interview-widget 3.2.14 → 3.2.15
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(be,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],o):(be=typeof globalThis<"u"?globalThis:be||self,o(be.InterviewWidget={},be.jsxRuntime,be.React,be.ReactDOM))})(this,function(be,o,d,Qs){"use strict";var f2=Object.defineProperty;var w2=(be,o,d)=>o in be?f2(be,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):be[o]=d;var ye=(be,o,d)=>w2(be,typeof o!="symbol"?o+"":o,d);var hn=typeof document<"u"?document.currentScript:null;const fn={},it={api:{baseUrl:"/api",retryConfig:{attempts:3,backoff:"exponential",baseDelay:1e3}},ui:{baseColor:"#3B82F6",borderRadius:"8px"},interview:{allow_answer_editing:!0,capture_screenshots:!1,timers:{thinkingDuration:30,answeringDuration:120,editingDuration:30},stt:{provider:"groq",model:"whisper-large-v3-turbo",language:"en"},tts:{provider:"piper"},proctoring:{enabled:!0,gazeAnalysisEnabled:!0}}},wn="iw-storage";function Cl(){if(!(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.tagName.toUpperCase()==="SCRIPT"&&hn.src||new URL("widget.umd.3.2.14.js",document.baseURI).href}<"u"&&(fn!=null&&fn.VITE_IW_SECRET)))return typeof process<"u"&&process.env.NEXT_PUBLIC_IW_SECRET?process.env.NEXT_PUBLIC_IW_SECRET:typeof window<"u"&&window.__IW_SECRET__?window.__IW_SECRET__:"proctoring-data-seed"}const Js=Cl(),hi=30,Tl={SCREENSHOT:"screenshot"},gn="AES-GCM",pn=12;async function Zs(e){const r=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",r);return crypto.subtle.importKey("raw",i,gn,!1,["encrypt","decrypt"])}function Nl(){return crypto.getRandomValues(new Uint8Array(pn))}async function Il(e,t="default-seed"){try{const r=typeof e=="string"?e:JSON.stringify(e),n=new TextEncoder().encode(r),s=await Zs(t),a=Nl(),c=await crypto.subtle.encrypt({name:gn,iv:a},s,n),l=new Uint8Array(a.length+c.byteLength);return l.set(new Uint8Array(a),0),l.set(new Uint8Array(c),a.length),btoa(String.fromCharCode(...Array.from(l)))}catch(r){throw console.error("Encryption failed:",r),new Error("Failed to encrypt data")}}async function Fl(e,t="default-seed"){try{const r=atob(e),i=new Uint8Array(r.length);for(let h=0;h<r.length;h++)i[h]=r.charCodeAt(h);const n=i.slice(0,pn),s=i.slice(pn),a=await Zs(t),c=await crypto.subtle.decrypt({name:gn,iv:n},a,s);return new TextDecoder().decode(c)}catch(r){throw console.error("Decryption failed:",r),new Error("Failed to decrypt data")}}async function Ll(e,t="default-seed"){return Il(e,t)}async function Ml(e,t="default-seed"){const r=await Fl(e,t);try{return JSON.parse(r)}catch{return r}}const Ur=d.createContext(null),Dl=async()=>{try{const e=sessionStorage.getItem(wn);if(e){const r=(await Ml(e,Js)).state;return{logViolations:(r==null?void 0:r.logViolations)||[],totalViolations:(r==null?void 0:r.totalViolations)||0,gazeViolationCounters:(r==null?void 0:r.gazeViolationCounters)||{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:(r==null?void 0:r.referenceSet)??!1,referenceRef:(r==null?void 0:r.referenceRef)??{x:.5,y:.5,noseX:.5,noseY:.5}}}}catch(e){console.error("Failed to load proctoring data from session storage:",e)}return{logViolations:[],totalViolations:0,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:!1,referenceRef:{x:.5,y:.5,noseX:.5,noseY:.5}}},Vr=async e=>{try{const t=await Ll({state:e,version:0},Js);sessionStorage.setItem(wn,t)}catch(t){console.error("Failed to save proctoring data to session storage:",t)}},Pl=({children:e})=>{const t=d.useRef({logViolations:[],totalViolations:0,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:!1,referenceRef:{x:.5,y:.5,noseX:.5,noseY:.5}}),r=d.useRef(new Set);d.useEffect(()=>{Dl().then(w=>{t.current=w,i()})},[]);const i=d.useCallback(()=>{r.current.forEach(w=>w())},[]),n=d.useCallback(w=>(r.current.add(w),()=>{r.current.delete(w)}),[]),s=d.useCallback(()=>t.current,[]),a=d.useCallback(w=>{t.current={...t.current,logViolations:[...t.current.logViolations,w],totalViolations:t.current.totalViolations+1},Vr(t.current),i()},[i]),c=d.useCallback(w=>{const g={...t.current.gazeViolationCounters};w==="looking_away"&&(g.lookingAwayCount+=1),w==="no_face_detected"&&(g.noFaceDetectedCount+=1),w==="multiple_faces"&&(g.multipleFacesCount+=1),g.totalGazeViolations=g.lookingAwayCount+g.noFaceDetectedCount+g.multipleFacesCount,t.current={...t.current,gazeViolationCounters:g},Vr(t.current),i()},[i]),l=d.useCallback(()=>{t.current={...t.current,logViolations:[],totalViolations:0},Vr(t.current),i()},[i]),h=d.useCallback(()=>{t.current={...t.current,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0}},Vr(t.current),i()},[i]),u=d.useCallback((w,g)=>{t.current={...t.current,referenceSet:w,referenceRef:g},Vr(t.current),i()},[i]),f=d.useMemo(()=>({getState:s,addViolation:a,clearViolations:l,subscribe:n,incrementGazeViolation:c,clearGazeViolationCounters:h,setReferenceData:u}),[s,a,l,n,c,h,u]);return o.jsx(Ur.Provider,{value:f,children:e})},Rs=()=>{const e=d.useContext(Ur);if(!e)throw new Error("useProctoringStore must be used within a ProctoringProvider");const t=d.useSyncExternalStore(e.subscribe,e.getState,e.getState);return{logViolations:t.logViolations,totalViolations:t.totalViolations,addViolation:e.addViolation,clearViolations:e.clearViolations,gazeViolationCounters:t.gazeViolationCounters,referenceSet:t.referenceSet,referenceRef:t.referenceRef,incrementGazeViolation:e.incrementGazeViolation,clearGazeViolationCounters:e.clearGazeViolationCounters,setReferenceData:e.setReferenceData}},Ol=()=>{const e=d.useContext(Ur);if(!e)throw new Error("useViolations must be used within a ProctoringProvider");return d.useSyncExternalStore(e.subscribe,()=>e.getState().logViolations,()=>e.getState().logViolations)},Bl=()=>{const e=d.useContext(Ur);if(!e)throw new Error("useTotalViolations must be used within a ProctoringProvider");return d.useSyncExternalStore(e.subscribe,()=>e.getState().totalViolations,()=>e.getState().totalViolations)},Ul=()=>{const e=d.useContext(Ur);if(!e)throw new Error("useProctoringActions must be used within a ProctoringProvider");return{addViolation:e.addViolation,clearViolations:e.clearViolations}},eo=d.createContext(null);function to({config:e={},children:t}){var i,n,s,a;const r={api:{...it.api,...e.api,retryConfig:{...it.api.retryConfig,...(i=e.api)==null?void 0:i.retryConfig}},ui:{...it.ui,...e.ui},interview:{...it.interview,...e.interview,timers:{...it.interview.timers,...(n=e.interview)==null?void 0:n.timers},stt:{...it.interview.stt,...(s=e.interview)==null?void 0:s.stt},tts:{...it.interview.tts,...(a=e.interview)==null?void 0:a.tts}}};return o.jsx(eo.Provider,{value:r,children:o.jsx(Pl,{children:t})})}function fi(){const e=d.useContext(eo);if(!e)throw new Error("useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>");return e}function ro(){return fi().api||it.api}function Zt(){return fi().ui||it.ui}function mn(){return fi().interview||it.interview}function Vl(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function Gl(e,t,r){return"#"+[e,t,r].map(i=>{const n=Math.round(i).toString(16);return n.length===1?"0"+n:n}).join("")}function jl(e,t){const r=Vl(e);if(!r)return e;const i=r.r+(255-r.r)*t,n=r.g+(255-r.g)*t,s=r.b+(255-r.b)*t;return Gl(i,n,s)}function $l(e){return new Promise(t=>setTimeout(t,e))}function zl(e){return`linear-gradient(to left, ${jl(e,.4)}, ${e})`}const Wl=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);function Hl(e){try{const t=e.split(".");if(t.length!==3||!t[1])throw new Error("Invalid JWT token");const i=t[1].replace(/-/g,"+").replace(/_/g,"/"),n=i.padEnd(i.length+(4-i.length%4)%4,"="),s=atob(n);return JSON.parse(s)}catch(t){return console.error("Error decoding JWT:",t),null}}const ql=e=>{var t;return!e||typeof e!="string"?"":(t=e.charAt(0))==null?void 0:t.toUpperCase()},yn=(e,t)=>{const r=Math.max(0,Math.floor(e));if(t&&r<60)return`${r}`;const i=Math.floor(r/60).toString().padStart(2,"0"),n=(r%60).toString().padStart(2,"0");return`${i}:${n}`},bn=({brandLogo:e,brandName:t,className:r="",showFallbackStyles:i=!0})=>{const{baseColor:n}=Zt();return e?o.jsx("div",{className:r,children:e}):o.jsx("div",{className:i?`iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold ${r}`:r,style:i?{backgroundColor:n}:{},children:ql(t)})},Kl=e=>{const t=d.useRef(null),r=d.useRef(null),[i,n]=d.useState(!1),[s,a]=d.useState(!1),[c,l]=d.useState(null),[h,u]=d.useState([]),[f,w]=d.useState([]),[g,p]=d.useState(""),[y,m]=d.useState(""),[b,v]=d.useState(!1),A=d.useCallback(()=>{r.current&&(r.current.getTracks().forEach(N=>N.stop()),r.current=null,l(null))},[]),E=d.useCallback(async()=>{var N,L,B,H;try{const j=await navigator.mediaDevices.enumerateDevices(),q=j.filter(D=>D.kind==="audioinput"),O=j.filter(D=>D.kind==="videoinput");if(u(q),w(O),!g&&q.length>0){const D=(N=r.current)==null?void 0:N.getAudioTracks()[0],Q=D==null?void 0:D.getSettings().deviceId;p(Q||((L=q[0])==null?void 0:L.deviceId)||"")}if(!y&&O.length>0){const D=(B=r.current)==null?void 0:B.getVideoTracks()[0],Q=D==null?void 0:D.getSettings().deviceId;m(Q||((H=O[0])==null?void 0:H.deviceId)||"")}}catch(j){console.error("Error enumerating devices:",j)}},[g,y]),T=d.useCallback(async(N,L)=>{const B={width:{ideal:1280},height:{ideal:720},...L?{deviceId:{exact:L}}:{facingMode:"user"}},H={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,sampleRate:{ideal:16e3},channelCount:{ideal:1},...N?{deviceId:{exact:N}}:{}};let j=null;try{j=await navigator.mediaDevices.getUserMedia({video:B,audio:H}),n(!0),a(!0)}catch(q){console.warn("Combined media request failed, trying individual.",q);try{const O=await navigator.mediaDevices.getUserMedia({audio:H});n(!0),j=O}catch(O){console.error("Audio permission denied",O),n(!1)}try{const O=await navigator.mediaDevices.getUserMedia({video:B});a(!0),j?O.getTracks().forEach(D=>j.addTrack(D)):j=O}catch(O){console.error("Video permission denied",O),a(!1)}}j?(r.current=j,l(j),t.current&&(t.current.srcObject=j,await t.current.play().catch(q=>console.error("Error playing video element",q)))):(r.current=null,l(null)),await E()},[E]),_=async N=>{N!==g&&(v(!0),p(N),A(),await T(N,y),v(!1))},P=async N=>{N!==y&&(v(!0),m(N),A(),await T(g,N),v(!1))};return d.useEffect(()=>{if(!e){A();return}return T(),()=>A()},[e]),{videoRef:t,audioAllowed:i,videoAllowed:s,audioDevices:h,videoDevices:f,selectedAudioDeviceId:g,selectedVideoDeviceId:y,isDeviceLoading:b,currentStream:c,handleAudioChange:_,handleVideoChange:P,stopStream:A}},wi=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),o.jsx("path",{d:"M12 9v4"}),o.jsx("path",{d:"M12 17h.01"})]}),Yl=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-bolt-icon prefix__lucide-bolt",...e,children:[o.jsx("path",{d:"M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z"}),o.jsx("circle",{cx:12,cy:12,r:4})]}),Xl=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-camera-off-icon prefix__lucide-camera-off",...e,children:[o.jsx("path",{d:"M14.564 14.558a3 3 0 11-4.122-4.121M2 2l20 20"}),o.jsx("path",{d:"M20 20H4a2 2 0 01-2-2V9a2 2 0 012-2h1.997a2 2 0 00.819-.175M9.695 4.024A2 2 0 0110.004 4h3.993a2 2 0 011.76 1.05l.486.9A2 2 0 0018.003 7H20a2 2 0 012 2v7.344"})]}),gi=e=>o.jsx("svg",{width:"10",height:"9",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M0.75 5.5C0.75 5.5 2.35 6.4125 3.15 7.75C3.15 7.75 5.55 2.5 8.75 0.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ql=({className:e})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:o.jsx("path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),io=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"M12 2a10 10 0 0 1 7.38 16.75"}),o.jsx("path",{d:"M12 6v6l4 2"}),o.jsx("path",{d:"M2.5 8.875a10 10 0 0 0-.5 3"}),o.jsx("path",{d:"M2.83 16a10 10 0 0 0 2.43 3.4"}),o.jsx("path",{d:"M4.636 5.235a10 10 0 0 1 .891-.857"}),o.jsx("path",{d:"M8.644 21.42a10 10 0 0 0 7.631-.38"})]}),pi=e=>o.jsx("svg",{className:"iw-w-5 iw-h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),Jl=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),o.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Zl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M2.66797 2H13.3346",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M3.66797 2V3.35359C3.66797 4.18151 4.05252 4.96247 4.70874 5.46726L8.0013 8L11.2938 5.46726C11.9501 4.96247 12.3346 4.18151 12.3346 3.35359V2",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M3.66797 14V12.6464C3.66797 11.8185 4.05252 11.0375 4.70874 10.5327L8.0013 8L11.2938 10.5327C11.9501 11.0375 12.3346 11.8185 12.3346 12.6464V14",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M2.66797 14H13.3346",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"})]}),no=({className:e,...t})=>o.jsx("div",{children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`iw-animate-spin ${e}`,...t,children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M12 6l0 -3"}),o.jsx("path",{d:"M16.25 7.75l2.15 -2.15"}),o.jsx("path",{d:"M18 12l3 0"}),o.jsx("path",{d:"M16.25 16.25l2.15 2.15"}),o.jsx("path",{d:"M12 18l0 3"}),o.jsx("path",{d:"M7.75 16.25l-2.15 2.15"}),o.jsx("path",{d:"M6 12l-3 0"}),o.jsx("path",{d:"M7.75 7.75l-2.15 -2.15"})]})}),Rl=e=>o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M17 7V11C17 13.7614 14.7614 16 12 16C9.23858 16 7 13.7614 7 11V7C7 4.23858 9.23858 2 12 2C14.7614 2 17 4.23858 17 7Z",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M20 11C20 15.4183 16.4183 19 12 19M12 19C7.58172 19 4 15.4183 4 11M12 19V22M12 22H15M12 22H9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),so=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-target-icon prefix__lucide-target",...e,children:[o.jsx("circle",{cx:12,cy:12,r:10}),o.jsx("circle",{cx:12,cy:12,r:6}),o.jsx("circle",{cx:12,cy:12,r:2})]}),ed=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-users-icon prefix__lucide-users",...e,children:[o.jsx("path",{d:"M16 21v-2a4 4 0 00-4-4H6a4 4 0 00-4 4v2M16 3.128a4 4 0 010 7.744M22 21v-2a4 4 0 00-3-3.87"}),o.jsx("circle",{cx:9,cy:7,r:4})]}),td=e=>o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M11 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),o.jsx("path",{d:"M2 11C2 7.70017 2 6.05025 3.02513 5.02513C4.05025 4 5.70017 4 9 4H10C13.2998 4 14.9497 4 15.9749 5.02513C17 6.05025 17 7.70017 17 11V13C17 16.2998 17 17.9497 15.9749 18.9749C14.9497 20 13.2998 20 10 20H9C5.70017 20 4.05025 20 3.02513 18.9749C2 17.9497 2 16.2998 2 13V11Z",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M17 8.90585L17.1259 8.80196C19.2417 7.05623 20.2996 6.18336 21.1498 6.60482C22 7.02628 22 8.42355 22 11.2181V12.7819C22 15.5765 22 16.9737 21.1498 17.3952C20.2996 17.8166 19.2417 16.9438 17.1259 15.198L17 15.0941",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),rd=e=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M8.16651 8.63991V5.35747C8.16651 3.52277 8.16651 2.60542 7.62675 2.37712C7.08699 2.14882 6.45168 2.79749 5.18119 4.09482C4.52323 4.76666 4.14784 4.91543 3.2117 4.91543C2.39301 4.91543 1.98366 4.91543 1.68961 5.11606C1.07921 5.53252 1.17148 6.34653 1.17148 6.9987C1.17148 7.65086 1.07921 8.46485 1.68961 8.88135C1.98366 9.08196 2.39301 9.08196 3.2117 9.08196C4.14784 9.08196 4.52323 9.23076 5.18119 9.90259C6.45168 11.1999 7.08699 11.8486 7.62675 11.6203C8.16651 11.392 8.16651 10.4746 8.16651 8.63991Z",stroke:"currentColor",strokeWidth:"0.875",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M9.9165 5.25C10.2813 5.72815 10.4998 6.33698 10.4998 7C10.4998 7.66302 10.2813 8.27184 9.9165 8.75",stroke:"currentColor",strokeWidth:"0.875",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M11.6665 4.08203C12.3961 4.87894 12.8332 5.89369 12.8332 6.9987C12.8332 8.10371 12.3961 9.11847 11.6665 9.91536",stroke:"currentColor",strokeWidth:"0.875",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ce={FACE_DETECTED:"face_detected",NO_FACE:"no_face_detected",MULTIPLE_FACES:"multiple_faces",LOOKING_AWAY:"looking_away",CAMERA_ERROR:"camera_error",MODEL_LOADING:"model_loading"},oo={[Ce.FACE_DETECTED]:{icon:Jl,iconColor:"iw-text-green-600",iconBg:"iw-bg-green-50",iconBorder:"iw-border-green-100",title:"All Good",subtitle:"Everything looks normal",description:"Your gaze is properly focused on the screen. Continue with your interview.",buttonText:"Continue"},[Ce.NO_FACE]:{icon:Xl,iconColor:"iw-text-orange-600",iconBg:"iw-bg-orange-50",iconBorder:"iw-border-orange-100",title:"Face Not Detected",subtitle:"We can't see you in the camera",description:"Please ensure you're positioned properly in front of the camera and that your face is clearly visible.",buttonText:"I Understood"},[Ce.MULTIPLE_FACES]:{icon:ed,iconColor:"iw-text-red-600",iconBg:"iw-bg-red-50",iconBorder:"iw-border-red-100",title:"Multiple People Detected",subtitle:"More than one person is visible on the screen.",buttonText:"I Understood"},[Ce.LOOKING_AWAY]:{icon:so,iconColor:"iw-text-amber-600",iconBg:"iw-bg-amber-50",iconBorder:"iw-border-amber-200/75",title:"Focus Alert",subtitle:"You looked away from the screen. Maintain focus to continue.",buttonText:"I Understood"},[Ce.CAMERA_ERROR]:{icon:wi,iconColor:"iw-text-red-600",iconBg:"iw-bg-red-50",iconBorder:"iw-border-red-100",title:"Camera Issue",subtitle:"There's a problem with your camera",description:"Please check your camera connection and permissions, contact support if the problem continues.",buttonText:"I Understood"},[Ce.MODEL_LOADING]:{icon:so,iconColor:"iw-text-blue-600",iconBg:"iw-bg-blue-50",iconBorder:"iw-border-blue-100",title:"Initializing Model",subtitle:"Please wait while we set up the AI",description:"The face detection model is being loaded. This should only take a moment.",buttonText:"Wait"}};function id(e){var t;if(!navigator.onLine)return{type:"network",message:"No internet connection",retryable:!0,userMessage:"Please check your internet connection and try again."};if(e.name==="AbortError"||(t=e.message)!=null&&t.includes("timeout"))return{type:"timeout",message:"Request timed out",retryable:!0,userMessage:"The request is taking longer than expected. Please try again."};if(e.status){const{status:r}=e;if(r===401||r===403)return{type:"auth",status:r,message:"Authentication failed",retryable:!1,userMessage:"Your session has expired. Please refresh the page."};if(r===429)return{type:"rate-limit",status:r,message:"Too many requests",retryable:!0,userMessage:"Please wait a moment before trying again."};if(r>=500)return{type:"server",status:r,message:`Server error: ${r}`,retryable:!0,userMessage:"Our servers are experiencing issues. Please try again in a few moments."};if(r>=400)return{type:"client",status:r,message:`Client error: ${r}`,retryable:!1,userMessage:"There was an issue with your request. Please check your input."}}return{type:"unknown",message:e.message||"Unknown error occurred",retryable:!0,userMessage:"Something unexpected happened. Please try again.",originalError:e}}async function xt(e,t={},r={attempts:3,backoff:"exponential",baseDelay:1e3,maxDelay:1e4,jitter:!0}){let i;for(let n=1;n<=r.attempts;n++)try{const s=new AbortController,a=setTimeout(()=>s.abort(),6e4),c=await fetch(e,{...t,signal:s.signal});if(clearTimeout(a),c.status>=400&&c.status<500&&c.status!==429)return c;if(!c.ok)throw new Error(`HTTP ${c.status}: ${c.statusText}`);return c}catch(s){i=s;const a=id(s);if(!a.retryable||n===r.attempts)throw a;const c=nd(n,r);console.warn(`API request failed (attempt ${n}/${r.attempts}), retrying in ${c}ms:`,a.message),await new Promise(l=>setTimeout(l,c))}throw i}function nd(e,t){let r;return t.backoff==="exponential"?r=t.baseDelay*Math.pow(2,e-1):r=t.baseDelay,r=Math.min(r,t.maxDelay),t.jitter&&(r=r*(.5+Math.random()*.5)),Math.round(r)}const Et={v2:"/v2"},_t={GENERATE_QUESTION:e=>`${Et.v2}/interviews/${e}/next-question`,SCREENSHOT_UPLOAD:e=>`${Et.v2}/interviews/${e}/assets/upload-url`,CONFIRM_UPLOAD:e=>`${Et.v2}/interviews/assets/${e}/confirm`,TRANSCRIBE_ANSWER:e=>`${Et.v2}/interviews/${e}/transcribe-answer`,SUBMIT_ANSWER:e=>`${Et.v2}/interviews/${e}/submit-answer`,EXIT:e=>`${Et.v2}/interviews/${e}/exit`,CONFIG:e=>`${Et.v2}/interviews/${e}/config`,TRANSCRIPTION:e=>`${Et.v2}/interviews/${e}/transcript`};class ao{constructor(t={}){ye(this,"config");this.config=t}updateConfig(t){this.config={...this.config,...t}}getHeaders(){var r;const t={"Content-Type":"application/json"};return(r=this.config)!=null&&r.authToken&&(t.Authorization=`Bearer ${this.config.authToken}`),t}getBaseUrl(){var t;return((t=this.config)==null?void 0:t.baseUrl)||"/api"}async generateQuestion({interviewId:t,isInterviewDone:r=!1}){const i=await xt(`${this.getBaseUrl()}${_t.GENERATE_QUESTION(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({interview_id:t,is_interview_done:r})});if(!i.ok)throw new Error(`Failed to get questions: ${i.status}`);return await i.json()}async submitAnswer({interviewId:t,qnaId:r,answer:i}){const n=await xt(`${this.getBaseUrl()}${_t.SUBMIT_ANSWER(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({qna_id:r,answer_text:i})});if(!n.ok)throw new Error(`Failed to submit answer: ${n.status}`);return await n.json()}async exitInterview(t){const r=await xt(`${this.getBaseUrl()}${_t.EXIT(t)}`,{method:"POST",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to exit interview: ${r.status}`)}async getInterviewConfig(t){const r=await xt(`${this.getBaseUrl()}${_t.CONFIG(t)}`,{method:"GET",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to get interview config: ${r.status}`);return await r.json()}async requestScreenshotUploadUrl(t,r=`screenshot-${Date.now()}.jpeg`){const i=await xt(`${this.getBaseUrl()}${_t.SCREENSHOT_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({filename:r,mime_type:"image/jpeg",asset_type:Tl.SCREENSHOT})});if(!i.ok)throw new Error(`Failed to request screenshot upload URL: ${i.status}`);return await i.json()}async uploadScreenshot(t,r){const i=await fetch(t,{method:"PUT",body:r,headers:{"Content-Type":"image/jpeg"}});if(!i.ok)throw new Error(`Failed to upload screenshot: ${i.status}`)}async confirmScreenshotUpload(t){const r=await xt(`${this.getBaseUrl()}${_t.CONFIRM_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to confirm screenshot upload: ${r.status}`)}async getInterviewTranscription(t){const r=await xt(`${this.getBaseUrl()}${_t.TRANSCRIPTION(t)}`,{method:"GET",headers:{...this.getHeaders()}});if(!r.ok)throw new Error(`Failed to get interview transcription: ${r.status}`);return await r.json()}}const mi=new ao,sd=({gazeAnalysisEnabled:e,isModelLoaded:t,stats:r,statusMessage:i,loadingProgress:n})=>o.jsx("div",{className:"iw-w-full",children:o.jsxs("div",{className:"iw-border-strock iw-rounded-md iw-border iw-bg-gray-50 iw-p-4",children:[o.jsxs("h3",{className:"iw-m-0 iw-mb-2.5",children:["Status: ",i]}),n>0&&n<100&&o.jsxs("div",{className:"iw-mb-2.5",children:[o.jsx("div",{className:"iw-h-2 iw-w-full iw-rounded iw-bg-gray-300",children:o.jsx("div",{className:"iw-h-full iw-rounded iw-bg-blue-600 iw-transition-all iw-duration-300 iw-ease-out",style:{width:`${n}%`}})}),o.jsxs("small",{className:"iw-text-gray-600",children:["Loading model... ",n.toFixed(1),"%"]})]}),o.jsxs("div",{className:"iw-grid iw-grid-cols-2 iw-gap-2.5 iw-text-sm",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"FPS:"})," ",o.jsx("span",{className:r.fps<15?"iw-text-red-600":r.fps<25?"iw-text-orange-500":"iw-text-green-600",children:r.fps})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Model:"})," ",t?"✓ Loaded":"✗ Loading"]}),e&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Engagement:"})," ",r.engagement.toFixed(1),"%"]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Looking:"})," ",o.jsx("span",{className:r.isLookingAway?"iw-text-red-600":"iw-text-green-600",children:r.isLookingAway?"Away":"At Screen"})]})]})]}),r.referenceFaceNotDetected&&o.jsxs("div",{className:"iw-text-gray-dark iw-mt-2.5 iw-w-full iw-rounded-md iw-bg-[#ffeb3b] iw-p-2.5 iw-text-sm",children:[o.jsx("strong",{children:"Reference Face Not Detected"}),o.jsx("br",{}),"The previously set reference face is no longer in view."]}),r.multipleFacesDetected&&o.jsxs("div",{className:"iw-mt-2.5 iw-rounded iw-bg-red-50 iw-p-2.5 iw-text-sm iw-text-red-700",children:[o.jsx("strong",{children:"Multiple Faces Detected"}),o.jsx("br",{}),"Please ensure only one person is in the frame."]}),!e&&o.jsxs("div",{className:"iw-mt-2.5 iw-rounded iw-bg-blue-50 iw-p-2.5 iw-text-sm iw-text-blue-700",children:[o.jsx("strong",{children:"Gaze Analysis Disabled"}),o.jsx("br",{}),"Enable to track engagement and attention levels."]})]})}),od=({showControls:e,isBubbleOpen:t,setIsBubbleOpen:r,setReference:i,clearCache:n,isModelLoaded:s,gazeAnalysisEnabled:a,referenceSet:c,showLandmarks:l,setShowLandmarks:h,showEngagementBar:u,setShowEngagementBar:f,handleToggleGazeAnalysis:w,stats:g,statusMessage:p,loadingProgress:y})=>e?o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>r(!t),className:"iw-absolute iw-right-4 iw-bottom-4 iw-z-10 iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-full iw-text-white",children:o.jsx(Yl,{className:"iw-size-4.5"})}),t&&o.jsxs("div",{className:"iw-absolute iw-right-4 iw-bottom-16 iw-z-10 iw-max-h-96 iw-w-80 iw-overflow-y-auto iw-rounded-md iw-bg-gray-50 iw-p-4 iw-shadow-lg",children:[o.jsx("h4",{className:"m-0 mb-2.5",children:"Controls"}),o.jsx("button",{onClick:i,disabled:!s||!a,className:`iw-mb-2.5 iw-block iw-w-full iw-rounded border-none iw-px-4 iw-py-2 iw-text-sm iw-text-white ${!s||!a?"iw-cursor-not-allowed iw-bg-gray-400":"iw-cursor-pointer iw-bg-blue-600 hover:iw-bg-blue-700"}`,children:c?"Reference Set ✓":"Set Reference"}),o.jsx("button",{onClick:n,className:"iw-mb-4 iw-block iw-w-full iw-cursor-pointer iw-rounded iw-border-none iw-bg-red-600 iw-px-4 iw-py-2 iw-text-sm iw-text-white hover:iw-bg-red-700",children:"Clear Model Cache"}),o.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-2.5",children:[o.jsxs("label",{className:"iw-flex iw-cursor-pointer iw-items-center iw-gap-2",children:[o.jsx("input",{type:"checkbox",checked:a,onChange:m=>w(m.target.checked)}),o.jsx("strong",{children:"Enable Gaze Analysis"})]}),o.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${a?"iw-opacity-100":"iw-opacity-60"}`,children:[o.jsx("input",{type:"checkbox",checked:l,onChange:m=>h(m.target.checked),disabled:!a}),"Show Landmarks"]}),o.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${a?"iw-opacity-100":"iw-opacity-60"}`,children:[o.jsx("input",{type:"checkbox",checked:u,onChange:m=>f(m.target.checked),disabled:!a}),"Show Engagement Bar"]})]}),c&&o.jsx(sd,{gazeAnalysisEnabled:a,isModelLoaded:s,loadingProgress:y,stats:g,statusMessage:p})]})]}):null;var Rt=typeof self<"u"?self:{};function Gr(e,t){e:{for(var r=["CLOSURE_FLAGS"],i=Rt,n=0;n<r.length;n++)if((i=i[r[n]])==null){r=null;break e}r=i}return(e=r&&r[e])!=null?e:t}function Ot(){throw Error("Invalid UTF8")}function co(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let yi,vn;const ad=typeof TextDecoder<"u";let cd;const ld=typeof TextEncoder<"u";function lo(e){if(ld)e=(cd||(cd=new TextEncoder)).encode(e);else{let r=0;const i=new Uint8Array(3*e.length);for(let n=0;n<e.length;n++){var t=e.charCodeAt(n);if(t<128)i[r++]=t;else{if(t<2048)i[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&n<e.length){const s=e.charCodeAt(++n);if(s>=56320&&s<=57343){t=1024*(t-55296)+s-56320+65536,i[r++]=t>>18|240,i[r++]=t>>12&63|128,i[r++]=t>>6&63|128,i[r++]=63&t|128;continue}n--}t=65533}i[r++]=t>>12|224,i[r++]=t>>6&63|128}i[r++]=63&t|128}}e=r===i.length?i:i.subarray(0,r)}return e}function uo(e){Rt.setTimeout(()=>{throw e},0)}var xn,dd=Gr(610401301,!1),ho=Gr(748402147,!0),En=Gr(824648567,!0),_n=Gr(824656860,Gr(1,!0));function fo(){var e=Rt.navigator;return e&&(e=e.userAgent)?e:""}const wo=Rt.navigator;function bi(e){return bi[" "](e),e}xn=wo&&wo.userAgentData||null,bi[" "]=function(){};const go={};let jr=null;function ud(e){const t=e.length;let r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);const i=new Uint8Array(r);let n=0;return function(s,a){function c(h){for(;l<s.length;){const u=s.charAt(l++),f=jr[u];if(f!=null)return f;if(!/^[\s\xa0]*$/.test(u))throw Error("Unknown base64 encoding at char: "+u)}return h}po();let l=0;for(;;){const h=c(-1),u=c(0),f=c(64),w=c(64);if(w===64&&h===-1)break;a(h<<2|u>>4),f!=64&&(a(u<<4&240|f>>2),w!=64&&a(f<<6&192|w))}}(e,function(s){i[n++]=s}),n!==r?i.subarray(0,n):i}function po(){if(!jr){jr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const i=e.concat(t[r].split(""));go[r]=i;for(let n=0;n<i.length;n++){const s=i[n];jr[s]===void 0&&(jr[s]=n)}}}}var hd=typeof Uint8Array<"u",mo=!(!(dd&&xn&&xn.brands.length>0)&&(fo().indexOf("Trident")!=-1||fo().indexOf("MSIE")!=-1))&&typeof btoa=="function";const yo=/[-_.]/g,fd={"-":"+",_:"/",".":"="};function wd(e){return fd[e]||""}function bo(e){if(!mo)return ud(e);e=yo.test(e)?e.replace(yo,wd):e,e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function kn(e){return hd&&e!=null&&e instanceof Uint8Array}var er={};function Bt(){return gd||(gd=new nt(null,er))}function Sn(e){vo(er);var t=e.g;return(t=t==null||kn(t)?t:typeof t=="string"?bo(t):null)==null?t:e.g=t}var nt=class{h(){return new Uint8Array(Sn(this)||0)}constructor(e,t){if(vo(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let gd,pd;function vo(e){if(e!==er)throw Error("illegal external caller")}function xo(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function An(e){return xo(e=Error(e),"warning"),e}function tr(e,t){if(e!=null){var r=pd??(pd={}),i=r[e]||0;i>=t||(r[e]=i+1,xo(e=Error(),"incident"),uo(e))}}function rr(){return typeof BigInt=="function"}var ir=typeof Symbol=="function"&&typeof Symbol()=="symbol";function st(e,t,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var md=st("jas",void 0,!0),Eo=st(void 0,"0di"),$r=st(void 0,"1oa"),Ie=st(void 0,Symbol()),yd=st(void 0,"0ub"),bd=st(void 0,"0ubs"),Cn=st(void 0,"0ubsb"),vd=st(void 0,"0actk"),nr=st("m_m","Pa",!0),_o=st();const ko={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},So=Object.defineProperties,k=ir?md:"Ga";var Ut;const Ao=[];function zr(e,t){ir||k in e||So(e,ko),e[k]|=t}function de(e,t){ir||k in e||So(e,ko),e[k]=t}function Wr(e){return zr(e,34),e}function Hr(e){return zr(e,8192),e}de(Ao,7),Ut=Object.freeze(Ao);var sr={};function Fe(e,t){return t===void 0?e.h!==Vt&&!!(2&(0|e.v[k])):!!(2&t)&&e.h!==Vt}const Vt={};function Tn(e,t){if(e!=null){if(typeof e=="string")e=e?new nt(e,er):Bt();else if(e.constructor!==nt)if(kn(e))e=e.length?new nt(new Uint8Array(e),er):Bt();else{if(!t)throw Error();e=void 0}}return e}class Co{constructor(t,r,i){this.g=t,this.h=r,this.l=i}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var xd=Object.freeze({});function To(e,t,r){const i=128&t?0:-1,n=e.length;var s;(s=!!n)&&(s=(s=e[n-1])!=null&&typeof s=="object"&&s.constructor===Object);const a=n+(s?-1:0);for(t=128&t?1:0;t<a;t++)r(t-i,e[t]);if(s){e=e[n-1];for(const c in e)!isNaN(c)&&r(+c,e[c])}}var No={};function or(e){return 128&e?No:void 0}function vi(e){return e.Na=!0,e}var Ed=vi(e=>typeof e=="number"),Io=vi(e=>typeof e=="string"),_d=vi(e=>typeof e=="boolean"),xi=typeof Rt.BigInt=="function"&&typeof Rt.BigInt(0)=="bigint";function Le(e){var t=e;if(Io(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(Ed(t)&&!Number.isSafeInteger(t))throw Error(String(t));return xi?BigInt(e):e=_d(e)?e?"1":"0":Io(e)?e.trim()||"0":String(e)}var Nn=vi(e=>xi?e>=Sd&&e<=Cd:e[0]==="-"?Fo(e,kd):Fo(e,Ad));const kd=Number.MIN_SAFE_INTEGER.toString(),Sd=xi?BigInt(Number.MIN_SAFE_INTEGER):void 0,Ad=Number.MAX_SAFE_INTEGER.toString(),Cd=xi?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Fo(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){const i=e[r],n=t[r];if(i>n)return!1;if(i<n)return!0}}const Td=typeof Uint8Array.prototype.slice=="function";let Nd,ee=0,ae=0;function Lo(e){const t=e>>>0;ee=t,ae=(e-t)/4294967296>>>0}function ar(e){if(e<0){Lo(-e);const[t,r]=Dn(ee,ae);ee=t>>>0,ae=r>>>0}else Lo(e)}function In(e){const t=Nd||(Nd=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),ae=0,ee=t.getUint32(0,!0)}function Fn(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:qr(e,t)}function Id(e,t){return Le(rr()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):qr(e,t))}function Ln(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Fn(e,t))=="number"?r?-e:e:r?"-"+e:e}function Mo(e,t){return rr()?Le(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):Le(Mn(e,t))}function qr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else rr()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+Do(r)+Do(e));return r}function Do(e){return e=String(e),"0000000".slice(e.length)+e}function Mn(e,t){if(2147483648&t)if(rr())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,i]=Dn(e,t);e="-"+qr(r,i)}else e=qr(e,t);return e}function Ei(e){if(e.length<16)ar(Number(e));else if(rr())e=BigInt(e),ee=Number(e&BigInt(4294967295))>>>0,ae=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");ae=ee=0;const r=e.length;for(let i=t,n=(r-t)%6+t;n<=r;i=n,n+=6){const s=Number(e.slice(i,n));ae*=1e6,ee=1e6*ee+s,ee>=4294967296&&(ae+=Math.trunc(ee/4294967296),ae>>>=0,ee>>>=0)}if(t){const[i,n]=Dn(ee,ae);ee=i,ae=n}}}function Dn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Ze(e){return Array.prototype.slice.call(e)}const Kr=typeof BigInt=="function"?BigInt.asIntN:void 0,Fd=typeof BigInt=="function"?BigInt.asUintN:void 0,Gt=Number.isSafeInteger,_i=Number.isFinite,cr=Math.trunc,Ld=Le(0);function Yr(e){if(e!=null&&typeof e!="number")throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);return e}function ot(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Xr(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}function Po(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Md=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Qr(e){switch(typeof e){case"bigint":return!0;case"number":return _i(e);case"string":return Md.test(e);default:return!1}}function lr(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return _i(e)?0|e:void 0}function Oo(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return _i(e)?e>>>0:void 0}function Bo(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(Ei(e),Mn(ee,ae))}function Pn(e){return e=cr(e),Gt(e)||(ar(e),e=Ln(ee,ae)),e}function Uo(e){var t=cr(Number(e));return Gt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Bo(e))}function Vo(e){var t=cr(Number(e));return Gt(t)?Le(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),rr()?Le(Kr(64,BigInt(e))):Le(Bo(e)))}function Go(e){return Gt(e)?e=Le(Pn(e)):(e=cr(e),Gt(e)?e=String(e):(ar(e),e=Mn(ee,ae)),e=Le(e)),e}function Dd(e){return e==null?e:typeof e=="bigint"?(Nn(e)?e=Number(e):(e=Kr(64,e),e=Nn(e)?Number(e):String(e)),e):Qr(e)?typeof e=="number"?Pn(e):Uo(e):void 0}function ki(e){const t=typeof e;return e==null?e:t==="bigint"?Le(Kr(64,e)):Qr(e)?t==="string"?Vo(e):Go(e):void 0}function jo(e){if(typeof e!="string")throw Error();return e}function Jr(e){if(e!=null&&typeof e!="string")throw Error();return e}function ve(e){return e==null||typeof e=="string"?e:void 0}function On(e,t,r,i){return e!=null&&e[nr]===sr?e:Array.isArray(e)?((i=(r=0|e[k])|32&i|2&i)!==r&&de(e,i),new t(e)):(r?2&i?((e=t[Eo])||(Wr((e=new t).v),e=t[Eo]=e),t=e):t=new t:t=void 0,t)}function Pd(e,t,r){if(t)e:{if(!Qr(t=e))throw An("int64");switch(typeof t){case"string":t=Vo(t);break e;case"bigint":t=Le(Kr(64,t));break e;default:t=Go(t)}}else t=ki(e);return(e=t)==null?r?Ld:void 0:e}const Od={};let Bd=function(){try{return bi(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class Bn{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}}const Ud=Bd?(Object.setPrototypeOf(Bn.prototype,Map.prototype),Object.defineProperties(Bn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Bn):class extends Map{constructor(){super()}};function $o(e){return e}function Un(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var gt=class extends Ud{constructor(e,t,r=$o,i=$o){super(),this.J=0|e[k],this.K=t,this.S=r,this.fa=this.K?Vd:i;for(let n=0;n<e.length;n++){const s=e[n],a=r(s[0],!1,!0);let c=s[1];t?c===void 0&&(c=null):c=i(s[1],!1,!0,void 0,void 0,this.J),super.set(a,c)}}V(e){return Hr(Array.from(super.entries(),e))}clear(){Un(this),super.clear()}delete(e){return Un(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new Co(e,Gd,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new Co(e,gt.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach((r,i,n)=>{e.call(t,n.get(i),i,n)}):super.forEach(e,t)}set(e,t){return Un(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.fa(t,!0,!0,this.K,!1,this.J))}Ma(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var r=this.K;return r?((r=this.fa(t,!1,!0,r,this.ra,this.J))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function Vd(e,t,r,i,n,s){return e=On(e,i,r,s),n&&(e=jn(e)),e}function Gd(e){return[e,this.get(e)]}let jd;function zo(){return jd||(jd=new gt(Wr([]),void 0,void 0,void 0,Od))}function Si(e){return Ie?e[Ie]:void 0}function Ai(e,t){for(const r in e)!isNaN(r)&&t(e,+r,e[r])}gt.prototype.toJSON=void 0;var Vn=class{};const $d={Ka:!0};function zd(e,t){t<100||tr(bd,1)}function Ci(e,t,r,i){const n=i!==void 0;i=!!i;var s,a=Ie;!n&&ir&&a&&(s=e[a])&&Ai(s,zd),a=[];var c=e.length;let l;s=4294967295;let h=!1;const u=!!(64&t),f=u?128&t?0:-1:void 0;1&t||(l=c&&e[c-1],l!=null&&typeof l=="object"&&l.constructor===Object?s=--c:l=void 0,!u||128&t||n||(h=!0,s=s-f+f)),t=void 0;for(var w=0;w<c;w++){let g=e[w];if(g!=null&&(g=r(g,i))!=null)if(u&&w>=s){const p=w-f;(t??(t={}))[p]=g}else a[w]=g}if(l)for(let g in l){if((c=l[g])==null||(c=r(c,i))==null)continue;let p;w=+g,u&&!Number.isNaN(w)&&(p=w+f)<s?a[p]=c:(t??(t={}))[g]=c}return t&&(h?a.push(t):a[s]=t),n&&Ie&&(e=Si(e))&&e instanceof Vn&&(a[Ie]=function(g){const p=new Vn;return Ai(g,(y,m,b)=>{p[m]=Ze(b)}),p.da=g.da,p}(e)),a}function Wd(e){return e[0]=Zr(e[0]),e[1]=Zr(e[1]),e}function Zr(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Nn(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[k];return e.length===0&&1&t?void 0:Ci(e,t,Zr)}if(e!=null&&e[nr]===sr)return Wo(e);if(e instanceof nt){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(mo){for(var r="",i=0,n=t.length-10240;i<n;)r+=String.fromCharCode.apply(null,t.subarray(i,i+=10240));r+=String.fromCharCode.apply(null,i?t.subarray(i):t),t=btoa(r)}else{r===void 0&&(r=0),po(),r=go[r],i=Array(Math.floor(t.length/3)),n=r[64]||"";let h=0,u=0;for(;h<t.length-2;h+=3){var s=t[h],a=t[h+1],c=t[h+2],l=r[s>>2];s=r[(3&s)<<4|a>>4],a=r[(15&a)<<2|c>>6],c=r[63&c],i[u++]=l+s+a+c}switch(l=0,c=n,t.length-h){case 2:c=r[(15&(l=t[h+1]))<<2]||n;case 1:t=t[h],i[u]=r[t>>2]+r[(3&t)<<4|l>>4]+c+n}t=i.join("")}e=e.g=t}return e}return e instanceof gt?e=e.size!==0?e.V(Wd):void 0:void 0}return e}function Wo(e){return Ci(e=e.v,0|e[k],Zr)}let Hd,qd;function jt(e,t){return Ho(e,t[0],t[1])}function Ho(e,t,r,i=0){if(e==null){var n=32;r?(e=[r],n|=128):e=[],t&&(n=-16760833&n|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(n=0|e[k],ho&&1&n)throw Error("rfarr");if(2048&n&&!(2&n)&&function(){if(ho)throw Error("carr");tr(vd,5)}(),256&n)throw Error("farr");if(64&n)return(n|i)!==n&&de(e,n|i),e;if(r&&(n|=128,r!==e[0]))throw Error("mid");e:{n|=64;var s=(r=e).length;if(s){var a=s-1;const l=r[a];if(l!=null&&typeof l=="object"&&l.constructor===Object){if((a-=t=128&n?0:-1)>=1024)throw Error("pvtlmt");for(var c in l)(s=+c)<a&&(r[s+t]=l[c],delete l[c]);n=-16760833&n|(1023&a)<<14;break e}}if(t){if((c=Math.max(t,s-(128&n?0:-1)))>1024)throw Error("spvt");n=-16760833&n|(1023&c)<<14}}}return de(e,64|n|i),e}function Kd(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var r=0|e[k];return e.length===0&&1&r?void 0:qo(e,r,t)}if(e!=null&&e[nr]===sr)return Ko(e);if(e instanceof gt){if(2&(t=e.J))return e;if(!e.size)return;if(r=Wr(e.V()),e.K)for(e=0;e<r.length;e++){const i=r[e];let n=i[1];n=n==null||typeof n!="object"?void 0:n!=null&&n[nr]===sr?Ko(n):Array.isArray(n)?qo(n,0|n[k],!!(32&t)):void 0,i[1]=n}return r}return e instanceof nt?e:void 0}function qo(e,t,r){return 2&t||(!r||4096&t||16&t?e=dr(e,t,!1,r&&!(16&t)):(zr(e,34),4&t&&Object.freeze(e))),e}function Gn(e,t,r){return e=new e.constructor(t),r&&(e.h=Vt),e.m=Vt,e}function Ko(e){const t=e.v,r=0|t[k];return Fe(e,r)?e:$n(e,t,r)?Gn(e,t):dr(t,r)}function dr(e,t,r,i){return i??(i=!!(34&t)),e=Ci(e,t,Kd,i),i=32,r&&(i|=2),de(e,t=16769217&t|i),e}function jn(e){const t=e.v,r=0|t[k];return Fe(e,r)?$n(e,t,r)?Gn(e,t,!0):new e.constructor(dr(t,r,!1)):e}function ur(e){if(e.h!==Vt)return!1;var t=e.v;return zr(t=dr(t,0|t[k]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function hr(e){if(!ur(e)&&Fe(e,0|e.v[k]))throw Error()}function $t(e,t){t===void 0&&(t=0|e[k]),32&t&&!(4096&t)&&de(e,4096|t)}function $n(e,t,r){return!!(2&r)||!(!(32&r)||4096&r)&&(de(t,2|r),e.h=Vt,!0)}const Yd=Le(0),kt={};function J(e,t,r,i,n){if((t=pt(e.v,t,r,n))!==null||i&&e.m!==Vt)return t}function pt(e,t,r,i){if(t===-1)return null;const n=t+(r?0:-1),s=e.length-1;let a,c;if(!(s<1+(r?0:-1))){if(n>=s)if(a=e[s],a!=null&&typeof a=="object"&&a.constructor===Object)r=a[t],c=!0;else{if(n!==s)return;r=a}else r=e[n];if(i&&r!=null){if((i=i(r))==null)return i;if(!Object.is(i,r))return c?a[t]=i:e[n]=i,i}return r}}function K(e,t,r,i){hr(e),ue(e=e.v,0|e[k],t,r,i)}function ue(e,t,r,i,n){const s=r+(n?0:-1);var a=e.length-1;if(a>=1+(n?0:-1)&&s>=a){const c=e[a];if(c!=null&&typeof c=="object"&&c.constructor===Object)return c[r]=i,t}return s<=a?(e[s]=i,t):(i!==void 0&&(r>=(a=(t??(t=0|e[k]))>>14&1023||536870912)?i!=null&&(e[a+(n?0:-1)]={[r]:i}):e[s]=i),t)}function zt(){return xd===void 0?2:4}function Wt(e,t,r,i,n){let s=e.v,a=0|s[k];i=Fe(e,a)?1:i,n=!!n||i===3,i===2&&ur(e)&&(s=e.v,a=0|s[k]);let c=(e=zn(s,t))===Ut?7:0|e[k],l=Wn(c,a);var h=!(4&l);if(h){4&l&&(e=Ze(e),c=0,l=qt(l,a),a=ue(s,a,t,e));let u=0,f=0;for(;u<e.length;u++){const w=r(e[u]);w!=null&&(e[f++]=w)}f<u&&(e.length=f),r=-513&(4|l),l=r&=-1025,l&=-4097}return l!==c&&(de(e,l),2&l&&Object.freeze(e)),Yo(e,l,s,a,t,i,h,n)}function Yo(e,t,r,i,n,s,a,c){let l=t;return s===1||s===4&&(2&t||!(16&t)&&32&i)?Ht(t)||((t|=!e.length||a&&!(4096&t)||32&i&&!(4096&t||16&t)?2:256)!==l&&de(e,t),Object.freeze(e)):(s===2&&Ht(t)&&(e=Ze(e),l=0,t=qt(t,i),i=ue(r,i,n,e)),Ht(t)||(c||(t|=16),t!==l&&de(e,t))),2&t||!(4096&t||16&t)||$t(r,i),e}function zn(e,t,r){return e=pt(e,t,r),Array.isArray(e)?e:Ut}function Wn(e,t){return 2&t&&(e|=2),1|e}function Ht(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function Xo(e){return Tn(e,!0)}function Qo(e){e=Ze(e);for(let t=0;t<e.length;t++){const r=e[t]=Ze(e[t]);Array.isArray(r[1])&&(r[1]=Wr(r[1]))}return Hr(e)}function St(e,t,r,i){hr(e),ue(e=e.v,0|e[k],t,(i==="0"?Number(r)===0:r===i)?void 0:r)}function fr(e,t,r){if(2&t)throw Error();const i=or(t);let n=zn(e,r,i),s=n===Ut?7:0|n[k],a=Wn(s,t);return(2&a||Ht(a)||16&a)&&(a===s||Ht(a)||de(n,a),n=Ze(n),s=0,a=qt(a,t),ue(e,t,r,n,i)),a&=-13,a!==s&&de(n,a),n}function Hn(e,t){var r=rc;return Kn(qn(e=e.v),e,void 0,r)===t?t:-1}function qn(e){if(ir)return e[$r]??(e[$r]=new Map);if($r in e)return e[$r];const t=new Map;return Object.defineProperty(e,$r,{value:t}),t}function Jo(e,t,r,i,n){const s=qn(e),a=Kn(s,e,t,r,n);return a!==i&&(a&&(t=ue(e,t,a,void 0,n)),s.set(r,i)),t}function Kn(e,t,r,i,n){let s=e.get(i);if(s!=null)return s;s=0;for(let a=0;a<i.length;a++){const c=i[a];pt(t,c,n)!=null&&(s!==0&&(r=ue(t,r,s,void 0,n)),s=c)}return e.set(i,s),s}function Yn(e,t,r){let i=0|e[k];const n=or(i),s=pt(e,r,n);let a;if(s!=null&&s[nr]===sr){if(!Fe(s))return ur(s),s.v;a=s.v}else Array.isArray(s)&&(a=s);if(a){const c=0|a[k];2&c&&(a=dr(a,c))}return a=jt(a,t),a!==s&&ue(e,i,r,a,n),a}function Zo(e,t,r,i,n){let s=!1;if((i=pt(e,i,n,a=>{const c=On(a,r,!1,t);return s=c!==a&&c!=null,c}))!=null)return s&&!Fe(i)&&$t(e,t),i}function $(e,t,r,i){let n=e.v,s=0|n[k];if((t=Zo(n,s,t,r,i))==null)return t;if(s=0|n[k],!Fe(e,s)){const a=jn(t);a!==t&&(ur(e)&&(n=e.v,s=0|n[k]),s=ue(n,s,r,t=a,i),$t(n,s))}return t}function Ro(e,t,r,i,n,s,a,c){var l=Fe(e,r);s=l?1:s,a=!!a||s===3,l=c&&!l,(s===2||l)&&ur(e)&&(r=0|(t=e.v)[k]);var h=(e=zn(t,n))===Ut?7:0|e[k],u=Wn(h,r);if(c=!(4&u)){var f=e,w=r;const g=!!(2&u);g&&(w|=2);let p=!g,y=!0,m=0,b=0;for(;m<f.length;m++){const v=On(f[m],i,!1,w);if(v instanceof i){if(!g){const A=Fe(v);p&&(p=!A),y&&(y=A)}f[b++]=v}}b<m&&(f.length=b),u|=4,u=y?-4097&u:4096|u,u=p?8|u:-9&u}if(u!==h&&(de(e,u),2&u&&Object.freeze(e)),l&&!(8&u||!e.length&&(s===1||s===4&&(2&u||!(16&u)&&32&r)))){for(Ht(u)&&(e=Ze(e),u=qt(u,r),r=ue(t,r,n,e)),i=e,l=u,h=0;h<i.length;h++)(f=i[h])!==(u=jn(f))&&(i[h]=u);l|=8,de(e,u=l=i.length?4096|l:-4097&l)}return Yo(e,u,t,r,n,s,c,a)}function mt(e,t,r){const i=e.v;return Ro(e,i,0|i[k],t,r,zt(),!1,!0)}function ea(e){return e==null&&(e=void 0),e}function F(e,t,r,i,n){return K(e,r,i=ea(i),n),i&&!Fe(i)&&$t(e.v),e}function Rr(e,t,r,i){e:{var n=i=ea(i);hr(e);const s=e.v;let a=0|s[k];if(n==null){const c=qn(s);if(Kn(c,s,a,r)!==t)break e;c.set(r,0)}else a=Jo(s,a,r,t);ue(s,a,t,n)}i&&!Fe(i)&&$t(e.v)}function qt(e,t){return-273&(2&t?2|e:-3&e)}function Xn(e,t,r,i){var n=i;hr(e),e=Ro(e,i=e.v,0|i[k],r,t,2,!0),n=n??new r,e.push(n),t=r=e===Ut?7:0|e[k],(n=Fe(n))?(r&=-9,e.length===1&&(r&=-4097)):r|=4096,r!==t&&de(e,r),n||$t(i)}function $e(e,t,r){return lr(J(e,t,void 0,r))}function ta(e){return(_n?J(e,2,void 0,void 0,ki):ki(J(e,2)))??Yd}function ne(e,t){return J(e,t,void 0,void 0,ot)??0}function yt(e,t,r){if(r!=null){if(typeof r!="number"||!_i(r))throw An("int32");r|=0}K(e,t,r)}function I(e,t,r){K(e,t,Yr(r))}function Me(e,t,r){St(e,t,Jr(r),"")}function Ti(e,t,r){{hr(e);const a=e.v;let c=0|a[k];if(r==null)ue(a,c,t);else{var i=e=r===Ut?7:0|r[k],n=Ht(e),s=n||Object.isFrozen(r);for(n||(e=0),s||(r=Ze(r),i=0,e=qt(e,c),s=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??(_n?1024:0),n=0;n<r.length;n++){const l=r[n],h=jo(l);Object.is(l,h)||(s&&(r=Ze(r),i=0,e=qt(e,c),s=!1),r[n]=h)}e!==i&&(s&&(r=Ze(r),e=qt(e,c)),de(r,e)),ue(a,c,t,r)}}}function Ni(e,t,r){hr(e),Wt(e,t,ve,2,!0).push(jo(r))}var wr=class{constructor(e,t,r){if(this.buffer=e,r&&!t)throw Error();this.g=t}};function Qn(e,t){if(typeof e=="string")return new wr(bo(e),t);if(Array.isArray(e))return new wr(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new wr(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new wr(e,!1);if(e.constructor===nt)return t=Sn(e)||new Uint8Array(0),new wr(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new wr(e,!1);throw Error()}function gr(e,t){let r,i=0,n=0,s=0;const a=e.h;let c=e.g;do r=a[c++],i|=(127&r)<<s,s+=7;while(s<32&&128&r);if(s>32)for(n|=(127&r)>>4,s=3;s<32&&128&r;s+=7)r=a[c++],n|=(127&r)<<s;if(Kt(e,c),!(128&r))return t(i>>>0,n>>>0);throw Error()}function Jn(e){let t=0,r=e.g;const i=r+10,n=e.h;for(;r<i;){const s=n[r++];if(t|=s,(128&s)==0)return Kt(e,r),!!(127&t)}throw Error()}function At(e){const t=e.h;let r=e.g,i=t[r++],n=127&i;if(128&i&&(i=t[r++],n|=(127&i)<<7,128&i&&(i=t[r++],n|=(127&i)<<14,128&i&&(i=t[r++],n|=(127&i)<<21,128&i&&(i=t[r++],n|=i<<28,128&i&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Error();return Kt(e,r),n}function bt(e){return At(e)>>>0}function Ii(e){var t=e.h;const r=e.g;var i=t[r],n=t[r+1];const s=t[r+2];return t=t[r+3],Kt(e,e.g+4),e=2*((n=(i<<0|n<<8|s<<16|t<<24)>>>0)>>31)+1,i=n>>>23&255,n&=8388607,i==255?n?NaN:e*(1/0):i==0?1401298464324817e-60*e*n:e*Math.pow(2,i-150)*(n+8388608)}function Xd(e){return At(e)}function Kt(e,t){if(e.g=t,t>e.l)throw Error()}function ra(e,t){if(t<0)throw Error();const r=e.g;if((t=r+t)>e.l)throw Error();return e.g=t,r}function ia(e,t){if(t==0)return Bt();var r=ra(e,t);return e.Y&&e.j?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):Td?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?Bt():new nt(r,er)}var na=[];function sa(e,t,r,i){if(Mi.length){const n=Mi.pop();return n.o(i),n.g.init(e,t,r,i),n}return new Qd(e,t,r,i)}function oa(e){e.g.clear(),e.l=-1,e.h=-1,Mi.length<100&&Mi.push(e)}function aa(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var r=bt(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5)||t<1)throw Error();return e.l=t,e.h=r,!0}function Fi(e){switch(e.h){case 0:e.h!=0?Fi(e):Jn(e.g);break;case 1:Kt(e=e.g,e.g+8);break;case 2:if(e.h!=2)Fi(e);else{var t=bt(e.g);Kt(e=e.g,e.g+t)}break;case 5:Kt(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!aa(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}Fi(e)}break;default:throw Error()}}function ei(e,t,r){const i=e.g.l;var n=bt(e.g);let s=(n=e.g.g+n)-i;if(s<=0&&(e.g.l=n,r(t,e,void 0,void 0,void 0),s=n-e.g.g),s)throw Error();return e.g.g=n,e.g.l=i,t}function Zn(e){var t=bt(e.g),r=ra(e=e.g,t);if(e=e.h,ad){var i,n=e;(i=vn)||(i=vn=new TextDecoder("utf-8",{fatal:!0})),t=r+t,n=r===0&&t===n.length?n:n.subarray(r,t);try{var s=i.decode(n)}catch(c){if(yi===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),yi=!0}catch{yi=!1}}throw!yi&&(vn=void 0),c}}else{t=(s=r)+t,r=[];let c,l=null;for(;s<t;){var a=e[s++];a<128?r.push(a):a<224?s>=t?Ot():(c=e[s++],a<194||(192&c)!=128?(s--,Ot()):r.push((31&a)<<6|63&c)):a<240?s>=t-1?Ot():(c=e[s++],(192&c)!=128||a===224&&c<160||a===237&&c>=160||(192&(i=e[s++]))!=128?(s--,Ot()):r.push((15&a)<<12|(63&c)<<6|63&i)):a<=244?s>=t-2?Ot():(c=e[s++],(192&c)!=128||c-144+(a<<28)>>30||(192&(i=e[s++]))!=128||(192&(n=e[s++]))!=128?(s--,Ot()):(a=(7&a)<<18|(63&c)<<12|(63&i)<<6|63&n,a-=65536,r.push(55296+(a>>10&1023),56320+(1023&a)))):Ot(),r.length>=8192&&(l=co(l,r),r.length=0)}s=co(l,r)}return s}function ca(e){const t=bt(e.g);return ia(e.g,t)}function Li(e,t,r){var i=bt(e.g);for(i=e.g.g+i;e.g.g<i;)r.push(t(e.g))}var Qd=class{constructor(e,t,r,i){if(na.length){const n=na.pop();n.init(e,t,r,i),e=n}else e=new class{constructor(n,s,a,c){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(n,s,a,c)}init(n,s,a,{Y:c=!1,ea:l=!1}={}){this.Y=c,this.ea=l,n&&(n=Qn(n,this.ea),this.h=n.buffer,this.j=n.g,this.m=s||0,this.l=a!==void 0?this.m+a:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(e,t,r,i);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(i)}o({ha:e=!1}={}){this.ha=e}},Mi=[];function la(e){return e?/^\d+$/.test(e)?(Ei(e),new Rn(ee,ae)):null:Jd||(Jd=new Rn(0,0))}var Rn=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Jd;function da(e){return e?/^-?\d+$/.test(e)?(Ei(e),new es(ee,ae)):null:Zd||(Zd=new es(0,0))}var es=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Zd;function pr(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function mr(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Di(e,t){if(t>=0)mr(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function ts(e){var t=ee;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function yr(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function ze(e,t,r){mr(e.g,8*t+r)}function rs(e,t){return ze(e,t,2),t=e.g.end(),yr(e,t),t.push(e.h),t}function is(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function Pi(e,t,r){ze(e,t,2),mr(e.g,r.length),yr(e,e.g.end()),yr(e,r)}function Oi(e,t,r,i){r!=null&&(t=rs(e,t),i(r,e),is(e,t))}function at(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var ns=at(),ua=at(),ss=at(),os=at(),ha=at(),fa=at(),Rd=at(),Bi=at(),wa=at(),ga=at();function ct(e,t,r){var i=e.v;Ie&&Ie in i&&(i=i[Ie])&&delete i[t.g],t.h?t.j(e,t.h,t.g,r,t.l):t.j(e,t.g,r,t.l)}var S=class{constructor(e,t){this.v=Ho(e,t,void 0,2048)}toJSON(){return Wo(this)}j(){var n;var e=Pu,t=this.v,r=e.g,i=Ie;if(ir&&i&&((n=t[i])==null?void 0:n[r])!=null&&tr(yd,3),t=e.g,_o&&Ie&&_o===void 0&&(i=(r=this.v)[Ie])&&(i=i.da))try{i(r,t,$d)}catch(s){uo(s)}return e.h?e.m(this,e.h,e.g,e.l):e.m(this,e.g,e.defaultValue,e.l)}clone(){const e=this.v,t=0|e[k];return $n(this,e,t)?Gn(this,e,!0):new this.constructor(dr(e,t,!1))}};S.prototype[nr]=sr,S.prototype.toString=function(){return this.v.toString()};var br=class{constructor(e,t,r){this.g=e,this.h=t,e=ns,this.l=!!e&&r===e||!1}};function Ui(e,t){return new br(e,t,ns)}function pa(e,t,r,i,n){Oi(e,r,Ea(t,i),n)}const eu=Ui(function(e,t,r,i,n){return e.h===2&&(ei(e,Yn(t,i,r),n),!0)},pa),tu=Ui(function(e,t,r,i,n){return e.h===2&&(ei(e,Yn(t,i,r),n),!0)},pa);var Vi=Symbol(),Gi=Symbol(),as=Symbol(),ma=Symbol(),ya=Symbol();let ba,va;function Yt(e,t,r,i){var n=i[e];if(n)return n;(n={}).qa=i,n.T=function(f){switch(typeof f){case"boolean":return Hd||(Hd=[0,void 0,!0]);case"number":return f>0?void 0:f===0?qd||(qd=[0,void 0]):[-f,void 0];case"string":return[0,f];case"object":return f}}(i[0]);var s=i[1];let a=1;s&&s.constructor===Object&&(n.ba=s,typeof(s=i[++a])=="function"&&(n.ma=!0,ba??(ba=s),va??(va=i[a+1]),s=i[a+=2]));const c={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var l=0;l<s.length;l++)c[s[l]]=s;s=i[++a]}for(l=1;s!==void 0;){let f;typeof s=="number"&&(l+=s,s=i[++a]);var h=void 0;if(s instanceof br?f=s:(f=eu,a--),f==null?void 0:f.l){s=i[++a],h=i;var u=a;typeof s=="function"&&(s=s(),h[u]=s),h=s}for(u=l+1,typeof(s=i[++a])=="number"&&s<0&&(u-=s,s=i[++a]);l<u;l++){const w=c[l];h?r(n,l,f,h,w):t(n,l,f,w)}}return i[e]=n}function xa(e){return Array.isArray(e)?e[0]instanceof br?e:[tu,e]:[e,void 0]}function Ea(e,t){return e instanceof S?e.v:Array.isArray(e)?jt(e,t):void 0}function cs(e,t,r,i){const n=r.g;e[t]=i?(s,a,c)=>n(s,a,c,i):n}function ls(e,t,r,i,n){const s=r.g;let a,c;e[t]=(l,h,u)=>s(l,h,u,c||(c=Yt(Gi,cs,ls,i).T),a||(a=ds(i)),n)}function ds(e){let t=e[as];if(t!=null)return t;const r=Yt(Gi,cs,ls,e);return t=r.ma?(i,n)=>ba(i,n,r):(i,n)=>{for(;aa(n)&&n.h!=4;){var s=n.l,a=r[s];if(a==null){var c=r.ba;c&&(c=c[s])&&(c=iu(c))!=null&&(a=r[s]=c)}if(a==null||!a(n,i,s)){if(a=(c=n).m,Fi(c),c.ha)var l=void 0;else l=c.g.g-a,c.g.g=a,l=ia(c.g,l);a=void 0,c=i,l&&((a=c[Ie]??(c[Ie]=new Vn))[s]??(a[s]=[])).push(l)}}return(i=Si(i))&&(i.da=r.qa[ya]),!0},e[as]=t,e[ya]=ru.bind(e),t}function ru(e,t,r,i){var n=this[Gi];const s=this[as],a=jt(void 0,n.T),c=Si(e);if(c){var l=!1,h=n.ba;if(h){if(n=(u,f,w)=>{if(w.length!==0)if(h[f])for(const g of w){u=sa(g);try{l=!0,s(a,u)}finally{oa(u)}}else i==null||i(e,f,w)},t==null)Ai(c,n);else if(c!=null){const u=c[t];u&&n(c,t,u)}if(l){let u=0|e[k];if(2&u&&2048&u&&!(r!=null&&r.Ka))throw Error();const f=or(u),w=(g,p)=>{if(pt(e,g,f)!=null){if((r==null?void 0:r.Qa)===1)return;throw Error()}p!=null&&(u=ue(e,u,g,p,f)),delete c[g]};t==null?To(a,0|a[k],(g,p)=>{w(g,p)}):w(t,pt(a,t,f))}}}}function iu(e){const t=(e=xa(e))[0].g;if(e=e[1]){const r=ds(e),i=Yt(Gi,cs,ls,e).T;return(n,s,a)=>t(n,s,a,i,r)}return t}function ji(e,t,r){e[t]=r.h}function $i(e,t,r,i){let n,s;const a=r.h;e[t]=(c,l,h)=>a(c,l,h,s||(s=Yt(Vi,ji,$i,i).T),n||(n=_a(i)))}function _a(e){let t=e[ma];if(!t){const r=Yt(Vi,ji,$i,e);t=(i,n)=>ka(i,n,r),e[ma]=t}return t}function ka(e,t,r){To(e,0|e[k],(i,n)=>{if(n!=null){var s=function(a,c){var l=a[c];if(l)return l;if((l=a.ba)&&(l=l[c])){var h=(l=xa(l))[0].h;if(l=l[1]){const u=_a(l),f=Yt(Vi,ji,$i,l).T;l=a.ma?va(f,u):(w,g,p)=>h(w,g,p,f,u)}else l=h;return a[c]=l}}(r,i);s?s(t,n,i):i<500||tr(Cn,3)}}),(e=Si(e))&&Ai(e,(i,n,s)=>{for(yr(t,t.g.end()),i=0;i<s.length;i++)yr(t,Sn(s[i])||new Uint8Array(0))})}const nu=Le(0);function vr(e,t){if(Array.isArray(t)){var r=0|t[k];if(4&r)return t;for(var i=0,n=0;i<t.length;i++){const s=e(t[i]);s!=null&&(t[n++]=s)}return n<i&&(t.length=n),(e=-1537&(5|r))!==r&&de(t,e),2&e&&Object.freeze(t),t}}function _e(e,t,r){return new br(e,t,r)}function xr(e,t,r){return new br(e,t,r)}function fe(e,t,r){ue(e,0|e[k],t,r,or(0|e[k]))}var su=Ui(function(e,t,r,i,n){if(e.h!==2)return!1;if(e=Ze(e=ei(e,jt([void 0,void 0],i),n)),n=or(i=0|t[k]),2&i)throw Error();let s=pt(t,r,n);if(s instanceof gt)2&s.J?(s=s.V(),s.push(e),ue(t,i,r,s,n)):s.Ma(e);else if(Array.isArray(s)){var a=0|s[k];8192&a||de(s,a|=8192),2&a&&(s=Qo(s),ue(t,i,r,s,n)),s.push(e)}else ue(t,i,r,Hr([e]),n);return!0},function(e,t,r,i,n){if(t instanceof gt)t.forEach((s,a)=>{Oi(e,r,jt([a,s],i),n)});else if(Array.isArray(t)){for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&Oi(e,r,jt(a,i),n)}Hr(t)}});function Sa(e,t,r){(t=ot(t))!=null&&(ze(e,r,5),e=e.g,In(t),ts(e))}function Aa(e,t,r){if(t=function(i){if(i==null)return i;const n=typeof i;if(n==="bigint")return String(Kr(64,i));if(Qr(i)){if(n==="string")return Uo(i);if(n==="number")return Pn(i)}}(t),t!=null&&(typeof t=="string"&&da(t),t!=null))switch(ze(e,r,0),typeof t){case"number":e=e.g,ar(t),pr(e,ee,ae);break;case"bigint":r=BigInt.asUintN(64,t),r=new es(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),pr(e.g,r.h,r.g);break;default:r=da(t),pr(e.g,r.h,r.g)}}function Ca(e,t,r){(t=lr(t))!=null&&t!=null&&(ze(e,r,0),Di(e.g,t))}function Ta(e,t,r){(t=Po(t))!=null&&(ze(e,r,0),e.g.g.push(t?1:0))}function Na(e,t,r){(t=ve(t))!=null&&Pi(e,r,lo(t))}function Ia(e,t,r,i,n){Oi(e,r,Ea(t,i),n)}function Fa(e,t,r){(t=t==null||typeof t=="string"||t instanceof nt?t:void 0)!=null&&Pi(e,r,Qn(t,!0).buffer)}function La(e,t,r){return(e.h===5||e.h===2)&&(t=fr(t,0|t[k],r),e.h==2?Li(e,Ii,t):t.push(Ii(e.g)),!0)}var ce=_e(function(e,t,r){return e.h===5&&(fe(t,r,Ii(e.g)),!0)},Sa,Bi),ou=xr(La,function(e,t,r){if((t=vr(ot,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&(ze(i,n,5),i=i.g,In(s),ts(i))}},Bi),us=xr(La,function(e,t,r){if((t=vr(ot,t))!=null&&t.length){ze(e,r,2),mr(e.g,4*t.length);for(let i=0;i<t.length;i++)r=e.g,In(t[i]),ts(r)}},Bi),au=_e(function(e,t,r){return e.h===5&&(fe(t,r,(e=Ii(e.g))===0?void 0:e),!0)},Sa,Bi),Ct=_e(function(e,t,r){return En?(e.h!==0?e=!1:(fe(t,r,gr(e.g,Mo)),e=!0),e):e.h===0&&(fe(t,r,gr(e.g,Ln)),!0)},Aa,fa),hs=_e(function(e,t,r){return En?(e.h!==0?t=!1:(fe(t,r,(e=gr(e.g,Mo))===nu?void 0:e),t=!0),t):e.h===0&&(fe(t,r,(e=gr(e.g,Ln))===0?void 0:e),!0)},Aa,fa),cu=_e(function(e,t,r){return En?(e.h!==0?e=!1:(fe(t,r,gr(e.g,Id)),e=!0),e):e.h===0&&(fe(t,r,gr(e.g,Fn)),!0)},function(e,t,r){if(t=function(i){if(i==null)return i;var n=typeof i;if(n==="bigint")return String(Fd(64,i));if(Qr(i)){if(n==="string")return n=cr(Number(i)),Gt(n)&&n>=0?i=String(n):((n=i.indexOf("."))!==-1&&(i=i.substring(0,n)),(n=i[0]!=="-"&&((n=i.length)<20||n===20&&i<="18446744073709551615"))||(Ei(i),i=qr(ee,ae))),i;if(n==="number")return(i=cr(i))>=0&&Gt(i)||(ar(i),i=Fn(ee,ae)),i}}(t),t!=null&&(typeof t=="string"&&la(t),t!=null))switch(ze(e,r,0),typeof t){case"number":e=e.g,ar(t),pr(e,ee,ae);break;case"bigint":r=BigInt.asUintN(64,t),r=new Rn(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),pr(e.g,r.h,r.g);break;default:r=la(t),pr(e.g,r.h,r.g)}},Rd),we=_e(function(e,t,r){return e.h===0&&(fe(t,r,At(e.g)),!0)},Ca,os),ti=xr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r),e.h==2?Li(e,At,t):t.push(At(e.g)),!0)},function(e,t,r){if((t=vr(lr,t))!=null&&t.length){r=rs(e,r);for(let i=0;i<t.length;i++)Di(e.g,t[i]);is(e,r)}},os),Er=_e(function(e,t,r){return e.h===0&&(fe(t,r,(e=At(e.g))===0?void 0:e),!0)},Ca,os),se=_e(function(e,t,r){return e.h===0&&(fe(t,r,Jn(e.g)),!0)},Ta,ua),Xt=_e(function(e,t,r){return e.h===0&&(fe(t,r,(e=Jn(e.g))===!1?void 0:e),!0)},Ta,ua),xe=xr(function(e,t,r){return e.h===2&&(e=Zn(e),fr(t,0|t[k],r).push(e),!0)},function(e,t,r){if((t=vr(ve,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&Pi(i,n,lo(s))}},ss),Tt=_e(function(e,t,r){return e.h===2&&(fe(t,r,(e=Zn(e))===""?void 0:e),!0)},Na,ss),X=_e(function(e,t,r){return e.h===2&&(fe(t,r,Zn(e)),!0)},Na,ss),ge=function(e,t,r=ns){return new br(e,t,r)}(function(e,t,r,i,n){return e.h===2&&(i=jt(void 0,i),fr(t,0|t[k],r).push(i),ei(e,i,n),!0)},function(e,t,r,i,n){if(Array.isArray(t)){for(let s=0;s<t.length;s++)Ia(e,t[s],r,i,n);1&(e=0|t[k])||de(t,1|e)}}),oe=Ui(function(e,t,r,i,n,s){if(e.h!==2)return!1;let a=0|t[k];return Jo(t,a,s,r,or(a)),ei(e,t=Yn(t,i,r),n),!0},Ia),Ma=_e(function(e,t,r){return e.h===2&&(fe(t,r,ca(e)),!0)},Fa,wa),lu=xr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r),e.h==2?Li(e,bt,t):t.push(bt(e.g)),!0)},function(e,t,r){if((t=vr(Oo,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&(ze(i,n,0),mr(i.g,s))}},ha),du=_e(function(e,t,r){return e.h===0&&(fe(t,r,(e=bt(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Oo(t))!=null&&t!=null&&(ze(e,r,0),mr(e.g,t))},ha),De=_e(function(e,t,r){return e.h===0&&(fe(t,r,At(e.g)),!0)},function(e,t,r){(t=lr(t))!=null&&(t=parseInt(t,10),ze(e,r,0),Di(e.g,t))},ga);class uu{constructor(t,r){var i=Pe;this.g=t,this.h=r,this.m=$,this.j=F,this.defaultValue=void 0,this.l=i.Oa!=null?No:void 0}register(){bi(this)}}function lt(e,t){return new uu(e,t)}function Nt(e,t){return(r,i)=>{{const s={ea:!0};i&&Object.assign(s,i),r=sa(r,void 0,void 0,s);try{const a=new e,c=a.v;ds(t)(c,r);var n=a}finally{oa(r)}}return n}}function zi(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const a=this.g;return this.g=[],a}}}};ka(this.v,t,Yt(Vi,ji,$i,e)),yr(t,t.g.end());const r=new Uint8Array(t.h),i=t.l,n=i.length;let s=0;for(let a=0;a<n;a++){const c=i[a];r.set(c,s),s+=c.length}return t.l=[r],r}}var Da=class extends S{constructor(e){super(e)}},Pa=[0,Tt,_e(function(e,t,r){return e.h===2&&(fe(t,r,(e=ca(e))===Bt()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof S){const i=t.Ra;return void(i?(t=i(t),t!=null&&Pi(e,r,Qn(t,!0).buffer)):tr(Cn,3))}if(Array.isArray(t))return void tr(Cn,3)}Fa(e,t,r)},wa)];let fs,Oa=globalThis.trustedTypes;function Ba(e){var t;return fs===void 0&&(fs=function(){let r=null;if(!Oa)return r;try{const i=n=>n;r=Oa.createPolicy("goog#html",{createHTML:i,createScript:i,createScriptURL:i})}catch{}return r}()),e=(t=fs)?t.createScriptURL(e):e,new class{constructor(r){this.g=r}toString(){return this.g+""}}(e)}function hu(e,...t){if(t.length===0)return Ba(e[0]);let r=e[0];for(let i=0;i<t.length;i++)r+=encodeURIComponent(t[i])+e[i+1];return Ba(r)}var Ua=[0,we,De,se,-1,ti,De,-1,se],fu=class extends S{constructor(e){super(e)}},Va=[0,se,X,se,De,-1,xr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r),e.h==2?Li(e,Xd,t):t.push(At(e.g)),!0)},function(e,t,r){if((t=vr(lr,t))!=null&&t.length){r=rs(e,r);for(let i=0;i<t.length;i++)Di(e.g,t[i]);is(e,r)}},ga),X,-1,[0,se,-1],De,se,-1],Ga=[0,3,se,-1,2,[0,we],[0,De,se],[0,X,-1],[0]],ja=[0,X,-2],$a=class extends S{constructor(e){super(e)}},za=[0],Wa=[0,we,se,1,se,-4],Pe=class extends S{constructor(e){super(e,2)}},he={};he[336783863]=[0,X,se,-1,we,[0,[1,2,3,4,5,6,7,8,9],oe,za,oe,Va,oe,ja,oe,Wa,oe,Ua,oe,[0,X,-2],oe,[0,X,De],oe,Ga,oe,[0,De,-1,se]],[0,X],se,[0,[1,3],[2,4],oe,[0,ti],-1,oe,[0,xe],-1,ge,[0,X,-1]],X];var Ha=[0,hs,-1,Xt,-3,hs,ti,Tt,Er,hs,-1,Xt,Er,Xt,-2,Tt];function Z(e,t){Ni(e,3,t)}function V(e,t){Ni(e,4,t)}var Te=class extends S{constructor(e){super(e,500)}o(e){return F(this,0,7,e)}},ri=[-1,{}],qa=[0,X,1,ri],Ka=[0,X,xe,ri];function We(e,t){Xn(e,1,Te,t)}function te(e,t){Ni(e,10,t)}function W(e,t){Ni(e,15,t)}var Oe=class extends S{constructor(e){super(e,500)}o(e){return F(this,0,1001,e)}},Ya=[-500,ge,[-500,Tt,-1,xe,-3,[-2,he,se],ge,Pa,Er,-1,qa,Ka,ge,[0,Tt,Xt],Tt,Ha,Er,xe,987,xe],4,ge,[-500,X,-1,[-1,{}],998,X],ge,[-500,X,xe,-1,[-2,{},se],997,xe,-1],Er,ge,[-500,X,xe,ri,998,xe],xe,Er,qa,Ka,ge,[0,Tt,-1,ri],xe,-2,Ha,Tt,-1,Xt,[0,Xt,du],978,ri,ge,Pa];Oe.prototype.g=zi(Ya);var wu=Nt(Oe,Ya),gu=class extends S{constructor(e){super(e)}},Xa=class extends S{constructor(e){super(e)}g(){return mt(this,gu,1)}},Qa=[0,ge,[0,we,ce,X,-1]],Wi=Nt(Xa,Qa),pu=class extends S{constructor(e){super(e)}},mu=class extends S{constructor(e){super(e)}},ws=class extends S{constructor(e){super(e)}l(){return $(this,pu,2)}g(){return mt(this,mu,5)}},Ja=Nt(class extends S{constructor(e){super(e)}},[0,xe,ti,us,[0,De,[0,we,-3],[0,ce,-3],[0,we,-1,[0,ge,[0,we,-2]]],ge,[0,ce,-1,X,ce]],X,-1,Ct,ge,[0,we,ce],xe,Ct]),Za=class extends S{constructor(e){super(e)}},_r=Nt(class extends S{constructor(e){super(e)}},[0,ge,[0,ce,-4]]),Ra=class extends S{constructor(e){super(e)}},ii=Nt(class extends S{constructor(e){super(e)}},[0,ge,[0,ce,-4]]),yu=class extends S{constructor(e){super(e)}},bu=[0,we,-1,us,De],ec=class extends S{constructor(e){super(e)}};ec.prototype.g=zi([0,ce,-4,Ct]);var vu=class extends S{constructor(e){super(e)}},xu=Nt(class extends S{constructor(e){super(e)}},[0,ge,[0,1,we,X,Qa],Ct]),tc=class extends S{constructor(e){super(e)}},Eu=class extends S{constructor(e){super(e)}na(){const e=J(this,1,void 0,void 0,Xo);return e??Bt()}},_u=class extends S{constructor(e){super(e)}},rc=[1,2],ku=Nt(class extends S{constructor(e){super(e)}},[0,ge,[0,rc,oe,[0,us],oe,[0,Ma],we,X],Ct]),gs=class extends S{constructor(e){super(e)}},ic=[0,X,we,ce,xe,-1],nc=class extends S{constructor(e){super(e)}},Su=[0,se,-1],sc=class extends S{constructor(e){super(e)}},Hi=[1,2,3,4,5,6],qi=class extends S{constructor(e){super(e)}g(){return J(this,1,void 0,void 0,Xo)!=null}l(){return ve(J(this,2))!=null}},ie=class extends S{constructor(e){super(e)}g(){return Po(J(this,2))??!1}},oc=[0,Ma,X,[0,we,Ct,-1],[0,cu,Ct]],le=[0,oc,se,[0,Hi,oe,Wa,oe,Va,oe,Ua,oe,za,oe,ja,oe,Ga],De],Ki=class extends S{constructor(e){super(e)}},ps=[0,le,ce,-1,we],Au=lt(502141897,Ki);he[502141897]=ps;var Cu=Nt(class extends S{constructor(e){super(e)}},[0,[0,De,-1,ou,lu],bu]),ac=class extends S{constructor(e){super(e)}},cc=class extends S{constructor(e){super(e)}},ms=[0,le,ce,[0,le],se],Tu=lt(508968150,cc);he[508968150]=[0,le,ps,ms,ce,[0,[0,oc]]],he[508968149]=ms;var kr=class extends S{constructor(e){super(e)}l(){return $(this,gs,2)}g(){K(this,2)}},lc=[0,le,ic];he[478825465]=lc;var Nu=class extends S{constructor(e){super(e)}},dc=class extends S{constructor(e){super(e)}},ys=class extends S{constructor(e){super(e)}},bs=class extends S{constructor(e){super(e)}},uc=class extends S{constructor(e){super(e)}},hc=[0,le,[0,le],lc,-1],fc=[0,le,ce,we],vs=[0,le,ce],wc=[0,le,fc,vs,ce],Iu=lt(479097054,uc);he[479097054]=[0,le,wc,hc],he[463370452]=hc,he[464864288]=fc;var Fu=lt(462713202,bs);he[462713202]=wc,he[474472470]=vs;var Lu=class extends S{constructor(e){super(e)}},gc=class extends S{constructor(e){super(e)}},pc=class extends S{constructor(e){super(e)}},mc=class extends S{constructor(e){super(e)}},xs=[0,le,ce,-1,we],Es=[0,le,ce,se];mc.prototype.g=zi([0,le,vs,[0,le],ps,ms,xs,Es]);var yc=class extends S{constructor(e){super(e)}},Mu=lt(456383383,yc);he[456383383]=[0,le,ic];var bc=class extends S{constructor(e){super(e)}},Du=lt(476348187,bc);he[476348187]=[0,le,Su];var vc=class extends S{constructor(e){super(e)}},xc=class extends S{constructor(e){super(e)}},Ec=[0,De,-1],Pu=lt(458105876,class extends S{constructor(e){super(e)}g(){let e;var t=this.v;const r=0|t[k];return e=Fe(this,r),t=function(i,n,s,a){var c=xc;!a&&ur(i)&&(s=0|(n=i.v)[k]);var l=pt(n,2);if(i=!1,l==null){if(a)return zo();l=[]}else if(l.constructor===gt){if(!(2&l.J)||a)return l;l=l.V()}else Array.isArray(l)?i=!!(2&(0|l[k])):l=[];if(a){if(!l.length)return zo();i||(i=!0,Wr(l))}else i&&(i=!1,Hr(l),l=Qo(l));return!i&&32&s&&zr(l,32),s=ue(n,s,2,a=new gt(l,c,Pd,void 0)),i||$t(n,s),a}(this,t,r,e),!e&&xc&&(t.ra=!0),t}});he[458105876]=[0,Ec,su,[!0,Ct,[0,X,-1,xe]],[0,ti,se,De]];var _s=class extends S{constructor(e){super(e)}},_c=lt(458105758,_s);he[458105758]=[0,le,X,Ec];var ks=class extends S{constructor(e){super(e)}},kc=[0,au,-1,Xt],Ou=class extends S{constructor(e){super(e)}},Sc=class extends S{constructor(e){super(e)}},Ss=[1,2];Sc.prototype.g=zi([0,Ss,oe,kc,oe,[0,ge,kc]]);var Ac=class extends S{constructor(e){super(e)}},Bu=lt(443442058,Ac);he[443442058]=[0,le,X,we,ce,xe,-1,se,ce],he[514774813]=xs;var Cc=class extends S{constructor(e){super(e)}},Uu=lt(516587230,Cc);function As(e,t){return t=t?t.clone():new gs,e.displayNamesLocale!==void 0?K(t,1,Jr(e.displayNamesLocale)):e.displayNamesLocale===void 0&&K(t,1),e.maxResults!==void 0?yt(t,2,e.maxResults):"maxResults"in e&&K(t,2),e.scoreThreshold!==void 0?I(t,3,e.scoreThreshold):"scoreThreshold"in e&&K(t,3),e.categoryAllowlist!==void 0?Ti(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&K(t,4),e.categoryDenylist!==void 0?Ti(t,5,e.categoryDenylist):"categoryDenylist"in e&&K(t,5),t}function Tc(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function Cs(e,t=-1,r=""){return{categories:e.map(i=>({index:$e(i,1)??0??-1,score:ne(i,2)??0,categoryName:ve(J(i,3))??""??"",displayName:ve(J(i,4))??""??""})),headIndex:t,headName:r}}function Vu(e){const t={classifications:mt(e,vu,1).map(r=>{var i;return Cs(((i=$(r,Xa,4))==null?void 0:i.g())??[],$e(r,2)??0,ve(J(r,3))??"")})};return function(r){return Dd(_n?J(r,2,void 0,void 0,ki):J(r,2))}(e)!=null&&(t.timestampMs=Tc(ta(e))),t}function Nc(e){var a,c;var t=Wt(e,3,ot,zt()),r=Wt(e,2,lr,zt()),i=Wt(e,1,ve,zt()),n=Wt(e,9,ve,zt());const s={categories:[],keypoints:[]};for(let l=0;l<t.length;l++)s.categories.push({score:t[l],index:r[l]??-1,categoryName:i[l]??"",displayName:n[l]??""});if((t=(a=$(e,ws,4))==null?void 0:a.l())&&(s.boundingBox={originX:$e(t,1,kt)??0,originY:$e(t,2,kt)??0,width:$e(t,3,kt)??0,height:$e(t,4,kt)??0,angle:0}),(c=$(e,ws,4))==null?void 0:c.g().length)for(const l of $(e,ws,4).g())s.keypoints.push({x:J(l,1,void 0,kt,ot)??0,y:J(l,2,void 0,kt,ot)??0,score:J(l,4,void 0,kt,ot)??0,label:ve(J(l,3,void 0,kt))??""});return s}function Yi(e){const t=[];for(const r of mt(e,Ra,1))t.push({x:ne(r,1)??0,y:ne(r,2)??0,z:ne(r,3)??0,visibility:ne(r,4)??0});return t}function ni(e){const t=[];for(const r of mt(e,Za,1))t.push({x:ne(r,1)??0,y:ne(r,2)??0,z:ne(r,3)??0,visibility:ne(r,4)??0});return t}function Ic(e){return Array.from(e,t=>t>127?t-256:t)}function Fc(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,i=0,n=0;for(let s=0;s<e.length;s++)r+=e[s]*t[s],i+=e[s]*e[s],n+=t[s]*t[s];if(i<=0||n<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(i*n)}let Xi;he[516587230]=[0,le,xs,Es,ce],he[518928384]=Es;const Gu=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Lc(){if(Xi===void 0)try{await WebAssembly.instantiate(Gu),Xi=!0}catch{Xi=!1}return Xi}async function si(e,t=hu``){const r=await Lc()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Qt=class{};function Mc(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Dc(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,i)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",n=>{i(n)},!1),document.body.appendChild(t)})}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function Pc(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function C(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Oc(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[i,n]=Pc(t);return!e.l||i===e.i.canvas.width&&n===e.i.canvas.height||(e.i.canvas.width=i,e.i.canvas.height=n),[i,n]}function Bc(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const i=new Uint32Array(t.length);for(let n=0;n<t.length;n++)i[n]=e.i.stringToNewUTF8(t[n]);t=e.i._malloc(4*i.length),e.i.HEAPU32.set(i,t>>2),r(t);for(const n of i)e.i._free(n);e.i._free(t)}function dt(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function It(e,t,r){let i=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(n,s,a)=>{s?(r(i,a),i=[]):i.push(n)}}Qt.forVisionTasks=function(e){return si("vision",e)},Qt.forTextTasks=function(e){return si("text",e)},Qt.forGenAiExperimentalTasks=function(e){return si("genai_experimental",e)},Qt.forGenAiTasks=function(e){return si("genai",e)},Qt.forAudioTasks=function(e){return si("audio",e)},Qt.isSimdSupported=function(){return Lc()};async function ju(e,t,r,i){return e=await(async(n,s,a,c,l)=>{if(s&&await Dc(s),!self.ModuleFactory||a&&(await Dc(a),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&l&&((s=self.Module).locateFile=l.locateFile,l.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=l.mainScriptUrlOrBlob)),l=await self.ModuleFactory(self.Module||l),self.ModuleFactory=self.Module=void 0,new n(l,c)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:n=>n.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&n.endsWith(".data")?r.assetBinaryPath.toString():n}),await e.o(i),e}function Ts(e,t){const r=$(e.baseOptions,qi,1)||new qi;typeof t=="string"?(K(r,2,Jr(t)),K(r,1)):t instanceof Uint8Array&&(K(r,1,Tn(t,!1)),K(r,2)),F(e.baseOptions,0,1,r)}function Uc(e){try{const t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map(r=>r.message).join(", "))}finally{e.H=[]}}function x(e,t){e.C=Math.max(e.C,t)}function Qi(e,t){e.B=new Te,Me(e.B,2,"PassThroughCalculator"),Z(e.B,"free_memory"),V(e.B,"free_memory_unused_out"),te(t,"free_memory"),We(t,e.B)}function Sr(e,t){Z(e.B,t),V(e.B,t+"_unused_out")}function Ji(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var Ns=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var r,i,n,s,a,c;if(t){const l=e.baseOptions||{};if((r=e.baseOptions)!=null&&r.modelAssetBuffer&&((i=e.baseOptions)!=null&&i.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((n=$(this.baseOptions,qi,1))!=null&&n.g()||(s=$(this.baseOptions,qi,1))!=null&&s.l()||(a=e.baseOptions)!=null&&a.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(h,u){let f=$(h.baseOptions,sc,3);if(!f){var w=f=new sc,g=new $a;Rr(w,4,Hi,g)}"delegate"in u&&(u.delegate==="GPU"?(u=f,w=new fu,Rr(u,2,Hi,w)):(u=f,w=new $a,Rr(u,4,Hi,w))),F(h.baseOptions,0,3,f)}(this,l),l.modelAssetPath)return fetch(l.modelAssetPath.toString()).then(h=>{if(h.ok)return h.arrayBuffer();throw Error(`Failed to fetch model: ${l.modelAssetPath} (${h.status})`)}).then(h=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(h),!0,!1,!1),Ts(this,"/model.dat"),this.m(),this.L()});if(l.modelAssetBuffer instanceof Uint8Array)Ts(this,l.modelAssetBuffer);else if(l.modelAssetBuffer)return async function(h){const u=[];for(var f=0;;){const{done:w,value:g}=await h.read();if(w)break;u.push(g),f+=g.length}if(u.length===0)return new Uint8Array(0);if(u.length===1)return u[0];h=new Uint8Array(f),f=0;for(const w of u)h.set(w,f),f+=w.length;return h}(l.modelAssetBuffer).then(h=>{Ts(this,h),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca(t=>{e=wu(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,i)=>{this.H.push(Error(i))}),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,Uc(this)}finishProcessing(){this.g.finishProcessing(),Uc(this)}close(){this.B=void 0,this.g.closeGraph()}};function Ft(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Ns.prototype.close=Ns.prototype.close;class $u{constructor(t,r,i,n){this.g=t,this.h=r,this.m=i,this.l=n}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Vc(e,t,r){const i=e.g;if(r=Ft(i.createShader(r),"Failed to create WebGL shader"),i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(r)}`);return i.attachShader(e.h,r),r}function Gc(e,t){const r=e.g,i=Ft(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(i);const n=Ft(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,n),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);const s=Ft(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.L),r.vertexAttribPointer(e.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new $u(r,i,n,s)}function Is(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function zu(e,t,r,i){return Is(e,t),e.h||(e.m(),e.D()),r?(e.u||(e.u=Gc(e,!0)),r=e.u):(e.A||(e.A=Gc(e,!1)),r=e.A),t.useProgram(e.h),r.bind(),e.l(),e=i(),r.g.bindVertexArray(null),e}function jc(e,t,r){return Is(e,t),e=Ft(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function $c(e,t,r){Is(e,t),e.B||(e.B=Ft(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function Wu(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var zc=class{H(){return`
|
|
1
|
+
(function(be,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],o):(be=typeof globalThis<"u"?globalThis:be||self,o(be.InterviewWidget={},be.jsxRuntime,be.React,be.ReactDOM))})(this,function(be,o,d,Qs){"use strict";var f2=Object.defineProperty;var w2=(be,o,d)=>o in be?f2(be,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):be[o]=d;var ye=(be,o,d)=>w2(be,typeof o!="symbol"?o+"":o,d);var hn=typeof document<"u"?document.currentScript:null;const fn={},it={api:{baseUrl:"/api",retryConfig:{attempts:3,backoff:"exponential",baseDelay:1e3}},ui:{baseColor:"#3B82F6",borderRadius:"8px"},interview:{allow_answer_editing:!0,capture_screenshots:!1,timers:{thinkingDuration:30,answeringDuration:120,editingDuration:30},stt:{provider:"groq",model:"whisper-large-v3-turbo",language:"en"},tts:{provider:"piper"},proctoring:{enabled:!0,gazeAnalysisEnabled:!0}}},wn="iw-storage";function Cl(){if(!(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:hn&&hn.tagName.toUpperCase()==="SCRIPT"&&hn.src||new URL("widget.umd.3.2.15.js",document.baseURI).href}<"u"&&(fn!=null&&fn.VITE_IW_SECRET)))return typeof process<"u"&&process.env.NEXT_PUBLIC_IW_SECRET?process.env.NEXT_PUBLIC_IW_SECRET:typeof window<"u"&&window.__IW_SECRET__?window.__IW_SECRET__:"proctoring-data-seed"}const Js=Cl(),hi=30,Tl={SCREENSHOT:"screenshot"},gn="AES-GCM",pn=12;async function Zs(e){const r=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",r);return crypto.subtle.importKey("raw",i,gn,!1,["encrypt","decrypt"])}function Nl(){return crypto.getRandomValues(new Uint8Array(pn))}async function Il(e,t="default-seed"){try{const r=typeof e=="string"?e:JSON.stringify(e),n=new TextEncoder().encode(r),s=await Zs(t),a=Nl(),c=await crypto.subtle.encrypt({name:gn,iv:a},s,n),l=new Uint8Array(a.length+c.byteLength);return l.set(new Uint8Array(a),0),l.set(new Uint8Array(c),a.length),btoa(String.fromCharCode(...Array.from(l)))}catch(r){throw console.error("Encryption failed:",r),new Error("Failed to encrypt data")}}async function Fl(e,t="default-seed"){try{const r=atob(e),i=new Uint8Array(r.length);for(let h=0;h<r.length;h++)i[h]=r.charCodeAt(h);const n=i.slice(0,pn),s=i.slice(pn),a=await Zs(t),c=await crypto.subtle.decrypt({name:gn,iv:n},a,s);return new TextDecoder().decode(c)}catch(r){throw console.error("Decryption failed:",r),new Error("Failed to decrypt data")}}async function Ll(e,t="default-seed"){return Il(e,t)}async function Ml(e,t="default-seed"){const r=await Fl(e,t);try{return JSON.parse(r)}catch{return r}}const Ur=d.createContext(null),Dl=async()=>{try{const e=sessionStorage.getItem(wn);if(e){const r=(await Ml(e,Js)).state;return{logViolations:(r==null?void 0:r.logViolations)||[],totalViolations:(r==null?void 0:r.totalViolations)||0,gazeViolationCounters:(r==null?void 0:r.gazeViolationCounters)||{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:(r==null?void 0:r.referenceSet)??!1,referenceRef:(r==null?void 0:r.referenceRef)??{x:.5,y:.5,noseX:.5,noseY:.5}}}}catch(e){console.error("Failed to load proctoring data from session storage:",e)}return{logViolations:[],totalViolations:0,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:!1,referenceRef:{x:.5,y:.5,noseX:.5,noseY:.5}}},Vr=async e=>{try{const t=await Ll({state:e,version:0},Js);sessionStorage.setItem(wn,t)}catch(t){console.error("Failed to save proctoring data to session storage:",t)}},Pl=({children:e})=>{const t=d.useRef({logViolations:[],totalViolations:0,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:!1,referenceRef:{x:.5,y:.5,noseX:.5,noseY:.5}}),r=d.useRef(new Set);d.useEffect(()=>{Dl().then(w=>{t.current=w,i()})},[]);const i=d.useCallback(()=>{r.current.forEach(w=>w())},[]),n=d.useCallback(w=>(r.current.add(w),()=>{r.current.delete(w)}),[]),s=d.useCallback(()=>t.current,[]),a=d.useCallback(w=>{t.current={...t.current,logViolations:[...t.current.logViolations,w],totalViolations:t.current.totalViolations+1},Vr(t.current),i()},[i]),c=d.useCallback(w=>{const g={...t.current.gazeViolationCounters};w==="looking_away"&&(g.lookingAwayCount+=1),w==="no_face_detected"&&(g.noFaceDetectedCount+=1),w==="multiple_faces"&&(g.multipleFacesCount+=1),g.totalGazeViolations=g.lookingAwayCount+g.noFaceDetectedCount+g.multipleFacesCount,t.current={...t.current,gazeViolationCounters:g},Vr(t.current),i()},[i]),l=d.useCallback(()=>{t.current={...t.current,logViolations:[],totalViolations:0},Vr(t.current),i()},[i]),h=d.useCallback(()=>{t.current={...t.current,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0}},Vr(t.current),i()},[i]),u=d.useCallback((w,g)=>{t.current={...t.current,referenceSet:w,referenceRef:g},Vr(t.current),i()},[i]),f=d.useMemo(()=>({getState:s,addViolation:a,clearViolations:l,subscribe:n,incrementGazeViolation:c,clearGazeViolationCounters:h,setReferenceData:u}),[s,a,l,n,c,h,u]);return o.jsx(Ur.Provider,{value:f,children:e})},Rs=()=>{const e=d.useContext(Ur);if(!e)throw new Error("useProctoringStore must be used within a ProctoringProvider");const t=d.useSyncExternalStore(e.subscribe,e.getState,e.getState);return{logViolations:t.logViolations,totalViolations:t.totalViolations,addViolation:e.addViolation,clearViolations:e.clearViolations,gazeViolationCounters:t.gazeViolationCounters,referenceSet:t.referenceSet,referenceRef:t.referenceRef,incrementGazeViolation:e.incrementGazeViolation,clearGazeViolationCounters:e.clearGazeViolationCounters,setReferenceData:e.setReferenceData}},Ol=()=>{const e=d.useContext(Ur);if(!e)throw new Error("useViolations must be used within a ProctoringProvider");return d.useSyncExternalStore(e.subscribe,()=>e.getState().logViolations,()=>e.getState().logViolations)},Bl=()=>{const e=d.useContext(Ur);if(!e)throw new Error("useTotalViolations must be used within a ProctoringProvider");return d.useSyncExternalStore(e.subscribe,()=>e.getState().totalViolations,()=>e.getState().totalViolations)},Ul=()=>{const e=d.useContext(Ur);if(!e)throw new Error("useProctoringActions must be used within a ProctoringProvider");return{addViolation:e.addViolation,clearViolations:e.clearViolations}},eo=d.createContext(null);function to({config:e={},children:t}){var i,n,s,a;const r={api:{...it.api,...e.api,retryConfig:{...it.api.retryConfig,...(i=e.api)==null?void 0:i.retryConfig}},ui:{...it.ui,...e.ui},interview:{...it.interview,...e.interview,timers:{...it.interview.timers,...(n=e.interview)==null?void 0:n.timers},stt:{...it.interview.stt,...(s=e.interview)==null?void 0:s.stt},tts:{...it.interview.tts,...(a=e.interview)==null?void 0:a.tts}}};return o.jsx(eo.Provider,{value:r,children:o.jsx(Pl,{children:t})})}function fi(){const e=d.useContext(eo);if(!e)throw new Error("useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>");return e}function ro(){return fi().api||it.api}function Zt(){return fi().ui||it.ui}function mn(){return fi().interview||it.interview}function Vl(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function Gl(e,t,r){return"#"+[e,t,r].map(i=>{const n=Math.round(i).toString(16);return n.length===1?"0"+n:n}).join("")}function jl(e,t){const r=Vl(e);if(!r)return e;const i=r.r+(255-r.r)*t,n=r.g+(255-r.g)*t,s=r.b+(255-r.b)*t;return Gl(i,n,s)}function $l(e){return new Promise(t=>setTimeout(t,e))}function zl(e){return`linear-gradient(to left, ${jl(e,.4)}, ${e})`}const Wl=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);function Hl(e){try{const t=e.split(".");if(t.length!==3||!t[1])throw new Error("Invalid JWT token");const i=t[1].replace(/-/g,"+").replace(/_/g,"/"),n=i.padEnd(i.length+(4-i.length%4)%4,"="),s=atob(n);return JSON.parse(s)}catch(t){return console.error("Error decoding JWT:",t),null}}const ql=e=>{var t;return!e||typeof e!="string"?"":(t=e.charAt(0))==null?void 0:t.toUpperCase()},yn=(e,t)=>{const r=Math.max(0,Math.floor(e));if(t&&r<60)return`${r}`;const i=Math.floor(r/60).toString().padStart(2,"0"),n=(r%60).toString().padStart(2,"0");return`${i}:${n}`},bn=({brandLogo:e,brandName:t,className:r="",showFallbackStyles:i=!0})=>{const{baseColor:n}=Zt();return e?o.jsx("div",{className:r,children:e}):o.jsx("div",{className:i?`iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold ${r}`:r,style:i?{backgroundColor:n}:{},children:ql(t)})},Kl=e=>{const t=d.useRef(null),r=d.useRef(null),[i,n]=d.useState(!1),[s,a]=d.useState(!1),[c,l]=d.useState(null),[h,u]=d.useState([]),[f,w]=d.useState([]),[g,p]=d.useState(""),[y,m]=d.useState(""),[b,v]=d.useState(!1),A=d.useCallback(()=>{r.current&&(r.current.getTracks().forEach(N=>N.stop()),r.current=null,l(null))},[]),E=d.useCallback(async()=>{var N,L,B,H;try{const j=await navigator.mediaDevices.enumerateDevices(),q=j.filter(D=>D.kind==="audioinput"),O=j.filter(D=>D.kind==="videoinput");if(u(q),w(O),!g&&q.length>0){const D=(N=r.current)==null?void 0:N.getAudioTracks()[0],Q=D==null?void 0:D.getSettings().deviceId;p(Q||((L=q[0])==null?void 0:L.deviceId)||"")}if(!y&&O.length>0){const D=(B=r.current)==null?void 0:B.getVideoTracks()[0],Q=D==null?void 0:D.getSettings().deviceId;m(Q||((H=O[0])==null?void 0:H.deviceId)||"")}}catch(j){console.error("Error enumerating devices:",j)}},[g,y]),T=d.useCallback(async(N,L)=>{const B={width:{ideal:1280},height:{ideal:720},...L?{deviceId:{exact:L}}:{facingMode:"user"}},H={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0,sampleRate:{ideal:16e3},channelCount:{ideal:1},...N?{deviceId:{exact:N}}:{}};let j=null;try{j=await navigator.mediaDevices.getUserMedia({video:B,audio:H}),n(!0),a(!0)}catch(q){console.warn("Combined media request failed, trying individual.",q);try{const O=await navigator.mediaDevices.getUserMedia({audio:H});n(!0),j=O}catch(O){console.error("Audio permission denied",O),n(!1)}try{const O=await navigator.mediaDevices.getUserMedia({video:B});a(!0),j?O.getTracks().forEach(D=>j.addTrack(D)):j=O}catch(O){console.error("Video permission denied",O),a(!1)}}j?(r.current=j,l(j),t.current&&(t.current.srcObject=j,await t.current.play().catch(q=>console.error("Error playing video element",q)))):(r.current=null,l(null)),await E()},[E]),_=async N=>{N!==g&&(v(!0),p(N),A(),await T(N,y),v(!1))},P=async N=>{N!==y&&(v(!0),m(N),A(),await T(g,N),v(!1))};return d.useEffect(()=>{if(!e){A();return}return T(),()=>A()},[e]),{videoRef:t,audioAllowed:i,videoAllowed:s,audioDevices:h,videoDevices:f,selectedAudioDeviceId:g,selectedVideoDeviceId:y,isDeviceLoading:b,currentStream:c,handleAudioChange:_,handleVideoChange:P,stopStream:A}},wi=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),o.jsx("path",{d:"M12 9v4"}),o.jsx("path",{d:"M12 17h.01"})]}),Yl=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-bolt-icon prefix__lucide-bolt",...e,children:[o.jsx("path",{d:"M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z"}),o.jsx("circle",{cx:12,cy:12,r:4})]}),Xl=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-camera-off-icon prefix__lucide-camera-off",...e,children:[o.jsx("path",{d:"M14.564 14.558a3 3 0 11-4.122-4.121M2 2l20 20"}),o.jsx("path",{d:"M20 20H4a2 2 0 01-2-2V9a2 2 0 012-2h1.997a2 2 0 00.819-.175M9.695 4.024A2 2 0 0110.004 4h3.993a2 2 0 011.76 1.05l.486.9A2 2 0 0018.003 7H20a2 2 0 012 2v7.344"})]}),gi=e=>o.jsx("svg",{width:"10",height:"9",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:o.jsx("path",{d:"M0.75 5.5C0.75 5.5 2.35 6.4125 3.15 7.75C3.15 7.75 5.55 2.5 8.75 0.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ql=({className:e})=>o.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:o.jsx("path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),io=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"M12 2a10 10 0 0 1 7.38 16.75"}),o.jsx("path",{d:"M12 6v6l4 2"}),o.jsx("path",{d:"M2.5 8.875a10 10 0 0 0-.5 3"}),o.jsx("path",{d:"M2.83 16a10 10 0 0 0 2.43 3.4"}),o.jsx("path",{d:"M4.636 5.235a10 10 0 0 1 .891-.857"}),o.jsx("path",{d:"M8.644 21.42a10 10 0 0 0 7.631-.38"})]}),pi=e=>o.jsx("svg",{className:"iw-w-5 iw-h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),Jl=e=>o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),o.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),Zl=e=>o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M2.66797 2H13.3346",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M3.66797 2V3.35359C3.66797 4.18151 4.05252 4.96247 4.70874 5.46726L8.0013 8L11.2938 5.46726C11.9501 4.96247 12.3346 4.18151 12.3346 3.35359V2",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M3.66797 14V12.6464C3.66797 11.8185 4.05252 11.0375 4.70874 10.5327L8.0013 8L11.2938 10.5327C11.9501 11.0375 12.3346 11.8185 12.3346 12.6464V14",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M2.66797 14H13.3346",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"})]}),no=({className:e,...t})=>o.jsx("div",{children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:`iw-animate-spin ${e}`,...t,children:[o.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M12 6l0 -3"}),o.jsx("path",{d:"M16.25 7.75l2.15 -2.15"}),o.jsx("path",{d:"M18 12l3 0"}),o.jsx("path",{d:"M16.25 16.25l2.15 2.15"}),o.jsx("path",{d:"M12 18l0 3"}),o.jsx("path",{d:"M7.75 16.25l-2.15 2.15"}),o.jsx("path",{d:"M6 12l-3 0"}),o.jsx("path",{d:"M7.75 7.75l-2.15 -2.15"})]})}),Rl=e=>o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M17 7V11C17 13.7614 14.7614 16 12 16C9.23858 16 7 13.7614 7 11V7C7 4.23858 9.23858 2 12 2C14.7614 2 17 4.23858 17 7Z",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M20 11C20 15.4183 16.4183 19 12 19M12 19C7.58172 19 4 15.4183 4 11M12 19V22M12 22H15M12 22H9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),so=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-target-icon prefix__lucide-target",...e,children:[o.jsx("circle",{cx:12,cy:12,r:10}),o.jsx("circle",{cx:12,cy:12,r:6}),o.jsx("circle",{cx:12,cy:12,r:2})]}),ed=e=>o.jsxs("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-users-icon prefix__lucide-users",...e,children:[o.jsx("path",{d:"M16 21v-2a4 4 0 00-4-4H6a4 4 0 00-4 4v2M16 3.128a4 4 0 010 7.744M22 21v-2a4 4 0 00-3-3.87"}),o.jsx("circle",{cx:9,cy:7,r:4})]}),td=e=>o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M11 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),o.jsx("path",{d:"M2 11C2 7.70017 2 6.05025 3.02513 5.02513C4.05025 4 5.70017 4 9 4H10C13.2998 4 14.9497 4 15.9749 5.02513C17 6.05025 17 7.70017 17 11V13C17 16.2998 17 17.9497 15.9749 18.9749C14.9497 20 13.2998 20 10 20H9C5.70017 20 4.05025 20 3.02513 18.9749C2 17.9497 2 16.2998 2 13V11Z",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M17 8.90585L17.1259 8.80196C19.2417 7.05623 20.2996 6.18336 21.1498 6.60482C22 7.02628 22 8.42355 22 11.2181V12.7819C22 15.5765 22 16.9737 21.1498 17.3952C20.2996 17.8166 19.2417 16.9438 17.1259 15.198L17 15.0941",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),rd=e=>o.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[o.jsx("path",{d:"M8.16651 8.63991V5.35747C8.16651 3.52277 8.16651 2.60542 7.62675 2.37712C7.08699 2.14882 6.45168 2.79749 5.18119 4.09482C4.52323 4.76666 4.14784 4.91543 3.2117 4.91543C2.39301 4.91543 1.98366 4.91543 1.68961 5.11606C1.07921 5.53252 1.17148 6.34653 1.17148 6.9987C1.17148 7.65086 1.07921 8.46485 1.68961 8.88135C1.98366 9.08196 2.39301 9.08196 3.2117 9.08196C4.14784 9.08196 4.52323 9.23076 5.18119 9.90259C6.45168 11.1999 7.08699 11.8486 7.62675 11.6203C8.16651 11.392 8.16651 10.4746 8.16651 8.63991Z",stroke:"currentColor",strokeWidth:"0.875",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M9.9165 5.25C10.2813 5.72815 10.4998 6.33698 10.4998 7C10.4998 7.66302 10.2813 8.27184 9.9165 8.75",stroke:"currentColor",strokeWidth:"0.875",strokeLinecap:"round",strokeLinejoin:"round"}),o.jsx("path",{d:"M11.6665 4.08203C12.3961 4.87894 12.8332 5.89369 12.8332 6.9987C12.8332 8.10371 12.3961 9.11847 11.6665 9.91536",stroke:"currentColor",strokeWidth:"0.875",strokeLinecap:"round",strokeLinejoin:"round"})]}),Ce={FACE_DETECTED:"face_detected",NO_FACE:"no_face_detected",MULTIPLE_FACES:"multiple_faces",LOOKING_AWAY:"looking_away",CAMERA_ERROR:"camera_error",MODEL_LOADING:"model_loading"},oo={[Ce.FACE_DETECTED]:{icon:Jl,iconColor:"iw-text-green-600",iconBg:"iw-bg-green-50",iconBorder:"iw-border-green-100",title:"All Good",subtitle:"Everything looks normal",description:"Your gaze is properly focused on the screen. Continue with your interview.",buttonText:"Continue"},[Ce.NO_FACE]:{icon:Xl,iconColor:"iw-text-orange-600",iconBg:"iw-bg-orange-50",iconBorder:"iw-border-orange-100",title:"Face Not Detected",subtitle:"We can't see you in the camera",description:"Please ensure you're positioned properly in front of the camera and that your face is clearly visible.",buttonText:"I Understood"},[Ce.MULTIPLE_FACES]:{icon:ed,iconColor:"iw-text-red-600",iconBg:"iw-bg-red-50",iconBorder:"iw-border-red-100",title:"Multiple People Detected",subtitle:"More than one person is visible on the screen.",buttonText:"I Understood"},[Ce.LOOKING_AWAY]:{icon:so,iconColor:"iw-text-amber-600",iconBg:"iw-bg-amber-50",iconBorder:"iw-border-amber-200/75",title:"Focus Alert",subtitle:"You looked away from the screen. Maintain focus to continue.",buttonText:"I Understood"},[Ce.CAMERA_ERROR]:{icon:wi,iconColor:"iw-text-red-600",iconBg:"iw-bg-red-50",iconBorder:"iw-border-red-100",title:"Camera Issue",subtitle:"There's a problem with your camera",description:"Please check your camera connection and permissions, contact support if the problem continues.",buttonText:"I Understood"},[Ce.MODEL_LOADING]:{icon:so,iconColor:"iw-text-blue-600",iconBg:"iw-bg-blue-50",iconBorder:"iw-border-blue-100",title:"Initializing Model",subtitle:"Please wait while we set up the AI",description:"The face detection model is being loaded. This should only take a moment.",buttonText:"Wait"}};function id(e){var t;if(!navigator.onLine)return{type:"network",message:"No internet connection",retryable:!0,userMessage:"Please check your internet connection and try again."};if(e.name==="AbortError"||(t=e.message)!=null&&t.includes("timeout"))return{type:"timeout",message:"Request timed out",retryable:!0,userMessage:"The request is taking longer than expected. Please try again."};if(e.status){const{status:r}=e;if(r===401||r===403)return{type:"auth",status:r,message:"Authentication failed",retryable:!1,userMessage:"Your session has expired. Please refresh the page."};if(r===429)return{type:"rate-limit",status:r,message:"Too many requests",retryable:!0,userMessage:"Please wait a moment before trying again."};if(r>=500)return{type:"server",status:r,message:`Server error: ${r}`,retryable:!0,userMessage:"Our servers are experiencing issues. Please try again in a few moments."};if(r>=400)return{type:"client",status:r,message:`Client error: ${r}`,retryable:!1,userMessage:"There was an issue with your request. Please check your input."}}return{type:"unknown",message:e.message||"Unknown error occurred",retryable:!0,userMessage:"Something unexpected happened. Please try again.",originalError:e}}async function xt(e,t={},r={attempts:3,backoff:"exponential",baseDelay:1e3,maxDelay:1e4,jitter:!0}){let i;for(let n=1;n<=r.attempts;n++)try{const s=new AbortController,a=setTimeout(()=>s.abort(),6e4),c=await fetch(e,{...t,signal:s.signal});if(clearTimeout(a),c.status>=400&&c.status<500&&c.status!==429)return c;if(!c.ok)throw new Error(`HTTP ${c.status}: ${c.statusText}`);return c}catch(s){i=s;const a=id(s);if(!a.retryable||n===r.attempts)throw a;const c=nd(n,r);console.warn(`API request failed (attempt ${n}/${r.attempts}), retrying in ${c}ms:`,a.message),await new Promise(l=>setTimeout(l,c))}throw i}function nd(e,t){let r;return t.backoff==="exponential"?r=t.baseDelay*Math.pow(2,e-1):r=t.baseDelay,r=Math.min(r,t.maxDelay),t.jitter&&(r=r*(.5+Math.random()*.5)),Math.round(r)}const Et={v2:"/v2"},_t={GENERATE_QUESTION:e=>`${Et.v2}/interviews/${e}/next-question`,SCREENSHOT_UPLOAD:e=>`${Et.v2}/interviews/${e}/assets/upload-url`,CONFIRM_UPLOAD:e=>`${Et.v2}/interviews/assets/${e}/confirm`,TRANSCRIBE_ANSWER:e=>`${Et.v2}/interviews/${e}/transcribe-answer`,SUBMIT_ANSWER:e=>`${Et.v2}/interviews/${e}/submit-answer`,EXIT:e=>`${Et.v2}/interviews/${e}/exit`,CONFIG:e=>`${Et.v2}/interviews/${e}/config`,TRANSCRIPTION:e=>`${Et.v2}/interviews/${e}/transcript`};class ao{constructor(t={}){ye(this,"config");this.config=t}updateConfig(t){this.config={...this.config,...t}}getHeaders(){var r;const t={"Content-Type":"application/json"};return(r=this.config)!=null&&r.authToken&&(t.Authorization=`Bearer ${this.config.authToken}`),t}getBaseUrl(){var t;return((t=this.config)==null?void 0:t.baseUrl)||"/api"}async generateQuestion({interviewId:t,isInterviewDone:r=!1}){const i=await xt(`${this.getBaseUrl()}${_t.GENERATE_QUESTION(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({interview_id:t,is_interview_done:r})});if(!i.ok)throw new Error(`Failed to get questions: ${i.status}`);return await i.json()}async submitAnswer({interviewId:t,qnaId:r,answer:i}){const n=await xt(`${this.getBaseUrl()}${_t.SUBMIT_ANSWER(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({qna_id:r,answer_text:i})});if(!n.ok)throw new Error(`Failed to submit answer: ${n.status}`);return await n.json()}async exitInterview(t){const r=await xt(`${this.getBaseUrl()}${_t.EXIT(t)}`,{method:"POST",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to exit interview: ${r.status}`)}async getInterviewConfig(t){const r=await xt(`${this.getBaseUrl()}${_t.CONFIG(t)}`,{method:"GET",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to get interview config: ${r.status}`);return await r.json()}async requestScreenshotUploadUrl(t,r=`screenshot-${Date.now()}.jpeg`){const i=await xt(`${this.getBaseUrl()}${_t.SCREENSHOT_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({filename:r,mime_type:"image/jpeg",asset_type:Tl.SCREENSHOT})});if(!i.ok)throw new Error(`Failed to request screenshot upload URL: ${i.status}`);return await i.json()}async uploadScreenshot(t,r){const i=await fetch(t,{method:"PUT",body:r,headers:{"Content-Type":"image/jpeg"}});if(!i.ok)throw new Error(`Failed to upload screenshot: ${i.status}`)}async confirmScreenshotUpload(t){const r=await xt(`${this.getBaseUrl()}${_t.CONFIRM_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to confirm screenshot upload: ${r.status}`)}async getInterviewTranscription(t){const r=await xt(`${this.getBaseUrl()}${_t.TRANSCRIPTION(t)}`,{method:"GET",headers:{...this.getHeaders()}});if(!r.ok)throw new Error(`Failed to get interview transcription: ${r.status}`);return await r.json()}}const mi=new ao,sd=({gazeAnalysisEnabled:e,isModelLoaded:t,stats:r,statusMessage:i,loadingProgress:n})=>o.jsx("div",{className:"iw-w-full",children:o.jsxs("div",{className:"iw-border-strock iw-rounded-md iw-border iw-bg-gray-50 iw-p-4",children:[o.jsxs("h3",{className:"iw-m-0 iw-mb-2.5",children:["Status: ",i]}),n>0&&n<100&&o.jsxs("div",{className:"iw-mb-2.5",children:[o.jsx("div",{className:"iw-h-2 iw-w-full iw-rounded iw-bg-gray-300",children:o.jsx("div",{className:"iw-h-full iw-rounded iw-bg-blue-600 iw-transition-all iw-duration-300 iw-ease-out",style:{width:`${n}%`}})}),o.jsxs("small",{className:"iw-text-gray-600",children:["Loading model... ",n.toFixed(1),"%"]})]}),o.jsxs("div",{className:"iw-grid iw-grid-cols-2 iw-gap-2.5 iw-text-sm",children:[o.jsxs("div",{children:[o.jsx("strong",{children:"FPS:"})," ",o.jsx("span",{className:r.fps<15?"iw-text-red-600":r.fps<25?"iw-text-orange-500":"iw-text-green-600",children:r.fps})]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Model:"})," ",t?"✓ Loaded":"✗ Loading"]}),e&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("strong",{children:"Engagement:"})," ",r.engagement.toFixed(1),"%"]}),o.jsxs("div",{children:[o.jsx("strong",{children:"Looking:"})," ",o.jsx("span",{className:r.isLookingAway?"iw-text-red-600":"iw-text-green-600",children:r.isLookingAway?"Away":"At Screen"})]})]})]}),r.referenceFaceNotDetected&&o.jsxs("div",{className:"iw-text-gray-dark iw-mt-2.5 iw-w-full iw-rounded-md iw-bg-[#ffeb3b] iw-p-2.5 iw-text-sm",children:[o.jsx("strong",{children:"Reference Face Not Detected"}),o.jsx("br",{}),"The previously set reference face is no longer in view."]}),r.multipleFacesDetected&&o.jsxs("div",{className:"iw-mt-2.5 iw-rounded iw-bg-red-50 iw-p-2.5 iw-text-sm iw-text-red-700",children:[o.jsx("strong",{children:"Multiple Faces Detected"}),o.jsx("br",{}),"Please ensure only one person is in the frame."]}),!e&&o.jsxs("div",{className:"iw-mt-2.5 iw-rounded iw-bg-blue-50 iw-p-2.5 iw-text-sm iw-text-blue-700",children:[o.jsx("strong",{children:"Gaze Analysis Disabled"}),o.jsx("br",{}),"Enable to track engagement and attention levels."]})]})}),od=({showControls:e,isBubbleOpen:t,setIsBubbleOpen:r,setReference:i,clearCache:n,isModelLoaded:s,gazeAnalysisEnabled:a,referenceSet:c,showLandmarks:l,setShowLandmarks:h,showEngagementBar:u,setShowEngagementBar:f,handleToggleGazeAnalysis:w,stats:g,statusMessage:p,loadingProgress:y})=>e?o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>r(!t),className:"iw-absolute iw-right-4 iw-bottom-4 iw-z-10 iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-full iw-text-white",children:o.jsx(Yl,{className:"iw-size-4.5"})}),t&&o.jsxs("div",{className:"iw-absolute iw-right-4 iw-bottom-16 iw-z-10 iw-max-h-96 iw-w-80 iw-overflow-y-auto iw-rounded-md iw-bg-gray-50 iw-p-4 iw-shadow-lg",children:[o.jsx("h4",{className:"m-0 mb-2.5",children:"Controls"}),o.jsx("button",{onClick:i,disabled:!s||!a,className:`iw-mb-2.5 iw-block iw-w-full iw-rounded border-none iw-px-4 iw-py-2 iw-text-sm iw-text-white ${!s||!a?"iw-cursor-not-allowed iw-bg-gray-400":"iw-cursor-pointer iw-bg-blue-600 hover:iw-bg-blue-700"}`,children:c?"Reference Set ✓":"Set Reference"}),o.jsx("button",{onClick:n,className:"iw-mb-4 iw-block iw-w-full iw-cursor-pointer iw-rounded iw-border-none iw-bg-red-600 iw-px-4 iw-py-2 iw-text-sm iw-text-white hover:iw-bg-red-700",children:"Clear Model Cache"}),o.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-2.5",children:[o.jsxs("label",{className:"iw-flex iw-cursor-pointer iw-items-center iw-gap-2",children:[o.jsx("input",{type:"checkbox",checked:a,onChange:m=>w(m.target.checked)}),o.jsx("strong",{children:"Enable Gaze Analysis"})]}),o.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${a?"iw-opacity-100":"iw-opacity-60"}`,children:[o.jsx("input",{type:"checkbox",checked:l,onChange:m=>h(m.target.checked),disabled:!a}),"Show Landmarks"]}),o.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${a?"iw-opacity-100":"iw-opacity-60"}`,children:[o.jsx("input",{type:"checkbox",checked:u,onChange:m=>f(m.target.checked),disabled:!a}),"Show Engagement Bar"]})]}),c&&o.jsx(sd,{gazeAnalysisEnabled:a,isModelLoaded:s,loadingProgress:y,stats:g,statusMessage:p})]})]}):null;var Rt=typeof self<"u"?self:{};function Gr(e,t){e:{for(var r=["CLOSURE_FLAGS"],i=Rt,n=0;n<r.length;n++)if((i=i[r[n]])==null){r=null;break e}r=i}return(e=r&&r[e])!=null?e:t}function Ot(){throw Error("Invalid UTF8")}function co(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let yi,vn;const ad=typeof TextDecoder<"u";let cd;const ld=typeof TextEncoder<"u";function lo(e){if(ld)e=(cd||(cd=new TextEncoder)).encode(e);else{let r=0;const i=new Uint8Array(3*e.length);for(let n=0;n<e.length;n++){var t=e.charCodeAt(n);if(t<128)i[r++]=t;else{if(t<2048)i[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&n<e.length){const s=e.charCodeAt(++n);if(s>=56320&&s<=57343){t=1024*(t-55296)+s-56320+65536,i[r++]=t>>18|240,i[r++]=t>>12&63|128,i[r++]=t>>6&63|128,i[r++]=63&t|128;continue}n--}t=65533}i[r++]=t>>12|224,i[r++]=t>>6&63|128}i[r++]=63&t|128}}e=r===i.length?i:i.subarray(0,r)}return e}function uo(e){Rt.setTimeout(()=>{throw e},0)}var xn,dd=Gr(610401301,!1),ho=Gr(748402147,!0),En=Gr(824648567,!0),_n=Gr(824656860,Gr(1,!0));function fo(){var e=Rt.navigator;return e&&(e=e.userAgent)?e:""}const wo=Rt.navigator;function bi(e){return bi[" "](e),e}xn=wo&&wo.userAgentData||null,bi[" "]=function(){};const go={};let jr=null;function ud(e){const t=e.length;let r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);const i=new Uint8Array(r);let n=0;return function(s,a){function c(h){for(;l<s.length;){const u=s.charAt(l++),f=jr[u];if(f!=null)return f;if(!/^[\s\xa0]*$/.test(u))throw Error("Unknown base64 encoding at char: "+u)}return h}po();let l=0;for(;;){const h=c(-1),u=c(0),f=c(64),w=c(64);if(w===64&&h===-1)break;a(h<<2|u>>4),f!=64&&(a(u<<4&240|f>>2),w!=64&&a(f<<6&192|w))}}(e,function(s){i[n++]=s}),n!==r?i.subarray(0,n):i}function po(){if(!jr){jr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const i=e.concat(t[r].split(""));go[r]=i;for(let n=0;n<i.length;n++){const s=i[n];jr[s]===void 0&&(jr[s]=n)}}}}var hd=typeof Uint8Array<"u",mo=!(!(dd&&xn&&xn.brands.length>0)&&(fo().indexOf("Trident")!=-1||fo().indexOf("MSIE")!=-1))&&typeof btoa=="function";const yo=/[-_.]/g,fd={"-":"+",_:"/",".":"="};function wd(e){return fd[e]||""}function bo(e){if(!mo)return ud(e);e=yo.test(e)?e.replace(yo,wd):e,e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function kn(e){return hd&&e!=null&&e instanceof Uint8Array}var er={};function Bt(){return gd||(gd=new nt(null,er))}function Sn(e){vo(er);var t=e.g;return(t=t==null||kn(t)?t:typeof t=="string"?bo(t):null)==null?t:e.g=t}var nt=class{h(){return new Uint8Array(Sn(this)||0)}constructor(e,t){if(vo(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let gd,pd;function vo(e){if(e!==er)throw Error("illegal external caller")}function xo(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function An(e){return xo(e=Error(e),"warning"),e}function tr(e,t){if(e!=null){var r=pd??(pd={}),i=r[e]||0;i>=t||(r[e]=i+1,xo(e=Error(),"incident"),uo(e))}}function rr(){return typeof BigInt=="function"}var ir=typeof Symbol=="function"&&typeof Symbol()=="symbol";function st(e,t,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var md=st("jas",void 0,!0),Eo=st(void 0,"0di"),$r=st(void 0,"1oa"),Ie=st(void 0,Symbol()),yd=st(void 0,"0ub"),bd=st(void 0,"0ubs"),Cn=st(void 0,"0ubsb"),vd=st(void 0,"0actk"),nr=st("m_m","Pa",!0),_o=st();const ko={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},So=Object.defineProperties,k=ir?md:"Ga";var Ut;const Ao=[];function zr(e,t){ir||k in e||So(e,ko),e[k]|=t}function de(e,t){ir||k in e||So(e,ko),e[k]=t}function Wr(e){return zr(e,34),e}function Hr(e){return zr(e,8192),e}de(Ao,7),Ut=Object.freeze(Ao);var sr={};function Fe(e,t){return t===void 0?e.h!==Vt&&!!(2&(0|e.v[k])):!!(2&t)&&e.h!==Vt}const Vt={};function Tn(e,t){if(e!=null){if(typeof e=="string")e=e?new nt(e,er):Bt();else if(e.constructor!==nt)if(kn(e))e=e.length?new nt(new Uint8Array(e),er):Bt();else{if(!t)throw Error();e=void 0}}return e}class Co{constructor(t,r,i){this.g=t,this.h=r,this.l=i}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var xd=Object.freeze({});function To(e,t,r){const i=128&t?0:-1,n=e.length;var s;(s=!!n)&&(s=(s=e[n-1])!=null&&typeof s=="object"&&s.constructor===Object);const a=n+(s?-1:0);for(t=128&t?1:0;t<a;t++)r(t-i,e[t]);if(s){e=e[n-1];for(const c in e)!isNaN(c)&&r(+c,e[c])}}var No={};function or(e){return 128&e?No:void 0}function vi(e){return e.Na=!0,e}var Ed=vi(e=>typeof e=="number"),Io=vi(e=>typeof e=="string"),_d=vi(e=>typeof e=="boolean"),xi=typeof Rt.BigInt=="function"&&typeof Rt.BigInt(0)=="bigint";function Le(e){var t=e;if(Io(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(Ed(t)&&!Number.isSafeInteger(t))throw Error(String(t));return xi?BigInt(e):e=_d(e)?e?"1":"0":Io(e)?e.trim()||"0":String(e)}var Nn=vi(e=>xi?e>=Sd&&e<=Cd:e[0]==="-"?Fo(e,kd):Fo(e,Ad));const kd=Number.MIN_SAFE_INTEGER.toString(),Sd=xi?BigInt(Number.MIN_SAFE_INTEGER):void 0,Ad=Number.MAX_SAFE_INTEGER.toString(),Cd=xi?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Fo(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){const i=e[r],n=t[r];if(i>n)return!1;if(i<n)return!0}}const Td=typeof Uint8Array.prototype.slice=="function";let Nd,ee=0,ae=0;function Lo(e){const t=e>>>0;ee=t,ae=(e-t)/4294967296>>>0}function ar(e){if(e<0){Lo(-e);const[t,r]=Dn(ee,ae);ee=t>>>0,ae=r>>>0}else Lo(e)}function In(e){const t=Nd||(Nd=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),ae=0,ee=t.getUint32(0,!0)}function Fn(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:qr(e,t)}function Id(e,t){return Le(rr()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):qr(e,t))}function Ln(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Fn(e,t))=="number"?r?-e:e:r?"-"+e:e}function Mo(e,t){return rr()?Le(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):Le(Mn(e,t))}function qr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else rr()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+Do(r)+Do(e));return r}function Do(e){return e=String(e),"0000000".slice(e.length)+e}function Mn(e,t){if(2147483648&t)if(rr())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,i]=Dn(e,t);e="-"+qr(r,i)}else e=qr(e,t);return e}function Ei(e){if(e.length<16)ar(Number(e));else if(rr())e=BigInt(e),ee=Number(e&BigInt(4294967295))>>>0,ae=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");ae=ee=0;const r=e.length;for(let i=t,n=(r-t)%6+t;n<=r;i=n,n+=6){const s=Number(e.slice(i,n));ae*=1e6,ee=1e6*ee+s,ee>=4294967296&&(ae+=Math.trunc(ee/4294967296),ae>>>=0,ee>>>=0)}if(t){const[i,n]=Dn(ee,ae);ee=i,ae=n}}}function Dn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Ze(e){return Array.prototype.slice.call(e)}const Kr=typeof BigInt=="function"?BigInt.asIntN:void 0,Fd=typeof BigInt=="function"?BigInt.asUintN:void 0,Gt=Number.isSafeInteger,_i=Number.isFinite,cr=Math.trunc,Ld=Le(0);function Yr(e){if(e!=null&&typeof e!="number")throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);return e}function ot(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Xr(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}function Po(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Md=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Qr(e){switch(typeof e){case"bigint":return!0;case"number":return _i(e);case"string":return Md.test(e);default:return!1}}function lr(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return _i(e)?0|e:void 0}function Oo(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return _i(e)?e>>>0:void 0}function Bo(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(Ei(e),Mn(ee,ae))}function Pn(e){return e=cr(e),Gt(e)||(ar(e),e=Ln(ee,ae)),e}function Uo(e){var t=cr(Number(e));return Gt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Bo(e))}function Vo(e){var t=cr(Number(e));return Gt(t)?Le(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),rr()?Le(Kr(64,BigInt(e))):Le(Bo(e)))}function Go(e){return Gt(e)?e=Le(Pn(e)):(e=cr(e),Gt(e)?e=String(e):(ar(e),e=Mn(ee,ae)),e=Le(e)),e}function Dd(e){return e==null?e:typeof e=="bigint"?(Nn(e)?e=Number(e):(e=Kr(64,e),e=Nn(e)?Number(e):String(e)),e):Qr(e)?typeof e=="number"?Pn(e):Uo(e):void 0}function ki(e){const t=typeof e;return e==null?e:t==="bigint"?Le(Kr(64,e)):Qr(e)?t==="string"?Vo(e):Go(e):void 0}function jo(e){if(typeof e!="string")throw Error();return e}function Jr(e){if(e!=null&&typeof e!="string")throw Error();return e}function ve(e){return e==null||typeof e=="string"?e:void 0}function On(e,t,r,i){return e!=null&&e[nr]===sr?e:Array.isArray(e)?((i=(r=0|e[k])|32&i|2&i)!==r&&de(e,i),new t(e)):(r?2&i?((e=t[Eo])||(Wr((e=new t).v),e=t[Eo]=e),t=e):t=new t:t=void 0,t)}function Pd(e,t,r){if(t)e:{if(!Qr(t=e))throw An("int64");switch(typeof t){case"string":t=Vo(t);break e;case"bigint":t=Le(Kr(64,t));break e;default:t=Go(t)}}else t=ki(e);return(e=t)==null?r?Ld:void 0:e}const Od={};let Bd=function(){try{return bi(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class Bn{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}}const Ud=Bd?(Object.setPrototypeOf(Bn.prototype,Map.prototype),Object.defineProperties(Bn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Bn):class extends Map{constructor(){super()}};function $o(e){return e}function Un(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var gt=class extends Ud{constructor(e,t,r=$o,i=$o){super(),this.J=0|e[k],this.K=t,this.S=r,this.fa=this.K?Vd:i;for(let n=0;n<e.length;n++){const s=e[n],a=r(s[0],!1,!0);let c=s[1];t?c===void 0&&(c=null):c=i(s[1],!1,!0,void 0,void 0,this.J),super.set(a,c)}}V(e){return Hr(Array.from(super.entries(),e))}clear(){Un(this),super.clear()}delete(e){return Un(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new Co(e,Gd,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new Co(e,gt.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach((r,i,n)=>{e.call(t,n.get(i),i,n)}):super.forEach(e,t)}set(e,t){return Un(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.fa(t,!0,!0,this.K,!1,this.J))}Ma(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var r=this.K;return r?((r=this.fa(t,!1,!0,r,this.ra,this.J))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function Vd(e,t,r,i,n,s){return e=On(e,i,r,s),n&&(e=jn(e)),e}function Gd(e){return[e,this.get(e)]}let jd;function zo(){return jd||(jd=new gt(Wr([]),void 0,void 0,void 0,Od))}function Si(e){return Ie?e[Ie]:void 0}function Ai(e,t){for(const r in e)!isNaN(r)&&t(e,+r,e[r])}gt.prototype.toJSON=void 0;var Vn=class{};const $d={Ka:!0};function zd(e,t){t<100||tr(bd,1)}function Ci(e,t,r,i){const n=i!==void 0;i=!!i;var s,a=Ie;!n&&ir&&a&&(s=e[a])&&Ai(s,zd),a=[];var c=e.length;let l;s=4294967295;let h=!1;const u=!!(64&t),f=u?128&t?0:-1:void 0;1&t||(l=c&&e[c-1],l!=null&&typeof l=="object"&&l.constructor===Object?s=--c:l=void 0,!u||128&t||n||(h=!0,s=s-f+f)),t=void 0;for(var w=0;w<c;w++){let g=e[w];if(g!=null&&(g=r(g,i))!=null)if(u&&w>=s){const p=w-f;(t??(t={}))[p]=g}else a[w]=g}if(l)for(let g in l){if((c=l[g])==null||(c=r(c,i))==null)continue;let p;w=+g,u&&!Number.isNaN(w)&&(p=w+f)<s?a[p]=c:(t??(t={}))[g]=c}return t&&(h?a.push(t):a[s]=t),n&&Ie&&(e=Si(e))&&e instanceof Vn&&(a[Ie]=function(g){const p=new Vn;return Ai(g,(y,m,b)=>{p[m]=Ze(b)}),p.da=g.da,p}(e)),a}function Wd(e){return e[0]=Zr(e[0]),e[1]=Zr(e[1]),e}function Zr(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Nn(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[k];return e.length===0&&1&t?void 0:Ci(e,t,Zr)}if(e!=null&&e[nr]===sr)return Wo(e);if(e instanceof nt){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(mo){for(var r="",i=0,n=t.length-10240;i<n;)r+=String.fromCharCode.apply(null,t.subarray(i,i+=10240));r+=String.fromCharCode.apply(null,i?t.subarray(i):t),t=btoa(r)}else{r===void 0&&(r=0),po(),r=go[r],i=Array(Math.floor(t.length/3)),n=r[64]||"";let h=0,u=0;for(;h<t.length-2;h+=3){var s=t[h],a=t[h+1],c=t[h+2],l=r[s>>2];s=r[(3&s)<<4|a>>4],a=r[(15&a)<<2|c>>6],c=r[63&c],i[u++]=l+s+a+c}switch(l=0,c=n,t.length-h){case 2:c=r[(15&(l=t[h+1]))<<2]||n;case 1:t=t[h],i[u]=r[t>>2]+r[(3&t)<<4|l>>4]+c+n}t=i.join("")}e=e.g=t}return e}return e instanceof gt?e=e.size!==0?e.V(Wd):void 0:void 0}return e}function Wo(e){return Ci(e=e.v,0|e[k],Zr)}let Hd,qd;function jt(e,t){return Ho(e,t[0],t[1])}function Ho(e,t,r,i=0){if(e==null){var n=32;r?(e=[r],n|=128):e=[],t&&(n=-16760833&n|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(n=0|e[k],ho&&1&n)throw Error("rfarr");if(2048&n&&!(2&n)&&function(){if(ho)throw Error("carr");tr(vd,5)}(),256&n)throw Error("farr");if(64&n)return(n|i)!==n&&de(e,n|i),e;if(r&&(n|=128,r!==e[0]))throw Error("mid");e:{n|=64;var s=(r=e).length;if(s){var a=s-1;const l=r[a];if(l!=null&&typeof l=="object"&&l.constructor===Object){if((a-=t=128&n?0:-1)>=1024)throw Error("pvtlmt");for(var c in l)(s=+c)<a&&(r[s+t]=l[c],delete l[c]);n=-16760833&n|(1023&a)<<14;break e}}if(t){if((c=Math.max(t,s-(128&n?0:-1)))>1024)throw Error("spvt");n=-16760833&n|(1023&c)<<14}}}return de(e,64|n|i),e}function Kd(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var r=0|e[k];return e.length===0&&1&r?void 0:qo(e,r,t)}if(e!=null&&e[nr]===sr)return Ko(e);if(e instanceof gt){if(2&(t=e.J))return e;if(!e.size)return;if(r=Wr(e.V()),e.K)for(e=0;e<r.length;e++){const i=r[e];let n=i[1];n=n==null||typeof n!="object"?void 0:n!=null&&n[nr]===sr?Ko(n):Array.isArray(n)?qo(n,0|n[k],!!(32&t)):void 0,i[1]=n}return r}return e instanceof nt?e:void 0}function qo(e,t,r){return 2&t||(!r||4096&t||16&t?e=dr(e,t,!1,r&&!(16&t)):(zr(e,34),4&t&&Object.freeze(e))),e}function Gn(e,t,r){return e=new e.constructor(t),r&&(e.h=Vt),e.m=Vt,e}function Ko(e){const t=e.v,r=0|t[k];return Fe(e,r)?e:$n(e,t,r)?Gn(e,t):dr(t,r)}function dr(e,t,r,i){return i??(i=!!(34&t)),e=Ci(e,t,Kd,i),i=32,r&&(i|=2),de(e,t=16769217&t|i),e}function jn(e){const t=e.v,r=0|t[k];return Fe(e,r)?$n(e,t,r)?Gn(e,t,!0):new e.constructor(dr(t,r,!1)):e}function ur(e){if(e.h!==Vt)return!1;var t=e.v;return zr(t=dr(t,0|t[k]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function hr(e){if(!ur(e)&&Fe(e,0|e.v[k]))throw Error()}function $t(e,t){t===void 0&&(t=0|e[k]),32&t&&!(4096&t)&&de(e,4096|t)}function $n(e,t,r){return!!(2&r)||!(!(32&r)||4096&r)&&(de(t,2|r),e.h=Vt,!0)}const Yd=Le(0),kt={};function J(e,t,r,i,n){if((t=pt(e.v,t,r,n))!==null||i&&e.m!==Vt)return t}function pt(e,t,r,i){if(t===-1)return null;const n=t+(r?0:-1),s=e.length-1;let a,c;if(!(s<1+(r?0:-1))){if(n>=s)if(a=e[s],a!=null&&typeof a=="object"&&a.constructor===Object)r=a[t],c=!0;else{if(n!==s)return;r=a}else r=e[n];if(i&&r!=null){if((i=i(r))==null)return i;if(!Object.is(i,r))return c?a[t]=i:e[n]=i,i}return r}}function K(e,t,r,i){hr(e),ue(e=e.v,0|e[k],t,r,i)}function ue(e,t,r,i,n){const s=r+(n?0:-1);var a=e.length-1;if(a>=1+(n?0:-1)&&s>=a){const c=e[a];if(c!=null&&typeof c=="object"&&c.constructor===Object)return c[r]=i,t}return s<=a?(e[s]=i,t):(i!==void 0&&(r>=(a=(t??(t=0|e[k]))>>14&1023||536870912)?i!=null&&(e[a+(n?0:-1)]={[r]:i}):e[s]=i),t)}function zt(){return xd===void 0?2:4}function Wt(e,t,r,i,n){let s=e.v,a=0|s[k];i=Fe(e,a)?1:i,n=!!n||i===3,i===2&&ur(e)&&(s=e.v,a=0|s[k]);let c=(e=zn(s,t))===Ut?7:0|e[k],l=Wn(c,a);var h=!(4&l);if(h){4&l&&(e=Ze(e),c=0,l=qt(l,a),a=ue(s,a,t,e));let u=0,f=0;for(;u<e.length;u++){const w=r(e[u]);w!=null&&(e[f++]=w)}f<u&&(e.length=f),r=-513&(4|l),l=r&=-1025,l&=-4097}return l!==c&&(de(e,l),2&l&&Object.freeze(e)),Yo(e,l,s,a,t,i,h,n)}function Yo(e,t,r,i,n,s,a,c){let l=t;return s===1||s===4&&(2&t||!(16&t)&&32&i)?Ht(t)||((t|=!e.length||a&&!(4096&t)||32&i&&!(4096&t||16&t)?2:256)!==l&&de(e,t),Object.freeze(e)):(s===2&&Ht(t)&&(e=Ze(e),l=0,t=qt(t,i),i=ue(r,i,n,e)),Ht(t)||(c||(t|=16),t!==l&&de(e,t))),2&t||!(4096&t||16&t)||$t(r,i),e}function zn(e,t,r){return e=pt(e,t,r),Array.isArray(e)?e:Ut}function Wn(e,t){return 2&t&&(e|=2),1|e}function Ht(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function Xo(e){return Tn(e,!0)}function Qo(e){e=Ze(e);for(let t=0;t<e.length;t++){const r=e[t]=Ze(e[t]);Array.isArray(r[1])&&(r[1]=Wr(r[1]))}return Hr(e)}function St(e,t,r,i){hr(e),ue(e=e.v,0|e[k],t,(i==="0"?Number(r)===0:r===i)?void 0:r)}function fr(e,t,r){if(2&t)throw Error();const i=or(t);let n=zn(e,r,i),s=n===Ut?7:0|n[k],a=Wn(s,t);return(2&a||Ht(a)||16&a)&&(a===s||Ht(a)||de(n,a),n=Ze(n),s=0,a=qt(a,t),ue(e,t,r,n,i)),a&=-13,a!==s&&de(n,a),n}function Hn(e,t){var r=rc;return Kn(qn(e=e.v),e,void 0,r)===t?t:-1}function qn(e){if(ir)return e[$r]??(e[$r]=new Map);if($r in e)return e[$r];const t=new Map;return Object.defineProperty(e,$r,{value:t}),t}function Jo(e,t,r,i,n){const s=qn(e),a=Kn(s,e,t,r,n);return a!==i&&(a&&(t=ue(e,t,a,void 0,n)),s.set(r,i)),t}function Kn(e,t,r,i,n){let s=e.get(i);if(s!=null)return s;s=0;for(let a=0;a<i.length;a++){const c=i[a];pt(t,c,n)!=null&&(s!==0&&(r=ue(t,r,s,void 0,n)),s=c)}return e.set(i,s),s}function Yn(e,t,r){let i=0|e[k];const n=or(i),s=pt(e,r,n);let a;if(s!=null&&s[nr]===sr){if(!Fe(s))return ur(s),s.v;a=s.v}else Array.isArray(s)&&(a=s);if(a){const c=0|a[k];2&c&&(a=dr(a,c))}return a=jt(a,t),a!==s&&ue(e,i,r,a,n),a}function Zo(e,t,r,i,n){let s=!1;if((i=pt(e,i,n,a=>{const c=On(a,r,!1,t);return s=c!==a&&c!=null,c}))!=null)return s&&!Fe(i)&&$t(e,t),i}function $(e,t,r,i){let n=e.v,s=0|n[k];if((t=Zo(n,s,t,r,i))==null)return t;if(s=0|n[k],!Fe(e,s)){const a=jn(t);a!==t&&(ur(e)&&(n=e.v,s=0|n[k]),s=ue(n,s,r,t=a,i),$t(n,s))}return t}function Ro(e,t,r,i,n,s,a,c){var l=Fe(e,r);s=l?1:s,a=!!a||s===3,l=c&&!l,(s===2||l)&&ur(e)&&(r=0|(t=e.v)[k]);var h=(e=zn(t,n))===Ut?7:0|e[k],u=Wn(h,r);if(c=!(4&u)){var f=e,w=r;const g=!!(2&u);g&&(w|=2);let p=!g,y=!0,m=0,b=0;for(;m<f.length;m++){const v=On(f[m],i,!1,w);if(v instanceof i){if(!g){const A=Fe(v);p&&(p=!A),y&&(y=A)}f[b++]=v}}b<m&&(f.length=b),u|=4,u=y?-4097&u:4096|u,u=p?8|u:-9&u}if(u!==h&&(de(e,u),2&u&&Object.freeze(e)),l&&!(8&u||!e.length&&(s===1||s===4&&(2&u||!(16&u)&&32&r)))){for(Ht(u)&&(e=Ze(e),u=qt(u,r),r=ue(t,r,n,e)),i=e,l=u,h=0;h<i.length;h++)(f=i[h])!==(u=jn(f))&&(i[h]=u);l|=8,de(e,u=l=i.length?4096|l:-4097&l)}return Yo(e,u,t,r,n,s,c,a)}function mt(e,t,r){const i=e.v;return Ro(e,i,0|i[k],t,r,zt(),!1,!0)}function ea(e){return e==null&&(e=void 0),e}function F(e,t,r,i,n){return K(e,r,i=ea(i),n),i&&!Fe(i)&&$t(e.v),e}function Rr(e,t,r,i){e:{var n=i=ea(i);hr(e);const s=e.v;let a=0|s[k];if(n==null){const c=qn(s);if(Kn(c,s,a,r)!==t)break e;c.set(r,0)}else a=Jo(s,a,r,t);ue(s,a,t,n)}i&&!Fe(i)&&$t(e.v)}function qt(e,t){return-273&(2&t?2|e:-3&e)}function Xn(e,t,r,i){var n=i;hr(e),e=Ro(e,i=e.v,0|i[k],r,t,2,!0),n=n??new r,e.push(n),t=r=e===Ut?7:0|e[k],(n=Fe(n))?(r&=-9,e.length===1&&(r&=-4097)):r|=4096,r!==t&&de(e,r),n||$t(i)}function $e(e,t,r){return lr(J(e,t,void 0,r))}function ta(e){return(_n?J(e,2,void 0,void 0,ki):ki(J(e,2)))??Yd}function ne(e,t){return J(e,t,void 0,void 0,ot)??0}function yt(e,t,r){if(r!=null){if(typeof r!="number"||!_i(r))throw An("int32");r|=0}K(e,t,r)}function I(e,t,r){K(e,t,Yr(r))}function Me(e,t,r){St(e,t,Jr(r),"")}function Ti(e,t,r){{hr(e);const a=e.v;let c=0|a[k];if(r==null)ue(a,c,t);else{var i=e=r===Ut?7:0|r[k],n=Ht(e),s=n||Object.isFrozen(r);for(n||(e=0),s||(r=Ze(r),i=0,e=qt(e,c),s=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??(_n?1024:0),n=0;n<r.length;n++){const l=r[n],h=jo(l);Object.is(l,h)||(s&&(r=Ze(r),i=0,e=qt(e,c),s=!1),r[n]=h)}e!==i&&(s&&(r=Ze(r),e=qt(e,c)),de(r,e)),ue(a,c,t,r)}}}function Ni(e,t,r){hr(e),Wt(e,t,ve,2,!0).push(jo(r))}var wr=class{constructor(e,t,r){if(this.buffer=e,r&&!t)throw Error();this.g=t}};function Qn(e,t){if(typeof e=="string")return new wr(bo(e),t);if(Array.isArray(e))return new wr(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new wr(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new wr(e,!1);if(e.constructor===nt)return t=Sn(e)||new Uint8Array(0),new wr(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new wr(e,!1);throw Error()}function gr(e,t){let r,i=0,n=0,s=0;const a=e.h;let c=e.g;do r=a[c++],i|=(127&r)<<s,s+=7;while(s<32&&128&r);if(s>32)for(n|=(127&r)>>4,s=3;s<32&&128&r;s+=7)r=a[c++],n|=(127&r)<<s;if(Kt(e,c),!(128&r))return t(i>>>0,n>>>0);throw Error()}function Jn(e){let t=0,r=e.g;const i=r+10,n=e.h;for(;r<i;){const s=n[r++];if(t|=s,(128&s)==0)return Kt(e,r),!!(127&t)}throw Error()}function At(e){const t=e.h;let r=e.g,i=t[r++],n=127&i;if(128&i&&(i=t[r++],n|=(127&i)<<7,128&i&&(i=t[r++],n|=(127&i)<<14,128&i&&(i=t[r++],n|=(127&i)<<21,128&i&&(i=t[r++],n|=i<<28,128&i&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Error();return Kt(e,r),n}function bt(e){return At(e)>>>0}function Ii(e){var t=e.h;const r=e.g;var i=t[r],n=t[r+1];const s=t[r+2];return t=t[r+3],Kt(e,e.g+4),e=2*((n=(i<<0|n<<8|s<<16|t<<24)>>>0)>>31)+1,i=n>>>23&255,n&=8388607,i==255?n?NaN:e*(1/0):i==0?1401298464324817e-60*e*n:e*Math.pow(2,i-150)*(n+8388608)}function Xd(e){return At(e)}function Kt(e,t){if(e.g=t,t>e.l)throw Error()}function ra(e,t){if(t<0)throw Error();const r=e.g;if((t=r+t)>e.l)throw Error();return e.g=t,r}function ia(e,t){if(t==0)return Bt();var r=ra(e,t);return e.Y&&e.j?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):Td?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?Bt():new nt(r,er)}var na=[];function sa(e,t,r,i){if(Mi.length){const n=Mi.pop();return n.o(i),n.g.init(e,t,r,i),n}return new Qd(e,t,r,i)}function oa(e){e.g.clear(),e.l=-1,e.h=-1,Mi.length<100&&Mi.push(e)}function aa(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var r=bt(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5)||t<1)throw Error();return e.l=t,e.h=r,!0}function Fi(e){switch(e.h){case 0:e.h!=0?Fi(e):Jn(e.g);break;case 1:Kt(e=e.g,e.g+8);break;case 2:if(e.h!=2)Fi(e);else{var t=bt(e.g);Kt(e=e.g,e.g+t)}break;case 5:Kt(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!aa(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}Fi(e)}break;default:throw Error()}}function ei(e,t,r){const i=e.g.l;var n=bt(e.g);let s=(n=e.g.g+n)-i;if(s<=0&&(e.g.l=n,r(t,e,void 0,void 0,void 0),s=n-e.g.g),s)throw Error();return e.g.g=n,e.g.l=i,t}function Zn(e){var t=bt(e.g),r=ra(e=e.g,t);if(e=e.h,ad){var i,n=e;(i=vn)||(i=vn=new TextDecoder("utf-8",{fatal:!0})),t=r+t,n=r===0&&t===n.length?n:n.subarray(r,t);try{var s=i.decode(n)}catch(c){if(yi===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),yi=!0}catch{yi=!1}}throw!yi&&(vn=void 0),c}}else{t=(s=r)+t,r=[];let c,l=null;for(;s<t;){var a=e[s++];a<128?r.push(a):a<224?s>=t?Ot():(c=e[s++],a<194||(192&c)!=128?(s--,Ot()):r.push((31&a)<<6|63&c)):a<240?s>=t-1?Ot():(c=e[s++],(192&c)!=128||a===224&&c<160||a===237&&c>=160||(192&(i=e[s++]))!=128?(s--,Ot()):r.push((15&a)<<12|(63&c)<<6|63&i)):a<=244?s>=t-2?Ot():(c=e[s++],(192&c)!=128||c-144+(a<<28)>>30||(192&(i=e[s++]))!=128||(192&(n=e[s++]))!=128?(s--,Ot()):(a=(7&a)<<18|(63&c)<<12|(63&i)<<6|63&n,a-=65536,r.push(55296+(a>>10&1023),56320+(1023&a)))):Ot(),r.length>=8192&&(l=co(l,r),r.length=0)}s=co(l,r)}return s}function ca(e){const t=bt(e.g);return ia(e.g,t)}function Li(e,t,r){var i=bt(e.g);for(i=e.g.g+i;e.g.g<i;)r.push(t(e.g))}var Qd=class{constructor(e,t,r,i){if(na.length){const n=na.pop();n.init(e,t,r,i),e=n}else e=new class{constructor(n,s,a,c){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(n,s,a,c)}init(n,s,a,{Y:c=!1,ea:l=!1}={}){this.Y=c,this.ea=l,n&&(n=Qn(n,this.ea),this.h=n.buffer,this.j=n.g,this.m=s||0,this.l=a!==void 0?this.m+a:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(e,t,r,i);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(i)}o({ha:e=!1}={}){this.ha=e}},Mi=[];function la(e){return e?/^\d+$/.test(e)?(Ei(e),new Rn(ee,ae)):null:Jd||(Jd=new Rn(0,0))}var Rn=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Jd;function da(e){return e?/^-?\d+$/.test(e)?(Ei(e),new es(ee,ae)):null:Zd||(Zd=new es(0,0))}var es=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Zd;function pr(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function mr(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Di(e,t){if(t>=0)mr(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function ts(e){var t=ee;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function yr(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function ze(e,t,r){mr(e.g,8*t+r)}function rs(e,t){return ze(e,t,2),t=e.g.end(),yr(e,t),t.push(e.h),t}function is(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function Pi(e,t,r){ze(e,t,2),mr(e.g,r.length),yr(e,e.g.end()),yr(e,r)}function Oi(e,t,r,i){r!=null&&(t=rs(e,t),i(r,e),is(e,t))}function at(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var ns=at(),ua=at(),ss=at(),os=at(),ha=at(),fa=at(),Rd=at(),Bi=at(),wa=at(),ga=at();function ct(e,t,r){var i=e.v;Ie&&Ie in i&&(i=i[Ie])&&delete i[t.g],t.h?t.j(e,t.h,t.g,r,t.l):t.j(e,t.g,r,t.l)}var S=class{constructor(e,t){this.v=Ho(e,t,void 0,2048)}toJSON(){return Wo(this)}j(){var n;var e=Pu,t=this.v,r=e.g,i=Ie;if(ir&&i&&((n=t[i])==null?void 0:n[r])!=null&&tr(yd,3),t=e.g,_o&&Ie&&_o===void 0&&(i=(r=this.v)[Ie])&&(i=i.da))try{i(r,t,$d)}catch(s){uo(s)}return e.h?e.m(this,e.h,e.g,e.l):e.m(this,e.g,e.defaultValue,e.l)}clone(){const e=this.v,t=0|e[k];return $n(this,e,t)?Gn(this,e,!0):new this.constructor(dr(e,t,!1))}};S.prototype[nr]=sr,S.prototype.toString=function(){return this.v.toString()};var br=class{constructor(e,t,r){this.g=e,this.h=t,e=ns,this.l=!!e&&r===e||!1}};function Ui(e,t){return new br(e,t,ns)}function pa(e,t,r,i,n){Oi(e,r,Ea(t,i),n)}const eu=Ui(function(e,t,r,i,n){return e.h===2&&(ei(e,Yn(t,i,r),n),!0)},pa),tu=Ui(function(e,t,r,i,n){return e.h===2&&(ei(e,Yn(t,i,r),n),!0)},pa);var Vi=Symbol(),Gi=Symbol(),as=Symbol(),ma=Symbol(),ya=Symbol();let ba,va;function Yt(e,t,r,i){var n=i[e];if(n)return n;(n={}).qa=i,n.T=function(f){switch(typeof f){case"boolean":return Hd||(Hd=[0,void 0,!0]);case"number":return f>0?void 0:f===0?qd||(qd=[0,void 0]):[-f,void 0];case"string":return[0,f];case"object":return f}}(i[0]);var s=i[1];let a=1;s&&s.constructor===Object&&(n.ba=s,typeof(s=i[++a])=="function"&&(n.ma=!0,ba??(ba=s),va??(va=i[a+1]),s=i[a+=2]));const c={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var l=0;l<s.length;l++)c[s[l]]=s;s=i[++a]}for(l=1;s!==void 0;){let f;typeof s=="number"&&(l+=s,s=i[++a]);var h=void 0;if(s instanceof br?f=s:(f=eu,a--),f==null?void 0:f.l){s=i[++a],h=i;var u=a;typeof s=="function"&&(s=s(),h[u]=s),h=s}for(u=l+1,typeof(s=i[++a])=="number"&&s<0&&(u-=s,s=i[++a]);l<u;l++){const w=c[l];h?r(n,l,f,h,w):t(n,l,f,w)}}return i[e]=n}function xa(e){return Array.isArray(e)?e[0]instanceof br?e:[tu,e]:[e,void 0]}function Ea(e,t){return e instanceof S?e.v:Array.isArray(e)?jt(e,t):void 0}function cs(e,t,r,i){const n=r.g;e[t]=i?(s,a,c)=>n(s,a,c,i):n}function ls(e,t,r,i,n){const s=r.g;let a,c;e[t]=(l,h,u)=>s(l,h,u,c||(c=Yt(Gi,cs,ls,i).T),a||(a=ds(i)),n)}function ds(e){let t=e[as];if(t!=null)return t;const r=Yt(Gi,cs,ls,e);return t=r.ma?(i,n)=>ba(i,n,r):(i,n)=>{for(;aa(n)&&n.h!=4;){var s=n.l,a=r[s];if(a==null){var c=r.ba;c&&(c=c[s])&&(c=iu(c))!=null&&(a=r[s]=c)}if(a==null||!a(n,i,s)){if(a=(c=n).m,Fi(c),c.ha)var l=void 0;else l=c.g.g-a,c.g.g=a,l=ia(c.g,l);a=void 0,c=i,l&&((a=c[Ie]??(c[Ie]=new Vn))[s]??(a[s]=[])).push(l)}}return(i=Si(i))&&(i.da=r.qa[ya]),!0},e[as]=t,e[ya]=ru.bind(e),t}function ru(e,t,r,i){var n=this[Gi];const s=this[as],a=jt(void 0,n.T),c=Si(e);if(c){var l=!1,h=n.ba;if(h){if(n=(u,f,w)=>{if(w.length!==0)if(h[f])for(const g of w){u=sa(g);try{l=!0,s(a,u)}finally{oa(u)}}else i==null||i(e,f,w)},t==null)Ai(c,n);else if(c!=null){const u=c[t];u&&n(c,t,u)}if(l){let u=0|e[k];if(2&u&&2048&u&&!(r!=null&&r.Ka))throw Error();const f=or(u),w=(g,p)=>{if(pt(e,g,f)!=null){if((r==null?void 0:r.Qa)===1)return;throw Error()}p!=null&&(u=ue(e,u,g,p,f)),delete c[g]};t==null?To(a,0|a[k],(g,p)=>{w(g,p)}):w(t,pt(a,t,f))}}}}function iu(e){const t=(e=xa(e))[0].g;if(e=e[1]){const r=ds(e),i=Yt(Gi,cs,ls,e).T;return(n,s,a)=>t(n,s,a,i,r)}return t}function ji(e,t,r){e[t]=r.h}function $i(e,t,r,i){let n,s;const a=r.h;e[t]=(c,l,h)=>a(c,l,h,s||(s=Yt(Vi,ji,$i,i).T),n||(n=_a(i)))}function _a(e){let t=e[ma];if(!t){const r=Yt(Vi,ji,$i,e);t=(i,n)=>ka(i,n,r),e[ma]=t}return t}function ka(e,t,r){To(e,0|e[k],(i,n)=>{if(n!=null){var s=function(a,c){var l=a[c];if(l)return l;if((l=a.ba)&&(l=l[c])){var h=(l=xa(l))[0].h;if(l=l[1]){const u=_a(l),f=Yt(Vi,ji,$i,l).T;l=a.ma?va(f,u):(w,g,p)=>h(w,g,p,f,u)}else l=h;return a[c]=l}}(r,i);s?s(t,n,i):i<500||tr(Cn,3)}}),(e=Si(e))&&Ai(e,(i,n,s)=>{for(yr(t,t.g.end()),i=0;i<s.length;i++)yr(t,Sn(s[i])||new Uint8Array(0))})}const nu=Le(0);function vr(e,t){if(Array.isArray(t)){var r=0|t[k];if(4&r)return t;for(var i=0,n=0;i<t.length;i++){const s=e(t[i]);s!=null&&(t[n++]=s)}return n<i&&(t.length=n),(e=-1537&(5|r))!==r&&de(t,e),2&e&&Object.freeze(t),t}}function _e(e,t,r){return new br(e,t,r)}function xr(e,t,r){return new br(e,t,r)}function fe(e,t,r){ue(e,0|e[k],t,r,or(0|e[k]))}var su=Ui(function(e,t,r,i,n){if(e.h!==2)return!1;if(e=Ze(e=ei(e,jt([void 0,void 0],i),n)),n=or(i=0|t[k]),2&i)throw Error();let s=pt(t,r,n);if(s instanceof gt)2&s.J?(s=s.V(),s.push(e),ue(t,i,r,s,n)):s.Ma(e);else if(Array.isArray(s)){var a=0|s[k];8192&a||de(s,a|=8192),2&a&&(s=Qo(s),ue(t,i,r,s,n)),s.push(e)}else ue(t,i,r,Hr([e]),n);return!0},function(e,t,r,i,n){if(t instanceof gt)t.forEach((s,a)=>{Oi(e,r,jt([a,s],i),n)});else if(Array.isArray(t)){for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&Oi(e,r,jt(a,i),n)}Hr(t)}});function Sa(e,t,r){(t=ot(t))!=null&&(ze(e,r,5),e=e.g,In(t),ts(e))}function Aa(e,t,r){if(t=function(i){if(i==null)return i;const n=typeof i;if(n==="bigint")return String(Kr(64,i));if(Qr(i)){if(n==="string")return Uo(i);if(n==="number")return Pn(i)}}(t),t!=null&&(typeof t=="string"&&da(t),t!=null))switch(ze(e,r,0),typeof t){case"number":e=e.g,ar(t),pr(e,ee,ae);break;case"bigint":r=BigInt.asUintN(64,t),r=new es(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),pr(e.g,r.h,r.g);break;default:r=da(t),pr(e.g,r.h,r.g)}}function Ca(e,t,r){(t=lr(t))!=null&&t!=null&&(ze(e,r,0),Di(e.g,t))}function Ta(e,t,r){(t=Po(t))!=null&&(ze(e,r,0),e.g.g.push(t?1:0))}function Na(e,t,r){(t=ve(t))!=null&&Pi(e,r,lo(t))}function Ia(e,t,r,i,n){Oi(e,r,Ea(t,i),n)}function Fa(e,t,r){(t=t==null||typeof t=="string"||t instanceof nt?t:void 0)!=null&&Pi(e,r,Qn(t,!0).buffer)}function La(e,t,r){return(e.h===5||e.h===2)&&(t=fr(t,0|t[k],r),e.h==2?Li(e,Ii,t):t.push(Ii(e.g)),!0)}var ce=_e(function(e,t,r){return e.h===5&&(fe(t,r,Ii(e.g)),!0)},Sa,Bi),ou=xr(La,function(e,t,r){if((t=vr(ot,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&(ze(i,n,5),i=i.g,In(s),ts(i))}},Bi),us=xr(La,function(e,t,r){if((t=vr(ot,t))!=null&&t.length){ze(e,r,2),mr(e.g,4*t.length);for(let i=0;i<t.length;i++)r=e.g,In(t[i]),ts(r)}},Bi),au=_e(function(e,t,r){return e.h===5&&(fe(t,r,(e=Ii(e.g))===0?void 0:e),!0)},Sa,Bi),Ct=_e(function(e,t,r){return En?(e.h!==0?e=!1:(fe(t,r,gr(e.g,Mo)),e=!0),e):e.h===0&&(fe(t,r,gr(e.g,Ln)),!0)},Aa,fa),hs=_e(function(e,t,r){return En?(e.h!==0?t=!1:(fe(t,r,(e=gr(e.g,Mo))===nu?void 0:e),t=!0),t):e.h===0&&(fe(t,r,(e=gr(e.g,Ln))===0?void 0:e),!0)},Aa,fa),cu=_e(function(e,t,r){return En?(e.h!==0?e=!1:(fe(t,r,gr(e.g,Id)),e=!0),e):e.h===0&&(fe(t,r,gr(e.g,Fn)),!0)},function(e,t,r){if(t=function(i){if(i==null)return i;var n=typeof i;if(n==="bigint")return String(Fd(64,i));if(Qr(i)){if(n==="string")return n=cr(Number(i)),Gt(n)&&n>=0?i=String(n):((n=i.indexOf("."))!==-1&&(i=i.substring(0,n)),(n=i[0]!=="-"&&((n=i.length)<20||n===20&&i<="18446744073709551615"))||(Ei(i),i=qr(ee,ae))),i;if(n==="number")return(i=cr(i))>=0&&Gt(i)||(ar(i),i=Fn(ee,ae)),i}}(t),t!=null&&(typeof t=="string"&&la(t),t!=null))switch(ze(e,r,0),typeof t){case"number":e=e.g,ar(t),pr(e,ee,ae);break;case"bigint":r=BigInt.asUintN(64,t),r=new Rn(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),pr(e.g,r.h,r.g);break;default:r=la(t),pr(e.g,r.h,r.g)}},Rd),we=_e(function(e,t,r){return e.h===0&&(fe(t,r,At(e.g)),!0)},Ca,os),ti=xr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r),e.h==2?Li(e,At,t):t.push(At(e.g)),!0)},function(e,t,r){if((t=vr(lr,t))!=null&&t.length){r=rs(e,r);for(let i=0;i<t.length;i++)Di(e.g,t[i]);is(e,r)}},os),Er=_e(function(e,t,r){return e.h===0&&(fe(t,r,(e=At(e.g))===0?void 0:e),!0)},Ca,os),se=_e(function(e,t,r){return e.h===0&&(fe(t,r,Jn(e.g)),!0)},Ta,ua),Xt=_e(function(e,t,r){return e.h===0&&(fe(t,r,(e=Jn(e.g))===!1?void 0:e),!0)},Ta,ua),xe=xr(function(e,t,r){return e.h===2&&(e=Zn(e),fr(t,0|t[k],r).push(e),!0)},function(e,t,r){if((t=vr(ve,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&Pi(i,n,lo(s))}},ss),Tt=_e(function(e,t,r){return e.h===2&&(fe(t,r,(e=Zn(e))===""?void 0:e),!0)},Na,ss),X=_e(function(e,t,r){return e.h===2&&(fe(t,r,Zn(e)),!0)},Na,ss),ge=function(e,t,r=ns){return new br(e,t,r)}(function(e,t,r,i,n){return e.h===2&&(i=jt(void 0,i),fr(t,0|t[k],r).push(i),ei(e,i,n),!0)},function(e,t,r,i,n){if(Array.isArray(t)){for(let s=0;s<t.length;s++)Ia(e,t[s],r,i,n);1&(e=0|t[k])||de(t,1|e)}}),oe=Ui(function(e,t,r,i,n,s){if(e.h!==2)return!1;let a=0|t[k];return Jo(t,a,s,r,or(a)),ei(e,t=Yn(t,i,r),n),!0},Ia),Ma=_e(function(e,t,r){return e.h===2&&(fe(t,r,ca(e)),!0)},Fa,wa),lu=xr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r),e.h==2?Li(e,bt,t):t.push(bt(e.g)),!0)},function(e,t,r){if((t=vr(Oo,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&(ze(i,n,0),mr(i.g,s))}},ha),du=_e(function(e,t,r){return e.h===0&&(fe(t,r,(e=bt(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Oo(t))!=null&&t!=null&&(ze(e,r,0),mr(e.g,t))},ha),De=_e(function(e,t,r){return e.h===0&&(fe(t,r,At(e.g)),!0)},function(e,t,r){(t=lr(t))!=null&&(t=parseInt(t,10),ze(e,r,0),Di(e.g,t))},ga);class uu{constructor(t,r){var i=Pe;this.g=t,this.h=r,this.m=$,this.j=F,this.defaultValue=void 0,this.l=i.Oa!=null?No:void 0}register(){bi(this)}}function lt(e,t){return new uu(e,t)}function Nt(e,t){return(r,i)=>{{const s={ea:!0};i&&Object.assign(s,i),r=sa(r,void 0,void 0,s);try{const a=new e,c=a.v;ds(t)(c,r);var n=a}finally{oa(r)}}return n}}function zi(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const a=this.g;return this.g=[],a}}}};ka(this.v,t,Yt(Vi,ji,$i,e)),yr(t,t.g.end());const r=new Uint8Array(t.h),i=t.l,n=i.length;let s=0;for(let a=0;a<n;a++){const c=i[a];r.set(c,s),s+=c.length}return t.l=[r],r}}var Da=class extends S{constructor(e){super(e)}},Pa=[0,Tt,_e(function(e,t,r){return e.h===2&&(fe(t,r,(e=ca(e))===Bt()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof S){const i=t.Ra;return void(i?(t=i(t),t!=null&&Pi(e,r,Qn(t,!0).buffer)):tr(Cn,3))}if(Array.isArray(t))return void tr(Cn,3)}Fa(e,t,r)},wa)];let fs,Oa=globalThis.trustedTypes;function Ba(e){var t;return fs===void 0&&(fs=function(){let r=null;if(!Oa)return r;try{const i=n=>n;r=Oa.createPolicy("goog#html",{createHTML:i,createScript:i,createScriptURL:i})}catch{}return r}()),e=(t=fs)?t.createScriptURL(e):e,new class{constructor(r){this.g=r}toString(){return this.g+""}}(e)}function hu(e,...t){if(t.length===0)return Ba(e[0]);let r=e[0];for(let i=0;i<t.length;i++)r+=encodeURIComponent(t[i])+e[i+1];return Ba(r)}var Ua=[0,we,De,se,-1,ti,De,-1,se],fu=class extends S{constructor(e){super(e)}},Va=[0,se,X,se,De,-1,xr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r),e.h==2?Li(e,Xd,t):t.push(At(e.g)),!0)},function(e,t,r){if((t=vr(lr,t))!=null&&t.length){r=rs(e,r);for(let i=0;i<t.length;i++)Di(e.g,t[i]);is(e,r)}},ga),X,-1,[0,se,-1],De,se,-1],Ga=[0,3,se,-1,2,[0,we],[0,De,se],[0,X,-1],[0]],ja=[0,X,-2],$a=class extends S{constructor(e){super(e)}},za=[0],Wa=[0,we,se,1,se,-4],Pe=class extends S{constructor(e){super(e,2)}},he={};he[336783863]=[0,X,se,-1,we,[0,[1,2,3,4,5,6,7,8,9],oe,za,oe,Va,oe,ja,oe,Wa,oe,Ua,oe,[0,X,-2],oe,[0,X,De],oe,Ga,oe,[0,De,-1,se]],[0,X],se,[0,[1,3],[2,4],oe,[0,ti],-1,oe,[0,xe],-1,ge,[0,X,-1]],X];var Ha=[0,hs,-1,Xt,-3,hs,ti,Tt,Er,hs,-1,Xt,Er,Xt,-2,Tt];function Z(e,t){Ni(e,3,t)}function V(e,t){Ni(e,4,t)}var Te=class extends S{constructor(e){super(e,500)}o(e){return F(this,0,7,e)}},ri=[-1,{}],qa=[0,X,1,ri],Ka=[0,X,xe,ri];function We(e,t){Xn(e,1,Te,t)}function te(e,t){Ni(e,10,t)}function W(e,t){Ni(e,15,t)}var Oe=class extends S{constructor(e){super(e,500)}o(e){return F(this,0,1001,e)}},Ya=[-500,ge,[-500,Tt,-1,xe,-3,[-2,he,se],ge,Pa,Er,-1,qa,Ka,ge,[0,Tt,Xt],Tt,Ha,Er,xe,987,xe],4,ge,[-500,X,-1,[-1,{}],998,X],ge,[-500,X,xe,-1,[-2,{},se],997,xe,-1],Er,ge,[-500,X,xe,ri,998,xe],xe,Er,qa,Ka,ge,[0,Tt,-1,ri],xe,-2,Ha,Tt,-1,Xt,[0,Xt,du],978,ri,ge,Pa];Oe.prototype.g=zi(Ya);var wu=Nt(Oe,Ya),gu=class extends S{constructor(e){super(e)}},Xa=class extends S{constructor(e){super(e)}g(){return mt(this,gu,1)}},Qa=[0,ge,[0,we,ce,X,-1]],Wi=Nt(Xa,Qa),pu=class extends S{constructor(e){super(e)}},mu=class extends S{constructor(e){super(e)}},ws=class extends S{constructor(e){super(e)}l(){return $(this,pu,2)}g(){return mt(this,mu,5)}},Ja=Nt(class extends S{constructor(e){super(e)}},[0,xe,ti,us,[0,De,[0,we,-3],[0,ce,-3],[0,we,-1,[0,ge,[0,we,-2]]],ge,[0,ce,-1,X,ce]],X,-1,Ct,ge,[0,we,ce],xe,Ct]),Za=class extends S{constructor(e){super(e)}},_r=Nt(class extends S{constructor(e){super(e)}},[0,ge,[0,ce,-4]]),Ra=class extends S{constructor(e){super(e)}},ii=Nt(class extends S{constructor(e){super(e)}},[0,ge,[0,ce,-4]]),yu=class extends S{constructor(e){super(e)}},bu=[0,we,-1,us,De],ec=class extends S{constructor(e){super(e)}};ec.prototype.g=zi([0,ce,-4,Ct]);var vu=class extends S{constructor(e){super(e)}},xu=Nt(class extends S{constructor(e){super(e)}},[0,ge,[0,1,we,X,Qa],Ct]),tc=class extends S{constructor(e){super(e)}},Eu=class extends S{constructor(e){super(e)}na(){const e=J(this,1,void 0,void 0,Xo);return e??Bt()}},_u=class extends S{constructor(e){super(e)}},rc=[1,2],ku=Nt(class extends S{constructor(e){super(e)}},[0,ge,[0,rc,oe,[0,us],oe,[0,Ma],we,X],Ct]),gs=class extends S{constructor(e){super(e)}},ic=[0,X,we,ce,xe,-1],nc=class extends S{constructor(e){super(e)}},Su=[0,se,-1],sc=class extends S{constructor(e){super(e)}},Hi=[1,2,3,4,5,6],qi=class extends S{constructor(e){super(e)}g(){return J(this,1,void 0,void 0,Xo)!=null}l(){return ve(J(this,2))!=null}},ie=class extends S{constructor(e){super(e)}g(){return Po(J(this,2))??!1}},oc=[0,Ma,X,[0,we,Ct,-1],[0,cu,Ct]],le=[0,oc,se,[0,Hi,oe,Wa,oe,Va,oe,Ua,oe,za,oe,ja,oe,Ga],De],Ki=class extends S{constructor(e){super(e)}},ps=[0,le,ce,-1,we],Au=lt(502141897,Ki);he[502141897]=ps;var Cu=Nt(class extends S{constructor(e){super(e)}},[0,[0,De,-1,ou,lu],bu]),ac=class extends S{constructor(e){super(e)}},cc=class extends S{constructor(e){super(e)}},ms=[0,le,ce,[0,le],se],Tu=lt(508968150,cc);he[508968150]=[0,le,ps,ms,ce,[0,[0,oc]]],he[508968149]=ms;var kr=class extends S{constructor(e){super(e)}l(){return $(this,gs,2)}g(){K(this,2)}},lc=[0,le,ic];he[478825465]=lc;var Nu=class extends S{constructor(e){super(e)}},dc=class extends S{constructor(e){super(e)}},ys=class extends S{constructor(e){super(e)}},bs=class extends S{constructor(e){super(e)}},uc=class extends S{constructor(e){super(e)}},hc=[0,le,[0,le],lc,-1],fc=[0,le,ce,we],vs=[0,le,ce],wc=[0,le,fc,vs,ce],Iu=lt(479097054,uc);he[479097054]=[0,le,wc,hc],he[463370452]=hc,he[464864288]=fc;var Fu=lt(462713202,bs);he[462713202]=wc,he[474472470]=vs;var Lu=class extends S{constructor(e){super(e)}},gc=class extends S{constructor(e){super(e)}},pc=class extends S{constructor(e){super(e)}},mc=class extends S{constructor(e){super(e)}},xs=[0,le,ce,-1,we],Es=[0,le,ce,se];mc.prototype.g=zi([0,le,vs,[0,le],ps,ms,xs,Es]);var yc=class extends S{constructor(e){super(e)}},Mu=lt(456383383,yc);he[456383383]=[0,le,ic];var bc=class extends S{constructor(e){super(e)}},Du=lt(476348187,bc);he[476348187]=[0,le,Su];var vc=class extends S{constructor(e){super(e)}},xc=class extends S{constructor(e){super(e)}},Ec=[0,De,-1],Pu=lt(458105876,class extends S{constructor(e){super(e)}g(){let e;var t=this.v;const r=0|t[k];return e=Fe(this,r),t=function(i,n,s,a){var c=xc;!a&&ur(i)&&(s=0|(n=i.v)[k]);var l=pt(n,2);if(i=!1,l==null){if(a)return zo();l=[]}else if(l.constructor===gt){if(!(2&l.J)||a)return l;l=l.V()}else Array.isArray(l)?i=!!(2&(0|l[k])):l=[];if(a){if(!l.length)return zo();i||(i=!0,Wr(l))}else i&&(i=!1,Hr(l),l=Qo(l));return!i&&32&s&&zr(l,32),s=ue(n,s,2,a=new gt(l,c,Pd,void 0)),i||$t(n,s),a}(this,t,r,e),!e&&xc&&(t.ra=!0),t}});he[458105876]=[0,Ec,su,[!0,Ct,[0,X,-1,xe]],[0,ti,se,De]];var _s=class extends S{constructor(e){super(e)}},_c=lt(458105758,_s);he[458105758]=[0,le,X,Ec];var ks=class extends S{constructor(e){super(e)}},kc=[0,au,-1,Xt],Ou=class extends S{constructor(e){super(e)}},Sc=class extends S{constructor(e){super(e)}},Ss=[1,2];Sc.prototype.g=zi([0,Ss,oe,kc,oe,[0,ge,kc]]);var Ac=class extends S{constructor(e){super(e)}},Bu=lt(443442058,Ac);he[443442058]=[0,le,X,we,ce,xe,-1,se,ce],he[514774813]=xs;var Cc=class extends S{constructor(e){super(e)}},Uu=lt(516587230,Cc);function As(e,t){return t=t?t.clone():new gs,e.displayNamesLocale!==void 0?K(t,1,Jr(e.displayNamesLocale)):e.displayNamesLocale===void 0&&K(t,1),e.maxResults!==void 0?yt(t,2,e.maxResults):"maxResults"in e&&K(t,2),e.scoreThreshold!==void 0?I(t,3,e.scoreThreshold):"scoreThreshold"in e&&K(t,3),e.categoryAllowlist!==void 0?Ti(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&K(t,4),e.categoryDenylist!==void 0?Ti(t,5,e.categoryDenylist):"categoryDenylist"in e&&K(t,5),t}function Tc(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function Cs(e,t=-1,r=""){return{categories:e.map(i=>({index:$e(i,1)??0??-1,score:ne(i,2)??0,categoryName:ve(J(i,3))??""??"",displayName:ve(J(i,4))??""??""})),headIndex:t,headName:r}}function Vu(e){const t={classifications:mt(e,vu,1).map(r=>{var i;return Cs(((i=$(r,Xa,4))==null?void 0:i.g())??[],$e(r,2)??0,ve(J(r,3))??"")})};return function(r){return Dd(_n?J(r,2,void 0,void 0,ki):J(r,2))}(e)!=null&&(t.timestampMs=Tc(ta(e))),t}function Nc(e){var a,c;var t=Wt(e,3,ot,zt()),r=Wt(e,2,lr,zt()),i=Wt(e,1,ve,zt()),n=Wt(e,9,ve,zt());const s={categories:[],keypoints:[]};for(let l=0;l<t.length;l++)s.categories.push({score:t[l],index:r[l]??-1,categoryName:i[l]??"",displayName:n[l]??""});if((t=(a=$(e,ws,4))==null?void 0:a.l())&&(s.boundingBox={originX:$e(t,1,kt)??0,originY:$e(t,2,kt)??0,width:$e(t,3,kt)??0,height:$e(t,4,kt)??0,angle:0}),(c=$(e,ws,4))==null?void 0:c.g().length)for(const l of $(e,ws,4).g())s.keypoints.push({x:J(l,1,void 0,kt,ot)??0,y:J(l,2,void 0,kt,ot)??0,score:J(l,4,void 0,kt,ot)??0,label:ve(J(l,3,void 0,kt))??""});return s}function Yi(e){const t=[];for(const r of mt(e,Ra,1))t.push({x:ne(r,1)??0,y:ne(r,2)??0,z:ne(r,3)??0,visibility:ne(r,4)??0});return t}function ni(e){const t=[];for(const r of mt(e,Za,1))t.push({x:ne(r,1)??0,y:ne(r,2)??0,z:ne(r,3)??0,visibility:ne(r,4)??0});return t}function Ic(e){return Array.from(e,t=>t>127?t-256:t)}function Fc(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,i=0,n=0;for(let s=0;s<e.length;s++)r+=e[s]*t[s],i+=e[s]*e[s],n+=t[s]*t[s];if(i<=0||n<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(i*n)}let Xi;he[516587230]=[0,le,xs,Es,ce],he[518928384]=Es;const Gu=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Lc(){if(Xi===void 0)try{await WebAssembly.instantiate(Gu),Xi=!0}catch{Xi=!1}return Xi}async function si(e,t=hu``){const r=await Lc()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Qt=class{};function Mc(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Dc(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,i)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",n=>{i(n)},!1),document.body.appendChild(t)})}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function Pc(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function C(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Oc(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[i,n]=Pc(t);return!e.l||i===e.i.canvas.width&&n===e.i.canvas.height||(e.i.canvas.width=i,e.i.canvas.height=n),[i,n]}function Bc(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const i=new Uint32Array(t.length);for(let n=0;n<t.length;n++)i[n]=e.i.stringToNewUTF8(t[n]);t=e.i._malloc(4*i.length),e.i.HEAPU32.set(i,t>>2),r(t);for(const n of i)e.i._free(n);e.i._free(t)}function dt(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function It(e,t,r){let i=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(n,s,a)=>{s?(r(i,a),i=[]):i.push(n)}}Qt.forVisionTasks=function(e){return si("vision",e)},Qt.forTextTasks=function(e){return si("text",e)},Qt.forGenAiExperimentalTasks=function(e){return si("genai_experimental",e)},Qt.forGenAiTasks=function(e){return si("genai",e)},Qt.forAudioTasks=function(e){return si("audio",e)},Qt.isSimdSupported=function(){return Lc()};async function ju(e,t,r,i){return e=await(async(n,s,a,c,l)=>{if(s&&await Dc(s),!self.ModuleFactory||a&&(await Dc(a),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&l&&((s=self.Module).locateFile=l.locateFile,l.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=l.mainScriptUrlOrBlob)),l=await self.ModuleFactory(self.Module||l),self.ModuleFactory=self.Module=void 0,new n(l,c)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:n=>n.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&n.endsWith(".data")?r.assetBinaryPath.toString():n}),await e.o(i),e}function Ts(e,t){const r=$(e.baseOptions,qi,1)||new qi;typeof t=="string"?(K(r,2,Jr(t)),K(r,1)):t instanceof Uint8Array&&(K(r,1,Tn(t,!1)),K(r,2)),F(e.baseOptions,0,1,r)}function Uc(e){try{const t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map(r=>r.message).join(", "))}finally{e.H=[]}}function x(e,t){e.C=Math.max(e.C,t)}function Qi(e,t){e.B=new Te,Me(e.B,2,"PassThroughCalculator"),Z(e.B,"free_memory"),V(e.B,"free_memory_unused_out"),te(t,"free_memory"),We(t,e.B)}function Sr(e,t){Z(e.B,t),V(e.B,t+"_unused_out")}function Ji(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var Ns=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var r,i,n,s,a,c;if(t){const l=e.baseOptions||{};if((r=e.baseOptions)!=null&&r.modelAssetBuffer&&((i=e.baseOptions)!=null&&i.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((n=$(this.baseOptions,qi,1))!=null&&n.g()||(s=$(this.baseOptions,qi,1))!=null&&s.l()||(a=e.baseOptions)!=null&&a.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(h,u){let f=$(h.baseOptions,sc,3);if(!f){var w=f=new sc,g=new $a;Rr(w,4,Hi,g)}"delegate"in u&&(u.delegate==="GPU"?(u=f,w=new fu,Rr(u,2,Hi,w)):(u=f,w=new $a,Rr(u,4,Hi,w))),F(h.baseOptions,0,3,f)}(this,l),l.modelAssetPath)return fetch(l.modelAssetPath.toString()).then(h=>{if(h.ok)return h.arrayBuffer();throw Error(`Failed to fetch model: ${l.modelAssetPath} (${h.status})`)}).then(h=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(h),!0,!1,!1),Ts(this,"/model.dat"),this.m(),this.L()});if(l.modelAssetBuffer instanceof Uint8Array)Ts(this,l.modelAssetBuffer);else if(l.modelAssetBuffer)return async function(h){const u=[];for(var f=0;;){const{done:w,value:g}=await h.read();if(w)break;u.push(g),f+=g.length}if(u.length===0)return new Uint8Array(0);if(u.length===1)return u[0];h=new Uint8Array(f),f=0;for(const w of u)h.set(w,f),f+=w.length;return h}(l.modelAssetBuffer).then(h=>{Ts(this,h),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca(t=>{e=wu(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,i)=>{this.H.push(Error(i))}),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,Uc(this)}finishProcessing(){this.g.finishProcessing(),Uc(this)}close(){this.B=void 0,this.g.closeGraph()}};function Ft(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Ns.prototype.close=Ns.prototype.close;class $u{constructor(t,r,i,n){this.g=t,this.h=r,this.m=i,this.l=n}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Vc(e,t,r){const i=e.g;if(r=Ft(i.createShader(r),"Failed to create WebGL shader"),i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(r)}`);return i.attachShader(e.h,r),r}function Gc(e,t){const r=e.g,i=Ft(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(i);const n=Ft(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,n),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);const s=Ft(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.L),r.vertexAttribPointer(e.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new $u(r,i,n,s)}function Is(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function zu(e,t,r,i){return Is(e,t),e.h||(e.m(),e.D()),r?(e.u||(e.u=Gc(e,!0)),r=e.u):(e.A||(e.A=Gc(e,!1)),r=e.A),t.useProgram(e.h),r.bind(),e.l(),e=i(),r.g.bindVertexArray(null),e}function jc(e,t,r){return Is(e,t),e=Ft(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function $c(e,t,r){Is(e,t),e.B||(e.B=Ft(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function Wu(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var zc=class{H(){return`
|
|
2
2
|
precision mediump float;
|
|
3
3
|
varying vec2 vTex;
|
|
4
4
|
uniform sampler2D inputTexture;
|
package/package.json
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "interview-widget",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.15",
|
|
5
5
|
"description": "Advanced React interview widget with STT, TTS, camera access, and ML-powered analysis",
|
|
6
|
-
"main": "dist/widget.umd.js",
|
|
7
|
-
"module": "dist/widget.es.js",
|
|
6
|
+
"main": "./dist/widget.umd.3.2.15.js",
|
|
7
|
+
"module": "./dist/widget.es.3.2.15.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
|
-
"unpkg": "dist/widget.umd.js",
|
|
10
|
-
"jsdelivr": "dist/widget.umd.js",
|
|
11
|
-
"style": "dist/widget.css",
|
|
9
|
+
"unpkg": "./dist/widget.umd.3.2.15.js",
|
|
10
|
+
"jsdelivr": "./dist/widget.umd.3.2.15.js",
|
|
11
|
+
"style": "./dist/widget.3.2.15.css",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
|
-
"import": "./dist/widget.es.js",
|
|
16
|
-
"require": "./dist/widget.umd.js"
|
|
15
|
+
"import": "./dist/widget.es.3.2.15.js",
|
|
16
|
+
"require": "./dist/widget.umd.3.2.15.js"
|
|
17
17
|
},
|
|
18
|
-
"./style.css": "./dist/widget.css"
|
|
18
|
+
"./style.css": "./dist/widget.3.2.15.css",
|
|
19
|
+
"./package.json": "./package.json"
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
21
22
|
"dist"
|
|
22
23
|
],
|
|
23
24
|
"scripts": {
|
|
24
25
|
"dev": "vite",
|
|
25
|
-
"build": "tsc && vite build",
|
|
26
|
-
"build:dev": "tsc && vite build --mode development",
|
|
26
|
+
"build": "tsc && vite build && node scripts/update-package-exports.js",
|
|
27
|
+
"build:dev": "tsc && vite build --mode development && node scripts/update-package-exports.js",
|
|
27
28
|
"build:cdn": "npm run build && npm run copy:examples",
|
|
28
29
|
"copy:examples": "mkdir -p dist/examples && cp examples/*.html dist/examples/",
|
|
29
30
|
"preview": "vite preview",
|
|
30
31
|
"type-check": "tsc --noEmit",
|
|
31
32
|
"prepublishOnly": "npm run build",
|
|
32
|
-
"publish:patch": "npm version patch && npm publish",
|
|
33
|
-
"publish:minor": "npm version minor && npm publish",
|
|
34
|
-
"publish:major": "npm version major && npm publish",
|
|
35
|
-
"publish:beta": "npm version prerelease --preid=beta && npm publish --tag beta",
|
|
36
|
-
"publish:beta-patch": "npm version patch && npm publish --tag beta"
|
|
33
|
+
"publish:patch": "npm version patch && npm run build && npm publish",
|
|
34
|
+
"publish:minor": "npm version minor && npm run build && npm publish",
|
|
35
|
+
"publish:major": "npm version major && npm run build && npm publish",
|
|
36
|
+
"publish:beta": "npm version prerelease --preid=beta && npm run build && npm publish --tag beta",
|
|
37
|
+
"publish:beta-patch": "npm version patch && npm run build && npm publish --tag beta"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"react": "^18.0.0 || ^19.0.0",
|
|
File without changes
|
|
File without changes
|