interview-widget 2.0.3 → 3.0.1

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.
Files changed (35) hide show
  1. package/README.md +1 -0
  2. package/dist/assets/check-icon.d.ts +1 -0
  3. package/dist/assets/cross-icon.d.ts +1 -0
  4. package/dist/assets/hourglass-icon.d.ts +1 -0
  5. package/dist/assets/index.d.ts +10 -2
  6. package/dist/assets/mic-icon.d.ts +1 -0
  7. package/dist/assets/mic-off-icon.d.ts +1 -0
  8. package/dist/assets/video-icon.d.ts +1 -0
  9. package/dist/assets/video-off-icon.d.ts +1 -0
  10. package/dist/components/interview/interview-content.d.ts +12 -1
  11. package/dist/components/interview/interview-controller.d.ts +1 -0
  12. package/dist/components/interview/interview-header.d.ts +4 -1
  13. package/dist/components/interview/interview-timer-label.d.ts +8 -0
  14. package/dist/components/interview/question-display.d.ts +5 -0
  15. package/dist/components/interview/submit-response-button.d.ts +7 -0
  16. package/dist/components/interview/transcript/editable-answer.d.ts +10 -0
  17. package/dist/components/interview/transcript/interview-transcript-view.d.ts +15 -0
  18. package/dist/components/interview/transcript/interview-transcript.d.ts +19 -0
  19. package/dist/components/interview/transcript/transcript-phase-indicator.d.ts +8 -0
  20. package/dist/components/interview/transcript/transcript-qna-item.d.ts +15 -0
  21. package/dist/components/media/video-feed.d.ts +3 -0
  22. package/dist/components/modals/onboarding-media-controls.d.ts +16 -0
  23. package/dist/components/modals/onboarding-steps.d.ts +10 -0
  24. package/dist/components/ui/extended/chat-ui.d.ts +12 -0
  25. package/dist/dev.d.ts +2 -0
  26. package/dist/hooks/use-timer.d.ts +1 -1
  27. package/dist/services/api/endpoints.d.ts +1 -0
  28. package/dist/services/api/interview-api.d.ts +5 -1
  29. package/dist/services/timer/timer-service.d.ts +5 -0
  30. package/dist/types.d.ts +19 -0
  31. package/dist/utils/helper.d.ts +1 -0
  32. package/dist/widget.css +1 -1
  33. package/dist/widget.es.js +17039 -6715
  34. package/dist/widget.umd.js +31 -7
  35. package/package.json +8 -7
@@ -1,4 +1,4 @@
1
- (function(we,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],d):(we=typeof globalThis<"u"?globalThis:we||self,d(we.InterviewWidget={},we.React,we.ReactDOM))})(this,function(we,d,tr){"use strict";var Rh=Object.defineProperty;var Oh=(we,d,tr)=>d in we?Rh(we,d,{enumerable:!0,configurable:!0,writable:!0,value:tr}):we[d]=tr;var Oe=(we,d,tr)=>Oh(we,typeof d!="symbol"?d+"":d,tr);var rn=typeof document<"u"?document.currentScript:null,Ks={exports:{}},ei={};/**
1
+ (function(it,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],y):(it=typeof globalThis<"u"?globalThis:it||self,y(it.InterviewWidget={},it.React,it.ReactDOM))})(this,function(it,y,Zi){"use strict";var u7=Object.defineProperty;var o7=(it,y,Zi)=>y in it?u7(it,y,{enumerable:!0,configurable:!0,writable:!0,value:Zi}):it[y]=Zi;var Qt=(it,y,Zi)=>o7(it,typeof y!="symbol"?y+"":y,Zi);var qo=typeof document<"u"?document.currentScript:null,P2={exports:{}},_r={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,21 +6,21 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Sl=Symbol.for("react.transitional.element"),Al=Symbol.for("react.fragment");function Xs(e,t,r){var i=null;if(r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),"key"in t){r={};for(var n in t)n!=="key"&&(r[n]=t[n])}else r=t;return t=r.ref,{$$typeof:Sl,type:e,key:i,ref:t!==void 0?t:null,props:r}}ei.Fragment=Al,ei.jsx=Xs,ei.jsxs=Xs,Ks.exports=ei;var o=Ks.exports;const nn={},it={api:{baseUrl:"/api",retryConfig:{attempts:3,backoff:"exponential",baseDelay:1e3}},ui:{baseColor:"#3B82F6",borderRadius:"8px"},interview:{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}}},sn="iw-storage";function Tl(){if(!(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:rn&&rn.tagName.toUpperCase()==="SCRIPT"&&rn.src||new URL("widget.umd.js",document.baseURI).href}<"u"&&(nn!=null&&nn.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 Qs=Tl(),ti=30,jl={SCREENSHOT:"screenshot"},on="AES-GCM",an=12;async function Js(e){const r=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",r);return crypto.subtle.importKey("raw",i,on,!1,["encrypt","decrypt"])}function Nl(){return crypto.getRandomValues(new Uint8Array(an))}async function Cl(e,t="default-seed"){try{const r=typeof e=="string"?e:JSON.stringify(e),n=new TextEncoder().encode(r),s=await Js(t),a=Nl(),c=await crypto.subtle.encrypt({name:on,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 Il(e,t="default-seed"){try{const r=atob(e),i=new Uint8Array(r.length);for(let u=0;u<r.length;u++)i[u]=r.charCodeAt(u);const n=i.slice(0,an),s=i.slice(an),a=await Js(t),c=await crypto.subtle.decrypt({name:on,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 Ml(e,t="default-seed"){return Cl(e,t)}async function Ll(e,t="default-seed"){const r=await Il(e,t);try{return JSON.parse(r)}catch{return r}}const Ir=d.createContext(null),Fl=async()=>{try{const e=sessionStorage.getItem(sn);if(e){const r=(await Ll(e,Qs)).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}}},Mr=async e=>{try{const t=await Ml({state:e,version:0},Qs);sessionStorage.setItem(sn,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(()=>{Fl().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},Mr(t.current),i()},[i]),c=d.useCallback(w=>{const m={...t.current.gazeViolationCounters};w==="looking_away"&&(m.lookingAwayCount+=1),w==="no_face_detected"&&(m.noFaceDetectedCount+=1),w==="multiple_faces"&&(m.multipleFacesCount+=1),m.totalGazeViolations=m.lookingAwayCount+m.noFaceDetectedCount+m.multipleFacesCount,t.current={...t.current,gazeViolationCounters:m},Mr(t.current),i()},[i]),l=d.useCallback(()=>{t.current={...t.current,logViolations:[],totalViolations:0},Mr(t.current),i()},[i]),u=d.useCallback(()=>{t.current={...t.current,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0}},Mr(t.current),i()},[i]),h=d.useCallback((w,m)=>{t.current={...t.current,referenceSet:w,referenceRef:m},Mr(t.current),i()},[i]),f=d.useMemo(()=>({getState:s,addViolation:a,clearViolations:l,subscribe:n,incrementGazeViolation:c,clearGazeViolationCounters:u,setReferenceData:h}),[s,a,l,n,c,u,h]);return o.jsx(Ir.Provider,{value:f,children:e})},Zs=()=>{const e=d.useContext(Ir);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}},Dl=()=>{const e=d.useContext(Ir);if(!e)throw new Error("useViolations must be used within a ProctoringProvider");return d.useSyncExternalStore(e.subscribe,()=>e.getState().logViolations,()=>e.getState().logViolations)},Rl=()=>{const e=d.useContext(Ir);if(!e)throw new Error("useTotalViolations must be used within a ProctoringProvider");return d.useSyncExternalStore(e.subscribe,()=>e.getState().totalViolations,()=>e.getState().totalViolations)},Ol=()=>{const e=d.useContext(Ir);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 ri(){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 ri().api||it.api}function rr(){return ri().ui||it.ui}function cn(){return ri().interview||it.interview}const io=({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"})]})}),no=({children:e,variant:t="primary",size:r="md",fullWidth:i=!1,isLoading:n=!1,disabled:s,className:a="",...c})=>{const l="iw-inline-flex iw-items-center iw-justify-center iw-rounded-md iw-font-medium iw-transition-colors iw-focus:outline-none iw-focus:ring-2 iw-focus:ring-primary-500 iw-focus:ring-offset-2",u={primary:"iw-bg-primary-600 iw-text-white iw-hover:bg-primary-700 iw-border iw-border-transparent",secondary:"iw-bg-primary-100 iw-text-primary-700 iw-hover:bg-primary-200 iw-border iw-border-transparent",outline:"iw-bg-transparent iw-text-primary-700 iw-border iw-border-primary-500 iw-hover:bg-primary-50",text:"iw-bg-transparent iw-text-primary-600 iw-hover:bg-primary-50 iw-border iw-border-transparent",gradient:"iw-text-white iw-border iw-border-transparent iw-bg-gradient-to-r iw-from-purple-500 iw-to-indigo-500 hover:iw-from-purple-600 hover:iw-to-indigo-600"},h={sm:"iw-px-3 iw-py-1.5 iw-text-sm",md:"iw-px-4 iw-py-2.5 iw-text-sm",lg:"iw-px-5 iw-py-3 iw-text-base"},f="iw-disabled:opacity-50 iw-disabled:cursor-not-allowed iw-disabled:pointer-events-none",w=i?"iw-w-full":"";return o.jsxs("button",{className:`${l} ${u[t]} ${h[r]} ${w} ${f} ${a}`,disabled:s||n,...c,children:[n&&o.jsx(io,{height:16,width:16,style:{marginRight:"3px"}}),e]})};function Bl(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 Ul(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 so(e,t){const r=Bl(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 Ul(i,n,s)}function Gl(e,t=.8){return{background:`linear-gradient(to bottom, ${so(e,t)}, #ffffff)`,color:"#1f2937"}}function Vl(e){return new Promise(t=>setTimeout(t,e))}function oo(e){return`linear-gradient(to left, ${so(e,.4)}, ${e})`}const $l=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);function Wl(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 zl=e=>{var t;return!e||typeof e!="string"?"":(t=e.charAt(0))==null?void 0:t.toUpperCase()},ao=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:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}),o.jsx("path",{d:"m9 12 2 2 4-4"})]}),co=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("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),o.jsx("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),o.jsx("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]}),Hl=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",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),o.jsx("path",{d:"M15 8a5 5 0 0 1 0 8"}),o.jsx("path",{d:"M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a.8 .8 0 0 1 1.5 .5v14a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5"})]}),Qe=e=>{const{baseColor:t,borderRadius:r}=rr(),{loading:i,children:n,...s}=e;return o.jsx(no,{style:{background:oo(t),borderRadius:r},...s,children:i?o.jsx(io,{}):n})},ii=({isOpen:e,onClose:t,children:r,title:i,showCloseButton:n=!0,closeOnOverlayClick:s=!0,closeOnEscape:a=!0,className:c=""})=>{if(d.useEffect(()=>{if(!e||!a)return;const h=f=>{f.key==="Escape"&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,a,t]),d.useEffect(()=>(e?(document.body.style.overflow="hidden",document.body.classList.add("interview-widget-container")):(document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")),()=>{document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")}),[e]),!e)return null;const l=h=>{s&&h.target===h.currentTarget&&t()},u=o.jsxs("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center",children:[o.jsx("div",{className:"iw-fixed iw-inset-0 iw-bg-black iw-bg-opacity-50 iw-transition-opacity",onClick:l}),o.jsxs("div",{className:`iw-relative iw-bg-white iw-rounded-lg iw-shadow-xl iw-max-w-md iw-w-full iw-mx-4 iw-max-h-[90vh] iw-overflow-hidden ${c}`,role:"dialog","aria-modal":"true","aria-labelledby":i?"dialog-title":void 0,children:[(i||n)&&o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between iw-p-4 iw-border-b iw-border-gray-200",children:[i&&o.jsx("h2",{id:"dialog-title",className:"iw-text-lg iw-font-semibold iw-text-gray-900",children:i}),n&&o.jsx("button",{onClick:t,className:"iw-p-1 iw-text-gray-400 iw-hover:text-gray-600 iw-transition-colors iw-rounded iw-hover:bg-gray-100","aria-label":"Close dialog",children:o.jsx("svg",{className:"iw-w-5 iw-h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),o.jsx("div",{className:"iw-p-4 iw-overflow-y-auto",children:r})]})]});return tr.createPortal(u,document.body)},ql=e=>o.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-info-icon prefix__lucide-info",...e,children:[o.jsx("circle",{cx:12,cy:12,r:10}),o.jsx("path",{d:"M12 16v-4M12 8h.01"})]}),Yl=e=>o.jsx("svg",{width:24,height:24,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"prefix__lucide prefix__lucide-scan-face-icon prefix__lucide-scan-face",...e,children:o.jsx("path",{d:"M3 7V5a2 2 0 012-2h2M17 3h2a2 2 0 012 2v2M21 17v2a2 2 0 01-2 2h-2M7 21H5a2 2 0 01-2-2v-2M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01"})});function Kl({isOpen:e,onDecline:t,onContinue:r}){return o.jsx(ii,{isOpen:e,showCloseButton:!1,onClose:t,className:"iw-overflow-y-auto",children:e&&o.jsx("div",{className:"iw-bg-white iw-border-slate-200 iw-rounded-2xl iw-p-0 iw-shadow-xl sm:iw-max-w-xl",children:o.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-4",children:[o.jsx("div",{className:"iw--mt-0.5 iw-h-2.5 iw-w-full iw-rounded-t-2xl iw-bg-gradient-to-r iw-from-blue-500 iw-to-indigo-500"}),o.jsx("div",{className:"iw-sr-only",children:"Face Data Usage Notice"}),o.jsx("div",{className:"iw-sr-only",children:"Permission to use face data for interview monitoring"}),o.jsxs("div",{className:"iw-px-8 iw-py-8",children:[o.jsxs("div",{className:"iw-text-center",children:[o.jsx("div",{className:"iw-mx-auto iw-mb-6 iw-flex iw-h-16 iw-w-16 iw-items-center iw-justify-center iw-rounded-full iw-border iw-border-blue-200 iw-bg-gradient-to-br iw-from-blue-50 iw-to-blue-100 iw-shadow-sm iw-ring-1 iw-ring-blue-100",children:o.jsx(Yl,{className:"iw-text-blue-600"})}),o.jsx("h1",{className:"iw-text-zinc-700 iw-mb-6 iw-text-2xl iw-font-semibold iw-tracking-tight",children:"Face Data Usage Notice"})]}),o.jsxs("ul",{className:"iw-mb-4 iw-list-item iw-space-y-4 iw-text-sm iw-leading-relaxed iw-text-gray-700",children:[o.jsx("li",{children:"To ensure the integrity of the interview process, this platform uses your device's camera to monitor your face and gaze direction."}),o.jsx("li",{children:"Your face data is processed only for proctoring purposes (e.g., detecting if you are looking away or off-screen)."}),o.jsx("li",{children:"All processing is limited to the interview session and is used solely to maintain fairness."})]}),o.jsxs("div",{className:"iw-text-zinc-700 iw-flex iw-items-start iw-gap-2 iw-rounded-md iw-border iw-border-blue-100 iw-bg-blue-50/60 iw-p-3 iw-text-sm iw-font-medium",children:[o.jsx(ql,{className:"iw-text-neutral-400 iw-mt-0.5 iw-inline-block iw-size-4 iw-flex-shrink-0"}),o.jsx("p",{className:"",children:"Please note that we do not store, share, or use your biometric data beyond the scope of this interview."})]}),o.jsx("p",{className:"iw-text-neutral-400 iw-my-4 iw-text-center iw-text-sm",children:"By continuing, you acknowledge and consent to the use of your face data exclusively for interview monitoring purposes."}),o.jsxs("div",{className:"iw-flex iw-gap-3 iw-border-t iw-border-gray-200/80 iw-pt-6",children:[o.jsx(Qe,{onClick:t,className:"iw-flex-1 iw-border",children:"Decline"}),o.jsx(Qe,{onClick:r,className:"iw-flex-1",children:"I Understand & Continue"})]})]})]})})})}function Xl(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 Bt(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=Xl(s);if(!a.retryable||n===r.attempts)throw a;const c=Ql(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 Ql(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 Ut={v2:"/v2"},Gt={GENERATE_QUESTION:e=>`${Ut.v2}/interviews/${e}/next-question`,SCREENSHOT_UPLOAD:e=>`${Ut.v2}/interviews/${e}/assets/upload-url`,CONFIRM_UPLOAD:e=>`${Ut.v2}/interviews/assets/${e}/confirm`,TRANSCRIBE_ANSWER:e=>`${Ut.v2}/interviews/${e}/transcribe-answer`,SUBMIT_ANSWER:e=>`${Ut.v2}/interviews/${e}/submit-answer`,EXIT:e=>`${Ut.v2}/interviews/${e}/exit`,CONFIG:e=>`${Ut.v2}/interviews/${e}/config`};class Jl{constructor(t={}){Oe(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 Bt(`${this.getBaseUrl()}${Gt.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 Bt(`${this.getBaseUrl()}${Gt.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 Bt(`${this.getBaseUrl()}${Gt.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 Bt(`${this.getBaseUrl()}${Gt.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 Bt(`${this.getBaseUrl()}${Gt.SCREENSHOT_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({filename:r,mime_type:"image/jpeg",asset_type:jl.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 Bt(`${this.getBaseUrl()}${Gt.CONFIRM_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to confirm screenshot upload: ${r.status}`)}}function lo(){const e=ri();return d.useMemo(()=>{const r=e.api||{};return new Jl(r)},[e.api])}const Lr=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"})]}),ln=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"})]}),Zl=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 6v6l4 2"}),o.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),uo=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"})]}),eu=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("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),o.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),o.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),o.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),un=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("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),o.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),o.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),o.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),tu=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("circle",{cx:"12",cy:"12",r:"3"}),o.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),o.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),o.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),o.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),ru=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})]}),iu=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"})]}),nu=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})]}),su=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})]}),Fr={FACE_DETECTED:"face_detected",NO_FACE:"no_face_detected",MULTIPLE_FACES:"multiple_faces",LOOKING_AWAY:"looking_away",CAMERA_ERROR:"camera_error"},ou={[Fr.FACE_DETECTED]:{icon:uo,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"},[Fr.NO_FACE]:{icon:iu,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"},[Fr.MULTIPLE_FACES]:{icon:su,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",description:"For interview integrity, please ensure you are alone in the room and only your face is visible to the camera.",buttonText:"I Understood"},[Fr.LOOKING_AWAY]:{icon:nu,iconColor:"iw-text-amber-600",iconBg:"iw-bg-amber-50",iconBorder:"iw-border-amber-200/75",title:"Stay Focused",subtitle:"We noticed you looked away from the screen",description:"To ensure interview integrity, please keep your attention on the screen throughout the session.",buttonText:"I Understood"},[Fr.CAMERA_ERROR]:{icon:Lr,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, then refresh the page to continue.",buttonText:"I Understood"}};function au({isOpen:e,onClose:t,warningType:r}){const i=ou[r],n=i.icon,s=()=>{t()};return r==="face_detected"?null:o.jsx(ii,{isOpen:e,onClose:t,children:e&&o.jsx("div",{className:"iw-bg-white iw-border-white iw-border iw-p-0 iw-shadow-lg sm:iw-max-w-md",children:o.jsxs("div",{children:[o.jsx("div",{className:"iw-sr-only",children:i.description}),o.jsxs("div",{className:"iw-px-8 iw-py-8 iw-text-center",children:[o.jsx("div",{className:`iw-mx-auto iw-mb-6 iw-flex iw-h-16 iw-w-16 iw-items-center iw-justify-center iw-rounded-full ${i.iconBg} border ${i.iconBorder}`,children:o.jsx(n,{className:`iw-h-7 iw-w-7 ${i.iconColor}`})}),o.jsx("h1",{className:"iw-text-foreground iw-mb-3 iw-text-2xl iw-font-bold iw-tracking-tight",children:i.title}),o.jsx("h2",{className:"iw-text-gray-500 iw-mb-6 iw-text-base iw-font-medium",children:i.subtitle}),o.jsx("p",{className:"iw-text-neutral-400 iw-mx-auto iw-mb-8 iw-max-w-sm iw-text-sm iw-leading-relaxed",children:i.description}),o.jsx(Qe,{onClick:s,className:"iw-w-full iw-bg-gray-800 iw-text-white hover:iw-bg-gray-800",children:i.buttonText})]})]})})})}const cu=({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."]})]})}),lu=({showControls:e,isBubbleOpen:t,setIsBubbleOpen:r,setReference:i,clearCache:n,isModelLoaded:s,gazeAnalysisEnabled:a,referenceSet:c,showLandmarks:l,setShowLandmarks:u,showEngagementBar:h,setShowEngagementBar:f,handleToggleGazeAnalysis:w,stats:m,statusMessage:g,loadingProgress:b})=>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(ru,{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:_=>w(_.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:_=>u(_.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:h,onChange:_=>f(_.target.checked),disabled:!a}),"Show Engagement Bar"]})]}),c&&o.jsx(cu,{gazeAnalysisEnabled:a,isModelLoaded:s,loadingProgress:b,stats:m,statusMessage:g})]})]}):null;var ir=typeof self<"u"?self:{};function Vt(){throw Error("Invalid UTF8")}function ho(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let ni,dn;const uu=typeof TextDecoder<"u";let du;const hu=typeof TextEncoder<"u";function fo(e){if(hu)e=(du||(du=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}var hn,si;e:{for(var wo=["CLOSURE_FLAGS"],fn=ir,wn=0;wn<wo.length;wn++)if((fn=fn[wo[wn]])==null){si=null;break e}si=fn}var Pr,mo=si&&si[610401301];hn=mo!=null&&mo;const go=ir.navigator;function mn(e){return!!hn&&!!Pr&&Pr.brands.some(({brand:t})=>t&&t.indexOf(e)!=-1)}function Be(e){var t;return(t=ir.navigator)&&(t=t.userAgent)||(t=""),t.indexOf(e)!=-1}function Et(){return!!hn&&!!Pr&&Pr.brands.length>0}function gn(){return Et()?mn("Chromium"):(Be("Chrome")||Be("CriOS"))&&!(!Et()&&Be("Edge"))||Be("Silk")}function oi(e){return oi[" "](e),e}Pr=go&&go.userAgentData||null,oi[" "]=function(){};var fu=!Et()&&(Be("Trident")||Be("MSIE"));!Be("Android")||gn(),gn(),Be("Safari")&&(gn()||!Et()&&Be("Coast")||!Et()&&Be("Opera")||!Et()&&Be("Edge")||(Et()?mn("Microsoft Edge"):Be("Edg/"))||Et()&&mn("Opera"));var po={},Dr=null;function wu(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(u){for(;l<s.length;){const h=s.charAt(l++),f=Dr[h];if(f!=null)return f;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return u}xo();let l=0;for(;;){const u=c(-1),h=c(0),f=c(64),w=c(64);if(w===64&&u===-1)break;a(u<<2|h>>4),f!=64&&(a(h<<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 xo(){if(!Dr){Dr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const i=e.concat(t[r].split(""));po[r]=i;for(let n=0;n<i.length;n++){const s=i[n];Dr[s]===void 0&&(Dr[s]=n)}}}}var yo=typeof Uint8Array<"u",bo=!fu&&typeof btoa=="function";function vo(e){if(!bo){var t;t===void 0&&(t=0),xo(),t=po[t];var r=Array(Math.floor(e.length/3)),i=t[64]||"";let l=0,u=0;for(;l<e.length-2;l+=3){var n=e[l],s=e[l+1],a=e[l+2],c=t[n>>2];n=t[(3&n)<<4|s>>4],s=t[(15&s)<<2|a>>6],a=t[63&a],r[u++]=c+n+s+a}switch(c=0,a=i,e.length-l){case 2:a=t[(15&(c=e[l+1]))<<2]||i;case 1:e=e[l],r[u]=t[e>>2]+t[(3&e)<<4|c>>4]+a+i}return r.join("")}for(t="",r=0,i=e.length-10240;r<i;)t+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));return t+=String.fromCharCode.apply(null,r?e.subarray(r):e),btoa(t)}const _o=/[-_.]/g,mu={"-":"+",_:"/",".":"="};function gu(e){return mu[e]||""}function ko(e){if(!bo)return wu(e);_o.test(e)&&(e=e.replace(_o,gu)),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 $t(e){return yo&&e!=null&&e instanceof Uint8Array}var nr={};function Wt(){return pu||(pu=new wt(null,nr))}function pn(e){Eo(nr);var t=e.g;return(t=t==null||$t(t)?t:typeof t=="string"?ko(t):null)==null?t:e.g=t}var wt=class{h(){return new Uint8Array(pn(this)||0)}constructor(e,t){if(Eo(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let pu,xu;function Eo(e){if(e!==nr)throw Error("illegal external caller")}function So(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function xn(e){return So(e=Error(e),"warning"),e}function yn(e){if(e!=null){var t=xu??(xu={}),r=t[e]||0;r>=5||(t[e]=r+1,So(e=Error(),"incident"),function(i){ir.setTimeout(()=>{throw i},0)}(e))}}var ai=typeof Symbol=="function"&&typeof Symbol()=="symbol";function sr(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 yu=sr("jas",void 0,!0),Ao=sr(void 0,"0di"),Rr=sr(void 0,"1oa"),or=sr(void 0,Symbol()),bu=sr(void 0,"0actk"),To=sr(void 0,"8utk");const k=ai?yu:"Ea",jo={Ea:{value:0,configurable:!0,writable:!0,enumerable:!1}},No=Object.defineProperties;function ci(e,t){ai||k in e||No(e,jo),e[k]|=t}function ae(e,t){ai||k in e||No(e,jo),e[k]=t}function ar(e){return ci(e,34),e}function vu(e,t){ae(t,-15615&(0|e))}function bn(e,t){ae(t,-15581&(34|e))}function li(){return typeof BigInt=="function"}function ke(e){return Array.prototype.slice.call(e)}var vn,Or={};function ui(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)&&e.constructor===Object}function _n(e,t){if(e!=null){if(typeof e=="string")e=e?new wt(e,nr):Wt();else if(e.constructor!==wt)if($t(e))e=e.length?new wt(new Uint8Array(e),nr):Wt();else{if(!t)throw Error();e=void 0}}return e}const Co=[];function St(e){if(2&e)throw Error()}ae(Co,55),vn=Object.freeze(Co);class Io{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}}function kn(e){return or?e[or]:void 0}var _u=Object.freeze({});function di(e){return e.Na=!0,e}var ku=di(e=>typeof e=="number"),Mo=di(e=>typeof e=="string"),Eu=di(e=>typeof e=="boolean"),hi=typeof ir.BigInt=="function"&&typeof ir.BigInt(0)=="bigint";function At(e){var t=e;if(Mo(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(ku(t)&&!Number.isSafeInteger(t))throw Error(String(t));return hi?BigInt(e):e=Eu(e)?e?"1":"0":Mo(e)?e.trim()||"0":String(e)}var En=di(e=>hi?e>=Au&&e<=ju:e[0]==="-"?Lo(e,Su):Lo(e,Tu));const Su=Number.MIN_SAFE_INTEGER.toString(),Au=hi?BigInt(Number.MIN_SAFE_INTEGER):void 0,Tu=Number.MAX_SAFE_INTEGER.toString(),ju=hi?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Lo(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 Nu=typeof Uint8Array.prototype.slice=="function";let Fo,U=0,Z=0;function Po(e){const t=e>>>0;U=t,Z=(e-t)/4294967296>>>0}function zt(e){if(e<0){Po(-e);const[t,r]=jn(U,Z);U=t>>>0,Z=r>>>0}else Po(e)}function Sn(e){const t=Fo||(Fo=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),Z=0,U=t.getUint32(0,!0)}function An(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Br(e,t)}function Tn(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=An(e,t))=="number"?r?-e:e:r?"-"+e:e}function Br(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else li()?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 Ro(){var e=U,t=Z;if(2147483648&t)if(li())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,i]=jn(e,t);e="-"+Br(r,i)}else e=Br(e,t);return e}function fi(e){if(e.length<16)zt(Number(e));else if(li())e=BigInt(e),U=Number(e&BigInt(4294967295))>>>0,Z=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");Z=U=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));Z*=1e6,U=1e6*U+s,U>=4294967296&&(Z+=Math.trunc(U/4294967296),Z>>>=0,U>>>=0)}if(t){const[i,n]=jn(U,Z);U=i,Z=n}}}function jn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}const Ur=typeof BigInt=="function"?BigInt.asIntN:void 0,Cu=typeof BigInt=="function"?BigInt.asUintN:void 0,Tt=Number.isSafeInteger,wi=Number.isFinite,cr=Math.trunc,Iu=At(0);function jt(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Oo(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const Mu=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Gr(e){switch(typeof e){case"bigint":return!0;case"number":return wi(e);case"string":return Mu.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 wi(e)?0|e:void 0}function Bo(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return wi(e)?e>>>0:void 0}function Uo(e){if(e[0]==="-")return!1;const t=e.length;return t<20||t===20&&Number(e.substring(0,6))<184467}function Go(e){const t=e.length;return e[0]==="-"?t<20||t===20&&Number(e.substring(0,7))>-922337:t<19||t===19&&Number(e.substring(0,6))<922337}function Vo(e){return Go(e)?e:(fi(e),Ro())}function Nn(e){return e=cr(e),Tt(e)||(zt(e),e=Tn(U,Z)),e}function $o(e){var t=cr(Number(e));return Tt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Vo(e))}function Wo(e){var t=cr(Number(e));return Tt(t)?At(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),li()?At(Ur(64,BigInt(e))):At(Vo(e)))}function zo(e){if(Tt(e))e=At(Nn(e));else{if(e=cr(e),Tt(e))e=String(e);else{const t=String(e);Go(t)?e=t:(zt(e),e=Ro())}e=At(e)}return e}function Cn(e){return e==null?e:typeof e=="bigint"?(En(e)?e=Number(e):(e=Ur(64,e),e=En(e)?Number(e):String(e)),e):Gr(e)?typeof e=="number"?Nn(e):$o(e):void 0}function Lu(e){if(e==null)return e;var t=typeof e;if(t==="bigint")return String(Cu(64,e));if(Gr(e)){if(t==="string")return t=cr(Number(e)),Tt(t)&&t>=0?e=String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Uo(e)||(fi(e),e=Br(U,Z))),e;if(t==="number")return(e=cr(e))>=0&&Tt(e)?e:function(r){if(r<0){zt(r);var i=Br(U,Z);return r=Number(i),Tt(r)?r:i}return Uo(i=String(r))?i:(zt(r),An(U,Z))}(e)}}function Ho(e){if(typeof e!="string")throw Error();return e}function ur(e){if(e!=null&&typeof e!="string")throw Error();return e}function dr(e){return e==null||typeof e=="string"?e:void 0}function In(e,t,r,i){if(e!=null&&typeof e=="object"&&e.W===Or)return e;if(!Array.isArray(e))return r?2&i?((e=t[Ao])||(ar((e=new t).u),e=t[Ao]=e),t=e):t=new t:t=void 0,t;let n=r=0|e[k];return n===0&&(n|=32&i),n|=2&i,n!==r&&ae(e,n),new t(e)}function Fu(e,t,r){if(t)e:{if(!Gr(t=e))throw xn("int64");switch(typeof t){case"string":t=Wo(t);break e;case"bigint":t=At(Ur(64,t));break e;default:t=zo(t)}}else e=typeof(t=e),t=t==null?t:e==="bigint"?At(Ur(64,t)):Gr(t)?e==="string"?Wo(t):zo(t):void 0;return(e=t)==null?r?Iu:void 0:e}function Pu(e){return e}const Du={};let Ru=function(){try{return oi(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class Mn{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 Ou=Ru?(Object.setPrototypeOf(Mn.prototype,Map.prototype),Object.defineProperties(Mn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Mn):class extends Map{constructor(){super()}};function qo(e){return e}function Ln(e){if(2&e.M)throw Error("Cannot mutate an immutable Map")}var nt=class extends Ou{constructor(e,t,r=qo,i=qo){super();let n=0|e[k];n|=64,ae(e,n),this.M=n,this.I=t,this.S=r,this.X=this.I?Bu:i;for(let s=0;s<e.length;s++){const a=e[s],c=r(a[0],!1,!0);let l=a[1];t?l===void 0&&(l=null):l=i(a[1],!1,!0,void 0,void 0,n),super.set(c,l)}}La(){var e=Wu;if(this.size!==0)return Array.from(super.entries(),t=>(t[0]=e(t[0]),t[1]=e(t[1]),t))}da(e=Uu){const t=[],r=super.entries();for(var i;!(i=r.next()).done;)(i=i.value)[0]=e(i[0]),i[1]=e(i[1]),t.push(i);return t}clear(){Ln(this),super.clear()}delete(e){return Ln(this),super.delete(this.S(e,!0,!1))}entries(){if(this.I){var e=super.keys();e=new Io(e,Gu,this)}else e=super.entries();return e}values(){if(this.I){var e=super.keys();e=new Io(e,nt.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.I?super.forEach((r,i,n)=>{e.call(t,n.get(i),i,n)}):super.forEach(e,t)}set(e,t){return Ln(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.X(t,!0,!0,this.I,!1,this.M))}Ja(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.I?e===void 0?null:e:this.X(e,!1,!0,void 0,!1,this.M),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.I;return r?((r=this.X(t,!1,!0,r,this.pa,this.M))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function Bu(e,t,r,i,n,s){return e=In(e,i,r,s),n&&(e=pi(e)),e}function Uu(e){return e}function Gu(e){return[e,this.get(e)]}let Vu,Yo,Ko,$u;function Xo(){return Vu||(Vu=new nt(ar([]),void 0,void 0,void 0,Du))}function Fn(e,t,r,i,n){if(e!=null){if(Array.isArray(e)){const s=0|e[k];return e.length===0&&1&s?void 0:n&&2&s?e:mi(e,t,r,i!==void 0,n)}return t(e,i)}}function mi(e,t,r,i,n){const s=i||r?0|e[k]:0,a=i?!!(32&s):void 0;let c=0;const l=(i=ke(e)).length;for(let g=0;g<l;g++){var u=i[g];if(g===l-1&&ui(u)){var h=t,f=r,w=a,m=n;let b;for(let _ in u){const p=Fn(u[_],h,f,w,m);p!=null&&((b??(b={}))[_]=p)}u=b}else u=Fn(i[g],t,r,a,n);i[g]=u,u!=null&&(c=g+1)}return c<l&&(i.length=c),r&&((e=kn(e))&&(i[or]=ke(e)),r(s,i)),i}function Wu(e){return Fn(e,Pn,void 0,void 0,!1)}function Pn(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return En(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if($t(e))return $t(e)&&yn(To),vo(e);if(e.W===Or)return Qo(e);if(e instanceof wt){const t=e.g;return t==null?"":typeof t=="string"?t:e.g=vo(t)}return e instanceof nt?e.La():void 0}return e}function Qo(e){var t=e.u;e=mi(t,Pn,void 0,void 0,!1);var r=0|t[k];if((t=e.length)&&!(512&r)){var i=e[t-1],n=!1;ui(i)?(t--,n=!0):i=void 0;var s=t-(r=512&r?0:-1),a=(Yo??Pu)(s,r,e,i);if(i&&(e[t]=void 0),s<a&&i){for(var c in s=!0,i){const l=+c;l<=a?(e[n=l+r]=i[c],t=Math.max(n+1,t),n=!1,delete i[c]):s=!1}s&&(i=void 0)}for(s=t-1;t>0;s=t-1)if((c=e[s])==null)t--,n=!0;else{if(!((s-=r)>=a))break;(i??(i={}))[s]=c,t--,n=!0}n&&(e.length=t),i&&e.push(i)}return e}function Nt(e,t,r){return e=Jo(e,t[0],t[1],r?1:2),t!==Ko&&r&&ci(e,8192),e}function Jo(e,t,r,i){if(e==null){var n=96;r?(e=[r],n|=512):e=[],t&&(n=-16760833&n|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(8192&(n=0|e[k])||!(64&n)||2&n||yn(bu),1024&n)throw Error("farr");if(64&n)return e;if(i===1||i===2||(n|=64),r&&(n|=512,r!==e[0]))throw Error("mid");e:{var s=(r=e).length;if(s){var a=s-1;if(ui(i=r[a])){if((a-=t=512&(n|=256)?0:-1)>=1024)throw Error("pvtlmt");for(var c in i)(s=+c)<a&&(r[s+t]=i[c],delete i[c]);n=-16760833&n|(1023&a)<<14;break e}}if(t){if((c=Math.max(t,s-(512&n?0:-1)))>1024)throw Error("spvt");n=-16760833&n|(1023&c)<<14}}}return ae(e,n),e}function Dn(e,t,r=bn){if(e!=null){if(yo&&e instanceof Uint8Array)return t?e:new Uint8Array(e);if(Array.isArray(e)){var i=0|e[k];return 2&i?e:(t&&(t=i===0||!!(32&i)&&!(64&i||!(16&i))),t?(ae(e,34|i),4&i&&Object.freeze(e),e):mi(e,Dn,4&i?bn:r,!0,!0))}return e.W===Or?e=2&(i=0|(r=e.u)[k])?e:new e.constructor(gi(r,i,!0)):e instanceof nt&&!(2&e.M)&&(r=ar(e.da(Dn)),e=new nt(r,e.I,e.S,e.X)),e}}function gi(e,t,r){const i=r||2&t?bn:vu,n=!!(32&t);return e=function(s,a,c){const l=ke(s);var u=l.length;const h=256&a?l[u-1]:void 0;for(u+=h?-1:0,a=512&a?1:0;a<u;a++)l[a]=c(l[a]);if(h){a=l[a]={};for(const f in h)a[f]=c(h[f])}return(s=kn(s))&&(l[or]=ke(s)),l}(e,t,s=>Dn(s,n,i)),ci(e,32|(r?2:0)),e}function pi(e){const t=e.u,r=0|t[k];return 2&r?new e.constructor(gi(t,r,!1)):e}function hr(e,t){return mt(e=e.u,0|e[k],t)}function mt(e,t,r){if(r===-1)return null;const i=r+(512&t?0:-1),n=e.length-1;return i>=n&&256&t?e[n][r]:i<=n?e[i]:void 0}function $(e,t,r){const i=e.u;let n=0|i[k];return St(n),K(i,n,t,r),e}function K(e,t,r,i){const n=512&t?0:-1,s=r+n;var a=e.length-1;return s>=a&&256&t?(e[a][r]=i,t):s<=a?(e[s]=i,t):(i!==void 0&&(r>=(a=t>>14&1023||536870912)?i!=null&&(e[a+n]={[r]:i},ae(e,t|=256)):e[s]=i),t)}function xi(e,t){let r=0|(e=e.u)[k];const i=mt(e,r,t),n=jt(i);return n!=null&&n!==i&&K(e,r,t,n),n}function Zo(e){let t=0|(e=e.u)[k];const r=mt(e,t,1),i=_n(r,!0);return i!=null&&i!==r&&K(e,t,1,i),i}function Ht(){return _u===void 0?2:4}function qt(e,t,r,i,n){const s=e.u,a=2&(e=0|s[k])?1:i;n=!!n;let c=0|(i=Rn(s,e,t))[k];if(!(4&c)){4&c&&(i=ke(i),c=xt(c,e),e=K(s,e,t,i));let l=0,u=0;for(;l<i.length;l++){const h=r(i[l]);h!=null&&(i[u++]=h)}u<l&&(i.length=u),c=On(c,e),r=-2049&(20|c),c=r&=-4097,ae(i,c),2&c&&Object.freeze(i)}return a===1||a===4&&32&c?gt(c)||(n=c,c|=2,c!==n&&ae(i,c),Object.freeze(i)):(a===2&&gt(c)&&(i=ke(i),c=xt(c,e),c=Ct(c,e,n),ae(i,c),e=K(s,e,t,i)),gt(c)||(t=c,c=Ct(c,e,n),c!==t&&ae(i,c))),i}function Rn(e,t,r){return e=mt(e,t,r),Array.isArray(e)?e:vn}function On(e,t){return e===0&&(e=xt(e,t)),1|e}function gt(e){return!!(2&e)&&!!(4&e)||!!(1024&e)}function ea(e){e=ke(e);for(let t=0;t<e.length;t++){const r=e[t]=ke(e[t]);Array.isArray(r[1])&&(r[1]=ar(r[1]))}return e}function Bn(e,t,r,i){let n=0|(e=e.u)[k];St(n),K(e,n,t,(i==="0"?Number(r)===0:r===i)?void 0:r)}function fr(e,t,r,i){St(t);let n=Rn(e,t,r);const s=n!==vn;if(64&t||!(8192&t)||!s){const a=s?0|n[k]:0;let c=a;(!s||2&c||gt(c)||4&c&&!(32&c))&&(n=ke(n),c=xt(c,t),t=K(e,t,r,n)),c=-13&On(c,t),c=Ct(i?-17&c:16|c,t,!0),c!==a&&ae(n,c)}return n}function Un(e,t){var r=rc;return Vn(Gn(e=e.u),e,0|e[k],r)===t?t:-1}function Gn(e){if(ai)return e[Rr]??(e[Rr]=new Map);if(Rr in e)return e[Rr];const t=new Map;return Object.defineProperty(e,Rr,{value:t}),t}function ta(e,t,r,i){const n=Gn(e),s=Vn(n,e,t,r);return s!==i&&(s&&(t=K(e,t,s)),n.set(r,i)),t}function Vn(e,t,r,i){let n=e.get(i);if(n!=null)return n;n=0;for(let s=0;s<i.length;s++){const a=i[s];mt(t,r,a)!=null&&(n!==0&&(r=K(t,r,n)),n=a)}return e.set(i,n),n}function $n(e,t,r){let i=0|e[k];const n=mt(e,i,r);let s;if(n!=null&&n.W===Or)return(t=pi(n))!==n&&K(e,i,r,t),t.u;if(Array.isArray(n)){const a=0|n[k];s=2&a?Nt(gi(n,a,!1),t,!0):64&a?n:Nt(s,t,!0)}else s=Nt(void 0,t,!0);return s!==n&&K(e,i,r,s),s}function ra(e,t,r){let i=0|(e=e.u)[k];const n=mt(e,i,r);return(t=In(n,t,!1,i))!==n&&t!=null&&K(e,i,r,t),t}function P(e,t,r){if((t=ra(e,t,r))==null)return t;let i=0|(e=e.u)[k];if(!(2&i)){const n=pi(t);n!==t&&K(e,i,r,t=n)}return t}function ia(e,t,r,i,n,s,a){e=e.u;var c=!!(2&t);const l=c?1:n;s=!!s,a&&(a=!c);var u=0|(n=Rn(e,t,i))[k];if(!(c=!!(4&u))){var h=n,f=t;const w=!!(2&(u=On(u,t)));w&&(f|=2);let m=!w,g=!0,b=0,_=0;for(;b<h.length;b++){const p=In(h[b],r,!1,f);if(p instanceof r){if(!w){const A=!!(2&(0|p.u[k]));m&&(m=!A),g&&(g=A)}h[_++]=p}}_<b&&(h.length=_),u|=4,u=g?16|u:-17&u,ae(h,u=m?8|u:-9&u),w&&Object.freeze(h)}if(a&&!(8&u||!n.length&&(l===1||l===4&&32&u))){for(gt(u)&&(n=ke(n),u=xt(u,t),t=K(e,t,i,n)),r=n,a=u,h=0;h<r.length;h++)(u=r[h])!==(f=pi(u))&&(r[h]=f);a|=8,ae(r,a=r.length?-17&a:16|a),u=a}return l===1||l===4&&32&u?gt(u)||(t=u,(u|=!n.length||16&u&&(!c||32&u)?2:1024)!==t&&ae(n,u),Object.freeze(n)):(l===2&&gt(u)&&(ae(n=ke(n),u=Ct(u=xt(u,t),t,s)),t=K(e,t,i,n)),gt(u)||(i=u,(u=Ct(u,t,s))!==i&&ae(n,u))),n}function pt(e,t,r){const i=0|e.u[k];return ia(e,i,t,r,Ht(),!1,!(2&i))}function S(e,t,r,i){return i==null&&(i=void 0),$(e,r,i)}function Vr(e,t,r,i){i==null&&(i=void 0);e:{let n=0|(e=e.u)[k];if(St(n),i==null){const s=Gn(e);if(Vn(s,e,n,r)!==t)break e;s.set(r,0)}else n=ta(e,n,r,t);K(e,n,t,i)}}function xt(e,t){return-1025&(e=32|(2&t?2|e:-3&e))}function Ct(e,t,r){return 32&t&&r||(e&=-33),e}function yi(e,t,r){St(0|e.u[k]),qt(e,t,dr,2,!0).push(Ho(r))}function bi(e,t,r,i){const n=0|e.u[k];St(n),e=ia(e,n,r,t,2,!0),i=i??new r,e.push(i),e[k]=2&(0|i.u[k])?-9&e[k]:-17&e[k]}function Ue(e,t){return lr(hr(e,t))}function Ge(e,t){return dr(hr(e,t))}function ie(e,t){return xi(e,t)??0}function $r(e,t,r){if(r!=null&&typeof r!="boolean")throw e=typeof r,Error(`Expected boolean but got ${e!="object"?e:r?Array.isArray(r)?"array":e:"null"}: ${r}`);$(e,t,r)}function st(e,t,r){if(r!=null){if(typeof r!="number"||!wi(r))throw xn("int32");r|=0}$(e,t,r)}function v(e,t,r){if(r!=null&&typeof r!="number")throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);$(e,t,r)}function vi(e,t,r){{const a=e.u;let c=0|a[k];if(St(c),r==null)K(a,c,t);else{var i=e=0|r[k],n=gt(e),s=n||Object.isFrozen(r);for(n||(e=0),s||(r=ke(r),i=0,e=Ct(e=xt(e,c),c,!0),s=!1),e|=21,n=0;n<r.length;n++){const l=r[n],u=Ho(l);Object.is(l,u)||(s&&(r=ke(r),i=0,e=Ct(e=xt(e,c),c,!0),s=!1),r[n]=u)}e!==i&&(s&&(r=ke(r),e=Ct(e=xt(e,c),c,!0)),ae(r,e)),K(a,c,t,r)}}}function na(e,t){return Error(`Invalid wire type: ${e} (at position ${t})`)}function Wn(){return Error("Failed to read varint, encoding is invalid.")}function sa(e,t){return Error(`Tried to read past the end of the data ${t} > ${e}`)}function zn(e){if(typeof e=="string")return{buffer:ko(e),O:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),O:!1};if(e.constructor===Uint8Array)return{buffer:e,O:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),O:!1};if(e.constructor===wt)return{buffer:pn(e)||new Uint8Array(0),O:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),O:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Hn(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);for(s>32&&(n|=(127&r)>>4),s=3;s<32&&128&r;s+=7)r=a[c++],n|=(127&r)<<s;if(Yt(e,c),r<128)return t(i>>>0,n>>>0);throw Wn()}function qn(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 Yt(e,r),!!(127&t)}throw Wn()}function It(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 Wn();return Yt(e,r),n}function yt(e){return It(e)>>>0}function Yn(e){var t=e.h;const r=e.g,i=t[r],n=t[r+1],s=t[r+2];return t=t[r+3],Yt(e,e.g+4),(i<<0|n<<8|s<<16|t<<24)>>>0}function Kn(e){var t=Yn(e);e=2*(t>>31)+1;const r=t>>>23&255;return t&=8388607,r==255?t?NaN:e*(1/0):r==0?1401298464324817e-60*e*t:e*Math.pow(2,r-150)*(t+8388608)}function zu(e){return It(e)}function Xn(e,t,{aa:r=!1}={}){e.aa=r,t&&(t=zn(t),e.h=t.buffer,e.m=t.O,e.j=0,e.l=e.h.length,e.g=e.j)}function Yt(e,t){if(e.g=t,t>e.l)throw sa(e.l,t)}function oa(e,t){if(t<0)throw Error(`Tried to read a negative byte length: ${t}`);const r=e.g,i=r+t;if(i>e.l)throw sa(t,e.l-r);return e.g=i,r}function aa(e,t){if(t==0)return Wt();var r=oa(e,t);return e.aa&&e.m?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):Nu?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?Wt():new wt(r,nr)}nt.prototype.toJSON=void 0;var ca=[];function la(e){var t=e.g;if(t.g==t.l)return!1;e.l=e.g.g;var r=yt(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5))throw na(r,e.l);if(t<1)throw Error(`Invalid field number: ${t} (at position ${e.l})`);return e.m=t,e.h=r,!0}function _i(e){switch(e.h){case 0:e.h!=0?_i(e):qn(e.g);break;case 1:Yt(e=e.g,e.g+8);break;case 2:if(e.h!=2)_i(e);else{var t=yt(e.g);Yt(e=e.g,e.g+t)}break;case 5:Yt(e=e.g,e.g+4);break;case 3:for(t=e.m;;){if(!la(e))throw Error("Unmatched start-group tag: stream EOF");if(e.h==4){if(e.m!=t)throw Error("Unmatched end-group tag");break}_i(e)}break;default:throw na(e.h,e.l)}}function Wr(e,t,r){const i=e.g.l,n=yt(e.g),s=e.g.g+n;let a=s-i;if(a<=0&&(e.g.l=s,r(t,e,void 0,void 0,void 0),a=s-e.g.g),a)throw Error(`Message parsing ended unexpectedly. Expected to read ${n} bytes, instead read ${n-a} bytes, either the data ended unexpectedly or the message misreported its own length`);return e.g.g=s,e.g.l=i,t}function Qn(e){var t=yt(e.g),r=oa(e=e.g,t);if(e=e.h,uu){var i,n=e;(i=dn)||(i=dn=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(ni===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),ni=!0}catch{ni=!1}}throw!ni&&(dn=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?Vt():(c=e[s++],a<194||(192&c)!=128?(s--,Vt()):r.push((31&a)<<6|63&c)):a<240?s>=t-1?Vt():(c=e[s++],(192&c)!=128||a===224&&c<160||a===237&&c>=160||(192&(i=e[s++]))!=128?(s--,Vt()):r.push((15&a)<<12|(63&c)<<6|63&i)):a<=244?s>=t-2?Vt():(c=e[s++],(192&c)!=128||c-144+(a<<28)>>30||(192&(i=e[s++]))!=128||(192&(n=e[s++]))!=128?(s--,Vt()):(a=(7&a)<<18|(63&c)<<12|(63&i)<<6|63&n,a-=65536,r.push(55296+(a>>10&1023),56320+(1023&a)))):Vt(),r.length>=8192&&(l=ho(l,r),r.length=0)}s=ho(l,r)}return s}function ua(e){const t=yt(e.g);return aa(e.g,t)}function ki(e,t,r){var i=yt(e.g);for(i=e.g.g+i;e.g.g<i;)r.push(t(e.g))}var Ei=[];function Je(e,t,r){t.g?t.m(e,t.g,t.h,r):t.m(e,t.h,r)}var y=class{constructor(e,t){this.u=Jo(e,t)}toJSON(){try{var e=Qo(this)}finally{Yo=void 0}return e}l(){var e=Td;return e.g?e.l(this,e.g,e.h):e.l(this,e.h,e.defaultValue)}clone(){const e=this.u;return new this.constructor(gi(e,0|e[k],!1))}O(){return!!(2&(0|this.u[k]))}};function da(e){return e?/^\d+$/.test(e)?(fi(e),new Jn(U,Z)):null:Hu||(Hu=new Jn(0,0))}y.prototype.W=Or,y.prototype.toString=function(){return this.u.toString()};var Jn=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let Hu;function ha(e){return e?/^-?\d+$/.test(e)?(fi(e),new Zn(U,Z)):null:qu||(qu=new Zn(0,0))}var Zn=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let qu;function wr(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 Si(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 zr(e,t){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 gr(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Ne(e,t,r){mr(e.g,8*t+r)}function es(e,t){return Ne(e,t,2),t=e.g.end(),gr(e,t),t.push(e.h),t}function ts(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 Ai(e,t,r){Ne(e,t,2),mr(e.g,r.length),gr(e,e.g.end()),gr(e,r)}function Ti(e,t,r,i){r!=null&&(t=es(e,t),i(r,e),ts(e,t))}function Ze(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var rs=Ze(),fa=Ze(),is=Ze(),ns=Ze(),wa=Ze(),ma=Ze(),ss=Ze(),ga=Ze(),pa=Ze(),pr=class{constructor(e,t,r){this.g=e,this.h=t,e=rs,this.l=!!e&&r===e||!1}};function ji(e,t){return new pr(e,t,rs)}function xa(e,t,r,i,n){Ti(e,r,Ea(t,i),n)}const Yu=ji(function(e,t,r,i,n){return e.h===2&&(Wr(e,$n(t,i,r),n),!0)},xa),Ku=ji(function(e,t,r,i,n){return e.h===2&&(Wr(e,$n(t,i,r),n),!0)},xa);var Ni=Symbol(),os=Symbol(),ya=Symbol(),ba=Symbol();let va,_a;function Kt(e,t,r,i){var n=i[e];if(n)return n;(n={}).Ma=i,n.T=function(f){switch(typeof f){case"boolean":return Ko||(Ko=[0,void 0,!0]);case"number":return f>0?void 0:f===0?$u||($u=[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.ga=s,typeof(s=i[++a])=="function"&&(n.la=!0,va??(va=s),_a??(_a=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 u=void 0;if(s instanceof pr?f=s:(f=Yu,a--),f==null?void 0:f.l){s=i[++a],u=i;var h=a;typeof s=="function"&&(s=s(),u[h]=s),u=s}for(h=l+1,typeof(s=i[++a])=="number"&&s<0&&(h-=s,s=i[++a]);l<h;l++){const w=c[l];u?r(n,l,f,u,w):t(n,l,f,w)}}return i[e]=n}function ka(e){return Array.isArray(e)?e[0]instanceof pr?e:[Ku,e]:[e,void 0]}function Ea(e,t){return e instanceof y?e.u:Array.isArray(e)?Nt(e,t,!1):void 0}function as(e,t,r,i){const n=r.g;e[t]=i?(s,a,c)=>n(s,a,c,i):n}function cs(e,t,r,i,n){const s=r.g;let a,c;e[t]=(l,u,h)=>s(l,u,h,c||(c=Kt(os,as,cs,i).T),a||(a=ls(i)),n)}function ls(e){let t=e[ya];if(t!=null)return t;const r=Kt(os,as,cs,e);return t=r.la?(i,n)=>va(i,n,r):(i,n)=>{const s=0|i[k];for(;la(n)&&n.h!=4;){var a=n.m,c=r[a];if(c==null){var l=r.ga;l&&(l=l[a])&&(l=Xu(l))!=null&&(c=r[a]=l)}c!=null&&c(n,i,a)||(a=(c=n).l,_i(c),c.fa?c=void 0:(l=c.g.g-a,c.g.g=a,c=aa(c.g,l)),a=i,c&&((l=a[or])?l.push(c):a[or]=[c]))}return 8192&s&&ar(i),!0},e[ya]=t}function Xu(e){const t=(e=ka(e))[0].g;if(e=e[1]){const r=ls(e),i=Kt(os,as,cs,e).T;return(n,s,a)=>t(n,s,a,i,r)}return t}function Ci(e,t,r){e[t]=r.h}function Ii(e,t,r,i){let n,s;const a=r.h;e[t]=(c,l,u)=>a(c,l,u,s||(s=Kt(Ni,Ci,Ii,i).T),n||(n=Sa(i)))}function Sa(e){let t=e[ba];if(!t){const r=Kt(Ni,Ci,Ii,e);t=(i,n)=>Aa(i,n,r),e[ba]=t}return t}function Aa(e,t,r){(function(i,n,s){const a=512&n?0:-1,c=i.length,l=c+((n=64&n?256&n:!!c&&ui(i[c-1]))?-1:0);for(let u=0;u<l;u++)s(u-a,i[u]);if(n){i=i[c-1];for(const u in i)!isNaN(u)&&s(+u,i[u])}})(e,0|e[k]|(r.T[1]?512:0),(i,n)=>{if(n!=null){var s=function(a,c){var l=a[c];if(l)return l;if((l=a.ga)&&(l=l[c])){var u=(l=ka(l))[0].h;if(l=l[1]){const h=Sa(l),f=Kt(Ni,Ci,Ii,l).T;l=a.la?_a(f,h):(w,m,g)=>u(w,m,g,f,h)}else l=u;return a[c]=l}}(r,i);s&&s(t,n,i)}}),(e=kn(e))&&function(i,n){gr(i,i.g.end());for(let s=0;s<n.length;s++)gr(i,pn(n[s])||new Uint8Array(0))}(t,e)}function xr(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),ae(t,-6145&(5|r)),2&r&&Object.freeze(t),t}}function pe(e,t,r){return new pr(e,t,r)}function yr(e,t,r){return new pr(e,t,r)}function xe(e,t,r){K(e,0|e[k],t,r)}var Qu=ji(function(e,t,r,i,n){return e.h===2&&(e=Wr(e,Nt([void 0,void 0],i,!0),n),St(i=0|t[k]),(n=mt(t,i,r))instanceof nt?2&n.M?((n=n.da()).push(e),K(t,i,r,n)):n.Ja(e):Array.isArray(n)?(2&(0|n[k])&&K(t,i,r,n=ea(n)),n.push(e)):K(t,i,r,[e]),!0)},function(e,t,r,i,n){if(t instanceof nt)t.forEach((s,a)=>{Ti(e,r,Nt([a,s],i,!1),n)});else if(Array.isArray(t))for(let s=0;s<t.length;s++){const a=t[s];Array.isArray(a)&&Ti(e,r,Nt(a,i,!1),n)}});function Ta(e,t,r){if(t=function(i){if(i==null)return i;const n=typeof i;if(n==="bigint")return String(Ur(64,i));if(Gr(i)){if(n==="string")return $o(i);if(n==="number")return Nn(i)}}(t),t!=null&&(typeof t=="string"&&ha(t),t!=null))switch(Ne(e,r,0),typeof t){case"number":e=e.g,zt(t),wr(e,U,Z);break;case"bigint":r=BigInt.asUintN(64,t),r=new Zn(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),wr(e.g,r.h,r.g);break;default:r=ha(t),wr(e.g,r.h,r.g)}}function ja(e,t,r){(t=lr(t))!=null&&t!=null&&(Ne(e,r,0),Si(e.g,t))}function Na(e,t,r){(t=Oo(t))!=null&&(Ne(e,r,0),e.g.g.push(t?1:0))}function Ca(e,t,r){(t=dr(t))!=null&&Ai(e,r,fo(t))}function Ia(e,t,r,i,n){Ti(e,r,Ea(t,i),n)}function Ma(e,t,r){t==null||typeof t=="string"||t instanceof wt||($t(t)?$t(t)&&yn(To):t=void 0),t!=null&&Ai(e,r,zn(t).buffer)}function La(e,t,r){return(e.h===5||e.h===2)&&(t=fr(t,0|t[k],r,!1),e.h==2?ki(e,Kn,t):t.push(Kn(e.g)),!0)}var bt=pe(function(e,t,r){if(e.h!==1)return!1;var i=e.g;e=Yn(i);const n=Yn(i);i=2*(n>>31)+1;const s=n>>>20&2047;return e=4294967296*(1048575&n)+e,xe(t,r,s==2047?e?NaN:i*(1/0):s==0?5e-324*i*e:i*Math.pow(2,s-1075)*(e+4503599627370496)),!0},function(e,t,r){(t=jt(t))!=null&&(Ne(e,r,1),e=e.g,(r=Fo||(Fo=new DataView(new ArrayBuffer(8)))).setFloat64(0,+t,!0),U=r.getUint32(0,!0),Z=r.getUint32(4,!0),zr(e,U),zr(e,Z))},Ze()),ce=pe(function(e,t,r){return e.h===5&&(xe(t,r,Kn(e.g)),!0)},function(e,t,r){(t=jt(t))!=null&&(Ne(e,r,5),e=e.g,Sn(t),zr(e,U))},ss),Ju=yr(La,function(e,t,r){if((t=xr(jt,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&(Ne(i,n,5),i=i.g,Sn(s),zr(i,U))}},ss),us=yr(La,function(e,t,r){if((t=xr(jt,t))!=null&&t.length){Ne(e,r,2),mr(e.g,4*t.length);for(let i=0;i<t.length;i++)r=e.g,Sn(t[i]),zr(r,U)}},ss),Mt=pe(function(e,t,r){return e.h===0&&(xe(t,r,Hn(e.g,Tn)),!0)},Ta,ma),ds=pe(function(e,t,r){return e.h===0&&(xe(t,r,(e=Hn(e.g,Tn))===0?void 0:e),!0)},Ta,ma),Zu=pe(function(e,t,r){return e.h===0&&(xe(t,r,Hn(e.g,An)),!0)},function(e,t,r){if((t=Lu(t))!=null&&(typeof t=="string"&&da(t),t!=null))switch(Ne(e,r,0),typeof t){case"number":e=e.g,zt(t),wr(e,U,Z);break;case"bigint":r=BigInt.asUintN(64,t),r=new Jn(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),wr(e.g,r.h,r.g);break;default:r=da(t),wr(e.g,r.h,r.g)}},Ze()),ee=pe(function(e,t,r){return e.h===0&&(xe(t,r,It(e.g)),!0)},ja,ns),Mi=yr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r,!1),e.h==2?ki(e,It,t):t.push(It(e.g)),!0)},function(e,t,r){if((t=xr(lr,t))!=null&&t.length){r=es(e,r);for(let i=0;i<t.length;i++)Si(e.g,t[i]);ts(e,r)}},ns),br=pe(function(e,t,r){return e.h===0&&(xe(t,r,(e=It(e.g))===0?void 0:e),!0)},ja,ns),H=pe(function(e,t,r){return e.h===0&&(xe(t,r,qn(e.g)),!0)},Na,fa),vr=pe(function(e,t,r){return e.h===0&&(xe(t,r,(e=qn(e.g))===!1?void 0:e),!0)},Na,fa),me=yr(function(e,t,r){return e.h===2&&(e=Qn(e),fr(t,0|t[k],r,!1).push(e),!0)},function(e,t,r){if((t=xr(dr,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&Ai(i,n,fo(s))}},is),Lt=pe(function(e,t,r){return e.h===2&&(xe(t,r,(e=Qn(e))===""?void 0:e),!0)},Ca,is),R=pe(function(e,t,r){return e.h===2&&(xe(t,r,Qn(e)),!0)},Ca,is),ue=function(e,t,r=rs){return new pr(e,t,r)}(function(e,t,r,i,n){return e.h===2&&(i=Nt(void 0,i,!0),fr(t,0|t[k],r,!0).push(i),Wr(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)}),O=ji(function(e,t,r,i,n,s){return e.h===2&&(ta(t,0|t[k],s,r),Wr(e,t=$n(t,i,r),n),!0)},Ia),Fa=pe(function(e,t,r){return e.h===2&&(xe(t,r,ua(e)),!0)},Ma,ga),ed=yr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r,!1),e.h==2?ki(e,yt,t):t.push(yt(e.g)),!0)},function(e,t,r){if((t=xr(Bo,t))!=null)for(let a=0;a<t.length;a++){var i=e,n=r,s=t[a];s!=null&&(Ne(i,n,0),mr(i.g,s))}},wa),td=pe(function(e,t,r){return e.h===0&&(xe(t,r,(e=yt(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Bo(t))!=null&&t!=null&&(Ne(e,r,0),mr(e.g,t))},wa),Ce=pe(function(e,t,r){return e.h===0&&(xe(t,r,It(e.g)),!0)},function(e,t,r){(t=lr(t))!=null&&(t=parseInt(t,10),Ne(e,r,0),Si(e.g,t))},pa);class rd{constructor(t,r){this.h=t,this.g=r,this.l=P,this.m=S,this.defaultValue=void 0}register(){oi(this)}}function et(e,t){return new rd(e,t)}function Ft(e,t){return(r,i)=>{if(Ei.length){const s=Ei.pop();s.o(i),Xn(s.g,r,i),r=s}else r=new class{constructor(s,a){if(ca.length){const c=ca.pop();Xn(c,s,a),s=c}else s=new class{constructor(c,l){this.h=null,this.m=!1,this.g=this.l=this.j=0,Xn(this,c,l)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.aa=!1}}(s,a);this.g=s,this.l=this.g.g,this.h=this.m=-1,this.o(a)}o({fa:s=!1}={}){this.fa=s}}(r,i);try{const s=new e,a=s.u;ls(t)(a,r);var n=s}finally{r.g.clear(),r.m=-1,r.h=-1,Ei.length<100&&Ei.push(r)}return n}}function Li(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}}}};Aa(this.u,t,Kt(Ni,Ci,Ii,e)),gr(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 Pa=class extends y{constructor(e){super(e)}},Da=[0,Lt,pe(function(e,t,r){return e.h===2&&(xe(t,r,(e=ua(e))===Wt()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof y){const i=t.Oa;return void(i&&(t=i(t),t!=null&&Ai(e,r,zn(t).buffer)))}if(Array.isArray(t))return}Ma(e,t,r)},ga)];let hs,Ra=globalThis.trustedTypes;function Oa(e){hs===void 0&&(hs=function(){let r=null;if(!Ra)return r;try{const i=n=>n;r=Ra.createPolicy("goog#html",{createHTML:i,createScript:i,createScriptURL:i})}catch{}return r}());var t=hs;return new class{constructor(r){this.g=r}toString(){return this.g+""}}(t?t.createScriptURL(e):e)}function id(e,...t){if(t.length===0)return Oa(e[0]);let r=e[0];for(let i=0;i<t.length;i++)r+=encodeURIComponent(t[i])+e[i+1];return Oa(r)}var Ba=[0,ee,Ce,H,-1,Mi,Ce,-1],nd=class extends y{constructor(e){super(e)}},Ua=[0,H,R,H,Ce,-1,yr(function(e,t,r){return(e.h===0||e.h===2)&&(t=fr(t,0|t[k],r,!1),e.h==2?ki(e,zu,t):t.push(It(e.g)),!0)},function(e,t,r){if((t=xr(lr,t))!=null&&t.length){r=es(e,r);for(let i=0;i<t.length;i++)Si(e.g,t[i]);ts(e,r)}},pa),R,-1,[0,H,-1],Ce,H,-1],Ga=[0,R,-2],Va=class extends y{constructor(e){super(e)}},$a=[0],Wa=[0,ee,H,1,H,-3],Ie=class extends y{constructor(e){super(e,2)}},le={};le[336783863]=[0,R,H,-1,ee,[0,[1,2,3,4,5,6,7,8,9],O,$a,O,Ua,O,Ga,O,Wa,O,Ba,O,[0,R,-2],O,[0,R,Ce],O,[0,Ce,R,-1],O,[0,Ce,-1]],[0,R],H,[0,[1,3],[2,4],O,[0,Mi],-1,O,[0,me],-1,ue,[0,R,-1]],R];var za=[0,ds,-1,vr,-3,ds,Mi,Lt,br,ds,-1,vr,br,vr,-2,Lt];function Me(e,t){Bn(e,2,ur(t),"")}function W(e,t){yi(e,3,t)}function L(e,t){yi(e,4,t)}var ye=class extends y{constructor(e){super(e,500)}o(e){return S(this,0,7,e)}},Hr=[-1,{}],Ha=[0,R,1,Hr],qa=[0,R,me,Hr];function Le(e,t){bi(e,1,ye,t)}function z(e,t){yi(e,10,t)}function D(e,t){yi(e,15,t)}var Ee=class extends y{constructor(e){super(e,500)}o(e){return S(this,0,1001,e)}},Ya=[-500,ue,[-500,Lt,-1,me,-3,[-2,le,H],ue,Da,br,-1,Ha,qa,ue,[0,Lt,vr],Lt,za,br,me,987,me],4,ue,[-500,R,-1,[-1,{}],998,R],ue,[-500,R,me,-1,[-2,{},H],997,me,-1],br,ue,[-500,R,me,Hr,998,me],me,br,Ha,qa,ue,[0,Lt,-1,Hr],me,-2,za,Lt,-1,vr,[0,vr,td],978,Hr,ue,Da];Ee.prototype.g=Li(Ya);var sd=Ft(Ee,Ya),od=class extends y{constructor(e){super(e)}},Ka=class extends y{constructor(e){super(e)}g(){return pt(this,od,1)}},Xa=[0,ue,[0,ee,ce,R,-1]],Fi=Ft(Ka,Xa),ad=class extends y{constructor(e){super(e)}},cd=class extends y{constructor(e){super(e)}},fs=class extends y{constructor(e){super(e)}h(){return P(this,ad,2)}g(){return pt(this,cd,5)}},Qa=Ft(class extends y{constructor(e){super(e)}},[0,me,Mi,us,[0,Ce,[0,ee,-3],[0,ce,-3],[0,ee,-1,[0,ue,[0,ee,-2]]],ue,[0,ce,-1,R,ce]],R,-1,Mt,ue,[0,ee,ce],me,Mt]),Ja=class extends y{constructor(e){super(e)}},_r=Ft(class extends y{constructor(e){super(e)}},[0,ue,[0,ce,-4]]),Za=class extends y{constructor(e){super(e)}},qr=Ft(class extends y{constructor(e){super(e)}},[0,ue,[0,ce,-4]]),ld=class extends y{constructor(e){super(e)}},ud=[0,ee,-1,us,Ce],ec=class extends y{constructor(e){super(e)}};ec.prototype.g=Li([0,ce,-4,Mt]);var dd=class extends y{constructor(e){super(e)}},hd=Ft(class extends y{constructor(e){super(e)}},[0,ue,[0,1,ee,R,Xa],Mt]),tc=class extends y{constructor(e){super(e)}},fd=class extends y{constructor(e){super(e)}ma(){const e=Zo(this);return e??Wt()}},wd=class extends y{constructor(e){super(e)}},rc=[1,2],md=Ft(class extends y{constructor(e){super(e)}},[0,ue,[0,rc,O,[0,us],O,[0,Fa],ee,R],Mt]),ws=class extends y{constructor(e){super(e)}},ic=[0,R,ee,ce,me,-1],nc=class extends y{constructor(e){super(e)}},gd=[0,H,-1],sc=class extends y{constructor(e){super(e)}},Pi=[1,2,3,4,5],Di=class extends y{constructor(e){super(e)}g(){return Zo(this)!=null}h(){return Ge(this,2)!=null}},q=class extends y{constructor(e){super(e)}g(){return Oo(hr(this,2))??!1}},oc=[0,Fa,R,[0,ee,Mt,-1],[0,Zu,Mt]],ne=[0,oc,H,[0,Pi,O,Wa,O,Ua,O,Ba,O,$a,O,Ga],Ce],Ri=class extends y{constructor(e){super(e)}},ms=[0,ne,ce,-1,ee],pd=et(502141897,Ri);le[502141897]=ms;var xd=Ft(class extends y{constructor(e){super(e)}},[0,[0,Ce,-1,Ju,ed],ud]),ac=class extends y{constructor(e){super(e)}},cc=class extends y{constructor(e){super(e)}},gs=[0,ne,ce,[0,ne],H],lc=[0,ne,ms,gs,ce,[0,[0,oc]]],yd=et(508968150,cc);le[508968150]=lc,le[508968149]=gs;var uc=class extends y{constructor(e){super(e)}},bd=et(513916220,uc);le[513916220]=[0,ne,lc,ee];var kr=class extends y{constructor(e){super(e)}h(){return P(this,ws,2)}g(){$(this,2)}},dc=[0,ne,ic];le[478825465]=dc;var vd=class extends y{constructor(e){super(e)}},hc=class extends y{constructor(e){super(e)}},ps=class extends y{constructor(e){super(e)}},xs=class extends y{constructor(e){super(e)}},fc=class extends y{constructor(e){super(e)}},wc=[0,ne,[0,ne],dc,-1],mc=[0,ne,ce,ee],ys=[0,ne,ce],gc=[0,ne,mc,ys,ce],_d=et(479097054,fc);le[479097054]=[0,ne,gc,wc],le[463370452]=wc,le[464864288]=mc;var kd=et(462713202,xs);le[462713202]=gc,le[474472470]=ys;var Ed=class extends y{constructor(e){super(e)}},pc=class extends y{constructor(e){super(e)}},xc=class extends y{constructor(e){super(e)}},yc=class extends y{constructor(e){super(e)}},bs=[0,ne,ce,-1,ee],vs=[0,ne,ce,H];yc.prototype.g=Li([0,ne,ys,[0,ne],ms,gs,bs,vs]);var bc=class extends y{constructor(e){super(e)}},Sd=et(456383383,bc);le[456383383]=[0,ne,ic];var vc=class extends y{constructor(e){super(e)}},Ad=et(476348187,vc);le[476348187]=[0,ne,gd];var _c=class extends y{constructor(e){super(e)}},kc=class extends y{constructor(e){super(e)}},Ec=[0,Ce,-1],Td=et(458105876,class extends y{constructor(e){super(e)}g(){var e=this.u;const t=0|e[k],r=2&t;return e=function(i,n,s){var a=kc;const c=2&n;let l=!1;if(s==null){if(c)return Xo();s=[]}else if(s.constructor===nt){if(!(2&s.M)||c)return s;s=s.da()}else Array.isArray(s)?l=!!(2&(0|s[k])):s=[];if(c){if(!s.length)return Xo();l||(l=!0,ar(s))}else l&&(l=!1,s=ea(s));return l||(64&(0|s[k])?s[k]&=-33:32&n&&ci(s,32)),K(i,n,2,a=new nt(s,a,Fu,void 0)),a}(e,t,mt(e,t,2)),!r&&kc&&(e.pa=!0),e}});le[458105876]=[0,Ec,Qu,[!0,Mt,[0,R,-1,me]]];var _s=class extends y{constructor(e){super(e)}},Sc=et(458105758,_s);le[458105758]=[0,ne,R,Ec];var Ac=class extends y{constructor(e){super(e)}},jd=et(443442058,Ac);le[443442058]=[0,ne,R,ee,ce,me,-1,H,ce],le[514774813]=bs;var Tc=class extends y{constructor(e){super(e)}},Nd=et(516587230,Tc);function ks(e,t){return t=t?t.clone():new ws,e.displayNamesLocale!==void 0?$(t,1,ur(e.displayNamesLocale)):e.displayNamesLocale===void 0&&$(t,1),e.maxResults!==void 0?st(t,2,e.maxResults):"maxResults"in e&&$(t,2),e.scoreThreshold!==void 0?v(t,3,e.scoreThreshold):"scoreThreshold"in e&&$(t,3),e.categoryAllowlist!==void 0?vi(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&$(t,4),e.categoryDenylist!==void 0?vi(t,5,e.categoryDenylist):"categoryDenylist"in e&&$(t,5),t}function Es(e,t=-1,r=""){return{categories:e.map(i=>({index:Ue(i,1)??0??-1,score:ie(i,2)??0,categoryName:Ge(i,3)??""??"",displayName:Ge(i,4)??""??""})),headIndex:t,headName:r}}function jc(e){var a,c;var t=qt(e,3,jt,Ht()),r=qt(e,2,lr,Ht()),i=qt(e,1,dr,Ht()),n=qt(e,9,dr,Ht());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=P(e,fs,4))==null?void 0:a.h())&&(s.boundingBox={originX:Ue(t,1)??0,originY:Ue(t,2)??0,width:Ue(t,3)??0,height:Ue(t,4)??0,angle:0}),(c=P(e,fs,4))==null?void 0:c.g().length)for(const l of P(e,fs,4).g())s.keypoints.push({x:xi(l,1)??0,y:xi(l,2)??0,score:xi(l,4)??0,label:Ge(l,3)??""});return s}function Oi(e){const t=[];for(const r of pt(e,Za,1))t.push({x:ie(r,1)??0,y:ie(r,2)??0,z:ie(r,3)??0,visibility:ie(r,4)??0});return t}function Yr(e){const t=[];for(const r of pt(e,Ja,1))t.push({x:ie(r,1)??0,y:ie(r,2)??0,z:ie(r,3)??0,visibility:ie(r,4)??0});return t}function Nc(e){return Array.from(e,t=>t>127?t-256:t)}function Cc(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 Bi;le[516587230]=[0,ne,bs,vs,ce],le[518928384]=vs;const Cd=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 Ic(){if(Bi===void 0)try{await WebAssembly.instantiate(Cd),Bi=!0}catch{Bi=!1}return Bi}async function Kr(e,t=id``){const r=await Ic()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Xt=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 Lc(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)})}importScripts(e.toString())}function Fc(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 E(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 Pc(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]=Fc(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 Dc(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 ot(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function Pt(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)}}Xt.forVisionTasks=function(e){return Kr("vision",e)},Xt.forTextTasks=function(e){return Kr("text",e)},Xt.forGenAiExperimentalTasks=function(e){return Kr("genai_experimental",e)},Xt.forGenAiTasks=function(e){return Kr("genai",e)},Xt.forAudioTasks=function(e){return Kr("audio",e)},Xt.isSimdSupported=function(){return Ic()};async function Id(e,t,r,i){return e=await(async(n,s,a,c,l)=>{if(s&&await Lc(s),!self.ModuleFactory||a&&(await Lc(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 Ss(e,t){const r=P(e.baseOptions,Di,1)||new Di;typeof t=="string"?($(r,2,ur(t)),$(r,1)):t instanceof Uint8Array&&($(r,1,_n(t,!1)),$(r,2)),S(e.baseOptions,0,1,r)}function Rc(e){try{const t=e.G.length;if(t===1)throw Error(e.G[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.G.map(r=>r.message).join(", "))}finally{e.G=[]}}function x(e,t){e.B=Math.max(e.B,t)}function Ui(e,t){e.A=new ye,Me(e.A,"PassThroughCalculator"),W(e.A,"free_memory"),L(e.A,"free_memory_unused_out"),z(t,"free_memory"),Le(t,e.A)}function Er(e,t){W(e.A,t),L(e.A,t+"_unused_out")}function Gi(e){e.g.addBoolToStream(!0,"free_memory",e.B)}var As=class{constructor(e){this.g=e,this.G=[],this.B=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=P(this.baseOptions,Di,1))!=null&&n.g()||(s=P(this.baseOptions,Di,1))!=null&&s.h()||(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(u,h){let f=P(u.baseOptions,sc,3);if(!f){var w=f=new sc,m=new Va;Vr(w,4,Pi,m)}"delegate"in h&&(h.delegate==="GPU"?(h=f,w=new nd,Vr(h,2,Pi,w)):(h=f,w=new Va,Vr(h,4,Pi,w))),S(u.baseOptions,0,3,f)}(this,l),l.modelAssetPath)return fetch(l.modelAssetPath.toString()).then(u=>{if(u.ok)return u.arrayBuffer();throw Error(`Failed to fetch model: ${l.modelAssetPath} (${u.status})`)}).then(u=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(u),!0,!1,!1),Ss(this,"/model.dat"),this.m(),this.J()});if(l.modelAssetBuffer instanceof Uint8Array)Ss(this,l.modelAssetBuffer);else if(l.modelAssetBuffer)return async function(u){const h=[];for(var f=0;;){const{done:w,value:m}=await u.read();if(w)break;h.push(m),f+=m.length}if(h.length===0)return new Uint8Array(0);if(h.length===1)return h[0];u=new Uint8Array(f),f=0;for(const w of h)u.set(w,f),f+=w.length;return u}(l.modelAssetBuffer).then(u=>{Ss(this,u),this.m(),this.J()})}return this.m(),this.J(),Promise.resolve()}J(){}ca(){let e;if(this.g.ca(t=>{e=sd(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,i)=>{this.G.push(Error(i))}),this.g.Ha(),this.g.setGraph(e,t),this.A=void 0,Rc(this)}finishProcessing(){this.g.finishProcessing(),Rc(this)}close(){this.A=void 0,this.g.closeGraph()}};function vt(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}As.prototype.close=As.prototype.close;class Md{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 Oc(e,t,r){const i=e.g;if(r=vt(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 Bc(e,t){const r=e.g,i=vt(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(i);const n=vt(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,n),r.enableVertexAttribArray(e.P),r.vertexAttribPointer(e.P,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=vt(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.J),r.vertexAttribPointer(e.J,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 Md(r,i,n,s)}function Ts(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function js(e,t,r,i){return Ts(e,t),e.h||(e.m(),e.C()),r?(e.s||(e.s=Bc(e,!0)),r=e.s):(e.v||(e.v=Bc(e,!1)),r=e.v),t.useProgram(e.h),r.bind(),e.l(),e=i(),r.g.bindVertexArray(null),e}function Vi(e,t,r){return Ts(e,t),e=vt(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 $i(e,t,r){Ts(e,t),e.A||(e.A=vt(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.A),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function Ns(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Cs=class{G(){return`
9
+ */var Xw=Symbol.for("react.transitional.element"),Qw=Symbol.for("react.fragment");function $2(e,t,n){var i=null;if(n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),"key"in t){n={};for(var a in t)a!=="key"&&(n[a]=t[a])}else n=t;return t=n.ref,{$$typeof:Xw,type:e,key:i,ref:t!==void 0?t:null,props:n}}_r.Fragment=Qw,_r.jsx=$2,_r.jsxs=$2,P2.exports=_r;var u=P2.exports;const Fo={},xn={api:{baseUrl:"/api",retryConfig:{attempts:3,backoff:"exponential",baseDelay:1e3}},ui:{baseColor:"#3B82F6",borderRadius:"8px"},interview:{allow_answer_editing:!0,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}}},Yo="iw-storage";function Zw(){if(!(typeof{url:typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:qo&&qo.tagName.toUpperCase()==="SCRIPT"&&qo.src||new URL("widget.umd.js",document.baseURI).href}<"u"&&(Fo!=null&&Fo.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 e1=Zw(),Tr=30,Kw={SCREENSHOT:"screenshot"},Xo="AES-GCM",Qo=12;async function t1(e){const n=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",n);return crypto.subtle.importKey("raw",i,Xo,!1,["encrypt","decrypt"])}function Iw(){return crypto.getRandomValues(new Uint8Array(Qo))}async function Jw(e,t="default-seed"){try{const n=typeof e=="string"?e:JSON.stringify(e),a=new TextEncoder().encode(n),l=await t1(t),s=Iw(),r=await crypto.subtle.encrypt({name:Xo,iv:s},l,a),o=new Uint8Array(s.length+r.byteLength);return o.set(new Uint8Array(s),0),o.set(new Uint8Array(r),s.length),btoa(String.fromCharCode(...Array.from(o)))}catch(n){throw console.error("Encryption failed:",n),new Error("Failed to encrypt data")}}async function Ww(e,t="default-seed"){try{const n=atob(e),i=new Uint8Array(n.length);for(let c=0;c<n.length;c++)i[c]=n.charCodeAt(c);const a=i.slice(0,Qo),l=i.slice(Qo),s=await t1(t),r=await crypto.subtle.decrypt({name:Xo,iv:a},s,l);return new TextDecoder().decode(r)}catch(n){throw console.error("Decryption failed:",n),new Error("Failed to decrypt data")}}async function Pw(e,t="default-seed"){return Jw(e,t)}async function $w(e,t="default-seed"){const n=await Ww(e,t);try{return JSON.parse(n)}catch{return n}}const Wl=y.createContext(null),e6=async()=>{try{const e=sessionStorage.getItem(Yo);if(e){const n=(await $w(e,e1)).state;return{logViolations:(n==null?void 0:n.logViolations)||[],totalViolations:(n==null?void 0:n.totalViolations)||0,gazeViolationCounters:(n==null?void 0:n.gazeViolationCounters)||{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:(n==null?void 0:n.referenceSet)??!1,referenceRef:(n==null?void 0:n.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}}},Pl=async e=>{try{const t=await Pw({state:e,version:0},e1);sessionStorage.setItem(Yo,t)}catch(t){console.error("Failed to save proctoring data to session storage:",t)}},t6=({children:e})=>{const t=y.useRef({logViolations:[],totalViolations:0,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0},referenceSet:!1,referenceRef:{x:.5,y:.5,noseX:.5,noseY:.5}}),n=y.useRef(new Set);y.useEffect(()=>{e6().then(d=>{t.current=d,i()})},[]);const i=y.useCallback(()=>{n.current.forEach(d=>d())},[]),a=y.useCallback(d=>(n.current.add(d),()=>{n.current.delete(d)}),[]),l=y.useCallback(()=>t.current,[]),s=y.useCallback(d=>{t.current={...t.current,logViolations:[...t.current.logViolations,d],totalViolations:t.current.totalViolations+1},Pl(t.current),i()},[i]),r=y.useCallback(d=>{const m={...t.current.gazeViolationCounters};d==="looking_away"&&(m.lookingAwayCount+=1),d==="no_face_detected"&&(m.noFaceDetectedCount+=1),d==="multiple_faces"&&(m.multipleFacesCount+=1),m.totalGazeViolations=m.lookingAwayCount+m.noFaceDetectedCount+m.multipleFacesCount,t.current={...t.current,gazeViolationCounters:m},Pl(t.current),i()},[i]),o=y.useCallback(()=>{t.current={...t.current,logViolations:[],totalViolations:0},Pl(t.current),i()},[i]),c=y.useCallback(()=>{t.current={...t.current,gazeViolationCounters:{lookingAwayCount:0,noFaceDetectedCount:0,multipleFacesCount:0,totalGazeViolations:0}},Pl(t.current),i()},[i]),f=y.useCallback((d,m)=>{t.current={...t.current,referenceSet:d,referenceRef:m},Pl(t.current),i()},[i]),h=y.useMemo(()=>({getState:l,addViolation:s,clearViolations:o,subscribe:a,incrementGazeViolation:r,clearGazeViolationCounters:c,setReferenceData:f}),[l,s,o,a,r,c,f]);return u.jsx(Wl.Provider,{value:h,children:e})},n1=()=>{const e=y.useContext(Wl);if(!e)throw new Error("useProctoringStore must be used within a ProctoringProvider");const t=y.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}},n6=()=>{const e=y.useContext(Wl);if(!e)throw new Error("useViolations must be used within a ProctoringProvider");return y.useSyncExternalStore(e.subscribe,()=>e.getState().logViolations,()=>e.getState().logViolations)},i6=()=>{const e=y.useContext(Wl);if(!e)throw new Error("useTotalViolations must be used within a ProctoringProvider");return y.useSyncExternalStore(e.subscribe,()=>e.getState().totalViolations,()=>e.getState().totalViolations)},a6=()=>{const e=y.useContext(Wl);if(!e)throw new Error("useProctoringActions must be used within a ProctoringProvider");return{addViolation:e.addViolation,clearViolations:e.clearViolations}},i1=y.createContext(null);function Zo({config:e={},children:t}){var i,a,l,s;const n={api:{...xn.api,...e.api,retryConfig:{...xn.api.retryConfig,...(i=e.api)==null?void 0:i.retryConfig}},ui:{...xn.ui,...e.ui},interview:{...xn.interview,...e.interview,timers:{...xn.interview.timers,...(a=e.interview)==null?void 0:a.timers},stt:{...xn.interview.stt,...(l=e.interview)==null?void 0:l.stt},tts:{...xn.interview.tts,...(s=e.interview)==null?void 0:s.tts}}};return u.jsx(i1.Provider,{value:n,children:u.jsx(t6,{children:t})})}function Ar(){const e=y.useContext(i1);if(!e)throw new Error("useInterviewConfig must be used within an InterviewWidgetProvider. Wrap your component tree with <InterviewWidgetProvider config={...}>");return e}function a1(){return Ar().api||xn.api}function $l(){return Ar().ui||xn.ui}function Ko(){return Ar().interview||xn.interview}function l6(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 s6(e,t,n){return"#"+[e,t,n].map(i=>{const a=Math.round(i).toString(16);return a.length===1?"0"+a:a}).join("")}function r6(e,t){const n=l6(e);if(!n)return e;const i=n.r+(255-n.r)*t,a=n.g+(255-n.g)*t,l=n.b+(255-n.b)*t;return s6(i,a,l)}function u6(e){return new Promise(t=>setTimeout(t,e))}function o6(e){return`linear-gradient(to left, ${r6(e,.4)}, ${e})`}const c6=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);function f6(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,"/"),a=i.padEnd(i.length+(4-i.length%4)%4,"="),l=atob(a);return JSON.parse(l)}catch(t){return console.error("Error decoding JWT:",t),null}}const l1=e=>{var t;return!e||typeof e!="string"?"":(t=e.charAt(0))==null?void 0:t.toUpperCase()},Io=e=>{const t=Math.max(0,Math.floor(e)),n=Math.floor(t/60).toString().padStart(2,"0"),i=(t%60).toString().padStart(2,"0");return`${n}:${i}`},es=e=>u.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:[u.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"}),u.jsx("path",{d:"M12 9v4"}),u.jsx("path",{d:"M12 17h.01"})]}),d6=e=>u.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:[u.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"}),u.jsx("circle",{cx:12,cy:12,r:4})]}),h6=e=>u.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:[u.jsx("path",{d:"M14.564 14.558a3 3 0 11-4.122-4.121M2 2l20 20"}),u.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"})]}),Nr=e=>u.jsx("svg",{width:"10",height:"9",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:u.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"})}),s1=e=>u.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:[u.jsx("path",{d:"M12 2a10 10 0 0 1 7.38 16.75"}),u.jsx("path",{d:"M12 6v6l4 2"}),u.jsx("path",{d:"M2.5 8.875a10 10 0 0 0-.5 3"}),u.jsx("path",{d:"M2.83 16a10 10 0 0 0 2.43 3.4"}),u.jsx("path",{d:"M4.636 5.235a10 10 0 0 1 .891-.857"}),u.jsx("path",{d:"M8.644 21.42a10 10 0 0 0 7.631-.38"})]}),m6=e=>u.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:[u.jsx("path",{d:"M12 6v6l4 2"}),u.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),r1=e=>u.jsx("svg",{className:"iw-w-5 iw-h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",...e,children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),u1=e=>u.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:[u.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"}),u.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),g6=e=>u.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:[u.jsx("circle",{cx:"12",cy:"12",r:"3"}),u.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),u.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),u.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),u.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),w6=e=>u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("path",{d:"M2.66797 2H13.3346",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"}),u.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"}),u.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"}),u.jsx("path",{d:"M2.66797 14H13.3346",stroke:"#5C6686",strokeLinecap:"round",strokeLinejoin:"round"})]}),Jo=e=>u.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:[u.jsx("circle",{cx:"12",cy:"12",r:"3"}),u.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),u.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),u.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),u.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),o1=({className:e,...t})=>u.jsx("div",{children:u.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:[u.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),u.jsx("path",{d:"M12 6l0 -3"}),u.jsx("path",{d:"M16.25 7.75l2.15 -2.15"}),u.jsx("path",{d:"M18 12l3 0"}),u.jsx("path",{d:"M16.25 16.25l2.15 2.15"}),u.jsx("path",{d:"M12 18l0 3"}),u.jsx("path",{d:"M7.75 16.25l-2.15 2.15"}),u.jsx("path",{d:"M6 12l-3 0"}),u.jsx("path",{d:"M7.75 7.75l-2.15 -2.15"})]})}),y6=e=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.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"}),u.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"})]}),p6=e=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("path",{d:"M2 2L22 22",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M4 11C4 15.4183 7.58172 19 12 19M12 19C13.9545 19 15.7454 18.2991 17.1348 17.1348M12 19V22M12 22H15M12 22H9M20 11C20 12.6514 19.4996 14.1859 18.6422 15.4603",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M7 6.98V11C7 13.7614 9.23858 16 12 16C13.1354 16 14.1647 15.6096 15.004 14.972M16.4387 13.244C16.7973 12.5545 17 11.8309 17 11V6.98C17 4.21858 14.7614 2 12 2C10.1312 2 8.53009 2.96527 7.672 4.484",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"})]}),v6=e=>u.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:[u.jsx("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),u.jsx("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),u.jsx("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]}),b6=e=>u.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:[u.jsx("circle",{cx:"12",cy:"12",r:"3"}),u.jsx("path",{d:"M3 7V5a2 2 0 0 1 2-2h2"}),u.jsx("path",{d:"M17 3h2a2 2 0 0 1 2 2v2"}),u.jsx("path",{d:"M21 17v2a2 2 0 0 1-2 2h-2"}),u.jsx("path",{d:"M7 21H5a2 2 0 0 1-2-2v-2"})]}),x6=e=>u.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:[u.jsx("path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}),u.jsx("path",{d:"m9 12 2 2 4-4"})]}),S6=e=>u.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:[u.jsx("circle",{cx:12,cy:12,r:10}),u.jsx("circle",{cx:12,cy:12,r:6}),u.jsx("circle",{cx:12,cy:12,r:2})]}),E6=e=>u.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:[u.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"}),u.jsx("circle",{cx:9,cy:7,r:4})]}),_6=e=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("path",{d:"M11 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),u.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"}),u.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"})]}),T6=e=>u.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[u.jsx("path",{d:"M2.00195 2L21.9773 22",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M16.8517 16.8668C16.7225 17.8052 16.4666 18.4659 15.9596 18.9735C14.9357 19.9987 13.2878 19.9987 9.99206 19.9987H8.99329C5.69755 19.9987 4.04967 19.9987 3.02581 18.9735C2.00195 17.9484 2.00195 16.2985 2.00195 12.9987V10.9987C2.00195 7.69885 2.00195 6.04893 3.02581 5.0238C3.36833 4.68086 3.78068 4.45265 4.3012 4.30078",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx("path",{d:"M8.23633 4.00052C8.47821 4 8.73001 4 8.99223 4H9.99099C13.2868 4 14.9347 4 15.9585 5.02513C16.9823 6.05025 16.9823 7.70017 16.9823 11V12.7574M16.9823 9.23142L19.3019 7.52913C20.773 6.54073 21.449 7.17196 21.6675 7.64847C22.1192 8.92813 21.9769 11.3936 21.9769 14.5417C21.8704 16.555 21.5953 16.7719 21.3138 16.9939L21.3108 16.9962",stroke:"#062260",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),ts={FACE_DETECTED:"face_detected",NO_FACE:"no_face_detected",MULTIPLE_FACES:"multiple_faces",LOOKING_AWAY:"looking_away",CAMERA_ERROR:"camera_error"},c1={[ts.FACE_DETECTED]:{icon:u1,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"},[ts.NO_FACE]:{icon:h6,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"},[ts.MULTIPLE_FACES]:{icon:E6,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",description:"For interview integrity, please ensure you are alone in the room and only your face is visible to the camera.",buttonText:"I Understood"},[ts.LOOKING_AWAY]:{icon:S6,iconColor:"iw-text-amber-600",iconBg:"iw-bg-amber-50",iconBorder:"iw-border-amber-200/75",title:"Stay Focused",subtitle:"We noticed you looked away from the screen",description:"To ensure interview integrity, please keep your attention on the screen throughout the session.",buttonText:"I Understood"},[ts.CAMERA_ERROR]:{icon:es,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, then refresh the page to continue.",buttonText:"I Understood"}};function A6(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:n}=e;if(n===401||n===403)return{type:"auth",status:n,message:"Authentication failed",retryable:!1,userMessage:"Your session has expired. Please refresh the page."};if(n===429)return{type:"rate-limit",status:n,message:"Too many requests",retryable:!0,userMessage:"Please wait a moment before trying again."};if(n>=500)return{type:"server",status:n,message:`Server error: ${n}`,retryable:!0,userMessage:"Our servers are experiencing issues. Please try again in a few moments."};if(n>=400)return{type:"client",status:n,message:`Client error: ${n}`,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 ui(e,t={},n={attempts:3,backoff:"exponential",baseDelay:1e3,maxDelay:1e4,jitter:!0}){let i;for(let a=1;a<=n.attempts;a++)try{const l=new AbortController,s=setTimeout(()=>l.abort(),6e4),r=await fetch(e,{...t,signal:l.signal});if(clearTimeout(s),r.status>=400&&r.status<500&&r.status!==429)return r;if(!r.ok)throw new Error(`HTTP ${r.status}: ${r.statusText}`);return r}catch(l){i=l;const s=A6(l);if(!s.retryable||a===n.attempts)throw s;const r=N6(a,n);console.warn(`API request failed (attempt ${a}/${n.attempts}), retrying in ${r}ms:`,s.message),await new Promise(o=>setTimeout(o,r))}throw i}function N6(e,t){let n;return t.backoff==="exponential"?n=t.baseDelay*Math.pow(2,e-1):n=t.baseDelay,n=Math.min(n,t.maxDelay),t.jitter&&(n=n*(.5+Math.random()*.5)),Math.round(n)}const oi={v2:"/v2"},ci={GENERATE_QUESTION:e=>`${oi.v2}/interviews/${e}/next-question`,SCREENSHOT_UPLOAD:e=>`${oi.v2}/interviews/${e}/assets/upload-url`,CONFIRM_UPLOAD:e=>`${oi.v2}/interviews/assets/${e}/confirm`,TRANSCRIBE_ANSWER:e=>`${oi.v2}/interviews/${e}/transcribe-answer`,SUBMIT_ANSWER:e=>`${oi.v2}/interviews/${e}/submit-answer`,EXIT:e=>`${oi.v2}/interviews/${e}/exit`,CONFIG:e=>`${oi.v2}/interviews/${e}/config`,TRANSCRIPTION:e=>`${oi.v2}/interviews/${e}/transcript`};class f1{constructor(t={}){Qt(this,"config");this.config=t}updateConfig(t){this.config={...this.config,...t}}getHeaders(){var n;const t={"Content-Type":"application/json"};return(n=this.config)!=null&&n.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:n=!1}){const i=await ui(`${this.getBaseUrl()}${ci.GENERATE_QUESTION(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({interview_id:t,is_interview_done:n})});if(!i.ok)throw new Error(`Failed to get questions: ${i.status}`);return await i.json()}async submitAnswer({interviewId:t,qnaId:n,answer:i}){const a=await ui(`${this.getBaseUrl()}${ci.SUBMIT_ANSWER(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({qna_id:n,answer_text:i})});if(!a.ok)throw new Error(`Failed to submit answer: ${a.status}`);return await a.json()}async exitInterview(t){const n=await ui(`${this.getBaseUrl()}${ci.EXIT(t)}`,{method:"POST",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to exit interview: ${n.status}`)}async getInterviewConfig(t){const n=await ui(`${this.getBaseUrl()}${ci.CONFIG(t)}`,{method:"GET",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get interview config: ${n.status}`);return await n.json()}async requestScreenshotUploadUrl(t,n=`screenshot-${Date.now()}.jpeg`){const i=await ui(`${this.getBaseUrl()}${ci.SCREENSHOT_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({filename:n,mime_type:"image/jpeg",asset_type:Kw.SCREENSHOT})});if(!i.ok)throw new Error(`Failed to request screenshot upload URL: ${i.status}`);return await i.json()}async uploadScreenshot(t,n){const i=await fetch(t,{method:"PUT",body:n,headers:{"Content-Type":"image/jpeg"}});if(!i.ok)throw new Error(`Failed to upload screenshot: ${i.status}`)}async confirmScreenshotUpload(t){const n=await ui(`${this.getBaseUrl()}${ci.CONFIRM_UPLOAD(t)}`,{method:"POST",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to confirm screenshot upload: ${n.status}`)}async getInterviewTranscription(t){const n=await ui(`${this.getBaseUrl()}${ci.TRANSCRIPTION(t)}`,{method:"GET",headers:{...this.getHeaders(),"x-auth-token":"interview-engine-api-key"}});if(!n.ok)throw new Error(`Failed to get interview transcription: ${n.status}`);return await n.json()}}const j6=new f1,M6=({gazeAnalysisEnabled:e,isModelLoaded:t,stats:n,statusMessage:i,loadingProgress:a})=>u.jsx("div",{className:"iw-w-full",children:u.jsxs("div",{className:"iw-border-strock iw-rounded-md iw-border iw-bg-gray-50 iw-p-4",children:[u.jsxs("h3",{className:"iw-m-0 iw-mb-2.5",children:["Status: ",i]}),a>0&&a<100&&u.jsxs("div",{className:"iw-mb-2.5",children:[u.jsx("div",{className:"iw-h-2 iw-w-full iw-rounded iw-bg-gray-300",children:u.jsx("div",{className:"iw-h-full iw-rounded iw-bg-blue-600 iw-transition-all iw-duration-300 iw-ease-out",style:{width:`${a}%`}})}),u.jsxs("small",{className:"iw-text-gray-600",children:["Loading model... ",a.toFixed(1),"%"]})]}),u.jsxs("div",{className:"iw-grid iw-grid-cols-2 iw-gap-2.5 iw-text-sm",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"FPS:"})," ",u.jsx("span",{className:n.fps<15?"iw-text-red-600":n.fps<25?"iw-text-orange-500":"iw-text-green-600",children:n.fps})]}),u.jsxs("div",{children:[u.jsx("strong",{children:"Model:"})," ",t?"✓ Loaded":"✗ Loading"]}),e&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Engagement:"})," ",n.engagement.toFixed(1),"%"]}),u.jsxs("div",{children:[u.jsx("strong",{children:"Looking:"})," ",u.jsx("span",{className:n.isLookingAway?"iw-text-red-600":"iw-text-green-600",children:n.isLookingAway?"Away":"At Screen"})]})]})]}),n.referenceFaceNotDetected&&u.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:[u.jsx("strong",{children:"Reference Face Not Detected"}),u.jsx("br",{}),"The previously set reference face is no longer in view."]}),n.multipleFacesDetected&&u.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:[u.jsx("strong",{children:"Multiple Faces Detected"}),u.jsx("br",{}),"Please ensure only one person is in the frame."]}),!e&&u.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:[u.jsx("strong",{children:"Gaze Analysis Disabled"}),u.jsx("br",{}),"Enable to track engagement and attention levels."]})]})}),C6=({showControls:e,isBubbleOpen:t,setIsBubbleOpen:n,setReference:i,clearCache:a,isModelLoaded:l,gazeAnalysisEnabled:s,referenceSet:r,showLandmarks:o,setShowLandmarks:c,showEngagementBar:f,setShowEngagementBar:h,handleToggleGazeAnalysis:d,stats:m,statusMessage:v,loadingProgress:x})=>e?u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:()=>n(!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:u.jsx(d6,{className:"iw-size-4.5"})}),t&&u.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:[u.jsx("h4",{className:"m-0 mb-2.5",children:"Controls"}),u.jsx("button",{onClick:i,disabled:!l||!s,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 ${!l||!s?"iw-cursor-not-allowed iw-bg-gray-400":"iw-cursor-pointer iw-bg-blue-600 hover:iw-bg-blue-700"}`,children:r?"Reference Set ✓":"Set Reference"}),u.jsx("button",{onClick:a,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"}),u.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-2.5",children:[u.jsxs("label",{className:"iw-flex iw-cursor-pointer iw-items-center iw-gap-2",children:[u.jsx("input",{type:"checkbox",checked:s,onChange:E=>d(E.target.checked)}),u.jsx("strong",{children:"Enable Gaze Analysis"})]}),u.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${s?"iw-opacity-100":"iw-opacity-60"}`,children:[u.jsx("input",{type:"checkbox",checked:o,onChange:E=>c(E.target.checked),disabled:!s}),"Show Landmarks"]}),u.jsxs("label",{className:`iw-flex iw-cursor-pointer iw-items-center iw-gap-2 ${s?"iw-opacity-100":"iw-opacity-60"}`,children:[u.jsx("input",{type:"checkbox",checked:f,onChange:E=>h(E.target.checked),disabled:!s}),"Show Engagement Bar"]})]}),r&&u.jsx(M6,{gazeAnalysisEnabled:s,isModelLoaded:l,loadingProgress:x,stats:m,statusMessage:v})]})]}):null;var Oa=typeof self<"u"?self:{};function ns(e,t){e:{for(var n=["CLOSURE_FLAGS"],i=Oa,a=0;a<n.length;a++)if((i=i[n[a]])==null){n=null;break e}n=i}return(e=n&&n[e])!=null?e:t}function Ki(){throw Error("Invalid UTF8")}function d1(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let jr,Wo;const D6=typeof TextDecoder<"u";let O6;const z6=typeof TextEncoder<"u";function h1(e){if(z6)e=(O6||(O6=new TextEncoder)).encode(e);else{let n=0;const i=new Uint8Array(3*e.length);for(let a=0;a<e.length;a++){var t=e.charCodeAt(a);if(t<128)i[n++]=t;else{if(t<2048)i[n++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&a<e.length){const l=e.charCodeAt(++a);if(l>=56320&&l<=57343){t=1024*(t-55296)+l-56320+65536,i[n++]=t>>18|240,i[n++]=t>>12&63|128,i[n++]=t>>6&63|128,i[n++]=63&t|128;continue}a--}t=65533}i[n++]=t>>12|224,i[n++]=t>>6&63|128}i[n++]=63&t|128}}e=n===i.length?i:i.subarray(0,n)}return e}function m1(e){Oa.setTimeout(()=>{throw e},0)}var Po,k6=ns(610401301,!1),g1=ns(748402147,!0),$o=ns(824648567,!0),ec=ns(824656860,ns(1,!0));function w1(){var e=Oa.navigator;return e&&(e=e.userAgent)?e:""}const y1=Oa.navigator;function Mr(e){return Mr[" "](e),e}Po=y1&&y1.userAgentData||null,Mr[" "]=function(){};const p1={};let is=null;function L6(e){const t=e.length;let n=3*t/4;n%3?n=Math.floor(n):"=.".indexOf(e[t-1])!=-1&&(n="=.".indexOf(e[t-2])!=-1?n-2:n-1);const i=new Uint8Array(n);let a=0;return function(l,s){function r(c){for(;o<l.length;){const f=l.charAt(o++),h=is[f];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(f))throw Error("Unknown base64 encoding at char: "+f)}return c}v1();let o=0;for(;;){const c=r(-1),f=r(0),h=r(64),d=r(64);if(d===64&&c===-1)break;s(c<<2|f>>4),h!=64&&(s(f<<4&240|h>>2),d!=64&&s(h<<6&192|d))}}(e,function(l){i[a++]=l}),a!==n?i.subarray(0,a):i}function v1(){if(!is){is={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const i=e.concat(t[n].split(""));p1[n]=i;for(let a=0;a<i.length;a++){const l=i[a];is[l]===void 0&&(is[l]=a)}}}}var U6=typeof Uint8Array<"u",b1=!(!(k6&&Po&&Po.brands.length>0)&&(w1().indexOf("Trident")!=-1||w1().indexOf("MSIE")!=-1))&&typeof btoa=="function";const x1=/[-_.]/g,B6={"-":"+",_:"/",".":"="};function R6(e){return B6[e]||""}function S1(e){if(!b1)return L6(e);e=x1.test(e)?e.replace(x1,R6):e,e=atob(e);const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function tc(e){return U6&&e!=null&&e instanceof Uint8Array}var za={};function Ii(){return G6||(G6=new Sn(null,za))}function nc(e){E1(za);var t=e.g;return(t=t==null||tc(t)?t:typeof t=="string"?S1(t):null)==null?t:e.g=t}var Sn=class{h(){return new Uint8Array(nc(this)||0)}constructor(e,t){if(E1(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let G6,H6;function E1(e){if(e!==za)throw Error("illegal external caller")}function _1(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function ic(e){return _1(e=Error(e),"warning"),e}function ka(e,t){if(e!=null){var n=H6??(H6={}),i=n[e]||0;i>=t||(n[e]=i+1,_1(e=Error(),"incident"),m1(e))}}function La(){return typeof BigInt=="function"}var Ua=typeof Symbol=="function"&&typeof Symbol()=="symbol";function En(e,t,n=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var V6=En("jas",void 0,!0),T1=En(void 0,"0di"),as=En(void 0,"1oa"),Et=En(void 0,Symbol()),q6=En(void 0,"0ub"),F6=En(void 0,"0ubs"),ac=En(void 0,"0ubsb"),Y6=En(void 0,"0actk"),Ba=En("m_m","Pa",!0),A1=En();const N1={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},j1=Object.defineProperties,O=Ua?V6:"Ga";var Ji;const M1=[];function ls(e,t){Ua||O in e||j1(e,N1),e[O]|=t}function Ge(e,t){Ua||O in e||j1(e,N1),e[O]=t}function ss(e){return ls(e,34),e}function rs(e){return ls(e,8192),e}Ge(M1,7),Ji=Object.freeze(M1);var Ra={};function _t(e,t){return t===void 0?e.h!==Wi&&!!(2&(0|e.v[O])):!!(2&t)&&e.h!==Wi}const Wi={};function lc(e,t){if(e!=null){if(typeof e=="string")e=e?new Sn(e,za):Ii();else if(e.constructor!==Sn)if(tc(e))e=e.length?new Sn(new Uint8Array(e),za):Ii();else{if(!t)throw Error();e=void 0}}return e}class C1{constructor(t,n,i){this.g=t,this.h=n,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 X6=Object.freeze({});function D1(e,t,n){const i=128&t?0:-1,a=e.length;var l;(l=!!a)&&(l=(l=e[a-1])!=null&&typeof l=="object"&&l.constructor===Object);const s=a+(l?-1:0);for(t=128&t?1:0;t<s;t++)n(t-i,e[t]);if(l){e=e[a-1];for(const r in e)!isNaN(r)&&n(+r,e[r])}}var O1={};function Ga(e){return 128&e?O1:void 0}function Cr(e){return e.Na=!0,e}var Q6=Cr(e=>typeof e=="number"),z1=Cr(e=>typeof e=="string"),Z6=Cr(e=>typeof e=="boolean"),Dr=typeof Oa.BigInt=="function"&&typeof Oa.BigInt(0)=="bigint";function Tt(e){var t=e;if(z1(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(Q6(t)&&!Number.isSafeInteger(t))throw Error(String(t));return Dr?BigInt(e):e=Z6(e)?e?"1":"0":z1(e)?e.trim()||"0":String(e)}var sc=Cr(e=>Dr?e>=I6&&e<=W6:e[0]==="-"?k1(e,K6):k1(e,J6));const K6=Number.MIN_SAFE_INTEGER.toString(),I6=Dr?BigInt(Number.MIN_SAFE_INTEGER):void 0,J6=Number.MAX_SAFE_INTEGER.toString(),W6=Dr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function k1(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let n=0;n<e.length;n++){const i=e[n],a=t[n];if(i>a)return!1;if(i<a)return!0}}const P6=typeof Uint8Array.prototype.slice=="function";let $6,we=0,De=0;function L1(e){const t=e>>>0;we=t,De=(e-t)/4294967296>>>0}function Ha(e){if(e<0){L1(-e);const[t,n]=fc(we,De);we=t>>>0,De=n>>>0}else L1(e)}function rc(e){const t=$6||($6=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),De=0,we=t.getUint32(0,!0)}function uc(e,t){const n=4294967296*t+(e>>>0);return Number.isSafeInteger(n)?n:us(e,t)}function e5(e,t){return Tt(La()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):us(e,t))}function oc(e,t){const n=2147483648&t;return n&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=uc(e,t))=="number"?n?-e:e:n?"-"+e:e}function U1(e,t){return La()?Tt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):Tt(cc(e,t))}function us(e,t){if(e>>>=0,(t>>>=0)<=2097151)var n=""+(4294967296*t+e);else La()?n=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(n=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),n+=8147497*t,t*=2,e>=1e7&&(n+=e/1e7>>>0,e%=1e7),n>=1e7&&(t+=n/1e7>>>0,n%=1e7),n=t+B1(n)+B1(e));return n}function B1(e){return e=String(e),"0000000".slice(e.length)+e}function cc(e,t){if(2147483648&t)if(La())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[n,i]=fc(e,t);e="-"+us(n,i)}else e=us(e,t);return e}function Or(e){if(e.length<16)Ha(Number(e));else if(La())e=BigInt(e),we=Number(e&BigInt(4294967295))>>>0,De=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");De=we=0;const n=e.length;for(let i=t,a=(n-t)%6+t;a<=n;i=a,a+=6){const l=Number(e.slice(i,a));De*=1e6,we=1e6*we+l,we>=4294967296&&(De+=Math.trunc(we/4294967296),De>>>=0,we>>>=0)}if(t){const[i,a]=fc(we,De);we=i,De=a}}}function fc(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function hn(e){return Array.prototype.slice.call(e)}const os=typeof BigInt=="function"?BigInt.asIntN:void 0,t5=typeof BigInt=="function"?BigInt.asUintN:void 0,Pi=Number.isSafeInteger,zr=Number.isFinite,Va=Math.trunc,n5=Tt(0);function cs(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 _n(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function fs(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 R1(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const i5=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function ds(e){switch(typeof e){case"bigint":return!0;case"number":return zr(e);case"string":return i5.test(e);default:return!1}}function qa(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return zr(e)?0|e:void 0}function G1(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return zr(e)?e>>>0:void 0}function H1(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(Or(e),cc(we,De))}function dc(e){return e=Va(e),Pi(e)||(Ha(e),e=oc(we,De)),e}function V1(e){var t=Va(Number(e));return Pi(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),H1(e))}function q1(e){var t=Va(Number(e));return Pi(t)?Tt(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),La()?Tt(os(64,BigInt(e))):Tt(H1(e)))}function F1(e){return Pi(e)?e=Tt(dc(e)):(e=Va(e),Pi(e)?e=String(e):(Ha(e),e=cc(we,De)),e=Tt(e)),e}function a5(e){return e==null?e:typeof e=="bigint"?(sc(e)?e=Number(e):(e=os(64,e),e=sc(e)?Number(e):String(e)),e):ds(e)?typeof e=="number"?dc(e):V1(e):void 0}function kr(e){const t=typeof e;return e==null?e:t==="bigint"?Tt(os(64,e)):ds(e)?t==="string"?q1(e):F1(e):void 0}function Y1(e){if(typeof e!="string")throw Error();return e}function hs(e){if(e!=null&&typeof e!="string")throw Error();return e}function We(e){return e==null||typeof e=="string"?e:void 0}function hc(e,t,n,i){return e!=null&&e[Ba]===Ra?e:Array.isArray(e)?((i=(n=0|e[O])|32&i|2&i)!==n&&Ge(e,i),new t(e)):(n?2&i?((e=t[T1])||(ss((e=new t).v),e=t[T1]=e),t=e):t=new t:t=void 0,t)}function l5(e,t,n){if(t)e:{if(!ds(t=e))throw ic("int64");switch(typeof t){case"string":t=q1(t);break e;case"bigint":t=Tt(os(64,t));break e;default:t=F1(t)}}else t=kr(e);return(e=t)==null?n?n5:void 0:e}const s5={};let r5=function(){try{return Mr(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class mc{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,n){return this.g.set(t,n),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,n){return this.g.forEach(t,n)}[Symbol.iterator](){return this.entries()}}const u5=r5?(Object.setPrototypeOf(mc.prototype,Map.prototype),Object.defineProperties(mc.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),mc):class extends Map{constructor(){super()}};function X1(e){return e}function gc(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var Bn=class extends u5{constructor(e,t,n=X1,i=X1){super(),this.J=0|e[O],this.K=t,this.S=n,this.fa=this.K?o5:i;for(let a=0;a<e.length;a++){const l=e[a],s=n(l[0],!1,!0);let r=l[1];t?r===void 0&&(r=null):r=i(l[1],!1,!0,void 0,void 0,this.J),super.set(s,r)}}V(e){return rs(Array.from(super.entries(),e))}clear(){gc(this),super.clear()}delete(e){return gc(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new C1(e,c5,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new C1(e,Bn.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach((n,i,a)=>{e.call(t,a.get(i),i,a)}):super.forEach(e,t)}set(e,t){return gc(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 n=this.K;return n?((n=this.fa(t,!1,!0,n,this.ra,this.J))!==t&&super.set(e,n),n):t}}[Symbol.iterator](){return this.entries()}};function o5(e,t,n,i,a,l){return e=hc(e,i,n,l),a&&(e=pc(e)),e}function c5(e){return[e,this.get(e)]}let f5;function Q1(){return f5||(f5=new Bn(ss([]),void 0,void 0,void 0,s5))}function Lr(e){return Et?e[Et]:void 0}function Ur(e,t){for(const n in e)!isNaN(n)&&t(e,+n,e[n])}Bn.prototype.toJSON=void 0;var wc=class{};const d5={Ka:!0};function h5(e,t){t<100||ka(F6,1)}function Br(e,t,n,i){const a=i!==void 0;i=!!i;var l,s=Et;!a&&Ua&&s&&(l=e[s])&&Ur(l,h5),s=[];var r=e.length;let o;l=4294967295;let c=!1;const f=!!(64&t),h=f?128&t?0:-1:void 0;1&t||(o=r&&e[r-1],o!=null&&typeof o=="object"&&o.constructor===Object?l=--r:o=void 0,!f||128&t||a||(c=!0,l=l-h+h)),t=void 0;for(var d=0;d<r;d++){let m=e[d];if(m!=null&&(m=n(m,i))!=null)if(f&&d>=l){const v=d-h;(t??(t={}))[v]=m}else s[d]=m}if(o)for(let m in o){if((r=o[m])==null||(r=n(r,i))==null)continue;let v;d=+m,f&&!Number.isNaN(d)&&(v=d+h)<l?s[v]=r:(t??(t={}))[m]=r}return t&&(c?s.push(t):s[l]=t),a&&Et&&(e=Lr(e))&&e instanceof wc&&(s[Et]=function(m){const v=new wc;return Ur(m,(x,E,g)=>{v[E]=hn(g)}),v.da=m.da,v}(e)),s}function m5(e){return e[0]=ms(e[0]),e[1]=ms(e[1]),e}function ms(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return sc(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[O];return e.length===0&&1&t?void 0:Br(e,t,ms)}if(e!=null&&e[Ba]===Ra)return Z1(e);if(e instanceof Sn){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(b1){for(var n="",i=0,a=t.length-10240;i<a;)n+=String.fromCharCode.apply(null,t.subarray(i,i+=10240));n+=String.fromCharCode.apply(null,i?t.subarray(i):t),t=btoa(n)}else{n===void 0&&(n=0),v1(),n=p1[n],i=Array(Math.floor(t.length/3)),a=n[64]||"";let c=0,f=0;for(;c<t.length-2;c+=3){var l=t[c],s=t[c+1],r=t[c+2],o=n[l>>2];l=n[(3&l)<<4|s>>4],s=n[(15&s)<<2|r>>6],r=n[63&r],i[f++]=o+l+s+r}switch(o=0,r=a,t.length-c){case 2:r=n[(15&(o=t[c+1]))<<2]||a;case 1:t=t[c],i[f]=n[t>>2]+n[(3&t)<<4|o>>4]+r+a}t=i.join("")}e=e.g=t}return e}return e instanceof Bn?e=e.size!==0?e.V(m5):void 0:void 0}return e}function Z1(e){return Br(e=e.v,0|e[O],ms)}let g5,w5;function $i(e,t){return K1(e,t[0],t[1])}function K1(e,t,n,i=0){if(e==null){var a=32;n?(e=[n],a|=128):e=[],t&&(a=-16760833&a|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(a=0|e[O],g1&&1&a)throw Error("rfarr");if(2048&a&&!(2&a)&&function(){if(g1)throw Error("carr");ka(Y6,5)}(),256&a)throw Error("farr");if(64&a)return(a|i)!==a&&Ge(e,a|i),e;if(n&&(a|=128,n!==e[0]))throw Error("mid");e:{a|=64;var l=(n=e).length;if(l){var s=l-1;const o=n[s];if(o!=null&&typeof o=="object"&&o.constructor===Object){if((s-=t=128&a?0:-1)>=1024)throw Error("pvtlmt");for(var r in o)(l=+r)<s&&(n[l+t]=o[r],delete o[r]);a=-16760833&a|(1023&s)<<14;break e}}if(t){if((r=Math.max(t,l-(128&a?0:-1)))>1024)throw Error("spvt");a=-16760833&a|(1023&r)<<14}}}return Ge(e,64|a|i),e}function y5(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var n=0|e[O];return e.length===0&&1&n?void 0:I1(e,n,t)}if(e!=null&&e[Ba]===Ra)return J1(e);if(e instanceof Bn){if(2&(t=e.J))return e;if(!e.size)return;if(n=ss(e.V()),e.K)for(e=0;e<n.length;e++){const i=n[e];let a=i[1];a=a==null||typeof a!="object"?void 0:a!=null&&a[Ba]===Ra?J1(a):Array.isArray(a)?I1(a,0|a[O],!!(32&t)):void 0,i[1]=a}return n}return e instanceof Sn?e:void 0}function I1(e,t,n){return 2&t||(!n||4096&t||16&t?e=Fa(e,t,!1,n&&!(16&t)):(ls(e,34),4&t&&Object.freeze(e))),e}function yc(e,t,n){return e=new e.constructor(t),n&&(e.h=Wi),e.m=Wi,e}function J1(e){const t=e.v,n=0|t[O];return _t(e,n)?e:vc(e,t,n)?yc(e,t):Fa(t,n)}function Fa(e,t,n,i){return i??(i=!!(34&t)),e=Br(e,t,y5,i),i=32,n&&(i|=2),Ge(e,t=16769217&t|i),e}function pc(e){const t=e.v,n=0|t[O];return _t(e,n)?vc(e,t,n)?yc(e,t,!0):new e.constructor(Fa(t,n,!1)):e}function Ya(e){if(e.h!==Wi)return!1;var t=e.v;return ls(t=Fa(t,0|t[O]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function Xa(e){if(!Ya(e)&&_t(e,0|e.v[O]))throw Error()}function ea(e,t){t===void 0&&(t=0|e[O]),32&t&&!(4096&t)&&Ge(e,4096|t)}function vc(e,t,n){return!!(2&n)||!(!(32&n)||4096&n)&&(Ge(t,2|n),e.h=Wi,!0)}const p5=Tt(0),fi={};function de(e,t,n,i,a){if((t=Rn(e.v,t,n,a))!==null||i&&e.m!==Wi)return t}function Rn(e,t,n,i){if(t===-1)return null;const a=t+(n?0:-1),l=e.length-1;let s,r;if(!(l<1+(n?0:-1))){if(a>=l)if(s=e[l],s!=null&&typeof s=="object"&&s.constructor===Object)n=s[t],r=!0;else{if(a!==l)return;n=s}else n=e[a];if(i&&n!=null){if((i=i(n))==null)return i;if(!Object.is(i,n))return r?s[t]=i:e[a]=i,i}return n}}function ne(e,t,n,i){Xa(e),He(e=e.v,0|e[O],t,n,i)}function He(e,t,n,i,a){const l=n+(a?0:-1);var s=e.length-1;if(s>=1+(a?0:-1)&&l>=s){const r=e[s];if(r!=null&&typeof r=="object"&&r.constructor===Object)return r[n]=i,t}return l<=s?(e[l]=i,t):(i!==void 0&&(n>=(s=(t??(t=0|e[O]))>>14&1023||536870912)?i!=null&&(e[s+(a?0:-1)]={[n]:i}):e[l]=i),t)}function ta(){return X6===void 0?2:4}function na(e,t,n,i,a){let l=e.v,s=0|l[O];i=_t(e,s)?1:i,a=!!a||i===3,i===2&&Ya(e)&&(l=e.v,s=0|l[O]);let r=(e=bc(l,t))===Ji?7:0|e[O],o=xc(r,s);var c=!(4&o);if(c){4&o&&(e=hn(e),r=0,o=aa(o,s),s=He(l,s,t,e));let f=0,h=0;for(;f<e.length;f++){const d=n(e[f]);d!=null&&(e[h++]=d)}h<f&&(e.length=h),n=-513&(4|o),o=n&=-1025,o&=-4097}return o!==r&&(Ge(e,o),2&o&&Object.freeze(e)),W1(e,o,l,s,t,i,c,a)}function W1(e,t,n,i,a,l,s,r){let o=t;return l===1||l===4&&(2&t||!(16&t)&&32&i)?ia(t)||((t|=!e.length||s&&!(4096&t)||32&i&&!(4096&t||16&t)?2:256)!==o&&Ge(e,t),Object.freeze(e)):(l===2&&ia(t)&&(e=hn(e),o=0,t=aa(t,i),i=He(n,i,a,e)),ia(t)||(r||(t|=16),t!==o&&Ge(e,t))),2&t||!(4096&t||16&t)||ea(n,i),e}function bc(e,t,n){return e=Rn(e,t,n),Array.isArray(e)?e:Ji}function xc(e,t){return 2&t&&(e|=2),1|e}function ia(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function P1(e){return lc(e,!0)}function $1(e){e=hn(e);for(let t=0;t<e.length;t++){const n=e[t]=hn(e[t]);Array.isArray(n[1])&&(n[1]=ss(n[1]))}return rs(e)}function di(e,t,n,i){Xa(e),He(e=e.v,0|e[O],t,(i==="0"?Number(n)===0:n===i)?void 0:n)}function Qa(e,t,n){if(2&t)throw Error();const i=Ga(t);let a=bc(e,n,i),l=a===Ji?7:0|a[O],s=xc(l,t);return(2&s||ia(s)||16&s)&&(s===l||ia(s)||Ge(a,s),a=hn(a),l=0,s=aa(s,t),He(e,t,n,a,i)),s&=-13,s!==l&&Ge(a,s),a}function Sc(e,t){var n=l0;return _c(Ec(e=e.v),e,void 0,n)===t?t:-1}function Ec(e){if(Ua)return e[as]??(e[as]=new Map);if(as in e)return e[as];const t=new Map;return Object.defineProperty(e,as,{value:t}),t}function eh(e,t,n,i,a){const l=Ec(e),s=_c(l,e,t,n,a);return s!==i&&(s&&(t=He(e,t,s,void 0,a)),l.set(n,i)),t}function _c(e,t,n,i,a){let l=e.get(i);if(l!=null)return l;l=0;for(let s=0;s<i.length;s++){const r=i[s];Rn(t,r,a)!=null&&(l!==0&&(n=He(t,n,l,void 0,a)),l=r)}return e.set(i,l),l}function Tc(e,t,n){let i=0|e[O];const a=Ga(i),l=Rn(e,n,a);let s;if(l!=null&&l[Ba]===Ra){if(!_t(l))return Ya(l),l.v;s=l.v}else Array.isArray(l)&&(s=l);if(s){const r=0|s[O];2&r&&(s=Fa(s,r))}return s=$i(s,t),s!==l&&He(e,i,n,s,a),s}function th(e,t,n,i,a){let l=!1;if((i=Rn(e,i,a,s=>{const r=hc(s,n,!1,t);return l=r!==s&&r!=null,r}))!=null)return l&&!_t(i)&&ea(e,t),i}function I(e,t,n,i){let a=e.v,l=0|a[O];if((t=th(a,l,t,n,i))==null)return t;if(l=0|a[O],!_t(e,l)){const s=pc(t);s!==t&&(Ya(e)&&(a=e.v,l=0|a[O]),l=He(a,l,n,t=s,i),ea(a,l))}return t}function nh(e,t,n,i,a,l,s,r){var o=_t(e,n);l=o?1:l,s=!!s||l===3,o=r&&!o,(l===2||o)&&Ya(e)&&(n=0|(t=e.v)[O]);var c=(e=bc(t,a))===Ji?7:0|e[O],f=xc(c,n);if(r=!(4&f)){var h=e,d=n;const m=!!(2&f);m&&(d|=2);let v=!m,x=!0,E=0,g=0;for(;E<h.length;E++){const w=hc(h[E],i,!1,d);if(w instanceof i){if(!m){const p=_t(w);v&&(v=!p),x&&(x=p)}h[g++]=w}}g<E&&(h.length=g),f|=4,f=x?-4097&f:4096|f,f=v?8|f:-9&f}if(f!==c&&(Ge(e,f),2&f&&Object.freeze(e)),o&&!(8&f||!e.length&&(l===1||l===4&&(2&f||!(16&f)&&32&n)))){for(ia(f)&&(e=hn(e),f=aa(f,n),n=He(t,n,a,e)),i=e,o=f,c=0;c<i.length;c++)(h=i[c])!==(f=pc(h))&&(i[c]=f);o|=8,Ge(e,f=o=i.length?4096|o:-4097&o)}return W1(e,f,t,n,a,l,r,s)}function Gn(e,t,n){const i=e.v;return nh(e,i,0|i[O],t,n,ta(),!1,!0)}function ih(e){return e==null&&(e=void 0),e}function U(e,t,n,i,a){return ne(e,n,i=ih(i),a),i&&!_t(i)&&ea(e.v),e}function gs(e,t,n,i){e:{var a=i=ih(i);Xa(e);const l=e.v;let s=0|l[O];if(a==null){const r=Ec(l);if(_c(r,l,s,n)!==t)break e;r.set(n,0)}else s=eh(l,s,n,t);He(l,s,t,a)}i&&!_t(i)&&ea(e.v)}function aa(e,t){return-273&(2&t?2|e:-3&e)}function Ac(e,t,n,i){var a=i;Xa(e),e=nh(e,i=e.v,0|i[O],n,t,2,!0),a=a??new n,e.push(a),t=n=e===Ji?7:0|e[O],(a=_t(a))?(n&=-9,e.length===1&&(n&=-4097)):n|=4096,n!==t&&Ge(e,n),a||ea(i)}function Zt(e,t,n){return qa(de(e,t,void 0,n))}function ah(e){return(ec?de(e,2,void 0,void 0,kr):kr(de(e,2)))??p5}function Te(e,t){return de(e,t,void 0,void 0,_n)??0}function Hn(e,t,n){if(n!=null){if(typeof n!="number"||!zr(n))throw ic("int32");n|=0}ne(e,t,n)}function L(e,t,n){ne(e,t,cs(n))}function At(e,t,n){di(e,t,hs(n),"")}function Rr(e,t,n){{Xa(e);const s=e.v;let r=0|s[O];if(n==null)He(s,r,t);else{var i=e=n===Ji?7:0|n[O],a=ia(e),l=a||Object.isFrozen(n);for(a||(e=0),l||(n=hn(n),i=0,e=aa(e,r),l=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??(ec?1024:0),a=0;a<n.length;a++){const o=n[a],c=Y1(o);Object.is(o,c)||(l&&(n=hn(n),i=0,e=aa(e,r),l=!1),n[a]=c)}e!==i&&(l&&(n=hn(n),e=aa(e,r)),Ge(n,e)),He(s,r,t,n)}}}function Gr(e,t,n){Xa(e),na(e,t,We,2,!0).push(Y1(n))}var Za=class{constructor(e,t,n){if(this.buffer=e,n&&!t)throw Error();this.g=t}};function Nc(e,t){if(typeof e=="string")return new Za(S1(e),t);if(Array.isArray(e))return new Za(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new Za(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new Za(e,!1);if(e.constructor===Sn)return t=nc(e)||new Uint8Array(0),new Za(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Za(e,!1);throw Error()}function Ka(e,t){let n,i=0,a=0,l=0;const s=e.h;let r=e.g;do n=s[r++],i|=(127&n)<<l,l+=7;while(l<32&&128&n);if(l>32)for(a|=(127&n)>>4,l=3;l<32&&128&n;l+=7)n=s[r++],a|=(127&n)<<l;if(la(e,r),!(128&n))return t(i>>>0,a>>>0);throw Error()}function jc(e){let t=0,n=e.g;const i=n+10,a=e.h;for(;n<i;){const l=a[n++];if(t|=l,(128&l)==0)return la(e,n),!!(127&t)}throw Error()}function hi(e){const t=e.h;let n=e.g,i=t[n++],a=127&i;if(128&i&&(i=t[n++],a|=(127&i)<<7,128&i&&(i=t[n++],a|=(127&i)<<14,128&i&&(i=t[n++],a|=(127&i)<<21,128&i&&(i=t[n++],a|=i<<28,128&i&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++])))))throw Error();return la(e,n),a}function Vn(e){return hi(e)>>>0}function Hr(e){var t=e.h;const n=e.g;var i=t[n],a=t[n+1];const l=t[n+2];return t=t[n+3],la(e,e.g+4),e=2*((a=(i<<0|a<<8|l<<16|t<<24)>>>0)>>31)+1,i=a>>>23&255,a&=8388607,i==255?a?NaN:e*(1/0):i==0?1401298464324817e-60*e*a:e*Math.pow(2,i-150)*(a+8388608)}function v5(e){return hi(e)}function la(e,t){if(e.g=t,t>e.l)throw Error()}function lh(e,t){if(t<0)throw Error();const n=e.g;if((t=n+t)>e.l)throw Error();return e.g=t,n}function sh(e,t){if(t==0)return Ii();var n=lh(e,t);return e.Y&&e.j?n=e.h.subarray(n,n+t):(e=e.h,n=n===(t=n+t)?new Uint8Array(0):P6?e.slice(n,t):new Uint8Array(e.subarray(n,t))),n.length==0?Ii():new Sn(n,za)}var rh=[];function uh(e,t,n,i){if(Fr.length){const a=Fr.pop();return a.o(i),a.g.init(e,t,n,i),a}return new b5(e,t,n,i)}function oh(e){e.g.clear(),e.l=-1,e.h=-1,Fr.length<100&&Fr.push(e)}function ch(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var n=Vn(e.g);if(t=n>>>3,!((n&=7)>=0&&n<=5)||t<1)throw Error();return e.l=t,e.h=n,!0}function Vr(e){switch(e.h){case 0:e.h!=0?Vr(e):jc(e.g);break;case 1:la(e=e.g,e.g+8);break;case 2:if(e.h!=2)Vr(e);else{var t=Vn(e.g);la(e=e.g,e.g+t)}break;case 5:la(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!ch(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}Vr(e)}break;default:throw Error()}}function ws(e,t,n){const i=e.g.l;var a=Vn(e.g);let l=(a=e.g.g+a)-i;if(l<=0&&(e.g.l=a,n(t,e,void 0,void 0,void 0),l=a-e.g.g),l)throw Error();return e.g.g=a,e.g.l=i,t}function Mc(e){var t=Vn(e.g),n=lh(e=e.g,t);if(e=e.h,D6){var i,a=e;(i=Wo)||(i=Wo=new TextDecoder("utf-8",{fatal:!0})),t=n+t,a=n===0&&t===a.length?a:a.subarray(n,t);try{var l=i.decode(a)}catch(r){if(jr===void 0){try{i.decode(new Uint8Array([128]))}catch{}try{i.decode(new Uint8Array([97])),jr=!0}catch{jr=!1}}throw!jr&&(Wo=void 0),r}}else{t=(l=n)+t,n=[];let r,o=null;for(;l<t;){var s=e[l++];s<128?n.push(s):s<224?l>=t?Ki():(r=e[l++],s<194||(192&r)!=128?(l--,Ki()):n.push((31&s)<<6|63&r)):s<240?l>=t-1?Ki():(r=e[l++],(192&r)!=128||s===224&&r<160||s===237&&r>=160||(192&(i=e[l++]))!=128?(l--,Ki()):n.push((15&s)<<12|(63&r)<<6|63&i)):s<=244?l>=t-2?Ki():(r=e[l++],(192&r)!=128||r-144+(s<<28)>>30||(192&(i=e[l++]))!=128||(192&(a=e[l++]))!=128?(l--,Ki()):(s=(7&s)<<18|(63&r)<<12|(63&i)<<6|63&a,s-=65536,n.push(55296+(s>>10&1023),56320+(1023&s)))):Ki(),n.length>=8192&&(o=d1(o,n),n.length=0)}l=d1(o,n)}return l}function fh(e){const t=Vn(e.g);return sh(e.g,t)}function qr(e,t,n){var i=Vn(e.g);for(i=e.g.g+i;e.g.g<i;)n.push(t(e.g))}var b5=class{constructor(e,t,n,i){if(rh.length){const a=rh.pop();a.init(e,t,n,i),e=a}else e=new class{constructor(a,l,s,r){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(a,l,s,r)}init(a,l,s,{Y:r=!1,ea:o=!1}={}){this.Y=r,this.ea=o,a&&(a=Nc(a,this.ea),this.h=a.buffer,this.j=a.g,this.m=l||0,this.l=s!==void 0?this.m+s: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,n,i);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(i)}o({ha:e=!1}={}){this.ha=e}},Fr=[];function dh(e){return e?/^\d+$/.test(e)?(Or(e),new Cc(we,De)):null:x5||(x5=new Cc(0,0))}var Cc=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let x5;function hh(e){return e?/^-?\d+$/.test(e)?(Or(e),new Dc(we,De)):null:S5||(S5=new Dc(0,0))}var Dc=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let S5;function Ia(e,t,n){for(;n>0||t>127;)e.g.push(127&t|128),t=(t>>>7|n<<25)>>>0,n>>>=7;e.g.push(t)}function Ja(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function Yr(e,t){if(t>=0)Ja(e,t);else{for(let n=0;n<9;n++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function Oc(e){var t=we;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 Wa(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Kt(e,t,n){Ja(e.g,8*t+n)}function zc(e,t){return Kt(e,t,2),t=e.g.end(),Wa(e,t),t.push(e.h),t}function kc(e,t){var n=t.pop();for(n=e.h+e.g.length()-n;n>127;)t.push(127&n|128),n>>>=7,e.h++;t.push(n),e.h++}function Xr(e,t,n){Kt(e,t,2),Ja(e.g,n.length),Wa(e,e.g.end()),Wa(e,n)}function Qr(e,t,n,i){n!=null&&(t=zc(e,t),i(n,e),kc(e,t))}function Tn(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var Lc=Tn(),mh=Tn(),Uc=Tn(),Bc=Tn(),gh=Tn(),wh=Tn(),E5=Tn(),Zr=Tn(),yh=Tn(),ph=Tn();function An(e,t,n){var i=e.v;Et&&Et in i&&(i=i[Et])&&delete i[t.g],t.h?t.j(e,t.h,t.g,n,t.l):t.j(e,t.g,n,t.l)}var z=class{constructor(e,t){this.v=K1(e,t,void 0,2048)}toJSON(){return Z1(this)}j(){var a;var e=ly,t=this.v,n=e.g,i=Et;if(Ua&&i&&((a=t[i])==null?void 0:a[n])!=null&&ka(q6,3),t=e.g,A1&&Et&&A1===void 0&&(i=(n=this.v)[Et])&&(i=i.da))try{i(n,t,d5)}catch(l){m1(l)}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[O];return vc(this,e,t)?yc(this,e,!0):new this.constructor(Fa(e,t,!1))}};z.prototype[Ba]=Ra,z.prototype.toString=function(){return this.v.toString()};var Pa=class{constructor(e,t,n){this.g=e,this.h=t,e=Lc,this.l=!!e&&n===e||!1}};function Kr(e,t){return new Pa(e,t,Lc)}function vh(e,t,n,i,a){Qr(e,n,Th(t,i),a)}const _5=Kr(function(e,t,n,i,a){return e.h===2&&(ws(e,Tc(t,i,n),a),!0)},vh),T5=Kr(function(e,t,n,i,a){return e.h===2&&(ws(e,Tc(t,i,n),a),!0)},vh);var Ir=Symbol(),Jr=Symbol(),Rc=Symbol(),bh=Symbol(),xh=Symbol();let Sh,Eh;function sa(e,t,n,i){var a=i[e];if(a)return a;(a={}).qa=i,a.T=function(h){switch(typeof h){case"boolean":return g5||(g5=[0,void 0,!0]);case"number":return h>0?void 0:h===0?w5||(w5=[0,void 0]):[-h,void 0];case"string":return[0,h];case"object":return h}}(i[0]);var l=i[1];let s=1;l&&l.constructor===Object&&(a.ba=l,typeof(l=i[++s])=="function"&&(a.ma=!0,Sh??(Sh=l),Eh??(Eh=i[s+1]),l=i[s+=2]));const r={};for(;l&&Array.isArray(l)&&l.length&&typeof l[0]=="number"&&l[0]>0;){for(var o=0;o<l.length;o++)r[l[o]]=l;l=i[++s]}for(o=1;l!==void 0;){let h;typeof l=="number"&&(o+=l,l=i[++s]);var c=void 0;if(l instanceof Pa?h=l:(h=_5,s--),h==null?void 0:h.l){l=i[++s],c=i;var f=s;typeof l=="function"&&(l=l(),c[f]=l),c=l}for(f=o+1,typeof(l=i[++s])=="number"&&l<0&&(f-=l,l=i[++s]);o<f;o++){const d=r[o];c?n(a,o,h,c,d):t(a,o,h,d)}}return i[e]=a}function _h(e){return Array.isArray(e)?e[0]instanceof Pa?e:[T5,e]:[e,void 0]}function Th(e,t){return e instanceof z?e.v:Array.isArray(e)?$i(e,t):void 0}function Gc(e,t,n,i){const a=n.g;e[t]=i?(l,s,r)=>a(l,s,r,i):a}function Hc(e,t,n,i,a){const l=n.g;let s,r;e[t]=(o,c,f)=>l(o,c,f,r||(r=sa(Jr,Gc,Hc,i).T),s||(s=Vc(i)),a)}function Vc(e){let t=e[Rc];if(t!=null)return t;const n=sa(Jr,Gc,Hc,e);return t=n.ma?(i,a)=>Sh(i,a,n):(i,a)=>{for(;ch(a)&&a.h!=4;){var l=a.l,s=n[l];if(s==null){var r=n.ba;r&&(r=r[l])&&(r=N5(r))!=null&&(s=n[l]=r)}if(s==null||!s(a,i,l)){if(s=(r=a).m,Vr(r),r.ha)var o=void 0;else o=r.g.g-s,r.g.g=s,o=sh(r.g,o);s=void 0,r=i,o&&((s=r[Et]??(r[Et]=new wc))[l]??(s[l]=[])).push(o)}}return(i=Lr(i))&&(i.da=n.qa[xh]),!0},e[Rc]=t,e[xh]=A5.bind(e),t}function A5(e,t,n,i){var a=this[Jr];const l=this[Rc],s=$i(void 0,a.T),r=Lr(e);if(r){var o=!1,c=a.ba;if(c){if(a=(f,h,d)=>{if(d.length!==0)if(c[h])for(const m of d){f=uh(m);try{o=!0,l(s,f)}finally{oh(f)}}else i==null||i(e,h,d)},t==null)Ur(r,a);else if(r!=null){const f=r[t];f&&a(r,t,f)}if(o){let f=0|e[O];if(2&f&&2048&f&&!(n!=null&&n.Ka))throw Error();const h=Ga(f),d=(m,v)=>{if(Rn(e,m,h)!=null){if((n==null?void 0:n.Qa)===1)return;throw Error()}v!=null&&(f=He(e,f,m,v,h)),delete r[m]};t==null?D1(s,0|s[O],(m,v)=>{d(m,v)}):d(t,Rn(s,t,h))}}}}function N5(e){const t=(e=_h(e))[0].g;if(e=e[1]){const n=Vc(e),i=sa(Jr,Gc,Hc,e).T;return(a,l,s)=>t(a,l,s,i,n)}return t}function Wr(e,t,n){e[t]=n.h}function Pr(e,t,n,i){let a,l;const s=n.h;e[t]=(r,o,c)=>s(r,o,c,l||(l=sa(Ir,Wr,Pr,i).T),a||(a=Ah(i)))}function Ah(e){let t=e[bh];if(!t){const n=sa(Ir,Wr,Pr,e);t=(i,a)=>Nh(i,a,n),e[bh]=t}return t}function Nh(e,t,n){D1(e,0|e[O],(i,a)=>{if(a!=null){var l=function(s,r){var o=s[r];if(o)return o;if((o=s.ba)&&(o=o[r])){var c=(o=_h(o))[0].h;if(o=o[1]){const f=Ah(o),h=sa(Ir,Wr,Pr,o).T;o=s.ma?Eh(h,f):(d,m,v)=>c(d,m,v,h,f)}else o=c;return s[r]=o}}(n,i);l?l(t,a,i):i<500||ka(ac,3)}}),(e=Lr(e))&&Ur(e,(i,a,l)=>{for(Wa(t,t.g.end()),i=0;i<l.length;i++)Wa(t,nc(l[i])||new Uint8Array(0))})}const j5=Tt(0);function $a(e,t){if(Array.isArray(t)){var n=0|t[O];if(4&n)return t;for(var i=0,a=0;i<t.length;i++){const l=e(t[i]);l!=null&&(t[a++]=l)}return a<i&&(t.length=a),(e=-1537&(5|n))!==n&&Ge(t,e),2&e&&Object.freeze(t),t}}function lt(e,t,n){return new Pa(e,t,n)}function el(e,t,n){return new Pa(e,t,n)}function Ye(e,t,n){He(e,0|e[O],t,n,Ga(0|e[O]))}var M5=Kr(function(e,t,n,i,a){if(e.h!==2)return!1;if(e=hn(e=ws(e,$i([void 0,void 0],i),a)),a=Ga(i=0|t[O]),2&i)throw Error();let l=Rn(t,n,a);if(l instanceof Bn)2&l.J?(l=l.V(),l.push(e),He(t,i,n,l,a)):l.Ma(e);else if(Array.isArray(l)){var s=0|l[O];8192&s||Ge(l,s|=8192),2&s&&(l=$1(l),He(t,i,n,l,a)),l.push(e)}else He(t,i,n,rs([e]),a);return!0},function(e,t,n,i,a){if(t instanceof Bn)t.forEach((l,s)=>{Qr(e,n,$i([s,l],i),a)});else if(Array.isArray(t)){for(let l=0;l<t.length;l++){const s=t[l];Array.isArray(s)&&Qr(e,n,$i(s,i),a)}rs(t)}});function jh(e,t,n){(t=_n(t))!=null&&(Kt(e,n,5),e=e.g,rc(t),Oc(e))}function Mh(e,t,n){if(t=function(i){if(i==null)return i;const a=typeof i;if(a==="bigint")return String(os(64,i));if(ds(i)){if(a==="string")return V1(i);if(a==="number")return dc(i)}}(t),t!=null&&(typeof t=="string"&&hh(t),t!=null))switch(Kt(e,n,0),typeof t){case"number":e=e.g,Ha(t),Ia(e,we,De);break;case"bigint":n=BigInt.asUintN(64,t),n=new Dc(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Ia(e.g,n.h,n.g);break;default:n=hh(t),Ia(e.g,n.h,n.g)}}function Ch(e,t,n){(t=qa(t))!=null&&t!=null&&(Kt(e,n,0),Yr(e.g,t))}function Dh(e,t,n){(t=R1(t))!=null&&(Kt(e,n,0),e.g.g.push(t?1:0))}function Oh(e,t,n){(t=We(t))!=null&&Xr(e,n,h1(t))}function zh(e,t,n,i,a){Qr(e,n,Th(t,i),a)}function kh(e,t,n){(t=t==null||typeof t=="string"||t instanceof Sn?t:void 0)!=null&&Xr(e,n,Nc(t,!0).buffer)}function Lh(e,t,n){return(e.h===5||e.h===2)&&(t=Qa(t,0|t[O],n),e.h==2?qr(e,Hr,t):t.push(Hr(e.g)),!0)}var Oe=lt(function(e,t,n){return e.h===5&&(Ye(t,n,Hr(e.g)),!0)},jh,Zr),C5=el(Lh,function(e,t,n){if((t=$a(_n,t))!=null)for(let s=0;s<t.length;s++){var i=e,a=n,l=t[s];l!=null&&(Kt(i,a,5),i=i.g,rc(l),Oc(i))}},Zr),qc=el(Lh,function(e,t,n){if((t=$a(_n,t))!=null&&t.length){Kt(e,n,2),Ja(e.g,4*t.length);for(let i=0;i<t.length;i++)n=e.g,rc(t[i]),Oc(n)}},Zr),D5=lt(function(e,t,n){return e.h===5&&(Ye(t,n,(e=Hr(e.g))===0?void 0:e),!0)},jh,Zr),mi=lt(function(e,t,n){return $o?(e.h!==0?e=!1:(Ye(t,n,Ka(e.g,U1)),e=!0),e):e.h===0&&(Ye(t,n,Ka(e.g,oc)),!0)},Mh,wh),Fc=lt(function(e,t,n){return $o?(e.h!==0?t=!1:(Ye(t,n,(e=Ka(e.g,U1))===j5?void 0:e),t=!0),t):e.h===0&&(Ye(t,n,(e=Ka(e.g,oc))===0?void 0:e),!0)},Mh,wh),O5=lt(function(e,t,n){return $o?(e.h!==0?e=!1:(Ye(t,n,Ka(e.g,e5)),e=!0),e):e.h===0&&(Ye(t,n,Ka(e.g,uc)),!0)},function(e,t,n){if(t=function(i){if(i==null)return i;var a=typeof i;if(a==="bigint")return String(t5(64,i));if(ds(i)){if(a==="string")return a=Va(Number(i)),Pi(a)&&a>=0?i=String(a):((a=i.indexOf("."))!==-1&&(i=i.substring(0,a)),(a=i[0]!=="-"&&((a=i.length)<20||a===20&&i<="18446744073709551615"))||(Or(i),i=us(we,De))),i;if(a==="number")return(i=Va(i))>=0&&Pi(i)||(Ha(i),i=uc(we,De)),i}}(t),t!=null&&(typeof t=="string"&&dh(t),t!=null))switch(Kt(e,n,0),typeof t){case"number":e=e.g,Ha(t),Ia(e,we,De);break;case"bigint":n=BigInt.asUintN(64,t),n=new Cc(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),Ia(e.g,n.h,n.g);break;default:n=dh(t),Ia(e.g,n.h,n.g)}},E5),Xe=lt(function(e,t,n){return e.h===0&&(Ye(t,n,hi(e.g)),!0)},Ch,Bc),ys=el(function(e,t,n){return(e.h===0||e.h===2)&&(t=Qa(t,0|t[O],n),e.h==2?qr(e,hi,t):t.push(hi(e.g)),!0)},function(e,t,n){if((t=$a(qa,t))!=null&&t.length){n=zc(e,n);for(let i=0;i<t.length;i++)Yr(e.g,t[i]);kc(e,n)}},Bc),tl=lt(function(e,t,n){return e.h===0&&(Ye(t,n,(e=hi(e.g))===0?void 0:e),!0)},Ch,Bc),Ae=lt(function(e,t,n){return e.h===0&&(Ye(t,n,jc(e.g)),!0)},Dh,mh),ra=lt(function(e,t,n){return e.h===0&&(Ye(t,n,(e=jc(e.g))===!1?void 0:e),!0)},Dh,mh),at=el(function(e,t,n){return e.h===2&&(e=Mc(e),Qa(t,0|t[O],n).push(e),!0)},function(e,t,n){if((t=$a(We,t))!=null)for(let s=0;s<t.length;s++){var i=e,a=n,l=t[s];l!=null&&Xr(i,a,h1(l))}},Uc),gi=lt(function(e,t,n){return e.h===2&&(Ye(t,n,(e=Mc(e))===""?void 0:e),!0)},Oh,Uc),re=lt(function(e,t,n){return e.h===2&&(Ye(t,n,Mc(e)),!0)},Oh,Uc),Qe=function(e,t,n=Lc){return new Pa(e,t,n)}(function(e,t,n,i,a){return e.h===2&&(i=$i(void 0,i),Qa(t,0|t[O],n).push(i),ws(e,i,a),!0)},function(e,t,n,i,a){if(Array.isArray(t)){for(let l=0;l<t.length;l++)zh(e,t[l],n,i,a);1&(e=0|t[O])||Ge(t,1|e)}}),Ne=Kr(function(e,t,n,i,a,l){if(e.h!==2)return!1;let s=0|t[O];return eh(t,s,l,n,Ga(s)),ws(e,t=Tc(t,i,n),a),!0},zh),Uh=lt(function(e,t,n){return e.h===2&&(Ye(t,n,fh(e)),!0)},kh,yh),z5=el(function(e,t,n){return(e.h===0||e.h===2)&&(t=Qa(t,0|t[O],n),e.h==2?qr(e,Vn,t):t.push(Vn(e.g)),!0)},function(e,t,n){if((t=$a(G1,t))!=null)for(let s=0;s<t.length;s++){var i=e,a=n,l=t[s];l!=null&&(Kt(i,a,0),Ja(i.g,l))}},gh),k5=lt(function(e,t,n){return e.h===0&&(Ye(t,n,(e=Vn(e.g))===0?void 0:e),!0)},function(e,t,n){(t=G1(t))!=null&&t!=null&&(Kt(e,n,0),Ja(e.g,t))},gh),Nt=lt(function(e,t,n){return e.h===0&&(Ye(t,n,hi(e.g)),!0)},function(e,t,n){(t=qa(t))!=null&&(t=parseInt(t,10),Kt(e,n,0),Yr(e.g,t))},ph);class L5{constructor(t,n){var i=jt;this.g=t,this.h=n,this.m=I,this.j=U,this.defaultValue=void 0,this.l=i.Oa!=null?O1:void 0}register(){Mr(this)}}function Nn(e,t){return new L5(e,t)}function wi(e,t){return(n,i)=>{{const l={ea:!0};i&&Object.assign(l,i),n=uh(n,void 0,void 0,l);try{const s=new e,r=s.v;Vc(t)(r,n);var a=s}finally{oh(n)}}return a}}function $r(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 s=this.g;return this.g=[],s}}}};Nh(this.v,t,sa(Ir,Wr,Pr,e)),Wa(t,t.g.end());const n=new Uint8Array(t.h),i=t.l,a=i.length;let l=0;for(let s=0;s<a;s++){const r=i[s];n.set(r,l),l+=r.length}return t.l=[n],n}}var Bh=class extends z{constructor(e){super(e)}},Rh=[0,gi,lt(function(e,t,n){return e.h===2&&(Ye(t,n,(e=fh(e))===Ii()?void 0:e),!0)},function(e,t,n){if(t!=null){if(t instanceof z){const i=t.Ra;return void(i?(t=i(t),t!=null&&Xr(e,n,Nc(t,!0).buffer)):ka(ac,3))}if(Array.isArray(t))return void ka(ac,3)}kh(e,t,n)},yh)];let Yc,Gh=globalThis.trustedTypes;function Hh(e){var t;return Yc===void 0&&(Yc=function(){let n=null;if(!Gh)return n;try{const i=a=>a;n=Gh.createPolicy("goog#html",{createHTML:i,createScript:i,createScriptURL:i})}catch{}return n}()),e=(t=Yc)?t.createScriptURL(e):e,new class{constructor(n){this.g=n}toString(){return this.g+""}}(e)}function U5(e,...t){if(t.length===0)return Hh(e[0]);let n=e[0];for(let i=0;i<t.length;i++)n+=encodeURIComponent(t[i])+e[i+1];return Hh(n)}var Vh=[0,Xe,Nt,Ae,-1,ys,Nt,-1,Ae],B5=class extends z{constructor(e){super(e)}},qh=[0,Ae,re,Ae,Nt,-1,el(function(e,t,n){return(e.h===0||e.h===2)&&(t=Qa(t,0|t[O],n),e.h==2?qr(e,v5,t):t.push(hi(e.g)),!0)},function(e,t,n){if((t=$a(qa,t))!=null&&t.length){n=zc(e,n);for(let i=0;i<t.length;i++)Yr(e.g,t[i]);kc(e,n)}},ph),re,-1,[0,Ae,-1],Nt,Ae,-1],Fh=[0,3,Ae,-1,2,[0,Xe],[0,Nt,Ae],[0,re,-1],[0]],Yh=[0,re,-2],Xh=class extends z{constructor(e){super(e)}},Qh=[0],Zh=[0,Xe,Ae,1,Ae,-4],jt=class extends z{constructor(e){super(e,2)}},Ve={};Ve[336783863]=[0,re,Ae,-1,Xe,[0,[1,2,3,4,5,6,7,8,9],Ne,Qh,Ne,qh,Ne,Yh,Ne,Zh,Ne,Vh,Ne,[0,re,-2],Ne,[0,re,Nt],Ne,Fh,Ne,[0,Nt,-1,Ae]],[0,re],Ae,[0,[1,3],[2,4],Ne,[0,ys],-1,Ne,[0,at],-1,Qe,[0,re,-1]],re];var Kh=[0,Fc,-1,ra,-3,Fc,ys,gi,tl,Fc,-1,ra,tl,ra,-2,gi];function he(e,t){Gr(e,3,t)}function Q(e,t){Gr(e,4,t)}var dt=class extends z{constructor(e){super(e,500)}o(e){return U(this,0,7,e)}},ps=[-1,{}],Ih=[0,re,1,ps],Jh=[0,re,at,ps];function It(e,t){Ac(e,1,dt,t)}function ye(e,t){Gr(e,10,t)}function J(e,t){Gr(e,15,t)}var Mt=class extends z{constructor(e){super(e,500)}o(e){return U(this,0,1001,e)}},Wh=[-500,Qe,[-500,gi,-1,at,-3,[-2,Ve,Ae],Qe,Rh,tl,-1,Ih,Jh,Qe,[0,gi,ra],gi,Kh,tl,at,987,at],4,Qe,[-500,re,-1,[-1,{}],998,re],Qe,[-500,re,at,-1,[-2,{},Ae],997,at,-1],tl,Qe,[-500,re,at,ps,998,at],at,tl,Ih,Jh,Qe,[0,gi,-1,ps],at,-2,Kh,gi,-1,ra,[0,ra,k5],978,ps,Qe,Rh];Mt.prototype.g=$r(Wh);var R5=wi(Mt,Wh),G5=class extends z{constructor(e){super(e)}},Ph=class extends z{constructor(e){super(e)}g(){return Gn(this,G5,1)}},$h=[0,Qe,[0,Xe,Oe,re,-1]],eu=wi(Ph,$h),H5=class extends z{constructor(e){super(e)}},V5=class extends z{constructor(e){super(e)}},Xc=class extends z{constructor(e){super(e)}l(){return I(this,H5,2)}g(){return Gn(this,V5,5)}},e0=wi(class extends z{constructor(e){super(e)}},[0,at,ys,qc,[0,Nt,[0,Xe,-3],[0,Oe,-3],[0,Xe,-1,[0,Qe,[0,Xe,-2]]],Qe,[0,Oe,-1,re,Oe]],re,-1,mi,Qe,[0,Xe,Oe],at,mi]),t0=class extends z{constructor(e){super(e)}},nl=wi(class extends z{constructor(e){super(e)}},[0,Qe,[0,Oe,-4]]),n0=class extends z{constructor(e){super(e)}},vs=wi(class extends z{constructor(e){super(e)}},[0,Qe,[0,Oe,-4]]),q5=class extends z{constructor(e){super(e)}},F5=[0,Xe,-1,qc,Nt],i0=class extends z{constructor(e){super(e)}};i0.prototype.g=$r([0,Oe,-4,mi]);var Y5=class extends z{constructor(e){super(e)}},X5=wi(class extends z{constructor(e){super(e)}},[0,Qe,[0,1,Xe,re,$h],mi]),a0=class extends z{constructor(e){super(e)}},Q5=class extends z{constructor(e){super(e)}na(){const e=de(this,1,void 0,void 0,P1);return e??Ii()}},Z5=class extends z{constructor(e){super(e)}},l0=[1,2],K5=wi(class extends z{constructor(e){super(e)}},[0,Qe,[0,l0,Ne,[0,qc],Ne,[0,Uh],Xe,re],mi]),Qc=class extends z{constructor(e){super(e)}},s0=[0,re,Xe,Oe,at,-1],r0=class extends z{constructor(e){super(e)}},I5=[0,Ae,-1],u0=class extends z{constructor(e){super(e)}},tu=[1,2,3,4,5,6],nu=class extends z{constructor(e){super(e)}g(){return de(this,1,void 0,void 0,P1)!=null}l(){return We(de(this,2))!=null}},ve=class extends z{constructor(e){super(e)}g(){return R1(de(this,2))??!1}},o0=[0,Uh,re,[0,Xe,mi,-1],[0,O5,mi]],ze=[0,o0,Ae,[0,tu,Ne,Zh,Ne,qh,Ne,Vh,Ne,Qh,Ne,Yh,Ne,Fh],Nt],iu=class extends z{constructor(e){super(e)}},Zc=[0,ze,Oe,-1,Xe],J5=Nn(502141897,iu);Ve[502141897]=Zc;var W5=wi(class extends z{constructor(e){super(e)}},[0,[0,Nt,-1,C5,z5],F5]),c0=class extends z{constructor(e){super(e)}},f0=class extends z{constructor(e){super(e)}},Kc=[0,ze,Oe,[0,ze],Ae],P5=Nn(508968150,f0);Ve[508968150]=[0,ze,Zc,Kc,Oe,[0,[0,o0]]],Ve[508968149]=Kc;var il=class extends z{constructor(e){super(e)}l(){return I(this,Qc,2)}g(){ne(this,2)}},d0=[0,ze,s0];Ve[478825465]=d0;var $5=class extends z{constructor(e){super(e)}},h0=class extends z{constructor(e){super(e)}},Ic=class extends z{constructor(e){super(e)}},Jc=class extends z{constructor(e){super(e)}},m0=class extends z{constructor(e){super(e)}},g0=[0,ze,[0,ze],d0,-1],w0=[0,ze,Oe,Xe],Wc=[0,ze,Oe],y0=[0,ze,w0,Wc,Oe],ey=Nn(479097054,m0);Ve[479097054]=[0,ze,y0,g0],Ve[463370452]=g0,Ve[464864288]=w0;var ty=Nn(462713202,Jc);Ve[462713202]=y0,Ve[474472470]=Wc;var ny=class extends z{constructor(e){super(e)}},p0=class extends z{constructor(e){super(e)}},v0=class extends z{constructor(e){super(e)}},b0=class extends z{constructor(e){super(e)}},Pc=[0,ze,Oe,-1,Xe],$c=[0,ze,Oe,Ae];b0.prototype.g=$r([0,ze,Wc,[0,ze],Zc,Kc,Pc,$c]);var x0=class extends z{constructor(e){super(e)}},iy=Nn(456383383,x0);Ve[456383383]=[0,ze,s0];var S0=class extends z{constructor(e){super(e)}},ay=Nn(476348187,S0);Ve[476348187]=[0,ze,I5];var E0=class extends z{constructor(e){super(e)}},_0=class extends z{constructor(e){super(e)}},T0=[0,Nt,-1],ly=Nn(458105876,class extends z{constructor(e){super(e)}g(){let e;var t=this.v;const n=0|t[O];return e=_t(this,n),t=function(i,a,l,s){var r=_0;!s&&Ya(i)&&(l=0|(a=i.v)[O]);var o=Rn(a,2);if(i=!1,o==null){if(s)return Q1();o=[]}else if(o.constructor===Bn){if(!(2&o.J)||s)return o;o=o.V()}else Array.isArray(o)?i=!!(2&(0|o[O])):o=[];if(s){if(!o.length)return Q1();i||(i=!0,ss(o))}else i&&(i=!1,rs(o),o=$1(o));return!i&&32&l&&ls(o,32),l=He(a,l,2,s=new Bn(o,r,l5,void 0)),i||ea(a,l),s}(this,t,n,e),!e&&_0&&(t.ra=!0),t}});Ve[458105876]=[0,T0,M5,[!0,mi,[0,re,-1,at]],[0,ys,Ae,Nt]];var ef=class extends z{constructor(e){super(e)}},A0=Nn(458105758,ef);Ve[458105758]=[0,ze,re,T0];var tf=class extends z{constructor(e){super(e)}},N0=[0,D5,-1,ra],sy=class extends z{constructor(e){super(e)}},j0=class extends z{constructor(e){super(e)}},nf=[1,2];j0.prototype.g=$r([0,nf,Ne,N0,Ne,[0,Qe,N0]]);var M0=class extends z{constructor(e){super(e)}},ry=Nn(443442058,M0);Ve[443442058]=[0,ze,re,Xe,Oe,at,-1,Ae,Oe],Ve[514774813]=Pc;var C0=class extends z{constructor(e){super(e)}},uy=Nn(516587230,C0);function af(e,t){return t=t?t.clone():new Qc,e.displayNamesLocale!==void 0?ne(t,1,hs(e.displayNamesLocale)):e.displayNamesLocale===void 0&&ne(t,1),e.maxResults!==void 0?Hn(t,2,e.maxResults):"maxResults"in e&&ne(t,2),e.scoreThreshold!==void 0?L(t,3,e.scoreThreshold):"scoreThreshold"in e&&ne(t,3),e.categoryAllowlist!==void 0?Rr(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&ne(t,4),e.categoryDenylist!==void 0?Rr(t,5,e.categoryDenylist):"categoryDenylist"in e&&ne(t,5),t}function D0(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function lf(e,t=-1,n=""){return{categories:e.map(i=>({index:Zt(i,1)??0??-1,score:Te(i,2)??0,categoryName:We(de(i,3))??""??"",displayName:We(de(i,4))??""??""})),headIndex:t,headName:n}}function oy(e){const t={classifications:Gn(e,Y5,1).map(n=>{var i;return lf(((i=I(n,Ph,4))==null?void 0:i.g())??[],Zt(n,2)??0,We(de(n,3))??"")})};return function(n){return a5(ec?de(n,2,void 0,void 0,kr):de(n,2))}(e)!=null&&(t.timestampMs=D0(ah(e))),t}function O0(e){var s,r;var t=na(e,3,_n,ta()),n=na(e,2,qa,ta()),i=na(e,1,We,ta()),a=na(e,9,We,ta());const l={categories:[],keypoints:[]};for(let o=0;o<t.length;o++)l.categories.push({score:t[o],index:n[o]??-1,categoryName:i[o]??"",displayName:a[o]??""});if((t=(s=I(e,Xc,4))==null?void 0:s.l())&&(l.boundingBox={originX:Zt(t,1,fi)??0,originY:Zt(t,2,fi)??0,width:Zt(t,3,fi)??0,height:Zt(t,4,fi)??0,angle:0}),(r=I(e,Xc,4))==null?void 0:r.g().length)for(const o of I(e,Xc,4).g())l.keypoints.push({x:de(o,1,void 0,fi,_n)??0,y:de(o,2,void 0,fi,_n)??0,score:de(o,4,void 0,fi,_n)??0,label:We(de(o,3,void 0,fi))??""});return l}function au(e){const t=[];for(const n of Gn(e,n0,1))t.push({x:Te(n,1)??0,y:Te(n,2)??0,z:Te(n,3)??0,visibility:Te(n,4)??0});return t}function bs(e){const t=[];for(const n of Gn(e,t0,1))t.push({x:Te(n,1)??0,y:Te(n,2)??0,z:Te(n,3)??0,visibility:Te(n,4)??0});return t}function z0(e){return Array.from(e,t=>t>127?t-256:t)}function k0(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let n=0,i=0,a=0;for(let l=0;l<e.length;l++)n+=e[l]*t[l],i+=e[l]*e[l],a+=t[l]*t[l];if(i<=0||a<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(i*a)}let lu;Ve[516587230]=[0,ze,Pc,$c,Oe],Ve[518928384]=$c;const cy=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 L0(){if(lu===void 0)try{await WebAssembly.instantiate(cy),lu=!0}catch{lu=!1}return lu}async function xs(e,t=U5``){const n=await L0()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${n}.js`,wasmBinaryPath:`${t}/${e}_${n}.wasm`}}var ua=class{};function U0(){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 B0(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((n,i)=>{t.addEventListener("load",()=>{n()},!1),t.addEventListener("error",a=>{i(a)},!1),document.body.appendChild(t)})}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function R0(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 k(e,t,n){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function G0(e,t,n){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(n?e.i._bindTextureToStream(n):e.i._bindTextureToCanvas(),!(n=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&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[i,a]=R0(t);return!e.l||i===e.i.canvas.width&&a===e.i.canvas.height||(e.i.canvas.width=i,e.i.canvas.height=a),[i,a]}function H0(e,t,n){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 a=0;a<t.length;a++)i[a]=e.i.stringToNewUTF8(t[a]);t=e.i._malloc(4*i.length),e.i.HEAPU32.set(i,t>>2),n(t);for(const a of i)e.i._free(a);e.i._free(t)}function jn(e,t,n){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=n}function yi(e,t,n){let i=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(a,l,s)=>{l?(n(i,s),i=[]):i.push(a)}}ua.forVisionTasks=function(e){return xs("vision",e)},ua.forTextTasks=function(e){return xs("text",e)},ua.forGenAiExperimentalTasks=function(e){return xs("genai_experimental",e)},ua.forGenAiTasks=function(e){return xs("genai",e)},ua.forAudioTasks=function(e){return xs("audio",e)},ua.isSimdSupported=function(){return L0()};async function fy(e,t,n,i){return e=await(async(a,l,s,r,o)=>{if(l&&await B0(l),!self.ModuleFactory||s&&(await B0(s),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&o&&((l=self.Module).locateFile=o.locateFile,o.mainScriptUrlOrBlob&&(l.mainScriptUrlOrBlob=o.mainScriptUrlOrBlob)),o=await self.ModuleFactory(self.Module||o),self.ModuleFactory=self.Module=void 0,new a(o,r)})(e,n.wasmLoaderPath,n.assetLoaderPath,t,{locateFile:a=>a.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&a.endsWith(".data")?n.assetBinaryPath.toString():a}),await e.o(i),e}function sf(e,t){const n=I(e.baseOptions,nu,1)||new nu;typeof t=="string"?(ne(n,2,hs(t)),ne(n,1)):t instanceof Uint8Array&&(ne(n,1,lc(t,!1)),ne(n,2)),U(e.baseOptions,0,1,n)}function V0(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(n=>n.message).join(", "))}finally{e.H=[]}}function C(e,t){e.C=Math.max(e.C,t)}function su(e,t){e.B=new dt,At(e.B,2,"PassThroughCalculator"),he(e.B,"free_memory"),Q(e.B,"free_memory_unused_out"),ye(t,"free_memory"),It(t,e.B)}function al(e,t){he(e.B,t),Q(e.B,t+"_unused_out")}function ru(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var rf=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var n,i,a,l,s,r;if(t){const o=e.baseOptions||{};if((n=e.baseOptions)!=null&&n.modelAssetBuffer&&((i=e.baseOptions)!=null&&i.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((a=I(this.baseOptions,nu,1))!=null&&a.g()||(l=I(this.baseOptions,nu,1))!=null&&l.l()||(s=e.baseOptions)!=null&&s.modelAssetBuffer||(r=e.baseOptions)!=null&&r.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(c,f){let h=I(c.baseOptions,u0,3);if(!h){var d=h=new u0,m=new Xh;gs(d,4,tu,m)}"delegate"in f&&(f.delegate==="GPU"?(f=h,d=new B5,gs(f,2,tu,d)):(f=h,d=new Xh,gs(f,4,tu,d))),U(c.baseOptions,0,3,h)}(this,o),o.modelAssetPath)return fetch(o.modelAssetPath.toString()).then(c=>{if(c.ok)return c.arrayBuffer();throw Error(`Failed to fetch model: ${o.modelAssetPath} (${c.status})`)}).then(c=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(c),!0,!1,!1),sf(this,"/model.dat"),this.m(),this.L()});if(o.modelAssetBuffer instanceof Uint8Array)sf(this,o.modelAssetBuffer);else if(o.modelAssetBuffer)return async function(c){const f=[];for(var h=0;;){const{done:d,value:m}=await c.read();if(d)break;f.push(m),h+=m.length}if(f.length===0)return new Uint8Array(0);if(f.length===1)return f[0];c=new Uint8Array(h),h=0;for(const d of f)c.set(d,h),h+=d.length;return c}(o.modelAssetBuffer).then(c=>{sf(this,c),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca(t=>{e=R5(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((n,i)=>{this.H.push(Error(i))}),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,V0(this)}finishProcessing(){this.g.finishProcessing(),V0(this)}close(){this.B=void 0,this.g.closeGraph()}};function pi(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}rf.prototype.close=rf.prototype.close;class dy{constructor(t,n,i,a){this.g=t,this.h=n,this.m=i,this.l=a}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function q0(e,t,n){const i=e.g;if(n=pi(i.createShader(n),"Failed to create WebGL shader"),i.shaderSource(n,t),i.compileShader(n),!i.getShaderParameter(n,i.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${i.getShaderInfoLog(n)}`);return i.attachShader(e.h,n),n}function F0(e,t){const n=e.g,i=pi(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(i);const a=pi(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,a),n.enableVertexAttribArray(e.O),n.vertexAttribPointer(e.O,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const l=pi(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,l),n.enableVertexAttribArray(e.L),n.vertexAttribPointer(e.L,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(t?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new dy(n,i,a,l)}function uf(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function hy(e,t,n,i){return uf(e,t),e.h||(e.m(),e.D()),n?(e.u||(e.u=F0(e,!0)),n=e.u):(e.A||(e.A=F0(e,!1)),n=e.A),t.useProgram(e.h),n.bind(),e.l(),e=i(),n.g.bindVertexArray(null),e}function Y0(e,t,n){return uf(e,t),e=pi(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,n??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function X0(e,t,n){uf(e,t),e.B||(e.B=pi(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,n,0)}function my(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Q0=class{H(){return`
10
10
  precision mediump float;
11
11
  varying vec2 vTex;
12
12
  uniform sampler2D inputTexture;
13
13
  void main() {
14
14
  gl_FragColor = texture2D(inputTexture, vTex);
15
15
  }
16
- `}m(){const e=this.g;if(this.h=vt(e.createProgram(),"Failed to create WebGL program"),this.Z=Oc(this,`
16
+ `}m(){const e=this.g;if(this.h=pi(e.createProgram(),"Failed to create WebGL program"),this.X=q0(this,`
17
17
  attribute vec2 aVertex;
18
18
  attribute vec2 aTex;
19
19
  varying vec2 vTex;
20
20
  void main(void) {
21
21
  gl_Position = vec4(aVertex, 0.0, 1.0);
22
22
  vTex = aTex;
23
- }`,e.VERTEX_SHADER),this.Y=Oc(this,this.G(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.P=e.getAttribLocation(this.h,"aVertex"),this.J=e.getAttribLocation(this.h,"aTex")}C(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.Z),e.deleteShader(this.Y)}this.A&&this.g.deleteFramebuffer(this.A),this.v&&this.v.close(),this.s&&this.s.close()}};function _t(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Is(e){var t=_t(e,1);if(!t){if(t=_t(e,0))t=new Float32Array(t).map(i=>i/255);else{t=new Float32Array(e.width*e.height);const i=Sr(e);var r=Ms(e);if($i(r,i,Uc(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(e.width*e.height*4),i.readPixels(0,0,e.width,e.height,i.RGBA,i.FLOAT,r);for(let n=0,s=0;n<t.length;++n,s+=4)t[n]=r[s]}else i.readPixels(0,0,e.width,e.height,i.RED,i.FLOAT,t)}e.g.push(t)}return t}function Uc(e){let t=_t(e,2);if(!t){const r=Sr(e);t=Vc(e);const i=Is(e),n=Gc(e);r.texImage2D(r.TEXTURE_2D,0,n,e.width,e.height,0,r.RED,r.FLOAT,i),Ls(e)}return t}function Sr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=vt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Gc(e){if(e=Sr(e),!Wi)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Wi=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Wi=e.R16F}return Wi}function Ms(e){return e.l||(e.l=new Cs),e.l}function Vc(e){const t=Sr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=_t(e,2);return r||(r=Vi(Ms(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function Ls(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Wi,he=class{constructor(e,t,r,i,n,s,a){this.g=e,this.m=t,this.j=r,this.canvas=i,this.l=n,this.width=s,this.height=a,this.j&&--$c===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Da(){return!!_t(this,0)}ja(){return!!_t(this,1)}R(){return!!_t(this,2)}ia(){return(t=_t(e=this,0))||(t=Is(e),t=new Uint8Array(t.map(r=>255*r)),e.g.push(t)),t;var e,t}ha(){return Is(this)}N(){return Uc(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const i=Sr(this),n=Ms(this);i.activeTexture(i.TEXTURE1),r=Vi(n,i,this.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,r);const s=Gc(this);i.texImage2D(i.TEXTURE_2D,0,s,this.width,this.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),$i(n,i,r),js(n,i,!1,()=>{Vc(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),Ls(this)}),Ns(n),Ls(this)}}e.push(r)}return new he(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Sr(this).deleteTexture(_t(this,2)),$c=-1}};he.prototype.close=he.prototype.close,he.prototype.clone=he.prototype.clone,he.prototype.getAsWebGLTexture=he.prototype.N,he.prototype.getAsFloat32Array=he.prototype.ha,he.prototype.getAsUint8Array=he.prototype.ia,he.prototype.hasWebGLTexture=he.prototype.R,he.prototype.hasFloat32Array=he.prototype.ja,he.prototype.hasUint8Array=he.prototype.Da;var $c=250;function at(e,t){switch(t){case 0:return e.g.find(r=>r instanceof ImageData);case 1:return e.g.find(r=>typeof ImageBitmap<"u"&&r instanceof ImageBitmap);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Wc(e){var t=at(e,0);if(!t){t=Ar(e);const r=Hi(e),i=new Uint8Array(e.width*e.height*4);$i(r,t,zi(e)),t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,i),Ns(r),t=new ImageData(new Uint8ClampedArray(i.buffer),e.width,e.height),e.g.push(t)}return t}function zi(e){let t=at(e,2);if(!t){const r=Ar(e);t=qi(e);const i=at(e,1)||Wc(e);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,i),Xr(e)}return t}function Ar(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=vt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function Hi(e){return e.l||(e.l=new Cs),e.l}function qi(e){const t=Ar(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=at(e,2);return r||(r=Vi(Hi(e),t),e.g.push(r),e.m=!0),t.bindTexture(t.TEXTURE_2D,r),r}function Xr(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}function zc(e){const t=Ar(e);return js(Hi(e),t,!0,()=>function(r,i){const n=r.canvas;if(n.width===r.width&&n.height===r.height)return i();const s=n.width,a=n.height;return n.width=r.width,n.height=r.height,r=i(),n.width=s,n.height=a,r}(e,()=>{if(t.bindFramebuffer(t.FRAMEBUFFER,null),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),!(e.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return e.canvas.transferToImageBitmap()}))}var fe=class{constructor(e,t,r,i,n,s,a){this.g=e,this.j=t,this.m=r,this.canvas=i,this.l=n,this.width=s,this.height=a,(this.j||this.m)&&--Hc===0&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources.")}Ca(){return!!at(this,0)}ka(){return!!at(this,1)}R(){return!!at(this,2)}Aa(){return Wc(this)}za(){var e=at(this,1);return e||(zi(this),qi(this),e=zc(this),Xr(this),this.g.push(e),this.j=!0),e}N(){return zi(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof ImageData)r=new ImageData(t.data,this.width,this.height);else if(t instanceof WebGLTexture){const i=Ar(this),n=Hi(this);i.activeTexture(i.TEXTURE1),r=Vi(n,i),i.bindTexture(i.TEXTURE_2D,r),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.bindTexture(i.TEXTURE_2D,null),$i(n,i,r),js(n,i,!1,()=>{qi(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),Xr(this)}),Ns(n),Xr(this)}else{if(!(t instanceof ImageBitmap))throw Error(`Type is not supported: ${t}`);zi(this),qi(this),r=zc(this),Xr(this)}e.push(r)}return new fe(e,this.ka(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&at(this,1).close(),this.m&&Ar(this).deleteTexture(at(this,2)),Hc=-1}};fe.prototype.close=fe.prototype.close,fe.prototype.clone=fe.prototype.clone,fe.prototype.getAsWebGLTexture=fe.prototype.N,fe.prototype.getAsImageBitmap=fe.prototype.za,fe.prototype.getAsImageData=fe.prototype.Aa,fe.prototype.hasWebGLTexture=fe.prototype.R,fe.prototype.hasImageBitmap=fe.prototype.ka,fe.prototype.hasImageData=fe.prototype.Ca;var Hc=250;function tt(...e){return e.map(([t,r])=>({start:t,end:r}))}const Ld=function(e){return class extends e{Ha(){this.i._registerModelResourcesGraphService()}}}((qc=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Mc()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const r=e.length,i=this.i._malloc(r);this.i.HEAPU8.set(e,i),t?this.i._changeBinaryGraph(r,i):this.i._changeTextGraph(r,i),this.i._free(i)}configureAudio(e,t,r,i,n){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),E(this,i||"input_audio",s=>{E(this,n=n||"audio_header",a=>{this.i._configureAudio(s,a,e,t??0,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){ot(this,"__graph_config__",t=>{e(t)}),E(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,i,n){const s=4*e.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(e,this.g/4),E(this,i,a=>{this.i._addAudioToInputStream(this.g,t,r,a,n)})}addGpuBufferToStream(e,t,r){E(this,t,i=>{const[n,s]=Pc(this,e,i);this.i._addBoundTextureToStream(i,n,s,r)})}addBoolToStream(e,t,r){E(this,t,i=>{this.i._addBoolToInputStream(e,i,r)})}addDoubleToStream(e,t,r){E(this,t,i=>{this.i._addDoubleToInputStream(e,i,r)})}addFloatToStream(e,t,r){E(this,t,i=>{this.i._addFloatToInputStream(e,i,r)})}addIntToStream(e,t,r){E(this,t,i=>{this.i._addIntToInputStream(e,i,r)})}addUintToStream(e,t,r){E(this,t,i=>{this.i._addUintToInputStream(e,i,r)})}addStringToStream(e,t,r){E(this,t,i=>{E(this,e,n=>{this.i._addStringToInputStream(n,i,r)})})}addStringRecordToStream(e,t,r){E(this,t,i=>{Dc(this,Object.keys(e),n=>{Dc(this,Object.values(e),s=>{this.i._addFlatHashMapToInputStream(n,s,Object.keys(e).length,i,r)})})})}addProtoToStream(e,t,r,i){E(this,r,n=>{E(this,t,s=>{const a=this.i._malloc(e.length);this.i.HEAPU8.set(e,a),this.i._addProtoToInputStream(a,e.length,s,n,i),this.i._free(a)})})}addEmptyPacketToStream(e,t){E(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(n,s);this.i._addBoolVectorToInputStream(n,i,r)})}addDoubleVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(n,s);this.i._addDoubleVectorToInputStream(n,i,r)})}addFloatVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(n,s);this.i._addFloatVectorToInputStream(n,i,r)})}addIntVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(n,s);this.i._addIntVectorToInputStream(n,i,r)})}addUintVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(n,s);this.i._addUintVectorToInputStream(n,i,r)})}addStringVectorToStream(e,t,r){E(this,t,i=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const s of e)E(this,s,a=>{this.i._addStringVectorEntry(n,a)});this.i._addStringVectorToInputStream(n,i,r)})}addBoolToInputSidePacket(e,t){E(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){E(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){E(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){E(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addUintToInputSidePacket(e,t){E(this,t,r=>{this.i._addUintToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){E(this,t,r=>{E(this,e,i=>{this.i._addStringToInputSidePacket(i,r)})})}addProtoToInputSidePacket(e,t,r){E(this,r,i=>{E(this,t,n=>{const s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputSidePacket(s,e.length,n,i),this.i._free(s)})})}addBoolVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(const n of e)this.i._addBoolVectorEntry(i,n);this.i._addBoolVectorToInputSidePacket(i,r)})}addDoubleVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(const n of e)this.i._addDoubleVectorEntry(i,n);this.i._addDoubleVectorToInputSidePacket(i,r)})}addFloatVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(const n of e)this.i._addFloatVectorEntry(i,n);this.i._addFloatVectorToInputSidePacket(i,r)})}addIntVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(const n of e)this.i._addIntVectorEntry(i,n);this.i._addIntVectorToInputSidePacket(i,r)})}addUintVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(const n of e)this.i._addUintVectorEntry(i,n);this.i._addUintVectorToInputSidePacket(i,r)})}addStringVectorToInputSidePacket(e,t){E(this,t,r=>{const i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(const n of e)E(this,n,s=>{this.i._addStringVectorEntry(i,s)});this.i._addStringVectorToInputSidePacket(i,r)})}attachBoolListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachIntVectorListener(r)})}attachUintListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachUintListener(r)})}attachUintVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachUintVectorListener(r)})}attachDoubleListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){ot(this,e,t),E(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){Pt(this,e,t),E(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){ot(this,e,t),E(this,e,i=>{this.i._attachProtoListener(i,r||!1)})}attachProtoVectorListener(e,t,r){Pt(this,e,t),E(this,e,i=>{this.i._attachProtoVectorListener(i,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),ot(this,e,(i,n)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,n)}),E(this,e,i=>{this.i._attachAudioListener(i,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends qc{get ea(){return this.i}oa(e,t,r){E(this,t,i=>{const[n,s]=Pc(this,e,i);this.ea._addBoundTextureAsImageToStream(i,n,s,r)})}V(e,t){ot(this,e,t),E(this,e,r=>{this.ea._attachImageListener(r)})}ba(e,t){Pt(this,e,t),E(this,e,r=>{this.ea._attachImageVectorListener(r)})}}));var qc,Ve=class extends Ld{};async function I(e,t,r){return async function(i,n,s,a){return Id(i,n,s,a)}(e,r.canvas??(Mc()?void 0:document.createElement("canvas")),t,r)}function Yc(e,t,r,i){if(e.U){const s=new ec;if(r!=null&&r.regionOfInterest){if(!e.na)throw Error("This task doesn't support region-of-interest.");var n=r.regionOfInterest;if(n.left>=n.right||n.top>=n.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(n.left<0||n.top<0||n.right>1||n.bottom>1)throw Error("Expected RectF values to be in [0,1].");v(s,1,(n.left+n.right)/2),v(s,2,(n.top+n.bottom)/2),v(s,4,n.right-n.left),v(s,3,n.bottom-n.top)}else v(s,1,.5),v(s,2,.5),v(s,4,1),v(s,3,1);if(r!=null&&r.rotationDegrees){if((r==null?void 0:r.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(v(s,5,-Math.PI*r.rotationDegrees/180),(r==null?void 0:r.rotationDegrees)%180!=0){const[a,c]=Fc(t);r=ie(s,3)*c/a,n=ie(s,4)*a/c,v(s,4,r),v(s,3,n)}}e.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",e.U,i)}e.g.oa(t,e.Z,i??performance.now()),e.finishProcessing()}function $e(e,t,r){var i;if((i=e.baseOptions)!=null&&i.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Yc(e,t,r,e.B+1)}function ct(e,t,r,i){var n;if(!((n=e.baseOptions)!=null&&n.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Yc(e,t,r,i)}function Tr(e,t,r,i){var n=t.data;const s=t.width,a=s*(t=t.height);if((n instanceof Uint8Array||n instanceof Float32Array)&&n.length!==a)throw Error("Unsupported channel count: "+n.length/a);return e=new he([n],r,!1,e.g.i.canvas,e.P,s,t),i?e.clone():e}var Se=class extends As{constructor(e,t,r,i){super(e),this.g=e,this.Z=t,this.U=r,this.na=i,this.P=new Cs}l(e,t=!0){if("runningMode"in e&&$r(this.baseOptions,2,!!e.runningMode&&e.runningMode!=="IMAGE"),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Se.prototype.close=Se.prototype.close;var We=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},S(e=this.h=new Ri,0,1,t=new q),v(this.h,2,.5),v(this.h,3,.3)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&v(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&v(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}D(e,t){return this.j={detections:[]},$e(this,e,t),this.j}F(e,t,r){return this.j={detections:[]},ct(this,e,r,t),this.j}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect_in"),D(e,"detections");const t=new Ie;Je(t,pd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect_in"),L(r,"DETECTIONS:detections"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("detections",(i,n)=>{for(const s of i)i=Qa(s),this.j.detections.push(jc(i));x(this,n)}),this.g.attachEmptyPacketListener("detections",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};We.prototype.detectForVideo=We.prototype.F,We.prototype.detect=We.prototype.D,We.prototype.setOptions=We.prototype.o,We.createFromModelPath=async function(e,t){return I(We,e,{baseOptions:{modelAssetPath:t}})},We.createFromModelBuffer=function(e,t){return I(We,e,{baseOptions:{modelAssetBuffer:t}})},We.createFromOptions=function(e,t){return I(We,e,t)};var Fs=tt([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),Ps=tt([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),Ds=tt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),Kc=tt([474,475],[475,476],[476,477],[477,474]),Rs=tt([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),Os=tt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),Xc=tt([469,470],[470,471],[471,472],[472,469]),Bs=tt([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),Qc=[...Fs,...Ps,...Ds,...Rs,...Os,...Bs],Jc=tt([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function Zc(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var X=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,S(e=this.h=new cc,0,1,t=new q),this.v=new ac,S(this.h,0,3,this.v),this.s=new Ri,S(this.h,0,2,this.s),st(this.s,4,1),v(this.s,2,.5),v(this.v,2,.5),v(this.h,4,.5)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"numFaces"in e&&st(this.s,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&v(this.s,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&v(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&v(this.v,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}D(e,t){return Zc(this),$e(this,e,t),this.j}F(e,t,r){return Zc(this),ct(this,e,r,t),this.j}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"face_landmarks");const t=new Ie;Je(t,yd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("face_landmarks",(i,n)=>{for(const s of i)i=qr(s),this.j.faceLandmarks.push(Oi(i));x(this,n)}),this.g.attachEmptyPacketListener("face_landmarks",i=>{x(this,i)}),this.outputFaceBlendshapes&&(D(e,"blendshapes"),L(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(i,n)=>{if(this.outputFaceBlendshapes)for(const s of i)i=Fi(s),this.j.faceBlendshapes.push(Es(i.g()??[]));x(this,n)}),this.g.attachEmptyPacketListener("blendshapes",i=>{x(this,i)})),this.outputFacialTransformationMatrixes&&(D(e,"face_geometry"),L(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(i,n)=>{if(this.outputFacialTransformationMatrixes)for(const s of i)(i=P(xd(s),ld,2))&&this.j.facialTransformationMatrixes.push({rows:Ue(i,1)??0??0,columns:Ue(i,2)??0??0,data:qt(i,3,jt,Ht()).slice()??[]});x(this,n)}),this.g.attachEmptyPacketListener("face_geometry",i=>{x(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};X.prototype.detectForVideo=X.prototype.F,X.prototype.detect=X.prototype.D,X.prototype.setOptions=X.prototype.o,X.createFromModelPath=function(e,t){return I(X,e,{baseOptions:{modelAssetPath:t}})},X.createFromModelBuffer=function(e,t){return I(X,e,{baseOptions:{modelAssetBuffer:t}})},X.createFromOptions=function(e,t){return I(X,e,t)},X.FACE_LANDMARKS_LIPS=Fs,X.FACE_LANDMARKS_LEFT_EYE=Ps,X.FACE_LANDMARKS_LEFT_EYEBROW=Ds,X.FACE_LANDMARKS_LEFT_IRIS=Kc,X.FACE_LANDMARKS_RIGHT_EYE=Rs,X.FACE_LANDMARKS_RIGHT_EYEBROW=Os,X.FACE_LANDMARKS_RIGHT_IRIS=Xc,X.FACE_LANDMARKS_FACE_OVAL=Bs,X.FACE_LANDMARKS_CONTOURS=Qc,X.FACE_LANDMARKS_TESSELATION=Jc;var lt=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!0),S(e=this.j=new uc,0,1,t=new q)}get baseOptions(){return P(this.j,q,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){return super.l(e)}Ka(e,t,r){const i=typeof t!="function"?t:{};if(this.h=typeof t=="function"?t:r,$e(this,e,i??{}),!this.h)return this.s}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"stylized_image");const t=new Ie;Je(t,bd,this.j);const r=new ye;Me(r,"mediapipe.tasks.vision.face_stylizer.FaceStylizerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"STYLIZED_IMAGE:stylized_image"),r.o(t),Le(e,r),this.g.V("stylized_image",(i,n)=>{var s=!this.h,a=i.data,c=i.width;const l=c*(i=i.height);if(a instanceof Uint8Array)if(a.length===3*l){const u=new Uint8ClampedArray(4*l);for(let h=0;h<l;++h)u[4*h]=a[3*h],u[4*h+1]=a[3*h+1],u[4*h+2]=a[3*h+2],u[4*h+3]=255;a=new ImageData(u,c,i)}else{if(a.length!==4*l)throw Error("Unsupported channel count: "+a.length/l);a=new ImageData(new Uint8ClampedArray(a.buffer,a.byteOffset,a.length),c,i)}else if(!(a instanceof WebGLTexture))throw Error(`Unsupported format: ${a.constructor.name}`);c=new fe([a],!1,!1,this.g.i.canvas,this.P,c,i),this.s=s=s?c.clone():c,this.h&&this.h(s),x(this,n)}),this.g.attachEmptyPacketListener("stylized_image",i=>{this.s=null,this.h&&this.h(null),x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};lt.prototype.stylize=lt.prototype.Ka,lt.prototype.setOptions=lt.prototype.o,lt.createFromModelPath=function(e,t){return I(lt,e,{baseOptions:{modelAssetPath:t}})},lt.createFromModelBuffer=function(e,t){return I(lt,e,{baseOptions:{modelAssetBuffer:t}})},lt.createFromOptions=function(e,t){return I(lt,e,t)};var Us=tt([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function el(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function tl(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function rl(e,t=!0){const r=[];for(const n of e){var i=Fi(n);e=[];for(const s of i.g())i=t&&Ue(s,1)!=null?Ue(s,1)??0:-1,e.push({score:ie(s,2)??0,index:i,categoryName:Ge(s,3)??""??"",displayName:Ge(s,4)??""??""});r.push(e)}return r}var Fe=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],S(e=this.j=new fc,0,1,t=new q),this.s=new xs,S(this.j,0,2,this.s),this.C=new ps,S(this.s,0,3,this.C),this.v=new hc,S(this.s,0,2,this.v),this.h=new vd,S(this.j,0,3,this.h),v(this.v,2,.5),v(this.s,4,.5),v(this.C,2,.5)}get baseOptions(){return P(this.j,q,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){var n,s,a,c;if(st(this.v,3,e.numHands??1),"minHandDetectionConfidence"in e&&v(this.v,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&v(this.s,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&v(this.C,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new kr,r=t,i=ks(e.cannedGesturesClassifierOptions,(n=P(this.h,kr,3))==null?void 0:n.h());S(r,0,2,i),S(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((s=P(this.h,kr,3))==null||s.g());return e.customGesturesClassifierOptions?(S(r=t=new kr,0,2,i=ks(e.customGesturesClassifierOptions,(a=P(this.h,kr,4))==null?void 0:a.h())),S(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((c=P(this.h,kr,4))==null||c.g()),this.l(e)}Fa(e,t){return el(this),$e(this,e,t),tl(this)}Ga(e,t,r){return el(this),ct(this,e,r,t),tl(this)}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"hand_gestures"),D(e,"hand_landmarks"),D(e,"world_hand_landmarks"),D(e,"handedness");const t=new Ie;Je(t,_d,this.j);const r=new ye;Me(r,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"HAND_GESTURES:hand_gestures"),L(r,"LANDMARKS:hand_landmarks"),L(r,"WORLD_LANDMARKS:world_hand_landmarks"),L(r,"HANDEDNESS:handedness"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("hand_landmarks",(i,n)=>{for(const s of i){i=qr(s);const a=[];for(const c of pt(i,Za,1))a.push({x:ie(c,1)??0,y:ie(c,2)??0,z:ie(c,3)??0,visibility:ie(c,4)??0});this.landmarks.push(a)}x(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{x(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,n)=>{for(const s of i){i=_r(s);const a=[];for(const c of pt(i,Ja,1))a.push({x:ie(c,1)??0,y:ie(c,2)??0,z:ie(c,3)??0,visibility:ie(c,4)??0});this.worldLandmarks.push(a)}x(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{x(this,i)}),this.g.attachProtoVectorListener("hand_gestures",(i,n)=>{this.gestures.push(...rl(i,!1)),x(this,n)}),this.g.attachEmptyPacketListener("hand_gestures",i=>{x(this,i)}),this.g.attachProtoVectorListener("handedness",(i,n)=>{this.handedness.push(...rl(i)),x(this,n)}),this.g.attachEmptyPacketListener("handedness",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function il(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Fe.prototype.recognizeForVideo=Fe.prototype.Ga,Fe.prototype.recognize=Fe.prototype.Fa,Fe.prototype.setOptions=Fe.prototype.o,Fe.createFromModelPath=function(e,t){return I(Fe,e,{baseOptions:{modelAssetPath:t}})},Fe.createFromModelBuffer=function(e,t){return I(Fe,e,{baseOptions:{modelAssetBuffer:t}})},Fe.createFromOptions=function(e,t){return I(Fe,e,t)},Fe.HAND_CONNECTIONS=Us;var Pe=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],S(e=this.h=new xs,0,1,t=new q),this.s=new ps,S(this.h,0,3,this.s),this.j=new hc,S(this.h,0,2,this.j),st(this.j,3,1),v(this.j,2,.5),v(this.s,2,.5),v(this.h,4,.5)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"numHands"in e&&st(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&v(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&v(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&v(this.s,2,e.minHandPresenceConfidence??.5),this.l(e)}D(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],$e(this,e,t),il(this)}F(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],ct(this,e,r,t),il(this)}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"hand_landmarks"),D(e,"world_hand_landmarks"),D(e,"handedness");const t=new Ie;Je(t,kd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"LANDMARKS:hand_landmarks"),L(r,"WORLD_LANDMARKS:world_hand_landmarks"),L(r,"HANDEDNESS:handedness"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("hand_landmarks",(i,n)=>{for(const s of i)i=qr(s),this.landmarks.push(Oi(i));x(this,n)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{x(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,n)=>{for(const s of i)i=_r(s),this.worldLandmarks.push(Yr(i));x(this,n)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{x(this,i)}),this.g.attachProtoVectorListener("handedness",(i,n)=>{var s=this.handedness,a=s.push;const c=[];for(const l of i){i=Fi(l);const u=[];for(const h of i.g())u.push({score:ie(h,2)??0,index:Ue(h,1)??0??-1,categoryName:Ge(h,3)??""??"",displayName:Ge(h,4)??""??""});c.push(u)}a.call(s,...c),x(this,n)}),this.g.attachEmptyPacketListener("handedness",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Pe.prototype.detectForVideo=Pe.prototype.F,Pe.prototype.detect=Pe.prototype.D,Pe.prototype.setOptions=Pe.prototype.o,Pe.createFromModelPath=function(e,t){return I(Pe,e,{baseOptions:{modelAssetPath:t}})},Pe.createFromModelBuffer=function(e,t){return I(Pe,e,{baseOptions:{modelAssetBuffer:t}})},Pe.createFromOptions=function(e,t){return I(Pe,e,t)},Pe.HAND_CONNECTIONS=Us;var nl=tt([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function sl(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function ol(e){try{if(!e.C)return e.h;e.C(e.h)}finally{Gi(e)}}function Yi(e,t){e=qr(e),t.push(Oi(e))}var Y=class extends Se{constructor(e,t){super(new Ve(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,S(e=this.j=new yc,0,1,t=new q),this.K=new ps,S(this.j,0,2,this.K),this.Y=new Ed,S(this.j,0,3,this.Y),this.s=new Ri,S(this.j,0,4,this.s),this.H=new ac,S(this.j,0,5,this.H),this.v=new pc,S(this.j,0,6,this.v),this.L=new xc,S(this.j,0,7,this.L),v(this.s,2,.5),v(this.s,3,.3),v(this.H,2,.5),v(this.v,2,.5),v(this.v,3,.3),v(this.L,2,.5),v(this.K,2,.5)}get baseOptions(){return P(this.j,q,1)}set baseOptions(e){S(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&v(this.s,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&v(this.s,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&v(this.H,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&v(this.v,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&v(this.v,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&v(this.L,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&v(this.K,2,e.minHandLandmarksConfidence??.5),this.l(e)}D(e,t,r){const i=typeof t!="function"?t:{};return this.C=typeof t=="function"?t:r,sl(this),$e(this,e,i),ol(this)}F(e,t,r,i){const n=typeof r!="function"?r:{};return this.C=typeof r=="function"?r:i,sl(this),ct(this,e,n,t),ol(this)}m(){var e=new Ee;z(e,"input_frames_image"),D(e,"pose_landmarks"),D(e,"pose_world_landmarks"),D(e,"face_landmarks"),D(e,"left_hand_landmarks"),D(e,"left_hand_world_landmarks"),D(e,"right_hand_landmarks"),D(e,"right_hand_world_landmarks");const t=new Ie,r=new Pa;Bn(r,1,ur("type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),""),function(n,s){if(s!=null)if(Array.isArray(s))$(n,2,mi(s,Pn,void 0,void 0,!1));else{if(!(typeof s=="string"||s instanceof wt||$t(s)))throw Error("invalid value in Any.value field: "+s+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Bn(n,2,_n(s,!1),Wt())}}(r,this.j.g());const i=new ye;Me(i,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),bi(i,8,Pa,r),W(i,"IMAGE:input_frames_image"),L(i,"POSE_LANDMARKS:pose_landmarks"),L(i,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),L(i,"FACE_LANDMARKS:face_landmarks"),L(i,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),L(i,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),L(i,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),L(i,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),i.o(t),Le(e,i),Ui(this,e),this.g.attachProtoListener("pose_landmarks",(n,s)=>{Yi(n,this.h.poseLandmarks),x(this,s)}),this.g.attachEmptyPacketListener("pose_landmarks",n=>{x(this,n)}),this.g.attachProtoListener("pose_world_landmarks",(n,s)=>{var a=this.h.poseWorldLandmarks;n=_r(n),a.push(Yr(n)),x(this,s)}),this.g.attachEmptyPacketListener("pose_world_landmarks",n=>{x(this,n)}),this.outputPoseSegmentationMasks&&(L(i,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Er(this,"pose_segmentation_mask"),this.g.V("pose_segmentation_mask",(n,s)=>{this.h.poseSegmentationMasks=[Tr(this,n,!0,!this.C)],x(this,s)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",n=>{this.h.poseSegmentationMasks=[],x(this,n)})),this.g.attachProtoListener("face_landmarks",(n,s)=>{Yi(n,this.h.faceLandmarks),x(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{x(this,n)}),this.outputFaceBlendshapes&&(D(e,"extra_blendshapes"),L(i,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(n,s)=>{var a=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(n=Fi(n),a.push(Es(n.g()??[]))),x(this,s)}),this.g.attachEmptyPacketListener("extra_blendshapes",n=>{x(this,n)})),this.g.attachProtoListener("left_hand_landmarks",(n,s)=>{Yi(n,this.h.leftHandLandmarks),x(this,s)}),this.g.attachEmptyPacketListener("left_hand_landmarks",n=>{x(this,n)}),this.g.attachProtoListener("left_hand_world_landmarks",(n,s)=>{var a=this.h.leftHandWorldLandmarks;n=_r(n),a.push(Yr(n)),x(this,s)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",n=>{x(this,n)}),this.g.attachProtoListener("right_hand_landmarks",(n,s)=>{Yi(n,this.h.rightHandLandmarks),x(this,s)}),this.g.attachEmptyPacketListener("right_hand_landmarks",n=>{x(this,n)}),this.g.attachProtoListener("right_hand_world_landmarks",(n,s)=>{var a=this.h.rightHandWorldLandmarks;n=_r(n),a.push(Yr(n)),x(this,s)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",n=>{x(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Y.prototype.detectForVideo=Y.prototype.F,Y.prototype.detect=Y.prototype.D,Y.prototype.setOptions=Y.prototype.o,Y.createFromModelPath=function(e,t){return I(Y,e,{baseOptions:{modelAssetPath:t}})},Y.createFromModelBuffer=function(e,t){return I(Y,e,{baseOptions:{modelAssetBuffer:t}})},Y.createFromOptions=function(e,t){return I(Y,e,t)},Y.HAND_CONNECTIONS=Us,Y.POSE_CONNECTIONS=nl,Y.FACE_LANDMARKS_LIPS=Fs,Y.FACE_LANDMARKS_LEFT_EYE=Ps,Y.FACE_LANDMARKS_LEFT_EYEBROW=Ds,Y.FACE_LANDMARKS_LEFT_IRIS=Kc,Y.FACE_LANDMARKS_RIGHT_EYE=Rs,Y.FACE_LANDMARKS_RIGHT_EYEBROW=Os,Y.FACE_LANDMARKS_RIGHT_IRIS=Xc,Y.FACE_LANDMARKS_FACE_OVAL=Bs,Y.FACE_LANDMARKS_CONTOURS=Qc,Y.FACE_LANDMARKS_TESSELATION=Jc;var ze=class extends Se{constructor(e,t){super(new Ve(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},S(e=this.h=new bc,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return S(this.h,0,2,ks(e,P(this.h,ws,2))),this.l(e)}qa(e,t){return this.j={classifications:[]},$e(this,e,t),this.j}ra(e,t,r){return this.j={classifications:[]},ct(this,e,r,t),this.j}m(){var e=new Ee;z(e,"input_image"),z(e,"norm_rect"),D(e,"classifications");const t=new Ie;Je(t,Sd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),W(r,"IMAGE:input_image"),W(r,"NORM_RECT:norm_rect"),L(r,"CLASSIFICATIONS:classifications"),r.o(t),Le(e,r),this.g.attachProtoListener("classifications",(i,n)=>{this.j=function(s){const a={classifications:pt(s,dd,1).map(c=>{var l;return Es(((l=P(c,Ka,4))==null?void 0:l.g())??[],Ue(c,2)??0,Ge(c,3)??"")})};return Cn(hr(s,2))!=null&&(a.timestampMs=Cn(hr(s,2))??0),a}(hd(i)),x(this,n)}),this.g.attachEmptyPacketListener("classifications",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ze.prototype.classifyForVideo=ze.prototype.ra,ze.prototype.classify=ze.prototype.qa,ze.prototype.setOptions=ze.prototype.o,ze.createFromModelPath=function(e,t){return I(ze,e,{baseOptions:{modelAssetPath:t}})},ze.createFromModelBuffer=function(e,t){return I(ze,e,{baseOptions:{modelAssetBuffer:t}})},ze.createFromOptions=function(e,t){return I(ze,e,t)};var De=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!0),this.h=new vc,this.embeddings={embeddings:[]},S(e=this.h,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){var t=this.h,r=P(this.h,nc,2);return r=r?r.clone():new nc,e.l2Normalize!==void 0?$r(r,1,e.l2Normalize):"l2Normalize"in e&&$(r,1),e.quantize!==void 0?$r(r,2,e.quantize):"quantize"in e&&$(r,2),S(t,0,2,r),this.l(e)}xa(e,t){return $e(this,e,t),this.embeddings}ya(e,t,r){return ct(this,e,r,t),this.embeddings}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"embeddings_out");const t=new Ie;Je(t,Ad,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"EMBEDDINGS:embeddings_out"),r.o(t),Le(e,r),this.g.attachProtoListener("embeddings_out",(i,n)=>{i=md(i),this.embeddings=function(s){return{embeddings:pt(s,wd,1).map(a=>{var l,u;const c={headIndex:Ue(a,3)??0??-1,headName:Ge(a,4)??""??""};if(ra(a,tc,Un(a,1))!==void 0)a=qt(a=P(a,tc,Un(a,1)),1,jt,Ht()),c.floatEmbedding=a.slice();else{const h=new Uint8Array(0);c.quantizedEmbedding=((u=(l=P(a,fd,Un(a,2)))==null?void 0:l.ma())==null?void 0:u.h())??h}return c}),timestampMs:Cn(hr(s,2))??0}}(i),x(this,n)}),this.g.attachEmptyPacketListener("embeddings_out",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};De.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Cc(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Cc(Nc(e.quantizedEmbedding),Nc(t.quantizedEmbedding))}return e},De.prototype.embedForVideo=De.prototype.ya,De.prototype.embed=De.prototype.xa,De.prototype.setOptions=De.prototype.o,De.createFromModelPath=function(e,t){return I(De,e,{baseOptions:{modelAssetPath:t}})},De.createFromModelBuffer=function(e,t){return I(De,e,{baseOptions:{modelAssetBuffer:t}})},De.createFromOptions=function(e,t){return I(De,e,t)};var Gs=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};function al(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function cl(e){try{const t=new Gs(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{Gi(e)}}Gs.prototype.close=Gs.prototype.close;var Ae=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.s=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new _s,this.v=new _c,S(this.h,0,3,this.v),S(e=this.h,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?$(this.h,2,ur(e.displayNamesLocale)):"displayNamesLocale"in e&&$(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}J(){(function(e){var r,i;const t=pt(e.ca(),ye,1).filter(n=>(Ge(n,1)??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.s=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((i=(r=P(t[0],Ie,7))==null?void 0:r.l())==null?void 0:i.g())??new Map).forEach((n,s)=>{e.s[Number(s)]=Ge(n,1)??""})})(this)}segment(e,t,r){const i=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,al(this),$e(this,e,i),cl(this)}Ia(e,t,r,i){const n=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:i,al(this),ct(this,e,n,t),cl(this)}Ba(){return this.s}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect");const t=new Ie;Je(t,Sc,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),r.o(t),Le(e,r),Ui(this,e),this.outputConfidenceMasks&&(D(e,"confidence_masks"),L(r,"CONFIDENCE_MASKS:confidence_masks"),Er(this,"confidence_masks"),this.g.ba("confidence_masks",(i,n)=>{this.confidenceMasks=i.map(s=>Tr(this,s,!0,!this.j)),x(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],x(this,i)})),this.outputCategoryMask&&(D(e,"category_mask"),L(r,"CATEGORY_MASK:category_mask"),Er(this,"category_mask"),this.g.V("category_mask",(i,n)=>{this.categoryMask=Tr(this,i,!1,!this.j),x(this,n)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,x(this,i)})),D(e,"quality_scores"),L(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,n)=>{this.qualityScores=i,x(this,n)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ae.prototype.getLabels=Ae.prototype.Ba,Ae.prototype.segmentForVideo=Ae.prototype.Ia,Ae.prototype.segment=Ae.prototype.segment,Ae.prototype.setOptions=Ae.prototype.o,Ae.createFromModelPath=function(e,t){return I(Ae,e,{baseOptions:{modelAssetPath:t}})},Ae.createFromModelBuffer=function(e,t){return I(Ae,e,{baseOptions:{modelAssetBuffer:t}})},Ae.createFromOptions=function(e,t){return I(Ae,e,t)};var Vs=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};Vs.prototype.close=Vs.prototype.close;var Fd=class extends y{constructor(e){super(e)}},jr=[0,ee,-2],Ki=[0,bt,-3,H,bt,-1],ll=[0,Ki],ul=[0,Ki,ee,-1],$s=class extends y{constructor(e){super(e)}},dl=[0,bt,-1,H],Pd=class extends y{constructor(e){super(e)}},hl=class extends y{constructor(e){super(e)}},Ws=[1,2,3,4,5,6,7,8,9,10,14,15],fl=class extends y{constructor(e){super(e)}};fl.prototype.g=Li([0,ue,[0,Ws,O,Ki,O,[0,Ki,jr],O,ll,O,[0,ll,jr],O,dl,O,[0,bt,-3,H,Ce],O,[0,bt,-3,H],O,[0,R,bt,-2,H,ee,H,-1,2,bt,jr],O,ul,O,[0,ul,jr],bt,jr,R,O,[0,bt,-3,H,jr,-1],O,[0,ue,dl]],R,[0,R,ee,-1,H]]);var ut=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new _s,this.s=new _c,S(this.h,0,3,this.s),S(e=this.h,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,i){const n=typeof r!="function"?r:{};this.j=typeof r=="function"?r:i,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.B+1,i=new fl;const s=new hl;var a=new Fd;if(st(a,1,255),S(s,0,12,a),t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var c=new $s;$r(c,3,!0),v(c,1,t.keypoint.x),v(c,2,t.keypoint.y),Vr(s,5,Ws,c)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");for(c of(a=new Pd,t.scribble))$r(t=new $s,3,!0),v(t,1,c.x),v(t,2,c.y),bi(a,1,$s,t);Vr(s,15,Ws,a)}bi(i,1,hl,s),this.g.addProtoToStream(i.g(),"drishti.RenderData","roi_in",r),$e(this,e,n);e:{try{const u=new Vs(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var l=u;break e}this.j(u)}finally{Gi(this)}l=void 0}return l}m(){var e=new Ee;z(e,"image_in"),z(e,"roi_in"),z(e,"norm_rect_in");const t=new Ie;Je(t,Sc,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraph"),W(r,"IMAGE:image_in"),W(r,"ROI:roi_in"),W(r,"NORM_RECT:norm_rect_in"),r.o(t),Le(e,r),Ui(this,e),this.outputConfidenceMasks&&(D(e,"confidence_masks"),L(r,"CONFIDENCE_MASKS:confidence_masks"),Er(this,"confidence_masks"),this.g.ba("confidence_masks",(i,n)=>{this.confidenceMasks=i.map(s=>Tr(this,s,!0,!this.j)),x(this,n)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],x(this,i)})),this.outputCategoryMask&&(D(e,"category_mask"),L(r,"CATEGORY_MASK:category_mask"),Er(this,"category_mask"),this.g.V("category_mask",(i,n)=>{this.categoryMask=Tr(this,i,!1,!this.j),x(this,n)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,x(this,i)})),D(e,"quality_scores"),L(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,n)=>{this.qualityScores=i,x(this,n)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ut.prototype.segment=ut.prototype.segment,ut.prototype.setOptions=ut.prototype.o,ut.createFromModelPath=function(e,t){return I(ut,e,{baseOptions:{modelAssetPath:t}})},ut.createFromModelBuffer=function(e,t){return I(ut,e,{baseOptions:{modelAssetBuffer:t}})},ut.createFromOptions=function(e,t){return I(ut,e,t)};var He=class extends Se{constructor(e,t){super(new Ve(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},S(e=this.h=new Ac,0,1,t=new q)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?$(this.h,2,ur(e.displayNamesLocale)):"displayNamesLocale"in e&&$(this.h,2),e.maxResults!==void 0?st(this.h,3,e.maxResults):"maxResults"in e&&$(this.h,3),e.scoreThreshold!==void 0?v(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&$(this.h,4),e.categoryAllowlist!==void 0?vi(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&$(this.h,5),e.categoryDenylist!==void 0?vi(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&$(this.h,6),this.l(e)}D(e,t){return this.j={detections:[]},$e(this,e,t),this.j}F(e,t,r){return this.j={detections:[]},ct(this,e,r,t),this.j}m(){var e=new Ee;z(e,"input_frame_gpu"),z(e,"norm_rect"),D(e,"detections");const t=new Ie;Je(t,jd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.ObjectDetectorGraph"),W(r,"IMAGE:input_frame_gpu"),W(r,"NORM_RECT:norm_rect"),L(r,"DETECTIONS:detections"),r.o(t),Le(e,r),this.g.attachProtoVectorListener("detections",(i,n)=>{for(const s of i)i=Qa(s),this.j.detections.push(jc(i));x(this,n)}),this.g.attachEmptyPacketListener("detections",i=>{x(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};He.prototype.detectForVideo=He.prototype.F,He.prototype.detect=He.prototype.D,He.prototype.setOptions=He.prototype.o,He.createFromModelPath=async function(e,t){return I(He,e,{baseOptions:{modelAssetPath:t}})},He.createFromModelBuffer=function(e,t){return I(He,e,{baseOptions:{modelAssetBuffer:t}})},He.createFromOptions=function(e,t){return I(He,e,t)};var zs=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function wl(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function ml(e){try{const t=new zs(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.s)return t;e.s(t)}finally{Gi(e)}}zs.prototype.close=zs.prototype.close;var Re=class extends Se{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,S(e=this.h=new Tc,0,1,t=new q),this.v=new xc,S(this.h,0,3,this.v),this.j=new pc,S(this.h,0,2,this.j),st(this.j,4,1),v(this.j,2,.5),v(this.v,2,.5),v(this.h,4,.5)}get baseOptions(){return P(this.h,q,1)}set baseOptions(e){S(this.h,0,1,e)}o(e){return"numPoses"in e&&st(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&v(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&v(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&v(this.v,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}D(e,t,r){const i=typeof t!="function"?t:{};return this.s=typeof t=="function"?t:r,wl(this),$e(this,e,i),ml(this)}F(e,t,r,i){const n=typeof r!="function"?r:{};return this.s=typeof r=="function"?r:i,wl(this),ct(this,e,n,t),ml(this)}m(){var e=new Ee;z(e,"image_in"),z(e,"norm_rect"),D(e,"normalized_landmarks"),D(e,"world_landmarks"),D(e,"segmentation_masks");const t=new Ie;Je(t,Nd,this.h);const r=new ye;Me(r,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),W(r,"IMAGE:image_in"),W(r,"NORM_RECT:norm_rect"),L(r,"NORM_LANDMARKS:normalized_landmarks"),L(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Le(e,r),Ui(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(i,n)=>{this.landmarks=[];for(const s of i)i=qr(s),this.landmarks.push(Oi(i));x(this,n)}),this.g.attachEmptyPacketListener("normalized_landmarks",i=>{this.landmarks=[],x(this,i)}),this.g.attachProtoVectorListener("world_landmarks",(i,n)=>{this.worldLandmarks=[];for(const s of i)i=_r(s),this.worldLandmarks.push(Yr(i));x(this,n)}),this.g.attachEmptyPacketListener("world_landmarks",i=>{this.worldLandmarks=[],x(this,i)}),this.outputSegmentationMasks&&(L(r,"SEGMENTATION_MASK:segmentation_masks"),Er(this,"segmentation_masks"),this.g.ba("segmentation_masks",(i,n)=>{this.segmentationMasks=i.map(s=>Tr(this,s,!0,!this.s)),x(this,n)}),this.g.attachEmptyPacketListener("segmentation_masks",i=>{this.segmentationMasks=[],x(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Re.prototype.detectForVideo=Re.prototype.F,Re.prototype.detect=Re.prototype.D,Re.prototype.setOptions=Re.prototype.o,Re.createFromModelPath=function(e,t){return I(Re,e,{baseOptions:{modelAssetPath:t}})},Re.createFromModelBuffer=function(e,t){return I(Re,e,{baseOptions:{modelAssetBuffer:t}})},Re.createFromOptions=function(e,t){return I(Re,e,t)},Re.POSE_CONNECTIONS=nl;const Xi="https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/latest/face_landmarker.task",Dd="https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm",Rd=()=>{const e=d.useRef(null),[t,r]=d.useState(!1),[i,n]=d.useState("Initializing..."),[s,a]=d.useState(0),[c,l]=d.useState(!1);d.useEffect(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(w=>{console.log("ServiceWorker registered:",w)}).catch(w=>{console.log("ServiceWorker registration failed:",w)})},[]);const u=async()=>"caches"in window?await(await caches.open("mediapipe-models-v1")).match(Xi)!==void 0:!1,h=async()=>{try{const w=await fetch(Xi),m=w.headers.get("content-length"),g=m?parseInt(m,10):0;if(!w.body)throw new Error("No response body");const b=w.body.getReader();let _=0;const p=[];for(;;){const{done:A,value:F}=await b.read();if(A)break;if(p.push(F),_+=F.length,g){const T=Math.round(_/g*100);a(T),n(`Downloading model... ${T}%`)}}return"caches"in window&&await(await caches.open("mediapipe-models-v1")).put(Xi,new Response(new Blob(p),{headers:{"Content-Type":"application/octet-stream"}})),!0}catch(w){return console.error("Failed to preload model:",w),!1}};return d.useEffect(()=>{(async()=>{try{n("Checking cached models..."),await u()?n("Using cached model..."):(n("Model not cached. Downloading..."),await h()),n("Loading MediaPipe WASM...");const g=await Xt.forVisionTasks(Dd);n("Creating face landmarker...");const b=await X.createFromOptions(g,{baseOptions:{modelAssetPath:Xi,delegate:"GPU"},runningMode:"VIDEO",outputFaceBlendshapes:!0,numFaces:2});e.current=b,r(!0),n("Model loaded successfully ✅")}catch(m){console.error("Model init error:",m),n(`Error: ${m==null?void 0:m.message}`),(m==null?void 0:m.name)==="NotAllowedError"&&l(!0)}})()},[]),{faceLandmarkerRef:e,isModelLoaded:t,statusMessage:i,setStatusMessage:n,loadingProgress:s,permissionDenied:c,clearCache:async()=>{"caches"in window&&(await caches.delete("mediapipe-models-v1"),n("Cache cleared. Please refresh to re-download models."))}}},Od=()=>{const[e,t]=d.useState(0),r=d.useRef({lastTime:0,frames:0,fps:0}),i=d.useCallback(()=>{const n=performance.now(),s=r.current;if(s.frames++,n-s.lastTime>=1e3){const a=Math.round(s.frames*1e3/(n-s.lastTime));t(a),s.frames=0,s.lastTime=n}},[]);return{fps:e,updateFPS:i}},Bd=()=>{const e=d.useRef({value:100,isLookingAway:!1}),t=d.useCallback((s,a,c,l)=>{if(!s||!c||!a)return;const u=s.getContext("2d");if(!u)return;const{width:h,height:f}=s;if(u.clearRect(0,0,h,f),u.drawImage(a,0,0,h,f),l){u.fillStyle="#00FF00";for(const w of c)u.fillRect(w.x*h-.5,w.y*f-.5,1,1)}},[]),r=d.useCallback(s=>{const a=e.current.value/100,c=100,l=20,u=20,h=40;s.fillStyle="rgba(0, 0, 0, 0.3)",s.fillRect(u,h,l,c),s.fillStyle=`rgba(${Math.floor(255*(1-a))}, ${Math.floor(255*a)}, 0, 0.8)`;const f=c*a;s.fillRect(u,h+c-f,l,f),s.fillStyle="#FFFFFF",s.fillRect(u,h+c*(1-a),l,2)},[]),i=d.useCallback((s,a,c,l,u,h,f)=>{if(t(s,a,c,l),u&&h&&f){const w=s.getContext("2d");w&&r(w)}},[t,r]),n=d.useCallback((s,a)=>{const c=s.getContext("2d");c&&(c.clearRect(0,0,s.width,s.height),c.drawImage(a,0,0,s.width,s.height))},[]);return{drawLandmarks:t,drawEngagementBar:r,drawWithEngagementBar:i,clearCanvas:n,engagementRef:e}},Ud=50,Gd=()=>{const[e,t]=d.useState(100),[r,i]=d.useState(!1),n=d.useRef(0),s=d.useCallback((a,c,l)=>{if(!l||a.length<468)return;const u=a[33],h=a[263],f=a[1];if(!u||!h||!f)return;const w=(u.x+h.x)*.5,m=(u.y+h.y)*.5,g=w-c.x,b=m-c.y,_=Math.sqrt(g*g+b*b),p=Math.abs(f.y-c.noseY)*100,A=Math.abs(f.x-c.noseX)*100,F=Math.max(0,100-(_*200+p+A)),T=F<Ud,C=performance.now();return C-n.current>100&&(t(F),i(T),n.current=C),{engagement:F,isLookingAway:T}},[]);return{engagement:e,isLookingAway:r,analyzeGaze:s,setEngagement:t,setIsLookingAway:i}},Vd=.05,$d=()=>{const[e,t]=d.useState(!1),[r,i]=d.useState(!1),n=d.useCallback((c,l)=>Math.sqrt(Math.pow(c.x-l.x,2)+Math.pow(c.y-l.y,2)),[]),s=d.useCallback((c,l)=>{if(!c||!l)return 0;const u=[1,33,263,61,291,10,152];let h=0,f=0;const w=l[33],m=l[263],g=c[33],b=c[263];if(!w||!m||!g||!b)return 0;const _=n(w,m),p=n(g,b);if(_===0||p===0)return 0;for(const F of u){const T=l[F],C=c[F];if(T&&C){const M=w.x+(C.x-g.x)*_/p,B=w.y+(C.y-g.y)*_/p;h+=n(T,{x:M,y:B}),f++}}return f===0?0:h/f},[n]),a=d.useCallback((c,l,u,h)=>{if(!c.faceLandmarks||c.faceLandmarks.length===0)return l?(h("Reference face not detected."),i(!0),t(!1)):i(!1),null;if(l&&u){let f=null,w=0;for(const m of c.faceLandmarks)s(m,u)<Vd&&(f=m,w++);return w===1?(t(!1),i(!1),h("Reference face tracked."),f):w>1?(t(!0),i(!1),h("Multiple matching faces detected. Tracking suspended."),null):(t(!1),i(!0),h("Reference face not detected."),null)}else{c.faceLandmarks.length>1?(t(!0),h("Multiple faces detected. Set reference for single face tracking.")):(t(!1),h("No reference set. Detecting first face."));const f=c.faceLandmarks[0];return!f||f.length<468?null:f}},[s]);return{multipleFacesDetected:e,referenceFaceNotDetected:r,analyzeFace:a,setMultipleFacesDetected:t,setReferenceFaceNotDetected:i}},Wd=1e3,zd=(e,t)=>{const[r,i]=d.useState(!1),[n,s]=d.useState("face_detected"),{incrementGazeViolation:a}=Zs(),{multipleFacesDetected:c,referenceFaceNotDetected:l,isLookingAway:u}=e;d.useEffect(()=>{let w;return(u||c||l)&&t?w=setTimeout(()=>{i(!0),u?(s("looking_away"),a("looking_away")):c?(s("multiple_faces"),a("multiple_faces")):l&&(s("no_face_detected"),a("no_face_detected"))},Wd):(i(!1),s("face_detected")),()=>{clearTimeout(w)}},[u,c,l,t,a]);const h=d.useCallback(()=>c?"multiple_faces":l?"no_face_detected":u?"looking_away":"face_detected",[c,l,u]),f=d.useCallback(()=>{i(!1),s("face_detected")},[]);return{showGazeWarningModal:r,faceDetectionState:n,getWarningType:h,closeWarningModal:f,setShowGazeWarningModal:i,setFaceDetectionState:s}};class te extends Error{constructor(t,r,i=!1){super(t),this.code=r,this.recoverable=i,this.name="STTError"}}class Hd{constructor(t={}){Oe(this,"config");Oe(this,"mediaRecorder",null);Oe(this,"audioChunks",[]);Oe(this,"recordingStream",null);Oe(this,"autoStopTimeoutId",null);this.config={baseUrl:"http://localhost:8000",provider:"groq",model:"whisper-large-v3-turbo",language:"en",includeTimestamps:!1,temperature:0,...t}}updateConfig(t){this.config={...this.config,...t}}isRecordingSupported(){return!!(navigator.mediaDevices&&typeof navigator.mediaDevices.getUserMedia=="function"&&window.MediaRecorder)}async startRecording(t,r){var i;if(!this.isRecordingSupported())throw new te("Audio recording is not supported in this browser","RECORDING_NOT_SUPPORTED",!1);if(this.isRecording())throw new te("Recording is already in progress","ALREADY_RECORDING",!0);try{this.recordingStream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:44100}}),this.audioChunks=[];const n=this.getSupportedMimeType();this.mediaRecorder=new MediaRecorder(this.recordingStream,{mimeType:n}),this.mediaRecorder.ondataavailable=s=>{var a;s.data.size>0&&(this.audioChunks.push(s.data),(a=r==null?void 0:r.onDataAvailable)==null||a.call(r,s.data))},this.mediaRecorder.onstop=()=>{var s;(s=r==null?void 0:r.onStop)==null||s.call(r)},this.mediaRecorder.onerror=s=>{var c;const a=new te(`Recording failed: ${s.error}`,"RECORDING_ERROR",!0);(c=r==null?void 0:r.onError)==null||c.call(r,a),this.cleanup()},this.mediaRecorder.start(100),(i=r==null?void 0:r.onStart)==null||i.call(r),t&&t>0&&(this.autoStopTimeoutId=setTimeout(()=>{this.isRecording()&&this.stopRecording()},t*1e3))}catch(n){if(this.cleanup(),n instanceof Error){if(n.name==="NotAllowedError"||n.name==="PermissionDeniedError")throw new te("Microphone permission was denied","PERMISSION_DENIED",!1);if(n.name==="NotFoundError")throw new te("No microphone found","NO_MICROPHONE",!1)}throw new te(`Failed to start recording: ${n instanceof Error?n.message:String(n)}`,"START_RECORDING_FAILED",!0)}}async stopRecording(){if(this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null),!this.mediaRecorder||!this.isRecording())throw new te("No active recording to stop","NO_ACTIVE_RECORDING",!1);return new Promise((t,r)=>{if(!this.mediaRecorder){r(new te("MediaRecorder is null","MEDIARECORDER_NULL",!1));return}const i=this.mediaRecorder,n=()=>{try{const s=i.mimeType||"audio/webm",a=new Blob(this.audioChunks,{type:s});this.cleanup(),t(a)}catch(s){r(new te(`Failed to create audio blob: ${s instanceof Error?s.message:String(s)}`,"BLOB_CREATION_FAILED",!1))}};i.addEventListener("stop",n,{once:!0}),i.stop()})}async transcribe(t){const{audioBlob:r}=t;if(!r||r.size===0)throw new te("Audio blob is empty or invalid","INVALID_AUDIO",!1);try{const i=new FormData,n=new File([r],"recording.wav",{type:r.type||"audio/wav"});if(i.append("file",n),i.append("qna_id",this.config.qnaId||""),!this.config.interviewId)throw new te("Interview ID is missing from configuration","MISSING_INTERVIEW_ID",!1);const s=await Bt(`${this.config.baseUrl}${Gt.TRANSCRIBE_ANSWER(this.config.interviewId)}`,{method:"POST",headers:{accept:"application/json","X-STT-Provider":this.config.provider||"groq",...this.config.authToken&&{Authorization:`Bearer ${this.config.authToken}`}},body:i},{attempts:1,backoff:"exponential",baseDelay:1e3,maxDelay:3e3,jitter:!0});if(!s.ok){const c=await s.text();let l=`STT request failed: ${s.status} ${s.statusText}`;try{const u=JSON.parse(c);l=u.message||u.error||l}catch{l=c||l}throw new te(l,`HTTP_${s.status}`,s.status>=500)}return{transcript:(await s.json()).data.transcribed_text??""}}catch(i){throw i instanceof te?i:new te(`Transcription failed: ${i instanceof Error?i.message:String(i)}`,"TRANSCRIPTION_FAILED",!0)}}cancelRecording(){this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null),this.mediaRecorder&&this.isRecording()&&this.mediaRecorder.stop(),this.cleanup()}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}getSupportedMimeType(){const t=["audio/webm","audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4","audio/wav"];for(const r of t)if(MediaRecorder.isTypeSupported(r))return r;return"audio/webm"}getRecordingStream(){return this.recordingStream}cleanup(){this.recordingStream&&(this.recordingStream.getTracks().forEach(t=>t.stop()),this.recordingStream=null),this.mediaRecorder=null,this.audioChunks=[],this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null)}}const Nr=new Hd,qd=(e,t,r,i)=>{const n=d.useRef(null);return d.useEffect(()=>{if(!t)return;const s=async()=>{try{const l=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:640},height:{ideal:480},facingMode:"user"}});e.current&&(e.current.srcObject=l,e.current.onloadeddata=()=>{r()})}catch(l){console.error("Camera access error:",l),i("Camera access failed")}},a=n.current,c=e.current;return s(),()=>{a&&cancelAnimationFrame(a),c!=null&&c.srcObject&&c.srcObject.getTracks().forEach(u=>u.stop())}},[t,r]),d.useEffect(()=>{const s=Nr.getRecordingStream();if(s&&e.current){e.current.srcObject=s;const a=s.getVideoTracks(),c=s.getAudioTracks(),l=()=>{console.log("Media track ended - permission may have been revoked")};[...a,...c].forEach(u=>{u.addEventListener("ended",l)})}},[]),{animationFrameRef:n}},Yd=(e,t,r,i,n,s,a,c,l,u,h,f,w,m,g)=>{const b=d.useRef(null),_=d.useCallback(()=>{var T;const p=e.current,A=t.current,F=r.current;if(!p||p.readyState<2||!F||!A){b.current=requestAnimationFrame(_);return}i();try{const C=performance.now(),M=F.detectForVideo(p,C);if(((T=M.faceLandmarks)==null?void 0:T.length)>0){g(!1);const B=n(M,l,u.current,m);B?(s(A,p,B,h,f,w,l),l&&w&&c(B,u.current,w)):a(A,p)}else a(A,p),l?(g(!0),m("Reference face not detected.")):g(!1)}catch(C){console.error("Face detection error:",C)}b.current=requestAnimationFrame(_)},[e,t,r,i,n,s,a,c,l,u,h,f,w,m,g]);return{renderLoop:_,animationFrameRef:b}},Kd=(e,t,r,i)=>{const{referenceSet:n,referenceRef:s,setReferenceData:a}=Zs(),c=d.useRef(s),l=d.useCallback(()=>{c.current=s},[s]),u=d.useCallback(()=>{var w;const h=e.current,f=t.current;if(console.log({faceLandmarker:h,video:f}),!(!h||!f))try{const m=performance.now(),g=h.detectForVideo(f,m);if((w=g.faceLandmarks)!=null&&w[0]){const b=g.faceLandmarks[0],_=b[33],p=b[263],A=b[1];_&&p&&A&&(c.current={x:(_.x+p.x)*.5,y:(_.y+p.y)*.5,noseX:A.x,noseY:A.y},a(!0,c.current),r("Reference set. Gaze tracking active."),console.log("Reference set. Gaze tracking active.",c.current),i&&i())}}catch(m){console.error("Set reference error:",m),r("Failed to set reference")}},[e,t,r,a,i]);return{referenceSet:n,referenceRef:c,setReference:u,syncReference:l}},gl=d.forwardRef(({className:e="",interviewId:t="",interview_duration:r,showProctoringUI:i=!0,onSetReference:n},s)=>{var El;const{authToken:a}=ro(),c=a?Wl(a):null,l=lo(),{borderRadius:u}=rr(),h=u??18,{proctoring:f}=cn(),w=!!(f!=null&&f.gazeAnalysisEnabled),[m,g]=d.useState(!1),[b,_]=d.useState((f==null?void 0:f.showLandmarks)??!1),[p,A]=d.useState(i&&((f==null?void 0:f.showEngagementBar)??!0)),[F,T]=d.useState(w),C=d.useRef(null),M=d.useRef(null),B=d.useRef(null),G=d.useRef(null),Q=d.useCallback(async ft=>{var tn;const Jr=C.current,ve=B.current;if(!Jr||!ve)return;const Cr=ve.getContext("2d");if(!Cr)return;ve.width=Jr.videoWidth,ve.height=Jr.videoHeight,Cr.save(),Cr.scale(-1,1),Cr.drawImage(Jr,-ve.width,0,ve.width,ve.height),Cr.restore();const Zr=await new Promise(er=>ve.toBlob(er,"image/jpeg"));if(Zr&&t)try{const er=`${ft}-${Date.now()}.jpeg`,_e=await l.requestScreenshotUploadUrl(t,er);_e.data&&_e.data.upload_url&&(await l.uploadScreenshot((tn=_e==null?void 0:_e.data)==null?void 0:tn.upload_url,Zr),_e.data.asset_id&&await l.confirmScreenshotUpload(_e.data.asset_id))}catch(er){console.error(`Failed to upload screenshot for ${ft}:`,er)}},[l,t]),{faceLandmarkerRef:oe,isModelLoaded:qe,statusMessage:de,setStatusMessage:Ye,loadingProgress:Te,permissionDenied:be,clearCache:kt}=Rd(),{fps:dt,updateFPS:ge}=Od(),{drawWithEngagementBar:Qt,clearCanvas:Ke,engagementRef:re}=Bd(),{engagement:Xe,isLookingAway:V,analyzeGaze:ht,setEngagement:j,setIsLookingAway:J}=Gd(),{multipleFacesDetected:Dt,referenceFaceNotDetected:Rt,analyzeFace:Jt,setMultipleFacesDetected:Ji,setReferenceFaceNotDetected:Zt}=$d(),{referenceSet:Qr,referenceRef:Zi,setReference:N,syncReference:je}=Kd(oe,C,Ye,n),rt={multipleFacesDetected:Dt,referenceFaceNotDetected:Rt,isLookingAway:V},{showGazeWarningModal:en,getWarningType:Ch,closeWarningModal:vl,setShowGazeWarningModal:_l,setFaceDetectionState:kl}=zd(rt,w),{renderLoop:Ih}=Yd(C,M,oe,ge,Jt,Qt,Ke,ht,Qr,Zi,b,p,w,Ye,Zt);qd(C,qe,Ih,Ye),d.useEffect(()=>{je()},[je]),d.useEffect(()=>{re&&re.current&&(re.current.value=Xe,re.current.isLookingAway=V)},[Xe,V,re]);const Mh=d.useCallback(ft=>{T(ft),ft||(j(100),J(!1))},[j,J]),Lh=d.useCallback(()=>{J(!1),Ji(!1),Zt(!1),kl("face_detected"),_l(!1),vl()},[J,Ji,Zt,kl,_l,vl]),Fh={engagement:Xe,fps:dt,isLookingAway:V,multipleFacesDetected:Dt,referenceFaceNotDetected:Rt};return d.useEffect(()=>{const ft=[];return(async()=>{try{const ve=await navigator.mediaDevices.getUserMedia({video:!0,audio:!1});G.current=ve,C.current&&(C.current.srcObject=ve);const Zr=(r??ti)*60*1e3/3,tn=[0,1,2].map((_e,Ot)=>({label:`capture-${Ot+1}`,start:Ot*Zr,end:(Ot+1)*Zr})),er=(_e,Ot)=>_e===Ot?_e:Math.random()*(Ot-_e)+_e;tn.forEach(({label:_e,start:Ot,end:Ph},Dh)=>{let Ys;Dh===0?Ys=3e3:Ys=er(Ot,Ph),ft.push(setTimeout(()=>{Q(_e)},Ys))})}catch(ve){console.error("Error accessing camera:",ve)}})(),()=>{G.current&&G.current.getTracks().forEach(ve=>ve.stop()),ft.forEach(clearTimeout)}},[Q]),d.useImperativeHandle(s,()=>({setReference:()=>{N()},stopCamera:()=>{G.current&&(G.current.getTracks().forEach(ft=>ft.stop()),G.current=null)}}),[N]),o.jsxs("div",{className:`iw-relative iw-h-full ${e}`,children:[be?o.jsxs("div",{className:"iw-rounded-md iw-border iw-border-red-600 iw-p-5 iw-text-red-600",children:[o.jsx("h2",{children:"Camera Permission Denied"}),o.jsx("p",{children:"Please allow camera access to use this application."})]}):o.jsx("div",{className:"iw-flex iw-w-full iw-h-full iw-flex-wrap iw-gap-5",children:o.jsxs("div",{className:"iw-relative iw-flex-1",children:[o.jsx("video",{ref:C,autoPlay:!0,playsInline:!0,muted:!0,className:"iw-w-full iw-h-full iw-object-cover iw-scale-75 iw-rounded-r-xl iw-min-h-[200px] iw-max-h-[600px] iw-aspect-video",style:{transform:"scaleX(-1)"}}),w&&o.jsx("canvas",{ref:M,width:320,height:240,className:"iw-absolute iw-top-0 iw-left-0 iw-w-full iw-h-full iw-object-cover iw-scale-75 iw-rounded-r-xl iw-min-h-[200px] iw-max-h-[600px] iw-aspect-video",style:{transform:"scaleX(-1)",borderRadius:h}}),o.jsx("canvas",{ref:B,style:{display:"none"}}),i&&o.jsxs("div",{className:"iw-absolute iw-top-4 iw-left-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-black/40 iw-px-4 iw-py-2 iw-backdrop-blur-md",children:[o.jsx("div",{className:"iw-size-2 iw-animate-pulse iw-rounded-full iw-bg-red-500"}),o.jsx("span",{className:"iw-font-medium iw-text-white",children:"Recording"})]}),i&&((El=c==null?void 0:c.data)==null?void 0:El.user_name)&&o.jsx("div",{className:"iw-absolute iw-z-50 iw-bottom-4 iw-right-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-black/40 iw-px-4 iw-py-2 iw-backdrop-blur-md",children:o.jsx("span",{className:"iw-font-medium iw-text-white",children:c.data.user_name})}),i&&o.jsx("div",{className:"iw-absolute iw-bottom-4 iw-right-4",children:o.jsx(lu,{showControls:(f==null?void 0:f.showControls)??!1,isBubbleOpen:m,setIsBubbleOpen:g,setReference:N,clearCache:kt,isModelLoaded:qe,gazeAnalysisEnabled:F&&w,referenceSet:Qr,showLandmarks:b,setShowLandmarks:_,showEngagementBar:p,setShowEngagementBar:A,handleToggleGazeAnalysis:Mh,stats:Fh,statusMessage:de,loadingProgress:Te})})]})}),w&&en&&o.jsx(au,{isOpen:en,onClose:Lh,warningType:Ch()})]})}),Xd=["Do not refresh or reload the page during your assessment","Refrain from switching tabs or opening other applications while the session is in progress","Ensure your face remains clearly visible on camera at all times","Avoid frequent distractions or leaving your seat during the session","Do not disable or interfere with audio/video monitoring"],Qd=({isOpen:e,onStart:t,onClose:r,gazeEnabled:i=!1,videoFeedRef:n,interviewId:s="",interview_duration:a=ti})=>{var ht;const c=d.useRef(null),l=d.useRef(null),{baseColor:u,borderRadius:h}=rr(),[f,w]=d.useState(!1),[m,g]=d.useState(!1),[b,_]=d.useState(!1),[p,A]=d.useState(!1),[F,T]=d.useState(!1),[C,M]=d.useState(null),[B,G]=d.useState(!1),Q=d.useRef(null),oe=d.useRef(null),qe=j=>{Q.current=j,n&&(typeof n=="function"?n(j):n.current=j)},de=u??"#2563eb",Ye=oo(de),Te=h??18,be=(j,J)=>j.startsWith("#")&&j.length===7?`${j}${J}`:j,kt=[`radial-gradient(120% 85% at 50% 125%, ${be(de,"34")} 0%, transparent 70%)`,`radial-gradient(90% 70% at 10% 130%, ${be(de,"24")} 0%, transparent 72%)`,`radial-gradient(90% 70% at 90% 130%, ${be(de,"24")} 0%, transparent 72%)`,`repeating-linear-gradient(135deg, ${be(de,"14")} 0, ${be(de,"14")} 16px, transparent 16px, transparent 32px)`].join(", "),dt=f?{label:"Camera & microphone ready",toneClass:"iw-bg-white/15 iw-text-white",dotClass:"iw-bg-emerald-400"}:B?{label:"Checking device access…",toneClass:"iw-bg-white/15 iw-text-white",dotClass:"iw-bg-amber-300"}:{label:"Allow access to continue",toneClass:"iw-bg-white/15 iw-text-white",dotClass:"iw-bg-rose-300"},ge=f?{badge:"Ready",toneClass:"iw-bg-emerald-50 iw-text-emerald-600",cameraCopy:"Framing looks good for identity verification.",micCopy:"We can hear you clearly for your responses."}:B?{badge:"Checking",toneClass:"iw-bg-amber-50 iw-text-amber-600",cameraCopy:"Hang tight while we confirm camera access.",micCopy:"Listening for microphone permission from your browser."}:{badge:"Action needed",toneClass:"iw-bg-rose-50 iw-text-rose-600",cameraCopy:"Grant camera access to continue with the interview.",micCopy:"Enable microphone access so we can capture your answers."},Qt=[{label:"Camera feed",description:ge.cameraCopy,status:ge.badge,toneClass:ge.toneClass,Icon:co},{label:"Microphone input",description:ge.micCopy,status:ge.badge,toneClass:ge.toneClass,Icon:Hl}],Ke=()=>{l.current&&(l.current.getTracks().forEach(j=>j.stop()),l.current=null)},re=async()=>{G(!0),M(null);try{const j=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:1280},height:{ideal:720}},audio:!0});l.current=j,c.current&&(c.current.srcObject=j),w(!0)}catch(j){console.error("Media permission error:",j);let J="Unable to access camera or microphone.";(j==null?void 0:j.name)==="NotAllowedError"?J="Permissions denied. Please allow access to camera and microphone.":(j==null?void 0:j.name)==="NotFoundError"?J="No camera/microphone found. Please connect a device and retry.":j!=null&&j.message&&(J=j.message),w(!1),M(J)}finally{G(!1)}};if(d.useEffect(()=>{if(!e){Ke();return}return re(),()=>Ke()},[e]),d.useEffect(()=>()=>{oe.current&&(clearInterval(oe.current),oe.current=null)},[]),!e)return null;const Xe=()=>{i?_(!0):(t(),Ke())},V=async()=>{A(!0);const j=()=>{var J;return(J=Q.current)==null?void 0:J.setReference()};j(),oe.current&&clearInterval(oe.current),oe.current=setInterval(j,500)};return o.jsxs("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-gray-900/25 iw-backdrop-blur-md iw-p-4",children:[o.jsxs("div",{className:" iw-w-full iw-max-w-[920px] iw-max-h-[96vh] iw-overflow-auto iw-rounded-3xl iw-bg-white iw-shadow-[0_40px_80px_-28px_rgba(15,23,42,0.25)]",children:[o.jsxs("div",{className:"iw-relative iw-overflow-hidden",style:{background:Ye},children:[o.jsx("div",{"aria-hidden":!0,className:"iw-absolute iw-pointer-events-none",style:{top:-90,right:-100,width:240,height:240,background:"radial-gradient(circle, rgba(255,255,255,0.6), transparent 70%)",filter:"blur(12px)"}}),o.jsx("div",{"aria-hidden":!0,className:"iw-absolute iw-pointer-events-none",style:{bottom:-110,left:-60,width:220,height:220,background:"radial-gradient(circle, rgba(255,255,255,0.35), transparent 70%)",filter:"blur(14px)"}}),o.jsxs("div",{className:"iw-relative iw-grid md:iw-grid-cols-[minmax(0,1fr)_auto] iw-items-start iw-gap-6 iw-px-6 iw-py-7",children:[o.jsx("div",{className:"iw-flex iw-flex-col iw-gap-4 iw-text-white",children:o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-4",children:[o.jsx("div",{className:"iw-flex iw-h-12 iw-w-12 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-white/15 iw-shadow-inner",children:o.jsx(ao,{className:"iw-h-6 iw-w-6"})}),o.jsxs("div",{children:[o.jsx("p",{className:"iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-white/70",children:"Pre-interview checklist"}),o.jsx("h2",{className:"iw-mt-1 iw-text-xl iw-font-semibold iw-leading-tight",children:"Final checks before you go live"}),o.jsx("p",{className:"iw-mt-2 iw-text-sm iw-text-white/80",children:"Align your space, confirm device access, and step confidently into your secure session."})]})]})}),o.jsx("div",{className:"iw-flex iw-items-start iw-justify-end",children:o.jsxs("div",{className:`iw-inline-flex iw-items-center iw-gap-2 iw-rounded-full iw-bg-white/10 iw-px-4 iw-py-1.5 iw-text-xs iw-font-medium iw-text-white/85 iw-backdrop-blur-sm ${dt.toneClass}`,children:[o.jsx("span",{className:`iw-inline-flex iw-h-2 iw-w-2 iw-rounded-full ${dt.dotClass}`}),dt.label]})}),r&&o.jsx("button",{"aria-label":"Close",className:"iw-absolute iw-top-5 iw-right-5 iw-text-white/70 transition-colors hover:iw-text-white",onClick:()=>{Ke(),r==null||r()},children:"✕"})]})]}),o.jsxs("div",{className:"iw-relative iw-flex iw-flex-col iw-gap-6 iw-px-6 iw-pb-8 iw-pt-6",children:[o.jsxs("div",{className:"iw-grid xl:iw-grid-cols-[0.95fr_1.05fr] iw-gap-6",children:[o.jsx("section",{className:"iw-flex iw-flex-col iw-gap-5",children:o.jsxs("div",{className:"iw-rounded-2xl iw-border iw-border-slate-100 iw-bg-white iw-p-5 iw-shadow-sm",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between",children:[o.jsx("h3",{className:"iw-text-sm iw-font-semibold iw-text-slate-900",children:"Proctoring guidelines"}),o.jsx("span",{className:"iw-text-[11px] iw-font-medium iw-uppercase iw-tracking-wide iw-text-slate-400",children:"Required"})]}),o.jsx("ul",{className:"iw-mt-5 iw-flex iw-flex-col iw-gap-4",children:Xd.map((j,J)=>o.jsx("li",{className:"iw-group iw-overflow-hidden iw-rounded-xl iw-border iw-border-slate-100 iw-bg-slate-50/60 iw-p-4 iw-transition-all hover:iw-border-slate-200 hover:iw-bg-white",children:o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3",children:[o.jsx("span",{className:"iw-flex iw-h-8 iw-w-8 iw-flex-none iw-items-center iw-justify-center iw-rounded-full iw-text-sm iw-font-semibold iw-text-white",style:{background:Ye},children:J+1}),o.jsx("span",{className:"iw-text-sm iw-text-slate-600",children:j})]})},j))})]})}),o.jsxs("section",{className:"iw-flex iw-flex-col iw-gap-5",children:[o.jsxs("div",{className:"iw-relative iw-flex iw-flex-col iw-gap-6 iw-overflow-hidden iw-rounded-3xl iw-bg-white ",style:{borderRadius:Te},children:[o.jsx("div",{className:"iw-relative iw-z-10 iw-rounded-2xl iw-border iw-border-slate-200 iw-bg-slate-50/80 iw-p-3",children:i&&(F||p)?o.jsx(gl,{ref:qe,interviewId:s,interview_duration:a,showProctoringUI:!1,onSetReference:()=>{oe.current&&(clearInterval(oe.current),oe.current=null),A(!1),t()}}):o.jsx("video",{ref:c,autoPlay:!0,playsInline:!0,muted:!0,className:"iw-h-64 iw-w-full iw-rounded-2xl iw-object-cover",style:{transform:"scaleX(-1)",borderRadius:Te}})}),o.jsx("div",{className:"iw-relative iw-grid iw-grid-cols-2 iw-gap-4 iw-px-1",children:!b&&!F?o.jsxs(o.Fragment,{children:[o.jsx(no,{onClick:re,disabled:B,variant:"outline",size:"sm",className:"iw-font-medium",style:{borderColor:de,borderRadius:Te,color:de},children:f?"Recheck permissions":"Enable camera & mic"}),o.jsx(Qe,{onClick:Xe,disabled:!f,className:"iw-h-10 iw-px-6 iw-text-sm",style:{backgroundColor:de},children:"Proceed"})]}):i&&(b&&!F?o.jsx(Qe,{onClick:()=>g(!0),disabled:!f,className:"iw-h-10 iw-px-6 iw-text-sm iw-col-span-2",style:{backgroundColor:de},children:"Calibrate Face Position"}):o.jsxs(Qe,{onClick:V,disabled:p||!f,className:"iw-h-10 iw-px-6 iw-text-sm iw-col-span-2",style:{backgroundColor:de},children:[p?"Calibrating":"Start Calibration",p&&o.jsx("span",{className:"iw-ml-2 iw-animate-spin iw-inline-block iw-border-2 iw-border-t-transparent iw-border-stone-200 iw-size-4 iw-rounded-full","aria-label":"loading"})]}))})]}),i&&F?o.jsxs("span",{className:"iw-text-slate-700 iw-text-center iw-text-md",children:["Sit upright and look directly into the camera, then press the",o.jsx("span",{className:"iw-font-semibold",children:" Start Calibration "}),"button. Proper calibration is required and incorrect setup may affect your assessment."]}):o.jsx("ul",{className:"iw-grid sm:iw-grid-cols-1 iw-gap-3",children:Qt.map(({Icon:j,label:J,description:Dt,status:Rt,toneClass:Jt})=>o.jsx("li",{className:"iw-rounded-2xl iw-border iw-border-slate-200/65 iw-bg-white iw-p-4 iw-shadow-sm iw-transition-all hover:iw-border-slate-200",children:o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3",children:[o.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-flex-none iw-items-center iw-justify-center iw-rounded-xl iw-bg-slate-100",children:o.jsx(j,{className:"iw-h-5 iw-w-5 iw-text-slate-600"})}),o.jsxs("div",{className:"iw-flex-1",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between iw-gap-3",children:[o.jsx("p",{className:"iw-text-sm iw-font-medium iw-text-slate-800",children:J}),o.jsx("span",{className:`iw-rounded-full iw-px-3 iw-py-1 iw-text-[11px] iw-font-semibold ${Jt}`,children:Rt})]}),o.jsx("p",{className:"iw-mt-1.5 iw-text-xs iw-text-slate-500",children:Dt})]})]})},J))}),C&&o.jsx("div",{className:"iw-rounded-lg iw-border iw-border-rose-200 iw-bg-rose-50 iw-px-3 iw-py-2 iw-text-xs iw-text-rose-600",children:C}),!((ht=navigator.mediaDevices)!=null&&ht.getUserMedia)&&o.jsx("div",{className:"iw-rounded-lg iw-border iw-border-amber-200 iw-bg-amber-50 iw-px-3 iw-py-2 iw-text-xs iw-text-amber-700",children:"Your browser does not support media devices. Please use a modern browser like Chrome, Edge, or Firefox."})]})]}),o.jsx("div",{className:" iw-rounded-2xl iw-border iw-border-dashed iw-border-slate-200 iw-bg-slate-50/85 iw-px-5 iw-py-4 iw-text-center",children:o.jsx("div",{className:"iw-text-xs iw-text-slate-500",children:"Your session is monitored to protect exam integrity. Continuing confirms you have reviewed and accept these safeguards."})}),o.jsx("div",{"aria-hidden":!0,className:"iw-pointer-events-none iw-absolute iw-inset-x-0 iw-bottom-1 iw-h-20",style:{backgroundImage:kt,backgroundSize:"100% 120%, 100% 120%, 100% 120%, 32px 32px",backgroundPosition:"center bottom, left 95% bottom, right 95% bottom, center bottom",backgroundRepeat:"no-repeat, no-repeat, no-repeat, repeat",opacity:.9,transform:"translateY(4px)",maskImage:"linear-gradient(to top, rgba(0,0,0,0.92), transparent)",WebkitMaskImage:"linear-gradient(to top, rgba(0,0,0,0.92), transparent)"}})]})]}),o.jsx(Kl,{isOpen:m,onDecline:()=>g(!1),onContinue:()=>{g(!1),Ke(),T(!0)}})]})};var se=(e=>(e.IDLE="idle",e.FETCHING_QUESTION="fetching_question",e.READING_QUESTION="reading_question",e.THINKING="thinking",e.ANSWERING="answering",e.TRANSCRIBING="transcribing",e.EDITING="editing",e.SUBMITTING="submitting",e.COMPLETED="completed",e))(se||{});const Jd={thinkingDuration:30,answeringDuration:120,editingDuration:30},Zd={idle:{next:"fetching_question"},fetching_question:{next:"reading_question"},reading_question:{next:"thinking"},thinking:{next:"answering",duration:30},answering:{next:"transcribing",duration:120},transcribing:{next:"editing"},editing:{next:"submitting",duration:30},submitting:{next:"completed"},completed:{next:"completed"}};class eh{constructor(t={},r={}){Oe(this,"config");Oe(this,"state");Oe(this,"phaseIntervalId",null);Oe(this,"globalIntervalId",null);Oe(this,"callbacks");this.config={...Jd,...t},this.callbacks=r,this.state={phase:"idle",currentPhaseTimeRemaining:0,totalTimeElapsed:0,currentQuestionNumber:0}}getState(){return{...this.state}}startQuestion(){this.state.currentQuestionNumber===0&&this.startGlobalTimer(),this.state.currentQuestionNumber=this.state.currentQuestionNumber+1,this.state.phase="fetching_question",this.notifyChange()}nextPhase(){const t=this.state.phase,r=Zd[t];if(!r)return;this.stopPhaseTimer(),this.state.phase=r.next;const i=this.getDurationForPhase(r.next);i>0?(this.state.currentPhaseTimeRemaining=i,this.startPhaseTimer()):this.state.currentPhaseTimeRemaining=0,this.notifyChange()}completeInterview(){var t,r;this.stopGlobalTimer(),this.stopPhaseTimer(),this.state.phase="completed",(r=(t=this.callbacks).onInterviewEnd)==null||r.call(t),this.notifyChange()}destroy(){this.stopPhaseTimer(),this.stopGlobalTimer()}getDurationForPhase(t){switch(t){case"thinking":return this.config.thinkingDuration;case"answering":return this.config.answeringDuration;case"editing":return this.config.editingDuration;default:return 0}}startGlobalTimer(){this.globalIntervalId=setInterval(()=>{var t,r;this.state.totalTimeElapsed++,(r=(t=this.callbacks).onTick)==null||r.call(t,this.getState())},1e3)}stopGlobalTimer(){this.globalIntervalId&&(clearInterval(this.globalIntervalId),this.globalIntervalId=null)}startPhaseTimer(){this.phaseIntervalId=setInterval(()=>{this.state.currentPhaseTimeRemaining--,this.state.currentPhaseTimeRemaining<=0&&this.nextPhase()},1e3)}stopPhaseTimer(){this.phaseIntervalId&&(clearInterval(this.phaseIntervalId),this.phaseIntervalId=null)}notifyChange(){var t,r;(r=(t=this.callbacks).onPhaseChange)==null||r.call(t,this.state.phase,this.getState())}}function th(e={}){const{config:t={},callbacks:r={}}=e,i=d.useRef(null);i.current||(i.current=new eh(t,{}));const n=i.current,[s,a]=d.useState(n.getState()),c=d.useCallback(()=>{a(n.getState())},[n]);d.useEffect(()=>{const f={onPhaseChange:(w,m)=>{var g;c(),(g=r.onPhaseChange)==null||g.call(r,w,m)},onTick:w=>{var m;c(),(m=r.onTick)==null||m.call(r,w)},onInterviewEnd:()=>{var w;c(),(w=r.onInterviewEnd)==null||w.call(r)}};n.callbacks=f},[n,r,c]),d.useEffect(()=>()=>{n.destroy()},[n]);const l=d.useCallback(()=>{n.startQuestion(),c()},[n,c]),u=d.useCallback(()=>{n.nextPhase(),c()},[n,c]),h=d.useCallback(()=>{n.completeInterview(),c()},[n,c]);return{state:s,startQuestion:l,nextPhase:u,completeInterview:h,timerService:n}}function rh(e,t={}){const[r,i]=d.useState({data:null,loading:!1,error:null}),n=d.useCallback(async(...s)=>{var a,c,l,u;i(h=>({...h,loading:!0,error:null}));try{const h=await e(...s);i(f=>({...f,data:h,loading:!1,error:null})),(a=t.onSuccess)==null||a.call(t,h),(c=t.onSettled)==null||c.call(t,h,null)}catch(h){const f=h.type?h:{type:"unknown",message:h.message||"Unknown error",retryable:!0,userMessage:"Something went wrong. Please try again.",originalError:h};i(w=>({...w,loading:!1,error:f})),(l=t.onError)==null||l.call(t,f),(u=t.onSettled)==null||u.call(t,null,f)}},[e,t]);return{...r,execute:n}}const ih=e=>{const[t,r]=d.useState(null),[i,n]=d.useState(!1),s=document,a=()=>!!(s.fullscreenEnabled||s.webkitFullscreenEnabled||s.mozFullScreenEnabled||s.msFullscreenEnabled),c=()=>s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement,l=async m=>{var g;try{if(!a())throw new Error("Fullscreen is not supported in this environment");m.requestFullscreen?await m.requestFullscreen():m.webkitRequestFullscreen?await m.webkitRequestFullscreen():m.mozRequestFullScreen?await m.mozRequestFullScreen():m.msRequestFullscreen&&await m.msRequestFullscreen()}catch(b){const _={name:"FullscreenError",message:b instanceof Error?b.message:"Failed to enter fullscreen"};r(_),(g=e==null?void 0:e.onError)==null||g.call(e,_)}},u=async()=>{var m;try{s.exitFullscreen?await s.exitFullscreen():s.webkitExitFullscreen?await s.webkitExitFullscreen():s.mozCancelFullScreen?await s.mozCancelFullScreen():s.msExitFullscreen&&await s.msExitFullscreen()}catch(g){const b={name:"FullscreenError",message:g instanceof Error?g.message:"Failed to exit fullscreen"};r(b),(m=e==null?void 0:e.onError)==null||m.call(e,b)}},h=d.useCallback(()=>{var g;const m=!!c();n(m),(g=e==null?void 0:e.onFullScreenChange)==null||g.call(e,m)},[e]);d.useEffect(()=>{const m=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"];return m.forEach(g=>{document.addEventListener(g,h)}),()=>{m.forEach(g=>{document.removeEventListener(g,h)})}},[h]);const f=async m=>{r(null);const g=m??document.documentElement;await l(g)};return{isFullScreen:i,toggleFullScreen:async m=>{i?await u():await f(m)},enterFullScreen:f,exitFullScreen:u,error:t}},nh=e=>{d.useEffect(()=>{const t=i=>{(i.ctrlKey||i.metaKey)&&["c","v","a","t","n","w","r","s","p"].includes(i.key.toLowerCase())&&(i.preventDefault(),e({type:"blocked_shortcut",severity:"low",details:{action:"shortcut_pressed",reason:`Attempted to use a blocked keyboard shortcut: Ctrl + ${i.key}`}})),i.key.startsWith("F")&&i.key.length<=3&&(i.preventDefault(),e({type:"blocked_function_key",severity:"low",details:{action:"function_key_pressed",reason:`Attempted to use a blocked function key: ${i.key}`}})),i.altKey&&i.key==="Tab"&&(i.preventDefault(),e({type:"alt_tab_attempt",severity:"medium",details:{action:"alt_tab",reason:"Attempted to use the Alt + Tab shortcut"}}))},r=i=>{i.preventDefault(),e({type:"right_click_attempt",severity:"low",details:{action:"right_click",reason:"Attempted to use the right click"}})};return document.addEventListener("keydown",t),document.addEventListener("contextmenu",r),()=>{document.removeEventListener("keydown",t),document.removeEventListener("contextmenu",r)}},[e])},sh=(e={})=>{const[t,r]=d.useState(!1),[i,n]=d.useState(!1),[s,a]=d.useState(null),[c,l]=d.useState(null),[u,h]=d.useState(null);e.config&&Nr.updateConfig(e.config);const f=d.useCallback(async b=>{var _;try{l(null),a(null),h(null),await Nr.startRecording(b,{onStart:()=>{var p;r(!0),(p=e.onStart)==null||p.call(e)},onStop:()=>{var p;r(!1),(p=e.onStop)==null||p.call(e)},onError:p=>{var F;const A=p instanceof te?p:new te(p.message,"RECORDING_ERROR",!0);l(A),r(!1),(F=e.onError)==null||F.call(e,A)}})}catch(p){const A=p instanceof te?p:new te(p instanceof Error?p.message:String(p),"START_FAILED",!1);throw l(A),r(!1),(_=e.onError)==null||_.call(e,A),A}},[]),w=d.useCallback(async()=>{var b,_;try{const p=await Nr.stopRecording();return h(p),r(!1),(b=e.onStop)==null||b.call(e),p}catch(p){const A=p instanceof te?p:new te(p instanceof Error?p.message:String(p),"STOP_FAILED",!1);throw l(A),r(!1),(_=e.onError)==null||_.call(e,A),A}},[]),m=d.useCallback(async(b,_={})=>{var p,A;try{l(null),n(!0);const F={audioBlob:b,..._},T=await Nr.transcribe(F);return a(T.transcript),n(!1),(p=e.onTranscriptionComplete)==null||p.call(e,T),T}catch(F){const T=F instanceof te?F:new te(F instanceof Error?F.message:String(F),"TRANSCRIPTION_FAILED",!0);throw l(T),n(!1),(A=e.onError)==null||A.call(e,T),T}},[]),g=d.useCallback(()=>{Nr.cancelRecording(),r(!1),h(null)},[]);return{startRecording:f,stopRecording:w,transcribe:m,cancelRecording:g,isRecording:t,isTranscribing:i,transcript:s,error:c,audioBlob:u}},oh=e=>{const t=d.useRef(null),r=d.useRef(!1);d.useEffect(()=>{const i=()=>{document.hidden&&(r.current=!0,t.current&&(clearTimeout(t.current),t.current=null),e({type:"tab_switch",severity:"high",details:{action:"tab_hidden",reason:"Attempted to switch tabs or applications"}}),setTimeout(()=>{r.current=!1},100))},n=()=>{r.current||(t.current=setTimeout(()=>{r.current||e({type:"focus_loss",severity:"medium",details:{action:"window_blur",reason:"Focus lost from the interview window"}}),t.current=null},50))};return document.addEventListener("visibilitychange",i),window.addEventListener("blur",n),()=>{document.removeEventListener("visibilitychange",i),window.removeEventListener("blur",n),t.current&&clearTimeout(t.current)}},[e])},ah=()=>{d.useEffect(()=>{const e=document.createElement("style");return e.textContent=`
23
+ }`,e.VERTEX_SHADER),this.W=q0(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.O=e.getAttribLocation(this.h,"aVertex"),this.L=e.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.X),e.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}};function qn(e,t){switch(t){case 0:return e.g.find(n=>n instanceof Uint8Array);case 1:return e.g.find(n=>n instanceof Float32Array);case 2:return e.g.find(n=>typeof WebGLTexture<"u"&&n instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function of(e){var t=qn(e,1);if(!t){if(t=qn(e,0))t=new Float32Array(t).map(i=>i/255);else{t=new Float32Array(e.width*e.height);const i=ll(e);var n=cf(e);if(X0(n,i,Z0(e)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){n=new Float32Array(e.width*e.height*4),i.readPixels(0,0,e.width,e.height,i.RGBA,i.FLOAT,n);for(let a=0,l=0;a<t.length;++a,l+=4)t[a]=n[l]}else i.readPixels(0,0,e.width,e.height,i.RED,i.FLOAT,t)}e.g.push(t)}return t}function Z0(e){let t=qn(e,2);if(!t){const n=ll(e);t=I0(e);const i=of(e),a=K0(e);n.texImage2D(n.TEXTURE_2D,0,a,e.width,e.height,0,n.RED,n.FLOAT,i),ff(e)}return t}function ll(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=pi(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function K0(e){if(e=ll(e),!uu)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))uu=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");uu=e.R16F}return uu}function cf(e){return e.l||(e.l=new Q0),e.l}function I0(e){const t=ll(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let n=qn(e,2);return n||(n=Y0(cf(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(n),e.j=!0),t.bindTexture(t.TEXTURE_2D,n),n}function ff(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var uu,Ze=class{constructor(e,t,n,i,a,l,s){this.g=e,this.m=t,this.j=n,this.canvas=i,this.l=a,this.width=l,this.height=s,this.j&&--J0===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!qn(this,0)}ka(){return!!qn(this,1)}R(){return!!qn(this,2)}ja(){return(t=qn(e=this,0))||(t=of(e),t=new Uint8Array(t.map(n=>Math.round(255*n))),e.g.push(t)),t;var e,t}ia(){return of(this)}N(){return Z0(this)}clone(){const e=[];for(const t of this.g){let n;if(t instanceof Uint8Array)n=new Uint8Array(t);else if(t instanceof Float32Array)n=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const i=ll(this),a=cf(this);i.activeTexture(i.TEXTURE1),n=Y0(a,i,this.m?i.LINEAR:i.NEAREST),i.bindTexture(i.TEXTURE_2D,n);const l=K0(this);i.texImage2D(i.TEXTURE_2D,0,l,this.width,this.height,0,i.RED,i.FLOAT,null),i.bindTexture(i.TEXTURE_2D,null),X0(a,i,n),hy(a,i,!1,()=>{I0(this),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),ff(this)}),my(a),ff(this)}}e.push(n)}return new Ze(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&ll(this).deleteTexture(qn(this,2)),J0=-1}};Ze.prototype.close=Ze.prototype.close,Ze.prototype.clone=Ze.prototype.clone,Ze.prototype.getAsWebGLTexture=Ze.prototype.N,Ze.prototype.getAsFloat32Array=Ze.prototype.ia,Ze.prototype.getAsUint8Array=Ze.prototype.ja,Ze.prototype.hasWebGLTexture=Ze.prototype.R,Ze.prototype.hasFloat32Array=Ze.prototype.ka,Ze.prototype.hasUint8Array=Ze.prototype.Fa;var J0=250;function mn(...e){return e.map(([t,n])=>({start:t,end:n}))}const gy=function(e){return class extends e{Ja(){this.i._registerModelResourcesGraphService()}}}((W0=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:U0()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const n=e.length,i=this.i._malloc(n);this.i.HEAPU8.set(e,i),t?this.i._changeBinaryGraph(n,i):this.i._changeTextGraph(n,i),this.i._free(i)}configureAudio(e,t,n,i,a){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),k(this,i||"input_audio",l=>{k(this,a=a||"audio_header",s=>{this.i._configureAudio(l,s,e,t??0,n)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){jn(this,"__graph_config__",t=>{e(t)}),k(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,n){this.addAudioToStreamWithShape(e,0,0,t,n)}addAudioToStreamWithShape(e,t,n,i,a){const l=4*e.length;this.h!==l&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(l),this.h=l),this.i.HEAPF32.set(e,this.g/4),k(this,i,s=>{this.i._addAudioToInputStream(this.g,t,n,s,a)})}addGpuBufferToStream(e,t,n){k(this,t,i=>{const[a,l]=G0(this,e,i);this.i._addBoundTextureToStream(i,a,l,n)})}addBoolToStream(e,t,n){k(this,t,i=>{this.i._addBoolToInputStream(e,i,n)})}addDoubleToStream(e,t,n){k(this,t,i=>{this.i._addDoubleToInputStream(e,i,n)})}addFloatToStream(e,t,n){k(this,t,i=>{this.i._addFloatToInputStream(e,i,n)})}addIntToStream(e,t,n){k(this,t,i=>{this.i._addIntToInputStream(e,i,n)})}addUintToStream(e,t,n){k(this,t,i=>{this.i._addUintToInputStream(e,i,n)})}addStringToStream(e,t,n){k(this,t,i=>{k(this,e,a=>{this.i._addStringToInputStream(a,i,n)})})}addStringRecordToStream(e,t,n){k(this,t,i=>{H0(this,Object.keys(e),a=>{H0(this,Object.values(e),l=>{this.i._addFlatHashMapToInputStream(a,l,Object.keys(e).length,i,n)})})})}addProtoToStream(e,t,n,i){k(this,n,a=>{k(this,t,l=>{const s=this.i._malloc(e.length);this.i.HEAPU8.set(e,s),this.i._addProtoToInputStream(s,e.length,l,a,i),this.i._free(s)})})}addEmptyPacketToStream(e,t){k(this,e,n=>{this.i._addEmptyPacketToInputStream(n,t)})}addBoolVectorToStream(e,t,n){k(this,t,i=>{const a=this.i._allocateBoolVector(e.length);if(!a)throw Error("Unable to allocate new bool vector on heap.");for(const l of e)this.i._addBoolVectorEntry(a,l);this.i._addBoolVectorToInputStream(a,i,n)})}addDoubleVectorToStream(e,t,n){k(this,t,i=>{const a=this.i._allocateDoubleVector(e.length);if(!a)throw Error("Unable to allocate new double vector on heap.");for(const l of e)this.i._addDoubleVectorEntry(a,l);this.i._addDoubleVectorToInputStream(a,i,n)})}addFloatVectorToStream(e,t,n){k(this,t,i=>{const a=this.i._allocateFloatVector(e.length);if(!a)throw Error("Unable to allocate new float vector on heap.");for(const l of e)this.i._addFloatVectorEntry(a,l);this.i._addFloatVectorToInputStream(a,i,n)})}addIntVectorToStream(e,t,n){k(this,t,i=>{const a=this.i._allocateIntVector(e.length);if(!a)throw Error("Unable to allocate new int vector on heap.");for(const l of e)this.i._addIntVectorEntry(a,l);this.i._addIntVectorToInputStream(a,i,n)})}addUintVectorToStream(e,t,n){k(this,t,i=>{const a=this.i._allocateUintVector(e.length);if(!a)throw Error("Unable to allocate new unsigned int vector on heap.");for(const l of e)this.i._addUintVectorEntry(a,l);this.i._addUintVectorToInputStream(a,i,n)})}addStringVectorToStream(e,t,n){k(this,t,i=>{const a=this.i._allocateStringVector(e.length);if(!a)throw Error("Unable to allocate new string vector on heap.");for(const l of e)k(this,l,s=>{this.i._addStringVectorEntry(a,s)});this.i._addStringVectorToInputStream(a,i,n)})}addBoolToInputSidePacket(e,t){k(this,t,n=>{this.i._addBoolToInputSidePacket(e,n)})}addDoubleToInputSidePacket(e,t){k(this,t,n=>{this.i._addDoubleToInputSidePacket(e,n)})}addFloatToInputSidePacket(e,t){k(this,t,n=>{this.i._addFloatToInputSidePacket(e,n)})}addIntToInputSidePacket(e,t){k(this,t,n=>{this.i._addIntToInputSidePacket(e,n)})}addUintToInputSidePacket(e,t){k(this,t,n=>{this.i._addUintToInputSidePacket(e,n)})}addStringToInputSidePacket(e,t){k(this,t,n=>{k(this,e,i=>{this.i._addStringToInputSidePacket(i,n)})})}addProtoToInputSidePacket(e,t,n){k(this,n,i=>{k(this,t,a=>{const l=this.i._malloc(e.length);this.i.HEAPU8.set(e,l),this.i._addProtoToInputSidePacket(l,e.length,a,i),this.i._free(l)})})}addBoolVectorToInputSidePacket(e,t){k(this,t,n=>{const i=this.i._allocateBoolVector(e.length);if(!i)throw Error("Unable to allocate new bool vector on heap.");for(const a of e)this.i._addBoolVectorEntry(i,a);this.i._addBoolVectorToInputSidePacket(i,n)})}addDoubleVectorToInputSidePacket(e,t){k(this,t,n=>{const i=this.i._allocateDoubleVector(e.length);if(!i)throw Error("Unable to allocate new double vector on heap.");for(const a of e)this.i._addDoubleVectorEntry(i,a);this.i._addDoubleVectorToInputSidePacket(i,n)})}addFloatVectorToInputSidePacket(e,t){k(this,t,n=>{const i=this.i._allocateFloatVector(e.length);if(!i)throw Error("Unable to allocate new float vector on heap.");for(const a of e)this.i._addFloatVectorEntry(i,a);this.i._addFloatVectorToInputSidePacket(i,n)})}addIntVectorToInputSidePacket(e,t){k(this,t,n=>{const i=this.i._allocateIntVector(e.length);if(!i)throw Error("Unable to allocate new int vector on heap.");for(const a of e)this.i._addIntVectorEntry(i,a);this.i._addIntVectorToInputSidePacket(i,n)})}addUintVectorToInputSidePacket(e,t){k(this,t,n=>{const i=this.i._allocateUintVector(e.length);if(!i)throw Error("Unable to allocate new unsigned int vector on heap.");for(const a of e)this.i._addUintVectorEntry(i,a);this.i._addUintVectorToInputSidePacket(i,n)})}addStringVectorToInputSidePacket(e,t){k(this,t,n=>{const i=this.i._allocateStringVector(e.length);if(!i)throw Error("Unable to allocate new string vector on heap.");for(const a of e)k(this,a,l=>{this.i._addStringVectorEntry(i,l)});this.i._addStringVectorToInputSidePacket(i,n)})}attachBoolListener(e,t){jn(this,e,t),k(this,e,n=>{this.i._attachBoolListener(n)})}attachBoolVectorListener(e,t){yi(this,e,t),k(this,e,n=>{this.i._attachBoolVectorListener(n)})}attachIntListener(e,t){jn(this,e,t),k(this,e,n=>{this.i._attachIntListener(n)})}attachIntVectorListener(e,t){yi(this,e,t),k(this,e,n=>{this.i._attachIntVectorListener(n)})}attachUintListener(e,t){jn(this,e,t),k(this,e,n=>{this.i._attachUintListener(n)})}attachUintVectorListener(e,t){yi(this,e,t),k(this,e,n=>{this.i._attachUintVectorListener(n)})}attachDoubleListener(e,t){jn(this,e,t),k(this,e,n=>{this.i._attachDoubleListener(n)})}attachDoubleVectorListener(e,t){yi(this,e,t),k(this,e,n=>{this.i._attachDoubleVectorListener(n)})}attachFloatListener(e,t){jn(this,e,t),k(this,e,n=>{this.i._attachFloatListener(n)})}attachFloatVectorListener(e,t){yi(this,e,t),k(this,e,n=>{this.i._attachFloatVectorListener(n)})}attachStringListener(e,t){jn(this,e,t),k(this,e,n=>{this.i._attachStringListener(n)})}attachStringVectorListener(e,t){yi(this,e,t),k(this,e,n=>{this.i._attachStringVectorListener(n)})}attachProtoListener(e,t,n){jn(this,e,t),k(this,e,i=>{this.i._attachProtoListener(i,n||!1)})}attachProtoVectorListener(e,t,n){yi(this,e,t),k(this,e,i=>{this.i._attachProtoVectorListener(i,n||!1)})}attachAudioListener(e,t,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),jn(this,e,(i,a)=>{i=new Float32Array(i.buffer,i.byteOffset,i.length/4),t(i,a)}),k(this,e,i=>{this.i._attachAudioListener(i,n||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends W0{get ga(){return this.i}pa(e,t,n){k(this,t,i=>{const[a,l]=G0(this,e,i);this.ga._addBoundTextureAsImageToStream(i,a,l,n)})}Z(e,t){jn(this,e,t),k(this,e,n=>{this.ga._attachImageListener(n)})}aa(e,t){yi(this,e,t),k(this,e,n=>{this.ga._attachImageVectorListener(n)})}}));var W0,gn=class extends gy{};async function Z(e,t,n){return async function(i,a,l,s){return fy(i,a,l,s)}(e,n.canvas??(U0()?void 0:document.createElement("canvas")),t,n)}function P0(e,t,n,i){if(e.U){const l=new i0;if(n!=null&&n.regionOfInterest){if(!e.oa)throw Error("This task doesn't support region-of-interest.");var a=n.regionOfInterest;if(a.left>=a.right||a.top>=a.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(a.left<0||a.top<0||a.right>1||a.bottom>1)throw Error("Expected RectF values to be in [0,1].");L(l,1,(a.left+a.right)/2),L(l,2,(a.top+a.bottom)/2),L(l,4,a.right-a.left),L(l,3,a.bottom-a.top)}else L(l,1,.5),L(l,2,.5),L(l,4,1),L(l,3,1);if(n!=null&&n.rotationDegrees){if((n==null?void 0:n.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(L(l,5,-Math.PI*n.rotationDegrees/180),(n==null?void 0:n.rotationDegrees)%180!=0){const[s,r]=R0(t);n=Te(l,3)*r/s,a=Te(l,4)*s/r,L(l,4,n),L(l,3,a)}}e.g.addProtoToStream(l.g(),"mediapipe.NormalizedRect",e.U,i)}e.g.pa(t,e.X,i??performance.now()),e.finishProcessing()}function wn(e,t,n){var i;if((i=e.baseOptions)!=null&&i.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");P0(e,t,n,e.C+1)}function Mn(e,t,n,i){var a;if(!((a=e.baseOptions)!=null&&a.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");P0(e,t,n,i)}function sl(e,t,n,i){var a=t.data;const l=t.width,s=l*(t=t.height);if((a instanceof Uint8Array||a instanceof Float32Array)&&a.length!==s)throw Error("Unsupported channel count: "+a.length/s);return e=new Ze([a],n,!1,e.g.i.canvas,e.P,l,t),i?e.clone():e}var Ct=class extends rf{constructor(e,t,n,i){super(e),this.g=e,this.X=t,this.U=n,this.oa=i,this.P=new Q0}l(e,t=!0){if("runningMode"in e&&ne(this.baseOptions,2,fs(!!e.runningMode&&e.runningMode!=="IMAGE")),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Ct.prototype.close=Ct.prototype.close;var Jt=class extends Ct{constructor(e,t){super(new gn(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},U(e=this.h=new iu,0,1,t=new ve),L(this.h,2,.5),L(this.h,3,.3)}get baseOptions(){return I(this.h,ve,1)}set baseOptions(e){U(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&L(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&L(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}F(e,t){return this.j={detections:[]},wn(this,e,t),this.j}G(e,t,n){return this.j={detections:[]},Mn(this,e,n,t),this.j}m(){var e=new Mt;ye(e,"image_in"),ye(e,"norm_rect_in"),J(e,"detections");const t=new jt;An(t,J5,this.h);const n=new dt;At(n,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),he(n,"IMAGE:image_in"),he(n,"NORM_RECT:norm_rect_in"),Q(n,"DETECTIONS:detections"),n.o(t),It(e,n),this.g.attachProtoVectorListener("detections",(i,a)=>{for(const l of i)i=e0(l),this.j.detections.push(O0(i));C(this,a)}),this.g.attachEmptyPacketListener("detections",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Jt.prototype.detectForVideo=Jt.prototype.G,Jt.prototype.detect=Jt.prototype.F,Jt.prototype.setOptions=Jt.prototype.o,Jt.createFromModelPath=async function(e,t){return Z(Jt,e,{baseOptions:{modelAssetPath:t}})},Jt.createFromModelBuffer=function(e,t){return Z(Jt,e,{baseOptions:{modelAssetBuffer:t}})},Jt.createFromOptions=function(e,t){return Z(Jt,e,t)};var df=mn([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),hf=mn([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),mf=mn([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),$0=mn([474,475],[475,476],[476,477],[477,474]),gf=mn([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),wf=mn([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),e3=mn([469,470],[470,471],[471,472],[472,469]),yf=mn([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),t3=[...df,...hf,...mf,...gf,...wf,...yf],n3=mn([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function i3(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var pe=class extends Ct{constructor(e,t){super(new gn(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,U(e=this.h=new f0,0,1,t=new ve),this.A=new c0,U(this.h,0,3,this.A),this.u=new iu,U(this.h,0,2,this.u),Hn(this.u,4,1),L(this.u,2,.5),L(this.A,2,.5),L(this.h,4,.5)}get baseOptions(){return I(this.h,ve,1)}set baseOptions(e){U(this.h,0,1,e)}o(e){return"numFaces"in e&&Hn(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&L(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&L(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&L(this.A,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return i3(this),wn(this,e,t),this.j}G(e,t,n){return i3(this),Mn(this,e,n,t),this.j}m(){var e=new Mt;ye(e,"image_in"),ye(e,"norm_rect"),J(e,"face_landmarks");const t=new jt;An(t,P5,this.h);const n=new dt;At(n,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),he(n,"IMAGE:image_in"),he(n,"NORM_RECT:norm_rect"),Q(n,"NORM_LANDMARKS:face_landmarks"),n.o(t),It(e,n),this.g.attachProtoVectorListener("face_landmarks",(i,a)=>{for(const l of i)i=vs(l),this.j.faceLandmarks.push(au(i));C(this,a)}),this.g.attachEmptyPacketListener("face_landmarks",i=>{C(this,i)}),this.outputFaceBlendshapes&&(J(e,"blendshapes"),Q(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(i,a)=>{if(this.outputFaceBlendshapes)for(const l of i)i=eu(l),this.j.faceBlendshapes.push(lf(i.g()??[]));C(this,a)}),this.g.attachEmptyPacketListener("blendshapes",i=>{C(this,i)})),this.outputFacialTransformationMatrixes&&(J(e,"face_geometry"),Q(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(i,a)=>{if(this.outputFacialTransformationMatrixes)for(const l of i)(i=I(i=W5(l),q5,2))&&this.j.facialTransformationMatrixes.push({rows:Zt(i,1)??0??0,columns:Zt(i,2)??0??0,data:na(i,3,_n,ta()).slice()??[]});C(this,a)}),this.g.attachEmptyPacketListener("face_geometry",i=>{C(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};pe.prototype.detectForVideo=pe.prototype.G,pe.prototype.detect=pe.prototype.F,pe.prototype.setOptions=pe.prototype.o,pe.createFromModelPath=function(e,t){return Z(pe,e,{baseOptions:{modelAssetPath:t}})},pe.createFromModelBuffer=function(e,t){return Z(pe,e,{baseOptions:{modelAssetBuffer:t}})},pe.createFromOptions=function(e,t){return Z(pe,e,t)},pe.FACE_LANDMARKS_LIPS=df,pe.FACE_LANDMARKS_LEFT_EYE=hf,pe.FACE_LANDMARKS_LEFT_EYEBROW=mf,pe.FACE_LANDMARKS_LEFT_IRIS=$0,pe.FACE_LANDMARKS_RIGHT_EYE=gf,pe.FACE_LANDMARKS_RIGHT_EYEBROW=wf,pe.FACE_LANDMARKS_RIGHT_IRIS=e3,pe.FACE_LANDMARKS_FACE_OVAL=yf,pe.FACE_LANDMARKS_CONTOURS=t3,pe.FACE_LANDMARKS_TESSELATION=n3;var pf=mn([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function a3(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function l3(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function s3(e,t=!0){const n=[];for(const a of e){var i=eu(a);e=[];for(const l of i.g())i=t&&Zt(l,1)!=null?Zt(l,1)??0:-1,e.push({score:Te(l,2)??0,index:i,categoryName:We(de(l,3))??""??"",displayName:We(de(l,4))??""??""});n.push(e)}return n}var Dt=class extends Ct{constructor(e,t){super(new gn(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],U(e=this.j=new m0,0,1,t=new ve),this.u=new Jc,U(this.j,0,2,this.u),this.D=new Ic,U(this.u,0,3,this.D),this.A=new h0,U(this.u,0,2,this.A),this.h=new $5,U(this.j,0,3,this.h),L(this.A,2,.5),L(this.u,4,.5),L(this.D,2,.5)}get baseOptions(){return I(this.j,ve,1)}set baseOptions(e){U(this.j,0,1,e)}o(e){var a,l,s,r;if(Hn(this.A,3,e.numHands??1),"minHandDetectionConfidence"in e&&L(this.A,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&L(this.u,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&L(this.D,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new il,n=t,i=af(e.cannedGesturesClassifierOptions,(a=I(this.h,il,3))==null?void 0:a.l());U(n,0,2,i),U(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((l=I(this.h,il,3))==null||l.g());return e.customGesturesClassifierOptions?(U(n=t=new il,0,2,i=af(e.customGesturesClassifierOptions,(s=I(this.h,il,4))==null?void 0:s.l())),U(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((r=I(this.h,il,4))==null||r.g()),this.l(e)}Ha(e,t){return a3(this),wn(this,e,t),l3(this)}Ia(e,t,n){return a3(this),Mn(this,e,n,t),l3(this)}m(){var e=new Mt;ye(e,"image_in"),ye(e,"norm_rect"),J(e,"hand_gestures"),J(e,"hand_landmarks"),J(e,"world_hand_landmarks"),J(e,"handedness");const t=new jt;An(t,ey,this.j);const n=new dt;At(n,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),he(n,"IMAGE:image_in"),he(n,"NORM_RECT:norm_rect"),Q(n,"HAND_GESTURES:hand_gestures"),Q(n,"LANDMARKS:hand_landmarks"),Q(n,"WORLD_LANDMARKS:world_hand_landmarks"),Q(n,"HANDEDNESS:handedness"),n.o(t),It(e,n),this.g.attachProtoVectorListener("hand_landmarks",(i,a)=>{for(const l of i){i=vs(l);const s=[];for(const r of Gn(i,n0,1))s.push({x:Te(r,1)??0,y:Te(r,2)??0,z:Te(r,3)??0,visibility:Te(r,4)??0});this.landmarks.push(s)}C(this,a)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{C(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,a)=>{for(const l of i){i=nl(l);const s=[];for(const r of Gn(i,t0,1))s.push({x:Te(r,1)??0,y:Te(r,2)??0,z:Te(r,3)??0,visibility:Te(r,4)??0});this.worldLandmarks.push(s)}C(this,a)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{C(this,i)}),this.g.attachProtoVectorListener("hand_gestures",(i,a)=>{this.gestures.push(...s3(i,!1)),C(this,a)}),this.g.attachEmptyPacketListener("hand_gestures",i=>{C(this,i)}),this.g.attachProtoVectorListener("handedness",(i,a)=>{this.handedness.push(...s3(i)),C(this,a)}),this.g.attachEmptyPacketListener("handedness",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function r3(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Dt.prototype.recognizeForVideo=Dt.prototype.Ia,Dt.prototype.recognize=Dt.prototype.Ha,Dt.prototype.setOptions=Dt.prototype.o,Dt.createFromModelPath=function(e,t){return Z(Dt,e,{baseOptions:{modelAssetPath:t}})},Dt.createFromModelBuffer=function(e,t){return Z(Dt,e,{baseOptions:{modelAssetBuffer:t}})},Dt.createFromOptions=function(e,t){return Z(Dt,e,t)},Dt.HAND_CONNECTIONS=pf;var Ot=class extends Ct{constructor(e,t){super(new gn(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],U(e=this.h=new Jc,0,1,t=new ve),this.u=new Ic,U(this.h,0,3,this.u),this.j=new h0,U(this.h,0,2,this.j),Hn(this.j,3,1),L(this.j,2,.5),L(this.u,2,.5),L(this.h,4,.5)}get baseOptions(){return I(this.h,ve,1)}set baseOptions(e){U(this.h,0,1,e)}o(e){return"numHands"in e&&Hn(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&L(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&L(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&L(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],wn(this,e,t),r3(this)}G(e,t,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Mn(this,e,n,t),r3(this)}m(){var e=new Mt;ye(e,"image_in"),ye(e,"norm_rect"),J(e,"hand_landmarks"),J(e,"world_hand_landmarks"),J(e,"handedness");const t=new jt;An(t,ty,this.h);const n=new dt;At(n,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),he(n,"IMAGE:image_in"),he(n,"NORM_RECT:norm_rect"),Q(n,"LANDMARKS:hand_landmarks"),Q(n,"WORLD_LANDMARKS:world_hand_landmarks"),Q(n,"HANDEDNESS:handedness"),n.o(t),It(e,n),this.g.attachProtoVectorListener("hand_landmarks",(i,a)=>{for(const l of i)i=vs(l),this.landmarks.push(au(i));C(this,a)}),this.g.attachEmptyPacketListener("hand_landmarks",i=>{C(this,i)}),this.g.attachProtoVectorListener("world_hand_landmarks",(i,a)=>{for(const l of i)i=nl(l),this.worldLandmarks.push(bs(i));C(this,a)}),this.g.attachEmptyPacketListener("world_hand_landmarks",i=>{C(this,i)}),this.g.attachProtoVectorListener("handedness",(i,a)=>{var l=this.handedness,s=l.push;const r=[];for(const o of i){i=eu(o);const c=[];for(const f of i.g())c.push({score:Te(f,2)??0,index:Zt(f,1)??0??-1,categoryName:We(de(f,3))??""??"",displayName:We(de(f,4))??""??""});r.push(c)}s.call(l,...r),C(this,a)}),this.g.attachEmptyPacketListener("handedness",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ot.prototype.detectForVideo=Ot.prototype.G,Ot.prototype.detect=Ot.prototype.F,Ot.prototype.setOptions=Ot.prototype.o,Ot.createFromModelPath=function(e,t){return Z(Ot,e,{baseOptions:{modelAssetPath:t}})},Ot.createFromModelBuffer=function(e,t){return Z(Ot,e,{baseOptions:{modelAssetBuffer:t}})},Ot.createFromOptions=function(e,t){return Z(Ot,e,t)},Ot.HAND_CONNECTIONS=pf;var u3=mn([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function o3(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function c3(e){try{if(!e.D)return e.h;e.D(e.h)}finally{ru(e)}}function ou(e,t){e=vs(e),t.push(au(e))}var me=class extends Ct{constructor(e,t){super(new gn(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,U(e=this.j=new b0,0,1,t=new ve),this.I=new Ic,U(this.j,0,2,this.I),this.W=new ny,U(this.j,0,3,this.W),this.u=new iu,U(this.j,0,4,this.u),this.O=new c0,U(this.j,0,5,this.O),this.A=new p0,U(this.j,0,6,this.A),this.M=new v0,U(this.j,0,7,this.M),L(this.u,2,.5),L(this.u,3,.3),L(this.O,2,.5),L(this.A,2,.5),L(this.A,3,.3),L(this.M,2,.5),L(this.I,2,.5)}get baseOptions(){return I(this.j,ve,1)}set baseOptions(e){U(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&L(this.u,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&L(this.u,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&L(this.O,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&L(this.A,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&L(this.A,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&L(this.M,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&L(this.I,2,e.minHandLandmarksConfidence??.5),this.l(e)}F(e,t,n){const i=typeof t!="function"?t:{};return this.D=typeof t=="function"?t:n,o3(this),wn(this,e,i),c3(this)}G(e,t,n,i){const a=typeof n!="function"?n:{};return this.D=typeof n=="function"?n:i,o3(this),Mn(this,e,a,t),c3(this)}m(){var e=new Mt;ye(e,"input_frames_image"),J(e,"pose_landmarks"),J(e,"pose_world_landmarks"),J(e,"face_landmarks"),J(e,"left_hand_landmarks"),J(e,"left_hand_world_landmarks"),J(e,"right_hand_landmarks"),J(e,"right_hand_world_landmarks");const t=new jt,n=new Bh;At(n,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(a,l){if(l!=null)if(Array.isArray(l))ne(a,2,Br(l,0,ms));else{if(!(typeof l=="string"||l instanceof Sn||tc(l)))throw Error("invalid value in Any.value field: "+l+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");di(a,2,lc(l,!1),Ii())}}(n,this.j.g());const i=new dt;At(i,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Ac(i,8,Bh,n),he(i,"IMAGE:input_frames_image"),Q(i,"POSE_LANDMARKS:pose_landmarks"),Q(i,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Q(i,"FACE_LANDMARKS:face_landmarks"),Q(i,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Q(i,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Q(i,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Q(i,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),i.o(t),It(e,i),su(this,e),this.g.attachProtoListener("pose_landmarks",(a,l)=>{ou(a,this.h.poseLandmarks),C(this,l)}),this.g.attachEmptyPacketListener("pose_landmarks",a=>{C(this,a)}),this.g.attachProtoListener("pose_world_landmarks",(a,l)=>{var s=this.h.poseWorldLandmarks;a=nl(a),s.push(bs(a)),C(this,l)}),this.g.attachEmptyPacketListener("pose_world_landmarks",a=>{C(this,a)}),this.outputPoseSegmentationMasks&&(Q(i,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),al(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(a,l)=>{this.h.poseSegmentationMasks=[sl(this,a,!0,!this.D)],C(this,l)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",a=>{this.h.poseSegmentationMasks=[],C(this,a)})),this.g.attachProtoListener("face_landmarks",(a,l)=>{ou(a,this.h.faceLandmarks),C(this,l)}),this.g.attachEmptyPacketListener("face_landmarks",a=>{C(this,a)}),this.outputFaceBlendshapes&&(J(e,"extra_blendshapes"),Q(i,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(a,l)=>{var s=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(a=eu(a),s.push(lf(a.g()??[]))),C(this,l)}),this.g.attachEmptyPacketListener("extra_blendshapes",a=>{C(this,a)})),this.g.attachProtoListener("left_hand_landmarks",(a,l)=>{ou(a,this.h.leftHandLandmarks),C(this,l)}),this.g.attachEmptyPacketListener("left_hand_landmarks",a=>{C(this,a)}),this.g.attachProtoListener("left_hand_world_landmarks",(a,l)=>{var s=this.h.leftHandWorldLandmarks;a=nl(a),s.push(bs(a)),C(this,l)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",a=>{C(this,a)}),this.g.attachProtoListener("right_hand_landmarks",(a,l)=>{ou(a,this.h.rightHandLandmarks),C(this,l)}),this.g.attachEmptyPacketListener("right_hand_landmarks",a=>{C(this,a)}),this.g.attachProtoListener("right_hand_world_landmarks",(a,l)=>{var s=this.h.rightHandWorldLandmarks;a=nl(a),s.push(bs(a)),C(this,l)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",a=>{C(this,a)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};me.prototype.detectForVideo=me.prototype.G,me.prototype.detect=me.prototype.F,me.prototype.setOptions=me.prototype.o,me.createFromModelPath=function(e,t){return Z(me,e,{baseOptions:{modelAssetPath:t}})},me.createFromModelBuffer=function(e,t){return Z(me,e,{baseOptions:{modelAssetBuffer:t}})},me.createFromOptions=function(e,t){return Z(me,e,t)},me.HAND_CONNECTIONS=pf,me.POSE_CONNECTIONS=u3,me.FACE_LANDMARKS_LIPS=df,me.FACE_LANDMARKS_LEFT_EYE=hf,me.FACE_LANDMARKS_LEFT_EYEBROW=mf,me.FACE_LANDMARKS_LEFT_IRIS=$0,me.FACE_LANDMARKS_RIGHT_EYE=gf,me.FACE_LANDMARKS_RIGHT_EYEBROW=wf,me.FACE_LANDMARKS_RIGHT_IRIS=e3,me.FACE_LANDMARKS_FACE_OVAL=yf,me.FACE_LANDMARKS_CONTOURS=t3,me.FACE_LANDMARKS_TESSELATION=n3;var Wt=class extends Ct{constructor(e,t){super(new gn(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},U(e=this.h=new x0,0,1,t=new ve)}get baseOptions(){return I(this.h,ve,1)}set baseOptions(e){U(this.h,0,1,e)}o(e){return U(this.h,0,2,af(e,I(this.h,Qc,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},wn(this,e,t),this.j}ta(e,t,n){return this.j={classifications:[]},Mn(this,e,n,t),this.j}m(){var e=new Mt;ye(e,"input_image"),ye(e,"norm_rect"),J(e,"classifications");const t=new jt;An(t,iy,this.h);const n=new dt;At(n,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),he(n,"IMAGE:input_image"),he(n,"NORM_RECT:norm_rect"),Q(n,"CLASSIFICATIONS:classifications"),n.o(t),It(e,n),this.g.attachProtoListener("classifications",(i,a)=>{this.j=oy(X5(i)),C(this,a)}),this.g.attachEmptyPacketListener("classifications",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Wt.prototype.classifyForVideo=Wt.prototype.ta,Wt.prototype.classify=Wt.prototype.sa,Wt.prototype.setOptions=Wt.prototype.o,Wt.createFromModelPath=function(e,t){return Z(Wt,e,{baseOptions:{modelAssetPath:t}})},Wt.createFromModelBuffer=function(e,t){return Z(Wt,e,{baseOptions:{modelAssetBuffer:t}})},Wt.createFromOptions=function(e,t){return Z(Wt,e,t)};var zt=class extends Ct{constructor(e,t){super(new gn(e,t),"image_in","norm_rect",!0),this.h=new S0,this.embeddings={embeddings:[]},U(e=this.h,0,1,t=new ve)}get baseOptions(){return I(this.h,ve,1)}set baseOptions(e){U(this.h,0,1,e)}o(e){var t=this.h,n=I(this.h,r0,2);return n=n?n.clone():new r0,e.l2Normalize!==void 0?ne(n,1,fs(e.l2Normalize)):"l2Normalize"in e&&ne(n,1),e.quantize!==void 0?ne(n,2,fs(e.quantize)):"quantize"in e&&ne(n,2),U(t,0,2,n),this.l(e)}za(e,t){return wn(this,e,t),this.embeddings}Aa(e,t,n){return Mn(this,e,n,t),this.embeddings}m(){var e=new Mt;ye(e,"image_in"),ye(e,"norm_rect"),J(e,"embeddings_out");const t=new jt;An(t,ay,this.h);const n=new dt;At(n,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),he(n,"IMAGE:image_in"),he(n,"NORM_RECT:norm_rect"),Q(n,"EMBEDDINGS:embeddings_out"),n.o(t),It(e,n),this.g.attachProtoListener("embeddings_out",(i,a)=>{i=K5(i),this.embeddings=function(l){return{embeddings:Gn(l,Z5,1).map(s=>{var c,f;const r={headIndex:Zt(s,3)??0??-1,headName:We(de(s,4))??""??""};var o=s.v;return th(o,0|o[O],a0,Sc(s,1))!==void 0?(s=na(s=I(s,a0,Sc(s,1),void 0),1,_n,ta()),r.floatEmbedding=s.slice()):(o=new Uint8Array(0),r.quantizedEmbedding=((f=(c=I(s,Q5,Sc(s,2),void 0))==null?void 0:c.na())==null?void 0:f.h())??o),r}),timestampMs:D0(ah(l))}}(i),C(this,a)}),this.g.attachEmptyPacketListener("embeddings_out",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};zt.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=k0(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=k0(z0(e.quantizedEmbedding),z0(t.quantizedEmbedding))}return e},zt.prototype.embedForVideo=zt.prototype.Aa,zt.prototype.embed=zt.prototype.za,zt.prototype.setOptions=zt.prototype.o,zt.createFromModelPath=function(e,t){return Z(zt,e,{baseOptions:{modelAssetPath:t}})},zt.createFromModelBuffer=function(e,t){return Z(zt,e,{baseOptions:{modelAssetBuffer:t}})},zt.createFromOptions=function(e,t){return Z(zt,e,t)};var vf=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(n=>{n.close()}),(t=this.categoryMask)==null||t.close()}};function wy(e){var n,i;const t=function(a){return Gn(a,dt,1)}(e.ca()).filter(a=>(We(de(a,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.u=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((i=(n=I(t[0],jt,7))==null?void 0:n.j())==null?void 0:i.g())??new Map).forEach((a,l)=>{e.u[Number(l)]=We(de(a,1))??""})}function f3(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function d3(e){try{const t=new vf(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{ru(e)}}vf.prototype.close=vf.prototype.close;var ht=class extends Ct{constructor(e,t){super(new gn(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new ef,this.A=new E0,U(this.h,0,3,this.A),U(e=this.h,0,1,t=new ve)}get baseOptions(){return I(this.h,ve,1)}set baseOptions(e){U(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?ne(this.h,2,hs(e.displayNamesLocale)):"displayNamesLocale"in e&&ne(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}L(){wy(this)}segment(e,t,n){const i=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:n,f3(this),wn(this,e,i),d3(this)}La(e,t,n,i){const a=typeof n!="function"?n:{};return this.j=typeof n=="function"?n:i,f3(this),Mn(this,e,a,t),d3(this)}Da(){return this.u}m(){var e=new Mt;ye(e,"image_in"),ye(e,"norm_rect");const t=new jt;An(t,A0,this.h);const n=new dt;At(n,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),he(n,"IMAGE:image_in"),he(n,"NORM_RECT:norm_rect"),n.o(t),It(e,n),su(this,e),this.outputConfidenceMasks&&(J(e,"confidence_masks"),Q(n,"CONFIDENCE_MASKS:confidence_masks"),al(this,"confidence_masks"),this.g.aa("confidence_masks",(i,a)=>{this.confidenceMasks=i.map(l=>sl(this,l,!0,!this.j)),C(this,a)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],C(this,i)})),this.outputCategoryMask&&(J(e,"category_mask"),Q(n,"CATEGORY_MASK:category_mask"),al(this,"category_mask"),this.g.Z("category_mask",(i,a)=>{this.categoryMask=sl(this,i,!1,!this.j),C(this,a)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,C(this,i)})),J(e,"quality_scores"),Q(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,a)=>{this.qualityScores=i,C(this,a)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ht.prototype.getLabels=ht.prototype.Da,ht.prototype.segmentForVideo=ht.prototype.La,ht.prototype.segment=ht.prototype.segment,ht.prototype.setOptions=ht.prototype.o,ht.createFromModelPath=function(e,t){return Z(ht,e,{baseOptions:{modelAssetPath:t}})},ht.createFromModelBuffer=function(e,t){return Z(ht,e,{baseOptions:{modelAssetBuffer:t}})},ht.createFromOptions=function(e,t){return Z(ht,e,t)};var bf=class{constructor(e,t,n){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=n}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(n=>{n.close()}),(t=this.categoryMask)==null||t.close()}};bf.prototype.close=bf.prototype.close;var Cn=class extends Ct{constructor(e,t){super(new gn(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new ef,this.u=new E0,U(this.h,0,3,this.u),U(e=this.h,0,1,t=new ve)}get baseOptions(){return I(this.h,ve,1)}set baseOptions(e){U(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,n,i){const a=typeof n!="function"?n:{};if(this.j=typeof n=="function"?n:i,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.C+1,i=new j0,t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var l=new tf;di(l,3,fs(!0),!1),di(l,1,cs(t.keypoint.x),0),di(l,2,cs(t.keypoint.y),0),gs(i,1,nf,l)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");{const r=new sy;for(l of t.scribble)di(t=new tf,3,fs(!0),!1),di(t,1,cs(l.x),0),di(t,2,cs(l.y),0),Ac(r,1,tf,t);gs(i,2,nf,r)}}this.g.addProtoToStream(i.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",n),wn(this,e,a);e:{try{const r=new bf(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var s=r;break e}this.j(r)}finally{ru(this)}s=void 0}return s}m(){var e=new Mt;ye(e,"image_in"),ye(e,"roi_in"),ye(e,"norm_rect_in");const t=new jt;An(t,A0,this.h);const n=new dt;At(n,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),he(n,"IMAGE:image_in"),he(n,"ROI:roi_in"),he(n,"NORM_RECT:norm_rect_in"),n.o(t),It(e,n),su(this,e),this.outputConfidenceMasks&&(J(e,"confidence_masks"),Q(n,"CONFIDENCE_MASKS:confidence_masks"),al(this,"confidence_masks"),this.g.aa("confidence_masks",(i,a)=>{this.confidenceMasks=i.map(l=>sl(this,l,!0,!this.j)),C(this,a)}),this.g.attachEmptyPacketListener("confidence_masks",i=>{this.confidenceMasks=[],C(this,i)})),this.outputCategoryMask&&(J(e,"category_mask"),Q(n,"CATEGORY_MASK:category_mask"),al(this,"category_mask"),this.g.Z("category_mask",(i,a)=>{this.categoryMask=sl(this,i,!1,!this.j),C(this,a)}),this.g.attachEmptyPacketListener("category_mask",i=>{this.categoryMask=void 0,C(this,i)})),J(e,"quality_scores"),Q(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(i,a)=>{this.qualityScores=i,C(this,a)}),this.g.attachEmptyPacketListener("quality_scores",i=>{this.categoryMask=void 0,C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Cn.prototype.segment=Cn.prototype.segment,Cn.prototype.setOptions=Cn.prototype.o,Cn.createFromModelPath=function(e,t){return Z(Cn,e,{baseOptions:{modelAssetPath:t}})},Cn.createFromModelBuffer=function(e,t){return Z(Cn,e,{baseOptions:{modelAssetBuffer:t}})},Cn.createFromOptions=function(e,t){return Z(Cn,e,t)};var Pt=class extends Ct{constructor(e,t){super(new gn(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},U(e=this.h=new M0,0,1,t=new ve)}get baseOptions(){return I(this.h,ve,1)}set baseOptions(e){U(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?ne(this.h,2,hs(e.displayNamesLocale)):"displayNamesLocale"in e&&ne(this.h,2),e.maxResults!==void 0?Hn(this.h,3,e.maxResults):"maxResults"in e&&ne(this.h,3),e.scoreThreshold!==void 0?L(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&ne(this.h,4),e.categoryAllowlist!==void 0?Rr(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&ne(this.h,5),e.categoryDenylist!==void 0?Rr(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&ne(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},wn(this,e,t),this.j}G(e,t,n){return this.j={detections:[]},Mn(this,e,n,t),this.j}m(){var e=new Mt;ye(e,"input_frame_gpu"),ye(e,"norm_rect"),J(e,"detections");const t=new jt;An(t,ry,this.h);const n=new dt;At(n,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),he(n,"IMAGE:input_frame_gpu"),he(n,"NORM_RECT:norm_rect"),Q(n,"DETECTIONS:detections"),n.o(t),It(e,n),this.g.attachProtoVectorListener("detections",(i,a)=>{for(const l of i)i=e0(l),this.j.detections.push(O0(i));C(this,a)}),this.g.attachEmptyPacketListener("detections",i=>{C(this,i)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Pt.prototype.detectForVideo=Pt.prototype.G,Pt.prototype.detect=Pt.prototype.F,Pt.prototype.setOptions=Pt.prototype.o,Pt.createFromModelPath=async function(e,t){return Z(Pt,e,{baseOptions:{modelAssetPath:t}})},Pt.createFromModelBuffer=function(e,t){return Z(Pt,e,{baseOptions:{modelAssetBuffer:t}})},Pt.createFromOptions=function(e,t){return Z(Pt,e,t)};var xf=class{constructor(e,t,n){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=n}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function h3(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function m3(e){try{const t=new xf(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.u)return t;e.u(t)}finally{ru(e)}}xf.prototype.close=xf.prototype.close;var kt=class extends Ct{constructor(e,t){super(new gn(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,U(e=this.h=new C0,0,1,t=new ve),this.A=new v0,U(this.h,0,3,this.A),this.j=new p0,U(this.h,0,2,this.j),Hn(this.j,4,1),L(this.j,2,.5),L(this.A,2,.5),L(this.h,4,.5)}get baseOptions(){return I(this.h,ve,1)}set baseOptions(e){U(this.h,0,1,e)}o(e){return"numPoses"in e&&Hn(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&L(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&L(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&L(this.A,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}F(e,t,n){const i=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:n,h3(this),wn(this,e,i),m3(this)}G(e,t,n,i){const a=typeof n!="function"?n:{};return this.u=typeof n=="function"?n:i,h3(this),Mn(this,e,a,t),m3(this)}m(){var e=new Mt;ye(e,"image_in"),ye(e,"norm_rect"),J(e,"normalized_landmarks"),J(e,"world_landmarks"),J(e,"segmentation_masks");const t=new jt;An(t,uy,this.h);const n=new dt;At(n,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),he(n,"IMAGE:image_in"),he(n,"NORM_RECT:norm_rect"),Q(n,"NORM_LANDMARKS:normalized_landmarks"),Q(n,"WORLD_LANDMARKS:world_landmarks"),n.o(t),It(e,n),su(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(i,a)=>{this.landmarks=[];for(const l of i)i=vs(l),this.landmarks.push(au(i));C(this,a)}),this.g.attachEmptyPacketListener("normalized_landmarks",i=>{this.landmarks=[],C(this,i)}),this.g.attachProtoVectorListener("world_landmarks",(i,a)=>{this.worldLandmarks=[];for(const l of i)i=nl(l),this.worldLandmarks.push(bs(i));C(this,a)}),this.g.attachEmptyPacketListener("world_landmarks",i=>{this.worldLandmarks=[],C(this,i)}),this.outputSegmentationMasks&&(Q(n,"SEGMENTATION_MASK:segmentation_masks"),al(this,"segmentation_masks"),this.g.aa("segmentation_masks",(i,a)=>{this.segmentationMasks=i.map(l=>sl(this,l,!0,!this.u)),C(this,a)}),this.g.attachEmptyPacketListener("segmentation_masks",i=>{this.segmentationMasks=[],C(this,i)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};kt.prototype.detectForVideo=kt.prototype.G,kt.prototype.detect=kt.prototype.F,kt.prototype.setOptions=kt.prototype.o,kt.createFromModelPath=function(e,t){return Z(kt,e,{baseOptions:{modelAssetPath:t}})},kt.createFromModelBuffer=function(e,t){return Z(kt,e,{baseOptions:{modelAssetBuffer:t}})},kt.createFromOptions=function(e,t){return Z(kt,e,t)},kt.POSE_CONNECTIONS=u3;const cu="https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/latest/face_landmarker.task",yy="https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm",py=()=>{const e=y.useRef(null),[t,n]=y.useState(!1),[i,a]=y.useState("Initializing..."),[l,s]=y.useState(0),[r,o]=y.useState(!1);y.useEffect(()=>{"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(d=>{console.log("ServiceWorker registered:",d)}).catch(d=>{console.log("ServiceWorker registration failed:",d)})},[]);const c=async()=>"caches"in window?await(await caches.open("mediapipe-models-v1")).match(cu)!==void 0:!1,f=async()=>{try{const d=await fetch(cu),m=d.headers.get("content-length"),v=m?parseInt(m,10):0;if(!d.body)throw new Error("No response body");const x=d.body.getReader();let E=0;const g=[];for(;;){const{done:w,value:p}=await x.read();if(w)break;if(g.push(p),E+=p.length,v){const b=Math.round(E/v*100);s(b),a(`Downloading model... ${b}%`)}}return"caches"in window&&await(await caches.open("mediapipe-models-v1")).put(cu,new Response(new Blob(g),{headers:{"Content-Type":"application/octet-stream"}})),!0}catch(d){return console.error("Failed to preload model:",d),!1}};return y.useEffect(()=>{(async()=>{try{a("Checking cached models..."),await c()?a("Using cached model..."):(a("Model not cached. Downloading..."),await f()),a("Loading MediaPipe WASM...");const v=await ua.forVisionTasks(yy);a("Creating face landmarker...");const x=await pe.createFromOptions(v,{baseOptions:{modelAssetPath:cu,delegate:"GPU"},runningMode:"VIDEO",outputFaceBlendshapes:!0,numFaces:2});e.current=x,n(!0),a("Model loaded successfully ✅")}catch(m){console.error("Model init error:",m),a(`Error: ${m==null?void 0:m.message}`),(m==null?void 0:m.name)==="NotAllowedError"&&o(!0)}})()},[]),{faceLandmarkerRef:e,isModelLoaded:t,statusMessage:i,setStatusMessage:a,loadingProgress:l,permissionDenied:r,clearCache:async()=>{"caches"in window&&(await caches.delete("mediapipe-models-v1"),a("Cache cleared. Please refresh to re-download models."))}}},vy=()=>{const[e,t]=y.useState(0),n=y.useRef({lastTime:0,frames:0,fps:0}),i=y.useCallback(()=>{const a=performance.now(),l=n.current;if(l.frames++,a-l.lastTime>=1e3){const s=Math.round(l.frames*1e3/(a-l.lastTime));t(s),l.frames=0,l.lastTime=a}},[]);return{fps:e,updateFPS:i}},by=()=>{const e=y.useRef({value:100,isLookingAway:!1}),t=y.useCallback((l,s,r,o)=>{if(!l||!r||!s)return;const c=l.getContext("2d");if(!c)return;const{width:f,height:h}=l;if(c.clearRect(0,0,f,h),c.drawImage(s,0,0,f,h),o){c.fillStyle="#00FF00";for(const d of r)c.fillRect(d.x*f-.5,d.y*h-.5,1,1)}},[]),n=y.useCallback(l=>{const s=e.current.value/100,r=100,o=20,c=20,f=40;l.fillStyle="rgba(0, 0, 0, 0.3)",l.fillRect(c,f,o,r),l.fillStyle=`rgba(${Math.floor(255*(1-s))}, ${Math.floor(255*s)}, 0, 0.8)`;const h=r*s;l.fillRect(c,f+r-h,o,h),l.fillStyle="#FFFFFF",l.fillRect(c,f+r*(1-s),o,2)},[]),i=y.useCallback((l,s,r,o,c,f,h)=>{if(t(l,s,r,o),c&&f&&h){const d=l.getContext("2d");d&&n(d)}},[t,n]),a=y.useCallback((l,s)=>{const r=l.getContext("2d");r&&(r.clearRect(0,0,l.width,l.height),r.drawImage(s,0,0,l.width,l.height))},[]);return{drawLandmarks:t,drawEngagementBar:n,drawWithEngagementBar:i,clearCanvas:a,engagementRef:e}},xy=50,Sy=()=>{const[e,t]=y.useState(100),[n,i]=y.useState(!1),a=y.useRef(0),l=y.useCallback((s,r,o)=>{if(!o||s.length<468)return;const c=s[33],f=s[263],h=s[1];if(!c||!f||!h)return;const d=(c.x+f.x)*.5,m=(c.y+f.y)*.5,v=d-r.x,x=m-r.y,E=Math.sqrt(v*v+x*x),g=Math.abs(h.y-r.noseY)*100,w=Math.abs(h.x-r.noseX)*100,p=Math.max(0,100-(E*200+g+w)),b=p<xy,A=performance.now();return A-a.current>100&&(t(p),i(b),a.current=A),{engagement:p,isLookingAway:b}},[]);return{engagement:e,isLookingAway:n,analyzeGaze:l,setEngagement:t,setIsLookingAway:i}},Ey=.05,_y=()=>{const[e,t]=y.useState(!1),[n,i]=y.useState(!1),a=y.useCallback((r,o)=>Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),[]),l=y.useCallback((r,o)=>{if(!r||!o)return 0;const c=[1,33,263,61,291,10,152];let f=0,h=0;const d=o[33],m=o[263],v=r[33],x=r[263];if(!d||!m||!v||!x)return 0;const E=a(d,m),g=a(v,x);if(E===0||g===0)return 0;for(const p of c){const b=o[p],A=r[p];if(b&&A){const N=d.x+(A.x-v.x)*E/g,_=d.y+(A.y-v.y)*E/g;f+=a(b,{x:N,y:_}),h++}}return h===0?0:f/h},[a]),s=y.useCallback((r,o,c,f)=>{if(!r.faceLandmarks||r.faceLandmarks.length===0)return o?(f("Reference face not detected."),i(!0),t(!1)):i(!1),null;if(o&&c){let h=null,d=0;for(const m of r.faceLandmarks)l(m,c)<Ey&&(h=m,d++);return d===1?(t(!1),i(!1),f("Reference face tracked."),h):d>1?(t(!0),i(!1),f("Multiple matching faces detected. Tracking suspended."),null):(t(!1),i(!0),f("Reference face not detected."),null)}else{r.faceLandmarks.length>1?(t(!0),f("Multiple faces detected. Set reference for single face tracking.")):(t(!1),f("No reference set. Detecting first face."));const h=r.faceLandmarks[0];return!h||h.length<468?null:h}},[l]);return{multipleFacesDetected:e,referenceFaceNotDetected:n,analyzeFace:s,setMultipleFacesDetected:t,setReferenceFaceNotDetected:i}},Ty=1e3,Ay=(e,t)=>{const[n,i]=y.useState(!1),[a,l]=y.useState("face_detected"),{incrementGazeViolation:s}=n1(),{multipleFacesDetected:r,referenceFaceNotDetected:o,isLookingAway:c}=e;y.useEffect(()=>{let d;return(c||r||o)&&t?d=setTimeout(()=>{i(!0),c?(l("looking_away"),s("looking_away")):r?(l("multiple_faces"),s("multiple_faces")):o&&(l("no_face_detected"),s("no_face_detected"))},Ty):(i(!1),l("face_detected")),()=>{clearTimeout(d)}},[c,r,o,t,s]);const f=y.useCallback(()=>r?"multiple_faces":o?"no_face_detected":c?"looking_away":"face_detected",[r,o,c]),h=y.useCallback(()=>{i(!1),l("face_detected")},[]);return{showGazeWarningModal:n,faceDetectionState:a,getWarningType:f,closeWarningModal:h,setShowGazeWarningModal:i,setFaceDetectionState:l}};class be extends Error{constructor(t,n,i=!1){super(t),this.code=n,this.recoverable=i,this.name="STTError"}}class Ny{constructor(t={}){Qt(this,"config");Qt(this,"mediaRecorder",null);Qt(this,"audioChunks",[]);Qt(this,"recordingStream",null);Qt(this,"autoStopTimeoutId",null);this.config={baseUrl:"http://localhost:8000",provider:"groq",model:"whisper-large-v3-turbo",language:"en",includeTimestamps:!1,temperature:0,...t}}updateConfig(t){this.config={...this.config,...t}}isRecordingSupported(){return!!(navigator.mediaDevices&&typeof navigator.mediaDevices.getUserMedia=="function"&&window.MediaRecorder)}async startRecording(t,n){var i;if(!this.isRecordingSupported())throw new be("Audio recording is not supported in this browser","RECORDING_NOT_SUPPORTED",!1);if(this.isRecording())throw new be("Recording is already in progress","ALREADY_RECORDING",!0);try{this.recordingStream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,sampleRate:44100}}),this.audioChunks=[];const a=this.getSupportedMimeType();this.mediaRecorder=new MediaRecorder(this.recordingStream,{mimeType:a}),this.mediaRecorder.ondataavailable=l=>{var s;l.data.size>0&&(this.audioChunks.push(l.data),(s=n==null?void 0:n.onDataAvailable)==null||s.call(n,l.data))},this.mediaRecorder.onstop=()=>{var l;(l=n==null?void 0:n.onStop)==null||l.call(n)},this.mediaRecorder.onerror=l=>{var r;const s=new be(`Recording failed: ${l.error}`,"RECORDING_ERROR",!0);(r=n==null?void 0:n.onError)==null||r.call(n,s),this.cleanup()},this.mediaRecorder.start(100),(i=n==null?void 0:n.onStart)==null||i.call(n),t&&t>0&&(this.autoStopTimeoutId=setTimeout(()=>{this.isRecording()&&this.stopRecording()},t*1e3))}catch(a){if(this.cleanup(),a instanceof Error){if(a.name==="NotAllowedError"||a.name==="PermissionDeniedError")throw new be("Microphone permission was denied","PERMISSION_DENIED",!1);if(a.name==="NotFoundError")throw new be("No microphone found","NO_MICROPHONE",!1)}throw new be(`Failed to start recording: ${a instanceof Error?a.message:String(a)}`,"START_RECORDING_FAILED",!0)}}async stopRecording(){if(this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null),!this.mediaRecorder||!this.isRecording())throw new be("No active recording to stop","NO_ACTIVE_RECORDING",!1);return new Promise((t,n)=>{if(!this.mediaRecorder){n(new be("MediaRecorder is null","MEDIARECORDER_NULL",!1));return}const i=this.mediaRecorder,a=()=>{try{const l=i.mimeType||"audio/webm",s=new Blob(this.audioChunks,{type:l});this.cleanup(),t(s)}catch(l){n(new be(`Failed to create audio blob: ${l instanceof Error?l.message:String(l)}`,"BLOB_CREATION_FAILED",!1))}};i.addEventListener("stop",a,{once:!0}),i.stop()})}async transcribe(t){const{audioBlob:n}=t;if(!n||n.size===0)throw new be("Audio blob is empty or invalid","INVALID_AUDIO",!1);try{const i=new FormData,a=new File([n],"recording.wav",{type:n.type||"audio/wav"});if(i.append("file",a),i.append("qna_id",this.config.qnaId||""),!this.config.interviewId)throw new be("Interview ID is missing from configuration","MISSING_INTERVIEW_ID",!1);const l=await ui(`${this.config.baseUrl}${ci.TRANSCRIBE_ANSWER(this.config.interviewId)}`,{method:"POST",headers:{accept:"application/json","X-STT-Provider":this.config.provider||"groq",...this.config.authToken&&{Authorization:`Bearer ${this.config.authToken}`}},body:i},{attempts:1,backoff:"exponential",baseDelay:1e3,maxDelay:3e3,jitter:!0});if(!l.ok){const r=await l.text();let o=`STT request failed: ${l.status} ${l.statusText}`;try{const c=JSON.parse(r);o=c.message||c.error||o}catch{o=r||o}throw new be(o,`HTTP_${l.status}`,l.status>=500)}return{transcript:(await l.json()).data.transcribed_text??""}}catch(i){throw i instanceof be?i:new be(`Transcription failed: ${i instanceof Error?i.message:String(i)}`,"TRANSCRIPTION_FAILED",!0)}}cancelRecording(){this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null),this.mediaRecorder&&this.isRecording()&&this.mediaRecorder.stop(),this.cleanup()}isRecording(){return this.mediaRecorder!==null&&this.mediaRecorder.state==="recording"}getSupportedMimeType(){const t=["audio/webm","audio/webm;codecs=opus","audio/ogg;codecs=opus","audio/mp4","audio/wav"];for(const n of t)if(MediaRecorder.isTypeSupported(n))return n;return"audio/webm"}getRecordingStream(){return this.recordingStream}cleanup(){this.recordingStream&&(this.recordingStream.getTracks().forEach(t=>t.stop()),this.recordingStream=null),this.mediaRecorder=null,this.audioChunks=[],this.autoStopTimeoutId&&(clearTimeout(this.autoStopTimeoutId),this.autoStopTimeoutId=null)}}const rl=new Ny,jy=(e,t,n,i)=>{const a=y.useRef(null);return y.useEffect(()=>{if(!t)return;const l=async()=>{try{const o=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:640},height:{ideal:480},facingMode:"user"}});e.current&&(e.current.srcObject=o,e.current.onloadeddata=()=>{n()})}catch(o){console.error("Camera access error:",o),i("Camera access failed")}},s=a.current,r=e.current;return l(),()=>{s&&cancelAnimationFrame(s),r!=null&&r.srcObject&&r.srcObject.getTracks().forEach(c=>c.stop())}},[t,n]),y.useEffect(()=>{const l=rl.getRecordingStream();if(l&&e.current){e.current.srcObject=l;const s=l.getVideoTracks(),r=l.getAudioTracks(),o=()=>{console.log("Media track ended - permission may have been revoked")};[...s,...r].forEach(c=>{c.addEventListener("ended",o)})}},[]),{animationFrameRef:a}},My=(e,t,n,i,a,l,s,r,o,c,f,h,d,m,v)=>{const x=y.useRef(null),E=y.useCallback(()=>{var b;const g=e.current,w=t.current,p=n.current;if(!g||g.readyState<2||!p||!w){x.current=requestAnimationFrame(E);return}i();try{const A=performance.now(),N=p.detectForVideo(g,A);if(((b=N.faceLandmarks)==null?void 0:b.length)>0){v(!1);const _=a(N,o,c.current,m);_?(l(w,g,_,f,h,d,o),o&&d&&r(_,c.current,d)):s(w,g)}else s(w,g),o?(v(!0),m("Reference face not detected.")):v(!1)}catch(A){console.error("Face detection error:",A)}x.current=requestAnimationFrame(E)},[e,t,n,i,a,l,s,r,o,c,f,h,d,m,v]);return{renderLoop:E,animationFrameRef:x}},Cy=(e,t,n,i)=>{const{referenceSet:a,referenceRef:l,setReferenceData:s}=n1(),r=y.useRef(l),o=y.useCallback(()=>{r.current=l},[l]),c=y.useCallback(()=>{var d;const f=e.current,h=t.current;if(console.log({faceLandmarker:f,video:h}),!(!f||!h))try{const m=performance.now(),v=f.detectForVideo(h,m);if((d=v.faceLandmarks)!=null&&d[0]){const x=v.faceLandmarks[0],E=x[33],g=x[263],w=x[1];E&&g&&w&&(r.current={x:(E.x+g.x)*.5,y:(E.y+g.y)*.5,noseX:w.x,noseY:w.y},s(!0,r.current),n("Reference set. Gaze tracking active."),console.log("Reference set. Gaze tracking active.",r.current),i&&i())}}catch(m){console.error("Set reference error:",m),n("Failed to set reference")}},[e,t,n,s,i]);return{referenceSet:a,referenceRef:r,setReference:c,syncReference:o}},Sf=({isOpen:e,onClose:t,children:n,title:i,showCloseButton:a=!0,closeOnOverlayClick:l=!0,closeOnEscape:s=!0,className:r=""})=>{if(y.useEffect(()=>{if(!e||!s)return;const f=h=>{h.key==="Escape"&&t()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,s,t]),y.useEffect(()=>(e?(document.body.style.overflow="hidden",document.body.classList.add("interview-widget-container")):(document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")),()=>{document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")}),[e]),!e)return null;const o=f=>{l&&f.target===f.currentTarget&&t()},c=u.jsxs("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center",children:[u.jsx("div",{className:"iw-fixed iw-inset-0 iw-bg-black iw-bg-opacity-50 iw-transition-opacity",onClick:o}),u.jsxs("div",{className:`iw-relative iw-bg-white iw-rounded-lg iw-shadow-xl iw-max-w-md iw-w-full iw-mx-4 iw-max-h-[90vh] iw-overflow-hidden ${r}`,role:"dialog","aria-modal":"true","aria-labelledby":i?"dialog-title":void 0,children:[(i||a)&&u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between iw-p-4 iw-border-b iw-border-gray-200",children:[i&&u.jsx("h2",{id:"dialog-title",className:"iw-text-lg iw-font-semibold iw-text-gray-900",children:i}),a&&u.jsx("button",{onClick:t,className:"iw-p-1 iw-text-gray-400 iw-hover:text-gray-600 iw-transition-colors iw-rounded iw-hover:bg-gray-100","aria-label":"Close dialog",children:u.jsx("svg",{className:"iw-w-5 iw-h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),u.jsx("div",{className:"iw-p-4 iw-overflow-y-auto",children:n})]})]});return Zi.createPortal(c,document.body)},g3=({children:e,variant:t="primary",size:n="md",fullWidth:i=!1,isLoading:a=!1,disabled:l,className:s="",...r})=>{const o="iw-inline-flex iw-items-center iw-justify-center iw-rounded-md iw-font-medium iw-transition-colors iw-focus:outline-none iw-focus:ring-2 iw-focus:ring-primary-500 iw-focus:ring-offset-2",c={primary:"iw-bg-primary-600 iw-text-white iw-hover:bg-primary-700 iw-border iw-border-transparent",secondary:"iw-bg-primary-100 iw-text-primary-700 iw-hover:bg-primary-200 iw-border iw-border-transparent",outline:"iw-bg-transparent iw-text-primary-700 iw-border iw-border-primary-500 iw-hover:bg-primary-50",text:"iw-bg-transparent iw-text-primary-600 iw-hover:bg-primary-50 iw-border iw-border-transparent",gradient:"iw-text-white iw-border iw-border-transparent iw-bg-gradient-to-r iw-from-purple-500 iw-to-indigo-500 hover:iw-from-purple-600 hover:iw-to-indigo-600"},f={sm:"iw-px-3 iw-py-1.5 iw-text-sm",md:"iw-px-4 iw-py-2.5 iw-text-sm",lg:"iw-px-5 iw-py-3 iw-text-base"},h="iw-disabled:opacity-50 iw-disabled:cursor-not-allowed iw-disabled:pointer-events-none",d=i?"iw-w-full":"";return u.jsxs("button",{className:`${o} ${c[t]} ${f[n]} ${d} ${h} ${s}`,disabled:l||a,...r,children:[a&&u.jsx(o1,{height:16,width:16,style:{marginRight:"3px"}}),e]})},Ss=e=>{const{baseColor:t,borderRadius:n}=$l(),{loading:i,children:a,...l}=e;return u.jsx(g3,{style:{background:o6(t),borderRadius:n},...l,children:i?u.jsx(o1,{}):a})};function Dy({isOpen:e,onClose:t,warningType:n}){const i=c1[n],a=i.icon,l=()=>{t()};return n==="face_detected"?null:u.jsx(Sf,{isOpen:e,onClose:t,children:e&&u.jsx("div",{className:"iw-bg-white iw-border-white iw-border iw-p-0 iw-shadow-lg sm:iw-max-w-md",children:u.jsxs("div",{children:[u.jsx("div",{className:"iw-sr-only",children:i.description}),u.jsxs("div",{className:"iw-px-8 iw-py-8 iw-text-center",children:[u.jsx("div",{className:`iw-mx-auto iw-mb-6 iw-flex iw-h-16 iw-w-16 iw-items-center iw-justify-center iw-rounded-full ${i.iconBg} border ${i.iconBorder}`,children:u.jsx(a,{className:`iw-h-7 iw-w-7 ${i.iconColor}`})}),u.jsx("h1",{className:"iw-text-foreground iw-mb-3 iw-text-2xl iw-font-bold iw-tracking-tight",children:i.title}),u.jsx("h2",{className:"iw-text-gray-500 iw-mb-6 iw-text-base iw-font-medium",children:i.subtitle}),u.jsx("p",{className:"iw-text-neutral-400 iw-mx-auto iw-mb-8 iw-max-w-sm iw-text-sm iw-leading-relaxed",children:i.description}),u.jsx(Ss,{onClick:l,className:"iw-w-full iw-bg-gray-800 iw-text-white hover:iw-bg-gray-800",children:i.buttonText})]})]})})})}const w3=y.forwardRef(({className:e="",interviewId:t="",interview_duration:n,showProctoringUI:i=!0,onSetReference:a,isAnswering:l,onProctoringStatusChange:s,showStatusOverlay:r=!1},o)=>{var Yw;const{authToken:c}=a1(),f=c?f6(c):null,{borderRadius:h}=$l(),d=h??18,{proctoring:m}=Ko(),v=!!(m!=null&&m.gazeAnalysisEnabled),[x,E]=y.useState(!1),[g,w]=y.useState((m==null?void 0:m.showLandmarks)??!1),[p,b]=y.useState(i&&((m==null?void 0:m.showEngagementBar)??!0)),[A,N]=y.useState(v),[_,M]=y.useState(!1),T=y.useRef(null),D=y.useRef(null),Ee=y.useRef(null),Re=y.useRef(null),rt=y.useCallback(async St=>{const Er=T.current,ft=Ee.current;if(!Er||!ft)return;const Jl=ft.getContext("2d");Jl&&(ft.width=Er.videoWidth,ft.height=Er.videoHeight,Jl.save(),Jl.scale(-1,1),Jl.drawImage(Er,-ft.width,0,ft.width,ft.height),Jl.restore(),await new Promise(Vo=>ft.toBlob(Vo,"image/jpeg")))},[j6,t]);y.useEffect(()=>{let St;return l&&(M(!0),St=setTimeout(()=>M(!1),1e3)),()=>{St&&clearTimeout(St)}},[l]);const{faceLandmarkerRef:cn,isModelLoaded:xt,statusMessage:j,setStatusMessage:G,loadingProgress:R,permissionDenied:$,clearCache:se}=py(),{fps:ut,updateFPS:bn}=vy(),{drawWithEngagementBar:fn,clearCanvas:Xt,engagementRef:ot}=by(),{engagement:ct,isLookingAway:dn,analyzeGaze:Ce,setEngagement:Xi,setIsLookingAway:Il}=Sy(),{multipleFacesDetected:br,referenceFaceNotDetected:xr,analyzeFace:J2,setMultipleFacesDetected:Bo,setReferenceFaceNotDetected:Ma}=_y(),{referenceSet:Sr,referenceRef:Ro,setReference:V,syncReference:_e}=Cy(cn,T,G,a),Ca={multipleFacesDetected:br,referenceFaceNotDetected:xr,isLookingAway:dn},{showGazeWarningModal:Go,getWarningType:Ho,closeWarningModal:Vw,setShowGazeWarningModal:qw,setFaceDetectionState:Fw}=Ay(Ca,v&&!r);y.useEffect(()=>{if(s){const St=Ho()||"face_detected";s(St)}},[br,xr,dn,Ho,s]);const{renderLoop:e7}=My(T,D,cn,bn,J2,fn,Xt,Ce,Sr,Ro,g,p,v,G,Ma);jy(T,xt,e7,G),y.useEffect(()=>{_e()},[_e]),y.useEffect(()=>{ot&&ot.current&&(ot.current.value=ct,ot.current.isLookingAway=dn)},[ct,dn,ot]);const t7=y.useCallback(St=>{N(St),St||(Xi(100),Il(!1))},[Xi,Il]),n7=y.useCallback(()=>{Il(!1),Bo(!1),Ma(!1),Fw("face_detected"),qw(!1),Vw()},[Il,Bo,Ma,Fw,qw,Vw]),i7={engagement:ct,fps:ut,isLookingAway:dn,multipleFacesDetected:br,referenceFaceNotDetected:xr};return y.useEffect(()=>{const St=[];return(async()=>{try{const ft=await navigator.mediaDevices.getUserMedia({video:!0,audio:!1});Re.current=ft,T.current&&(T.current.srcObject=ft);const Vo=(n??Tr)*60*1e3/3,a7=[0,1,2].map((Da,Qi)=>({label:`capture-${Qi+1}`,start:Qi*Vo,end:(Qi+1)*Vo})),l7=(Da,Qi)=>Da===Qi?Da:Math.random()*(Qi-Da)+Da;a7.forEach(({label:Da,start:Qi,end:s7},r7)=>{let W2;r7===0?W2=3e3:W2=l7(Qi,s7),St.push(setTimeout(()=>{rt(Da)},W2))})}catch(ft){console.error("Error accessing camera:",ft)}})(),()=>{Re.current&&Re.current.getTracks().forEach(ft=>ft.stop()),St.forEach(clearTimeout)}},[rt]),y.useImperativeHandle(o,()=>({setReference:()=>{V()},stopCamera:()=>{Re.current&&(Re.current.getTracks().forEach(St=>St.stop()),Re.current=null)}}),[V]),u.jsxs("div",{className:`iw-relative iw-h-full iw-w-full ${e}`,children:[$?u.jsxs("div",{className:"iw-rounded-md iw-border iw-border-red-600 iw-p-5 iw-text-red-600",children:[u.jsx("h2",{children:"Camera Permission Denied"}),u.jsx("p",{children:"Please allow camera access to use this application."})]}):u.jsx("div",{className:"iw-flex iw-w-full iw-h-full iw-justify-start iw-items-start",children:u.jsxs("div",{className:`iw-relative iw-max-w-full iw-max-h-full iw-aspect-video iw-rounded-2xl iw-overflow-hidden iw-bg-black ${_?"iw-animate-answer-start":""} ${l?"iw-border-4 iw-border-[#6296FB]":""}`,style:{width:"100%",height:"auto",minHeight:"0"},children:[u.jsx("video",{ref:T,autoPlay:!0,playsInline:!0,muted:!0,className:"iw-absolute iw-inset-0 iw-w-full iw-h-full iw-object-cover",style:{transform:"scaleX(-1)"}}),v&&u.jsx("canvas",{ref:D,width:320,height:240,className:"iw-absolute iw-inset-0 iw-w-full iw-h-full iw-object-cover",style:{transform:"scaleX(-1)",borderRadius:d}}),u.jsx("canvas",{ref:Ee,style:{display:"none"}}),i&&u.jsxs("div",{className:"iw-absolute iw-top-4 iw-right-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-[#FFEBE6] iw-px-2 iw-py-1 iw-backdrop-blur-md",children:[u.jsx("div",{className:"iw-size-2 iw-animate-pulse iw-rounded-full iw-bg-red-500"}),u.jsx("span",{className:"iw-font-medium iw-text-xs iw-text-[#E94315]",children:"RECORDING"})]}),i&&((Yw=f==null?void 0:f.data)==null?void 0:Yw.user_name)&&u.jsx("div",{className:"iw-absolute iw-z-50 iw-bottom-4 iw-right-4 iw-inline-flex iw-items-center iw-gap-2 iw-rounded-lg iw-border iw-border-white/10 iw-bg-[#F1F5FE] iw-px-3 iw-py-1 iw-backdrop-blur-md",children:u.jsx("span",{className:"iw-font-medium iw-text-xs iw-text-[#062260]",children:f.data.user_name})}),i&&u.jsx("div",{className:"iw-absolute iw-bottom-4 iw-right-4",children:u.jsx(C6,{showControls:(m==null?void 0:m.showControls)??!1,isBubbleOpen:x,setIsBubbleOpen:E,setReference:V,clearCache:se,isModelLoaded:xt,gazeAnalysisEnabled:A&&v,referenceSet:Sr,showLandmarks:g,setShowLandmarks:w,showEngagementBar:p,setShowEngagementBar:b,handleToggleGazeAnalysis:t7,stats:i7,statusMessage:j,loadingProgress:R})}),r&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"iw-absolute iw-inset-0 iw-pointer-events-none iw-z-10 ",style:{background:"radial-gradient(ellipse 20% 40% at 50% 45%, transparent 99.5%, rgba(0,0,0,0.35) 100%)"}}),u.jsx("div",{className:"iw-absolute iw-bottom-2 iw-inset-x-0 iw-flex iw-justify-center iw-pointer-events-none iw-z-20",children:u.jsx(Oy,{status:Ho()??"face_detected"})})]})]})}),v&&Go&&!r&&u.jsx(Dy,{isOpen:Go,onClose:n7,warningType:Ho()})]})}),Oy=({status:e})=>{const t=c1[e];if(!t)return null;const n=e!=="face_detected";return u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-gap-2",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2 iw-px-3 iw-py-1 iw-rounded-full iw-backdrop-blur-md iw-shadow-sm transition-colors duration-300 iw-text-white",children:[u.jsx("div",{className:`iw-flex iw-h-4 iw-w-4 iw-items-center iw-size-2.5 iw-justify-center iw-rounded-full iw-text-white ${n?"iw-bg-[#E94315]":"iw-bg-[#22C55E]"}`,children:n?u.jsx(r1,{}):u.jsx(Nr,{})}),u.jsx("span",{className:"iw-text-sm iw-font-medium",children:e==="face_detected"?"Face detected clearly":t.title})]}),n&&u.jsx("span",{className:"iw-text-white iw-text-center iw-text-sm iw-drop-shadow-sm iw-max-w-[400px] iw-px-3 ",children:"Sit upright & look directly into the camera"})]})},y3=({micEnabled:e=!1,videoEnabled:t=!1,buttonText:n,onButtonClick:i,isAgreed:a,onAgreedToggle:l,showCheckbox:s=!0,showMediaIcons:r=!0,disabled:o=!1})=>{const c=o||!a||r&&(!e||!t);return u.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-6 iw-w-full",children:[s&&u.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3 iw-bg-[#F1F5FE] iw-rounded-xl iw-p-4 iw-border iw-border-[#E7EAF1]",children:[u.jsx("div",{className:`iw-mt-0.5 iw-h-5 iw-w-5 iw-min-w-[20px] iw-rounded iw-border iw-flex iw-items-center iw-justify-center iw-cursor-pointer iw-transition-colors ${a?"iw-bg-[#062260] iw-border-[#062260]":"iw-bg-white iw-border-[#B3B9CB]"}`,onClick:f=>{f.stopPropagation(),l(!a)},children:a&&u.jsx(Nr,{className:"iw-size-3 iw-text-white"})}),u.jsx("label",{onClick:()=>l(!a),className:"iw-text-sm iw-text-[#062260] iw-font-medium iw-cursor-pointer iw-select-none",children:"By continuing, you acknowledge and consent to the use of your face data exclusively for interview monitoring"})]}),u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-4",children:[r&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"iw-relative",children:[u.jsx("div",{className:`iw-flex iw-h-12 iw-w-16 iw-items-center iw-justify-center iw-rounded-xl iw-border iw-transition-all ${e?"iw-border-[#E7EAF1] iw-bg-white iw-text-[#062260]":"iw-border-rose-200 iw-bg-rose-50 iw-text-rose-600"}`,children:e?u.jsx(y6,{className:"iw-h-6 iw-w-6"}):u.jsx(p6,{className:"iw-h-6 iw-w-6"})}),e&&u.jsx("div",{className:"iw-absolute -iw-right-1 -iw-top-1 iw-flex iw-h-4 iw-w-4 iw-items-center iw-justify-center iw-rounded-full iw-bg-[#22C55E] iw-text-white",children:u.jsx(Nr,{className:"iw-h-2.5 iw-w-2.5"})})]}),u.jsxs("div",{className:"iw-relative",children:[u.jsx("div",{className:`iw-flex iw-h-12 iw-w-16 iw-items-center iw-justify-center iw-rounded-xl iw-border iw-transition-all ${t?"iw-border-[#E7EAF1] iw-bg-white iw-text-[#062260]":"iw-border-rose-200 iw-bg-rose-50 iw-text-rose-600"}`,children:t?u.jsx(_6,{className:"iw-h-6 iw-w-6"}):u.jsx(T6,{className:"iw-h-6 iw-w-6"})}),t&&u.jsx("div",{className:"iw-absolute -iw-right-1 -iw-top-1 iw-flex iw-h-4 iw-w-4 iw-items-center iw-justify-center iw-rounded-full iw-bg-[#22C55E] iw-text-white",children:u.jsx(Nr,{className:"iw-h-2.5 iw-w-2.5"})})]})]}),u.jsx(g3,{onClick:i,disabled:c,className:`iw-h-12 iw-flex-1 iw-max-w-[220px] !iw-bg-[#F1F5FE] !iw-text-[#062260] !iw-font-bold iw-border-none iw-rounded-lg ${c?"iw-opacity-50":"hover:iw-opacity-75"}`,children:n})]})]})},zy=({steps:e,currentStepIndex:t})=>u.jsx("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-4 iw-w-full iw-py-6",children:e.map((n,i)=>{const a=i<t,l=i===t;return u.jsxs(y.Fragment,{children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-3",children:[u.jsx("div",{className:`iw-flex iw-size-9 iw-text-[#062260] iw-items-center iw-justify-center iw-rounded-full iw-font-semibold iw-border ${l||a?"iw-border-[#0EB00E] iw-bg-[#E9FFE6]":"iw-border-[#BDE0FD] iw-bg-[#E6F3FF]"}`,children:a?u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:u.jsx("polyline",{points:"20 6 9 17 4 12"})}):i+1}),u.jsx("span",{className:`iw-text-sm iw-font-medium ${l||a?"iw-text-[#062260]":"iw-text-[#5C6686]"}`,children:n.label})]}),i<e.length-1&&u.jsx("div",{className:"iw-flex-1 iw-max-w-[120px] iw-border-t iw-border-dotted iw-border-[#B3B9CB]"})]},i)})}),ky=["Don't refresh or reload the page during your assessment","Don't switch tabs or open other applications while session is ongoing","Don't leave your position during the session","Don't disable or interfere with video/audio monitoring"],Ly=({isOpen:e,onStart:t,gazeEnabled:n=!1,videoFeedRef:i,interviewId:a="",interview_duration:l=Tr})=>{const s=y.useRef(null),r=y.useRef(null),[o,c]=y.useState(!1),[f,h]=y.useState(!1),[d,m]=y.useState(0),[v,x]=y.useState(!1),E=y.useRef(null),g=y.useRef(null),w=T=>{E.current=T,i&&(typeof i=="function"?i(T):i.current=T)},p=()=>{r.current&&(r.current.getTracks().forEach(T=>T.stop()),r.current=null)},b=async()=>{try{const T=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:1280},height:{ideal:720}},audio:!0});r.current=T,s.current&&(s.current.srcObject=T),c(!0)}catch(T){console.error("Media permission error:",T);let D="Unable to access camera or microphone.";(T==null?void 0:T.name)==="NotAllowedError"?D="Permissions denied. Please allow access to camera and microphone.":(T==null?void 0:T.name)==="NotFoundError"?D="No camera/microphone found. Please connect a device and retry.":T!=null&&T.message&&(D=T.message),c(!1),console.log(D)}finally{}};if(y.useEffect(()=>{if(!e){p();return}return b(),()=>p()},[e]),y.useEffect(()=>()=>{g.current&&(clearInterval(g.current),g.current=null)},[]),!e)return null;const[A,N]=y.useState("face_detected"),_=async()=>{h(!0);const T=()=>{var D;return(D=E.current)==null?void 0:D.setReference()};T(),g.current&&clearInterval(g.current),g.current=setInterval(T,500)},M=[{label:n?"Calibrate your camera":"Camera & Mic permission"},{label:"Basic guidelines"}];return u.jsx("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-gray-900/40 iw-backdrop-blur-sm iw-p-4 iw-overflow-auto",children:u.jsxs("div",{className:"iw-w-full iw-max-w-[700px] iw-bg-white iw-rounded-xl iw-shadow-2xl iw-overflow-auto",children:[u.jsxs("div",{className:"iw-px-5 iw-pt-5",children:[u.jsx("h2",{className:"iw-text-[#062260] iw-text-2xl iw-font-medium iw-tracking-tight",children:"Final checks before you go live"}),u.jsx("div",{className:"iw-mt-4 iw-bg-[#F1F5FE] iw-rounded-xl iw-p-3 iw-border iw-border-[#E7EAF1]",children:u.jsx("p",{className:"iw-text-[#5C6686] iw-text-sm iw-leading-relaxed",children:"To ensure the integrity of the interview process, this platform uses your device’s camera to monitor your face and gaze direction. We do not store any outside this session"})}),u.jsx("div",{className:"iw-mt-6 iw-border-b iw-border-dashed iw-border-[#B3B9CB] iw-w-full"}),u.jsx(zy,{steps:M,currentStepIndex:d})]}),u.jsx("div",{className:"iw-px-5 iw-pb-5 iw-flex iw-flex-col iw-items-center",children:d===0?u.jsxs("div",{className:"iw-w-full iw-flex iw-flex-col iw-items-center iw-gap-6",children:[u.jsx("div",{className:"iw-w-full iw-max-w-[600px] iw-aspect-video iw-bg-slate-100 iw-rounded-2xl iw-overflow-hidden iw-relative iw-border iw-border-slate-200",children:n?u.jsx(w3,{ref:w,interviewId:a,interview_duration:l,showProctoringUI:!1,showStatusOverlay:!0,onProctoringStatusChange:N,onSetReference:()=>{g.current&&(clearInterval(g.current),g.current=null),h(!1),m(1)}}):u.jsx("video",{ref:s,autoPlay:!0,playsInline:!0,muted:!0,className:"iw-w-full iw-h-full iw-object-cover",style:{transform:"scaleX(-1)"}})}),u.jsx(y3,{micEnabled:o,videoEnabled:o,buttonText:n?f?"Calibrating...":"Start calibrate":"Next",onButtonClick:()=>{n?_():m(1)},disabled:!v||n&&A!=="face_detected"||!n&&!o,isAgreed:v,onAgreedToggle:x})]}):u.jsxs("div",{className:"iw-w-full iw-flex iw-flex-col iw-gap-6",children:[u.jsx("div",{className:"iw-w-full iw-bg-[#F8FAFF] iw-rounded-2xl iw-p-8 iw-flex iw-flex-col iw-gap-5",children:ky.map((T,D)=>u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-4",children:[u.jsx("div",{className:"iw-flex iw-h-7 iw-w-7 iw-min-w-[28px] iw-items-center iw-justify-center iw-rounded-full iw-bg-[#DBEAFE] iw-text-[#062260] iw-text-xs iw-font-bold",children:D+1}),u.jsx("span",{className:"iw-text-[#5C6686] iw-font-medium",children:T})]},D))}),u.jsx(y3,{buttonText:"Start interview",onButtonClick:()=>{t(),p()},isAgreed:v,onAgreedToggle:x,showMediaIcons:!1})]})})]})})};var K=(e=>(e.IDLE="idle",e.FETCHING_QUESTION="fetching_question",e.READING_QUESTION="reading_question",e.THINKING="thinking",e.ANSWERING="answering",e.TRANSCRIBING="transcribing",e.EDITING="editing",e.SUBMITTING="submitting",e.COMPLETED="completed",e))(K||{});const p3={thinkingDuration:0,answeringDuration:120,editingDuration:30},v3={idle:{next:"fetching_question"},fetching_question:{next:"reading_question"},reading_question:{next:"answering"},thinking:{next:"answering",duration:0},answering:{next:"transcribing",duration:120},transcribing:{next:"editing"},editing:{next:"submitting",duration:30},submitting:{next:"completed"},completed:{next:"completed"}};class Uy{constructor(t={},n={}){Qt(this,"config");Qt(this,"state");Qt(this,"phaseIntervalId",null);Qt(this,"globalIntervalId",null);Qt(this,"callbacks");this.config={...p3,...t},this.callbacks=n,this.state={phase:"idle",currentPhaseTimeRemaining:0,totalTimeElapsed:0,currentQuestionNumber:0}}updateConfig(t){this.config={...this.config,...t}}getState(){return{...this.state}}startQuestion(){this.state.currentQuestionNumber===0&&this.startGlobalTimer(),this.state.currentQuestionNumber=this.state.currentQuestionNumber+1,this.state.phase="fetching_question",this.notifyChange()}nextPhase(){const t=this.state.phase;let n=v3[t];if(!n)return;if(n.next==="editing"&&this.config.editingDuration===0){const a=v3.editing;a&&(n=a)}this.stopPhaseTimer(),this.state.phase=n.next;const i=this.getDurationForPhase(n.next);i>0?(this.state.currentPhaseTimeRemaining=i,this.startPhaseTimer()):this.state.currentPhaseTimeRemaining=0,this.notifyChange()}completeInterview(){var t,n;this.stopGlobalTimer(),this.stopPhaseTimer(),this.state.phase="completed",(n=(t=this.callbacks).onInterviewEnd)==null||n.call(t),this.notifyChange()}destroy(){this.stopPhaseTimer(),this.stopGlobalTimer()}getDurationForPhase(t){switch(t){case"thinking":return this.config.thinkingDuration;case"answering":return this.config.answeringDuration;case"editing":return this.config.editingDuration;default:return 0}}startGlobalTimer(){this.globalIntervalId=setInterval(()=>{var t,n;this.state.totalTimeElapsed++,(n=(t=this.callbacks).onTick)==null||n.call(t,this.getState())},1e3)}stopGlobalTimer(){this.globalIntervalId&&(clearInterval(this.globalIntervalId),this.globalIntervalId=null)}startPhaseTimer(){this.phaseIntervalId=setInterval(()=>{this.state.currentPhaseTimeRemaining--,this.state.currentPhaseTimeRemaining<=0&&this.nextPhase()},1e3)}stopPhaseTimer(){this.phaseIntervalId&&(clearInterval(this.phaseIntervalId),this.phaseIntervalId=null)}notifyChange(){var t,n;(n=(t=this.callbacks).onPhaseChange)==null||n.call(t,this.state.phase,this.getState())}}function By(e={}){const{config:t={},callbacks:n={}}=e,i=y.useRef(null);i.current||(i.current=new Uy(t,{}));const a=i.current,[l,s]=y.useState(a.getState()),r=y.useCallback(()=>{s(a.getState())},[a]);y.useEffect(()=>{const h={onPhaseChange:(d,m)=>{var v;r(),(v=n.onPhaseChange)==null||v.call(n,d,m)},onTick:d=>{var m;r(),(m=n.onTick)==null||m.call(n,d)},onInterviewEnd:()=>{var d;r(),(d=n.onInterviewEnd)==null||d.call(n)}};a.callbacks=h},[a,n,r]),y.useEffect(()=>{a.updateConfig(t)},[a,t]),y.useEffect(()=>()=>{a.destroy()},[a]);const o=y.useCallback(()=>{a.startQuestion(),r()},[a,r]),c=y.useCallback(()=>{a.nextPhase(),r()},[a,r]),f=y.useCallback(()=>{a.completeInterview(),r()},[a,r]);return{state:l,startQuestion:o,nextPhase:c,completeInterview:f,timerService:a}}function Ry(e,t={}){const[n,i]=y.useState({data:null,loading:!1,error:null}),a=y.useCallback(async(...l)=>{var s,r,o,c;i(f=>({...f,loading:!0,error:null}));try{const f=await e(...l);i(h=>({...h,data:f,loading:!1,error:null})),(s=t.onSuccess)==null||s.call(t,f),(r=t.onSettled)==null||r.call(t,f,null)}catch(f){const h=f.type?f:{type:"unknown",message:f.message||"Unknown error",retryable:!0,userMessage:"Something went wrong. Please try again.",originalError:f};i(d=>({...d,loading:!1,error:h})),(o=t.onError)==null||o.call(t,h),(c=t.onSettled)==null||c.call(t,null,h)}},[e,t]);return{...n,execute:a}}const Gy=e=>{const[t,n]=y.useState(null),[i,a]=y.useState(!1),l=document,s=()=>!!(l.fullscreenEnabled||l.webkitFullscreenEnabled||l.mozFullScreenEnabled||l.msFullscreenEnabled),r=()=>l.fullscreenElement||l.webkitFullscreenElement||l.mozFullScreenElement||l.msFullscreenElement,o=async m=>{var v;try{if(!s())throw new Error("Fullscreen is not supported in this environment");m.requestFullscreen?await m.requestFullscreen():m.webkitRequestFullscreen?await m.webkitRequestFullscreen():m.mozRequestFullScreen?await m.mozRequestFullScreen():m.msRequestFullscreen&&await m.msRequestFullscreen()}catch(x){const E={name:"FullscreenError",message:x instanceof Error?x.message:"Failed to enter fullscreen"};n(E),(v=e==null?void 0:e.onError)==null||v.call(e,E)}},c=async()=>{var m;try{l.exitFullscreen?await l.exitFullscreen():l.webkitExitFullscreen?await l.webkitExitFullscreen():l.mozCancelFullScreen?await l.mozCancelFullScreen():l.msExitFullscreen&&await l.msExitFullscreen()}catch(v){const x={name:"FullscreenError",message:v instanceof Error?v.message:"Failed to exit fullscreen"};n(x),(m=e==null?void 0:e.onError)==null||m.call(e,x)}},f=y.useCallback(()=>{var v;const m=!!r();a(m),(v=e==null?void 0:e.onFullScreenChange)==null||v.call(e,m)},[e]);y.useEffect(()=>{const m=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"];return m.forEach(v=>{document.addEventListener(v,f)}),()=>{m.forEach(v=>{document.removeEventListener(v,f)})}},[f]);const h=async m=>{n(null);const v=m??document.documentElement;await o(v)};return{isFullScreen:i,toggleFullScreen:async m=>{i?await c():await h(m)},enterFullScreen:h,exitFullScreen:c,error:t}};function b3(){const e=Ar();return y.useMemo(()=>{const n=e.api||{};return new f1(n)},[e.api])}const Hy=e=>{y.useEffect(()=>{const t=i=>{(i.ctrlKey||i.metaKey)&&["c","v","a","t","n","w","r","s","p"].includes(i.key.toLowerCase())&&(i.preventDefault(),e({type:"blocked_shortcut",severity:"low",details:{action:"shortcut_pressed",reason:`Attempted to use a blocked keyboard shortcut: Ctrl + ${i.key}`}})),i.key.startsWith("F")&&i.key.length<=3&&(i.preventDefault(),e({type:"blocked_function_key",severity:"low",details:{action:"function_key_pressed",reason:`Attempted to use a blocked function key: ${i.key}`}})),i.altKey&&i.key==="Tab"&&(i.preventDefault(),e({type:"alt_tab_attempt",severity:"medium",details:{action:"alt_tab",reason:"Attempted to use the Alt + Tab shortcut"}}))},n=i=>{i.preventDefault(),e({type:"right_click_attempt",severity:"low",details:{action:"right_click",reason:"Attempted to use the right click"}})};return document.addEventListener("keydown",t),document.addEventListener("contextmenu",n),()=>{document.removeEventListener("keydown",t),document.removeEventListener("contextmenu",n)}},[e])},Vy=(e={})=>{const[t,n]=y.useState(!1),[i,a]=y.useState(!1),[l,s]=y.useState(null),[r,o]=y.useState(null),[c,f]=y.useState(null);e.config&&rl.updateConfig(e.config);const h=y.useCallback(async x=>{var E;try{o(null),s(null),f(null),await rl.startRecording(x,{onStart:()=>{var g;n(!0),(g=e.onStart)==null||g.call(e)},onStop:()=>{var g;n(!1),(g=e.onStop)==null||g.call(e)},onError:g=>{var p;const w=g instanceof be?g:new be(g.message,"RECORDING_ERROR",!0);o(w),n(!1),(p=e.onError)==null||p.call(e,w)}})}catch(g){const w=g instanceof be?g:new be(g instanceof Error?g.message:String(g),"START_FAILED",!1);throw o(w),n(!1),(E=e.onError)==null||E.call(e,w),w}},[]),d=y.useCallback(async()=>{var x,E;try{const g=await rl.stopRecording();return f(g),n(!1),(x=e.onStop)==null||x.call(e),g}catch(g){const w=g instanceof be?g:new be(g instanceof Error?g.message:String(g),"STOP_FAILED",!1);throw o(w),n(!1),(E=e.onError)==null||E.call(e,w),w}},[]),m=y.useCallback(async(x,E={})=>{var g,w;try{o(null),a(!0);const p={audioBlob:x,...E},b=await rl.transcribe(p);return s(b.transcript),a(!1),(g=e.onTranscriptionComplete)==null||g.call(e,b),b}catch(p){const b=p instanceof be?p:new be(p instanceof Error?p.message:String(p),"TRANSCRIPTION_FAILED",!0);throw o(b),a(!1),(w=e.onError)==null||w.call(e,b),b}},[]),v=y.useCallback(()=>{rl.cancelRecording(),n(!1),f(null)},[]);return{startRecording:h,stopRecording:d,transcribe:m,cancelRecording:v,isRecording:t,isTranscribing:i,transcript:l,error:r,audioBlob:c}},qy=e=>{const t=y.useRef(null),n=y.useRef(!1);y.useEffect(()=>{const i=()=>{document.hidden&&(n.current=!0,t.current&&(clearTimeout(t.current),t.current=null),e({type:"tab_switch",severity:"high",details:{action:"tab_hidden",reason:"Attempted to switch tabs or applications"}}),setTimeout(()=>{n.current=!1},100))},a=()=>{n.current||(t.current=setTimeout(()=>{n.current||e({type:"focus_loss",severity:"medium",details:{action:"window_blur",reason:"Focus lost from the interview window"}}),t.current=null},50))};return document.addEventListener("visibilitychange",i),window.addEventListener("blur",a),()=>{document.removeEventListener("visibilitychange",i),window.removeEventListener("blur",a),t.current&&clearTimeout(t.current)}},[e])},Fy=()=>{y.useEffect(()=>{const e=document.createElement("style");return e.textContent=`
24
24
  * {
25
25
  -webkit-user-select: none !important;
26
26
  -moz-user-select: none !important;
@@ -33,7 +33,7 @@
33
33
  -ms-user-select: text !important;
34
34
  user-select: text !important;
35
35
  }
36
- `,document.head.appendChild(e),()=>{document.head.removeChild(e)}},[])};class ch{constructor(){Oe(this,"currentAudio",null)}async play(t,r){var i,n;try{if(this.stop(),(i=r==null?void 0:r.onStart)==null||i.call(r),!t)throw new Error("No audio data provided");const s=window.atob(t),a=new Uint8Array(s==null?void 0:s.length);for(let u=0;u<(s==null?void 0:s.length);u++)a[u]=s==null?void 0:s.charCodeAt(u);const c=new Blob([a],{type:"audio/wav"}),l=URL.createObjectURL(c);return this.currentAudio=new Audio(l),new Promise((u,h)=>{if(!this.currentAudio){h(new Error("Audio element not created"));return}const f=this.currentAudio;f.onended=()=>{var w;URL.revokeObjectURL(l),this.currentAudio=null,(w=r==null?void 0:r.onEnd)==null||w.call(r),u()},f.onerror=w=>{var g;URL.revokeObjectURL(l),this.currentAudio=null;const m=new Error(`Audio playback failed: ${w}`);(g=r==null?void 0:r.onError)==null||g.call(r,m),h(m)},f.play().catch(w=>{var g;URL.revokeObjectURL(l),this.currentAudio=null;const m=new Error(`Failed to play audio: ${w.message}`);(g=r==null?void 0:r.onError)==null||g.call(r,m),h(m)})})}catch(s){const a=s instanceof Error?s:new Error(`TTS Error: ${String(s)}`);throw(n=r==null?void 0:r.onError)==null||n.call(r,a),a}}stop(){this.currentAudio&&(this.currentAudio.pause(),this.currentAudio.currentTime=0,this.currentAudio=null)}isPlaying(){return this.currentAudio!==null&&!this.currentAudio.paused}}const pl=new ch,lh=(e={})=>{const[t,r]=d.useState(!1),[i,n]=d.useState(!1),[s,a]=d.useState(null),c=d.useCallback(async u=>{var h;try{a(null),n(!0),await pl.play(u,{onStart:()=>{var f;n(!1),r(!0),(f=e.onStart)==null||f.call(e)},onEnd:()=>{var f;r(!1),(f=e.onEnd)==null||f.call(e)},onError:f=>{var w;r(!1),n(!1),a(f),(w=e.onError)==null||w.call(e,f)}})}catch(f){const w=f instanceof Error?f:new Error(String(f));throw a(w),r(!1),n(!1),(h=e.onError)==null||h.call(e,w),w}},[e]),l=d.useCallback(()=>{pl.stop(),r(!1),n(!1)},[]);return{speak:c,stop:l,isPlaying:t,isLoading:i,error:s}},uh=({onViolation:e,onEnd:t,maxViolations:r=5})=>{const{addViolation:i}=Ol(),n=Dl(),s=Rl(),a=d.useRef(s);d.useEffect(()=>{a.current=s},[s]);const c=d.useCallback(u=>{t&&t(u,a.current)},[t]);return{logViolation:d.useCallback(({type:u,severity:h,details:f})=>{const w={id:$l(),type:u,severity:h,details:f,timestamp:Date.now()};i(w);const m=a.current+1;e&&e(w,m),m>=r&&c("excessive_violations")},[i,e,r,c]),onInterviewEnd:c,violationCount:s,logList:n}},dh=()=>{d.useEffect(()=>{function e(){console.clear(),console.log(`
36
+ `,document.head.appendChild(e),()=>{document.head.removeChild(e)}},[])};class Yy{constructor(){Qt(this,"currentAudio",null)}async play(t,n){var i,a;try{if(this.stop(),(i=n==null?void 0:n.onStart)==null||i.call(n),!t)throw new Error("No audio data provided");const l=window.atob(t),s=new Uint8Array(l==null?void 0:l.length);for(let c=0;c<(l==null?void 0:l.length);c++)s[c]=l==null?void 0:l.charCodeAt(c);const r=new Blob([s],{type:"audio/wav"}),o=URL.createObjectURL(r);return this.currentAudio=new Audio(o),new Promise((c,f)=>{if(!this.currentAudio){f(new Error("Audio element not created"));return}const h=this.currentAudio;h.onended=()=>{var d;URL.revokeObjectURL(o),this.currentAudio=null,(d=n==null?void 0:n.onEnd)==null||d.call(n),c()},h.onerror=d=>{var v;URL.revokeObjectURL(o),this.currentAudio=null;const m=new Error(`Audio playback failed: ${d}`);(v=n==null?void 0:n.onError)==null||v.call(n,m),f(m)},h.play().catch(d=>{var v;URL.revokeObjectURL(o),this.currentAudio=null;const m=new Error(`Failed to play audio: ${d.message}`);(v=n==null?void 0:n.onError)==null||v.call(n,m),f(m)})})}catch(l){const s=l instanceof Error?l:new Error(`TTS Error: ${String(l)}`);throw(a=n==null?void 0:n.onError)==null||a.call(n,s),s}}stop(){this.currentAudio&&(this.currentAudio.pause(),this.currentAudio.currentTime=0,this.currentAudio=null)}isPlaying(){return this.currentAudio!==null&&!this.currentAudio.paused}}const x3=new Yy,Xy=(e={})=>{const[t,n]=y.useState(!1),[i,a]=y.useState(!1),[l,s]=y.useState(null),r=y.useCallback(async c=>{var f;try{s(null),a(!0),await x3.play(c,{onStart:()=>{var h;a(!1),n(!0),(h=e.onStart)==null||h.call(e)},onEnd:()=>{var h;n(!1),(h=e.onEnd)==null||h.call(e)},onError:h=>{var d;n(!1),a(!1),s(h),(d=e.onError)==null||d.call(e,h)}})}catch(h){const d=h instanceof Error?h:new Error(String(h));throw s(d),n(!1),a(!1),(f=e.onError)==null||f.call(e,d),d}},[e]),o=y.useCallback(()=>{x3.stop(),n(!1),a(!1)},[]);return{speak:r,stop:o,isPlaying:t,isLoading:i,error:l}},Qy=({onViolation:e,onEnd:t,maxViolations:n=5})=>{const{addViolation:i}=a6(),a=n6(),l=i6(),s=y.useRef(l);y.useEffect(()=>{s.current=l},[l]);const r=y.useCallback(c=>{t&&t(c,s.current)},[t]);return{logViolation:y.useCallback(({type:c,severity:f,details:h})=>{const d={id:c6(),type:c,severity:f,details:h,timestamp:Date.now()};i(d);const m=s.current+1;e&&e(d,m),m>=n&&r("excessive_violations")},[i,e,n,r]),onInterviewEnd:r,violationCount:l,logList:a}},Zy=()=>{y.useEffect(()=>{function e(){console.clear(),console.log(`
37
37
  %c
38
38
  ╔═══════════════════════════════════════════════════════════════════════╗
39
39
  ║ ║
@@ -79,7 +79,31 @@
79
79
  │ │
80
80
  │ 💡 IMMEDIATE ACTION REQUIRED: │
81
81
  │ Close developer tools to continue interview │
82
- └─────────────────────────────────────────────────────────────┘`,"color: #ffd93d; font-size: 14px; font-family: monospace; background: rgba(255, 217, 61, 0.1); padding: 10px;")}const t={open:!1,orientation:null},r=160,i=setInterval(()=>{window.outerHeight-window.innerHeight>r||window.outerWidth-window.innerWidth>r?t.open||(t.open=!0,t.orientation=window.outerWidth-window.innerWidth>r?"vertical":"horizontal",e()):t.open&&(t.open=!1,console.log("%c🌟 Developer tools closed. Interview continues smoothly! ✨","color: #4ecdc4; font-weight: bold; text-shadow: 0 0 10px #4ecdc4;"))},500),n=a=>{if(a.keyCode===123||a.ctrlKey&&a.shiftKey&&(a.keyCode===73||a.keyCode===74)||a.ctrlKey&&a.keyCode===85)return a.preventDefault(),console.log("%c🎭 Nice try! Keyboard shortcuts are disabled during interviews ✨","color: #ffd93d; font-weight: bold; text-shadow: 0 0 10px #ffd93d;"),!1},s=a=>(a.preventDefault(),console.log("%c🌈 Right-click menu disabled for interview integrity! 🎪","color: #ff9ff3; font-weight: bold; text-shadow: 0 0 10px #ff9ff3;"),!1);return document.addEventListener("keydown",n),document.addEventListener("contextmenu",s),()=>{clearInterval(i),document.removeEventListener("keydown",n),document.removeEventListener("contextmenu",s),delete window.showStats,delete window.interviewTips}},[])},hh=(e,t,r)=>Math.max(t,Math.min(r,e)),xl=e=>{const t=Math.max(0,Math.floor(e)),r=Math.floor(t/60).toString().padStart(2,"0"),i=(t%60).toString().padStart(2,"0");return`${r}:${i}`},Hs=({total:e,remaining:t,size:r=64,strokeWidth:i=6,className:n="",showLabel:s=!0})=>{const a=Math.max(1,e||1),c=hh(t/a,0,1),{radius:l,circumference:u,dashOffset:h,center:f}=d.useMemo(()=>{const g=(r-i)/2,b=2*Math.PI*g,_=b*(1-c),p=Math.round(i)%2===1,A=r/2+(p?.5:0);return{radius:g,circumference:b,dashOffset:_,center:A}},[r,i,c]),w=d.useMemo(()=>c<=.25?"iw-stroke-red-500":c<=.5?"iw-stroke-yellow-500":"iw-stroke-green-500",[c]),m=c<=.25?"iw-animate-pulse":"";return o.jsxs("div",{className:`iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${n}`,style:{width:r,height:r},"aria-label":`Time remaining ${xl(t)}`,role:"timer","aria-live":"polite",children:[o.jsx("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,preserveAspectRatio:"xMidYMid meet",children:o.jsxs("g",{transform:`rotate(-90 ${f} ${f})`,children:[o.jsx("circle",{cx:f,cy:f,r:l,className:"iw-stroke-gray-200",strokeWidth:i,fill:"none",shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke"}),o.jsx("circle",{cx:f,cy:f,r:l,className:`${w} ${m}`,strokeWidth:i,strokeLinecap:"round",fill:"none",strokeDasharray:u,strokeDashoffset:h,shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke",style:{transition:"stroke-dashoffset 0.3s ease, stroke 0.2s ease"}})]})}),s&&o.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center iw-rotate-0",children:o.jsx("span",{className:`iw-text-[11px] iw-font-semibold iw-tabular-nums ${c<=.25?"iw-text-red-600":c<=.5?"iw-text-yellow-600":"iw-text-green-600"}`,children:xl(t)})})]})},fh=({label:e,error:t,fullWidth:r=!1,className:i="",id:n,...s})=>{const a=n||`textarea-${Math.random().toString(36).substring(2,9)}`,c="iw-block iw-rounded-md iw-border iw-border-gray-300 iw-shadow-sm iw-px-4 iw-py-2 iw-text-sm iw-transition-all",l=t?"iw-border-red-500 iw-focus:border-red-500 iw-focus:ring-red-500":"",u=r?"iw-w-full":"",h=i.includes("iw-h-full")||r?"iw-h-full":"";return o.jsxs("div",{className:`iw-h-full iw-flex iw-flex-col ${r?"iw-w-full":""}`,children:[e&&o.jsx("label",{htmlFor:a,className:"iw-block iw-text-sm iw-font-medium iw-text-gray-700 iw-mb-1",children:e}),o.jsx("textarea",{id:a,className:`${c} ${l} ${u} ${h} ${i}`,"aria-invalid":t?"true":"false",...s}),t&&o.jsx("p",{className:"iw-mt-1 iw-text-sm iw-text-red-600",children:t})]})},wh=({value:e,onChange:t,onSubmit:r,isSubmitDisabled:i,state:n,editingTime:s})=>{const a=c=>{c.key==="Enter"&&(c.ctrlKey||c.metaKey)&&!i&&(c.preventDefault(),r())};return o.jsxs("div",{className:"iw-flex iw-flex-col iw-h-full ",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between",children:[o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Your Answer"}),o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[o.jsx(ln,{className:"iw-size-4 iw-text-orange-600"}),o.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to edit: "})]}),o.jsx(Hs,{total:s,remaining:n.currentPhaseTimeRemaining,size:50,strokeWidth:4})]})]}),o.jsxs("div",{className:" iw-overflow-hidden iw-flex iw-flex-col iw-h-full iw-mt-2",children:[o.jsx(fh,{value:e,onChange:t,onKeyDown:a,placeholder:"Type your answer here...",className:" iw-w-full iw-h-full iw-flex-1 iw-resize-none !iw-p-4 iw-bg-transparent iw-min-h-full focus-visible:iw-outline-0",onPaste:c=>c.preventDefault(),onCopy:c=>c.preventDefault(),onCut:c=>c.preventDefault(),onDrop:c=>c.preventDefault(),onDragOver:c=>c.preventDefault(),disabled:n.phase===se.SUBMITTING}),o.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1 iw-mt-4",children:o.jsx(Qe,{onClick:r,disabled:i,className:n.phase===se.SUBMITTING?"iw-opacity-75":"",children:n.phase===se.SUBMITTING?"Submitting...":"Submit Answer"})})]})]})},mh=({question:e,isLoading:t=!1})=>{const{baseColor:r}=rr();return o.jsx("div",{className:"iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-p-6 ",style:Gl(r,.85),children:o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-8",children:[o.jsx("div",{className:"iw-flex iw-flex-col iw-items-center iw-relative iw-h-32 iw-w-32 iw-shrink-0 iw-shadow iw-rounded-lg iw-bg-white",children:o.jsx("div",{className:"iw-mt-2",children:o.jsx("img",{src:"https://duf9q5sx7u.ufs.sh/f/va7H6eSeKAux755zByRN5Nq9LZurgIoJGYX6c0CEdRSDm8y2",alt:"brand_logo",className:"iw-h-28 iw-w-28"})})}),t?o.jsxs("div",{className:"iw-animate-pulse iw-w-full iw-space-y-3 iw-mr-10",children:[o.jsx("div",{className:"iw-h-5 iw-bg-gray-200 iw-rounded iw-w-full"}),o.jsx("div",{className:"iw-h-5 iw-bg-gray-200 iw-rounded iw-w-3/4"})]}):o.jsx("p",{className:"iw-text-lg iw-leading-8",children:e==null?void 0:e.question})]})})},yl=({currentQuestion:e,phase:t,className:r="",children:i,interviewId:n="",interview_duration:s=ti,videoFeedRef:a})=>o.jsxs("div",{className:`iw-p-4 iw-space-y-4 iw-pb-6 ${r} iw-min-h-[calc(100vh_-_3.8rem)] iw-flex iw-flex-col iw-justify-between`,children:[o.jsx("div",{className:"iw-flex iw-items-start iw-justify-between iw-gap-3",children:o.jsx("div",{className:"iw-flex-1",children:o.jsx(mh,{question:e,isLoading:t===se.FETCHING_QUESTION||t===se.IDLE})})}),o.jsxs("div",{className:"iw iw-bg-[#F6F6F6] iw-grid iw-grid-cols-2 iw-rounded-[14px] iw-p-6",children:[o.jsx("div",{className:"iw-min-h-[400px] iw-max-h-[600px]",children:o.jsx(gl,{ref:a,interviewId:n,interview_duration:s})}),o.jsx("div",{className:"iw-bg-white iw-rounded-r-xl iw-shadow iw-p-6",children:i})]})]}),gh=({confirmExitInterview:e,isOpen:t,onClose:r})=>o.jsx(ii,{isOpen:t,onClose:r,title:"Exit Interview",closeOnOverlayClick:!1,children:o.jsxs("div",{className:"iw-space-y-5",children:[o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3 iw-rounded-xl iw-p-2",children:[o.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-flex-none iw-items-center iw-justify-center iw-rounded-full iw-bg-rose-100 iw-text-rose-600",children:"!"}),o.jsxs("div",{className:"iw-space-y-2",children:[o.jsx("p",{className:"iw-text-sm iw-font-semibold iw-text-rose-600",children:"Leaving now will end your interview !"}),o.jsx("p",{className:"iw-text-sm iw-text-slate-500",children:"Are you sure you want to exit? All progress will be lost and you will not be able to resume."})]})]}),o.jsxs("div",{className:"iw-flex iw-flex-col-reverse iw-gap-2 sm:iw-flex-row sm:iw-items-center sm:iw-justify-end iw-pb-1",children:[o.jsx("button",{className:"iw-inline-flex iw-items-center iw-justify-center iw-rounded-lg iw-border iw-border-slate-200 iw-bg-white iw-px-4 iw-py-2 iw-text-sm iw-font-medium iw-text-slate-600 iw-shadow-sm iw-transition hover:iw-bg-slate-50",onClick:r,children:"Stay in interview"}),o.jsx("button",{className:"iw-inline-flex iw-items-center iw-justify-center iw-rounded-lg iw-px-4 iw-py-2 iw-text-sm iw-font-semibold iw-text-white iw-transition hover:iw-brightness-110",style:{background:"linear-gradient(to right, rgba(244, 63, 94, 0.8), rgba(225, 29, 72, 0.8))",boxShadow:"0 12px 30px -16px rgba(244, 63, 94, 0.65)"},onClick:e,children:"Confirm exit"})]})]})}),bl=({title:e,brandName:t,onExit:r})=>{const{baseColor:i}=rr(),[n,s]=d.useState(!1);return o.jsxs("header",{className:"iw-w-full iw-text-gray-900",children:[o.jsxs("div",{className:"iw-mx-auto iw-flex iw-items-center iw-justify-between iw-px-4 iw-pb-4 iw-pt-2",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-space-x-2",children:[o.jsx("div",{className:"iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold",style:{backgroundColor:i},children:zl(t)}),o.jsx("p",{className:"iw-text-sm iw-font-medium",children:t})]}),o.jsx("h1",{className:"iw-text-base iw-font-bold",children:e}),o.jsx("button",{className:"iw-text-sm iw-text-white iw-px-4 iw-py-2 iw-rounded-md",style:{background:"linear-gradient(to right, rgba(244, 63, 94, 0.8), rgba(225, 29, 72, 0.8))"},onClick:()=>s(!0),children:"Exit Interview"})]}),o.jsx("div",{className:"iw-h-px iw-bg-gray-200"}),o.jsx(gh,{isOpen:n,confirmExitInterview:()=>{r(),s(!1)},onClose:()=>s(!1)})]})},ph=({className:e="",width:t,height:r=56,barWidth:i=3,gap:n=2,fftSize:s=1024,smoothingTimeConstant:a=.8,mediaStream:c,startOnMount:l=!0})=>{const{baseColor:u}=rr(),h=d.useRef(null),f=d.useRef(null),w=d.useRef(null),m=d.useRef(null),g=d.useRef(null),b=d.useRef(null),_=d.useRef(!1),[p,A]=d.useState(null);d.useEffect(()=>{if(t||!f.current)return;const T=f.current,C=()=>{const B=h.current;if(!B)return;const G=T.clientWidth,Q=r;B.width=Math.max(1,Math.floor(G*window.devicePixelRatio||1)),B.height=Math.max(1,Math.floor(Q*window.devicePixelRatio||1))},M=new ResizeObserver(C);return M.observe(T),C(),()=>M.disconnect()},[t,r]),d.useEffect(()=>{if(!t)return;const T=h.current;T&&(T.width=Math.max(1,Math.floor(t*(window.devicePixelRatio||1))),T.height=Math.max(1,Math.floor(r*(window.devicePixelRatio||1))))},[t,r]),d.useEffect(()=>{let T=!1;return(async()=>{try{const M=new(window.AudioContext||window.webkitAudioContext);w.current=M;let B=c;if(!B){if(!l)return;B=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),_.current=!0}if(T)return;const G=M.createAnalyser();G.fftSize=s,G.smoothingTimeConstant=a,m.current=G;const Q=M.createMediaStreamSource(B);g.current=Q,Q.connect(G),F()}catch(M){A((M==null?void 0:M.message)||"Failed to initialize microphone")}})(),()=>{var M,B,G,Q;T=!0,b.current&&cancelAnimationFrame(b.current);try{(M=g.current)==null||M.disconnect()}catch{}try{(B=m.current)==null||B.disconnect()}catch{}_.current&&((Q=((G=g.current)==null?void 0:G.mediaStream)||void 0)==null||Q.getTracks().forEach(oe=>oe.stop())),w.current&&w.current.state!=="closed"&&w.current.close()}},[c,s,a,l]);const F=()=>{const T=h.current,C=m.current;if(!T||!C)return;const M=T.getContext("2d");if(!M)return;const B=window.devicePixelRatio||1,G=T.width,Q=T.height,oe=C.frequencyBinCount,qe=new Uint8Array(oe),de=()=>{b.current=requestAnimationFrame(de),C.getByteTimeDomainData(qe),M.clearRect(0,0,G,Q),M.fillStyle="rgba(0,0,0,0)",M.fillRect(0,0,G,Q);const Ye=Math.max(1,Math.floor(i*B)),Te=Math.max(1,Math.floor(n*B)),be=Ye+Te,kt=Math.max(8,Math.floor((G+Te)/be)),dt=Math.floor(qe.length/kt);for(let ge=0;ge<kt;ge++){const Qt=Math.min(qe.length-1,ge*dt),Ke=qe[Qt]/128-1,re=Math.abs(Ke),Xe=Math.pow(re,.6),V=Math.max(Q*.06,Xe*(Q*.9)),ht=ge*be,j=(Q-V)/2,J=140-Math.min(140,140*re),Dt=85,Rt=48+Math.floor(12*(1-re));M.fillStyle=`${u}`,M.shadowColor=`hsla(${J}, ${Dt}%, ${Rt}%, ${.25*re})`,M.shadowBlur=8*re;const Jt=Math.min(Ye/2,V/2);xh(M,ht,j,Ye,V,Jt),M.fill()}};de()};return o.jsxs("div",{ref:f,className:`iw-relative iw-w-full iw-overflow-hidden iw-rounded-md iw-bg-gray-50 ${e}`,style:{height:r},children:[o.jsx("canvas",{ref:h,className:"iw-w-full iw-h-full"}),p&&o.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center",children:o.jsx("span",{className:"iw-text-xs iw-text-red-600 iw-bg-red-50 iw-border iw-border-red-200 iw-px-2 iw-py-1 iw-rounded",children:p})})]})};function xh(e,t,r,i,n,s){const a=Math.min(s,i/2,n/2);e.beginPath(),e.moveTo(t+a,r),e.lineTo(t+i-a,r),e.quadraticCurveTo(t+i,r,t+i,r+a),e.lineTo(t+i,r+n-a),e.quadraticCurveTo(t+i,r+n,t+i-a,r+n),e.lineTo(t+a,r+n),e.quadraticCurveTo(t,r+n,t,r+n-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath()}const yh=({state:e,answeringTime:t,nextPhase:r,sttError:i})=>o.jsxs("div",{className:"iw-flex iw-flex-col iw-justify-between iw-h-full ",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between",children:[o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"You may start speaking now. We're listening...."}),o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[o.jsx(ln,{className:"iw-size-4 iw-text-orange-600"}),o.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to talk: "})]}),o.jsx(Hs,{total:t,remaining:e.currentPhaseTimeRemaining,size:50,strokeWidth:4})]})]}),o.jsx("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:"Done talking? Click the button to review your answer."})]}),o.jsxs("div",{children:[o.jsx(ph,{}),i&&o.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Recording error: ",i.message]})]}),o.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1",children:o.jsx(Qe,{onClick:()=>{r()},children:"Transcribe My Answer"})})]});function bh(){const[e,t]=d.useState(!0),r=d.useMemo(()=>[0,1,2].map(i=>({id:i})),[]);return d.useEffect(()=>{const i=setInterval(()=>{t(n=>!n)},1500);return()=>clearInterval(i)},[]),o.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-h-full",children:[o.jsx("div",{className:"iw-relative iw-w-80 iw-h-48 ","aria-hidden":!0,children:r.map((i,n)=>{const s=n*50,a=e?s:s+12,c=e?1:.08,l=n*140;return o.jsx("div",{role:"presentation",className:"iw-absolute iw-w-full iw-rounded-lg iw-p-4 iw-shadow-md iw-bg-gradient-to-b iw-from-gray-50 iw-to-gray-100 iw-overflow-hidden",style:{top:0,transform:`translateY(${a}px)`,opacity:c,transition:`transform 600ms cubic-bezier(.2,.9,.3,1) ${l}ms, opacity 400ms ease ${l}ms`},children:o.jsxs("div",{className:"iw-flex iw-gap-3 iw-items-center",children:[o.jsx("div",{className:"iw-w-10 iw-h-10 iw-bg-gray-300 iw-rounded iw-flex-shrink-0"}),o.jsxs("div",{className:"iw-flex-1 iw-space-y-2",children:[o.jsx("div",{className:"iw-h-2 iw-bg-gray-300 iw-rounded iw-w-24"}),o.jsx("div",{className:"iw-h-2 iw-bg-gray-300 iw-rounded iw-w-32"})]})]})},i.id)})}),o.jsx("div",{className:"iw-text-center",children:o.jsx("p",{className:"iw-text-gray-500 iw-font-medium",children:"Preparing your question..."})})]})}const vh=({size:e="192px",className:t,colors:r,animationDuration:i=20})=>{const s={...{bg:"oklch(95% 0.02 264.695)",c1:"oklch(75% 0.15 350)",c2:"oklch(80% 0.12 200)",c3:"oklch(78% 0.14 280)"},...r},a=parseInt(e.replace("px",""),10),c=a<50?Math.max(a*.008,1):Math.max(a*.015,4),l=a<50?Math.max(a*.004,1.2):Math.max(a*.008,1.5),u=a<50?Math.max(a*.004,.05):Math.max(a*.008,.1),h=a<50?Math.max(a*.004,.5):Math.max(a*.008,2),f=a<30?"0%":a<50?"5%":a<100?"15%":"25%",w=a<30?1.1:a<50?Math.max(l*1.2,1.3):l;return o.jsx("div",{className:`siri-orb ${t}`,style:{width:e,height:e,"--bg":s.bg,"--c1":s.c1,"--c2":s.c2,"--c3":s.c3,"--animation-duration":`${i}s`,"--blur-amount":`${c}px`,"--contrast-amount":w,"--dot-size":`${u}px`,"--shadow-spread":`${h}px`,"--mask-radius":f},children:o.jsx("style",{children:`
82
+ └─────────────────────────────────────────────────────────────┘`,"color: #ffd93d; font-size: 14px; font-family: monospace; background: rgba(255, 217, 61, 0.1); padding: 10px;")}const t={open:!1,orientation:null},n=160,i=setInterval(()=>{window.outerHeight-window.innerHeight>n||window.outerWidth-window.innerWidth>n?t.open||(t.open=!0,t.orientation=window.outerWidth-window.innerWidth>n?"vertical":"horizontal",e()):t.open&&(t.open=!1,console.log("%c🌟 Developer tools closed. Interview continues smoothly! ✨","color: #4ecdc4; font-weight: bold; text-shadow: 0 0 10px #4ecdc4;"))},500),a=s=>{if(s.keyCode===123||s.ctrlKey&&s.shiftKey&&(s.keyCode===73||s.keyCode===74)||s.ctrlKey&&s.keyCode===85)return s.preventDefault(),console.log("%c🎭 Nice try! Keyboard shortcuts are disabled during interviews ✨","color: #ffd93d; font-weight: bold; text-shadow: 0 0 10px #ffd93d;"),!1},l=s=>(s.preventDefault(),console.log("%c🌈 Right-click menu disabled for interview integrity! 🎪","color: #ff9ff3; font-weight: bold; text-shadow: 0 0 10px #ff9ff3;"),!1);return document.addEventListener("keydown",a),document.addEventListener("contextmenu",l),()=>{clearInterval(i),document.removeEventListener("keydown",a),document.removeEventListener("contextmenu",l),delete window.showStats,delete window.interviewTips}},[])};var S3={exports:{}},fu={},E3={exports:{}},_3={};/**
83
+ * @license React
84
+ * scheduler.production.js
85
+ *
86
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
87
+ *
88
+ * This source code is licensed under the MIT license found in the
89
+ * LICENSE file in the root directory of this source tree.
90
+ */(function(e){function t(j,G){var R=j.length;j.push(G);e:for(;0<R;){var $=R-1>>>1,se=j[$];if(0<a(se,G))j[$]=G,j[R]=se,R=$;else break e}}function n(j){return j.length===0?null:j[0]}function i(j){if(j.length===0)return null;var G=j[0],R=j.pop();if(R!==G){j[0]=R;e:for(var $=0,se=j.length,ut=se>>>1;$<ut;){var bn=2*($+1)-1,fn=j[bn],Xt=bn+1,ot=j[Xt];if(0>a(fn,R))Xt<se&&0>a(ot,fn)?(j[$]=ot,j[Xt]=R,$=Xt):(j[$]=fn,j[bn]=R,$=bn);else if(Xt<se&&0>a(ot,R))j[$]=ot,j[Xt]=R,$=Xt;else break e}}return G}function a(j,G){var R=j.sortIndex-G.sortIndex;return R!==0?R:j.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var s=Date,r=s.now();e.unstable_now=function(){return s.now()-r}}var o=[],c=[],f=1,h=null,d=3,m=!1,v=!1,x=!1,E=!1,g=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;function b(j){for(var G=n(c);G!==null;){if(G.callback===null)i(c);else if(G.startTime<=j)i(c),G.sortIndex=G.expirationTime,t(o,G);else break;G=n(c)}}function A(j){if(x=!1,b(j),!v)if(n(o)!==null)v=!0,N||(N=!0,Re());else{var G=n(c);G!==null&&xt(A,G.startTime-j)}}var N=!1,_=-1,M=5,T=-1;function D(){return E?!0:!(e.unstable_now()-T<M)}function Ee(){if(E=!1,N){var j=e.unstable_now();T=j;var G=!0;try{e:{v=!1,x&&(x=!1,w(_),_=-1),m=!0;var R=d;try{t:{for(b(j),h=n(o);h!==null&&!(h.expirationTime>j&&D());){var $=h.callback;if(typeof $=="function"){h.callback=null,d=h.priorityLevel;var se=$(h.expirationTime<=j);if(j=e.unstable_now(),typeof se=="function"){h.callback=se,b(j),G=!0;break t}h===n(o)&&i(o),b(j)}else i(o);h=n(o)}if(h!==null)G=!0;else{var ut=n(c);ut!==null&&xt(A,ut.startTime-j),G=!1}}break e}finally{h=null,d=R,m=!1}G=void 0}}finally{G?Re():N=!1}}}var Re;if(typeof p=="function")Re=function(){p(Ee)};else if(typeof MessageChannel<"u"){var rt=new MessageChannel,cn=rt.port2;rt.port1.onmessage=Ee,Re=function(){cn.postMessage(null)}}else Re=function(){g(Ee,0)};function xt(j,G){_=g(function(){j(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_next=function(j){switch(d){case 1:case 2:case 3:var G=3;break;default:G=d}var R=d;d=G;try{return j()}finally{d=R}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(j,G){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var R=d;d=j;try{return G()}finally{d=R}},e.unstable_scheduleCallback=function(j,G,R){var $=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?$+R:$):R=$,j){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=R+se,j={id:f++,callback:G,priorityLevel:j,startTime:R,expirationTime:se,sortIndex:-1},R>$?(j.sortIndex=R,t(c,j),n(o)===null&&j===n(c)&&(x?(w(_),_=-1):x=!0,xt(A,R-$))):(j.sortIndex=se,t(o,j),v||m||(v=!0,N||(N=!0,Re()))),j},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(j){var G=d;return function(){var R=d;d=G;try{return j.apply(this,arguments)}finally{d=R}}}})(_3),E3.exports=_3;var Ky=E3.exports;/**
91
+ * @license React
92
+ * react-dom-client.production.js
93
+ *
94
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
95
+ *
96
+ * This source code is licensed under the MIT license found in the
97
+ * LICENSE file in the root directory of this source tree.
98
+ */var qe=Ky,T3=y,Iy=Zi;function S(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function A3(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Es(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function N3(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function j3(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function M3(e){if(Es(e)!==e)throw Error(S(188))}function Jy(e){var t=e.alternate;if(!t){if(t=Es(e),t===null)throw Error(S(188));return t!==e?null:e}for(var n=e,i=t;;){var a=n.return;if(a===null)break;var l=a.alternate;if(l===null){if(i=a.return,i!==null){n=i;continue}break}if(a.child===l.child){for(l=a.child;l;){if(l===n)return M3(a),e;if(l===i)return M3(a),t;l=l.sibling}throw Error(S(188))}if(n.return!==i.return)n=a,i=l;else{for(var s=!1,r=a.child;r;){if(r===n){s=!0,n=a,i=l;break}if(r===i){s=!0,i=a,n=l;break}r=r.sibling}if(!s){for(r=l.child;r;){if(r===n){s=!0,n=l,i=a;break}if(r===i){s=!0,i=l,n=a;break}r=r.sibling}if(!s)throw Error(S(189))}}if(n.alternate!==i)throw Error(S(190))}if(n.tag!==3)throw Error(S(188));return n.stateNode.current===n?e:t}function C3(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=C3(e),t!==null)return t;e=e.sibling}return null}var oe=Object.assign,Wy=Symbol.for("react.element"),du=Symbol.for("react.transitional.element"),_s=Symbol.for("react.portal"),ul=Symbol.for("react.fragment"),D3=Symbol.for("react.strict_mode"),Ef=Symbol.for("react.profiler"),O3=Symbol.for("react.consumer"),Fn=Symbol.for("react.context"),_f=Symbol.for("react.forward_ref"),Tf=Symbol.for("react.suspense"),Af=Symbol.for("react.suspense_list"),Nf=Symbol.for("react.memo"),vi=Symbol.for("react.lazy"),jf=Symbol.for("react.activity"),Py=Symbol.for("react.memo_cache_sentinel"),z3=Symbol.iterator;function Ts(e){return e===null||typeof e!="object"?null:(e=z3&&e[z3]||e["@@iterator"],typeof e=="function"?e:null)}var $y=Symbol.for("react.client.reference");function Mf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$y?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ul:return"Fragment";case Ef:return"Profiler";case D3:return"StrictMode";case Tf:return"Suspense";case Af:return"SuspenseList";case jf:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _s:return"Portal";case Fn:return e.displayName||"Context";case O3:return(e._context.displayName||"Context")+".Consumer";case _f:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nf:return t=e.displayName||null,t!==null?t:Mf(e.type)||"Memo";case vi:t=e._payload,e=e._init;try{return Mf(e(t))}catch{}}return null}var As=Array.isArray,B=T3.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Iy.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oa={pending:!1,data:null,method:null,action:null},Cf=[],ol=-1;function Dn(e){return{current:e}}function Ke(e){0>ol||(e.current=Cf[ol],Cf[ol]=null,ol--)}function ue(e,t){ol++,Cf[ol]=e.current,e.current=t}var On=Dn(null),Ns=Dn(null),bi=Dn(null),hu=Dn(null);function mu(e,t){switch(ue(bi,t),ue(Ns,e),ue(On,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?aw(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=aw(t),e=lw(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ke(On),ue(On,e)}function cl(){Ke(On),Ke(Ns),Ke(bi)}function Df(e){e.memoizedState!==null&&ue(hu,e);var t=On.current,n=lw(t,e.type);t!==n&&(ue(Ns,e),ue(On,n))}function gu(e){Ns.current===e&&(Ke(On),Ke(Ns)),hu.current===e&&(Ke(hu),wr._currentValue=oa)}var Of,k3;function ca(e){if(Of===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Of=t&&t[1]||"",k3=-1<n.stack.indexOf(`
99
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
100
+ `+Of+e+k3}var zf=!1;function kf(e,t){if(!e||zf)return"";zf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(m){var d=m}Reflect.construct(e,[],h)}else{try{h.call()}catch(m){d=m}e.call(h.prototype)}}else{try{throw Error()}catch(m){d=m}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(m){if(m&&d&&typeof m.stack=="string")return[m.stack,d.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var l=i.DetermineComponentFrameRoot(),s=l[0],r=l[1];if(s&&r){var o=s.split(`
101
+ `),c=r.split(`
102
+ `);for(a=i=0;i<o.length&&!o[i].includes("DetermineComponentFrameRoot");)i++;for(;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;if(i===o.length||a===c.length)for(i=o.length-1,a=c.length-1;1<=i&&0<=a&&o[i]!==c[a];)a--;for(;1<=i&&0<=a;i--,a--)if(o[i]!==c[a]){if(i!==1||a!==1)do if(i--,a--,0>a||o[i]!==c[a]){var f=`
103
+ `+o[i].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=i&&0<=a);break}}}finally{zf=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ca(n):""}function ep(e,t){switch(e.tag){case 26:case 27:case 5:return ca(e.type);case 16:return ca("Lazy");case 13:return e.child!==t&&t!==null?ca("Suspense Fallback"):ca("Suspense");case 19:return ca("SuspenseList");case 0:case 15:return kf(e.type,!1);case 11:return kf(e.type.render,!1);case 1:return kf(e.type,!0);case 31:return ca("Activity");default:return""}}function L3(e){try{var t="",n=null;do t+=ep(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
104
+ Error generating stack: `+i.message+`
105
+ `+i.stack}}var Lf=Object.prototype.hasOwnProperty,Uf=qe.unstable_scheduleCallback,Bf=qe.unstable_cancelCallback,tp=qe.unstable_shouldYield,np=qe.unstable_requestPaint,Lt=qe.unstable_now,ip=qe.unstable_getCurrentPriorityLevel,U3=qe.unstable_ImmediatePriority,B3=qe.unstable_UserBlockingPriority,wu=qe.unstable_NormalPriority,ap=qe.unstable_LowPriority,R3=qe.unstable_IdlePriority,lp=qe.log,sp=qe.unstable_setDisableYieldValue,js=null,Ut=null;function xi(e){if(typeof lp=="function"&&sp(e),Ut&&typeof Ut.setStrictMode=="function")try{Ut.setStrictMode(js,e)}catch{}}var Bt=Math.clz32?Math.clz32:op,rp=Math.log,up=Math.LN2;function op(e){return e>>>=0,e===0?32:31-(rp(e)/up|0)|0}var yu=256,pu=262144,vu=4194304;function fa(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function bu(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var a=0,l=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var r=i&134217727;return r!==0?(i=r&~l,i!==0?a=fa(i):(s&=r,s!==0?a=fa(s):n||(n=r&~e,n!==0&&(a=fa(n))))):(r=i&~l,r!==0?a=fa(r):s!==0?a=fa(s):n||(n=i&~e,n!==0&&(a=fa(n)))),a===0?0:t!==0&&t!==a&&!(t&l)&&(l=a&-a,n=t&-t,l>=n||l===32&&(n&4194048)!==0)?t:a}function Ms(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function cp(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function G3(){var e=vu;return vu<<=1,!(vu&62914560)&&(vu=4194304),e}function Rf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Cs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function fp(e,t,n,i,a,l){var s=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var r=e.entanglements,o=e.expirationTimes,c=e.hiddenUpdates;for(n=s&~n;0<n;){var f=31-Bt(n),h=1<<f;r[f]=0,o[f]=-1;var d=c[f];if(d!==null)for(c[f]=null,f=0;f<d.length;f++){var m=d[f];m!==null&&(m.lane&=-536870913)}n&=~h}i!==0&&H3(e,i,0),l!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=l&~(s&~t))}function H3(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Bt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function V3(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Bt(n),a=1<<i;a&t|e[i]&t&&(e[i]|=t),n&=~a}}function q3(e,t){var n=t&-t;return n=n&42?1:Gf(n),n&(e.suspendedLanes|t)?0:n}function Gf(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Hf(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function F3(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:jw(e.type))}function Y3(e,t){var n=W.p;try{return W.p=e,t()}finally{W.p=n}}var Si=Math.random().toString(36).slice(2),Pe="__reactFiber$"+Si,mt="__reactProps$"+Si,fl="__reactContainer$"+Si,Vf="__reactEvents$"+Si,dp="__reactListeners$"+Si,hp="__reactHandles$"+Si,X3="__reactResources$"+Si,Ds="__reactMarker$"+Si;function qf(e){delete e[Pe],delete e[mt],delete e[Vf],delete e[dp],delete e[hp]}function dl(e){var t=e[Pe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fl]||n[Pe]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=dw(e);e!==null;){if(n=e[Pe])return n;e=dw(e)}return t}e=n,n=e.parentNode}return null}function hl(e){if(e=e[Pe]||e[fl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Os(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(S(33))}function ml(e){var t=e[X3];return t||(t=e[X3]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ie(e){e[Ds]=!0}var Q3=new Set,Z3={};function da(e,t){gl(e,t),gl(e+"Capture",t)}function gl(e,t){for(Z3[e]=t,e=0;e<t.length;e++)Q3.add(t[e])}var mp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),K3={},I3={};function gp(e){return Lf.call(I3,e)?!0:Lf.call(K3,e)?!1:mp.test(e)?I3[e]=!0:(K3[e]=!0,!1)}function xu(e,t,n){if(gp(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Su(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Yn(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function $t(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function J3(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wp(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var a=i.get,l=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(s){n=""+s,l.call(this,s)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ff(e){if(!e._valueTracker){var t=J3(e)?"checked":"value";e._valueTracker=wp(e,t,""+e[t])}}function W3(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=J3(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Eu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var yp=/[\n"\\]/g;function en(e){return e.replace(yp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Yf(e,t,n,i,a,l,s,r){e.name="",s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"?e.type=s:e.removeAttribute("type"),t!=null?s==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+$t(t)):e.value!==""+$t(t)&&(e.value=""+$t(t)):s!=="submit"&&s!=="reset"||e.removeAttribute("value"),t!=null?Xf(e,s,$t(t)):n!=null?Xf(e,s,$t(n)):i!=null&&e.removeAttribute("value"),a==null&&l!=null&&(e.defaultChecked=!!l),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"?e.name=""+$t(r):e.removeAttribute("name")}function P3(e,t,n,i,a,l,s,r){if(l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"&&(e.type=l),t!=null||n!=null){if(!(l!=="submit"&&l!=="reset"||t!=null)){Ff(e);return}n=n!=null?""+$t(n):"",t=t!=null?""+$t(t):n,r||t===e.value||(e.value=t),e.defaultValue=t}i=i??a,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=r?e.checked:!!i,e.defaultChecked=!!i,s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.name=s),Ff(e)}function Xf(e,t,n){t==="number"&&Eu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function wl(e,t,n,i){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&i&&(e[n].defaultSelected=!0)}else{for(n=""+$t(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,i&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function $3(e,t,n){if(t!=null&&(t=""+$t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+$t(n):""}function e4(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(S(92));if(As(i)){if(1<i.length)throw Error(S(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=$t(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),Ff(e)}function yl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pp=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function t4(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||pp.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function n4(e,t,n){if(t!=null&&typeof t!="object")throw Error(S(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var a in t)i=t[a],t.hasOwnProperty(a)&&n[a]!==i&&t4(e,a,i)}else for(var l in t)t.hasOwnProperty(l)&&t4(e,l,t[l])}function Qf(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),bp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function _u(e){return bp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var Zf=null;function Kf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pl=null,vl=null;function i4(e){var t=hl(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Yf(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+en(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var a=i[mt]||null;if(!a)throw Error(S(90));Yf(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&W3(i)}break e;case"textarea":$3(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&wl(e,!!n.multiple,t,!1)}}}var If=!1;function a4(e,t,n){if(If)return e(t,n);If=!0;try{var i=e(t);return i}finally{if(If=!1,(pl!==null||vl!==null)&&(fo(),pl&&(t=pl,e=vl,vl=pl=null,i4(t),e)))for(t=0;t<e.length;t++)i4(e[t])}}function zs(e,t){var n=e.stateNode;if(n===null)return null;var i=n[mt]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(S(231,t,typeof n));return n}var Qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jf=!1;if(Qn)try{var ks={};Object.defineProperty(ks,"passive",{get:function(){Jf=!0}}),window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{Jf=!1}var Ei=null,Wf=null,Tu=null;function l4(){if(Tu)return Tu;var e,t=Wf,n=t.length,i,a="value"in Ei?Ei.value:Ei.textContent,l=a.length;for(e=0;e<n&&t[e]===a[e];e++);var s=n-e;for(i=1;i<=s&&t[n-i]===a[l-i];i++);return Tu=a.slice(e,1<i?1-i:void 0)}function Au(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Nu(){return!0}function s4(){return!1}function gt(e){function t(n,i,a,l,s){this._reactName=n,this._targetInst=a,this.type=i,this.nativeEvent=l,this.target=s,this.currentTarget=null;for(var r in e)e.hasOwnProperty(r)&&(n=e[r],this[r]=n?n(l):l[r]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Nu:s4,this.isPropagationStopped=s4,this}return oe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Nu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Nu)},persist:function(){},isPersistent:Nu}),t}var ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ju=gt(ha),Ls=oe({},ha,{view:0,detail:0}),xp=gt(Ls),Pf,$f,Us,Mu=oe({},Ls,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:td,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Us&&(Us&&e.type==="mousemove"?(Pf=e.screenX-Us.screenX,$f=e.screenY-Us.screenY):$f=Pf=0,Us=e),Pf)},movementY:function(e){return"movementY"in e?e.movementY:$f}}),r4=gt(Mu),Sp=oe({},Mu,{dataTransfer:0}),Ep=gt(Sp),_p=oe({},Ls,{relatedTarget:0}),ed=gt(_p),Tp=oe({},ha,{animationName:0,elapsedTime:0,pseudoElement:0}),Ap=gt(Tp),Np=oe({},ha,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jp=gt(Np),Mp=oe({},ha,{data:0}),u4=gt(Mp),Cp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dp={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Op={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Op[e])?!!t[e]:!1}function td(){return zp}var kp=oe({},Ls,{key:function(e){if(e.key){var t=Cp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Au(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Dp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:td,charCode:function(e){return e.type==="keypress"?Au(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Au(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Lp=gt(kp),Up=oe({},Mu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),o4=gt(Up),Bp=oe({},Ls,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:td}),Rp=gt(Bp),Gp=oe({},ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hp=gt(Gp),Vp=oe({},Mu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),qp=gt(Vp),Fp=oe({},ha,{newState:0,oldState:0}),Yp=gt(Fp),Xp=[9,13,27,32],nd=Qn&&"CompositionEvent"in window,Bs=null;Qn&&"documentMode"in document&&(Bs=document.documentMode);var Qp=Qn&&"TextEvent"in window&&!Bs,c4=Qn&&(!nd||Bs&&8<Bs&&11>=Bs),f4=" ",d4=!1;function h4(e,t){switch(e){case"keyup":return Xp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function m4(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bl=!1;function Zp(e,t){switch(e){case"compositionend":return m4(t);case"keypress":return t.which!==32?null:(d4=!0,f4);case"textInput":return e=t.data,e===f4&&d4?null:e;default:return null}}function Kp(e,t){if(bl)return e==="compositionend"||!nd&&h4(e,t)?(e=l4(),Tu=Wf=Ei=null,bl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return c4&&t.locale!=="ko"?null:t.data;default:return null}}var Ip={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function g4(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ip[e.type]:t==="textarea"}function w4(e,t,n,i){pl?vl?vl.push(i):vl=[i]:pl=i,t=vo(t,"onChange"),0<t.length&&(n=new ju("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Rs=null,Gs=null;function Jp(e){Pg(e,0)}function Cu(e){var t=Os(e);if(W3(t))return e}function y4(e,t){if(e==="change")return t}var p4=!1;if(Qn){var id;if(Qn){var ad="oninput"in document;if(!ad){var v4=document.createElement("div");v4.setAttribute("oninput","return;"),ad=typeof v4.oninput=="function"}id=ad}else id=!1;p4=id&&(!document.documentMode||9<document.documentMode)}function b4(){Rs&&(Rs.detachEvent("onpropertychange",x4),Gs=Rs=null)}function x4(e){if(e.propertyName==="value"&&Cu(Gs)){var t=[];w4(t,Gs,e,Kf(e)),a4(Jp,t)}}function Wp(e,t,n){e==="focusin"?(b4(),Rs=t,Gs=n,Rs.attachEvent("onpropertychange",x4)):e==="focusout"&&b4()}function Pp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cu(Gs)}function $p(e,t){if(e==="click")return Cu(t)}function ev(e,t){if(e==="input"||e==="change")return Cu(t)}function tv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rt=typeof Object.is=="function"?Object.is:tv;function Hs(e,t){if(Rt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var a=n[i];if(!Lf.call(t,a)||!Rt(e[a],t[a]))return!1}return!0}function S4(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function E4(e,t){var n=S4(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=S4(n)}}function _4(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_4(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function T4(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Eu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Eu(e.document)}return t}function ld(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var nv=Qn&&"documentMode"in document&&11>=document.documentMode,xl=null,sd=null,Vs=null,rd=!1;function A4(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;rd||xl==null||xl!==Eu(i)||(i=xl,"selectionStart"in i&&ld(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Vs&&Hs(Vs,i)||(Vs=i,i=vo(sd,"onSelect"),0<i.length&&(t=new ju("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=xl)))}function ma(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sl={animationend:ma("Animation","AnimationEnd"),animationiteration:ma("Animation","AnimationIteration"),animationstart:ma("Animation","AnimationStart"),transitionrun:ma("Transition","TransitionRun"),transitionstart:ma("Transition","TransitionStart"),transitioncancel:ma("Transition","TransitionCancel"),transitionend:ma("Transition","TransitionEnd")},ud={},N4={};Qn&&(N4=document.createElement("div").style,"AnimationEvent"in window||(delete Sl.animationend.animation,delete Sl.animationiteration.animation,delete Sl.animationstart.animation),"TransitionEvent"in window||delete Sl.transitionend.transition);function ga(e){if(ud[e])return ud[e];if(!Sl[e])return e;var t=Sl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in N4)return ud[e]=t[n];return e}var j4=ga("animationend"),M4=ga("animationiteration"),C4=ga("animationstart"),iv=ga("transitionrun"),av=ga("transitionstart"),lv=ga("transitioncancel"),D4=ga("transitionend"),O4=new Map,od="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");od.push("scrollEnd");function yn(e,t){O4.set(e,t),da(t,[e])}var Du=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},tn=[],El=0,cd=0;function Ou(){for(var e=El,t=cd=El=0;t<e;){var n=tn[t];tn[t++]=null;var i=tn[t];tn[t++]=null;var a=tn[t];tn[t++]=null;var l=tn[t];if(tn[t++]=null,i!==null&&a!==null){var s=i.pending;s===null?a.next=a:(a.next=s.next,s.next=a),i.pending=a}l!==0&&z4(n,a,l)}}function zu(e,t,n,i){tn[El++]=e,tn[El++]=t,tn[El++]=n,tn[El++]=i,cd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function fd(e,t,n,i){return zu(e,t,n,i),ku(e)}function wa(e,t){return zu(e,null,null,t),ku(e)}function z4(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var a=!1,l=e.return;l!==null;)l.childLanes|=n,i=l.alternate,i!==null&&(i.childLanes|=n),l.tag===22&&(e=l.stateNode,e===null||e._visibility&1||(a=!0)),e=l,l=l.return;return e.tag===3?(l=e.stateNode,a&&t!==null&&(a=31-Bt(n),e=l.hiddenUpdates,i=e[a],i===null?e[a]=[t]:i.push(t),t.lane=n|536870912),l):null}function ku(e){if(50<or)throw or=0,b2=null,Error(S(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var _l={};function sv(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,n,i){return new sv(e,t,n,i)}function dd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zn(e,t){var n=e.alternate;return n===null?(n=Gt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function k4(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Lu(e,t,n,i,a,l){var s=0;if(i=e,typeof e=="function")dd(e)&&(s=1);else if(typeof e=="string")s=f8(e,n,On.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case jf:return e=Gt(31,n,t,a),e.elementType=jf,e.lanes=l,e;case ul:return ya(n.children,a,l,t);case D3:s=8,a|=24;break;case Ef:return e=Gt(12,n,t,a|2),e.elementType=Ef,e.lanes=l,e;case Tf:return e=Gt(13,n,t,a),e.elementType=Tf,e.lanes=l,e;case Af:return e=Gt(19,n,t,a),e.elementType=Af,e.lanes=l,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fn:s=10;break e;case O3:s=9;break e;case _f:s=11;break e;case Nf:s=14;break e;case vi:s=16,i=null;break e}s=29,n=Error(S(130,e===null?"null":typeof e,"")),i=null}return t=Gt(s,n,t,a),t.elementType=e,t.type=i,t.lanes=l,t}function ya(e,t,n,i){return e=Gt(7,e,i,t),e.lanes=n,e}function hd(e,t,n){return e=Gt(6,e,null,t),e.lanes=n,e}function L4(e){var t=Gt(18,null,null,0);return t.stateNode=e,t}function md(e,t,n){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var U4=new WeakMap;function nn(e,t){if(typeof e=="object"&&e!==null){var n=U4.get(e);return n!==void 0?n:(t={value:e,source:t,stack:L3(t)},U4.set(e,t),t)}return{value:e,source:t,stack:L3(t)}}var Tl=[],Al=0,Uu=null,qs=0,an=[],ln=0,_i=null,zn=1,kn="";function Kn(e,t){Tl[Al++]=qs,Tl[Al++]=Uu,Uu=e,qs=t}function B4(e,t,n){an[ln++]=zn,an[ln++]=kn,an[ln++]=_i,_i=e;var i=zn;e=kn;var a=32-Bt(i)-1;i&=~(1<<a),n+=1;var l=32-Bt(t)+a;if(30<l){var s=a-a%5;l=(i&(1<<s)-1).toString(32),i>>=s,a-=s,zn=1<<32-Bt(t)+a|n<<a|i,kn=l+e}else zn=1<<l|n<<a|i,kn=e}function gd(e){e.return!==null&&(Kn(e,1),B4(e,1,0))}function wd(e){for(;e===Uu;)Uu=Tl[--Al],Tl[Al]=null,qs=Tl[--Al],Tl[Al]=null;for(;e===_i;)_i=an[--ln],an[ln]=null,kn=an[--ln],an[ln]=null,zn=an[--ln],an[ln]=null}function R4(e,t){an[ln++]=zn,an[ln++]=kn,an[ln++]=_i,zn=t.id,kn=t.overflow,_i=e}var $e=null,ce=null,X=!1,Ti=null,sn=!1,yd=Error(S(519));function Ai(e){var t=Error(S(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fs(nn(t,e)),yd}function G4(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[Pe]=e,t[mt]=i,n){case"dialog":F("cancel",t),F("close",t);break;case"iframe":case"object":case"embed":F("load",t);break;case"video":case"audio":for(n=0;n<fr.length;n++)F(fr[n],t);break;case"source":F("error",t);break;case"img":case"image":case"link":F("error",t),F("load",t);break;case"details":F("toggle",t);break;case"input":F("invalid",t),P3(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":F("invalid",t);break;case"textarea":F("invalid",t),e4(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||nw(t.textContent,n)?(i.popover!=null&&(F("beforetoggle",t),F("toggle",t)),i.onScroll!=null&&F("scroll",t),i.onScrollEnd!=null&&F("scrollend",t),i.onClick!=null&&(t.onclick=Xn),t=!0):t=!1,t||Ai(e,!0)}function H4(e){for($e=e.return;$e;)switch($e.tag){case 5:case 31:case 13:sn=!1;return;case 27:case 3:sn=!0;return;default:$e=$e.return}}function Nl(e){if(e!==$e)return!1;if(!X)return H4(e),X=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||L2(e.type,e.memoizedProps)),n=!n),n&&ce&&Ai(e),H4(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(317));ce=fw(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(317));ce=fw(e)}else t===27?(t=ce,Hi(e.type)?(e=H2,H2=null,ce=e):ce=t):ce=$e?un(e.stateNode.nextSibling):null;return!0}function pa(){ce=$e=null,X=!1}function pd(){var e=Ti;return e!==null&&(vt===null?vt=e:vt.push.apply(vt,e),Ti=null),e}function Fs(e){Ti===null?Ti=[e]:Ti.push(e)}var vd=Dn(null),va=null,In=null;function Ni(e,t,n){ue(vd,t._currentValue),t._currentValue=n}function Jn(e){e._currentValue=vd.current,Ke(vd)}function bd(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function xd(e,t,n,i){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var l=a.dependencies;if(l!==null){var s=a.child;l=l.firstContext;e:for(;l!==null;){var r=l;l=a;for(var o=0;o<t.length;o++)if(r.context===t[o]){l.lanes|=n,r=l.alternate,r!==null&&(r.lanes|=n),bd(l.return,n,e),i||(s=null);break e}l=r.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(S(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),bd(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function jl(e,t,n,i){e=null;for(var a=t,l=!1;a!==null;){if(!l){if(a.flags&524288)l=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(S(387));if(s=s.memoizedProps,s!==null){var r=a.type;Rt(a.pendingProps.value,s.value)||(e!==null?e.push(r):e=[r])}}else if(a===hu.current){if(s=a.alternate,s===null)throw Error(S(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(wr):e=[wr])}a=a.return}e!==null&&xd(t,e,n,i),t.flags|=262144}function Bu(e){for(e=e.firstContext;e!==null;){if(!Rt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){va=e,In=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function et(e){return V4(va,e)}function Ru(e,t){return va===null&&ba(e),V4(e,t)}function V4(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},In===null){if(e===null)throw Error(S(308));In=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else In=In.next=t;return n}var rv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},uv=qe.unstable_scheduleCallback,ov=qe.unstable_NormalPriority,ke={$$typeof:Fn,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sd(){return{controller:new rv,data:new Map,refCount:0}}function Ys(e){e.refCount--,e.refCount===0&&uv(ov,function(){e.controller.abort()})}var Xs=null,Ed=0,Ml=0,Cl=null;function cv(e,t){if(Xs===null){var n=Xs=[];Ed=0,Ml=A2(),Cl={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Ed++,t.then(q4,q4),t}function q4(){if(--Ed===0&&Xs!==null){Cl!==null&&(Cl.status="fulfilled");var e=Xs;Xs=null,Ml=0,Cl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fv(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(i.status="rejected",i.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),i}var F4=B.S;B.S=function(e,t){Ag=Lt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&cv(e,t),F4!==null&&F4(e,t)};var xa=Dn(null);function _d(){var e=xa.current;return e!==null?e:le.pooledCache}function Gu(e,t){t===null?ue(xa,xa.current):ue(xa,t.pool)}function Y4(){var e=_d();return e===null?null:{parent:ke._currentValue,pool:e}}var Dl=Error(S(460)),Td=Error(S(474)),Hu=Error(S(542)),Vu={then:function(){}};function X4(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Q4(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xn,Xn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,K4(e),e;default:if(typeof t.status=="string")t.then(Xn,Xn);else{if(e=le,e!==null&&100<e.shellSuspendCounter)throw Error(S(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=i}},function(i){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,K4(e),e}throw Ea=t,Dl}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ea=n,Dl):n}}var Ea=null;function Z4(){if(Ea===null)throw Error(S(459));var e=Ea;return Ea=null,e}function K4(e){if(e===Dl||e===Hu)throw Error(S(483))}var Ol=null,Qs=0;function qu(e){var t=Qs;return Qs+=1,Ol===null&&(Ol=[]),Q4(Ol,e,t)}function Zs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Fu(e,t){throw t.$$typeof===Wy?Error(S(525)):(e=Object.prototype.toString.call(t),Error(S(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function I4(e){function t(g,w){if(e){var p=g.deletions;p===null?(g.deletions=[w],g.flags|=16):p.push(w)}}function n(g,w){if(!e)return null;for(;w!==null;)t(g,w),w=w.sibling;return null}function i(g){for(var w=new Map;g!==null;)g.key!==null?w.set(g.key,g):w.set(g.index,g),g=g.sibling;return w}function a(g,w){return g=Zn(g,w),g.index=0,g.sibling=null,g}function l(g,w,p){return g.index=p,e?(p=g.alternate,p!==null?(p=p.index,p<w?(g.flags|=67108866,w):p):(g.flags|=67108866,w)):(g.flags|=1048576,w)}function s(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function r(g,w,p,b){return w===null||w.tag!==6?(w=hd(p,g.mode,b),w.return=g,w):(w=a(w,p),w.return=g,w)}function o(g,w,p,b){var A=p.type;return A===ul?f(g,w,p.props.children,b,p.key):w!==null&&(w.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===vi&&Sa(A)===w.type)?(w=a(w,p.props),Zs(w,p),w.return=g,w):(w=Lu(p.type,p.key,p.props,null,g.mode,b),Zs(w,p),w.return=g,w)}function c(g,w,p,b){return w===null||w.tag!==4||w.stateNode.containerInfo!==p.containerInfo||w.stateNode.implementation!==p.implementation?(w=md(p,g.mode,b),w.return=g,w):(w=a(w,p.children||[]),w.return=g,w)}function f(g,w,p,b,A){return w===null||w.tag!==7?(w=ya(p,g.mode,b,A),w.return=g,w):(w=a(w,p),w.return=g,w)}function h(g,w,p){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=hd(""+w,g.mode,p),w.return=g,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case du:return p=Lu(w.type,w.key,w.props,null,g.mode,p),Zs(p,w),p.return=g,p;case _s:return w=md(w,g.mode,p),w.return=g,w;case vi:return w=Sa(w),h(g,w,p)}if(As(w)||Ts(w))return w=ya(w,g.mode,p,null),w.return=g,w;if(typeof w.then=="function")return h(g,qu(w),p);if(w.$$typeof===Fn)return h(g,Ru(g,w),p);Fu(g,w)}return null}function d(g,w,p,b){var A=w!==null?w.key:null;if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return A!==null?null:r(g,w,""+p,b);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case du:return p.key===A?o(g,w,p,b):null;case _s:return p.key===A?c(g,w,p,b):null;case vi:return p=Sa(p),d(g,w,p,b)}if(As(p)||Ts(p))return A!==null?null:f(g,w,p,b,null);if(typeof p.then=="function")return d(g,w,qu(p),b);if(p.$$typeof===Fn)return d(g,w,Ru(g,p),b);Fu(g,p)}return null}function m(g,w,p,b,A){if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return g=g.get(p)||null,r(w,g,""+b,A);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case du:return g=g.get(b.key===null?p:b.key)||null,o(w,g,b,A);case _s:return g=g.get(b.key===null?p:b.key)||null,c(w,g,b,A);case vi:return b=Sa(b),m(g,w,p,b,A)}if(As(b)||Ts(b))return g=g.get(p)||null,f(w,g,b,A,null);if(typeof b.then=="function")return m(g,w,p,qu(b),A);if(b.$$typeof===Fn)return m(g,w,p,Ru(w,b),A);Fu(w,b)}return null}function v(g,w,p,b){for(var A=null,N=null,_=w,M=w=0,T=null;_!==null&&M<p.length;M++){_.index>M?(T=_,_=null):T=_.sibling;var D=d(g,_,p[M],b);if(D===null){_===null&&(_=T);break}e&&_&&D.alternate===null&&t(g,_),w=l(D,w,M),N===null?A=D:N.sibling=D,N=D,_=T}if(M===p.length)return n(g,_),X&&Kn(g,M),A;if(_===null){for(;M<p.length;M++)_=h(g,p[M],b),_!==null&&(w=l(_,w,M),N===null?A=_:N.sibling=_,N=_);return X&&Kn(g,M),A}for(_=i(_);M<p.length;M++)T=m(_,g,M,p[M],b),T!==null&&(e&&T.alternate!==null&&_.delete(T.key===null?M:T.key),w=l(T,w,M),N===null?A=T:N.sibling=T,N=T);return e&&_.forEach(function(Ee){return t(g,Ee)}),X&&Kn(g,M),A}function x(g,w,p,b){if(p==null)throw Error(S(151));for(var A=null,N=null,_=w,M=w=0,T=null,D=p.next();_!==null&&!D.done;M++,D=p.next()){_.index>M?(T=_,_=null):T=_.sibling;var Ee=d(g,_,D.value,b);if(Ee===null){_===null&&(_=T);break}e&&_&&Ee.alternate===null&&t(g,_),w=l(Ee,w,M),N===null?A=Ee:N.sibling=Ee,N=Ee,_=T}if(D.done)return n(g,_),X&&Kn(g,M),A;if(_===null){for(;!D.done;M++,D=p.next())D=h(g,D.value,b),D!==null&&(w=l(D,w,M),N===null?A=D:N.sibling=D,N=D);return X&&Kn(g,M),A}for(_=i(_);!D.done;M++,D=p.next())D=m(_,g,M,D.value,b),D!==null&&(e&&D.alternate!==null&&_.delete(D.key===null?M:D.key),w=l(D,w,M),N===null?A=D:N.sibling=D,N=D);return e&&_.forEach(function(Re){return t(g,Re)}),X&&Kn(g,M),A}function E(g,w,p,b){if(typeof p=="object"&&p!==null&&p.type===ul&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case du:e:{for(var A=p.key;w!==null;){if(w.key===A){if(A=p.type,A===ul){if(w.tag===7){n(g,w.sibling),b=a(w,p.props.children),b.return=g,g=b;break e}}else if(w.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===vi&&Sa(A)===w.type){n(g,w.sibling),b=a(w,p.props),Zs(b,p),b.return=g,g=b;break e}n(g,w);break}else t(g,w);w=w.sibling}p.type===ul?(b=ya(p.props.children,g.mode,b,p.key),b.return=g,g=b):(b=Lu(p.type,p.key,p.props,null,g.mode,b),Zs(b,p),b.return=g,g=b)}return s(g);case _s:e:{for(A=p.key;w!==null;){if(w.key===A)if(w.tag===4&&w.stateNode.containerInfo===p.containerInfo&&w.stateNode.implementation===p.implementation){n(g,w.sibling),b=a(w,p.children||[]),b.return=g,g=b;break e}else{n(g,w);break}else t(g,w);w=w.sibling}b=md(p,g.mode,b),b.return=g,g=b}return s(g);case vi:return p=Sa(p),E(g,w,p,b)}if(As(p))return v(g,w,p,b);if(Ts(p)){if(A=Ts(p),typeof A!="function")throw Error(S(150));return p=A.call(p),x(g,w,p,b)}if(typeof p.then=="function")return E(g,w,qu(p),b);if(p.$$typeof===Fn)return E(g,w,Ru(g,p),b);Fu(g,p)}return typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint"?(p=""+p,w!==null&&w.tag===6?(n(g,w.sibling),b=a(w,p),b.return=g,g=b):(n(g,w),b=hd(p,g.mode,b),b.return=g,g=b),s(g)):n(g,w)}return function(g,w,p,b){try{Qs=0;var A=E(g,w,p,b);return Ol=null,A}catch(_){if(_===Dl||_===Hu)throw _;var N=Gt(29,_,null,g.mode);return N.lanes=b,N.return=g,N}finally{}}}var _a=I4(!0),J4=I4(!1),ji=!1;function Ad(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Mi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ci(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,P&2){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,t=ku(e),z4(e,null,n),t}return zu(e,i,t,n),ku(e)}function Ks(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,V3(e,n)}}function jd(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var a=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var s={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};l===null?a=l=s:l=l.next=s,n=n.next}while(n!==null);l===null?a=l=t:l=l.next=t}else a=l=t;n={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:l,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Md=!1;function Is(){if(Md){var e=Cl;if(e!==null)throw e}}function Js(e,t,n,i){Md=!1;var a=e.updateQueue;ji=!1;var l=a.firstBaseUpdate,s=a.lastBaseUpdate,r=a.shared.pending;if(r!==null){a.shared.pending=null;var o=r,c=o.next;o.next=null,s===null?l=c:s.next=c,s=o;var f=e.alternate;f!==null&&(f=f.updateQueue,r=f.lastBaseUpdate,r!==s&&(r===null?f.firstBaseUpdate=c:r.next=c,f.lastBaseUpdate=o))}if(l!==null){var h=a.baseState;s=0,f=c=o=null,r=l;do{var d=r.lane&-536870913,m=d!==r.lane;if(m?(Y&d)===d:(i&d)===d){d!==0&&d===Ml&&(Md=!0),f!==null&&(f=f.next={lane:0,tag:r.tag,payload:r.payload,callback:null,next:null});e:{var v=e,x=r;d=t;var E=n;switch(x.tag){case 1:if(v=x.payload,typeof v=="function"){h=v.call(E,h,d);break e}h=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=x.payload,d=typeof v=="function"?v.call(E,h,d):v,d==null)break e;h=oe({},h,d);break e;case 2:ji=!0}}d=r.callback,d!==null&&(e.flags|=64,m&&(e.flags|=8192),m=a.callbacks,m===null?a.callbacks=[d]:m.push(d))}else m={lane:d,tag:r.tag,payload:r.payload,callback:r.callback,next:null},f===null?(c=f=m,o=h):f=f.next=m,s|=d;if(r=r.next,r===null){if(r=a.shared.pending,r===null)break;m=r,r=m.next,m.next=null,a.lastBaseUpdate=m,a.shared.pending=null}}while(!0);f===null&&(o=h),a.baseState=o,a.firstBaseUpdate=c,a.lastBaseUpdate=f,l===null&&(a.shared.lanes=0),Li|=s,e.lanes=s,e.memoizedState=h}}function W4(e,t){if(typeof e!="function")throw Error(S(191,e));e.call(t)}function P4(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)W4(n[e],t)}var zl=Dn(null),Yu=Dn(0);function $4(e,t){e=li,ue(Yu,e),ue(zl,t),li=e|t.baseLanes}function Cd(){ue(Yu,li),ue(zl,zl.current)}function Dd(){li=Yu.current,Ke(zl),Ke(Yu)}var Ht=Dn(null),rn=null;function Di(e){var t=e.alternate;ue(je,je.current&1),ue(Ht,e),rn===null&&(t===null||zl.current!==null||t.memoizedState!==null)&&(rn=e)}function Od(e){ue(je,je.current),ue(Ht,e),rn===null&&(rn=e)}function em(e){e.tag===22?(ue(je,je.current),ue(Ht,e),rn===null&&(rn=e)):Oi()}function Oi(){ue(je,je.current),ue(Ht,Ht.current)}function Vt(e){Ke(Ht),rn===e&&(rn=null),Ke(je)}var je=Dn(0);function Xu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||R2(n)||G2(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wn=0,H=null,ie=null,Le=null,Qu=!1,kl=!1,Ta=!1,Zu=0,Ws=0,Ll=null,dv=0;function xe(){throw Error(S(321))}function zd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Rt(e[n],t[n]))return!1;return!0}function kd(e,t,n,i,a,l){return Wn=l,H=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?Bm:Id,Ta=!1,l=n(i,a),Ta=!1,kl&&(l=nm(t,n,i,a)),tm(e),l}function tm(e){B.H=er;var t=ie!==null&&ie.next!==null;if(Wn=0,Le=ie=H=null,Qu=!1,Ws=0,Ll=null,t)throw Error(S(300));e===null||Ue||(e=e.dependencies,e!==null&&Bu(e)&&(Ue=!0))}function nm(e,t,n,i){H=e;var a=0;do{if(kl&&(Ll=null),Ws=0,kl=!1,25<=a)throw Error(S(301));if(a+=1,Le=ie=null,e.updateQueue!=null){var l=e.updateQueue;l.lastEffect=null,l.events=null,l.stores=null,l.memoCache!=null&&(l.memoCache.index=0)}B.H=Rm,l=t(n,i)}while(kl);return l}function hv(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?Ps(t):t,e=e.useState()[0],(ie!==null?ie.memoizedState:null)!==e&&(H.flags|=1024),t}function Ld(){var e=Zu!==0;return Zu=0,e}function Ud(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Bd(e){if(Qu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qu=!1}Wn=0,Le=ie=H=null,kl=!1,Ws=Zu=0,Ll=null}function st(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Le===null?H.memoizedState=Le=e:Le=Le.next=e,Le}function Me(){if(ie===null){var e=H.alternate;e=e!==null?e.memoizedState:null}else e=ie.next;var t=Le===null?H.memoizedState:Le.next;if(t!==null)Le=t,ie=e;else{if(e===null)throw H.alternate===null?Error(S(467)):Error(S(310));ie=e,e={memoizedState:ie.memoizedState,baseState:ie.baseState,baseQueue:ie.baseQueue,queue:ie.queue,next:null},Le===null?H.memoizedState=Le=e:Le=Le.next=e}return Le}function Ku(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ps(e){var t=Ws;return Ws+=1,Ll===null&&(Ll=[]),e=Q4(Ll,e,t),t=H,(Le===null?t.memoizedState:Le.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?Bm:Id),e}function Iu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ps(e);if(e.$$typeof===Fn)return et(e)}throw Error(S(438,String(e)))}function Rd(e){var t=null,n=H.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=H.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ku(),H.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=Py;return t.index++,n}function Pn(e,t){return typeof t=="function"?t(e):t}function Ju(e){var t=Me();return Gd(t,ie,e)}function Gd(e,t,n){var i=e.queue;if(i===null)throw Error(S(311));i.lastRenderedReducer=n;var a=e.baseQueue,l=i.pending;if(l!==null){if(a!==null){var s=a.next;a.next=l.next,l.next=s}t.baseQueue=a=l,i.pending=null}if(l=e.baseState,a===null)e.memoizedState=l;else{t=a.next;var r=s=null,o=null,c=t,f=!1;do{var h=c.lane&-536870913;if(h!==c.lane?(Y&h)===h:(Wn&h)===h){var d=c.revertLane;if(d===0)o!==null&&(o=o.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),h===Ml&&(f=!0);else if((Wn&d)===d){c=c.next,d===Ml&&(f=!0);continue}else h={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},o===null?(r=o=h,s=l):o=o.next=h,H.lanes|=d,Li|=d;h=c.action,Ta&&n(l,h),l=c.hasEagerState?c.eagerState:n(l,h)}else d={lane:h,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},o===null?(r=o=d,s=l):o=o.next=d,H.lanes|=h,Li|=h;c=c.next}while(c!==null&&c!==t);if(o===null?s=l:o.next=r,!Rt(l,e.memoizedState)&&(Ue=!0,f&&(n=Cl,n!==null)))throw n;e.memoizedState=l,e.baseState=s,e.baseQueue=o,i.lastRenderedState=l}return a===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Hd(e){var t=Me(),n=t.queue;if(n===null)throw Error(S(311));n.lastRenderedReducer=e;var i=n.dispatch,a=n.pending,l=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do l=e(l,s.action),s=s.next;while(s!==a);Rt(l,t.memoizedState)||(Ue=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,i]}function im(e,t,n){var i=H,a=Me(),l=X;if(l){if(n===void 0)throw Error(S(407));n=n()}else n=t();var s=!Rt((ie||a).memoizedState,n);if(s&&(a.memoizedState=n,Ue=!0),a=a.queue,Fd(sm.bind(null,i,a,e),[e]),a.getSnapshot!==t||s||Le!==null&&Le.memoizedState.tag&1){if(i.flags|=2048,Ul(9,{destroy:void 0},lm.bind(null,i,a,n,t),null),le===null)throw Error(S(349));l||Wn&127||am(i,t,n)}return n}function am(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=H.updateQueue,t===null?(t=Ku(),H.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function lm(e,t,n,i){t.value=n,t.getSnapshot=i,rm(t)&&um(e)}function sm(e,t,n){return n(function(){rm(t)&&um(e)})}function rm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Rt(e,n)}catch{return!0}}function um(e){var t=wa(e,2);t!==null&&bt(t,e,2)}function Vd(e){var t=st();if(typeof e=="function"){var n=e;if(e=n(),Ta){xi(!0);try{n()}finally{xi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:e},t}function om(e,t,n,i){return e.baseState=n,Gd(e,ie,typeof i=="function"?i:Pn)}function mv(e,t,n,i,a){if($u(e))throw Error(S(485));if(e=t.action,e!==null){var l={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(s){l.listeners.push(s)}};B.T!==null?n(!0):l.isTransition=!1,i(l),n=t.pending,n===null?(l.next=t.pending=l,cm(t,l)):(l.next=n.next,t.pending=n.next=l)}}function cm(e,t){var n=t.action,i=t.payload,a=e.state;if(t.isTransition){var l=B.T,s={};B.T=s;try{var r=n(a,i),o=B.S;o!==null&&o(s,r),fm(e,t,r)}catch(c){qd(e,t,c)}finally{l!==null&&s.types!==null&&(l.types=s.types),B.T=l}}else try{l=n(a,i),fm(e,t,l)}catch(c){qd(e,t,c)}}function fm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){dm(e,t,i)},function(i){return qd(e,t,i)}):dm(e,t,n)}function dm(e,t,n){t.status="fulfilled",t.value=n,hm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,cm(e,n)))}function qd(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,hm(t),t=t.next;while(t!==i)}e.action=null}function hm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function mm(e,t){return t}function gm(e,t){if(X){var n=le.formState;if(n!==null){e:{var i=H;if(X){if(ce){t:{for(var a=ce,l=sn;a.nodeType!==8;){if(!l){a=null;break t}if(a=un(a.nextSibling),a===null){a=null;break t}}l=a.data,a=l==="F!"||l==="F"?a:null}if(a){ce=un(a.nextSibling),i=a.data==="F!";break e}}Ai(i)}i=!1}i&&(t=n[0])}}return n=st(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mm,lastRenderedState:t},n.queue=i,n=km.bind(null,H,i),i.dispatch=n,i=Vd(!1),l=Kd.bind(null,H,!1,i.queue),i=st(),a={state:t,dispatch:null,action:e,pending:null},i.queue=a,n=mv.bind(null,H,a,l,n),a.dispatch=n,i.memoizedState=e,[t,n,!1]}function wm(e){var t=Me();return ym(t,ie,e)}function ym(e,t,n){if(t=Gd(e,t,mm)[0],e=Ju(Pn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Ps(t)}catch(s){throw s===Dl?Hu:s}else i=t;t=Me();var a=t.queue,l=a.dispatch;return n!==t.memoizedState&&(H.flags|=2048,Ul(9,{destroy:void 0},gv.bind(null,a,n),null)),[i,l,e]}function gv(e,t){e.action=t}function pm(e){var t=Me(),n=ie;if(n!==null)return ym(t,n,e);Me(),t=t.memoizedState,n=Me();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function Ul(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=H.updateQueue,t===null&&(t=Ku(),H.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function vm(){return Me().memoizedState}function Wu(e,t,n,i){var a=st();H.flags|=e,a.memoizedState=Ul(1|t,{destroy:void 0},n,i===void 0?null:i)}function Pu(e,t,n,i){var a=Me();i=i===void 0?null:i;var l=a.memoizedState.inst;ie!==null&&i!==null&&zd(i,ie.memoizedState.deps)?a.memoizedState=Ul(t,l,n,i):(H.flags|=e,a.memoizedState=Ul(1|t,l,n,i))}function bm(e,t){Wu(8390656,8,e,t)}function Fd(e,t){Pu(2048,8,e,t)}function wv(e){H.flags|=4;var t=H.updateQueue;if(t===null)t=Ku(),H.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function xm(e){var t=Me().memoizedState;return wv({ref:t,nextImpl:e}),function(){if(P&2)throw Error(S(440));return t.impl.apply(void 0,arguments)}}function Sm(e,t){return Pu(4,2,e,t)}function Em(e,t){return Pu(4,4,e,t)}function _m(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Tm(e,t,n){n=n!=null?n.concat([e]):null,Pu(4,4,_m.bind(null,t,e),n)}function Yd(){}function Am(e,t){var n=Me();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&zd(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Nm(e,t){var n=Me();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&zd(t,i[1]))return i[0];if(i=e(),Ta){xi(!0);try{e()}finally{xi(!1)}}return n.memoizedState=[i,t],i}function Xd(e,t,n){return n===void 0||Wn&1073741824&&!(Y&261930)?e.memoizedState=t:(e.memoizedState=n,e=jg(),H.lanes|=e,Li|=e,n)}function jm(e,t,n,i){return Rt(n,t)?n:zl.current!==null?(e=Xd(e,n,i),Rt(e,t)||(Ue=!0),e):!(Wn&42)||Wn&1073741824&&!(Y&261930)?(Ue=!0,e.memoizedState=n):(e=jg(),H.lanes|=e,Li|=e,t)}function Mm(e,t,n,i,a){var l=W.p;W.p=l!==0&&8>l?l:8;var s=B.T,r={};B.T=r,Kd(e,!1,t,n);try{var o=a(),c=B.S;if(c!==null&&c(r,o),o!==null&&typeof o=="object"&&typeof o.then=="function"){var f=fv(o,i);$s(e,t,f,Yt(e))}else $s(e,t,i,Yt(e))}catch(h){$s(e,t,{then:function(){},status:"rejected",reason:h},Yt())}finally{W.p=l,s!==null&&r.types!==null&&(s.types=r.types),B.T=s}}function yv(){}function Qd(e,t,n,i){if(e.tag!==5)throw Error(S(476));var a=Cm(e).queue;Mm(e,a,t,oa,n===null?yv:function(){return Dm(e),n(i)})}function Cm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oa,baseState:oa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:oa},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Dm(e){var t=Cm(e);t.next===null&&(t=e.alternate.memoizedState),$s(e,t.next.queue,{},Yt())}function Zd(){return et(wr)}function Om(){return Me().memoizedState}function zm(){return Me().memoizedState}function pv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Yt();e=Mi(n);var i=Ci(t,e,n);i!==null&&(bt(i,t,n),Ks(i,t,n)),t={cache:Sd()},e.payload=t;return}t=t.return}}function vv(e,t,n){var i=Yt();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},$u(e)?Lm(t,n):(n=fd(e,t,n,i),n!==null&&(bt(n,e,i),Um(n,t,i)))}function km(e,t,n){var i=Yt();$s(e,t,n,i)}function $s(e,t,n,i){var a={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if($u(e))Lm(t,a);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var s=t.lastRenderedState,r=l(s,n);if(a.hasEagerState=!0,a.eagerState=r,Rt(r,s))return zu(e,t,a,0),le===null&&Ou(),!1}catch{}finally{}if(n=fd(e,t,a,i),n!==null)return bt(n,e,i),Um(n,t,i),!0}return!1}function Kd(e,t,n,i){if(i={lane:2,revertLane:A2(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},$u(e)){if(t)throw Error(S(479))}else t=fd(e,n,i,2),t!==null&&bt(t,e,2)}function $u(e){var t=e.alternate;return e===H||t!==null&&t===H}function Lm(e,t){kl=Qu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Um(e,t,n){if(n&4194048){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,V3(e,n)}}var er={readContext:et,use:Iu,useCallback:xe,useContext:xe,useEffect:xe,useImperativeHandle:xe,useLayoutEffect:xe,useInsertionEffect:xe,useMemo:xe,useReducer:xe,useRef:xe,useState:xe,useDebugValue:xe,useDeferredValue:xe,useTransition:xe,useSyncExternalStore:xe,useId:xe,useHostTransitionStatus:xe,useFormState:xe,useActionState:xe,useOptimistic:xe,useMemoCache:xe,useCacheRefresh:xe};er.useEffectEvent=xe;var Bm={readContext:et,use:Iu,useCallback:function(e,t){return st().memoizedState=[e,t===void 0?null:t],e},useContext:et,useEffect:bm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Wu(4194308,4,_m.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wu(4194308,4,e,t)},useInsertionEffect:function(e,t){Wu(4,2,e,t)},useMemo:function(e,t){var n=st();t=t===void 0?null:t;var i=e();if(Ta){xi(!0);try{e()}finally{xi(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=st();if(n!==void 0){var a=n(t);if(Ta){xi(!0);try{n(t)}finally{xi(!1)}}}else a=t;return i.memoizedState=i.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},i.queue=e,e=e.dispatch=vv.bind(null,H,e),[i.memoizedState,e]},useRef:function(e){var t=st();return e={current:e},t.memoizedState=e},useState:function(e){e=Vd(e);var t=e.queue,n=km.bind(null,H,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Yd,useDeferredValue:function(e,t){var n=st();return Xd(n,e,t)},useTransition:function(){var e=Vd(!1);return e=Mm.bind(null,H,e.queue,!0,!1),st().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=H,a=st();if(X){if(n===void 0)throw Error(S(407));n=n()}else{if(n=t(),le===null)throw Error(S(349));Y&127||am(i,t,n)}a.memoizedState=n;var l={value:n,getSnapshot:t};return a.queue=l,bm(sm.bind(null,i,l,e),[e]),i.flags|=2048,Ul(9,{destroy:void 0},lm.bind(null,i,l,n,t),null),n},useId:function(){var e=st(),t=le.identifierPrefix;if(X){var n=kn,i=zn;n=(i&~(1<<32-Bt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Zu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=dv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zd,useFormState:gm,useActionState:gm,useOptimistic:function(e){var t=st();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Kd.bind(null,H,!0,n),n.dispatch=t,[e,t]},useMemoCache:Rd,useCacheRefresh:function(){return st().memoizedState=pv.bind(null,H)},useEffectEvent:function(e){var t=st(),n={impl:e};return t.memoizedState=n,function(){if(P&2)throw Error(S(440));return n.impl.apply(void 0,arguments)}}},Id={readContext:et,use:Iu,useCallback:Am,useContext:et,useEffect:Fd,useImperativeHandle:Tm,useInsertionEffect:Sm,useLayoutEffect:Em,useMemo:Nm,useReducer:Ju,useRef:vm,useState:function(){return Ju(Pn)},useDebugValue:Yd,useDeferredValue:function(e,t){var n=Me();return jm(n,ie.memoizedState,e,t)},useTransition:function(){var e=Ju(Pn)[0],t=Me().memoizedState;return[typeof e=="boolean"?e:Ps(e),t]},useSyncExternalStore:im,useId:Om,useHostTransitionStatus:Zd,useFormState:wm,useActionState:wm,useOptimistic:function(e,t){var n=Me();return om(n,ie,e,t)},useMemoCache:Rd,useCacheRefresh:zm};Id.useEffectEvent=xm;var Rm={readContext:et,use:Iu,useCallback:Am,useContext:et,useEffect:Fd,useImperativeHandle:Tm,useInsertionEffect:Sm,useLayoutEffect:Em,useMemo:Nm,useReducer:Hd,useRef:vm,useState:function(){return Hd(Pn)},useDebugValue:Yd,useDeferredValue:function(e,t){var n=Me();return ie===null?Xd(n,e,t):jm(n,ie.memoizedState,e,t)},useTransition:function(){var e=Hd(Pn)[0],t=Me().memoizedState;return[typeof e=="boolean"?e:Ps(e),t]},useSyncExternalStore:im,useId:Om,useHostTransitionStatus:Zd,useFormState:pm,useActionState:pm,useOptimistic:function(e,t){var n=Me();return ie!==null?om(n,ie,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Rd,useCacheRefresh:zm};Rm.useEffectEvent=xm;function Jd(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:oe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Wd={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=Yt(),a=Mi(i);a.payload=t,n!=null&&(a.callback=n),t=Ci(e,a,i),t!==null&&(bt(t,e,i),Ks(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=Yt(),a=Mi(i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Ci(e,a,i),t!==null&&(bt(t,e,i),Ks(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Yt(),i=Mi(n);i.tag=2,t!=null&&(i.callback=t),t=Ci(e,i,n),t!==null&&(bt(t,e,n),Ks(t,e,n))}};function Gm(e,t,n,i,a,l,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,l,s):t.prototype&&t.prototype.isPureReactComponent?!Hs(n,i)||!Hs(a,l):!0}function Hm(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Wd.enqueueReplaceState(t,t.state,null)}function Aa(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=oe({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function Vm(e){Du(e)}function qm(e){console.error(e)}function Fm(e){Du(e)}function eo(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Ym(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Pd(e,t,n){return n=Mi(n),n.tag=3,n.payload={element:null},n.callback=function(){eo(e,t)},n}function Xm(e){return e=Mi(e),e.tag=3,e}function Qm(e,t,n,i){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var l=i.value;e.payload=function(){return a(l)},e.callback=function(){Ym(t,n,i)}}var s=n.stateNode;s!==null&&typeof s.componentDidCatch=="function"&&(e.callback=function(){Ym(t,n,i),typeof a!="function"&&(Ui===null?Ui=new Set([this]):Ui.add(this));var r=i.stack;this.componentDidCatch(i.value,{componentStack:r!==null?r:""})})}function bv(e,t,n,i,a){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&jl(t,n,a,!0),n=Ht.current,n!==null){switch(n.tag){case 31:case 13:return rn===null?ho():n.alternate===null&&Se===0&&(Se=3),n.flags&=-257,n.flags|=65536,n.lanes=a,i===Vu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),E2(e,i,a)),!1;case 22:return n.flags|=65536,i===Vu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),E2(e,i,a)),!1}throw Error(S(435,n.tag))}return E2(e,i,a),ho(),!1}if(X)return t=Ht.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,i!==yd&&(e=Error(S(422),{cause:i}),Fs(nn(e,n)))):(i!==yd&&(t=Error(S(423),{cause:i}),Fs(nn(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,i=nn(i,n),a=Pd(e.stateNode,i,a),jd(e,a),Se!==4&&(Se=2)),!1;var l=Error(S(520),{cause:i});if(l=nn(l,n),ur===null?ur=[l]:ur.push(l),Se!==4&&(Se=2),t===null)return!0;i=nn(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Pd(n.stateNode,i,e),jd(n,e),!1;case 1:if(t=n.type,l=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||l!==null&&typeof l.componentDidCatch=="function"&&(Ui===null||!Ui.has(l))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xm(a),Qm(a,e,n,i),jd(n,a),!1}n=n.return}while(n!==null);return!1}var $d=Error(S(461)),Ue=!1;function tt(e,t,n,i){t.child=e===null?J4(t,null,n,i):_a(t,e.child,n,i)}function Zm(e,t,n,i,a){n=n.render;var l=t.ref;if("ref"in i){var s={};for(var r in i)r!=="ref"&&(s[r]=i[r])}else s=i;return ba(t),i=kd(e,t,n,s,l,a),r=Ld(),e!==null&&!Ue?(Ud(e,t,a),$n(e,t,a)):(X&&r&&gd(t),t.flags|=1,tt(e,t,i,a),t.child)}function Km(e,t,n,i,a){if(e===null){var l=n.type;return typeof l=="function"&&!dd(l)&&l.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=l,Im(e,t,l,i,a)):(e=Lu(n.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!r2(e,a)){var s=l.memoizedProps;if(n=n.compare,n=n!==null?n:Hs,n(s,i)&&e.ref===t.ref)return $n(e,t,a)}return t.flags|=1,e=Zn(l,i),e.ref=t.ref,e.return=t,t.child=e}function Im(e,t,n,i,a){if(e!==null){var l=e.memoizedProps;if(Hs(l,i)&&e.ref===t.ref)if(Ue=!1,t.pendingProps=i=l,r2(e,a))e.flags&131072&&(Ue=!0);else return t.lanes=e.lanes,$n(e,t,a)}return e2(e,t,n,i,a)}function Jm(e,t,n,i){var a=i.children,l=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if(t.flags&128){if(l=l!==null?l.baseLanes|n:n,e!==null){for(i=t.child=e.child,a=0;i!==null;)a=a|i.lanes|i.childLanes,i=i.sibling;i=a&~l}else i=0,t.child=null;return Wm(e,t,l,n,i)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Gu(t,l!==null?l.cachePool:null),l!==null?$4(t,l):Cd(),em(t);else return i=t.lanes=536870912,Wm(e,t,l!==null?l.baseLanes|n:n,n,i)}else l!==null?(Gu(t,l.cachePool),$4(t,l),Oi(),t.memoizedState=null):(e!==null&&Gu(t,null),Cd(),Oi());return tt(e,t,a,n),t.child}function tr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wm(e,t,n,i,a){var l=_d();return l=l===null?null:{parent:ke._currentValue,pool:l},t.memoizedState={baseLanes:n,cachePool:l},e!==null&&Gu(t,null),Cd(),em(t),e!==null&&jl(e,t,i,!0),t.childLanes=a,null}function to(e,t){return t=io({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Pm(e,t,n){return _a(t,e.child,null,n),e=to(t,t.pendingProps),e.flags|=2,Vt(t),t.memoizedState=null,e}function xv(e,t,n){var i=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(X){if(i.mode==="hidden")return e=to(t,i),t.lanes=536870912,tr(null,e);if(Od(t),(e=ce)?(e=cw(e,sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i!==null?{id:zn,overflow:kn}:null,retryLane:536870912,hydrationErrors:null},n=L4(e),n.return=t,t.child=n,$e=t,ce=null)):e=null,e===null)throw Ai(t);return t.lanes=536870912,null}return to(t,i)}var l=e.memoizedState;if(l!==null){var s=l.dehydrated;if(Od(t),a)if(t.flags&256)t.flags&=-257,t=Pm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(S(558));else if(Ue||jl(e,t,n,!1),a=(n&e.childLanes)!==0,Ue||a){if(i=le,i!==null&&(s=q3(i,n),s!==0&&s!==l.retryLane))throw l.retryLane=s,wa(e,s),bt(i,e,s),$d;ho(),t=Pm(e,t,n)}else e=l.treeContext,ce=un(s.nextSibling),$e=t,X=!0,Ti=null,sn=!1,e!==null&&R4(t,e),t=to(t,i),t.flags|=4096;return t}return e=Zn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function no(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(S(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function e2(e,t,n,i,a){return ba(t),n=kd(e,t,n,i,void 0,a),i=Ld(),e!==null&&!Ue?(Ud(e,t,a),$n(e,t,a)):(X&&i&&gd(t),t.flags|=1,tt(e,t,n,a),t.child)}function $m(e,t,n,i,a,l){return ba(t),t.updateQueue=null,n=nm(t,i,n,a),tm(e),i=Ld(),e!==null&&!Ue?(Ud(e,t,l),$n(e,t,l)):(X&&i&&gd(t),t.flags|=1,tt(e,t,n,l),t.child)}function eg(e,t,n,i,a){if(ba(t),t.stateNode===null){var l=_l,s=n.contextType;typeof s=="object"&&s!==null&&(l=et(s)),l=new n(i,l),t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Wd,t.stateNode=l,l._reactInternals=t,l=t.stateNode,l.props=i,l.state=t.memoizedState,l.refs={},Ad(t),s=n.contextType,l.context=typeof s=="object"&&s!==null?et(s):_l,l.state=t.memoizedState,s=n.getDerivedStateFromProps,typeof s=="function"&&(Jd(t,n,s,i),l.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(s=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),s!==l.state&&Wd.enqueueReplaceState(l,l.state,null),Js(t,i,l,a),Is(),l.state=t.memoizedState),typeof l.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){l=t.stateNode;var r=t.memoizedProps,o=Aa(n,r);l.props=o;var c=l.context,f=n.contextType;s=_l,typeof f=="object"&&f!==null&&(s=et(f));var h=n.getDerivedStateFromProps;f=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function",r=t.pendingProps!==r,f||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(r||c!==s)&&Hm(t,l,i,s),ji=!1;var d=t.memoizedState;l.state=d,Js(t,i,l,a),Is(),c=t.memoizedState,r||d!==c||ji?(typeof h=="function"&&(Jd(t,n,h,i),c=t.memoizedState),(o=ji||Gm(t,n,o,i,d,c,s))?(f||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),l.props=i,l.state=c,l.context=s,i=o):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{l=t.stateNode,Nd(e,t),s=t.memoizedProps,f=Aa(n,s),l.props=f,h=t.pendingProps,d=l.context,c=n.contextType,o=_l,typeof c=="object"&&c!==null&&(o=et(c)),r=n.getDerivedStateFromProps,(c=typeof r=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==h||d!==o)&&Hm(t,l,i,o),ji=!1,d=t.memoizedState,l.state=d,Js(t,i,l,a),Is();var m=t.memoizedState;s!==h||d!==m||ji||e!==null&&e.dependencies!==null&&Bu(e.dependencies)?(typeof r=="function"&&(Jd(t,n,r,i),m=t.memoizedState),(f=ji||Gm(t,n,f,i,d,m,o)||e!==null&&e.dependencies!==null&&Bu(e.dependencies))?(c||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(i,m,o),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(i,m,o)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=m),l.props=i,l.state=m,l.context=o,i=f):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),i=!1)}return l=i,no(e,t),i=(t.flags&128)!==0,l||i?(l=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:l.render(),t.flags|=1,e!==null&&i?(t.child=_a(t,e.child,null,a),t.child=_a(t,null,n,a)):tt(e,t,n,a),t.memoizedState=l.state,e=t.child):e=$n(e,t,a),e}function tg(e,t,n,i){return pa(),t.flags|=256,tt(e,t,n,i),t.child}var t2={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function n2(e){return{baseLanes:e,cachePool:Y4()}}function i2(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Ft),e}function ng(e,t,n){var i=t.pendingProps,a=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(je.current&2)!==0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!==0,t.flags&=-33,e===null){if(X){if(a?Di(t):Oi(),(e=ce)?(e=cw(e,sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:_i!==null?{id:zn,overflow:kn}:null,retryLane:536870912,hydrationErrors:null},n=L4(e),n.return=t,t.child=n,$e=t,ce=null)):e=null,e===null)throw Ai(t);return G2(e)?t.lanes=32:t.lanes=536870912,null}var r=i.children;return i=i.fallback,a?(Oi(),a=t.mode,r=io({mode:"hidden",children:r},a),i=ya(i,a,n,null),r.return=t,i.return=t,r.sibling=i,t.child=r,i=t.child,i.memoizedState=n2(n),i.childLanes=i2(e,s,n),t.memoizedState=t2,tr(null,i)):(Di(t),a2(t,r))}var o=e.memoizedState;if(o!==null&&(r=o.dehydrated,r!==null)){if(l)t.flags&256?(Di(t),t.flags&=-257,t=l2(e,t,n)):t.memoizedState!==null?(Oi(),t.child=e.child,t.flags|=128,t=null):(Oi(),r=i.fallback,a=t.mode,i=io({mode:"visible",children:i.children},a),r=ya(r,a,n,null),r.flags|=2,i.return=t,r.return=t,i.sibling=r,t.child=i,_a(t,e.child,null,n),i=t.child,i.memoizedState=n2(n),i.childLanes=i2(e,s,n),t.memoizedState=t2,t=tr(null,i));else if(Di(t),G2(r)){if(s=r.nextSibling&&r.nextSibling.dataset,s)var c=s.dgst;s=c,i=Error(S(419)),i.stack="",i.digest=s,Fs({value:i,source:null,stack:null}),t=l2(e,t,n)}else if(Ue||jl(e,t,n,!1),s=(n&e.childLanes)!==0,Ue||s){if(s=le,s!==null&&(i=q3(s,n),i!==0&&i!==o.retryLane))throw o.retryLane=i,wa(e,i),bt(s,e,i),$d;R2(r)||ho(),t=l2(e,t,n)}else R2(r)?(t.flags|=192,t.child=e.child,t=null):(e=o.treeContext,ce=un(r.nextSibling),$e=t,X=!0,Ti=null,sn=!1,e!==null&&R4(t,e),t=a2(t,i.children),t.flags|=4096);return t}return a?(Oi(),r=i.fallback,a=t.mode,o=e.child,c=o.sibling,i=Zn(o,{mode:"hidden",children:i.children}),i.subtreeFlags=o.subtreeFlags&65011712,c!==null?r=Zn(c,r):(r=ya(r,a,n,null),r.flags|=2),r.return=t,i.return=t,i.sibling=r,t.child=i,tr(null,i),i=t.child,r=e.child.memoizedState,r===null?r=n2(n):(a=r.cachePool,a!==null?(o=ke._currentValue,a=a.parent!==o?{parent:o,pool:o}:a):a=Y4(),r={baseLanes:r.baseLanes|n,cachePool:a}),i.memoizedState=r,i.childLanes=i2(e,s,n),t.memoizedState=t2,tr(e.child,i)):(Di(t),n=e.child,e=n.sibling,n=Zn(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function a2(e,t){return t=io({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function io(e,t){return e=Gt(22,e,null,t),e.lanes=0,e}function l2(e,t,n){return _a(t,e.child,null,n),e=a2(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ig(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),bd(e.return,t,n)}function s2(e,t,n,i,a,l){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:a,treeForkCount:l}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=a,s.treeForkCount=l)}function ag(e,t,n){var i=t.pendingProps,a=i.revealOrder,l=i.tail;i=i.children;var s=je.current,r=(s&2)!==0;if(r?(s=s&1|2,t.flags|=128):s&=1,ue(je,s),tt(e,t,i,n),i=X?qs:0,!r&&e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ig(e,n,t);else if(e.tag===19)ig(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Xu(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),s2(t,!1,a,n,l,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Xu(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}s2(t,!0,n,null,l,i);break;case"together":s2(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function $n(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Li|=t.lanes,!(n&t.childLanes))if(e!==null){if(jl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(S(153));if(t.child!==null){for(e=t.child,n=Zn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Zn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function r2(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Bu(e)))}function Sv(e,t,n){switch(t.tag){case 3:mu(t,t.stateNode.containerInfo),Ni(t,ke,e.memoizedState.cache),pa();break;case 27:case 5:Df(t);break;case 4:mu(t,t.stateNode.containerInfo);break;case 10:Ni(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Od(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Di(t),t.flags|=128,null):n&t.child.childLanes?ng(e,t,n):(Di(t),e=$n(e,t,n),e!==null?e.sibling:null);Di(t);break;case 19:var a=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(jl(e,t,n,!1),i=(n&t.childLanes)!==0),a){if(i)return ag(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ue(je,je.current),i)break;return null;case 22:return t.lanes=0,Jm(e,t,n,t.pendingProps);case 24:Ni(t,ke,e.memoizedState.cache)}return $n(e,t,n)}function lg(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ue=!0;else{if(!r2(e,n)&&!(t.flags&128))return Ue=!1,Sv(e,t,n);Ue=!!(e.flags&131072)}else Ue=!1,X&&t.flags&1048576&&B4(t,qs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e=="function")dd(e)?(i=Aa(e,i),t.tag=1,t=eg(null,t,e,i,n)):(t.tag=0,t=e2(null,t,e,i,n));else{if(e!=null){var a=e.$$typeof;if(a===_f){t.tag=11,t=Zm(null,t,e,i,n);break e}else if(a===Nf){t.tag=14,t=Km(null,t,e,i,n);break e}}throw t=Mf(e)||e,Error(S(306,t,""))}}return t;case 0:return e2(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,a=Aa(i,t.pendingProps),eg(e,t,i,a,n);case 3:e:{if(mu(t,t.stateNode.containerInfo),e===null)throw Error(S(387));i=t.pendingProps;var l=t.memoizedState;a=l.element,Nd(e,t),Js(t,i,null,n);var s=t.memoizedState;if(i=s.cache,Ni(t,ke,i),i!==l.cache&&xd(t,[ke],n,!0),Is(),i=s.element,l.isDehydrated)if(l={element:i,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){t=tg(e,t,i,n);break e}else if(i!==a){a=nn(Error(S(424)),t),Fs(a),t=tg(e,t,i,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ce=un(e.firstChild),$e=t,X=!0,Ti=null,sn=!0,n=J4(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(pa(),i===a){t=$n(e,t,n);break e}tt(e,t,i,n)}t=t.child}return t;case 26:return no(e,t),e===null?(n=ww(t.type,null,t.pendingProps,null))?t.memoizedState=n:X||(n=t.type,e=t.pendingProps,i=bo(bi.current).createElement(n),i[Pe]=t,i[mt]=e,nt(i,n,e),Ie(i),t.stateNode=i):t.memoizedState=ww(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Df(t),e===null&&X&&(i=t.stateNode=hw(t.type,t.pendingProps,bi.current),$e=t,sn=!0,a=ce,Hi(t.type)?(H2=a,ce=un(i.firstChild)):ce=a),tt(e,t,t.pendingProps.children,n),no(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&X&&((a=i=ce)&&(i=Pv(i,t.type,t.pendingProps,sn),i!==null?(t.stateNode=i,$e=t,ce=un(i.firstChild),sn=!1,a=!0):a=!1),a||Ai(t)),Df(t),a=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,i=l.children,L2(a,l)?i=null:s!==null&&L2(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=kd(e,t,hv,null,null,n),wr._currentValue=a),no(e,t),tt(e,t,i,n),t.child;case 6:return e===null&&X&&((e=n=ce)&&(n=$v(n,t.pendingProps,sn),n!==null?(t.stateNode=n,$e=t,ce=null,e=!0):e=!1),e||Ai(t)),null;case 13:return ng(e,t,n);case 4:return mu(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=_a(t,null,i,n):tt(e,t,i,n),t.child;case 11:return Zm(e,t,t.type,t.pendingProps,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Ni(t,t.type,i.value),tt(e,t,i.children,n),t.child;case 9:return a=t.type._context,i=t.pendingProps.children,ba(t),a=et(a),i=i(a),t.flags|=1,tt(e,t,i,n),t.child;case 14:return Km(e,t,t.type,t.pendingProps,n);case 15:return Im(e,t,t.type,t.pendingProps,n);case 19:return ag(e,t,n);case 31:return xv(e,t,n);case 22:return Jm(e,t,n,t.pendingProps);case 24:return ba(t),i=et(ke),e===null?(a=_d(),a===null&&(a=le,l=Sd(),a.pooledCache=l,l.refCount++,l!==null&&(a.pooledCacheLanes|=n),a=l),t.memoizedState={parent:i,cache:a},Ad(t),Ni(t,ke,a)):(e.lanes&n&&(Nd(e,t),Js(t,null,null,n),Is()),a=e.memoizedState,l=t.memoizedState,a.parent!==i?(a={parent:i,cache:i},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ni(t,ke,i)):(i=l.cache,Ni(t,ke,i),i!==a.cache&&xd(t,[ke],n,!0))),tt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(S(156,t.tag))}function ei(e){e.flags|=4}function u2(e,t,n,i,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(Og())e.flags|=8192;else throw Ea=Vu,Td}else e.flags&=-16777217}function sg(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!xw(t))if(Og())e.flags|=8192;else throw Ea=Vu,Td}function ao(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?G3():536870912,e.lanes|=t,Hl|=t)}function nr(e,t){if(!X)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function fe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags&65011712,i|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function Ev(e,t,n){var i=t.pendingProps;switch(wd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fe(t),null;case 1:return fe(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Jn(ke),cl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Nl(t)?ei(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pd())),fe(t),null;case 26:var a=t.type,l=t.memoizedState;return e===null?(ei(t),l!==null?(fe(t),sg(t,l)):(fe(t),u2(t,a,null,i,n))):l?l!==e.memoizedState?(ei(t),fe(t),sg(t,l)):(fe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&ei(t),fe(t),u2(t,a,e,i,n)),null;case 27:if(gu(t),n=bi.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ei(t);else{if(!i){if(t.stateNode===null)throw Error(S(166));return fe(t),null}e=On.current,Nl(t)?G4(t):(e=hw(a,i,n),t.stateNode=e,ei(t))}return fe(t),null;case 5:if(gu(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ei(t);else{if(!i){if(t.stateNode===null)throw Error(S(166));return fe(t),null}if(l=On.current,Nl(t))G4(t);else{var s=bo(bi.current);switch(l){case 1:l=s.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:l=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":l=s.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":l=s.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":l=s.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild);break;case"select":l=typeof i.is=="string"?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?l.multiple=!0:i.size&&(l.size=i.size);break;default:l=typeof i.is=="string"?s.createElement(a,{is:i.is}):s.createElement(a)}}l[Pe]=t,l[mt]=i;e:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)l.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;s.sibling===null;){if(s.return===null||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=l;e:switch(nt(l,a,i),a){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ei(t)}}return fe(t),u2(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&ei(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(S(166));if(e=bi.current,Nl(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,a=$e,a!==null)switch(a.tag){case 27:case 5:i=a.memoizedProps}e[Pe]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||nw(e.nodeValue,n)),e||Ai(t,!0)}else e=bo(e).createTextNode(i),e[Pe]=t,t.stateNode=e}return fe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Nl(t),n!==null){if(e===null){if(!i)throw Error(S(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(557));e[Pe]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fe(t),e=!1}else n=pd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Vt(t),t):(Vt(t),null);if(t.flags&128)throw Error(S(558))}return fe(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Nl(t),i!==null&&i.dehydrated!==null){if(e===null){if(!a)throw Error(S(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(S(317));a[Pe]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fe(t),a=!1}else a=pd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Vt(t),t):(Vt(t),null)}return Vt(t),t.flags&128?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,a=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(a=i.alternate.memoizedState.cachePool.pool),l=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==a&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ao(t,t.updateQueue),fe(t),null);case 4:return cl(),e===null&&C2(t.stateNode.containerInfo),fe(t),null;case 10:return Jn(t.type),fe(t),null;case 19:if(Ke(je),i=t.memoizedState,i===null)return fe(t),null;if(a=(t.flags&128)!==0,l=i.rendering,l===null)if(a)nr(i,!1);else{if(Se!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Xu(e),l!==null){for(t.flags|=128,nr(i,!1),e=l.updateQueue,t.updateQueue=e,ao(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)k4(n,e),n=n.sibling;return ue(je,je.current&1|2),X&&Kn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Lt()>oo&&(t.flags|=128,a=!0,nr(i,!1),t.lanes=4194304)}else{if(!a)if(e=Xu(l),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ao(t,e),nr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!X)return fe(t),null}else 2*Lt()-i.renderingStartTime>oo&&n!==536870912&&(t.flags|=128,a=!0,nr(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(e=i.last,e!==null?e.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Lt(),e.sibling=null,n=je.current,ue(je,a?n&1|2:n&1),X&&Kn(t,i.treeForkCount),e):(fe(t),null);case 22:case 23:return Vt(t),Dd(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?n&536870912&&!(t.flags&128)&&(fe(t),t.subtreeFlags&6&&(t.flags|=8192)):fe(t),n=t.updateQueue,n!==null&&ao(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&Ke(xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Jn(ke),fe(t),null;case 25:return null;case 30:return null}throw Error(S(156,t.tag))}function _v(e,t){switch(wd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jn(ke),cl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return gu(t),null;case 31:if(t.memoizedState!==null){if(Vt(t),t.alternate===null)throw Error(S(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Vt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ke(je),null;case 4:return cl(),null;case 10:return Jn(t.type),null;case 22:case 23:return Vt(t),Dd(),e!==null&&Ke(xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Jn(ke),null;case 25:return null;default:return null}}function rg(e,t){switch(wd(t),t.tag){case 3:Jn(ke),cl();break;case 26:case 27:case 5:gu(t);break;case 4:cl();break;case 31:t.memoizedState!==null&&Vt(t);break;case 13:Vt(t);break;case 19:Ke(je);break;case 10:Jn(t.type);break;case 22:case 23:Vt(t),Dd(),e!==null&&Ke(xa);break;case 24:Jn(ke)}}function ir(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var a=i.next;n=a;do{if((n.tag&e)===e){i=void 0;var l=n.create,s=n.inst;i=l(),s.destroy=i}n=n.next}while(n!==a)}}catch(r){te(t,t.return,r)}}function zi(e,t,n){try{var i=t.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var l=a.next;i=l;do{if((i.tag&e)===e){var s=i.inst,r=s.destroy;if(r!==void 0){s.destroy=void 0,a=t;var o=n,c=r;try{c()}catch(f){te(a,o,f)}}}i=i.next}while(i!==l)}}catch(f){te(t,t.return,f)}}function ug(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{P4(t,n)}catch(i){te(e,e.return,i)}}}function og(e,t,n){n.props=Aa(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){te(e,t,i)}}function ar(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(a){te(e,t,a)}}function Ln(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(a){te(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){te(e,t,a)}else n.current=null}function cg(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(a){te(e,e.return,a)}}function o2(e,t,n){try{var i=e.stateNode;Qv(i,e.type,n,t),i[mt]=t}catch(a){te(e,e.return,a)}}function fg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Hi(e.type)||e.tag===4}function c2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Hi(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function f2(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xn));else if(i!==4&&(i===27&&Hi(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(f2(e,t,n),e=e.sibling;e!==null;)f2(e,t,n),e=e.sibling}function lo(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Hi(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(lo(e,t,n),e=e.sibling;e!==null;)lo(e,t,n),e=e.sibling}function dg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);nt(t,i,n),t[Pe]=e,t[mt]=n}catch(l){te(e,e.return,l)}}var ti=!1,Be=!1,d2=!1,hg=typeof WeakSet=="function"?WeakSet:Set,Je=null;function Tv(e,t){if(e=e.containerInfo,z2=No,e=T4(e),ld(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,l=i.focusNode;i=i.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var s=0,r=-1,o=-1,c=0,f=0,h=e,d=null;t:for(;;){for(var m;h!==n||a!==0&&h.nodeType!==3||(r=s+a),h!==l||i!==0&&h.nodeType!==3||(o=s+i),h.nodeType===3&&(s+=h.nodeValue.length),(m=h.firstChild)!==null;)d=h,h=m;for(;;){if(h===e)break t;if(d===n&&++c===a&&(r=s),d===l&&++f===i&&(o=s),(m=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=m}n=r===-1||o===-1?null:{start:r,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(k2={focusedElem:e,selectionRange:n},No=!1,Je=t;Je!==null;)if(t=Je,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Je=e;else for(;Je!==null;){switch(t=Je,l=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&l!==null){e=void 0,n=t,a=l.memoizedProps,l=l.memoizedState,i=n.stateNode;try{var v=Aa(n.type,a);e=i.getSnapshotBeforeUpdate(v,l),i.__reactInternalSnapshotBeforeUpdate=e}catch(x){te(n,n.return,x)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)B2(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":B2(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(S(163))}if(e=t.sibling,e!==null){e.return=t.return,Je=e;break}Je=t.return}}function mg(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:ii(e,n),i&4&&ir(5,n);break;case 1:if(ii(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(s){te(n,n.return,s)}else{var a=Aa(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(s){te(n,n.return,s)}}i&64&&ug(n),i&512&&ar(n,n.return);break;case 3:if(ii(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{P4(e,t)}catch(s){te(n,n.return,s)}}break;case 27:t===null&&i&4&&dg(n);case 26:case 5:ii(e,n),t===null&&i&4&&cg(n),i&512&&ar(n,n.return);break;case 12:ii(e,n);break;case 31:ii(e,n),i&4&&yg(e,n);break;case 13:ii(e,n),i&4&&pg(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=kv.bind(null,n),e8(e,n))));break;case 22:if(i=n.memoizedState!==null||ti,!i){t=t!==null&&t.memoizedState!==null||Be,a=ti;var l=Be;ti=i,(Be=t)&&!l?ai(e,n,(n.subtreeFlags&8772)!==0):ii(e,n),ti=a,Be=l}break;case 30:break;default:ii(e,n)}}function gg(e){var t=e.alternate;t!==null&&(e.alternate=null,gg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qf(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ge=null,wt=!1;function ni(e,t,n){for(n=n.child;n!==null;)wg(e,t,n),n=n.sibling}function wg(e,t,n){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(js,n)}catch{}switch(n.tag){case 26:Be||Ln(n,t),ni(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Be||Ln(n,t);var i=ge,a=wt;Hi(n.type)&&(ge=n.stateNode,wt=!1),ni(e,t,n),hr(n.stateNode),ge=i,wt=a;break;case 5:Be||Ln(n,t);case 6:if(i=ge,a=wt,ge=null,ni(e,t,n),ge=i,wt=a,ge!==null)if(wt)try{(ge.nodeType===9?ge.body:ge.nodeName==="HTML"?ge.ownerDocument.body:ge).removeChild(n.stateNode)}catch(l){te(n,t,l)}else try{ge.removeChild(n.stateNode)}catch(l){te(n,t,l)}break;case 18:ge!==null&&(wt?(e=ge,uw(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Kl(e)):uw(ge,n.stateNode));break;case 4:i=ge,a=wt,ge=n.stateNode.containerInfo,wt=!0,ni(e,t,n),ge=i,wt=a;break;case 0:case 11:case 14:case 15:zi(2,n,t),Be||zi(4,n,t),ni(e,t,n);break;case 1:Be||(Ln(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&og(n,t,i)),ni(e,t,n);break;case 21:ni(e,t,n);break;case 22:Be=(i=Be)||n.memoizedState!==null,ni(e,t,n),Be=i;break;default:ni(e,t,n)}}function yg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Kl(e)}catch(n){te(t,t.return,n)}}}function pg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Kl(e)}catch(n){te(t,t.return,n)}}function Av(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new hg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hg),t;default:throw Error(S(435,e.tag))}}function so(e,t){var n=Av(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var a=Lv.bind(null,e,i);i.then(a,a)}})}function yt(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i],l=e,s=t,r=s;e:for(;r!==null;){switch(r.tag){case 27:if(Hi(r.type)){ge=r.stateNode,wt=!1;break e}break;case 5:ge=r.stateNode,wt=!1;break e;case 3:case 4:ge=r.stateNode.containerInfo,wt=!0;break e}r=r.return}if(ge===null)throw Error(S(160));wg(l,s,a),ge=null,wt=!1,l=a.alternate,l!==null&&(l.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vg(t,e),t=t.sibling}var pn=null;function vg(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:yt(t,e),pt(e),i&4&&(zi(3,e,e.return),ir(3,e),zi(5,e,e.return));break;case 1:yt(t,e),pt(e),i&512&&(Be||n===null||Ln(n,n.return)),i&64&&ti&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var a=pn;if(yt(t,e),pt(e),i&512&&(Be||n===null||Ln(n,n.return)),i&4){var l=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(i){case"title":l=a.getElementsByTagName("title")[0],(!l||l[Ds]||l[Pe]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=a.createElement(i),a.head.insertBefore(l,a.querySelector("head > title"))),nt(l,i,n),l[Pe]=e,Ie(l),i=l;break e;case"link":var s=vw("link","href",a).get(i+(n.href||""));if(s){for(var r=0;r<s.length;r++)if(l=s[r],l.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(r,1);break t}}l=a.createElement(i),nt(l,i,n),a.head.appendChild(l);break;case"meta":if(s=vw("meta","content",a).get(i+(n.content||""))){for(r=0;r<s.length;r++)if(l=s[r],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){s.splice(r,1);break t}}l=a.createElement(i),nt(l,i,n),a.head.appendChild(l);break;default:throw Error(S(468,i))}l[Pe]=e,Ie(l),i=l}e.stateNode=i}else bw(a,e.type,e.stateNode);else e.stateNode=pw(a,i,e.memoizedProps);else l!==i?(l===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):l.count--,i===null?bw(a,e.type,e.stateNode):pw(a,i,e.memoizedProps)):i===null&&e.stateNode!==null&&o2(e,e.memoizedProps,n.memoizedProps)}break;case 27:yt(t,e),pt(e),i&512&&(Be||n===null||Ln(n,n.return)),n!==null&&i&4&&o2(e,e.memoizedProps,n.memoizedProps);break;case 5:if(yt(t,e),pt(e),i&512&&(Be||n===null||Ln(n,n.return)),e.flags&32){a=e.stateNode;try{yl(a,"")}catch(v){te(e,e.return,v)}}i&4&&e.stateNode!=null&&(a=e.memoizedProps,o2(e,a,n!==null?n.memoizedProps:a)),i&1024&&(d2=!0);break;case 6:if(yt(t,e),pt(e),i&4){if(e.stateNode===null)throw Error(S(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(v){te(e,e.return,v)}}break;case 3:if(Eo=null,a=pn,pn=xo(t.containerInfo),yt(t,e),pn=a,pt(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Kl(t.containerInfo)}catch(v){te(e,e.return,v)}d2&&(d2=!1,bg(e));break;case 4:i=pn,pn=xo(e.stateNode.containerInfo),yt(t,e),pt(e),pn=i;break;case 12:yt(t,e),pt(e);break;case 31:yt(t,e),pt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,so(e,i)));break;case 13:yt(t,e),pt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(uo=Lt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,so(e,i)));break;case 22:a=e.memoizedState!==null;var o=n!==null&&n.memoizedState!==null,c=ti,f=Be;if(ti=c||a,Be=f||o,yt(t,e),Be=f,ti=c,pt(e),i&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||o||ti||Be||Na(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){o=n=t;try{if(l=o.stateNode,a)s=l.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none";else{r=o.stateNode;var h=o.memoizedProps.style,d=h!=null&&h.hasOwnProperty("display")?h.display:null;r.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(v){te(o,o.return,v)}}}else if(t.tag===6){if(n===null){o=t;try{o.stateNode.nodeValue=a?"":o.memoizedProps}catch(v){te(o,o.return,v)}}}else if(t.tag===18){if(n===null){o=t;try{var m=o.stateNode;a?ow(m,!0):ow(o.stateNode,!1)}catch(v){te(o,o.return,v)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,so(e,n))));break;case 19:yt(t,e),pt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,so(e,i)));break;case 30:break;case 21:break;default:yt(t,e),pt(e)}}function pt(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(fg(i)){n=i;break}i=i.return}if(n==null)throw Error(S(160));switch(n.tag){case 27:var a=n.stateNode,l=c2(e);lo(e,l,a);break;case 5:var s=n.stateNode;n.flags&32&&(yl(s,""),n.flags&=-33);var r=c2(e);lo(e,r,s);break;case 3:case 4:var o=n.stateNode.containerInfo,c=c2(e);f2(e,c,o);break;default:throw Error(S(161))}}catch(f){te(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ii(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mg(e,t.alternate,t),t=t.sibling}function Na(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zi(4,t,t.return),Na(t);break;case 1:Ln(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&og(t,t.return,n),Na(t);break;case 27:hr(t.stateNode);case 26:case 5:Ln(t,t.return),Na(t);break;case 22:t.memoizedState===null&&Na(t);break;case 30:Na(t);break;default:Na(t)}e=e.sibling}}function ai(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,a=e,l=t,s=l.flags;switch(l.tag){case 0:case 11:case 15:ai(a,l,n),ir(4,l);break;case 1:if(ai(a,l,n),i=l,a=i.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(c){te(i,i.return,c)}if(i=l,a=i.updateQueue,a!==null){var r=i.stateNode;try{var o=a.shared.hiddenCallbacks;if(o!==null)for(a.shared.hiddenCallbacks=null,a=0;a<o.length;a++)W4(o[a],r)}catch(c){te(i,i.return,c)}}n&&s&64&&ug(l),ar(l,l.return);break;case 27:dg(l);case 26:case 5:ai(a,l,n),n&&i===null&&s&4&&cg(l),ar(l,l.return);break;case 12:ai(a,l,n);break;case 31:ai(a,l,n),n&&s&4&&yg(a,l);break;case 13:ai(a,l,n),n&&s&4&&pg(a,l);break;case 22:l.memoizedState===null&&ai(a,l,n),ar(l,l.return);break;case 30:break;default:ai(a,l,n)}t=t.sibling}}function h2(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ys(n))}function m2(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ys(e))}function vn(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xg(e,t,n,i),t=t.sibling}function xg(e,t,n,i){var a=t.flags;switch(t.tag){case 0:case 11:case 15:vn(e,t,n,i),a&2048&&ir(9,t);break;case 1:vn(e,t,n,i);break;case 3:vn(e,t,n,i),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ys(e)));break;case 12:if(a&2048){vn(e,t,n,i),e=t.stateNode;try{var l=t.memoizedProps,s=l.id,r=l.onPostCommit;typeof r=="function"&&r(s,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(o){te(t,t.return,o)}}else vn(e,t,n,i);break;case 31:vn(e,t,n,i);break;case 13:vn(e,t,n,i);break;case 23:break;case 22:l=t.stateNode,s=t.alternate,t.memoizedState!==null?l._visibility&2?vn(e,t,n,i):lr(e,t):l._visibility&2?vn(e,t,n,i):(l._visibility|=2,Bl(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),a&2048&&h2(s,t);break;case 24:vn(e,t,n,i),a&2048&&m2(t.alternate,t);break;default:vn(e,t,n,i)}}function Bl(e,t,n,i,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var l=e,s=t,r=n,o=i,c=s.flags;switch(s.tag){case 0:case 11:case 15:Bl(l,s,r,o,a),ir(8,s);break;case 23:break;case 22:var f=s.stateNode;s.memoizedState!==null?f._visibility&2?Bl(l,s,r,o,a):lr(l,s):(f._visibility|=2,Bl(l,s,r,o,a)),a&&c&2048&&h2(s.alternate,s);break;case 24:Bl(l,s,r,o,a),a&&c&2048&&m2(s.alternate,s);break;default:Bl(l,s,r,o,a)}t=t.sibling}}function lr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,a=i.flags;switch(i.tag){case 22:lr(n,i),a&2048&&h2(i.alternate,i);break;case 24:lr(n,i),a&2048&&m2(i.alternate,i);break;default:lr(n,i)}t=t.sibling}}var sr=8192;function Rl(e,t,n){if(e.subtreeFlags&sr)for(e=e.child;e!==null;)Sg(e,t,n),e=e.sibling}function Sg(e,t,n){switch(e.tag){case 26:Rl(e,t,n),e.flags&sr&&e.memoizedState!==null&&d8(n,pn,e.memoizedState,e.memoizedProps);break;case 5:Rl(e,t,n);break;case 3:case 4:var i=pn;pn=xo(e.stateNode.containerInfo),Rl(e,t,n),pn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=sr,sr=16777216,Rl(e,t,n),sr=i):Rl(e,t,n));break;default:Rl(e,t,n)}}function Eg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function rr(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Je=i,Tg(i,e)}Eg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_g(e),e=e.sibling}function _g(e){switch(e.tag){case 0:case 11:case 15:rr(e),e.flags&2048&&zi(9,e,e.return);break;case 3:rr(e);break;case 12:rr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ro(e)):rr(e);break;default:rr(e)}}function ro(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Je=i,Tg(i,e)}Eg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zi(8,t,t.return),ro(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ro(t));break;default:ro(t)}e=e.sibling}}function Tg(e,t){for(;Je!==null;){var n=Je;switch(n.tag){case 0:case 11:case 15:zi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Ys(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Je=i;else e:for(n=e;Je!==null;){i=Je;var a=i.sibling,l=i.return;if(gg(i),i===n){Je=null;break e}if(a!==null){a.return=l,Je=a;break e}Je=l}}}var Nv={getCacheForType:function(e){var t=et(ke),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return et(ke).controller.signal}},jv=typeof WeakMap=="function"?WeakMap:Map,P=0,le=null,q=null,Y=0,ee=0,qt=null,ki=!1,Gl=!1,g2=!1,li=0,Se=0,Li=0,ja=0,w2=0,Ft=0,Hl=0,ur=null,vt=null,y2=!1,uo=0,Ag=0,oo=1/0,co=null,Ui=null,Fe=0,Bi=null,Vl=null,si=0,p2=0,v2=null,Ng=null,or=0,b2=null;function Yt(){return P&2&&Y!==0?Y&-Y:B.T!==null?A2():F3()}function jg(){if(Ft===0)if(!(Y&536870912)||X){var e=pu;pu<<=1,!(pu&3932160)&&(pu=262144),Ft=e}else Ft=536870912;return e=Ht.current,e!==null&&(e.flags|=32),Ft}function bt(e,t,n){(e===le&&(ee===2||ee===9)||e.cancelPendingCommit!==null)&&(ql(e,0),Ri(e,Y,Ft,!1)),Cs(e,n),(!(P&2)||e!==le)&&(e===le&&(!(P&2)&&(ja|=n),Se===4&&Ri(e,Y,Ft,!1)),Un(e))}function Mg(e,t,n){if(P&6)throw Error(S(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ms(e,t),a=i?Dv(e,t):S2(e,t,!0),l=i;do{if(a===0){Gl&&!i&&Ri(e,t,0,!1);break}else{if(n=e.current.alternate,l&&!Mv(n)){a=S2(e,t,!1),l=!1;continue}if(a===2){if(l=t,e.errorRecoveryDisabledLanes&l)var s=0;else s=e.pendingLanes&-536870913,s=s!==0?s:s&536870912?536870912:0;if(s!==0){t=s;e:{var r=e;a=ur;var o=r.current.memoizedState.isDehydrated;if(o&&(ql(r,s).flags|=256),s=S2(r,s,!1),s!==2){if(g2&&!o){r.errorRecoveryDisabledLanes|=l,ja|=l,a=4;break e}l=vt,vt=a,l!==null&&(vt===null?vt=l:vt.push.apply(vt,l))}a=s}if(l=!1,a!==2)continue}}if(a===1){ql(e,0),Ri(e,t,0,!0);break}e:{switch(i=e,l=a,l){case 0:case 1:throw Error(S(345));case 4:if((t&4194048)!==t)break;case 6:Ri(i,t,Ft,!ki);break e;case 2:vt=null;break;case 3:case 5:break;default:throw Error(S(329))}if((t&62914560)===t&&(a=uo+300-Lt(),10<a)){if(Ri(i,t,Ft,!ki),bu(i,0,!0)!==0)break e;si=t,i.timeoutHandle=sw(Cg.bind(null,i,n,vt,co,y2,t,Ft,ja,Hl,ki,l,"Throttled",-0,0),a);break e}Cg(i,n,vt,co,y2,t,Ft,ja,Hl,ki,l,null,-0,0)}}break}while(!0);Un(e)}function Cg(e,t,n,i,a,l,s,r,o,c,f,h,d,m){if(e.timeoutHandle=-1,h=t.subtreeFlags,h&8192||(h&16785408)===16785408){h={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xn},Sg(t,l,h);var v=(l&62914560)===l?uo-Lt():(l&4194048)===l?Ag-Lt():0;if(v=h8(h,v),v!==null){si=l,e.cancelPendingCommit=v(Rg.bind(null,e,t,l,n,i,a,s,r,o,f,h,null,d,m)),Ri(e,l,s,!c);return}}Rg(e,t,l,n,i,a,s,r,o)}function Mv(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var a=n[i],l=a.getSnapshot;a=a.value;try{if(!Rt(l(),a))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ri(e,t,n,i){t&=~w2,t&=~ja,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var a=t;0<a;){var l=31-Bt(a),s=1<<l;i[l]=-1,a&=~s}n!==0&&H3(e,n,t)}function fo(){return P&6?!0:(cr(0),!1)}function x2(){if(q!==null){if(ee===0)var e=q.return;else e=q,In=va=null,Bd(e),Ol=null,Qs=0,e=q;for(;e!==null;)rg(e.alternate,e),e=e.return;q=null}}function ql(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Iv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),si=0,x2(),le=e,q=n=Zn(e.current,null),Y=t,ee=0,qt=null,ki=!1,Gl=Ms(e,t),g2=!1,Hl=Ft=w2=ja=Li=Se=0,vt=ur=null,y2=!1,t&8&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var a=31-Bt(i),l=1<<a;t|=e[a],i&=~l}return li=t,Ou(),n}function Dg(e,t){H=null,B.H=er,t===Dl||t===Hu?(t=Z4(),ee=3):t===Td?(t=Z4(),ee=4):ee=t===$d?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,qt=t,q===null&&(Se=1,eo(e,nn(t,e.current)))}function Og(){var e=Ht.current;return e===null?!0:(Y&4194048)===Y?rn===null:(Y&62914560)===Y||Y&536870912?e===rn:!1}function zg(){var e=B.H;return B.H=er,e===null?er:e}function kg(){var e=B.A;return B.A=Nv,e}function ho(){Se=4,ki||(Y&4194048)!==Y&&Ht.current!==null||(Gl=!0),!(Li&134217727)&&!(ja&134217727)||le===null||Ri(le,Y,Ft,!1)}function S2(e,t,n){var i=P;P|=2;var a=zg(),l=kg();(le!==e||Y!==t)&&(co=null,ql(e,t)),t=!1;var s=Se;e:do try{if(ee!==0&&q!==null){var r=q,o=qt;switch(ee){case 8:x2(),s=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var c=ee;if(ee=0,qt=null,Fl(e,r,o,c),n&&Gl){s=0;break e}break;default:c=ee,ee=0,qt=null,Fl(e,r,o,c)}}Cv(),s=Se;break}catch(f){Dg(e,f)}while(!0);return t&&e.shellSuspendCounter++,In=va=null,P=i,B.H=a,B.A=l,q===null&&(le=null,Y=0,Ou()),s}function Cv(){for(;q!==null;)Lg(q)}function Dv(e,t){var n=P;P|=2;var i=zg(),a=kg();le!==e||Y!==t?(co=null,oo=Lt()+500,ql(e,t)):Gl=Ms(e,t);e:do try{if(ee!==0&&q!==null){t=q;var l=qt;t:switch(ee){case 1:ee=0,qt=null,Fl(e,t,l,1);break;case 2:case 9:if(X4(l)){ee=0,qt=null,Ug(t);break}t=function(){ee!==2&&ee!==9||le!==e||(ee=7),Un(e)},l.then(t,t);break e;case 3:ee=7;break e;case 4:ee=5;break e;case 7:X4(l)?(ee=0,qt=null,Ug(t)):(ee=0,qt=null,Fl(e,t,l,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var r=q;if(s?xw(s):r.stateNode.complete){ee=0,qt=null;var o=r.sibling;if(o!==null)q=o;else{var c=r.return;c!==null?(q=c,mo(c)):q=null}break t}}ee=0,qt=null,Fl(e,t,l,5);break;case 6:ee=0,qt=null,Fl(e,t,l,6);break;case 8:x2(),Se=6;break e;default:throw Error(S(462))}}Ov();break}catch(f){Dg(e,f)}while(!0);return In=va=null,B.H=i,B.A=a,P=n,q!==null?0:(le=null,Y=0,Ou(),Se)}function Ov(){for(;q!==null&&!tp();)Lg(q)}function Lg(e){var t=lg(e.alternate,e,li);e.memoizedProps=e.pendingProps,t===null?mo(e):q=t}function Ug(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=$m(n,t,t.pendingProps,t.type,void 0,Y);break;case 11:t=$m(n,t,t.pendingProps,t.type.render,t.ref,Y);break;case 5:Bd(t);default:rg(n,t),t=q=k4(t,li),t=lg(n,t,li)}e.memoizedProps=e.pendingProps,t===null?mo(e):q=t}function Fl(e,t,n,i){In=va=null,Bd(t),Ol=null,Qs=0;var a=t.return;try{if(bv(e,a,t,n,Y)){Se=1,eo(e,nn(n,e.current)),q=null;return}}catch(l){if(a!==null)throw q=a,l;Se=1,eo(e,nn(n,e.current)),q=null;return}t.flags&32768?(X||i===1?e=!0:Gl||Y&536870912?e=!1:(ki=e=!0,(i===2||i===9||i===3||i===6)&&(i=Ht.current,i!==null&&i.tag===13&&(i.flags|=16384))),Bg(t,e)):mo(t)}function mo(e){var t=e;do{if(t.flags&32768){Bg(t,ki);return}e=t.return;var n=Ev(t.alternate,t,li);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);Se===0&&(Se=5)}function Bg(e,t){do{var n=_v(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);Se=6,q=null}function Rg(e,t,n,i,a,l,s,r,o){e.cancelPendingCommit=null;do go();while(Fe!==0);if(P&6)throw Error(S(327));if(t!==null){if(t===e.current)throw Error(S(177));if(l=t.lanes|t.childLanes,l|=cd,fp(e,n,l,s,r,o),e===le&&(q=le=null,Y=0),Vl=t,Bi=e,si=n,p2=l,v2=a,Ng=i,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Uv(wu,function(){return Fg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,t.subtreeFlags&13878||i){i=B.T,B.T=null,a=W.p,W.p=2,s=P,P|=4;try{Tv(e,t,n)}finally{P=s,W.p=a,B.T=i}}Fe=1,Gg(),Hg(),Vg()}}function Gg(){if(Fe===1){Fe=0;var e=Bi,t=Vl,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=B.T,B.T=null;var i=W.p;W.p=2;var a=P;P|=4;try{vg(t,e);var l=k2,s=T4(e.containerInfo),r=l.focusedElem,o=l.selectionRange;if(s!==r&&r&&r.ownerDocument&&_4(r.ownerDocument.documentElement,r)){if(o!==null&&ld(r)){var c=o.start,f=o.end;if(f===void 0&&(f=c),"selectionStart"in r)r.selectionStart=c,r.selectionEnd=Math.min(f,r.value.length);else{var h=r.ownerDocument||document,d=h&&h.defaultView||window;if(d.getSelection){var m=d.getSelection(),v=r.textContent.length,x=Math.min(o.start,v),E=o.end===void 0?x:Math.min(o.end,v);!m.extend&&x>E&&(s=E,E=x,x=s);var g=E4(r,x),w=E4(r,E);if(g&&w&&(m.rangeCount!==1||m.anchorNode!==g.node||m.anchorOffset!==g.offset||m.focusNode!==w.node||m.focusOffset!==w.offset)){var p=h.createRange();p.setStart(g.node,g.offset),m.removeAllRanges(),x>E?(m.addRange(p),m.extend(w.node,w.offset)):(p.setEnd(w.node,w.offset),m.addRange(p))}}}}for(h=[],m=r;m=m.parentNode;)m.nodeType===1&&h.push({element:m,left:m.scrollLeft,top:m.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<h.length;r++){var b=h[r];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}No=!!z2,k2=z2=null}finally{P=a,W.p=i,B.T=n}}e.current=t,Fe=2}}function Hg(){if(Fe===2){Fe=0;var e=Bi,t=Vl,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=B.T,B.T=null;var i=W.p;W.p=2;var a=P;P|=4;try{mg(e,t.alternate,t)}finally{P=a,W.p=i,B.T=n}}Fe=3}}function Vg(){if(Fe===4||Fe===3){Fe=0,np();var e=Bi,t=Vl,n=si,i=Ng;t.subtreeFlags&10256||t.flags&10256?Fe=5:(Fe=0,Vl=Bi=null,qg(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Ui=null),Hf(n),t=t.stateNode,Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(js,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=B.T,a=W.p,W.p=2,B.T=null;try{for(var l=e.onRecoverableError,s=0;s<i.length;s++){var r=i[s];l(r.value,{componentStack:r.stack})}}finally{B.T=t,W.p=a}}si&3&&go(),Un(e),a=e.pendingLanes,n&261930&&a&42?e===b2?or++:(or=0,b2=e):or=0,cr(0)}}function qg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ys(t)))}function go(){return Gg(),Hg(),Vg(),Fg()}function Fg(){if(Fe!==5)return!1;var e=Bi,t=p2;p2=0;var n=Hf(si),i=B.T,a=W.p;try{W.p=32>n?32:n,B.T=null,n=v2,v2=null;var l=Bi,s=si;if(Fe=0,Vl=Bi=null,si=0,P&6)throw Error(S(331));var r=P;if(P|=4,_g(l.current),xg(l,l.current,s,n),P=r,cr(0,!1),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(js,l)}catch{}return!0}finally{W.p=a,B.T=i,qg(e,t)}}function Yg(e,t,n){t=nn(n,t),t=Pd(e.stateNode,t,2),e=Ci(e,t,2),e!==null&&(Cs(e,2),Un(e))}function te(e,t,n){if(e.tag===3)Yg(e,e,n);else for(;t!==null;){if(t.tag===3){Yg(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Ui===null||!Ui.has(i))){e=nn(n,e),n=Xm(2),i=Ci(t,n,2),i!==null&&(Qm(n,i,t,e),Cs(i,2),Un(i));break}}t=t.return}}function E2(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new jv;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(n)||(g2=!0,a.add(n),e=zv.bind(null,e,t,n),t.then(e,e))}function zv(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,le===e&&(Y&n)===n&&(Se===4||Se===3&&(Y&62914560)===Y&&300>Lt()-uo?!(P&2)&&ql(e,0):w2|=n,Hl===Y&&(Hl=0)),Un(e)}function Xg(e,t){t===0&&(t=G3()),e=wa(e,t),e!==null&&(Cs(e,t),Un(e))}function kv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xg(e,n)}function Lv(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(S(314))}i!==null&&i.delete(t),Xg(e,n)}function Uv(e,t){return Uf(e,t)}var wo=null,Yl=null,_2=!1,yo=!1,T2=!1,Gi=0;function Un(e){e!==Yl&&e.next===null&&(Yl===null?wo=Yl=e:Yl=Yl.next=e),yo=!0,_2||(_2=!0,Rv())}function cr(e,t){if(!T2&&yo){T2=!0;do for(var n=!1,i=wo;i!==null;){if(e!==0){var a=i.pendingLanes;if(a===0)var l=0;else{var s=i.suspendedLanes,r=i.pingedLanes;l=(1<<31-Bt(42|e)+1)-1,l&=a&~(s&~r),l=l&201326741?l&201326741|1:l?l|2:0}l!==0&&(n=!0,Ig(i,l))}else l=Y,l=bu(i,i===le?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),!(l&3)||Ms(i,l)||(n=!0,Ig(i,l));i=i.next}while(n);T2=!1}}function Bv(){Qg()}function Qg(){yo=_2=!1;var e=0;Gi!==0&&Kv()&&(e=Gi);for(var t=Lt(),n=null,i=wo;i!==null;){var a=i.next,l=Zg(i,t);l===0?(i.next=null,n===null?wo=a:n.next=a,a===null&&(Yl=n)):(n=i,(e!==0||l&3)&&(yo=!0)),i=a}Fe!==0&&Fe!==5||cr(e),Gi!==0&&(Gi=0)}function Zg(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,l=e.pendingLanes&-62914561;0<l;){var s=31-Bt(l),r=1<<s,o=a[s];o===-1?(!(r&n)||r&i)&&(a[s]=cp(r,t)):o<=t&&(e.expiredLanes|=r),l&=~r}if(t=le,n=Y,n=bu(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(ee===2||ee===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Bf(i),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ms(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&Bf(i),Hf(n)){case 2:case 8:n=B3;break;case 32:n=wu;break;case 268435456:n=R3;break;default:n=wu}return i=Kg.bind(null,e),n=Uf(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&Bf(i),e.callbackPriority=2,e.callbackNode=null,2}function Kg(e,t){if(Fe!==0&&Fe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(go()&&e.callbackNode!==n)return null;var i=Y;return i=bu(e,e===le?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Mg(e,i,t),Zg(e,Lt()),e.callbackNode!=null&&e.callbackNode===n?Kg.bind(null,e):null)}function Ig(e,t){if(go())return null;Mg(e,t,!0)}function Rv(){Jv(function(){P&6?Uf(U3,Bv):Qg()})}function A2(){if(Gi===0){var e=Ml;e===0&&(e=yu,yu<<=1,!(yu&261888)&&(yu=256)),Gi=e}return Gi}function Jg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_u(""+e)}function Wg(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Gv(e,t,n,i,a){if(t==="submit"&&n&&n.stateNode===a){var l=Jg((a[mt]||null).action),s=i.submitter;s&&(t=(t=s[mt]||null)?Jg(t.formAction):s.getAttribute("formAction"),t!==null&&(l=t,s=null));var r=new ju("action","action",null,i,a);e.push({event:r,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Gi!==0){var o=s?Wg(a,s):new FormData(a);Qd(n,{pending:!0,data:o,method:a.method,action:l},null,o)}}else typeof l=="function"&&(r.preventDefault(),o=s?Wg(a,s):new FormData(a),Qd(n,{pending:!0,data:o,method:a.method,action:l},l,o))},currentTarget:a}]})}}for(var N2=0;N2<od.length;N2++){var j2=od[N2],Hv=j2.toLowerCase(),Vv=j2[0].toUpperCase()+j2.slice(1);yn(Hv,"on"+Vv)}yn(j4,"onAnimationEnd"),yn(M4,"onAnimationIteration"),yn(C4,"onAnimationStart"),yn("dblclick","onDoubleClick"),yn("focusin","onFocus"),yn("focusout","onBlur"),yn(iv,"onTransitionRun"),yn(av,"onTransitionStart"),yn(lv,"onTransitionCancel"),yn(D4,"onTransitionEnd"),gl("onMouseEnter",["mouseout","mouseover"]),gl("onMouseLeave",["mouseout","mouseover"]),gl("onPointerEnter",["pointerout","pointerover"]),gl("onPointerLeave",["pointerout","pointerover"]),da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),da("onBeforeInput",["compositionend","keypress","textInput","paste"]),da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),qv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fr));function Pg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],a=i.event;i=i.listeners;e:{var l=void 0;if(t)for(var s=i.length-1;0<=s;s--){var r=i[s],o=r.instance,c=r.currentTarget;if(r=r.listener,o!==l&&a.isPropagationStopped())break e;l=r,a.currentTarget=c;try{l(a)}catch(f){Du(f)}a.currentTarget=null,l=o}else for(s=0;s<i.length;s++){if(r=i[s],o=r.instance,c=r.currentTarget,r=r.listener,o!==l&&a.isPropagationStopped())break e;l=r,a.currentTarget=c;try{l(a)}catch(f){Du(f)}a.currentTarget=null,l=o}}}}function F(e,t){var n=t[Vf];n===void 0&&(n=t[Vf]=new Set);var i=e+"__bubble";n.has(i)||($g(t,e,2,!1),n.add(i))}function M2(e,t,n){var i=0;t&&(i|=4),$g(n,e,i,t)}var po="_reactListening"+Math.random().toString(36).slice(2);function C2(e){if(!e[po]){e[po]=!0,Q3.forEach(function(n){n!=="selectionchange"&&(qv.has(n)||M2(n,!1,e),M2(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[po]||(t[po]=!0,M2("selectionchange",!1,t))}}function $g(e,t,n,i){switch(jw(t)){case 2:var a=w8;break;case 8:a=y8;break;default:a=X2}n=a.bind(null,t,n,e),a=void 0,!Jf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),i?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function D2(e,t,n,i,a){var l=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var s=i.tag;if(s===3||s===4){var r=i.stateNode.containerInfo;if(r===a)break;if(s===4)for(s=i.return;s!==null;){var o=s.tag;if((o===3||o===4)&&s.stateNode.containerInfo===a)return;s=s.return}for(;r!==null;){if(s=dl(r),s===null)return;if(o=s.tag,o===5||o===6||o===26||o===27){i=l=s;continue e}r=r.parentNode}}i=i.return}a4(function(){var c=l,f=Kf(n),h=[];e:{var d=O4.get(e);if(d!==void 0){var m=ju,v=e;switch(e){case"keypress":if(Au(n)===0)break e;case"keydown":case"keyup":m=Lp;break;case"focusin":v="focus",m=ed;break;case"focusout":v="blur",m=ed;break;case"beforeblur":case"afterblur":m=ed;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=r4;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Ep;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=Rp;break;case j4:case M4:case C4:m=Ap;break;case D4:m=Hp;break;case"scroll":case"scrollend":m=xp;break;case"wheel":m=qp;break;case"copy":case"cut":case"paste":m=jp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=o4;break;case"toggle":case"beforetoggle":m=Yp}var x=(t&4)!==0,E=!x&&(e==="scroll"||e==="scrollend"),g=x?d!==null?d+"Capture":null:d;x=[];for(var w=c,p;w!==null;){var b=w;if(p=b.stateNode,b=b.tag,b!==5&&b!==26&&b!==27||p===null||g===null||(b=zs(w,g),b!=null&&x.push(dr(w,b,p))),E)break;w=w.return}0<x.length&&(d=new m(d,v,null,n,f),h.push({event:d,listeners:x}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",d&&n!==Zf&&(v=n.relatedTarget||n.fromElement)&&(dl(v)||v[fl]))break e;if((m||d)&&(d=f.window===f?f:(d=f.ownerDocument)?d.defaultView||d.parentWindow:window,m?(v=n.relatedTarget||n.toElement,m=c,v=v?dl(v):null,v!==null&&(E=Es(v),x=v.tag,v!==E||x!==5&&x!==27&&x!==6)&&(v=null)):(m=null,v=c),m!==v)){if(x=r4,b="onMouseLeave",g="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(x=o4,b="onPointerLeave",g="onPointerEnter",w="pointer"),E=m==null?d:Os(m),p=v==null?d:Os(v),d=new x(b,w+"leave",m,n,f),d.target=E,d.relatedTarget=p,b=null,dl(f)===c&&(x=new x(g,w+"enter",v,n,f),x.target=p,x.relatedTarget=E,b=x),E=b,m&&v)t:{for(x=Fv,g=m,w=v,p=0,b=g;b;b=x(b))p++;b=0;for(var A=w;A;A=x(A))b++;for(;0<p-b;)g=x(g),p--;for(;0<b-p;)w=x(w),b--;for(;p--;){if(g===w||w!==null&&g===w.alternate){x=g;break t}g=x(g),w=x(w)}x=null}else x=null;m!==null&&ew(h,d,m,x,!1),v!==null&&E!==null&&ew(h,E,v,x,!0)}}e:{if(d=c?Os(c):window,m=d.nodeName&&d.nodeName.toLowerCase(),m==="select"||m==="input"&&d.type==="file")var N=y4;else if(g4(d))if(p4)N=ev;else{N=Pp;var _=Wp}else m=d.nodeName,!m||m.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&Qf(c.elementType)&&(N=y4):N=$p;if(N&&(N=N(e,c))){w4(h,N,n,f);break e}_&&_(e,d,c),e==="focusout"&&c&&d.type==="number"&&c.memoizedProps.value!=null&&Xf(d,"number",d.value)}switch(_=c?Os(c):window,e){case"focusin":(g4(_)||_.contentEditable==="true")&&(xl=_,sd=c,Vs=null);break;case"focusout":Vs=sd=xl=null;break;case"mousedown":rd=!0;break;case"contextmenu":case"mouseup":case"dragend":rd=!1,A4(h,n,f);break;case"selectionchange":if(nv)break;case"keydown":case"keyup":A4(h,n,f)}var M;if(nd)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else bl?h4(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(c4&&n.locale!=="ko"&&(bl||T!=="onCompositionStart"?T==="onCompositionEnd"&&bl&&(M=l4()):(Ei=f,Wf="value"in Ei?Ei.value:Ei.textContent,bl=!0)),_=vo(c,T),0<_.length&&(T=new u4(T,e,null,n,f),h.push({event:T,listeners:_}),M?T.data=M:(M=m4(n),M!==null&&(T.data=M)))),(M=Qp?Zp(e,n):Kp(e,n))&&(T=vo(c,"onBeforeInput"),0<T.length&&(_=new u4("onBeforeInput","beforeinput",null,n,f),h.push({event:_,listeners:T}),_.data=M)),Gv(h,e,c,n,f)}Pg(h,t)})}function dr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vo(e,t){for(var n=t+"Capture",i=[];e!==null;){var a=e,l=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||l===null||(a=zs(e,n),a!=null&&i.unshift(dr(e,a,l)),a=zs(e,t),a!=null&&i.push(dr(e,a,l))),e.tag===3)return i;e=e.return}return[]}function Fv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ew(e,t,n,i,a){for(var l=t._reactName,s=[];n!==null&&n!==i;){var r=n,o=r.alternate,c=r.stateNode;if(r=r.tag,o!==null&&o===i)break;r!==5&&r!==26&&r!==27||c===null||(o=c,a?(c=zs(n,l),c!=null&&s.unshift(dr(n,c,o))):a||(c=zs(n,l),c!=null&&s.push(dr(n,c,o)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Yv=/\r\n?/g,Xv=/\u0000|\uFFFD/g;function tw(e){return(typeof e=="string"?e:""+e).replace(Yv,`
106
+ `).replace(Xv,"")}function nw(e,t){return t=tw(t),tw(e)===t}function ae(e,t,n,i,a,l){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||yl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&yl(e,""+i);break;case"className":Su(e,"class",i);break;case"tabIndex":Su(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Su(e,n,i);break;case"style":n4(e,i,l);break;case"data":if(t!=="object"){Su(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=_u(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof l=="function"&&(n==="formAction"?(t!=="input"&&ae(e,t,"name",a.name,a,null),ae(e,t,"formEncType",a.formEncType,a,null),ae(e,t,"formMethod",a.formMethod,a,null),ae(e,t,"formTarget",a.formTarget,a,null)):(ae(e,t,"encType",a.encType,a,null),ae(e,t,"method",a.method,a,null),ae(e,t,"target",a.target,a,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=_u(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=Xn);break;case"onScroll":i!=null&&F("scroll",e);break;case"onScrollEnd":i!=null&&F("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(S(61));if(n=i.__html,n!=null){if(a.children!=null)throw Error(S(60));e.innerHTML=n}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=_u(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""+i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":F("beforetoggle",e),F("toggle",e),xu(e,"popover",i);break;case"xlinkActuate":Yn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Yn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Yn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Yn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Yn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Yn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Yn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":xu(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=vp.get(n)||n,xu(e,n,i))}}function O2(e,t,n,i,a,l){switch(n){case"style":n4(e,i,l);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(S(61));if(n=i.__html,n!=null){if(a.children!=null)throw Error(S(60));e.innerHTML=n}}break;case"children":typeof i=="string"?yl(e,i):(typeof i=="number"||typeof i=="bigint")&&yl(e,""+i);break;case"onScroll":i!=null&&F("scroll",e);break;case"onScrollEnd":i!=null&&F("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Z3.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),l=e[mt]||null,l=l!=null?l[n]:null,typeof l=="function"&&e.removeEventListener(t,l,a),typeof i=="function")){typeof l!="function"&&l!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,a);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):xu(e,n,i)}}}function nt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":F("error",e),F("load",e);var i=!1,a=!1,l;for(l in n)if(n.hasOwnProperty(l)){var s=n[l];if(s!=null)switch(l){case"src":i=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(S(137,t));default:ae(e,t,l,s,n,null)}}a&&ae(e,t,"srcSet",n.srcSet,n,null),i&&ae(e,t,"src",n.src,n,null);return;case"input":F("invalid",e);var r=l=s=a=null,o=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var f=n[i];if(f!=null)switch(i){case"name":a=f;break;case"type":s=f;break;case"checked":o=f;break;case"defaultChecked":c=f;break;case"value":l=f;break;case"defaultValue":r=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(S(137,t));break;default:ae(e,t,i,f,n,null)}}P3(e,l,r,o,c,s,a,!1);return;case"select":F("invalid",e),i=s=l=null;for(a in n)if(n.hasOwnProperty(a)&&(r=n[a],r!=null))switch(a){case"value":l=r;break;case"defaultValue":s=r;break;case"multiple":i=r;default:ae(e,t,a,r,n,null)}t=l,n=s,e.multiple=!!i,t!=null?wl(e,!!i,t,!1):n!=null&&wl(e,!!i,n,!0);return;case"textarea":F("invalid",e),l=a=i=null;for(s in n)if(n.hasOwnProperty(s)&&(r=n[s],r!=null))switch(s){case"value":i=r;break;case"defaultValue":a=r;break;case"children":l=r;break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(S(91));break;default:ae(e,t,s,r,n,null)}e4(e,i,a,l);return;case"option":for(o in n)if(n.hasOwnProperty(o)&&(i=n[o],i!=null))switch(o){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:ae(e,t,o,i,n,null)}return;case"dialog":F("beforetoggle",e),F("toggle",e),F("cancel",e),F("close",e);break;case"iframe":case"object":F("load",e);break;case"video":case"audio":for(i=0;i<fr.length;i++)F(fr[i],e);break;case"image":F("error",e),F("load",e);break;case"details":F("toggle",e);break;case"embed":case"source":case"link":F("error",e),F("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(S(137,t));default:ae(e,t,c,i,n,null)}return;default:if(Qf(t)){for(f in n)n.hasOwnProperty(f)&&(i=n[f],i!==void 0&&O2(e,t,f,i,n,void 0));return}}for(r in n)n.hasOwnProperty(r)&&(i=n[r],i!=null&&ae(e,t,r,i,n,null))}function Qv(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,l=null,s=null,r=null,o=null,c=null,f=null;for(m in n){var h=n[m];if(n.hasOwnProperty(m)&&h!=null)switch(m){case"checked":break;case"value":break;case"defaultValue":o=h;default:i.hasOwnProperty(m)||ae(e,t,m,null,i,h)}}for(var d in i){var m=i[d];if(h=n[d],i.hasOwnProperty(d)&&(m!=null||h!=null))switch(d){case"type":l=m;break;case"name":a=m;break;case"checked":c=m;break;case"defaultChecked":f=m;break;case"value":s=m;break;case"defaultValue":r=m;break;case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(S(137,t));break;default:m!==h&&ae(e,t,d,m,i,h)}}Yf(e,s,r,o,c,f,l,a);return;case"select":m=s=r=d=null;for(l in n)if(o=n[l],n.hasOwnProperty(l)&&o!=null)switch(l){case"value":break;case"multiple":m=o;default:i.hasOwnProperty(l)||ae(e,t,l,null,i,o)}for(a in i)if(l=i[a],o=n[a],i.hasOwnProperty(a)&&(l!=null||o!=null))switch(a){case"value":d=l;break;case"defaultValue":r=l;break;case"multiple":s=l;default:l!==o&&ae(e,t,a,l,i,o)}t=r,n=s,i=m,d!=null?wl(e,!!n,d,!1):!!i!=!!n&&(t!=null?wl(e,!!n,t,!0):wl(e,!!n,n?[]:"",!1));return;case"textarea":m=d=null;for(r in n)if(a=n[r],n.hasOwnProperty(r)&&a!=null&&!i.hasOwnProperty(r))switch(r){case"value":break;case"children":break;default:ae(e,t,r,null,i,a)}for(s in i)if(a=i[s],l=n[s],i.hasOwnProperty(s)&&(a!=null||l!=null))switch(s){case"value":d=a;break;case"defaultValue":m=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(S(91));break;default:a!==l&&ae(e,t,s,a,i,l)}$3(e,d,m);return;case"option":for(var v in n)if(d=n[v],n.hasOwnProperty(v)&&d!=null&&!i.hasOwnProperty(v))switch(v){case"selected":e.selected=!1;break;default:ae(e,t,v,null,i,d)}for(o in i)if(d=i[o],m=n[o],i.hasOwnProperty(o)&&d!==m&&(d!=null||m!=null))switch(o){case"selected":e.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:ae(e,t,o,d,i,m)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var x in n)d=n[x],n.hasOwnProperty(x)&&d!=null&&!i.hasOwnProperty(x)&&ae(e,t,x,null,i,d);for(c in i)if(d=i[c],m=n[c],i.hasOwnProperty(c)&&d!==m&&(d!=null||m!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(S(137,t));break;default:ae(e,t,c,d,i,m)}return;default:if(Qf(t)){for(var E in n)d=n[E],n.hasOwnProperty(E)&&d!==void 0&&!i.hasOwnProperty(E)&&O2(e,t,E,void 0,i,d);for(f in i)d=i[f],m=n[f],!i.hasOwnProperty(f)||d===m||d===void 0&&m===void 0||O2(e,t,f,d,i,m);return}}for(var g in n)d=n[g],n.hasOwnProperty(g)&&d!=null&&!i.hasOwnProperty(g)&&ae(e,t,g,null,i,d);for(h in i)d=i[h],m=n[h],!i.hasOwnProperty(h)||d===m||d==null&&m==null||ae(e,t,h,d,i,m)}function iw(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Zv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var a=n[i],l=a.transferSize,s=a.initiatorType,r=a.duration;if(l&&r&&iw(s)){for(s=0,r=a.responseEnd,i+=1;i<n.length;i++){var o=n[i],c=o.startTime;if(c>r)break;var f=o.transferSize,h=o.initiatorType;f&&iw(h)&&(o=o.responseEnd,s+=f*(o<r?1:(r-c)/(o-c)))}if(--i,t+=8*(l+s)/(a.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var z2=null,k2=null;function bo(e){return e.nodeType===9?e:e.ownerDocument}function aw(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function lw(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function L2(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var U2=null;function Kv(){var e=window.event;return e&&e.type==="popstate"?e===U2?!1:(U2=e,!0):(U2=null,!1)}var sw=typeof setTimeout=="function"?setTimeout:void 0,Iv=typeof clearTimeout=="function"?clearTimeout:void 0,rw=typeof Promise=="function"?Promise:void 0,Jv=typeof queueMicrotask=="function"?queueMicrotask:typeof rw<"u"?function(e){return rw.resolve(null).then(e).catch(Wv)}:sw;function Wv(e){setTimeout(function(){throw e})}function Hi(e){return e==="head"}function uw(e,t){var n=t,i=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(a),Kl(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")hr(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,hr(n);for(var l=n.firstChild;l;){var s=l.nextSibling,r=l.nodeName;l[Ds]||r==="SCRIPT"||r==="STYLE"||r==="LINK"&&l.rel.toLowerCase()==="stylesheet"||n.removeChild(l),l=s}}else n==="body"&&hr(e.ownerDocument.body);n=a}while(n);Kl(t)}function ow(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function B2(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":B2(n),qf(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Pv(e,t,n,i){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Ds])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(l=e.getAttribute("rel"),l==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(l!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(l=e.getAttribute("src"),(l!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&l&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var l=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===l)return e}else return e;if(e=un(e.nextSibling),e===null)break}return null}function $v(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=un(e.nextSibling),e===null))return null;return e}function cw(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=un(e.nextSibling),e===null))return null;return e}function R2(e){return e.data==="$?"||e.data==="$~"}function G2(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function e8(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function un(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var H2=null;function fw(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return un(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function dw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function hw(e,t,n){switch(t=bo(n),e){case"html":if(e=t.documentElement,!e)throw Error(S(452));return e;case"head":if(e=t.head,!e)throw Error(S(453));return e;case"body":if(e=t.body,!e)throw Error(S(454));return e;default:throw Error(S(451))}}function hr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qf(e)}var on=new Map,mw=new Set;function xo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ri=W.d;W.d={f:t8,r:n8,D:i8,C:a8,L:l8,m:s8,X:u8,S:r8,M:o8};function t8(){var e=ri.f(),t=fo();return e||t}function n8(e){var t=hl(e);t!==null&&t.tag===5&&t.type==="form"?Dm(t):ri.r(e)}var Xl=typeof document>"u"?null:document;function gw(e,t,n){var i=Xl;if(i&&typeof t=="string"&&t){var a=en(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),mw.has(a)||(mw.add(a),e={rel:e,crossOrigin:n,href:t},i.querySelector(a)===null&&(t=i.createElement("link"),nt(t,"link",e),Ie(t),i.head.appendChild(t)))}}function i8(e){ri.D(e),gw("dns-prefetch",e,null)}function a8(e,t){ri.C(e,t),gw("preconnect",e,t)}function l8(e,t,n){ri.L(e,t,n);var i=Xl;if(i&&e&&t){var a='link[rel="preload"][as="'+en(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+en(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+en(n.imageSizes)+'"]')):a+='[href="'+en(e)+'"]';var l=a;switch(t){case"style":l=Ql(e);break;case"script":l=Zl(e)}on.has(l)||(e=oe({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),on.set(l,e),i.querySelector(a)!==null||t==="style"&&i.querySelector(mr(l))||t==="script"&&i.querySelector(gr(l))||(t=i.createElement("link"),nt(t,"link",e),Ie(t),i.head.appendChild(t)))}}function s8(e,t){ri.m(e,t);var n=Xl;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+en(i)+'"][href="'+en(e)+'"]',l=a;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":l=Zl(e)}if(!on.has(l)&&(e=oe({rel:"modulepreload",href:e},t),on.set(l,e),n.querySelector(a)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(gr(l)))return}i=n.createElement("link"),nt(i,"link",e),Ie(i),n.head.appendChild(i)}}}function r8(e,t,n){ri.S(e,t,n);var i=Xl;if(i&&e){var a=ml(i).hoistableStyles,l=Ql(e);t=t||"default";var s=a.get(l);if(!s){var r={loading:0,preload:null};if(s=i.querySelector(mr(l)))r.loading=5;else{e=oe({rel:"stylesheet",href:e,"data-precedence":t},n),(n=on.get(l))&&V2(e,n);var o=s=i.createElement("link");Ie(o),nt(o,"link",e),o._p=new Promise(function(c,f){o.onload=c,o.onerror=f}),o.addEventListener("load",function(){r.loading|=1}),o.addEventListener("error",function(){r.loading|=2}),r.loading|=4,So(s,t,i)}s={type:"stylesheet",instance:s,count:1,state:r},a.set(l,s)}}}function u8(e,t){ri.X(e,t);var n=Xl;if(n&&e){var i=ml(n).hoistableScripts,a=Zl(e),l=i.get(a);l||(l=n.querySelector(gr(a)),l||(e=oe({src:e,async:!0},t),(t=on.get(a))&&q2(e,t),l=n.createElement("script"),Ie(l),nt(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},i.set(a,l))}}function o8(e,t){ri.M(e,t);var n=Xl;if(n&&e){var i=ml(n).hoistableScripts,a=Zl(e),l=i.get(a);l||(l=n.querySelector(gr(a)),l||(e=oe({src:e,async:!0,type:"module"},t),(t=on.get(a))&&q2(e,t),l=n.createElement("script"),Ie(l),nt(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},i.set(a,l))}}function ww(e,t,n,i){var a=(a=bi.current)?xo(a):null;if(!a)throw Error(S(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Ql(n.href),n=ml(a).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Ql(n.href);var l=ml(a).hoistableStyles,s=l.get(e);if(s||(a=a.ownerDocument||a,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},l.set(e,s),(l=a.querySelector(mr(e)))&&!l._p&&(s.instance=l,s.state.loading=5),on.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},on.set(e,n),l||c8(a,e,n,s.state))),t&&i===null)throw Error(S(528,""));return s}if(t&&i!==null)throw Error(S(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Zl(n),n=ml(a).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(S(444,e))}}function Ql(e){return'href="'+en(e)+'"'}function mr(e){return'link[rel="stylesheet"]['+e+"]"}function yw(e){return oe({},e,{"data-precedence":e.precedence,precedence:null})}function c8(e,t,n,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),nt(t,"link",n),Ie(t),e.head.appendChild(t))}function Zl(e){return'[src="'+en(e)+'"]'}function gr(e){return"script[async]"+e}function pw(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+en(n.href)+'"]');if(i)return t.instance=i,Ie(i),i;var a=oe({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ie(i),nt(i,"style",a),So(i,n.precedence,e),t.instance=i;case"stylesheet":a=Ql(n.href);var l=e.querySelector(mr(a));if(l)return t.state.loading|=4,t.instance=l,Ie(l),l;i=yw(n),(a=on.get(a))&&V2(i,a),l=(e.ownerDocument||e).createElement("link"),Ie(l);var s=l;return s._p=new Promise(function(r,o){s.onload=r,s.onerror=o}),nt(l,"link",i),t.state.loading|=4,So(l,n.precedence,e),t.instance=l;case"script":return l=Zl(n.src),(a=e.querySelector(gr(l)))?(t.instance=a,Ie(a),a):(i=n,(a=on.get(l))&&(i=oe({},n),q2(i,a)),e=e.ownerDocument||e,a=e.createElement("script"),Ie(a),nt(a,"link",i),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(S(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(i=t.instance,t.state.loading|=4,So(i,n.precedence,e));return t.instance}function So(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=i.length?i[i.length-1]:null,l=a,s=0;s<i.length;s++){var r=i[s];if(r.dataset.precedence===t)l=r;else if(l!==a)break}l?l.parentNode.insertBefore(e,l.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function V2(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function q2(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Eo=null;function vw(e,t,n){if(Eo===null){var i=new Map,a=Eo=new Map;a.set(n,i)}else a=Eo,i=a.get(n),i||(i=new Map,a.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var l=n[a];if(!(l[Ds]||l[Pe]||e==="link"&&l.getAttribute("rel")==="stylesheet")&&l.namespaceURI!=="http://www.w3.org/2000/svg"){var s=l.getAttribute(t)||"";s=e+s;var r=i.get(s);r?r.push(l):i.set(s,[l])}}return i}function bw(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function f8(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function xw(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}function d8(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&!(n.state.loading&4)){if(n.instance===null){var a=Ql(i.href),l=t.querySelector(mr(a));if(l){t=l._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=_o.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=l,Ie(l);return}l=t.ownerDocument||t,i=yw(i),(a=on.get(a))&&V2(i,a),l=l.createElement("link"),Ie(l);var s=l;s._p=new Promise(function(r,o){s.onload=r,s.onerror=o}),nt(l,"link",i),n.instance=l}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=_o.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var F2=0;function h8(e,t){return e.stylesheets&&e.count===0&&Ao(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&Ao(e,e.stylesheets),e.unsuspend){var l=e.unsuspend;e.unsuspend=null,l()}},6e4+t);0<e.imgBytes&&F2===0&&(F2=62500*Zv());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ao(e,e.stylesheets),e.unsuspend)){var l=e.unsuspend;e.unsuspend=null,l()}},(e.imgBytes>F2?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(a)}}:null}function _o(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ao(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var To=null;function Ao(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,To=new Map,t.forEach(m8,e),To=null,_o.call(e))}function m8(e,t){if(!(t.state.loading&4)){var n=To.get(e);if(n)var i=n.get(null);else{n=new Map,To.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),l=0;l<a.length;l++){var s=a[l];(s.nodeName==="LINK"||s.getAttribute("media")!=="not all")&&(n.set(s.dataset.precedence,s),i=s)}i&&n.set(null,i)}a=t.instance,s=a.getAttribute("data-precedence"),l=n.get(s)||i,l===i&&n.set(null,a),n.set(s,a),this.count++,i=_o.bind(this),a.addEventListener("load",i),a.addEventListener("error",i),l?l.parentNode.insertBefore(a,l.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var wr={$$typeof:Fn,Provider:null,Consumer:null,_currentValue:oa,_currentValue2:oa,_threadCount:0};function g8(e,t,n,i,a,l,s,r,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Rf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rf(0),this.hiddenUpdates=Rf(null),this.identifierPrefix=i,this.onUncaughtError=a,this.onCaughtError=l,this.onRecoverableError=s,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function Sw(e,t,n,i,a,l,s,r,o,c,f,h){return e=new g8(e,t,n,s,o,c,f,h,r),t=1,l===!0&&(t|=24),l=Gt(3,null,null,t),e.current=l,l.stateNode=e,t=Sd(),t.refCount++,e.pooledCache=t,t.refCount++,l.memoizedState={element:i,isDehydrated:n,cache:t},Ad(l),e}function Ew(e){return e?(e=_l,e):_l}function _w(e,t,n,i,a,l){a=Ew(a),i.context===null?i.context=a:i.pendingContext=a,i=Mi(t),i.payload={element:n},l=l===void 0?null:l,l!==null&&(i.callback=l),n=Ci(e,i,t),n!==null&&(bt(n,e,t),Ks(n,e,t))}function Tw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Y2(e,t){Tw(e,t),(e=e.alternate)&&Tw(e,t)}function Aw(e){if(e.tag===13||e.tag===31){var t=wa(e,67108864);t!==null&&bt(t,e,67108864),Y2(e,67108864)}}function Nw(e){if(e.tag===13||e.tag===31){var t=Yt();t=Gf(t);var n=wa(e,t);n!==null&&bt(n,e,t),Y2(e,t)}}var No=!0;function w8(e,t,n,i){var a=B.T;B.T=null;var l=W.p;try{W.p=2,X2(e,t,n,i)}finally{W.p=l,B.T=a}}function y8(e,t,n,i){var a=B.T;B.T=null;var l=W.p;try{W.p=8,X2(e,t,n,i)}finally{W.p=l,B.T=a}}function X2(e,t,n,i){if(No){var a=Q2(i);if(a===null)D2(e,t,i,jo,n),Mw(e,i);else if(v8(a,e,t,n,i))i.stopPropagation();else if(Mw(e,i),t&4&&-1<p8.indexOf(e)){for(;a!==null;){var l=hl(a);if(l!==null)switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var s=fa(l.pendingLanes);if(s!==0){var r=l;for(r.pendingLanes|=2,r.entangledLanes|=2;s;){var o=1<<31-Bt(s);r.entanglements[1]|=o,s&=~o}Un(l),!(P&6)&&(oo=Lt()+500,cr(0))}}break;case 31:case 13:r=wa(l,2),r!==null&&bt(r,l,2),fo(),Y2(l,2)}if(l=Q2(i),l===null&&D2(e,t,i,jo,n),l===a)break;a=l}a!==null&&i.stopPropagation()}else D2(e,t,i,null,n)}}function Q2(e){return e=Kf(e),Z2(e)}var jo=null;function Z2(e){if(jo=null,e=dl(e),e!==null){var t=Es(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=N3(t),e!==null)return e;e=null}else if(n===31){if(e=j3(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jo=e,null}function jw(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ip()){case U3:return 2;case B3:return 8;case wu:case ap:return 32;case R3:return 268435456;default:return 32}default:return 32}}var K2=!1,Vi=null,qi=null,Fi=null,yr=new Map,pr=new Map,Yi=[],p8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Mw(e,t){switch(e){case"focusin":case"focusout":Vi=null;break;case"dragenter":case"dragleave":qi=null;break;case"mouseover":case"mouseout":Fi=null;break;case"pointerover":case"pointerout":yr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pr.delete(t.pointerId)}}function vr(e,t,n,i,a,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:l,targetContainers:[a]},t!==null&&(t=hl(t),t!==null&&Aw(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function v8(e,t,n,i,a){switch(t){case"focusin":return Vi=vr(Vi,e,t,n,i,a),!0;case"dragenter":return qi=vr(qi,e,t,n,i,a),!0;case"mouseover":return Fi=vr(Fi,e,t,n,i,a),!0;case"pointerover":var l=a.pointerId;return yr.set(l,vr(yr.get(l)||null,e,t,n,i,a)),!0;case"gotpointercapture":return l=a.pointerId,pr.set(l,vr(pr.get(l)||null,e,t,n,i,a)),!0}return!1}function Cw(e){var t=dl(e.target);if(t!==null){var n=Es(t);if(n!==null){if(t=n.tag,t===13){if(t=N3(n),t!==null){e.blockedOn=t,Y3(e.priority,function(){Nw(n)});return}}else if(t===31){if(t=j3(n),t!==null){e.blockedOn=t,Y3(e.priority,function(){Nw(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Mo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Q2(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Zf=i,n.target.dispatchEvent(i),Zf=null}else return t=hl(n),t!==null&&Aw(t),e.blockedOn=n,!1;t.shift()}return!0}function Dw(e,t,n){Mo(e)&&n.delete(t)}function b8(){K2=!1,Vi!==null&&Mo(Vi)&&(Vi=null),qi!==null&&Mo(qi)&&(qi=null),Fi!==null&&Mo(Fi)&&(Fi=null),yr.forEach(Dw),pr.forEach(Dw)}function Co(e,t){e.blockedOn===t&&(e.blockedOn=null,K2||(K2=!0,qe.unstable_scheduleCallback(qe.unstable_NormalPriority,b8)))}var Do=null;function Ow(e){Do!==e&&(Do=e,qe.unstable_scheduleCallback(qe.unstable_NormalPriority,function(){Do===e&&(Do=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],a=e[t+2];if(typeof i!="function"){if(Z2(i||n)===null)continue;break}var l=hl(n);l!==null&&(e.splice(t,3),t-=3,Qd(l,{pending:!0,data:a,method:n.method,action:i},i,a))}}))}function Kl(e){function t(o){return Co(o,e)}Vi!==null&&Co(Vi,e),qi!==null&&Co(qi,e),Fi!==null&&Co(Fi,e),yr.forEach(t),pr.forEach(t);for(var n=0;n<Yi.length;n++){var i=Yi[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Yi.length&&(n=Yi[0],n.blockedOn===null);)Cw(n),n.blockedOn===null&&Yi.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var a=n[i],l=n[i+1],s=a[mt]||null;if(typeof l=="function")s||Ow(n);else if(s){var r=null;if(l&&l.hasAttribute("formAction")){if(a=l,s=l[mt]||null)r=s.formAction;else if(Z2(a)!==null)continue}else r=s.action;typeof r=="function"?n[i+1]=r:(n.splice(i,3),i-=3),Ow(n)}}}function zw(){function e(l){l.canIntercept&&l.info==="react-transition"&&l.intercept({handler:function(){return new Promise(function(s){return a=s})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var l=navigation.currentEntry;l&&l.url!=null&&navigation.navigate(l.url,{state:l.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function I2(e){this._internalRoot=e}Oo.prototype.render=I2.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(S(409));var n=t.current,i=Yt();_w(n,i,e,t,null,null)},Oo.prototype.unmount=I2.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_w(e.current,2,null,e,null,null),fo(),t[fl]=null}};function Oo(e){this._internalRoot=e}Oo.prototype.unstable_scheduleHydration=function(e){if(e){var t=F3();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Yi.length&&t!==0&&t<Yi[n].priority;n++);Yi.splice(n,0,e),n===0&&Cw(e)}};var kw=T3.version;if(kw!=="19.2.0")throw Error(S(527,kw,"19.2.0"));W.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(S(188)):(e=Object.keys(e).join(","),Error(S(268,e)));return e=Jy(t),e=e!==null?C3(e):null,e=e===null?null:e.stateNode,e};var x8={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zo.isDisabled&&zo.supportsFiber)try{js=zo.inject(x8),Ut=zo}catch{}}fu.createRoot=function(e,t){if(!A3(e))throw Error(S(299));var n=!1,i="",a=Vm,l=qm,s=Fm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(l=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Sw(e,1,!1,null,null,n,i,null,a,l,s,zw),e[fl]=t.current,C2(e),new I2(t)},fu.hydrateRoot=function(e,t,n){if(!A3(e))throw Error(S(299));var i=!1,a="",l=Vm,s=qm,r=Fm,o=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(l=n.onUncaughtError),n.onCaughtError!==void 0&&(s=n.onCaughtError),n.onRecoverableError!==void 0&&(r=n.onRecoverableError),n.formState!==void 0&&(o=n.formState)),t=Sw(e,1,!0,t,n??null,i,a,o,l,s,r,zw),t.context=Ew(null),n=t.current,i=Yt(),i=Gf(i),a=Mi(i),a.callback=null,Ci(n,a,i),n=i,t.current.lanes=n,Cs(t,n),Un(t),e[fl]=t.current,C2(e),new Oo(t)},fu.version="19.2.0";function Lw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Lw)}catch(e){console.error(e)}}Lw(),S3.exports=fu;var S8=S3.exports;const E8=e=>u.jsx("span",{className:"iw-text-2xl",children:u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",...e,children:[u.jsx("path",{d:"M0 0C9.01627 8.39148 22.9837 8.39148 32 0C23.6085 9.01627 23.6085 22.9837 32 32C22.9837 23.6085 9.01627 23.6085 0 32C8.39148 22.9837 8.39148 9.01627 0 0Z",fill:"url(#paint0_linear_6039_13039)"}),u.jsx("defs",{children:u.jsxs("linearGradient",{id:"paint0_linear_6039_13039",x1:"16",y1:"-3.5",x2:"41.5",y2:"29",gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{offset:"0.210966",stopColor:"#1E06CB"}),u.jsx("stop",{offset:"0.740385",stopColor:"#DB38EF"})]})})]})}),_8=()=>u.jsx(Zo,{config:{api:{baseUrl:"http://localhost:8000/api",authToken:""},interview:{proctoring:{enabled:!1,gazeAnalysisEnabled:!1,showControls:!1,showEngagementBar:!1,showLandmarks:!1}}},children:u.jsx("div",{className:"interview-widget-container",children:u.jsx(Uo,{title:"Frontend Developer",brandName:"Previa",interviewId:"ea3cb06a-c168-4ad3-8084-4165a79473d3",className:"iw-rounded-none iw-shadow-none",onInterviewEnd:()=>{console.log("🎉🎉 Interview ended 🎉🎉"),window.location.reload(),sessionStorage.clear()},onInterviewDisqualify:()=>{console.log("❌ Interview disqualified ❌")}})})}),T8=document.getElementById("root");S8.createRoot(T8).render(u.jsx(_8,{}));const A8=(e,t,n)=>Math.max(t,Math.min(n,e)),Uw=e=>{const t=Math.max(0,Math.floor(e)),n=Math.floor(t/60).toString().padStart(2,"0"),i=(t%60).toString().padStart(2,"0");return`${n}:${i}`},ko=({total:e,remaining:t,size:n=64,strokeWidth:i=6,className:a="",showLabel:l=!0})=>{const s=Math.max(1,e||1),r=A8(t/s,0,1),{radius:o,circumference:c,dashOffset:f,center:h}=y.useMemo(()=>{const v=(n-i)/2,x=2*Math.PI*v,E=x*(1-r),g=Math.round(i)%2===1,w=n/2+(g?.5:0);return{radius:v,circumference:x,dashOffset:E,center:w}},[n,i,r]),d=y.useMemo(()=>r<=.25?"iw-stroke-red-500":r<=.5?"iw-stroke-yellow-500":"iw-stroke-green-500",[r]),m=r<=.25?"iw-animate-pulse":"";return u.jsxs("div",{className:`iw-relative iw-inline-flex iw-items-center iw-justify-center iw-rounded-full iw-bg-white ${a}`,style:{width:n,height:n},"aria-label":`Time remaining ${Uw(t)}`,role:"timer","aria-live":"polite",children:[u.jsx("svg",{width:n,height:n,viewBox:`0 0 ${n} ${n}`,preserveAspectRatio:"xMidYMid meet",children:u.jsxs("g",{transform:`rotate(-90 ${h} ${h})`,children:[u.jsx("circle",{cx:h,cy:h,r:o,className:"iw-stroke-gray-200",strokeWidth:i,fill:"none",shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke"}),u.jsx("circle",{cx:h,cy:h,r:o,className:`${d} ${m}`,strokeWidth:i,strokeLinecap:"round",fill:"none",strokeDasharray:c,strokeDashoffset:f,shapeRendering:"geometricPrecision",vectorEffect:"non-scaling-stroke",style:{transition:"stroke-dashoffset 0.3s ease, stroke 0.2s ease"}})]})}),l?u.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center iw-rotate-0",children:u.jsx("span",{className:`iw-text-[11px] iw-font-semibold iw-tabular-nums ${r<=.25?"iw-text-red-600":r<=.5?"iw-text-yellow-600":"iw-text-green-600"}`,children:Uw(t)})}):u.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center iw-rotate-0",children:u.jsx(w6,{})})]})},N8=({timerState:e,answeringTime:t})=>{const n=(e==null?void 0:e.currentPhaseTimeRemaining)||0,i=t||p3.answeringDuration;return u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-3",children:[u.jsx(ko,{total:i,remaining:n,size:50,strokeWidth:4,showLabel:!1,className:"iw-shadow-sm iw-border iw-border-gray-100"}),u.jsxs("div",{className:"iw-flex iw-flex-col",children:[u.jsx("span",{className:"iw-text-[#5C6686]",children:"Time left to answer"}),u.jsxs("span",{className:"iw-text-xl iw-font-bold iw-text-[#062260]",children:[Io(n)," mins"]})]})]})},j8=({question:e,isLoading:t=!1,phase:n,brandName:i,timerState:a,answeringTime:l})=>u.jsx("div",{className:"iw-rounded-xl iw-mb-4 message-animation iw-text-gray-800 iw-py-1",children:u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-4",children:[u.jsx("div",{className:`iw-flex iw-flex-col iw-items-center iw-justify-center iw-relative iw-h-16 iw-w-16 iw-shrink-0 iw-shadow iw-rounded-full iw-border-[#E8EEFE] iw-border-4 ${n===K.READING_QUESTION?"iw-animate-speaking":""}`,children:u.jsx("div",{className:"iw-bg-transparent iw-flex iw-items-center iw-justify-center iw-rounded-full iw-size-full",style:{backgroundImage:"linear-gradient(#B5D0FD, #FFFFFF)"},children:u.jsx(E8,{className:"iw-size-8"})})}),u.jsx(M8,{phase:n,question:e,isLoading:t,brandName:i,timerState:a,answeringTime:l})]})}),M8=({phase:e,question:t,isLoading:n,brandName:i,timerState:a,answeringTime:l})=>{const s=i||"We",r=i?"is":"are";if(n||e===K.FETCHING_QUESTION||e===K.IDLE)return u.jsxs("div",{className:"iw-animate-pulse iw-w-full iw-space-y-3 iw-mr-10",children:[u.jsx("div",{className:"iw-h-5 iw-bg-gray-200 iw-rounded iw-w-full"}),u.jsx("div",{className:"iw-h-5 iw-bg-gray-200 iw-rounded iw-w-3/4"})]});const o=()=>u.jsxs("span",{className:"iw-animate-dot-wave iw-ml-1",children:[u.jsx("span",{children:"."}),u.jsx("span",{children:"."}),u.jsx("span",{children:"."})]});switch(e){case K.ANSWERING:return u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between iw-w-full",children:[u.jsxs("p",{className:"iw-text-lg iw-leading-7 iw-font-medium iw-text-gray-600",children:["Listening",u.jsx(o,{})]}),u.jsx(N8,{timerState:a,answeringTime:l})]});case K.TRANSCRIBING:return u.jsxs("p",{className:"iw-text-lg iw-leading-7 iw-font-medium iw-text-gray-600",children:[s," ",r," analyzing your answer",u.jsx(o,{})]});case(K.EDITING||K.SUBMITTING):return u.jsxs("p",{className:"iw-text-lg iw-leading-7 iw-font-medium iw-text-gray-600",children:[s," ",r," waiting for your answer..."]});default:return u.jsx("p",{className:"iw-text-lg iw-leading-7",children:t==null?void 0:t.question})}},C8=({label:e,error:t,fullWidth:n=!1,className:i="",id:a,...l})=>{const s=a||`textarea-${Math.random().toString(36).substring(2,9)}`,r="iw-block iw-rounded-md iw-border iw-border-gray-300 iw-shadow-sm iw-px-4 iw-py-2 iw-text-sm iw-transition-all",o=t?"iw-border-red-500 iw-focus:border-red-500 iw-focus:ring-red-500":"",c=n?"iw-w-full":"",f=i.includes("iw-h-full")||n?"iw-h-full":"";return u.jsxs("div",{className:`iw-h-full iw-flex iw-flex-col ${n?"iw-w-full":""}`,children:[e&&u.jsx("label",{htmlFor:s,className:"iw-block iw-text-sm iw-font-medium iw-text-gray-700 iw-mb-1",children:e}),u.jsx("textarea",{id:s,className:`${r} ${o} ${c} ${f} ${i}`,"aria-invalid":t?"true":"false",...l}),t&&u.jsx("p",{className:"iw-mt-1 iw-text-sm iw-text-red-600",children:t})]})},D8=({answerText:e,onAnswerChange:t,timerState:n,editingTime:i})=>u.jsxs("div",{className:"iw-w-full iw-bg-white iw-rounded-xl iw-border iw-border-[#84bbf5] iw-overflow-hidden iw-rounded-tr-none",children:[u.jsx("div",{className:"iw-p-2 iw-pb-0",children:u.jsx(C8,{value:e,onChange:t,placeholder:"Type your answer here...",className:"iw-w-full iw-h-64 iw-resize-none iw-bg-transparent iw-border-none iw-text-[#062260] iw-text-base iw-leading-relaxed focus-visible:iw-outline-0 iw-p-0",disabled:n.phase===K.SUBMITTING})}),u.jsxs("div",{className:"iw-bg-[#F1F5FE] iw-px-2 iw-py-2 iw-flex iw-items-center iw-justify-between iw-border-t iw-border-[#E8EEFE]",children:[u.jsx("span",{className:"iw-text-[#062260] iw-text-sm iw-font-medium iw-line-clamp-1",children:"Time left to edit answer"}),u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[u.jsx(ko,{total:i,remaining:n.currentPhaseTimeRemaining,size:32,strokeWidth:3,showLabel:!1}),u.jsx("span",{className:"iw-text-[#062260] iw-text-sm iw-font-bold",children:`${Io(n.currentPhaseTimeRemaining)} mins`})]})]})]}),Bw=({children:e})=>u.jsx("div",{className:"iw-flex iw-flex-col iw-items-start iw-mt-3 iw-gap-1",children:e}),O8=({children:e})=>u.jsx("div",{className:"iw-flex iw-flex-col iw-items-end iw-mt-3 iw-gap-1",children:e}),z8=({questionNumber:e})=>u.jsxs("div",{className:"iw-px-4 iw-py-1.5 iw-rounded-full iw-mb-2 iw-text-sm iw-font-semibold",style:{color:"#062260",backgroundColor:"#E6F3FF",border:"1px solid #BDE0FD"},children:[" Q",e]}),Rw=({label:e})=>u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2 iw-text-sm iw-text-gray-500 iw-bg-[#F1F5FE] iw-px-4 iw-py-1.5 iw-rounded-full iw-my-2 iw-font-semibold",children:[e&&u.jsx("span",{className:"iw-font-medium",children:e}),u.jsxs("span",{className:"iw-animate-dot-wave iw-text-2xl",children:[u.jsx("span",{children:"."}),u.jsx("span",{children:"."}),u.jsx("span",{children:"."})]})]}),k8=({phase:e,questionNumber:t})=>{switch(e){case K.FETCHING_QUESTION:return u.jsxs(Bw,{children:[u.jsx(z8,{questionNumber:t+1}),u.jsx(Rw,{})]});case K.ANSWERING:return u.jsx(O8,{children:u.jsx(Rw,{label:"You"})});case K.TRANSCRIBING:return u.jsx(Bw,{children:u.jsxs("div",{className:"iw-flex iw-items-center iw-px-1 iw-py-1.5 iw-rounded-lg iw-mb-2 iw-text-sm iw-bg-[#F2E8FE]",children:[u.jsx("img",{src:"../../../../src/assets/transcribing.gif",alt:"Transcribing",className:"iw-h-8 iw-w-12"}),u.jsx("span",{className:"iw-text-sm iw-text-[#062260]",children:"Analyzing answer…"})]})});default:return null}},L8=({item:e,index:t,isCurrentQuestion:n=!1,isEditable:i=!1,answerText:a="",onAnswerChange:l,timerState:s,editingTime:r})=>{const o=i&&s&&r!==void 0,c=o||e.answer;return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-start",children:[u.jsxs("div",{className:"iw-px-4 iw-py-1.5 iw-rounded-full iw-mb-2 iw-text-sm iw-font-semibold",style:{color:"#062260",backgroundColor:"#E6F3FF",border:"1px solid #BDE0FD"},children:["Q",t+1]}),u.jsx("div",{className:"iw-w-full iw-p-4 iw-rounded-xl iw-text-[#062260] iw-text-base iw-leading-relaxed iw-rounded-tl-none",style:{backgroundColor:"#F1F5FE",border:n?"2px solid #84bbf5":"1px solid transparent"},children:e.question})]}),c&&u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-end iw-mt-4",children:[u.jsx("div",{className:"iw-px-4 iw-py-1.5 iw-rounded-full iw-mb-2 iw-text-sm iw-font-semibold",style:{color:"#062260",backgroundColor:"#F2E8FE",border:"1px solid #E9D5FF"},children:"You"}),o?u.jsx(D8,{answerText:a||"",onAnswerChange:l,timerState:s,editingTime:r}):u.jsx("div",{className:"iw-w-full iw-p-4 iw-rounded-xl iw-text-[#062260] iw-text-base iw-leading-relaxed iw-rounded-tr-none",style:{backgroundColor:"#F7F1FE"},children:e.answer})]}),n&&u.jsx(k8,{phase:s==null?void 0:s.phase,questionNumber:t+1})]})},U8=()=>u.jsx("div",{className:"iw-space-y-6 iw-animate-pulse",children:[1,2,3].map(e=>u.jsxs("div",{className:`iw-flex iw-flex-col ${e%2===0?"iw-items-end":"iw-items-start"} iw-gap-2`,children:[u.jsx("div",{className:"iw-h-8 iw-w-16 iw-bg-gray-200 iw-rounded-full"}),u.jsx("div",{className:"iw-h-24 iw-w-full iw-bg-gray-100 iw-rounded-xl"})]},e))}),B8=({transcript:e,isLoading:t,className:n="",bottomRef:i,isEditing:a,answerText:l,onAnswerChange:s,timerState:r,editingTime:o})=>u.jsxs("div",{className:`iw-h-full iw-flex iw-flex-col iw-bg-white iw-scroll-smooth iw-p-6 iw-pr-2 iw-min-w-32 iw-border iw-rounded-tr-2xl iw-rounded-br-2xl iw-border-[#E8EEFE] ${n}`,children:[u.jsxs("div",{className:"iw-mb-6",children:[u.jsx("h2",{className:"iw-text-lg iw-font-semibold iw-mb-4",style:{color:"#062260"},children:"Interview transcript"}),u.jsx("div",{className:"iw-h-px iw-w-full iw-border-t iw-border-dashed iw-border-gray-300"})]}),u.jsxs("div",{className:"iw-flex-1 iw-overflow-y-auto iw-pr-2 iw-space-y-6 iw-scrollbar-thin iw-max-w-xl iw-pb-5",children:[t?u.jsx(U8,{}):e==null?void 0:e.map((c,f)=>u.jsx(L8,{item:c,index:f,isCurrentQuestion:f===(e==null?void 0:e.length)-1,isEditable:!!(f===(e==null?void 0:e.length)-1&&a),answerText:l||"",onAnswerChange:s||(()=>{}),timerState:r,editingTime:o},c.qna_id)),u.jsx("div",{ref:i})]})]}),R8=({interviewId:e,className:t="",currentQuestion:n,lastSubmittedAnswer:i,isEditing:a,answerText:l,onAnswerChange:s,timerState:r,editingTime:o})=>{const c=b3(),[f,h]=y.useState([]),[d,m]=y.useState(!0),v=y.useRef(null);return y.useEffect(()=>{var x;(x=v.current)==null||x.scrollIntoView({behavior:"smooth"})},[f,l,r==null?void 0:r.phase]),y.useEffect(()=>{(async()=>{var E;try{const g=await c.getInterviewTranscription(e);h(((E=g==null?void 0:g.data)==null?void 0:E.question_answers)||[])}catch(g){console.error("Failed to fetch transcript:",g)}finally{m(!1)}})()},[e,c]),y.useEffect(()=>{n&&h(x=>{if(x.some(w=>w.qna_id===n.qna_id))return x;const g={qna_id:n.qna_id,question:n.question,answer:null,question_generated_at:new Date().toISOString(),answer_submitted_at:null};return[...x,g]})},[n]),y.useEffect(()=>{i!=null&&i.answer?h(x=>x.map(E=>E.qna_id===i.qnaId?{...E,answer:i.answer,answer_submitted_at:new Date().toISOString()}:E)):l&&h(x=>x.map(E=>E.qna_id===(i==null?void 0:i.qnaId)?{...E,answer:l,answer_submitted_at:new Date().toISOString()}:E))},[i,l]),u.jsx(B8,{transcript:f,isLoading:d||(f==null?void 0:f.length)===0,className:t,bottomRef:v,isEditing:a,answerText:l,onAnswerChange:s,timerState:r,editingTime:o})},G8=({onClick:e,text:t="Submit response"})=>(y.useEffect(()=>{if(typeof window>"u")return;const n=i=>{const a=i.metaKey||i.ctrlKey,l=i.key===" ",s=i.target;s.tagName==="INPUT"||s.isContentEditable||a&&l&&(i.preventDefault(),e())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[e]),u.jsx("div",{className:"iw-fixed iw-bottom-10 iw-left-1/4 iw-transform iw--translate-x-1/2 iw-z-50",children:u.jsxs("button",{onClick:e,className:"iw-flex iw-items-center iw-gap-3 iw-bg-[#4C6CFF] hover:iw-bg-[#4c6dffd5] iw-text-white iw-px-5 iw-py-3 iw-rounded-lg iw-shadow-lg iw-transition-all iw-duration-200 iw-group",children:[u.jsx("span",{className:"iw-font-semibold iw-text-sm",children:t}),u.jsx("span",{className:"iw-bg-white/90 iw-text-[#062260] iw-px-2 iw-py-1 iw-rounded iw-text-xs iw-font-mono iw-font-bold group-hover:iw-bg-white iw-transition-colors",children:"Press Ctrl / ⌘ + Space"})]})})),Gw=({brandName:e,currentQuestion:t,state:n,phase:i,className:a="",interviewId:l="",interview_duration:s=Tr,videoFeedRef:r,lastSubmittedAnswer:o,onNextPhase:c,answerText:f,onAnswerChange:h,editingTime:d,answeringTime:m})=>u.jsxs("div",{className:`iw-px-4 iw-py-3 ${a} iw-h-[calc(100vh_-_120px)] iw-max-h-[calc(100vh_-_120px)] iw-flex iw-gap-0 iw-relative`,children:[u.jsxs("div",{className:"iw-flex iw-flex-col iw-flex-1 iw-p-5 iw-bg-white/50 iw-border iw-border-[#E8EEFE] iw-rounded-s-3xl iw-overflow-hidden",children:[u.jsx("div",{className:"iw-flex iw-items-start iw-justify-between iw-gap-3 iw-mb-4",children:u.jsx("div",{className:"iw-flex-1",children:u.jsx(j8,{question:t,isLoading:i===K.FETCHING_QUESTION||i===K.IDLE,phase:i,brandName:e,timerState:n,answeringTime:m})})}),u.jsx("div",{className:"iw-flex-1 iw-min-h-0 iw-rounded-[16px] iw-overflow-hidden iw-relative",children:u.jsx(w3,{ref:r,interviewId:l,interview_duration:s,isAnswering:i===K.ANSWERING})})]}),u.jsx("div",{className:"iw-interview-transcription iw-w-1/4 iw-min-w-32 iw-h-full",children:u.jsx(R8,{interviewId:l,currentQuestion:t,lastSubmittedAnswer:o,isEditing:i===K.EDITING,answerText:f,onAnswerChange:h,timerState:n,editingTime:d})}),c&&(i===K.ANSWERING||i===K.EDITING)&&u.jsx(G8,{onClick:c,text:i===K.ANSWERING?"Submit Response":"Submit Final Response"})]}),H8=({confirmExitInterview:e,isOpen:t,onClose:n})=>u.jsx(Sf,{isOpen:t,onClose:n,title:"Exit Interview",closeOnOverlayClick:!1,children:u.jsxs("div",{className:"iw-space-y-5",children:[u.jsxs("div",{className:"iw-flex iw-items-start iw-gap-3 iw-rounded-xl iw-p-2",children:[u.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-flex-none iw-items-center iw-justify-center iw-rounded-full iw-bg-rose-100 iw-text-rose-600",children:"!"}),u.jsxs("div",{className:"iw-space-y-2",children:[u.jsx("p",{className:"iw-text-sm iw-font-semibold iw-text-rose-600",children:"Leaving now will end your interview !"}),u.jsx("p",{className:"iw-text-sm iw-text-slate-500",children:"Are you sure you want to exit? All progress will be lost and you will not be able to resume."})]})]}),u.jsxs("div",{className:"iw-flex iw-flex-col-reverse iw-gap-2 sm:iw-flex-row sm:iw-items-center sm:iw-justify-end iw-pb-1",children:[u.jsx("button",{className:"iw-inline-flex iw-items-center iw-justify-center iw-rounded-lg iw-border iw-border-slate-200 iw-bg-white iw-px-4 iw-py-2 iw-text-sm iw-font-medium iw-text-slate-600 iw-shadow-sm iw-transition hover:iw-bg-slate-50",onClick:n,children:"Stay in interview"}),u.jsx("button",{className:"iw-inline-flex iw-items-center iw-justify-center iw-rounded-lg iw-px-4 iw-py-2 iw-text-sm iw-font-semibold iw-text-white iw-transition hover:iw-brightness-110",style:{background:"linear-gradient(to right, rgba(244, 63, 94, 0.8), rgba(225, 29, 72, 0.8))",boxShadow:"0 12px 30px -16px rgba(244, 63, 94, 0.65)"},onClick:e,children:"Confirm exit"})]})]})}),Hw=({title:e,brandName:t,brandLogo:n,onExit:i,totalDuration:a=30,elapsedTime:l=0})=>{const{baseColor:s}=$l(),[r,o]=y.useState(!1),c=Math.min(l/(a*60)*100,100),f=()=>u.jsxs("div",{className:"iw-px-4 iw-pb-2 iw-flex iw-items-center iw-gap-3",children:[u.jsx("div",{className:"iw-flex-1 iw-h-4 iw-bg-[#F2F4F7] iw-rounded-full iw-overflow-hidden iw-border iw-border-blue-100 iw-relative",children:u.jsx("div",{className:"iw-h-full iw-bg-[#0EB00E] iw-rounded-full iw-transition-all iw-duration-1000 iw-ease-linear",style:{width:`${c}%`}})}),u.jsxs("div",{className:"iw-text-sm iw-font-medium iw-whitespace-nowrap",children:[u.jsx("span",{className:"iw-text-[#062260]",children:Io(l)}),u.jsxs("span",{className:"iw-text-[#667085]",children:["/",a," Min"]})]})]});return u.jsxs("header",{className:"iw-w-full iw-text-gray-900 iw-shadow-sm",children:[u.jsxs("div",{className:"iw-mx-auto iw-flex iw-items-center iw-justify-between iw-p-4 iw-pt-1 iw-mb-2 iw-border-b iw-border-[#B3B9CB] iw-border-dashed",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-space-x-2",children:[n||u.jsx("div",{className:"iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold",style:{backgroundColor:s},children:l1(t)}),u.jsx("p",{className:"iw-text-xl iw-font-semibold",children:t})]}),u.jsx("h1",{className:"iw-text-2xl iw-font-semibold iw-text-gradient-silver",children:e}),u.jsx("button",{className:"iw-text-sm iw-text-[#E94315] iw-min-w-10 iw-rounded-md hover:iw-bg-orange-100 iw-p-2",onClick:()=>o(!0),children:u.jsxs("span",{className:"iw-flex iw-items-center iw-gap-1 iw-text-[18px] iw-font-semibold iw-whitespace-nowrap",children:[u.jsx(r1,{className:"iw-text-[#E94315] iw-size-5"}),"Leave interview"]})})]}),u.jsx(f,{}),u.jsx("div",{className:"iw-h-px iw-bg-gray-200"}),u.jsx(H8,{isOpen:r,confirmExitInterview:()=>{i(),o(!1)},onClose:()=>o(!1)})]})},V8=({className:e="",width:t,height:n=56,barWidth:i=3,gap:a=2,fftSize:l=1024,smoothingTimeConstant:s=.8,mediaStream:r,startOnMount:o=!0})=>{const{baseColor:c}=$l(),f=y.useRef(null),h=y.useRef(null),d=y.useRef(null),m=y.useRef(null),v=y.useRef(null),x=y.useRef(null),E=y.useRef(!1),[g,w]=y.useState(null);y.useEffect(()=>{if(t||!h.current)return;const b=h.current,A=()=>{const _=f.current;if(!_)return;const M=b.clientWidth,T=n;_.width=Math.max(1,Math.floor(M*window.devicePixelRatio||1)),_.height=Math.max(1,Math.floor(T*window.devicePixelRatio||1))},N=new ResizeObserver(A);return N.observe(b),A(),()=>N.disconnect()},[t,n]),y.useEffect(()=>{if(!t)return;const b=f.current;b&&(b.width=Math.max(1,Math.floor(t*(window.devicePixelRatio||1))),b.height=Math.max(1,Math.floor(n*(window.devicePixelRatio||1))))},[t,n]),y.useEffect(()=>{let b=!1;return(async()=>{try{const N=new(window.AudioContext||window.webkitAudioContext);d.current=N;let _=r;if(!_){if(!o)return;_=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),E.current=!0}if(b)return;const M=N.createAnalyser();M.fftSize=l,M.smoothingTimeConstant=s,m.current=M;const T=N.createMediaStreamSource(_);v.current=T,T.connect(M),p()}catch(N){w((N==null?void 0:N.message)||"Failed to initialize microphone")}})(),()=>{var N,_,M,T;b=!0,x.current&&cancelAnimationFrame(x.current);try{(N=v.current)==null||N.disconnect()}catch{}try{(_=m.current)==null||_.disconnect()}catch{}E.current&&((T=((M=v.current)==null?void 0:M.mediaStream)||void 0)==null||T.getTracks().forEach(D=>D.stop())),d.current&&d.current.state!=="closed"&&d.current.close()}},[r,l,s,o]);const p=()=>{const b=f.current,A=m.current;if(!b||!A)return;const N=b.getContext("2d");if(!N)return;const _=window.devicePixelRatio||1,M=b.width,T=b.height,D=A.frequencyBinCount,Ee=new Uint8Array(D),Re=()=>{x.current=requestAnimationFrame(Re),A.getByteTimeDomainData(Ee),N.clearRect(0,0,M,T),N.fillStyle="rgba(0,0,0,0)",N.fillRect(0,0,M,T);const rt=Math.max(1,Math.floor(i*_)),cn=Math.max(1,Math.floor(a*_)),xt=rt+cn,j=Math.max(8,Math.floor((M+cn)/xt)),G=Math.floor(Ee.length/j);for(let R=0;R<j;R++){const $=Math.min(Ee.length-1,R*G),se=Ee[$]/128-1,ut=Math.abs(se),bn=Math.pow(ut,.6),fn=Math.max(T*.06,bn*(T*.9)),Xt=R*xt,ot=(T-fn)/2,ct=140-Math.min(140,140*ut),dn=85,Ce=48+Math.floor(12*(1-ut));N.fillStyle=`${c}`,N.shadowColor=`hsla(${ct}, ${dn}%, ${Ce}%, ${.25*ut})`,N.shadowBlur=8*ut;const Xi=Math.min(rt/2,fn/2);q8(N,Xt,ot,rt,fn,Xi),N.fill()}};Re()};return u.jsxs("div",{ref:h,className:`iw-relative iw-w-full iw-overflow-hidden iw-rounded-md iw-bg-gray-50 ${e}`,style:{height:n},children:[u.jsx("canvas",{ref:f,className:"iw-w-full iw-h-full"}),g&&u.jsx("div",{className:"iw-absolute iw-inset-0 iw-flex iw-items-center iw-justify-center",children:u.jsx("span",{className:"iw-text-xs iw-text-red-600 iw-bg-red-50 iw-border iw-border-red-200 iw-px-2 iw-py-1 iw-rounded",children:g})})]})};function q8(e,t,n,i,a,l){const s=Math.min(l,i/2,a/2);e.beginPath(),e.moveTo(t+s,n),e.lineTo(t+i-s,n),e.quadraticCurveTo(t+i,n,t+i,n+s),e.lineTo(t+i,n+a-s),e.quadraticCurveTo(t+i,n+a,t+i-s,n+a),e.lineTo(t+s,n+a),e.quadraticCurveTo(t,n+a,t,n+a-s),e.lineTo(t,n+s),e.quadraticCurveTo(t,n,t+s,n),e.closePath()}const F8=({state:e,answeringTime:t,nextPhase:n,sttError:i})=>u.jsxs("div",{className:"iw-flex iw-flex-col iw-justify-between iw-h-full ",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-between",children:[u.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"You may start speaking now. We're listening...."}),u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[u.jsx(s1,{className:"iw-size-4 iw-text-orange-600"}),u.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to talk: "})]}),u.jsx(ko,{total:t,remaining:e.currentPhaseTimeRemaining,size:50,strokeWidth:4})]})]}),u.jsx("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:"Done talking? Click the button to review your answer."})]}),u.jsxs("div",{children:[u.jsx(V8,{}),i&&u.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Recording error: ",i.message]})]}),u.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1",children:u.jsx(Ss,{onClick:()=>{n()},children:"Transcribe My Answer"})})]});function Y8(){const[e,t]=y.useState(!0),n=y.useMemo(()=>[0,1,2].map(i=>({id:i})),[]);return y.useEffect(()=>{const i=setInterval(()=>{t(a=>!a)},1500);return()=>clearInterval(i)},[]),u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-h-full",children:[u.jsx("div",{className:"iw-relative iw-w-80 iw-h-48 ","aria-hidden":!0,children:n.map((i,a)=>{const l=a*50,s=e?l:l+12,r=e?1:.08,o=a*140;return u.jsx("div",{role:"presentation",className:"iw-absolute iw-w-full iw-rounded-lg iw-p-4 iw-shadow-md iw-bg-gradient-to-b iw-from-gray-50 iw-to-gray-100 iw-overflow-hidden",style:{top:0,transform:`translateY(${s}px)`,opacity:r,transition:`transform 600ms cubic-bezier(.2,.9,.3,1) ${o}ms, opacity 400ms ease ${o}ms`},children:u.jsxs("div",{className:"iw-flex iw-gap-3 iw-items-center",children:[u.jsx("div",{className:"iw-w-10 iw-h-10 iw-bg-gray-300 iw-rounded iw-flex-shrink-0"}),u.jsxs("div",{className:"iw-flex-1 iw-space-y-2",children:[u.jsx("div",{className:"iw-h-2 iw-bg-gray-300 iw-rounded iw-w-24"}),u.jsx("div",{className:"iw-h-2 iw-bg-gray-300 iw-rounded iw-w-32"})]})]})},i.id)})}),u.jsx("div",{className:"iw-text-center",children:u.jsx("p",{className:"iw-text-gray-500 iw-font-medium",children:"Preparing your question..."})})]})}const X8=({size:e="192px",className:t,colors:n,animationDuration:i=20})=>{const l={...{bg:"oklch(95% 0.02 264.695)",c1:"oklch(75% 0.15 350)",c2:"oklch(80% 0.12 200)",c3:"oklch(78% 0.14 280)"},...n},s=parseInt(e.replace("px",""),10),r=s<50?Math.max(s*.008,1):Math.max(s*.015,4),o=s<50?Math.max(s*.004,1.2):Math.max(s*.008,1.5),c=s<50?Math.max(s*.004,.05):Math.max(s*.008,.1),f=s<50?Math.max(s*.004,.5):Math.max(s*.008,2),h=s<30?"0%":s<50?"5%":s<100?"15%":"25%",d=s<30?1.1:s<50?Math.max(o*1.2,1.3):o;return u.jsx("div",{className:`siri-orb ${t}`,style:{width:e,height:e,"--bg":l.bg,"--c1":l.c1,"--c2":l.c2,"--c3":l.c3,"--animation-duration":`${i}s`,"--blur-amount":`${r}px`,"--contrast-amount":d,"--dot-size":`${c}px`,"--shadow-spread":`${f}px`,"--mask-radius":h},children:u.jsx("style",{children:`
83
107
  @property --angle {
84
108
  syntax: "<angle>";
85
109
  inherits: false;
@@ -184,4 +208,4 @@
184
208
  animation: none;
185
209
  }
186
210
  }
187
- `})})};function _h({ttsError:e}){return o.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-w-full iw-h-full",children:[o.jsx(vh,{size:"80px"}),e&&o.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Audio playback failed: ",e.message]}),o.jsx("p",{className:"iw-text- iw-text-gray-700",children:"Your AI interviewer is speaking..."})]})}const kh=({state:e,thinkingTime:t,nextPhase:r})=>o.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Get Ready to Answer"}),o.jsx("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:"After 30-seconds thinking time, recording will start automatically, or you can begin recording early by clicking the button below."})]}),o.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[o.jsx(ln,{className:"iw-size-4 iw-text-orange-600"}),o.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to think: "})]}),o.jsx(Hs,{total:t,remaining:e.currentPhaseTimeRemaining,size:50,strokeWidth:4})]}),o.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1",children:o.jsx(Qe,{onClick:()=>{r()},children:"Start Answering"})})]}),Eh=({sttError:e,editingDuration:t})=>o.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full",children:[o.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 60 60",fill:"none",children:[o.jsx("rect",{width:60,height:60,rx:30,fill:"url(#prefix__paint0_linear_1460_12482)"}),o.jsx("path",{d:"M28.127 14c.276 7.685 6.442 13.851 14.127 14.127-7.684.276-13.85 6.442-14.127 14.127-.275-7.685-6.442-13.851-14.126-14.127 7.684-.276 13.85-6.442 14.126-14.127zM38.937 31.873A7.331 7.331 0 0046 38.937 7.331 7.331 0 0038.937 46a7.331 7.331 0 00-7.064-7.063 7.331 7.331 0 007.064-7.064z",fill:"#fff"}),o.jsx("defs",{children:o.jsxs("linearGradient",{id:"prefix__paint0_linear_1460_12482",x1:30,y1:-6.563,x2:77.813,y2:54.375,gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:.211,stopColor:"#5C92FA"}),o.jsx("stop",{offset:1,stopColor:"#A75FFD"})]})})]}),o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1 iw-mt-3",children:"Just a moment... We're analyzing your response"}),o.jsxs("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:["After transcription, you'll have ",t||30," sec to review your answer."]}),e&&o.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Transcription error: ",e.message,e.recoverable&&" (attempting to continue)"]})]}),Qi=5;function Sh({isOpen:e,onClose:t,warningCount:r,violationType:i,onDisqualify:n}){const[s,a]=d.useState(10),c=d.useRef(t);if(d.useEffect(()=>{c.current=t},[t]),d.useEffect(()=>{if(!e)return;const w=setInterval(()=>{a(m=>m<=1?(c.current(),10):m-1)},1e3);return()=>clearInterval(w)},[e]),d.useEffect(()=>{e&&a(10)},[e]),d.useEffect(()=>(e?(document.body.style.overflow="hidden",document.body.classList.add("interview-widget-container")):(document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")),()=>{document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")}),[e]),!e)return null;const u=(()=>{switch(i){case"tab_switch":return{title:"Tab Switch Detected",description:"You attempted to switch to another tab or reload application.",icon:o.jsx(uo,{className:"iw-h-5 iw-w-5"})};case"fullscreen_exit":return{title:"Full Screen Exit Detected",description:"You attempted to exit full screen mode.",icon:o.jsx(co,{className:"iw-h-5 iw-w-5"})};case"focus_loss":return{title:"Focus Loss Detected",description:"You lost focus from the interview window.",icon:o.jsx(eu,{className:"iw-h-5 iw-w-5"})};case"blocked_shortcut":return{title:"Keyboard Shortcut Blocked",description:"You attempted to use a blocked keyboard shortcut.",icon:o.jsx(un,{className:"iw-h-5 iw-w-5"})};case"right_click_attempt":return{title:"Right Click Attempted",description:"You attempted to use the right click.",icon:o.jsx(tu,{className:"iw-h-5 iw-w-5"})};case"alt_tab_attempt":return{title:"Alt + Tab Attempted",description:"You attempted to use the Alt + Tab shortcut.",icon:o.jsx(un,{className:"iw-h-5 iw-w-5"})};case"blocked_function_key":return{title:"Function Key Blocked",description:"You attempted to use a blocked function key.",icon:o.jsx(un,{className:"iw-h-5 iw-w-5"})};default:return{title:"Violation Detected",description:"You attempted to perform an action that is not allowed.",icon:o.jsx(Lr,{className:"iw-h-5 iw-w-5"})}}})(),h=Qi-r,f=()=>{r+1>Qi?n():t()};return o.jsx("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-black/60 iw-p-4 iw-backdrop-blur-sm",children:o.jsxs("div",{className:"iw-w-full iw-max-w-md iw-rounded-2xl iw-border iw-border-gray-100 iw-bg-white iw-shadow-xl",children:[o.jsxs("div",{className:"iw-p-6 iw-pb-0",children:[o.jsxs("div",{className:"iw-mb-6 iw-flex iw-items-start iw-gap-4",children:[o.jsx("div",{className:"iw-flex iw-h-12 iw-w-12 iw-flex-shrink-0 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-red-50",children:o.jsx(Lr,{className:"iw-h-6 iw-w-6 iw-text-red-500"})}),o.jsxs("div",{className:"iw-flex-1",children:[o.jsx("h2",{className:"iw-mb-1 iw-text-xl iw-font-semibold iw-text-gray-900",children:"Security Violation"}),o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[o.jsx("span",{className:"iw-text-sm iw-text-gray-500",children:"Warning"}),o.jsx("div",{className:"iw-flex iw-gap-1",children:Array.from({length:Qi}).map((w,m)=>o.jsx("div",{className:`iw-h-2 iw-w-2 iw-rounded-full ${m<=r-1?"iw-bg-red-500":"iw-bg-gray-200"}`},m))}),o.jsxs("span",{className:"iw-text-sm iw-text-gray-500",children:["(",r,"/",Qi,")"]})]})]})]}),o.jsx("div",{className:"iw-mb-5 iw-rounded-2xl iw-border iw-border-red-100 iw-p-5",style:{background:"linear-gradient(to right, rgb(254, 242, 242), rgb(254, 245, 235))",borderColor:"rgb(254, 226, 226)"},children:o.jsxs("div",{className:"iw-flex iw-items-start iw-gap-4",children:[o.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-xl iw-bg-white iw-shadow-sm",children:u.icon}),o.jsxs("div",{className:"iw-flex-1",children:[o.jsx("h3",{className:"iw-mb-2 iw-font-semibold iw-text-gray-900",children:u.title}),o.jsx("p",{className:"iw-text-sm iw-leading-relaxed iw-text-gray-700",children:u.description}),o.jsxs("div",{className:"iw-mt-3 iw-flex iw-items-center iw-gap-2 iw-text-xs iw-text-red-600",children:[o.jsx(ao,{className:"iw-h-3 iw-w-3"}),o.jsx("span",{children:"This action is monitored for interview integrity"})]})]})]})}),o.jsxs("div",{className:"iw-mb-5 iw-grid iw-grid-cols-2 iw-gap-3",children:[o.jsx("div",{className:"iw-rounded-xl iw-border iw-border-amber-200 iw-bg-amber-50 iw-p-4",children:o.jsxs("div",{className:"iw-text-center",children:[o.jsx("div",{className:"iw-mb-1 iw-text-2xl iw-font-bold iw-text-amber-600",children:h}),o.jsx("div",{className:"iw-text-xs iw-font-medium iw-text-amber-700",children:"Warnings Left"})]})}),o.jsx("div",{className:"iw-border-primary-100 iw-bg-primary-50 iw-rounded-xl iw-border iw-p-4",children:o.jsxs("div",{className:"iw-text-center",children:[o.jsxs("div",{className:"iw-mb-1 iw-flex iw-items-center iw-justify-center iw-gap-1.5",children:[o.jsx(Zl,{className:"iw-text-primary-600 iw-h-4 iw-w-4"}),o.jsx("span",{className:"iw-text-primary-600 iw-text-2xl iw-font-bold",children:s})]}),o.jsx("div",{className:"iw-text-primary-700 iw-text-xs iw-font-medium",children:"Auto Close"})]})})]}),h===1&&o.jsx("div",{className:"iw-mb-5 iw-rounded-2xl iw-p-4 iw-text-white",style:{background:"linear-gradient(to right, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9))"},children:o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-3",children:[o.jsx("div",{className:"iw-flex iw-h-8 iw-w-8 iw-items-center iw-justify-center iw-rounded-full iw-bg-white/20",children:o.jsx(Lr,{className:"iw-h-4 iw-w-4"})}),o.jsxs("div",{children:[o.jsx("div",{className:"iw-text-sm iw-font-semibold",children:"Final Warning"}),o.jsx("div",{className:"iw-text-xs iw-text-red-100",children:"Next violation will disqualify you from this interview"})]})]})})]}),o.jsxs("div",{className:"iw-p-6 iw-pt-0",children:[o.jsx(Qe,{onClick:f,className:"iw-h-12 iw-w-full iw-rounded-xl iw-bg-gray-800 iw-text-sm iw-font-medium iw-text-white iw-hover:bg-gray-800",children:"I Understand - Continue Interview"}),o.jsx("p",{className:"iw-text-gray-500 iw-mt-3 iw-text-center iw-text-xs",children:"Please maintain focus and avoid switching tabs, exiting fullscreen, using shortcuts or right-clicking."})]})]})})}const Ah=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:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z"}),o.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),Th=({showHardReloadWarning:e,onContinue:t})=>{const r=()=>{t()};return o.jsxs(ii,{isOpen:e,onClose:r,closeOnOverlayClick:!1,closeOnEscape:!1,showCloseButton:!1,className:"iw-max-w-lg iw-px-2 iw-rounded-xl",children:[o.jsx("div",{className:"iw-absolute iw-inset-x-0 iw-top-0 iw-h-1 iw-bg-gradient-to-r iw-from-red-500 iw-to-red-600"}),o.jsx("div",{className:"iw-space-y-1 iw-pb-2 iw-pt-3",children:o.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[o.jsx(Lr,{className:"iw-w-5 iw-h-5 iw-text-red-500"}),o.jsx("h3",{className:"iw-text-xl iw-font-semibold iw-text-red-500",children:"Full Screen Exit Detected"})]})}),o.jsx("div",{className:"iw-pt-4 iw-pb-6",children:o.jsx("p",{className:"iw-text-center iw-text-sm iw-leading-relaxed iw-text-gray-500/90",children:"Exiting full screen mode or reloading this page during the session is strictly prohibited. Any attempt to do so will be recorded and may lead to penalties."})}),o.jsx("div",{className:"iw-pt-2 iw-pb-4",children:o.jsxs("button",{onClick:r,className:"iw-w-full iw-flex iw-items-center iw-justify-center iw-gap-2 iw-px-4 iw-py-3 iw-bg-gray-100 iw-text-gray-600 iw-rounded-md iw-font-medium iw-transition-colors hover:iw-bg-gray-200 focus:iw-outline-none focus:iw-ring-2 focus:iw-ring-gray-400 focus:iw-ring-offset-2",children:[o.jsx(Ah,{className:"iw-size-4"}),"Continue Session"]})})]})},jh=d.forwardRef(({children:e,onDisqualify:t},r)=>{const[i,n]=d.useState(!1),[s,a]=d.useState(!1),[c,l]=d.useState(!1),[u,h]=d.useState("fullscreen_exit"),{logViolation:f,violationCount:w}=uh({maxViolations:5,onViolation:p=>{s||(n(!0),h(p.type))}}),{enterFullScreen:m,isFullScreen:g,exitFullScreen:b}=ih({onFullScreenChange(p){!p&&!s&&!c&&(n(!0),f({type:"fullscreen_exit",severity:"high",details:{action:"fullscreen_exit",reason:"Attempted to exit full screen mode"}})),p&&l(!1)}});d.useEffect(()=>{m()},[]),d.useImperativeHandle(r,()=>({exitFullScreenIntentionally:async()=>{l(!0),n(!1),a(!1);try{document.fullscreenElement&&await document.exitFullscreen()}catch(p){console.error("Failed to exit fullscreen:",p)}}}),[]),oh(f),nh(f),ah(),dh();const _=()=>{a(!0),b(),n(!1),t==null||t()};return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"iw-relative iw-h-full iw-w-full",children:e}),o.jsx(Sh,{warningCount:w,isOpen:i,violationType:u,onClose:()=>{n(!1),m()},onDisqualify:_}),!i&&w>0&&!s&&!c&&o.jsx(Th,{showHardReloadWarning:!g,logViolation:f,onContinue:m})]})}),Nh=({interviewTitle:e,brandName:t="Novara",interviewId:r,onComplete:i,onDisqualify:n,className:s="",videoFeedRef:a})=>{var Zi;const c=lo(),{baseUrl:l,authToken:u}=ro(),{timers:h,stt:f,proctoring:w}=cn(),m=d.useRef(null),[g,b]=d.useState(null),[_,p]=d.useState(""),[A,F]=d.useState(ti),T=d.useRef(""),C=d.useRef(null);d.useEffect(()=>{(async()=>{var je;try{const rt=await c.getInterviewConfig(r);(je=rt==null?void 0:rt.data)!=null&&je.duration_in_minutes&&F(rt.data.duration_in_minutes)}catch(rt){console.error("Failed to fetch interview config:",rt)}})()},[r]);const M={thinkingTime:(h==null?void 0:h.thinkingDuration)||30,answeringTime:(h==null?void 0:h.answeringDuration)||120,editingTime:(h==null?void 0:h.editingDuration)||30},{thinkingTime:B,answeringTime:G,editingTime:Q}=M;d.useEffect(()=>{T.current=_},[_]);const oe=d.useRef(!1),{speak:qe,stop:de,error:Ye}=lh({onEnd:()=>{oe.current=!1,V()},onError:()=>{oe.current||(oe.current=!0,V())}}),Te=d.useRef(!1),be=d.useRef(!1),{startRecording:kt,stopRecording:dt,transcribe:ge,cancelRecording:Qt,error:Ke}=sh({config:{baseUrl:l,provider:f==null?void 0:f.provider,model:f==null?void 0:f.model,language:f==null?void 0:f.language,authToken:u,qnaId:((Zi=C.current)==null?void 0:Zi.qna_id)||"",interviewId:r},onStart:()=>{Te.current=!1,be.current=!1},onStop:()=>{},onTranscriptionComplete:N=>{p(N.transcript),be.current||(be.current=!0,V())},onError:N=>{console.error("STT Error:",N),Te.current||(Te.current=!0,V())}}),{state:re,startQuestion:Xe,nextPhase:V,completeInterview:ht}=th({config:{thinkingDuration:B,answeringDuration:G,editingDuration:Q},callbacks:{onPhaseChange:N=>{switch(N){case se.FETCHING_QUESTION:j();break;case se.READING_QUESTION:Rt();break;case se.ANSWERING:Jt();break;case se.TRANSCRIBING:Ji();break;case se.SUBMITTING:Dt();break}},onInterviewEnd:()=>{i==null||i()}}});d.useEffect(()=>{Xe()},[]);const{execute:j,loading:J}=rh(async()=>{const N=await c.generateQuestion({interviewId:r});return C.current=N.data,N},{onSuccess:async N=>{N&&N.data&&(p(""),b(N.data),V())},onError:N=>{console.error("Failed to fetch questions:",N)}}),Dt=d.useCallback(async()=>{var N;try{await c.submitAnswer({interviewId:r,qnaId:((N=C.current)==null?void 0:N.qna_id)||"",answer:T.current})}catch(je){console.error("Failed to submit answer:",je)}Xe()},[c,r,Xe]),Rt=d.useCallback(async()=>{var N;if((N=C.current)!=null&&N.question)if(C.current.question_audio_data_base64)try{oe.current=!1,await qe(C.current.question_audio_data_base64),C.current.is_interview_done&&ht()}catch(je){console.error("Failed to speak question:",je),V()}else console.warn("No audio data available for question"),await Vl(2e3),V();else V()},[qe,V,ht]),Jt=d.useCallback(async()=>{try{await kt(G)}catch(N){console.error("Failed to start recording:",N),V()}},[kt,V]),Ji=d.useCallback(async()=>{try{const N=await dt();await ge(N)}catch(N){console.error("STT processing failed:",N),!Te.current&&!be.current&&(Te.current=!0,V())}},[dt,ge,V]),Zt=d.useCallback(async N=>{var je,rt;de(),Qt(),a&&"current"in a&&((je=a.current)==null||je.stopCamera()),await((rt=m.current)==null?void 0:rt.exitFullScreenIntentionally());try{await c.exitInterview(r)}catch(en){console.error("API call failed:",en)}finally{N==null||N(),ht(),sessionStorage.removeItem(sn)}},[r,de,c]),Qr=()=>{const{phase:N}=re;switch(N){case se.IDLE:return o.jsxs("div",{className:"iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full",children:[o.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Ready to start the Interview?"}),o.jsx("p",{className:"iw-max-w-xl iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:`You will be asked a series of behavioral and technical questions. For each one you'll get a short thinking period, then a timed recording window. We'll transcribe your response so you can review and edit it before submitting. Click "Start Interview" when you're ready.`}),o.jsx(Qe,{onClick:Xe,className:"iw-mt-2 iw-w-40",children:"Start Interview"})]});case se.FETCHING_QUESTION:return o.jsx(bh,{});case se.READING_QUESTION:return o.jsx(_h,{ttsError:Ye});case se.THINKING:return o.jsx(kh,{state:re,thinkingTime:B,nextPhase:V});case se.ANSWERING:return o.jsx(yh,{state:re,answeringTime:G,nextPhase:V,sttError:Ke});case se.TRANSCRIBING:return o.jsx(Eh,{sttError:Ke,editingDuration:Q});case se.EDITING:case se.SUBMITTING:return o.jsx("div",{className:"iw-space-y-4 iw-h-full",children:o.jsx(wh,{value:_,onChange:je=>p(je.target.value),onSubmit:()=>V(),isSubmitDisabled:!_.trim()||J||re.phase===se.SUBMITTING,state:re,editingTime:Q})});case se.COMPLETED:return null;default:return null}};return o.jsx(o.Fragment,{children:w!=null&&w.enabled?o.jsxs(jh,{ref:m,onDisqualify:()=>Zt(n),children:[o.jsx(bl,{title:e,brandName:t,onExit:()=>Zt()}),o.jsx(yl,{currentQuestion:g,phase:re.phase,className:s,interviewId:r,interview_duration:A,videoFeedRef:a,children:Qr()})]}):o.jsxs(o.Fragment,{children:[o.jsx(bl,{title:e,brandName:t,onExit:()=>Zt()}),o.jsx(yl,{currentQuestion:g,phase:re.phase,className:s,interviewId:r,interview_duration:A,videoFeedRef:a,children:Qr()})]})})},qs=({title:e,brandName:t,interviewId:r,onInterviewEnd:i,onInterviewDisqualify:n,className:s=""})=>{const[a,c]=d.useState(!1),[l,u]=d.useState(!0),[h,f]=d.useState(!1),{proctoring:w}=cn(),m=d.useRef(null),g=d.useRef(null),b=(w==null?void 0:w.gazeAnalysisEnabled)===!0,_=()=>{c(!0),u(!1)};return d.useEffect(()=>{if(a&&h&&g.current&&b)try{g.current.setReference()}finally{f(!1)}},[a,h,b]),a?o.jsx("div",{className:"interview-widget-container",children:o.jsx("div",{ref:m,className:`iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${s}`,children:o.jsx("div",{className:"iw-h-full iw-flex iw-flex-col",children:o.jsx(Nh,{interviewTitle:e??"Interview",brandName:t??"Novara",interviewId:r,className:s,onComplete:i??(()=>{}),onDisqualify:n,videoFeedRef:g})})})}):o.jsx("div",{className:"interview-widget-container",children:o.jsx(Qd,{isOpen:l,gazeEnabled:b,onStart:_,onRequestCalibration:()=>f(!0),videoFeedRef:g,interviewId:r})})};typeof window<"u"&&(window.InterviewWidget={InterviewWidget:qs,InterviewWidgetProvider:to}),we.InterviewWidget=qs,we.InterviewWidgetProvider=to,we.default=qs,Object.defineProperties(we,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
211
+ `})})};function Q8({ttsError:e}){return u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-8 iw-w-full iw-h-full",children:[u.jsx(X8,{size:"80px"}),e&&u.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Audio playback failed: ",e.message]}),u.jsx("p",{className:"iw-text- iw-text-gray-700",children:"Your AI interviewer is speaking..."})]})}const Z8=({state:e,thinkingTime:t,nextPhase:n})=>u.jsxs("div",{className:"iw-flex iw-flex-col iw-gap-6 iw-items-center iw-justify-center iw-text-center iw-h-full ",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Get Ready to Answer"}),u.jsx("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:"After 30-seconds thinking time, recording will start automatically, or you can begin recording early by clicking the button below."})]}),u.jsxs("div",{className:"iw-flex iw-items-center iw-justify-center iw-gap-2",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-1",children:[u.jsx(s1,{className:"iw-size-4 iw-text-orange-600"}),u.jsx("p",{className:"iw-text-gray-700 iw-text-sm",children:"Time to think: "})]}),u.jsx(ko,{total:t,remaining:e.currentPhaseTimeRemaining,size:50,strokeWidth:4})]}),u.jsx("div",{className:"iw-w-full iw-grid iw-grid-cols-1",children:u.jsx(Ss,{onClick:()=>{n()},children:"Start Answering"})})]}),K8=({sttError:e,editingDuration:t})=>u.jsxs("div",{className:"iw-flex iw-flex-col iw-items-center iw-justify-center iw-h-full",children:[u.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 60 60",fill:"none",children:[u.jsx("rect",{width:60,height:60,rx:30,fill:"url(#prefix__paint0_linear_1460_12482)"}),u.jsx("path",{d:"M28.127 14c.276 7.685 6.442 13.851 14.127 14.127-7.684.276-13.85 6.442-14.127 14.127-.275-7.685-6.442-13.851-14.126-14.127 7.684-.276 13.85-6.442 14.126-14.127zM38.937 31.873A7.331 7.331 0 0046 38.937 7.331 7.331 0 0038.937 46a7.331 7.331 0 00-7.064-7.063 7.331 7.331 0 007.064-7.064z",fill:"#fff"}),u.jsx("defs",{children:u.jsxs("linearGradient",{id:"prefix__paint0_linear_1460_12482",x1:30,y1:-6.563,x2:77.813,y2:54.375,gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{offset:.211,stopColor:"#5C92FA"}),u.jsx("stop",{offset:1,stopColor:"#A75FFD"})]})})]}),u.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1 iw-mt-3",children:"Just a moment... We're analyzing your response"}),u.jsxs("p",{className:"iw-max-w-lg iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:["After transcription, you'll have ",t||30," sec to review your answer."]}),e&&u.jsxs("div",{className:"iw-mt-2 iw-text-xs iw-text-red-600",children:["Transcription error: ",e.message,e.recoverable&&" (attempting to continue)"]})]}),Lo=5;function I8({isOpen:e,onClose:t,warningCount:n,violationType:i,onDisqualify:a}){const[l,s]=y.useState(10),r=y.useRef(t);if(y.useEffect(()=>{r.current=t},[t]),y.useEffect(()=>{if(!e)return;const d=setInterval(()=>{s(m=>m<=1?(r.current(),10):m-1)},1e3);return()=>clearInterval(d)},[e]),y.useEffect(()=>{e&&s(10)},[e]),y.useEffect(()=>(e?(document.body.style.overflow="hidden",document.body.classList.add("interview-widget-container")):(document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")),()=>{document.body.style.overflow="unset",document.body.classList.remove("interview-widget-container")}),[e]),!e)return null;const c=(()=>{switch(i){case"tab_switch":return{title:"Tab Switch Detected",description:"You attempted to switch to another tab or reload application.",icon:u.jsx(u1,{className:"iw-h-5 iw-w-5"})};case"fullscreen_exit":return{title:"Full Screen Exit Detected",description:"You attempted to exit full screen mode.",icon:u.jsx(v6,{className:"iw-h-5 iw-w-5"})};case"focus_loss":return{title:"Focus Loss Detected",description:"You lost focus from the interview window.",icon:u.jsx(g6,{className:"iw-h-5 iw-w-5"})};case"blocked_shortcut":return{title:"Keyboard Shortcut Blocked",description:"You attempted to use a blocked keyboard shortcut.",icon:u.jsx(Jo,{className:"iw-h-5 iw-w-5"})};case"right_click_attempt":return{title:"Right Click Attempted",description:"You attempted to use the right click.",icon:u.jsx(b6,{className:"iw-h-5 iw-w-5"})};case"alt_tab_attempt":return{title:"Alt + Tab Attempted",description:"You attempted to use the Alt + Tab shortcut.",icon:u.jsx(Jo,{className:"iw-h-5 iw-w-5"})};case"blocked_function_key":return{title:"Function Key Blocked",description:"You attempted to use a blocked function key.",icon:u.jsx(Jo,{className:"iw-h-5 iw-w-5"})};default:return{title:"Violation Detected",description:"You attempted to perform an action that is not allowed.",icon:u.jsx(es,{className:"iw-h-5 iw-w-5"})}}})(),f=Lo-n,h=()=>{n+1>Lo?a():t()};return u.jsx("div",{className:"iw-fixed iw-inset-0 iw-z-50 iw-flex iw-items-center iw-justify-center iw-bg-black/60 iw-p-4 iw-backdrop-blur-sm",children:u.jsxs("div",{className:"iw-w-full iw-max-w-md iw-rounded-2xl iw-border iw-border-gray-100 iw-bg-white iw-shadow-xl",children:[u.jsxs("div",{className:"iw-p-6 iw-pb-0",children:[u.jsxs("div",{className:"iw-mb-6 iw-flex iw-items-start iw-gap-4",children:[u.jsx("div",{className:"iw-flex iw-h-12 iw-w-12 iw-flex-shrink-0 iw-items-center iw-justify-center iw-rounded-2xl iw-bg-red-50",children:u.jsx(es,{className:"iw-h-6 iw-w-6 iw-text-red-500"})}),u.jsxs("div",{className:"iw-flex-1",children:[u.jsx("h2",{className:"iw-mb-1 iw-text-xl iw-font-semibold iw-text-gray-900",children:"Security Violation"}),u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[u.jsx("span",{className:"iw-text-sm iw-text-gray-500",children:"Warning"}),u.jsx("div",{className:"iw-flex iw-gap-1",children:Array.from({length:Lo}).map((d,m)=>u.jsx("div",{className:`iw-h-2 iw-w-2 iw-rounded-full ${m<=n-1?"iw-bg-red-500":"iw-bg-gray-200"}`},m))}),u.jsxs("span",{className:"iw-text-sm iw-text-gray-500",children:["(",n,"/",Lo,")"]})]})]})]}),u.jsx("div",{className:"iw-mb-5 iw-rounded-2xl iw-border iw-border-red-100 iw-p-5",style:{background:"linear-gradient(to right, rgb(254, 242, 242), rgb(254, 245, 235))",borderColor:"rgb(254, 226, 226)"},children:u.jsxs("div",{className:"iw-flex iw-items-start iw-gap-4",children:[u.jsx("div",{className:"iw-flex iw-h-10 iw-w-10 iw-items-center iw-justify-center iw-rounded-xl iw-bg-white iw-shadow-sm",children:c.icon}),u.jsxs("div",{className:"iw-flex-1",children:[u.jsx("h3",{className:"iw-mb-2 iw-font-semibold iw-text-gray-900",children:c.title}),u.jsx("p",{className:"iw-text-sm iw-leading-relaxed iw-text-gray-700",children:c.description}),u.jsxs("div",{className:"iw-mt-3 iw-flex iw-items-center iw-gap-2 iw-text-xs iw-text-red-600",children:[u.jsx(x6,{className:"iw-h-3 iw-w-3"}),u.jsx("span",{children:"This action is monitored for interview integrity"})]})]})]})}),u.jsxs("div",{className:"iw-mb-5 iw-grid iw-grid-cols-2 iw-gap-3",children:[u.jsx("div",{className:"iw-rounded-xl iw-border iw-border-amber-200 iw-bg-amber-50 iw-p-4",children:u.jsxs("div",{className:"iw-text-center",children:[u.jsx("div",{className:"iw-mb-1 iw-text-2xl iw-font-bold iw-text-amber-600",children:f}),u.jsx("div",{className:"iw-text-xs iw-font-medium iw-text-amber-700",children:"Warnings Left"})]})}),u.jsx("div",{className:"iw-border-primary-100 iw-bg-primary-50 iw-rounded-xl iw-border iw-p-4",children:u.jsxs("div",{className:"iw-text-center",children:[u.jsxs("div",{className:"iw-mb-1 iw-flex iw-items-center iw-justify-center iw-gap-1.5",children:[u.jsx(m6,{className:"iw-text-primary-600 iw-h-4 iw-w-4"}),u.jsx("span",{className:"iw-text-primary-600 iw-text-2xl iw-font-bold",children:l})]}),u.jsx("div",{className:"iw-text-primary-700 iw-text-xs iw-font-medium",children:"Auto Close"})]})})]}),f===1&&u.jsx("div",{className:"iw-mb-5 iw-rounded-2xl iw-p-4 iw-text-white",style:{background:"linear-gradient(to right, rgba(220, 38, 38, 0.9), rgba(239, 68, 68, 0.9))"},children:u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-3",children:[u.jsx("div",{className:"iw-flex iw-h-8 iw-w-8 iw-items-center iw-justify-center iw-rounded-full iw-bg-white/20",children:u.jsx(es,{className:"iw-h-4 iw-w-4"})}),u.jsxs("div",{children:[u.jsx("div",{className:"iw-text-sm iw-font-semibold",children:"Final Warning"}),u.jsx("div",{className:"iw-text-xs iw-text-red-100",children:"Next violation will disqualify you from this interview"})]})]})})]}),u.jsxs("div",{className:"iw-p-6 iw-pt-0",children:[u.jsx(Ss,{onClick:h,className:"iw-h-12 iw-w-full iw-rounded-xl iw-bg-gray-800 iw-text-sm iw-font-medium iw-text-white iw-hover:bg-gray-800",children:"I Understand - Continue Interview"}),u.jsx("p",{className:"iw-text-gray-500 iw-mt-3 iw-text-center iw-text-xs",children:"Please maintain focus and avoid switching tabs, exiting fullscreen, using shortcuts or right-clicking."})]})]})})}const J8=e=>u.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:[u.jsx("path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z"}),u.jsx("circle",{cx:"12",cy:"12",r:"10"})]}),W8=({showHardReloadWarning:e,onContinue:t})=>{const n=()=>{t()};return u.jsxs(Sf,{isOpen:e,onClose:n,closeOnOverlayClick:!1,closeOnEscape:!1,showCloseButton:!1,className:"iw-max-w-lg iw-px-2 iw-rounded-xl",children:[u.jsx("div",{className:"iw-absolute iw-inset-x-0 iw-top-0 iw-h-1 iw-bg-gradient-to-r iw-from-red-500 iw-to-red-600"}),u.jsx("div",{className:"iw-space-y-1 iw-pb-2 iw-pt-3",children:u.jsxs("div",{className:"iw-flex iw-items-center iw-gap-2",children:[u.jsx(es,{className:"iw-w-5 iw-h-5 iw-text-red-500"}),u.jsx("h3",{className:"iw-text-xl iw-font-semibold iw-text-red-500",children:"Full Screen Exit Detected"})]})}),u.jsx("div",{className:"iw-pt-4 iw-pb-6",children:u.jsx("p",{className:"iw-text-center iw-text-sm iw-leading-relaxed iw-text-gray-500/90",children:"Exiting full screen mode or reloading this page during the session is strictly prohibited. Any attempt to do so will be recorded and may lead to penalties."})}),u.jsx("div",{className:"iw-pt-2 iw-pb-4",children:u.jsxs("button",{onClick:n,className:"iw-w-full iw-flex iw-items-center iw-justify-center iw-gap-2 iw-px-4 iw-py-3 iw-bg-gray-100 iw-text-gray-600 iw-rounded-md iw-font-medium iw-transition-colors hover:iw-bg-gray-200 focus:iw-outline-none focus:iw-ring-2 focus:iw-ring-gray-400 focus:iw-ring-offset-2",children:[u.jsx(J8,{className:"iw-size-4"}),"Continue Session"]})})]})},P8=y.forwardRef(({children:e,onDisqualify:t},n)=>{const[i,a]=y.useState(!1),[l,s]=y.useState(!1),[r,o]=y.useState(!1),[c,f]=y.useState("fullscreen_exit"),{logViolation:h,violationCount:d}=Qy({maxViolations:5,onViolation:g=>{l||(a(!0),f(g.type))}}),{enterFullScreen:m,isFullScreen:v,exitFullScreen:x}=Gy({onFullScreenChange(g){!g&&!l&&!r&&(a(!0),h({type:"fullscreen_exit",severity:"high",details:{action:"fullscreen_exit",reason:"Attempted to exit full screen mode"}})),g&&o(!1)}});y.useEffect(()=>{m()},[]),y.useImperativeHandle(n,()=>({exitFullScreenIntentionally:async()=>{o(!0),a(!1),s(!1);try{document.fullscreenElement&&await document.exitFullscreen()}catch(g){console.error("Failed to exit fullscreen:",g)}}}),[]),qy(h),Hy(h),Fy(),Zy();const E=()=>{s(!0),x(),a(!1),t==null||t()};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"iw-relative iw-h-full iw-w-full",children:e}),u.jsx(I8,{warningCount:d,isOpen:i,violationType:c,onClose:()=>{a(!1),m()},onDisqualify:E}),!i&&d>0&&!l&&!r&&u.jsx(W8,{showHardReloadWarning:!v,logViolation:h,onContinue:m})]})}),$8=({interviewTitle:e,brandName:t="Novara",brandLogo:n,interviewId:i,onComplete:a,onDisqualify:l,className:s="",videoFeedRef:r})=>{var Ro;const o=b3(),{baseUrl:c,authToken:f}=a1(),{timers:h,stt:d,proctoring:m}=Ko(),v=y.useRef(null),[x,E]=y.useState(null),[g,w]=y.useState(""),[p,b]=y.useState(null),[A,N]=y.useState(Tr),[_,M]=y.useState(!0),T=y.useRef(""),D=y.useRef(null);y.useEffect(()=>{(async()=>{try{const _e=await o.getInterviewConfig(i);_e!=null&&_e.data&&(_e.data.duration_in_minutes&&N(_e.data.duration_in_minutes),typeof _e.data.allow_answer_editing=="boolean"&&M(_e.data.allow_answer_editing))}catch(_e){console.error("Failed to fetch interview config:",_e)}})()},[i]);const Ee={thinkingTime:(h==null?void 0:h.thinkingDuration)||0,answeringTime:(h==null?void 0:h.answeringDuration)||120,editingTime:_?(h==null?void 0:h.editingDuration)||30:0},{thinkingTime:Re,answeringTime:rt,editingTime:cn}=Ee;y.useEffect(()=>{T.current=g},[g]);const xt=y.useRef(!1),{speak:j,stop:G,error:R}=Xy({onEnd:()=>{xt.current=!1,Ce()},onError:()=>{xt.current||(xt.current=!0,Ce())}}),$=y.useRef(!1),se=y.useRef(!1),{startRecording:ut,stopRecording:bn,transcribe:fn,cancelRecording:Xt,error:ot}=Vy({config:{baseUrl:c,provider:d==null?void 0:d.provider,model:d==null?void 0:d.model,language:d==null?void 0:d.language,authToken:f,qnaId:((Ro=D.current)==null?void 0:Ro.qna_id)||"",interviewId:i},onStart:()=>{$.current=!1,se.current=!1},onStop:()=>{},onTranscriptionComplete:V=>{w(V.transcript),se.current||(se.current=!0,Ce())},onError:V=>{console.error("STT Error:",V),$.current||($.current=!0,Ce())}}),{state:ct,startQuestion:dn,nextPhase:Ce,completeInterview:Xi}=By({config:{answeringDuration:rt,editingDuration:cn},callbacks:{onPhaseChange:V=>{switch(V){case K.FETCHING_QUESTION:Il();break;case K.READING_QUESTION:xr();break;case K.ANSWERING:J2();break;case K.TRANSCRIBING:Bo();break;case K.SUBMITTING:br();break}},onInterviewEnd:()=>{a==null||a()}}});y.useEffect(()=>{dn()},[]);const{execute:Il}=Ry(async()=>{const V=await o.generateQuestion({interviewId:i});return D.current=V.data,V},{onSuccess:async V=>{V&&V.data&&(w(""),E(V.data),Ce())},onError:V=>{console.error("Failed to fetch questions:",V)}}),br=y.useCallback(async()=>{var V;try{const _e=T.current,Ca=((V=D.current)==null?void 0:V.qna_id)||"";await o.submitAnswer({interviewId:i,qnaId:Ca,answer:_e}),b({qnaId:Ca,answer:_e})}catch(_e){console.error("Failed to submit answer:",_e)}dn()},[o,i,dn]),xr=y.useCallback(async()=>{var V;if((V=D.current)!=null&&V.question)if(D.current.question_audio_data_base64)try{xt.current=!1,await j(D.current.question_audio_data_base64),D.current.is_interview_done&&Xi()}catch(_e){console.error("Failed to speak question:",_e),Ce()}else console.warn("No audio data available for question"),await u6(2e3),Ce();else Ce()},[j,Ce,Xi]),J2=y.useCallback(async()=>{try{await ut(rt)}catch(V){console.error("Failed to start recording:",V),Ce()}},[ut,Ce]),Bo=y.useCallback(async()=>{try{const V=await bn();await fn(V)}catch(V){console.error("STT processing failed:",V),!$.current&&!se.current&&($.current=!0,Ce())}},[bn,fn,Ce]),Ma=y.useCallback(async V=>{var _e,Ca;G(),Xt(),r&&"current"in r&&((_e=r.current)==null||_e.stopCamera()),await((Ca=v.current)==null?void 0:Ca.exitFullScreenIntentionally());try{await o.exitInterview(i)}catch(Go){console.error("API call failed:",Go)}finally{V==null||V(),Xi(),sessionStorage.removeItem(Yo)}},[i,G,o]),Sr=()=>{const{phase:V}=ct;switch(V){case K.IDLE:return u.jsxs("div",{className:"iw-text-center iw-flex iw-flex-col iw-items-center iw-justify-center iw-gap-2 iw-h-full",children:[u.jsx("h3",{className:"iw-text-lg iw-font-semibold iw-text-gray-900 iw-mb-1",children:"Ready to start the Interview?"}),u.jsx("p",{className:"iw-max-w-xl iw-text-gray-500 iw-text-xs iw-leading-[21px]",children:`You will be asked a series of behavioral and technical questions. For each one you'll get a short thinking period, then a timed recording window. We'll transcribe your response so you can review and edit it before submitting. Click "Start Interview" when you're ready.`}),u.jsx(Ss,{onClick:dn,className:"iw-mt-2 iw-w-40",children:"Start Interview"})]});case K.FETCHING_QUESTION:return u.jsx(Y8,{});case K.READING_QUESTION:return u.jsx(Q8,{ttsError:R});case K.THINKING:return u.jsx(Z8,{state:ct,thinkingTime:Re,nextPhase:Ce});case K.ANSWERING:return u.jsx(F8,{state:ct,answeringTime:rt,nextPhase:Ce,sttError:ot});case K.TRANSCRIBING:return u.jsx(K8,{sttError:ot,editingDuration:cn});case K.EDITING:case K.SUBMITTING:return null;case K.COMPLETED:return null;default:return null}};return u.jsx(u.Fragment,{children:m!=null&&m.enabled?u.jsxs(P8,{ref:v,onDisqualify:()=>Ma(l),children:[u.jsx(Hw,{title:e,brandName:t,brandLogo:n,totalDuration:A,elapsedTime:ct.totalTimeElapsed,onExit:()=>Ma()}),u.jsx(Gw,{brandName:t,currentQuestion:x,state:ct,phase:ct.phase,className:s,interviewId:i,interview_duration:A,videoFeedRef:r,lastSubmittedAnswer:p,onNextPhase:Ce,answerText:g,onAnswerChange:V=>w(V.target.value),editingTime:cn,answeringTime:rt,children:Sr()})]}):u.jsxs(u.Fragment,{children:[u.jsx(Hw,{title:e,brandName:t,brandLogo:n,totalDuration:A,elapsedTime:ct.totalTimeElapsed,onExit:()=>Ma()}),u.jsx(Gw,{brandName:t,currentQuestion:x,state:ct,phase:ct.phase,className:s,interviewId:i,interview_duration:A,videoFeedRef:r,lastSubmittedAnswer:p,onNextPhase:Ce,answerText:g,onAnswerChange:V=>w(V.target.value),editingTime:cn,answeringTime:rt,children:Sr()})]})})},Uo=({title:e,brandName:t,brandLogo:n,interviewId:i,onInterviewEnd:a,onInterviewDisqualify:l,className:s=""})=>{const{baseColor:r}=$l(),[o,c]=y.useState(!1),[f,h]=y.useState(!0),[d,m]=y.useState(!1),{proctoring:v}=Ko(),x=y.useRef(null),E=y.useRef(null),g=(v==null?void 0:v.gazeAnalysisEnabled)===!0,w=()=>{c(!0),h(!1)};return y.useEffect(()=>{if(o&&d&&E.current&&g)try{E.current.setReference()}finally{m(!1)}},[o,d,g]),o?u.jsx("div",{className:"interview-widget-container",children:u.jsx("div",{ref:x,className:`iw-flex iw-flex-col iw-rounded-xl iw-shadow-lg iw-overflow-hidden iw-h-[calc(100vh-1rem)] ${s}`,children:u.jsx("div",{className:"iw-h-[calc(100vh-1rem)] iw-flex iw-flex-col iw-justify-between gap-1",children:u.jsx($8,{interviewTitle:e??"Interview",brandName:t??"Novara",brandLogo:n,interviewId:i,className:s,onComplete:a??(()=>{}),onDisqualify:l,videoFeedRef:E})})})}):u.jsxs("div",{className:"interview-widget-container",children:[u.jsxs("div",{className:"iw-flex iw-items-center iw-space-x-2 iw-mx-auto iw-p-2 iw-max-w-[1800px]",children:[n||u.jsx("div",{className:"iw-h-7 iw-w-7 iw-rounded-md iw-flex iw-items-center iw-justify-center iw-text-white iw-font-semibold",style:{backgroundColor:r},children:l1(t)}),u.jsx("p",{className:"iw-text-xl iw-font-semibold",children:t})]}),u.jsx(Ly,{isOpen:f,gazeEnabled:g,onStart:w,onRequestCalibration:()=>m(!0),videoFeedRef:E,interviewId:i})]})};typeof window<"u"&&(window.InterviewWidget={InterviewWidget:Uo,InterviewWidgetProvider:Zo}),it.InterviewWidget=Uo,it.InterviewWidgetProvider=Zo,it.default=Uo,Object.defineProperties(it,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});