@moveo-ai/web-client 0.136.0 → 0.138.0

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 (48) hide show
  1. package/dist/752.min.js.LICENSE.txt +1 -1
  2. package/dist/882.min.js.LICENSE.txt +1 -1
  3. package/dist/929.min.js.LICENSE.txt +1 -1
  4. package/dist/audio-client.min.js +1 -1
  5. package/dist/audio-client.min.js.LICENSE.txt +1 -1
  6. package/dist/continue/index.html +1 -1
  7. package/dist/continue.min.js +1 -1
  8. package/dist/continue.min.js.LICENSE.txt +1 -1
  9. package/dist/iframe.min.js +1 -1
  10. package/dist/iframe.min.js.LICENSE.txt +1 -1
  11. package/dist/index.html +1 -1
  12. package/dist/preview/index.html +1 -1
  13. package/dist/preview-audio/index.html +1 -1
  14. package/dist/preview-telnyx/index.html +1 -1
  15. package/dist/preview-webrtc/index.html +1 -1
  16. package/dist/preview.css.min.js.LICENSE.txt +1 -1
  17. package/dist/public/locales/ar.json +3 -2
  18. package/dist/public/locales/bg.json +4 -3
  19. package/dist/public/locales/cs.json +4 -3
  20. package/dist/public/locales/da.json +4 -3
  21. package/dist/public/locales/de.json +4 -3
  22. package/dist/public/locales/el.json +4 -3
  23. package/dist/public/locales/en.json +4 -3
  24. package/dist/public/locales/es.json +4 -3
  25. package/dist/public/locales/fr.json +4 -3
  26. package/dist/public/locales/id.json +4 -3
  27. package/dist/public/locales/it.json +4 -3
  28. package/dist/public/locales/ja.json +3 -2
  29. package/dist/public/locales/me.json +4 -3
  30. package/dist/public/locales/nl-be.json +4 -3
  31. package/dist/public/locales/nl.json +4 -3
  32. package/dist/public/locales/pl.json +4 -3
  33. package/dist/public/locales/pt-br.json +4 -3
  34. package/dist/public/locales/pt.json +4 -3
  35. package/dist/public/locales/ro.json +4 -3
  36. package/dist/public/locales/ru.json +4 -3
  37. package/dist/public/locales/sq.json +4 -3
  38. package/dist/public/locales/sr.json +4 -3
  39. package/dist/public/locales/sv.json +4 -3
  40. package/dist/public/locales/tl.json +4 -3
  41. package/dist/public/locales/tr.json +4 -3
  42. package/dist/public/locales/zh.json +3 -2
  43. package/dist/telnyx-client.min.js +1 -1
  44. package/dist/telnyx-client.min.js.LICENSE.txt +1 -1
  45. package/dist/web-client.min.js.LICENSE.txt +1 -1
  46. package/dist/webrtc-client.min.js +1 -1
  47. package/dist/webrtc-client.min.js.LICENSE.txt +1 -1
  48. package/package.json +4 -3
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see telnyx-client.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("MoveoTelnyx",[],t):"object"==typeof exports?exports.MoveoTelnyx=t():e.MoveoTelnyx=t()}(this,()=>(()=>{var e={511(e,t,n){"use strict";var i=n(601),r=n.n(i),o=n(314),a=n.n(o)()(r());a.push([e.id,"@import url(https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap);"]),a.push([e.id,'/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-green-50:oklch(98.2% .018 155.826);--color-green-300:oklch(87.1% .15 154.449);--color-green-700:oklch(52.7% .154 150.069);--color-green-950:oklch(26.6% .065 152.934);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-950:oklch(26.2% .051 172.552);--color-sky-50:oklch(97.7% .013 236.62);--color-sky-100:oklch(95.1% .026 236.824);--color-sky-200:oklch(90.1% .058 230.902);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-sky-600:oklch(58.8% .158 241.966);--color-sky-700:oklch(50% .134 242.749);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-600:oklch(55.8% .288 302.321);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xs:16rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-2xl:42rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:Inter, system-ui, -apple-system, sans-serif}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.\\!visible{visibility:visible!important}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-\\[-4px\\]{inset:-4px}.inset-x-0{inset-inline:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.inset-x-6{inset-inline:calc(var(--spacing) * 6)}.inset-x-\\[92px\\]{inset-inline:92px}.inset-y-0{inset-block:0}.-top-2{top:calc(var(--spacing) * -2)}.-top-4{top:calc(var(--spacing) * -4)}.-top-14{top:calc(var(--spacing) * -14)}.-top-\\[28px\\]{top:-28px}.top-\\(--moveo-header-height\\){top:var(--moveo-header-height)}.top-0{top:0}.top-1\\.5{top:calc(var(--spacing) * 1.5)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-\\[50\\%\\]{top:50%}.top-\\[62px\\]{top:62px}.-right-2{right:calc(var(--spacing) * -2)}.right-0{right:0}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-1\\.5{right:calc(var(--spacing) * 1.5)}.right-2{right:calc(var(--spacing) * 2)}.right-2\\.5{right:calc(var(--spacing) * 2.5)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.right-auto{right:auto}.bottom-0{bottom:0}.bottom-0\\.5{bottom:calc(var(--spacing) * .5)}.bottom-1\\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-16{bottom:calc(var(--spacing) * 16)}.bottom-\\[calc\\(100\\%\\+40px\\)\\]{bottom:calc(100% + 40px)}.bottom-full{bottom:100%}.-left-2{left:calc(var(--spacing) * -2)}.left-0{left:0}.left-1\\.5{left:calc(var(--spacing) * 1.5)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.left-\\[50\\%\\]{left:50%}.isolate{isolation:isolate}.z-0{z-index:0}.z-1{z-index:1}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-1100{z-index:1100}.col-start-1{grid-column-start:1}.row-start-1{grid-row-start:1}.clear-both{clear:both}.\\!container{width:100%!important}@media (min-width:40rem){.\\!container{max-width:40rem!important}}@media (min-width:48rem){.\\!container{max-width:48rem!important}}@media (min-width:64rem){.\\!container{max-width:64rem!important}}@media (min-width:80rem){.\\!container{max-width:80rem!important}}@media (min-width:96rem){.\\!container{max-width:96rem!important}}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.-m-\\[3px\\]{margin:-3px}.m-0{margin:0}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-2\\.5{margin-inline:calc(var(--spacing) * -2.5)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-5{margin-inline:calc(var(--spacing) * 5)}.mx-6{margin-inline:calc(var(--spacing) * 6)}.mx-7{margin-inline:calc(var(--spacing) * 7)}.mx-auto{margin-inline:auto}.-my-1{margin-block:calc(var(--spacing) * -1)}.-my-2{margin-block:calc(var(--spacing) * -2)}.my-0{margin-block:0}.my-1{margin-block:var(--spacing)}.-ms-1{margin-inline-start:calc(var(--spacing) * -1)}.-ms-1\\.5{margin-inline-start:calc(var(--spacing) * -1.5)}.-mt-1\\.5{margin-top:calc(var(--spacing) * -1.5)}.-mt-4{margin-top:calc(var(--spacing) * -4)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mt-\\[5px\\]{margin-top:5px}.mt-\\[10\\%\\]{margin-top:10%}.mt-\\[var\\(--moveo-header-height\\)\\]{margin-top:var(--moveo-header-height)}.mt-auto{margin-top:auto}.-mr-1\\.5{margin-right:calc(var(--spacing) * -1.5)}.-mr-2{margin-right:calc(var(--spacing) * -2)}.mr-1{margin-right:var(--spacing)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-auto{margin-right:auto}.-mb-2{margin-bottom:calc(var(--spacing) * -2)}.mb-0{margin-bottom:0}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-9{margin-bottom:calc(var(--spacing) * 9)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.mb-16{margin-bottom:calc(var(--spacing) * 16)}.mb-20{margin-bottom:calc(var(--spacing) * 20)}.-ml-0\\.5{margin-left:calc(var(--spacing) * -.5)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.-ml-4{margin-left:calc(var(--spacing) * -4)}.ml-0{margin-left:0}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.box-content{box-sizing:content-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.aspect-\\[3\\/2\\]{aspect-ratio:3/2}.aspect-video{aspect-ratio:var(--aspect-video)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.size-\\[9px\\]{width:9px;height:9px}.size-full{width:100%;height:100%}.h-\\(--moveo-chat-height\\){height:var(--moveo-chat-height)}.h-1{height:var(--spacing)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-2\\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-24{height:calc(var(--spacing) * 24)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-45{height:calc(var(--spacing) * 45)}.h-\\[0\\.9em\\]{height:.9em}.h-\\[18px\\]{height:18px}.h-\\[19px\\]{height:19px}.h-\\[26px\\]{height:26px}.h-\\[34px\\]{height:34px}.h-\\[42px\\]{height:42px}.h-\\[44px\\]{height:44px}.h-\\[82px\\]{height:82px}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[222px\\]{height:222px}.h-\\[254px\\]{height:254px}.h-\\[282px\\]{height:282px}.h-\\[300px\\]{height:300px}.h-\\[340px\\]{height:340px}.h-\\[386px\\]{height:386px}.h-\\[560px\\]{height:560px}.h-\\[562px\\]{height:562px}.h-\\[min\\(72\\%\\,calc\\(100\\%_-_var\\(--moveo-header-height\\)_-_16px\\)\\)\\]{height:min(72%, calc(100% - var(--moveo-header-height) - 16px))}.h-\\[min\\(var\\(--moveo-expanded-chat-height\\)\\,var\\(--moveo-chat-max-height\\)\\)\\]{height:min(var(--moveo-expanded-chat-height), var(--moveo-chat-max-height))}.h-\\[var\\(--moveo-chat-height\\)\\]{height:var(--moveo-chat-height)}.h-\\[var\\(--moveo-frame-h\\)\\]{height:var(--moveo-frame-h)}.h-\\[var\\(--moveo-modal-tall-height\\)\\]{height:var(--moveo-modal-tall-height)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-\\(--moveo-chat-max-height\\){max-height:var(--moveo-chat-max-height)}.max-h-\\(--radix-select-content-available-height\\){max-height:var(--radix-select-content-available-height)}.max-h-18{max-height:calc(var(--spacing) * 18)}.max-h-44{max-height:calc(var(--spacing) * 44)}.max-h-\\[40vh\\]{max-height:40vh}.max-h-\\[60vh\\]{max-height:60vh}.max-h-\\[88px\\]{max-height:88px}.max-h-\\[134px\\]{max-height:134px}.max-h-\\[400px\\]{max-height:400px}.max-h-\\[calc\\(100\\%_-_var\\(--moveo-header-height\\)\\)\\]{max-height:calc(100% - var(--moveo-header-height))}.max-h-\\[min\\(460px\\,72vh\\)\\]{max-height:min(460px,72vh)}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.min-h-0{min-height:0}.min-h-8{min-height:calc(var(--spacing) * 8)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-14{min-height:calc(var(--spacing) * 14)}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-\\[72px\\]{min-height:72px}.min-h-\\[120px\\]{min-height:120px}.min-h-\\[190px\\]{min-height:190px}.min-h-screen{min-height:100vh}.w-\\(--moveo-expanded-chat-width\\){width:var(--moveo-expanded-chat-width)}.w-0\\.5{width:calc(var(--spacing) * .5)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-1\\/2{width:50%}.w-2\\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-3\\/4{width:75%}.w-3xs{width:var(--container-3xs)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-20{width:calc(var(--spacing) * 20)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-\\[2px\\]{width:2px}.w-\\[18px\\]{width:18px}.w-\\[19px\\]{width:19px}.w-\\[26px\\]{width:26px}.w-\\[28px\\]{width:28px}.w-\\[42px\\]{width:42px}.w-\\[52px\\]{width:52px}.w-\\[54px\\]{width:54px}.w-\\[75\\%\\]{width:75%}.w-\\[86\\%\\]{width:86%}.w-\\[252px\\]{width:252px}.w-\\[280px\\]{width:280px}.w-\\[360px\\]{width:360px}.w-\\[380px\\]{width:380px}.w-\\[440px\\]{width:440px}.w-\\[510px\\]{width:510px}.w-\\[512px\\]{width:512px}.w-\\[calc\\(100\\%-24px\\)\\]{width:calc(100% - 24px)}.w-\\[calc\\(100\\%-40px\\)\\]{width:calc(100% - 40px)}.w-\\[var\\(--moveo-chat-width\\)\\]{width:var(--moveo-chat-width)}.w-\\[var\\(--moveo-expanded-chat-width\\)\\]{width:var(--moveo-expanded-chat-width)}.w-\\[var\\(--moveo-frame-w\\)\\]{width:var(--moveo-frame-w)}.w-\\[var\\(--moveo-modal-tall-width\\)\\]{width:var(--moveo-modal-tall-width)}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-sm{width:var(--container-sm)}.w-xs{width:var(--container-xs)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-18{max-width:calc(var(--spacing) * 18)}.max-w-56{max-width:calc(var(--spacing) * 56)}.max-w-\\[18rem\\]{max-width:18rem}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[328px\\]{max-width:328px}.max-w-fit{max-width:-moz-fit-content;max-width:fit-content}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-6{min-width:calc(var(--spacing) * 6)}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-20{min-width:calc(var(--spacing) * 20)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[52px\\]{min-width:52px}.min-w-\\[156px\\]{min-width:156px}.min-w-\\[260px\\]{min-width:260px}.min-w-\\[300px\\]{min-width:300px}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.min-w-auto{min-width:auto}.min-w-fit{min-width:-moz-fit-content;min-width:fit-content}.flex-1{flex:1}.flex-initial{flex:0 auto}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-\\[130px\\]{flex-basis:130px}.basis-\\[min\\(336px\\,calc\\(100\\%-32px\\)\\)\\]{flex-basis:min(336px,100% - 32px)}.basis-\\[min\\(400px\\,calc\\(100\\%-32px\\)\\)\\]{flex-basis:min(400px,100% - 32px)}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.origin-\\(--radix-popover-content-transform-origin\\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\\(--radix-select-content-transform-origin\\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\\(--radix-tooltip-content-transform-origin\\){transform-origin:var(--radix-tooltip-content-transform-origin)}.origin-bottom-left{transform-origin:0 100%}.origin-bottom-right{transform-origin:100% 100%}.origin-center{transform-origin:50%}.origin-top-left{transform-origin:0 0}.origin-top-right{transform-origin:100% 0}.-translate-px{--tw-translate-x:-1px;--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-px{--tw-translate-x:1px;--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\[75\\%\\]{--tw-translate-x:75%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\[86\\%\\]{--tw-translate-x:86%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-0\\.5{--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1\\.5{--tw-translate-y:calc(var(--spacing) * 1.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-4{--tw-translate-y:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[0\\.1em\\]{--tw-translate-y:.1em;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-none{translate:none}.scale-50{--tw-scale-x:50%;--tw-scale-y:50%;--tw-scale-z:50%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[busy-pulse_1\\.2s_ease-in-out_infinite\\]{animation:1.2s ease-in-out infinite busy-pulse}.animate-\\[busy-pulse_2s_ease-in-out_infinite\\]{animation:2s ease-in-out infinite busy-pulse}.animate-\\[progress-ring_10s_linear_forwards\\]{animation:10s linear forwards progress-ring}.animate-\\[slide-in-up_0\\.2s_ease-out\\]{animation:.2s ease-out slide-in-up}.animate-\\[teaser-sharpen_420ms_linear_backwards\\]{animation:.42s linear backwards teaser-sharpen}.animate-\\[typing_1\\.2s_ease-in-out_infinite\\]{animation:1.2s ease-in-out infinite typing}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.resize{resize:both}.scroll-my-1{scroll-margin-block:var(--spacing)}.\\[scrollbar-width\\:thin\\]{scrollbar-width:thin}.\\[scrollbar-color\\:rgba\\(0\\,0\\,0\\,0\\.15\\)_transparent\\]{scrollbar-color:#00000026 transparent}.\\[scrollbar-gutter\\:stable_both-edges\\]{scrollbar-gutter:stable both-edges}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;appearance:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\\[36px_16px_36px\\]{grid-template-columns:36px 16px 36px}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-\\[2px\\]{gap:2px}.gap-\\[7px\\]{gap:7px}.gap-px{gap:1px}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-1{-moz-column-gap:var(--spacing);column-gap:var(--spacing)}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-1{row-gap:var(--spacing)}.self-end{align-self:flex-end}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\(--moveo-border-radius-base\\){border-radius:var(--moveo-border-radius-base)}.rounded-\\(--moveo-border-radius-surface\\){border-radius:var(--moveo-border-radius-surface)}.rounded-\\(--panel-radius\\){border-radius:var(--panel-radius)}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[18px\\]{border-radius:18px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--moveo-border-radius-base\\)\\]{border-radius:var(--moveo-border-radius-base)}.rounded-\\[var\\(--moveo-border-radius-surface\\)\\]{border-radius:var(--moveo-border-radius-surface)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.rounded-br-md{border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\(--color-options-border\\){border-color:var(--color-options-border)}.border-emerald-200\\/60{border-color:#a4f4cf99}@supports (color:color-mix(in lab, red, red)){.border-emerald-200\\/60{border-color:color-mix(in oklab, var(--color-emerald-200) 60%, transparent)}}.border-emerald-500\\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab, red, red)){.border-emerald-500\\/20{border-color:color-mix(in oklab, var(--color-emerald-500) 20%, transparent)}}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-700{border-color:var(--color-gray-700)}.border-rose-200\\/60{border-color:#ffccd399}@supports (color:color-mix(in lab, red, red)){.border-rose-200\\/60{border-color:color-mix(in oklab, var(--color-rose-200) 60%, transparent)}}.border-sky-200\\/60{border-color:#b8e6fe99}@supports (color:color-mix(in lab, red, red)){.border-sky-200\\/60{border-color:color-mix(in oklab, var(--color-sky-200) 60%, transparent)}}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\\/80{border-color:#e2e8f0cc}@supports (color:color-mix(in lab, red, red)){.border-slate-200\\/80{border-color:color-mix(in oklab, var(--color-slate-200) 80%, transparent)}}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-white\\/90{border-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.border-white\\/90{border-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.border-t-rose-400\\/60{border-top-color:#ff667f99}@supports (color:color-mix(in lab, red, red)){.border-t-rose-400\\/60{border-top-color:color-mix(in oklab, var(--color-rose-400) 60%, transparent)}}.border-t-sky-400\\/60{border-top-color:#00bcfe99}@supports (color:color-mix(in lab, red, red)){.border-t-sky-400\\/60{border-top-color:color-mix(in oklab, var(--color-sky-400) 60%, transparent)}}.border-t-sky-500\\/60{border-top-color:#00a5ef99}@supports (color:color-mix(in lab, red, red)){.border-t-sky-500\\/60{border-top-color:color-mix(in oklab, var(--color-sky-500) 60%, transparent)}}.border-t-transparent{border-top-color:#0000}.border-r-rose-300\\/30{border-right-color:#ffa2ae4d}@supports (color:color-mix(in lab, red, red)){.border-r-rose-300\\/30{border-right-color:color-mix(in oklab, var(--color-rose-300) 30%, transparent)}}.border-r-sky-300\\/30{border-right-color:#77d4ff4d}@supports (color:color-mix(in lab, red, red)){.border-r-sky-300\\/30{border-right-color:color-mix(in oklab, var(--color-sky-300) 30%, transparent)}}.border-r-sky-400\\/30{border-right-color:#00bcfe4d}@supports (color:color-mix(in lab, red, red)){.border-r-sky-400\\/30{border-right-color:color-mix(in oklab, var(--color-sky-400) 30%, transparent)}}.border-b-transparent{border-bottom-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-\\(--color-accent\\){background-color:var(--color-accent)}.bg-\\(--color-launcher-background\\,var\\(--color-accent\\)\\){background-color:var(--color-launcher-background,var(--color-accent))}.bg-\\(--color-opening-message-background\\,var\\(--color-accent\\)\\){background-color:var(--color-opening-message-background,var(--color-accent))}.bg-\\(--color-options-background\\){background-color:var(--color-options-background)}.bg-\\(--color-rating-background\\){background-color:var(--color-rating-background)}.bg-\\(--color-send-icon\\){background-color:var(--color-send-icon)}.bg-\\[var\\(--background\\)\\]{background-color:var(--background)}.bg-\\[var\\(--color-successful\\)\\]{background-color:var(--color-successful)}.bg-\\[var\\(--moveo-header-background\\)\\]{background-color:var(--moveo-header-background)}.bg-\\[var\\(--moveo-header-background\\,var\\(--color-accent\\)\\)\\]{background-color:var(--moveo-header-background,var(--color-accent))}.bg-\\[var\\(--nbg-bg\\)\\]{background-color:var(--nbg-bg)}.bg-\\[var\\(--text-03\\)\\]{background-color:var(--text-03)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-100\\/90{background-color:#fef3c6e6}@supports (color:color-mix(in lab, red, red)){.bg-amber-100\\/90{background-color:color-mix(in oklab, var(--color-amber-100) 90%, transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-black\\/55{background-color:#0000008c}@supports (color:color-mix(in lab, red, red)){.bg-black\\/55{background-color:color-mix(in oklab, var(--color-black) 55%, transparent)}}.bg-current{background-color:currentColor}.bg-emerald-50\\/80{background-color:#ecfdf5cc}@supports (color:color-mix(in lab, red, red)){.bg-emerald-50\\/80{background-color:color-mix(in oklab, var(--color-emerald-50) 80%, transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-green-50{background-color:var(--color-green-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-rose-50\\/80{background-color:#fff1f2cc}@supports (color:color-mix(in lab, red, red)){.bg-rose-50\\/80{background-color:color-mix(in oklab, var(--color-rose-50) 80%, transparent)}}.bg-sky-50\\/80{background-color:#f0f9ffcc}@supports (color:color-mix(in lab, red, red)){.bg-sky-50\\/80{background-color:color-mix(in oklab, var(--color-sky-50) 80%, transparent)}}.bg-sky-100{background-color:var(--color-sky-100)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-400{background-color:var(--color-slate-400)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab, red, red)){.bg-white\\/80{background-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.bg-white\\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\\/90{background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-emerald-500{--tw-gradient-from:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-600{--tw-gradient-to:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-contain{background-size:contain}.bg-right{background-position:100%}.bg-no-repeat{background-repeat:no-repeat}.fill-\\(--color-launcher-background\\,var\\(--color-accent\\)\\){fill:var(--color-launcher-background,var(--color-accent))}.fill-\\(--color-launcher-foreground\\,var\\(--color-background\\)\\){fill:var(--color-launcher-foreground,var(--color-background))}.fill-sky-600{fill:var(--color-sky-600)}.fill-white{fill:var(--color-white)}.stroke-\\(--color-launcher-foreground\\,var\\(--color-background\\)\\){stroke:var(--color-launcher-foreground,var(--color-background))}.stroke-\\[var\\(--color-accent\\)\\]{stroke:var(--color-accent)}.stroke-\\[var\\(--color-border\\)\\]{stroke:var(--color-border)}.stroke-\\[var\\(--color-successful\\)\\]{stroke:var(--color-successful)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-20{padding:calc(var(--spacing) * 20)}.p-\\[10\\%\\]{padding:10%}.p-px{padding:1px}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-\\[18px\\]{padding-inline:18px}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-\\[11px\\]{padding-block:11px}.py-px{padding-block:1px}.pe-2\\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-\\[66px\\]{padding-top:66px}.pt-\\[92px\\]{padding-top:92px}.pt-\\[var\\(--moveo-header-height\\)\\]{padding-top:var(--moveo-header-height)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pb-0{padding-bottom:0}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-10{padding-bottom:calc(var(--spacing) * 10)}.pb-14{padding-bottom:calc(var(--spacing) * 14)}.pb-24{padding-bottom:calc(var(--spacing) * 24)}.pb-32{padding-bottom:calc(var(--spacing) * 32)}.pl-0{padding-left:0}.pl-1{padding-left:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:Inter,system-ui,-apple-system,sans-serif}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[0\\.65rem\\]{font-size:.65rem}.text-\\[10\\.5px\\]{font-size:10.5px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[42px\\]{font-size:42px}.text-\\[length\\:var\\(--font-size-brain-message\\)\\]{font-size:var(--font-size-brain-message)}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.leading-8{--tw-leading:calc(var(--spacing) * 8);line-height:calc(var(--spacing) * 8)}.leading-\\[18px\\]{--tw-leading:18px;line-height:18px}.leading-\\[30px\\]{--tw-leading:30px;line-height:30px}.leading-\\[51px\\]{--tw-leading:51px;line-height:51px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.25em\\]{--tw-tracking:.25em;letter-spacing:.25em}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.wrap-anywhere{overflow-wrap:anywhere}.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-\\(--color-accent\\){color:var(--color-accent)}.text-\\(--color-launcher-foreground\\,var\\(--color-background\\)\\){color:var(--color-launcher-foreground,var(--color-background))}.text-\\(--color-link\\){color:var(--color-link)}.text-\\(--color-opening-message-foreground\\,var\\(--color-text-primary-foreground\\)\\){color:var(--color-opening-message-foreground,var(--color-text-primary-foreground))}.text-\\(--color-send-icon\\){color:var(--color-send-icon)}.text-\\(--color-text-primary-foreground\\){color:var(--color-text-primary-foreground)}.text-\\[var\\(--color-link\\)\\]{color:var(--color-link)}.text-\\[var\\(--moveo-accent-color\\)\\]{color:var(--moveo-accent-color)}.text-\\[var\\(--moveo-header-text-color\\,var\\(--color-accent\\)\\)\\]{color:var(--moveo-header-text-color,var(--color-accent))}.text-\\[var\\(--moveo-header-text-color\\,var\\(--color-element-primary-foreground\\)\\)\\]{color:var(--moveo-header-text-color,var(--color-element-primary-foreground))}.text-\\[var\\(--moveo-header-text-color\\,var\\(--color-foreground\\)\\)\\]{color:var(--moveo-header-text-color,var(--color-foreground))}.text-\\[var\\(--moveo-header-text-color\\,var\\(--color-text-primary-foreground\\)\\)\\]{color:var(--moveo-header-text-color,var(--color-text-primary-foreground))}.text-\\[var\\(--moveo-header-text-color\\,white\\)\\]{color:var(--moveo-header-text-color,white)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-current{color:currentColor}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-800{color:var(--color-gray-800)}.text-green-700{color:var(--color-green-700)}.text-inherit{color:inherit}.text-moveo-primary{color:#1b66d6}.text-rose-500{color:var(--color-rose-500)}.text-rose-600{color:var(--color-rose-600)}.text-sky-500{color:var(--color-sky-500)}.text-sky-600{color:var(--color-sky-600)}.text-sky-700{color:var(--color-sky-700)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_1px_2px_rgba\\(16\\,24\\,40\\,0\\.05\\)\\,0_6px_16px_-8px_rgba\\(16\\,24\\,40\\,0\\.18\\)\\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#1018280d), 0 6px 16px -8px var(--tw-shadow-color,#1018282e);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_1px_2px_rgba\\(16\\,24\\,40\\,0\\.05\\)\\,0_18px_36px_-12px_rgba\\(16\\,24\\,40\\,0\\.28\\)\\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#1018280d), 0 18px 36px -12px var(--tw-shadow-color,#10182847);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,0\\.15\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(14\\,165\\,233\\,0\\.12\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0ea5e91f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(16\\,185\\,129\\,0\\.15\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#10b98126);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(244\\,63\\,94\\,0\\.12\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#f43f5e1f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_4px_14px_rgba\\(16\\,185\\,129\\,0\\.25\\)\\]{--tw-shadow:0 4px 14px var(--tw-shadow-color,#10b98140);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[2px_3px_6px_rgb\\(104_104_104\\/10\\%\\)\\]{--tw-shadow:2px 3px 6px var(--tw-shadow-color,#6868681a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[var\\(--moveo-shadow-bubble\\)\\]{--tw-shadow:var(--moveo-shadow-bubble);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-amber-200\\/70{--tw-shadow-color:#fee685b3}@supports (color:color-mix(in lab, red, red)){.shadow-amber-200\\/70{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-amber-200) 70%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-amber-300{--tw-ring-color:var(--color-amber-300)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\\[6px\\]{--tw-blur:blur(6px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-sm{--tw-blur:blur(var(--blur-sm));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-xl{--tw-blur:blur(var(--blur-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\\[20px\\]{--tw-backdrop-blur:blur(20px);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-saturate-150{--tw-backdrop-saturate:saturate(150%);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-saturate-\\[1\\.4\\]{--tw-backdrop-saturate:saturate(1.4);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background-color\\,border-color\\,color\\]{transition-property:background-color,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background-color\\,scale\\]{transition-property:background-color,scale;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[border-color\\]{transition-property:border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,display\\]{transition-property:opacity,display;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,rotate\\,scale\\]{transition-property:opacity,rotate,scale;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,transform\\,filter\\]{transition-property:opacity,transform,filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[stroke-dashoffset\\,stroke\\]{transition-property:stroke-dashoffset,stroke;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,height\\,opacity\\]{transition-property:transform,height,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,height\\]{transition-property:width,height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.transition-discrete{transition-behavior:allow-discrete}.duration-\\(--moveo-expand-duration\\){--tw-duration:var(--moveo-expand-duration);transition-duration:var(--moveo-expand-duration)}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-250{--tw-duration:.25s;transition-duration:.25s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-2000{--tw-duration:2s;transition-duration:2s}.duration-\\[240ms\\]{--tw-duration:.24s;transition-duration:.24s}.duration-\\[340ms\\]{--tw-duration:.34s;transition-duration:.34s}.ease-\\[cubic-bezier\\(\\.32\\,\\.72\\,0\\,1\\)\\]{--tw-ease:cubic-bezier(.32,.72,0,1);transition-timing-function:cubic-bezier(.32,.72,0,1)}.ease-\\[cubic-bezier\\(\\.34\\,1\\.23\\,\\.5\\,1\\)\\]{--tw-ease:cubic-bezier(.34,1.23,.5,1);transition-timing-function:cubic-bezier(.34,1.23,.5,1)}.ease-\\[cubic-bezier\\(0\\.2\\,0\\.8\\,0\\.2\\,1\\)\\]{--tw-ease:cubic-bezier(.2,.8,.2,1);transition-timing-function:cubic-bezier(.2,.8,.2,1)}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-transform{will-change:transform}.outline-none{--tw-outline-style:none;outline-style:none}.outline-solid{--tw-outline-style:solid;outline-style:solid}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.\\[--moveo-chat-max-height\\:calc\\(100vh-16px\\)\\]{--moveo-chat-max-height:calc(100vh - 16px)}.\\[--moveo-chat-max-height\\:calc\\(100vh-74px\\)\\]{--moveo-chat-max-height:calc(100vh - 74px)}.\\[--panel-radius\\:0px\\]{--panel-radius:0px}.\\[--panel-radius\\:var\\(--moveo-border-radius-surface\\)\\]{--panel-radius:var(--moveo-border-radius-surface)}.\\[--thread-frost-tint\\:var\\(--color-panel-surface\\)\\]{--thread-frost-tint:var(--color-panel-surface)}.\\[animation-delay\\:0\\.2s\\]{animation-delay:.2s}.\\[animation-delay\\:0\\.4s\\]{animation-delay:.4s}.\\[animation-delay\\:0s\\]{animation-delay:0s}.\\[animation-fill-mode\\:forwards\\]{animation-fill-mode:forwards}.\\[overflow-anchor\\:none\\]{overflow-anchor:none}.\\[transition\\:width_\\.26s_cubic-bezier\\(\\.34\\,\\.01\\,\\.2\\,1\\)\\,opacity_\\.18s_ease\\,transform_\\.18s_ease\\]{transition:width .26s cubic-bezier(.34,.01,.2,1),opacity .18s,transform .18s}.ring-inset{--tw-ring-inset:inset}:is(.\\*\\:col-start-1>*){grid-column-start:1}:is(.\\*\\:row-start-1>*){grid-row-start:1}.not-first\\:border-t:not(:first-child){border-top-style:var(--tw-border-style);border-top-width:1px}.not-first\\:border-solid:not(:first-child){--tw-border-style:solid;border-style:solid}@media (hover:hover){.group-hover\\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\/open\\:scale-110:is(:where(.group\\/open):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.group-focus-visible\\:opacity-100:is(:where(.group):focus-visible *){opacity:1}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.placeholder\\:text-\\(--color-foreground-muted\\)::placeholder{color:var(--color-foreground-muted)}.before\\:pointer-events-none:before{content:var(--tw-content);pointer-events:none}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:inset-x-2\\.5:before{content:var(--tw-content);inset-inline:calc(var(--spacing) * 2.5)}.before\\:-top-px:before{content:var(--tw-content);top:-1px}.before\\:h-px:before{content:var(--tw-content);height:1px}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:-inset-1:after{content:var(--tw-content);inset:calc(var(--spacing) * -1)}.after\\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing) * -2)}.after\\:content-\\[\\\'\\\'\\]:after{--tw-content:"";content:var(--tw-content)}.first\\:mt-0:first-child{margin-top:0}.first\\:ml-4:first-child{margin-left:calc(var(--spacing) * 4)}.first\\:rounded-t-\\[23px\\]:first-child{border-top-left-radius:23px;border-top-right-radius:23px}.last\\:mr-4:last-child{margin-right:calc(var(--spacing) * 4)}.last\\:rounded-b-\\[23px\\]:last-child{border-bottom-right-radius:23px;border-bottom-left-radius:23px}.focus-within\\:ring-2:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-within\\:ring-inset:focus-within{--tw-ring-inset:inset}@media (hover:hover){.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\\:scale-\\[1\\.05\\]:hover{scale:1.05}.hover\\:border-\\(--color-options-border\\):hover{border-color:var(--color-options-border)}.hover\\:border-red-500\\/20:hover{border-color:#fb2c3633}@supports (color:color-mix(in lab, red, red)){.hover\\:border-red-500\\/20:hover{border-color:color-mix(in oklab, var(--color-red-500) 20%, transparent)}}.hover\\:bg-\\(--color-options-background\\):hover{background-color:var(--color-options-background)}.hover\\:bg-\\(--color-send-icon\\)\\/90:hover{background-color:var(--color-send-icon)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-\\(--color-send-icon\\)\\/90:hover{background-color:color-mix(in oklab, var(--color-send-icon) 90%, transparent)}}.hover\\:bg-\\(--color-surface-hover-darken\\):hover{background-color:var(--color-surface-hover-darken)}.hover\\:bg-amber-200:hover{background-color:var(--color-amber-200)}.hover\\:bg-gray-700\\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-gray-700\\/50:hover{background-color:color-mix(in oklab, var(--color-gray-700) 50%, transparent)}}.hover\\:bg-sky-200:hover{background-color:var(--color-sky-200)}.hover\\:bg-slate-200:hover{background-color:var(--color-slate-200)}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:bg-white\\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-white\\/10:hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.hover\\:bg-gradient-to-br:hover{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.hover\\:from-red-500:hover{--tw-gradient-from:var(--color-red-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\\:to-red-600:hover{--tw-gradient-to:var(--color-red-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\\:text-\\(--color-options-foreground\\):hover{color:var(--color-options-foreground)}.hover\\:text-\\[var\\(--color-accent\\)\\]:hover{color:var(--color-accent)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-\\[0_6px_20px_rgba\\(16\\,185\\,129\\,0\\.35\\)\\]:hover{--tw-shadow:0 6px 20px var(--tw-shadow-color,#10b98159);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-\\[0_6px_20px_rgba\\(239\\,68\\,68\\,0\\.35\\)\\]:hover{--tw-shadow:0 6px 20px var(--tw-shadow-color,#ef444459);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:brightness-\\[0\\.92\\]:hover{--tw-brightness:brightness(.92);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\\:backdrop-blur-sm:hover{--tw-backdrop-blur:blur(var(--blur-sm));backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}}.focus\\:outline-2:focus{outline-style:var(--tw-outline-style);outline-width:2px}.focus\\:outline-offset-2:focus{outline-offset:2px}.focus\\:outline-solid:focus{--tw-outline-style:solid;outline-style:solid}.focus-visible\\:border-\\(--color-options-border\\):focus-visible{border-color:var(--color-options-border)}.focus-visible\\:text-\\(--color-options-foreground\\):focus-visible{color:var(--color-options-foreground)}.focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-amber-400:focus-visible{--tw-ring-color:var(--color-amber-400)}.focus-visible\\:ring-sky-400:focus-visible{--tw-ring-color:var(--color-sky-400)}.focus-visible\\:ring-slate-400:focus-visible{--tw-ring-color:var(--color-slate-400)}.focus-visible\\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-white:focus-visible{--tw-ring-offset-color:var(--color-white)}.focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:-outline-offset-2:focus-visible{outline-offset:calc(2px * -1)}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:outline-solid:focus-visible{--tw-outline-style:solid;outline-style:solid}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\\:scale-\\[0\\.98\\]:active{scale:.98}.active\\:cursor-grabbing:active{cursor:grabbing}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[placeholder\\]\\:text-sm[data-placeholder]{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.data-\\[placeholder\\]\\:leading-5[data-placeholder]{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.data-\\[placeholder\\]\\:font-normal[data-placeholder]{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:flex>*)[data-slot=select-value]{display:flex}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\\[state\\=closed\\]\\:duration-200[data-state=closed]{--tw-duration:.2s;transition-duration:.2s}.data-\\[state\\=closed\\]\\:ease-in[data-state=closed]{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.data-\\[state\\=open\\]\\:duration-300[data-state=open]{--tw-duration:.3s;transition-duration:.3s}.data-\\[state\\=open\\]\\:ease-out[data-state=open]{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media (prefers-reduced-motion:no-preference){.motion-safe\\:animate-\\[question-rise_220ms_ease-out_both\\]{animation:.22s ease-out both question-rise}.motion-safe\\:animate-\\[question-rise_260ms_ease-out_both\\]{animation:.26s ease-out both question-rise}.motion-safe\\:animate-\\[question-set-in_360ms_cubic-bezier\\(0\\.2\\,0\\.8\\,0\\.2\\,1\\)_both\\]{animation:.36s cubic-bezier(.2,.8,.2,1) both question-set-in}.motion-safe\\:animate-\\[question-step-in_200ms_cubic-bezier\\(0\\.2\\,0\\.8\\,0\\.2\\,1\\)_80ms_both\\]{animation:.2s cubic-bezier(.2,.8,.2,1) 80ms both question-step-in}.motion-safe\\:animate-\\[question-step-out_100ms_ease-out_both\\]{animation:.1s ease-out both question-step-out}@media (hover:hover){.motion-safe\\:group-hover\\:-translate-\\[1\\.5px\\]:is(:where(.group):hover *){--tw-translate-x:calc(1.5px * -1);--tw-translate-y:calc(1.5px * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\\:group-hover\\:translate-0:is(:where(.group):hover *){--tw-translate-x:0px;--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\\:group-hover\\:translate-\\[1\\.5px\\]:is(:where(.group):hover *){--tw-translate-x:1.5px;--tw-translate-y:1.5px;translate:var(--tw-translate-x) var(--tw-translate-y)}}.motion-safe\\:active\\:scale-90:active{--tw-scale-x:90%;--tw-scale-y:90%;--tw-scale-z:90%;scale:var(--tw-scale-x) var(--tw-scale-y)}}@media (prefers-reduced-motion:reduce){.motion-reduce\\:invisible{visibility:hidden}.motion-reduce\\:animate-none{animation:none}.motion-reduce\\:transition-none{transition-property:none}.motion-reduce\\:duration-0{--tw-duration:0s;transition-duration:0s}}@media (min-width:40rem){.sm\\:block{display:block}.sm\\:flex-row{flex-direction:row}.sm\\:justify-end{justify-content:flex-end}.sm\\:text-left{text-align:left}.sm\\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.sm\\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}}@media (min-width:48rem){.md\\:max-h-\\[70vh\\]{max-height:70vh}.md\\:flex-row{flex-direction:row}.md\\:items-center{align-items:center}.md\\:items-start{align-items:flex-start}.md\\:px-12{padding-inline:calc(var(--spacing) * 12)}.md\\:pb-16{padding-bottom:calc(var(--spacing) * 16)}.md\\:text-left{text-align:left}.md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (min-width:64rem){.lg\\:gap-16{gap:calc(var(--spacing) * 16)}}.dark\\:border-emerald-500\\/30:is(.dark *){border-color:#00bb7f4d}@supports (color:color-mix(in lab, red, red)){.dark\\:border-emerald-500\\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-emerald-500) 30%, transparent)}}.dark\\:border-rose-500\\/30:is(.dark *){border-color:#ff23574d}@supports (color:color-mix(in lab, red, red)){.dark\\:border-rose-500\\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-rose-500) 30%, transparent)}}.dark\\:border-sky-500\\/30:is(.dark *){border-color:#00a5ef4d}@supports (color:color-mix(in lab, red, red)){.dark\\:border-sky-500\\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-sky-500) 30%, transparent)}}.dark\\:border-slate-700\\/50:is(.dark *){border-color:#31415880}@supports (color:color-mix(in lab, red, red)){.dark\\:border-slate-700\\/50:is(.dark *){border-color:color-mix(in oklab, var(--color-slate-700) 50%, transparent)}}.dark\\:border-white\\/10:is(.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\\:border-white\\/10:is(.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\\:bg-amber-500\\/15:is(.dark *){background-color:#f99c0026}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-amber-500\\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-500) 15%, transparent)}}.dark\\:bg-amber-500\\/20:is(.dark *){background-color:#f99c0033}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-amber-500\\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-500) 20%, transparent)}}.dark\\:bg-emerald-500\\/15:is(.dark *){background-color:#00bb7f26}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-emerald-500\\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-emerald-500) 15%, transparent)}}.dark\\:bg-green-950:is(.dark *){background-color:var(--color-green-950)}.dark\\:bg-rose-500\\/15:is(.dark *){background-color:#ff235726}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-rose-500\\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-rose-500) 15%, transparent)}}.dark\\:bg-sky-500\\/15:is(.dark *){background-color:#00a5ef26}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-sky-500\\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-sky-500) 15%, transparent)}}.dark\\:bg-sky-500\\/20:is(.dark *){background-color:#00a5ef33}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-sky-500\\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-sky-500) 20%, transparent)}}.dark\\:bg-slate-700\\/50:is(.dark *){background-color:#31415880}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-slate-700\\/50:is(.dark *){background-color:color-mix(in oklab, var(--color-slate-700) 50%, transparent)}}.dark\\:bg-slate-900\\/80:is(.dark *){background-color:#0f172bcc}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-slate-900\\/80:is(.dark *){background-color:color-mix(in oklab, var(--color-slate-900) 80%, transparent)}}.dark\\:from-emerald-600:is(.dark *){--tw-gradient-from:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\\:to-emerald-700:is(.dark *){--tw-gradient-to:var(--color-emerald-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\\:to-slate-950:is(.dark *){--tw-gradient-to:var(--color-slate-950);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\\:fill-sky-300:is(.dark *){fill:var(--color-sky-300)}.dark\\:text-amber-200:is(.dark *){color:var(--color-amber-200)}.dark\\:text-amber-300:is(.dark *){color:var(--color-amber-300)}.dark\\:text-emerald-300:is(.dark *){color:var(--color-emerald-300)}.dark\\:text-emerald-400:is(.dark *){color:var(--color-emerald-400)}.dark\\:text-green-300:is(.dark *){color:var(--color-green-300)}.dark\\:text-rose-300:is(.dark *){color:var(--color-rose-300)}.dark\\:text-rose-400:is(.dark *){color:var(--color-rose-400)}.dark\\:text-sky-300:is(.dark *){color:var(--color-sky-300)}.dark\\:text-sky-400:is(.dark *){color:var(--color-sky-400)}.dark\\:text-slate-100:is(.dark *){color:var(--color-slate-100)}.dark\\:text-slate-200:is(.dark *){color:var(--color-slate-200)}.dark\\:text-slate-300:is(.dark *){color:var(--color-slate-300)}.dark\\:text-slate-400:is(.dark *){color:var(--color-slate-400)}.dark\\:shadow-xl:is(.dark *){--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.dark\\:shadow-slate-950\\/30:is(.dark *){--tw-shadow-color:#0206184d}@supports (color:color-mix(in lab, red, red)){.dark\\:shadow-slate-950\\/30:is(.dark *){--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-950) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.dark\\:ring-amber-400\\/40:is(.dark *){--tw-ring-color:#fcbb0066}@supports (color:color-mix(in lab, red, red)){.dark\\:ring-amber-400\\/40:is(.dark *){--tw-ring-color:color-mix(in oklab, var(--color-amber-400) 40%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-amber-500\\/30:is(.dark *):hover{background-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-amber-500\\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.dark\\:hover\\:bg-sky-500\\/30:is(.dark *):hover{background-color:#00a5ef4d}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-sky-500\\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-sky-500) 30%, transparent)}}.dark\\:hover\\:bg-slate-700:is(.dark *):hover{background-color:var(--color-slate-700)}.dark\\:hover\\:from-red-600:is(.dark *):hover{--tw-gradient-from:var(--color-red-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\\:hover\\:to-red-700:is(.dark *):hover{--tw-gradient-to:var(--color-red-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}}.dark\\:focus-visible\\:ring-offset-slate-950:is(.dark *):focus-visible{--tw-ring-offset-color:var(--color-slate-950)}.\\[\\&_a\\]\\:cursor-pointer a{cursor:pointer}.\\[\\&_a\\]\\:underline a{text-decoration-line:underline}.\\[\\&_a\\>\\*\\]\\:pointer-events-none a>*{pointer-events:none}.\\[\\&_button\\:active\\>\\*\\]\\:scale-95 button:active>*{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.\\[\\&_button\\:hover\\>\\*\\]\\:scale-110 button:hover>*{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.\\[\\&_button\\>\\*\\]\\:animate-\\[moveo-morph-absorb_var\\(--morph-collapse\\)_both\\] button>*{animation:moveo-morph-absorb var(--morph-collapse) both}.\\[\\&_button\\>\\*\\]\\:transition-transform button>*{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\\[\\&_p\\]\\:max-w-md p{max-width:var(--container-md)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\&_svg\\]\\:size-5 svg{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.\\[\\&_svg\\]\\:flex-shrink-0 svg,.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\\'size-\\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}:is(.\\*\\:\\[span\\]\\:last\\:flex>*):is(span):last-child{display:flex}:is(.\\*\\:\\[span\\]\\:last\\:items-center>*):is(span):last-child{align-items:center}:is(.\\*\\:\\[span\\]\\:last\\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}.\\[\\&\\>\\*\\]\\:\\[grid-area\\:1\\/1\\]>*{grid-area:1/1}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}\n',""]);const s=a;n.d(t,["A",0,s])},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,i,r,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(i)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);i&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},833(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let i=0,r=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(i++,"%c"===e&&(r=i))}),t.splice(r,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(736)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},736(e,t,n){e.exports=function(e){function t(e){let n,r,o,a=null;function s(...e){if(!s.enabled)return;const i=s,r=Number(new Date),o=r-(n||r);i.diff=o,i.prev=n,i.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,r)=>{if("%%"===n)return"%";a++;const o=t.formatters[r];if("function"==typeof o){const t=e[a];n=o.call(i,t),e.splice(a,1),a--}return n}),t.formatArgs.call(i,e),(i.log||t.log).apply(i,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=i,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(r!==t.namespaces&&(r=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function i(e,n){const i=t(this.namespace+(void 0===n?":":n)+e);return i.log=this.log,i}function r(e,t){let n=0,i=0,r=-1,o=0;for(;n<e.length;)if(i<t.length&&(t[i]===e[n]||"*"===t[i]))"*"===t[i]?(r=i,o=n,i++):(n++,i++);else{if(-1===r)return!1;i=r+1,o++,n=o}for(;i<t.length&&"*"===t[i];)i++;return i===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(r(e,n))return!1;for(const n of t.names)if(r(e,n))return!0;return!1},t.humanize=n(585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},585(e){var t=1e3,n=60*t,i=60*n,r=24*i,o=7*r;function a(e,t,n,i){var r=t>=1.5*n;return Math.round(e/n)+" "+i+(r?"s":"")}e.exports=function(e,s){s=s||{};var l,c,d=typeof e;if("string"===d&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*r;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===d&&isFinite(e))return s.long?(l=e,(c=Math.abs(l))>=r?a(l,c,r,"day"):c>=i?a(l,c,i,"hour"):c>=n?a(l,c,n,"minute"):c>=t?a(l,c,t,"second"):l+" ms"):function(e){var o=Math.abs(e);return o>=r?Math.round(e/r)+"d":o>=i?Math.round(e/i)+"h":o>=n?Math.round(e/n)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}};const t={};function n(i){const r=t[i];if(void 0!==r)return r.exports;const o=t[i]={id:i,exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var r=t[i++],o=t[i++],a=0===o?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:o};n.o(e,r)||Object.defineProperty(e,r,a)}else for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0;let i={};return(()=>{"use strict";n.d(i,{default:()=>ca});var e=n.cw((e,t)=>{var n=u(),i=l(),r=o();function a(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 s(e){for(var t=e,n=t;n&&!n.alternate;)!!(4098&(t=n).flags)&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return 3===t.tag?e:null}function c(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function d(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function h(e){if(s(e)!==e)throw Error(a(188))}function p(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=p(e)))return t;e=e.sibling}return null}function f(e,t,n,i,r,o){for(;null!==e;){if((5===e.tag||27===e.tag||6===e.tag)&&n(e,i,r,o)||(22!==e.tag||null===e.memoizedState)&&(t||5!==e.tag&&27!==e.tag)&&f(e.child,t,n,i,r,o))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;null!==e;){if(3===e.tag||5===e.tag||27===e.tag)return e;e=e.return}return null}function v(e){var t=!1;for(e=e.return;null!==e&&(4===e.tag&&(t=!0),3!==e.tag&&5!==e.tag&&27!==e.tag);)e=e.return;return t}function m(e){var t=[null,null],n=g(e);return null===n||b(t,e,n.child,{foundSelf:!1}),t}function b(e,t,n,i){for(;null!==n;){if(n===t)i.foundSelf=!0;else if(5===n.tag||27===n.tag||6===n.tag){if(i.foundSelf)return e[1]=n,!0;e[0]=n}else if((22!==n.tag||null===n.memoizedState)&&b(e,t,n.child,i))return!0;n=n.sibling}return!1}function y(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var w=null,k=null;function _(e,t,n){return e===n||e===t&&(w=e,!0)}function S(e,t,n){return e===n?(k=e,!1):e===t&&(null!==k&&(w=e),!0)}function x(e){if(null===e)return null;do{e=null===e?null:e.return}while(e&&5!==e.tag&&27!==e.tag&&3!==e.tag);return e||null}function C(e,t,n){for(var i=0,r=e;r;r=n(r))i++;r=0;for(var o=t;o;o=n(o))r++;for(;0<i-r;)e=n(e),i--;for(;0<r-i;)t=n(t),r--;for(;i--;){if(e===t||null!==t&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,I=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),D=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),z=Symbol.for("react.lazy");Symbol.for("react.scope");var U=Symbol.for("react.activity"),$=Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var B=Symbol.for("react.memo_cache_sentinel"),H=Symbol.for("react.view_transition"),W=Symbol.for("react.recoverable"),V=Symbol.iterator;function q(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=V&&e[V]||e["@@iterator"])?e:null}var G=Symbol.for("react.client.reference");function K(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===G?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case N:return"Fragment";case A:return"Profiler";case O:return"StrictMode";case M:return"Suspense";case F:return"SuspenseList";case U:return"Activity";case H:return"ViewTransition"}if("object"==typeof e)switch(e.$$typeof){case R:return"Portal";case D:return e.displayName||"Context";case L:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case j:return null!==(t=e.displayName||null)?t:K(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return K(e(t))}catch(e){}}return null}var Y=Array.isArray,Q=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},Z=[],ee=-1;function te(e){return{current:e}}function ne(e){0>ee||(e.current=Z[ee],Z[ee]=null,ee--)}function ie(e,t){ee++,Z[ee]=e.current,e.current=t}var re,oe,ae=te(null),se=te(null),le=te(null),ce=te(null);function de(e,t){switch(ie(le,t),ie(se,e),ie(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Fh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=jh(t=Fh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ne(ae),ie(ae,e)}function ue(){ne(ae),ne(se),ne(le)}function he(e){var t=e.memoizedState;null!==t&&(hf._currentValue=t.memoizedState,ie(ce,e));var n=jh(t=ae.current,e.type);t!==n&&(ie(se,e),ie(ae,n))}function pe(e){se.current===e&&(ne(ae),ne(se)),ce.current===e&&(ne(ce),hf._currentValue=X)}function fe(e){if(void 0===re)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||"",oe=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+re+e+oe}var ge=!1;function ve(e,t){if(!e||ge)return"";ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var i=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){i=e}n=!1;try{var r=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(void 0!==r?Object.defineProperty(e.prototype,"props",r):delete e.prototype.props)}}}else{try{throw Error()}catch(e){i=e}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(e){if(e&&i&&"string"==typeof e.stack)return[e.stack,i.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),a=o[0],s=o[1];if(a&&s){var l=a.split("\n"),c=s.split("\n");for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(1!==i||1!==r)do{if(i--,0>--r||l[i]!==c[r]){var d="\n"+l[i].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}}while(1<=i&&0<=r);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?fe(n):""}function me(e,t){switch(e.tag){case 26:case 27:case 5:return fe(e.type);case 16:return fe("Lazy");case 13:return e.child!==t&&null!==t?fe("Suspense Fallback"):fe("Suspense");case 19:return fe("SuspenseList");case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return fe("Activity");case 30:return fe("ViewTransition");default:return""}}function be(e){try{var t="",n=null;do{t+=me(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ye=Object.prototype.hasOwnProperty,we=n.unstable_scheduleCallback,ke=n.unstable_cancelCallback,_e=n.unstable_shouldYield,Se=n.unstable_requestPaint,xe=n.unstable_now,Ce=n.unstable_getCurrentPriorityLevel,Ee=n.unstable_ImmediatePriority,Ie=n.unstable_UserBlockingPriority,Te=n.unstable_NormalPriority,Re=n.unstable_LowPriority,Ne=n.unstable_IdlePriority,Oe=n.log,Ae=n.unstable_setDisableYieldValue,Le=null,De=null;function Pe(e){if("function"==typeof Oe&&Ae(e),De&&"function"==typeof De.setStrictMode)try{De.setStrictMode(Le,e)}catch(e){}}var Me=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(Fe(e)/je|0)|0},Fe=Math.log,je=Math.LN2,ze=256,Ue=262144,$e=4194304;function Be(e){var t=42&e;if(0!==t)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&-e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var i=e.pendingLanes;if(0===i)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var s=134217727&i;return 0!==s?0!==(i=s&~o)?r=Be(i):0!==(a&=s)?r=Be(a):n||0!==(n=s&~e)&&(r=Be(n)):0!==(s=i&~o)?r=Be(s):0!==a?r=Be(a):n||0!==(n=i&~e)&&(r=Be(n)),0===r?0:0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(n=t&-t)||32===o&&4194048&n)?t:r}function We(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Ve(e,t){8&t&&(t|=32&t);var n=e.entangledLanes;if(0!==n)for(e=e.entanglements,n&=t;0<n;){var i=31-Me(n),r=1<<i;t|=e[i],n&=~r}return t}function qe(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;default:return-1}}function Ge(){var e=$e;return!(62914560&($e<<=1))&&($e=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Me(t);e.entangledLanes|=t,e.entanglements[i]=1073741824|e.entanglements[i]|261930&n}function Je(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Me(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}function Xe(e,t){var n=t&-t;return 0!==((n=42&n?1:Ze(n))&(e.suspendedLanes|t))?0:n}function Ze(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 et(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function tt(){var e=J.p;return 0!==e?e:void 0===(e=window.event)?32:Ef(e.type)}function nt(e,t){var n=J.p;try{return J.p=e,t()}finally{J.p=n}}var it=Math.random().toString(36).slice(2),rt="__reactFiber$"+it,ot="__reactProps$"+it,at="__reactContainer$"+it,st="__reactEvents$"+it,lt="__reactListeners$"+it,ct="__reactHandles$"+it,dt="__reactResources$"+it,ut="__reactMarker$"+it,ht="__reactLoad$"+it;function pt(e){delete e[rt],delete e[ot],delete e[lt],delete e[ct]}function ft(e){var t;if(t=e[rt])return t;for(var n=e.parentNode;n;){if(t=n[at]||n[rt]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Op(e);null!==e;){if(n=e[rt])return n;e=Op(e)}return t}n=(e=n).parentNode}return null}function gt(e){if(e=e[rt]||e[at]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function vt(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(a(33))}function mt(e){var t=e[dt];return t||(t=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function bt(e){e[ut]=!0}function yt(e){e[ht]=void 0}var wt=new Set,kt={};function _t(e,t){St(e,t),St(e+"Capture",t)}function St(e,t){for(kt[e]=t,e=0;e<t.length;e++)wt.add(t[e])}var xt=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]*$"),Ct={},Et={},It=!1;function Tt(){var e=It;return It=!1,e}function Rt(e,t,n){if(r=t,ye.call(Et,r)||!ye.call(Ct,r)&&(xt.test(r)?Et[r]=!0:(Ct[r]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var i=t.toLowerCase().slice(0,5);if("data-"!==i&&"aria-"!==i)return void e.removeAttribute(t)}e.setAttribute(t,n)}var r}function Nt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,n)}}function Ot(e,t,n,i){if(null===i)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,i)}}function At(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function Lt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Dt(e){if(!e._valueTracker){var t=Lt(e)?"checked":"value";e._valueTracker=function(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==i&&"function"==typeof i.get&&"function"==typeof i.set){var r=i.get,o=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){n=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Lt(e)?e.checked?"true":"false":e.value),(e=i)!==n&&(t.setValue(e),!0)}var Mt=/[\n"\\]/g;function Ft(e){return e.replace(Mt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function jt(e,t,n,i,r,o,a,s){e.name="",null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a?e.type=a:e.removeAttribute("type"),null!=t?"number"===a?(0===t&&""===e.value||e.value!=t)&&(e.value=""+At(t)):e.value!==""+At(t)&&(e.value=""+At(t)):"submit"!==a&&"reset"!==a||e.removeAttribute("value"),null!=t?"number"===a&&e.value==t?Ut(e,At(e.value)):Ut(e,At(t)):null!=n?Ut(e,At(n)):null!=i&&e.removeAttribute("value"),null==r&&null!=o&&(e.defaultChecked=!!o),null!=r&&(e.checked=r&&"function"!=typeof r&&"symbol"!=typeof r),null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.name=""+At(s):e.removeAttribute("name")}function zt(e,t,n,i,r,o,a,s){if(null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.type=o),null!=t||null!=n){if(("submit"===o||"reset"===o)&&null==t)return void Dt(e);n=null!=n?""+At(n):"",t=null!=t?""+At(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}i="function"!=typeof(i=null!=i?i:r)&&"symbol"!=typeof i&&!!i,e.checked=s?e.checked:!!i,e.defaultChecked=!!i,null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.name=a),Dt(e)}function Ut(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function $t(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+At(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(i&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function Bt(e,t,n){null==t||((t=""+At(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+At(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function Ht(e,t,n,i){if(null==t){if(null!=i){if(null!=n)throw Error(a(92));if(Y(i)){if(1<i.length)throw Error(a(93));i=i[0]}n=i}null==n&&(n=""),t=n}n=At(t),e.defaultValue=n,(i=e.textContent)===n&&""!==i&&null!==i&&(e.value=i),Dt(e)}function Wt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Vt=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 qt(e,t,n){var i=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?i?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":i?e.setProperty(t,n):"number"!=typeof n||0===n||Vt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Gt(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(a(62));if(e=e.style,null!=n){for(var i in n)!n.hasOwnProperty(i)||null!=t&&t.hasOwnProperty(i)||(0===i.indexOf("--")?e.setProperty(i,""):"float"===i?e.cssFloat="":e[i]="",It=!0);for(var r in t)i=t[r],t.hasOwnProperty(r)&&n[r]!==i&&(qt(e,r,i),It=!0)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function Kt(e){if(-1===e.indexOf("-"))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 Yt=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"],["maskType","mask-type"],["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"]]),Qt=/^[\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 Jt(e){return Qt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xt(){}var Zt=null;function en(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var tn=null,nn=null;function rn(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(jt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ft(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=i[ot]||null;if(!r)throw Error(a(90));jt(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)(i=n[t]).form===e.form&&Pt(i)}break e;case"textarea":Bt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&$t(e,!!n.multiple,t,!1)}}}var on=!1;function an(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(null!==tn||null!==nn)&&(mu(),tn&&(t=tn,e=nn,nn=tn=null,rn(t),e)))for(t=0;t<e.length;t++)rn(e[t])}}function sn(e,t){var n=e.stateNode;if(null===n)return null;var i=n[ot]||null;if(null===i)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)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(a(231,t,typeof n));return n}var ln=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),cn=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){cn=!0}}),window.addEventListener("test",dn,dn),window.removeEventListener("test",dn,dn)}catch(e){cn=!1}var un=null,hn=null,pn=null;function fn(){if(pn)return pn;var e,t,n=hn,i=n.length,r="value"in un?un.value:un.textContent,o=r.length;for(e=0;e<i&&n[e]===r[e];e++);var a=i-e;for(t=1;t<=a&&n[i-t]===r[o-t];t++);return pn=r.slice(e,1<t?1-t:void 0)}function gn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function vn(){return!0}function mn(){return!1}function bn(e){function t(t,n,i,r,o){for(var a in this._reactName=t,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(r):r[a]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?vn:mn,this.isPropagationStopped=mn,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var yn,wn,kn,_n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(_n),xn=E({},_n,{view:0,detail:0}),Cn=bn(xn),En=E({},xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==kn&&(kn&&"mousemove"===e.type?(yn=e.screenX-kn.screenX,wn=e.screenY-kn.screenY):wn=yn=0,kn=e),yn)},movementY:function(e){return"movementY"in e?e.movementY:wn}}),In=bn(En),Tn=bn(E({},En,{dataTransfer:0})),Rn=bn(E({},xn,{relatedTarget:0})),Nn=bn(E({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),On=bn(E({},_n,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),An=bn(E({},_n,{data:0})),Ln={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dn={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"},Pn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Pn[e])&&!!t[e]}function Fn(){return Mn}var jn=bn(E({},xn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=gn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Dn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return"keypress"===e.type?gn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?gn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),zn=bn(E({},En,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=bn(E({},_n,{submitter:0})),$n=bn(E({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),Bn=bn(E({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Hn=bn(E({},En,{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})),Wn=bn(E({},_n,{newState:0,oldState:0,source:0})),Vn=[9,13,27,32],qn=ln&&"CompositionEvent"in window,Gn=null;ln&&"documentMode"in document&&(Gn=document.documentMode);var Kn=ln&&"TextEvent"in window&&!Gn,Yn=ln&&(!qn||Gn&&8<Gn&&11>=Gn),Qn=String.fromCharCode(32),Jn=!1;function Xn(e,t){switch(e){case"keyup":return-1!==Vn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ei=!1,ti={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 ni(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ti[e.type]:"textarea"===t}function ii(e,t,n,i){tn?nn?nn.push(i):nn=[i]:tn=i,0<(t=_h(t,"onChange")).length&&(n=new Sn("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var ri=null,oi=null;function ai(e){fh(e,0)}function si(e){if(Pt(vt(e)))return e}function li(e,t){if("change"===e)return t}var ci=!1;if(ln){var di;if(ln){var ui="oninput"in document;if(!ui){var hi=document.createElement("div");hi.setAttribute("oninput","return;"),ui="function"==typeof hi.oninput}di=ui}else di=!1;ci=di&&(!document.documentMode||9<document.documentMode)}function pi(){ri&&(ri.detachEvent("onpropertychange",fi),oi=ri=null)}function fi(e){if("value"===e.propertyName&&si(oi)){var t=[];ii(t,oi,e,en(e)),an(ai,t)}}function gi(e,t,n){"focusin"===e?(pi(),oi=n,(ri=t).attachEvent("onpropertychange",fi)):"focusout"===e&&pi()}function vi(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return si(oi)}function mi(e,t){if("click"===e)return si(t)}function bi(e,t){if("input"===e||"change"===e)return si(t)}var yi="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function wi(e,t){if(yi(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)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 r=n[i];if(!ye.call(t,r)||!yi(e[r],t[r]))return!1}return!0}function ki(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function _i(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Si(e,t){var n,i=_i(e);for(e=0;i;){if(3===i.nodeType){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=_i(i)}}function xi(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?xi(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Ci(e){for(var t=ki((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=ki((e=t.contentWindow).document)}return t}function Ei(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Ii=ln&&"documentMode"in document&&11>=document.documentMode,Ti=null,Ri=null,Ni=null,Oi=!1;function Ai(e,t,n){var i=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;Oi||null==Ti||Ti!==ki(i)||(i="selectionStart"in(i=Ti)&&Ei(i)?{start:i.selectionStart,end:i.selectionEnd}:{anchorNode:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset},Ni&&wi(Ni,i)||(Ni=i,0<(i=_h(Ri,"onSelect")).length&&(t=new Sn("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Ti)))}function Li(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Di={animationend:Li("Animation","AnimationEnd"),animationiteration:Li("Animation","AnimationIteration"),animationstart:Li("Animation","AnimationStart"),transitionrun:Li("Transition","TransitionRun"),transitionstart:Li("Transition","TransitionStart"),transitioncancel:Li("Transition","TransitionCancel"),transitionend:Li("Transition","TransitionEnd")},Pi={},Mi={};function Fi(e){if(Pi[e])return Pi[e];if(!Di[e])return e;var t,n=Di[e];for(t in n)if(n.hasOwnProperty(t)&&t in Mi)return Pi[e]=n[t];return e}ln&&(Mi=document.createElement("div").style,"AnimationEvent"in window||(delete Di.animationend.animation,delete Di.animationiteration.animation,delete Di.animationstart.animation),"TransitionEvent"in window||delete Di.transitionend.transition);var ji=Fi("animationend"),zi=Fi("animationiteration"),Ui=Fi("animationstart"),$i=Fi("transitionrun"),Bi=Fi("transitionstart"),Hi=Fi("transitioncancel"),Wi=Fi("transitionend"),Vi=new Map,qi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");function Gi(e,t){Vi.set(e,t),_t(t,[e])}qi.push("scrollEnd");var Ki=0;function Yi(e,t){return null!=e.name&&"auto"!==e.name?e.name:null!==t.autoName?t.autoName:(e="_"+(e=Xd.identifierPrefix)+"t_"+(Ki++).toString(32)+"_",t.autoName=e)}function Qi(e){if(null==e||"string"==typeof e)return e;var t=null,n=au;if(null!==n)for(var i=0;i<n.length;i++){var r=e[n[i]];if(null!=r){if("none"===r)return"none";t=null==t?r:t+" "+r}}return t??e.default}function Ji(e,t){return e=Qi(e),null==(t=Qi(t))?"auto"===e?null:e:"auto"===t?null:t}var Xi="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Zi=[],er=0,tr=0;function nr(){for(var e=er,t=tr=er=0;t<e;){var n=Zi[t];Zi[t++]=null;var i=Zi[t];Zi[t++]=null;var r=Zi[t];Zi[t++]=null;var o=Zi[t];if(Zi[t++]=null,null!==i&&null!==r){var a=i.pending;null===a?r.next=r:(r.next=a.next,a.next=r),i.pending=r}0!==o&&ar(n,r,o)}}function ir(e,t,n,i){Zi[er++]=e,Zi[er++]=t,Zi[er++]=n,Zi[er++]=i,tr|=i,e.lanes|=i,null!==(e=e.alternate)&&(e.lanes|=i)}function rr(e,t,n,i){return ir(e,t,n,i),sr(e)}function or(e,t){return ir(e,null,null,t),sr(e)}function ar(e,t,n){e.lanes|=n;var i=e.alternate;null!==i&&(i.lanes|=n);for(var r=!1,o=e.return;null!==o;)o.childLanes|=n,null!==(i=o.alternate)&&(i.childLanes|=n),22===o.tag&&(null===(e=o.stateNode)||1&e._visibility||(r=!0)),e=o,o=o.return;return 3===e.tag?(o=e.stateNode,r&&null!==t&&(r=31-Me(n),null===(i=(e=o.hiddenUpdates)[r])?e[r]=[t]:i.push(t),t.lane=536870912|n),o):null}function sr(e){if(50<su)throw su=0,lu=null,Error(a(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var lr={};function cr(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 dr(e,t,n,i){return new cr(e,t,n,i)}function ur(e){return!(!(e=e.prototype)||!e.isReactComponent)}function hr(e,t){var n=e.alternate;return null===n?((n=dr(e.tag,t,e.key,e.mode)).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=1206910976&e.flags,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=null===t?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 pr(e,t){e.flags&=1206910978;var n=e.alternate;return null===n?(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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fr(e,t,n,i,r,o){var s=0;if("function"==typeof(i=e))ur(i)&&(s=1);else if("string"==typeof i)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,ae.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(i){case U:return(e=dr(31,n,t,r)).elementType=U,e.lanes=o,e;case N:return gr(n.children,r,o,t);case O:s=8,r|=24;break;case A:return(e=dr(12,n,t,2|r)).elementType=A,e.lanes=o,e;case M:return(e=dr(13,n,t,r)).elementType=M,e.lanes=o,e;case F:return(e=dr(19,n,t,r)).elementType=F,e.lanes=o,e;case $:case H:return(e=dr(30,n,t,e=32|r)).elementType=H,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if("object"==typeof i&&null!==i)switch(i.$$typeof){case D:s=10;break e;case L:s=9;break e;case P:s=11;break e;case j:s=14;break e;case z:s=16,i=null;break e}s=29,n=Error(a(130,null===e?"null":typeof e,"")),i=null}return(t=dr(s,n,t,r)).elementType=e,t.type=i,t.lanes=o,t}function gr(e,t,n,i){return(e=dr(7,e,i,t)).lanes=n,e}function vr(e,t,n){return(e=dr(6,e,null,t)).lanes=n,e}function mr(e){var t=dr(18,null,null,0);return t.stateNode=e,t}function br(e,t,n){return(t=dr(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yr=new WeakMap;function wr(e,t){if("object"==typeof e&&null!==e){var n=yr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:be(t)},yr.set(e,t),t)}return{value:e,source:t,stack:be(t)}}var kr=[],_r=0,Sr=null,xr=0,Cr=[],Er=0,Ir=null,Tr=1,Rr="";function Nr(e,t){kr[_r++]=xr,kr[_r++]=Sr,Sr=e,xr=t}function Or(e,t,n){Cr[Er++]=Tr,Cr[Er++]=Rr,Cr[Er++]=Ir,Ir=e;var i=Tr;e=Rr;var r=32-Me(i)-1;i&=~(1<<r),n+=1;var o=32-Me(t)+r;if(30<o){var a=r-r%5;o=(i&(1<<a)-1).toString(32),i>>=a,r-=a,Tr=1<<32-Me(t)+r|n<<r|i,Rr=o+e}else Tr=1<<o|n<<r|i,Rr=e}function Ar(e){null!==e.return&&(Nr(e,1),Or(e,1,0))}function Lr(e){for(;e===Sr;)Sr=kr[--_r],kr[_r]=null,xr=kr[--_r],kr[_r]=null;for(;e===Ir;)Ir=Cr[--Er],Cr[Er]=null,Rr=Cr[--Er],Cr[Er]=null,Tr=Cr[--Er],Cr[Er]=null}function Dr(e,t){Cr[Er++]=Tr,Cr[Er++]=Rr,Cr[Er++]=Ir,Tr=t.id,Rr=t.overflow,Ir=e}var Pr=null,Mr=null,Fr=!1,jr=null,zr=!1,Ur=Error(a(519));function $r(e){throw Gr(wr(Error(a(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),Ur}function Br(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[rt]=e,t[ot]=i,n){case"dialog":gh("cancel",t),gh("close",t);break;case"iframe":case"object":case"embed":gh("load",t);break;case"video":case"audio":for(n=0;n<hh.length;n++)gh(hh[n],t);break;case"source":gh("error",t);break;case"img":case"image":case"link":gh("error",t),gh("load",t);break;case"details":gh("toggle",t);break;case"input":gh("invalid",t),zt(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":gh("invalid",t);break;case"textarea":gh("invalid",t),Ht(t,i.value,i.defaultValue,i.children)}"string"!=typeof(n=i.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===i.suppressHydrationWarning||Th(t.textContent,n)?(null!=i.popover&&(gh("beforetoggle",t),gh("toggle",t)),null!=i.onScroll&&gh("scroll",t),null!=i.onScrollEnd&&gh("scrollend",t),null!=i.onClick&&(t.onclick=Xt),t=!0):t=!1,t||$r(e,!0)}function Hr(e){for(Pr=e.return;Pr;)switch(Pr.tag){case 5:case 31:case 13:return void(zr=!1);case 27:case 3:return void(zr=!0);default:Pr=Pr.return}}function Wr(e){if(e!==Pr)return!1;if(!Fr)return Hr(e),Fr=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||Uh(e.type,e.memoizedProps)),t=!t),t&&Mr&&$r(e),Hr(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));Mr=Np(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));Mr=Np(e)}else 27===n?(n=Mr,Kh(e.type)?(e=Rp,Rp=null,Mr=e):Mr=n):Mr=Pr?Tp(e.stateNode.nextSibling):null;return!0}function Vr(){Mr=Pr=null,Fr=!1}function qr(){var e=jr;return null!==e&&(null===Wd?Wd=e:Wd.push.apply(Wd,e),jr=null),e}function Gr(e){null===jr?jr=[e]:jr.push(e)}var Kr=te(null),Yr=null,Qr=null;function Jr(e,t,n){ie(Kr,t._currentValue),t._currentValue=n}function Xr(e){e._currentValue=Kr.current,ne(Kr)}function Zr(e,t,n){for(;null!==e;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==i&&(i.childLanes|=t)):null!==i&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function eo(e,t,n,i){var r=e.child;for(null!==r&&(r.return=e);null!==r;){var o=r.dependencies;if(null!==o){var s=r.child;o=o.firstContext;e:for(;null!==o;){var l=o;o=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Zr(o.return,n,e),i||(s=null);break e}o=l.next}}else if(18===r.tag){if(null===(s=r.return))throw Error(a(341));s.lanes|=n,null!==(o=s.alternate)&&(o.lanes|=n),Zr(s,n,e),s=null}else 13===r.tag&&null!==r.memoizedState&&null===r.memoizedState.dehydrated?(r.lanes|=n,null!==(s=r.alternate)&&(s.lanes|=n),Zr(r.return,n,e),s=null!==(s=r.child)?s.sibling:null):s=r.child;if(null!==s)s.return=r;else for(s=r;null!==s;){if(s===e){s=null;break}if(null!==(r=s.sibling)){r.return=s.return,s=r;break}s=s.return}r=s}}function to(e,t,n,i){e=null;for(var r=t,o=!1;null!==r;){if(!o)if(524288&r.flags)o=!0;else if(262144&r.flags)break;if(10===r.tag){var s=r.alternate;if(null===s)throw Error(a(387));if(null!==(s=s.memoizedProps)){var l=r.type;yi(r.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(r===ce.current){if(null===(s=r.alternate))throw Error(a(387));s.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(null!==e?e.push(hf):e=[hf])}r=r.return}return null!==e&&eo(t,e,n,i),t.flags|=262144,null!==e}function no(e){for(e=e.firstContext;null!==e;){if(!yi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function io(e){Yr=e,Qr=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function ro(e){return ao(Yr,e)}function oo(e,t){return null===Yr&&io(e),ao(e,t)}function ao(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===Qr){if(null===e)throw Error(a(308));Qr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Qr=Qr.next=t;return n}var so="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},lo=n.unstable_scheduleCallback,co=n.unstable_NormalPriority,uo={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ho(){return{controller:new so,data:new Map,refCount:0}}function po(e){e.refCount--,0===e.refCount&&lo(co,function(){e.controller.abort()})}function fo(e,t){if(4194048&e.pendingLanes){var n=e.transitionTypes;for(null===n&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var i=t[e];-1===n.indexOf(i)&&n.push(i)}}}var go=null,vo=null,mo=0,bo=0,yo=null;function wo(){if(0===--mo&&(go=null,null!==vo)){null!==yo&&(yo.status="fulfilled");var e=vo;vo=null,bo=0,yo=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var ko=Q.S;Q.S=function(e,t){if(Gd=xe(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===vo){var n=vo=[];mo=0,bo=lh(),yo={status:"pending",value:void 0,then:function(e){n.push(e)}}}mo++,t.then(wo,wo)}(0,t),null!==go)for(var n=Yu;null!==n;)fo(n,go),n=n.next;if(null!==(n=e.types)){for(var i=Yu;null!==i;)fo(i,n),i=i.next;if(0!==bo){null===(i=go)&&(i=go=[]);for(var r=0;r<n.length;r++){var o=n[r];-1===i.indexOf(o)&&i.push(o)}}}null!==ko&&ko(e,t)};var _o=te(null);function So(){var e=_o.current;return null!==e?e:Td.pooledCache}function xo(e,t){ie(_o,null===t?_o.current:t.pool)}function Co(){var e=So();return null===e?null:{parent:uo._currentValue,pool:e}}var Eo=Error(a(460)),Io=Error(a(474)),To=Error(a(542)),Ro={then:function(){}};function No(e){return"fulfilled"===(e=e.status)||"rejected"===e}function Oo(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case"fulfilled":return t.value;case"rejected":if(Po(e=t.reason),void 0===e&&!("reason"in t))throw Error(a(600));throw e;default:if("string"==typeof t.status)t.then(Xt,Xt);else{if(null!==(e=Td)&&100<e.shellSuspendCounter)throw Error(a(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw Po(e=t.reason),e}throw Lo=t,Eo}}function Ao(e){try{return(0,e._init)(e._payload)}catch(e){if(null!==e&&"object"==typeof e&&"function"==typeof e.then)throw Lo=e,Eo;throw e}}var Lo=null;function Do(){if(null===Lo)throw Error(a(459));var e=Lo;return Lo=null,e}function Po(e){if(e===Eo||e===To)throw Error(a(483))}var Mo=null,Fo=0;function jo(e){var t=Fo;return Fo+=1,null===Mo&&(Mo=[]),Oo(Mo,e,t)}function zo(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function Uo(e,t){if(t.$$typeof===I)throw Error(a(525));throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $o(e){function t(t,n){if(e){var i=t.deletions;null===i?(t.deletions=[n],t.flags|=16):i.push(n)}}function n(n,i){if(!e)return null;for(;null!==i;)t(n,i),i=i.sibling;return null}function i(e){for(var t=new Map;null!==e;)null===e.key?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function r(e,t){return(e=hr(e,t)).index=0,e.sibling=null,e}function o(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.flags|=2,n):i:(t.flags|=134217730,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=134217730),t}function l(e,t,n,i){return null===t||6!==t.tag?((t=vr(n,e.mode,i)).return=e,t):((t=r(t,n)).return=e,t)}function c(e,t,n,i){var o=n.type;return o===N?(zo(e=u(e,t,n.props.children,i,n.key),n),e):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===z&&Ao(o)===t.type)?(zo(t=r(t,n.props),n),t.return=e,t):(zo(t=fr(n.type,n.key,n.props,null,e.mode,i),n),t.return=e,t)}function d(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=br(n,e.mode,i)).return=e,t):((t=r(t,n.children||[])).return=e,t)}function u(e,t,n,i,o){return null===t||7!==t.tag?((t=gr(n,e.mode,i,o)).return=e,t):((t=r(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=vr(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case T:return zo(n=fr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case R:return(t=br(t,e.mode,n)).return=e,t;case z:return h(e,t=Ao(t),n)}if(Y(t)||q(t))return(t=gr(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return h(e,jo(t),n);if(t.$$typeof===D)return h(e,oo(e,t),n);Uo(e,t)}return null}function p(e,t,n,i){var r=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==r?null:l(e,t,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case T:return n.key===r?c(e,t,n,i):null;case R:return n.key===r?d(e,t,n,i):null;case z:return p(e,t,n=Ao(n),i)}if(Y(n)||q(n))return null!==r?null:u(e,t,n,i,null);if("function"==typeof n.then)return p(e,t,jo(n),i);if(n.$$typeof===D)return p(e,t,oo(e,n),i);Uo(e,n)}return null}function f(e,t,n,i,r){if("string"==typeof i&&""!==i||"number"==typeof i||"bigint"==typeof i)return l(t,e=e.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case T:return c(t,e=e.get(null===i.key?n:i.key)||null,i,r);case R:return d(t,e=e.get(null===i.key?n:i.key)||null,i,r);case z:return f(e,t,n,i=Ao(i),r)}if(Y(i)||q(i))return u(t,e=e.get(n)||null,i,r,null);if("function"==typeof i.then)return f(e,t,n,jo(i),r);if(i.$$typeof===D)return f(e,t,n,oo(t,i),r);Uo(t,i)}return null}function g(l,c,d,u){if("object"==typeof d&&null!==d&&d.type===N&&null===d.key&&void 0===d.props.ref&&(d=d.props.children),"object"==typeof d&&null!==d){switch(d.$$typeof){case T:e:{for(var v=d.key;null!==c;){if(c.key===v){if((v=d.type)===N){if(7===c.tag){n(l,c.sibling),zo(u=r(c,d.props.children),d),u.return=l,l=u;break e}}else if(c.elementType===v||"object"==typeof v&&null!==v&&v.$$typeof===z&&Ao(v)===c.type){n(l,c.sibling),zo(u=r(c,d.props),d),u.return=l,l=u;break e}n(l,c);break}t(l,c),c=c.sibling}d.type===N?(zo(u=gr(d.props.children,l.mode,u,d.key),d),u.return=l,l=u):(zo(u=fr(d.type,d.key,d.props,null,l.mode,u),d),u.return=l,l=u)}return s(l);case R:e:{for(v=d.key;null!==c;){if(c.key===v){if(4===c.tag&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(l,c.sibling),(u=r(c,d.children||[])).return=l,l=u;break e}n(l,c);break}t(l,c),c=c.sibling}(u=br(d,l.mode,u)).return=l,l=u}return s(l);case z:return g(l,c,d=Ao(d),u)}if(Y(d))return function(r,a,s,l){for(var c=null,d=null,u=a,g=a=0,v=null;null!==u&&g<s.length;g++){u.index>g?(v=u,u=null):v=u.sibling;var m=p(r,u,s[g],l);if(null===m){null===u&&(u=v);break}e&&u&&null===m.alternate&&t(r,u),a=o(m,a,g),null===d?c=m:d.sibling=m,d=m,u=v}if(g===s.length)return n(r,u),Fr&&Nr(r,g),c;if(null===u){for(;g<s.length;g++)null!==(u=h(r,s[g],l))&&(a=o(u,a,g),null===d?c=u:d.sibling=u,d=u);return Fr&&Nr(r,g),c}for(u=i(u);g<s.length;g++)null!==(v=f(u,r,g,s[g],l))&&(e&&null!==(m=v.alternate)&&u.delete(null===m.key?g:m.key),a=o(v,a,g),null===d?c=v:d.sibling=v,d=v);return e&&u.forEach(function(e){return t(r,e)}),Fr&&Nr(r,g),c}(l,c,d,u);if(q(d)){if("function"!=typeof(v=q(d)))throw Error(a(150));return function(r,s,l,c){if(null==l)throw Error(a(151));for(var d=null,u=null,g=s,v=s=0,m=null,b=l.next();null!==g&&!b.done;v++,b=l.next()){g.index>v?(m=g,g=null):m=g.sibling;var y=p(r,g,b.value,c);if(null===y){null===g&&(g=m);break}e&&g&&null===y.alternate&&t(r,g),s=o(y,s,v),null===u?d=y:u.sibling=y,u=y,g=m}if(b.done)return n(r,g),Fr&&Nr(r,v),d;if(null===g){for(;!b.done;v++,b=l.next())null!==(b=h(r,b.value,c))&&(s=o(b,s,v),null===u?d=b:u.sibling=b,u=b);return Fr&&Nr(r,v),d}for(g=i(g);!b.done;v++,b=l.next())null!==(b=f(g,r,v,b.value,c))&&(e&&null!==(m=b.alternate)&&g.delete(null===m.key?v:m.key),s=o(b,s,v),null===u?d=b:u.sibling=b,u=b);return e&&g.forEach(function(e){return t(r,e)}),Fr&&Nr(r,v),d}(l,c,d=v.call(d),u)}if("function"==typeof d.then)return g(l,c,jo(d),u);if(d.$$typeof===D)return g(l,c,oo(l,d),u);Uo(l,d)}return"string"==typeof d&&""!==d||"number"==typeof d||"bigint"==typeof d?(d=""+d,null!==c&&6===c.tag?(n(l,c.sibling),(u=r(c,d)).return=l,l=u):(n(l,c),(u=vr(d,l.mode,u)).return=l,l=u),s(l)):n(l,c)}return function(e,t,n,i){try{Fo=0;var r=g(e,t,n,i);return Mo=null,r}catch(t){if(t===Eo||t===To)throw t;var o=dr(29,t,null,e.mode);return o.lanes=i,o.return=e,o}}}var Bo=$o(!0),Ho=$o(!1),Wo=!1;function Vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qo(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 Go(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ko(e,t,n){var i=e.updateQueue;if(null===i)return null;if(i=i.shared,2&Id){var r=i.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=sr(e),ar(e,null,n),t}return ir(e,i,t,n),sr(e)}function Yo(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,Je(e,n)}}function Qo(e,t){var n=e.updateQueue,i=e.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===o?r=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?r=o=t:o=o.next=t}else r=o=t;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Jo=!1;function Xo(){if(Jo&&null!==yo)throw yo}function Zo(e,t,n,i){Jo=!1;var r=e.updateQueue;Wo=!1;var o=r.firstBaseUpdate,a=r.lastBaseUpdate,s=r.shared.pending;if(null!==s){r.shared.pending=null;var l=s,c=l.next;l.next=null,null===a?o=c:a.next=c,a=l;var d=e.alternate;null!==d&&(s=(d=d.updateQueue).lastBaseUpdate)!==a&&(null===s?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l)}if(null!==o){var u=r.baseState;for(a=0,d=c=l=null,s=o;;){var h=-536870913&s.lane,p=h!==s.lane;if(p?(Nd&h)===h:(i&h)===h){0!==h&&h===bo&&(Jo=!0),null!==d&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var f=e,g=s;h=t;var v=n;switch(g.tag){case 1:if("function"==typeof(f=g.payload)){u=f.call(v,u,h);break e}u=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null==(h="function"==typeof(f=g.payload)?f.call(v,u,h):f))break e;u=E({},u,h);break e;case 2:Wo=!0}}null!==(h=s.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=r.callbacks)?r.callbacks=[h]:p.push(h))}else p={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(c=d=p,l=u):d=d.next=p,a|=h;if(null===(s=s.next)){if(null===(s=r.shared.pending))break;s=(p=s).next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}null===d&&(l=u),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=d,null===o&&(r.shared.lanes=0),jd|=a,e.lanes=a,e.memoizedState=u}}function ea(e,t){if("function"!=typeof e)throw Error(a(191,e));e.call(t)}function ta(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)ea(n[e],t)}var na=te(null),ia=te(0);function ra(e,t){ie(ia,e=Md),ie(na,t),Md=e|t.baseLanes}function oa(){ie(ia,Md),ie(na,na.current)}function aa(){Md=ia.current,ne(na),ne(ia)}var sa=te(null),la=null;function ca(e){var t=e.alternate;ie(fa,1&fa.current),ie(sa,e),null===la&&(null===t||null!==na.current||null!==t.memoizedState)&&(la=e)}function da(e){ie(fa,fa.current),ie(sa,e),null===la&&(la=e)}function ua(e){22===e.tag?(ie(fa,fa.current),ie(sa,e),null===la&&(la=e)):ha()}function ha(){ie(fa,fa.current),ie(sa,sa.current)}function pa(e){ne(sa),la===e&&(la=null),ne(fa)}var fa=te(0);function ga(e,t){ie(sa,sa.current),ie(fa,t)}function va(e){ne(fa),ne(sa),la===e&&(la=null)}function ma(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Ep(n)||Ip(n)))return t}else if(19===t.tag&&"independent"!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ba=0,ya=null,wa=null,ka=null,_a=!1,Sa=!1,xa=!1,Ca=0,Ea=0,Ia=null,Ta=0;function Ra(){throw Error(a(321))}function Na(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yi(e[n],t[n]))return!1;return!0}function Oa(e,t,n,i,r,o){return ba=o,ya=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Q.H=null===e||null===e.memoizedState?qs:Gs,xa=!1,o=n(i,r),xa=!1,Sa&&(o=La(t,n,i,r)),Aa(e),o}function Aa(e){Q.H=Vs;var t=null!==wa&&null!==wa.next;if(ba=0,ka=wa=ya=null,_a=!1,Ea=0,Ia=null,t)throw Error(a(300));null===e||cl||null!==(e=e.dependencies)&&no(e)&&(cl=!0)}function La(e,t,n,i){ya=e;var r=0;do{if(Sa&&(Ia=null),Ea=0,Sa=!1,25<=r)throw Error(a(301));if(r+=1,ka=wa=null,null!=e.updateQueue){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,null!=o.memoCache&&(o.memoCache.index=0)}Q.H=Ks,o=t(n,i)}while(Sa);return o}function Da(){var e=Q.H,t=e.useState()[0];return t="function"==typeof t.then?Ua(t):t,e=e.useState()[0],(null!==wa?wa.memoizedState:null)!==e&&(ya.flags|=1024),t}function Pa(){var e=0!==Ca;return Ca=0,e}function Ma(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Fa(e){if(_a){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}_a=!1}ba=0,ka=wa=ya=null,Sa=!1,Ea=Ca=0,Ia=null}function ja(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ka?ya.memoizedState=ka=e:ka=ka.next=e,ka}function za(){if(null===wa){var e=ya.alternate;e=null!==e?e.memoizedState:null}else e=wa.next;var t=null===ka?ya.memoizedState:ka.next;if(null!==t)ka=t,wa=e;else{if(null===e){if(null===ya.alternate)throw Error(a(467));throw Error(a(310))}e={memoizedState:(wa=e).memoizedState,baseState:wa.baseState,baseQueue:wa.baseQueue,queue:wa.queue,next:null},null===ka?ya.memoizedState=ka=e:ka=ka.next=e}return ka}function Ua(e){var t=Ea;return Ea+=1,null===Ia&&(Ia=[]),e=Oo(Ia,e,t),t=ya,null===(null===ka?t.memoizedState:ka.next)&&(t=t.alternate,Q.H=null===t||null===t.memoizedState?qs:Gs),e}function $a(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return Ua(e);if(e.$$typeof===W)return;if(e.$$typeof===D)return ro(e)}throw Error(a(438,String(e)))}function Ba(e){var t=null,n=ya.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var i=ya.alternate;null!==i&&null!==(i=i.updateQueue)&&null!=(i=i.memoCache)&&(t={data:i.data.map(function(e){return e.slice()}),index:0})}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=B;return t.index++,n}function Ha(e,t){return"function"==typeof t?t(e):t}function Wa(e){return Va(za(),wa,e)}function Va(e,t,n){var i=e.queue;if(null===i)throw Error(a(311));i.lastRenderedReducer=n;var r=e.baseQueue,o=i.pending;if(null!==o){if(null!==r){var s=r.next;r.next=o.next,o.next=s}t.baseQueue=r=o,i.pending=null}if(o=e.baseState,null===r)e.memoizedState=o;else{var l=s=null,c=null,d=t=r.next,u=!1;do{var h=-536870913&d.lane;if(h!==d.lane?(Nd&h)===h:(ba&h)===h){var p=d.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),h===bo&&(u=!0);else{if((ba&p)===p){d=d.next,p===bo&&(u=!0);continue}h={lane:0,revertLane:d.revertLane,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},null===c?(l=c=h,s=o):c=c.next=h,ya.lanes|=p,jd|=p}h=d.action,xa&&n(o,h),o=d.hasEagerState?d.eagerState:n(o,h)}else p={lane:h,revertLane:d.revertLane,gesture:d.gesture,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},null===c?(l=c=p,s=o):c=c.next=p,ya.lanes|=h,jd|=h;d=d.next}while(null!==d&&d!==t);if(null===c?s=o:c.next=l,!yi(o,e.memoizedState)&&(cl=!0,u&&null!==(n=yo)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=c,i.lastRenderedState=o}return null===r&&(i.lanes=0),[e.memoizedState,i.dispatch]}function qa(e){var t=za(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,o=t.memoizedState;if(null!==r){n.pending=null;var s=r=r.next;do{o=e(o,s.action),s=s.next}while(s!==r);yi(o,t.memoizedState)||(cl=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Ga(e,t,n){var i=ya,r=za(),o=Fr;if(o){if(void 0===n)throw Error(a(407));n=n()}else n=t();var s=!yi((wa||r).memoizedState,n);if(s&&(r.memoizedState=n,cl=!0),r=r.queue,bs(Qa.bind(null,i,r,e),[e]),ps((e=r.getSnapshot!==t||s||null!==ka&&!!(1&ka.memoizedState.tag))?9:8,{destroy:void 0},Ya.bind(null,i,r,n,t),null),e){if(i.flags|=2048,null===Td)throw Error(a(349));o||127&ba||Ka(i,t,n)}return n}function Ka(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ya.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ya(e,t,n,i){t.value=n,t.getSnapshot=i,Ja(t)&&Xa(e)}function Qa(e,t,n){return n(function(){Ja(t)&&Xa(e)})}function Ja(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yi(e,n)}catch(e){return!0}}function Xa(e){var t=or(e,2);null!==t&&hu(t,0,2)}function Za(e){var t=ja();if("function"==typeof e){var n=e;if(e=n(),xa){Pe(!0);try{n()}finally{Pe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:e},t}function es(e,t,n,i){return e.baseState=n,Va(e,wa,"function"==typeof i?i:Ha)}function ts(e,t,n,i,r){if(Bs(e))throw Error(a(485));if(null!==(e=t.action)){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};null!==Q.T?n(!0):o.isTransition=!1,i(o),null===(n=t.pending)?(o.next=t.pending=o,ns(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ns(e,t){var n=t.action,i=t.payload,r=e.state;if(t.isTransition){var o=Q.T,a={};a.types=null!==o?o.types:null,Q.T=a;try{var s=n(r,i),l=Q.S;null!==l&&l(a,s),is(e,t,s)}catch(n){os(e,t,n)}finally{null!==o&&null!==a.types&&(o.types=a.types),Q.T=o}}else try{is(e,t,o=n(r,i))}catch(n){os(e,t,n)}}function is(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){rs(e,t,n)},function(n){return os(e,t,n)}):rs(e,t,n)}function rs(e,t,n){t.status="fulfilled",t.value=n,as(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,ns(e,n)))}function os(e,t,n){var i=e.pending;if(e.pending=null,null!==i){i=i.next;do{t.status="rejected",t.reason=n,as(t),t=t.next}while(t!==i)}e.action=null}function as(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ss(e,t){return t}function ls(e,t){if(Fr){var n=Td.formState;if(null!==n){e:{var i=ya;if(Fr){if(Mr){t:{for(var r=Mr,o=zr;8!==r.nodeType;){if(!o){r=null;break t}if(null===(r=Tp(r.nextSibling))){r=null;break t}}r="F!"===(o=r.data)||"F"===o?r:null}if(r){Mr=Tp(r.nextSibling),i="F!"===r.data;break e}}$r(i)}i=!1}i&&(t=n[0])}}return(n=ja()).memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:t},n.queue=i,n=zs.bind(null,ya,i),i.dispatch=n,i=Za(!1),o=$s.bind(null,ya,!1,i.queue),r={state:t,dispatch:null,action:e,pending:null},(i=ja()).queue=r,n=ts.bind(null,ya,r,o,n),r.dispatch=n,i.memoizedState=e,[t,n,!1]}function cs(e){return ds(za(),wa,e)}function ds(e,t,n){if(t=Va(e,t,ss)[0],e=Wa(Ha)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var i=Ua(t)}catch(e){if(e===Eo)throw To;throw e}else i=t;var r=(t=za()).queue,o=r.dispatch;return n!==t.memoizedState&&(ya.flags|=2048,ps(9,{destroy:void 0},us.bind(null,r,n),null)),[i,o,e]}function us(e,t){e.action=t}function hs(e){var t=za(),n=wa;if(null!==n)return ds(t,n,e);za(),t=t.memoizedState;var i=(n=za()).queue.dispatch;return n.memoizedState=e,[t,i,!1]}function ps(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},null===(t=ya.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function fs(){return za().memoizedState}function gs(e,t,n,i){var r=ja();ya.flags|=e,r.memoizedState=ps(1|t,{destroy:void 0},n,void 0===i?null:i)}function vs(e,t,n,i){var r=za();i=void 0===i?null:i;var o=r.memoizedState.inst;null!==wa&&null!==i&&Na(i,wa.memoizedState.deps)?r.memoizedState=ps(t,o,n,i):(ya.flags|=e,r.memoizedState=ps(1|t,o,n,i))}function ms(e,t){gs(8390656,8,e,t)}function bs(e,t){vs(2048,8,e,t)}function ys(e){var t=za().memoizedState;return function(e){ya.flags|=4;var t=ya.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(2&Id)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ws(e,t){return vs(4,2,e,t)}function ks(e,t){return vs(4,4,e,t)}function _s(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Ss(e,t,n){n=null!=n?n.concat([e]):null,vs(4,4,_s.bind(null,t,e),n)}function xs(){}function Cs(e,t){var n=za();t=void 0===t?null:t;var i=n.memoizedState;return null!==t&&Na(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Es(e,t){var n=za();t=void 0===t?null:t;var i=n.memoizedState;if(null!==t&&Na(t,i[1]))return i[0];if(i=e(),xa){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[i,t],i}function Is(e,t,n){return void 0===n||1073741824&ba&&!(261930&Nd)?e.memoizedState=t:(e.memoizedState=n,e=du(),ya.lanes|=e,jd|=e,n)}function Ts(e,t,n,i){return yi(n,t)?n:null!==na.current?(e=Is(e,n,i),yi(e,t)||(cl=!0),e):106&ba&&(!(1073741824&ba)||261930&Nd)?(e=du(),ya.lanes|=e,jd|=e,t):(cl=!0,e.memoizedState=n)}function Rs(e,t,n,i,r){var o=J.p;J.p=0!==o&&8>o?o:8;var a,s,l,c=Q.T,d={};d.types=null!==c?c.types:null,Q.T=d,$s(e,!1,t,n);try{var u=r(),h=Q.S;null!==h&&h(d,u),null!==u&&"object"==typeof u&&"function"==typeof u.then?Us(e,t,(a=i,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},u.then(function(){l.status="fulfilled",l.value=a;for(var e=0;e<s.length;e++)(0,s[e])(a)},function(e){for(l.status="rejected",l.reason=e,e=0;e<s.length;e++)(0,s[e])(void 0)}),l),cu()):Us(e,t,i,cu())}catch(n){Us(e,t,{then:function(){},status:"rejected",reason:n},cu())}finally{J.p=o,null!==c&&null!==d.types&&(c.types=d.types),Q.T=c}}function Ns(){}function Os(e,t,n,i){if(5!==e.tag)throw Error(a(476));var r=As(e).queue;Rs(e,r,t,X,null===n?Ns:function(){return Ls(e),n(i)})}function As(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:X},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function Ls(e){var t=As(e);null===t.next&&(t=e.alternate.memoizedState),Us(e,t.next.queue,{},cu())}function Ds(){return ro(hf)}function Ps(){return za().memoizedState}function Ms(){return za().memoizedState}function Fs(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=cu(),i=Ko(t,e=Go(n),n);return null!==i&&(hu(i,0,n),Yo(i,t,n)),t={cache:ho()},void(e.payload=t)}t=t.return}}function js(e,t,n){var i=cu();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bs(e)?Hs(t,n):null!==(n=rr(e,t,n,i))&&(hu(n,0,i),Ws(n,t,i))}function zs(e,t,n){Us(e,t,n,cu())}function Us(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bs(e))Hs(t,r);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=o(a,n);if(r.hasEagerState=!0,r.eagerState=s,yi(s,a))return ir(e,t,r,0),null===Td&&nr(),!1}catch(e){}if(null!==(n=rr(e,t,r,i)))return hu(n,0,i),Ws(n,t,i),!0}return!1}function $s(e,t,n,i){if(i={lane:2,revertLane:lh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Bs(e)){if(t)throw Error(a(479))}else null!==(t=rr(e,n,i,2))&&hu(t,0,2)}function Bs(e){var t=e.alternate;return e===ya||null!==t&&t===ya}function Hs(e,t){Sa=_a=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ws(e,t,n){if(4194048&n){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,Je(e,n)}}var Vs={readContext:ro,use:$a,useCallback:Ra,useContext:Ra,useEffect:Ra,useImperativeHandle:Ra,useLayoutEffect:Ra,useInsertionEffect:Ra,useMemo:Ra,useReducer:Ra,useRef:Ra,useState:Ra,useDebugValue:Ra,useDeferredValue:Ra,useTransition:Ra,useSyncExternalStore:Ra,useId:Ra,useHostTransitionStatus:Ra,useFormState:Ra,useActionState:Ra,useOptimistic:Ra,useMemoCache:Ra,useCacheRefresh:Ra,useEffectEvent:Ra},qs={readContext:ro,use:$a,useCallback:function(e,t){return ja().memoizedState=[e,void 0===t?null:t],e},useContext:ro,useEffect:ms,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,gs(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gs(4194308,4,e,t)},useInsertionEffect:function(e,t){gs(4,2,e,t)},useMemo:function(e,t){var n=ja();t=void 0===t?null:t;var i=e();if(xa){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=ja();if(void 0!==n){var r=n(t);if(xa){Pe(!0);try{n(t)}finally{Pe(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=js.bind(null,ya,e),[i.memoizedState,e]},useRef:function(e){return e={current:e},ja().memoizedState=e},useState:function(e){var t=(e=Za(e)).queue,n=zs.bind(null,ya,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xs,useDeferredValue:function(e,t){return Is(ja(),e,t)},useTransition:function(){var e=Za(!1);return e=Rs.bind(null,ya,e.queue,!0,!1),ja().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=ya,r=ja();if(Fr){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===Td)throw Error(a(349));127&Nd||Ka(i,t,n)}r.memoizedState=n;var o={value:n,getSnapshot:t};return r.queue=o,ms(Qa.bind(null,i,o,e),[e]),i.flags|=2048,ps(9,{destroy:void 0},Ya.bind(null,i,o,n,t),null),n},useId:function(){var e=ja(),t=Td.identifierPrefix;if(Fr){var n=Rr;t="_"+t+"R_"+(n=(Tr&~(1<<32-Me(Tr)-1)).toString(32)+n),0<(n=Ca++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=Ta++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:ls,useActionState:ls,useOptimistic:function(e){var t=ja();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=$s.bind(null,ya,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ba,useCacheRefresh:function(){return ja().memoizedState=Fs.bind(null,ya)},useEffectEvent:function(e){var t=ja(),n={impl:e};return t.memoizedState=n,function(){if(2&Id)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Gs={readContext:ro,use:$a,useCallback:Cs,useContext:ro,useEffect:bs,useImperativeHandle:Ss,useInsertionEffect:ws,useLayoutEffect:ks,useMemo:Es,useReducer:Wa,useRef:fs,useState:function(){return Wa(Ha)},useDebugValue:xs,useDeferredValue:function(e,t){return Ts(za(),wa.memoizedState,e,t)},useTransition:function(){var e=Wa(Ha)[0],t=za().memoizedState;return["boolean"==typeof e?e:Ua(e),t]},useSyncExternalStore:Ga,useId:Ps,useHostTransitionStatus:Ds,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){return es(za(),0,e,t)},useMemoCache:Ba,useCacheRefresh:Ms,useEffectEvent:ys},Ks={readContext:ro,use:$a,useCallback:Cs,useContext:ro,useEffect:bs,useImperativeHandle:Ss,useInsertionEffect:ws,useLayoutEffect:ks,useMemo:Es,useReducer:qa,useRef:fs,useState:function(){return qa(Ha)},useDebugValue:xs,useDeferredValue:function(e,t){var n=za();return null===wa?Is(n,e,t):Ts(n,wa.memoizedState,e,t)},useTransition:function(){var e=qa(Ha)[0],t=za().memoizedState;return["boolean"==typeof e?e:Ua(e),t]},useSyncExternalStore:Ga,useId:Ps,useHostTransitionStatus:Ds,useFormState:hs,useActionState:hs,useOptimistic:function(e,t){var n=za();return null!==wa?es(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Ba,useCacheRefresh:Ms,useEffectEvent:ys};function Ys(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:E({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Qs={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=cu(),r=Go(i);r.payload=t,null!=n&&(r.callback=n),null!==(t=Ko(e,r,i))&&(hu(t,0,i),Yo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=cu(),r=Go(i);r.tag=1,r.payload=t,null!=n&&(r.callback=n),null!==(t=Ko(e,r,i))&&(hu(t,0,i),Yo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=cu(),i=Go(n);i.tag=2,null!=t&&(i.callback=t),null!==(t=Ko(e,i,n))&&(hu(t,0,n),Yo(t,e,n))}};function Js(e,t,n,i,r,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,o,a):!(t.prototype&&t.prototype.isPureReactComponent&&wi(n,i)&&wi(r,o))}function Xs(e,t,n,i){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Qs.enqueueReplaceState(t,t.state,null)}function Zs(e,t){var n=t;if("ref"in t)for(var i in n={},t)"ref"!==i&&(n[i]=t[i]);if(e=e.defaultProps)for(var r in n===t&&(n=E({},n)),e)void 0===n[r]&&(n[r]=e[r]);return n}function el(e){Xi(e)}function tl(e){console.error(e)}function nl(e){Xi(e)}function il(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function rl(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ol(e,t,n){return(n=Go(n)).tag=3,n.payload={element:null},n.callback=function(){il(e,t)},n}function al(e){return(e=Go(e)).tag=3,e}function sl(e,t,n,i){var r=n.type.getDerivedStateFromError;if("function"==typeof r){var o=i.value;e.payload=function(){return r(o)},e.callback=function(){rl(t,n,i)}}var a=n.stateNode;null!==a&&"function"==typeof a.componentDidCatch&&(e.callback=function(){rl(t,n,i),"function"!=typeof r&&(null===Qd?Qd=new Set([this]):Qd.add(this));var e=i.stack;this.componentDidCatch(i.value,{componentStack:null!==e?e:""})})}var ll=Error(a(461)),cl=!1;function dl(e,t,n,i){t.child=null===e?Ho(t,null,n,i):Bo(t,e.child,n,i)}function ul(e,t,n,i,r){n=n.render;var o=t.ref;if("ref"in i){var a={};for(var s in i)"ref"!==s&&(a[s]=i[s])}else a=i;return io(t),i=Oa(e,t,n,a,o,r),s=Pa(),null===e||cl?(Fr&&s&&Ar(t),t.flags|=1,dl(e,t,i,r),t.child):(Ma(e,t,r),Fl(e,t,r))}function hl(e,t,n,i,r){if(null===e){var o=n.type;return"function"!=typeof o||ur(o)||void 0!==o.defaultProps||null!==n.compare?((e=fr(n.type,null,i,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,pl(e,t,o,i,r))}if(o=e.child,!jl(e,r)){var a=o.memoizedProps;if((n=null!==(n=n.compare)?n:wi)(a,i)&&e.ref===t.ref)return Fl(e,t,r)}return t.flags|=1,(e=hr(o,i)).ref=t.ref,e.return=t,t.child=e}function pl(e,t,n,i,r){if(null!==e){var o=e.memoizedProps;if(wi(o,i)&&e.ref===t.ref){if(cl=!1,t.pendingProps=i=o,!jl(e,r))return t.lanes=e.lanes,Fl(e,t,r);131072&e.flags&&(cl=!0)}}return wl(e,t,n,i,r)}function fl(e,t,n,i){var r=i.children,o=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===i.mode){if(128&t.flags){if(o=null!==o?o.baseLanes|n:n,null!==e){for(i=t.child=e.child,r=0;null!==i;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~o}else i=0,t.child=null;return vl(e,t,o,n,i)}if(!(536870912&n))return i=t.lanes=536870912,vl(e,t,null!==o?o.baseLanes|n:n,n,i);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&xo(0,null!==o?o.cachePool:null),null!==o?ra(t,o):oa(),ua(t)}else null!==o?(xo(0,o.cachePool),ra(t,o),ha(),t.memoizedState=null):(null!==e&&xo(0,null),oa(),ha());return dl(e,t,r,n),t.child}function gl(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function vl(e,t,n,i,r){var o=So();return o=null===o?null:{parent:uo._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},null!==e&&xo(0,null),oa(),ua(t),null!==e&&to(e,t,i,!0),t.childLanes=r,null}function ml(e,t){return(t=Rl({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function bl(e,t,n){return Bo(t,e.child,null,n),(e=ml(t,t.pendingProps)).flags|=2,pa(t),t.memoizedState=null,e}function yl(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(a(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function wl(e,t,n,i,r){return io(t),n=Oa(e,t,n,i,void 0,r),i=Pa(),null===e||cl?(Fr&&i&&Ar(t),t.flags|=1,dl(e,t,n,r),t.child):(Ma(e,t,r),Fl(e,t,r))}function kl(e,t,n,i,r,o){return io(t),t.updateQueue=null,n=La(t,i,n,r),Aa(e),i=Pa(),null===e||cl?(Fr&&i&&Ar(t),t.flags|=1,dl(e,t,n,o),t.child):(Ma(e,t,o),Fl(e,t,o))}function _l(e,t,n,i,r){if(io(t),null===t.stateNode){var o=lr,a=n.contextType;"object"==typeof a&&null!==a&&(o=ro(a)),o=new n(i,o),t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,o.updater=Qs,t.stateNode=o,o._reactInternals=t,(o=t.stateNode).props=i,o.state=t.memoizedState,o.refs={},Vo(t),a=n.contextType,o.context="object"==typeof a&&null!==a?ro(a):lr,o.state=t.memoizedState,"function"==typeof(a=n.getDerivedStateFromProps)&&(Ys(t,n,a,i),o.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(a=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),a!==o.state&&Qs.enqueueReplaceState(o,o.state,null),Zo(t,i,o,r),Xo(),o.state=t.memoizedState),"function"==typeof o.componentDidMount&&(t.flags|=4194308),i=!0}else if(null===e){o=t.stateNode;var s=t.memoizedProps,l=Zs(n,s);o.props=l;var c=o.context,d=n.contextType;a=lr,"object"==typeof d&&null!==d&&(a=ro(d));var u=n.getDerivedStateFromProps;d="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate,s=t.pendingProps!==s,d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s||c!==a)&&Xs(t,o,i,a),Wo=!1;var h=t.memoizedState;o.state=h,Zo(t,i,o,r),Xo(),c=t.memoizedState,s||h!==c||Wo?("function"==typeof u&&(Ys(t,n,u,i),c=t.memoizedState),(l=Wo||Js(t,n,l,i,h,c,a))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),o.props=i,o.state=c,o.context=a,i=l):("function"==typeof o.componentDidMount&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,qo(e,t),d=Zs(n,a=t.memoizedProps),o.props=d,u=t.pendingProps,h=o.context,c=n.contextType,l=lr,"object"==typeof c&&null!==c&&(l=ro(c)),(c="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==u||h!==l)&&Xs(t,o,i,l),Wo=!1,h=t.memoizedState,o.state=h,Zo(t,i,o,r),Xo();var p=t.memoizedState;a!==u||h!==p||Wo||null!==e&&null!==e.dependencies&&no(e.dependencies)?("function"==typeof s&&(Ys(t,n,s,i),p=t.memoizedState),(d=Wo||Js(t,n,d,i,h,p,l)||null!==e&&null!==e.dependencies&&no(e.dependencies))?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(i,p,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(i,p,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=p),o.props=i,o.state=p,o.context=l,i=d):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return o=i,yl(e,t),i=!!(128&t.flags),o||i?(o=t.stateNode,n=i&&"function"!=typeof n.getDerivedStateFromError?null:o.render(),t.flags|=1,null!==e&&i?(t.child=Bo(t,e.child,null,r),t.child=Bo(t,null,n,r)):dl(e,t,n,r),t.memoizedState=o.state,e=t.child):e=Fl(e,t,r),e}function Sl(e,t,n,i){return Vr(),t.flags|=256,dl(e,t,n,i),t.child}var xl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cl(e){return{baseLanes:e,cachePool:Co()}}function El(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=$d),e}function Il(e,t,n){var i,r=t.pendingProps,o=!1,s=!!(128&t.flags);if((i=s)||(i=(null===e||null!==e.memoizedState)&&!!(2&fa.current)),i&&(o=!0,t.flags&=-129),i=!!(32&t.flags),t.flags&=-33,null===e){if(Fr){if(o?ca(t):ha(),(e=Mr)?null!==(e=null!==(e=Cp(e,zr))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==Ir?{id:Tr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},(n=mr(e)).return=t,t.child=n,Pr=t,Mr=null):e=null,null===e)throw $r(t);return Ip(e)?t.lanes=32:t.lanes=536870912,null}return s=r.children,r=r.fallback,o?(ha(),s=Rl({mode:"hidden",children:s},o=t.mode),r=gr(r,o,n,null),s.return=t,r.return=t,s.sibling=r,t.child=s,(r=t.child).memoizedState=Cl(n),r.childLanes=El(e,i,n),t.memoizedState=xl,gl(null,r)):(ca(t),Tl(t,s))}var l=e.memoizedState;if(null!==l){var c=l.dehydrated;if(null!==c)return function(e,t,n,i,r,o,s,l){if(n)return 256&t.flags?(ca(t),t.flags&=-257,Nl(e,t,l)):null!==t.memoizedState?(ha(),t.child=e.child,t.flags|=128,null):(ha(),o=r.fallback,s=t.mode,r=Rl({mode:"visible",children:r.children},s),(o=gr(o,s,l,null)).flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,Bo(t,e.child,null,l),(r=t.child).memoizedState=Cl(l),r.childLanes=El(e,i,l),t.memoizedState=xl,gl(null,r));if(ca(t),Ip(o)){if(i=o.nextSibling&&o.nextSibling.dataset)var c=i.dgst;return""!==(i=c)&&((r=Error(a(419))).stack="",r.digest=i,Gr({value:r,source:null,stack:null})),Nl(e,t,l)}if(cl||to(e,t,l,!1),i=0!==(l&e.childLanes),cl||i){if(null!==na.current)return Nl(e,t,l);if(null!==(i=Td)&&0!==(r=Xe(i,l))&&r!==s.retryLane)throw s.retryLane=r,or(e,r),hu(i,0,r),ll;return Ep(o)||xu(),Nl(e,t,l)}return Ep(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Mr=Tp(o.nextSibling),Pr=t,Fr=!0,jr=null,zr=!1,null!==e&&Dr(t,e),(t=Tl(t,r.children)).flags|=134221824,t)}(e,t,s,i,r,c,l,n)}return o?(ha(),o=r.fallback,s=t.mode,c=(l=e.child).sibling,(r=hr(l,{mode:"hidden",children:r.children})).subtreeFlags=1206910976&l.subtreeFlags,null!==c?o=hr(c,o):(o=gr(o,s,n,null)).flags|=2,o.return=t,r.return=t,r.sibling=o,t.child=r,gl(null,r),r=t.child,null===(o=e.child.memoizedState)?o=Cl(n):(null!==(s=o.cachePool)?(l=uo._currentValue,s=s.parent!==l?{parent:l,pool:l}:s):s=Co(),o={baseLanes:o.baseLanes|n,cachePool:s}),r.memoizedState=o,r.childLanes=El(e,i,n),t.memoizedState=xl,gl(e.child,r)):(ca(t),e=(n=e.child).sibling,(n=hr(n,{mode:"visible",children:r.children})).return=t,n.sibling=null,null!==e&&(null===(i=t.deletions)?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function Tl(e,t){return(t=Rl({mode:"visible",children:t},e.mode)).return=e,e.child=t}function Rl(e,t){return(e=dr(22,e,null,t)).lanes=0,e}function Nl(e,t,n){return Bo(t,e.child,null,n),(e=Tl(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ol(e,t,n){e.lanes|=t;var i=e.alternate;null!==i&&(i.lanes|=t),Zr(e.return,t,n)}function Al(e){for(var t=null;null!==e;){var n=e.alternate;null!==n&&null===ma(n)&&(t=e),e=e.sibling}return t}function Ll(e,t,n,i,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r,a.treeForkCount=o)}function Dl(e){var t=e.child;for(e.child=null;null!==t;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function Pl(e,t,n){var i=t.pendingProps,r=i.revealOrder,o=i.tail;i=i.children;var a=fa.current;if(128&t.flags)return ga(0,a),null;var s=!!(2&a);if(s?(a=1&a|2,t.flags|=128):a&=1,ga(0,a),"backwards"===r&&null!==e?(Dl(e),dl(e,t,i,n),Dl(e)):dl(e,t,i,n),i=Fr?xr:0,!s&&null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ol(e,n,t);else if(19===e.tag)Ol(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"backwards":null===(n=Al(t.child))?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null,Dl(t)),Ll(t,!0,r,null,o,i);break;case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===ma(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Ll(t,!0,n,null,o,i);break;case"together":Ll(t,!1,null,null,void 0,i);break;case"independent":t.memoizedState=null;break;default:null===(n=Al(t.child))?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Ll(t,!1,r,n,o,i)}return t.child}function Ml(e,t,n){var i=t.pendingProps;return Jr(0,t.type,i.value),dl(e,t,i.children,n),t.child}function Fl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),jd|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(to(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=hr(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=hr(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function jl(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!no(e))}function zl(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)cl=!0;else{if(!(jl(e,n)||128&t.flags))return cl=!1,function(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Jr(0,uo,e.memoizedState.cache),Vr();break;case 27:case 5:he(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Jr(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,da(t),null;break;case 13:var i=t.memoizedState;if(null!==i){if(null!==i.dehydrated)return ca(t),t.flags|=128,null;i=to(e,t,n,!1);var r=t.child.childLanes;return i||0!==(n&r)?Il(e,t,n):(ca(t),null!==(e=Fl(e,t,n))?e.sibling:null)}ca(t);break;case 19:if(128&t.flags)return Pl(e,t,n);if(r=!!(128&e.flags),(i=0!==(n&t.childLanes))||(to(e,t,n,!1),i=0!==(n&t.childLanes)),r){if(i)return Pl(e,t,n);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),ga(0,fa.current),i)break;return null;case 22:return t.lanes=0,fl(e,t,n,t.pendingProps);case 24:Jr(0,uo,e.memoizedState.cache)}return Fl(e,t,n)}(e,t,n);cl=!!(131072&e.flags)}else cl=!1,Fr&&1048576&t.flags&&Or(t,xr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ao(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var r=e.$$typeof;if(r===P){t.tag=11,t=ul(null,t,e,i,n);break e}if(r===j){t.tag=14,t=hl(null,t,e,i,n);break e}if(r===D){t.tag=10,t.type=e,t=Ml(null,t,n);break e}}throw t=K(e)||e,Error(a(306,t,""))}ur(e)?(i=Zs(e,i),t.tag=1,t=_l(null,t,e,i,n)):(t.tag=0,t=wl(null,t,e,i,n))}return t;case 0:return wl(e,t,t.type,t.pendingProps,n);case 1:return _l(e,t,i=t.type,r=Zs(i,t.pendingProps),n);case 3:e:{if(de(t,t.stateNode.containerInfo),null===e)throw Error(a(387));i=t.pendingProps;var o=t.memoizedState;r=o.element,qo(e,t),Zo(t,i,null,n);var s=t.memoizedState;if(i=s.cache,Jr(0,uo,i),i!==o.cache&&eo(t,[uo],n,!0),Xo(),i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Sl(e,t,i,n);break e}if(i!==r){Gr(r=wr(Error(a(424)),t)),t=Sl(e,t,i,n);break e}for(e=9===(e=t.stateNode.containerInfo).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,Mr=Tp(e.firstChild),Pr=t,Fr=!0,jr=null,zr=!0,n=Ho(t,null,i,n),t.child=n;n;)n.flags=-3&n.flags|134221824,n=n.sibling}else{if(Vr(),i===r){t=Fl(e,t,n);break e}dl(e,t,i,n)}t=t.child}return t;case 26:return yl(e,t),null===e?(n=$p(t.type,null,t.pendingProps,null))?t.memoizedState=n:Fr||(t.stateNode=zh(t.type,t.pendingProps,le.current,t)):t.memoizedState=$p(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return he(t),null===e&&Fr&&(i=t.stateNode=Ap(t.type,t.pendingProps,le.current),Pr=t,zr=!0,r=Mr,Kh(t.type)?(Rp=r,Mr=Tp(i.firstChild)):Mr=r),dl(e,t,t.pendingProps.children,n),yl(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&Fr&&((r=i=Mr)&&(null!==(i=function(e,t,n,i){for(;1===e.nodeType;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(i){if(!e[ut])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(o=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(null==r.href||""===r.href?null:r.href)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin)||e.getAttribute("title")!==(null==r.title?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((o=e.getAttribute("src"))!==(null==r.src?null:r.src)||e.getAttribute("type")!==(null==r.type?null:r.type)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var o=null==r.name?null:""+r.name;if("hidden"===r.type&&e.getAttribute("name")===o)return e}if(null===(e=Tp(e.nextSibling)))break}return null}(i,t.type,t.pendingProps,zr))?(t.stateNode=i,Pr=t,Mr=Tp(i.firstChild),zr=!1,r=!0):r=!1),r||$r(t)),he(t),r=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,i=o.children,Uh(r,o)?i=null:null!==s&&Uh(r,s)&&(t.flags|=32),null!==t.memoizedState&&(r=Oa(e,t,Da,null,null,n),hf._currentValue=r),yl(e,t),dl(e,t,i,n),t.child;case 6:return null===e&&Fr&&((e=n=Mr)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=Tp(e.nextSibling)))return null}return e}(n,t.pendingProps,zr))?(t.stateNode=n,Pr=t,Mr=null,e=!0):e=!1),e||$r(t)),null;case 13:return Il(e,t,n);case 4:return de(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=Bo(t,null,i,n):dl(e,t,i,n),t.child;case 11:return ul(e,t,t.type,t.pendingProps,n);case 7:return i=t.pendingProps,yl(e,t),dl(e,t,i,n),t.child;case 8:case 12:return dl(e,t,t.pendingProps.children,n),t.child;case 10:return Ml(e,t,n);case 9:return r=t.type._context,i=t.pendingProps.children,io(t),i=i(r=ro(r)),t.flags|=1,dl(e,t,i,n),t.child;case 14:return hl(e,t,t.type,t.pendingProps,n);case 15:return pl(e,t,t.type,t.pendingProps,n);case 19:return Pl(e,t,n);case 31:return function(e,t,n){var i=t.pendingProps,r=!!(128&t.flags);if(t.flags&=-129,null===e){if(Fr){if("hidden"===i.mode)return e=ml(t,i),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},gl(null,e);if(da(t),(e=Mr)?null!==(e=null!==(e=Cp(e,zr))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==Ir?{id:Tr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},(n=mr(e)).return=t,t.child=n,Pr=t,Mr=null):e=null,null===e)throw $r(t);return t.lanes=536870912,null}return ml(t,i)}var o=e.memoizedState;if(null!==o){var s=o.dehydrated;if(da(t),r)if(256&t.flags)t.flags&=-257,t=bl(e,t,n);else{if(null===t.memoizedState)throw Error(a(558));t.child=e.child,t.flags|=128,t=null}else if(cl||to(e,t,n,!1),r=0!==(n&e.childLanes),cl||r){if(null===na.current){if(null!==(i=Td)&&0!==(s=Xe(i,n))&&s!==o.retryLane)throw o.retryLane=s,or(e,s),hu(i,0,s),ll;xu()}t=bl(e,t,n)}else e=o.treeContext,Mr=Tp(s.nextSibling),Pr=t,Fr=!0,jr=null,zr=!1,null!==e&&Dr(t,e),(t=ml(t,i)).flags|=134221824;return t}return(e=hr(e.child,{mode:i.mode,children:i.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return fl(e,t,n,t.pendingProps);case 24:return io(t),i=ro(uo),null===e?(null===(r=So())&&(r=Td,o=ho(),r.pooledCache=o,o.refCount++,null!==o&&(r.pooledCacheLanes|=n),r=o),t.memoizedState={parent:i,cache:r},Vo(t),Jr(0,uo,r)):(0!==(e.lanes&n)&&(qo(e,t),Zo(t,null,null,n),Xo()),r=e.memoizedState,o=t.memoizedState,r.parent!==i?(r={parent:i,cache:i},t.memoizedState=r,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=r),Jr(0,uo,i)):(i=o.cache,Jr(0,uo,i),i!==r.cache&&eo(t,[uo],n,!0))),dl(e,t,t.pendingProps.children,n),t.child;case 30:return null===t.stateNode&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),null!=(i=t.pendingProps).name&&"auto"!==i.name?t.flags|=null===e?18882560:18874368:Fr&&Ar(t),null!==e&&e.memoizedProps.name!==i.name?t.flags|=4194816:yl(e,t),dl(e,t,i.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Ul(e){e.flags|=4}function $l(e,t,n,i,r){var o;if((o=!!(32&e.mode))&&(o=null===n?ef(t,i):ef(t,i)&&(i.src!==n.src||i.srcSet!==n.srcSet)),o){if(e.flags|=16777216,(335544128&r)===r)if(e.stateNode.complete)e.flags|=8192;else{if(!ku())throw Lo=Ro,Io;e.flags|=8192}}else e.flags&=-16777217}function Bl(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!tf(t)){if(!ku())throw Lo=Ro,Io;e.flags|=8192}}function Hl(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Ge():536870912,e.lanes|=t,Bd|=t)}function Wl(e,t){if(!Fr)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null;break;default:for(t=e.tail,n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null}}function Vl(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=1206910976&r.subtreeFlags,i|=1206910976&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function ql(e,t,n){var i=t.pendingProps;switch(Lr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return Vl(t),null;case 3:return n=t.stateNode,i=null,null!==e&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Xr(uo),ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(Wr(t)?Ul(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,qr())),Vl(t),null;case 26:var r=t.type,o=t.memoizedState;return null===e?(Ul(t),null!==o?(Vl(t),Bl(t,o)):(Vl(t),$l(t,r,null,i,n))):o?o!==e.memoizedState?(Ul(t),Vl(t),Bl(t,o)):(Vl(t),t.flags&=-16777217):((e=e.memoizedProps)!==i&&Ul(t),Vl(t),$l(t,r,e,i,n)),null;case 27:if(pe(t),n=le.current,r=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&Ul(t);else{if(!i){if(null===t.stateNode)throw Error(a(166));return Vl(t),t.subtreeFlags&=-33554433,null}e=ae.current,Wr(t)?Br(t):(e=Ap(r,i,n),t.stateNode=e,Ul(t))}return Vl(t),t.subtreeFlags&=-33554433,null;case 5:if(pe(t),r=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&Ul(t);else{if(!i){if(null===t.stateNode)throw Error(a(166));return Vl(t),t.subtreeFlags&=-33554433,null}if(o=ae.current,Wr(t))Br(t);else{var s=Mh(le.current);switch(o){case 1:o=s.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=s.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=s.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=s.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":(o=s.createElement("div")).innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o="string"==typeof i.is?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o="string"==typeof i.is?s.createElement(r,{is:i.is}):s.createElement(r)}}o[rt]=t,o[ot]=i;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)o.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;e:switch(Oh(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ul(t)}}return Vl(t),t.subtreeFlags&=-33554433,$l(t,t.type,null===e?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==i&&Ul(t);else{if("string"!=typeof i&&null===t.stateNode)throw Error(a(166));if(e=le.current,Wr(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,null!==(r=Pr))switch(r.tag){case 27:case 5:i=r.memoizedProps}e[rt]=t,(e=!!(e.nodeValue===n||null!==i&&!0===i.suppressHydrationWarning||Th(e.nodeValue,n)))||$r(t,!0)}else(e=Mh(e).createTextNode(i))[rt]=t,t.stateNode=e}return Vl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(i=Wr(t),null!==n){if(null===e){if(!i)throw Error(a(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(a(557));e[rt]=t}else Vr(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Vl(t),e=!1}else n=qr(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(pa(t),t):(pa(t),null);if(128&t.flags)throw Error(a(558))}return Vl(t),null;case 13:if(i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(r=Wr(t),null!==i&&null!==i.dehydrated){if(null===e){if(!r)throw Error(a(318));if(!(r=null!==(r=t.memoizedState)?r.dehydrated:null))throw Error(a(317));r[rt]=t}else Vr(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Vl(t),r=!1}else r=qr(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return 256&t.flags?(pa(t),t):(pa(t),null)}return pa(t),128&t.flags?(t.lanes=n,t):(n=null!==i,e=null!==e&&null!==e.memoizedState,n&&(r=null,null!==(i=t.child).alternate&&null!==i.alternate.memoizedState&&null!==i.alternate.memoizedState.cachePool&&(r=i.alternate.memoizedState.cachePool.pool),o=null,null!==i.memoizedState&&null!==i.memoizedState.cachePool&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Hl(t,t.updateQueue),Vl(t),null);case 4:return ue(),null===e&&bh(t.stateNode.containerInfo),t.flags|=67108864,Vl(t),null;case 10:return Xr(t.type),Vl(t),null;case 19:if(va(t),null===(i=t.memoizedState))return Vl(t),null;if(r=!!(128&t.flags),null===(o=i.rendering))if(r)Wl(i,!1);else{if(0!==Fd||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(o=ma(e))){for(t.flags|=128,Wl(i,!1),e=o.updateQueue,t.updateQueue=e,Hl(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)pr(n,e),n=n.sibling;return ga(0,1&fa.current|2),Fr&&Nr(t,i.treeForkCount),t.child}e=e.sibling}null!==i.tail&&xe()>Kd&&(t.flags|=128,r=!0,Wl(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=ma(o))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Hl(t,e),Wl(i,!0),null===i.tail&&"collapsed"!==i.tailMode&&"visible"!==i.tailMode&&!o.alternate&&!Fr)return Vl(t),null}else 2*xe()-i.renderingStartTime>Kd&&536870912!==n&&(t.flags|=128,r=!0,Wl(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=i.last)?e.sibling=o:t.child=o,i.last=o)}if(null!==i.tail){e:{for(n=e=i.tail;null!==n;){if(null!==n.alternate){n=!1;break e}n=n.sibling}n=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=xe(),e.sibling=null,o=fa.current,o=r?1&o|2:1&o,"visible"===i.tailMode||"collapsed"===i.tailMode||!n||Fr?ga(0,o):(n=o,ie(sa,t),ie(fa,n),null===la&&(la=t)),Fr&&Nr(t,i.treeForkCount),e}return Vl(t),null;case 22:case 23:return pa(t),aa(),i=null!==t.memoizedState,null!==e?null!==e.memoizedState!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?!!(536870912&n)&&!(128&t.flags)&&(Vl(t),6&t.subtreeFlags&&(t.flags|=8192)):Vl(t),null!==(n=t.updateQueue)&&Hl(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),i=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),null!==e&&ne(_o),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xr(uo),Vl(t),null;case 25:return null;case 30:return t.flags|=33554432,Vl(t),null}throw Error(a(156,t.tag))}function Gl(e,t){switch(Lr(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Xr(uo),ue(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(null!==t.memoizedState){if(pa(t),null===t.alternate)throw Error(a(340));Vr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(pa(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));Vr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return va(t),65536&(e=t.flags)?(t.flags=-65537&e|128,null!==(e=t.memoizedState)&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ue(),null;case 10:return Xr(t.type),null;case 22:case 23:return pa(t),aa(),null!==e&&ne(_o),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return Xr(uo),null;default:return null}}function Kl(e,t){switch(Lr(t),t.tag){case 3:Xr(uo),ue();break;case 26:case 27:case 5:pe(t);break;case 4:ue();break;case 31:null!==t.memoizedState&&pa(t);break;case 13:pa(t);break;case 19:va(t);break;case 10:Xr(t.type);break;case 22:case 23:pa(t),aa(),null!==e&&ne(_o);break;case 24:Xr(uo)}}function Yl(e,t){try{var n=t.updateQueue,i=null!==n?n.lastEffect:null;if(null!==i){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var o=n.create,a=n.inst;i=o(),a.destroy=i}n=n.next}while(n!==r)}}catch(e){Hu(t,t.return,e)}}function Ql(e,t,n){try{var i=t.updateQueue,r=null!==i?i.lastEffect:null;if(null!==r){var o=r.next;i=o;do{if((i.tag&e)===e){var a=i.inst,s=a.destroy;if(void 0!==s){a.destroy=void 0,r=t;var l=n,c=s;try{c()}catch(e){Hu(r,l,e)}}}i=i.next}while(i!==o)}}catch(e){Hu(t,t.return,e)}}function Jl(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{ta(t,n)}catch(t){Hu(e,e.return,t)}}}function Xl(e,t,n){n.props=Zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Hu(e,t,n)}}function Zl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var r=e.stateNode,o=Yi(e.memoizedProps,r);null!==r.ref&&r.ref.name===o||(r.ref=rp(o)),i=r.ref;break;case 7:if(null===e.stateNode){var a=new op(e);f(e.child,!1,wp,a,void 0,void 0),e.stateNode=a}i=e.stateNode;break;default:i=e.stateNode}"function"==typeof n?e.refCleanup=n(i):n.current=i}}catch(n){Hu(e,t,n)}}function ec(e,t){var n=e.ref,i=e.refCleanup;if(null!==n)if("function"==typeof i)try{i()}catch(n){Hu(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Hu(e,t,n)}else n.current=null}function tc(e,t){if((5===e.tag||27===e.tag||6===e.tag)&&null===e.alternate&&null!==t)for(var n=0;n<t.length;n++)_p(e.stateNode,t[n])}function nc(e){for(var t=e.return;null!==t&&(oc(t)&&_p(e.stateNode,t.stateNode),!rc(t));)t=t.return}function ic(e){for(var t=e.return;null!==t&&(oc(t)&&Sp(e.stateNode,t.stateNode),!rc(t));)t=t.return}function rc(e){return 5===e.tag||3===e.tag||27===e.tag}function oc(e){return e&&7===e.tag&&null!==e.stateNode}function ac(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(t){Hu(e,e.return,t)}}function sc(e,t,n){try{var i=e.stateNode;!function(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 r=null,o=null,s=null,l=null,c=null,d=null,u=null;for(f in n){var h=n[f];if(n.hasOwnProperty(f)&&null!=h)switch(f){case"checked":case"value":break;case"defaultValue":c=h;default:i.hasOwnProperty(f)||Rh(e,t,f,null,i,h)}}for(var p in i){var f=i[p];if(h=n[p],i.hasOwnProperty(p)&&(null!=f||null!=h))switch(p){case"type":f!==h&&(It=!0),o=f;break;case"name":f!==h&&(It=!0),r=f;break;case"checked":f!==h&&(It=!0),d=f;break;case"defaultChecked":f!==h&&(It=!0),u=f;break;case"value":f!==h&&(It=!0),s=f;break;case"defaultValue":f!==h&&(It=!0),l=f;break;case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(a(137,t));break;default:f!==h&&Rh(e,t,p,f,i,h)}}return void jt(e,s,l,c,d,u,o,r);case"select":for(o in f=s=l=p=null,n)if(c=n[o],n.hasOwnProperty(o)&&null!=c)switch(o){case"value":break;case"multiple":f=c;default:i.hasOwnProperty(o)||Rh(e,t,o,null,i,c)}for(r in i)if(o=i[r],c=n[r],i.hasOwnProperty(r)&&(null!=o||null!=c))switch(r){case"value":o!==c&&(It=!0),p=o;break;case"defaultValue":o!==c&&(It=!0),l=o;break;case"multiple":o!==c&&(It=!0),s=o;default:o!==c&&Rh(e,t,r,o,i,c)}return t=l,n=s,i=f,void(null!=p?$t(e,!!n,p,!1):!!i!=!!n&&(null!=t?$t(e,!!n,t,!0):$t(e,!!n,n?[]:"",!1)));case"textarea":for(l in f=p=null,n)if(r=n[l],n.hasOwnProperty(l)&&null!=r&&!i.hasOwnProperty(l))switch(l){case"value":case"children":break;default:Rh(e,t,l,null,i,r)}for(s in i)if(r=i[s],o=n[s],i.hasOwnProperty(s)&&(null!=r||null!=o))switch(s){case"value":r!==o&&(It=!0),p=r;break;case"defaultValue":r!==o&&(It=!0),f=r;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=r)throw Error(a(91));break;default:r!==o&&Rh(e,t,s,r,i,o)}return void Bt(e,p,f);case"option":for(var g in n)p=n[g],n.hasOwnProperty(g)&&null!=p&&!i.hasOwnProperty(g)&&("selected"===g?e.selected=!1:Rh(e,t,g,null,i,p));for(c in i)p=i[c],f=n[c],!i.hasOwnProperty(c)||p===f||null==p&&null==f||("selected"===c?(p!==f&&(It=!0),e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p):Rh(e,t,c,p,i,f));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 v in n)p=n[v],n.hasOwnProperty(v)&&null!=p&&!i.hasOwnProperty(v)&&Rh(e,t,v,null,i,p);for(d in i)if(p=i[d],f=n[d],i.hasOwnProperty(d)&&p!==f&&(null!=p||null!=f))switch(d){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(a(137,t));break;default:Rh(e,t,d,p,i,f)}return;default:if(Kt(t)){for(var m in n)p=n[m],n.hasOwnProperty(m)&&void 0!==p&&!i.hasOwnProperty(m)&&Nh(e,t,m,void 0,i,p);for(u in i)p=i[u],f=n[u],!i.hasOwnProperty(u)||p===f||void 0===p&&void 0===f||Nh(e,t,u,p,i,f);return}}for(var b in n)p=n[b],n.hasOwnProperty(b)&&null!=p&&!i.hasOwnProperty(b)&&Rh(e,t,b,null,i,p);for(h in i)p=i[h],f=n[h],!i.hasOwnProperty(h)||p===f||null==p&&null==f||Rh(e,t,h,p,i,f)}(i,e.type,n,t),i[ot]=t}catch(t){Hu(e,e.return,t)}}function lc(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Kh(e.type)||4===e.tag}function cc(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||lc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Kh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function dc(e,t,n,i){var r=e.tag;if(5===r||6===r)r=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(r,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(r),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Xt)),tc(e,i),It=!0;else if(4!==r&&(27===r&&(tc(e,i),i=null,Kh(e.type)&&(n=e.stateNode,t=null)),null!==(e=e.child)))for(dc(e,t,n,i),e=e.sibling;null!==e;)dc(e,t,n,i),e=e.sibling}function uc(e,t,n,i){var r=e.tag;if(5===r||6===r)r=e.stateNode,t?n.insertBefore(r,t):n.appendChild(r),tc(e,i),It=!0;else if(4!==r&&(27===r&&(tc(e,i),i=null,Kh(e.type)&&(n=e.stateNode)),null!==(e=e.child)))for(uc(e,t,n,i),e=e.sibling;null!==e;)uc(e,t,n,i),e=e.sibling}function hc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Oh(t,i,n),t[rt]=e,t[ot]=n}catch(t){Hu(e,e.return,t)}}var pc=!1,fc=null;function gc(e){(30===e.tag||33554432&e.subtreeFlags)&&(pc=!0)}var vc=null;function mc(){var e=vc;return vc=null,e}var bc=0;function yc(e,t,n,i,r){return bc=0,wc(e.child,t,n,i,r)}function wc(e,t,n,i,r){for(var o=!1;null!==e;){if(5===e.tag){var a=e.stateNode;if(null!==i){var s=ep(a);i.push(s),s.view&&(o=!0)}else o||ep(a).view&&(o=!0);pc=!0,Jh(a,0===bc?t:t+"_"+bc,n),bc++}else 22===e.tag&&null!==e.memoizedState||30===e.tag&&r||wc(e.child,t,n,i,r)&&(o=!0);e=e.sibling}return o}function kc(e,t){for(;null!==e;)5===e.tag?Xh(e.stateNode,e.memoizedProps):22===e.tag&&null!==e.memoizedState||30===e.tag&&t||kc(e.child,t),e=e.sibling}function _c(e){if(18874368&e.subtreeFlags)for(e=e.child;null!==e;){if((22!==e.tag||null===e.memoizedState)&&(_c(e),30===e.tag&&18874368&e.flags&&e.stateNode.paired)){var t=e.memoizedProps;if(null==t.name||"auto"===t.name)throw Error(a(544));var n=t.name;"none"!==(t=Ji(t.default,t.share))&&(yc(e,n,t,null,!1)||kc(e.child,!1))}e=e.sibling}}function Sc(e,t){if(30===e.tag){var n=e.stateNode,i=e.memoizedProps,r=Yi(i,n),o=Ji(i.default,n.paired?i.share:i.enter);"none"!==o?yc(e,r,o,null,!1)?(_c(e),n.paired||t||uu(e,i.onEnter)):kc(e.child,!1):_c(e)}else if(33554432&e.subtreeFlags)for(e=e.child;null!==e;)Sc(e,t),e=e.sibling;else _c(e)}function xc(e){if(null!==fc&&0!==fc.size){var t=fc;if(18874368&e.subtreeFlags)for(e=e.child;null!==e;){if(22!==e.tag||null===e.memoizedState){if(30===e.tag&&18874368&e.flags){var n=e.memoizedProps,i=n.name;if(null!=i&&"auto"!==i){var r=t.get(i);if(void 0!==r){var o=Ji(n.default,n.share);if("none"!==o&&(yc(e,i,o,null,!1)?(o=e.stateNode,r.paired=o,o.paired=r,uu(e,n.onShare)):kc(e.child,!1)),t.delete(i),0===t.size)break}}}xc(e)}e=e.sibling}}}function Cc(e){if(30===e.tag){var t=e.memoizedProps,n=Yi(t,e.stateNode),i=null!==fc?fc.get(n):void 0,r=Ji(t.default,void 0!==i?t.share:t.exit);"none"!==r&&(yc(e,n,r,null,!1)?void 0!==i?(r=e.stateNode,i.paired=r,r.paired=i,fc.delete(n),uu(e,t.onShare)):uu(e,t.onExit):kc(e.child,!1)),null!==fc&&xc(e)}else if(33554432&e.subtreeFlags)for(e=e.child;null!==e;)Cc(e),e=e.sibling;else null!==fc&&xc(e)}function Ec(e){for(e=e.child;null!==e;){if(30===e.tag){var t=e.memoizedProps,n=Yi(t,e.stateNode);t=Ji(t.default,t.update),e.flags&=-5,"none"!==t&&yc(e,n,t,e.memoizedState=[],!1)}else 33554432&e.subtreeFlags&&Ec(e);e=e.sibling}}function Ic(e){if(18874368&e.subtreeFlags)for(e=e.child;null!==e;){if(22!==e.tag||null===e.memoizedState){if(30===e.tag&&18874368&e.flags){var t=e.stateNode;null!==t.paired&&(t.paired=null,kc(e.child,!1))}Ic(e)}e=e.sibling}}function Tc(e){if(30===e.tag)e.stateNode.paired=null,kc(e.child,!1),Ic(e);else if(33554432&e.subtreeFlags)for(e=e.child;null!==e;)Tc(e),e=e.sibling;else Ic(e)}function Rc(e){for(e=e.child;null!==e;)30===e.tag?kc(e.child,!1):!!(33554432&e.subtreeFlags)&&Rc(e),e=e.sibling}function Nc(e,t,n,i,r,o,a){for(var s=!1;null!==t;){if(5===t.tag){var l=t.stateNode;if(null!==o&&bc<o.length){var c,d=o[bc],u=ep(l);if((d.view||u.view)&&(s=!0),c=!(4&e.flags))if(u.clip)c=!0;else{c=d.rect;var h=u.rect;c=c.y!==h.y||c.x!==h.x||c.height!==h.height||c.width!==h.width}c&&(e.flags|=4),u.abs?u=!d.abs:(d=d.rect,u=u.rect,u=d.height!==u.height||d.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;4&e.flags&&Jh(l,0===bc?n:n+"_"+bc,r),s&&4&e.flags||(null===vc&&(vc=[]),vc.push(l,0===bc?i:i+"_"+bc,t.memoizedProps)),bc++}else 22===t.tag&&null!==t.memoizedState||(30===t.tag&&a?e.flags|=32&t.flags:Nc(e,t.child,n,i,r,o,a)&&(s=!0));t=t.sibling}return s}function Oc(e,t){for(e=e.child;null!==e;){if(30===e.tag){var n=e.memoizedProps,i=e.stateNode,r=Yi(n,i),o=Ji(n.default,n.update);if(t)var a=null===(i=i.clones)?null:i.map(tp);else a=e.memoizedState,e.memoizedState=null;i=e;var s=e.child;bc=0,r=Nc(i,s,r,r,o,a,!1),4&e.flags&&r&&(t||uu(e,n.onUpdate))}else 33554432&e.subtreeFlags&&Oc(e,t);e=e.sibling}}var Ac=!1,Lc=!1,Dc=!1,Pc=!1,Mc="function"==typeof WeakSet?WeakSet:Set,Fc=null,jc=!1,zc=!1,Uc=!1,$c=!1;function Bc(e){for(;null!==Fc;){var t=Fc,n=e,i=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&r&&null!==i){n=void 0,r=i.memoizedProps,i=i.memoizedState;var o=t.stateNode;try{var s=Zs(t.type,r);n=o.getSnapshotBeforeUpdate(s,i),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Hu(t,t.return,e)}}break;case 3:if(1024&r)if(9===(n=(i=t.stateNode.containerInfo).nodeType))xp(i);else if(1===n)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":xp(i);break;default:i.textContent=""}break;case 30:n&&null!==i&&(n=Yi(i.memoizedProps,i.stateNode),"none"!==(r=Ji((r=t.memoizedProps).default,r.update))&&yc(i,n,r,i.memoizedState=[],!0));break;default:if(1024&r)throw Error(a(163))}if(null!==(i=t.sibling)){i.return=t.return,Fc=i;break}Fc=t.return}}function Hc(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:ld(e,n),4&i&&Yl(5,n);break;case 1:if(ld(e,n),4&i)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Hu(n,n.return,e)}else{var r=Zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Hu(n,n.return,e)}}64&i&&Jl(n),512&i&&Zl(n,n.return);break;case 3:if(ld(e,n),64&i&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{ta(e,t)}catch(e){Hu(n,n.return,e)}}break;case 27:null===t&&4&i&&hc(n);case 26:case 5:ld(e,n),null===t&&4&i&&ac(n),512&i&&Zl(n,n.return);break;case 12:ld(e,n);break;case 31:ld(e,n),4&i&&Xc(e,n);break;case 13:ld(e,n),4&i&&Zc(e,n),64&i&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}(e,n=Gu.bind(null,n));break;case 22:if(!(i=null!==n.memoizedState||Ac)){var o=null!==t&&null!==t.memoizedState||Lc;t=Ac,r=Lc,Ac=i,(Lc=o)&&!r?(i=2,!!(8772&n.subtreeFlags)&&(i|=1),dd(e,n,i)):ld(e,n),Ac=t,Lc=r}break;case 30:ld(e,n),512&i&&Zl(n,n.return);break;case 7:512&i&&Zl(n,n.return);default:ld(e,n)}}function Wc(e,t){for(e=e.child;null!==e;)Vc(e,t),e=e.sibling}function Vc(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var i=n.style;"function"==typeof i.setProperty?i.setProperty("display","none","important"):i.display="none"}else{var r=e.stateNode,o=e.memoizedProps.style,a=null!=o&&o.hasOwnProperty("display")?o.display:null;r.style.display=null==a||"boolean"==typeof a?"":(""+a).trim()}}catch(t){Hu(e,e.return,t)}qc(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,It=!0}catch(t){Hu(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Qh(s,!0):Qh(e.stateNode,!1)}catch(t){Hu(e,e.return,t)}break;case 22:case 23:null===e.memoizedState&&Wc(e,t);break;default:Wc(e,t)}}function qc(e,t){if(67108864&e.subtreeFlags)for(e=e.child;null!==e;){e:{var n=e,i=t;switch(n.tag){case 4:Vc(n,i);break e;case 22:null===n.memoizedState&&qc(n,i);break e;default:qc(n,i)}}e=e.sibling}}function Gc(e){var t=e.alternate;null!==t&&(e.alternate=null,Gc(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&pt(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 Kc=null,Yc=!1;function Qc(e,t,n){for(n=n.child;null!==n;)Jc(e,t,n),n=n.sibling}function Jc(e,t,n){if(De&&"function"==typeof De.onCommitFiberUnmount)try{De.onCommitFiberUnmount(Le,n)}catch(e){}switch(n.tag){case 26:Lc||ec(n,t),Qc(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Lc&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Lc||ec(n,t),ic(n);var i=Kc,r=Yc;Kh(n.type)&&(Kc=n.stateNode,Yc=!1),Qc(e,t,n),Lp(n.stateNode,n.type,n.memoizedProps),Kc=i,Yc=r;break;case 5:Lc||ec(n,t),ic(n);case 6:if(6===n.tag&&ic(n),i=Kc,r=Yc,Kc=null,Qc(e,t,n),Yc=r,null!==(Kc=i))if(Yc)try{(9===Kc.nodeType?Kc.body:"HTML"===Kc.nodeName?Kc.ownerDocument.body:Kc).removeChild(n.stateNode),It=!0}catch(e){Hu(n,t,e)}else try{Kc.removeChild(n.stateNode),It=!0}catch(e){Hu(n,t,e)}break;case 18:null!==Kc&&(Yc?(Yh(9===(e=Kc).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Wf(e)):Yh(Kc,n.stateNode));break;case 4:i=Kc,r=Yc,Kc=n.stateNode.containerInfo,Yc=!0,Qc(e,t,n),Kc=i,Yc=r;break;case 0:case 11:case 14:case 15:Ql(2,n,t),Lc||Ql(4,n,t),Qc(e,t,n);break;case 1:Lc||(ec(n,t),"function"==typeof(i=n.stateNode).componentWillUnmount&&Xl(n,t,i)),Qc(e,t,n);break;case 21:Qc(e,t,n);break;case 22:Lc=(i=Lc)||null!==n.memoizedState,Qc(e,t,n),Lc=i;break;case 30:ec(n,t),Qc(e,t,n);break;case 7:Lc||ec(n,t),Qc(e,t,n);break;default:Qc(e,t,n)}}function Xc(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Wf(e)}catch(e){Hu(t,t.return,e)}}}function Zc(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Wf(e)}catch(e){Hu(t,t.return,e)}}function ed(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Mc),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Mc),t;default:throw Error(a(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var i=Ku.bind(null,e,t);t.then(i,i)}})}function td(e,t,n){var i=t.deletions;if(null!==i)for(var r=0;r<i.length;r++){var o=i[r],s=e,l=t,c=l;e:for(;null!==c;){switch(c.tag){case 27:if(Kh(c.type)){Kc=c.stateNode,Yc=!1;break e}break;case 5:Kc=c.stateNode,Yc=!1;break e;case 3:case 4:Kc=c.stateNode.containerInfo,Yc=!0;break e}c=c.return}if(null===Kc)throw Error(a(160));Jc(s,l,o),Kc=null,Yc=!1,null!==(s=o.alternate)&&(s.return=null),o.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)id(t,e,n),t=t.sibling}var nd=null;function id(e,t,n){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(4&r&&null!==(i=null!==(i=e.updateQueue)?i.events:null))for(var o=0;o<i.length;o++){var s=i[o];s.ref.impl=s.nextImpl}td(t,e,n),rd(e),4&r&&(Ql(3,e,e.return),Yl(3,e),Ql(5,e,e.return));break;case 1:td(t,e,n),rd(e),512&r&&(Lc||null===i||ec(i,i.return)),64&r&&Ac&&null!==(e=e.updateQueue)&&null!==(t=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?t:n.concat(t));break;case 26:if(o=nd,td(t,e,n),rd(e),512&r&&(Lc||null===i||ec(i,i.return)),4&r)if(r=null!==i?i.memoizedState:null,n=e.memoizedState,null===i)if(null===n)if(null===e.stateNode)if(Ac)e.stateNode=zh(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,r=o.ownerDocument||o;t:switch(t){case"title":(!(i=r.getElementsByTagName("title")[0])||i[ut]||i[rt]||"http://www.w3.org/2000/svg"===i.namespaceURI||i.hasAttribute("itemprop"))&&(i=r.createElement(t),r.head.insertBefore(i,r.querySelector("head > title"))),Oh(i,t,n),i[rt]=e,bt(i),t=i;break e;case"link":if(o=Xp("link","href",r).get(t+(n.href||"")))for(s=0;s<o.length;s++)if((i=o[s]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&i.getAttribute("rel")===(null==n.rel?null:n.rel)&&i.getAttribute("title")===(null==n.title?null:n.title)&&i.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){o.splice(s,1);break t}Oh(i=r.createElement(t),t,n),r.head.appendChild(i);break;case"meta":if(o=Xp("meta","content",r).get(t+(n.content||"")))for(s=0;s<o.length;s++)if((i=o[s]).getAttribute("content")===(null==n.content?null:""+n.content)&&i.getAttribute("name")===(null==n.name?null:n.name)&&i.getAttribute("property")===(null==n.property?null:n.property)&&i.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&i.getAttribute("charset")===(null==n.charSet?null:n.charSet)){o.splice(s,1);break t}Oh(i=r.createElement(t),t,n),r.head.appendChild(i);break;default:throw Error(a(468,t))}i[rt]=e,bt(i),t=i}e.stateNode=t}else Ac||Zp(o,e.type,e.stateNode);else e.stateNode=Gp(o,n,e.memoizedProps);else r!==n?(null===r?null===(t=i.stateNode)||Lc||t.parentNode.removeChild(t):r.count--,null===n?Ac||Zp(o,e.type,e.stateNode):Gp(o,n,e.memoizedProps)):null===n&&null!==e.stateNode&&sc(e,e.memoizedProps,i.memoizedProps);break;case 27:td(t,e,n),rd(e),512&r&&(Lc||null===i||ec(i,i.return)),null!==i&&4&r&&sc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(o=Dc,Dc=!1,td(t,e,n),Dc=o,rd(e),512&r&&(Lc||null===i||ec(i,i.return)),32&e.flags){t=e.stateNode;try{Wt(t,""),It=!0}catch(t){Hu(e,e.return,t)}}4&r&&null!=e.stateNode&&sc(e,t=e.memoizedProps,null!==i?i.memoizedProps:t),1024&r&&(Pc=!0);break;case 6:if(td(t,e,n),rd(e),4&r){if(null===e.stateNode)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,It=!0}catch(t){Hu(e,e.return,t)}}break;case 3:if(It=!1,Jp=null,o=nd,nd=Fp(t.containerInfo),td(t,e,n),nd=o,rd(e),4&r&&null!==i&&i.memoizedState.isDehydrated)try{Wf(t.containerInfo)}catch(t){Hu(e,e.return,t)}Pc&&(Pc=!1,od(e)),It=!1;break;case 4:r=Dc,Dc=Ac,i=Tt(),o=nd,nd=Fp(e.stateNode.containerInfo),td(t,e,n),rd(e),nd=o,It&&zc&&(Uc=!0),It=i,Dc=r;break;case 12:td(t,e,n),rd(e);break;case 31:td(t,e,n),rd(e),4&r&&null!==(t=e.updateQueue)&&(e.updateQueue=null,ed(e,t));break;case 13:td(t,e,n),rd(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==i&&null!==i.memoizedState)&&(qd=xe()),4&r&&null!==(t=e.updateQueue)&&(e.updateQueue=null,ed(e,t));break;case 22:o=null!==e.memoizedState,s=null!==i&&null!==i.memoizedState;var l=Ac,c=Lc,d=Dc;Ac=l||o,Dc=d||o,Lc=c||s,td(t,e,n),Lc=c,Dc=d,Ac=l,rd(e),8192&r&&((t=e.stateNode)._visibility=o?-2&t._visibility:1|t._visibility,!o||null===i||s||Ac||Lc||(n=Ac,i=Lc,Ac=o||Ac,Lc=t=s||Lc,cd(e,2),Ac=n,Lc=i),!o&&Dc||Wc(e,o)),4&r&&null!==(t=e.updateQueue)&&null!==(n=t.retryQueue)&&(t.retryQueue=null,ed(e,n));break;case 19:td(t,e,n),rd(e),4&r&&null!==(t=e.updateQueue)&&(e.updateQueue=null,ed(e,t));break;case 30:512&r&&(Lc||null===i||ec(i,i.return)),r=Tt(),o=zc,s=(335544064&n)===n,l=e.memoizedProps,zc=s&&"none"!==Ji(l.default,l.update),td(t,e,n),rd(e),s&&null!==i&&It&&(e.flags|=4),zc=o,It=r;break;case 21:break;case 7:512&r&&(Lc||null===i||ec(i,i.return)),i&&null!==i.stateNode&&(i.stateNode._fragmentFiber=e);default:td(t,e,n),rd(e)}}function rd(e){var t=e.flags;if(2&t){try{for(var n,i=e.return;null!==i;){if(lc(i)){n=i;break}i=i.return}i=null;for(var r=e.return;null!==r;){if(oc(r)){var o=r.stateNode;null===i?i=[o]:i.push(o)}if(rc(r))break;r=r.return}var s=i;if(null==n)throw Error(a(160));switch(n.tag){case 27:var l=n.stateNode;uc(e,cc(e),l,s);break;case 5:var c=n.stateNode;32&n.flags&&(Wt(c,""),n.flags&=-33),uc(e,cc(e),c,s);break;case 3:case 4:var d=n.stateNode.containerInfo;dc(e,cc(e),d,s);break;default:throw Error(a(161))}}catch(t){Hu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function od(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;od(t),5===t.tag&&1024&t.flags&&(t=t.stateNode,yf=!0,t.reset(),yf=!1),e=e.sibling}}function ad(e,t){if(9270&t.subtreeFlags)for(t=t.child;null!==t;)sd(t,e),t=t.sibling;else Oc(t,!1)}function sd(e,t){var n=e.alternate;if(null===n)Sc(e,!1);else switch(e.tag){case 3:if($c=jc=!1,mc(),ad(t,e),!jc&&!Uc){if(null!==(e=vc))for(var i=0;i<e.length;i+=3){n=e[i];var r=e[i+1];Xh(n,e[i+2]),null!==(n=n.ownerDocument.documentElement)&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}null!==(e=9===(e=t.containerInfo).nodeType?e.documentElement:e.ownerDocument.documentElement)&&""===e.style.viewTransitionName&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),$c=!0}vc=null;break;case 5:default:ad(t,e);break;case 4:i=jc,jc=!1,ad(t,e),jc&&(Uc=!0),jc=i;break;case 22:null===e.memoizedState&&(null!==n.memoizedState?Sc(e,!1):ad(t,e));break;case 30:i=jc,r=mc(),jc=!1,ad(t,e),jc&&(e.flags|=4);var o=e.memoizedProps,a=e.stateNode;t=Yi(o,a),a=Yi(n.memoizedProps,a);var s=Ji(o.default,o.update);"none"===s?t=!1:(o=n.memoizedState,n.memoizedState=null,n=e.child,bc=0,t=Nc(e,n,t,a,s,o,!0),bc!==(null===o?0:o.length)&&(e.flags|=32)),4&e.flags&&t?(uu(e,e.memoizedProps.onUpdate),vc=r):null!==r&&(r.push.apply(r,vc),vc=r),jc=!!(32&e.flags)||i}}function ld(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Hc(e,t.alternate,t),t=t.sibling}function cd(e,t){for(e=e.child;null!==e;){var n=e,i=t;switch(n.tag){case 0:case 11:case 14:case 15:Ql(4,n,n.return),cd(n,i);break;case 1:ec(n,n.return);var r=n.stateNode;"function"==typeof r.componentWillUnmount&&Xl(n,n.return,r),cd(n,i);break;case 27:2&i&&Lp(n.stateNode,n.type,n.memoizedProps);case 5:ec(n,n.return),5!==n.tag&&27!==n.tag||ic(n),cd(n,i);break;case 6:ic(n);break;case 26:ec(n,n.return),r=n.stateNode,null!==n.memoizedState||null===r||Lc||r.parentNode.removeChild(r),cd(n,i);break;case 22:null===n.memoizedState&&cd(n,i);break;case 30:ec(n,n.return),cd(n,i);break;case 7:ec(n,n.return);default:cd(n,i)}e=e.sibling}}function dd(e,t,n){for(n=8772&t.subtreeFlags?n:-2&n,t=t.child;null!==t;){var i=t.alternate,r=e,o=t,a=o.flags,s=!!(1&n);switch(o.tag){case 0:case 11:case 15:dd(r,o,n),Yl(4,o);break;case 1:if(dd(r,o,n),"function"==typeof(r=(i=o).stateNode).componentDidMount)try{r.componentDidMount()}catch(e){Hu(i,i.return,e)}if(null!==(r=(i=o).updateQueue)){var l=i.stateNode;try{var c=r.shared.hiddenCallbacks;if(null!==c)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)ea(c[r],l)}catch(e){Hu(i,i.return,e)}}s&&64&a&&Jl(o),Zl(o,o.return);break;case 27:2&n&&hc(o);case 5:5!==o.tag&&27!==o.tag||nc(o),dd(r,o,n),s&&null===i&&4&a&&ac(o),Zl(o,o.return);break;case 6:nc(o);break;case 26:l=o.stateNode,null!==o.memoizedState||null===l||Ac||Zp(Fp(l.ownerDocument),o.type,l),dd(r,o,n),s&&null===i&&4&a&&ac(o),Zl(o,o.return);break;case 12:dd(r,o,n);break;case 31:dd(r,o,n),s&&4&a&&Xc(r,o);break;case 13:dd(r,o,n),s&&4&a&&Zc(r,o);break;case 22:null===o.memoizedState&&dd(r,o,n),Zl(o,o.return);break;case 30:dd(r,o,n),Zl(o,o.return);break;case 7:Zl(o,o.return);default:dd(r,o,n)}t=t.sibling}}function ud(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&po(n))}function hd(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&po(e))}function pd(e,t,n,i){var r=(335544064&n)===n;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;null!==t;)fd(e,t,n,i),t=t.sibling;else r&&Rc(t)}function fd(e,t,n,i){var r=(335544064&n)===n;r&&null===t.alternate&&null!==t.return&&null!==t.return.alternate&&Tc(t);var o=t.flags;switch(t.tag){case 0:case 11:case 15:pd(e,t,n,i),2048&o&&Yl(9,t);break;case 1:case 31:case 13:default:pd(e,t,n,i);break;case 3:pd(e,t,n,i),r&&$c&&("root"===(e=9===(e=e.containerInfo).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e).style.viewTransitionName&&(e.style.viewTransitionName=""),null!==(e=e.ownerDocument.documentElement)&&"none"===e.style.viewTransitionName&&(e.style.viewTransitionName="")),2048&o&&(o=null,null!==t.alternate&&(o=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==o&&(t.refCount++,null!=o&&po(o)));break;case 12:if(2048&o){pd(e,t,n,i),o=t.stateNode;try{var a=t.memoizedProps,s=a.id,l=a.onPostCommit;"function"==typeof l&&l(s,null===t.alternate?"mount":"update",o.passiveEffectDuration,-0)}catch(e){Hu(t,t.return,e)}}else pd(e,t,n,i);break;case 23:break;case 22:a=t.stateNode,s=t.alternate,null!==t.memoizedState?(r&&null!==s&&null===s.memoizedState&&Tc(s),2&a._visibility?pd(e,t,n,i):vd(e,t)):(r&&null!==s&&null!==s.memoizedState&&Tc(t),2&a._visibility?pd(e,t,n,i):(a._visibility|=2,gd(e,t,n,i,!!(10256&t.subtreeFlags)||!1))),2048&o&&ud(s,t);break;case 24:pd(e,t,n,i),2048&o&&hd(t.alternate,t);break;case 30:r&&null!==(o=t.alternate)&&(kc(o.child,!0),kc(t.child,!0)),pd(e,t,n,i)}}function gd(e,t,n,i,r){for(r=r&&(!!(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var o=e,a=t,s=n,l=i,c=a.flags;switch(a.tag){case 0:case 11:case 15:gd(o,a,s,l,r),Yl(8,a);break;case 23:break;case 22:var d=a.stateNode;null!==a.memoizedState?2&d._visibility?gd(o,a,s,l,r):vd(o,a):(d._visibility|=2,gd(o,a,s,l,r)),r&&2048&c&&ud(a.alternate,a);break;case 24:gd(o,a,s,l,r),r&&2048&c&&hd(a.alternate,a);break;default:gd(o,a,s,l,r)}t=t.sibling}}function vd(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,i=t,r=i.flags;switch(i.tag){case 22:vd(n,i),2048&r&&ud(i.alternate,i);break;case 24:vd(n,i),2048&r&&hd(i.alternate,i);break;default:vd(n,i)}t=t.sibling}}var md=8192;function bd(e,t,n){if(e.subtreeFlags&md)for(e=e.child;null!==e;)yd(e,t,n),e=e.sibling}function yd(e,t,n){switch(e.tag){case 26:bd(e,t,n),e.flags&md&&(null!==e.memoizedState?function(e,t,n,i){if(!("stylesheet"!==n.type||"string"==typeof i.media&&!1===matchMedia(i.media).matches||4&n.state.loading)){if(null===n.instance){var r=Bp(i.href),o=t.querySelector(Hp(r));if(o)return null!==(t=o._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=sf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,void bt(o);o=t.ownerDocument||t,i=Wp(i),(r=Pp.get(r))&&Yp(i,r),bt(o=o.createElement("link"));var a=o;a._p=new Promise(function(e,t){a.onload=e,a.onerror=t}),Oh(o,"link",i),n.instance=o}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(3&n.state.loading)&&(e.count++,n=sf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,nd,e.memoizedState,e.memoizedProps):(e=e.stateNode,(335544128&t)===t&&rf(n,e)));break;case 5:bd(e,t,n),e.flags&md&&(e=e.stateNode,(335544128&t)===t&&rf(n,e));break;case 3:case 4:var i=nd;nd=Fp(e.stateNode.containerInfo),bd(e,t,n),nd=i;break;case 22:null===e.memoizedState&&(null!==(i=e.alternate)&&null!==i.memoizedState?(i=md,md=16777216,bd(e,t,n),md=i):bd(e,t,n));break;case 30:if(0!==(e.flags&md)&&null!=(i=e.memoizedProps.name)&&"auto"!==i){var r=e.stateNode;r.paired=null,null===fc&&(fc=new Map),fc.set(i,r)}bd(e,t,n);break;default:bd(e,t,n)}}function wd(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function kd(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];Fc=i,xd(i,e)}wd(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)_d(e),e=e.sibling}function _d(e){switch(e.tag){case 0:case 11:case 15:kd(e),2048&e.flags&&Ql(9,e,e.return);break;case 3:case 12:default:kd(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,Sd(e)):kd(e)}}function Sd(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];Fc=i,xd(i,e)}wd(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:Ql(8,t,t.return),Sd(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,Sd(t));break;default:Sd(t)}e=e.sibling}}function xd(e,t){for(;null!==Fc;){var n=Fc;switch(n.tag){case 0:case 11:case 15:Ql(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var i=n.memoizedState.cachePool.pool;null!=i&&i.refCount++}break;case 24:po(n.memoizedState.cache)}if(null!==(i=n.child))i.return=n,Fc=i;else e:for(n=e;null!==Fc;){var r=(i=Fc).sibling,o=i.return;if(Gc(i),i===n){Fc=null;break e}if(null!==r){r.return=o,Fc=r;break e}Fc=o}}}var Cd={getCacheForType:function(e){var t=ro(uo),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ro(uo).controller.signal}},Ed="function"==typeof WeakMap?WeakMap:Map,Id=0,Td=null,Rd=null,Nd=0,Od=0,Ad=null,Ld=!1,Dd=!1,Pd=!1,Md=0,Fd=0,jd=0,zd=0,Ud=0,$d=0,Bd=0,Hd=null,Wd=null,Vd=!1,qd=0,Gd=0,Kd=1/0,Yd=null,Qd=null,Jd=0,Xd=null,Zd=null,eu=0,tu=0,nu=null,iu=null,ru=null,ou=null,au=null,su=0,lu=null;function cu(){return 2&Id&&0!==Nd?Nd&-Nd:null!==Q.T?lh():tt()}function du(){if(0===$d)if(536870912&Nd&&!Fr)$d=536870912;else{var e=Ue;!(3932160&(Ue<<=1))&&(Ue=262144),$d=e}return null!==(e=sa.current)&&(e.flags|=32),$d}function uu(e,t){if(null!=t){var n=e.stateNode,i=n.ref;null===i&&(i=n.ref=rp(Yi(e.memoizedProps,n))),null===ou&&(ou=[]),ou.push(t.bind(null,i))}}function hu(e,t,n){(e!==Td||2!==Od&&9!==Od)&&null===e.cancelPendingCommit||(yu(e,0),vu(e,Nd,$d,!1)),Ye(e,n),2&Id&&e===Td||(e===Td&&(!(2&Id)&&(zd|=n),4===Fd&&vu(e,Nd,$d,!1)),th(e))}function pu(e,t,n){if(6&Id)throw Error(a(327));for(var i=!n&&!(127&t)&&0===(t&e.expiredLanes)||We(e,t),r=i?function(e,t){var n=Id;Id|=2;var i=_u(),r=Su();Td!==e||Nd!==t?(Yd=null,Kd=xe()+500,yu(e,t)):Dd=We(e,t);e:for(;;)try{if(0!==Od&&null!==Rd){t=Rd;var o=Ad;t:switch(Od){case 1:Od=0,Ad=null,Nu(e,t,o,1);break;case 2:case 9:if(No(o)){Od=0,Ad=null,Ru(t);break}t=function(){2!==Od&&9!==Od||Td!==e||(Od=7),th(e)},o.then(t,t);break e;case 3:Od=7;break e;case 4:Od=5;break e;case 7:No(o)?(Od=0,Ad=null,Ru(t)):(Od=0,Ad=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Rd.tag){case 26:s=Rd.memoizedState;case 5:case 27:var l=Rd;if(s?tf(s):l.stateNode.complete){Od=0,Ad=null;var c=l.sibling;if(null!==c)Rd=c;else{var d=l.return;null!==d?(Rd=d,Ou(d)):Rd=null}break t}}Od=0,Ad=null,Nu(e,t,o,5);break;case 6:Od=0,Ad=null,Nu(e,t,o,6);break;case 8:bu(),Fd=6;break e;default:throw Error(a(462))}}Iu();break}catch(t){wu(e,t)}return Qr=Yr=null,Q.H=i,Q.A=r,Id=n,null!==Rd?0:(Td=null,Nd=0,nr(),Fd)}(e,t):Cu(e,t,!0),o=i;;){if(0===r){Dd&&!i&&vu(e,t,0,!1);break}if(n=e.current.alternate,!o||gu(n)){if(2===r){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=0!=(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;r=Hd;var c=l.current.memoizedState.isDehydrated;if(c&&(yu(l,s).flags|=256),2!==(s=Cu(l,s,!1))&&6!==s){if(Pd&&!c){l.errorRecoveryDisabledLanes|=o,zd|=o,r=4;break e}o=Wd,Wd=r,null!==o&&(null===Wd?Wd=o:Wd.push.apply(Wd,o))}r=s}if(o=!1,2!==r)continue}}if(1===r){yu(e,0),vu(e,t,0,!0);break}e:{switch(i=e,o=r){case 0:case 1:throw Error(a(345));case 4:if((4194048&t)!==t&&(62914560&t)!==t)break;case 6:vu(i,t,$d,!Ld);break e;case 2:Wd=null;break;case 3:case 5:break;default:throw Error(a(329))}if((62914560&t)===t&&10<(r=qd+300-xe())){if(vu(i,t,$d,!Ld),0!==He(i,0,!0))break e;eu=t,i.timeoutHandle=Bh(fu.bind(null,i,n,Wd,Yd,Vd,t,$d,zd,Bd,Ld,o,"Throttled",-0,0),r)}else fu(i,n,Wd,Yd,Vd,t,$d,zd,Bd,Ld,o,null,-0,0)}break}r=Cu(e,t,!1),o=!1}th(e)}function fu(e,t,n,i,r,o,a,s,l,c,d,u,h,p){e.timeoutHandle=-1;var f,g,v=t.subtreeFlags,m=(335544064&o)===o;if(u=null,(m||8192&v||!(16785408&~v))&&(fc=null,yd(t,o,u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt}),m&&(v=u,null!=(m=(9===(m=e.containerInfo).nodeType?m:m.ownerDocument).__reactViewTransition)&&(v.count++,v.waitingForViewTransition=!0,v=sf.bind(v),m.finished.then(v,v))),v=(62914560&o)===o?qd-xe():(4194048&o)===o?Gd-xe():0,g=v,(f=u).stylesheets&&0===f.count&&df(f,f.stylesheets),null!==(v=0<f.count||0<f.imgCount?function(e){var t=setTimeout(function(){if(f.stylesheets&&df(f,f.stylesheets),f.unsuspend){var e=f.unsuspend;f.unsuspend=null,e()}},6e4+g);0<f.imgBytes&&0===of&&(of=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],o=r.transferSize,a=r.initiatorType,s=r.duration;if(o&&s&&Lh(a)){for(a=0,s=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>s)break;var d=l.transferSize,u=l.initiatorType;d&&Lh(u)&&(a+=d*((l=l.responseEnd)<s?1:(s-c)/(l-c)))}if(--i,t+=8*(o+a)/(r.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var n=setTimeout(function(){if(f.waitingForImages=!1,0===f.count&&(f.stylesheets&&df(f,f.stylesheets),f.unsuspend)){var e=f.unsuspend;f.unsuspend=null,e()}},(f.imgBytes>of?50:800)+g);return f.unsuspend=e,function(){f.unsuspend=null,clearTimeout(t),clearTimeout(n)}}:null)))return eu=o,e.cancelPendingCommit=v(Lu.bind(null,e,t,o,n,i,r,a,s,l,c,d,u,null,h,p)),void vu(e,o,a,!c);Lu(e,t,o,n,i,0,a,s,l,0,0,u)}function gu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!yi(o(),r))return!1}catch(e){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function vu(e,t,n,i){t=Ve(e,t),t&=~Ud,t&=~zd,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var r=t;0<r;){var o=31-Me(r),a=1<<o;i[o]=-1,r&=~a}0!==n&&Qe(e,n,t)}function mu(){return!!(6&Id)||(nh(0,!1),!1)}function bu(){if(null!==Rd){if(0===Od)var e=Rd.return;else Qr=Yr=null,Fa(e=Rd),Mo=null,Fo=0,e=Rd;for(;null!==e;)Kl(e.alternate,e),e=e.return;Rd=null}}function yu(e,t){var n=e.timeoutHandle;return-1!==n&&(e.timeoutHandle=-1,Hh(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),eu=0,bu(),Td=e,Rd=n=hr(e.current,null),Nd=t,Od=0,Ad=null,Ld=!1,Dd=We(e,t),Pd=!1,Bd=$d=Ud=zd=jd=Fd=0,Wd=Hd=null,Vd=!1,Md=Ve(e,t),nr(),n}function wu(e,t){ya=null,Q.H=Vs,t===Eo||t===To?(t=Do(),Od=3):t===Io?(t=Do(),Od=4):Od=t===ll?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,Ad=t,null===Rd&&(Fd=1,il(e,wr(t,e.current)))}function ku(){var e=sa.current;return null===e||((4194048&Nd)===Nd?null===la:!!((62914560&Nd)===Nd||536870912&Nd)&&e===la)}function _u(){var e=Q.H;return Q.H=Vs,null===e?Vs:e}function Su(){var e=Q.A;return Q.A=Cd,e}function xu(){Fd=4,Ld||(4194048&Nd)!==Nd&&null!==sa.current||(Dd=!0),!(134217727&jd)&&!(134217727&zd)||null===Td||vu(Td,Nd,$d,!1)}function Cu(e,t,n){var i=Id;Id|=2;var r=_u(),o=Su();Td===e&&Nd===t||(Yd=null,yu(e,t)),t=!1;var a=Fd;e:for(;;)try{if(0!==Od&&null!==Rd){var s=Rd,l=Ad;switch(Od){case 8:bu(),a=6;break e;case 3:case 2:case 9:case 6:null===sa.current&&(t=!0);var c=Od;if(Od=0,Ad=null,Nu(e,s,l,c),n&&Dd){a=0;break e}break;default:c=Od,Od=0,Ad=null,Nu(e,s,l,c)}}Eu(),a=Fd;break}catch(t){wu(e,t)}return t&&e.shellSuspendCounter++,Qr=Yr=null,Id=i,Q.H=r,Q.A=o,null===Rd&&(Td=null,Nd=0,nr()),a}function Eu(){for(;null!==Rd;)Tu(Rd)}function Iu(){for(;null!==Rd&&!_e();)Tu(Rd)}function Tu(e){var t=zl(e.alternate,e,Md);e.memoizedProps=e.pendingProps,null===t?Ou(e):Rd=t}function Ru(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=kl(n,t,t.pendingProps,t.type,void 0,Nd);break;case 11:t=kl(n,t,t.pendingProps,t.type.render,t.ref,Nd);break;case 5:Fa(t);var i=t;i===Pr&&(Fr?(Hr(i),5===i.tag&&null!=i.stateNode&&(Mr=i.stateNode)):(Hr(i),Fr=!0));default:Kl(n,t),t=zl(n,t=Rd=pr(t,Md),Md)}e.memoizedProps=e.pendingProps,null===t?Ou(e):Rd=t}function Nu(e,t,n,i){Qr=Yr=null,Fa(t),Mo=null,Fo=0;var r=t.return;try{if(function(e,t,n,i,r){if(n.flags|=32768,null!==i&&"object"==typeof i&&"function"==typeof i.then){if(null!==(t=n.alternate)&&to(t,n,r,!0),null!==(n=sa.current)){switch(n.tag){case 31:case 13:case 19:return null===la?xu():null===n.alternate&&0===Fd&&(Fd=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Ro?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([i]):t.add(i),Wu(e,i,r)),!1;case 22:return n.flags|=65536,i===Ro?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([i]):n.add(i),Wu(e,i,r)),!1}throw Error(a(435,n.tag))}return Wu(e,i,r),xu(),!1}if(Fr)return null!==(t=sa.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=r,i!==Ur&&Gr(wr(e=Error(a(422),{cause:i}),n))):(i!==Ur&&Gr(wr(t=Error(a(423),{cause:i}),n)),(e=e.current.alternate).flags|=65536,r&=-r,e.lanes|=r,i=wr(i,n),Qo(e,r=ol(e.stateNode,i,r)),4!==Fd&&(Fd=2)),!1;var o=Error(a(520),{cause:i});if(o=wr(o,n),null===Hd?Hd=[o]:Hd.push(o),4!==Fd&&(Fd=2),null===t)return!0;i=wr(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,Qo(n,e=ol(n.stateNode,i,e)),!1;case 1:if(t=n.type,o=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===o||"function"!=typeof o.componentDidCatch||null!==Qd&&Qd.has(o))))return n.flags|=65536,r&=-r,n.lanes|=r,sl(r=al(r),e,n,i),Qo(n,r),!1;break;case 22:if(null!==n.memoizedState)return n.flags|=65536,!1}n=n.return}while(null!==n);return!1}(e,r,t,n,Nd))return Fd=1,il(e,wr(n,e.current)),void(Rd=null)}catch(t){if(null!==r)throw Rd=r,t;return Fd=1,il(e,wr(n,e.current)),void(Rd=null)}32768&t.flags?(Fr||1===i?e=!0:Dd||536870912&Nd?e=!1:(Ld=e=!0,(2===i||9===i||3===i||6===i)&&null!==(i=sa.current)&&13===i.tag&&(i.flags|=16384)),Au(t,e)):Ou(t)}function Ou(e){var t=e;do{if(32768&t.flags)return void Au(t,Ld);e=t.return;var n=ql(t.alternate,t,Md);if(null!==n)return void(Rd=n);if(null!==(t=t.sibling))return void(Rd=t);Rd=t=e}while(null!==t);0===Fd&&(Fd=5)}function Au(e,t){do{var n=Gl(e.alternate,e);if(null!==n)return n.flags&=32767,void(Rd=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(Rd=e);Rd=e=n}while(null!==e);Fd=6,Rd=null}function Lu(e,t,n,i,r,o,s,l,c,d,u,h){e.cancelPendingCommit=null;do{Uu()}while(0!==Jd);if(6&Id)throw Error(a(327));if(null!==t){if(t===e.current)throw Error(a(177));e===Td&&(Rd=Td=null,Nd=0),Zd=t,Xd=e,eu=n,nu=r,iu=i,function(e,t,n,i,r,o,a){var s=t.lanes|t.childLanes;if(tu=s,function(e,t,n,i,r,o){var a=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 s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=a&~n;0<n;){var d=31-Me(n),u=1<<d;s[d]=0,l[d]=-1;var h=c[d];if(null!==h)for(c[d]=null,d=0;d<h.length;d++){var p=h[d];null!==p&&(p.lane&=-536870913)}n&=~u}0!==i&&Qe(e,i,0),0!==o&&0===r&&0!==e.tag&&(e.suspendedLanes|=o&~(a&~t))}(e,n,s|=tr,i,r,o),ou=null,(335544064&n)===n?(au=function(e){var t=e.transitionTypes;return e.transitionTypes=null,t}(e),i=10262):(au=null,i=10256),0!==(t.subtreeFlags&i)||0!==(t.flags&i)?(e.callbackNode=null,e.callbackPriority=0,we(Te,function(){return $u(),null})):(e.callbackNode=null,e.callbackPriority=0),pc=!1,i=!!(13878&t.flags),13878&t.subtreeFlags||i){i=Q.T,Q.T=null,r=J.p,J.p=2,o=Id,Id|=4;try{!function(e,t,n){if(e=e.containerInfo,Dh=yf,Ei(e=Ci(e))){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(i=(i=e.ownerDocument)&&i.defaultView||window).getSelection&&i.getSelection();if(r&&0!==r.rangeCount){i=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{i.nodeType,a.nodeType}catch(e){i=null;break e}var s=0,l=-1,c=-1,d=0,u=0,h=e,p=null;t:for(;;){for(var f;h!==i||0!==o&&3!==h.nodeType||(l=s+o),h!==a||0!==r&&3!==h.nodeType||(c=s+r),3===h.nodeType&&(s+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===i&&++d===o&&(l=s),p===a&&++u===r&&(c=s),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}i=-1===l||-1===c?null:{start:l,end:c}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ph={focusedElem:e,selectionRange:i},yf=!1,Fc=t,t=(n=(335544064&n)===n)?9270:1024;null!==Fc;){if(e=Fc,n&&null!==(i=e.deletions))for(o=0;o<i.length;o++)n&&Cc(i[o]);if(null===e.alternate&&2&e.flags)n&&gc(e),Bc(n);else{if(22===e.tag){if(i=e.alternate,null!==e.memoizedState){null!==i&&null===i.memoizedState&&n&&Cc(i),Bc(n);continue}if(null!==i&&null!==i.memoizedState){n&&gc(e),Bc(n);continue}}i=e.child,0!==(e.subtreeFlags&t)&&null!==i?(i.return=e,Fc=i):(n&&Ec(e),Bc(n))}}fc=null}(e,t,n)}finally{Id=o,J.p=r,Q.T=i}}Jd=1,pc?ru=function(e,t,n,i,r,o,a,s,l){var c=9===t.nodeType?t:t.ownerDocument;try{var d=c.startViewTransition({update:function(){var t=c.defaultView,n=t.navigation&&t.navigation.transition,a=c.fonts.status;i();var s=[];if("loaded"===a&&(function(e){e.documentElement.clientHeight}(c),"loading"===c.fonts.status&&s.push(c.fonts.ready)),a=s.length,null!==e)for(var l=e.suspenseyImages,d=0,u=0;u<l.length;u++){var h=l[u];if(!h.complete){var p=h.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if((d+=nf(h))>of){s.length=a;break}h=new Promise(np.bind(h)),s.push(h)}}}return 0<s.length?(t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(r,r),(n?Promise.allSettled([n.finished,t]):t).then(o,o)):(r(),n?n.finished.then(o,o):void o())},types:n});c.__reactViewTransition=d;var u=[];return d.ready.then(function(){for(var e=c.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],i=n.effect,r=i.pseudoElement;if(null!=r&&r.startsWith("::view-transition")){u.push(n),n=i.getKeyframes();for(var o=r=void 0,s=!0,l=0;l<n.length;l++){var d=n[l],h=d.width;if(void 0===r)r=h;else if(r!==h){s=!1;break}if(h=d.height,void 0===o)o=h;else if(o!==h){s=!1;break}delete d.width,delete d.height,"none"===d.transform&&delete d.transform}s&&void 0!==r&&void 0!==o&&(i.setKeyframes(n),(s=getComputedStyle(i.target,i.pseudoElement)).width!==r||s.height!==o)&&((s=n[0]).width=r,s.height=o,(s=n[n.length-1]).width=r,s.height=o,i.setKeyframes(n))}}a()},function(e){c.__reactViewTransition===d&&(c.__reactViewTransition=null);try{"object"==typeof e&&null!==e&&"InvalidStateError"===e.name&&("View transition was skipped because document visibility state is hidden."!==e.message&&"Skipping view transition because document visibility state has become hidden."!==e.message&&"Skipping view transition because viewport size changed."!==e.message&&"Transition was aborted because of invalid state"!==e.message||(e=null)),null!==e&&l(e)}finally{i(),r(),a()}}),d.finished.finally(function(){for(var e=0;e<u.length;e++)u[e].cancel();c.__reactViewTransition===d&&(c.__reactViewTransition=null),s()}),d}catch(e){return i(),r(),a(),null}}(a,e.containerInfo,au,Mu,Fu,Pu,ju,$u,Du):(Mu(),Fu(),ju())}(e,t,n,s,l,c,h)}}function Du(e){0!==Jd&&(0,Xd.onRecoverableError)(e,{componentStack:null})}function Pu(){3===Jd&&(Jd=0,sd(Zd,Xd),Jd=4)}function Mu(){if(1===Jd){Jd=0;var e=Xd,t=Zd,n=eu,i=!!(13878&t.flags);if(13878&t.subtreeFlags||i){i=Q.T,Q.T=null;var r=J.p;J.p=2;var o=Id;Id|=4;try{zc=Uc=!1,id(t,e,n),n=Ph;var a=Ci(e.containerInfo),s=n.focusedElem,l=n.selectionRange;if(a!==s&&s&&s.ownerDocument&&xi(s.ownerDocument.documentElement,s)){if(null!==l&&Ei(s)){var c=l.start,d=l.end;if(void 0===d&&(d=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(d,s.value.length);else{var u=s.ownerDocument||document,h=u&&u.defaultView||window;if(h.getSelection){var p=h.getSelection(),f=s.textContent.length,g=Math.min(l.start,f),v=void 0===l.end?g:Math.min(l.end,f);!p.extend&&g>v&&(a=v,v=g,g=a);var m=Si(s,g),b=Si(s,v);if(m&&b&&(1!==p.rangeCount||p.anchorNode!==m.node||p.anchorOffset!==m.offset||p.focusNode!==b.node||p.focusOffset!==b.offset)){var y=u.createRange();y.setStart(m.node,m.offset),p.removeAllRanges(),g>v?(p.addRange(y),p.extend(b.node,b.offset)):(y.setEnd(b.node,b.offset),p.addRange(y))}}}}for(u=[],p=s;p=p.parentNode;)1===p.nodeType&&u.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;s<u.length;s++){var w=u[s];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}yf=!!Dh,Ph=Dh=null}finally{Id=o,J.p=r,Q.T=i}}e.current=t,Jd=2}}function Fu(){if(2===Jd){Jd=0;var e=Xd,t=Zd,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=Q.T,Q.T=null;var i=J.p;J.p=2;var r=Id;Id|=4;try{Hc(e,t.alternate,t)}finally{Id=r,J.p=i,Q.T=n}}Jd=3}}function ju(){if(4===Jd||3===Jd){Jd=0;var e=ru;ru=null,Se();var t=Xd,n=Zd,i=eu,r=iu,o=(335544064&i)===i?10262:10256;if(0!==(n.subtreeFlags&o)||0!==(n.flags&o)?Jd=5:(Jd=0,Zd=Xd=null,zu(t,t.pendingLanes)),0===(o=t.pendingLanes)&&(Qd=null),et(i),n=n.stateNode,De&&"function"==typeof De.onCommitFiberRoot)try{De.onCommitFiberRoot(Le,n,void 0,!(128&~n.current.flags))}catch(e){}if(null!==r){n=Q.T,o=J.p,J.p=2,Q.T=null;try{for(var a=t.onRecoverableError,s=0;s<r.length;s++){var l=r[s];a(l.value,{componentStack:l.stack})}}finally{Q.T=n,J.p=o}}if(a=au,au=null,null!==(r=ou)&&(ou=null,null===a&&(a=[]),null!==e))for(l=0;l<r.length;l++)void 0!==(n=(0,r[l])(a))&&e.finished.finally(n);3&eu&&Uu(),th(t),o=t.pendingLanes,261930&i&&42&o?t===lu?su++:(su=0,lu=t):(su=0,lu=null),nh(0,!1)}}function zu(e,t){0===(e.pooledCacheLanes&=t)&&null!=(t=e.pooledCache)&&(e.pooledCache=null,po(t))}function Uu(){return null!==ru&&(ru.skipTransition(),ru=null),Mu(),Fu(),ju(),$u()}function $u(){if(5!==Jd)return!1;var e=Xd,t=tu;tu=0;var n=et(eu),i=Q.T,r=J.p;try{J.p=32>n?32:n,Q.T=null,n=nu,nu=null;var o=Xd,s=eu;if(Jd=0,Zd=Xd=null,eu=0,6&Id)throw Error(a(331));var l=Id;if(Id|=4,_d(o.current),fd(o,o.current,s,n),Id=l,nh(0,!1),De&&"function"==typeof De.onPostCommitFiberRoot)try{De.onPostCommitFiberRoot(Le,o)}catch(e){}return!0}finally{J.p=r,Q.T=i,zu(e,t)}}function Bu(e,t,n){t=wr(n,t),null!==(e=Ko(e,t=ol(e.stateNode,t,2),2))&&(Ye(e,2),th(e))}function Hu(e,t,n){if(3===e.tag)Bu(e,e,n);else for(;null!==t;){if(3===t.tag){Bu(t,e,n);break}if(1===t.tag){var i=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===Qd||!Qd.has(i))){e=wr(n,e),null!==(i=Ko(t,n=al(2),2))&&(sl(n,i,t,e),Ye(i,2),th(i));break}}t=t.return}}function Wu(e,t,n){var i=e.pingCache;if(null===i){i=e.pingCache=new Ed;var r=new Set;i.set(t,r)}else void 0===(r=i.get(t))&&(r=new Set,i.set(t,r));r.has(n)||(Pd=!0,r.add(n),e=Vu.bind(null,e,t,n),t.then(e,e))}function Vu(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Td===e&&(Nd&n)===n&&(4===Fd||3===Fd&&(62914560&Nd)===Nd&&300>xe()-qd?2&Id?Ud|=n:yu(e,0):Ud|=n,Bd===Nd&&(Bd=0)),th(e)}function qu(e,t){0===t&&(t=Ge()),null!==(e=or(e,t))&&(Ye(e,t),th(e))}function Gu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),qu(e,n)}function Ku(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;null!==r&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(a(314))}null!==i&&i.delete(t),qu(e,n)}var Yu=null,Qu=null,Ju=!1,Xu=!1,Zu=!1,eh=0;function th(e){e!==Qu&&null===e.next&&(null===Qu?Yu=Qu=e:Qu=Qu.next=e),Xu=!0,Ju||(Ju=!0,qh(function(){6&Id?we(Ee,ih):rh()}))}function nh(e,t){if(!Zu&&Xu){Zu=!0;do{for(var n=!1,i=Yu;null!==i;){if(!t)if(0!==e){var r=i.pendingLanes;if(0===r)var o=0;else{var a=i.suspendedLanes,s=i.pingedLanes;o=(1<<31-Me(42|e)+1)-1,o=201326741&(o&=r&~(a&~s))?201326741&o|1:o?2|o:0}0!==o&&(n=!0,sh(i,o))}else o=Nd,!(3&(o=He(i,i===Td?o:0,null!==i.cancelPendingCommit||-1!==i.timeoutHandle)))||We(i,o)||(n=!0,sh(i,o));i=i.next}}while(n);Zu=!1}}function ih(){rh()}function rh(){Xu=Ju=!1;var e,t=0;0!==eh&&((e=window.event)&&"popstate"===e.type?e!==$h&&($h=e,1):($h=null,0))&&(t=eh);for(var n=xe(),i=null,r=Yu;null!==r;){var o=r.next,a=oh(r,n);0===a?(r.next=null,null===i?Yu=o:i.next=o,null===o&&(Qu=i)):(i=r,(0!==t||3&a)&&(Xu=!0)),r=o}0!==Jd&&5!==Jd||nh(t,!1),0!==eh&&(eh=0)}function oh(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=-62914561&e.pendingLanes;0<o;){var a=31-Me(o),s=1<<a,l=r[a];-1===l?0!==(s&n)&&0===(s&i)||(r[a]=qe(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}if(n=Nd,n=He(e,e===(t=Td)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),i=e.callbackNode,0===n||e===t&&(2===Od||9===Od)||null!==e.cancelPendingCommit)return null!==i&&null!==i&&ke(i),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||We(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==i&&ke(i),et(n)){case 2:case 8:n=Ie;break;case 32:default:n=Te;break;case 268435456:n=Ne}return i=ah.bind(null,e),n=we(n,i),e.callbackPriority=t,e.callbackNode=n,t}return null!==i&&null!==i&&ke(i),e.callbackPriority=2,e.callbackNode=null,2}function ah(e,t){if(0!==Jd&&5!==Jd)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var i=Nd;return 0===(i=He(e,e===Td?i:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(pu(e,i,t),oh(e,xe()),null!=e.callbackNode&&e.callbackNode===n?ah.bind(null,e):null)}function sh(e,t){if(Uu())return null;pu(e,t,!0)}function lh(){if(0===eh){var e=bo;0===e&&(e=ze,!(261888&(ze<<=1))&&(ze=256)),eh=e}return eh}function ch(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Jt(e)}for(var dh=0;dh<qi.length;dh++){var uh=qi[dh];Gi(uh.toLowerCase(),"on"+(uh[0].toUpperCase()+uh.slice(1)))}Gi(ji,"onAnimationEnd"),Gi(zi,"onAnimationIteration"),Gi(Ui,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi($i,"onTransitionRun"),Gi(Bi,"onTransitionStart"),Gi(Hi,"onTransitionCancel"),Gi(Wi,"onTransitionEnd"),St("onMouseEnter",["mouseout","mouseover"]),St("onMouseLeave",["mouseout","mouseover"]),St("onPointerEnter",["pointerout","pointerover"]),St("onPointerLeave",["pointerout","pointerover"]),_t("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_t("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_t("onBeforeInput",["compositionend","keypress","textInput","paste"]),_t("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_t("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_t("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hh="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(" "),ph=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hh));function fh(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var a=i.length-1;0<=a;a--){var s=i[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(e){Xi(e)}r.currentTarget=null,o=l}else for(a=0;a<i.length;a++){if(l=(s=i[a]).instance,c=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(e){Xi(e)}r.currentTarget=null,o=l}}}}function gh(e,t){var n=t[st];void 0===n&&(n=t[st]=new Set);var i=e+"__bubble";n.has(i)||(yh(t,e,2,!1),n.add(i))}function vh(e,t,n){var i=0;t&&(i|=4),yh(n,e,i,t)}var mh="_reactListening"+Math.random().toString(36).slice(2);function bh(e){if(!e[mh]){e[mh]=!0,wt.forEach(function(t){"selectionchange"!==t&&(ph.has(t)||vh(t,!1,e),vh(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[mh]||(t[mh]=!0,vh("selectionchange",!1,t))}}function yh(e,t,n,i){switch(Ef(t)){case 2:var r=wf;break;case 8:r=kf;break;default:r=_f}n=r.bind(null,t,n,e),r=void 0,!cn||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),i?void 0!==r?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):void 0!==r?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function wh(e,t,n,i,r){var o=i;if(!(1&t||2&t||null===i))e:for(;;){if(null===i)return;var a=i.tag;if(3===a||4===a){var l=i.stateNode.containerInfo;if(l===r)break;if(4===a)for(a=i.return;null!==a;){var c=a.tag;if((3===c||4===c)&&a.stateNode.containerInfo===r)return;a=a.return}for(;null!==l;){if(null===(a=ft(l)))return;if(5===(c=a.tag)||6===c||26===c||27===c){i=o=a;continue e}l=l.parentNode}}i=i.return}an(function(){var i=o,r=en(n),a=[];e:{var l=Vi.get(e);if(void 0!==l){var c=Sn,d=e;switch(e){case"keypress":if(0===gn(n))break e;case"keydown":case"keyup":c=jn;break;case"focusin":d="focus",c=Rn;break;case"focusout":d="blur",c=Rn;break;case"beforeblur":case"afterblur":c=Rn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=In;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=Tn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=$n;break;case ji:case zi:case Ui:c=Nn;break;case Wi:c=Bn;break;case"scroll":case"scrollend":c=Cn;break;case"wheel":c=Hn;break;case"copy":case"cut":case"paste":c=On;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=zn;break;case"submit":c=Un;break;case"toggle":case"beforetoggle":c=Wn}var u=!!(4&t),h=!u&&("scroll"===e||"scrollend"===e),p=u?null!==l?l+"Capture":null:l;u=[];for(var f,g=i;null!==g;){var v=g;if(f=v.stateNode,5!==(v=v.tag)&&26!==v&&27!==v||null===f||null===p||null!=(v=sn(g,p))&&u.push(kh(g,v,f)),h)break;g=g.return}0<u.length&&(l=new c(l,d,null,n,r),a.push({event:l,listeners:u}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(c="mouseover"===e||"pointerover"===e)&&n!==Zt&&(d=n.relatedTarget||n.fromElement)&&(ft(d)||d[at])||(l||c)&&(d=r.window===r?r:(c=r.ownerDocument)?c.defaultView||c.parentWindow:window,l?(l=i,null!==(c=(c=n.relatedTarget||n.toElement)?ft(c):null)&&(h=s(c),u=c.tag,c!==h||5!==u&&27!==u&&6!==u)&&(c=null)):(l=null,c=i),l!==c&&(u=In,v="onMouseLeave",p="onMouseEnter",g="mouse","pointerout"!==e&&"pointerover"!==e||(u=zn,v="onPointerLeave",p="onPointerEnter",g="pointer"),h=null==l?d:vt(l),f=null==c?d:vt(c),(d=new u(v,g+"leave",l,n,r)).target=h,d.relatedTarget=f,v=null,ft(r)===i&&((u=new u(p,g+"enter",c,n,r)).target=f,u.relatedTarget=h,v=u),h=v,u=l&&c?C(l,c,Sh):null,null!==l&&xh(a,d,l,u,!1),null!==c&&null!==h&&xh(a,h,c,u,!0))),"select"===(c=(l=i?vt(i):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var m=li;else if(ni(l))if(ci)m=bi;else{m=vi;var b=gi}else!(c=l.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?i&&Kt(i.elementType)&&(m=li):m=mi;switch(m&&(m=m(e,i))?ii(a,m,n,r):b&&b(e,l,i),b=i?vt(i):window,e){case"focusin":(ni(b)||"true"===b.contentEditable)&&(Ti=b,Ri=i,Ni=null);break;case"focusout":Ni=Ri=Ti=null;break;case"mousedown":Oi=!0;break;case"contextmenu":case"mouseup":case"dragend":Oi=!1,Ai(a,n,r);break;case"selectionchange":if(Ii)break;case"keydown":case"keyup":Ai(a,n,r)}var y;if(qn)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else ei?Xn(e,n)&&(w="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(w="onCompositionStart");w&&(Yn&&"ko"!==n.locale&&(ei||"onCompositionStart"!==w?"onCompositionEnd"===w&&ei&&(y=fn()):(hn="value"in(un=r)?un.value:un.textContent,ei=!0)),0<(b=_h(i,w)).length&&(w=new An(w,e,null,n,r),a.push({event:w,listeners:b}),(y||null!==(y=Zn(n)))&&(w.data=y))),(y=Kn?function(e,t){switch(e){case"compositionend":return Zn(t);case"keypress":return 32!==t.which?null:(Jn=!0,Qn);case"textInput":return(e=t.data)===Qn&&Jn?null:e;default:return null}}(e,n):function(e,t){if(ei)return"compositionend"===e||!qn&&Xn(e,t)?(e=fn(),pn=hn=un=null,ei=!1,e):null;switch(e){case"paste":default: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 Yn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(w=_h(i,"onBeforeInput")).length&&(b=new An("onBeforeInput","beforeinput",null,n,r),a.push({event:b,listeners:w}),b.data=y),function(e,t,n,i,r){if("submit"===t&&n&&n.stateNode===r){var o=ch((r[ot]||null).action),a=i.submitter;a&&null!==(t=(t=a[ot]||null)?ch(t.formAction):a.getAttribute("formAction"))&&(o=t,a=null);var s=new Sn("action","action",null,i,r);e.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(0!==eh){var e=new FormData(r,a);Os(n,{pending:!0,data:e,method:r.method,action:o},null,e)}}else"function"==typeof o&&(s.preventDefault(),e=new FormData(r,a),Os(n,{pending:!0,data:e,method:r.method,action:o},o,e))},currentTarget:r}]})}}(a,e,i,n,r)}fh(a,t)})}function kh(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _h(e,t){for(var n=t+"Capture",i=[];null!==e;){var r=e,o=r.stateNode;if(5!==(r=r.tag)&&26!==r&&27!==r||null===o||(null!=(r=sn(e,n))&&i.unshift(kh(e,r,o)),null!=(r=sn(e,t))&&i.push(kh(e,r,o))),3===e.tag)return i;e=e.return}return[]}function Sh(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function xh(e,t,n,i,r){for(var o=t._reactName,a=[];null!==n&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===i)break;5!==s&&26!==s&&27!==s||null===c||(l=c,r?null!=(c=sn(n,o))&&a.unshift(kh(n,c,l)):r||null!=(c=sn(n,o))&&a.push(kh(n,c,l))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Ch=/\r\n?/g,Eh=/\u0000|\uFFFD/g;function Ih(e){return("string"==typeof e?e:""+e).replace(Ch,"\n").replace(Eh,"")}function Th(e,t){return t=Ih(t),Ih(e)===t}function Rh(e,t,n,i,r,o){switch(n){case"children":if("string"==typeof i)"body"===t||"textarea"===t&&""===i||Wt(e,i);else{if("number"!=typeof i&&"bigint"!=typeof i)return;"body"!==t&&Wt(e,""+i)}break;case"className":Nt(e,"class",i);break;case"tabIndex":Nt(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Nt(e,n,i);break;case"style":return void Gt(e,i,o);case"data":if("object"!==t){Nt(e,"data",i);break}case"src":case"href":if(""===i&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==i||"function"==typeof i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Jt(i),e.setAttribute(n,i);break;case"action":case"formAction":if("function"==typeof i){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}if("function"==typeof o&&("formAction"===n?("input"!==t&&Rh(e,t,"name",r.name,r,null),Rh(e,t,"formEncType",r.formEncType,r,null),Rh(e,t,"formMethod",r.formMethod,r,null),Rh(e,t,"formTarget",r.formTarget,r,null)):(Rh(e,t,"encType",r.encType,r,null),Rh(e,t,"method",r.method,r,null),Rh(e,t,"target",r.target,r,null))),null==i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Jt(i),e.setAttribute(n,i);break;case"onClick":return void(null!=i&&(e.onclick=Xt));case"onScroll":return void(null!=i&&gh("scroll",e));case"onScrollEnd":return void(null!=i&&gh("scrollend",e));case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(a(61));if(null!=(n=i.__html)){if(null!=r.children)throw Error(a(60));(null!=o?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"muted":e.muted=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==i||"function"==typeof i||"boolean"==typeof i||"symbol"==typeof i){e.removeAttribute("xlink:href");break}n=Jt(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":null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===i?e.setAttribute(n,""):!1!==i&&null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":null==i||"function"==typeof i||"symbol"==typeof i||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":gh("beforetoggle",e),gh("toggle",e),Rt(e,"popover",i);break;case"xlinkActuate":Ot(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ot(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ot(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ot(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ot(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ot(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ot(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ot(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ot(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Rt(e,"is",i);break;case"innerText":case"textContent":return;default:if(2<n.length&&("o"===n[0]||"O"===n[0])&&("n"===n[1]||"N"===n[1]))return;Rt(e,n=Yt.get(n)||n,i)}It=!0}function Nh(e,t,n,i,r,o){switch(n){case"style":return void Gt(e,i,o);case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(a(61));if(null!=(n=i.__html)){if(null!=r.children)throw Error(a(60));(null!=o?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if("string"==typeof i)Wt(e,i);else{if("number"!=typeof i&&"bigint"!=typeof i)return;Wt(e,""+i)}break;case"onScroll":return void(null!=i&&gh("scroll",e));case"onScrollEnd":return void(null!=i&&gh("scrollend",e));case"onClick":return void(null!=i&&(e.onclick=Xt));case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":return;default:return void(kt.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(r=n.endsWith("Capture"),o=n.slice(2,r?n.length-7:void 0),"function"==typeof(t=null!=(t=e[ot]||null)?t[n]:null)&&e.removeEventListener(o,t,r),"function"!=typeof i)?(It=!0,n in e?e[n]=i:!0===i?e.setAttribute(n,""):Rt(e,n,i)):("function"!=typeof t&&null!==t&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,i,r))))}It=!0}function Oh(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gh("error",e),gh("load",e);var i,r=!1,o=!1;for(i in n)if(n.hasOwnProperty(i)){var s=n[i];if(null!=s)switch(i){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Rh(e,t,i,s,n,null)}}return o&&Rh(e,t,"srcSet",n.srcSet,n,null),void(r&&Rh(e,t,"src",n.src,n,null));case"input":gh("invalid",e);var l=i=s=o=null,c=null,d=null;for(r in n)if(n.hasOwnProperty(r)){var u=n[r];if(null!=u)switch(r){case"name":o=u;break;case"type":s=u;break;case"checked":c=u;break;case"defaultChecked":d=u;break;case"value":i=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(null!=u)throw Error(a(137,t));break;default:Rh(e,t,r,u,n,null)}}return void zt(e,i,l,c,d,s,o,!1);case"select":for(o in gh("invalid",e),r=s=i=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":i=l;break;case"defaultValue":s=l;break;case"multiple":r=l;default:Rh(e,t,o,l,n,null)}return t=i,n=s,e.multiple=!!r,void(null!=t?$t(e,!!r,t,!1):null!=n&&$t(e,!!r,n,!0));case"textarea":for(s in gh("invalid",e),i=o=r=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":r=l;break;case"defaultValue":o=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(a(91));break;default:Rh(e,t,s,l,n,null)}return void Ht(e,r,o,i);case"option":for(c in n)n.hasOwnProperty(c)&&null!=(r=n[c])&&("selected"===c?e.selected=r&&"function"!=typeof r&&"symbol"!=typeof r:Rh(e,t,c,r,n,null));return;case"dialog":gh("beforetoggle",e),gh("toggle",e),gh("cancel",e),gh("close",e);break;case"iframe":case"object":gh("load",e);break;case"video":case"audio":for(r=0;r<hh.length;r++)gh(hh[r],e);break;case"image":gh("error",e),gh("load",e);break;case"details":gh("toggle",e);break;case"embed":case"source":case"link":gh("error",e),gh("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(d in n)if(n.hasOwnProperty(d)&&null!=(r=n[d]))switch(d){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Rh(e,t,d,r,n,null)}return;default:if(Kt(t)){for(u in n)n.hasOwnProperty(u)&&void 0!==(r=n[u])&&Nh(e,t,u,r,n,void 0);return}}for(l in n)n.hasOwnProperty(l)&&null!=(r=n[l])&&Rh(e,t,l,r,n,null)}var Ah={};function Lh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var Dh=null,Ph=null;function Mh(e){return 9===e.nodeType?e:e.ownerDocument}function Fh(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 jh(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function zh(e,t,n,i){return(n=Mh(n).createElement(e))[rt]=i,n[ot]=t,Oh(n,e,t),bt(n),n}function Uh(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var $h=null,Bh="function"==typeof setTimeout?setTimeout:void 0,Hh="function"==typeof clearTimeout?clearTimeout:void 0,Wh="function"==typeof Promise?Promise:void 0,Vh="function"==typeof requestAnimationFrame?requestAnimationFrame:Bh,qh="function"==typeof queueMicrotask?queueMicrotask:void 0!==Wh?function(e){return Wh.resolve(null).then(e).catch(Gh)}:Bh;function Gh(e){setTimeout(function(){throw e})}function Kh(e){return"head"===e}function Yh(e,t){var n=t,i=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&8===r.nodeType)if("/$"===(n=r.data)||"/&"===n){if(0===i)return e.removeChild(r),void Wf(t);i--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)i++;else if("html"===n)Dp(e.ownerDocument.documentElement);else if("head"===n){Dp(n=e.ownerDocument.head);for(var o=n.firstChild;o;){var a=o.nextSibling,s=o.nodeName;o[ut]||"SCRIPT"===s||"STYLE"===s||"LINK"===s&&"stylesheet"===o.rel.toLowerCase()||n.removeChild(o),o=a}}else"body"===n&&Dp(e.ownerDocument.body);n=r}while(n);Wf(t)}function Qh(e,t){var n=e;e=0;do{var i=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===e)break;e--}else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=i}while(n)}function Jh(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,null!=n&&(e.style.viewTransitionClass=n),"inline"===(n=getComputedStyle(e)).display){if(1===(t=e.getClientRects()).length)var i=1;else for(var r=i=0;r<t.length;r++){var o=t[r];0<o.width&&0<o.height&&i++}1===i&&((e=e.style).display=1===t.length?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Xh(e,t){e=e.style;var n=null!=(t=t.style)?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=null==n||"boolean"==typeof n?"":(""+n).trim(),n=null!=t?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=null==n||"boolean"==typeof n?"":(""+n).trim(),"inline-block"===e.display&&(null==t?e.display=e.margin="":(n=t.display,e.display=null==n||"boolean"==typeof n?"":n,null!=(n=t.margin)?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=null==n||"boolean"==typeof n?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=null==t||"boolean"==typeof t?"":t)))}function Zh(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:"absolute"===t.position||"fixed"===t.position,clip:"none"!==t.clipPath||"visible"!==t.overflow||"none"!==t.filter||"none"!==t.mask||"none"!==t.mask||"0px"!==t.borderRadius,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function ep(e){return Zh(e.getBoundingClientRect(),getComputedStyle(e),e)}function tp(e){var t=e.getBoundingClientRect();return Zh(t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height),getComputedStyle(e),e)}function np(e){this.addEventListener("load",e),this.addEventListener("error",e)}function ip(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}function rp(e){return{name:e,group:new ip("group",e),imagePair:new ip("image-pair",e),old:new ip("old",e),new:new ip("new",e)}}function op(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}function ap(e,t,n,i){return y(e).addEventListener(t,n,i),!1}function sp(e,t,n,i){return y(e).removeEventListener(t,n,i),!1}function lp(e){return null!=e&&"boolean"!=typeof e&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function cp(e){return null==e?"c=0":"boolean"==typeof e?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function dp(e,t,n,i){if(0===e.length)return-1;i=cp(i);for(var r=0;r<e.length;r++){var o=e[r];if(o.type===t&&o.listener===n&&cp(o.optionsOrUseCapture)===i)return r}return-1}function up(e,t){return 6!==e.tag&&function(e,t){function n(){i=!0}if(e.ownerDocument.activeElement===e)return!0;var i=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return i}(e=y(e),t)}function hp(e,t){return t.push(e),!1}function pp(e,t){return!(6===e.tag||(e=y(e))!==t&&!e.contains(t)||(t.blur(),0))}function fp(e,t){return 6===e.tag||(e=y(e),t.observe(e)),!1}function gp(e,t){return 6===e.tag||(e=y(e),t.unobserve(e)),!1}ip.prototype.animate=function(e,t){return(t="number"==typeof t?{duration:t}:E({},t)).pseudoElement=this._selector,this._scope.animate(e,t)},ip.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),i=[],r=0;r<n.length;r++){var o=n[r].effect;null!==o&&o.target===e&&o.pseudoElement===t&&i.push(n[r])}return i},ip.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)},op.prototype.addEventListener=function(e,t,n){var i=null,r=null;if(null==n||"boolean"==typeof n||null===(i=n.signal||null)||!i.aborted){null===this._eventListeners&&(this._eventListeners=[]);var o=this._eventListeners;if(-1===dp(o,e,t,n)){var a=this,s=t;null!=n&&"boolean"!=typeof n&&!0===n.once&&(s=function(i){a.removeEventListener(e,t,n),"function"==typeof t?t.call(this,i):t.handleEvent(i)}),null!==i&&(r=a.removeEventListener.bind(a,e,t,n),i.addEventListener("abort",r,{once:!0}),r=i.removeEventListener.bind(i,"abort",r)),i=lp(n),o.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:r}),f(this._fragmentFiber.child,!1,ap,e,s,i)}this._eventListeners=o}},op.prototype.removeEventListener=function(e,t,n){var i=this._eventListeners;if(null!==i&&-1!==(t=dp(i,e,t,n))){var r=i[t];n=r.attachedListener;var o=r.cleanup;r=lp(r.optionsOrUseCapture),f(this._fragmentFiber.child,!1,sp,e,n,r),i.splice(t,1),null!==o&&o()}},op.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(null===t)return!0;t=y(t);var n=this._eventListeners;if(null!==n&&0<n.length||!e.bubbles){var i=9===t.nodeType?t.createComment(""):document.createTextNode("");if(n)for(var r=0;r<n.length;r++){var o=n[r];i.addEventListener(o.type,o.attachedListener,lp(o.optionsOrUseCapture))}if(t.appendChild(i),e=i.dispatchEvent(e),n)for(r=0;r<n.length;r++)o=n[r],i.removeEventListener(o.type,o.attachedListener,lp(o.optionsOrUseCapture));return t.removeChild(i),e}return t.dispatchEvent(e)},op.prototype.focus=function(e){f(this._fragmentFiber.child,!0,up,e,void 0,void 0)},op.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!up(t[n],e);n--);},op.prototype.blur=function(){var e=g(this._fragmentFiber);null!==e&&null!==(e=Mh(e=y(e)).activeElement)&&f(this._fragmentFiber.child,!1,pp,e,void 0,void 0)},op.prototype.observeUsing=function(e){null===this._observers&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,fp,e,void 0,void 0)},op.prototype.unobserveUsing=function(e){var t=this._observers;if(null!==t&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,gp,e,void 0,void 0);for(var n=t=0;n<vp.length;n++){var i=vp[n];i.fragmentInstance===this&&i.observer===e?e.unobserve(i.instance):vp[t++]=i}vp.length=t}};var vp=[],mp=!1;function bp(e,t){if(6===e.tag){var n=(e=e.stateNode).ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=y(e),t.push.apply(t,e.getClientRects());return!1}function yp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}function wp(e,t){return kp(e=y(e),t),!1}function kp(e,t){null==e.reactFragments&&(e.reactFragments=new Set),e.reactFragments.add(t)}function _p(e,t){var n=t._eventListeners;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];e.addEventListener(r.type,r.attachedListener,lp(r.optionsOrUseCapture))}3!==e.nodeType&&(null!==(n=t._observers)&&n.forEach(function(n){for(var i=0,r=0;r<vp.length;r++){var o=vp[r];o.fragmentInstance===t&&o.observer===n&&o.instance===e||(vp[i++]=o)}vp.length=i,n.observe(e)}),kp(e,t))}function Sp(e,t){var n=t._eventListeners;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];e.removeEventListener(r.type,r.attachedListener,lp(r.optionsOrUseCapture))}3!==e.nodeType&&(null!==(n=t._observers)&&n.forEach(function(n){"string"==typeof n.rootMargin?function(e,t,n){var i;vp.push({fragmentInstance:e,observer:t,instance:n}),mp||(mp=!0,i=function(){mp=!1;var e=vp;vp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}},Vh(function(){Vh(function(e){return i()})}))}(t,n,e):n.unobserve(e)}),null!=e.reactFragments&&e.reactFragments.delete(t))}function xp(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":xp(n),pt(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function Cp(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=Tp(e.nextSibling)))return null}return e}function Ep(e){return"$?"===e.data||"$~"===e.data}function Ip(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function Tp(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}op.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,bp,e,void 0,void 0),e},op.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return null===t?this:y(t).getRootNode(e)},op.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(null===t)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,hp,n,void 0,void 0);var i=y(t);if(0===n.length){if(n=i,v(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;null!==t;){if(4===t.tag){t=t.stateNode.containerInfo;break e}if(3===t.tag||5===t.tag||27===t.tag)break;t=t.return}t=null}null!=t&&(n=t)}t=this._fragmentFiber;var r=i=n.compareDocumentPosition(e);return n===e?r=Node.DOCUMENT_POSITION_CONTAINS:i&Node.DOCUMENT_POSITION_CONTAINED_BY&&(r=null===(n=m(t)[1])?Node.DOCUMENT_POSITION_PRECEDING:0===(e=y(n).compareDocumentPosition(e))||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING),r|Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=y(n[0]),r=y(n[n.length-1]);var o=v(this._fragmentFiber)?t.parentElement:i;if(null==o)return Node.DOCUMENT_POSITION_DISCONNECTED;i=o.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,o=o.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var a=t.compareDocumentPosition(e),s=r.compareDocumentPosition(e),l=a&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=i&&o&&a&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,(t=i&&t===e||o&&r===e||l||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!i&&t===e||!o&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:a)&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||function(e,t,n,i,r){var o=ft(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!o)e:{for(;null!==o;){if(7===o.tag&&(o===t||o.alternate===t)){n=!0;break e}o=o.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(null===o)return r===(o=r.ownerDocument)||r===o.documentElement||r===o.body;e:{for(o=t,t=g(t);null!==o;){if(!(5!==o.tag&&3!==o.tag&&27!==o.tag||o!==t&&o.alternate!==t)){o=!0;break e}o=o.return}o=!1}return o}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!o)&&!(t=o===n)&&(null===(t=C(n,o,x))?t=!1:(f(t,!0,_,o,n),o=w,w=null,t=null!==o)),t):!!(e&Node.DOCUMENT_POSITION_FOLLOWING)&&((t=!!o)&&!(t=o===i)&&(null===(t=C(i,o,x))?t=!1:(f(t,!0,S,o,i),o=w,k=w=null,t=null!==o)),t)}(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC},op.prototype.scrollIntoView=function(e){if("object"==typeof e)throw Error(a(566));var t=[];f(this._fragmentFiber.child,!1,hp,t,void 0,void 0);var n=!1!==e;if(0===t.length){var i=m(this._fragmentFiber);if(null===(i=n?i[1]||i[0]||g(this._fragmentFiber):i[0]||i[1]))return;if(6===i.tag)return void yp(e=y(i),n);if(9!==(i=y(i)).nodeType){if(11===i.nodeType)return void(null!==(n="host"in i?i.host:null)&&n.scrollIntoView(e));i.scrollIntoView(e)}}for(i=n?t.length-1:0;i!==(n?-1:t.length);){var r=t[i];6===r.tag?yp(r=y(r),n):y(r).scrollIntoView(e),i+=n?-1:1}};var Rp=null;function Np(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return Tp(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function Op(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function Ap(e,t,n){switch(t=Mh(n),e){case"html":if(!(e=t.documentElement))throw Error(a(452));return e;case"head":if(!(e=t.head))throw Error(a(453));return e;case"body":if(!(e=t.body))throw Error(a(454));return e;default:throw Error(a(451))}}function Lp(e,t,n){for(var i in n){var r=n[i];n.hasOwnProperty(i)&&null!=r&&Rh(e,t,i,null,Ah,r)}null!=n.dangerouslySetInnerHTML&&(e.textContent=""),e.onclick===Xt&&(e.onclick=null),pt(e)}function Dp(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var Pp=new Map,Mp=new Set;function Fp(e){if("function"==typeof e.getRootNode){var t=e.getRootNode();if(9===t.nodeType||11===t.nodeType)return t}return 9===e.nodeType?e:e.ownerDocument}var jp=J.d;J.d={f:function(){var e=jp.f(),t=mu();return e||t},r:function(e){var t=gt(e);null!==t&&5===t.tag&&"form"===t.type?Ls(t):jp.r(e)},D:function(e){jp.D(e),Up("dns-prefetch",e,null)},C:function(e,t){jp.C(e,t),Up("preconnect",e,t)},L:function(e,t,n){jp.L(e,t,n);var i=zp;if(i&&e&&t){var r='link[rel="preload"][as="'+Ft(t)+'"]';"image"===t&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Ft(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(r+='[imagesizes="'+Ft(n.imageSizes)+'"]')):r+='[href="'+Ft(e)+'"]';var o=r;switch(t){case"style":o=Bp(e);break;case"script":o=Vp(e)}if(!(Pp.has(o)||(e=E({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Pp.set(o,e),null!==i.querySelector(r)||"style"===t&&i.querySelector(Hp(o))||"script"===t&&i.querySelector(qp(o))))){var a=i.createElement("link");Oh(a,"link",e),"style"===t&&(a[ht]=!0,a.onload=a.onerror=function(){yt(a)}),bt(a),i.head.appendChild(a)}}},m:function(e,t){jp.m(e,t);var n=zp;if(n&&e){var i=t&&"string"==typeof t.as?t.as:"script",r='link[rel="modulepreload"][as="'+Ft(i)+'"][href="'+Ft(e)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Vp(e)}if(!Pp.has(o)&&(e=E({rel:"modulepreload",href:e},t),Pp.set(o,e),null===n.querySelector(r))){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(qp(o)))return}Oh(i=n.createElement("link"),"link",e),bt(i),n.head.appendChild(i)}}},X:function(e,t){jp.X(e,t);var n=zp;if(n&&e){var i=mt(n).hoistableScripts,r=Vp(e),o=i.get(r);o||((o=n.querySelector(qp(r)))||(e=E({src:e,async:!0},t),(t=Pp.get(r))&&Qp(e,t),bt(o=n.createElement("script")),Oh(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}},S:function(e,t,n){jp.S(e,t,n);var i=zp;if(i&&e){var r=mt(i).hoistableStyles,o=Bp(e);t=t||"default";var a=r.get(o);if(!a){var s={loading:0,preload:null};if(a=i.querySelector(Hp(o)))s.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Pp.get(o))&&Yp(e,n);var l=a=i.createElement("link");bt(l),Oh(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Kp(a,t,i)}a={type:"stylesheet",instance:a,count:1,state:s},r.set(o,a)}}},M:function(e,t){jp.M(e,t);var n=zp;if(n&&e){var i=mt(n).hoistableScripts,r=Vp(e),o=i.get(r);o||((o=n.querySelector(qp(r)))||(e=E({src:e,async:!0,type:"module"},t),(t=Pp.get(r))&&Qp(e,t),bt(o=n.createElement("script")),Oh(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}};var zp="undefined"==typeof document?null:document;function Up(e,t,n){var i=zp;if(i&&"string"==typeof t&&t){var r=Ft(t);r='link[rel="'+e+'"][href="'+r+'"]',"string"==typeof n&&(r+='[crossorigin="'+n+'"]'),Mp.has(r)||(Mp.add(r),e={rel:e,crossOrigin:n,href:t},null===i.querySelector(r)&&(Oh(t=i.createElement("link"),"link",e),bt(t),i.head.appendChild(t)))}}function $p(e,t,n,i){var r=(r=le.current)?Fp(r):null;if(!r)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(n=Bp(n.href),(i=(t=mt(r).hoistableStyles).get(n))||(i={type:"style",instance:null,count:0,state:null},t.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Bp(n.href);var o=mt(r).hoistableStyles,s=o.get(e);if(s||(r=r.ownerDocument||r,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=r.querySelector(Hp(e)))?o._p||(s.instance=o,s.state.loading=5):((o=Pp.get(e))||(o={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pp.set(e,o)),function(e,t,n,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(!0!==t[ht])return void(i.loading=1)}else(t=e.createElement("link"))[ht]=!0,t.onload=t.onerror=yt.bind(null,t),Oh(t,"link",n),bt(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}(r,e,o,s.state))),t&&null===i)throw Error(a(528,""));return s}if(t&&null!==i)throw Error(a(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(n=Vp(n),(i=(t=mt(r).hoistableScripts).get(n))||(i={type:"script",instance:null,count:0,state:null},t.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Bp(e){return'href="'+Ft(e)+'"'}function Hp(e){return'link[rel="stylesheet"]['+e+"]"}function Wp(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function Vp(e){return'[src="'+Ft(e)+'"]'}function qp(e){return"script[async]"+e}function Gp(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Ft(n.href)+'"]');if(i)return t.instance=i,bt(i),i;var r=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return bt(i=(e.ownerDocument||e).createElement("style")),Oh(i,"style",r),Kp(i,n.precedence,e),t.instance=i;case"stylesheet":r=Bp(n.href);var o=e.querySelector(Hp(r));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;i=Wp(n),(r=Pp.get(r))&&Yp(i,r),bt(o=(e.ownerDocument||e).createElement("link"));var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Oh(o,"link",i),t.state.loading|=4,Kp(o,n.precedence,e),t.instance=o;case"script":return o=Vp(n.src),(r=e.querySelector(qp(o)))?(t.instance=r,bt(r),r):(i=n,(r=Pp.get(o))&&Qp(i=E({},n),r),bt(r=(e=e.ownerDocument||e).createElement("script")),Oh(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(a(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(i=t.instance,t.state.loading|=4,Kp(i,n.precedence,e));return t.instance}function Kp(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,a=0;a<i.length;a++){var s=i[a];if(s.dataset.precedence===t)o=s;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function Yp(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Qp(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Jp=null;function Xp(e,t,n){if(null===Jp){var i=new Map,r=Jp=new Map;r.set(n,i)}else(i=(r=Jp).get(n))||(i=new Map,r.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var o=n[r];if(!(o[ut]||o[rt]||"link"===e&&"stylesheet"===o.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==o.namespaceURI){var a=o.getAttribute(t)||"";a=e+a;var s=i.get(a);s?s.push(o):i.set(a,[o])}}return i}function Zp(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function ef(e,t){return"img"===e&&null!=t.src&&""!==t.src&&null==t.onLoad&&"lazy"!==t.loading}function tf(e){return!!("stylesheet"!==e.type||3&e.state.loading)}function nf(e){return(e.width||100)*(e.height||100)*("number"==typeof devicePixelRatio?devicePixelRatio:1)*.25}function rf(e,t){"function"==typeof t.decode&&(e.imgCount++,t.complete||(e.imgBytes+=nf(t),e.suspenseyImages.push(t)),e=lf.bind(e),t.decode().then(e,e))}var of=0;function af(e){if(0===e.count&&(0===e.imgCount||!e.waitingForImages))if(e.stylesheets)df(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}function sf(){this.count--,af(this)}function lf(){this.imgCount--,af(this)}var cf=null;function df(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,cf=new Map,t.forEach(uf,e),cf=null,sf.call(e))}function uf(e,t){if(!(4&t.state.loading)){var n=cf.get(e);if(n)var i=n.get(null);else{n=new Map,cf.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var a=r[o];"LINK"!==a.nodeName&&"not all"===a.getAttribute("media")||(n.set(a.dataset.precedence,a),i=a)}i&&n.set(null,i)}a=(r=t.instance).getAttribute("data-precedence"),(o=n.get(a)||i)===i&&n.set(null,r),n.set(a,r),this.count++,i=sf.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),o?o.parentNode.insertBefore(r,o.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(r,e.firstChild),t.state.loading|=4}}var hf={$$typeof:D,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function pf(e,t,n,i,r,o,a,s,l){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=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.transitionTypes=null,this.incompleteTransitions=new Map}function ff(e,t,n,i,r,o){r=function(e){return e?e=lr:lr}(r),null===i.context?i.context=r:i.pendingContext=r,(i=Go(t)).payload={element:n},null!==(o=void 0===o?null:o)&&(i.callback=o),null!==(n=Ko(e,i,t))&&(hu(n,0,t),Yo(n,e,t))}function gf(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function vf(e,t){gf(e,t),(e=e.alternate)&&gf(e,t)}function mf(e){if(13===e.tag||31===e.tag){var t=or(e,67108864);null!==t&&hu(t,0,67108864),vf(e,67108864)}}function bf(e){if(13===e.tag||31===e.tag){var t=cu(),n=or(e,t=Ze(t));null!==n&&hu(n,0,t),vf(e,t)}}var yf=!0;function wf(e,t,n,i){var r=Q.T;Q.T=null;var o=J.p;try{J.p=2,_f(e,t,n,i)}finally{J.p=o,Q.T=r}}function kf(e,t,n,i){var r=Q.T;Q.T=null;var o=J.p;try{J.p=8,_f(e,t,n,i)}finally{J.p=o,Q.T=r}}function _f(e,t,n,i){if(yf){var r=Sf(i);if(null===r)wh(e,t,i,xf,n),Pf(e,i);else if(function(e,t,n,i,r){switch(t){case"focusin":return Tf=Mf(Tf,e,t,n,i,r),!0;case"dragenter":return Rf=Mf(Rf,e,t,n,i,r),!0;case"mouseover":return Nf=Mf(Nf,e,t,n,i,r),!0;case"pointerover":var o=r.pointerId;return Of.set(o,Mf(Of.get(o)||null,e,t,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,Af.set(o,Mf(Af.get(o)||null,e,t,n,i,r)),!0}return!1}(r,e,t,n,i))i.stopPropagation();else if(Pf(e,i),4&t&&-1<Df.indexOf(e)){for(;null!==r;){var o=gt(r);if(null!==o)switch(o.tag){case 3:if((o=o.stateNode).current.memoizedState.isDehydrated){var a=Be(o.pendingLanes);if(0!==a){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-Me(a);s.entanglements[1]|=l,a&=~l}th(o),!(6&Id)&&(Kd=xe()+500,nh(0,!1))}}break;case 31:case 13:null!==(s=or(o,2))&&hu(s,0,2),mu(),vf(o,2)}if(null===(o=Sf(i))&&wh(e,t,i,xf,n),o===r)break;r=o}null!==r&&i.stopPropagation()}else wh(e,t,i,null,n)}}function Sf(e){return Cf(e=en(e))}var xf=null;function Cf(e){if(xf=null,null!==(e=ft(e))){var t=s(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=c(t)))return e;e=null}else if(31===n){if(null!==(e=d(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xf=e,null}function Ef(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ce()){case Ee:return 2;case Ie:return 8;case Te:case Re:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var If=!1,Tf=null,Rf=null,Nf=null,Of=new Map,Af=new Map,Lf=[],Df="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 Pf(e,t){switch(e){case"focusin":case"focusout":Tf=null;break;case"dragenter":case"dragleave":Rf=null;break;case"mouseover":case"mouseout":Nf=null;break;case"pointerover":case"pointerout":Of.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Af.delete(t.pointerId)}}function Mf(e,t,n,i,r,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},null!==t&&null!==(t=gt(t))&&mf(t),e):(e.eventSystemFlags|=i,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function Ff(e){var t=ft(e.target);if(null!==t){var n=s(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=c(n)))return e.blockedOn=t,void nt(e.priority,function(){bf(n)})}else if(31===t){if(null!==(t=d(n)))return e.blockedOn=t,void nt(e.priority,function(){bf(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function jf(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sf(e.nativeEvent);if(null!==n)return null!==(t=gt(n))&&mf(t),e.blockedOn=n,!1;var i=new(n=e.nativeEvent).constructor(n.type,n);Zt=i,n.target.dispatchEvent(i),Zt=null,t.shift()}return!0}function zf(e,t,n){jf(e)&&n.delete(t)}function Uf(){If=!1,null!==Tf&&jf(Tf)&&(Tf=null),null!==Rf&&jf(Rf)&&(Rf=null),null!==Nf&&jf(Nf)&&(Nf=null),Of.forEach(zf),Af.forEach(zf)}function $f(e,t){e.blockedOn===t&&(e.blockedOn=null,If||(If=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Uf)))}var Bf=null;function Hf(e){Bf!==e&&(Bf=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bf===e&&(Bf=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],r=e[t+2];if("function"!=typeof i){if(null===Cf(i||n))continue;break}var o=gt(n);null!==o&&(e.splice(t,3),t-=3,Os(o,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Wf(e){function t(t){return $f(t,e)}null!==Tf&&$f(Tf,e),null!==Rf&&$f(Rf,e),null!==Nf&&$f(Nf,e),Of.forEach(t),Af.forEach(t);for(var n=0;n<Lf.length;n++){var i=Lf[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Lf.length&&null===(n=Lf[0]).blockedOn;)Ff(n),null===n.blockedOn&&Lf.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(i=0;i<n.length;i+=3){var r=n[i],o=n[i+1],a=r[ot]||null;if("function"==typeof o)a||Hf(n);else if(a){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,a=o[ot]||null)s=a.formAction;else if(null!==Cf(r))continue}else s=a.action;"function"==typeof s?n[i+1]=s:(n.splice(i,3),i-=3),Hf(n)}}}function Vf(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return r=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==r&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var i=!1,r=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),null!==r&&(r(),r=null)}}}function qf(e){this._internalRoot=e}function Gf(e){this._internalRoot=e}Gf.prototype.render=qf.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));ff(t.current,cu(),e,t,null,null)},Gf.prototype.unmount=qf.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;ff(e.current,2,null,e,null,null),mu(),t[at]=null}},Gf.prototype.unstable_scheduleHydration=function(e){if(e){var t=tt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lf.length&&0!==t&&t<Lf[n].priority;n++);Lf.splice(n,0,e),0===n&&Ff(e)}};var Kf=i.version;if("19.3.1"!==Kf)throw Error(a(527,Kf,"19.3.1"));J.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=s(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(null===r)break;var o=r.alternate;if(null===o){if(null!==(i=r.return)){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return h(r),e;if(o===i)return h(r),t;o=o.sibling}throw Error(a(188))}if(n.return!==i.return)n=r,i=o;else{for(var l=!1,c=r.child;c;){if(c===n){l=!0,n=r,i=o;break}if(c===i){l=!0,i=r,n=o;break}c=c.sibling}if(!l){for(c=o.child;c;){if(c===n){l=!0,n=o,i=r;break}if(c===i){l=!0,i=o,n=r;break}c=c.sibling}if(!l)throw Error(a(189))}}if(n.alternate!==i)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(t),null===(e=null!==e?p(e):null)?null:e.stateNode};var Yf={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.3.1"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Qf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qf.isDisabled&&Qf.supportsFiber)try{Le=Qf.inject(Yf),De=Qf}catch(e){}}t.createRoot=function(e,t){if(!(n=e)||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(a(299));var n,i=!1,r="",o=el,s=tl,l=nl;return null!=t&&(!0===t.unstable_strictMode&&(i=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onUncaughtError&&(o=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError)),t=function(e,t,n,i,r,o,a,s,l,c,d,u){return e=new pf(e,t,n,a,l,c,d,u,s),t=1,!0===o&&(t|=24),o=dr(3,null,null,t),e.current=o,o.stateNode=e,(t=ho()).refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:i,isDehydrated:n,cache:t},Vo(o),e}(e,1,!1,null,0,i,r,null,o,s,l,Vf),e[at]=t.current,bh(e),new qf(t)}}),t=n.cw((e,t)=>{var n=l();function i(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 r(){}var o={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal"),s=Symbol.for("react.recoverable"),c=Symbol.for("react.optimistic_key"),d=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,t.browser=function(e){return{$$typeof:s,_reason:e}},t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(i(299));return function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:a,key:null==i?null:i===c?c:""+i,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=d.T,n=o.p;try{if(d.T=null,o.p=2,e)return e()}finally{d.T=t,o.p=n,o.d.f()}},t.preconnect=function(e,t){"string"==typeof e&&(t=t?"string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:null,o.d.C(e,t))},t.prefetchDNS=function(e){"string"==typeof e&&o.d.D(e)},t.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,i=u(n,t.crossOrigin),r="string"==typeof t.integrity?t.integrity:void 0,a="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?o.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):"script"===n&&o.d.X(e,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=u(t.as,t.crossOrigin);o.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0})}}else null==t&&o.d.M(e)},t.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,i=u(n,t.crossOrigin);o.d.L(e,n,{crossOrigin:i,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=u(t.as,t.crossOrigin);o.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0})}else o.d.m(e)},t.requestFormReset=function(e){o.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return d.H.useFormState(e,t,n)},t.useFormStatus=function(){return d.H.useHostTransitionStatus()},t.version="19.3.1"}),r=n.cw(t=>{!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),t.exports=e()}),o=n.cw(e=>{!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=t()}),a=n.cw((e,t)=>{var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(e,t,i){var r=null;if(void 0!==i&&(r=""+i),void 0!==t.key&&(r=""+t.key),"key"in t)for(var o in i={},t)"key"!==o&&(i[o]=t[o]);else i=t;return t=i.ref,{$$typeof:n,type:e,key:r,ref:void 0!==t?t:null,props:i}}t.Fragment=i,t.jsx=r,t.jsxs=r}),s=n.cw((e,t)=>{var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),f=Symbol.for("react.view_transition"),g=Symbol.iterator,v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,b={};function y(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||v}function w(){}function k(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||v}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=y.prototype;var _=k.prototype=new w;_.constructor=k,m(_,y.prototype),_.isPureReactComponent=!0;var S=Array.isArray;function x(){}var C={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function I(e,t,i){var r=i.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==r?r:null,props:i}}function T(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var R=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return i[e]})):t.toString(36);var n,i}function O(e,t,r,o,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l,c,d=!1;if(null===e)d=!0;else switch(s){case"bigint":case"string":case"number":d=!0;break;case"object":switch(e.$$typeof){case n:case i:d=!0;break;case h:return O((d=e._init)(e._payload),t,r,o,a)}}if(d)return a=a(e),d=""===o?"."+N(e,0):o,S(a)?(r="",null!=d&&(r=d.replace(R,"$&/")+"/"),O(a,t,r,"",function(e){return e})):null!=a&&(T(a)&&(l=a,c=r+(null==a.key||e&&e.key===a.key?"":(""+a.key).replace(R,"$&/")+"/")+d,a=I(l.type,c,l.props)),t.push(a)),1;d=0;var u,p=""===o?".":o+":";if(S(e))for(var f=0;f<e.length;f++)d+=O(o=e[f],t,r,s=p+N(o,f),a);else if("function"==typeof(f=null===(u=e)||"object"!=typeof u?null:"function"==typeof(u=g&&u[g]||u["@@iterator"])?u:null))for(e=f.call(e),f=0;!(o=e.next()).done;)d+=O(o=o.value,t,r,s=p+N(o,f++),a);else if("object"===s){if("function"==typeof e.then)return O(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(x,x):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,r,o,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return d}function A(e,t,n){if(null==e)return e;var i=[],r=0;return O(e,i,"","",function(e){return t.call(n,e,r++)}),i}function L(e){if(-1===e._status){var t=(0,e._result)();t.then(function(n){0!==e._status&&-1!==e._status||(e._status=1,e._result=n,void 0===t.status&&(t.status="fulfilled",t.value=n))},function(n){0!==e._status&&-1!==e._status||(e._status=2,e._result=n,void 0===t.status&&(t.status="rejected",t.reason=n))}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function P(e){var t=C.T,n={};n.types=null!==t?t.types:null,C.T=n;try{var i=e(),r=C.S;null!==r&&r(n,i),"object"==typeof i&&null!==i&&"function"==typeof i.then&&i.then(x,D)}catch(e){D(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),C.T=t}}var M={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=p,t.Children=M,t.Component=y,t.Fragment=r,t.Profiler=a,t.PureComponent=k,t.StrictMode=o,t.Suspense=d,t.ViewTransition=f,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}},t.addTransitionType=function e(t){var n=C.T;if(null!==n){var i=n.types;null===i?n.types=[t]:-1===i.indexOf(t)&&i.push(t)}else P(e.bind(null,t))},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var i=m({},e.props),r=e.key;if(null!=t)for(o in void 0!==t.key&&(r=""+t.key),t)!E.call(t,o)||"key"===o||"__self"===o||"__source"===o||"ref"===o&&void 0===t.ref||(i[o]=t[o]);var o=arguments.length-2;if(1===o)i.children=n;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];i.children=a}return I(e.type,r,i)},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:s,_context:e},e},t.createElement=function(e,t,n){var i,r={},o=null;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)E.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&(r[i]=t[i]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(i in a=e.defaultProps)void 0===r[i]&&(r[i]=a[i]);return I(e,o,r)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=T,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.startTransition=P,t.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},t.use=function(e){return C.H.use(e)},t.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)},t.useCallback=function(e,t){return C.H.useCallback(e,t)},t.useContext=function(e){return C.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return C.H.useEffect(e,t)},t.useEffectEvent=function(e){return C.H.useEffectEvent(e)},t.useId=function(){return C.H.useId()},t.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return C.H.useMemo(e,t)},t.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)},t.useRef=function(e){return C.H.useRef(e)},t.useState=function(e){return C.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return C.H.useTransition()},t.version="19.3.1"}),l=n.cw(e=>{e.exports=s()}),c=n.cw(e=>{e.exports=a()}),d=n.cw((e,t)=>{function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var i=n-1>>>1,r=e[i];if(!(0<o(r,t)))break e;e[i]=t,e[n]=r,n=i}}function i(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,r=e.length,a=r>>>1;i<a;){var s=2*(i+1)-1,l=e[s],c=s+1,d=e[c];if(0>o(l,n))c<r&&0>o(d,l)?(e[i]=d,e[c]=n,i=c):(e[i]=l,e[s]=n,i=s);else{if(!(c<r&&0>o(d,n)))break e;e[i]=d,e[c]=n,i=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],d=[],u=1,h=null,p=3,f=!1,g=!1,v=!1,m=!1,b="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,w="undefined"!=typeof setImmediate?setImmediate:null;function k(e){for(var t=i(d);null!==t;){if(null===t.callback)r(d);else{if(!(t.startTime<=e))break;r(d),t.sortIndex=t.expirationTime,n(c,t)}t=i(d)}}function _(e){if(v=!1,k(e),!g)if(null!==i(c))g=!0,x||(x=!0,S());else{var t=i(d);null!==t&&A(_,t.startTime-e)}}var S,x=!1,C=-1,E=5,I=-1;function T(){return!(!m&&t.unstable_now()-I<E)}function R(){if(m=!1,x){var e=t.unstable_now();I=e;var n=!0;try{e:{g=!1,v&&(v=!1,y(C),C=-1),f=!0;var o=p;try{t:{for(k(e),h=i(c);null!==h&&!(h.expirationTime>e&&T());){var a=h.callback;if("function"==typeof a){h.callback=null,p=h.priorityLevel;var s=a(h.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof s){h.callback=s,k(e),n=!0;break t}h===i(c)&&r(c),k(e)}else r(c);h=i(c)}if(null!==h)n=!0;else{var l=i(d);null!==l&&A(_,l.startTime-e),n=!1}}break e}finally{h=null,p=o,f=!1}n=void 0}}finally{n?S():x=!1}}}if("function"==typeof w)S=function(){w(R)};else if("undefined"!=typeof MessageChannel){var N=new MessageChannel,O=N.port2;N.port1.onmessage=R,S=function(){O.postMessage(null)}}else S=function(){b(R,0)};function A(e,n){C=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_requestPaint=function(){m=!0},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,r,o){var a=t.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:u++,callback:r,priorityLevel:e,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>a?(e.sortIndex=o,n(d,e),null===i(c)&&e===i(d)&&(v?(y(C),C=-1):v=!0,A(_,o-a))):(e.sortIndex=s,n(c,e),g||f||(g=!0,x||(x=!0,S()))),e},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}}),u=n.cw(e=>{e.exports=d()}),h=n.cw(e=>{var t=[];function n(e){for(var n=-1,i=0;i<t.length;i++)if(t[i].identifier===e){n=i;break}return n}function i(e,i){for(var o={},a=[],s=0;s<e.length;s++){var l=e[s],c=i.base?l[0]+i.base:l[0],d=o[c]||0,u="".concat(c," ").concat(d);o[c]=d+1;var h=n(u),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var f=r(p,i);i.byIndex=s,t.splice(s,0,{identifier:u,updater:f,references:1})}a.push(u)}return a}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var o=i(e=e||[],r=r||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var s=n(o[a]);t[s].references--}for(var l=i(e,r),c=0;c<o.length;c++){var d=n(o[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}o=l}}}),p=n.cw(e=>{var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}}),f=n.cw(e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}}),g=n.cw(e=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}}),v=n.cw(e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}}),m=n.cw(e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}),b=n(833),y=n.n(b);l(),r(),c();const w=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),k={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function _(e){return null!=e}const S=(0,s().createContext)({}),x=(0,s().forwardRef)(({color:e,size:t,width:n,height:i,strokeWidth:r,absoluteStrokeWidth:o,nonScalingStroke:a,className:l="",children:c,iconNode:d=[],icon:u={node:d,aliases:[],size:24},...h},p)=>{const{size:f=24,strokeWidth:g=2,absoluteStrokeWidth:v=!1,nonScalingStroke:m=!1,color:b="currentColor",className:y=""}=(0,s().useContext)(S)??{},x=Boolean(c)||(e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(h),[C,E,I=[]]=function(e,t={}){return function(e,t={}){const n=t.attributeNames??{},i=e=>n[e]??e,r=e.size??e.width??k.width,o=e.size??e.height??k.height,a=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...a],l=t.className?.split(" ").filter(Boolean)??[],c=!1===t.includeDefaultClasses?w(...l):w("lucide",...s,...l),d=t.absoluteStrokeWidth?Number(t.strokeWidth??k["stroke-width"])*Number(e.size??e.width??k.width)/Number(t.size??t.width??k.width):t.strokeWidth??k["stroke-width"];return["svg",{...Object.entries(k).reduce((e,[t,n])=>(e[i(t)]=n,e),{}),..."color"in t&&t.color&&{[i("stroke")]:t.color},..."size"in t&&_(t.size)&&{[i("width")]:t.size,[i("height")]:t.size},..."width"in t&&_(t.width)&&{[i("width")]:t.width},..."height"in t&&_(t.height)&&{[i("height")]:t.height},[i("stroke-width")]:d,...c&&{[i("class")]:c},[i("viewBox")]:`0 0 ${r} ${o}`,...!1===t.hasA11yProp?{[i("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{const[n,r,o]=e,a=t.nonScalingStroke?{[i("vector-effect")]:"non-scaling-stroke",...r}:r;return o?[n,a,o]:[n,a]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(u,{color:e??b,width:n??t??f,height:i??t??f,strokeWidth:r??g,absoluteStrokeWidth:o??v,nonScalingStroke:a??m,className:w(y,l),hasA11yProp:x,attributes:h});return(0,s().createElement)(C,{ref:p,...E},[...I.map(([e,t])=>(0,s().createElement)(e,t)),...Array.isArray(c)?c:[c]])});function C(e,t=[],n=[]){const i="string"==typeof e?function(e,t,n=[]){if(null==t)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:(i=e,i?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),size:24,node:t,...n.length>0?{aliases:n}:{}};var i}(e,t,n):e,r=(0,s().forwardRef)(({className:e,...t},n)=>(0,s().createElement)(x,{ref:n,icon:i,className:e,...t}));return i.name&&(r.displayName=(e=>{const t=(e=>{let t="",n=!1;for(const i of e)"-"===i||"_"===i||i<=" "?n=t.length>0:(0===t.length?t+=i.toLowerCase():t+=n?i.toUpperCase():i,n=!1);return t})(e);return t.charAt(0).toUpperCase()+t.slice(1)})(i.name)),r}const E=C({name:"mic",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]}),I=C({name:"phone-off",size:24,node:[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]]}),T=(0,s().createContext)();class R{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}let N;const O=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,A={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},L=e=>A[e];let D={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(O,L)};const P={},M=(e,t,n,i)=>{U(n)&&P[n]||(U(n)&&(P[n]=new Date),((e,t,n,i)=>{const r=[n,{code:t,...i||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);U(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...r):console?.warn&&console.warn(...r)})(e,t,n,i))},F=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},j=(e,t,n)=>{e.loadNamespaces(t,F(e,n))},z=(e,t,n,i)=>{if(U(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return j(e,n,i);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,F(e,i))},U=e=>"string"==typeof e,$=(e,t,n,i)=>e.getFixedT(t,n,i),B=(e,t={})=>{const{i18n:n}=t,{i18n:i,defaultNS:r}=(0,s().useContext)(T)||{},o=n||i||N;if(o&&!o.reportNamespaces&&(o.reportNamespaces=new R),!o){M(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return U(t)?t:"object"==typeof(n=t)&&null!==n&&U(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var n},t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}o.options.react?.wait&&M(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...D,...o.options.react,...t},{useSuspense:l,keyPrefix:c}=a;let d=e||r||o.options?.defaultNS;d=U(d)?[d]:d||["translation"],o.reportNamespaces.addUsedNamespaces?.(d);const u=(o.isInitialized||o.initializedStoreOnce)&&d.every(e=>((e,t,n={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!i(t.isLanguageChangingTo,e))return!1}}):(M(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,o,a)),h=((e,t,n,i)=>(0,s().useCallback)($(e,t,n,i),[e,t,n,i]))(o,t.lng||null,"fallback"===a.nsMode?d:d[0],c),p=()=>h,f=()=>$(o,t.lng||null,"fallback"===a.nsMode?d:d[0],c),[g,v]=(0,s().useState)(p);let m=d.join();t.lng&&(m=`${t.lng}${m}`);const b=((e,t)=>{const n=(0,s().useRef)();return(0,s().useEffect)(()=>{n.current=e},[e,t]),n.current})(m),y=(0,s().useRef)(!0);(0,s().useEffect)(()=>{const{bindI18n:e,bindI18nStore:n}=a;y.current=!0,u||l||(t.lng?z(o,t.lng,d,()=>{y.current&&v(f)}):j(o,d,()=>{y.current&&v(f)})),u&&b&&b!==m&&y.current&&v(f);const i=()=>{y.current&&v(f)};return e&&o?.on(e,i),n&&o?.store.on(n,i),()=>{y.current=!1,o&&e&&e?.split(" ").forEach(e=>o.off(e,i)),n&&o&&n.split(" ").forEach(e=>o.store.off(e,i))}},[o,m]),(0,s().useEffect)(()=>{y.current&&u&&v(p)},[o,c,u]);const w=[g,o,u];if(w.t=g,w.i18n=o,w.ready=u,u)return w;if(!u&&!l)return w;throw new Promise(e=>{t.lng?z(o,t.lng,d,()=>e()):j(o,d,()=>e())})},H=e=>{const t="number"==typeof e?e:0,n=Number.isFinite(t)?Math.max(0,Math.floor(t)):0,i=Math.floor(n/60),r=n%60;return`${String(i).padStart(2,"0")}:${String(r).padStart(2,"0")}`},W=({audioLevel:e,isMuted:t=!1})=>{const n=(0,s().useRef)(0),[i,r]=(0,s().useState)(0);(0,s().useEffect)(()=>{const t=5*e*.3+.7*n.current;(Math.abs(t-n.current)>.02||e<.005)&&(n.current=t,r(t))},[e]);const o=Math.min(1,Math.max(0,i)),l=i>.03;return(0,a().jsx)("div",{className:"flex h-9 w-9 items-center justify-center gap-[2px]",children:[.4,.7,1,.7,.4].map((e,n)=>{const i=l?Math.max(.25,Math.min(.95,.25+o*e*.7)):.15;return(0,a().jsx)("span",{className:"h-5 w-[2px] origin-center rounded-full transition-transform duration-150 "+(t?"bg-slate-400":"bg-emerald-500"),style:{transform:`scaleY(${i})`,opacity:l?.7+.3*o:.4}},n)})})},V=({className:e=""})=>(0,a().jsx)("svg",{className:`h-[18px] w-[18px] ${e}`,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a().jsx)("path",{d:"M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"})}),q=()=>(0,a().jsx)("svg",{className:"h-[18px] w-[18px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,xmlns:"http://www.w3.org/2000/svg",children:(0,a().jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),G=()=>(0,a().jsxs)("div",{className:"relative h-5 w-5",children:[(0,a().jsx)(E,{className:"h-5 w-5"}),(0,a().jsx)("svg",{className:"absolute inset-0 h-5 w-5",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a().jsx)("path",{d:"M3 3L17 17",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round"})})]}),K=()=>(0,a().jsxs)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,a().jsx)("circle",{cx:"6",cy:"5",r:"1.5"}),(0,a().jsx)("circle",{cx:"12",cy:"5",r:"1.5"}),(0,a().jsx)("circle",{cx:"18",cy:"5",r:"1.5"}),(0,a().jsx)("circle",{cx:"6",cy:"10",r:"1.5"}),(0,a().jsx)("circle",{cx:"12",cy:"10",r:"1.5"}),(0,a().jsx)("circle",{cx:"18",cy:"10",r:"1.5"}),(0,a().jsx)("circle",{cx:"6",cy:"15",r:"1.5"}),(0,a().jsx)("circle",{cx:"12",cy:"15",r:"1.5"}),(0,a().jsx)("circle",{cx:"18",cy:"15",r:"1.5"}),(0,a().jsx)("circle",{cx:"12",cy:"20",r:"1.5"})]}),Y=[["1","2","3"],["4","5","6"],["7","8","9"],["*","0","#"]],Q=({onSendDigits:e})=>{const{t}=B(),[n,i]=(0,s().useState)(null);return(0,a().jsx)("div",{className:"grid grid-cols-3 gap-2 rounded-xl border border-slate-200/80 bg-white/90 p-3 shadow-sm backdrop-blur-md dark:border-slate-700/50 dark:bg-slate-900/80",role:"group","aria-label":t("audio_widget.dtmf.label"),children:Y.flat().map(t=>(0,a().jsx)("button",{type:"button",onClick:()=>(t=>{e(t),i(t),setTimeout(()=>i(null),150)})(t),className:"flex h-11 w-11 items-center justify-center rounded-lg text-base font-semibold transition-all duration-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400 focus-visible:ring-offset-1 active:scale-95 "+(n===t?"bg-sky-100 text-sky-700 dark:bg-sky-500/20 dark:text-sky-300":"bg-slate-100 text-slate-700 hover:bg-slate-200 dark:bg-slate-700/50 dark:text-slate-200 dark:hover:bg-slate-700"),"aria-label":t,children:t},t))})},J=({onStartCall:e,onEndCall:t,onToggleMute:n,isMuted:i,onSendDigits:r,onEvent:o})=>{const{t:l}=B(),[c,d]=(0,s().useState)("idle"),[u,h]=(0,s().useState)(""),[p,f]=(0,s().useState)(""),[g,v]=(0,s().useState)(0),[m,b]=(0,s().useState)(!1),[y,w]=(0,s().useState)(!1),[k,_]=(0,s().useState)(0),[S,x]=(0,s().useState)(!1),[C,T]=(0,s().useState)(!1),R=(0,s().useRef)(null),N=(0,s().useRef)(null),O=(0,s().useRef)(null),A=(0,s().useRef)(null),L=(0,s().useRef)(null);(0,s().useEffect)(()=>("connected"===c&&A.current?L.current=window.setInterval(()=>{A.current&&_(Math.floor((Date.now()-A.current)/1e3))},1e3):L.current&&(clearInterval(L.current),L.current=null),()=>{L.current&&clearInterval(L.current)}),[c]),(0,s().useEffect)(()=>{const e=o("any",({state:e,message:t,data:n})=>{switch(e){case"audio-level":{const e=n??t;let i;i="number"==typeof e?e:"string"==typeof e?parseFloat(e):Number(e),Number.isNaN(i)||v(Math.max(0,i));break}case"warning":t&&(f(t),R.current&&clearTimeout(R.current),R.current=window.setTimeout(()=>{f(""),R.current=null},5e3));break;case"warning-cleared":f(""),R.current&&(clearTimeout(R.current),R.current=null);break;case"remote-audio":N.current&&(clearTimeout(N.current),N.current=null),O.current&&(clearTimeout(O.current),O.current=null),b(!1),w(!1);break;case"error":d("error"),h(t||l("audio_widget.errors.generic")),b(!1),w(!1),_(0),A.current=null,O.current&&(clearTimeout(O.current),O.current=null),setTimeout(()=>{d("idle"),h("")},3e3)}});return()=>{e(),R.current&&clearTimeout(R.current)}},[o,l]),(0,s().useEffect)(()=>"connected"!==c?(N.current&&(clearTimeout(N.current),N.current=null),O.current&&(clearTimeout(O.current),O.current=null),void queueMicrotask(()=>{m&&b(!1),y&&w(!1)})):g>.04?(queueMicrotask(()=>{y||w(!0),m&&b(!1)}),N.current&&(clearTimeout(N.current),N.current=null),void(O.current&&(clearTimeout(O.current),O.current=null))):void(!y||m||N.current||(N.current=window.setTimeout(()=>{b(!0),N.current=null},1400))),[g,c,y,m]),(0,s().useEffect)(()=>()=>{N.current&&clearTimeout(N.current),O.current&&clearTimeout(O.current)},[]),(0,s().useEffect)(()=>{m?(O.current&&clearTimeout(O.current),O.current=window.setTimeout(()=>{b(!1),w(!1),O.current=null},4e3)):O.current&&(clearTimeout(O.current),O.current=null)},[m]);const D="connecting"===c,P="error"===c?"bg-rose-50/80 text-rose-600 border border-rose-200/60 shadow-[0_2px_8px_rgba(244,63,94,0.12)] dark:bg-rose-500/15 dark:text-rose-300 dark:border-rose-500/30":"connected"===c?"bg-emerald-50/80 text-emerald-600 border border-emerald-200/60 shadow-[0_2px_8px_rgba(16,185,129,0.15)] hover:bg-gradient-to-br hover:from-red-500 hover:to-red-600 hover:text-white hover:border-red-500/20 hover:shadow-[0_6px_20px_rgba(239,68,68,0.35)] dark:bg-emerald-500/15 dark:text-emerald-300 dark:border-emerald-500/30 dark:hover:from-red-600 dark:hover:to-red-700 transition-colors":"connecting"===c?"bg-sky-50/80 text-sky-600 border border-sky-200/60 shadow-[0_2px_8px_rgba(14,165,233,0.12)] dark:bg-sky-500/15 dark:text-sky-300 dark:border-sky-500/30":"bg-gradient-to-br from-emerald-500 to-emerald-600 text-white border border-emerald-500/20 shadow-[0_4px_14px_rgba(16,185,129,0.25)] hover:shadow-[0_6px_20px_rgba(16,185,129,0.35)] dark:from-emerald-600 dark:to-emerald-700 dark:border-emerald-500/30",M="error"===c?"border-t-rose-400/60 border-r-rose-300/30 border-b-transparent border-l-transparent":m?"border-t-sky-400/60 border-r-sky-300/30 border-b-transparent border-l-transparent":"border-t-sky-500/60 border-r-sky-400/30 border-b-transparent border-l-transparent",F=l("idle"===c?"audio_widget.status.ready":"connecting"===c?"audio_widget.status.connecting":"connected"===c?m?"audio_widget.status.thinking":"audio_widget.status.on_call":"audio_widget.status.error"),j="error"===c?"text-rose-500 dark:text-rose-400":"connected"===c?"text-emerald-500 dark:text-emerald-400":"connecting"===c?"text-sky-500 dark:text-sky-400":"text-slate-500 dark:text-slate-400",z=l("idle"===c||"error"===c?"audio_widget.actions.start":"connecting"===c?"audio_widget.actions.cancel":"audio_widget.actions.end"),U="idle"===c?l("audio_widget.sr.ready"):"connecting"===c?l("audio_widget.sr.connecting"):"connected"===c?l(m?"audio_widget.sr.connected_thinking":"audio_widget.sr.connected"):u?l("audio_widget.sr.error_with_message",{message:u}):l("audio_widget.sr.error");return(0,a().jsxs)("div",{className:"relative font-sans text-slate-800 antialiased dark:text-slate-100",children:[p&&(0,a().jsx)("div",{className:"absolute -top-14 left-1/2 w-max max-w-[18rem] -translate-x-1/2 rounded-full bg-amber-100/90 px-4 py-2 text-xs font-medium text-amber-800 shadow-lg shadow-amber-200/70 ring-1 ring-amber-300 backdrop-blur dark:bg-amber-500/15 dark:text-amber-200 dark:ring-amber-400/40",role:"status","aria-live":"polite",children:p}),(0,a().jsxs)("div",{className:"inline-flex min-w-[260px] items-center gap-3 rounded-2xl border border-slate-200/80 bg-white/90 px-5 py-3.5 shadow-sm backdrop-blur-md backdrop-saturate-150 transition-all duration-200 hover:shadow-md dark:border-slate-700/50 dark:bg-slate-900/80 dark:shadow-xl dark:shadow-slate-950/30",children:[(0,a().jsxs)("button",{type:"button",onClick:()=>{"idle"!==c&&"error"!==c?(N.current&&(clearTimeout(N.current),N.current=null),L.current&&(clearInterval(L.current),L.current=null),t(),d("idle"),v(0),b(!1),w(!1),_(0),x(!1),T(!1),A.current=null,O.current&&(clearTimeout(O.current),O.current=null)):(async()=>{try{d("connecting"),h(""),v(0),b(!1),w(!1),_(0),A.current=null,await e(),d("connected"),A.current=Date.now(),_(0)}catch(e){d("error"),b(!1),w(!1),h(e instanceof Error?e.message:l("audio_widget.errors.start_failed")),_(0),A.current=null}})()},className:`group relative flex h-12 w-12 shrink-0 items-center justify-center rounded-full transition-all duration-200 hover:scale-[1.05] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white active:scale-[0.98] dark:focus-visible:ring-offset-slate-950 ${P}`,"aria-label":z,title:"error"===c&&u?u:F,children:[(0,a().jsx)("span",{className:"sr-only",children:U}),"connected"===c?(0,a().jsxs)(a().Fragment,{children:[(0,a().jsx)("div",{className:"absolute inset-0 flex items-center justify-center transition-opacity duration-200 group-hover:opacity-0",children:(0,a().jsx)(W,{audioLevel:g,isMuted:S})}),(0,a().jsx)("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:(0,a().jsx)(I,{className:"h-5 w-5"})})]}):"error"===c?(0,a().jsx)(q,{}):(0,a().jsx)(V,{className:"idle"===c?"fill-white":"fill-sky-600 dark:fill-sky-300"}),D?(0,a().jsx)("span",{className:`pointer-events-none absolute inset-[-4px] rounded-full border border-transparent ${M} animate-spin`}):null]}),"connected"===c&&(0,a().jsx)("button",{type:"button",onClick:()=>{n(),x(i())},className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full transition-all duration-200 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 active:scale-95 "+(S?"bg-amber-100 text-amber-700 hover:bg-amber-200 focus-visible:ring-amber-400 dark:bg-amber-500/20 dark:text-amber-300 dark:hover:bg-amber-500/30":"bg-slate-100 text-slate-600 hover:bg-slate-200 focus-visible:ring-slate-400 dark:bg-slate-700/50 dark:text-slate-300 dark:hover:bg-slate-700"),"aria-label":l(S?"audio_widget.mute.unmute_microphone":"audio_widget.mute.mute_microphone"),title:l(S?"audio_widget.mute.unmute":"audio_widget.mute.mute"),children:S?(0,a().jsx)(G,{}):(0,a().jsx)(E,{className:"h-5 w-5"})}),"connected"===c&&(0,a().jsxs)("div",{className:"relative shrink-0",children:[(0,a().jsx)("button",{type:"button",onClick:()=>T(e=>!e),className:"flex h-12 w-12 items-center justify-center rounded-full transition-all duration-200 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 active:scale-95 "+(C?"bg-sky-100 text-sky-700 hover:bg-sky-200 focus-visible:ring-sky-400 dark:bg-sky-500/20 dark:text-sky-300 dark:hover:bg-sky-500/30":"bg-slate-100 text-slate-600 hover:bg-slate-200 focus-visible:ring-slate-400 dark:bg-slate-700/50 dark:text-slate-300 dark:hover:bg-slate-700"),"aria-label":l("audio_widget.dtmf.toggle"),title:l("audio_widget.dtmf.toggle"),"aria-expanded":C,children:(0,a().jsx)(K,{})}),C&&(0,a().jsx)("div",{className:"absolute bottom-full left-1/2 mb-5 w-max -translate-x-1/2",children:(0,a().jsx)(Q,{onSendDigits:r})})]}),(0,a().jsxs)("div",{className:"relative flex flex-col gap-1 overflow-hidden leading-tight",children:[(0,a().jsx)("span",{className:`relative z-10 text-[0.65rem] font-medium uppercase tracking-[0.25em] ${j} transition-colors duration-200`,children:F}),"connected"===c&&(0,a().jsx)("span",{className:"animate-in fade-in slide-in-from-bottom-1 relative z-10 font-mono text-[0.8rem] text-slate-600 transition-all duration-500 dark:text-slate-400",children:H(k)})]})]})]})};function X(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function Z(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;var ee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),te=new Uint8Array(16);function ne(){if(!ee)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(te)}for(var ie=[],re=0;re<256;++re)ie[re]=(re+256).toString(16).substr(1);function oe(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var r=(e=e||{}).random||(e.rng||ne)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t)for(var o=0;o<16;++o)t[i+o]=r[o];return t||function(e){var t=0,n=ie;return[n[e[t++]],n[e[t++]],n[e[t++]],n[e[t++]],"-",n[e[t++]],n[e[t++]],"-",n[e[t++]],n[e[t++]],"-",n[e[t++]],n[e[t++]],"-",n[e[t++]],n[e[t++]],n[e[t++]],n[e[t++]],n[e[t++]],n[e[t++]]].join("")}(r)}const{SDP_CREATE_OFFER_FAILED:ae,SDP_CREATE_ANSWER_FAILED:se,SDP_SET_LOCAL_DESCRIPTION_FAILED:le,SDP_SET_REMOTE_DESCRIPTION_FAILED:ce,SDP_SEND_FAILED:de,MEDIA_MICROPHONE_PERMISSION_DENIED:ue,MEDIA_DEVICE_NOT_FOUND:he,MEDIA_GET_USER_MEDIA_FAILED:pe,UNABLE_READ_AUDIO_INPUT_ON_DEVICE_CHANGE:fe,HOLD_FAILED:ge,INVALID_CALL_PARAMETERS:ve,BYE_SEND_FAILED:me,SUBSCRIBE_FAILED:be,PEER_CLOSED_DURING_INIT:ye,WEBSOCKET_CONNECTION_FAILED:we,WEBSOCKET_ERROR:ke,RECONNECTION_EXHAUSTED:_e,GATEWAY_FAILED:Se,LOGIN_FAILED:xe,INVALID_CREDENTIALS:Ce,AUTHENTICATION_REQUIRED:Ee,ICE_RESTART_FAILED:Ie,NETWORK_OFFLINE:Te,SESSION_NOT_REATTACHED:Re,UNEXPECTED_ERROR:Ne}={SDP_CREATE_OFFER_FAILED:40001,SDP_CREATE_ANSWER_FAILED:40002,SDP_SET_LOCAL_DESCRIPTION_FAILED:40003,SDP_SET_REMOTE_DESCRIPTION_FAILED:40004,SDP_SEND_FAILED:40005,MEDIA_MICROPHONE_PERMISSION_DENIED:42001,MEDIA_DEVICE_NOT_FOUND:42002,MEDIA_GET_USER_MEDIA_FAILED:42003,UNABLE_READ_AUDIO_INPUT_ON_DEVICE_CHANGE:42004,HOLD_FAILED:44001,INVALID_CALL_PARAMETERS:44002,BYE_SEND_FAILED:44003,SUBSCRIBE_FAILED:44004,PEER_CLOSED_DURING_INIT:44005,WEBSOCKET_CONNECTION_FAILED:45001,WEBSOCKET_ERROR:45002,RECONNECTION_EXHAUSTED:45003,GATEWAY_FAILED:45004,LOGIN_FAILED:46001,INVALID_CREDENTIALS:46002,AUTHENTICATION_REQUIRED:46003,ICE_RESTART_FAILED:47001,NETWORK_OFFLINE:48001,SESSION_NOT_REATTACHED:48501,UNEXPECTED_ERROR:49001},{HIGH_RTT:Oe,HIGH_JITTER:Ae,HIGH_PACKET_LOSS:Le,LOW_MOS:De,LOW_LOCAL_AUDIO:Pe,LOW_INBOUND_AUDIO:Me,LOW_BYTES_RECEIVED:Fe,LOW_BYTES_SENT:je,RECORDING_UNAVAILABLE:ze,RECORDING_BUFFER_OVERFLOW:Ue,ICE_CONNECTIVITY_LOST:$e,ICE_GATHERING_TIMEOUT:Be,ICE_GATHERING_EMPTY:He,PEER_CONNECTION_FAILED:We,ONLY_HOST_ICE_CANDIDATES:Ve,ANSWER_WHILE_PEER_ACTIVE:qe,ICE_CANDIDATE_PAIR_CHANGED:Ge,AUDIO_INPUT_DEVICE_CHANGE_SKIPPED:Ke,MULTIPLE_ACTIVE_CALLS_DETECTED:Ye,DUPLICATE_INBOUND_ANSWER:Qe,SHARED_REMOTE_ELEMENT_OVERWRITE:Je,REMOTE_AUDIO_ELEMENT_UNRESOLVED:Xe,TOKEN_EXPIRING_SOON:Ze,UNKNOWN_REATTACHED_SESSION:et,SIGNALING_RECOVERY_REQUIRED:tt,MEDIA_RECOVERY_REQUIRED:nt,RECONNECTION_FAILED_WITH_NO_AUTO_RECONNECT:it}={HIGH_RTT:31001,HIGH_JITTER:31002,HIGH_PACKET_LOSS:31003,LOW_MOS:31004,LOW_LOCAL_AUDIO:31005,LOW_INBOUND_AUDIO:31006,LOW_BYTES_RECEIVED:32001,LOW_BYTES_SENT:32002,RECORDING_UNAVAILABLE:32003,RECORDING_BUFFER_OVERFLOW:32004,ICE_CONNECTIVITY_LOST:33001,ICE_GATHERING_TIMEOUT:33002,ICE_GATHERING_EMPTY:33003,PEER_CONNECTION_FAILED:33004,ONLY_HOST_ICE_CANDIDATES:33005,ANSWER_WHILE_PEER_ACTIVE:33006,ICE_CANDIDATE_PAIR_CHANGED:33008,AUDIO_INPUT_DEVICE_CHANGE_SKIPPED:33009,MULTIPLE_ACTIVE_CALLS_DETECTED:33010,DUPLICATE_INBOUND_ANSWER:33007,SHARED_REMOTE_ELEMENT_OVERWRITE:33011,REMOTE_AUDIO_ELEMENT_UNRESOLVED:33012,TOKEN_EXPIRING_SOON:34001,UNKNOWN_REATTACHED_SESSION:35002,SIGNALING_RECOVERY_REQUIRED:36003,MEDIA_RECOVERY_REQUIRED:36004,RECONNECTION_FAILED_WITH_NO_AUTO_RECONNECT:36005},rt="wss://rtc.telnyx.com",ot={NORMAL_CLOSURE:1e3,GOING_AWAY:1001,PROTOCOL_ERROR:1002,UNSUPPORTED_DATA:1003,NO_STATUS_RECEIVED:1005,ABNORMAL_CLOSURE:1006,INVALID_FRAME_PAYLOAD:1007,POLICY_VIOLATION:1008,MESSAGE_TOO_BIG:1009,INTERNAL_ERROR:1011},at={urls:"stun:stun.l.google.com:19302"},st=[{urls:"stun:stun.telnyx.com:3478"},at,{urls:"turn:turn.telnyx.com:3478?transport=udp",username:"testuser",credential:"testpassword"},{urls:"turn:turn.telnyx.com:3478?transport=tcp",username:"testuser",credential:"testpassword"},{urls:"turns:turn.telnyx.com:443",username:"testuser",credential:"testpassword"}],lt=[{urls:"stun:stundev.telnyx.com:3478"},at,{urls:"turn:turndev.telnyx.com:3478?transport=udp",username:"testuser",credential:"testpassword"},{urls:"turn:turndev.telnyx.com:3478?transport=tcp",username:"testuser",credential:"testpassword"},{urls:"turns:turndev.telnyx.com:443",username:"testuser",credential:"testpassword"}],ct=/^(turn:)turn(dev)?\.telnyx\.com(?=[:/?]|$)/;function dt(e,t){return e.replace(ct,`$1${t}.turn$2.telnyx.com`)}var ut,ht;(ht=ut||(ut={})).SocketOpen="telnyx.socket.open",ht.SocketClose="telnyx.socket.close",ht.SocketError="telnyx.socket.error",ht.SocketMessage="telnyx.socket.message",ht.SpeedTest="telnyx.internal.speedtest",ht.SocketActivity="telnyx.internal.socketActivity",ht.Ready="telnyx.ready",ht.Error="telnyx.error",ht.Warning="telnyx.warning",ht.Notification="telnyx.notification",ht.StatsFrame="telnyx.stats.frame",ht.StatsReport="telnyx.stats.report",ht.Messages="telnyx.messages",ht.Calls="telnyx.calls",ht.MediaError="telnyx.rtc.mediaError",ht.PeerConnectionFailureError="telnyx.rtc.peerConnectionFailureError",ht.PeerConnectionSignalingStateClosed="telnyx.rtc.peerConnectionSignalingStateClosed",ht.AIConversationMessage="telnyx.ai.conversation";const pt={40001:{name:"SDP_CREATE_OFFER_FAILED",message:"Failed to create call offer",description:"The browser was unable to generate a local SDP offer. This typically indicates a WebRTC API error or invalid media constraints.",causes:["Browser WebRTC API error","Missing or invalid media constraints"],solutions:["Check getUserMedia permissions","Verify ICE server configuration"],fatal:!0},40002:{name:"SDP_CREATE_ANSWER_FAILED",message:"Failed to answer the call",description:"The browser was unable to generate a local SDP answer. The remote offer may be invalid or the browser state inconsistent.",causes:["Browser WebRTC API error","Invalid remote SDP offer"],solutions:["Retry the call","Check browser WebRTC compatibility"],fatal:!0},40003:{name:"SDP_SET_LOCAL_DESCRIPTION_FAILED",message:"Failed to apply local call settings",description:"setLocalDescription() was rejected by the browser. The generated SDP may be malformed or the browser state may be inconsistent.",causes:["Malformed SDP","Browser state inconsistency"],solutions:["Retry the call"],fatal:!0},40004:{name:"SDP_SET_REMOTE_DESCRIPTION_FAILED",message:"Failed to apply remote call settings",description:"setRemoteDescription() was rejected by the browser. The remote SDP may be malformed or contain unsupported codecs.",causes:["Malformed remote SDP","Browser codec mismatch"],solutions:["Retry the call","Check codec configuration"],fatal:!0},40005:{name:"SDP_SEND_FAILED",message:"Failed to send call data to server",description:"The Invite or Answer message could not be delivered via the signaling WebSocket. The connection may have been lost.",causes:["WebSocket connection lost","Server error"],solutions:["Check network connectivity","Retry the call"],fatal:!0},42001:{name:"MEDIA_MICROPHONE_PERMISSION_DENIED",message:"Microphone access denied",description:"The user or operating system denied microphone permission. The browser permission prompt was dismissed or OS-level access is disabled.",causes:["User denied browser permission prompt","OS-level microphone access disabled"],solutions:["Ask user to grant microphone permission in browser settings"],fatal:!0},42002:{name:"MEDIA_DEVICE_NOT_FOUND",message:"No microphone found",description:"The requested audio input device is not available. No microphone is connected, the device was disconnected, or an invalid deviceId was specified.",causes:["No microphone connected","Device was disconnected","Invalid deviceId"],solutions:["Check that a microphone is connected","Select a valid audio input device"],fatal:!0},42003:{name:"MEDIA_GET_USER_MEDIA_FAILED",message:"Failed to access microphone",description:"getUserMedia() was rejected for an unexpected reason. The device may be in use by another application or the browser encountered an internal error.",causes:["Browser error","Device in use by another application"],solutions:["Close other applications using the microphone","Retry"],fatal:!0},42004:{name:"UNABLE_READ_AUDIO_INPUT_ON_DEVICE_CHANGE",message:"Unable to read audio input settings after device change",description:"The audio input track was replaced successfully, but reading its settings failed. The call continues with the new track and the recorded microphone ID falls back to default.",causes:["MediaStreamTrack.getSettings() threw after audio input replacement"],solutions:["No call restart is required; inspect the original error if device identification remains unavailable"],fatal:!1},44001:{name:"HOLD_FAILED",message:"Failed to hold the call",description:"The server rejected or did not respond to the hold request. The WebSocket connection may have been lost during the operation.",causes:["Server error","WebSocket connection lost during hold"],solutions:["Retry the hold operation","Check network connectivity"],fatal:!1},44002:{name:"INVALID_CALL_PARAMETERS",message:"Invalid call parameters",description:"The call could not be initiated because required parameters are missing or invalid. For example, no destination number was provided to newCall().",causes:["Missing destinationNumber in call options","Invalid or empty call parameters"],solutions:["Provide a valid destinationNumber when calling newCall()","Check the call options object for required fields"],fatal:!0},44003:{name:"BYE_SEND_FAILED",message:"Failed to hang up cleanly",description:"The hangup signal could not be delivered to the server. The call was terminated locally but the server may not be aware.",causes:["WebSocket connection lost before BYE sent"],solutions:["No action needed — call is terminated locally","Check network connectivity"],fatal:!1},44004:{name:"SUBSCRIBE_FAILED",message:"Failed to subscribe to call events",description:"The Verto subscribe request for the call channel failed. This may prevent receiving call state updates from the server.",causes:["WebSocket connection lost during subscribe","Server rejected the subscription request"],solutions:["Check network connectivity","Retry the call"],fatal:!1},44005:{name:"PEER_CLOSED_DURING_INIT",message:"Call was closed during setup",description:"The PeerConnection was closed (e.g. by hangup()) while peer.init() was still running. This is a race condition: an async operation such as setRemoteDescription, getUserMedia, or the media recovery flow yielded control, and close() ran during that gap. The init() cannot continue because the underlying RTCPeerConnection has been destroyed.",causes:["call.hangup() or call.close() was called while the call was still setting up","A WebSocket Bye message arrived during getUserMedia prompt or SDP negotiation","User clicked hangup/decline before media permissions were granted"],solutions:["This is expected if the user intentionally hung up during setup — no action needed","If this happens frequently without user action, check for automatic hangup triggers that may fire too early"],fatal:!0},45001:{name:"WEBSOCKET_CONNECTION_FAILED",message:"Unable to connect to server",description:"The WebSocket connection to the signaling server could not be established. The server may be unreachable, the URL may be incorrect, or a firewall may be blocking the connection.",causes:["Server unreachable","Incorrect WebSocket URL","Firewall blocking WebSocket connections","Network interruption"],solutions:["Check network connectivity","Verify the signaling server URL","Ensure WebSocket connections are not blocked by a firewall"],fatal:!0},45002:{name:"WEBSOCKET_ERROR",message:"Connection to server lost",description:"An error occurred on the WebSocket connection after it was established. The connection may have been dropped due to network issues or server-side closure.",causes:["Network interruption","Server closed the connection","Idle timeout"],solutions:["Check network connectivity","SDK will attempt automatic reconnection if configured"],fatal:!1},45003:{name:"RECONNECTION_EXHAUSTED",message:"Unable to reconnect to server",description:"All automatic reconnection attempts have been exhausted. The SDK tried to re-establish the WebSocket connection multiple times but failed on every attempt.",causes:["Prolonged network outage","Server unreachable","Firewall or proxy blocking reconnection"],solutions:["Check network connectivity","Call client.disconnect() and client.connect() to manually retry","Notify the user that the connection was lost"],fatal:!0},45004:{name:"GATEWAY_FAILED",message:"Gateway connection failed",description:"The upstream gateway reported a FAILED, FAIL_WAIT, or TIMEOUT state. The signaling server could not establish or maintain a connection to the gateway. When autoReconnect is disabled, this is immediately fatal. When enabled, the SDK will retry until RECONNECTION_EXHAUSTED.",causes:["Gateway down or unreachable","Server-side infrastructure issue","Network partition between signaling server and gateway"],solutions:["Wait for automatic reconnection (if autoReconnect is enabled)","Call client.disconnect() and client.connect() to manually retry","Check Telnyx service status"],fatal:!1},46001:{name:"LOGIN_FAILED",message:"Authentication failed",description:"The login request was rejected by the server. The credentials may be invalid, expired, or the account may be suspended.",causes:["Invalid credentials (username/password or token)","Expired authentication token","Account suspended or disabled"],solutions:["Verify credentials","Generate a new authentication token","Check account status"],fatal:!0},46002:{name:"INVALID_CREDENTIALS",message:"Invalid credential parameters",description:"The SDK rejected the login options before sending any request to the server. This is an internal client-side validation guard — the credentials object is missing required fields or has an invalid structure. No network request was made.",causes:["Missing login and password fields","Missing or malformed authentication token","Invalid combination of credential fields in the options object"],solutions:["Provide valid login/password or a valid authentication token","Check the TelnyxRTC constructor options against the documentation","Ensure the credential object matches one of the supported auth modes (credentials, token, or anonymous)"],fatal:!0},46003:{name:"AUTHENTICATION_REQUIRED",message:"Authentication required",description:"The server rejected a request because the session is not authenticated. This can happen when the client sends a message (e.g. Invite, Subscribe, or Ping) before login completes, after a token expires mid-session, or after the server drops the authenticated state for any reason.",causes:["Message sent before login completed","Authentication token expired during the session","Server-side session was invalidated","WebSocket reconnected but re-authentication did not complete"],solutions:["Ensure the client is fully logged in before sending messages","Re-authenticate using client.login() with fresh credentials","Listen for telnyx.ready before making calls or sending requests"],fatal:!1},47001:{name:"ICE_RESTART_FAILED",message:"ICE restart failed",description:"The ICE restart Modify request could not be sent or the server returned an error. The media path could not be recovered via ICE restart.",causes:["WebSocket connection lost during ICE restart","Server rejected the Modify request","Timeout waiting for server response"],solutions:["The call may recover via WebSocket reconnect + Attach","If the call does not recover, hang up and retry"],fatal:!1},48001:{name:"NETWORK_OFFLINE",message:"Device is offline",description:"The browser reported that the device has lost network connectivity (navigator.onLine === false). All WebSocket and media connections will fail until the network is restored.",causes:["Wi-Fi or ethernet disconnected","Airplane mode enabled","Network interface went down"],solutions:["Check network connectivity","Reconnect to Wi-Fi or ethernet","Disable airplane mode"],fatal:!1},48501:{name:"SESSION_NOT_REATTACHED",message:"Active call lost after reconnect",description:"The WebSocket reconnected successfully but the server did not reattach the active call session. The server no longer knows about the call, so any subsequent call-control operation (hangup, hold, etc.) will fail with CALL_DOES_NOT_EXIST. The call is unrecoverable and must be terminated locally.",causes:["Server-side session expired during the disconnection window","Reconnect token was invalidated","Backend restarted or lost in-memory call state"],solutions:["Terminate the local call and notify the user","Start a new call","Investigate why the session was not preserved on the server"],fatal:!0},49001:{name:"UNEXPECTED_ERROR",message:"An unexpected error occurred",description:"An error was thrown that does not match any known SDK error category. This is a catch-all for unclassified failures.",causes:["Unknown or unhandled error condition"],solutions:["Check the originalError property for the underlying cause","Report the issue if it persists"],fatal:!0}},ft={31001:{name:"HIGH_RTT",message:"High network latency detected",description:"Round-trip time (RTT) exceeded the threshold for multiple consecutive samples. High latency causes perceptible audio delays.",causes:["Poor network connection","Geographic distance to media server","Network congestion"],solutions:["Check network connectivity","Use a wired connection instead of Wi-Fi","Close bandwidth-heavy applications"]},31002:{name:"HIGH_JITTER",message:"High jitter detected",description:"Jitter (variability in packet arrival time) exceeded the threshold for multiple consecutive samples. High jitter causes crackling and choppy audio.",causes:["Network congestion","Unstable Wi-Fi connection","Overloaded network equipment"],solutions:["Use a wired connection instead of Wi-Fi","Close bandwidth-heavy applications","Check network equipment"]},31003:{name:"HIGH_PACKET_LOSS",message:"High packet loss detected",description:"Packet loss exceeded the threshold for multiple consecutive samples. High packet loss causes choppy audio or dropped calls.",causes:["Network congestion","Unstable connection","Firewall or QoS misconfiguration"],solutions:["Check network connectivity","Use a wired connection","Contact network administrator"]},31004:{name:"LOW_MOS",message:"Low call quality score",description:"Mean Opinion Score (MOS) dropped below the acceptable threshold for multiple consecutive samples. This is a composite indicator of overall call quality.",causes:["Combination of high latency, jitter, and/or packet loss","Poor network conditions"],solutions:["Check network connectivity","Use a wired connection","Close bandwidth-heavy applications"]},31005:{name:"LOW_LOCAL_AUDIO",message:"Low local microphone audio detected",description:"Local outbound audio level stayed below the acceptable threshold before the microphone produced real audio, or stayed silent for a long continuous window after audio was confirmed. This may indicate that the microphone is not capturing enough audio even while RTP is being sent.",causes:["Microphone input level is too low","Wrong microphone selected","Microphone is obstructed or too far from the speaker","Operating system input gain is muted or very low"],solutions:["Check the selected microphone","Increase microphone input gain","Move closer to the microphone","Verify the microphone is not muted at the operating system or hardware level"]},31006:{name:"LOW_INBOUND_AUDIO",message:"Low inbound audio detected",description:"Inbound (remote) audio level stayed below the acceptable threshold for multiple consecutive stats intervals while RTP packets continued to flow. This may indicate the remote party is sending silence or comfort-noise (e.g. one-way audio caused by a media bridge issue), as opposed to LOW_BYTES_RECEIVED which fires when no bytes arrive at all.",causes:["Remote party microphone is muted or capturing very low audio","Media bridge or PBX is injecting comfort-noise/silence instead of forwarding real audio","One-way audio where RTP flows but content is silent (server-side media issue)","Remote party is on hold or not speaking"],solutions:["Verify the remote party is not muted and is actively speaking","Check the media bridge / PBX for comfort-noise injection or transcoding issues","Inspect PCAP RTP payload uniqueness to distinguish real audio from comfort-noise","If the issue persists, report the call for server-side media investigation"]},32001:{name:"LOW_BYTES_RECEIVED",message:"No audio data received",description:"No bytes have been received from the remote party for multiple consecutive seconds. This may indicate a network interruption or remote-side issue.",causes:["Network interruption","Remote party microphone issue","Firewall blocking inbound media"],solutions:["Check network connectivity","Ask remote party to check their microphone","Check firewall rules for media ports"]},32002:{name:"LOW_BYTES_SENT",message:"No audio data being sent",description:"No bytes have been sent for multiple consecutive seconds. This may indicate a local microphone issue or network interruption.",causes:["Microphone muted or disconnected","Network interruption","Local media track ended"],solutions:["Check that the microphone is not muted","Verify the microphone is still connected","Check network connectivity"]},32003:{name:"RECORDING_UNAVAILABLE",message:"Call recording is not available in this browser",description:"Call recording was enabled (enableCallRecording is true), but the browser does not support MediaStreamTrackProcessor (required to capture raw audio PCM). Recording is disabled for this call; the call proceeds normally. Currently affects Firefox and older Chromium (< 94).",causes:["Browser does not implement MediaStreamTrackProcessor (Firefox, Safari)","Chromium version older than 94","Recording enabled on an unsupported platform"],solutions:["Use a recent Chromium-based browser (Chrome 94+, Edge 94+) to capture recordings","Disable enableCallRecording if recording is not required for this deployment","See the enableCallRecording JSDoc for platform support details"]},32004:{name:"RECORDING_BUFFER_OVERFLOW",message:"Call recording buffer overflow — oldest packets dropped",description:"The in-memory call recording buffer reached its maxBufferBytes cap before the next scheduled flush. The oldest captured RTP packets were dropped to keep memory bounded. This indicates the flush interval is too long for the call audio rate, or the upload endpoint is slow/unreachable. The recording continues with the remaining (newer) packets.",causes:["Flush interval (callRecordingFlushIntervalMs) is larger than the buffer can hold at the current audio rate","Upload endpoint (/call_recording) is slow or unreachable, so intermediate flushes back up","A very long call with high sample rate filling the buffer between flushes"],solutions:["Reduce callRecordingFlushIntervalMs so flushes happen more frequently","Increase callRecordingMaxBufferBytes if memory headroom allows","Check the /call_recording endpoint health and network path to voice-sdk-proxy"]},33001:{name:"ICE_CONNECTIVITY_LOST",message:"Connection interrupted",description:"The ICE connection transitioned to the disconnected state. The previously selected connection path was lost and renegotiation may be required. The connection may recover automatically.",causes:["Temporary network interruption","Network interface change (e.g. Wi-Fi to cellular)","NAT rebinding"],solutions:["Wait for automatic recovery","Check network connectivity"]},33002:{name:"ICE_GATHERING_TIMEOUT",message:"ICE gathering timed out",description:"ICE candidate gathering did not complete within the safety timeout. This is typically caused by network restrictions blocking STUN/TURN. The call may still succeed if candidates arrive late.",causes:["Firewall blocking STUN/TURN","Network unreachable","STUN/TURN server not responding"],solutions:["Check STUN/TURN server reachability","Ensure UDP traffic is not blocked","Try forceRelayCandidate option"]},33003:{name:"ICE_GATHERING_EMPTY",message:"No ICE candidates gathered",description:"No ICE candidates were gathered after sending the initial SDP. This may indicate a firewall blocking all STUN/TURN traffic or no available network interface.",causes:["Firewall blocking all STUN/TURN traffic","No network interface available","VPN blocking UDP"],solutions:["Check STUN/TURN server reachability","Ensure UDP traffic is not blocked","Use forceRelayCandidate option"]},33004:{name:"PEER_CONNECTION_FAILED",message:"Connection failed",description:"RTCPeerConnection entered the failed state. This is a recoverable condition — the SDK may attempt ICE restart or the connection may recover. If it does not recover, the call will eventually be terminated.",causes:["ICE failure","DTLS handshake failure","Prolonged network interruption"],solutions:["Wait for automatic recovery","Check network connectivity","Verify TURN server credentials"]},33005:{name:"ONLY_HOST_ICE_CANDIDATES",message:"Only local network candidates available",description:"ICE gathering completed with host (local network) candidates only. This is diagnostic evidence that no server-reflexive (srflx), peer-reflexive (prflx), or relay (TURN) candidates were found; connectivity may still succeed, but network traversal options can be limited.",causes:["STUN/TURN servers unreachable","Firewall blocking UDP traffic to STUN/TURN servers","Incorrect TURN server configuration or credentials","Restrictive corporate network or VPN"],solutions:["Verify STUN/TURN server URLs and credentials","Ensure UDP traffic to STUN/TURN ports is not blocked","Check firewall or VPN settings","Try using TCP-based TURN as a fallback"]},33006:{name:"ANSWER_WHILE_PEER_ACTIVE",message:"Call answer ignored because a peer connection is already active",description:"answer() was called on a call that already has an active or connecting peer connection. Creating a second peer connection for the same call would duplicate media negotiation, confuse the remote party, and break call reporting. This is typically caused by application code invoking answer() multiple times (e.g. from multiple event handlers).",causes:["Application called answer() twice on the same call object","Multiple click handlers or event listeners triggering answer()"],solutions:["Ensure answer() is called only once per call","Disable the answer button after the first click","Check that answer() is not invoked from multiple event handlers"]},33008:{name:"ICE_CANDIDATE_PAIR_CHANGED",message:"ICE candidate pair changed mid-call",description:"The selected ICE candidate pair changed during an active call. This indicates a network path shift — for example, a Wi-Fi to cellular handoff, a NAT rebinding, or a relay fallback. The call may continue normally, but the path change can briefly affect audio quality.",causes:["Network interface change (e.g. Wi-Fi to cellular)","NAT rebinding or IP address change","Previous candidate pair failed and ICE selected an alternative","Network topology change"],solutions:["Monitor for audio quality degradation after the path change","Check network stability if changes are frequent","Verify TURN server configuration for relay fallback"]},33007:{name:"DUPLICATE_INBOUND_ANSWER",message:"Call answer ignored because another inbound call is already being answered",description:"answer() was called on an inbound call while another inbound call is already answering or active in this JavaScript runtime. Answering both legs can trigger SIP 486 USER_BUSY / LOSE_RACE when duplicate WebSocket registrations receive the same incoming call.",causes:["Multiple TelnyxRTC instances in the same page","Application code recreating a client without disconnecting the previous instance","Duplicate inbound call notifications produced by duplicate WebSocket registrations"],solutions:["Keep a single active TelnyxRTC instance for inbound call handling","Call disconnect() before replacing an SDK client instance","Only call answer() for one inbound call notification at a time"]},34001:{name:"TOKEN_EXPIRING_SOON",message:"Authentication token expiring soon",description:"The authentication token is approaching its expiration time. If the token expires the connection will be lost and calls will fail. A new token should be generated before expiration.",causes:["Token was issued with a limited lifetime"],solutions:["Generate a new authentication token","Reconnect with fresh credentials before the token expires"]},36003:{name:"SIGNALING_RECOVERY_REQUIRED",message:"Signaling recovery required",description:"The signaling (WebSocket) path has been detected as unhealthy and the SDK will force-close the socket and reconnect. The source field in the warning payload indicates what triggered the recovery (probe, request, peer_failure, or no_rtp). Active calls will be recovered via reattach after reconnection.",causes:["WebSocket probe timed out with no response","Critical signaling request timed out","Peer/media failure detected while signaling is also unhealthy"],solutions:["The SDK will automatically reconnect and recover the call","Check for network interface changes or interruptions","Verify firewall/NAT timeout settings"]},36004:{name:"MEDIA_RECOVERY_REQUIRED",message:"Media recovery required",description:"The peer connection or media flow has been detected as unhealthy while signaling is healthy. The SDK will attempt ICE restart to recover the media path. No socket reconnection is needed.",causes:["ICE connection state changed to failed","RTCPeerConnection state changed to failed","No RTP packets/bytes received while media should be active"],solutions:["The SDK will automatically attempt ICE restart","Check network connectivity and ICE candidate availability","Verify TURN server configuration"]},36005:{name:"RECONNECTION_FAILED_WITH_NO_AUTO_RECONNECT",message:"Reconnection failed — auto-reconnect disabled",description:"The WebSocket was closed and auto-reconnect is disabled, so the SDK will not attempt to reconnect. This typically occurs after the user called disconnect() or after reconnection attempts were exhausted.",causes:["Auto-reconnect was disabled by the application","Reconnection attempts were previously exhausted","The session was intentionally disconnected"],solutions:["Call connect() manually to re-establish the session","Check if disconnect() was called intentionally","Review maxReconnectAttempts configuration"]},33009:{name:"AUDIO_INPUT_DEVICE_CHANGE_SKIPPED",message:"Audio input device change skipped",description:"The SDK could not change the microphone because the active peer connection has no audio RTP sender to replace. The existing local media and mute state were left unchanged.",causes:["The call was created without an audio sender","The peer connection was not ready when setAudioInDevice was called","The call is already ending or the local media sender was removed"],solutions:["Retry after the call is active and local media is attached","Verify the call was started with audio enabled","Inspect call state and peer connection sender availability"]},33010:{name:"MULTIPLE_ACTIVE_CALLS_DETECTED",message:"Multiple active calls detected in one SDK session",description:"A new call was created or received while another call is still active (ringing, answering, active, held, or recovering) in the same SDK session. This may be intentional for some applications (e.g. call waiting, transfer) but is often abnormal and makes call reports and application behavior harder to reason about. The new call proceeds normally — this warning is diagnostic only.",causes:["Application created an outbound call while another call is active","An inbound call arrived while another call is already active","Application did not hang up the previous call before starting a new one","Call waiting or multi-call scenario (may be intentional)"],solutions:["Verify this is the expected behavior for your application","Ensure the previous call is hung up before creating a new one if only one call is expected","Use call.hold() before starting a new call if needed","Check the warning payload for call IDs to correlate which calls are involved"]},33011:{name:"SHARED_REMOTE_ELEMENT_OVERWRITE",message:"Remote media element overwritten by another call",description:"A new MediaStream was attached to an HTML media element (audio/video) that already held a different MediaStream from another active call. The SDK overwrote the existing stream (last-writer-wins), which disrupts the other call remote media playout. This happens when two concurrent calls share a single remoteElement instead of each having its own. Use a per-call remoteElement (client.newCall({ remoteElement }) or call.answer({ remoteElement })) so each call owns a distinct element.",causes:["Two concurrent calls share one remoteElement (legacy single-element app)","Application did not pass a per-call remoteElement to newCall() or answer()","A second inbound call rang into a session using one session-level remoteElement"],solutions:["Pass a distinct remoteElement per call via client.newCall({ remoteElement })","For inbound calls, override at answer time via call.answer({ remoteElement })","Give each call its own <audio>/<video> element so attach/detach lifecycles are independent"]},33012:{name:"REMOTE_AUDIO_ELEMENT_UNRESOLVED",message:"Configured remote media element could not be resolved",description:"A remote audio track arrived, but the configured call-level or session-level remoteElement did not resolve to an <audio> or <video> element, so the SDK could not attach it for playout. The call is not affected and the remote MediaStream is still available on call.remoteStream. This warning is not emitted when remoteElement is left unset, since the application is then expected to play call.remoteStream itself.",causes:["remoteElement is a string ID with no matching element in the DOM","client.remoteElement was set to a string ID before that element existed (session-level IDs are resolved when set)","A remoteElement resolver function returned null or undefined (or its promise did, or rejected)","remoteElement resolved to an element that is not <audio> or <video>"],solutions:["Make sure the element exists before setting client.remoteElement or starting/answering the call","Pass a per-call remoteElement via client.newCall({ remoteElement }) or call.answer({ remoteElement })","Use an <audio> or <video> element as remoteElement","To play call.remoteStream in your own element instead, leave remoteElement unset"]},35002:{name:"UNKNOWN_REATTACHED_SESSION",message:"Unknown reattach session after reconnect",description:"The WebSocket reconnected successfully and the server sent an Attach message for a session that does not match any active SDK call. The unknown Attach is ACK'd and ignored.",causes:["Server sent an Attach for a call that no longer exists in the SDK","Multiple Attach messages arrived and only the first was recovered","Race condition between reconnection and new inbound call"],solutions:["Check application logic for multiple simultaneous calls","Inspect the Attach callID in the warning payload for details","If a call should be active, start a new call manually"]}};function gt(e,t){const n=ft[e];return{code:e,name:n.name,message:t||n.message,description:n.description,causes:[...n.causes],solutions:[...n.solutions]}}class vt extends Error{constructor(e){super(e.message||`[${e.code}] ${e.name}`),this.name=e.name,this.code=e.code,this.description=e.description,this.causes=e.causes,this.solutions=e.solutions,this.originalError=e.originalError,this.fatal=e.fatal,Object.setPrototypeOf(this,vt.prototype)}toJSON(){return{code:this.code,name:this.name,description:this.description,message:this.message,causes:this.causes,solutions:this.solutions,originalError:this.originalError,fatal:this.fatal}}}function mt(e){if(e instanceof DOMException){if("NotAllowedError"===e.name)return ue;if("NotFoundError"===e.name||"OverconstrainedError"===e.name)return he}return pe}function bt(e,t,n,i){const r=pt[e],o=t instanceof Error?t:void 0!==t?new Error(String(t)):void 0;return new vt({code:e,name:r.name,description:r.description,message:n||r.message,causes:[...r.causes],solutions:[...r.solutions],originalError:o,fatal:null!=i?i:r.fatal})}class yt extends Error{constructor(e,t,n=""){super(`Signaling request timed out (id=${e}, method=${n||"unknown"}, timeout=${t}ms)`),this.name="RequestTimeoutError",this.requestId=e,this.timeoutMs=t,this.method=n}}class wt extends Error{constructor(e,t,n){super(`Stale request cancelled (id=${e}, gen=${t}, current=${n})`),this.name="StaleRequestError",this.requestId=e,this.staleGeneration=t,this.currentGeneration=n}}var kt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};function _t(e,t){return e(t={exports:{}},t.exports),t.exports}var St=_t(function(e){var t,n;t=kt,n=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(t,n){for(var r=0;r<i.length;r++){var o=i[r];this[o]=r<t?e:this.methodFactory(o,t,n)}this.log=this.debug}function s(e,n,i){return function(){typeof console!==t&&(a.call(this,n,i),this[e].apply(this,arguments))}}function l(i,a,l){return function(i){return"debug"===i&&(i="log"),typeof console!==t&&("trace"===i&&n?o:void 0!==console[i]?r(console,i):void 0!==console.log?r(console,"log"):e)}(i)||s.apply(this,arguments)}function c(e,n,r){var o,s=this;n=n??"WARN";var c="loglevel";function d(){var e;if(typeof window!==t&&c){try{e=window.localStorage[c]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,i=n.indexOf(encodeURIComponent(c)+"=");-1!==i&&(e=/^([^;]+)/.exec(n.slice(i))[1])}catch(e){}return void 0===s.levels[e]&&(e=void 0),e}}"string"==typeof e?c+=":"+e:"symbol"==typeof e&&(c=void 0),s.name=e,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=r||l,s.getLevel=function(){return o},s.setLevel=function(n,r){if("string"==typeof n&&void 0!==s.levels[n.toUpperCase()]&&(n=s.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(o=n,!1!==r&&function(e){var n=(i[e]||"silent").toUpperCase();if(typeof window!==t&&c){try{return void(window.localStorage[c]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(e){}}}(n),a.call(s,n,e),typeof console===t&&n<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(e){n=e,d()||s.setLevel(e,!1)},s.resetLevel=function(){s.setLevel(n,!1),function(){if(typeof window!==t&&c){try{return void window.localStorage.removeItem(c)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},s.enableAll=function(e){s.setLevel(s.levels.TRACE,e)},s.disableAll=function(e){s.setLevel(s.levels.SILENT,e)};var u=d();null==u&&(u=n),s.setLevel(u,!1)}var d=new c,u={};d.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=u[e];return t||(t=u[e]=new c(e,d.getLevel(),d.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return d.noConflict=function(){return typeof window!==t&&window.log===d&&(window.log=h),d},d.getLoggers=function(){return u},d.default=d,d},e.exports?e.exports=n():t.log=n()});const xt={debug:0,info:1,warn:2,error:3};class Ct{constructor(e={}){var t,n,i;this.buffer=[],this.isCapturing=!1,this.options={enabled:null!==(t=e.enabled)&&void 0!==t&&t,level:null!==(n=e.level)&&void 0!==n?n:"debug",maxEntries:null!==(i=e.maxEntries)&&void 0!==i?i:1e3}}start(){this.options.enabled&&(this.isCapturing=!0,this.buffer=[])}stop(){this.isCapturing=!1}addEntry(e,t,n){if(!this.isCapturing||!this.options.enabled)return;if(xt[e]<xt[this.options.level])return;const i=Object.assign({timestamp:(new Date).toISOString(),level:e,message:t},n&&Object.keys(n).length>0?{context:n}:{});this.buffer.push(i),this.buffer.length>this.options.maxEntries&&this.buffer.shift()}getLogs(){return[...this.buffer]}getLogCount(){return this.buffer.length}drain(){const e=this.buffer;return this.buffer=[],e}clear(){this.buffer=[]}isActive(){return this.isCapturing}isEnabled(){return this.options.enabled}}let Et=null;const It=St.getLogger("telnyx"),Tt={trace:0,debug:1,info:2,warn:3,error:4};let Rt=Tt.info;function Nt(e){if(null==e)return e;if("object"!=typeof e)return e;try{const t=JSON.stringify(e),n=JSON.parse(t);if("object"==typeof n&&null!==n&&Object.keys(n).length>1)return n}catch(e){}const t={};for(const n in e)try{const i=e[n];if("function"==typeof i)continue;if("object"==typeof i&&null!==i)try{t[n]=JSON.parse(JSON.stringify(i))}catch(e){t[n]=String(i)}else t[n]=i}catch(e){}return Object.keys(t).length>0?t:{value:String(e)}}const Ot=It.methodFactory;It.methodFactory=(e,t,n)=>{const i=Ot(e,t,n);return function(...t){if(Tt[e]>=Rt){const e=[(new Date).toISOString().replace("T"," ").replace("Z",""),"-"];for(const n of t)e.push(n);i(...e)}const n=Et;if(null==n?void 0:n.isActive()){const[i,...r]=t,o="string"==typeof i?i:JSON.stringify(i);let a;r.length>0&&(a=1===r.length&&"object"==typeof r[0]&&null!==r[0]?Nt(r[0]):{args:r.map(Nt)}),n.addEntry(e,o,a)}}},It.setLevel("debug",!1);const At=e=>{const[t,n,i,r,o,a]=e;let s={};try{s=JSON.parse(o.replace(/ID"/g,'Id"'))}catch(e){It.warn("Verto LA invalid media JSON string:",o)}return{participantId:Number(t),participantNumber:n,participantName:i,codec:r,media:s,participantData:a}},Lt=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}},Dt=e=>e instanceof Function||"function"==typeof e,Pt=e=>{var t;if("undefined"!=typeof HTMLMediaElement&&e instanceof HTMLMediaElement)return!0;const n=Mt(e)?null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView:null;return!!((null==n?void 0:n.HTMLMediaElement)&&e instanceof n.HTMLMediaElement)&&(It.info("Using a media element owned by another window (iframe, popout or Picture-in-Picture)"),!0)},Mt=e=>"object"==typeof e&&null!==e&&"ownerDocument"in e,Ft=e=>"object"==typeof document&&"getElementById"in document?"string"==typeof e?document.getElementById(e)||null:"function"==typeof e?e():Pt(e)?e:null:null,jt=/^(ws|wss):\/\//,zt=(e,t=null)=>{const{result:n={},error:i}=e;if(i)return{error:i};const{result:r=null}=n;if(null===r)return null!==t&&(n.node_id=t),{result:n};const{code:o=null,node_id:a=null,result:s=null}=r;return o&&"200"!==o?{error:r}:s?zt(s,a):{result:r}},Ut=({login:e,passwd:t,password:n,login_token:i})=>Boolean(e&&(t||n)||i),$t=({anonymous_login:e})=>Boolean(e)&&Boolean(e.target_id)&&Boolean(e.target_type),Bt=e=>{var t,n,i,r,o,a;let s="",l="";return(null===(n=null===(t=null==e?void 0:e.result)||void 0===t?void 0:t.params)||void 0===n?void 0:n.state)&&(s=null===(r=null===(i=null==e?void 0:e.result)||void 0===i?void 0:i.params)||void 0===r?void 0:r.state),(null===(o=null==e?void 0:e.params)||void 0===o?void 0:o.state)&&(l=null===(a=null==e?void 0:e.params)||void 0===a?void 0:a.state),s||l};function Ht({debounceTime:e}){let t,n;return{promise:new Promise((i,r)=>{t=e?Wt(i,e):i,n=r}),resolve:t,reject:n}}const Wt=(e,t)=>{let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}},Vt="telnyx-voice-sdk-id",qt="telnyx-voice-sdk-id-canary-rtc-server",Gt="telnyx-voice-sdk-session-id",Kt="telnyx-voice-sdk-session-id-stored-at",Yt="telnyx-voice-sdk-active-calls";function Qt(e=Date.now()){const t=function(){const e=Number(sessionStorage.getItem(Kt));return Number.isFinite(e)?e:null}();return null!==t&&e-t<=9e4}function Jt(){return sessionStorage.getItem(Vt)}function Xt(){const e=tn(qt);return"true"===e||"false"!==e&&void 0}function Zt(e,t=Date.now()){sessionStorage.setItem(Gt,e),sessionStorage.setItem(Kt,String(t))}function en(){sessionStorage.removeItem(Vt),sessionStorage.removeItem(qt),sessionStorage.removeItem(Gt),sessionStorage.removeItem(Kt)}function tn(e){try{return sessionStorage.getItem(e)}catch(t){return It.debug(`safeGetItem('${e}') failed: ${t instanceof Error?t.message:String(t)}`),null}}function nn(){!function(e){try{sessionStorage.removeItem(e)}catch(t){It.debug(`safeRemoveItem('${e}') failed: ${t instanceof Error?t.message:String(t)}`)}}(Yt)}function rn(e=Date.now()){const t=tn(Yt);if(!t)return null;try{const n=JSON.parse(t);if(!n||"object"!=typeof n||!Array.isArray(n.calls))return It.debug("Active-calls recovery marker payload was malformed — discarded."),nn(),null;const i=Number(n.storedAt);return!Number.isFinite(i)||e-i>9e5?(It.debug("Active-calls recovery marker was stale or had an invalid timestamp — discarded."),nn(),null):0===n.calls.length?(It.debug("Active-calls recovery marker had no call records — discarded."),nn(),null):n}catch(e){return It.debug(`Active-calls recovery marker JSON parse failed — discarded: ${e instanceof Error?e.message:String(e)}`),nn(),null}}function on(e,t,n=Date.now()){if(!Array.isArray(e)||0===e.length)return void nn();const i={sessionId:t,calls:e,storedAt:n};!function(e,t){try{sessionStorage.setItem(e,t)}catch(t){It.info(`safeSetItem('${e}') failed: ${t instanceof Error?t.message:String(t)}`)}}(Yt,JSON.stringify(i))}var an,sn,ln;!function(e){e.Offer="offer",e.Answer="answer"}(an||(an={})),function(e){e.Inbound="inbound",e.Outbound="outbound"}(sn||(sn={})),function(e){e.Invite="telnyx_rtc.invite",e.Attach="telnyx_rtc.attach",e.Answer="telnyx_rtc.answer",e.Info="telnyx_rtc.info",e.Candidate="telnyx_rtc.candidate",e.EndOfCandidates="telnyx_rtc.endOfCandidates",e.Display="telnyx_rtc.display",e.Media="telnyx_rtc.media",e.Event="telnyx_rtc.event",e.Bye="telnyx_rtc.bye",e.Punt="telnyx_rtc.punt",e.Broadcast="telnyx_rtc.broadcast",e.Subscribe="telnyx_rtc.subscribe",e.Unsubscribe="telnyx_rtc.unsubscribe",e.ClientReady="telnyx_rtc.clientReady",e.Modify="telnyx_rtc.modify",e.Ringing="telnyx_rtc.ringing",e.GatewayState="telnyx_rtc.gatewayState",e.Ping="telnyx_rtc.ping",e.Pong="telnyx_rtc.pong"}(ln||(ln={}));const cn={generic:"event",[ln.Display]:"participantData",[ln.Attach]:"participantData",conferenceUpdate:"conferenceUpdate",callUpdate:"callUpdate",vertoClientReady:"vertoClientReady",userMediaError:"userMediaError",peerConnectionFailureError:"peerConnectionFailureError",signalingStateClosed:"signalingStateClosed"},dn=8e6,un={destinationNumber:"",remoteCallerName:"Outbound Call",remoteCallerNumber:"",callerName:"",callerNumber:"",audio:!0,useStereo:!1,debug:!1,debugOutput:"socket",attach:!1,screenShare:!1,userVariables:{},mediaSettings:{useSdpASBandwidthKbps:!1,sdpASBandwidthKbps:0},mutedMicOnStart:!1,prefetchIceCandidates:!1};var hn,pn,fn,gn,vn,mn;!function(e){e[e.New=0]="New",e[e.Requesting=1]="Requesting",e[e.Trying=2]="Trying",e[e.Recovering=3]="Recovering",e[e.Ringing=4]="Ringing",e[e.Answering=5]="Answering",e[e.Early=6]="Early",e[e.Active=7]="Active",e[e.Held=8]="Held",e[e.Hangup=9]="Hangup",e[e.Destroy=10]="Destroy",e[e.Purge=11]="Purge"}(hn||(hn={})),function(e){e.Participant="participant",e.Moderator="moderator"}(pn||(pn={})),function(e){e.Join="join",e.Leave="leave",e.Bootstrap="bootstrap",e.Add="add",e.Modify="modify",e.Delete="delete",e.Clear="clear",e.ChatMessage="chatMessage",e.LayerInfo="layerInfo",e.LogoInfo="logoInfo",e.LayoutInfo="layoutInfo",e.LayoutList="layoutList",e.ModCmdResponse="modCommandResponse"}(fn||(fn={})),function(e){e.Video="videoinput",e.AudioIn="audioinput",e.AudioOut="audiooutput"}(gn||(gn={})),function(e){e.REGED="REGED",e.UNREGED="UNREGED",e.NOREG="NOREG",e.FAILED="FAILED",e.FAIL_WAIT="FAIL_WAIT",e.TIMEOUT="TIMEOUT",e.REGISTER="REGISTER",e.TRYING="TRYING",e.EXPIRED="EXPIRED",e.UNREGISTER="UNREGISTER"}(vn||(vn={})),function(e){e.Hold="hold",e.Unhold="unhold",e.ToggleHold="toggleHold",e.UpdateMedia="updateMedia"}(mn||(mn={}));const bn="GLOBAL",yn={},wn=(e,t)=>`${e}|${t}`,kn=(e,t=bn)=>wn(e,t)in yn,_n=(e,t,n=bn)=>{const i=wn(e,n);i in yn||(yn[i]=[]),yn[i].push(t)},Sn=(e,t,n=bn)=>{const i=function(r){xn(e,i,n),t(r)};return i.prototype.targetRef=t,_n(e,i,n)},xn=(e,t,n=bn)=>{if(!kn(e,n))return!1;const i=wn(e,n);if(Dt(t))for(let e=yn[i].length-1;e>=0;e--){const n=yn[i][e];(t===n||n.prototype&&t===n.prototype.targetRef)&&yn[i].splice(e,1)}else yn[i]=[];return 0===yn[i].length&&delete yn[i],!0},Cn=(e,t,n=bn,i=!0)=>{const r=i&&n!==bn;if(!kn(e,n))return r&&Cn(e,t),!1;const o=wn(e,n),a=yn[o].length;if(!a)return r&&Cn(e,t),!1;for(let e=a-1;e>=0;e--)yn[o][e](t);return r&&Cn(e,t),!0},En=e=>{const t=wn(e,"");Object.keys(yn).filter(e=>0===e.indexOf(t)).forEach(e=>delete yn[e])};let In="undefined"!=typeof WebSocket?WebSocket:null;class Tn{constructor(e){this.session=e,this.previousGatewayState="",this.lastInboundAt=0,this.socketGeneration=0,this._wsClient=null,this._host=rt,this._timers={},this._safetyTimeoutId=null,this._pendingRequestIds=new Set,this._pendingRequestTimers=new Map,this._pendingRequestRejecters=new Map,this.upDur=null,this.downDur=null;const{host:t,env:n,region:i,useCanaryRtcServer:r}=e.options;It.debug("Creating new Connection",{host:this._host,env:n,region:i,useCanaryRtcServer:r}),n&&(this._host="development"===n?"wss://rtcdev.telnyx.com":rt),t&&(this._host=(e=>`${jt.test(e)?"":"wss://"}${e}`)(t)),i&&(this._host=this._host.replace(/rtc(dev)?/,`${i}.rtc$1`))}get connected(){return!!this._wsClient&&1===this._wsClient.readyState}get connecting(){return!!this._wsClient&&0===this._wsClient.readyState}get closing(){return!!this._wsClient&&2===this._wsClient.readyState}get closed(){return!!this._wsClient&&3===this._wsClient.readyState}get isAlive(){return this.connecting||this.connected}get isDead(){return this.closing||this.closed}get host(){return this._host}connect(){var e,t;It.debug("Connection.connect() called",{host:this._host,socketGeneration:this.socketGeneration,sessionId:this.session.sessionid});const n=new URL(this._host),i=Jt();i!==this.session.reconnectTokenVoiceSdkId&&(this.session.reconnectTokenVoiceSdkId=i,this.session.reconnectTokenCanaryRtcServer=Xt());let r,o=this.session.reconnectTokenVoiceSdkId;this.session.options.rtcIp&&this.session.options.rtcPort&&(o=null,n.searchParams.set("rtc_ip",this.session.options.rtcIp),n.searchParams.set("rtc_port",this.session.options.rtcPort.toString())),o&&n.searchParams.set("voice_sdk_id",o),this.session.options.rtcIp&&this.session.options.rtcPort||(r=this.session.options.useCanaryRtcServer,"boolean"==typeof r&&n.searchParams.set("canary",String(r)),o&&r!==this.session.reconnectTokenCanaryRtcServer&&(n.searchParams.delete("voice_sdk_id"),It.debug("Canary routing changed. Refreshing voice_sdk_id",{previous:this.session.reconnectTokenCanaryRtcServer,current:r}))),this.session.callReportVoiceSdkId=n.searchParams.get("voice_sdk_id"),this.session.options.skipLastVoiceSdkId&&n.searchParams.has("voice_sdk_id")&&n.searchParams.set("skip_last_voice_sdk_id","true"),this.session.options.skipTrailing&&n.searchParams.set("skip_trailing","true");try{const t=this.socketGeneration;null===(e=this.session._registrationTimings)||void 0===e||e.mark("create WebSocket",{generation:t+1}),this._wsClient=new In(n.toString()),this.socketGeneration+=1,It.debug("WebSocket connection created",{sessionId:this.session.sessionid,voiceSdkId:this.session.callReportVoiceSdkId,socketGeneration:this.socketGeneration,reconnectCount:t}),this.lastInboundAt=0,this._cleanupPendingRequests(),this._registerSocketEvents(this._wsClient,r)}catch(e){null===(t=this.session._registrationTimings)||void 0===t||t.mark("WebSocket construction failed"),It.error("WebSocket connection failed:",e);const n=bt(we,e);Cn(ut.Error,{error:n,sessionId:this.session.sessionid},this.session.uuid),this.session._terminateActiveCallsLocally()}}sendRawText(e){var t;null===(t=this._wsClient)||void 0===t||t.send(e)}send(e,t){var n,i;const{request:r}=e,o=this.socketGeneration,a=r.method||"",s=new Promise((e,n)=>{if(r.hasOwnProperty("result"))return e();let i=!1,s=null;const l=t=>{if(null!==s&&(clearTimeout(s),this._pendingRequestTimers.delete(r.id),s=null),this._pendingRequestIds.delete(r.id),this._pendingRequestRejecters.delete(r.id),this.session.onOutboundConfirmed(),i)return;const{result:o,error:a}=zt(t);return a?n(a):e(o)};Sn(r.id,l),this._pendingRequestIds.add(r.id),this._pendingRequestRejecters.set(r.id,{reject:n,generation:o}),t&&t>0&&(s=setTimeout(()=>{if(i=!0,s=null,this._pendingRequestTimers.delete(r.id),this._pendingRequestRejecters.delete(r.id),xn(r.id,l),this._pendingRequestIds.delete(r.id),this.socketGeneration!==o)return It.debug(`Stale request timeout for ${r.id} (gen ${o}, current ${this.socketGeneration}) — settling with StaleRequestError`),void n(new wt(r.id,o,this.socketGeneration));n(new yt(r.id,t,a))},t),this._pendingRequestTimers.set(r.id,s))});return It.debug("SEND: \n",JSON.stringify(r,null,2),"\n"),this.connected&&(null===(n=this.session._registrationTimings)||void 0===n||n.requestSent(r.id,a)),null===(i=this._wsClient)||void 0===i||i.send(JSON.stringify(r)),s}close(){if(It.debug("Connection.close() called",{hasWsClient:!!this._wsClient,closing:this.closing,closed:this.closed,socketGeneration:this.socketGeneration,safetyTimeoutId:this._safetyTimeoutId,sessionId:this.session.sessionid}),!this._wsClient||this.closing)return;this._cleanupPendingRequests();const e=this._wsClient;Dt(this._wsClient._beginClose)?this._wsClient._beginClose():this._wsClient.close(),this._safetyTimeoutId||(this._safetyTimeoutId=setTimeout(()=>this._handleCloseTimeout(e),5e3))}_registerSocketEvents(e,t){const n=this.socketGeneration,i=()=>e===this._wsClient&&n===this.socketGeneration&&this.session.connection===this;e.onopen=e=>{var t;return i()&&(null===(t=this.session._registrationTimings)||void 0===t||t.mark("WebSocket open",{generation:n})),It.debug("WebSocket onopen",{socketGeneration:this.socketGeneration,sessionId:this.session.sessionid}),Cn(ut.SocketOpen,e,this.session.uuid)},e.onclose=t=>{var r;return i()&&(null===(r=this.session._registrationTimings)||void 0===r||r.mark("WebSocket closed",{generation:n,code:null==t?void 0:t.code})),this._clearSafetyTimeout(),this._safetyCleanupSocket(e,"close"),It.debug("WebSocket onclose",{code:null==t?void 0:t.code,reason:null==t?void 0:t.reason,wasClean:null==t?void 0:t.wasClean,socketGeneration:n,sessionId:this.session.sessionid}),Cn(ut.SocketClose,{event:t,socketGeneration:n},this.session.uuid)},e.onerror=t=>{var r;i()&&(null===(r=this.session._registrationTimings)||void 0===r||r.mark("WebSocket error",{generation:n})),this._clearSafetyTimeout(),this._safetyCleanupSocket(e,"error"),It.debug("WebSocket onerror",{socketGeneration:this.socketGeneration,sessionId:this.session.sessionid});const o=bt(ke);return Cn(ut.Error,{error:o,sessionId:this.session.sessionid},this.session.uuid),Cn(ut.SocketError,{error:t,sessionId:this.session.sessionid,socketGeneration:n},this.session.uuid)},e.onmessage=i=>{var r,o,a;this.lastInboundAt=Date.now(),Cn(ut.SocketActivity,{timestamp:this.lastInboundAt},this.session.uuid);const s=Lt(i.data);if("string"==typeof s)return void this._handleStringResponse(s);const l=e===this._wsClient&&n===this.socketGeneration&&this.session.connection===this;var c,d;if(l&&(null===(r=this.session._registrationTimings)||void 0===r||r.responseReceived(s)),s.voice_sdk_id&&l&&(this.session.callReportVoiceSdkId=s.voice_sdk_id,this.session.reconnectTokenVoiceSdkId=s.voice_sdk_id,this.session.reconnectTokenCanaryRtcServer=t,c=s.voice_sdk_id,d=t,sessionStorage.setItem(Vt,c),"boolean"==typeof d?sessionStorage.setItem(qt,String(d)):sessionStorage.removeItem(qt)),this._unsetTimer(s.id),It.debug("RECV: \n",JSON.stringify(s,null,2),"\n"),vn[`${null===(a=null===(o=null==s?void 0:s.result)||void 0===o?void 0:o.params)||void 0===a?void 0:a.state}`]||!Cn(s.id,s)){const e=Bt(s);Cn(ut.SocketMessage,s,this.session.uuid),Boolean(e)&&(this.previousGatewayState=e)}}}_deregisterSocketEvents(e){e.onopen=null,e.onclose=null,e.onerror=null,e.onmessage=null}_handleCloseTimeout(e){this._safetyTimeoutId=null,e&&3!==e.readyState?(It.warn("Socket stuck in CLOSING after 5s — forcefully cleaning up"),this._deregisterSocketEvents(e),this._safetyCleanupSocket(e,"timeout"),this._wsClient&&this._wsClient!==e?It.debug("Safety timeout: socket was replaced, not emitting SocketClose",{hasWsClient:!!this._wsClient,isSameSocket:this._wsClient===e}):(It.debug("Safety timeout: emitting SocketClose for stuck socket",{hasWsClient:!!this._wsClient,isSameSocket:this._wsClient===e}),Cn(ut.SocketClose,{code:ot.ABNORMAL_CLOSURE,reason:"STUCK_WS_TIMEOUT: Socket got stuck in CLOSING state and was forcefully cleaned up by safety timeout",wasClean:!1,socketGeneration:this.socketGeneration},this.session.uuid))):It.warn("Safety timeout fired but socket is already closed or cleaned up")}_clearSafetyTimeout(){this._safetyTimeoutId&&(It.debug("Clearing safety timeout"),clearTimeout(this._safetyTimeoutId),this._safetyTimeoutId=null)}_safetyCleanupSocket(e,t){this._wsClient===e?(It.debug(`Nulling socket reference (reason: ${t})`),this._wsClient=null):It.debug(`Skipping socket cleanup - old socket already replaced (reason: ${t})`)}_cleanupPendingRequests(){Array.from(this._pendingRequestIds).forEach(e=>{xn(e);const t=this._pendingRequestTimers.get(e),n=this._pendingRequestRejecters.get(e);t&&(clearTimeout(t),this._pendingRequestTimers.delete(e),n&&n.reject(new wt(e,n.generation,this.socketGeneration))),this._pendingRequestRejecters.delete(e)}),this._pendingRequestIds.clear()}_unsetTimer(e){clearTimeout(this._timers[e]),delete this._timers[e]}_handleStringResponse(e){if(/^#SP/.test(e))switch(e[3]){case"U":this.upDur=parseInt(e.substring(4));break;case"D":this.downDur=parseInt(e.substring(4)),Cn(ut.SpeedTest,{upDur:this.upDur,downDur:this.downDur},this.session.uuid)}else It.warn("Unknown message from socket",e)}}Tn.DEFAULT_REQUEST_TIMEOUT_MS=1e4;class Rn{buildRequest(e){this.request=Object.assign({jsonrpc:"2.0",id:oe()},e)}buildNotification(e){this.request=Object.assign({jsonrpc:"2.0"},e)}}const Nn={id:"callID",destinationNumber:"destination_number",remoteCallerName:"remote_caller_id_name",remoteCallerNumber:"remote_caller_id_number",callerName:"caller_id_name",callerNumber:"caller_id_number",customHeaders:"custom_headers"};class On extends Rn{constructor(e={}){if(super(),e.hasOwnProperty("dialogParams")){const t=X(e.dialogParams,["remoteSdp","localStream","remoteStream","localElement","remoteElement","onNotification","camId","micId","speakerId"]);for(const e in Nn)e&&t.hasOwnProperty(e)&&(t[Nn[e]]=t[e],delete t[e]);e.dialogParams=t}this.buildRequest({method:this.toString(),params:e})}}class An extends On{constructor(e){super(),this.method=ln.GatewayState,this.buildRequest({method:this.method,voice_sdk_id:e,params:{}})}}class Ln{constructor(e){this.pendingRequestId=null,this.onSocketMessage=e=>Z(this,void 0,void 0,function*(){e.id===this.pendingRequestId&&this.gatewayStateTask.resolve(Bt(e))}),this.getIsRegistered=()=>Z(this,void 0,void 0,function*(){const e=new An(Jt());this.pendingRequestId=e.request.id,this.gatewayStateTask=Ht({}),this.session.execute(e);const t=yield this.gatewayStateTask.promise;return!!t&&[vn.REGISTER,vn.REGED].includes(t)}),this.session=e,this.gatewayStateTask=Ht({}),this.session.on("telnyx.socket.message",this.onSocketMessage)}}class Dn extends On{constructor(e){super(),this.method=ln.Ping,this.buildRequest({method:this.method,voice_sdk_id:e,params:{}})}}class Pn{constructor(e){this._session=e,this._lastInboundAt=0,this._lastOutboundConfirmedAt=0,this._lastProbeSentAt=0,this._probeInFlight=!1,this._intervalId=null,this._pendingMediaRecovery=null,this._browserWasOffline=!1,this._onlineHandler=null,this._offlineHandler=null}static isCriticalMethod(e){return Pn.CRITICAL_METHODS.has(e)}start(){this._intervalId||(It.debug("Signaling health: monitor started"),this._lastInboundAt=Date.now(),this._lastOutboundConfirmedAt=Date.now(),this._probeInFlight=!1,this._lastProbeSentAt=0,this._setupBrowserListeners(),this._intervalId=setInterval(()=>this._check(),3e3))}stop(){this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null,this._probeInFlight=!1,this._lastProbeSentAt=0),this._pendingMediaRecovery=null,this._cleanupBrowserListeners(),It.debug("Signaling health: monitor stopped")}get isRunning(){return null!==this._intervalId}get isProbeInFlight(){return this._probeInFlight}onSocketActivity(){this._lastInboundAt=Date.now()}onOutboundConfirmed(){this._lastOutboundConfirmedAt=Date.now()}_resolveProbe(){if(!this._probeInFlight)return;if(this._probeInFlight=!1,this._lastProbeSentAt=0,this._lastInboundAt=Date.now(),this._lastOutboundConfirmedAt=Date.now(),It.debug("Signaling health: probe resolved by matching Ping response"),!this._pendingMediaRecovery)return void It.debug("Signaling health: probe resolved but no pending media recovery");const e=this._pendingMediaRecovery;this._pendingMediaRecovery=null,"healthy"===this._getSignalingHealthState()&&(It.info(`Signaling health: signaling probe resolved, triggering pending ICE restart for call ${e.callId}`),this._triggerIceRestart(e.callId,e.reason))}_probeIfNeeded(e){var t;(null===(t=this._session.connection)||void 0===t?void 0:t.connected)&&(this._probeInFlight?It.debug(`Signaling health: probe already in flight, skipping duplicate probe (${e})`):(It.info(`Signaling health: ${e}, sending signaling probe`),this._sendProbe()))}onRequestTimeout(e,t,n=""){var i;(null===(i=this._session.connection)||void 0===i?void 0:i.connected)&&(Pn.isCriticalMethod(n)?(It.warn(`Critical signaling request timed out (id=${e}, method=${n}, timeout=${t}ms) — declaring signaling unhealthy`),this._triggerSignalingRecovery(`Critical signaling request timed out (method=${n}, id=${e}, timeout=${t}ms)`,"request")):It.warn(`Non-critical signaling request timed out (id=${e}, method=${n||"unknown"}, timeout=${t}ms) — logging but not triggering signaling recovery`))}onPeerFailure(e,t){It.warn(`Signaling health: peer failure reported (callId=${e}, evidence=${t})`),this._recoverMediaOrSignaling(e,`Peer connection failure (${t})`,`Peer failure detected (${t}) while signaling is unhealthy`,"peer_failure")}onNoRtp(e,t){It.warn(`Signaling health: no RTP detected (callId=${e}, direction=${t})`),this._recoverMediaOrSignaling(e,`No RTP ${t} while media should be active`,`No RTP ${t} while signaling is unhealthy`,"no_rtp")}_setupBrowserListeners(){"undefined"==typeof window||this._onlineHandler||(this._onlineHandler=()=>{this._browserWasOffline&&(It.debug(`Signaling health: browser online — clearing browser offline state for session ${this._session.sessionid}`),this._browserWasOffline=!1)},this._offlineHandler=()=>{this._browserWasOffline=!0,It.debug(`Signaling health: browser offline signal received for session ${this._session.sessionid}`);const e=bt(Te);Cn(ut.Error,{error:e,sessionId:this._session.sessionid},this._session.uuid),this.isRunning&&this._probeIfNeeded("browser offline signal while monitor is active")},window.addEventListener("online",this._onlineHandler),window.addEventListener("offline",this._offlineHandler))}_cleanupBrowserListeners(){"undefined"!=typeof window&&this._onlineHandler&&this._offlineHandler&&(window.removeEventListener("online",this._onlineHandler),window.removeEventListener("offline",this._offlineHandler),this._onlineHandler=null,this._offlineHandler=null,this._browserWasOffline=!1)}onIceRestartFailed(e){It.warn(`Signaling health: ICE restart failed (callId=${e}) — triggering socket reconnect`),this._triggerSignalingRecovery(`ICE restart failed for call ${e}`,"peer_failure")}_check(){var e;if(!(null===(e=this._session.connection)||void 0===e?void 0:e.connected))return;const t=Date.now(),n=t-this._lastInboundAt,i=t-this._lastOutboundConfirmedAt,r=n>=2e4;if(!(r||i>=45e3))return;if(!this._probeInFlight)return It.info(r?`Signaling health: no inbound WS activity for ${Math.round(n/1e3)}s during active call, sending health probe`:`Signaling health: inbound WS activity is flowing but no outbound request has been answered for ${Math.round(i/1e3)}s, sending health probe`),void this._sendProbe();const o=t-this._lastProbeSentAt;o>=5e3&&(It.warn(`Signaling health: probe timed out after ${o}ms (inbound silent for ${Math.round(n/1e3)}s, no outbound request answered for ${Math.round(i/1e3)}s) — declaring signaling unhealthy`),this._triggerSignalingRecovery(r?"Signaling health probe timed out: no inbound WS activity after probe":"Signaling health probe timed out: inbound WS activity is flowing but no outbound request is being answered","probe"))}_sendProbe(){var e;this._probeInFlight=!0,this._lastProbeSentAt=Date.now();const t=new Dn(Jt());null===(e=this._session.connection)||void 0===e||e.send(t).then(()=>this._resolveProbe()).catch(e=>{It.warn("Signaling health: probe Ping failed to send",e)})}_recoverMediaOrSignaling(e,t,n,i){if(!this._session.hasActiveCall())return void It.debug(`Signaling health: ignoring ${i} recovery without an active call`);const r=this._getSignalingHealthState();return"healthy"===r?(It.info(`Signaling health: signaling is healthy, triggering ICE restart for call ${e}`),void this._triggerIceRestart(e,t)):"unknown"===r?(It.info(`Signaling health: signaling health is unknown, deferring ICE restart decision for call ${e}`),this._pendingMediaRecovery={callId:e,reason:t,source:i},void this._probeIfNeeded(`${i} detected with stale/unknown signaling`)):(It.info("Signaling health: signaling is unhealthy, triggering socket reconnect instead of ICE restart"),void this._triggerSignalingRecovery(n,i))}_getSignalingHealthState(){var e;if(!(null===(e=this._session.connection)||void 0===e?void 0:e.connected))return"unhealthy";if(this._probeInFlight)return"unknown";const t=Date.now(),n=this._lastInboundAt||this._session.connection.lastInboundAt||0;return 0===n?"unknown":t-n<3e3?"healthy":"unknown"}_triggerSignalingRecovery(e,t="probe"){var n,i,r;this._pendingMediaRecovery=null,this._probeInFlight=!1,this._lastProbeSentAt=0,It.debug(`Signaling recovery triggered (source=${t}, reason=${e})`);const o=gt(tt);Cn(ut.Warning,{warning:o,reason:e,source:t,sessionId:this._session.sessionid},this._session.uuid),(null===(n=this._session.connection)||void 0===n?void 0:n.connected)?(It.info("Signaling health: force-closing WebSocket to trigger reconnect"),this._session.socketDisconnect()):It.debug("Signaling health: recovery triggered but connection not connected",{connected:null===(i=this._session.connection)||void 0===i?void 0:i.connected,hasConnection:!!this._session.connection,socketGeneration:null===(r=this._session.connection)||void 0===r?void 0:r.socketGeneration})}_triggerIceRestart(e,t){It.info(`Signaling health: triggering ICE restart for call ${e}`);const n=this._session.triggerIceRestart(e);if(!n.started)return void It.info(`Signaling health: ICE restart not started for call ${e}: ${n.reason}`);const i=gt(nt);Cn(ut.Warning,{warning:i,reason:t,callId:e,sessionId:this._session.sessionid},this._session.uuid)}}Pn.CRITICAL_METHODS=new Set([ln.Modify,ln.Bye,ln.Ping]);var Mn="2.28.0",Fn=Mn;class jn extends On{constructor(e,t,n,i,r={},o,a=!1){super(),this.method="login";const s={login:e,passwd:t,login_token:n,userVariables:r,reconnection:o,loginParams:{early_sdp_answer:a},"User-Agent":{sdkVersion:Fn,data:navigator.userAgent}};i&&(s.sessid=i),this.buildRequest({method:this.method,params:s})}}class zn extends On{constructor(e,t){super(),this.buildRequest({id:e,result:{method:t}})}}class Un extends On{toString(){return ln.Invite}}class $n extends On{toString(){return ln.Answer}}class Bn extends On{toString(){return ln.Attach}}class Hn extends On{toString(){return ln.Bye}}class Wn extends On{toString(){return ln.Candidate}}class Vn extends On{toString(){return ln.EndOfCandidates}}class qn extends On{toString(){return ln.Modify}}class Gn extends On{toString(){return ln.Info}}class Kn extends On{toString(){return ln.Broadcast}}class Yn extends On{toString(){return ln.Subscribe}}class Qn extends On{toString(){return ln.Unsubscribe}}class Jn extends On{constructor(e){super(),this.method="anonymous_login";const{target_type:t,target_id:n,target_version_id:i,target_params:r,userVariables:o,sessionId:a,reconnection:s}=e,l={target_type:t,target_id:n,userVariables:o,reconnection:s,"User-Agent":{sdkVersion:Fn,data:navigator.userAgent}};a&&(l.sessid=a),i&&(l.target_version_id=i),r&&(l.target_params=r),this.buildRequest({method:this.method,params:l})}}class Xn{constructor(e){if(this.options=e,this.uuid=oe(),this.sessionid="",this.subscriptions={},this.signature=null,this.relayProtocol=null,this.contexts=[],this.timeoutErrorCode=-32e3,this.invalidMethodErrorCode=-32601,this.authenticationRequiredErrorCode=-32e3,this.callReportId=null,this.callReportVoiceSdkId=null,this.reconnectTokenVoiceSdkId=Jt(),this.reconnectTokenCanaryRtcServer=Xt(),this.dc=null,this.region=null,this.connection=null,this._jwtAuth=!1,this._autoReconnect=!0,this._idle=!1,this._reconnectAttempts=0,this._reconnectCountedGeneration=-1,this._intentionalClose=!1,this._tokenExpiryTimeout=null,this._pendingCallReportUploads=new Set,this._signalingHealthMonitor=new Pn(this),this._executeQueue=[],!this.validateOptions())throw new Error("Invalid init options");var t,n;t=e.debug?"debug":"info",Rt=null!==(n=Tt[t])&&void 0!==n?n:Tt.info,this._onSocketOpen=this._onSocketOpen.bind(this),this.onNetworkClose=this.onNetworkClose.bind(this),this._onSocketMessage=this._onSocketMessage.bind(this),this._handleLoginError=this._handleLoginError.bind(this),this._onSocketActivity=this._onSocketActivity.bind(this),this._attachListeners(),this.connection=new Tn(this),this.registerAgent=new Ln(this)}get __logger(){return It}get connected(){return this.connection&&this.connection.connected}getIsRegistered(){return Z(this,void 0,void 0,function*(){return this.registerAgent.getIsRegistered()})}get reconnectDelay(){const e=this._reconnectAttempts,t=Math.min(1e3*Math.pow(2,e-1),3e4),n=Math.floor(.25*t*(2*Math.random()-1)),i=t+n;return It.debug("Reconnect delay computed",{attempt:e,baseDelayMs:1e3,maxDelayMs:3e4,delayMs:t,jitterMs:n,totalDelay:i,sessionId:this.sessionid}),i}execute(e){var t;if(this._idle)return new Promise(t=>this._executeQueue.push({resolve:t,msg:e}));if(!this.connected)return new Promise(t=>{this._executeQueue.push({resolve:t,msg:e}),It.debug("Calling connect from execute since not currently connected."),this.connect()});const n=Pn.isCriticalMethod((null===(t=e.request)||void 0===t?void 0:t.method)||"")?Tn.DEFAULT_REQUEST_TIMEOUT_MS:void 0;return(null!=n?this.connection.send(e,n):this.connection.send(e)).catch(e=>Z(this,void 0,void 0,function*(){if(e instanceof wt)throw It.debug(`Stale request settled (id=${e.requestId}, gen=${e.staleGeneration}) — not triggering recovery`),e;if("RequestTimeoutError"===(null==e?void 0:e.name))throw this.onSignalingRequestTimeout(e.requestId,e.timeoutMs,e.method),e;if((null==e?void 0:e.code)===this.authenticationRequiredErrorCode){if(!this._autoReconnect){const t=bt(Ee,e,void 0,!0);Cn(ut.Error,{error:t,sessionId:this.sessionid},this.uuid)}yield this.login()}throw e}))}executeRaw(e){this._idle?this._executeQueue.push({msg:e}):this.connection.sendRawText(e)}trackCallReportUpload(e){this._pendingCallReportUploads.add(e),e.then(()=>this._pendingCallReportUploads.delete(e),()=>this._pendingCallReportUploads.delete(e))}_drainCallReportUploads(){return Z(this,void 0,void 0,function*(){if(0===this._pendingCallReportUploads.size)return;const e=Array.from(this._pendingCallReportUploads);let t=!1;yield Promise.race([Promise.all(e.map(e=>e.catch(()=>{}))),new Promise(e=>setTimeout(()=>{t=!0,e()},Xn.CALL_REPORT_UPLOAD_DRAIN_TIMEOUT_MS))]),t&&It.warn("Timed out waiting for pending call report uploads",{pendingCount:this._pendingCallReportUploads.size})})}validateOptions(){return Ut(this.options)||$t(this.options)}broadcast(e){}disconnect(){return Z(this,void 0,void 0,function*(){clearTimeout(this._reconnectTimeout),this._clearTokenExpiryTimeout(),this.subscriptions={},this._autoReconnect=!1,this._intentionalClose=!0,this._reconnectAttempts=0,this.relayProtocol=null,yield this._drainCallReportUploads(),this._closeConnection(),yield sessionStorage.removeItem(this.signature),this._executeQueue=[],this._detachListeners(),It.debug("Session disconnected. Cleaned up all listeners and subscriptions, closed connection, disabled auto-reconnect.")})}on(e,t){return _n(e,t,this.uuid),this}off(e,t){return xn(e,t,this.uuid),this}connect(){var e;return Z(this,void 0,void 0,function*(){null===(e=this._registrationTimings)||void 0===e||e.mark("client.connect() called"),this.connection||(It.debug("No existing connection found, creating a new one."),this.connection=new Tn(this)),this._attachListeners(),this._autoReconnect||(It.debug("autoReconnect was disabled, resetting reconnect attempts"),this._reconnectAttempts=0),this._autoReconnect=!0,this.connection.isAlive||(It.debug("Connection wasn't alive, initiating connection to the server..."),this.connection.connect()),It.debug("Connect method called. Connection initiated.")})}resetReconnectAttempts(){this._reconnectAttempts=0,this._reconnectCountedGeneration=-1}_handleLoginError(e){var t;null===(t=this._registrationTimings)||void 0===t||t.mark("login failed");const n=bt(xe,e);Cn(ut.Error,{error:n,sessionId:this.sessionid},this.uuid)}clearReconnectToken(){en(),this.reconnectTokenVoiceSdkId=null,this.reconnectTokenCanaryRtcServer=void 0}_checkTokenExpiry(){this._clearTokenExpiryTimeout();const e=this.options.login_token;if(e&&"string"==typeof e)try{const t=e.split(".");if(3!==t.length)return;const n=JSON.parse(atob(t[1])).exp;if("number"!=typeof n)return;const i=n-Math.floor(Date.now()/1e3);if(i<=0)return;if(i<=Xn.TOKEN_EXPIRY_WARNING_SECONDS)this._emitTokenExpiryWarning();else{const e=1e3*(i-Xn.TOKEN_EXPIRY_WARNING_SECONDS);this._tokenExpiryTimeout=setTimeout(()=>{this._emitTokenExpiryWarning()},e)}}catch(e){It.debug("login_token is not a decodable JWT, skipping expiry check")}}_emitTokenExpiryWarning(){const e=gt(Ze);Cn(ut.Warning,{warning:e,sessionId:this.sessionid},this.uuid)}_clearTokenExpiryTimeout(){null!==this._tokenExpiryTimeout&&(clearTimeout(this._tokenExpiryTimeout),this._tokenExpiryTimeout=null)}login({creds:e,onSuccess:t,onError:n}={}){return Z(this,void 0,void 0,function*(){if(this.connection&&this.connection.isAlive){if(e&&(void 0!==e.login&&(this.options.login=e.login),void 0!==e.password&&(this.options.password=e.password),void 0!==e.passwd&&(this.options.passwd=e.passwd),void 0!==e.login_token&&(this.options.login_token=e.login_token),void 0!==e.userVariables&&(this.options.userVariables=e.userVariables),void 0!==e.anonymous_login&&(this.options.anonymous_login=e.anonymous_login)),Ut(this.options))return this._login({type:"login",onSuccess:t,onError:n});if($t(this.options))return this._login({type:"anonymous_login",onSuccess:t,onError:n});{const e="Invalid login options provided for authentication.";It.error(e);const t=bt(Ce,void 0,e);return void Cn(ut.Error,{error:t,type:"InvalidCredentialsOptions",sessionId:this.sessionid},this.uuid)}}})}_login({type:e,onSuccess:t,onError:n}){var i,r,o,a,s,l,c;return Z(this,void 0,void 0,function*(){let d;null===(i=this._registrationTimings)||void 0===i||i.mark(`prepare ${e} request`);const u=!!Jt(),h=u&&(this.sessionid&&Qt()?this.sessionid:function(e=Date.now()){const t=sessionStorage.getItem(Gt);return t?Qt(e)?t:(sessionStorage.removeItem(Gt),sessionStorage.removeItem(Kt),null):null}())||"";if("login"===e){const e=null!==(a=null!==(r=this.options.pushWhenActive)&&void 0!==r?r:null===(o=this.options.userVariables)||void 0===o?void 0:o.push_when_active)&&void 0!==a&&a,t=Object.assign(Object.assign({},this.options.userVariables),{push_when_active:e,pn_late_fanout:e}),n=null!==(s=this.options.earlySdpAnswer)&&void 0!==s&&s;d=new jn(this.options.login,this.options.password||this.options.passwd,this.options.login_token,h,t,u,n)}else d=new Jn({target_id:this.options.anonymous_login.target_id,target_type:this.options.anonymous_login.target_type,target_version_id:this.options.anonymous_login.target_version_id,target_params:this.options.anonymous_login.target_params,sessionId:h,userVariables:this.options.userVariables,reconnection:u});const p=yield this.execute(d).catch(e=>{this._handleLoginError(e),n&&n(e)});p&&(null===(l=this._registrationTimings)||void 0===l||l.mark("login response processing started"),this.sessionid=p.sessid,this.sessionid&&Zt(this.sessionid),this._checkTokenExpiry(),t&&t(),null===(c=this._registrationTimings)||void 0===c||c.mark("login response processing complete"))})}_onSocketOpen(){return Z(this,void 0,void 0,function*(){this.startSignalingHealthMonitor()})}_flushIntermediateCallReports(e){const t=this.calls;t&&Object.values(t).forEach(t=>{if(null==t?void 0:t.flushIntermediateCallReport)try{t.flushIntermediateCallReport(e)}catch(n){It.error("Failed to flush intermediate call report",{callId:t.id,flushReason:e,error:n})}})}_getSocketCloseCodeName(e){if(void 0===e)return;const t=Object.entries(ot).find(([,t])=>t===e);return null==t?void 0:t[0]}_getSocketCloseError(e){if(e)return e instanceof Error?e.message:String(e)}_createSocketCloseFlushReason(e){return{type:(null==e?void 0:e.error)?"socket-error":"socket-close",socketClose:{code:null==e?void 0:e.code,codeName:this._getSocketCloseCodeName(null==e?void 0:e.code),reason:null==e?void 0:e.reason,wasClean:null==e?void 0:e.wasClean,error:this._getSocketCloseError(null==e?void 0:e.error)}}}onNetworkClose(e){var t,n,i,r,o;const a=null!==(n=null===(t=this.connection)||void 0===t?void 0:t.socketGeneration)&&void 0!==n?n:0,s=null!==(i=null==e?void 0:e.socketGeneration)&&void 0!==i?i:a;if(s<a)It.debug(`Skipping stale onNetworkClose for socket generation ${s} (current generation is ${a})`);else if(s!==this._reconnectCountedGeneration){this._flushIntermediateCallReports(this._createSocketCloseFlushReason(e)),It.debug("onNetworkClose called",{closeCode:null==e?void 0:e.code,closeReason:null==e?void 0:e.reason,wasClean:null==e?void 0:e.wasClean,voiceSdkId:this.callReportVoiceSdkId,sessid:this.sessionid||void 0,autoReconnect:this._autoReconnect,reconnectAttempts:this._reconnectAttempts}),this.relayProtocol&&En(this.relayProtocol);for(const e in this.subscriptions)En(e);if(this.subscriptions={},this.contexts=[],clearTimeout(this._keepAliveTimeout),clearTimeout(this._reconnectTimeout),this.stopSignalingHealthMonitor(),this.sessionid&&this._autoReconnect&&Zt(this.sessionid),this.connection&&(this.connection.previousGatewayState=""),this._autoReconnect){const e=null!==(r=this.options.maxReconnectAttempts)&&void 0!==r?r:10;if(this._reconnectCountedGeneration=s,this._reconnectAttempts+=1,e>0&&this._reconnectAttempts>e){It.info(`Reconnection exhausted after ${e} attempts. Stopping automatic reconnect.`),this._reconnectAttempts=0,this._autoReconnect=!1,this._terminateActiveCallsLocally();const t=bt(_e);return void Cn(ut.Error,{error:t,sessionId:this.sessionid},this.uuid)}const t=this.reconnectDelay;null===(o=this._registrationTimings)||void 0===o||o.mark("schedule WebSocket reconnect",{delayMs:t,attempt:this._reconnectAttempts}),It.debug(`Reconnect attempt ${this._reconnectAttempts}${e>0?` of ${e}`:""} (delay=${t}ms)`),this._reconnectTimeout=setTimeout(()=>{var e;null===(e=this._registrationTimings)||void 0===e||e.mark("WebSocket reconnect timer fired"),It.debug("Calling connect due to network close and auto-reconnect enabled."),this.connect()},t)}else if(It.debug("auto_reconnect disabled, not reconnecting",{voiceSdkId:this.callReportVoiceSdkId,sessid:this.sessionid||void 0,intentionalClose:this._intentionalClose}),!this._intentionalClose){const e=gt(it);Cn(ut.Warning,{warning:e,reason:"auto_reconnect_disabled",sessionId:this.sessionid},this.uuid)}this._intentionalClose=!1}else It.debug(`Skipping duplicate onNetworkClose for socket generation ${s} (already handled, reconnect attempt ${this._reconnectAttempts})`)}_onSocketMessage(e){}_removeSubscription(e,t){this._existsSubscription(e,t)&&(t?(delete this.subscriptions[e][t],xn(e,null,t)):(delete this.subscriptions[e],En(e)))}_addSubscription(e,t=null,n){this._existsSubscription(e,n)||(this._existsSubscription(e)||(this.subscriptions[e]={}),this.subscriptions[e][n]={},Dt(t)&&_n(e,t,n))}_existsSubscription(e,t){return!(!this.subscriptions.hasOwnProperty(e)||!(!t||t&&this.subscriptions[e].hasOwnProperty(t)))}_attachListeners(){this._detachListeners(),It.debug("Attaching socket event listeners"),this.on(ut.SocketOpen,this._onSocketOpen),this.on(ut.SocketClose,this.onNetworkClose),this.on(ut.SocketError,this.onNetworkClose),this.on(ut.SocketMessage,this._onSocketMessage),this.on(ut.SocketActivity,this._onSocketActivity)}_detachListeners(){It.debug("Detaching socket event listeners"),this.off(ut.SocketOpen,this._onSocketOpen),this.off(ut.SocketClose,this.onNetworkClose),this.off(ut.SocketError,this.onNetworkClose),this.off(ut.SocketMessage,this._onSocketMessage),this.off(ut.SocketActivity,this._onSocketActivity)}_emptyExecuteQueues(){this._executeQueue.forEach(({resolve:e,msg:t})=>{"string"==typeof t?this.executeRaw(t):e(this.execute(t))})}_closeConnection(){var e,t;this._idle=!0,clearTimeout(this._keepAliveTimeout),this.stopSignalingHealthMonitor(),It.debug("_closeConnection called",{connected:null===(e=this.connection)||void 0===e?void 0:e.connected,socketGeneration:null===(t=this.connection)||void 0===t?void 0:t.socketGeneration,voiceSdkId:this.callReportVoiceSdkId,sessid:this.sessionid||void 0}),this.connection&&this.connection.close()}_resetKeepAlive(){!1===this._pong&&(It.warn("No ping/pong received, forcing PING ACK to keep alive"),this.execute(new Dn(Jt()))),clearTimeout(this._keepAliveTimeout),this._triggerKeepAliveTimeoutCheck()}_triggerKeepAliveTimeoutCheck(){this._pong=!1,this._keepAliveTimeout=setTimeout(()=>this._resetKeepAlive(),35e3)}setPingReceived(){It.debug("Ping received"),this._pong=!0}_onSocketActivity(){this._signalingHealthMonitor.onSocketActivity()}onOutboundConfirmed(){this._signalingHealthMonitor.onOutboundConfirmed()}hasActiveCall(){const e=this.calls;if(!e)return!1;const t=new Set([hn.Early,hn.Active,hn.Held]);return Object.values(e).some(e=>e&&null!=e._state&&t.has(e._state))}_terminateActiveCallsLocally(){const e=this.calls;if(!e)return;const t=Object.keys(e);if(0!==t.length){It.debug(`Reconnection exhausted — locally terminating ${t.length} active call(s) (no BYE): ${t.join(", ")}`);for(const n of t){const t=e[n];null==t||t.hangup({},!1)}}}startSignalingHealthMonitor(){this._signalingHealthMonitor.start()}stopSignalingHealthMonitor(){this._signalingHealthMonitor.stop()}triggerIceRestart(e){const t=this.calls,n=null==t?void 0:t[e];if(!n)return It.warn(`Signaling health: cannot trigger ICE restart — call ${e} not found`),{started:!1,reason:"call not found"};const i=n.peer;if(!(null==i?void 0:i.restartIce))return It.warn(`Signaling health: cannot trigger ICE restart — no peer for call ${e}`),{started:!1,reason:"no peer"};const r=i.restartIce();return r.started||It.debug(`Signaling health: ICE restart skipped for call ${e}: ${r.reason}`),r}onSignalingRequestTimeout(e,t,n=""){this._signalingHealthMonitor.onRequestTimeout(e,t,n)}reportPeerFailure(e,t){this._signalingHealthMonitor.onPeerFailure(e,t)}reportNoRtp(e,t){this._signalingHealthMonitor.onNoRtp(e,t)}reportIceRestartFailed(e){this._signalingHealthMonitor.onIceRestartFailed(e)}static on(e,t){_n(e,t)}static off(e){xn(e)}static uuid(){return oe()}clearConnection(){this.connection=null}hasAutoReconnect(){return this._autoReconnect}}Xn.TOKEN_EXPIRY_WARNING_SECONDS=120,Xn.CALL_REPORT_UPLOAD_DRAIN_TIMEOUT_MS=1e4;const Zn=e=>navigator.mediaDevices.getUserMedia(e),ei=e=>e&&e instanceof MediaStream,ti=(e,t,n)=>{if(null==e)return null;const i=Ft(e);if(i instanceof Promise)return i.then(e=>ti(e,t,n),e=>(It.error("attachMediaStream: element resolver rejected",e),null));if(!Pt(i))return"function"==typeof e?It.warn(`attachMediaStream: element resolver returned ${i} instead of an <audio> or <video> element`):"string"==typeof e?It.warn(`attachMediaStream: id "${e}" did not resolve to an <audio> or <video> element`):It.warn("attachMediaStream: not an <audio> or <video> element:",e),null;if(i.getAttribute("autoplay")||i.setAttribute("autoplay","autoplay"),i.getAttribute("playsinline")||i.setAttribute("playsinline","playsinline"),i.srcObject&&i.srcObject!==t&&(It.warn("attachMediaStream: element already has a different MediaStream attached; overwriting will disrupt the existing call. Use a per-call remoteElement (client.newCall({ remoteElement }) or call.answer({ remoteElement })) for concurrent calls."),n)){const e=gt(Je);Cn(ut.Warning,{warning:e,callId:n.callId,sessionId:n.sessionId},n.eventTarget)}return i.srcObject=t,i},ni=(e,t)=>{const n=Ft(e);if(n){if(t&&n.srcObject!==t)return;n.srcObject=null}},ii=(e,t)=>Z(void 0,void 0,void 0,function*(){const n=Ft(e);if(null===n)return It.info("No HTMLMediaElement to attach the speakerId"),!1;if("string"!=typeof t)return It.info(`Invalid speaker deviceId: '${t}'`),!1;try{return yield n.setSinkId(t),!0}catch(e){return!1}}),ri=e=>{e&&"live"===e.readyState&&e.stop()},oi=e=>{ei(e)&&e.getTracks().forEach(ri),e=null},ai=e=>Z(void 0,void 0,void 0,function*(){It.info("RTCService.getUserMedia",e);const{audio:t,video:n}=e;if(!t&&!n)return null;try{return yield Zn(e)}catch(t){if(It.error("getUserMedia error: ",t),(e=>"NotReadableError"===e.name||"NotFoundError"===e.name||"OverconstrainedError"===e.name)(t)){const n=(e=>{const{audio:t,video:n}=e;let i=!1,r=t,o=n;if("object"==typeof t&&null!==t&&"deviceId"in t){i=!0;const e=Object.assign({},t);delete e.deviceId,r=0===Object.keys(e).length||e}if("object"==typeof n&&null!==n&&"deviceId"in n){i=!0;const e=Object.assign({},n);delete e.deviceId,o=0===Object.keys(e).length||e}return i?{audio:r,video:o}:null})(e);if(n){It.warn("Device not found or not readable, falling back to default device");try{return yield Zn(n)}catch(e){throw It.error("Fallback getUserMedia also failed: ",e),t}}}throw t}}),si=(e=null,t=!1)=>Z(void 0,void 0,void 0,function*(){let n=[];const i=yield navigator.mediaDevices.getUserMedia(((e=null)=>({audio:!e||e===gn.AudioIn||e===gn.AudioOut,video:!e||e===gn.Video}))(e)).catch(e=>(It.error(e),null));if(i){if(oi(i),n=yield navigator.mediaDevices.enumerateDevices(),e&&(n=n.filter(t=>t.kind===e)),!0===t)return n;const r=[];n=n.filter(e=>{if(!e.groupId)return!0;const t=`${e.kind}-${e.groupId}`;return!r.includes(t)&&(r.push(t),!0)})}return n}),li=[[320,240],[640,360],[640,480],[1280,720],[1920,1080]],ci=(e,t,n)=>Z(void 0,void 0,void 0,function*(){const i=yield si(n,!0);for(let n=0;n<i.length;n++){const{deviceId:r,label:o}=i[n];if(e===r||t===o)return r}return null}),di=e=>e?{id:e.id,kind:e.kind,enabled:e.enabled,muted:e.muted,readyState:e.readyState}:null,ui=e=>{var t,n,i,r,o,a;return e?(null!==(n=null===(t=e.getTracks)||void 0===t?void 0:t.call(e))&&void 0!==n?n:[...null!==(r=null===(i=e.getAudioTracks)||void 0===i?void 0:i.call(e))&&void 0!==r?r:[],...null!==(a=null===(o=e.getVideoTracks)||void 0===o?void 0:o.call(e))&&void 0!==a?a:[]]).map(e=>di(e)):[]},hi=(e,t)=>{if(!e)return!1;const{subscribed:n,alreadySubscribed:i}=pi(e);return n.includes(t)||i.includes(t)},pi=e=>{const t={subscribed:[],alreadySubscribed:[],unauthorized:[],unsubscribed:[],notSubscribed:[]};return Object.keys(t).forEach(n=>{t[n]=e[`${n}Channels`]||[]}),t},fi=(e,t=null,n=null)=>{if(!ei(e))return null;let i=[];switch(t){case"audio":i=e.getAudioTracks();break;case"video":i=e.getVideoTracks();break;default:i=e.getTracks()}i.forEach(e=>{switch(n){case"on":case!0:e.enabled=!0;break;case"off":case!1:e.enabled=!1;break;default:e.enabled=!e.enabled}})},gi=e=>{fi(e,"audio",!0)},vi=e=>{fi(e,"audio",!1)};var mi;function bi(e,t){const n=document.getElementById(t);if(n)return n;if(e&&t){const n=document.createElement("audio");return n.id=t,n.loop=!0,n.src=e,n.preload="auto",n.load(),document.body.appendChild(n),n}return null}function yi(e){e&&(e._playFulfilled=!1,e._promise=e.play(),e._promise.then(()=>{e._playFulfilled=!0}).catch(t=>{It.error("playAudio",t),e._playFulfilled=!0}))}function wi(e){e&&(e._playFulfilled?(e.pause(),e.currentTime=0):e._promise&&e._promise.then?e._promise.then(()=>{e.pause(),e.currentTime=0}):setTimeout(()=>{e.pause(),e.currentTime=0},1e3))}!function(e){e.not_supported="not supported",e.full="full",e.partial="partial"}(mi||(mi={}));const ki=e=>{const t=[],n=[];return e&&0!==e.length?(e.forEach(e=>{const i=e.mimeType.toLocaleLowerCase();i.startsWith("audio/")?t.push(e):i.startsWith("video/")&&n.push(e)}),{audioCodecs:t,videoCodecs:n}):{audioCodecs:t,videoCodecs:n}};class _i extends Rn{constructor(e,t){super(),this.method="ai_conversation",this.buildRequest({method:this.method,params:{type:"conversation.item.create",previous_item_id:null,item:{id:oe(),type:"message",role:"user",content:[{type:"input_text",text:e},...null==t?void 0:t.map(e=>({type:"image_url",image_url:{url:e}}))]}}})}}class Si extends Rn{constructor(e){super(),this.method="ai_conversation",this.buildNotification({method:this.method,params:{type:"conversation.item.create",item:e}})}}class xi{constructor(e,t,n){var i;this.getRegistrationTimingLog=n,this.peerConnection=null,this.intervalId=null,this.statsBuffer=[],this.intervalStartTime=null,this.callEndTime=null,this.logCollector=null,this.registrationTimingIncluded=!1,this.intervalAudioLevels={outbound:[],inbound:[]},this.intervalJitters=[],this.intervalRTTs=[],this.intervalBitrates={outbound:[],inbound:[]},this.previousStats={},this.previousCandidatePairSnapshot=null,this.MAX_BUFFER_SIZE=360,this.onFlushNeeded=null,this.onWarning=null,this._breachCounters={},this._activeWarnings=new Set,this._lastWarningEmitted={},this._prevPacketsReceived=null,this._prevPacketsLost=null,this._previousStatsEntryForWarnings=null,this._isHeld=!1,this._lastLocalAudioTrackSnapshotJson=null,this._hasConfirmedLocalAudio=!1,this._confirmedLocalAudioSilenceMs=0,this._segmentIndex=0,this._flushing=!1,this._stopped=!1,this.options=e,this.logCollectorOptions=t||{enabled:!1,level:"debug",maxEntries:1e3},this.callStartTime=new Date,this._lastIntermediateFlushTime=this.callStartTime,this.logCollectorOptions.enabled&&(this.logCollector=function(e){return new Ct(e)}(this.logCollectorOptions),this.logCollector.start(),i=this.logCollector,Et=i)}start(e){var t,n;this.options.enabled&&(this.peerConnection=e,this.intervalStartTime=new Date,this._lastIntermediateFlushTime=this.intervalStartTime,this._stopped=!1,It.info("CallReportCollector: Starting stats collection",{interval:this.options.interval,initialInterval:xi.INITIAL_COLLECTION_INTERVAL_MS,logCollectorActive:null!==(n=null===(t=this.logCollector)||void 0===t?void 0:t.isActive())&&void 0!==n&&n}),this._scheduleNextCollection())}stop(){var e,t;return Z(this,void 0,void 0,function*(){this._stopped=!0,this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),this.callEndTime=new Date,this.peerConnection&&this.intervalStartTime&&(yield this._collectStats(!0));const n=null!==(t=null===(e=this.logCollector)||void 0===e?void 0:e.getLogCount())&&void 0!==t?t:0;this.logCollector&&this.logCollector.stop(),It.info("CallReportCollector: Stopped stats collection",{totalIntervals:this.statsBuffer.length,totalLogs:n,duration:this.callEndTime.getTime()-this.callStartTime.getTime()})})}flush(e,t){var n,i,r,o;const a=this._getRegistrationTimingLog(),s=this.statsBuffer.length,l=null!==(i=null===(n=this.logCollector)||void 0===n?void 0:n.getLogCount())&&void 0!==i?i:0,c="socket-close"===(null==t?void 0:t.type)||"socket-error"===(null==t?void 0:t.type),d=s>0||l>0||c||!!a;if(this._flushing||!d)return It.debug("CallReportCollector: Skipping intermediate flush",{reason:this._flushing?"already-flushing":"no-stats-or-logs",flushReason:t,statsIntervals:s,logEntries:l}),null;this._flushing=!0;try{const n=this._segmentIndex++,i=this.statsBuffer;this.statsBuffer=[];const s=this._withRegistrationTiming(null!==(o=null===(r=this.logCollector)||void 0===r?void 0:r.drain())&&void 0!==o?o:[],a),l=new Date;this._lastIntermediateFlushTime=l;const c=Object.assign(Object.assign(Object.assign({summary:Object.assign(Object.assign({},e),{durationSeconds:(l.getTime()-this.callStartTime.getTime())/1e3,startTimestamp:this.callStartTime.toISOString(),endTimestamp:l.toISOString()}),stats:i},s.length>0?{logs:s}:{}),{segment:n}),t?{flushReason:t}:{});return It.info("CallReportCollector: Flushed intermediate segment",{segment:n,intervals:i.length,logEntries:s.length,callId:e.callId,flushReason:t}),c}finally{this._flushing=!1}}postReport(e,t,n,i){var r,o,a;return Z(this,void 0,void 0,function*(){const s=this._withRegistrationTiming(null!==(o=null===(r=this.logCollector)||void 0===r?void 0:r.getLogs())&&void 0!==o?o:[],this._getRegistrationTimingLog()),l=s&&s.length>0;if(!this.options.enabled)return void It.info("CallReportCollector: Skipping report — call reports disabled");if(0===this.statsBuffer.length&&!l)return void It.info("CallReportCollector: Skipping report — no stats or logs collected");const c=this._segmentIndex>0,d=this._segmentIndex,u=Object.assign(Object.assign({summary:Object.assign(Object.assign({},e),{durationSeconds:this.callEndTime&&this.callStartTime?(this.callEndTime.getTime()-this.callStartTime.getTime())/1e3:void 0,startTimestamp:this.callStartTime.toISOString(),endTimestamp:null===(a=this.callEndTime)||void 0===a?void 0:a.toISOString()}),stats:this.statsBuffer},s&&s.length>0?{logs:s}:{}),c?{segment:d}:{});yield this._sendPayload(u,t,n,i,!0)})}_getRegistrationTimingLog(){var e;if(!this.registrationTimingIncluded&&this.options.enabled&&this.logCollectorOptions.enabled&&!["warn","error"].includes(this.logCollectorOptions.level))try{return null===(e=this.getRegistrationTimingLog)||void 0===e?void 0:e.call(this)}catch(e){return}}_withRegistrationTiming(e,t){if(!this.getRegistrationTimingLog)return e;const n=e.filter(e=>{var t;return"registration_timing"!==(null===(t=e.context)||void 0===t?void 0:t.event)});return t&&(this.registrationTimingIncluded=!0,n.unshift(t)),n}sendPayload(e,t,n,i,r=!1){return Z(this,void 0,void 0,function*(){yield this._sendPayload(e,t,n,i,!1,r)})}_sendPayload(e,t,n,i,r=!0,o=!1){var a,s;return Z(this,void 0,void 0,function*(){const l=new URL(n),c=`${l.protocol.replace(/^ws/,"http")}//${l.host}/call_report`,d=r?"final report":`intermediate segment ${e.segment}`;It.info(`CallReportCollector: Posting ${d}`,{endpoint:c,intervals:e.stats.length,logEntries:null!==(s=null===(a=e.logs)||void 0===a?void 0:a.length)&&void 0!==s?s:0,callId:e.summary.callId,segment:e.segment});const u={"Content-Type":"application/json","x-call-report-id":t,"x-call-id":e.summary.callId};i&&(u["x-voice-sdk-id"]=i);const h=JSON.stringify(e),p=(r||o)&&h.length<=xi.KEEPALIVE_BODY_LIMIT_BYTES;let f;for(let e=0;e<=xi.RETRY_DELAYS_MS.length;e++){try{const t=yield fetch(c,Object.assign({method:"POST",headers:u,body:h},p?{keepalive:!0}:{}));if(t.ok)return void It.info(`CallReportCollector: Successfully posted ${d}`,{attempt:e+1,status:t.status});{const n=yield t.text();f=new Error(`Call report POST failed with status ${t.status}`),It.error(`CallReportCollector: Failed to post ${d}`,{attempt:e+1,status:t.status,error:n})}}catch(l){f=l,It.warn(`CallReportCollector: Network error posting ${d}`,{attempt:e+1,error:l})}const t=xi.RETRY_DELAYS_MS[e];if(void 0===t)break;It.info(`CallReportCollector: Retrying ${d} in ${t}ms`,{attempt:e+2}),yield new Promise(e=>setTimeout(e,t))}throw It.error(`CallReportCollector: Exhausted retries posting ${d}`,{error:f}),f instanceof Error?f:new Error("Call report POST failed after retries")})}getStatsBuffer(){return this.statsBuffer}shouldForceRelayCandidateForRecovery(){var e,t,n,i,r,o,a,s,l,c,d,u,h,p,f,g;if(this.statsBuffer.length<2)return!1;const v=this.statsBuffer[this.statsBuffer.length-1],m=this.statsBuffer[this.statsBuffer.length-2],b=null===(e=v.ice)||void 0===e?void 0:e.local;if("vpn"!==(null==b?void 0:b.networkType)||"relay"===(null==b?void 0:b.candidateType))return!1;const y=!1===(null===(t=v.ice)||void 0===t?void 0:t.writable),w="disconnected"===(null===(n=v.transport)||void 0===n?void 0:n.iceState)||"failed"===(null===(i=v.transport)||void 0===i?void 0:i.iceState),k=this._positiveDelta(null===(r=v.ice)||void 0===r?void 0:r.requestsSent,null===(o=m.ice)||void 0===o?void 0:o.requestsSent),_=this._positiveDelta(null===(a=v.ice)||void 0===a?void 0:a.responsesReceived,null===(s=m.ice)||void 0===s?void 0:s.responsesReceived),S=k>0&&0===_,x=this._positiveDelta(null===(c=null===(l=v.audio)||void 0===l?void 0:l.outbound)||void 0===c?void 0:c.bytesSent,null===(u=null===(d=m.audio)||void 0===d?void 0:d.outbound)||void 0===u?void 0:u.bytesSent),C=this._positiveDelta(null===(p=null===(h=v.audio)||void 0===h?void 0:h.inbound)||void 0===p?void 0:p.bytesReceived,null===(g=null===(f=m.audio)||void 0===f?void 0:f.inbound)||void 0===g?void 0:g.bytesReceived);return y||w||S||x>0&&0===C}getLogs(){var e,t;return null!==(t=null===(e=this.logCollector)||void 0===e?void 0:e.getLogs())&&void 0!==t?t:[]}_positiveDelta(e,t){return void 0===e||void 0===t?0:Math.max(0,e-t)}cleanup(){this._lastLocalAudioTrackSnapshotJson=null,this.logCollector&&(this.logCollector.clear(),this.logCollector=null)}setHeld(e){this._isHeld!==e&&(this._isHeld=e,this._trackBreach(Me,!1),this._trackBreach(Fe,!1))}_scheduleNextCollection(){if(this._stopped||!this.peerConnection||!this.intervalStartTime||this.intervalId)return;const e=this._collectionIntervalFor();this.intervalId=setTimeout(()=>{this.intervalId=null,this._collectStats().finally(()=>{!this._stopped&&this.peerConnection&&this._scheduleNextCollection()})},e)}_collectionIntervalFor(){const e=this._positiveInterval(this.options.interval,5e3);return Math.min(xi.INITIAL_COLLECTION_INTERVAL_MS,e)}_positiveInterval(e,t){return"number"==typeof e&&Number.isFinite(e)&&e>0?e:t}_collectStats(e=!1){var t,n;return Z(this,void 0,void 0,function*(){if(this.peerConnection&&this.intervalStartTime)try{const i=yield this.peerConnection.getStats(),r=new Date;let o=null,a=null,s=null,l=null,c=null,d=null;const u=[];let h=null;i.forEach(e=>{switch(e.type){case"outbound-rtp":"audio"===e.kind&&"audio"===e.mediaType&&(o=e);break;case"inbound-rtp":"audio"===e.kind&&"audio"===e.mediaType&&(a=e);break;case"media-playout":"audio"===e.kind&&(s=e);break;case"remote-inbound-rtp":"audio"===e.kind&&(l=e);break;case"remote-outbound-rtp":"audio"===e.kind&&(c=e);break;case"candidate-pair":(e.nominated||"succeeded"===e.state)&&u.push(e);break;case"transport":h=e}});const p=null==h?void 0:h.selectedCandidatePairId,f=p?null===(n=(t=i).get)||void 0===n?void 0:n.call(t,p):void 0,g=this._getCodec(i,null==o?void 0:o.codecId),v=this._getCodec(i,null==a?void 0:a.codecId);if(d="candidate-pair"===(null==f?void 0:f.type)?f:p?u.find(e=>e.id===p)||u[u.length-1]||null:u[u.length-1]||null,o){const e=this._getOutboundAudioLevel(i,o);if(null!==e&&this.intervalAudioLevels.outbound.push(e),void 0!==this.previousStats.outboundBytes&&void 0!==this.previousStats.timestamp){const e=(o.bytesSent||0)-this.previousStats.outboundBytes,t=(o.timestamp||r.getTime())-this.previousStats.timestamp;if(t>0){const n=8*e*1e3/t;this.intervalBitrates.outbound.push(n)}}this.previousStats.outboundBytes=o.bytesSent}if(a){const e=this._getInboundAudioLevel(i,a);if(null!==e&&this.intervalAudioLevels.inbound.push(e),void 0!==a.jitter&&this.intervalJitters.push(1e3*a.jitter),void 0!==this.previousStats.inboundBytes&&void 0!==this.previousStats.timestamp){const e=(a.bytesReceived||0)-this.previousStats.inboundBytes,t=(a.timestamp||r.getTime())-this.previousStats.timestamp;if(t>0){const n=8*e*1e3/t;this.intervalBitrates.inbound.push(n)}}this.previousStats.inboundBytes=a.bytesReceived}let m,b,y,w,k;d&&void 0!==d.currentRoundTripTime&&this.intervalRTTs.push(d.currentRoundTripTime),d&&(m=this._resolveCandidate(i,d.localCandidateId),b=this._resolveCandidate(i,d.remoteCandidateId)),d&&(y=Object.assign(Object.assign({id:d.id,localCandidateId:d.localCandidateId,remoteCandidateId:d.remoteCandidateId,state:d.state,nominated:d.nominated,writable:d.writable,currentRoundTripTime:d.currentRoundTripTime,requestsSent:d.requestsSent,responsesReceived:d.responsesReceived},m?{local:m}:{}),b?{remote:b}:{}),null!==this.previousCandidatePairSnapshot&&d.id!==this.previousCandidatePairSnapshot.id&&(It.debug("CallReportCollector: ICE candidate pair changed mid-call",{previous:this.previousCandidatePairSnapshot,current:y}),this._emitWarning(Ge)),this.previousCandidatePairSnapshot=y),o&&(w=this._getLocalAudioTrackSnapshot(),k=this._getOutboundAudioSourceStats(i,o)),this._logLocalAudioTrackSnapshot(w,k),this.previousStats.timestamp=r.getTime();const _=r.getTime()-this.intervalStartTime.getTime(),S=this._collectionIntervalFor();if(e||_>=S){const e=this._createStatsEntry(this.intervalStartTime,r,o,a,d,m,b,h,w,k,s,l,c,g,v);this.statsBuffer.push(e),this.statsBuffer.length>this.MAX_BUFFER_SIZE&&(this.statsBuffer.shift(),It.warn("CallReportCollector: Buffer size limit reached, removing oldest entry")),this._checkQualityWarnings(e,a),this._requestIntermediateFlushIfNeeded(r),this.intervalStartTime=r,this._resetIntervalAccumulators()}}catch(e){It.error("CallReportCollector: Error collecting stats",{error:e})}})}_getIntermediateReportInterval(){var e;return null!==(e=this.options.intermediateReportInterval)&&void 0!==e?e:xi.DEFAULT_INTERMEDIATE_REPORT_INTERVAL_MS}_requestIntermediateFlushIfNeeded(e){var t,n;const i=this.statsBuffer.length,r=null!==(n=null===(t=this.logCollector)||void 0===t?void 0:t.getLogCount())&&void 0!==n?n:0;if(!this.onFlushNeeded||this._flushing)return;if(0===i&&0===r)return void It.debug("CallReportCollector: Skipping intermediate flush request — no stats or logs buffered");const o=this._getIntermediateReportInterval(),a=e.getTime()-this._lastIntermediateFlushTime.getTime();let s=null;if(i>=xi.STATS_FLUSH_THRESHOLD||r>=xi.LOGS_FLUSH_THRESHOLD?s="buffer-limit":o>0&&a>=o&&(s="safety-interval"),s){It.info("CallReportCollector: Requesting intermediate report flush",{reason:s,statsIntervals:i,logEntries:r,msSinceLastFlush:a}),this._lastIntermediateFlushTime=e;try{this.onFlushNeeded()}catch(e){It.error("CallReportCollector: onFlushNeeded callback error",{error:e})}}}_checkQualityWarnings(e,t){var n,i,r,o,a,s,l,c,d,u,h,p,f,g,v;if(!this.onWarning)return;const m=null===(n=e.connection)||void 0===n?void 0:n.roundTripTimeAvg,b=null===(r=null===(i=e.audio)||void 0===i?void 0:i.inbound)||void 0===r?void 0:r.jitterAvg;let y;if(t){const e=null!==(o=t.packetsReceived)&&void 0!==o?o:0,n=null!==(a=t.packetsLost)&&void 0!==a?a:0;if(null!==this._prevPacketsReceived&&null!==this._prevPacketsLost){const t=e-this._prevPacketsReceived,i=n-this._prevPacketsLost,r=t+i;r>0&&(y=i/r*100)}this._prevPacketsReceived=e,this._prevPacketsLost=n}if(this._trackBreach(Oe,void 0!==m&&m>xi.THRESHOLD_RTT_MS),this._trackBreach(Ae,void 0!==b&&b>xi.THRESHOLD_JITTER_MS),this._trackBreach(Le,void 0!==y&&y>xi.THRESHOLD_PACKET_LOSS_PCT),this._trackLowLocalAudio(e),this._isHeld?this._trackBreach(Me,!1):this._trackLowInboundAudio(e),void 0!==m&&void 0!==b&&void 0!==y){const e=93.2-.11*b-2.5*y-1e3*m*.01,t=Math.max(1,Math.min(4.5,1+.035*e+e*(e-60)*(100-e)*7e-6));this._trackBreach(De,t<xi.THRESHOLD_MOS)}else this._trackBreach(De,!1);if(void 0!==(null===(l=null===(s=e.audio)||void 0===s?void 0:s.inbound)||void 0===l?void 0:l.bytesReceived)){const t=null===(u=null===(d=null===(c=this._previousStatsEntryForWarnings)||void 0===c?void 0:c.audio)||void 0===d?void 0:d.inbound)||void 0===u?void 0:u.bytesReceived,n=e.audio.inbound.bytesReceived;this._trackBreach(Fe,!this._isHeld&&void 0!==t&&n-t==0)}if(void 0!==(null===(p=null===(h=e.audio)||void 0===h?void 0:h.outbound)||void 0===p?void 0:p.bytesSent)){const t=null===(v=null===(g=null===(f=this._previousStatsEntryForWarnings)||void 0===f?void 0:f.audio)||void 0===g?void 0:g.outbound)||void 0===v?void 0:v.bytesSent,n=e.audio.outbound.bytesSent;this._trackBreach(je,void 0!==t&&n-t==0)}this._previousStatsEntryForWarnings=e}_trackLowLocalAudio(e){var t;const n=null===(t=e.audio)||void 0===t?void 0:t.outbound,i=null==n?void 0:n.audioLevelAvg,r=null==n?void 0:n.localTrack;if(void 0!==i&&!1!==(null==r?void 0:r.enabled)&&!0!==(null==r?void 0:r.muted))return i<=xi.THRESHOLD_LOCAL_AUDIO_LEVEL?void(this._hasConfirmedLocalAudio?(this._confirmedLocalAudioSilenceMs+=this._getStatsIntervalDurationMs(e),this._confirmedLocalAudioSilenceMs>=xi.CONFIRMED_LOCAL_AUDIO_SILENCE_MS&&this._emitWarningOncePerEpisode(Pe)):this._trackBreach(Pe,!0)):(this._hasConfirmedLocalAudio=!0,this._confirmedLocalAudioSilenceMs=0,void this._trackBreach(Pe,!1));this._resetLowLocalAudioWarning()}_resetLowLocalAudioWarning(){this._confirmedLocalAudioSilenceMs=0,this._trackBreach(Pe,!1)}_getStatsIntervalDurationMs(e){const t=new Date(e.intervalStartUtc).getTime(),n=new Date(e.intervalEndUtc).getTime()-t;return Number.isFinite(n)&&n>0?n:this.options.interval}_trackLowInboundAudio(e){var t;const n=null===(t=e.audio)||void 0===t?void 0:t.inbound,i=null==n?void 0:n.audioLevelAvg;if(void 0===i)return void this._trackBreach(Me,!1);const r=i<=xi.THRESHOLD_INBOUND_AUDIO_LEVEL;this._trackBreach(Me,r)}_trackBreach(e,t){var n,i;if(t){if(this._breachCounters[e]=(null!==(n=this._breachCounters[e])&&void 0!==n?n:0)+1,this._breachCounters[e]>=xi.CONSECUTIVE_BREACHES_REQUIRED){this._activeWarnings.add(e);const t=Date.now();t-(null!==(i=this._lastWarningEmitted[e])&&void 0!==i?i:0)>=xi.WARNING_THROTTLE_MS&&(this._lastWarningEmitted[e]=t,this._emitWarning(e))}}else this._breachCounters[e]=0,this._activeWarnings.delete(e),delete this._lastWarningEmitted[e]}_emitWarningOncePerEpisode(e){this._activeWarnings.has(e)||(this._activeWarnings.add(e),this._lastWarningEmitted[e]=Date.now(),this._emitWarning(e))}_emitWarning(e){var t;try{const n=gt(e);It.warn(`CallReportCollector: warning ${n.code}: ${n.message}`),null===(t=this.onWarning)||void 0===t||t.call(this,n)}catch(t){It.error(`CallReportCollector: Failed to emit warning ${e}`,{error:t})}}_createStatsEntry(e,t,n,i,r,o,a,s,l,c,d,u,h,p,f){const g={intervalStartUtc:e.toISOString(),intervalEndUtc:t.toISOString(),audio:{}};if(n&&(g.audio.outbound=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({packetsSent:n.packetsSent,bytesSent:n.bytesSent,audioLevelAvg:this._average(this.intervalAudioLevels.outbound),bitrateAvg:this._average(this.intervalBitrates.outbound)},l?{localTrack:l}:{}),c?{mediaSource:c}:{}),void 0!==n.retransmittedPacketsSent?{retransmittedPacketsSent:n.retransmittedPacketsSent}:{}),void 0!==n.retransmittedBytesSent?{retransmittedBytesSent:n.retransmittedBytesSent}:{}),void 0!==n.headerBytesSent?{headerBytesSent:n.headerBytesSent}:{}),void 0!==n.nackCount?{nackCount:n.nackCount}:{}),void 0!==n.targetBitrate?{targetBitrate:n.targetBitrate}:{}),void 0!==n.totalPacketSendDelay?{totalPacketSendDelay:n.totalPacketSendDelay}:{}),void 0!==n.active?{active:n.active}:{}),p?{codec:this._buildCodecSnapshot(p,n.codecId)}:{})),i&&(g.audio.inbound=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({packetsReceived:i.packetsReceived,bytesReceived:i.bytesReceived,packetsLost:i.packetsLost,packetsDiscarded:i.packetsDiscarded,jitterBufferDelay:i.jitterBufferDelay,jitterBufferEmittedCount:i.jitterBufferEmittedCount,totalSamplesReceived:i.totalSamplesReceived,concealedSamples:i.concealedSamples,concealmentEvents:i.concealmentEvents,audioLevelAvg:this._average(this.intervalAudioLevels.inbound),jitterAvg:this._average(this.intervalJitters),bitrateAvg:this._average(this.intervalBitrates.inbound)},void 0!==i.nackCount?{nackCount:i.nackCount}:{}),void 0!==i.headerBytesReceived?{headerBytesReceived:i.headerBytesReceived}:{}),void 0!==i.fecPacketsReceived?{fecPacketsReceived:i.fecPacketsReceived}:{}),void 0!==i.fecPacketsDiscarded?{fecPacketsDiscarded:i.fecPacketsDiscarded}:{}),void 0!==i.jitterBufferTargetDelay?{jitterBufferTargetDelay:i.jitterBufferTargetDelay}:{}),void 0!==i.jitterBufferMinimumDelay?{jitterBufferMinimumDelay:i.jitterBufferMinimumDelay}:{}),void 0!==i.totalSamplesDecoded?{totalSamplesDecoded:i.totalSamplesDecoded}:{}),void 0!==i.samplesDecodedWithSilence?{samplesDecodedWithSilence:i.samplesDecodedWithSilence}:{}),void 0!==i.samplesDecodedWithConcealment?{samplesDecodedWithConcealment:i.samplesDecodedWithConcealment}:{}),void 0!==i.totalAudioEnergy?{totalAudioEnergy:i.totalAudioEnergy}:{}),void 0!==i.totalSamplesDuration?{totalSamplesDuration:i.totalSamplesDuration}:{}),f?{codec:this._buildCodecSnapshot(f,i.codecId)}:{})),r&&(g.connection=Object.assign(Object.assign({roundTripTimeAvg:this._average(this.intervalRTTs),currentRoundTripTime:r.currentRoundTripTime},void 0!==r.currentRoundTripTime?{roundTripTimeSource:"candidate-pair.currentRoundTripTime"}:{}),{packetsSent:r.packetsSent,packetsReceived:r.packetsReceived,bytesSent:r.bytesSent,bytesReceived:r.bytesReceived}),g.ice=Object.assign(Object.assign({id:r.id,localCandidateId:r.localCandidateId,remoteCandidateId:r.remoteCandidateId,state:r.state,nominated:r.nominated,writable:r.writable,currentRoundTripTime:r.currentRoundTripTime,requestsSent:r.requestsSent,responsesReceived:r.responsesReceived},o?{local:o}:{}),a?{remote:a}:{})),s&&(g.transport=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},void 0!==s.iceState?{iceState:s.iceState}:{}),void 0!==s.dtlsState?{dtlsState:s.dtlsState}:{}),void 0!==s.srtpCipher?{srtpCipher:s.srtpCipher}:{}),void 0!==s.tlsVersion?{tlsVersion:s.tlsVersion}:{}),void 0!==s.selectedCandidatePairChanges?{selectedCandidatePairChanges:s.selectedCandidatePairChanges}:{}),void 0!==s.selectedCandidatePairId?{selectedCandidatePairId:s.selectedCandidatePairId}:{})),d&&(g.mediaPlayout=this._withoutUndefined({synthesizedSamplesEvents:d.synthesizedSamplesEvents,synthesizedSamplesDuration:d.synthesizedSamplesDuration,totalPlayoutDelay:d.totalPlayoutDelay,totalSamplesCount:d.totalSamplesCount,totalSamplesDuration:d.totalSamplesDuration})),u||h){const e={};if(u){const t=void 0!==u.jitter?1e3*u.jitter:void 0;let n;"number"==typeof u.totalRoundTripTime&&"number"==typeof u.roundTripTimeMeasurements&&u.roundTripTimeMeasurements>0&&(n=u.totalRoundTripTime/u.roundTripTimeMeasurements),e.inbound=this._withoutUndefined({packetsReceived:u.packetsReceived,packetsLost:u.packetsLost,fractionLost:u.fractionLost,jitter:t,roundTripTime:u.roundTripTime,totalRoundTripTime:u.totalRoundTripTime,roundTripTimeMeasurements:u.roundTripTimeMeasurements,roundTripTimeAvg:n,nackCount:u.nackCount,reportsReceived:u.reportsReceived,packetsDiscarded:u.packetsDiscarded})}h&&(e.outbound=this._withoutUndefined({packetsSent:h.packetsSent,bytesSent:h.bytesSent,reportsCount:h.reportsCount,roundTripTime:h.roundTripTime,totalPacketSendDelay:h.totalPacketSendDelay})),g.remoteRtcp=e}return g}_resolveCandidate(e,t){if(!t)return void It.debug("CallReportCollector: candidateId is empty, skipping resolve");const n=e.get(t);if(!n)return void It.debug("CallReportCollector: candidate not found in stats report",{candidateId:t});const i={};if(void 0!==n.id&&(i.id=n.id),void 0!==n.address?i.address=n.address:void 0!==n.ip&&(i.address=n.ip),void 0!==n.port&&(i.port=n.port),void 0!==n.candidateType&&(i.candidateType=n.candidateType),void 0!==n.protocol&&(i.protocol=n.protocol),void 0!==n.networkType&&(i.networkType=n.networkType),void 0!==n.url&&(i.url=n.url),void 0!==n.relayProtocol&&(i.relayProtocol=n.relayProtocol),0!==Object.keys(i).length)return i;It.debug("CallReportCollector: candidate report has no usable fields",{candidateId:t})}_getCodec(e,t){if(!t)return;const n=e.get(t);return n&&"codec"===n.type?n:void 0}_buildCodecSnapshot(e,t){const n=this._withoutUndefined(Object.assign({mimeType:e.mimeType,clockRate:e.clockRate,channels:e.channels,payloadType:e.payloadType,sdpFmtpLine:e.sdpFmtpLine},void 0!==t?{codecId:t}:{}));return Object.keys(n).length>0?n:void 0}_getOutboundMediaSource(e,t){let n;return t.mediaSourceId&&(n=e.get(t.mediaSourceId)),n||e.forEach(e=>{n||"media-source"!==e.type||"audio"!==e.kind||(n=e)}),n}_getLocalAudioTrackSnapshot(){var e,t;try{const n=null===(e=this.peerConnection)||void 0===e?void 0:e.getSenders().find(e=>{var t;return"audio"===(null===(t=e.track)||void 0===t?void 0:t.kind)}),i=null==n?void 0:n.track;if(!i)return;const r=null===(t=i.getSettings)||void 0===t?void 0:t.call(i),o=this._withoutUndefined({deviceId:null==r?void 0:r.deviceId,groupId:null==r?void 0:r.groupId,channelCount:null==r?void 0:r.channelCount,sampleRate:null==r?void 0:r.sampleRate,sampleSize:null==r?void 0:r.sampleSize,latency:null==r?void 0:r.latency,echoCancellation:null==r?void 0:r.echoCancellation,noiseSuppression:null==r?void 0:r.noiseSuppression,autoGainControl:null==r?void 0:r.autoGainControl}),a=this._withoutUndefined(Object.assign({id:i.id,label:i.label,enabled:i.enabled,muted:i.muted,readyState:i.readyState,contentHint:i.contentHint},Object.keys(o).length>0?{settings:o}:{}));return Object.keys(a).length>0?a:void 0}catch(e){return void It.debug("CallReportCollector: unable to snapshot local audio track",{error:e})}}_getOutboundAudioSourceStats(e,t){const n=this._getOutboundMediaSource(e,t);if(!n)return;const i=this._withoutUndefined({id:n.id,trackIdentifier:n.trackIdentifier,audioLevel:n.audioLevel,totalAudioEnergy:n.totalAudioEnergy,totalSamplesDuration:n.totalSamplesDuration,echoReturnLoss:n.echoReturnLoss,echoReturnLossEnhancement:n.echoReturnLossEnhancement});return Object.keys(i).length>0?i:void 0}_logLocalAudioTrackSnapshot(e,t){if(!e||0===Object.keys(e).length)return;const n=this._stableStringify(e);n!==this._lastLocalAudioTrackSnapshotJson&&(this._lastLocalAudioTrackSnapshotJson=n,It.debug("CallReportCollector: local audio track snapshot",{localTrack:e,mediaSource:t}))}_withoutUndefined(e){return Object.keys(e).reduce((t,n)=>{const i=e[n];return void 0!==i&&(t[n]=i),t},{})}_stableStringify(e){return JSON.stringify(this._sortObjectKeys(e))}_sortObjectKeys(e){return Array.isArray(e)?e.map(e=>this._sortObjectKeys(e)):e&&"object"==typeof e?Object.keys(e).sort().reduce((t,n)=>(t[n]=this._sortObjectKeys(e[n]),t),{}):e}_getOutboundAudioLevel(e,t){const n=this._getOutboundMediaSource(e,t);if(void 0!==(null==n?void 0:n.audioLevel))return n.audioLevel;if(n){const e=this._computeAudioLevelFromEnergy(n.totalAudioEnergy,n.totalSamplesDuration,"outbound");if(null!==e)return e}return this._getTrackAudioLevel(e,t.trackId)}_getInboundAudioLevel(e,t){if(void 0!==t.audioLevel)return t.audioLevel;const n=this._computeAudioLevelFromEnergy(t.totalAudioEnergy,t.totalSamplesDuration,"inbound");return null!==n?n:this._getTrackAudioLevel(e,t.trackId)}_computeAudioLevelFromEnergy(e,t,n){if(void 0===e||void 0===t)return null;const i="inbound"===n?"inboundAudioEnergy":"outboundAudioEnergy",r="inbound"===n?"inboundSamplesDuration":"outboundSamplesDuration",o=this.previousStats[i],a=this.previousStats[r];if(this.previousStats[i]=e,this.previousStats[r]=t,void 0===o||void 0===a)return null;const s=e-o,l=t-a;if(l<=0)return null;const c=Math.sqrt(s/l);return Math.min(1,Math.max(0,c))}_getTrackAudioLevel(e,t){var n;if(!t)return null;const i=e.get(t);return i&&null!==(n=i.audioLevel)&&void 0!==n?n:null}_average(e){if(0===e.length)return;const t=e.reduce((e,t)=>e+t,0);return parseFloat((t/e.length).toFixed(4))}_resetIntervalAccumulators(){this.intervalAudioLevels={outbound:[],inbound:[]},this.intervalJitters=[],this.intervalRTTs=[],this.intervalBitrates={outbound:[],inbound:[]}}}xi.INITIAL_COLLECTION_INTERVAL_MS=1e3,xi.STATS_FLUSH_THRESHOLD=300,xi.LOGS_FLUSH_THRESHOLD=800,xi.DEFAULT_INTERMEDIATE_REPORT_INTERVAL_MS=18e4,xi.CONSECUTIVE_BREACHES_REQUIRED=3,xi.THRESHOLD_RTT_MS=.4,xi.THRESHOLD_JITTER_MS=30,xi.THRESHOLD_PACKET_LOSS_PCT=1,xi.THRESHOLD_MOS=3.5,xi.THRESHOLD_LOCAL_AUDIO_LEVEL=.001,xi.CONFIRMED_LOCAL_AUDIO_SILENCE_MS=3e4,xi.THRESHOLD_INBOUND_AUDIO_LEVEL=.001,xi.WARNING_THROTTLE_MS=15e3,xi.RETRY_DELAYS_MS=[500,1e3,2e3],xi.KEEPALIVE_BODY_LIMIT_BYTES=61440;class Ci{constructor(e,t){this._buffers={local:[],remote:[]},this._bufferBytes={local:0,remote:0},this._trackStates={local:null,remote:null},this._processors=[],this._readerCancellers=[],this._flushTimerId=null,this._flushing=!1,this._stopped=!1,this._started=!1,this._startedAt=null,this._endedAt=null,this._overflowWarnedThisWindow={local:!1,remote:!1},this.onWarning=null,this._host=null,this._callReportId=null,this.options=e,this.callContext=t,this.recordingId=t.recordingId||`${t.callId}-${Date.now().toString(36)}`}start(e,t){if(!this.options.enabled||this._started)return;if("function"!=typeof MediaStreamTrackProcessor)return It.warn("CallRecorder: MediaStreamTrackProcessor unavailable — recording disabled for this call"),this._emitWarning(ze),void(this._started=!0);const n=this.options.tracks||["local","remote"];let i=0;if(n.includes("local")&&e&&(this._attach(e,"local"),i++),n.includes("remote")&&t&&(this._attach(t,"remote"),i++),0===i)return It.info("CallRecorder: no audio tracks available to record — recording idle for this call",{callId:this.callContext.callId}),void(this._started=!0);this._startedAt=new Date,this._started=!0,this._scheduleFlush(),It.info("CallRecorder: started",{callId:this.callContext.callId,tracksAttached:i,flushIntervalMs:this._flushIntervalMs(),maxBufferBytes:this._maxBufferBytes()})}stop(){this._stopped||(this._stopped=!0,this._clearFlushTimer(),this._cancelReaders(),this._endedAt=new Date,It.info("CallRecorder: stopped",{callId:this.callContext.callId,packetsBuffered:this._buffers.local.length+this._buffers.remote.length}))}postFinalReport(){return Z(this,void 0,void 0,function*(){if(!this.options.enabled)return;if(this.stop(),!this._startedAt)return void It.debug("CallRecorder: postFinalReport skipped — never started");const e=this._resolveEndpointFromContext();if(!e)return void It.debug("CallRecorder: postFinalReport skipped — no host available");const t=this.options.tracks||["local","remote"],n=this._startedAt,i=this._endedAt||new Date,r=t.flatMap(e=>{const t=this._drain(e);if(0===t.length)return[];const r=this._buildEnvelope(t,e,"final",n,i);return[{envelope:r,bodyBytes:JSON.stringify(r).length}]}),o=r.reduce((e,t)=>e+t.bodyBytes,0)<=Ci.KEEPALIVE_BODY_LIMIT_BYTES,a=(yield Promise.allSettled(r.map(({envelope:t})=>this._postRecording(e,t,o)))).find(e=>"rejected"===e.status);if(a)throw a.reason})}cleanup(){this._clearFlushTimer(),this._cancelReaders(),this._buffers={local:[],remote:[]},this._bufferBytes={local:0,remote:0},this._trackStates={local:null,remote:null}}_attach(e,t){this._trackStates[t]={ssrc:Math.floor(4294967295*Math.random())>>>0,seq:0,ts:0};try{const n=new MediaStreamTrackProcessor({track:e});this._processors.push(n);const i=n.readable.getReader();let r=!1;const o=()=>{r=!0,i.cancel().catch(()=>{}).finally(()=>{})};this._readerCancellers.push(o),(()=>{Z(this,void 0,void 0,function*(){try{for(;!r&&!this._stopped;){const{done:e,value:n}=yield i.read();if(e)break;this._onFrame(t,n)}}catch(e){this._stopped||It.warn("CallRecorder: reader loop error",{track:t,error:e})}})})()}catch(e){It.warn("CallRecorder: failed to attach track",{track:t,error:e}),this._trackStates[t]=null}}_onFrame(e,t){var n;const i=this._trackStates[e];if(!i||this._stopped)return;const r=t.numberOfFrames,o=new Float32Array(r);t.copyTo(o,{planeIndex:0}),null===(n=t.close)||void 0===n||n.call(t);const a=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);i.seq=i.seq+1&65535;const s=i.ts;i.ts+=r;const l={rtpSeq:i.seq,rtpTs:s,rtpSsrc:i.ssrc,capturedAt:(new Date).toISOString(),payloadBytes:a};this._pushPacket(l,e)}_pushPacket(e,t){const n=e.payloadBytes.length+Ci.PACKET_OVERHEAD_BYTES,i=this._maxBufferBytes(),r=this._buffers[t];if(r.push(e),this._bufferBytes[t]+=n,this._bufferBytes[t]>i){for(;r.length>1&&this._bufferBytes[t]>i;){const e=r.shift();e&&(this._bufferBytes[t]-=e.payloadBytes.length+Ci.PACKET_OVERHEAD_BYTES)}this._overflowWarnedThisWindow[t]||(this._overflowWarnedThisWindow[t]=!0,It.warn("CallRecorder: buffer overflow — oldest packets dropped",{track:t}),this._emitWarning(Ue))}}_flushIntervalMs(){var e;const t=null!==(e=this.options.flushIntervalMs)&&void 0!==e?e:15e3;return t<=0?t:Math.min(t,this._maxSafeFlushIntervalMs())}_maxSafeFlushIntervalMs(){const e=this._sampleRate()*Ci.BYTES_PER_SAMPLE+Ci.FRAMES_PER_SECOND*Ci.PACKET_OVERHEAD_BYTES;return Math.max(1e3,this._maxBufferBytes()/e*500)}_maxBufferBytes(){var e;return null!==(e=this.options.maxBufferBytes)&&void 0!==e?e:dn}_sampleRate(){var e;return null!==(e=this.options.sampleRate)&&void 0!==e?e:48e3}_scheduleFlush(){if(this._stopped||this._flushTimerId)return;const e=this._flushIntervalMs();e<=0||(this._flushTimerId=setInterval(()=>{this._periodicFlush().catch(e=>{It.error("CallRecorder: periodic flush error",{error:e})})},e))}_clearFlushTimer(){this._flushTimerId&&(clearInterval(this._flushTimerId),this._flushTimerId=null)}_cancelReaders(){for(const e of this._readerCancellers)try{e()}catch(e){}this._readerCancellers=[],this._processors=[]}_periodicFlush(){return Z(this,void 0,void 0,function*(){if(!this._flushing&&!this._stopped){this._flushing=!0;try{const e=this._resolveEndpointFromContext();if(!e)return void It.debug("CallRecorder: periodic flush skipped — no host available");const t=this.options.tracks||["local","remote"],n=this._startedAt||new Date,i=new Date;yield Promise.allSettled(t.map(t=>{const r=this._drain(t);if(0===r.length)return Promise.resolve();const o=this._buildEnvelope(r,t,"intermediate",n,i);return this._postRecording(e,o,!1).catch(e=>{It.error("CallRecorder: intermediate flush failed",{track:t,error:e})})})),this._overflowWarnedThisWindow={local:!1,remote:!1}}finally{this._flushing=!1}}})}_drain(e){const t=this._buffers[e];return this._buffers[e]=[],this._bufferBytes[e]=0,t}_resolveEndpointFromContext(){const e=this.callContext.host;return e?this._resolveEndpoint(e):this._host?this._resolveEndpoint(this._host):null}_setHost(e){this._host=e}_setCallReportId(e){e&&(this._callReportId=e)}_resolveCallReportId(){return this._callReportId||this.callContext.callReportId}_resolveEndpoint(e){const t=this.options.endpoint||"/call_recording";try{const n=new URL(e);return`${n.protocol.replace(/^ws/,"http")}//${n.host}${t}`}catch(n){return/^https?:\/\//.test(e)?`${e}${t}`:`https://${e}${t}`}}_buildEnvelope(e,t,n,i,r){let o=0;const a=e.map(e=>(o+=e.payloadBytes.length,{rtp_seq:e.rtpSeq,rtp_ts:e.rtpTs,rtp_ssrc:e.rtpSsrc,captured_at:e.capturedAt,payload_b64:this._toBase64(e.payloadBytes)}));return Object.assign(Object.assign({call_report_id:this._resolveCallReportId(),call_id:this.callContext.callId},this.callContext.voiceSdkId?{voice_sdk_id:this.callContext.voiceSdkId}:{}),{recording_id:this.recordingId,segment:n,track:t,codec:"pcm-f32-le",sample_rate:this._sampleRate(),channels:1,started_at:i.toISOString(),ended_at:r.toISOString(),packet_count:e.length,byte_count:o,packets:a})}_postRecording(e,t,n){return Z(this,void 0,void 0,function*(){const i={"Content-Type":"application/json","x-call-report-id":t.call_report_id,"x-call-id":t.call_id};t.voice_sdk_id&&(i["x-voice-sdk-id"]=t.voice_sdk_id);const r=JSON.stringify(t),o=n&&r.length<=Ci.KEEPALIVE_BODY_LIMIT_BYTES,a=this.options.fetchImpl||fetch;let s;for(let n=0;n<=Ci.RETRY_DELAYS_MS.length;n++){try{const l=yield a(e,Object.assign({method:"POST",headers:i,body:r},o?{keepalive:!0}:{}));if(l.ok)return void It.info("CallRecorder: posted",{track:t.track,segment:t.segment,attempt:n+1,status:l.status,packets:t.packet_count});{const e=yield l.text().catch(()=>"");s=new Error(`Call recording POST failed with status ${l.status}`),It.error("CallRecorder: failed to post",{track:t.track,segment:t.segment,attempt:n+1,status:l.status,error:e})}}catch(e){s=e,It.warn("CallRecorder: network error posting",{track:t.track,segment:t.segment,attempt:n+1,error:e})}const l=Ci.RETRY_DELAYS_MS[n];if(void 0===l)break;It.info("CallRecorder: retrying",{track:t.track,segment:t.segment,inMs:l,attempt:n+2}),yield new Promise(e=>setTimeout(e,l))}throw It.error("CallRecorder: exhausted retries",{track:t.track,segment:t.segment,error:s}),s instanceof Error?s:new Error("Call recording POST failed after retries")})}_emitWarning(e){var t;try{const n=gt(e);null===(t=this.onWarning)||void 0===t||t.call(this,n)}catch(t){It.warn("CallRecorder: failed to emit warning",{code:e,error:t})}}_toBase64(e){let t="";for(let n=0;n<e.length;n+=32768){const i=e.subarray(n,n+32768);t+=String.fromCharCode.apply(null,Array.from(i))}return btoa(t)}}Ci.RETRY_DELAYS_MS=[500,1e3,2e3],Ci.KEEPALIVE_BODY_LIMIT_BYTES=61440,Ci.PACKET_OVERHEAD_BYTES=160,Ci.BYTES_PER_SAMPLE=4,Ci.FRAMES_PER_SECOND=100;const Ei=e=>!e||"default"===e||"communications"===e;class Ii{constructor(e,t){this._call=e,this._recoverInput=t,this._rawDeviceCache=[],this._deviceChangeHandler=null,this._stopped=!1,this._running=!1,this._pending=!1}logDevicesAtStart(){var e,t;return Z(this,void 0,void 0,function*(){this._stopped||this._deviceChangeHandler||"undefined"!=typeof navigator&&navigator.mediaDevices&&(this._deviceChangeHandler=()=>{this._onDeviceChange()},null===(t=(e=navigator.mediaDevices).addEventListener)||void 0===t||t.call(e,"devicechange",this._deviceChangeHandler),yield this._onDeviceChange())})}stop(){var e,t;this._stopped=!0,this._deviceChangeHandler&&(null===(t=null===(e=navigator.mediaDevices)||void 0===e?void 0:e.removeEventListener)||void 0===t||t.call(e,"devicechange",this._deviceChangeHandler),this._deviceChangeHandler=null),this._rawDeviceCache=[],this._input=this._output=void 0}_usable(e,t){const n=e.filter(e=>e.kind===t);return n.some(e=>!Ei(e.deviceId))&&n.every(e=>Boolean(e.deviceId&&e.label))}_bind(e,t,n,i,r){var o;if(!t)return;if((null==e?void 0:e.owner)===t&&e.id===n)return e;if(!Ei(n))return{owner:t,id:n,physicalId:n,attempted:!1};const a=this._rawDeviceCache.filter(e=>e.kind===i);let s;if(Ei(n)){const e=r||(null===(o=a.find(e=>e.deviceId===(n||"default")))||void 0===o?void 0:o.groupId),t=a.filter(t=>e&&t.groupId===e&&!Ei(t.deviceId));1===t.length&&(s=t[0])}return s?{owner:t,id:n,physicalId:s.deviceId,attempted:!1}:void 0}_refreshBindings(){var e,t,n,i;const r=null===(n=null===(t=null===(e=this._call.peer)||void 0===e?void 0:e.instance)||void 0===t?void 0:t.getSenders().find(e=>{var t;return"audio"===(null===(t=e.track)||void 0===t?void 0:t.kind)}))||void 0===n?void 0:n.track;try{const e=null===(i=null==r?void 0:r.getSettings)||void 0===i?void 0:i.call(r);this._input=e&&(e.deviceId||e.groupId)?this._bind(this._input,r,e.deviceId||"","audioinput",e.groupId):void 0}catch(e){this._input=void 0}const o=Ft(this._call.options.remoteElement);this._output=o&&"function"==typeof o.setSinkId&&"string"==typeof o.sinkId?this._bind(this._output,o,o.sinkId,"audiooutput"):void 0}_removed(e,t,n){return Boolean(e&&!e.attempted&&this._usable(t,n)&&!t.some(t=>t.kind===n&&t.deviceId===e.physicalId))}_scan(e){var t,n;return Z(this,void 0,void 0,function*(){const i=this._rawDeviceCache;this._rawDeviceCache=["audioinput","audiooutput"].reduce((t,n)=>t.concat((this._usable(e,n)?e:i).filter(e=>e.kind===n)),[]),this._refreshBindings();const r=this._input,o=this._output,a=this._removed(r,e,"audioinput"),s=this._removed(o,e,"audiooutput");if(It.debug("MediaDeviceCollector: audio devices during call",{devices:this._rawDeviceCache,disconnected:i.filter(e=>!this._rawDeviceCache.some(t=>t.kind===e.kind&&t.deviceId===e.deviceId))}),a){r.attempted=!0;try{yield this._recoverInput()}catch(e){It.warn("Audio input disconnect recovery failed",{error:e})}}if(!this._stopped&&!this._pending){if(this._refreshBindings(),s&&this._output===o){o.attempted=!0;try{const e=yield null===(n=(t=this._call).setAudioOutDevice)||void 0===n?void 0:n.call(t,"default");this._stopped||e||It.warn("Audio output disconnect recovery failed"),e&&(this._output=void 0)}catch(e){It.warn("Audio output disconnect recovery failed",{error:e})}}this._stopped||this._pending||this._refreshBindings()}})}_onDeviceChange(){return Z(this,void 0,void 0,function*(){if(!this._stopped&&(this._pending=!0,!this._running)){this._running=!0;try{for(;this._pending&&!this._stopped;){this._pending=!1;try{const e=yield navigator.mediaDevices.enumerateDevices();if(this._stopped)return void It.debug("MediaDeviceCollector: stopped before applying enumeration",{callId:this._call.id});if(this._pending){It.debug("MediaDeviceCollector: skipping superseded enumeration",{callId:this._call.id});continue}yield this._scan(e)}catch(e){It.debug("MediaDeviceCollector: enumerate/devices failed",{error:e})}}}finally{this._running=!1}}})}}var Ti,Ri=_t(function(e,t){var n;function i(){}function r(){r.init.call(this)}function o(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function a(e,t,n,r){var a,s,l;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),l=s[t]):(s=e._events=new i,e._eventsCount=0),l){if("function"==typeof l?l=s[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),!l.warned&&(a=o(e))&&0<a&&l.length>a){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=l.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(c)}}else l=s[t]=n,++e._eventsCount;return e}function s(e,t,n){function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}var r=!1;return i.listener=n,i}function l(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function c(e,t){for(var n=Array(t);t--;)n[t]=e[t];return n}Object.defineProperty(t,"__esModule",{value:!0}),i.prototype=Object.create(null),r.EventEmitter=r,r.usingDomains=!1,r.prototype.domain=void 0,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.init=function(){this.domain=null,r.usingDomains&&n.active&&!(this instanceof n.Domain)&&(this.domain=n.active),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new i,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(e){var t,n,i,r,o,a,s,l="error"===e;if(a=this._events)l=l&&null==a.error;else if(!l)return!1;if(s=this.domain,l){if(t=arguments[1],!s){if(t instanceof Error)throw t;var d=new Error('Uncaught, unspecified "error" event. ('+t+")");throw d.context=t,d}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var u="function"==typeof n;switch(i=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var i=e.length,r=c(e,i),o=0;o<i;++o)r[o].call(n)}(n,u,this);break;case 2:!function(e,t,n,i){if(t)e.call(n,i);else for(var r=e.length,o=c(e,r),a=0;a<r;++a)o[a].call(n,i)}(n,u,this,arguments[1]);break;case 3:!function(e,t,n,i,r){if(t)e.call(n,i,r);else for(var o=e.length,a=c(e,o),s=0;s<o;++s)a[s].call(n,i,r)}(n,u,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,i,r,o){if(t)e.call(n,i,r,o);else for(var a=e.length,s=c(e,a),l=0;l<a;++l)s[l].call(n,i,r,o)}(n,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];!function(e,t,n,i){if(t)e.apply(n,i);else for(var r=e.length,o=c(e,r),a=0;a<r;++a)o[a].apply(n,i)}(n,u,this,r)}return!0},r.prototype.addListener=function(e,t){return a(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return a(this,e,t,!0)},r.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,s(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,s(this,e,t)),this},r.prototype.removeListener=function(e,t){var n,r,o,a,s;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new i:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,a=n.length;0<a--;)if(n[a]===t||n[a].listener&&n[a].listener===t){s=n[a].listener,o=a;break}if(0>o)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new i,this;delete r[e]}else!function(e,t){for(var n=t,i=n+1,r=e.length;i<r;n+=1,i+=1)e[n]=e[i];e.pop()}(n,o);r.removeListener&&this.emit("removeListener",e,s||t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new i,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new i:delete n[e]),this;if(0===arguments.length){for(var r,o=Object.keys(n),a=0;a<o.length;++a)"removeListener"!==(r=o[a])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new i,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},r.prototype.listeners=function(e){var t,n,i=this._events;return n=i&&(t=i[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[],n},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},r.prototype.listenerCount=l,r.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]};var d,u=new Uint8Array(16);function h(){if(!d&&!(d="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return d(u)}for(var p=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,f=[],g=0;256>g;++g)f.push((g+256).toString(16).substr(1));function v(e,t,n){var i=(e=e||{}).random||(e.rng||h)();if(i[6]=64|15&i[6],i[8]=128|63&i[8],t){n=n||0;for(var r=0;16>r;++r)t[n+r]=i[r];return t}return function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=(f[e[t+0]]+f[e[t+1]]+f[e[t+2]]+f[e[t+3]]+"-"+f[e[t+4]]+f[e[t+5]]+"-"+f[e[t+6]]+f[e[t+7]]+"-"+f[e[t+8]]+f[e[t+9]]+"-"+f[e[t+10]]+f[e[t+11]]+f[e[t+12]]+f[e[t+13]]+f[e[t+14]]+f[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&p.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n}(i)}function m(e,t){if(!e||!t)return{};const n={...e};if(n.localCandidateId){const e=t.get(n.localCandidateId);n.local={...e}}if(n.remoteCandidateId){const e=t.get(n.remoteCandidateId);n.remote={...e}}return n}function b(e,t,n){return 8*function(e,t,n){const i=e[n],r=t?t[n]:null;return null===i||null===r?null:(i-r)/(e.timestamp-t.timestamp)*1e3}(e,t,n)}function y(e){if(!e.entries)return e;const t={};return e.forEach(function(e,n){t[n]=e}),t}function w(e,t,n={}){if(!e)return null;let i={audio:{inbound:[],outbound:[]},video:{inbound:[],outbound:[]},connection:{inbound:[],outbound:[]}};n.remote&&(i.remote={audio:{inbound:[],outbound:[]},video:{inbound:[],outbound:[]}});for(const t of e.values())switch(t.type){case"outbound-rtp":{const n=t.mediaType||t.kind,r={};let o={};if(!["audio","video"].includes(n))continue;if(t.codecId){const n=e.get(t.codecId);n&&(r.clockRate=n.clockRate,r.mimeType=n.mimeType,r.payloadType=n.payloadType)}o=e.get(t.mediaSourceId)||e.get(t.trackId)||{},i[n].outbound.push({...t,...r,track:{...o}});break}case"inbound-rtp":{let n=t.mediaType||t.kind,r={};const o={};if(!["audio","video"].includes(n))if(t.id.includes("Video"))n="video";else{if(!t.id.includes("Audio"))continue;n="audio"}if(t.codecId){const n=e.get(t.codecId);n&&(o.clockRate=n.clockRate,o.mimeType=n.mimeType,o.payloadType=n.payloadType)}if(!i.connection.id&&t.transportId){const n=e.get(t.transportId);if(n&&n.selectedCandidatePairId){const t=e.get(n.selectedCandidatePairId);i.connection=m(t,e)}}r=e.get(t.mediaSourceId)||e.get(t.trackId)||{},i[n].inbound.push({...t,...o,track:{...r}});break}case"peer-connection":i.connection.dataChannelsClosed=t.dataChannelsClosed,i.connection.dataChannelsOpened=t.dataChannelsOpened;break;case"remote-inbound-rtp":{if(!n.remote)break;let r=t.mediaType||t.kind;const o={};if(!["audio","video"].includes(r))if(t.id.includes("Video"))r="video";else{if(!t.id.includes("Audio"))continue;r="audio"}if(t.codecId){const n=e.get(t.codecId);n&&(o.clockRate=n.clockRate,o.mimeType=n.mimeType,o.payloadType=n.payloadType)}if(!i.connection.id&&t.transportId){const n=e.get(t.transportId);if(n&&n.selectedCandidatePairId){const t=e.get(n.selectedCandidatePairId);i.connection=m(t,e)}}i.remote[r].inbound.push({...t,...o});break}case"remote-outbound-rtp":{if(!n.remote)break;const r=t.mediaType||t.kind,o={};if(!["audio","video"].includes(r))continue;if(t.codecId){const n=e.get(t.codecId);n&&(o.clockRate=n.clockRate,o.mimeType=n.mimeType,o.payloadType=n.payloadType)}i.remote[r].outbound.push({...t,...o});break}}if(!i.connection.id)for(const t of e.values())"candidate-pair"===t.type&&t.nominated&&"succeeded"===t.state&&(i.connection=m(t,e));return i=function(e,t){return t?(e.audio.inbound.map(e=>{let n=t.audio.inbound.find(t=>t.id===e.id);e.bitrate=b(e,n,"bytesReceived"),e.packetRate=b(e,n,"packetsReceived")}),e.audio.outbound.map(e=>{let n=t.audio.outbound.find(t=>t.id===e.id);e.bitrate=b(e,n,"bytesSent"),e.packetRate=b(e,n,"packetsSent")}),e.video.inbound.map(e=>{let n=t.video.inbound.find(t=>t.id===e.id);e.bitrate=b(e,n,"bytesReceived"),e.packetRate=b(e,n,"packetsReceived")}),e.video.outbound.map(e=>{let n=t.video.outbound.find(t=>t.id===e.id);e.bitrate=b(e,n,"bytesSent"),e.packetRate=b(e,n,"packetsSent")}),e):e}(i,t),i}let k,_={},S=[];t.WebRTCStats=class extends r{constructor(e){if(super(),this.monitoringSetInterval=0,this.connectionMonitoringSetInterval=0,this.connectionMonitoringInterval=1e3,this.remote=!0,this.peersToMonitor={},this.timeline=[],this.statsToMonitor=["inbound-rtp","outbound-rtp","remote-inbound-rtp","remote-outbound-rtp","peer-connection","data-channel","stream","track","sender","receiver","transport","candidate-pair","local-candidate","remote-candidate"],"undefined"==typeof window)throw new Error("WebRTCStats only works in browser");const t={...e};this.isEdge=!!window.RTCIceGatherer,this.getStatsInterval=t.getStatsInterval||1e3,this.rawStats=!!t.rawStats,this.statsObject=!!t.statsObject,this.filteredStats=!!t.filteredStats,this.shouldWrapGetUserMedia=!!t.wrapGetUserMedia,"boolean"==typeof t.remote&&(this.remote=t.remote),this.debug=!!t.debug,this.logLevel=t.logLevel||"none",this.shouldWrapGetUserMedia&&this.wrapGetUserMedia()}async addPeer(e,t){return console.warn("The addPeer() method has been deprecated, please use addConnection()"),this.addConnection({peerId:e,pc:t})}async addConnection(e){const{pc:t,peerId:n}=e;let{connectionId:i,remote:r}=e;if(r="boolean"==typeof r?r:this.remote,!(t&&t instanceof RTCPeerConnection))throw new Error("Missing argument 'pc' or is not of instance RTCPeerConnection");if(!n)throw new Error("Missing argument peerId");if(this.isEdge)throw new Error("Can't monitor peers in Edge at this time.");if(this.peersToMonitor[n]){if(i&&i in this.peersToMonitor[n])throw new Error(`We are already monitoring connection with id ${i}.`);for(let e in this.peersToMonitor[n]){const i=this.peersToMonitor[n][e];if(i.pc===t)throw new Error(`We are already monitoring peer with id ${n}.`);"closed"===i.pc.connectionState&&this.removeConnection({pc:i.pc})}}const o=t.getConfiguration();return o.iceServers&&o.iceServers.forEach(function(e){delete e.credential}),i||(i=v()),this.emitEvent({event:"addConnection",tag:"peer",peerId:n,connectionId:i,data:{options:e,peerConfiguration:o}}),this.monitorPeer({peerId:n,connectionId:i,pc:t,remote:r}),{connectionId:i}}getTimeline(e){return this.timeline=this.timeline.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),e?this.timeline.filter(t=>t.tag===e):this.timeline}get logger(){const e=e=>{const t=["none","error","warn","info","debug"];return t.slice(0,t.indexOf(this.logLevel)+1).indexOf(e)>-1};return{error(...t){this.debug&&e("error")&&console.error("[webrtc-stats][error] ",...t)},warn(...t){this.debug&&e("warn")&&console.warn("[webrtc-stats][warn] ",...t)},info(...t){this.debug&&e("info")&&console.log("[webrtc-stats][info] ",...t)},debug(...t){this.debug&&e("debug")&&console.debug("[webrtc-stats][debug] ",...t)}}}removeConnection(e){let t,{connectionId:n,pc:i}=e;if(!i&&!n)throw new Error("Missing arguments. You need to either send pc or a connectionId.");if(n){if("string"!=typeof n)throw new Error("connectionId must be a string.");for(let e in this.peersToMonitor)n in this.peersToMonitor[e]&&(i=this.peersToMonitor[e][n].pc,t=e)}else if(i){if(!(i instanceof RTCPeerConnection))throw new Error("pc must be an instance of RTCPeerConnection.");for(let e in this.peersToMonitor)for(let r in this.peersToMonitor[e])this.peersToMonitor[e][r].pc===i&&(n=r,t=e)}if(!i||!n)throw new Error("Could not find the desired connection.");return this.removePeerConnectionEventListeners(n,i),delete this.peersToMonitor[t][n],0===Object.values(this.peersToMonitor[t]).length&&delete this.peersToMonitor[t],{connectionId:n}}removeAllPeers(){for(let e in this.peersToMonitor)this.removePeer(e)}removePeer(e){if(this.logger.info(`Removing PeerConnection with id ${e}.`),this.peersToMonitor[e]){for(let t in this.peersToMonitor[e]){let n=this.peersToMonitor[e][t].pc;this.removePeerConnectionEventListeners(t,n)}delete this.peersToMonitor[e]}}destroy(){this.removeAllPeers(),S.forEach(e=>{this.removeTrackEventListeners(e)}),S=[],this.shouldWrapGetUserMedia&&k&&(navigator.mediaDevices.getUserMedia=k)}monitorPeer(e){let{peerId:t,connectionId:n,pc:i,remote:r}=e;if(!i)return void this.logger.warn("Did not receive pc argument when calling monitorPeer()");const o={pc:i,connectionId:n,stream:null,stats:{parsed:null,raw:null},options:{remote:r}};if(this.peersToMonitor[t]){if(n in this.peersToMonitor[t])return void this.logger.warn(`Already watching connection with ID ${n}`);this.peersToMonitor[t][n]=o}else this.peersToMonitor[t]={[n]:o};this.addPeerConnectionEventListeners(t,n,i),1===this.numberOfMonitoredPeers&&(this.startStatsMonitoring(),this.startConnectionStateMonitoring())}startStatsMonitoring(){this.monitoringSetInterval||(this.monitoringSetInterval=window.setInterval(()=>{this.numberOfMonitoredPeers||this.stopStatsMonitoring(),this.getStats().then(e=>{e.forEach(e=>{this.emitEvent(e)})})},this._getStatsInterval))}stopStatsMonitoring(){this.monitoringSetInterval&&(window.clearInterval(this.monitoringSetInterval),this.monitoringSetInterval=0)}async getStats(e=null){this.logger.info(e?`Getting stats from peer ${e}`:"Getting stats from all peers");let t={};if(e){if(!this.peersToMonitor[e])throw new Error(`Cannot get stats. Peer with id ${e} does not exist`);t[e]=this.peersToMonitor[e]}else t=this.peersToMonitor;let n=[];for(const i in t)for(const r in t[i]){const o=t[i][r],a=o.pc;if(a&&!this.checkIfConnectionIsClosed(i,r,a))try{const e=this.getTimestamp(),t=a.getStats(null);if(t){const a=await t,s=this.getTimestamp(),l=y(a),c={remote:o.options.remote},d=w(a,o.stats.parsed,c),u={event:"stats",tag:"stats",peerId:i,connectionId:r,timeTaken:s-e,data:d};!0===this.rawStats&&(u.rawStats=a),!0===this.statsObject&&(u.statsObject=l),!0===this.filteredStats&&(u.filteredStats=this.filteroutStats(l)),n.push(u),o.stats.parsed=d}else this.logger.error(`PeerConnection from peer ${i} did not return any stats data`)}catch(e){this.logger.error(e)}}return n}startConnectionStateMonitoring(){this.connectionMonitoringSetInterval=window.setInterval(()=>{this.numberOfMonitoredPeers||this.stopConnectionStateMonitoring();for(const e in this.peersToMonitor)for(const t in this.peersToMonitor[e]){const n=this.peersToMonitor[e][t].pc;this.checkIfConnectionIsClosed(e,t,n)}},this.connectionMonitoringInterval)}checkIfConnectionIsClosed(e,t,n){const i=this.isConnectionClosed(n);if(i){this.removeConnection({pc:n});let i="closed"===n.connectionState?"onconnectionstatechange":"oniceconnectionstatechange";this.emitEvent({event:i,peerId:e,connectionId:t,tag:"connection",data:"closed"})}return i}isConnectionClosed(e){return"closed"===e.connectionState||"closed"===e.iceConnectionState}stopConnectionStateMonitoring(){this.connectionMonitoringSetInterval&&(window.clearInterval(this.connectionMonitoringSetInterval),this.connectionMonitoringSetInterval=0)}wrapGetUserMedia(){if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)return void this.logger.warn("'navigator.mediaDevices.getUserMedia' is not available in browser. Will not wrap getUserMedia.");this.logger.info("Wrapping getUsermedia functions."),k=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);const e=this.parseGetUserMedia.bind(this);navigator.mediaDevices.getUserMedia=function(){return e({constraints:arguments[0]}),k.apply(navigator.mediaDevices,arguments).then(t=>(e({stream:t}),t),t=>(e({error:t}),Promise.reject(t)))}.bind(navigator.mediaDevices)}filteroutStats(e={}){const t={...e};for(const e in t){var n=t[e];this.statsToMonitor.includes(n.type)||delete t[e]}return t}get peerConnectionListeners(){return{icecandidate:(e,t,n,i)=>{this.logger.debug("[pc-event] icecandidate | peerId: ${peerId}",i),this.emitEvent({event:"onicecandidate",tag:"connection",peerId:e,connectionId:t,data:i.candidate})},track:(e,t,n,i)=>{this.logger.debug(`[pc-event] track | peerId: ${e}`,i);const r=i.track,o=i.streams[0];e in this.peersToMonitor&&t in this.peersToMonitor[e]&&(this.peersToMonitor[e][t].stream=o),this.addTrackEventListeners(r,t),this.emitEvent({event:"ontrack",tag:"track",peerId:e,connectionId:t,data:{stream:o?this.getStreamDetails(o):null,track:r?this.getMediaTrackDetails(r):null,title:i.track.kind+":"+i.track.id+" "+i.streams.map(function(e){return"stream:"+e.id})}})},signalingstatechange:(e,t,n)=>{this.logger.debug(`[pc-event] signalingstatechange | peerId: ${e}`),this.emitEvent({event:"onsignalingstatechange",tag:"connection",peerId:e,connectionId:t,data:{signalingState:n.signalingState,localDescription:n.localDescription,remoteDescription:n.remoteDescription}})},iceconnectionstatechange:(e,t,n)=>{this.logger.debug(`[pc-event] iceconnectionstatechange | peerId: ${e}`),this.emitEvent({event:"oniceconnectionstatechange",tag:"connection",peerId:e,connectionId:t,data:n.iceConnectionState})},icegatheringstatechange:(e,t,n)=>{this.logger.debug(`[pc-event] icegatheringstatechange | peerId: ${e}`),this.emitEvent({event:"onicegatheringstatechange",tag:"connection",peerId:e,connectionId:t,data:n.iceGatheringState})},icecandidateerror:(e,t,n,i)=>{this.logger.debug(`[pc-event] icecandidateerror | peerId: ${e}`),this.emitEvent({event:"onicecandidateerror",tag:"connection",peerId:e,connectionId:t,error:{errorCode:i.errorCode}})},connectionstatechange:(e,t,n)=>{this.logger.debug(`[pc-event] connectionstatechange | peerId: ${e}`),this.emitEvent({event:"onconnectionstatechange",tag:"connection",peerId:e,connectionId:t,data:n.connectionState})},negotiationneeded:(e,t,n)=>{this.logger.debug(`[pc-event] negotiationneeded | peerId: ${e}`),this.emitEvent({event:"onnegotiationneeded",tag:"connection",peerId:e,connectionId:t})},datachannel:(e,t,n,i)=>{this.logger.debug(`[pc-event] datachannel | peerId: ${e}`,i),this.emitEvent({event:"ondatachannel",tag:"datachannel",peerId:e,connectionId:t,data:i.channel})}}}addPeerConnectionEventListeners(e,t,n){this.logger.debug(`Adding event listeners for peer ${e} and connection ${t}.`),_[t]={},Object.keys(this.peerConnectionListeners).forEach(i=>{_[t][i]=this.peerConnectionListeners[i].bind(this,e,t,n),n.addEventListener(i,_[t][i],!1)})}parseGetUserMedia(e){try{const t={event:"getUserMedia",tag:"getUserMedia",data:{...e}};e.stream&&(t.data.details=this.parseStream(e.stream),e.stream.getTracks().map(e=>{this.addTrackEventListeners(e),S.push(e)})),this.emitEvent(t)}catch(e){}}parseStream(e){const t={audio:[],video:[]};return e.getTracks().forEach(e=>{t[e.kind].push(this.getMediaTrackDetails(e))}),t}getMediaTrackDetails(e){return{enabled:e.enabled,id:e.id,contentHint:e.contentHint,kind:e.kind,label:e.label,muted:e.muted,readyState:e.readyState,constructorName:e.constructor.name,capabilities:e.getCapabilities?e.getCapabilities():{},constraints:e.getConstraints?e.getConstraints():{},settings:e.getSettings?e.getSettings():{},_track:e}}getStreamDetails(e){return{active:e.active,id:e.id,_stream:e}}getTrackEventObject(e){return{mute:t=>{this.emitEvent({event:"mute",tag:"track",connectionId:e,data:{event:t}})},unmute:t=>{this.emitEvent({event:"unmute",tag:"track",connectionId:e,data:{event:t}})},overconstrained:t=>{this.emitEvent({event:"overconstrained",tag:"track",connectionId:e,data:{event:t}})},ended:t=>{this.emitEvent({event:"ended",tag:"track",connectionId:e,data:{event:t}}),this.removeTrackEventListeners(t.target)}}}addTrackEventListeners(e,t){_[e.id]={};const n=this.getTrackEventObject(t);Object.keys(n).forEach(t=>{_[e.id][t]=n[t].bind(this),e.addEventListener(t,_[e.id][t])}),_[e.id].readyState=setInterval(()=>{if("ended"===e.readyState){let t=new CustomEvent("ended",{detail:{check:"readyState"}});e.dispatchEvent(t)}},1e3)}removeTrackEventListeners(e){if(e.id in _){const t=this.getTrackEventObject();Object.keys(t).forEach(t=>{e.removeEventListener(t,_[e.id][t])}),clearInterval(_[e.id].readyState),delete _[e.id]}}addToTimeline(e){this.timeline.push(e),this.emit("timeline",e)}emitEvent(e){const t={...e,timestamp:new Date};this.addToTimeline(t),t.tag&&this.emit(t.tag,t)}set getStatsInterval(e){if(!Number.isInteger(e))throw new Error(`getStatsInterval should be an integer, got: ${e}`);this._getStatsInterval=e,this.monitoringSetInterval&&(this.stopStatsMonitoring(),this.startStatsMonitoring())}get numberOfMonitoredPeers(){return Object.keys(this.peersToMonitor).length}removePeerConnectionEventListeners(e,t){e in _&&(Object.keys(this.peerConnectionListeners).forEach(n=>{t.removeEventListener(n,_[e][n],!1)}),delete _[e]),t.getSenders().forEach(e=>{e.track&&this.removeTrackEventListeners(e.track)}),t.getReceivers().forEach(e=>{e.track&&this.removeTrackEventListeners(e.track)})}getTimestamp(){return Date.now()}wrapGetDisplayMedia(){const e=this;if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia){const t=navigator.mediaDevices.getDisplayMedia.bind(navigator.mediaDevices),n=function(){return e.debug("navigator.mediaDevices.getDisplayMedia",null,arguments[0]),t.apply(navigator.mediaDevices,arguments).then(function(e){return e},function(t){return e.debug("navigator.mediaDevices.getDisplayMediaOnFailure",null,t.name),Promise.reject(t)})};navigator.mediaDevices.getDisplayMedia=n.bind(navigator.mediaDevices)}}}});(Ti=Ri)&&Ti.__esModule&&Object.prototype.hasOwnProperty.call(Ti,"default")&&Ti.default;var Ni=Ri.WebRTCStats;function Oi(e){return isNaN(e)?null:e>4.2?"excellent":e>=4.1&&e<=4.2?"good":e>=3.7&&e<=4?"fair":e>=3.1&&e<=3.6?"poor":"bad"}class Ai extends Rn{constructor(e,t){super(),this.buildRequest({type:"debug_report_start",debug_report_id:e,debug_report_version:1,call_id:t})}}class Li extends Rn{constructor(e,t){super(),this.buildRequest({type:"debug_report_stop",debug_report_id:e,debug_report_version:1,call_id:t})}}class Di extends Rn{constructor(e,t,n){super(),this.buildRequest({type:"debug_report_data",debug_report_id:e,debug_report_version:1,call_id:t,debug_report_data:n})}}const Pi=(e,t)=>{const{contentType:n,canvasType:i,callID:r,canvasInfo:o=null,currentLayerIdx:a=-1}=t;o&&"mcu-personal-canvas"!==i&&delete o.memberID;const s={type:cn.conferenceUpdate,call:e.calls[r],canvasInfo:Mi(o),currentLayerIdx:a};switch(n){case"layer-info":{const t=Object.assign({action:fn.LayerInfo},s);Cn(ut.Notification,t,e.uuid);break}case"layout-info":{const t=Object.assign({action:fn.LayoutInfo},s);Cn(ut.Notification,t,e.uuid);break}}},Mi=e=>{const t=JSON.stringify(e).replace(/memberID/g,"participantId").replace(/ID"/g,'Id"').replace(/POS"/g,'Pos"');return Lt(t)},Fi=["new-call-start","new-peer","get-user-media","peer-creation-end","start-negotiation","create-offer","create-answer","set-local-description","ice-gathering-started","first-candidate","first-non-host-candidate","send-sdp","ice-gathering-completed","ringing","telnyx-rtc-media","first-remote-media-track","set-remote-description","telnyx-rtc-answer","ice-connected","dtls-connected","call-active","answer-called"],ji={"new-call-start":"Call Start","new-peer":"Peer object created","get-user-media":"Media devices acquired","peer-creation-end":"Peer setup complete","start-negotiation":"SDP negotiation started","create-offer":"SDP offer generated","create-answer":"SDP answer generated","set-local-description":"Local description applied","ice-gathering-started":"ICE candidate gathering started","first-candidate":"First ICE candidate found","first-non-host-candidate":"First server-reflexive/relay candidate found","send-sdp":"SDP sent to server","ice-gathering-completed":"All ICE candidates gathered",ringing:"Remote side ringing","telnyx-rtc-media":"Early media received from server","first-remote-media-track":"First remote audio/video track received","set-remote-description":"Remote description applied","telnyx-rtc-answer":"Call answered by remote side","ice-connected":"ICE connection established","dtls-connected":"Secure media channel established (DTLS)","call-active":"Call is active","answer-called":"Answer delay (invite → call.answer)"};function zi(e,t){return`telnyx:call:${e}:${t}`}function Ui(e){try{const t=performance.getEntriesByName(e,"mark");return t.length>0?t[0].startTime:void 0}catch(e){return}}function $i(e,t,n){const i=Ui(zi(e,"new-call-start"));if(void 0===i)return{mode:t,direction:n,steps:[]};const r=[];for(const t of Fi){if("new-call-start"===t)continue;const n=Ui(zi(e,t));void 0!==n&&r.push({label:ji[t]||t,fromStart:n-i})}r.sort((e,t)=>e.fromStart-t.fromStart);const o=[];let a=0;for(const e of r)o.push({label:e.label,fromStart:e.fromStart,delta:e.fromStart-a}),a=e.fromStart;return{mode:t,direction:n,steps:o}}function Bi(e){for(const t of Fi)try{performance.clearMarks(zi(e,t))}catch(e){It.warn("Clearing performance marks is failed")}}class Hi{constructor(e,t,n,i,r){this.type=e,this.options=t,this.statsReporter=null,this.isIceRestarting=!1,this.iceDone=!1,this._negotiating=!1,this._prevConnectionState=null,this._restartedIceOnConnectionStateFailed=!1,this._sleepWakeupIntervalId=null,this._iceGatheringSafetyTimeout=null,this._gatheredCandidatesCount=0,this._firstMediaTrackMarked=!1,this._timingsCollected=!1,this._iceRestartTimeoutId=null,this.handleConnectionStateChange=()=>Z(this,void 0,void 0,function*(){var e,t;if(!this.instance)return void It.debug("Connection state change ignored: instance is null");const{connectionState:n}=this.instance;if(It.info(`[${(new Date).toISOString()}] Connection State changed: ${this._prevConnectionState} -> ${n}`),"failed"!==n&&"disconnected"!==n||(this.isDebugEnabled&&this.statsReporter&&function(e,t){return Z(this,void 0,void 0,function*(){const n={connectionState:e.connectionState,previousConnectionState:t,iceConnectionState:e.iceConnectionState,iceGatheringState:e.iceGatheringState,signalingState:e.signalingState},i=e.getTransceivers();if(i.length>0){const e=i[0].sender,t=null==e?void 0:e.transport;t&&(n.dtlsState=t.state)}e.sctp&&(n.sctpState=e.sctp.state);try{const t=yield e.getStats();t.forEach(e=>{"candidate-pair"===e.type&&"succeeded"===e.state&&(n.candidatePairState=e.state,t.forEach(t=>{"local-candidate"===t.type&&t.id===e.localCandidateId&&(n.localCandidateType=t.candidateType,n.selectedCandidatePair=n.selectedCandidatePair||{local:{},remote:{}},n.selectedCandidatePair.local={address:t.address,port:t.port,protocol:t.protocol,candidateType:t.candidateType}),"remote-candidate"===t.type&&t.id===e.remoteCandidateId&&(n.remoteCandidateType=t.candidateType,n.selectedCandidatePair=n.selectedCandidatePair||{local:{},remote:{}},n.selectedCandidatePair.remote={address:t.address,port:t.port,protocol:t.protocol,candidateType:t.candidateType})})),"transport"===e.type&&(n.dtlsCipher=e.dtlsCipher,n.srtpCipher=e.srtpCipher,n.tlsVersion=e.tlsVersion,e.dtlsState&&(n.dtlsState=e.dtlsState))})}catch(e){It.error("Error gathering connection state details:",e)}return n})}(this.instance,this._prevConnectionState).then(e=>{this.statsReporter.reportConnectionStateChange(e)}),null===(t=(e=this._session).reportPeerFailure)||void 0===t||t.call(e,this.options.id,"connection_failed")),"disconnected"===n){const e=gt($e);Cn(ut.Warning,{warning:e,callId:this.options.id,sessionId:this._session.sessionid},this.options.id)}if("failed"===n){const e=gt(We);Cn(ut.PeerConnectionFailureError,{warning:e,error:new Error(`Peer Connection failed. previous state: ${this._prevConnectionState}, current state: ${n}`),sessionId:this._session.sessionid},this.options.id)}this._prevConnectionState=n,"connected"===n&&(performance.mark(zi(this.options.id,"dtls-connected")),this.tryCollectTimings(),this._restartedIceOnConnectionStateFailed=!1),this._isTrickleIce()&&("connecting"===n&&performance.mark(zi(this.options.id,"peer-connection-connecting")),"connected"===n&&(this._clearIceGatheringSafetyTimeout(),performance.mark(zi(this.options.id,"peer-connection-connected"))))}),this._handleIceConnectionStateChange=()=>{var e,t;if(!this.instance)return void It.debug("ICE connection state change ignored: instance is null");const n=this.instance.iceConnectionState;It.debug(`[${(new Date).toISOString()}] ICE Connection State`,n),"connected"===n&&performance.mark(zi(this.options.id,"ice-connected")),"failed"===n&&(null===(t=(e=this._session).reportPeerFailure)||void 0===t||t.call(e,this.options.id,"ice_failed"))},this._handleIceGatheringStateChange=()=>{const e=this.instance.iceGatheringState;It.debug(`[${(new Date).toISOString()}] ICE Gathering State`,e),"gathering"===e?(this._gatheredCandidatesCount=0,this._startIceGatheringSafetyTimeout()):"complete"===e&&this._clearIceGatheringSafetyTimeout()},this._setCodecs=(e,t)=>{if(e.setCodecPreferences)return e.setCodecPreferences(t)},It.debug("New Peer with type:",this.type,"Options:",this.options),this._constraints={offerToReceiveAudio:!0,offerToReceiveVideo:!!t.video},this.handleSignalingStateChangeEvent=this.handleSignalingStateChangeEvent.bind(this),this.handleNegotiationNeededEvent=this.handleNegotiationNeededEvent.bind(this),this.handleTrackEvent=this.handleTrackEvent.bind(this),this.createPeerConnection=this.createPeerConnection.bind(this),this._session=n,this._trickleIceSdpFn=i,this._registerPeerEvents=r}finishIceRestart(){this.isIceRestarting&&(this.isIceRestarting=!1,this._iceRestartTimeoutId&&(clearTimeout(this._iceRestartTimeoutId),this._iceRestartTimeoutId=null))}restartIce(){return this.instance?this.isIceRestarting?(It.debug("ICE restart: already in progress, skipping"),{started:!1,reason:"already in progress"}):this._session.connected?(this.isIceRestarting=!0,this._restartedIceOnConnectionStateFailed=!0,this.instance.restartIce(),this.iceDone=!1,this._iceRestartTimeoutId=setTimeout(()=>{this.isIceRestarting&&(It.warn("ICE restart: Modify exchange timed out, clearing isIceRestarting flag"),this.isIceRestarting=!1),this._iceRestartTimeoutId=null},Hi.ICE_RESTART_TIMEOUT_MS),It.info("ICE restart: initiated by signaling health monitor"),{started:!0}):(It.debug("ICE restart: session not connected, skipping"),{started:!1,reason:"session not connected"}):(It.warn("ICE restart: no RTCPeerConnection instance"),{started:!1,reason:"no RTCPeerConnection instance"})}get isOffer(){return this.type===an.Offer}get isAnswer(){return this.type===an.Answer}get isDebugEnabled(){return this.options.debug||this._session.options.debug}get debugOutput(){return this.options.debugOutput||this._session.options.debugOutput}get restartedIceOnConnectionStateFailed(){return this._restartedIceOnConnectionStateFailed}get callEstablishmentTimings(){return this._callEstablishmentTimings}isConnectionHealthy(){return!!this.instance&&"connected"===this.instance.connectionState&&"connected"===this.instance.iceConnectionState&&"closed"!==this.instance.signalingState}startNegotiation(){performance.mark(zi(this.options.id,"start-negotiation")),this._negotiating=!0,this._isOffer()||this.isIceRestarting?this._createOffer().catch(e=>this._emitNegotiationError(e)):this._createAnswer().catch(e=>this._emitNegotiationError(e))}startTrickleIceNegotiation(){return Z(this,void 0,void 0,function*(){performance.mark(zi(this.options.id,"start-negotiation")),this._negotiating=!0,this._isOffer()||this.isIceRestarting?yield this._createOffer().then(this._trickleIceSdpFn.bind(this)):yield this._createAnswer().then(this._trickleIceSdpFn.bind(this))})}_emitNegotiationError(e){e instanceof vt&&Cn(ut.Error,{error:e,sessionId:this._session.sessionid},this.options.id)}_logTransceivers(){this.instance?(It.info("Number of transceivers:",this.instance.getTransceivers().length),this.instance.getTransceivers().forEach((e,t)=>{It.info(`>> Transceiver [${t}]:`,e.mid,e.direction,e.stopped),It.info(`>> Sender Params [${t}]:`,JSON.stringify(e.sender.getParameters(),null,2))})):It.warn("Cannot log transceivers: peer connection is null")}handleSignalingStateChangeEvent(){switch(It.info("signalingState:",this.instance.signalingState),this.instance.signalingState){case"stable":this._negotiating=!1;break;case"closed":Cn(ut.PeerConnectionSignalingStateClosed,{sessionId:this._session.sessionid},this.options.id),this.instance&&(It.debug(`[${this.options.id}] Closing peer due to signalingState closed`),this.close());break;default:this._negotiating=!0}}handleNegotiationNeededEvent(){It.info("Negotiation needed event"),"stable"!==this.instance.signalingState||this._negotiating?It.debug("Skipping negotiation, state:",this.instance.signalingState,"negotiating:",this._negotiating):this._isTrickleIce()?this.startTrickleIceNegotiation().catch(e=>this._emitNegotiationError(e)):this.startNegotiation()}handleTrackEvent(e){var t;this._firstMediaTrackMarked||(performance.mark(zi(this.options.id,"first-remote-media-track")),this._firstMediaTrackMarked=!0);const{streams:[n]}=e,{remoteElement:i,screenShare:r}=this.options;if(this.options.remoteStream=n,!1===r){const n=ti(i,this.options.remoteStream,{callId:this.options.id,sessionId:this._session.sessionid,eventTarget:this._session.uuid});"audio"===(null===(t=e.track)||void 0===t?void 0:t.kind)&&(n instanceof Promise?n.then(e=>this._warnIfRemoteElementUnresolved(e)):this._warnIfRemoteElementUnresolved(n))}}_warnIfRemoteElementUnresolved(e){const t=null!=this._session.remoteElementId&&null==this._session.remoteElement;if(null===e&&(null!=this.options.remoteElement||t)&&!this._session.markMissingRemoteAudioElementWarned(this.options.id)){const e=gt(Xe);Cn(ut.Warning,{warning:e,callId:this.options.id,sessionId:this._session.sessionid},this._session.uuid)}}tryCollectTimings(){if(this._timingsCollected)return;if(!(performance.getEntriesByName(zi(this.options.id,"call-active"),"mark").length>0)||"connected"!==this.instance.connectionState)return;this._timingsCollected=!0;const e=this._isTrickleIce()?"trickle":"non-trickle",t=this.isOffer?"outbound":"inbound",n=$i(this.options.id,e,t);this._callEstablishmentTimings=n,function(e){const{mode:t,direction:n,steps:i}=e,r=`[CallTimings][${n}][${t}]`;if(0===i.length)return void It.info(`${r} No timing data collected`);const o=Math.max(...i.map(e=>e.label.length),4)+2,a=(e,t)=>{for(;e.length<t;)e+=" ";return e},s=(e,t)=>{for(;e.length<t;)e=" "+e;return e},l=a("Step",o)+s("Delta",14)+s("From Start",14);let c="";for(let e=0;e<l.length;e++)c+="-";It.info(`${r} Call establishment timing breakdown:`),It.info(`${r} ${l}`),It.info(`${r} ${c}`),It.info(`${r} ${a("Call Start",o)}${s("-",14)}${s("0.00ms",14)}`);for(const e of i){const t=e.delta.toFixed(2)+"ms",n=e.fromStart.toFixed(2)+"ms";It.info(`${r} ${a(e.label,o)}${s(t,14)}${s(n,14)}`)}It.info(`${r} ${c}`)}(n),Bi(this.options.id)}createPeerConnection(){return Z(this,void 0,void 0,function*(){var e;if(this.instance=(e=this._config(),new window.RTCPeerConnection(e)),this.instance.onsignalingstatechange=this.handleSignalingStateChangeEvent,this.instance.onnegotiationneeded=this.handleNegotiationNeededEvent,this.instance.ontrack=this.handleTrackEvent,this.instance.addEventListener("connectionstatechange",this.handleConnectionStateChange),this.instance.addEventListener("iceconnectionstatechange",this._handleIceConnectionStateChange),this.instance.addEventListener("icegatheringstatechange",this._handleIceGatheringStateChange),this.instance.addEventListener("addstream",e=>{this.options.remoteStream=e.stream}),this._registerPeerEvents(this.instance),this._prevConnectionState=this.instance.connectionState,this.isAnswer&&(yield this._setRemoteDescription({sdp:this.options.remoteSdp,type:an.Offer}),performance.mark(zi(this.options.id,"set-remote-description")),!this.instance))throw bt(ye);const t=Boolean(this.options.receiveOnlyAudio)&&!this.options.audio;let n=null;if(this.options.localStream=yield this._retrieveLocalStream().catch(e=>Z(this,void 0,void 0,function*(){const t=this._session.options.mediaPermissionsRecovery;if((null==t?void 0:t.enabled)&&this._isAnswer()){let i=null,r=null;return yield new Promise((n,i)=>{r=setTimeout(()=>i(new Error("Media recovery flow timed out!")),t.timeout),Cn(ut.Error,{error:bt(mt(e),e,void 0,!1),callId:this.options.id,sessionId:this._session.sessionid,recoverable:!0,retryDeadline:Date.now()+t.timeout,resume:()=>{n()},reject:()=>{i(new Error("Call was rejected during media recovery flow!"))}},this._session.uuid)}).then(()=>Z(this,void 0,void 0,function*(){var e;r&&(clearTimeout(r),r=null),i=yield this._retrieveLocalStream(),null===(e=t.onSuccess)||void 0===e||e.call(t)})).catch(e=>{var i;r&&(clearTimeout(r),r=null),n=e,null===(i=t.onError)||void 0===i||i.call(t,e)}),i}return n=e,null})),!this.instance)throw bt(ye);if(!this.options.localStream&&!t)throw bt(n?mt(n):pe,null!=n?n:void 0);performance.mark(zi(this.options.id,"get-user-media")),this.options.mutedMicOnStart&&ei(this.options.localStream)&&(It.info("Muting local audio tracks on start"),vi(this.options.localStream)),this.options.applyDesiredAudioMuteState&&this.options.applyDesiredAudioMuteState(),performance.mark(zi(this.options.id,"peer-creation-end"))})}incrementGatheredCandidates(){this._gatheredCandidatesCount++}_startIceGatheringSafetyTimeout(){this._clearIceGatheringSafetyTimeout(),this._iceGatheringSafetyTimeout=setTimeout(()=>{if(this.instance)if(0===this._gatheredCandidatesCount){const e=gt(He);Cn(ut.Warning,{warning:e,callId:this.options.id,sessionId:this._session.sessionid},this.options.id)}else if("complete"!==this.instance.iceGatheringState){const e=gt(Be);Cn(ut.Warning,{warning:e,callId:this.options.id,sessionId:this._session.sessionid},this.options.id)}},Hi.ICE_GATHERING_SAFETY_TIMEOUT_MS)}_clearIceGatheringSafetyTimeout(){null!==this._iceGatheringSafetyTimeout&&(clearTimeout(this._iceGatheringSafetyTimeout),this._iceGatheringSafetyTimeout=null)}init(){var e;return Z(this,void 0,void 0,function*(){if(yield this.createPeerConnection(),!this.instance)throw bt(ye);this.isDebugEnabled&&(this.statsReporter=function(e,t){const n=oe();let i=!1;const r=new Ni({getStatsInterval:1e3,rawStats:!1,statsObject:!0,filteredStats:!1,remote:!0,debug:!1,logLevel:"warn"}),o=i=>Z(this,void 0,void 0,function*(){"stats"===i.event&&Cn(ut.StatsFrame,function({data:e}){var t,n,i,r,o,a,s,l;const{audio:c,remote:d}=e,{audio:u}=d,h=null!==(n=null===(t=u.inbound[0])||void 0===t?void 0:t.jitter)&&void 0!==n?n:1/0,p=null!==(r=null===(i=u.inbound[0])||void 0===i?void 0:i.roundTripTime)&&void 0!==r?r:1/0,f=null!==(a=null===(o=c.inbound[0])||void 0===o?void 0:o.packetsReceived)&&void 0!==a?a:-1,g=function(e){const{packetsLost:t,packetsReceived:n,jitter:i,rtt:r}=e,o=function(e){const{jitter:t,rtt:n}=e,i=t+n/2;return.024*i+.11*(i-177.3)*(i>177.3?1:0)}({rtt:r,jitter:i}),a=function(e){const{packetsLost:t,packetsReceived:n}=e,i=t/(n+t)*100;return 20*Math.log(1+i)}({packetsLost:t,packetsReceived:n}),s=93.2-o-a+0,l=1+.035*s+7e-6*s*(s-60)*(100-s);return Math.min(Math.max(l,1),5)}({jitter:1e3*h,rtt:1e3*p,packetsLost:null!==(l=null===(s=c.inbound[0])||void 0===s?void 0:s.packetsLost)&&void 0!==l?l:-1,packetsReceived:f});return{jitter:h,rtt:p,mos:g,quality:Oi(g),inboundAudio:c.inbound[0],outboundAudio:c.outbound[0],remoteInboundAudio:u.inbound[0],remoteOutboundAudio:u.outbound[0]}}(i),e.uuid),yield e.execute(new Di(n,t,i))});return{get isRunning(){return i},start:(a,s,l)=>Z(this,void 0,void 0,function*(){if(i)It.debug(`[${t}] Stats reporter already running, skipping start`);else{yield e.execute(new Ai(n,t)),r.on("timeline",o);try{yield r.addConnection({pc:a,peerId:s,connectionId:l}),i=!0}catch(e){It.error(`[${t}] Failed to start stats reporter:`,e),r.removeAllPeers(),r.destroy()}}}),stop:o=>Z(this,void 0,void 0,function*(){const a=r.getTimeline();Cn(ut.StatsReport,a,e.uuid),"file"===o&&function(e,t){const n=new Blob([JSON.stringify(e)],{type:"application/json"}),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download=`${t}.json`,r.click(),URL.revokeObjectURL(i)}(a,`webrtc-stats-${n}-${Date.now()}`),yield e.execute(new Li(n,t)),r.removeAllPeers(),r.destroy(),i=!1}),reportConnectionStateChange:e=>{const t={event:"connectionstatechange-detailed",tag:"connection",timestamp:(new Date).toISOString(),data:e};o(t)},reportIceCandidateError:e=>{const t={event:"icecandidateerror-detailed",tag:"connection",timestamp:(new Date).toISOString(),data:e};o(t)}}}(this._session,this.options.id),yield null===(e=this.statsReporter)||void 0===e?void 0:e.start(this.instance,this._session.sessionid,this._session.sessionid));const{localElement:t,localStream:n=null,screenShare:i=!1}=this.options;if(ei(n)){const e=n.getAudioTracks();let r=[...e];if(It.info("Local audio tracks: ",e),"object"==typeof this.options.audio&&e.forEach(e=>{It.info("Local audio tracks constraints: ",e.getConstraints())}),this.options.video){const t=n.getVideoTracks();r=[...e,...t],It.info("Local video tracks: ",t),"object"==typeof this.options.video&&t.forEach(e=>{It.info("Local video tracks constraints: ",e.getConstraints())})}const{audioCodecs:o,videoCodecs:a}=ki(this.options.preferred_codecs),s=(t,i,o)=>{var a,s,l;const c=null===(s=(a=this.instance).getTransceivers)||void 0===s?void 0:s.call(a);It.debug(t,{callId:this.options.id,streamId:n.id,isOffer:this.isOffer,audioTracksLength:e.length,tracksLength:r.length,tracks:r.map(di),trackIndex:o,track:di(i),transceiversLength:null!==(l=null==c?void 0:c.length)&&void 0!==l?l:null,transceivers:null==c?void 0:c.map(e=>({mid:e.mid,direction:e.direction,currentDirection:e.currentDirection,senderTrack:di(e.sender.track),receiverTrack:di(e.receiver.track)}))})};if(this.isOffer&&"function"==typeof this.instance.addTransceiver){s("Attaching local tracks using addTransceiver");const e={direction:"sendrecv",streams:[n]};r.forEach((t,n)=>{"audio"===t.kind&&(this.options.userVariables.microphoneLabel=t.label),"video"===t.kind&&(this.options.userVariables.cameraLabel=t.label),s("Before addTransceiver",t,n);const i=this.instance.addTransceiver(t,e);s("After addTransceiver",t,n),"audio"===t.kind&&o.length>0&&this._setCodecs(i,o),"video"===t.kind&&a.length>0&&this._setCodecs(i,a)})}else"function"==typeof this.instance.addTrack?(s("Attaching local tracks using addTrack"),r.forEach((e,t)=>{"audio"===e.kind&&(this.options.userVariables.microphoneLabel=e.label),"video"===e.kind&&(this.options.userVariables.cameraLabel=e.label),s("Before addTrack",e,t),this.instance.addTrack(e,n),s("After addTrack",e,t)}),this.instance.getTransceivers().forEach(e=>{"audio"===e.receiver.track.kind&&o.length>0&&this._setCodecs(e,o),"video"===e.receiver.track.kind&&a.length>0&&this._setCodecs(e,a)})):(s("Attaching local stream using legacy addStream"),this.instance.addStream(n),s("After legacy addStream"));!1===i&&ti(t,n)}else if(this.options.receiveOnlyAudio&&"function"==typeof this.instance.addTransceiver){const e=this.instance.addTransceiver("audio",{direction:"recvonly"});It.info("Added recvonly audio transceiver for receive-only mode",e);const{audioCodecs:t}=ki(this.options.preferred_codecs);t.length>0&&this._setCodecs(e,t)}this.isOffer?(this.options.negotiateAudio&&this._checkMediaToNegotiate("audio"),this.options.negotiateVideo&&this._checkMediaToNegotiate("video")):this._isTrickleIce()||this.startNegotiation(),this._isTrickleIce()&&this.startTrickleIceNegotiation().catch(e=>this._emitNegotiationError(e)),this._logTransceivers()})}_getSenderByKind(e){return this.instance.getSenders().find(({track:t})=>t&&t.kind===e)}_checkMediaToNegotiate(e){if(!this._getSenderByKind(e)){const t=this.instance.addTransceiver(e);It.info("Add transceiver",e,t)}}_createOffer(){return Z(this,void 0,void 0,function*(){if(this._isOffer()||this.isIceRestarting){this._constraints.offerToReceiveAudio=!1!==this.options.audio||Boolean(this.options.receiveOnlyAudio),this._constraints.offerToReceiveVideo=Boolean(this.options.video),It.info("_createOffer - this._constraints",this._constraints);try{const e=yield this.instance.createOffer(this._constraints);return performance.mark(zi(this.options.id,"create-offer")),yield this._setLocalDescription(e),performance.mark(zi(this.options.id,"set-local-description")),performance.mark(zi(this.options.id,"ice-gathering-started")),e}catch(e){if(It.error("Peer _createOffer error:",e),e instanceof vt)throw e;throw bt(ae,e)}}})}_setRemoteDescription(e){return Z(this,void 0,void 0,function*(){It.debug("Setting remote description",e);try{yield this.instance.setRemoteDescription(e)}catch(e){throw It.error("Peer _setRemoteDescription error:",e),bt(ce,e)}})}_createAnswer(){return Z(this,void 0,void 0,function*(){if(this._isAnswer()){if("stable"!==this.instance.signalingState&&"have-remote-offer"!==this.instance.signalingState)return It.debug("Skipping negotiation, state:",this.instance.signalingState),It.debug(" - But the signaling state isn't stable, so triggering rollback"),void(yield Promise.all([this.instance.setLocalDescription({type:"rollback"}),this.instance.setRemoteDescription({sdp:this.options.remoteSdp,type:an.Offer})]));this._logTransceivers();try{const e=yield this.instance.createAnswer();return performance.mark(zi(this.options.id,"create-answer")),yield this._setLocalDescription(e),performance.mark(zi(this.options.id,"set-local-description")),performance.mark(zi(this.options.id,"ice-gathering-started")),e}catch(e){if(It.error("Peer _createAnswer error:",e),e instanceof vt)throw e;throw bt(se,e)}}})}_setLocalDescription(e){return Z(this,void 0,void 0,function*(){try{yield this.instance.setLocalDescription(e)}catch(e){throw It.error("Peer _setLocalDescription error:",e),bt(le,e)}})}_retrieveLocalStream(){return Z(this,void 0,void 0,function*(){if(ei(this.options.localStream))return this.options.localStream;const e=yield(t=this.options,Z(void 0,void 0,void 0,function*(){let{audio:e=!0,micId:n,video:i=!1,camId:r}=t;const{micLabel:o="",camLabel:a=""}=t;return!1!==e&&n&&(n=yield ci(n,o,gn.AudioIn).catch(()=>null),n&&(e=Object.assign(Object.assign({},"object"==typeof e?e:{}),{deviceId:{exact:n}}))),!1!==i&&r&&(r=yield ci(r,a,gn.Video).catch(()=>null),r&&(i=Object.assign(Object.assign({},"object"==typeof i?i:{}),{deviceId:{exact:r}}))),{audio:e,video:i}}));var t;return ai(e)})}_isOffer(){return this.type===an.Offer}_isAnswer(){return this.type===an.Answer}_isTrickleIce(){return!0===this.options.trickleIce}_config(){const{prefetchIceCandidates:e,forceRelayCandidate:t,iceServers:n}=this.options,i={bundlePolicy:"balanced",iceCandidatePoolSize:e?1:0,iceServers:n,iceTransportPolicy:t?"relay":"all"};return It.info("RTC config",i),i}restartStatsReporter(){return Z(this,void 0,void 0,function*(){this.isDebugEnabled&&this.statsReporter&&(this.instance?this.statsReporter.isRunning?It.debug(`[${this.options.id}] Stats reporter already running, skipping restart`):(It.debug(`[${this.options.id}] Restarting stats reporter after reconnect`),yield this.statsReporter.start(this.instance,this._session.sessionid,this._session.sessionid)):It.debug(`[${this.options.id}] Cannot restart stats reporter - no peer connection instance`))})}close(){return Z(this,void 0,void 0,function*(){Bi(this.options.id),this.finishIceRestart(),this._clearIceGatheringSafetyTimeout(),null!==this._sleepWakeupIntervalId&&(clearInterval(this._sleepWakeupIntervalId),this._sleepWakeupIntervalId=null),this.isDebugEnabled&&this.statsReporter&&(yield this.statsReporter.stop(this.debugOutput)),this.instance&&(this.instance.close(),this.instance=null)})}}Hi.ICE_GATHERING_SAFETY_TIMEOUT_MS=15e3,Hi.ICE_RESTART_TIMEOUT_MS=15e3;const Wi=Fn;class Vi{constructor(e,t){var n;this.session=e,this._callReportCollector=null,this._callRecorder=null,this._mediaDeviceCollector=null,this._audioDeviceRecoveryErrors=new WeakSet,this._mediaDeviceGeneration=0,this.id="",this.recoveredCallId="",this.state=hn[hn.New],this.prevState="",this.channels=[],this.role=pn.Participant,this.extension=null,this._state=hn.New,this._prevState=hn.New,this.gotAnswer=!1,this.gotEarly=!1,this._lastSerno=0,this._targetNodeId=null,this._iceTimeout=null,this._statsBindings=[],this._statsIntervalId=null,this._pendingIceCandidates=[],this._isRemoteDescriptionSet=!1,this._signalingStateClosed=!1,this._creatingPeer=!1,this._desiredAudioMuted=!1,this._firstCandidateSent=!1,this._firstNonHostCandidateSent=!1,this._isRecovering=!1,this._wasHeldBeforeRecovery=!1,this._checkConferenceSerno=e=>{const t=e<0||!this._lastSerno||this._lastSerno&&e===this._lastSerno+1;return t&&e>=0&&(this._lastSerno=e),t},this._doStats=()=>{this.peer&&this.peer.instance&&0!==this._statsBindings.length&&this.peer.instance.getStats().then(e=>{e.forEach(e=>{this._statsBindings.forEach(t=>{if(t.callback){if(t.constraints)for(const n in t.constraints)if(t.constraints.hasOwnProperty(n)&&t.constraints[n]!==e[n])return;t.callback(e)}})})})};const{iceServers:i,speaker:r,micId:o,micLabel:a,camId:s,camLabel:l,localElement:c,remoteElement:d,options:u,mediaConstraints:{audio:h,video:p},ringtoneFile:f,ringbackFile:g}=e;this.options=Object.assign({},un,{audio:h,video:p,iceServers:(null==t?void 0:t.iceServers)&&Array.isArray(t.iceServers)?t.iceServers:i,localElement:c,remoteElement:d,micId:o,micLabel:a,camId:s,camLabel:l,speakerId:r,ringtoneFile:f,ringbackFile:g,debug:u.debug,debugOutput:u.debugOutput,trickleIce:u.trickleIce,prefetchIceCandidates:null!==(n=u.prefetchIceCandidates)&&void 0!==n?n:un.prefetchIceCandidates,forceRelayCandidate:u.forceRelayCandidate,keepConnectionAliveOnSocketClose:u.keepConnectionAliveOnSocketClose,mutedMicOnStart:u.mutedMicOnStart},t),this._onMediaError=this._onMediaError.bind(this),this._onPeerConnectionFailureError=this._onPeerConnectionFailureError.bind(this),this._onPeerConnectionSignalingStateClosed=this._onPeerConnectionSignalingStateClosed.bind(this),this._onTrickleIceSdp=this._onTrickleIceSdp.bind(this),this._registerPeerEvents=this._registerPeerEvents.bind(this),this._desiredAudioMuted=Boolean(this.options.mutedMicOnStart),this.options.applyDesiredAudioMuteState=this._applyDesiredAudioMuteState.bind(this),this._init(),this.options&&(this._ringtone=bi(this.options.ringtoneFile,"_ringtone"),this._ringback=bi(this.options.ringbackFile,"_ringback"))}get creatingPeer(){return this._creatingPeer}get signalingStateClosed(){return this._signalingStateClosed}_captureHangupCallerStack(){const e=new Error("Call.hangup caller").stack;return e?e.split("\n").map(e=>e.trim()).filter(Boolean).slice(1,11):[]}get nodeId(){return this._targetNodeId}set nodeId(e){this._targetNodeId=e}get isVideoCall(){return!!this.options.video}get telnyxIDs(){return{telnyxCallControlId:this.options.telnyxCallControlId,telnyxSessionId:this.options.telnyxSessionId,telnyxLegId:this.options.telnyxLegId}}get localStream(){return this.options.localStream}get remoteStream(){return this.options.remoteStream}get memberChannel(){return`conference-member.${this.id}`}get isAudioMuted(){return this._desiredAudioMuted}_getLocalAudioTrackId(){var e,t;return null===(t=null===(e=this.options.localStream)||void 0===e?void 0:e.getAudioTracks()[0])||void 0===t?void 0:t.id}_hasActiveUnmutedLocalAudioTrack(){const e=this.options.localStream;return!!(null==e?void 0:e.getAudioTracks)&&e.getAudioTracks().some(e=>!0===e.enabled&&!0!==e.muted&&"live"===e.readyState)}shouldForceRelayCandidateForRecovery(){var e,t;return!!this.options.forceRelayCandidate||!!this.recoveredCallId&&null!==(t=null===(e=this._callReportCollector)||void 0===e?void 0:e.shouldForceRelayCandidateForRecovery())&&void 0!==t&&t}invite(){return Z(this,void 0,void 0,function*(){this._creatingPeer=!0,this.direction=sn.Outbound,this.options.trickleIce&&this._resetTrickleIceCandidateState(),performance.mark(zi(this.id,"new-peer")),this.peer=new Hi(an.Offer,this.options,this.session,this._onTrickleIceSdp,this._registerPeerEvents);try{yield this.peer.init()}catch(e){It.error("Peer init failed, aborting call",e),this._creatingPeer=!1;const t=e instanceof vt?e:bt(Ne,e instanceof Error?e:void 0);return Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid,recoverable:!1},this.session.uuid),void this.hangup({initiator:"sdk:peer-init-failed"},!1)}this._creatingPeer=!1})}answer(e={}){var t,n,i,r,o,a,s,l;return Z(this,void 0,void 0,function*(){const c=(null!==(i=null===(n=(t=this.session).getActiveCalls)||void 0===n?void 0:n.call(t))&&void 0!==i?i:[]).filter(e=>e.id!==this.id);if(c.length>0&&It.debug(`[${this.id}] answer(): answering inbound call while ${c.length} other active call(s) exist in session ${this.session.sessionid}`),this._creatingPeer||(null===(r=this.peer)||void 0===r?void 0:r.instance)&&"closed"!==this.peer.instance.signalingState){const e=gt(qe);return Cn(ut.Warning,{warning:e,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),void It.warn(`[${this.id}] answer() ignored: peer connection already exists or is being created (signalingState: ${null!==(s=null===(a=null===(o=this.peer)||void 0===o?void 0:o.instance)||void 0===a?void 0:a.signalingState)&&void 0!==s?s:"creating"})`)}if(!this._registerInboundAnswerAttempt())return;performance.mark(zi(this.id,"answer-called")),this._creatingPeer=!0,this.stopRingtone(),this.direction=sn.Inbound,(null===(l=null==e?void 0:e.customHeaders)||void 0===l?void 0:l.length)>0&&(this.options=Object.assign(Object.assign({},this.options),{customHeaders:e.customHeaders}));const d=["micId","micLabel","speakerId","camId","camLabel","audio","video","remoteElement","localElement"];for(const t of d)void 0!==e[t]&&(this.options=Object.assign(Object.assign({},this.options),{[t]:e[t]}));this.options.trickleIce&&this._resetTrickleIceCandidateState(),performance.mark(zi(this.id,"new-peer")),this.peer=new Hi(an.Answer,this.options,this.session,this._onTrickleIceSdp,this._registerPeerEvents);try{yield this.peer.init()}catch(e){It.error("Peer init failed, aborting call",e),this._creatingPeer=!1;const t=e instanceof vt?e:bt(Ne,e instanceof Error?e:void 0);return Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid,recoverable:!1},this.session.uuid),void(yield this.hangup({initiator:"sdk:peer-init-failed"},!0))}this._creatingPeer=!1})}playRingtone(){yi(this._ringtone)}stopRingtone(){wi(this._ringtone)}playRingback(){yi(this._ringback)}stopRingback(){wi(this._ringback)}hangup(e,t){var n,i,r,o,a,s;return Z(this,void 0,void 0,function*(){const l=e||{},c=!1!==t,d=this.state,u=this.prevState,h=this._captureHangupCallerStack(),p=l.initiator||"app:call.hangup",f=this._state<hn.Active?{cause:"USER_BUSY",causeCode:17}:{cause:"NORMAL_CLEARING",causeCode:16};if(this.cause=l.cause||f.cause,this.causeCode=l.causeCode||f.causeCode,this.sipCode=l.sipCode||null,this.sipReason=l.sipReason||null,this.sipCallId=l.sip_call_id||null,this.options.customHeaders=[...null!==(n=this.options.customHeaders)&&void 0!==n?n:[],...null!==(r=null===(i=null==l?void 0:l.dialogParams)||void 0===i?void 0:i.customHeaders)&&void 0!==r?r:[]],It.debug(`[${this.id}] hangup() invoked`,{callId:this.id,execute:c,state:d,prevState:u,cause:this.cause,causeCode:this.causeCode,initiator:p,sipCode:this.sipCode,sipReason:this.sipReason,sipCallId:this.sipCallId,isRecovering:Boolean(l.isRecovering),hasDialogCustomHeaders:Boolean(null===(a=null===(o=l.dialogParams)||void 0===o?void 0:o.customHeaders)||void 0===a?void 0:a.length),callerStack:h}),l.isRecovering)return this._isRecovering=!0,this.setState(hn.Recovering),void this._finalize();if(this.setState(hn.Hangup),this.stopRingtone(),this.stopRingback(),c){const e=new Hn({sipCode:this.sipCode,sip_call_id:this.sipCallId,sessid:this.session.sessionid,dialogParams:this.options,cause:this.cause,causeCode:this.causeCode});let t;try{yield Promise.race([this._execute(e),new Promise(e=>{t=setTimeout(()=>{It.warn(`[${this.id}] BYE execution timed out after 5000ms — proceeding to destroy.`),e()},5e3)})])}catch(e){It.error("telnyx_rtc.bye failed!",e);const t=bt(me,e);Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid)}finally{t&&clearTimeout(t)}}It.debug(`[${this.id}] Closing peer from hangup`),null===(s=this.peer)||void 0===s||s.close(),this.setState(hn.Destroy)})}hold(){const e=new qn({sessid:this.session.sessionid,action:mn.Hold,dialogParams:this.options});return this._execute(e).then(this._handleChangeHoldStateSuccess.bind(this)).catch(this._handleChangeHoldStateError.bind(this))}unhold(){const e=new qn({sessid:this.session.sessionid,action:mn.Unhold,dialogParams:this.options});return this._execute(e).then(this._handleChangeHoldStateSuccess.bind(this)).catch(this._handleChangeHoldStateError.bind(this))}toggleHold(){const e=new qn({sessid:this.session.sessionid,action:mn.ToggleHold,dialogParams:this.options});return this._execute(e).then(this._handleChangeHoldStateSuccess.bind(this)).catch(this._handleChangeHoldStateError.bind(this))}dtmf(e){const t=new Gn({sessid:this.session.sessionid,dtmf:e,dialogParams:this.options});this._execute(t)}message(e,t){const n={from:this.session.options.login,to:e,body:t},i=new Gn({sessid:this.session.sessionid,msg:n,dialogParams:this.options});this._execute(i)}muteAudio(){It.debug("muteAudio called",{callId:this.id,previousAudioState:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),this._desiredAudioMuted=!0,vi(this.options.localStream)}unmuteAudio(){It.debug("unmuteAudio called",{callId:this.id,previousAudioState:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),this._desiredAudioMuted=!1,gi(this.options.localStream)}_applyDesiredAudioMuteState(){It.debug("applyDesiredAudioMuteState called",{callId:this.id,previousAudioState:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),this._desiredAudioMuted?vi(this.options.localStream):gi(this.options.localStream)}toggleAudioMute(){It.debug("toggleAudioMute called",{callId:this.id,previousAudioState:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),this._desiredAudioMuted=!this._desiredAudioMuted,this._applyDesiredAudioMuteState()}setAudioInDevice(e,t){return Z(this,void 0,void 0,function*(){return this._setAudioInDevice(e,t)})}_setAudioInDevice(e,t,n=!1){var i,r,o,a,s,l;return Z(this,void 0,void 0,function*(){if(this._isTerminatingOrTerminated()||!(null===(i=this.peer)||void 0===i?void 0:i.instance))return;const c=void 0===t?this._desiredAudioMuted:Boolean(t),d=this._mediaDeviceGeneration,{instance:u}=this.peer,h=()=>{var e;return this._isTerminatingOrTerminated()||d!==this._mediaDeviceGeneration||(null===(e=this.peer)||void 0===e?void 0:e.instance)!==u},p=u.getSenders().find(({track:e})=>"audio"===(null==e?void 0:e.kind));if(!p)return It.warn("Skipping audio input device change: no audio sender found",{callId:this.id,deviceId:e,audioMuted:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),void Cn(ut.Warning,{warning:gt(Ke),callId:this.id,deviceId:e,sessionId:this.session.sessionid},(null===(r=this.options)||void 0===r?void 0:r.id)||this.id);let f;It.debug("Starting audio input device change",{callId:this.id,state:this.state,deviceId:e,previousDesiredAudioMuted:this._desiredAudioMuted,newDesiredMuted:c,currentSenderTrack:di(p.track),localTracks:ui(this.options.localStream)});try{f=yield ai({audio:{deviceId:{exact:e}}})}catch(e){if(h())return;const t=bt(mt(e),e);return n&&this._audioDeviceRecoveryErrors.add(t),void Cn(ut.MediaError,t,(null===(o=this.options)||void 0===o?void 0:o.id)||this.id)}if(h())return void f.getTracks().forEach(e=>e.stop());const g=f.getAudioTracks()[0];try{if(!g)throw new Error("No audio track acquired");g.enabled=!(void 0===t?this._desiredAudioMuted:c),yield p.replaceTrack(g)}catch(e){if(f.getTracks().forEach(e=>e.stop()),h())return;const t=bt(mt(e),e);return n&&this._audioDeviceRecoveryErrors.add(t),void Cn(ut.MediaError,t,(null===(a=this.options)||void 0===a?void 0:a.id)||this.id)}if(h())return void f.getTracks().forEach(e=>e.stop());void 0!==t&&(this._desiredAudioMuted=c),g.enabled=!this._desiredAudioMuted;try{this.options.micId=(null===(l=null===(s=g.getSettings)||void 0===s?void 0:s.call(g))||void 0===l?void 0:l.deviceId)||"default"}catch(e){this.options.micId="default";const t=bt(fe,e);It.warn("Unable to read audio input settings after device change",{callId:this.id,error:t})}const{localStream:v}=this.options;v.getAudioTracks().forEach(e=>e.stop()),v.getVideoTracks().forEach(e=>f.addTrack(e)),this.options.localStream=f,It.debug("Finished audio input device change",{callId:this.id,state:this.state,deviceId:e,desiredAudioMuted:this._desiredAudioMuted,senderTrack:di(p.track),localTracks:ui(this.options.localStream)})})}muteVideo(){var e;e=this.options.localStream,fi(e,"video",!1)}unmuteVideo(){var e;e=this.options.localStream,fi(e,"video",!0)}toggleVideoMute(){var e;e=this.options.localStream,fi(e,"video",null)}setVideoDevice(e){return Z(this,void 0,void 0,function*(){const{instance:t}=this.peer,n=t.getSenders().find(({track:{kind:e}})=>"video"===e);if(n){const t=yield ai({video:{deviceId:{exact:e}}}),i=t.getVideoTracks()[0];n.replaceTrack(i);const{localElement:r,localStream:o}=this.options;ti(r,t),this.options.camId=e,o.getAudioTracks().forEach(e=>t.addTrack(e)),o.getVideoTracks().forEach(e=>e.stop()),this.options.localStream=t,this._applyDesiredAudioMuteState()}})}deaf(){vi(this.options.remoteStream)}undeaf(){gi(this.options.remoteStream)}toggleDeaf(){var e;e=this.options.remoteStream,fi(e,"audio",null)}setBandwidthEncodingsMaxBps(e,t){return Z(this,void 0,void 0,function*(){if(!this||!this.peer)return void It.error("Could not set bandwidth (reason: no peer connection). Dynamic bandwidth can only be set when there is a call running - is there any call running?)");const{instance:n}=this.peer,i=n.getSenders();if(!i)return void It.error("Could not set bandwidth (reason: no senders). Dynamic bandwidth can only be set when there is a call running - is there any call running?)");const r=i.find(({track:{kind:e}})=>e===t);if(r){const n=r.getParameters();n.encodings||(n.encodings=[{rid:"h"}]),It.info("Parameters: ",n),It.info("Setting max ","audio"===t?"audio":"video"," bandwidth to: ",e," [bps]"),n.encodings[0].maxBitrate=e,yield r.setParameters(n).then(()=>{It.info("audio"===t?"New audio":"New video"," bandwidth settings in use: ",r.getParameters())}).catch(e=>It.error(e))}else It.error("Could not set bandwidth (reason: no "+t+" sender). Dynamic bandwidth can only be set when there is a call running - is there any call running?)")})}setAudioBandwidthEncodingsMaxBps(e){this.setBandwidthEncodingsMaxBps(e,"audio")}setVideoBandwidthEncodingsMaxBps(e){this.setBandwidthEncodingsMaxBps(e,"video")}_isTerminatingOrTerminated(){return[hn.Hangup,hn.Destroy,hn.Purge].includes(this._state)}getStats(e,t){if(!e)return;const n={callback:e,constraints:t};if(this._statsBindings.push(n),!this._statsIntervalId){const e=2e3;this._startStats(e)}}setState(e){var t,n,i,r,o,a,s;switch(this._prevState=this._state,this._state=e,this.state=hn[this._state].toLowerCase(),this.prevState=hn[this._prevState].toLowerCase(),It.debug(`Call ${this.id} state change from ${this.prevState} to ${this.state}`),this._dispatchNotification({type:cn.callUpdate,call:this}),e){case hn.Purge:It.info(`[${this.id}] Entering Purge state.`);break;case hn.Active:if(performance.mark(zi(this.id,"call-active")),null===(t=this.peer)||void 0===t||t.tryCollectTimings(),this._isRecovering&&(this._isRecovering=!1,It.debug(`[${this.id}] Recovery complete, call is active`)),this._wasHeldBeforeRecovery&&(It.debug(`[${this.id}] Cleared held-before-recovery intent on transition to Active`),this._wasHeldBeforeRecovery=!1),null===(n=this._callReportCollector)||void 0===n||n.setHeld(!1),this.session.startSignalingHealthMonitor(),setTimeout(()=>{const{remoteElement:e,speakerId:t}=this.options;e&&t&&ii(e,t)},0),this._callReportCollector&&(null===(i=this.peer)||void 0===i?void 0:i.instance)&&this.session.callReportId&&this._callReportCollector.start(this.peer.instance),this._callRecorder){const e=null===(r=this.session.connection)||void 0===r?void 0:r.host;e&&this._callRecorder._setHost(e),this.session.callReportId&&this._callRecorder._setCallReportId(this.session.callReportId);const t=null===(o=this.options.localStream)||void 0===o?void 0:o.getAudioTracks()[0],n=null===(a=this.options.remoteStream)||void 0===a?void 0:a.getAudioTracks()[0];this._callRecorder.start(t,n)}this._mediaDeviceCollector||(this._mediaDeviceCollector=new Ii(this,()=>this._setAudioInDevice("default",void 0,!0)),this._mediaDeviceCollector.logDevicesAtStart());break;case hn.Held:null===(s=this._callReportCollector)||void 0===s||s.setHeld(!0);break;case hn.Destroy:this._finalize()}}handleMessage(e){const{method:t,params:n}=e;switch(t){case ln.Answer:if(performance.mark(zi(this.id,"telnyx-rtc-answer")),this.gotAnswer=!0,n.telnyx_call_control_id&&(this.options.telnyxCallControlId=n.telnyx_call_control_id),n.telnyx_session_id&&(this.options.telnyxSessionId=n.telnyx_session_id),n.telnyx_leg_id&&(this.options.telnyxLegId=n.telnyx_leg_id),this._state>=hn.Active)return;this._state>=hn.Early&&this.setState(hn.Active),this.gotEarly||this._onRemoteSdp(n.sdp),this.stopRingback(),this.stopRingtone();break;case ln.Media:if(performance.mark(zi(this.id,"telnyx-rtc-media")),this._state>=hn.Early)return;this.gotEarly=!0,this._onRemoteSdp(n.sdp);break;case ln.Display:{const{display_name:e,display_number:i,display_direction:r}=n;this.extension=i;const o=r===sn.Inbound?sn.Outbound:sn.Inbound,a={type:cn[t],call:this,displayName:e,displayNumber:i,displayDirection:o};Cn(ut.Notification,a,this.id)||Cn(ut.Notification,a,this.session.uuid);break}case ln.Candidate:this._addIceCandidate(n);break;case ln.Info:case ln.Event:{const e=Object.assign(Object.assign({},n),{type:cn.generic,call:this});Cn(ut.Notification,e,this.id)||Cn(ut.Notification,e,this.session.uuid);break}case ln.Ringing:performance.mark(zi(this.id,"ringing")),this.playRingback(),n.telnyx_call_control_id&&(this.options.telnyxCallControlId=n.telnyx_call_control_id),n.telnyx_session_id&&(this.options.telnyxSessionId=n.telnyx_session_id),n.telnyx_leg_id&&(this.options.telnyxLegId=n.telnyx_leg_id);break;case ln.Bye:const e=n.client_state||n.clientState;e&&(this.options.clientState=e),this.stopRingback(),this.stopRingtone(),this.hangup(Object.assign(Object.assign({},n),{initiator:"remote:telnyx_rtc.bye"}),!1)}}handleConferenceUpdate(e,t){return Z(this,void 0,void 0,function*(){if(!this._checkConferenceSerno(e.wireSerno)&&e.name!==t.laName)return It.error("ConferenceUpdate invalid wireSerno or packet name:",e),"INVALID_PACKET";const{action:n,data:i,hashKey:r=String(this._lastSerno),arrIndex:o}=e;switch(n){case"bootObj":{this._lastSerno=0;const{chatChannel:e,infoChannel:n,modChannel:r,laName:o,conferenceMemberID:a,role:s}=t;this._dispatchConferenceUpdate({action:fn.Join,conferenceName:o,participantId:Number(a),role:s}),e&&(yield this._subscribeConferenceChat(e)),n&&(yield this._subscribeConferenceInfo(n));const l=[];for(const e in i)l.push(Object.assign({callId:i[e][0],index:Number(e)},At(i[e][1])));this._dispatchConferenceUpdate({action:fn.Bootstrap,participants:l});break}case"add":this._dispatchConferenceUpdate(Object.assign({action:fn.Add,callId:r,index:o},At(i)));break;case"modify":this._dispatchConferenceUpdate(Object.assign({action:fn.Modify,callId:r,index:o},At(i)));break;case"del":this._dispatchConferenceUpdate(Object.assign({action:fn.Delete,callId:r,index:o},At(i)));break;case"clear":this._dispatchConferenceUpdate({action:fn.Clear});break;default:this._dispatchConferenceUpdate({action:n,data:i,callId:r,index:o})}})}_addChannel(e){this.channels.includes(e)||this.channels.push(e);const t=this.session.relayProtocol;this.session._existsSubscription(t,e)&&(this.session.subscriptions[t][e]=Object.assign(Object.assign({},this.session.subscriptions[t][e]),{callId:this.id}))}_subscribeConferenceChat(e){return Z(this,void 0,void 0,function*(){const t={nodeId:this.nodeId,channels:[e],handler:e=>{const{direction:t,from:n,fromDisplay:i,message:r,type:o}=e.data;this._dispatchConferenceUpdate({action:fn.ChatMessage,direction:t,participantNumber:n,participantName:i,messageText:r,messageType:o,messageId:e.eventSerno})}},n=yield this.session.vertoSubscribe(t).catch(e=>{It.error("ConfChat subscription error:",e)});hi(n,e)&&(this._addChannel(e),Object.defineProperties(this,{sendChatMessage:{configurable:!0,value:(t,n)=>{this.session.vertoBroadcast({nodeId:this.nodeId,channel:e,data:{action:"send",message:t,type:n}})}}}))})}_subscribeConferenceInfo(e){return Z(this,void 0,void 0,function*(){const t={nodeId:this.nodeId,channels:[e],handler:e=>{const{eventData:t}=e;"layout-info"===t.contentType?(t.callID=this.id,Pi(this.session,t)):It.error("Conference-Info unknown contentType",e)}},n=yield this.session.vertoSubscribe(t).catch(e=>{It.error("ConfInfo subscription error:",e)});hi(n,e)&&this._addChannel(e)})}_confControl(e,t={}){const n=Object.assign({application:"conf-control",callID:this.id,value:null},t);this.session.vertoBroadcast({nodeId:this.nodeId,channel:e,data:n})}_handleChangeHoldStateSuccess(e){return"active"===e.holdState?this.setState(hn.Active):this.setState(hn.Held),!0}_handleChangeHoldStateError(e){It.error(`Failed to ${e.action} on call ${this.id}`);const t=bt(ge,e);return Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),!1}_sendIceRestartModify(e,t={}){const n=new qn(Object.assign(Object.assign({sessid:this.session.sessionid,action:mn.UpdateMedia,callID:this.options.id,sdp:e},t.trickle?{trickle:!0}:{}),{dialogParams:this.options}));It.info(`ICE restart: sending ${t.trickle?"trickle ":""}Modify with new offer SDP`),this._execute(n).then(e=>Z(this,void 0,void 0,function*(){var t;(null==e?void 0:e.sdp)?(It.info("ICE restart Modify response received"),null===(t=this.peer)||void 0===t||t.finishIceRestart(),yield this._onRemoteSdp(e.sdp)):this._onIceRestartFailed("ICE restart Modify response missing SDP")})).catch(e=>{this._onIceRestartFailed("ICE restart Modify failed",e)})}_onIceRestartFailed(e,t){var n,i,r;It.error(e,t),null===(n=this.peer)||void 0===n||n.finishIceRestart();const o=bt(Ie,t);Cn(ut.Error,{error:o,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),null===(r=(i=this.session).reportIceRestartFailed)||void 0===r||r.call(i,this.id)}_onRemoteSdp(e){return Z(this,void 0,void 0,function*(){const t=new RTCSessionDescription({sdp:e,type:an.Answer});yield this.peer.instance.setRemoteDescription(t).then(()=>{performance.mark(zi(this.id,"set-remote-description")),this.options.trickleIce&&(this._isRemoteDescriptionSet=!0,this._flushPendingTrickleIceCandidates()),this.gotEarly&&this.setState(hn.Early),this.gotAnswer&&this._state!==hn.Held&&this.setState(hn.Active)}).catch(e=>Z(this,void 0,void 0,function*(){It.error("Call setRemoteDescription Error: ",e);const t=bt(ce,e);Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid);try{yield this.hangup({cause:"USER_BUSY",causeCode:17,initiator:"sdk:set-remote-description-failure"},!0)}catch(e){It.error("Error during hangup after setRemoteDescription failure:",e)}}))})}_warnIfOnlyHostIceCandidates(e){if(!(e=>{if(!e)return!1;const t=e.split(/\r?\n/).filter(e=>/^a=candidate:/i.test(e));return t.length>0&&t.every(e=>/\styp\s+host(?:\s|$)/i.test(e))})(e))return;const t=gt(Ve);It.warn(`[${this.id}] Warning ${t.code}: ${t.message}`),Cn(ut.Warning,{warning:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid)}_onIceSdp(e){var t,n,i;if(this._iceTimeout&&clearTimeout(this._iceTimeout),this._iceTimeout=null,this._isTerminatingOrTerminated())return;if(this.peer&&(this.peer.iceDone=!0),!e)return void It.warn("localDescription is null — PeerConnection may have been closed during ICE gathering");const{sdp:r,type:o}=e;null===(n=null===(t=this.peer)||void 0===t?void 0:t.instance)||void 0===n||n.removeEventListener("icecandidate",this._onIce),this._warnIfOnlyHostIceCandidates(r),performance.mark(zi(this.id,"ice-gathering-end"));let a=null;const s={sessid:this.session.sessionid,sdp:r,dialogParams:this.options,"User-Agent":`Web-${Wi}`,call_reports_enabled:!1!==this.session.options.enableCallReports};if(null===(i=this.peer)||void 0===i?void 0:i.isIceRestarting)this._sendIceRestartModify(r);else{switch(o){case an.Offer:this.setState(hn.Requesting),a=new Un(s);break;case an.Answer:this._isRecovering||this.setState(hn.Answering),a=!0===this.options.attach?new Bn(s):new $n(s);break;default:return It.error(`${this.id} - Unknown local SDP type:`,e),void this.hangup({initiator:"sdk:unknown-local-sdp-type"},!1)}performance.mark(zi(this.id,"send-sdp")),this._execute(a).then(e=>{if(this._isTerminatingOrTerminated())return void It.debug(`[${this.id}] Ignoring ${o} response because call is ${this.state}`);const{node_id:t=null}=e;this._targetNodeId=t,o===an.Offer?this.setState(hn.Trying):this._wasHeldBeforeRecovery&&this._isRecovering?this.setState(hn.Held):this.setState(hn.Active)}).catch(e=>Z(this,void 0,void 0,function*(){It.error(`${this.id} - Sending ${o} error:`,e);const t=bt(de,e);Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid);try{yield this.hangup({cause:"USER_BUSY",causeCode:17,initiator:"sdk:sdp-send-failure"},!0)}catch(e){It.error("Error during hangup after SDP send failure:",e)}}))}}_onTrickleIceSdp(e){var t;if(this._isTerminatingOrTerminated())return;if(!e)return It.error("No SDP data provided"),void this.hangup({initiator:"sdk:missing-local-sdp"},!1);const{sdp:n,type:i}=e;let r=null;const o={sessid:this.session.sessionid,sdp:n,dialogParams:this.options,trickle:!0,"User-Agent":`Web-${Wi}`,call_reports_enabled:!1!==this.session.options.enableCallReports};if(null===(t=this.peer)||void 0===t?void 0:t.isIceRestarting)this._sendIceRestartModify(n,{trickle:!0});else{switch(i){case an.Offer:this.setState(hn.Requesting),r=new Un(o);break;case an.Answer:this._isRecovering||this.setState(hn.Answering),r=!0===this.options.attach?new Bn(o):new $n(o);break;default:return It.error(`${this.id} - Unknown local SDP type:`,e),void this.hangup({initiator:"sdk:unknown-local-sdp-type"},!1)}performance.mark(zi(this.id,"send-sdp")),this._execute(r).then(e=>{if(this._isTerminatingOrTerminated())return void It.debug(`[${this.id}] Ignoring ${i} response because call is ${this.state}`);const{node_id:t=null}=e;this._targetNodeId=t,i===an.Offer?this.setState(hn.Trying):this._wasHeldBeforeRecovery&&this._isRecovering?this.setState(hn.Held):this.setState(hn.Active)}).catch(e=>Z(this,void 0,void 0,function*(){It.error(`${this.id} - Sending ${i} error:`,e);const t=bt(de,e);Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid);try{yield this.hangup({cause:"USER_BUSY",causeCode:17,initiator:"sdk:sdp-send-failure"},!0)}catch(e){It.error("Error during hangup after SDP send failure:",e)}}))}}_onIce(e){var t;if(this._isTerminatingOrTerminated())return;const{instance:n}=this.peer;if(null===this._iceTimeout){const e=this.options.attach?5e3:1e3;this._iceTimeout=setTimeout(()=>this._onIceSdp(n.localDescription),e)}e.candidate?(It.debug("RTCPeer Candidate:",e.candidate),null===(t=this.peer)||void 0===t||t.incrementGatheredCandidates(),this._trackCandidateMarks(e.candidate)):this._onIceSdp(n.localDescription)}_onTrickleIce(e){var t,n,i,r;this._isTerminatingOrTerminated()||(e.candidate&&e.candidate.candidate?(It.debug("RTCPeer Candidate:",e.candidate),null===(t=this.peer)||void 0===t||t.incrementGatheredCandidates(),this._trackCandidateMarks(e.candidate),this._sendIceCandidate(e.candidate)):(null===e.candidate&&this._warnIfOnlyHostIceCandidates(null===(r=null===(i=null===(n=this.peer)||void 0===n?void 0:n.instance)||void 0===i?void 0:i.localDescription)||void 0===r?void 0:r.sdp),this._sendEndOfCandidates()))}_sendIceCandidate(e){const t=new Wn({sessid:this.session.sessionid,candidate:e.candidate,sdpMLineIndex:e.sdpMLineIndex,sdpMid:e.sdpMid,dialogParams:this.options});this._execute(t)}_addIceCandidate(e){if(!this._isRemoteDescriptionSet)return It.debug("Remote description not set. Queued ICE candidate.",e),void this._pendingIceCandidates.push(e);this._addIceCandidateToPeer(e)}_addIceCandidateToPeer(e){const t=this.peer.instance.addIceCandidate(e);Promise.resolve(t).then(()=>{It.debug("Successfully added ICE candidate:",e)}).catch(t=>{It.error("Failed to add ICE candidate:",t,e)})}_sendEndOfCandidates(){const e=new Vn({sessid:this.session.sessionid,endOfCandidates:!0,dialogParams:this.options});this._execute(e)}_trackCandidateMarks(e){var t;if(this._firstCandidateSent||(performance.mark(zi(this.id,"first-candidate")),this._firstCandidateSent=!0),!this._firstNonHostCandidateSent){const n=null===(t=e.candidate.match(/typ (\w+)/))||void 0===t?void 0:t[1];n&&"host"!==n&&(performance.mark(zi(this.id,"first-non-host-candidate")),this._firstNonHostCandidateSent=!0)}}_resetTrickleIceCandidateState(){this._pendingIceCandidates=[],this._isRemoteDescriptionSet=!1,this._firstCandidateSent=!1,this._firstNonHostCandidateSent=!1}_flushPendingTrickleIceCandidates(){if(!this._pendingIceCandidates.length)return;const e=[...this._pendingIceCandidates];this._pendingIceCandidates=[],e.forEach(e=>{this._addIceCandidateToPeer(e)})}_registerPeerEvents(e){e.onicecandidate=e=>{var t;this.options.trickleIce?this._onTrickleIce(e):(null===(t=this.peer)||void 0===t?void 0:t.iceDone)||this._onIce(e)},e.onicegatheringstatechange=t=>{It.debug("ICE gathering state changed:",e.iceGatheringState,t),"complete"===e.iceGatheringState&&(It.debug("Finished gathering candidates"),performance.mark(zi(this.id,"ice-gathering-completed")))},e.onicecandidateerror=t=>{var n;if(It.debug("ICE candidate error:",t),null===(n=this.peer)||void 0===n?void 0:n.statsReporter){const n=function(e,t){var n,i;return{errorCode:e.errorCode,errorText:e.errorText,url:e.url,address:e.address,port:e.port,connectionState:t.connectionState,iceConnectionState:t.iceConnectionState,iceGatheringState:t.iceGatheringState,signalingState:t.signalingState,localDescriptionType:null===(n=t.localDescription)||void 0===n?void 0:n.type,remoteDescriptionType:null===(i=t.remoteDescription)||void 0===i?void 0:i.type}}(t,e);this.peer.statsReporter.reportIceCandidateError(n)}},e.addEventListener("addstream",e=>{this.options.remoteStream=e.stream})}_onMediaError(e){const t=(null==e?void 0:e.name)||"UnknownError",n=(null==e?void 0:e.message)||"Unknown media error",i=(null==e?void 0:e.originalError)||e;this._dispatchNotification({type:cn.userMediaError,error:i,call:this,errorName:t,errorMessage:n}),It.error(`Media error (${t}): ${n}`,e),Cn(ut.Error,{error:e,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),this._audioDeviceRecoveryErrors.has(e)||this.hangup({initiator:"sdk:media-error"},!1)}_onPeerConnectionFailureError(e){this._dispatchNotification({type:cn.peerConnectionFailureError,error:e.error}),It.error("Peer connection failure error"),e.warning&&Cn(ut.Warning,{warning:e.warning,callId:this.id,sessionId:this.session.sessionid},this.session.uuid)}_onPeerConnectionSignalingStateClosed(e){this._signalingStateClosed=!0,this._dispatchNotification(Object.assign({type:cn.signalingStateClosed},e)),It.debug("Peer connection signaling state closed, call is not recoverable")}_dispatchConferenceUpdate(e){this._dispatchNotification(Object.assign({type:cn.conferenceUpdate,call:this},e))}_dispatchNotification(e){!0!==this.options.screenShare&&(Cn(ut.Notification,e,this.id,!1)||Cn(ut.Notification,e,this.session.uuid))}_execute(e){return this.nodeId&&(e.targetNodeId=this.nodeId),this.session.execute(e)}_registerInboundAnswerAttempt(){var e;if(this.options.attach||this._isRecovering)return!0;const t=null===(e=this.session.calls)||void 0===e?void 0:e[this.id];if(t&&t!==this){const e=gt(Qe);return Cn(ut.Warning,{warning:e,callId:this.id,activeCallId:t.id,sessionId:this.session.sessionid},this.session.uuid),It.warn(`[${this.id}] answer() ignored: callID ${this.id} already has an active call (${t.id})`),!1}return!0}_init(){var e,t,n,i,r,o,a,s,l,c;const{id:d,userVariables:u,remoteCallerNumber:h,onNotification:p,recoveredCallId:f,wasHeldBeforeRecovery:g}=this.options;var v;this.options.id=d?d.toString():oe(),this.id=this.options.id,f&&(this.recoveredCallId=f,this._isRecovering=!0,this._wasHeldBeforeRecovery=Boolean(g)),u&&(v=u,0!==Object.keys(v).length)||(this.options.userVariables=this.session.options.userVariables||{}),h||(this.options.remoteCallerNumber=this.options.destinationNumber),this.session.calls[this.id]=this,_n(ut.MediaError,this._onMediaError,this.id),_n(ut.PeerConnectionFailureError,this._onPeerConnectionFailureError,this.id),_n(ut.PeerConnectionSignalingStateClosed,this._onPeerConnectionSignalingStateClosed,this.id),Dt(p)&&_n(ut.Notification,p.bind(this),this.id);const m=!1!==this.session.options.enableCallReports,b=this.session.options.callReportInterval||5e3,y=null!==(e=this.session.options.callReportFlushInterval)&&void 0!==e?e:18e4,w=this.session.options.debugLogLevel||"debug",k=this.session.options.debugLogMaxEntries||1e3;if(m&&(this._callReportCollector=new xi({enabled:!0,interval:b,intermediateReportInterval:y},{enabled:!0,level:w,maxEntries:k},()=>{var e;return null===(e=this.session._registrationTimings)||void 0===e?void 0:e.getLogEntry()}),this._callReportCollector.onFlushNeeded=()=>{this._flushIntermediateReport()},this._callReportCollector.onWarning=e=>{var t,n,i,r;Cn(ut.Warning,{warning:e,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),e.code===Fe&&this._state!==hn.Held?null===(n=(t=this.session).reportNoRtp)||void 0===n||n.call(t,this.id,"inbound"):e.code===je&&this._state!==hn.Held&&this._hasActiveUnmutedLocalAudioTrack()&&(null===(r=(i=this.session).reportNoRtp)||void 0===r||r.call(i,this.id,"outbound"))}),!0===this.session.options.enableCallRecording){const e={enabled:!0,flushIntervalMs:null!==(t=this.session.options.callRecordingFlushIntervalMs)&&void 0!==t?t:15e3,maxBufferBytes:null!==(n=this.session.options.callRecordingMaxBufferBytes)&&void 0!==n?n:dn,sampleRate:null!==(i=this.session.options.callRecordingSampleRate)&&void 0!==i?i:48e3,tracks:null!==(r=this.session.options.callRecordingTracks)&&void 0!==r?r:["local","remote"],endpoint:null!==(o=this.session.options.callRecordingEndpoint)&&void 0!==o?o:"/call_recording"},l={callId:this.id,callReportId:null!==(a=this.session.callReportId)&&void 0!==a?a:"",voiceSdkId:this._getCallReportVoiceSdkId()};this._callRecorder=new Ci(e,l);const c=null===(s=this.session.connection)||void 0===s?void 0:s.host;c&&this._callRecorder._setHost(c),this._callRecorder.onWarning=e=>{Cn(ut.Warning,{warning:e,callId:this.id,sessionId:this.session.sessionid},this.session.uuid)}}this._isRecovering?this.setState(hn.Recovering):this.setState(hn.New),It.info(`New Call — region: ${null!==(l=this.session.region)&&void 0!==l?l:"unknown"}, dc: ${null!==(c=this.session.dc)&&void 0!==c?c:"unknown"}`,this.options)}getEstablishmentTimings(){var e,t,n;const i=null===(e=this.peer)||void 0===e?void 0:e.callEstablishmentTimings;if(i)return i;const r=(null===(t=this.options)||void 0===t?void 0:t.trickleIce)&&!(null===(n=this.peer)||void 0===n?void 0:n.isIceRestarting)?"trickle":"non-trickle";return $i(this.id,r,this.direction)}_finalize(){var e,t,n;this._mediaDeviceGeneration++,this._stopStats(),null===(e=this._mediaDeviceCollector)||void 0===e||e.stop(),this._mediaDeviceCollector=null,null===(t=this._callRecorder)||void 0===t||t.stop(),Bi(this.id),It.debug(`[${this.id}] Closing peer from _finalize`),null===(n=this.peer)||void 0===n||n.close();const{remoteStream:i,localStream:r,remoteElement:o,localElement:a}=this.options;oi(i),oi(r),ni(o,i),ni(a,r),xn(ut.MediaError,null,this.id),xn(ut.PeerConnectionFailureError,null,this.id),xn(ut.PeerConnectionSignalingStateClosed,null,this.id),this.session.calls[this.id]=null,delete this.session.calls[this.id];const s=this._postCallReport().catch(e=>{It.error("Unexpected error in _postCallReport",{error:e})});this.session.trackCallReportUpload(s)}_getCallReportVoiceSdkId(){return this.session.callReportVoiceSdkId||void 0}_getClientSummary(){var e,t,n,i,r,o,a,s,l,c,d,u;const h=this.session.options,p=h.anonymous_login;return{authentication:Object.assign({type:this._getAuthenticationType()},p?{anonymousLogin:{targetType:p.target_type,targetId:p.target_id,targetVersionId:p.target_version_id,targetParams:this._sanitizeClientOption(p.target_params)}}:{}),connection:{env:h.env,host:h.host,project:h.project,region:null!==(e=this.session.region)&&void 0!==e?e:h.region,dc:this.session.dc,rtcIp:h.rtcIp,rtcPort:h.rtcPort,autoReconnect:null===(t=h.autoReconnect)||void 0===t||t,maxReconnectAttempts:null!==(n=h.maxReconnectAttempts)&&void 0!==n?n:10,keepConnectionAliveOnSocketClose:null!==(i=h.keepConnectionAliveOnSocketClose)&&void 0!==i&&i,hangupOnBeforeUnload:!1!==h.hangupOnBeforeUnload,useCanaryRtcServer:null!==(r=h.useCanaryRtcServer)&&void 0!==r&&r,skipLastVoiceSdkId:null!==(o=h.skipLastVoiceSdkId)&&void 0!==o&&o,skipTrailing:null!==(a=h.skipTrailing)&&void 0!==a&&a},media:{audio:this._sanitizeClientOption(this.options.audio),video:this._sanitizeClientOption(this.options.video),mutedMicOnStart:null!==(s=this.options.mutedMicOnStart)&&void 0!==s&&s,prefetchIceCandidates:null!==(l=this.options.prefetchIceCandidates)&&void 0!==l&&l,forceRelayCandidate:null!==(c=this.options.forceRelayCandidate)&&void 0!==c&&c,trickleIce:null!==(d=this.options.trickleIce)&&void 0!==d&&d,iceServers:this._sanitizeIceServers(this.options.iceServers)},callReports:{enabled:!1!==h.enableCallReports,intervalMs:h.callReportInterval||5e3,flushIntervalMs:null!==(u=h.callReportFlushInterval)&&void 0!==u?u:18e4,debugLogLevel:h.debugLogLevel||"debug",debugLogMaxEntries:h.debugLogMaxEntries||1e3}}}_getAuthenticationType(){const e=this.session.options;return e.anonymous_login?"anonymous_login":e.login_token?"login_token":e.login&&(e.password||e.passwd)?"login_password":e.token?"token":"unknown"}_sanitizeIceServers(e){if(e&&0!==e.length)return e.map(({urls:e,username:t,credential:n})=>({urls:e,hasUsername:Boolean(t),hasCredential:Boolean(n)}))}_sanitizeClientOption(e,t=0){if(void 0!==e){if(null===e)return null;if("string"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("boolean"==typeof e)return e;if("function"!=typeof e){if(t>=4)return"[truncated]";if(Array.isArray(e))return e.map(e=>this._sanitizeClientOption(e,t+1)).filter(e=>void 0!==e);if("object"==typeof e){const n=Object.entries(e).filter(([e])=>!this._isSensitiveClientOptionKey(e)).map(([e,n])=>[e,this._sanitizeClientOption(n,t+1)]).filter(e=>void 0!==e[1]);return Object.fromEntries(n)}}}}_isSensitiveClientOptionKey(e){return/(password|passwd|credential|secret|token|authorization|auth|api[_-]?key)/i.test(e)}flushIntermediateCallReport(e={type:"manual"}){this._flushIntermediateReport(e)}_flushIntermediateReport(e={type:"buffer-limit"}){var t;if(!this._callReportCollector)return;const n=this.session.callReportId;if(!n)return void It.debug("Cannot flush intermediate report: call_report_id not available");const i=null===(t=this.session.connection)||void 0===t?void 0:t.host;if(!i)return void It.debug("Cannot flush intermediate report: connection host not available");const r={callId:this.id,destinationNumber:this.options.destinationNumber,callerNumber:this.options.callerNumber,direction:this.direction===sn.Inbound?"inbound":"outbound",state:this.state,telnyxSessionId:this.options.telnyxSessionId,telnyxLegId:this.options.telnyxLegId,sdkVersion:Wi,clientSummary:this._getClientSummary()},o=this._callReportCollector.flush(r,e);if(!o)return;It.info("Flushing intermediate call report",{callId:this.id,flushReason:e,segment:o.segment});const a=this._getCallReportVoiceSdkId(),s="page-unload"===e.type,l=this._callReportCollector.sendPayload(o,n,i,a,s).catch(e=>{It.error("Failed to post intermediate call report segment",{error:e})});this.session.trackCallReportUpload(l)}_postCallReport(){var e,t,n,i;return Z(this,void 0,void 0,function*(){if(!this._callReportCollector)return void It.warn("Call report collector not initialized");if(yield this._callReportCollector.stop(),this._callRecorder){this._callRecorder.stop();const t=null===(e=this.session.connection)||void 0===e?void 0:e.host;t&&this._callRecorder._setHost(t),this.session.callReportId&&this._callRecorder._setCallReportId(this.session.callReportId);const n=this._callRecorder.postFinalReport().catch(e=>{It.error("Failed to post final call recording",{error:e})}).finally(()=>{var e;null===(e=this._callRecorder)||void 0===e||e.cleanup()});this.session.trackCallReportUpload(n)}const r=this.session.callReportId;if(!r)return It.debug("Cannot post call report: call_report_id not available"),void this._callReportCollector.cleanup();const o={callId:this.id,destinationNumber:this.options.destinationNumber,callerNumber:this.options.callerNumber,direction:this.direction===sn.Inbound?"inbound":"outbound",state:this.state,telnyxSessionId:this.options.telnyxSessionId,telnyxLegId:this.options.telnyxLegId,sdkVersion:Wi,clientSummary:this._getClientSummary()},a=null===(t=this.session.connection)||void 0===t?void 0:t.host;if(!a)return void It.error("Cannot post call report: connection host not available");const s=this._getCallReportVoiceSdkId();try{yield this._callReportCollector.postReport(o,r,a,s)}catch(e){throw It.error("Failed to post call report",{error:e}),e}finally{null===(n=this._callReportCollector)||void 0===n||n.cleanup(),null===(i=this._callRecorder)||void 0===i||i.cleanup()}})}_startStats(e){this._statsIntervalId=setInterval(this._doStats,e),It.info("Stats started")}_stopStats(){this._statsIntervalId&&(clearInterval(this._statsIntervalId),this._statsIntervalId=null),It.debug("Stats stopped")}}Vi.setStateTelnyx=e=>{if(e){switch(e._state){case hn.Recovering:e.state="recovering";break;case hn.Requesting:case hn.Trying:case hn.Early:e.state="connecting";break;case hn.Active:e.state="active";break;case hn.Held:e.state="held";break;case hn.Hangup:case hn.Destroy:e.state="done";break;case hn.Answering:e.state="ringing";break;case hn.New:e.state="new"}return e}};class qi extends Vi{constructor(){super(...arguments),this._statsInterval=null,this.sendConversationMessage=(e,t)=>this.session.execute(new _i(e,t)),this.sendAIConversationMessage=e=>{if(!this.session.connected)throw new Error("Cannot send AI conversation message: session is not connected. sendAIConversationMessage requires an active WebSocket connection.");const t=new Si(e);this.session.connection.sendRawText(JSON.stringify(t.request))}}hangup(e={},t=!0){const n=Object.create(null,{hangup:{get:()=>super.hangup}});return Z(this,void 0,void 0,function*(){this.screenShare instanceof qi&&(yield this.screenShare.hangup(e,t)),yield n.hangup.call(this,e,t)})}startScreenShare(e){return Z(this,void 0,void 0,function*(){const t=yield(n={video:!0},navigator.mediaDevices.getDisplayMedia(n));var n;t.getTracks().forEach(e=>{e.addEventListener("ended",()=>Z(this,void 0,void 0,function*(){this.screenShare&&(yield this.screenShare.hangup({initiator:"sdk:screenshare-track-ended"}))}))});const{remoteCallerName:i,remoteCallerNumber:r,callerName:o,callerNumber:a}=this.options,s=Object.assign({screenShare:!0,localStream:t,destinationNumber:`${this.extension}-screen`,remoteCallerName:i,remoteCallerNumber:`${r}-screen`,callerName:`${o} (Screen)`,callerNumber:`${a} (Screen)`},e);return this.screenShare=new qi(this.session,s),this.screenShare.invite(),this.screenShare})}stopScreenShare(){return Z(this,void 0,void 0,function*(){this.screenShare instanceof qi&&(yield this.screenShare.hangup({initiator:"app:stopScreenShare"}))})}setAudioOutDevice(e){return Z(this,void 0,void 0,function*(){if(this._isTerminatingOrTerminated())return!1;const{remoteElement:t}=this.options,n=this._mediaDeviceGeneration;if(t&&e){const i=yield ii(t,e);return!this._isTerminatingOrTerminated()&&n===this._mediaDeviceGeneration&&this.options.remoteElement===t&&(i&&(this.options.speakerId=e),i)}return!1})}_finalize(){this._stats(!1),super._finalize()}_stats(e=!0){if(!1===e)return clearInterval(this._statsInterval);this._statsInterval=window.setInterval(()=>Z(this,void 0,void 0,function*(){const e=yield this.peer.instance.getStats(null);let t="";const n=["certificate","codec","peer-connection","stream","local-candidate","remote-candidate"],i=["id","type","timestamp"];e.forEach(e=>{n.includes(e.type)||(t+=`\n${e.type}\n`,Object.keys(e).forEach(n=>{i.includes(n)||(t+=`\t${n}: ${e[n]}\n`)}))}),It.info(t)}),2e3)}}class Gi extends Xn{constructor(e){super(e),this.calls={},this._missingRemoteAudioElementWarnedCallIds=new Set,this.autoRecoverCalls=!0,this._iceServers=[],this._localElement=null,this._localElementId=null,this._remoteElement=null,this._remoteElementId=null,this._jwtAuth=!0,this._audioConstraints=!0,this._previousAudioConstraints=!0,this._videoConstraints=!1,this._speaker=null,this._videoConstraints=e.video||!1,this.iceServers=e.iceServers,this.ringtoneFile=e.ringtoneFile,this.ringbackFile=e.ringbackFile}markMissingRemoteAudioElementWarned(e){return!!this._missingRemoteAudioElementWarnedCallIds.has(e)||(this._missingRemoteAudioElementWarnedCallIds.add(e),!1)}getActiveCalls(){return Object.values(this.calls).filter(e=>Gi.ACTIVE_CALL_STATE_NAMES.has(e.state))}_extractSafeCallIdentifiers(e){var t,n;const i={callId:e.id,state:e.state,direction:e.direction};(null===(t=e.options)||void 0===t?void 0:t.telnyxSessionId)&&(i.telnyxSessionId=e.options.telnyxSessionId),(null===(n=e.options)||void 0===n?void 0:n.telnyxLegId)&&(i.telnyxLegId=e.options.telnyxLegId);const r=e.sipCallId;return"string"==typeof r&&r&&(i.sipCallId=r),i}emitMultipleActiveCallsWarning(e){const t=this.getActiveCalls().filter(t=>t.id!==e);if(0===t.length)return;const n=gt(Ye),i=this.calls[e],r=i?this._extractSafeCallIdentifiers(i):{callId:e};Cn(ut.Warning,{warning:n,callId:e,sessionId:this.sessionid,newCall:r,activeCalls:t.map(e=>this._extractSafeCallIdentifiers(e))},this.uuid),It.warn(`MULTIPLE_ACTIVE_CALLS_DETECTED: new call ${e} created while ${t.length} other call(s) are active in session ${this.sessionid}`)}getIsRegistered(){const e=Object.create(null,{getIsRegistered:{get:()=>super.getIsRegistered}});return Z(this,void 0,void 0,function*(){return e.getIsRegistered.call(this)})}connect(){const e=Object.create(null,{connect:{get:()=>super.connect}});return Z(this,void 0,void 0,function*(){It.debug("BrowserSession.connect() called"),e.connect.call(this)})}checkPermissions(e=!0,t=!0){return Z(this,void 0,void 0,function*(){try{const n=yield ai({audio:e,video:t});return oi(n),!0}catch(e){return!1}})}logout(){this.disconnect()}disconnect(){const e=Object.create(null,{disconnect:{get:()=>super.disconnect}});return Z(this,void 0,void 0,function*(){It.info("[disconnect] Client-initiated disconnect — setting Purge with BYE on all active calls.");for(const e in this.calls){const t=this.calls[e];t.setState(hn.Purge),It.info("Start hangup for ",t),yield t.hangup({initiator:"app:client.disconnect"},!0)}this.calls={},this._missingRemoteAudioElementWarnedCallIds.clear(),yield e.disconnect.call(this)})}serverDisconnect(){const e=Object.create(null,{disconnect:{get:()=>super.disconnect}});return Z(this,void 0,void 0,function*(){It.info("[serverDisconnect] Server-initiated disconnect — setting Purge without BYE on all active calls.");for(const e in this.calls){const t=this.calls[e];t.setState(hn.Purge),t.hangup({initiator:"sdk:server-disconnect"},!1)}this.calls={},this._missingRemoteAudioElementWarnedCallIds.clear(),yield e.disconnect.call(this)})}socketDisconnect(){this._closeConnection()}handleLoginError(e){super._handleLoginError(e)}speedTest(e){return new Promise((t,n)=>{if(Sn(ut.SpeedTest,n=>{const{upDur:i,downDur:r}=n,o=r?8*e/(r/1e3)/1024:0;t({upDur:i,downDur:r,upKps:(i?8*e/(i/1e3)/1024:0).toFixed(0),downKps:o.toFixed(0)})},this.uuid),!(e=Number(e)))return n(`Invalid parameter 'bytes': ${e}`);this.executeRaw(`#SPU ${e}`);let i=e/1024;e%1024&&i++;const r=".".repeat(1024);for(let e=0;e<i;e++)this.executeRaw(`#SPB ${r}`);this.executeRaw("#SPE")})}getDevices(){return si().catch(e=>{const t=bt(mt(e),e);return Cn(ut.MediaError,t,this.uuid),[]})}getVideoDevices(){return si(gn.Video).catch(e=>(Cn(ut.MediaError,e,this.uuid),[]))}getAudioInDevices(){return si(gn.AudioIn).catch(e=>{const t=bt(mt(e),e);return Cn(ut.MediaError,t,this.uuid),[]})}getAudioOutDevices(){return si(gn.AudioOut).catch(e=>(It.error("getAudioOutDevices",e),Cn(ut.MediaError,e,this.uuid),[]))}validateDeviceId(e,t,n){return ci(e,t,n)}getDeviceResolutions(e){return Z(this,void 0,void 0,function*(){try{return yield(e=>Z(void 0,void 0,void 0,function*(){const t=[],n=yield ai({video:{deviceId:{exact:e}}}),i=n.getVideoTracks()[0];for(let e=0;e<li.length;e++){const[n,r]=li[e];(yield i.applyConstraints({width:{exact:n},height:{exact:r}}).then(()=>!0).catch(()=>!1))&&t.push({resolution:`${n}x${r}`,width:n,height:r})}return oi(n),t}))(e)}catch(e){throw e}})}get mediaConstraints(){return{audio:this._audioConstraints,video:this._videoConstraints}}setAudioSettings(e){return Z(this,void 0,void 0,function*(){if(!e)throw new Error("You need to provide the settings object");const{micId:t,micLabel:n}=e,i=X(e,["micId","micLabel"]);return(e=>{const t=navigator.mediaDevices.getSupportedConstraints();Object.keys(e).map(n=>{t.hasOwnProperty(n)&&null!==e[n]&&void 0!==e[n]||delete e[n]})})(i),this._audioConstraints=yield((e,t,n,i)=>Z(void 0,void 0,void 0,function*(){const{deviceId:n}=i;if(void 0===n&&(e||t)){const n=yield ci(e,t,"audioinput").catch(()=>null);n&&(i.deviceId={exact:n})}return i}))(t,n,0,i),this.micId=t,this.micLabel=n,this._audioConstraints})}disableMicrophone(){this._previousAudioConstraints=this._audioConstraints,this._audioConstraints=!1}enableMicrophone(){this._audioConstraints=this._previousAudioConstraints||!0}set iceServers(e){e&&Array.isArray(e)?this._iceServers=e:this._iceServers=function(e,t){const n="development"===e?lt:st;return t?n.map(e=>Object.assign(Object.assign({},e),{urls:Array.isArray(e.urls)?e.urls.map(e=>dt(e,t)):dt(e.urls,t)})):n}(this.options.env,this.options.region)}get iceServers(){return this._iceServers}set speaker(e){this._speaker=e}get speaker(){return this._speaker}set localElement(e){this._localElementId="string"==typeof e?e:null,this._localElement=Ft(e)}get localElement(){return this._localElement}get localElementId(){return this._localElementId}set remoteElement(e){this._remoteElementId="string"==typeof e?e:null,this._remoteElement=Ft(e)}get remoteElement(){return this._remoteElement}get remoteElementId(){return this._remoteElementId}vertoBroadcast({nodeId:e,channel:t="",data:n}){if(!t)throw new Error(`Invalid channel for broadcast: ${t}`);const i=new Kn({sessid:this.sessionid,eventChannel:t,data:n});e&&(i.targetNodeId=e),this.execute(i).catch(e=>e)}vertoSubscribe({nodeId:e,channels:t=[],handler:n}){return Z(this,void 0,void 0,function*(){if(!(t=t.filter(e=>e&&!this._existsSubscription(this.relayProtocol,e))).length)return{};const i=new Yn({sessid:this.sessionid,eventChannel:t});e&&(i.targetNodeId=e);const r=yield this.execute(i),{unauthorized:o=[],subscribed:a=[]}=pi(r);return o.length&&o.forEach(e=>this._removeSubscription(this.relayProtocol,e)),a.forEach(e=>this._addSubscription(this.relayProtocol,n,e)),r})}vertoUnsubscribe({nodeId:e,channels:t=[]}){return Z(this,void 0,void 0,function*(){if(!(t=t.filter(e=>e&&this._existsSubscription(this.relayProtocol,e))).length)return{};const n=new Qn({sessid:this.sessionid,eventChannel:t});e&&(n.targetNodeId=e);const i=yield this.execute(n),{unsubscribed:r=[],notSubscribed:o=[]}=pi(i);return r.forEach(e=>this._removeSubscription(this.relayProtocol,e)),o.forEach(e=>this._removeSubscription(this.relayProtocol,e)),i})}static telnyxStateCall(e){return qi.setStateTelnyx(e)}}Gi.ACTIVE_CALL_STATE_NAMES=new Set(["new","requesting","trying","recovering","ringing","answering","early","active","held"]);class Ki{constructor(e,t){this.code=t,this.message=e}}class Yi{constructor(e){this.session=e,this.retriedConnect=0,this.retriedRegister=0}_ack(e,t){const n=new zn(e,t);this.nodeId&&(n.targetNodeId=this.nodeId),this.session.execute(n)}reconnectDelay(){return 1e3*Math.floor(5*Math.random()+2)}handleMessage(e){var t,n,i,r,o,a,s,l,c,d,u,h;const{session:p}=this;p.setPingReceived();const{id:f,method:g,params:v={},voice_sdk_id:m}=e,b=null==v?void 0:v.callID,y=null==v?void 0:v.eventChannel,w=null==v?void 0:v.eventType,k=p.calls[b],_=null===(t=null==k?void 0:k.peer)||void 0===t?void 0:t.isConnectionHealthy(),S=new Set(Object.keys(p.calls));if(Array.isArray(null==v?void 0:v.reattached_sessions)&&S.size){It.debug(`Reattach: active call IDs before cleanup check: [${Array.from(S).join(", ")}].`);const e=0===v.reattached_sessions.length,t=v.reattached_sessions.some(e=>S.has(e));if(e||!t)for(const e of Object.keys(p.calls)){const t=p.calls[e];It.debug(`Session not reattached — terminating active call ${e} `);const n=bt(Re);Cn(ut.Error,{error:n,callId:e,sessionId:p.sessionid},p.uuid),t.hangup({},!1)}}if(Array.isArray(null==v?void 0:v.reattached_sessions)&&p.sessionid){const t=rn();if(t&&t.calls.length>0)if(t.sessionId!==p.sessionid)It.debug(`Recovery markers were saved for a different sessid (saved=${t.sessionId}, current=${p.sessionid}) — ignoring all.`),nn();else{const n=new Set(v.reattached_sessions),i=[];for(const r of t.calls)try{if(n.has(r.id)){It.debug(`Recovery marker for call ${r.id} was reattached — keeping for Attach element restore.`),i.push(r);continue}It.info(`Recovery marker for call ${r.id} (sessid=${p.sessionid}) was not reattached — emitting SESSION_NOT_REATTACHED.`);const e=bt(Re);Cn(ut.Error,{error:e,callId:r.id,sessionId:p.sessionid,customHeaders:r.customHeaders},p.uuid)}catch(e){It.debug(`Recovery marker for a saved call failed to process (callId=${null==r?void 0:r.id}) — skipping: ${e instanceof Error?e.message:String(e)}`),i.push(r)}on(i,t.sessionId,t.storedAt)}}if("channelPvtData"===w)return this._handlePvtEvent(v.pvtData);const x=({recoveredCallId:e,forceRelayCandidateForRecovery:t,mutedMicOnStart:n,remoteElement:i,localElement:r,wasHeldBeforeRecovery:o}={})=>{var a,s,l,c,d,u;const h={audio:!0,video:p.options.video,remoteSdp:v.sdp,destinationNumber:v.callee_id_number,remoteCallerName:v.caller_id_name,remoteCallerNumber:v.caller_id_number,callerName:v.callee_id_name,callerNumber:v.callee_id_number,attach:g===ln.Attach,mediaSettings:v.mediaSettings,debug:null!==(a=p.options.debug)&&void 0!==a&&a,debugOutput:null!==(s=p.options.debugOutput)&&void 0!==s?s:"socket",trickleIce:null!==(l=p.options.trickleIce)&&void 0!==l&&l,prefetchIceCandidates:null!==(c=p.options.prefetchIceCandidates)&&void 0!==c&&c,forceRelayCandidate:"boolean"==typeof t?t:null!==(d=p.options.forceRelayCandidate)&&void 0!==d&&d,keepConnectionAliveOnSocketClose:null!==(u=p.options.keepConnectionAliveOnSocketClose)&&void 0!==u&&u,mutedMicOnStart:null!=n?n:p.options.mutedMicOnStart};b&&(h.id=b),v.telnyx_call_control_id&&(h.telnyxCallControlId=v.telnyx_call_control_id),v.telnyx_session_id&&(h.telnyxSessionId=v.telnyx_session_id),v.telnyx_leg_id&&(h.telnyxLegId=v.telnyx_leg_id),v.client_state&&(h.clientState=v.client_state),v.dialogParams&&v.dialogParams.custom_headers&&v.dialogParams.custom_headers.length&&(h.customHeaders=v.dialogParams.custom_headers),e&&(h.recoveredCallId=e),o&&(h.wasHeldBeforeRecovery=o),void 0!==i&&(h.remoteElement=i),void 0!==r&&(h.localElement=r),performance.mark(zi(h.id,"new-call-start"));const f=new qi(p,h);return f.nodeId=this.nodeId,f},C=new An(m),E=new Dn(m);switch(g){case ln.Answer:case ln.Display:case ln.Candidate:case ln.Ringing:case ln.Bye:case ln.Media:if(!b||!k)return void It.error(`Received ${g} for non existing call:`,v);k.handleMessage(e),this._ack(f,g);break;case ln.Ping:this.session.setPingReceived(),this.session.execute(E);break;case ln.Punt:p.options.keepConnectionAliveOnSocketClose&&_?(It.info("[punt] Received PUNT from server. keepConnectionAliveOnSocketClose=true — disconnecting socket only, keeping calls alive."),p.socketDisconnect(),this._ack(f,g)):(It.info("[punt] Received PUNT from server — calling serverDisconnect() to purge all calls without BYE."),p.serverDisconnect());break;case ln.Invite:{const e=x();e.direction=sn.Inbound,e.playRingtone(),e.setState(hn.Ringing),this.session.emitMultipleActiveCallsWarning(e.id),this._ack(f,g);break}case ln.Attach:{const e=k||null;if(0===Object.keys(p.calls).length){let e,t;It.warn(`[${(new Date).toISOString()}][${b}] Attach: SDK doens't have any active call therefore we recover first arrived attach session ${b}`);let n=!1,i=!1;const r=rn();if(r&&r.sessionId===p.sessionid){const o=r.calls.find(e=>null!==e&&"object"==typeof e&&e.id===b);o&&(e=o.remoteElement,t=o.localElement,n=!0===o.wasHeld,"boolean"==typeof o.forceRelayCandidate&&(i=o.forceRelayCandidate),(e||t)&&It.info(`[${b}] Attach: restoring per-call media elements from recovery marker (remoteElement=${null!=e?e:"<none>"}, localElement=${null!=t?t:"<none>"}).`),"boolean"==typeof o.forceRelayCandidate&&It.info(`[${b}] Attach: restoring forceRelayCandidate=${o.forceRelayCandidate} from recovery marker.`))}const o=x({recoveredCallId:b,forceRelayCandidateForRecovery:i,remoteElement:e,localElement:t,wasHeldBeforeRecovery:n});o.answer(),this.session.emitMultipleActiveCallsWarning(o.id),this._ack(f,g);break}if(e){const t=e.id,n="held"===e.state,i=e.shouldForceRelayCandidateForRecovery();i&&It.warn(`[${(new Date).toISOString()}][${b}] Attach: forcing relay candidate for recovery`),It.info(`[${(new Date).toISOString()}][${b}] Attach: recovering active call ${t}.`),e.hangup({isRecovering:!0,initiator:"sdk:attach-recovery"},!1);const r=x({recoveredCallId:t,forceRelayCandidateForRecovery:i,mutedMicOnStart:e.isAudioMuted,remoteElement:e.options.remoteElement,localElement:e.options.localElement,wasHeldBeforeRecovery:n});r.answer(),this.session.emitMultipleActiveCallsWarning(r.id),this._ack(f,g);break}It.warn(`Attach: callID ${b} does not match any active calls. `),Cn(ut.Warning,{warning:gt(et),callId:b,params:v,sessionId:p.sessionid},p.uuid),this._ack(f,g);break}case ln.Event:case"webrtc.event":if(!y)return void It.error("Verto received an unknown event:",v);const t=p.relayProtocol,w=y.split(".")[0];p._existsSubscription(t,y)?Cn(t,v,y):y===p.sessionid?this._handleSessionEvent(v.eventData):p._existsSubscription(t,w)?Cn(t,v,w):p.calls.hasOwnProperty(y)?p.calls[y].handleMessage(e):Cn(ut.Notification,v,p.uuid);break;case ln.Info:v.type=cn.generic,Cn(ut.Notification,v,p.uuid);break;case ln.ClientReady:this.session.execute(C);break;case"ai_conversation":Cn(ut.AIConversationMessage,{method:"ai_conversation",params:v,voice_sdk_id:m},p.uuid);break;default:{const t=Bt(e);if(t){switch(t){case vn.REGISTER:case vn.REGED:if(!this.isDuplicateGatewayState(t,[vn.REGED,vn.REGISTER])){this.session._triggerKeepAliveTimeoutCheck(),this.retriedRegister=0,t===vn.REGED&&this.session.resetReconnectAttempts();const u=null===(i=null===(n=null==e?void 0:e.result)||void 0===n?void 0:n.params)||void 0===i?void 0:i.call_report_id;u&&(p.callReportId=u,It.debug("Captured call_report_id from REGED:",u));const h=null===(o=null===(r=null==e?void 0:e.result)||void 0===r?void 0:r.params)||void 0===o?void 0:o.dc;h&&(p.dc=h);const f=null===(s=null===(a=null==e?void 0:e.result)||void 0===a?void 0:a.params)||void 0===s?void 0:s.region;f&&(p.region=f),It.info(`Connected to Telnyx — region: ${null!==(l=p.region)&&void 0!==l?l:"unknown"}, dc: ${null!==(c=p.dc)&&void 0!==c?c:"unknown"}`),v.type=cn.vertoClientReady,null===(d=p._registrationTimings)||void 0===d||d.finish(p.sessionid),Cn(ut.Ready,v,p.uuid)}break;case vn.UNREGED:case vn.NOREG:if(this.retriedRegister+=1,5===this.retriedRegister){this.retriedRegister=0;const e=new Ki("Fail to register the user, the server tried 5 times","UNREGED|NOREG"),t=bt(xe,e);Cn(ut.Error,{error:t,sessionId:p.sessionid},p.uuid);break}{const e=this.reconnectDelay();null===(u=p._registrationTimings)||void 0===u||u.mark("schedule gateway state retry",{state:t,attempt:this.retriedRegister,delayMs:e}),setTimeout(()=>{var e;null===(e=p._registrationTimings)||void 0===e||e.mark("gateway state retry timer fired"),this.session.execute(C)},e);break}case vn.FAILED:case vn.FAIL_WAIT:case vn.TIMEOUT:if(!this.isDuplicateGatewayState(t,[vn.FAILED,vn.FAIL_WAIT,vn.TIMEOUT])){const e=bt(Se,new Error(`Gateway state: ${t}`));if(Cn(ut.Error,{error:e,sessionId:p.sessionid},p.uuid),p.options.skipLastVoiceSdkId=!0,It.debug(`Set skipLastVoiceSdkId=true on session options to avoid sticky reconnect to same b2bua-rtc instance (sessionId=${p.sessionid})`),!this.session.hasAutoReconnect()){this.retriedConnect=0;const e=new Ki("Fail to connect the server, the server tried 5 times","FAILED|FAIL_WAIT|TIMEOUT");this.session._terminateActiveCallsLocally();const t=bt(_e,e);Cn(ut.Error,{error:t,sessionId:p.sessionid},p.uuid);break}if(this.retriedConnect+=1,5===this.retriedConnect){this.retriedConnect=0,this.session._terminateActiveCallsLocally();const e=bt(_e,new Error("Connection Retry Failed"));Cn(ut.Error,{error:e,sessionId:p.sessionid},p.uuid);break}{const e=this.reconnectDelay();null===(h=p._registrationTimings)||void 0===h||h.mark("schedule gateway reconnect",{state:t,attempt:this.retriedConnect,delayMs:e}),setTimeout(()=>{var e;if(null===(e=p._registrationTimings)||void 0===e||e.mark("gateway reconnect timer fired"),It.debug(`Reconnecting... Retry ${this.retriedConnect} of 5`),this.session.options.keepConnectionAliveOnSocketClose){const e=Object.values(p.calls).some(e=>{var t;return(null===(t=e.peer)||void 0===t?void 0:t.instance)&&!e.signalingStateClosed});if(e)return It.debug("Reconnecting by keeping the existing session due to keepConnectionAliveOnSocketClose option being set."),void this.session.socketDisconnect();It.debug("keepConnectionAliveOnSocketClose is set but all peer connections have signalingState closed, doing full reconnect")}this.session.disconnect().then(()=>{this.session.clearConnection(),this.session.connect()})},e)}}break;default:It.warn("GatewayState message unknown method:",e)}break}It.debug("Verto message unknown method:",e);break}}}isDuplicateGatewayState(e,t){const{previousGatewayState:n}=this.session.connection,i=t.includes(n);return i&&It.debug(`Gateway state '${e}' received but previous state was '${n}' — guard condition met, skipping re-emission (sessionId=${this.session.sessionid})`),i}_retrieveCallId(e,t){const n=Object.keys(this.session.calls);if("bootObj"!==e.action)return n.find(e=>this.session.calls[e].channels.includes(t));{const t=e.data.find(e=>n.includes(e[0]));if(t instanceof Array)return t[0]}}_handlePvtEvent(e){return Z(this,void 0,void 0,function*(){const{session:t}=this,n=t.relayProtocol,{action:i,laChannel:r,laName:o,chatChannel:a,infoChannel:s,modChannel:l,conferenceMemberID:c,role:d,callID:u}=e;switch(i){case"conference-liveArray-join":{const n=()=>{t.vertoBroadcast({nodeId:this.nodeId,channel:r,data:{liveArray:{command:"bootstrap",context:r,name:o}}})},i={nodeId:this.nodeId,channels:[r],handler:({data:i})=>{const a=u||this._retrieveCallId(i,r);if(a&&t.calls.hasOwnProperty(a)){const s=t.calls[a];s._addChannel(r),s.extension=o,s.handleConferenceUpdate(i,e).then(e=>{"INVALID_PACKET"===e&&n()})}}},a=yield t.vertoSubscribe(i).catch(e=>{It.error("liveArray subscription error:",e);const n=bt(be,e);Cn(ut.Error,{error:n,sessionId:t.sessionid},t.uuid)});hi(a,r)&&n();break}case"conference-liveArray-part":{let e=null;if(r&&t._existsSubscription(n,r)){const{callId:i=null}=t.subscriptions[n][r];if(e=t.calls[i]||null,null!==i){const n={type:cn.conferenceUpdate,action:fn.Leave,conferenceName:o,participantId:Number(c),role:d};Cn(ut.Notification,n,i,!1)||Cn(ut.Notification,n,t.uuid),null===e&&xn(ut.Notification,null,i)}}const i=[r,a,s,l];t.vertoUnsubscribe({nodeId:this.nodeId,channels:i}).then(({unsubscribedChannels:t=[]})=>{e&&(e.channels=e.channels.filter(e=>!t.includes(e)))}).catch(e=>{It.error("liveArray unsubscribe error:",e)});break}}})}_handleSessionEvent(e){switch(e.contentType){case"layout-info":case"layer-info":Pi(this.session,e);break;case"logo-info":{const t={type:cn.conferenceUpdate,action:fn.LogoInfo,logo:e.logoURL};Cn(ut.Notification,t,this.session.uuid);break}}}}class Qi extends Gi{constructor(e){super(e),this.relayProtocol="verto-protocol",this.timeoutErrorCode=-329990,this.handleLoginOnSocketOpen=()=>Z(this,void 0,void 0,function*(){this._idle=!1;const{autoReconnect:e=!0}=this.options;yield this.login({onSuccess:()=>{this._autoReconnect=e}})}),this.handleAnonymousLoginOnSocketOpen=()=>Z(this,void 0,void 0,function*(){this._idle=!1,yield this.login()}),this._vertoHandler=new Yi(this),window.addEventListener("beforeunload",t=>{if(It.debug("Window beforeunload triggered."),!1!==e.hangupOnBeforeUnload)return en(),void(this.calls&&Object.keys(this.calls).forEach(e=>{this.calls[e]&&(It.info(`Hanging up call due to window unload: ${e}`),this.calls[e].hangup({initiator:"sdk:beforeunload"},!0))}));try{const e=this.getActiveCalls().map(e=>{const t={id:e.id,customHeaders:e.options.customHeaders,forceRelayCandidate:e.shouldForceRelayCandidateForRecovery()};return"held"===e.state&&(t.wasHeld=!0),"string"==typeof e.options.remoteElement?t.remoteElement=e.options.remoteElement:this.remoteElementId&&e.options.remoteElement===this.remoteElement&&(t.remoteElement=this.remoteElementId),"string"==typeof e.options.localElement?t.localElement=e.options.localElement:this.localElementId&&e.options.localElement===this.localElement&&(t.localElement=this.localElementId),t});if(this.getActiveCalls().forEach(e=>{if(e.flushIntermediateCallReport)try{It.debug(`beforeunload: flushing call report for ${e.id}.`),e.flushIntermediateCallReport({type:"page-unload"})}catch(t){It.debug(`beforeunload: failed to flush call report for ${e.id}: ${t instanceof Error?t.message:String(t)}`)}}),!this.sessionid||0===e.length)return It.debug(`No sessionID ${this.sessionid} or activeCalls ${e.length} during saving calls recover marker!`),void nn();It.info(`Saving recovery marker for ${e.length} active call(s) before unload (sessid=${this.sessionid}): [${e.map(e=>e.id).join(", ")}].`),on(e,this.sessionid)}catch(e){const t=this.calls?Object.keys(this.calls):[];It.debug(`Failed to save active-calls recovery marker before unload (active call ids: [${t.join(", ")}]): ${e instanceof Error?e.message:String(e)}`)}}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&!1===e.hangupOnBeforeUnload&&this.sessionid&&this.hasActiveCall()&&(It.debug("visibilitychange → hidden: re-stamping reconnect session-id freshness."),Zt(this.sessionid))})}validateOptions(){return Ut(this.options)||$t(this.options)}newCall(e){if(!this.validateCallOptions(e))throw bt(ve,void 0,"Error: destinationNumber is required");const t=new qi(this,e);return e.id||It.debug(`newCall: callId was not provided in options, SDK-generated ID: ${t.id}`),this.emitMultipleActiveCallsWarning(t.id),performance.mark(zi(t.id,"new-call-start")),t.invite(),t}broadcast(e){return this.vertoBroadcast(e)}subscribe(e){return this.vertoSubscribe(e)}unsubscribe(e){return this.vertoUnsubscribe(e)}validateCallOptions(e){return!!$t(this.options)||Boolean(e.destinationNumber)}_onSocketOpen(){const e=Object.create(null,{_onSocketOpen:{get:()=>super._onSocketOpen}});return Z(this,void 0,void 0,function*(){return e._onSocketOpen.call(this),Ut(this.options)?this.handleLoginOnSocketOpen():$t(this.options)?this.handleAnonymousLoginOnSocketOpen():void 0})}_onSocketMessage(e){this._vertoHandler.handleMessage(e)}}const Ji=e=>Number(e.toFixed(2)),Xi=(e={})=>Object.entries(e).filter(([,e])=>void 0!==e).map(([e,t])=>`${e}=${t}${e.endsWith("Ms")?" ms":""}`).join(", ");class Zi{constructor(e){this.sdkVersion=e,this.clientId="",this.startedAtUtc=(new Date).toISOString(),this.previousStep="new TelnyxRTC()",this.clockAdjusted=!1,this.finished=!1,this.socketAttempts=0,this.droppedSteps=0,this.droppedRequests=0,this.entries=[{timestamp:this.startedAtUtc,step:"new TelnyxRTC()",deltaMs:0,elapsedMs:0}],this.requests=new Map;try{const e=performance.now.bind(performance),t=e();if(!Number.isFinite(t))throw new Error("Clock unavailable");this.readClock=e,this.startedAt=t,this.clock="performance"}catch(e){this.readClock=Date.now,this.startedAt=this.readClock(),this.clock="date"}this.previousAt=this.startedAt}now(){try{const e=this.readClock();if(Number.isFinite(e)&&e>=this.previousAt)return e}catch(e){}return this.clockAdjusted=!0,this.previousAt}record(e,t,n=this.now(),i=!0){const r=Ji(n-this.previousAt);(!this.longestInterval||r>this.longestInterval.durationMs)&&(this.longestInterval={from:this.previousStep,to:e,durationMs:r}),this.previousAt=n,this.previousStep=e;const o=Object.assign({timestamp:(new Date).toISOString(),step:e,deltaMs:r,elapsedMs:Ji(n-this.startedAt)},t?{details:t}:{});return this.entries.length===Zi.MAX_STEPS&&(this.entries.shift(),this.droppedSteps+=1),this.entries.push(o),i&&this.logStep(o),o}logStep(e){try{const t=Xi(e.details);It.info(`[TelnyxRTC registration ${this.clientId}] ${e.timestamp} +${e.deltaMs} ms / ${e.elapsedMs} ms total: ${e.step}`+(t?` (${t})`:""))}catch(e){}}mark(e,t){if(this.finished)return;const n=this.now();"TelnyxRTC constructor complete"===e&&(this.constructorFinishedAt=n),"client.connect() called"===e&&void 0===this.connectStartedAt&&(this.connectStartedAt=n),"create WebSocket"===e&&(this.socketAttempts+=1,this.requests.clear()),"WebSocket closed"!==e&&"WebSocket error"!==e||this.requests.clear(),this.record(e,t,n)}requestSent(e,t){if(this.finished||!(e=>"login"===e||"anonymous_login"===e||e===ln.GatewayState)(t)||"string"!=typeof e||e.length>128)return;const n=this.now();this.requests.has(e)||this.requests.size!==Zi.MAX_REQUESTS||(this.requests.delete(this.requests.keys().next().value),this.droppedRequests+=1),this.requests.set(e,{method:t,startedAt:n}),this.record(`send ${t}`,{requestId:e},n)}responseReceived(e){var t,n,i;if(this.finished||!e)return;const r=this.now(),o="string"==typeof e.id?e.id:void 0,a=this.requests.get(o),s={};a&&(s.requestId=o,s.requestMs=Ji(r-a.startedAt),this.requests.delete(o));const l=(null===(n=null===(t=e.result)||void 0===t?void 0:t.params)||void 0===n?void 0:n.state)||(null===(i=e.params)||void 0===i?void 0:i.state);Object.values(vn).includes(l)&&(s.state=l),e.method===ln.ClientReady?this.record("receive server clientReady",s,r):a?this.record(`receive ${a.method}${e.error?" error":""}`,s,r):s.state&&this.record("receive gateway state",s,r)}finish(e){if(this.finished)return;const t=this.now(),n=this.record("emit telnyx.ready (vertoClientReady) to app",void 0,t,!1);this.finished=!0,this.requests.clear(),this.completedAtUtc=n.timestamp,this.summary=Object.assign(Object.assign(Object.assign({event:"registration_timing",schemaVersion:1,scope:"initial_registration",clientId:this.clientId,sessionId:e,sdkVersion:this.sdkVersion,startedAt:this.startedAtUtc,timestamp:this.completedAtUtc,clock:this.clock,clockAdjusted:this.clockAdjusted,totalMs:Ji(t-this.startedAt)},void 0!==this.constructorFinishedAt?{constructorMs:Ji(this.constructorFinishedAt-this.startedAt)}:{}),void 0!==this.connectStartedAt?Object.assign({connectToReadyMs:Ji(t-this.connectStartedAt)},void 0!==this.constructorFinishedAt?{appWaitBeforeConnectMs:Ji(this.connectStartedAt-this.constructorFinishedAt)}:{}):{}),{socketAttempts:this.socketAttempts,droppedSteps:this.droppedSteps,droppedRequests:this.droppedRequests,longestInterval:this.longestInterval,steps:this.entries}),this.entries=[],Promise.resolve().then(()=>{this.logStep(n);try{const e=this.summary,t=[`${e.totalMs} ms total`];void 0!==e.constructorMs&&t.push(`constructor=${e.constructorMs} ms`),void 0!==e.appWaitBeforeConnectMs&&t.push(`app wait=${e.appWaitBeforeConnectMs} ms`),void 0!==e.connectToReadyMs&&t.push(`connect-to-ready=${e.connectToReadyMs} ms`);const n=e.longestInterval;It.info(`[TelnyxRTC registration ${this.clientId}] ${e.timestamp} COMPLETE: ${t.join("; ")}; longest interval: ${n.from} → ${n.to} (${n.durationMs} ms); socket attempts=${e.socketAttempts}; dropped steps=${e.droppedSteps}`)}catch(e){}try{(function(){const e=Tt.info;return e>=Rt&&e>=It.getLevel()})()&&"undefined"!=typeof console&&"function"==typeof console.table&&console.table(this.summary.steps.map(e=>Object.assign(Object.assign({},e),{details:Xi(e.details)})))}catch(e){}})}getLogEntry(){if(this.summary)return{timestamp:this.completedAtUtc,level:"info",message:"Registration timing",context:JSON.parse(JSON.stringify(this.summary))}}}function er(e){return{options:e,statsSamples:[]}}function tr(e){return(Array.isArray(e.urls)?e.urls:[e.urls]).some(e=>/^turns?:/i.test(e))}function nr(e){var t;let n=e;const i=n.match(/^([a-z]+:)(\/\/)?([^@]*@)(.+)$/i);i&&(n=i[1]+(null!==(t=i[2])&&void 0!==t?t:"")+i[4]);const r=n.indexOf("?transport=");return-1!==r&&(n=n.substring(0,r)),n}function ir(e){const t=e.indexOf("?transport=");if(-1===t)return;const n=e.substring(t+11).toLowerCase(),i=n.indexOf("&");return-1===i?n:n.substring(0,i)}function rr(e,t,n){var i;if(!e||!t)return!1;if(nr(e)!==nr(t))return!1;const r=ir(t);if(void 0===r)return!0;const o=null!==(i=ir(e))&&void 0!==i?i:null==n?void 0:n.toLowerCase();return void 0===o||o===r}Zi.MAX_STEPS=128,Zi.MAX_REQUESTS=32;const or=2e3;function ar(e,t,n){return Z(this,void 0,void 0,function*(){if("undefined"==typeof AudioContext)return null;let i,r,o;try{i=new AudioContext,r=i.createAnalyser(),o=i.createMediaStreamSource(e),r.fftSize=2048,o.connect(r);const a=new Float32Array(r.fftSize),s=Date.now()+t;let l=0,c=0,d=0;for(;Date.now()<s;){r.getFloatTimeDomainData(a);let e=0;for(const t of a)e+=t*t;const t=Math.sqrt(e/a.length);l=Math.max(l,t),c+=t,d+=1;const n=s-Date.now();n>0&&(yield new Promise(e=>setTimeout(e,Math.min(100,n))))}return{audioLevel:l,audioDetected:l>=n,audioLevelStats:{peak:l,average:d>0?c/d:0,samples:d}}}catch(e){return null}finally{try{null==o||o.disconnect(),null==r||r.disconnect(),yield null==i?void 0:i.close()}catch(e){}}})}function sr(e,t){return Z(this,void 0,void 0,function*(){if("undefined"!=typeof MediaRecorder)try{const n=["audio/webm;codecs=opus","audio/webm"].find(e=>"function"!=typeof MediaRecorder.isTypeSupported||MediaRecorder.isTypeSupported(e)),i=n?new MediaRecorder(e,{mimeType:n}):new MediaRecorder(e),r=[],o=Date.now();return yield new Promise(e=>{let a=!1;const s=t=>{a||(a=!0,clearTimeout(l),clearTimeout(c),e(t))};i.ondataavailable=({data:e})=>{e.size>0&&r.push(e)},i.onerror=()=>s(),i.onstop=()=>Z(this,void 0,void 0,function*(){const e=i.mimeType||n||"audio/webm",t=yield(a=new Blob(r,{type:e}),new Promise(e=>{try{const t=new FileReader;t.onloadend=()=>e("string"==typeof t.result?t.result:void 0),t.onerror=()=>e(void 0),t.readAsDataURL(a)}catch(t){e(void 0)}}));var a;s(t?{recordingDataUrl:t,recordingMimeType:e,recordingDurationMs:Date.now()-o}:void 0)});const l=setTimeout(()=>{try{"inactive"!==i.state&&i.stop()}catch(e){s()}},t),c=setTimeout(()=>s(),t+1e3);i.start()})}catch(e){return}})}function lr(e){var t,n;return Z(this,void 0,void 0,function*(){const i=function(e){var t,n;const i=e&&"object"==typeof e?e:void 0;return{sampleDurationMs:Math.max(0,null!==(t=null==i?void 0:i.sampleDurationMs)&&void 0!==t?t:or),silenceThreshold:Math.min(1,Math.max(0,null!==(n=null==i?void 0:i.silenceThreshold)&&void 0!==n?n:.01)),record:!0===(null==i?void 0:i.record),warnOnRecording:null==i?void 0:i.warnOnRecording}}(e.options.microphone),r=yield function(){var e;return Z(this,void 0,void 0,function*(){if("undefined"==typeof navigator||"function"!=typeof(null===(e=navigator.permissions)||void 0===e?void 0:e.query))return"unknown";try{return(yield navigator.permissions.query({name:"microphone"})).state}catch(e){return"unknown"}})}(),{report:o,stream:a}=yield function(){var e;return Z(this,void 0,void 0,function*(){if("undefined"==typeof navigator||"function"!=typeof(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia))return{report:{activeCapturePerformed:!1,captureError:"not_supported",captureErrorMessage:"getUserMedia is not available in this environment"},stream:void 0};try{return{report:{deviceAvailable:!0},stream:yield navigator.mediaDevices.getUserMedia({audio:!0})}}catch(e){const{captureError:t,captureErrorMessage:n}=function(e){const t=e&&"object"==typeof e&&"name"in e?String(e.name):"",n=e instanceof Error?e.message:String(e);return"NotAllowedError"===t||"PermissionDeniedError"===t||"SecurityError"===t?{captureError:"permission_denied",captureErrorMessage:`Microphone permission denied: ${n}`}:"NotFoundError"===t||"DevicesNotFoundError"===t||"OverconstrainedError"===t||"ConstraintNotSatisfiedError"===t?{captureError:"no_device",captureErrorMessage:`No microphone device found: ${n}`}:"TypeError"===t?{captureError:"not_supported",captureErrorMessage:`Microphone capture is not supported: ${n}`}:{captureError:"unknown",captureErrorMessage:n}}(e);return{report:{activeCapturePerformed:!1,captureError:t,captureErrorMessage:n,deviceAvailable:!1},stream:void 0}}})}(),s=yield function(){var e;return Z(this,void 0,void 0,function*(){if("undefined"!=typeof navigator&&"function"==typeof(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.enumerateDevices))try{const e=(yield navigator.mediaDevices.enumerateDevices()).filter(({kind:e})=>"audioinput"===e).map(({deviceId:e,label:t})=>({deviceId:e||"",label:t||"",kind:"audioinput"}));return{devices:e,deviceCount:e.length,deviceAvailable:e.length>0,labelsAccessible:e.some(({label:e})=>e.length>0)}}catch(e){return}})}(),l=a?"granted":"permission_denied"===o.captureError?"denied":r,c={currentPermissionState:l,isPermissionGrantedCurrently:"granted"===l,isGetUserMediaFailed:!a,deviceAvailable:(null==s?void 0:s.deviceAvailable)||o.deviceAvailable||!1,deviceCount:null!==(t=null==s?void 0:s.deviceCount)&&void 0!==t?t:0,devices:null!==(n=null==s?void 0:s.devices)&&void 0!==n?n:[],labelsAccessible:null==s?void 0:s.labelsAccessible,captureError:o.captureError,captureErrorMessage:o.captureErrorMessage,activeCapturePerformed:o.activeCapturePerformed};if(a)try{const e=yield function(e,t,n){var i,r,o;return Z(this,void 0,void 0,function*(){e.activeCapturePerformed=!0,e.recordingPerformed=n.record,n.record&&n.warnOnRecording&&n.warnOnRecording("To check your microphone, we will be recorded your voice for a few seconds and played back to you so you can hear how it sounds.");const[a,s]=yield Promise.all([ar(t,null!==(i=n.sampleDurationMs)&&void 0!==i?i:or,null!==(r=n.silenceThreshold)&&void 0!==r?r:.01),n.record?sr(t,null!==(o=n.sampleDurationMs)&&void 0!==o?o:or):Promise.resolve(void 0)]);return a&&(e.audioLevel=a.audioLevel,e.audioDetected=a.audioDetected,e.audioLevelStats=a.audioLevelStats),s&&(e.recordingDataUrl=s.recordingDataUrl,e.recordingMimeType=s.recordingMimeType,e.recordingDurationMs=s.recordingDurationMs,e.recordingPerformed=!0),s})}(c,a,i);e&&(c.playbackPerformed=yield(d=e.recordingDataUrl,u=e.recordingDurationMs+5e3,"undefined"==typeof Audio?Promise.resolve(!1):new Promise(e=>{let t,n=!1;const i=setTimeout(()=>r(!1),u),r=r=>{n||(n=!0,clearTimeout(i),t&&(t.onended=null,t.onerror=null,t.paused||t.pause(),t.src=""),e(r))};try{t=new Audio(d),t.onended=()=>r(!0),t.onerror=()=>r(!1),t.play().catch(()=>r(!1))}catch(e){r(!1)}})))}finally{try{a.getTracks().forEach(e=>e.stop())}catch(e){}}var d,u;const h=function(e){const t=[],n=(e,n)=>t.push({code:e,message:n,source:"microphone"});"denied"===e.currentPermissionState&&n("microphone_permission_denied","Microphone permission has been denied by the user."),!1===e.deviceAvailable&&n("microphone_no_device","No audio input device is available.");const i=e.captureError?{permission_denied:["microphone_capture_permission_denied","Active microphone capture was denied permission."],no_device:["microphone_capture_no_device","No microphone device was found for active capture."],not_supported:["microphone_capture_not_supported","Active microphone capture is not supported."],unknown:["microphone_capture_failed","Active microphone capture failed."]}[e.captureError]:void 0;return i&&n(...i),e.activeCapturePerformed&&!1===e.audioDetected&&n("microphone_silent","No audio was detected above the silence threshold during active capture."),t}(c);return h.length>0&&(c.reasons=h),Object.keys(c).length>0?c:void 0})}function cr(e){if("number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e))return e}function dr(e){const t=e.filter(e=>void 0!==cr(e));if(0===t.length)return;let n=1/0,i=-1/0,r=0;for(const e of t)e<n&&(n=e),e>i&&(i=e),r+=e;return{min:n,max:i,average:r/t.length}}function ur(e){var t,n;const i=[],r=new Set;e.forEach(e=>{const t=e;i.push(t),"transport"===t.type&&"string"==typeof t.selectedCandidatePairId&&r.add(t.selectedCandidatePairId)});const o=i.filter(e=>"candidate-pair"===e.type);return null!==(n=null!==(t=o.find(e=>r.has(e.id)))&&void 0!==t?t:o.find(e=>!0===e.selected||!0===e.nominated&&"succeeded"===e.state))&&void 0!==n?n:o.find(e=>"succeeded"===e.state)}function hr(e,t){let n=0,i=!1;for(const r of e){const e=cr(r[t]);void 0!==e&&(n+=e,i=!0)}return i?n:void 0}function pr(e,t,n=!1){const i=[];return e.forEach(e=>{const r=e;r.type!==t||n&&!function(e){var t;const n=null!==(t=e.kind)&&void 0!==t?t:e.mediaType;return void 0===n||"audio"===n}(r)||i.push(r)}),i}function fr(e,t){const n=void 0===e.packets?void 0!==t.packets:void 0!==t.packets&&t.packets>e.packets,i=void 0===e.bytes?void 0!==t.bytes:void 0!==t.bytes&&t.bytes>e.bytes;return n||i}function gr(e,t){if(void 0!==e&&void 0!==t)return cr(t-e)}function vr(e,t){var n,i;if(!e.some(e=>pr(e,`${t}-rtp`,!0).length>0))return;const r=e.map(e=>function(e,t){const n=pr(e,`${t}-rtp`,!0);return"outbound"===t?{packets:hr(n,"packetsSent"),bytes:hr(n,"bytesSent")}:{packets:hr(n,"packetsReceived"),bytes:hr(n,"bytesReceived")}}(e,t)).filter(({packets:e,bytes:t})=>void 0!==e||void 0!==t),o=null!==(n=r[0])&&void 0!==n?n:{},a=null!==(i=r[r.length-1])&&void 0!==i?i:{},s=gr(o.packets,a.packets),l=gr(o.bytes,a.bytes);return Object.assign(Object.assign(Object.assign(Object.assign({flowing:r.length>1&&fr(o,a)},void 0!==a.packets?{packets:a.packets}:{}),void 0!==a.bytes?{bytes:a.bytes}:{}),void 0!==s?{packetsDelta:s}:{}),void 0!==l?{bytesDelta:l}:{})}function mr(e,t){const n=[];for(const i of e)for(const e of pr(i,t,!0)){const t=cr(e.jitter);if(void 0!==t){const e=1e3*t;e>=0&&n.push(e)}}return n}function br(e){const t=hr(e,"packetsReceived"),n=hr(e,"packetsLost"),i=e.map(e=>cr(e.fractionLost)).filter(e=>void 0!==e&&e>=0&&e<=1),r=i.length>0?Math.max(...i):void 0,o=void 0!==t&&void 0!==n?t+n:void 0;return{packetsReceived:t,packetsLost:n,packetLossFraction:null!=r?r:void 0!==n&&void 0!==o&&o>0?n/o:void 0}}function yr(e){let t;return e.forEach(e=>{void 0===t&&(t=cr(e.timestamp))}),t}function wr(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function kr(e,t){return e.find(e=>e.label===t)}class _r{constructor(){this.startedAtMonoMs=Sr()}build(e={}){var t,n;const i={};try{const r=null===(n=null===(t=e.call)||void 0===t?void 0:t.getEstablishmentTimings)||void 0===n?void 0:n.call(t);if(r){i.callEstablishment={mode:r.mode,direction:r.direction,steps:r.steps.map(e=>Object.assign({},e))};const e=kr(r.steps,"ICE candidate gathering started"),t=kr(r.steps,"All ICE candidates gathered"),n=wr(e&&t?t.fromStart-e.fromStart:void 0);void 0!==n&&(i.iceGatheringMs=n);const o=kr(r.steps,"First server-reflexive/relay candidate found"),a=wr(e&&o?o.fromStart-e.fromStart:void 0);void 0!==a&&(i.firstNonHostCandidateMs=a)}}catch(e){}return i}complete(e){const t=Sr()-this.startedAtMonoMs;Number.isFinite(t)&&t>=0&&(e.totalMs=t)}}function Sr(){try{if("undefined"!=typeof performance&&"function"==typeof performance.now)return performance.now()}catch(e){}return Date.now()}function xr(){return new _r}const Cr="ice_only_host_candidates",Er={inconclusive:0,ready:1,degraded:2,blocked:3,permission_denied:4};function Ir(e,t){return e?t?Er[e]>=Er[t]?e:t:e:t}function Tr(e,t,n){return{code:e,message:t,source:n}}function Rr(e,t,n){return{code:e,message:t,source:n}}function Nr(e,t=!1){var n;if(!e)return{reasons:[],warnings:[]};const i={reasons:[],warnings:[]},{reasons:r,warnings:o}=i,a=e.candidates.length>0;a||(r.push(Tr("ice_no_candidates","No ICE candidates were gathered.","ice")),i.verdict="inconclusive"),a&&e.onlyHostCandidates&&(e.hasSelectedPair?o.push(Rr(Cr,"Only host ICE candidates were found. Connectivity succeeded, but NAT traversal may not be possible.","ice")):(r.push(Tr(Cr,"Only host ICE candidates were found. NAT traversal may not be possible.","ice")),i.verdict=Ir(i.verdict,"degraded"))),e.isTurnRequired&&!t&&(r.push(Tr("ice_turn_required","The selected ICE candidate pair requires a TURN relay.","ice")),i.verdict=Ir(i.verdict,"degraded"));const s=void 0!==e.iceConnectionState&&"new"!==e.iceConnectionState;a&&!e.hasSelectedPair&&s&&(r.push(Tr("ice_no_selected_pair","No ICE candidate pair was selected. Connectivity failed.","ice")),i.verdict=Ir(i.verdict,"blocked")),!1===e.candidateGatheringCompleted&&(r.push(Tr("ice_gathering_timeout","ICE gathering did not complete within the timeout.","ice")),i.verdict=Ir(i.verdict,"degraded"));const l=(null!==(n=e.serverCandidateComparison)&&void 0!==n?n:[]).filter(({hasCandidates:e})=>!e);return l.length>0&&o.push(Rr("ice_server_no_candidates",`${l.length} configured ICE server${1===l.length?"":"s"} produced no candidates.`,"ice")),e.hasMultipleNetworkInterfaces&&o.push(Rr("ice_multiple_interfaces","Multiple network interfaces were detected on the host.","ice")),e.vpnDetected&&o.push(Rr("ice_vpn_detected","A VPN appears to be active and may affect media routing.","ice")),!i.verdict&&a&&(i.verdict="ready"),i}function Or(e){if(e.established&&!e.error)return{reasons:[],warnings:[]};const t=Array.isArray(e.server.urls)?e.server.urls.join(", "):e.server.urls;return{verdict:"degraded",reasons:[Tr("ice_server_failed",e.error?`ICE server [${t}] failed: ${e.error}`:`ICE server [${t}] did not establish a diagnostic call.`,"ice")],warnings:[]}}function Ar(e,t=!0){var n;if(!e)return{reasons:[],warnings:[]};const i={reasons:[],warnings:[]},{reasons:r,warnings:o}=i,a=t?e.reasons:null===(n=e.reasons)||void 0===n?void 0:n.filter(({code:e})=>"network_low_bitrate"!==e);switch((null==a?void 0:a.length)&&(r.push(...a),i.verdict="degraded"),e.quality){case"poor":r.push(Tr("network_poor_quality","Network quality is poor.","network")),i.verdict=Ir(i.verdict,"blocked");break;case"fair":o.push(Rr("network_fair_quality","Network quality is fair.","network")),i.verdict=Ir(i.verdict,"degraded");break;case"good":i.verdict=Ir(i.verdict,"ready")}const s=[e.inbound,e.outbound].filter(e=>!!e);if(t&&s.length>0){const e=s.filter(({flowing:e})=>e).length;2===s.length&&2===e?i.verdict=Ir(i.verdict,"ready"):e>0?(r.push(Tr("network_one_way_audio","Audio RTP is flowing in only one direction.","network")),i.verdict=Ir(i.verdict,"blocked")):(r.push(Tr("network_no_audio_flow","No inbound or outbound audio RTP is flowing.","network")),i.verdict=Ir(i.verdict,"blocked"))}return i}function Lr(e){var t;if(!e)return{reasons:[],warnings:[]};const n={reasons:[],warnings:[]};(null===(t=e.reasons)||void 0===t?void 0:t.length)&&n.reasons.push(...e.reasons);const i="denied"===e.currentPermissionState||!1===e.isPermissionGrantedCurrently||"permission_denied"===e.captureError,r=!1===e.deviceAvailable||void 0!==e.captureError,o=!0===e.activeCapturePerformed&&!1===e.audioDetected;return i?n.verdict="permission_denied":r?n.verdict="blocked":o?n.verdict="degraded":(!0===e.activeCapturePerformed&&!0===e.audioDetected||!0!==e.activeCapturePerformed&&!0===e.isPermissionGrantedCurrently&&!1!==e.deviceAvailable)&&(n.verdict="ready"),n}class Dr{constructor(e){this.options=e}run(){return Z(this,void 0,void 0,function*(){switch(this.options.mode){case"network-only":return this.runNetworkOnly();case"microphone-only":return this.runMicrophoneOnly(er(this.options));default:return this.runFull()}})}runFull(){return Z(this,void 0,void 0,function*(){const e=yield this.runTest({diagnosticOptions:this.options,modules:{ice:!!this.options.ice,network:!!this.options.network,microphone:!!this.options.microphone},autoHangup:!1!==this.options.autoHangup});return e.setupFailed?e.error?Pr({callId:e.callId,timings:e.timings},e.error):{version:1,verdict:"inconclusive",reasons:[{code:"call_setup_timeout",message:"The diagnostic call did not reach the established state",source:"diagnostic"}],callId:e.callId,timings:e.timings}:Pr({ice:e.ice,network:e.network,microphone:e.microphone,timings:e.timings,callId:e.callId,raw:e.raw},e.error)})}runNetworkOnly(){var e,t,n;return Z(this,void 0,void 0,function*(){const i=this.options.client.iceServers,r=function(e){const t=[];for(const n of e)(Array.isArray(n.urls)?n.urls:[n.urls]).forEach(e=>{t.push(Object.assign(Object.assign({},n),{urls:e}))});return t}(null!==(n=null!==(t=null===(e=this.options.rtcConfig)||void 0===e?void 0:e.iceServers)&&void 0!==t?t:i)&&void 0!==n?n:[]);let o=[];const a=xr();let s;try{return o=yield Promise.all(r.map(e=>Z(this,void 0,void 0,function*(){const t=yield this.runTest({diagnosticOptions:Object.assign(Object.assign({},this.options),{durationMs:3e3,statsSampleIntervalMs:500,rtcConfig:Object.assign(Object.assign({},this.options.rtcConfig),{iceServers:[e]})}),iceServers:[e],forceRelayCandidate:tr(e),modules:{ice:!0,network:!!this.options.network,microphone:!1},autoHangup:!0}),n=function(e){return e.error?e.error.message:e.setupFailed?"The diagnostic call did not reach the established state":e.ice?0===e.ice.candidates.length?"No ICE candidates were gathered":e.ice.hasSelectedPair?void 0:"No ICE candidate pair was selected":"No ICE report was produced"}(t);return{server:e,established:void 0===n,callId:t.callId,ice:t.ice,network:t.network,timings:t.timings,error:n}}))),s=Pr({serverTests:o,timings:a.build()},void 0,{networkOnly:!0}),s}catch(e){return s=Pr({timings:a.build()},Mr(e),{networkOnly:!0}),s}finally{(null==s?void 0:s.timings)&&a.complete(s.timings)}})}runTest(e){return Z(this,void 0,void 0,function*(){const t=er(e.diagnosticOptions),n=xr();let i,r,o,a=!1;const s=e=>{e.callId===(null==i?void 0:i.id)&&(r=Mr(e.error))};e.diagnosticOptions.client.on("telnyx.error",s);try{if(i=this.createDiagnosticCall(e.diagnosticOptions,e.iceServers,e.forceRelayCandidate),t.call=i,a=yield this.waitForCallEstablishment(i),!a)return o={established:!1,setupFailed:!0,callId:i.id,timings:n.build({call:i}),error:r},o;yield this.collectSamples(i,t);const s=e.modules.ice?function(e){var t,n;const i=null===(n=null===(t=e.call)||void 0===t?void 0:t.peer)||void 0===n?void 0:n.instance,r=e.statsSamples[e.statsSamples.length-1];if(!i||!r)return;const o=function(e,t){var n;const i=[],r=new Set,o=new Map,a=new Map,s={host:0,srflx:0,prflx:0,relay:0};e.forEach(e=>{switch(e.type){case"local-candidate":{const t=e;s[t.candidateType]++,a.set(t.id,t);break}case"remote-candidate":{const t=e;o.set(t.id,t);break}case"candidate-pair":{const t=e;i.push(t);break}case"transport":{const t=e;"string"==typeof t.selectedCandidatePairId&&r.add(t.selectedCandidatePairId);break}}});const l=function(e,t,n,i){var r,o;const a=e.find(e=>t.has(e.id)),s=e.find(e=>!0===e.selected),l=e.find(e=>!0===e.nominated&&"succeeded"===e.state),c=e.filter(e=>"succeeded"===e.state),d=null!==(o=null!==(r=null!=a?a:s)&&void 0!==r?r:l)&&void 0!==o?o:1===c.length?c[0]:void 0;return d?Object.assign(Object.assign({},d),{localCandidate:n.get(d.localCandidateId),remoteCandidate:i.get(d.remoteCandidateId)}):null}(i,r,a,o),c=s.relay>0,d=0===s.srflx&&0===s.relay&&0===s.prflx,u=t.iceGatheringState,h=t.iceConnectionState,p="complete"===u,f="relay"===(null===(n=null==l?void 0:l.localCandidate)||void 0===n?void 0:n.candidateType),{hasMultipleNetworkInterfaces:g,vpnDetected:v}=function(e){if(0===e.size)return{hasMultipleNetworkInterfaces:void 0,vpnDetected:void 0};const t=Array.from(e.values());return{hasMultipleNetworkInterfaces:new Set(t.filter(e=>"host"===e.candidateType).map(e=>e.address)).size>=2,vpnDetected:t.some(e=>"vpn"===e.networkType)}}(a);return{candidateGatheringCompleted:p,gatheringComplete:p,candidateCounts:s,candidates:Array.from(a.values()),hasRelayCandidate:c,onlyHostCandidates:d,isTurnRequired:f,hasMultipleNetworkInterfaces:g,vpnDetected:v,hasSelectedPair:!!l,selectedPair:null!=l?l:void 0,iceGatheringState:u,iceConnectionState:h}}(r,i),a=i.getConfiguration().iceServers;return a&&(o.serverCandidateComparison=function(e,t){var n,i;if(!e||0===e.length)return;const r=[];for(const o of e){const e=Array.isArray(o.urls)?o.urls:[o.urls],a=t.filter(t=>e.some(e=>rr(t.url,e,t.protocol))),s=null!==(i=null===(n=a[0])||void 0===n?void 0:n.candidateType)&&void 0!==i?i:null,l=a.length>0;r.push({urls:o.urls,hasCandidates:l,candidateType:s,candidates:a,candidateCount:a.length})}return r}(a,o.candidates)),o}(t):void 0,l=e.modules.network?function(e){if(0===e.statsSamples.length)return{quality:"unknown",reasons:[]};const t=e.statsSamples,n=vr(t,"inbound"),i=vr(t,"outbound"),r=dr(function(e){var t;const n=[];for(const i of e){let e=!1;const r=pr(i,"remote-inbound-rtp",!0);for(const t of r){const i=cr(t.roundTripTime);if(void 0!==i){const t=1e3*i;t>=0&&(n.push(t),e=!0)}}if(!e){const e=cr(null===(t=ur(i))||void 0===t?void 0:t.currentRoundTripTime);if(void 0!==e){const t=1e3*e;t>=0&&n.push(t)}}}return n}(t)),o=(a=dr(mr(t,"inbound-rtp")),s=dr(mr(t,"remote-inbound-rtp")),void 0===(null==a?void 0:a.average)?s:void 0===(null==s?void 0:s.average)?a:s.average>a.average?s:a);var a,s;const l=function(e,t,n){var i;if(0===e.length)return;const r=e[e.length-1],o=pr(r,"inbound-rtp",!0),a=pr(r,"remote-inbound-rtp",!0),s=function(e,t){return void 0===e.packetLossFraction?t:void 0===t.packetLossFraction?e:t.packetLossFraction>e.packetLossFraction?t:e}(br(o),br(a));let l=null==n?void 0:n.packets,c=null!==(i=s.packetsReceived)&&void 0!==i?i:null==t?void 0:t.packets;const d=s.packetsLost,u=s.packetLossFraction,h=ur(r);return void 0===l&&(l=cr(null==h?void 0:h.packetsSent)),void 0===c&&(c=cr(null==h?void 0:h.packetsReceived)),void 0!==l||void 0!==c||void 0!==d?{packetsSent:l,packetsReceived:c,packetsLost:d,packetLossFraction:u}:void 0}(t,n,i),c=function(e,t,n){if(0===e.length)return;const i=e[e.length-1];let r=null==n?void 0:n.bytes,o=null==t?void 0:t.bytes;const a=ur(i);return void 0===r&&(r=cr(null==a?void 0:a.bytesSent)),void 0===o&&(o=cr(null==a?void 0:a.bytesReceived)),void 0!==r||void 0!==o?{bytesSent:r,bytesReceived:o}:void 0}(t,n,i),d=function(e,t,n){if(e.length<2)return;const i=e[0],r=e[e.length-1],o=yr(i),a=yr(r);if(void 0===o||void 0===a)return;const s=(a-o)/1e3;if(s<=0)return;const l=void 0!==(null==n?void 0:n.bytesDelta)&&n.bytesDelta>=0?8*n.bytesDelta/s:void 0,c=void 0!==(null==t?void 0:t.bytesDelta)&&t.bytesDelta>=0?8*t.bytesDelta/s:void 0;return void 0!==l||void 0!==c?{outbound:l,inbound:c}:void 0}(t,n,i),u=function(e,t,n){let i=!1,r="good";return void 0!==(null==e?void 0:e.average)&&(i=!0,e.average>=500?r="poor":e.average>=300&&"good"===r&&(r="fair")),void 0!==(null==t?void 0:t.average)&&(i=!0,t.average>=100?r="poor":t.average>=30&&"good"===r&&(r="fair")),void 0!==(null==n?void 0:n.packetLossFraction)&&(i=!0,n.packetLossFraction>=.05?r="poor":n.packetLossFraction>=.02&&"good"===r&&(r="fair")),i?r:"unknown"}(r,o,l),h=function(e,t,n,i){const r=[];return void 0!==(null==e?void 0:e.average)&&(e.average>=500?r.push({code:"network_high_rtt",message:`Average RTT is ${Math.round(e.average)}ms (poor: ≥500ms threshold)`,source:"network"}):e.average>=300&&r.push({code:"network_high_rtt",message:`Average RTT is ${Math.round(e.average)}ms (degraded: ≥300ms threshold)`,source:"network"})),void 0!==(null==t?void 0:t.average)&&(t.average>=100?r.push({code:"network_high_jitter",message:`Average jitter is ${Math.round(t.average)}ms (poor: ≥100ms threshold)`,source:"network"}):t.average>=30&&r.push({code:"network_high_jitter",message:`Average jitter is ${Math.round(t.average)}ms (degraded: ≥30ms threshold)`,source:"network"})),void 0!==(null==n?void 0:n.packetLossFraction)&&(n.packetLossFraction>=.05?r.push({code:"network_packet_loss",message:`Packet loss is ${(100*n.packetLossFraction).toFixed(1)}% (poor: ≥5% threshold)`,source:"network"}):n.packetLossFraction>=.02&&r.push({code:"network_packet_loss",message:`Packet loss is ${(100*n.packetLossFraction).toFixed(1)}% (degraded: ≥2% threshold)`,source:"network"})),i&&(void 0!==i.outbound&&i.outbound<8e3&&r.push({code:"network_low_bitrate",message:`Outbound audio bitrate is ${Math.round(i.outbound)} bps (<8000 bps threshold)`,source:"network"}),void 0!==i.inbound&&i.inbound<8e3&&r.push({code:"network_low_bitrate",message:`Inbound audio bitrate is ${Math.round(i.inbound)} bps (<8000 bps threshold)`,source:"network"})),r}(r,o,l,"network-only"===e.options.mode?void 0:d);return{quality:u,rtt:r,jitter:o,packets:l,bytes:c,bitrate:d,inbound:n,outbound:i,reasons:h.length>0?h:void 0}}(t):void 0,c=e.modules.microphone?yield lr(t):void 0;return o={established:!0,setupFailed:!1,callId:i.id,ice:s,network:l,microphone:c,timings:n.build({call:i}),raw:{samples:t.statsSamples.length?t.statsSamples:void 0}},o}catch(e){return t.error=Mr(e),o={established:a,setupFailed:!1,callId:null==i?void 0:i.id,timings:n.build({call:i}),error:t.error},o}finally{if(e.diagnosticOptions.client.off("telnyx.error",s),i&&e.autoHangup)try{yield i.hangup()}catch(e){}(null==o?void 0:o.timings)&&n.complete(o.timings)}})}runMicrophoneOnly(e){return Z(this,void 0,void 0,function*(){const t=xr();let n;try{return n=Pr({microphone:this.options.microphone?yield lr(e):void 0,timings:t.build()},e.error),n}catch(i){return e.error=Mr(i),n=Pr({timings:t.build()},e.error),n}finally{(null==n?void 0:n.timings)&&t.complete(n.timings)}})}waitForCallEstablishment(e){return Z(this,void 0,void 0,function*(){const t=Date.now()+3e4,n=()=>{var t,n;return"active"===e.state&&"connected"===(null===(n=null===(t=e.peer)||void 0===t?void 0:t.instance)||void 0===n?void 0:n.connectionState)};for(;Date.now()<t;){if(n())return!0;if(["done","hangup","destroy"].includes(e.state))return!1;yield Fr(500)}return n()})}createDiagnosticCall(e,t,n=!1){const{client:i,destinationNumber:r,callerName:o,callerNumber:a,audio:s,debug:l,rtcConfig:c}=e;return i.newCall({destinationNumber:r,callerName:o,callerNumber:a,audio:s,debug:!0===l,iceServers:null!=t?t:null==c?void 0:c.iceServers,forceRelayCandidate:n})}collectSamples(e,t){var n,i,r;return Z(this,void 0,void 0,function*(){const o=null!==(n=t.options.durationMs)&&void 0!==n?n:5e3,a=null!==(i=t.options.statsSampleIntervalMs)&&void 0!==i?i:1e3,s=Date.now()+o;for(;Date.now()<s;){try{const n=yield null===(r=e.peer.instance)||void 0===r?void 0:r.getStats();n&&t.statsSamples.push(n)}catch(e){}yield Fr(Math.min(a,Math.max(0,s-Date.now())))}})}}function Pr(e,t,n){const{verdict:i,reasons:r,warnings:o}=function(e,t,n={}){var i,r;const o=[Nr(e.ice),Ar(e.network),Lr(e.microphone),...(null!==(i=e.serverTests)&&void 0!==i?i:[]).flatMap(e=>[Nr(e.ice,n.networkOnly&&tr(e.server)),Ar(e.network,!n.networkOnly),Or(e)])],a=o.flatMap(e=>e.reasons),s=o.flatMap(e=>e.warnings);let l=o.reduce((e,t)=>Ir(e,t.verdict),void 0);if(n.networkOnly&&(null===(r=e.serverTests)||void 0===r?void 0:r.length)){const t=e.serverTests.filter(e=>e.established&&!e.error).length;0===t?l="blocked":t<e.serverTests.length&&(l="degraded")}if(t)switch(t.code){case ue:a.push(Tr("microphone_capture_permission_denied","Microphone access was denied while establishing the diagnostic call.","microphone")),l=Ir(l,"permission_denied");break;case he:a.push(Tr("microphone_capture_no_device","No microphone device was available while establishing the diagnostic call.","microphone")),l=Ir(l,"blocked");break;case pe:a.push(Tr("microphone_capture_failed","Microphone capture failed while establishing the diagnostic call.","microphone")),l=Ir(l,"blocked");break;default:a.push(Tr("diagnostic_run_error",`Diagnostic run encountered an error: ${t.message}`,"diagnostic")),l=Ir(l,"blocked")}return{verdict:null!=l?l:"inconclusive",reasons:a,warnings:s}}(e,t,n);return Object.assign(Object.assign({},e),{version:1,verdict:null!=i?i:"inconclusive",reasons:r.length?r:void 0,warnings:o.length?o:void 0})}function Mr(e){return e instanceof Error?e:new Error(String(e))}function Fr(e){return new Promise(t=>setTimeout(t,e))}const jr="+1-872-231-5806";class zr extends Qi{constructor(e){const t=new Zi(Mn);super(e),this._registrationTimings=t,t.clientId=this.uuid,It.info(`SDK version: ${Mn}`),t.mark("TelnyxRTC constructor complete")}newCall(e){return super.newCall(e)}runPreCall(e={}){var t,n;return Z(this,void 0,void 0,function*(){const i={client:this,destinationNumber:null!==(t=e.destinationNumber)&&void 0!==t?t:jr,durationMs:e.durationMs,ice:!0,network:!0,microphone:!0,mode:"full",rtcConfig:{iceServers:null!==(n=e.iceServers)&&void 0!==n?n:this.iceServers}};return new Dr(i).run()})}runNetworkCheck(e={}){var t;return Z(this,void 0,void 0,function*(){const n={client:this,destinationNumber:jr,ice:!0,network:!0,microphone:!1,mode:"network-only",rtcConfig:{iceServers:null!==(t=e.iceServers)&&void 0!==t?t:this.iceServers}};return new Dr(n).run()})}runMicrophoneCheck(e={}){var t;return Z(this,void 0,void 0,function*(){const n={client:this,ice:!1,network:!1,microphone:{sampleDurationMs:e.durationMs,silenceThreshold:e.silenceThreshold,record:null!==(t=e.record)&&void 0!==t&&t,warnOnRecording:e.warnOnRecording},mode:"microphone-only"};return new Dr(n).run()})}static webRTCInfo(){return function(){try{const{browserInfo:e,name:t,version:n,supportAudio:i,supportVideo:r}=function(){if(!window||!window.navigator||!window.navigator.userAgent)throw new Error("You should use @telnyx/webrtc in a web browser such as Chrome|Firefox|Safari");if(navigator.userAgent.match(/chrom(e|ium)/gim)&&!navigator.userAgent.match(/OPR\/[0-9]{2}/gi)&&!navigator.userAgent.match(/edg/gim)){const e=navigator.userAgent.match(/chrom(e|ium)\/[0-9]+\./gim)[0].split("/"),t=e[0],n=parseInt(e[1],10);return{browserInfo:navigator.userAgent,name:t,version:n,supportAudio:!0,supportVideo:!0}}if(navigator.userAgent.match(/firefox/gim)&&!navigator.userAgent.match(/OPR\/[0-9]{2}/gi)&&!navigator.userAgent.match(/edg/gim)){const e=navigator.userAgent.match(/firefox\/[0-9]+\./gim)[0].split("/"),t=e[0],n=parseInt(e[1],10);return{browserInfo:navigator.userAgent,name:t,version:n,supportAudio:!0,supportVideo:!1}}if(navigator.userAgent.match(/safari/gim)&&!navigator.userAgent.match(/OPR\/[0-9]{2}/gi)&&!navigator.userAgent.match(/edg/gim)){const e=navigator.userAgent.match(/safari/gim)[0],t=navigator.userAgent.match(/version\/[0-9]+\./gim)[0].split("/"),n=parseInt(t[1],10);return{browserInfo:navigator.userAgent,name:e,version:n,supportAudio:!0,supportVideo:!0}}if(navigator.userAgent.match(/edg/gim)&&!navigator.userAgent.match(/OPR\/[0-9]{2}/gi)){const e=navigator.userAgent.match(/edg\/[0-9]+\./gim)[0].split("/"),t=e[0],n=parseInt(e[1],10);return{browserInfo:navigator.userAgent,name:t,version:n,supportAudio:!0,supportVideo:!0}}throw new Error("This browser does not support @telnyx/webrtc. To see browser support list: `TelnyxRTC.webRTCSupportedBrowserList()`")}(),o=window.RTCPeerConnection,a=window.RTCSessionDescription,s=window.RTCIceCandidate,l=window.navigator&&window.navigator.mediaDevices,c=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia;return{browserInfo:e,browserName:t,browserVersion:n,supportWebRTC:!!(o&&a&&s&&l&&c),supportWebRTCAudio:i,supportWebRTCVideo:r,supportRTCPeerConnection:!!o,supportSessionDescription:!!a,supportIceCandidate:!!s,supportMediaDevices:!!l,supportGetUserMedia:!!ai}}catch(e){return e.message}}()}static webRTCSupportedBrowserList(){return[{operationSystem:"Android",supported:[{browserName:"Chrome",features:["audio"],supported:mi.full},{browserName:"Firefox",features:["audio"],supported:mi.partial},{browserName:"Safari",supported:mi.not_supported},{browserName:"Edge",supported:mi.not_supported}]},{operationSystem:"iOS",supported:[{browserName:"Chrome",supported:mi.not_supported},{browserName:"Firefox",supported:mi.not_supported},{browserName:"Safari",features:["video","audio"],supported:mi.full},{browserName:"Edge",supported:mi.not_supported}]},{operationSystem:"Linux",supported:[{browserName:"Chrome",features:["video","audio"],supported:mi.full},{browserName:"Firefox",features:["audio"],supported:mi.partial},{browserName:"Safari",supported:mi.not_supported},{browserName:"Edge",supported:mi.not_supported}]},{operationSystem:"MacOS",supported:[{browserName:"Chrome",features:["video","audio"],supported:mi.full},{browserName:"Firefox",features:["audio"],supported:mi.partial},{browserName:"Safari",features:["video","audio"],supported:mi.full},{browserName:"Edge",features:["audio"],supported:mi.partial}]},{operationSystem:"Windows",supported:[{browserName:"Chrome",features:["video","audio"],supported:mi.full},{browserName:"Firefox",features:["audio"],supported:mi.partial},{browserName:"Safari",supported:mi.not_supported},{browserName:"Edge",features:["audio"],supported:mi.partial}]}]}}class Ur{constructor(){this.analyserNode=null,this.audioSource=null,this.animationId=null,this.audioContext=null}start(e,t){try{this.audioContext=new AudioContext,this.audioSource=this.audioContext.createMediaStreamSource(e),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=256,this.analyserNode.smoothingTimeConstant=.3,this.audioSource.connect(this.analyserNode);const n=new Float32Array(this.analyserNode.fftSize),i=()=>{if(!this.analyserNode)return void this.stop();this.analyserNode.getFloatTimeDomainData(n);let e=0;for(const t of n)e+=t*t;const r=Math.sqrt(e/n.length),o=Math.min(1,10*r);t((o>.01?o:0).toFixed(3)),this.animationId=requestAnimationFrame(i)};i()}catch{}}stop(){if(null!==this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=null),this.audioSource){try{this.audioSource.disconnect()}catch{}this.audioSource=null}this.audioContext&&(this.audioContext.close().catch(()=>{}),this.audioContext=null),this.analyserNode=null}}const $r={NotAllowedError:"Microphone permission denied",NotFoundError:"No microphone found",NotReadableError:"Microphone is in use by another application",OverconstrainedError:"Microphone does not support required settings"};class Br{constructor(e){this.options=e,this.client=null,this.call=null,this.localStream=null,this.remoteAudio=null,this.audioMonitor=null,this.state="idle",this.eventListeners=new Map,this.connectResolve=null,this.connectReject=null,this.readyTimeout=null,this.cleaningUp=!1,this.handleReady=()=>{if(this.client&&this.localStream){try{this.call=this.client.newCall({destinationNumber:"moveo-test",audio:!0,localStream:this.localStream,remoteElement:this.ensureRemoteAudioElement()})}catch(e){const t=e instanceof Error?e.message:"Failed to start Telnyx call";return this.emitError(t),void this.cleanup()}this.audioMonitor=new Ur,this.audioMonitor.start(this.localStream,e=>{this.emit("audio-level",e,Number(e))})}},this.handleClientError=e=>{const t=e instanceof Error?e.message:"object"==typeof e&&e&&"message"in e?String(e.message):"Telnyx client error";this.emitError(t),this.cleanup()},this.handleNotification=e=>{if("userMediaError"===e.type)return this.emitError(e.error?.message||"Microphone access failed"),void this.cleanup();if("callUpdate"!==e.type||!e.call)return;const t=e.call.state;switch(t){case"new":break;case"trying":case"requesting":case"ringing":this.setState("connecting");break;case"active":this.setState("connected"),this.clearReadyTimeout(),this.connectResolve?.(),this.connectResolve=null,this.connectReject=null;break;case"held":this.emitError("Call on hold"),this.cleanup();break;case"hangup":case"destroy":case"purge":"hangup"!==t&&this.emitError("Call ended unexpectedly"),this.cleanup(!0);break;default:this.emitError(`Unexpected call state: ${t}`),this.cleanup()}}}async connect(){let e;this.setState("connecting");try{e=await this.fetchToken()}catch(e){const t=e instanceof Error?e.message:"Token fetch failed";throw this.emitError(t),new Error(t)}try{this.localStream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch(e){const t=e instanceof Error?e.name:"",n=$r[t]||"Microphone access failed";throw this.emitError(n),new Error(n)}return this.client=new zr({login_token:e}),this.client.on("telnyx.ready",this.handleReady),this.client.on("telnyx.error",this.handleClientError),this.client.on("telnyx.notification",this.handleNotification),this.client.connect(),new Promise((e,t)=>{this.connectResolve=e,this.connectReject=t,this.readyTimeout=setTimeout(()=>{this.connectReject&&(this.emitError("Could not connect to Telnyx"),this.cleanup())},15e3)})}disconnect(){this.cleanup()}toggleMute(){return!!this.call&&(this.call.isAudioMuted?(this.call.unmuteAudio(),!1):(this.call.muteAudio(),!0))}isMuted(){return this.call?.isAudioMuted??!1}sendDigits(e){if(this.call)for(const t of e)this.call.dtmf(t)}on(e,t){const n=this.eventListeners.get(e)??new Set;return n.add(t),this.eventListeners.set(e,n),()=>this.off(e,t)}off(e,t){const n=this.eventListeners.get(e);n&&(n.delete(t),0===n.size&&this.eventListeners.delete(e))}async fetchToken(){const e=`${this.options.host}/v1/telnyxvoice/${encodeURIComponent(this.options.integrationId)}/token`,t=await fetch(e,{method:"GET"});if(!t.ok){if(404===t.status)throw new Error(`Integration ID "${this.options.integrationId}" was not found.`);throw new Error(`Unable to fetch Telnyx token (status ${t.status} ${t.statusText}).`)}const n=(await t.text()).trim();if(!n)throw new Error("Empty token response from Telnyx token endpoint");let i;try{i=JSON.parse(n)}catch{return n}if(i&&"object"==typeof i&&"token"in i&&"string"==typeof i.token)return i.token;throw new Error(`Unexpected Telnyx token response shape: ${n.slice(0,200)}`)}ensureRemoteAudioElement(){return this.remoteAudio||(this.remoteAudio=document.createElement("audio"),this.remoteAudio.autoplay=!0,document.body.appendChild(this.remoteAudio)),this.remoteAudio}cleanup(e=!1){if(!this.cleaningUp){this.cleaningUp=!0,this.clearReadyTimeout(),this.client&&(this.client.off("telnyx.ready",this.handleReady),this.client.off("telnyx.error",this.handleClientError),this.client.off("telnyx.notification",this.handleNotification)),this.call=null;try{this.audioMonitor?.stop()}catch{}if(this.audioMonitor=null,this.client)try{(e?this.client.serverDisconnect():this.client.disconnect()).catch(()=>{})}catch{}this.client=null;try{this.localStream?.getTracks().forEach(e=>e.stop())}catch{}if(this.localStream=null,this.remoteAudio){try{this.remoteAudio.srcObject=null,this.remoteAudio.remove()}catch{}this.remoteAudio=null}this.connectReject&&this.connectReject(new Error("Call disconnected before connection completed")),this.connectResolve=null,this.connectReject=null,this.setState("idle"),this.cleaningUp=!1}}clearReadyTimeout(){this.readyTimeout&&(clearTimeout(this.readyTimeout),this.readyTimeout=null)}setState(e){this.state!==e&&(this.state=e,this.emit("state-change",e,e))}emitError(e){this.emit("error",e),this.setState("error")}emit(e,t,n){const i={state:e,message:t,data:n},r=e=>{const t=this.eventListeners.get(e);t&&t.forEach(e=>{try{e(i)}catch{}})};r(e),r("any")}}class Hr{constructor(e){this.provider=null,this.widgetRoot=null,this.widgetContainer=null,this.widgetKey=0,this.prevProviderState=null,this.mq=null,this.mqListener=null,this.config={host:e.host||"https://channels.moveo.ai",integrationId:e.integrationId},this.log=y()(`moveo:telnyx:controller:${e.integrationId}`)}async init(){return this.provider=new Br({integrationId:this.config.integrationId,host:this.config.host}),this.provider.on("state-change",({data:e})=>{const t=e,n=this.prevProviderState;"idle"!==t||"connected"!==n&&"reconnecting"!==n||this.resetWidget(),this.prevProviderState=t}),this.createWidgetContainer(),this.renderWidget(),this.log("TelnyxController initialized"),this}async startCall(){await(this.provider?.connect())}endCall(){this.provider?.disconnect()}toggleMute(){this.provider?.toggleMute()}isMuted(){return this.provider?.isMuted()??!1}sendDigits(e){this.provider?.sendDigits(e)}on(e,t){return this.provider?.on(e,t)??(()=>{})}off(e,t){this.provider?.off(e,t)}destroy(){this.provider?.disconnect(),this.provider=null,this.mq&&this.mqListener&&this.mq.removeEventListener("change",this.mqListener),this.mq=null,this.mqListener=null,this.widgetRoot&&(this.widgetRoot.unmount(),this.widgetRoot=null),this.widgetContainer&&(document.body.removeChild(this.widgetContainer),this.widgetContainer=null)}createWidgetContainer(){this.widgetContainer=document.createElement("div"),this.widgetContainer.id="moveo-telnyx-widget",this.widgetContainer.style.position="fixed",this.widgetContainer.style.zIndex="2147483647",this.widgetContainer.style.bottom="20px",this.widgetContainer.style.right="20px",this.applyDarkMode(),document.body.appendChild(this.widgetContainer)}applyDarkMode(){if(!this.widgetContainer||"function"!=typeof window.matchMedia)return;this.mq=window.matchMedia("(prefers-color-scheme: dark)");const e=e=>{this.widgetContainer?.classList.toggle("dark",e)};e(this.mq.matches),this.mqListener=t=>e(t.matches),this.mq.addEventListener("change",this.mqListener)}resetWidget(){this.widgetKey++,this.widgetRoot&&this.renderWidgetElement()}renderWidget(){if(!this.widgetContainer)throw new Error("Widget container not created");this.widgetRoot=(0,e().createRoot)(this.widgetContainer),this.renderWidgetElement()}renderWidgetElement(){this.widgetRoot.render((0,s().createElement)(J,{key:this.widgetKey,onStartCall:this.startCall.bind(this),onEndCall:this.endCall.bind(this),onToggleMute:this.toggleMute.bind(this),isMuted:this.isMuted.bind(this),onSendDigits:this.sendDigits.bind(this),onEvent:this.on.bind(this)}))}}const Wr=e=>"string"==typeof e,Vr=()=>{let e,t;const n=new Promise((n,i)=>{e=n,t=i});return n.resolve=e,n.reject=t,n},qr=e=>null==e?"":String(e),Gr=/###/g,Kr=e=>e&&e.includes("###")?e.replace(Gr,"."):e,Yr=e=>!e||Wr(e),Qr=(e,t,n)=>{const i=Wr(t)?t.split("."):t;let r=0;for(;r<i.length-1;){if(Yr(e))return{};const t=Kr(i[r]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return Yr(e)?{}:{obj:e,k:Kr(i[r])}},Jr=(e,t,n)=>{const{obj:i,k:r}=Qr(e,t,Object);if(void 0!==i||1===t.length)return void(i[r]=n);let o=t[t.length-1],a=t.slice(0,t.length-1),s=Qr(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=Qr(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},Xr=(e,t)=>{const{obj:n,k:i}=Qr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},Zr=(e,t,n)=>{for(const i in t)"__proto__"!==i&&"constructor"!==i&&(Object.prototype.hasOwnProperty.call(e,i)?Wr(e[i])||e[i]instanceof String||Wr(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):Zr(e[i],t[i],n):e[i]=t[i]);return e},eo=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),to={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},no=e=>Wr(e)?e.replace(/[&<>"'\/]/g,e=>to[e]):e,io=[" ",",","?","!",";"],ro=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),oo=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const i=t.split(n);let r=e;for(let e=0;e<i.length;){if(!r||"object"!=typeof r)return;let t,o="";for(let a=e;a<i.length;++a)if(a!==e&&(o+=n),o+=i[a],t=r[o],"function"!=typeof t&&"__proto__"!==o||Object.prototype.hasOwnProperty.call(r,o)||(t=void 0),void 0!==t){if(["string","number","boolean"].includes(typeof t)&&a<i.length-1)continue;e+=a-e+1;break}r=t}return r},ao=e=>e?.replace(/_/g,"-"),so={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class lo{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||so,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,i){return i&&!this.debug?null:(e=e.map(e=>Wr(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g," "):e),Wr(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new lo(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new lo(this.logger,e)}}var co=new lo;class uo{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}once(e,t){const n=(...i)=>{t(...i),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let i=0;i<n;i++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,i])=>{for(let r=0;r<i;r++)n(e,...t)})}}const ho=new WeakSet;class po extends uo{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,i={}){const r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.includes(".")?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):Wr(n)&&r?a.push(...n.split(r)):a.push(n)));const s=Xr(this.data,a);return null!=s||t||n||!e.includes(".")||(e=a[0],t=a[1],n=a.slice(2).join(".")),null==s&&o&&Wr(n)?oo(this.data?.[e]?.[t],n,r):s}addResource(e,t,n,i,r={silent:!1}){const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.includes(".")&&(a=e.split("."),i=t,t=a[1]),this.addNamespaces(t),Jr(this.data,a,i),r.silent||this.emit("added",e,t,n,i)}addResources(e,t,n,i={silent:!1}){for(const i in n)(Wr(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});i.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,i,r,o={silent:!1,skipCopy:!1}){let a=[e,t];e.includes(".")&&(a=e.split("."),i=n,n=t,t=a[1]),this.addNamespaces(t);let s=Xr(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?Zr(s,n,r):s={...s,...n},Jr(this.data,a,s),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>{const n=t[e];return!!ho.has(n)||!(!n||0===Object.keys(n).length)&&("object"==typeof n&&ho.add(n),!0)})}toJSON(){return this.data}}var fo={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(e=>{t=this.processors[e]?.process(t,n,i,r)??t}),t}};const go=Symbol("i18next/PATH_KEY");function vo(e,t){const{[go]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>(n?.revoke?.(),r===go?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}()),i=t?.keySeparator??".",r=t?.nsSeparator??":",o="strict"===t?.enableSelector;if(n.length>1&&r){const e=t?.ns,a=o?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(a&&(o?a:a.length>1?a.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const mo=e=>!Wr(e)&&"boolean"!=typeof e&&"number"!=typeof e;class bo extends uo{constructor(e,t={}){var n,i;super(),n=e,i=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(i[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=co.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const i=this.resolve(e,n);if(void 0===i?.res)return!1;const r=mo(i.res);return!1!==n.returnObjects||!r}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const o=n&&e.includes(n),a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const i=io.filter(e=>!t.includes(e)&&!n.includes(e));if(0===i.length)return!0;const r=ro.getRegExp(`(${i.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!r.test(e);if(!o){const t=e.indexOf(n);t>0&&!r.test(e.substring(0,t))&&(o=!0)}return o})(e,n,i));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Wr(r)?[r]:r};const o=e.split(n);(n!==i||n===i&&this.options.ns.includes(o[0]))&&(r=o.shift()),e=o.join(i)}return{key:e,namespaces:Wr(r)?[r]:r}}translate(e,t,n){let i="object"==typeof t?{...t}:t;if("object"!=typeof i&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof i&&(i={...i}),i||(i={}),null==e)return"";"function"==typeof e&&(e=vo(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(e=>"function"==typeof e?vo(e,{...this.options,...i}):String(e));const r=void 0!==i.returnDetails?i.returnDetails:this.options.returnDetails,o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],i),l=s[s.length-1];let c=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const d=i.lng||this.language,u=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===d?.toLowerCase())return u?r?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${c}${a}`:r?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:a;const h=this.resolve(e,i);let p=h?.res;const f=h?.usedKey||a,g=h?.exactUsedKey||a,v=void 0!==i.joinArrays?i.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==i.count&&!Wr(i.count),y=bo.hasDefaultValue(i),w=b?this.pluralResolver.getSuffix(d,i.count,i):"",k=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):"",_=b&&!i.ordinal&&0===i.count,S=_&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${w}`]||i[`defaultValue${k}`]||i.defaultValue;let x=p;m&&!p&&y&&(x=S);const C=mo(x),E=Object.prototype.toString.apply(x);if(!(m&&x&&C)||["[object Number]","[object Function]","[object RegExp]"].includes(E)||Wr(v)&&Array.isArray(x))if(m&&Wr(v)&&Array.isArray(p))p=p.join(v),p&&(p=this.extendTranslation(p,e,i,h,n));else{let t=!1,r=!1;!this.isValidLookup(p)&&y&&(t=!0,p=S),this.isValidLookup(p)||(r=!0,p=a);const s=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:p,u=y&&S!==p&&this.options.updateMissing;if(r||t||u){if(this.logger.log(u?"updateKey":"missingKey",d,l,b&&!u?`${a}${this.pluralResolver.getSuffix(d,i.count,i)}`:a,u?S:p),o){const e=this.resolve(a,{...i,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);const n=(e,t,n)=>{const r=y&&n!==p?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,u,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,u,i),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,i);_&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,i[`defaultValue${t}`]||S)})}):n(e,a,S))}p=this.extendTranslation(p,e,i,h,n),r&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${l}${c}${a}`),(r||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,t?p:void 0,i))}else{if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,x,{...i,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(h.res=e,h.usedParams=this.getUsedParamsDetails(i),h):e}if(o){const e=Array.isArray(x),t=e?[]:{},n=e?g:f;for(const e in x)if(Object.prototype.hasOwnProperty.call(x,e)){const r=`${n}${o}${e}`;t[e]=y&&!p?this.translate(r,{...i,defaultValue:mo(S)?S[e]:void 0,joinArrays:!1,ns:s}):this.translate(r,{...i,joinArrays:!1,ns:s}),t[e]===r&&(t[e]=x[e])}p=t}}return r?(h.res=p,h.usedParams=this.getUsedParamsDetails(i),h):p}extendTranslation(e,t,n,i,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const o=Wr(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!Wr(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||i.usedLng,n),o){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>r?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,a=Wr(o)?[o]:o;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=fo.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,i,r,o,a;return Wr(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>"function"==typeof e?vo(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;i=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==t.count&&!Wr(t.count),u=d&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Wr(t.context)||"number"==typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(a=e,this.checkedLoadedFor[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(i=>{if(this.isValidLookup(n))return;o=i;const a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,i,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(i,t.count,t));const n=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&e.startsWith(r)&&a.push(l+e.replace(r,this.options.pluralSeparator)),a.push(l+e),u&&a.push(l+n)),h){const i=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(i),d&&(t.ordinal&&e.startsWith(r)&&a.push(i+e.replace(r,this.options.pluralSeparator)),a.push(i+e),u&&a.push(i+n))}}let s;for(;s=a.pop();)this.isValidLookup(n)||(r=s,n=this.getResource(i,e,s,t))}))})}),{res:n,usedKey:i,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,i):this.resourceStore.getResource(e,t,n,i)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Wr(e.replace);let i=n?e.replace:e;if(n&&void 0!==e.count&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const e of t)delete i[e]}return i}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class yo{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=co.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(!(e=ao(e))||!e.includes("-"))return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=ao(e))||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Wr(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(e=>e===i||!(!e.includes("-")&&!i.includes("-"))&&!(!e.includes("-")||i.includes("-")||e.slice(0,e.indexOf("-"))!==i))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Wr(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.options.fallbackLng,i=Array.isArray(n)?n.join("|"):n;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);const r=void 0===t||!1===t||Wr(t),o=void 0===t&&"function"==typeof this.options.fallbackLng;let a=null;if(Wr(e)&&r&&!o){let n;n=void 0===t?"undefined":!1===t?"boolean:false":`string:${t}`,a=`${e.length}:${e}|${n}`}if(null!==a){const e=this.resolveHierarchyCache[a];if(void 0!==e)return e.slice()}const s=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),l=[],c=e=>{e&&(this.isSupportedCode(e)?l.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Wr(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&c(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&c(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&c(this.getLanguagePartFromCode(e))):Wr(e)&&c(this.formatLanguageCode(e)),s.forEach(e=>{const t=this.formatLanguageCode(e);l.includes(t)||c(t)}),null!==a?(this.resolveHierarchyCache[a]=l,l.slice()):l}}const wo={zero:0,one:1,two:2,few:3,many:4,other:5},ko={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _o{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=co.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=ao("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:n,type:i});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let o;try{o=new Intl.PluralRules(n,{type:i})}catch(n){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),ko;if(!e.match(/-|_/))return ko;const i=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(i,t)}return this.pluralRulesCache[r]=o,o}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>wo[e]-wo[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const So=(e,t,n,i=".",r=!0)=>{let o=((e,t,n)=>{const i=Xr(e,n);return void 0!==i?i:Xr(t,n)})(e,t,n);return!o&&r&&Wr(n)&&(o=oo(e,n,i),void 0===o&&(o=oo(t,n,i))),o};class xo{constructor(e={}){this.logger=co.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:i,prefix:r,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:f,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:m}=e.interpolation;this.escape=void 0!==t?t:no,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==i&&i,this.prefix=r?eo(r):o||"{{",this.suffix=a?eo(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d?eo(d):"-",this.unescapeSuffix=this.unescapePrefix?"":c?eo(c):"",this.nestingPrefix=u?eo(u):h||eo("$t("),this.nestingSuffix=p?eo(p):f||eo(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==m&&m,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,i){let r,o,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(!e.includes(this.formatSeparator)){const r=So(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(r,void 0,n,{...i,...t,interpolationkey:e}):r}const r=e.split(this.formatSeparator),o=r.shift().trim(),a=r.join(this.formatSeparator).trim();return this.format(So(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...i,...t,interpolationkey:o})};this.resetRegExp(),!this.escapeValue&&"string"==typeof e&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const c=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=void 0!==i?.interpolation?.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,u=[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}],h=[];let p=0;return u.forEach(t=>{for(a=0;r=t.regex.exec(e);){const n=r.index-p,s=h.find(([e,t])=>n>=e&&n<t);if(s){t.regex.lastIndex=s[1]+p;continue}const u=r[1].trim();if(o=l(u),void 0===o)if("function"==typeof c){const t=c(e,r,i);o=Wr(t)?t:""}else if(i&&Object.prototype.hasOwnProperty.call(i,u))o="";else{if(d){o=r[0];continue}this.logger.warn(`missed to pass in variable ${u} for interpolating ${e}`),o=""}else Wr(o)||this.useRawValueToEscape||(o=qr(o));const f=qr(t.safeValue(o));if(e=e.slice(0,r.index)+f+e.slice(r.index+r[0].length),d?(t.regex===this.regexpUnescape?h.push([r.index,r.index+f.length]):p+=f.length-r[0].length,t.regex.lastIndex+=f.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let i,r,o;const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(!e.includes(n))return e;const i=e.split(new RegExp(`${eo(n)}[ ]*{`));let r=`{${i[1]}`;e=i[0],r=this.interpolate(r,o);const a=r.match(/'/g),s=r.match(/"/g);((a?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(r=r.replace(/'/g,'"'));try{o=JSON.parse(r),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${r}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,e},s=new RegExp(this.nestingRegexp);let l="",c=0;for(;i=s.exec(e);){let d=[];o={...n},o=o.replace&&!Wr(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(-1!==u&&(d=i[1].slice(u).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),r=t(a.call(this,i[1].trim(),o),o),r&&i[0]===e&&!Wr(r))return r;Wr(r)||(r=qr(r)),r||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),r=""),d.length&&(r=d.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:i[1].trim()}),r.trim())),l+=e.slice(c,i.index)+qr(r),c=s.lastIndex,this.regexp.lastIndex=0}return c?l+e.slice(c):e}}const Co=e=>{const t={};return(n,i,r)=>{let o,a=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(a={...a,[r.interpolationkey]:void 0});try{o=i+JSON.stringify(a)}catch(t){return e(ao(i),r)(n)}let s=t[o];return s||(s=e(ao(i),r),t[o]=s),s(n)}},Eo=e=>(t,n,i)=>e(ao(n),i)(t);class Io{constructor(e={}){this.logger=co.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Co:Eo;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Co(t)}format(e,t,n,i={}){if(!t)return e;if(null==e)return e;const r=t.split(this.formatSeparator),o=[];for(let e=0;e<r.length;e++){let t=r[e];for(;t.indexOf("(")>-1&&!t.includes(")")&&e+1<r.length;)t=`${t}${this.formatSeparator}${r[++e]}`;o.push(t)}const a=o.reduce((e,t)=>{const{formatName:r,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);"currency"!==t||r.includes(":")?"relativetime"!==t||r.includes(":")?r.split(";").forEach(e=>{if(e){const[t,...i]=e.split(":"),r=i.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=r),"false"===r&&(n[o]=!1),"true"===r&&(n[o]=!0),isNaN(r)||(n[o]=parseInt(r,10))}}):n.range||(n.range=r.trim()):n.currency||(n.currency=r.trim())}return{formatName:t,formatOptions:n}})(t);if(this.formats[r]){let t=e;try{const a=i?.formatParams?.[i.interpolationkey]||{},s=a.locale||a.lng||i.locale||i.lng||n;t=this.formats[r](e,s,{...o,...i,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${r}`),e},e);return a}}class To extends uo{constructor(e,t,n,i={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=co.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,i.backend,i)}queueLoad(e,t,n,i){const r={},o={},a={},s={};return e.forEach(e=>{let i=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,i=!1,void 0===o[a]&&(o[a]=!0),void 0===r[a]&&(r[a]=!0),void 0===s[t]&&(s[t]=!0)))}),i||(a[e]=!0)}),(Object.keys(r).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(r),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const i=e.split("|"),r=i[0],o=i[1];t&&this.emit("failedLoading",r,o,t),!t&&n&&this.store.addResourceBundle(r,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:i,k:r}=Qr(e,t,Object);i[r]=i[r]||[],i[r].push(n)})(n.loaded,[r],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,i=0,r=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:r,callback:o});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&i<this.maxRetries?setTimeout(()=>{this.read(e,t,n,i+1,2*r,o)},r):o(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Wr(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Wr(t)&&(t=[t]);const r=this.queueLoad(e,t,n,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),i=n[0],r=n[1];this.read(i,r,"read",void 0,void 0,(n,o)=>{n&&this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${i}`,o),this.loaded(e,n,o)})}saveMissing(e,t,n,i,r,o={},a=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const s={...o,isUpdate:r},l=this.backend.create.bind(this.backend);if(l.length<6)try{let r;r=5===l.length?l(e,t,n,i,s):l(e,t,n,i),r&&"function"==typeof r.then?r.then(e=>a(null,e)).catch(a):a(null,r)}catch(e){a(e)}else l(e,t,n,i,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,i)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Ro=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Wr(e[1])&&(t.defaultValue=e[1]),Wr(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),No=e=>(Wr(e.ns)&&(e.ns=[e.ns]),Wr(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Wr(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Oo=()=>{};class Ao extends uo{constructor(e={},t){var n;if(super(),this.options=No(e),this.services={},this.logger=co,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Wr(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=Ro();this.options={...n,...this.options,...No(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?co.init(i(this.modules.logger),this.options):co.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Io;const t=new yo(this.options);this.store=new po(this.options.resources,this.options);const n=this.services;n.logger=co,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new _o(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=i(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new xo(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new To(i(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=i(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=i(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new bo(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Oo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const r=Vr(),o=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),r}loadResources(e,t=Oo){let n=t;const i=Wr(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===i?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&(e.includes(t)||e.push(t))})};i?t(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const i=Vr();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Oo),this.services.backendConnector.reload(e,t,e=>{i.resolve(),n(e)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&fo.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!["cimode","dev"].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}this.resolvedLanguage||this.languages.includes(e)||!this.store.hasLanguageSomeTranslations(e)||(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Vr();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(r,o)=>{o?this.isLanguageChangingTo===e&&(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(r,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Wr(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Wr(t)?[t]:t);o&&(this.language||i(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{r(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}getFixedT(e,t,n,i){const r=i?.scopeNs,o=(e,t,...i)=>{let a;a="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},a.lng=a.lng||o.lng,a.lngs=a.lngs||o.lngs;const s=void 0!==a.ns&&null!==a.ns;a.ns=a.ns||o.ns,""!==a.keyPrefix&&(a.keyPrefix=a.keyPrefix||n||o.keyPrefix);const l={...this.options,...a};Array.isArray(r)&&!s&&(l.ns=r),"function"==typeof a.keyPrefix&&(a.keyPrefix=vo(a.keyPrefix,l));const c=this.options.keySeparator||".";let d;return a.keyPrefix&&Array.isArray(e)?d=e.map(e=>("function"==typeof e&&(e=vo(e,l)),`${a.keyPrefix}${c}${e}`)):("function"==typeof e&&(e=vo(e,l)),d=a.keyPrefix?`${a.keyPrefix}${c}${e}`:e),this.t(d,a)};return Wr(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}if(this.hasResourceBundle(n,e))return!0;if(!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:a}=this.services,s=t.lng?a.isSupportedCode(n)&&a.toResolveHierarchy(n,!1)[0]:n;return!(s&&!o(s,e)||i&&!o(r,e))}loadNamespaces(e,t){const n=Vr();return this.options.ns?(Wr(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Vr();Wr(e)&&(e=[e]);const i=this.options.preload||[],r=e.filter(e=>!i.includes(e)&&this.services.languageUtils.isSupportedCode(e));return r.length?(this.options.preload=i.concat(r),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new yo(Ro());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new Ao(e,t);return n.createInstance=Ao.createInstance,n}cloneInstance(e={},t=Oo){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,preload:!1,...e,isClone:!0},r=new Ao(i);if(void 0===e.debug&&void 0===e.prefix||(r.logger=r.logger.clone(e)),["store","services","language"].forEach(e=>{r[e]=this[e]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n){const e=t=>{const n=Array.isArray(t)?[...t]:{...t};return Object.keys(n).forEach(t=>{n[t]&&"object"==typeof n[t]&&(n[t]=e(n[t]))}),n},t=e(this.store.data);r.store=new po(t,i),r.services.resourceStore=r.store}if(e.interpolation){const t={...Ro().interpolation,...this.options.interpolation,...e.interpolation},n={...i,interpolation:t};r.services.interpolator=new xo(n)}return r.translator=new bo(r.services,i),r.translator.on("*",(e,...t)=>{r.emit(e,...t)}),r.init(i,t),r.translator.options=i,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Lo=Ao.createInstance(),{slice:Do,forEach:Po}=(Lo.createInstance,Lo.dir,Lo.init,Lo.loadResources,Lo.reloadResources,Lo.use,Lo.changeLanguage,Lo.getFixedT,Lo.t,Lo.exists,Lo.setDefaultNamespace,Lo.hasLoadedNamespace,Lo.loadNamespaces,Lo.loadLanguages,[]),Mo=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Fo={create(e,t,n,i,r={path:"/",sameSite:"strict"}){n&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+60*n*1e3)),i&&(r.domain=i),document.cookie=((e,t,n={path:"/"})=>{const i=n;let r=`${e}=${encodeURIComponent(t)}`;if(i.maxAge>0){const e=i.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(e)}`}if(i.domain){if(!Mo.test(i.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${i.domain}`}if(i.path){if(!Mo.test(i.path))throw new TypeError("option path is invalid");r+=`; Path=${i.path}`}if(i.expires){if("function"!=typeof i.expires.toUTCString)throw new TypeError("option expires is invalid");r+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(r+="; HttpOnly"),i.secure&&(r+="; Secure"),i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(r+="; Partitioned"),r})(e,t,r)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let i=n[e];for(;" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var jo={name:"cookie",lookup({lookupCookie:e}){if(e&&"undefined"!=typeof document)return Fo.read(e)||void 0},cacheUserLanguage(e,{lookupCookie:t,cookieMinutes:n,cookieDomain:i,cookieOptions:r}){t&&"undefined"!=typeof document&&Fo.create(t,e,n,i,r)}},zo={name:"querystring",lookup({lookupQuerystring:e}){let t;if("undefined"!=typeof window){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const i=n.substring(1).split("&");for(let n=0;n<i.length;n++){const r=i[n].indexOf("=");r>0&&i[n].substring(0,r)===e&&(t=i[n].substring(r+1))}}return t}},Uo={name:"hash",lookup({lookupHash:e,lookupFromHashIndex:t}){let n;if("undefined"!=typeof window){const{hash:i}=window.location;if(i&&i.length>2){const r=i.substring(1);if(e){const t=r.split("&");for(let i=0;i<t.length;i++){const r=t[i].indexOf("=");r>0&&t[i].substring(0,r)===e&&(n=t[i].substring(r+1))}}if(n)return n;if(!n&&t>-1){const e=i.match(/\/([a-zA-Z][a-zA-Z0-9-]*)?/g);if(!Array.isArray(e))return;const n="number"==typeof t?t:0;return e[n]?.replace("/","")}}}return n}};let $o=null;const Bo=()=>{if(null!==$o)return $o;try{if($o="undefined"!=typeof window&&null!==window.localStorage,!$o)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){$o=!1}return $o};var Ho={name:"localStorage",lookup({lookupLocalStorage:e}){if(e&&Bo())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(e,{lookupLocalStorage:t}){t&&Bo()&&window.localStorage.setItem(t,e)}};let Wo=null;const Vo=()=>{if(null!==Wo)return Wo;try{if(Wo="undefined"!=typeof window&&null!==window.sessionStorage,!Wo)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Wo=!1}return Wo};var qo={name:"sessionStorage",lookup({lookupSessionStorage:e}){if(e&&Vo())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(e,{lookupSessionStorage:t}){t&&Vo()&&window.sessionStorage.setItem(t,e)}},Go={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:i}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),i&&t.push(i)}return t.length>0?t:void 0}},Ko={name:"htmlTag",lookup({htmlTag:e}){let t;const n=e||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},Yo={name:"path",lookup({lookupFromPathIndex:e}){if("undefined"==typeof window)return;const t=window.location.pathname.match(/\/([a-zA-Z][a-zA-Z0-9-]*)?/g);if(!Array.isArray(t))return;const n="number"==typeof e?e:0;return t[n]?.replace("/","")}},Qo={name:"subdomain",lookup({lookupFromSubdomainIndex:e}){const t="number"==typeof e?e+1:1,n="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5}(?:-(?:[a-z]{4}|[a-z]{2}|\d{3}))*)\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};let Jo=!1;try{document.cookie,Jo=!0}catch(ht){}const Xo=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Jo||Xo.splice(1,1);class Zo{constructor(e,t={}){this.type="languageDetector",this.detectors={},this.init(e,t)}init(e={languageUtils:{}},t={},n={}){this.services=e,this.options=function(e){return Po.call(Do.call(arguments,1),t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])}),e}(t,this.options||{},{order:Xo,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(jo),this.addDetector(zo),this.addDetector(Ho),this.addDetector(qo),this.addDetector(Go),this.addDetector(Ko),this.addDetector(Yo),this.addDetector(Qo),this.addDetector(Uo)}addDetector(e){return this.detectors[e.name]=e,this}detect(e=this.options.order){let t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>{return null!=e&&!("string"==typeof(t=e)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(e=>e.test(t)));var t}).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e,t=this.options.caches){t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}}Zo.type="languageDetector";const ea={type:"3rdParty",init(e){((e={})=>{D={...D,...e}})(e.options.react),(e=>{N=e})(e)}},ta=JSON.parse('{"Gp":{"actions":{"cancel":"Ακύρωση δοκιμαστικής κλήσης ήχου","end":"Τερματισμός δοκιμαστικής κλήσης ήχου","end_call":"Τερματισμός κλήσης","start":"Έναρξη δοκιμαστικής κλήσης ήχου","start_call":"Έναρξη κλήσης"},"composer_placeholder":"Μπορείτε και να γράψετε…","dtmf":{"label":"Πληκτρολόγιο DTMF","toggle":"Πληκτρολόγιο"},"end_confirm":{"title":"Τερματισμός κλήσης;"},"errors":{"generic":"Παρουσιάστηκε σφάλμα","start_failed":"Δεν ήταν δυνατή η έναρξη της κλήσης"},"mute":{"mute":"Σίγαση","mute_microphone":"Σίγαση μικροφώνου","unmute":"Άρση σίγασης","unmute_microphone":"Άρση σίγασης μικροφώνου"},"sr":{"connected":"Η κλήση συνδέθηκε","connected_thinking":"Η κλήση συνδέθηκε, δημιουργία απάντησης","connecting":"Σύνδεση κλήσης","error":"Σφάλμα κλήσης","error_with_message":"Σφάλμα κλήσης: {{message}}","ready":"Έτοιμο για πραγματοποίηση κλήσης"},"status":{"connecting":"Σύνδεση","error":"Σφάλμα","listening":"Ακούει","muted":"Σίγαση","on_call":"Σε κλήση","ready":"Έτοιμο","reconnecting":"Επανασύνδεση","speaking":"Μιλάει","thinking":"Σκέφτεται"},"transcript":{"call_ended":"Η φωνητική κλήση έληξε · <0>{{duration}}</0>","call_started":"Η κλήση ξεκίνησε · <0>{{time}}</0>","reconnected":"Επανασυνδέθηκε","typed":"Πληκτρολογήθηκε"}}}'),na=JSON.parse('{"Gp":{"actions":{"cancel":"Cancel audio preview call","end":"End audio preview call","end_call":"End call","start":"Start audio preview call","start_call":"Start a call"},"composer_placeholder":"You can type too…","dtmf":{"label":"DTMF keypad","toggle":"Keypad"},"end_confirm":{"title":"End the call?"},"errors":{"generic":"An error occurred","start_failed":"Failed to start call"},"mute":{"mute":"Mute","mute_microphone":"Mute microphone","unmute":"Unmute","unmute_microphone":"Unmute microphone"},"sr":{"connected":"Call connected","connected_thinking":"Call connected, generating response","connecting":"Connecting call","error":"Call error","error_with_message":"Call error: {{message}}","ready":"Ready to place a call"},"status":{"connecting":"Connecting","error":"Error","listening":"Listening","muted":"Muted","on_call":"On call","ready":"Ready","reconnecting":"Reconnecting","speaking":"Speaking","thinking":"Thinking"},"transcript":{"call_ended":"Voice call ended · <0>{{duration}}</0>","call_started":"Call started · <0>{{time}}</0>","reconnected":"Reconnected","typed":"Typed"}}}'),ia=JSON.parse('{"Gp":{"actions":{"cancel":"Cancelar chamada de prévia de áudio","end":"Encerrar chamada de prévia de áudio","end_call":"Encerrar chamada","start":"Iniciar chamada de prévia de áudio","start_call":"Iniciar uma chamada"},"composer_placeholder":"Você também pode digitar…","dtmf":{"label":"Teclado DTMF","toggle":"Teclado"},"end_confirm":{"title":"Encerrar a chamada?"},"errors":{"generic":"Ocorreu um erro","start_failed":"Não foi possível iniciar a chamada"},"mute":{"mute":"Silenciar","mute_microphone":"Silenciar microfone","unmute":"Reativar","unmute_microphone":"Ativar microfone"},"sr":{"connected":"Chamada conectada","connected_thinking":"Chamada conectada, gerando resposta","connecting":"Conectando chamada","error":"Erro na chamada","error_with_message":"Erro na chamada: {{message}}","ready":"Pronto para iniciar uma chamada"},"status":{"connecting":"Conectando","error":"Erro","listening":"Ouvindo","muted":"Silenciado","on_call":"Em chamada","ready":"Pronto","reconnecting":"Reconectando","speaking":"Falando","thinking":"Pensando"},"transcript":{"call_ended":"Chamada de voz encerrada · <0>{{duration}}</0>","call_started":"Chamada iniciada · <0>{{time}}</0>","reconnected":"Reconectado","typed":"Digitado"}}}'),ra={el:{translation:{audio_widget:ta.Gp}},en:{translation:{audio_widget:na.Gp}},"pt-br":{translation:{audio_widget:ia.Gp}}};Lo.createInstance().use(Zo).use(ea).init({resources:ra,lowerCaseLng:!0,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1},detection:{order:["navigator"]}}),h(),v(),p(),g(),f(),m();var oa=n(511),aa={};aa.styleTagTransform=function e(){return e.c||(e.c=n.n(m()))}()(),aa.setAttributes=function e(){return e.c||(e.c=n.n(g()))}()(),aa.insert=function e(){return e.c||(e.c=n.n(p()))}()().bind(null,"head"),aa.domAPI=function e(){return e.c||(e.c=n.n(v()))}()(),aa.insertStyleElement=function e(){return e.c||(e.c=n.n(f()))}()(),function e(){return e.c||(e.c=n.n(h()))}()()(oa.A,aa),oa.A&&oa.A.locals&&oa.A.locals;const sa=y()("moveo:telnyx:main"),la=async e=>{if(sa("MoveoTelnyx.init() called with config",e),!e.integrationId){const e=new Error("integrationId is required in config");throw sa("Initialization failed: integrationId is required",e),e}sa("Creating TelnyxController instance");const t=new Hr(e);return sa("Initializing TelnyxController"),await t.init(),sa("MoveoTelnyx initialization complete"),t},ca=Object.assign(la,{init:la,TelnyxController:Hr})})(),i=i.default,i})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("MoveoTelnyx",[],t):"object"==typeof exports?exports.MoveoTelnyx=t():e.MoveoTelnyx=t()}(this,()=>(()=>{var e={511(e,t,n){"use strict";var i=n(601),r=n.n(i),o=n(314),a=n.n(o)()(r());a.push([e.id,"@import url(https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap);"]),a.push([e.id,'/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-content:""}}}@layer theme{:root,:host{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-green-50:oklch(98.2% .018 155.826);--color-green-300:oklch(87.1% .15 154.449);--color-green-700:oklch(52.7% .154 150.069);--color-green-950:oklch(26.6% .065 152.934);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-600:oklch(59.6% .145 163.225);--color-emerald-700:oklch(50.8% .118 165.612);--color-emerald-950:oklch(26.2% .051 172.552);--color-sky-50:oklch(97.7% .013 236.62);--color-sky-100:oklch(95.1% .026 236.824);--color-sky-200:oklch(90.1% .058 230.902);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-sky-600:oklch(58.8% .158 241.966);--color-sky-700:oklch(50% .134 242.749);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-900:oklch(37.9% .146 265.522);--color-purple-600:oklch(55.8% .288 302.321);--color-rose-50:oklch(96.9% .015 12.422);--color-rose-200:oklch(89.2% .058 10.001);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-rose-600:oklch(58.6% .253 17.585);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-3xs:16rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-2xl:42rem;--container-6xl:72rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--text-5xl:3rem;--text-5xl--line-height:1;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wider:.05em;--leading-tight:1.25;--leading-snug:1.375;--leading-normal:1.5;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--radius-3xl:1.5rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--aspect-video:16 / 9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:Inter, system-ui, -apple-system, sans-serif}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.\\!visible{visibility:visible!important}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-\\[-4px\\]{inset:-4px}.inset-x-0{inset-inline:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.inset-x-6{inset-inline:calc(var(--spacing) * 6)}.inset-x-\\[92px\\]{inset-inline:92px}.inset-y-0{inset-block:0}.-top-2{top:calc(var(--spacing) * -2)}.-top-4{top:calc(var(--spacing) * -4)}.-top-14{top:calc(var(--spacing) * -14)}.-top-\\[28px\\]{top:-28px}.top-\\(--moveo-header-height\\){top:var(--moveo-header-height)}.top-0{top:0}.top-1\\.5{top:calc(var(--spacing) * 1.5)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-\\[50\\%\\]{top:50%}.top-\\[62px\\]{top:62px}.-right-2{right:calc(var(--spacing) * -2)}.right-0{right:0}.right-0\\.5{right:calc(var(--spacing) * .5)}.right-1\\.5{right:calc(var(--spacing) * 1.5)}.right-2{right:calc(var(--spacing) * 2)}.right-2\\.5{right:calc(var(--spacing) * 2.5)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.right-auto{right:auto}.bottom-0{bottom:0}.bottom-0\\.5{bottom:calc(var(--spacing) * .5)}.bottom-1\\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-16{bottom:calc(var(--spacing) * 16)}.bottom-\\[calc\\(100\\%\\+40px\\)\\]{bottom:calc(100% + 40px)}.bottom-full{bottom:100%}.-left-2{left:calc(var(--spacing) * -2)}.left-0{left:0}.left-1\\.5{left:calc(var(--spacing) * 1.5)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-4{left:calc(var(--spacing) * 4)}.left-\\[50\\%\\]{left:50%}.isolate{isolation:isolate}.z-0{z-index:0}.z-1{z-index:1}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-1100{z-index:1100}.col-start-1{grid-column-start:1}.row-start-1{grid-row-start:1}.clear-both{clear:both}.\\!container{width:100%!important}@media (min-width:40rem){.\\!container{max-width:40rem!important}}@media (min-width:48rem){.\\!container{max-width:48rem!important}}@media (min-width:64rem){.\\!container{max-width:64rem!important}}@media (min-width:80rem){.\\!container{max-width:80rem!important}}@media (min-width:96rem){.\\!container{max-width:96rem!important}}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.-m-\\[3px\\]{margin:-3px}.m-0{margin:0}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.-mx-2\\.5{margin-inline:calc(var(--spacing) * -2.5)}.-mx-4{margin-inline:calc(var(--spacing) * -4)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-5{margin-inline:calc(var(--spacing) * 5)}.mx-6{margin-inline:calc(var(--spacing) * 6)}.mx-7{margin-inline:calc(var(--spacing) * 7)}.mx-auto{margin-inline:auto}.-my-1{margin-block:calc(var(--spacing) * -1)}.-my-2{margin-block:calc(var(--spacing) * -2)}.my-0{margin-block:0}.my-1{margin-block:var(--spacing)}.-ms-1{margin-inline-start:calc(var(--spacing) * -1)}.-ms-1\\.5{margin-inline-start:calc(var(--spacing) * -1.5)}.-me-1{margin-inline-end:calc(var(--spacing) * -1)}.-mt-1\\.5{margin-top:calc(var(--spacing) * -1.5)}.-mt-4{margin-top:calc(var(--spacing) * -4)}.mt-0{margin-top:0}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mt-\\[5px\\]{margin-top:5px}.mt-\\[10\\%\\]{margin-top:10%}.mt-\\[var\\(--moveo-header-height\\)\\]{margin-top:var(--moveo-header-height)}.mt-auto{margin-top:auto}.-mr-1\\.5{margin-right:calc(var(--spacing) * -1.5)}.-mr-2{margin-right:calc(var(--spacing) * -2)}.mr-1{margin-right:var(--spacing)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-auto{margin-right:auto}.-mb-2{margin-bottom:calc(var(--spacing) * -2)}.mb-0{margin-bottom:0}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-9{margin-bottom:calc(var(--spacing) * 9)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.mb-16{margin-bottom:calc(var(--spacing) * 16)}.mb-20{margin-bottom:calc(var(--spacing) * 20)}.-ml-0\\.5{margin-left:calc(var(--spacing) * -.5)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.-ml-4{margin-left:calc(var(--spacing) * -4)}.ml-0{margin-left:0}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:var(--spacing)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.box-content{box-sizing:content-box}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.table{display:table}.aspect-\\[3\\/2\\]{aspect-ratio:3/2}.aspect-video{aspect-ratio:var(--aspect-video)}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.size-\\[9px\\]{width:9px;height:9px}.size-full{width:100%;height:100%}.h-\\(--moveo-chat-height\\){height:var(--moveo-chat-height)}.h-1{height:var(--spacing)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-2\\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-24{height:calc(var(--spacing) * 24)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-45{height:calc(var(--spacing) * 45)}.h-\\[0\\.9em\\]{height:.9em}.h-\\[18px\\]{height:18px}.h-\\[19px\\]{height:19px}.h-\\[26px\\]{height:26px}.h-\\[34px\\]{height:34px}.h-\\[42px\\]{height:42px}.h-\\[44px\\]{height:44px}.h-\\[82px\\]{height:82px}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[222px\\]{height:222px}.h-\\[254px\\]{height:254px}.h-\\[282px\\]{height:282px}.h-\\[300px\\]{height:300px}.h-\\[340px\\]{height:340px}.h-\\[386px\\]{height:386px}.h-\\[560px\\]{height:560px}.h-\\[562px\\]{height:562px}.h-\\[min\\(72\\%\\,calc\\(100\\%_-_var\\(--moveo-header-height\\)_-_16px\\)\\)\\]{height:min(72%, calc(100% - var(--moveo-header-height) - 16px))}.h-\\[min\\(var\\(--moveo-expanded-chat-height\\)\\,var\\(--moveo-chat-max-height\\)\\)\\]{height:min(var(--moveo-expanded-chat-height), var(--moveo-chat-max-height))}.h-\\[var\\(--moveo-chat-height\\)\\]{height:var(--moveo-chat-height)}.h-\\[var\\(--moveo-frame-h\\)\\]{height:var(--moveo-frame-h)}.h-\\[var\\(--moveo-modal-tall-height\\)\\]{height:var(--moveo-modal-tall-height)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-\\(--moveo-chat-max-height\\){max-height:var(--moveo-chat-max-height)}.max-h-\\(--radix-select-content-available-height\\){max-height:var(--radix-select-content-available-height)}.max-h-18{max-height:calc(var(--spacing) * 18)}.max-h-44{max-height:calc(var(--spacing) * 44)}.max-h-\\[40vh\\]{max-height:40vh}.max-h-\\[60vh\\]{max-height:60vh}.max-h-\\[88px\\]{max-height:88px}.max-h-\\[134px\\]{max-height:134px}.max-h-\\[400px\\]{max-height:400px}.max-h-\\[calc\\(100\\%_-_var\\(--moveo-header-height\\)\\)\\]{max-height:calc(100% - var(--moveo-header-height))}.max-h-\\[min\\(460px\\,72vh\\)\\]{max-height:min(460px,72vh)}.max-h-full{max-height:100%}.max-h-screen{max-height:100vh}.min-h-0{min-height:0}.min-h-8{min-height:calc(var(--spacing) * 8)}.min-h-10{min-height:calc(var(--spacing) * 10)}.min-h-14{min-height:calc(var(--spacing) * 14)}.min-h-40{min-height:calc(var(--spacing) * 40)}.min-h-\\[72px\\]{min-height:72px}.min-h-\\[120px\\]{min-height:120px}.min-h-\\[190px\\]{min-height:190px}.min-h-screen{min-height:100vh}.w-\\(--moveo-expanded-chat-width\\){width:var(--moveo-expanded-chat-width)}.w-0\\.5{width:calc(var(--spacing) * .5)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-1\\/2{width:50%}.w-2\\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-3\\/4{width:75%}.w-3xs{width:var(--container-3xs)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-20{width:calc(var(--spacing) * 20)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-\\[2px\\]{width:2px}.w-\\[18px\\]{width:18px}.w-\\[19px\\]{width:19px}.w-\\[26px\\]{width:26px}.w-\\[28px\\]{width:28px}.w-\\[42px\\]{width:42px}.w-\\[52px\\]{width:52px}.w-\\[54px\\]{width:54px}.w-\\[75\\%\\]{width:75%}.w-\\[86\\%\\]{width:86%}.w-\\[252px\\]{width:252px}.w-\\[280px\\]{width:280px}.w-\\[360px\\]{width:360px}.w-\\[380px\\]{width:380px}.w-\\[440px\\]{width:440px}.w-\\[510px\\]{width:510px}.w-\\[512px\\]{width:512px}.w-\\[calc\\(100\\%-24px\\)\\]{width:calc(100% - 24px)}.w-\\[calc\\(100\\%-40px\\)\\]{width:calc(100% - 40px)}.w-\\[var\\(--moveo-chat-width\\)\\]{width:var(--moveo-chat-width)}.w-\\[var\\(--moveo-expanded-chat-width\\)\\]{width:var(--moveo-expanded-chat-width)}.w-\\[var\\(--moveo-frame-w\\)\\]{width:var(--moveo-frame-w)}.w-\\[var\\(--moveo-modal-tall-width\\)\\]{width:var(--moveo-modal-tall-width)}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:max-content}.w-sm{width:var(--container-sm)}.w-xs{width:var(--container-xs)}.max-w-2xl{max-width:var(--container-2xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-18{max-width:calc(var(--spacing) * 18)}.max-w-56{max-width:calc(var(--spacing) * 56)}.max-w-\\[18rem\\]{max-width:18rem}.max-w-\\[80\\%\\]{max-width:80%}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[328px\\]{max-width:328px}.max-w-fit{max-width:-moz-fit-content;max-width:fit-content}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-6{min-width:calc(var(--spacing) * 6)}.min-w-9{min-width:calc(var(--spacing) * 9)}.min-w-20{min-width:calc(var(--spacing) * 20)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[52px\\]{min-width:52px}.min-w-\\[156px\\]{min-width:156px}.min-w-\\[260px\\]{min-width:260px}.min-w-\\[300px\\]{min-width:300px}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.min-w-auto{min-width:auto}.min-w-fit{min-width:-moz-fit-content;min-width:fit-content}.flex-1{flex:1}.flex-initial{flex:0 auto}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.grow-0{flex-grow:0}.basis-\\[130px\\]{flex-basis:130px}.basis-\\[min\\(336px\\,calc\\(100\\%-32px\\)\\)\\]{flex-basis:min(336px,100% - 32px)}.basis-\\[min\\(400px\\,calc\\(100\\%-32px\\)\\)\\]{flex-basis:min(400px,100% - 32px)}.basis-full{flex-basis:100%}.border-collapse{border-collapse:collapse}.origin-\\(--radix-popover-content-transform-origin\\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\\(--radix-select-content-transform-origin\\){transform-origin:var(--radix-select-content-transform-origin)}.origin-\\(--radix-tooltip-content-transform-origin\\){transform-origin:var(--radix-tooltip-content-transform-origin)}.origin-bottom-left{transform-origin:0 100%}.origin-bottom-right{transform-origin:100% 100%}.origin-center{transform-origin:50%}.origin-top-left{transform-origin:0 0}.origin-top-right{transform-origin:100% 0}.-translate-px{--tw-translate-x:-1px;--tw-translate-y:-1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-px{--tw-translate-x:1px;--tw-translate-y:1px;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\[75\\%\\]{--tw-translate-x:75%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\[86\\%\\]{--tw-translate-x:86%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-0\\.5{--tw-translate-y:calc(var(--spacing) * -.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-0{--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-1\\.5{--tw-translate-y:calc(var(--spacing) * 1.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-4{--tw-translate-y:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[0\\.1em\\]{--tw-translate-y:.1em;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-none{translate:none}.scale-50{--tw-scale-x:50%;--tw-scale-y:50%;--tw-scale-z:50%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-125{--tw-scale-x:125%;--tw-scale-y:125%;--tw-scale-z:125%;scale:var(--tw-scale-x) var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[busy-pulse_1\\.2s_ease-in-out_infinite\\]{animation:1.2s ease-in-out infinite busy-pulse}.animate-\\[busy-pulse_2s_ease-in-out_infinite\\]{animation:2s ease-in-out infinite busy-pulse}.animate-\\[progress-ring_10s_linear_forwards\\]{animation:10s linear forwards progress-ring}.animate-\\[slide-in-up_0\\.2s_ease-out\\]{animation:.2s ease-out slide-in-up}.animate-\\[teaser-sharpen_420ms_linear_backwards\\]{animation:.42s linear backwards teaser-sharpen}.animate-\\[typing_1\\.2s_ease-in-out_infinite\\]{animation:1.2s ease-in-out infinite typing}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.resize{resize:both}.scroll-my-1{scroll-margin-block:var(--spacing)}.\\[scrollbar-width\\:thin\\]{scrollbar-width:thin}.\\[scrollbar-color\\:rgba\\(0\\,0\\,0\\,0\\.15\\)_transparent\\]{scrollbar-color:#00000026 transparent}.\\[scrollbar-gutter\\:stable_both-edges\\]{scrollbar-gutter:stable both-edges}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;appearance:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.grid-cols-\\[36px_16px_36px\\]{grid-template-columns:36px 16px 36px}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-0{gap:0}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-\\[2px\\]{gap:2px}.gap-\\[7px\\]{gap:7px}.gap-px{gap:1px}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-1{-moz-column-gap:var(--spacing);column-gap:var(--spacing)}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-1{row-gap:var(--spacing)}.self-end{align-self:flex-end}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\(--moveo-border-radius-base\\){border-radius:var(--moveo-border-radius-base)}.rounded-\\(--moveo-border-radius-surface\\){border-radius:var(--moveo-border-radius-surface)}.rounded-\\(--panel-radius\\){border-radius:var(--panel-radius)}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[14px\\]{border-radius:14px}.rounded-\\[18px\\]{border-radius:18px}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--moveo-border-radius-base\\)\\]{border-radius:var(--moveo-border-radius-base)}.rounded-\\[var\\(--moveo-border-radius-surface\\)\\]{border-radius:var(--moveo-border-radius-surface)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.rounded-br-md{border-bottom-right-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[3px\\]{border-style:var(--tw-border-style);border-width:3px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\(--color-options-border\\){border-color:var(--color-options-border)}.border-emerald-200\\/60{border-color:#a4f4cf99}@supports (color:color-mix(in lab, red, red)){.border-emerald-200\\/60{border-color:color-mix(in oklab, var(--color-emerald-200) 60%, transparent)}}.border-emerald-500\\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab, red, red)){.border-emerald-500\\/20{border-color:color-mix(in oklab, var(--color-emerald-500) 20%, transparent)}}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-700{border-color:var(--color-gray-700)}.border-rose-200\\/60{border-color:#ffccd399}@supports (color:color-mix(in lab, red, red)){.border-rose-200\\/60{border-color:color-mix(in oklab, var(--color-rose-200) 60%, transparent)}}.border-sky-200\\/60{border-color:#b8e6fe99}@supports (color:color-mix(in lab, red, red)){.border-sky-200\\/60{border-color:color-mix(in oklab, var(--color-sky-200) 60%, transparent)}}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\\/80{border-color:#e2e8f0cc}@supports (color:color-mix(in lab, red, red)){.border-slate-200\\/80{border-color:color-mix(in oklab, var(--color-slate-200) 80%, transparent)}}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-white\\/90{border-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.border-white\\/90{border-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.border-t-rose-400\\/60{border-top-color:#ff667f99}@supports (color:color-mix(in lab, red, red)){.border-t-rose-400\\/60{border-top-color:color-mix(in oklab, var(--color-rose-400) 60%, transparent)}}.border-t-sky-400\\/60{border-top-color:#00bcfe99}@supports (color:color-mix(in lab, red, red)){.border-t-sky-400\\/60{border-top-color:color-mix(in oklab, var(--color-sky-400) 60%, transparent)}}.border-t-sky-500\\/60{border-top-color:#00a5ef99}@supports (color:color-mix(in lab, red, red)){.border-t-sky-500\\/60{border-top-color:color-mix(in oklab, var(--color-sky-500) 60%, transparent)}}.border-t-transparent{border-top-color:#0000}.border-r-rose-300\\/30{border-right-color:#ffa2ae4d}@supports (color:color-mix(in lab, red, red)){.border-r-rose-300\\/30{border-right-color:color-mix(in oklab, var(--color-rose-300) 30%, transparent)}}.border-r-sky-300\\/30{border-right-color:#77d4ff4d}@supports (color:color-mix(in lab, red, red)){.border-r-sky-300\\/30{border-right-color:color-mix(in oklab, var(--color-sky-300) 30%, transparent)}}.border-r-sky-400\\/30{border-right-color:#00bcfe4d}@supports (color:color-mix(in lab, red, red)){.border-r-sky-400\\/30{border-right-color:color-mix(in oklab, var(--color-sky-400) 30%, transparent)}}.border-b-transparent{border-bottom-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-\\(--color-accent\\){background-color:var(--color-accent)}.bg-\\(--color-launcher-background\\,var\\(--color-accent\\)\\){background-color:var(--color-launcher-background,var(--color-accent))}.bg-\\(--color-opening-message-background\\,var\\(--color-accent\\)\\){background-color:var(--color-opening-message-background,var(--color-accent))}.bg-\\(--color-options-background\\){background-color:var(--color-options-background)}.bg-\\(--color-rating-background\\){background-color:var(--color-rating-background)}.bg-\\(--color-send-icon\\){background-color:var(--color-send-icon)}.bg-\\[var\\(--background\\)\\]{background-color:var(--background)}.bg-\\[var\\(--color-successful\\)\\]{background-color:var(--color-successful)}.bg-\\[var\\(--moveo-header-background\\)\\]{background-color:var(--moveo-header-background)}.bg-\\[var\\(--moveo-header-background\\,var\\(--color-accent\\)\\)\\]{background-color:var(--moveo-header-background,var(--color-accent))}.bg-\\[var\\(--nbg-bg\\)\\]{background-color:var(--nbg-bg)}.bg-\\[var\\(--text-03\\)\\]{background-color:var(--text-03)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-100\\/90{background-color:#fef3c6e6}@supports (color:color-mix(in lab, red, red)){.bg-amber-100\\/90{background-color:color-mix(in oklab, var(--color-amber-100) 90%, transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-black\\/55{background-color:#0000008c}@supports (color:color-mix(in lab, red, red)){.bg-black\\/55{background-color:color-mix(in oklab, var(--color-black) 55%, transparent)}}.bg-current{background-color:currentColor}.bg-emerald-50\\/80{background-color:#ecfdf5cc}@supports (color:color-mix(in lab, red, red)){.bg-emerald-50\\/80{background-color:color-mix(in oklab, var(--color-emerald-50) 80%, transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-green-50{background-color:var(--color-green-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-rose-50\\/80{background-color:#fff1f2cc}@supports (color:color-mix(in lab, red, red)){.bg-rose-50\\/80{background-color:color-mix(in oklab, var(--color-rose-50) 80%, transparent)}}.bg-sky-50\\/80{background-color:#f0f9ffcc}@supports (color:color-mix(in lab, red, red)){.bg-sky-50\\/80{background-color:color-mix(in oklab, var(--color-sky-50) 80%, transparent)}}.bg-sky-100{background-color:var(--color-sky-100)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-400{background-color:var(--color-slate-400)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/80{background-color:#fffc}@supports (color:color-mix(in lab, red, red)){.bg-white\\/80{background-color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.bg-white\\/90{background-color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.bg-white\\/90{background-color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-emerald-500{--tw-gradient-from:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-600{--tw-gradient-to:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-contain{background-size:contain}.bg-right{background-position:100%}.bg-no-repeat{background-repeat:no-repeat}.fill-\\(--color-launcher-background\\,var\\(--color-accent\\)\\){fill:var(--color-launcher-background,var(--color-accent))}.fill-\\(--color-launcher-foreground\\,var\\(--color-background\\)\\){fill:var(--color-launcher-foreground,var(--color-background))}.fill-sky-600{fill:var(--color-sky-600)}.fill-white{fill:var(--color-white)}.stroke-\\(--color-launcher-foreground\\,var\\(--color-background\\)\\){stroke:var(--color-launcher-foreground,var(--color-background))}.stroke-\\[var\\(--color-accent\\)\\]{stroke:var(--color-accent)}.stroke-\\[var\\(--color-border\\)\\]{stroke:var(--color-border)}.stroke-\\[var\\(--color-successful\\)\\]{stroke:var(--color-successful)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-20{padding:calc(var(--spacing) * 20)}.p-\\[10\\%\\]{padding:10%}.p-px{padding:1px}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-\\[18px\\]{padding-inline:18px}.py-0{padding-block:0}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3\\.5{padding-block:calc(var(--spacing) * 3.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-\\[11px\\]{padding-block:11px}.py-px{padding-block:1px}.pe-1\\.5{padding-inline-end:calc(var(--spacing) * 1.5)}.pe-2\\.5{padding-inline-end:calc(var(--spacing) * 2.5)}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-\\[66px\\]{padding-top:66px}.pt-\\[92px\\]{padding-top:92px}.pt-\\[var\\(--moveo-header-height\\)\\]{padding-top:var(--moveo-header-height)}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pr-9{padding-right:calc(var(--spacing) * 9)}.pb-0{padding-bottom:0}.pb-1{padding-bottom:var(--spacing)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-10{padding-bottom:calc(var(--spacing) * 10)}.pb-14{padding-bottom:calc(var(--spacing) * 14)}.pb-24{padding-bottom:calc(var(--spacing) * 24)}.pb-32{padding-bottom:calc(var(--spacing) * 32)}.pl-0{padding-left:0}.pl-1{padding-left:var(--spacing)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-8{padding-left:calc(var(--spacing) * 8)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.text-start{text-align:start}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:Inter,system-ui,-apple-system,sans-serif}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[0\\.8rem\\]{font-size:.8rem}.text-\\[0\\.65rem\\]{font-size:.65rem}.text-\\[10\\.5px\\]{font-size:10.5px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.text-\\[15px\\]{font-size:15px}.text-\\[42px\\]{font-size:42px}.text-\\[length\\:var\\(--font-size-brain-message\\)\\]{font-size:var(--font-size-brain-message)}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-6{--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.leading-8{--tw-leading:calc(var(--spacing) * 8);line-height:calc(var(--spacing) * 8)}.leading-\\[18px\\]{--tw-leading:18px;line-height:18px}.leading-\\[30px\\]{--tw-leading:30px;line-height:30px}.leading-\\[51px\\]{--tw-leading:51px;line-height:51px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.25em\\]{--tw-tracking:.25em;letter-spacing:.25em}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-balance{text-wrap:balance}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.wrap-anywhere{overflow-wrap:anywhere}.wrap-break-word{overflow-wrap:break-word}.text-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-\\(--color-accent\\){color:var(--color-accent)}.text-\\(--color-launcher-foreground\\,var\\(--color-background\\)\\){color:var(--color-launcher-foreground,var(--color-background))}.text-\\(--color-link\\){color:var(--color-link)}.text-\\(--color-opening-message-foreground\\,var\\(--color-text-primary-foreground\\)\\){color:var(--color-opening-message-foreground,var(--color-text-primary-foreground))}.text-\\(--color-send-icon\\){color:var(--color-send-icon)}.text-\\(--color-text-primary-foreground\\){color:var(--color-text-primary-foreground)}.text-\\[var\\(--color-link\\)\\]{color:var(--color-link)}.text-\\[var\\(--moveo-accent-color\\)\\]{color:var(--moveo-accent-color)}.text-\\[var\\(--moveo-header-text-color\\,var\\(--color-accent\\)\\)\\]{color:var(--moveo-header-text-color,var(--color-accent))}.text-\\[var\\(--moveo-header-text-color\\,var\\(--color-element-primary-foreground\\)\\)\\]{color:var(--moveo-header-text-color,var(--color-element-primary-foreground))}.text-\\[var\\(--moveo-header-text-color\\,var\\(--color-foreground\\)\\)\\]{color:var(--moveo-header-text-color,var(--color-foreground))}.text-\\[var\\(--moveo-header-text-color\\,var\\(--color-text-primary-foreground\\)\\)\\]{color:var(--moveo-header-text-color,var(--color-text-primary-foreground))}.text-\\[var\\(--moveo-header-text-color\\,white\\)\\]{color:var(--moveo-header-text-color,white)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-current{color:currentColor}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-800{color:var(--color-gray-800)}.text-green-700{color:var(--color-green-700)}.text-inherit{color:inherit}.text-moveo-primary{color:#1b66d6}.text-rose-500{color:var(--color-rose-500)}.text-rose-600{color:var(--color-rose-600)}.text-sky-500{color:var(--color-sky-500)}.text-sky-600{color:var(--color-sky-600)}.text-sky-700{color:var(--color-sky-700)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-80{opacity:.8}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_1px_2px_rgba\\(16\\,24\\,40\\,0\\.05\\)\\,0_6px_16px_-8px_rgba\\(16\\,24\\,40\\,0\\.18\\)\\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#1018280d), 0 6px 16px -8px var(--tw-shadow-color,#1018282e);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_1px_2px_rgba\\(16\\,24\\,40\\,0\\.05\\)\\,0_18px_36px_-12px_rgba\\(16\\,24\\,40\\,0\\.28\\)\\]{--tw-shadow:0 1px 2px var(--tw-shadow-color,#1018280d), 0 18px 36px -12px var(--tw-shadow-color,#10182847);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(0\\,0\\,0\\,0\\.15\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#00000026);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(14\\,165\\,233\\,0\\.12\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#0ea5e91f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(16\\,185\\,129\\,0\\.15\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#10b98126);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(244\\,63\\,94\\,0\\.12\\)\\]{--tw-shadow:0 2px 8px var(--tw-shadow-color,#f43f5e1f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_4px_14px_rgba\\(16\\,185\\,129\\,0\\.25\\)\\]{--tw-shadow:0 4px 14px var(--tw-shadow-color,#10b98140);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[2px_3px_6px_rgb\\(104_104_104\\/10\\%\\)\\]{--tw-shadow:2px 3px 6px var(--tw-shadow-color,#6868681a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[var\\(--moveo-shadow-bubble\\)\\]{--tw-shadow:var(--moveo-shadow-bubble);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-none{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-amber-200\\/70{--tw-shadow-color:#fee685b3}@supports (color:color-mix(in lab, red, red)){.shadow-amber-200\\/70{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-amber-200) 70%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-amber-300{--tw-ring-color:var(--color-amber-300)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\\[6px\\]{--tw-blur:blur(6px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-xl{--tw-blur:blur(var(--blur-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-\\[20px\\]{--tw-backdrop-blur:blur(20px);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-saturate-150{--tw-backdrop-saturate:saturate(150%);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-saturate-\\[1\\.4\\]{--tw-backdrop-saturate:saturate(1.4);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background-color\\,border-color\\,color\\]{transition-property:background-color,border-color,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[background-color\\,scale\\]{transition-property:background-color,scale;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[border-color\\]{transition-property:border-color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,display\\]{transition-property:opacity,display;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,rotate\\,scale\\]{transition-property:opacity,rotate,scale;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[stroke-dashoffset\\,stroke\\]{transition-property:stroke-dashoffset,stroke;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,height\\,opacity\\]{transition-property:transform,height,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,height\\]{transition-property:width,height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.transition-discrete{transition-behavior:allow-discrete}.duration-\\(--moveo-expand-duration\\){--tw-duration:var(--moveo-expand-duration);transition-duration:var(--moveo-expand-duration)}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-250{--tw-duration:.25s;transition-duration:.25s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-2000{--tw-duration:2s;transition-duration:2s}.duration-\\[240ms\\]{--tw-duration:.24s;transition-duration:.24s}.duration-\\[340ms\\]{--tw-duration:.34s;transition-duration:.34s}.ease-\\[cubic-bezier\\(\\.32\\,\\.72\\,0\\,1\\)\\]{--tw-ease:cubic-bezier(.32,.72,0,1);transition-timing-function:cubic-bezier(.32,.72,0,1)}.ease-\\[cubic-bezier\\(\\.34\\,1\\.23\\,\\.5\\,1\\)\\]{--tw-ease:cubic-bezier(.34,1.23,.5,1);transition-timing-function:cubic-bezier(.34,1.23,.5,1)}.ease-\\[cubic-bezier\\(0\\.2\\,0\\.8\\,0\\.2\\,1\\)\\]{--tw-ease:cubic-bezier(.2,.8,.2,1);transition-timing-function:cubic-bezier(.2,.8,.2,1)}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-linear{--tw-ease:linear;transition-timing-function:linear}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-transform{will-change:transform}.outline-none{--tw-outline-style:none;outline-style:none}.outline-solid{--tw-outline-style:solid;outline-style:solid}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.\\[--moveo-chat-max-height\\:calc\\(100vh-16px\\)\\]{--moveo-chat-max-height:calc(100vh - 16px)}.\\[--moveo-chat-max-height\\:calc\\(100vh-74px\\)\\]{--moveo-chat-max-height:calc(100vh - 74px)}.\\[--panel-radius\\:0px\\]{--panel-radius:0px}.\\[--panel-radius\\:var\\(--moveo-border-radius-surface\\)\\]{--panel-radius:var(--moveo-border-radius-surface)}.\\[--thread-frost-tint\\:var\\(--color-panel-surface\\)\\]{--thread-frost-tint:var(--color-panel-surface)}.\\[animation-delay\\:0\\.2s\\]{animation-delay:.2s}.\\[animation-delay\\:0\\.4s\\]{animation-delay:.4s}.\\[animation-delay\\:0s\\]{animation-delay:0s}.\\[animation-fill-mode\\:forwards\\]{animation-fill-mode:forwards}.\\[overflow-anchor\\:none\\]{overflow-anchor:none}.\\[transition\\:width_\\.26s_cubic-bezier\\(\\.34\\,\\.01\\,\\.2\\,1\\)\\,opacity_\\.18s_ease\\,transform_\\.18s_ease\\]{transition:width .26s cubic-bezier(.34,.01,.2,1),opacity .18s,transform .18s}:is(.\\*\\:col-start-1>*){grid-column-start:1}:is(.\\*\\:row-start-1>*){grid-row-start:1}.not-first\\:border-t:not(:first-child){border-top-style:var(--tw-border-style);border-top-width:1px}.not-first\\:border-solid:not(:first-child){--tw-border-style:solid;border-style:solid}@media (hover:hover){.group-hover\\:opacity-0:is(:where(.group):hover *){opacity:0}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\/open\\:scale-110:is(:where(.group\\/open):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.group-focus-visible\\:opacity-100:is(:where(.group):focus-visible *){opacity:1}.file\\:inline-flex::file-selector-button{display:inline-flex}.file\\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\\:bg-transparent::file-selector-button{background-color:#0000}.file\\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.file\\:font-medium::file-selector-button{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.placeholder\\:text-\\(--color-foreground-muted\\)::placeholder{color:var(--color-foreground-muted)}.before\\:pointer-events-none:before{content:var(--tw-content);pointer-events:none}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:inset-x-2\\.5:before{content:var(--tw-content);inset-inline:calc(var(--spacing) * 2.5)}.before\\:-top-px:before{content:var(--tw-content);top:-1px}.before\\:h-px:before{content:var(--tw-content);height:1px}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:-inset-1:after{content:var(--tw-content);inset:calc(var(--spacing) * -1)}.after\\:-inset-2:after{content:var(--tw-content);inset:calc(var(--spacing) * -2)}.after\\:content-\\[\\\'\\\'\\]:after{--tw-content:"";content:var(--tw-content)}.first\\:mt-0:first-child{margin-top:0}.first\\:ml-4:first-child{margin-left:calc(var(--spacing) * 4)}.first\\:rounded-t-\\[23px\\]:first-child{border-top-left-radius:23px;border-top-right-radius:23px}.last\\:mr-4:last-child{margin-right:calc(var(--spacing) * 4)}.last\\:rounded-b-\\[23px\\]:last-child{border-bottom-right-radius:23px;border-bottom-left-radius:23px}@media (hover:hover){.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\\:scale-\\[1\\.05\\]:hover{scale:1.05}.hover\\:border-\\(--color-options-border\\):hover{border-color:var(--color-options-border)}.hover\\:border-red-500\\/20:hover{border-color:#fb2c3633}@supports (color:color-mix(in lab, red, red)){.hover\\:border-red-500\\/20:hover{border-color:color-mix(in oklab, var(--color-red-500) 20%, transparent)}}.hover\\:bg-\\(--color-options-background\\):hover{background-color:var(--color-options-background)}.hover\\:bg-\\(--color-send-icon\\)\\/90:hover{background-color:var(--color-send-icon)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-\\(--color-send-icon\\)\\/90:hover{background-color:color-mix(in oklab, var(--color-send-icon) 90%, transparent)}}.hover\\:bg-\\(--color-surface-hover-darken\\):hover{background-color:var(--color-surface-hover-darken)}.hover\\:bg-amber-200:hover{background-color:var(--color-amber-200)}.hover\\:bg-gray-700\\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-gray-700\\/50:hover{background-color:color-mix(in oklab, var(--color-gray-700) 50%, transparent)}}.hover\\:bg-sky-200:hover{background-color:var(--color-sky-200)}.hover\\:bg-slate-200:hover{background-color:var(--color-slate-200)}.hover\\:bg-white:hover{background-color:var(--color-white)}.hover\\:bg-white\\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-white\\/10:hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.hover\\:bg-gradient-to-br:hover{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.hover\\:from-red-500:hover{--tw-gradient-from:var(--color-red-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\\:to-red-600:hover{--tw-gradient-to:var(--color-red-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\\:text-\\(--color-options-foreground\\):hover{color:var(--color-options-foreground)}.hover\\:text-\\[var\\(--color-accent\\)\\]:hover{color:var(--color-accent)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:shadow-\\[0_6px_20px_rgba\\(16\\,185\\,129\\,0\\.35\\)\\]:hover{--tw-shadow:0 6px 20px var(--tw-shadow-color,#10b98159);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-\\[0_6px_20px_rgba\\(239\\,68\\,68\\,0\\.35\\)\\]:hover{--tw-shadow:0 6px 20px var(--tw-shadow-color,#ef444459);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\\:brightness-\\[0\\.92\\]:hover{--tw-brightness:brightness(.92);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.hover\\:backdrop-blur-sm:hover{--tw-backdrop-blur:blur(var(--blur-sm));backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}}.focus\\:outline-2:focus{outline-style:var(--tw-outline-style);outline-width:2px}.focus\\:outline-offset-2:focus{outline-offset:2px}.focus\\:outline-solid:focus{--tw-outline-style:solid;outline-style:solid}.focus-visible\\:border-\\(--color-options-border\\):focus-visible{border-color:var(--color-options-border)}.focus-visible\\:text-\\(--color-options-foreground\\):focus-visible{color:var(--color-options-foreground)}.focus-visible\\:ring-0:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-amber-400:focus-visible{--tw-ring-color:var(--color-amber-400)}.focus-visible\\:ring-sky-400:focus-visible{--tw-ring-color:var(--color-sky-400)}.focus-visible\\:ring-slate-400:focus-visible{--tw-ring-color:var(--color-slate-400)}.focus-visible\\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-white:focus-visible{--tw-ring-offset-color:var(--color-white)}.focus-visible\\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:-outline-offset-2:focus-visible{outline-offset:calc(2px * -1)}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:outline-solid:focus-visible{--tw-outline-style:solid;outline-style:solid}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:scale-95:active{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.active\\:scale-\\[0\\.98\\]:active{scale:.98}.active\\:cursor-grabbing:active{cursor:grabbing}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[placeholder\\]\\:text-sm[data-placeholder]{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.data-\\[placeholder\\]\\:leading-5[data-placeholder]{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.data-\\[placeholder\\]\\:font-normal[data-placeholder]{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:var(--spacing);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:flex>*)[data-slot=select-value]{display:flex}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\\*\\:data-\\[slot\\=select-value\\]\\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\\[state\\=closed\\]\\:duration-200[data-state=closed]{--tw-duration:.2s;transition-duration:.2s}.data-\\[state\\=closed\\]\\:ease-in[data-state=closed]{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.data-\\[state\\=open\\]\\:duration-300[data-state=open]{--tw-duration:.3s;transition-duration:.3s}.data-\\[state\\=open\\]\\:ease-out[data-state=open]{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}@media (prefers-reduced-motion:no-preference){.motion-safe\\:animate-\\[question-rise_220ms_ease-out_both\\]{animation:.22s ease-out both question-rise}.motion-safe\\:animate-\\[question-rise_260ms_ease-out_both\\]{animation:.26s ease-out both question-rise}.motion-safe\\:animate-\\[question-set-in_360ms_cubic-bezier\\(0\\.2\\,0\\.8\\,0\\.2\\,1\\)_both\\]{animation:.36s cubic-bezier(.2,.8,.2,1) both question-set-in}.motion-safe\\:animate-\\[question-step-in_200ms_cubic-bezier\\(0\\.2\\,0\\.8\\,0\\.2\\,1\\)_80ms_both\\]{animation:.2s cubic-bezier(.2,.8,.2,1) 80ms both question-step-in}.motion-safe\\:animate-\\[question-step-out_100ms_ease-out_both\\]{animation:.1s ease-out both question-step-out}@media (hover:hover){.motion-safe\\:group-hover\\:-translate-\\[1\\.5px\\]:is(:where(.group):hover *){--tw-translate-x:calc(1.5px * -1);--tw-translate-y:calc(1.5px * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\\:group-hover\\:translate-0:is(:where(.group):hover *){--tw-translate-x:0px;--tw-translate-y:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\\:group-hover\\:translate-\\[1\\.5px\\]:is(:where(.group):hover *){--tw-translate-x:1.5px;--tw-translate-y:1.5px;translate:var(--tw-translate-x) var(--tw-translate-y)}}.motion-safe\\:active\\:scale-90:active{--tw-scale-x:90%;--tw-scale-y:90%;--tw-scale-z:90%;scale:var(--tw-scale-x) var(--tw-scale-y)}}@media (prefers-reduced-motion:reduce){.motion-reduce\\:invisible{visibility:hidden}.motion-reduce\\:animate-none{animation:none}.motion-reduce\\:transition-none{transition-property:none}.motion-reduce\\:duration-0{--tw-duration:0s;transition-duration:0s}}@media (min-width:40rem){.sm\\:block{display:block}.sm\\:flex-row{flex-direction:row}.sm\\:justify-end{justify-content:flex-end}.sm\\:text-left{text-align:left}.sm\\:text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.sm\\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}}@media (min-width:48rem){.md\\:max-h-\\[70vh\\]{max-height:70vh}.md\\:flex-row{flex-direction:row}.md\\:items-center{align-items:center}.md\\:items-start{align-items:flex-start}.md\\:px-12{padding-inline:calc(var(--spacing) * 12)}.md\\:pb-16{padding-bottom:calc(var(--spacing) * 16)}.md\\:text-left{text-align:left}.md\\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (min-width:64rem){.lg\\:gap-16{gap:calc(var(--spacing) * 16)}}.dark\\:border-emerald-500\\/30:is(.dark *){border-color:#00bb7f4d}@supports (color:color-mix(in lab, red, red)){.dark\\:border-emerald-500\\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-emerald-500) 30%, transparent)}}.dark\\:border-rose-500\\/30:is(.dark *){border-color:#ff23574d}@supports (color:color-mix(in lab, red, red)){.dark\\:border-rose-500\\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-rose-500) 30%, transparent)}}.dark\\:border-sky-500\\/30:is(.dark *){border-color:#00a5ef4d}@supports (color:color-mix(in lab, red, red)){.dark\\:border-sky-500\\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-sky-500) 30%, transparent)}}.dark\\:border-slate-700\\/50:is(.dark *){border-color:#31415880}@supports (color:color-mix(in lab, red, red)){.dark\\:border-slate-700\\/50:is(.dark *){border-color:color-mix(in oklab, var(--color-slate-700) 50%, transparent)}}.dark\\:border-white\\/10:is(.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\\:border-white\\/10:is(.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\\:bg-amber-500\\/15:is(.dark *){background-color:#f99c0026}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-amber-500\\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-500) 15%, transparent)}}.dark\\:bg-amber-500\\/20:is(.dark *){background-color:#f99c0033}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-amber-500\\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-500) 20%, transparent)}}.dark\\:bg-emerald-500\\/15:is(.dark *){background-color:#00bb7f26}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-emerald-500\\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-emerald-500) 15%, transparent)}}.dark\\:bg-green-950:is(.dark *){background-color:var(--color-green-950)}.dark\\:bg-rose-500\\/15:is(.dark *){background-color:#ff235726}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-rose-500\\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-rose-500) 15%, transparent)}}.dark\\:bg-sky-500\\/15:is(.dark *){background-color:#00a5ef26}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-sky-500\\/15:is(.dark *){background-color:color-mix(in oklab, var(--color-sky-500) 15%, transparent)}}.dark\\:bg-sky-500\\/20:is(.dark *){background-color:#00a5ef33}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-sky-500\\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-sky-500) 20%, transparent)}}.dark\\:bg-slate-700\\/50:is(.dark *){background-color:#31415880}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-slate-700\\/50:is(.dark *){background-color:color-mix(in oklab, var(--color-slate-700) 50%, transparent)}}.dark\\:bg-slate-900\\/80:is(.dark *){background-color:#0f172bcc}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-slate-900\\/80:is(.dark *){background-color:color-mix(in oklab, var(--color-slate-900) 80%, transparent)}}.dark\\:from-emerald-600:is(.dark *){--tw-gradient-from:var(--color-emerald-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\\:to-emerald-700:is(.dark *){--tw-gradient-to:var(--color-emerald-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\\:to-slate-950:is(.dark *){--tw-gradient-to:var(--color-slate-950);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\\:fill-sky-300:is(.dark *){fill:var(--color-sky-300)}.dark\\:text-amber-200:is(.dark *){color:var(--color-amber-200)}.dark\\:text-amber-300:is(.dark *){color:var(--color-amber-300)}.dark\\:text-emerald-300:is(.dark *){color:var(--color-emerald-300)}.dark\\:text-emerald-400:is(.dark *){color:var(--color-emerald-400)}.dark\\:text-green-300:is(.dark *){color:var(--color-green-300)}.dark\\:text-rose-300:is(.dark *){color:var(--color-rose-300)}.dark\\:text-rose-400:is(.dark *){color:var(--color-rose-400)}.dark\\:text-sky-300:is(.dark *){color:var(--color-sky-300)}.dark\\:text-sky-400:is(.dark *){color:var(--color-sky-400)}.dark\\:text-slate-100:is(.dark *){color:var(--color-slate-100)}.dark\\:text-slate-200:is(.dark *){color:var(--color-slate-200)}.dark\\:text-slate-300:is(.dark *){color:var(--color-slate-300)}.dark\\:text-slate-400:is(.dark *){color:var(--color-slate-400)}.dark\\:shadow-xl:is(.dark *){--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.dark\\:shadow-slate-950\\/30:is(.dark *){--tw-shadow-color:#0206184d}@supports (color:color-mix(in lab, red, red)){.dark\\:shadow-slate-950\\/30:is(.dark *){--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-slate-950) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.dark\\:ring-amber-400\\/40:is(.dark *){--tw-ring-color:#fcbb0066}@supports (color:color-mix(in lab, red, red)){.dark\\:ring-amber-400\\/40:is(.dark *){--tw-ring-color:color-mix(in oklab, var(--color-amber-400) 40%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-amber-500\\/30:is(.dark *):hover{background-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-amber-500\\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.dark\\:hover\\:bg-sky-500\\/30:is(.dark *):hover{background-color:#00a5ef4d}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-sky-500\\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-sky-500) 30%, transparent)}}.dark\\:hover\\:bg-slate-700:is(.dark *):hover{background-color:var(--color-slate-700)}.dark\\:hover\\:from-red-600:is(.dark *):hover{--tw-gradient-from:var(--color-red-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\\:hover\\:to-red-700:is(.dark *):hover{--tw-gradient-to:var(--color-red-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}}.dark\\:focus-visible\\:ring-offset-slate-950:is(.dark *):focus-visible{--tw-ring-offset-color:var(--color-slate-950)}.\\[\\&_a\\]\\:cursor-pointer a{cursor:pointer}.\\[\\&_a\\]\\:underline a{text-decoration-line:underline}.\\[\\&_a\\>\\*\\]\\:pointer-events-none a>*{pointer-events:none}.\\[\\&_button\\:active\\>\\*\\]\\:scale-95 button:active>*{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.\\[\\&_button\\:hover\\>\\*\\]\\:scale-110 button:hover>*{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.\\[\\&_button\\>\\*\\]\\:animate-\\[moveo-morph-absorb_var\\(--morph-collapse\\)_both\\] button>*{animation:moveo-morph-absorb var(--morph-collapse) both}.\\[\\&_button\\>\\*\\]\\:transition-transform button>*{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.\\[\\&_p\\]\\:max-w-md p{max-width:var(--container-md)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:size-4 svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\&_svg\\]\\:size-5 svg{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.\\[\\&_svg\\]\\:flex-shrink-0 svg,.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\\'size-\\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}:is(.\\*\\:\\[span\\]\\:last\\:flex>*):is(span):last-child{display:flex}:is(.\\*\\:\\[span\\]\\:last\\:items-center>*):is(span):last-child{align-items:center}:is(.\\*\\:\\[span\\]\\:last\\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}.\\[\\&\\>\\*\\]\\:\\[grid-area\\:1\\/1\\]>*{grid-area:1/1}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}\n',""]);const s=a;n.d(t,["A",0,s])},314(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",i=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),i&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),i&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,i,r,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(i)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(a[l]=!0)}for(var c=0;c<e.length;c++){var d=[].concat(e[c]);i&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),t.push(d))}},t}},601(e){"use strict";e.exports=function(e){return e[1]}},833(e,t,n){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let i=0,r=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(i++,"%c"===e&&(r=i))}),t.splice(r,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(736)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},736(e,t,n){e.exports=function(e){function t(e){let n,r,o,a=null;function s(...e){if(!s.enabled)return;const i=s,r=Number(new Date),o=r-(n||r);i.diff=o,i.prev=n,i.curr=r,n=r,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,r)=>{if("%%"===n)return"%";a++;const o=t.formatters[r];if("function"==typeof o){const t=e[a];n=o.call(i,t),e.splice(a,1),a--}return n}),t.formatArgs.call(i,e),(i.log||t.log).apply(i,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=i,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(r!==t.namespaces&&(r=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function i(e,n){const i=t(this.namespace+(void 0===n?":":n)+e);return i.log=this.log,i}function r(e,t){let n=0,i=0,r=-1,o=0;for(;n<e.length;)if(i<t.length&&(t[i]===e[n]||"*"===t[i]))"*"===t[i]?(r=i,o=n,i++):(n++,i++);else{if(-1===r)return!1;i=r+1,o++,n=o}for(;i<t.length&&"*"===t[i];)i++;return i===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(r(e,n))return!1;for(const n of t.names)if(r(e,n))return!0;return!1},t.humanize=n(585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},585(e){var t=1e3,n=60*t,i=60*n,r=24*i,o=7*r;function a(e,t,n,i){var r=t>=1.5*n;return Math.round(e/n)+" "+i+(r?"s":"")}e.exports=function(e,s){s=s||{};var l,c,d=typeof e;if("string"===d&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(a){var s=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*r;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===d&&isFinite(e))return s.long?(l=e,(c=Math.abs(l))>=r?a(l,c,r,"day"):c>=i?a(l,c,i,"hour"):c>=n?a(l,c,n,"minute"):c>=t?a(l,c,t,"second"):l+" ms"):function(e){var o=Math.abs(e);return o>=r?Math.round(e/r)+"d":o>=i?Math.round(e/i)+"h":o>=n?Math.round(e/n)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}};const t={};function n(i){const r=t[i];if(void 0!==r)return r.exports;const o=t[i]={id:i,exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var r=t[i++],o=t[i++],a=0===o?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:o};n.o(e,r)||Object.defineProperty(e,r,a)}else for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0;let i={};return(()=>{"use strict";n.d(i,{default:()=>ca});var e=n.cw((e,t)=>{var n=u(),i=l(),r=o();function a(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 s(e){for(var t=e,n=t;n&&!n.alternate;)!!(4098&(t=n).flags)&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return 3===t.tag?e:null}function c(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function d(e){if(31===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function h(e){if(s(e)!==e)throw Error(a(188))}function p(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=p(e)))return t;e=e.sibling}return null}function f(e,t,n,i,r,o){for(;null!==e;){if((5===e.tag||27===e.tag||6===e.tag)&&n(e,i,r,o)||(22!==e.tag||null===e.memoizedState)&&(t||5!==e.tag&&27!==e.tag)&&f(e.child,t,n,i,r,o))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;null!==e;){if(3===e.tag||5===e.tag||27===e.tag)return e;e=e.return}return null}function m(e){var t=!1;for(e=e.return;null!==e&&(4===e.tag&&(t=!0),3!==e.tag&&5!==e.tag&&27!==e.tag);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return null===n||b(t,e,n.child,{foundSelf:!1}),t}function b(e,t,n,i){for(;null!==n;){if(n===t)i.foundSelf=!0;else if(5===n.tag||27===n.tag||6===n.tag){if(i.foundSelf)return e[1]=n,!0;e[0]=n}else if((22!==n.tag||null===n.memoizedState)&&b(e,t,n.child,i))return!0;n=n.sibling}return!1}function y(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var w=null,k=null;function _(e,t,n){return e===n||e===t&&(w=e,!0)}function S(e,t,n){return e===n?(k=e,!1):e===t&&(null!==k&&(w=e),!0)}function x(e){if(null===e)return null;do{e=null===e?null:e.return}while(e&&5!==e.tag&&27!==e.tag&&3!==e.tag);return e||null}function C(e,t,n){for(var i=0,r=e;r;r=n(r))i++;r=0;for(var o=t;o;o=n(o))r++;for(;0<i-r;)e=n(e),i--;for(;0<r-i;)t=n(t),r--;for(;i--;){if(e===t||null!==t&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var E=Object.assign,I=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),D=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),z=Symbol.for("react.lazy");Symbol.for("react.scope");var U=Symbol.for("react.activity"),$=Symbol.for("react.legacy_hidden");Symbol.for("react.tracing_marker");var B=Symbol.for("react.memo_cache_sentinel"),H=Symbol.for("react.view_transition"),W=Symbol.for("react.recoverable"),V=Symbol.iterator;function q(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=V&&e[V]||e["@@iterator"])?e:null}var G=Symbol.for("react.client.reference");function K(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===G?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case N:return"Fragment";case A:return"Profiler";case O:return"StrictMode";case M:return"Suspense";case F:return"SuspenseList";case U:return"Activity";case H:return"ViewTransition"}if("object"==typeof e)switch(e.$$typeof){case R:return"Portal";case D:return e.displayName||"Context";case L:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case j:return null!==(t=e.displayName||null)?t:K(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return K(e(t))}catch(e){}}return null}var Y=Array.isArray,Q=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},Z=[],ee=-1;function te(e){return{current:e}}function ne(e){0>ee||(e.current=Z[ee],Z[ee]=null,ee--)}function ie(e,t){ee++,Z[ee]=e.current,e.current=t}var re,oe,ae=te(null),se=te(null),le=te(null),ce=te(null);function de(e,t){switch(ie(le,t),ie(se,e),ie(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Fh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=jh(t=Fh(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ne(ae),ie(ae,e)}function ue(){ne(ae),ne(se),ne(le)}function he(e){var t=e.memoizedState;null!==t&&(hf._currentValue=t.memoizedState,ie(ce,e));var n=jh(t=ae.current,e.type);t!==n&&(ie(se,e),ie(ae,n))}function pe(e){se.current===e&&(ne(ae),ne(se)),ce.current===e&&(ne(ce),hf._currentValue=X)}function fe(e){if(void 0===re)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||"",oe=-1<e.stack.indexOf("\n at")?" (<anonymous>)":-1<e.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+re+e+oe}var ge=!1;function me(e,t){if(!e||ge)return"";ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var i=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){i=e}n=!1;try{var r=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(void 0!==r?Object.defineProperty(e.prototype,"props",r):delete e.prototype.props)}}}else{try{throw Error()}catch(e){i=e}(n=e())&&"function"==typeof n.catch&&n.catch(function(){})}}catch(e){if(e&&i&&"string"==typeof e.stack)return[e.stack,i.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=i.DetermineComponentFrameRoot(),a=o[0],s=o[1];if(a&&s){var l=a.split("\n"),c=s.split("\n");for(r=i=0;i<l.length&&!l[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===l.length||r===c.length)for(i=l.length-1,r=c.length-1;1<=i&&0<=r&&l[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(l[i]!==c[r]){if(1!==i||1!==r)do{if(i--,0>--r||l[i]!==c[r]){var d="\n"+l[i].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),d}}while(1<=i&&0<=r);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?fe(n):""}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return fe(e.type);case 16:return fe("Lazy");case 13:return e.child!==t&&null!==t?fe("Suspense Fallback"):fe("Suspense");case 19:return fe("SuspenseList");case 0:case 15:return me(e.type,!1);case 11:return me(e.type.render,!1);case 1:return me(e.type,!0);case 31:return fe("Activity");case 30:return fe("ViewTransition");default:return""}}function be(e){try{var t="",n=null;do{t+=ve(e,n),n=e,e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var ye=Object.prototype.hasOwnProperty,we=n.unstable_scheduleCallback,ke=n.unstable_cancelCallback,_e=n.unstable_shouldYield,Se=n.unstable_requestPaint,xe=n.unstable_now,Ce=n.unstable_getCurrentPriorityLevel,Ee=n.unstable_ImmediatePriority,Ie=n.unstable_UserBlockingPriority,Te=n.unstable_NormalPriority,Re=n.unstable_LowPriority,Ne=n.unstable_IdlePriority,Oe=n.log,Ae=n.unstable_setDisableYieldValue,Le=null,De=null;function Pe(e){if("function"==typeof Oe&&Ae(e),De&&"function"==typeof De.setStrictMode)try{De.setStrictMode(Le,e)}catch(e){}}var Me=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(Fe(e)/je|0)|0},Fe=Math.log,je=Math.LN2,ze=256,Ue=262144,$e=4194304;function Be(e){var t=42&e;if(0!==t)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&-e;case 262144:case 524288:case 1048576:case 2097152:return 3932160&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var i=e.pendingLanes;if(0===i)return 0;var r=0,o=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var s=134217727&i;return 0!==s?0!==(i=s&~o)?r=Be(i):0!==(a&=s)?r=Be(a):n||0!==(n=s&~e)&&(r=Be(n)):0!==(s=i&~o)?r=Be(s):0!==a?r=Be(a):n||0!==(n=i&~e)&&(r=Be(n)),0===r?0:0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(n=t&-t)||32===o&&4194048&n)?t:r}function We(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Ve(e,t){8&t&&(t|=32&t);var n=e.entangledLanes;if(0!==n)for(e=e.entanglements,n&=t;0<n;){var i=31-Me(n),r=1<<i;t|=e[i],n&=~r}return t}function qe(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;default:return-1}}function Ge(){var e=$e;return!(62914560&($e<<=1))&&($e=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Me(t);e.entangledLanes|=t,e.entanglements[i]=1073741824|e.entanglements[i]|261930&n}function Je(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Me(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}function Xe(e,t){var n=t&-t;return 0!==((n=42&n?1:Ze(n))&(e.suspendedLanes|t))?0:n}function Ze(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 et(e){return 2<(e&=-e)?8<e?134217727&e?32:268435456:8:2}function tt(){var e=J.p;return 0!==e?e:void 0===(e=window.event)?32:Ef(e.type)}function nt(e,t){var n=J.p;try{return J.p=e,t()}finally{J.p=n}}var it=Math.random().toString(36).slice(2),rt="__reactFiber$"+it,ot="__reactProps$"+it,at="__reactContainer$"+it,st="__reactEvents$"+it,lt="__reactListeners$"+it,ct="__reactHandles$"+it,dt="__reactResources$"+it,ut="__reactMarker$"+it,ht="__reactLoad$"+it;function pt(e){delete e[rt],delete e[ot],delete e[lt],delete e[ct]}function ft(e){var t;if(t=e[rt])return t;for(var n=e.parentNode;n;){if(t=n[at]||n[rt]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Op(e);null!==e;){if(n=e[rt])return n;e=Op(e)}return t}n=(e=n).parentNode}return null}function gt(e){if(e=e[rt]||e[at]){var t=e.tag;if(5===t||6===t||13===t||31===t||26===t||27===t||3===t)return e}return null}function mt(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(a(33))}function vt(e){var t=e[dt];return t||(t=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function bt(e){e[ut]=!0}function yt(e){e[ht]=void 0}var wt=new Set,kt={};function _t(e,t){St(e,t),St(e+"Capture",t)}function St(e,t){for(kt[e]=t,e=0;e<t.length;e++)wt.add(t[e])}var xt=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]*$"),Ct={},Et={},It=!1;function Tt(){var e=It;return It=!1,e}function Rt(e,t,n){if(r=t,ye.call(Et,r)||!ye.call(Ct,r)&&(xt.test(r)?Et[r]=!0:(Ct[r]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var i=t.toLowerCase().slice(0,5);if("data-"!==i&&"aria-"!==i)return void e.removeAttribute(t)}e.setAttribute(t,n)}var r}function Nt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,n)}}function Ot(e,t,n,i){if(null===i)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,i)}}function At(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function Lt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Dt(e){if(!e._valueTracker){var t=Lt(e)?"checked":"value";e._valueTracker=function(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&void 0!==i&&"function"==typeof i.get&&"function"==typeof i.set){var r=i.get,o=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){n=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e,t,""+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Lt(e)?e.checked?"true":"false":e.value),(e=i)!==n&&(t.setValue(e),!0)}var Mt=/[\n"\\]/g;function Ft(e){return e.replace(Mt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function jt(e,t,n,i,r,o,a,s){e.name="",null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a?e.type=a:e.removeAttribute("type"),null!=t?"number"===a?(0===t&&""===e.value||e.value!=t)&&(e.value=""+At(t)):e.value!==""+At(t)&&(e.value=""+At(t)):"submit"!==a&&"reset"!==a||e.removeAttribute("value"),null!=t?"number"===a&&e.value==t?Ut(e,At(e.value)):Ut(e,At(t)):null!=n?Ut(e,At(n)):null!=i&&e.removeAttribute("value"),null==r&&null!=o&&(e.defaultChecked=!!o),null!=r&&(e.checked=r&&"function"!=typeof r&&"symbol"!=typeof r),null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?e.name=""+At(s):e.removeAttribute("name")}function zt(e,t,n,i,r,o,a,s){if(null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.type=o),null!=t||null!=n){if(("submit"===o||"reset"===o)&&null==t)return void Dt(e);n=null!=n?""+At(n):"",t=null!=t?""+At(t):n,s||t===e.value||(e.value=t),e.defaultValue=t}i="function"!=typeof(i=null!=i?i:r)&&"symbol"!=typeof i&&!!i,e.checked=s?e.checked:!!i,e.defaultChecked=!!i,null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.name=a),Dt(e)}function Ut(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function $t(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+At(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(i&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function Bt(e,t,n){null==t||((t=""+At(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+At(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function Ht(e,t,n,i){if(null==t){if(null!=i){if(null!=n)throw Error(a(92));if(Y(i)){if(1<i.length)throw Error(a(93));i=i[0]}n=i}null==n&&(n=""),t=n}n=At(t),e.defaultValue=n,(i=e.textContent)===n&&""!==i&&null!==i&&(e.value=i),Dt(e)}function Wt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Vt=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 qt(e,t,n){var i=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?i?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":i?e.setProperty(t,n):"number"!=typeof n||0===n||Vt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Gt(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(a(62));if(e=e.style,null!=n){for(var i in n)!n.hasOwnProperty(i)||null!=t&&t.hasOwnProperty(i)||(0===i.indexOf("--")?e.setProperty(i,""):"float"===i?e.cssFloat="":e[i]="",It=!0);for(var r in t)i=t[r],t.hasOwnProperty(r)&&n[r]!==i&&(qt(e,r,i),It=!0)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function Kt(e){if(-1===e.indexOf("-"))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 Yt=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"],["maskType","mask-type"],["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"]]),Qt=/^[\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 Jt(e){return Qt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xt(){}var Zt=null;function en(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var tn=null,nn=null;function rn(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(jt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Ft(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=i[ot]||null;if(!r)throw Error(a(90));jt(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)(i=n[t]).form===e.form&&Pt(i)}break e;case"textarea":Bt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&$t(e,!!n.multiple,t,!1)}}}var on=!1;function an(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(null!==tn||null!==nn)&&(vu(),tn&&(t=tn,e=nn,nn=tn=null,rn(t),e)))for(t=0;t<e.length;t++)rn(e[t])}}function sn(e,t){var n=e.stateNode;if(null===n)return null;var i=n[ot]||null;if(null===i)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)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(a(231,t,typeof n));return n}var ln=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),cn=!1;if(ln)try{var dn={};Object.defineProperty(dn,"passive",{get:function(){cn=!0}}),window.addEventListener("test",dn,dn),window.removeEventListener("test",dn,dn)}catch(e){cn=!1}var un=null,hn=null,pn=null;function fn(){if(pn)return pn;var e,t,n=hn,i=n.length,r="value"in un?un.value:un.textContent,o=r.length;for(e=0;e<i&&n[e]===r[e];e++);var a=i-e;for(t=1;t<=a&&n[i-t]===r[o-t];t++);return pn=r.slice(e,1<t?1-t:void 0)}function gn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function mn(){return!0}function vn(){return!1}function bn(e){function t(t,n,i,r,o){for(var a in this._reactName=t,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(r):r[a]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?mn:vn,this.isPropagationStopped=vn,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var yn,wn,kn,_n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(_n),xn=E({},_n,{view:0,detail:0}),Cn=bn(xn),En=E({},xn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==kn&&(kn&&"mousemove"===e.type?(yn=e.screenX-kn.screenX,wn=e.screenY-kn.screenY):wn=yn=0,kn=e),yn)},movementY:function(e){return"movementY"in e?e.movementY:wn}}),In=bn(En),Tn=bn(E({},En,{dataTransfer:0})),Rn=bn(E({},xn,{relatedTarget:0})),Nn=bn(E({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),On=bn(E({},_n,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),An=bn(E({},_n,{data:0})),Ln={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dn={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"},Pn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Pn[e])&&!!t[e]}function Fn(){return Mn}var jn=bn(E({},xn,{key:function(e){if(e.key){var t=Ln[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=gn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Dn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return"keypress"===e.type?gn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?gn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),zn=bn(E({},En,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=bn(E({},_n,{submitter:0})),$n=bn(E({},xn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),Bn=bn(E({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Hn=bn(E({},En,{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})),Wn=bn(E({},_n,{newState:0,oldState:0,source:0})),Vn=[9,13,27,32],qn=ln&&"CompositionEvent"in window,Gn=null;ln&&"documentMode"in document&&(Gn=document.documentMode);var Kn=ln&&"TextEvent"in window&&!Gn,Yn=ln&&(!qn||Gn&&8<Gn&&11>=Gn),Qn=String.fromCharCode(32),Jn=!1;function Xn(e,t){switch(e){case"keyup":return-1!==Vn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var ei=!1,ti={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 ni(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ti[e.type]:"textarea"===t}function ii(e,t,n,i){tn?nn?nn.push(i):nn=[i]:tn=i,0<(t=_h(t,"onChange")).length&&(n=new Sn("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var ri=null,oi=null;function ai(e){fh(e,0)}function si(e){if(Pt(mt(e)))return e}function li(e,t){if("change"===e)return t}var ci=!1;if(ln){var di;if(ln){var ui="oninput"in document;if(!ui){var hi=document.createElement("div");hi.setAttribute("oninput","return;"),ui="function"==typeof hi.oninput}di=ui}else di=!1;ci=di&&(!document.documentMode||9<document.documentMode)}function pi(){ri&&(ri.detachEvent("onpropertychange",fi),oi=ri=null)}function fi(e){if("value"===e.propertyName&&si(oi)){var t=[];ii(t,oi,e,en(e)),an(ai,t)}}function gi(e,t,n){"focusin"===e?(pi(),oi=n,(ri=t).attachEvent("onpropertychange",fi)):"focusout"===e&&pi()}function mi(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return si(oi)}function vi(e,t){if("click"===e)return si(t)}function bi(e,t){if("input"===e||"change"===e)return si(t)}var yi="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function wi(e,t){if(yi(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)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 r=n[i];if(!ye.call(t,r)||!yi(e[r],t[r]))return!1}return!0}function ki(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function _i(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Si(e,t){var n,i=_i(e);for(e=0;i;){if(3===i.nodeType){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=_i(i)}}function xi(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?xi(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Ci(e){for(var t=ki((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=ki((e=t.contentWindow).document)}return t}function Ei(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Ii=ln&&"documentMode"in document&&11>=document.documentMode,Ti=null,Ri=null,Ni=null,Oi=!1;function Ai(e,t,n){var i=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;Oi||null==Ti||Ti!==ki(i)||(i="selectionStart"in(i=Ti)&&Ei(i)?{start:i.selectionStart,end:i.selectionEnd}:{anchorNode:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset},Ni&&wi(Ni,i)||(Ni=i,0<(i=_h(Ri,"onSelect")).length&&(t=new Sn("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Ti)))}function Li(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Di={animationend:Li("Animation","AnimationEnd"),animationiteration:Li("Animation","AnimationIteration"),animationstart:Li("Animation","AnimationStart"),transitionrun:Li("Transition","TransitionRun"),transitionstart:Li("Transition","TransitionStart"),transitioncancel:Li("Transition","TransitionCancel"),transitionend:Li("Transition","TransitionEnd")},Pi={},Mi={};function Fi(e){if(Pi[e])return Pi[e];if(!Di[e])return e;var t,n=Di[e];for(t in n)if(n.hasOwnProperty(t)&&t in Mi)return Pi[e]=n[t];return e}ln&&(Mi=document.createElement("div").style,"AnimationEvent"in window||(delete Di.animationend.animation,delete Di.animationiteration.animation,delete Di.animationstart.animation),"TransitionEvent"in window||delete Di.transitionend.transition);var ji=Fi("animationend"),zi=Fi("animationiteration"),Ui=Fi("animationstart"),$i=Fi("transitionrun"),Bi=Fi("transitionstart"),Hi=Fi("transitioncancel"),Wi=Fi("transitionend"),Vi=new Map,qi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");function Gi(e,t){Vi.set(e,t),_t(t,[e])}qi.push("scrollEnd");var Ki=0;function Yi(e,t){return null!=e.name&&"auto"!==e.name?e.name:null!==t.autoName?t.autoName:(e="_"+(e=Xd.identifierPrefix)+"t_"+(Ki++).toString(32)+"_",t.autoName=e)}function Qi(e){if(null==e||"string"==typeof e)return e;var t=null,n=au;if(null!==n)for(var i=0;i<n.length;i++){var r=e[n[i]];if(null!=r){if("none"===r)return"none";t=null==t?r:t+" "+r}}return t??e.default}function Ji(e,t){return e=Qi(e),null==(t=Qi(t))?"auto"===e?null:e:"auto"===t?null:t}var Xi="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},Zi=[],er=0,tr=0;function nr(){for(var e=er,t=tr=er=0;t<e;){var n=Zi[t];Zi[t++]=null;var i=Zi[t];Zi[t++]=null;var r=Zi[t];Zi[t++]=null;var o=Zi[t];if(Zi[t++]=null,null!==i&&null!==r){var a=i.pending;null===a?r.next=r:(r.next=a.next,a.next=r),i.pending=r}0!==o&&ar(n,r,o)}}function ir(e,t,n,i){Zi[er++]=e,Zi[er++]=t,Zi[er++]=n,Zi[er++]=i,tr|=i,e.lanes|=i,null!==(e=e.alternate)&&(e.lanes|=i)}function rr(e,t,n,i){return ir(e,t,n,i),sr(e)}function or(e,t){return ir(e,null,null,t),sr(e)}function ar(e,t,n){e.lanes|=n;var i=e.alternate;null!==i&&(i.lanes|=n);for(var r=!1,o=e.return;null!==o;)o.childLanes|=n,null!==(i=o.alternate)&&(i.childLanes|=n),22===o.tag&&(null===(e=o.stateNode)||1&e._visibility||(r=!0)),e=o,o=o.return;return 3===e.tag?(o=e.stateNode,r&&null!==t&&(r=31-Me(n),null===(i=(e=o.hiddenUpdates)[r])?e[r]=[t]:i.push(t),t.lane=536870912|n),o):null}function sr(e){if(50<su)throw su=0,lu=null,Error(a(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var lr={};function cr(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 dr(e,t,n,i){return new cr(e,t,n,i)}function ur(e){return!(!(e=e.prototype)||!e.isReactComponent)}function hr(e,t){var n=e.alternate;return null===n?((n=dr(e.tag,t,e.key,e.mode)).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=1206910976&e.flags,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=null===t?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 pr(e,t){e.flags&=1206910978;var n=e.alternate;return null===n?(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=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fr(e,t,n,i,r,o){var s=0;if("function"==typeof(i=e))ur(i)&&(s=1);else if("string"==typeof i)s=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href)break;return!0;case"link":if("string"!=typeof t.rel||"string"!=typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"==typeof t.precedence&&null==e);case"script":if(t.async&&"function"!=typeof t.async&&"symbol"!=typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"==typeof t.src)return!0}return!1}(e,n,ae.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(i){case U:return(e=dr(31,n,t,r)).elementType=U,e.lanes=o,e;case N:return gr(n.children,r,o,t);case O:s=8,r|=24;break;case A:return(e=dr(12,n,t,2|r)).elementType=A,e.lanes=o,e;case M:return(e=dr(13,n,t,r)).elementType=M,e.lanes=o,e;case F:return(e=dr(19,n,t,r)).elementType=F,e.lanes=o,e;case $:case H:return(e=dr(30,n,t,e=32|r)).elementType=H,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if("object"==typeof i&&null!==i)switch(i.$$typeof){case D:s=10;break e;case L:s=9;break e;case P:s=11;break e;case j:s=14;break e;case z:s=16,i=null;break e}s=29,n=Error(a(130,null===e?"null":typeof e,"")),i=null}return(t=dr(s,n,t,r)).elementType=e,t.type=i,t.lanes=o,t}function gr(e,t,n,i){return(e=dr(7,e,i,t)).lanes=n,e}function mr(e,t,n){return(e=dr(6,e,null,t)).lanes=n,e}function vr(e){var t=dr(18,null,null,0);return t.stateNode=e,t}function br(e,t,n){return(t=dr(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yr=new WeakMap;function wr(e,t){if("object"==typeof e&&null!==e){var n=yr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:be(t)},yr.set(e,t),t)}return{value:e,source:t,stack:be(t)}}var kr=[],_r=0,Sr=null,xr=0,Cr=[],Er=0,Ir=null,Tr=1,Rr="";function Nr(e,t){kr[_r++]=xr,kr[_r++]=Sr,Sr=e,xr=t}function Or(e,t,n){Cr[Er++]=Tr,Cr[Er++]=Rr,Cr[Er++]=Ir,Ir=e;var i=Tr;e=Rr;var r=32-Me(i)-1;i&=~(1<<r),n+=1;var o=32-Me(t)+r;if(30<o){var a=r-r%5;o=(i&(1<<a)-1).toString(32),i>>=a,r-=a,Tr=1<<32-Me(t)+r|n<<r|i,Rr=o+e}else Tr=1<<o|n<<r|i,Rr=e}function Ar(e){null!==e.return&&(Nr(e,1),Or(e,1,0))}function Lr(e){for(;e===Sr;)Sr=kr[--_r],kr[_r]=null,xr=kr[--_r],kr[_r]=null;for(;e===Ir;)Ir=Cr[--Er],Cr[Er]=null,Rr=Cr[--Er],Cr[Er]=null,Tr=Cr[--Er],Cr[Er]=null}function Dr(e,t){Cr[Er++]=Tr,Cr[Er++]=Rr,Cr[Er++]=Ir,Tr=t.id,Rr=t.overflow,Ir=e}var Pr=null,Mr=null,Fr=!1,jr=null,zr=!1,Ur=Error(a(519));function $r(e){throw Gr(wr(Error(a(418,1<arguments.length&&void 0!==arguments[1]&&arguments[1]?"text":"HTML","")),e)),Ur}function Br(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[rt]=e,t[ot]=i,n){case"dialog":gh("cancel",t),gh("close",t);break;case"iframe":case"object":case"embed":gh("load",t);break;case"video":case"audio":for(n=0;n<hh.length;n++)gh(hh[n],t);break;case"source":gh("error",t);break;case"img":case"image":case"link":gh("error",t),gh("load",t);break;case"details":gh("toggle",t);break;case"input":gh("invalid",t),zt(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":gh("invalid",t);break;case"textarea":gh("invalid",t),Ht(t,i.value,i.defaultValue,i.children)}"string"!=typeof(n=i.children)&&"number"!=typeof n&&"bigint"!=typeof n||t.textContent===""+n||!0===i.suppressHydrationWarning||Th(t.textContent,n)?(null!=i.popover&&(gh("beforetoggle",t),gh("toggle",t)),null!=i.onScroll&&gh("scroll",t),null!=i.onScrollEnd&&gh("scrollend",t),null!=i.onClick&&(t.onclick=Xt),t=!0):t=!1,t||$r(e,!0)}function Hr(e){for(Pr=e.return;Pr;)switch(Pr.tag){case 5:case 31:case 13:return void(zr=!1);case 27:case 3:return void(zr=!0);default:Pr=Pr.return}}function Wr(e){if(e!==Pr)return!1;if(!Fr)return Hr(e),Fr=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||Uh(e.type,e.memoizedProps)),t=!t),t&&Mr&&$r(e),Hr(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));Mr=Np(e)}else if(31===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));Mr=Np(e)}else 27===n?(n=Mr,Kh(e.type)?(e=Rp,Rp=null,Mr=e):Mr=n):Mr=Pr?Tp(e.stateNode.nextSibling):null;return!0}function Vr(){Mr=Pr=null,Fr=!1}function qr(){var e=jr;return null!==e&&(null===Wd?Wd=e:Wd.push.apply(Wd,e),jr=null),e}function Gr(e){null===jr?jr=[e]:jr.push(e)}var Kr=te(null),Yr=null,Qr=null;function Jr(e,t,n){ie(Kr,t._currentValue),t._currentValue=n}function Xr(e){e._currentValue=Kr.current,ne(Kr)}function Zr(e,t,n){for(;null!==e;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==i&&(i.childLanes|=t)):null!==i&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function eo(e,t,n,i){var r=e.child;for(null!==r&&(r.return=e);null!==r;){var o=r.dependencies;if(null!==o){var s=r.child;o=o.firstContext;e:for(;null!==o;){var l=o;o=r;for(var c=0;c<t.length;c++)if(l.context===t[c]){o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Zr(o.return,n,e),i||(s=null);break e}o=l.next}}else if(18===r.tag){if(null===(s=r.return))throw Error(a(341));s.lanes|=n,null!==(o=s.alternate)&&(o.lanes|=n),Zr(s,n,e),s=null}else 13===r.tag&&null!==r.memoizedState&&null===r.memoizedState.dehydrated?(r.lanes|=n,null!==(s=r.alternate)&&(s.lanes|=n),Zr(r.return,n,e),s=null!==(s=r.child)?s.sibling:null):s=r.child;if(null!==s)s.return=r;else for(s=r;null!==s;){if(s===e){s=null;break}if(null!==(r=s.sibling)){r.return=s.return,s=r;break}s=s.return}r=s}}function to(e,t,n,i){e=null;for(var r=t,o=!1;null!==r;){if(!o)if(524288&r.flags)o=!0;else if(262144&r.flags)break;if(10===r.tag){var s=r.alternate;if(null===s)throw Error(a(387));if(null!==(s=s.memoizedProps)){var l=r.type;yi(r.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(r===ce.current){if(null===(s=r.alternate))throw Error(a(387));s.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(null!==e?e.push(hf):e=[hf])}r=r.return}return null!==e&&eo(t,e,n,i),t.flags|=262144,null!==e}function no(e){for(e=e.firstContext;null!==e;){if(!yi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function io(e){Yr=e,Qr=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function ro(e){return ao(Yr,e)}function oo(e,t){return null===Yr&&io(e),ao(e,t)}function ao(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===Qr){if(null===e)throw Error(a(308));Qr=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Qr=Qr.next=t;return n}var so="undefined"!=typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},lo=n.unstable_scheduleCallback,co=n.unstable_NormalPriority,uo={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ho(){return{controller:new so,data:new Map,refCount:0}}function po(e){e.refCount--,0===e.refCount&&lo(co,function(){e.controller.abort()})}function fo(e,t){if(4194048&e.pendingLanes){var n=e.transitionTypes;for(null===n&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var i=t[e];-1===n.indexOf(i)&&n.push(i)}}}var go=null,mo=null,vo=0,bo=0,yo=null;function wo(){if(0===--vo&&(go=null,null!==mo)){null!==yo&&(yo.status="fulfilled");var e=mo;mo=null,bo=0,yo=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var ko=Q.S;Q.S=function(e,t){if(Gd=xe(),"object"==typeof t&&null!==t&&"function"==typeof t.then&&function(e,t){if(null===mo){var n=mo=[];vo=0,bo=lh(),yo={status:"pending",value:void 0,then:function(e){n.push(e)}}}vo++,t.then(wo,wo)}(0,t),null!==go)for(var n=Yu;null!==n;)fo(n,go),n=n.next;if(null!==(n=e.types)){for(var i=Yu;null!==i;)fo(i,n),i=i.next;if(0!==bo){null===(i=go)&&(i=go=[]);for(var r=0;r<n.length;r++){var o=n[r];-1===i.indexOf(o)&&i.push(o)}}}null!==ko&&ko(e,t)};var _o=te(null);function So(){var e=_o.current;return null!==e?e:Td.pooledCache}function xo(e,t){ie(_o,null===t?_o.current:t.pool)}function Co(){var e=So();return null===e?null:{parent:uo._currentValue,pool:e}}var Eo=Error(a(460)),Io=Error(a(474)),To=Error(a(542)),Ro={then:function(){}};function No(e){return"fulfilled"===(e=e.status)||"rejected"===e}function Oo(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case"fulfilled":return t.value;case"rejected":if(Po(e=t.reason),void 0===e&&!("reason"in t))throw Error(a(600));throw e;default:if("string"==typeof t.status)t.then(Xt,Xt);else{if(null!==(e=Td)&&100<e.shellSuspendCounter)throw Error(a(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw Po(e=t.reason),e}throw Lo=t,Eo}}function Ao(e){try{return(0,e._init)(e._payload)}catch(e){if(null!==e&&"object"==typeof e&&"function"==typeof e.then)throw Lo=e,Eo;throw e}}var Lo=null;function Do(){if(null===Lo)throw Error(a(459));var e=Lo;return Lo=null,e}function Po(e){if(e===Eo||e===To)throw Error(a(483))}var Mo=null,Fo=0;function jo(e){var t=Fo;return Fo+=1,null===Mo&&(Mo=[]),Oo(Mo,e,t)}function zo(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function Uo(e,t){if(t.$$typeof===I)throw Error(a(525));throw e=Object.prototype.toString.call(t),Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function $o(e){function t(t,n){if(e){var i=t.deletions;null===i?(t.deletions=[n],t.flags|=16):i.push(n)}}function n(n,i){if(!e)return null;for(;null!==i;)t(n,i),i=i.sibling;return null}function i(e){for(var t=new Map;null!==e;)null===e.key?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function r(e,t){return(e=hr(e,t)).index=0,e.sibling=null,e}function o(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.flags|=2,n):i:(t.flags|=134217730,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=134217730),t}function l(e,t,n,i){return null===t||6!==t.tag?((t=mr(n,e.mode,i)).return=e,t):((t=r(t,n)).return=e,t)}function c(e,t,n,i){var o=n.type;return o===N?(zo(e=u(e,t,n.props.children,i,n.key),n),e):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===z&&Ao(o)===t.type)?(zo(t=r(t,n.props),n),t.return=e,t):(zo(t=fr(n.type,n.key,n.props,null,e.mode,i),n),t.return=e,t)}function d(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=br(n,e.mode,i)).return=e,t):((t=r(t,n.children||[])).return=e,t)}function u(e,t,n,i,o){return null===t||7!==t.tag?((t=gr(n,e.mode,i,o)).return=e,t):((t=r(t,n)).return=e,t)}function h(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t||"bigint"==typeof t)return(t=mr(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case T:return zo(n=fr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case R:return(t=br(t,e.mode,n)).return=e,t;case z:return h(e,t=Ao(t),n)}if(Y(t)||q(t))return(t=gr(t,e.mode,n,null)).return=e,t;if("function"==typeof t.then)return h(e,jo(t),n);if(t.$$typeof===D)return h(e,oo(e,t),n);Uo(e,t)}return null}function p(e,t,n,i){var r=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n||"bigint"==typeof n)return null!==r?null:l(e,t,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case T:return n.key===r?c(e,t,n,i):null;case R:return n.key===r?d(e,t,n,i):null;case z:return p(e,t,n=Ao(n),i)}if(Y(n)||q(n))return null!==r?null:u(e,t,n,i,null);if("function"==typeof n.then)return p(e,t,jo(n),i);if(n.$$typeof===D)return p(e,t,oo(e,n),i);Uo(e,n)}return null}function f(e,t,n,i,r){if("string"==typeof i&&""!==i||"number"==typeof i||"bigint"==typeof i)return l(t,e=e.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case T:return c(t,e=e.get(null===i.key?n:i.key)||null,i,r);case R:return d(t,e=e.get(null===i.key?n:i.key)||null,i,r);case z:return f(e,t,n,i=Ao(i),r)}if(Y(i)||q(i))return u(t,e=e.get(n)||null,i,r,null);if("function"==typeof i.then)return f(e,t,n,jo(i),r);if(i.$$typeof===D)return f(e,t,n,oo(t,i),r);Uo(t,i)}return null}function g(l,c,d,u){if("object"==typeof d&&null!==d&&d.type===N&&null===d.key&&void 0===d.props.ref&&(d=d.props.children),"object"==typeof d&&null!==d){switch(d.$$typeof){case T:e:{for(var m=d.key;null!==c;){if(c.key===m){if((m=d.type)===N){if(7===c.tag){n(l,c.sibling),zo(u=r(c,d.props.children),d),u.return=l,l=u;break e}}else if(c.elementType===m||"object"==typeof m&&null!==m&&m.$$typeof===z&&Ao(m)===c.type){n(l,c.sibling),zo(u=r(c,d.props),d),u.return=l,l=u;break e}n(l,c);break}t(l,c),c=c.sibling}d.type===N?(zo(u=gr(d.props.children,l.mode,u,d.key),d),u.return=l,l=u):(zo(u=fr(d.type,d.key,d.props,null,l.mode,u),d),u.return=l,l=u)}return s(l);case R:e:{for(m=d.key;null!==c;){if(c.key===m){if(4===c.tag&&c.stateNode.containerInfo===d.containerInfo&&c.stateNode.implementation===d.implementation){n(l,c.sibling),(u=r(c,d.children||[])).return=l,l=u;break e}n(l,c);break}t(l,c),c=c.sibling}(u=br(d,l.mode,u)).return=l,l=u}return s(l);case z:return g(l,c,d=Ao(d),u)}if(Y(d))return function(r,a,s,l){for(var c=null,d=null,u=a,g=a=0,m=null;null!==u&&g<s.length;g++){u.index>g?(m=u,u=null):m=u.sibling;var v=p(r,u,s[g],l);if(null===v){null===u&&(u=m);break}e&&u&&null===v.alternate&&t(r,u),a=o(v,a,g),null===d?c=v:d.sibling=v,d=v,u=m}if(g===s.length)return n(r,u),Fr&&Nr(r,g),c;if(null===u){for(;g<s.length;g++)null!==(u=h(r,s[g],l))&&(a=o(u,a,g),null===d?c=u:d.sibling=u,d=u);return Fr&&Nr(r,g),c}for(u=i(u);g<s.length;g++)null!==(m=f(u,r,g,s[g],l))&&(e&&null!==(v=m.alternate)&&u.delete(null===v.key?g:v.key),a=o(m,a,g),null===d?c=m:d.sibling=m,d=m);return e&&u.forEach(function(e){return t(r,e)}),Fr&&Nr(r,g),c}(l,c,d,u);if(q(d)){if("function"!=typeof(m=q(d)))throw Error(a(150));return function(r,s,l,c){if(null==l)throw Error(a(151));for(var d=null,u=null,g=s,m=s=0,v=null,b=l.next();null!==g&&!b.done;m++,b=l.next()){g.index>m?(v=g,g=null):v=g.sibling;var y=p(r,g,b.value,c);if(null===y){null===g&&(g=v);break}e&&g&&null===y.alternate&&t(r,g),s=o(y,s,m),null===u?d=y:u.sibling=y,u=y,g=v}if(b.done)return n(r,g),Fr&&Nr(r,m),d;if(null===g){for(;!b.done;m++,b=l.next())null!==(b=h(r,b.value,c))&&(s=o(b,s,m),null===u?d=b:u.sibling=b,u=b);return Fr&&Nr(r,m),d}for(g=i(g);!b.done;m++,b=l.next())null!==(b=f(g,r,m,b.value,c))&&(e&&null!==(v=b.alternate)&&g.delete(null===v.key?m:v.key),s=o(b,s,m),null===u?d=b:u.sibling=b,u=b);return e&&g.forEach(function(e){return t(r,e)}),Fr&&Nr(r,m),d}(l,c,d=m.call(d),u)}if("function"==typeof d.then)return g(l,c,jo(d),u);if(d.$$typeof===D)return g(l,c,oo(l,d),u);Uo(l,d)}return"string"==typeof d&&""!==d||"number"==typeof d||"bigint"==typeof d?(d=""+d,null!==c&&6===c.tag?(n(l,c.sibling),(u=r(c,d)).return=l,l=u):(n(l,c),(u=mr(d,l.mode,u)).return=l,l=u),s(l)):n(l,c)}return function(e,t,n,i){try{Fo=0;var r=g(e,t,n,i);return Mo=null,r}catch(t){if(t===Eo||t===To)throw t;var o=dr(29,t,null,e.mode);return o.lanes=i,o.return=e,o}}}var Bo=$o(!0),Ho=$o(!1),Wo=!1;function Vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qo(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 Go(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ko(e,t,n){var i=e.updateQueue;if(null===i)return null;if(i=i.shared,2&Id){var r=i.pending;return null===r?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=sr(e),ar(e,null,n),t}return ir(e,i,t,n),sr(e)}function Yo(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194048&n)){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,Je(e,n)}}function Qo(e,t){var n=e.updateQueue,i=e.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===o?r=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?r=o=t:o=o.next=t}else r=o=t;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,callbacks:i.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Jo=!1;function Xo(){if(Jo&&null!==yo)throw yo}function Zo(e,t,n,i){Jo=!1;var r=e.updateQueue;Wo=!1;var o=r.firstBaseUpdate,a=r.lastBaseUpdate,s=r.shared.pending;if(null!==s){r.shared.pending=null;var l=s,c=l.next;l.next=null,null===a?o=c:a.next=c,a=l;var d=e.alternate;null!==d&&(s=(d=d.updateQueue).lastBaseUpdate)!==a&&(null===s?d.firstBaseUpdate=c:s.next=c,d.lastBaseUpdate=l)}if(null!==o){var u=r.baseState;for(a=0,d=c=l=null,s=o;;){var h=-536870913&s.lane,p=h!==s.lane;if(p?(Nd&h)===h:(i&h)===h){0!==h&&h===bo&&(Jo=!0),null!==d&&(d=d.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var f=e,g=s;h=t;var m=n;switch(g.tag){case 1:if("function"==typeof(f=g.payload)){u=f.call(m,u,h);break e}u=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null==(h="function"==typeof(f=g.payload)?f.call(m,u,h):f))break e;u=E({},u,h);break e;case 2:Wo=!0}}null!==(h=s.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=r.callbacks)?r.callbacks=[h]:p.push(h))}else p={lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===d?(c=d=p,l=u):d=d.next=p,a|=h;if(null===(s=s.next)){if(null===(s=r.shared.pending))break;s=(p=s).next,p.next=null,r.lastBaseUpdate=p,r.shared.pending=null}}null===d&&(l=u),r.baseState=l,r.firstBaseUpdate=c,r.lastBaseUpdate=d,null===o&&(r.shared.lanes=0),jd|=a,e.lanes=a,e.memoizedState=u}}function ea(e,t){if("function"!=typeof e)throw Error(a(191,e));e.call(t)}function ta(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)ea(n[e],t)}var na=te(null),ia=te(0);function ra(e,t){ie(ia,e=Md),ie(na,t),Md=e|t.baseLanes}function oa(){ie(ia,Md),ie(na,na.current)}function aa(){Md=ia.current,ne(na),ne(ia)}var sa=te(null),la=null;function ca(e){var t=e.alternate;ie(fa,1&fa.current),ie(sa,e),null===la&&(null===t||null!==na.current||null!==t.memoizedState)&&(la=e)}function da(e){ie(fa,fa.current),ie(sa,e),null===la&&(la=e)}function ua(e){22===e.tag?(ie(fa,fa.current),ie(sa,e),null===la&&(la=e)):ha()}function ha(){ie(fa,fa.current),ie(sa,sa.current)}function pa(e){ne(sa),la===e&&(la=null),ne(fa)}var fa=te(0);function ga(e,t){ie(sa,sa.current),ie(fa,t)}function ma(e){ne(fa),ne(sa),la===e&&(la=null)}function va(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Ep(n)||Ip(n)))return t}else if(19===t.tag&&"independent"!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ba=0,ya=null,wa=null,ka=null,_a=!1,Sa=!1,xa=!1,Ca=0,Ea=0,Ia=null,Ta=0;function Ra(){throw Error(a(321))}function Na(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yi(e[n],t[n]))return!1;return!0}function Oa(e,t,n,i,r,o){return ba=o,ya=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Q.H=null===e||null===e.memoizedState?qs:Gs,xa=!1,o=n(i,r),xa=!1,Sa&&(o=La(t,n,i,r)),Aa(e),o}function Aa(e){Q.H=Vs;var t=null!==wa&&null!==wa.next;if(ba=0,ka=wa=ya=null,_a=!1,Ea=0,Ia=null,t)throw Error(a(300));null===e||cl||null!==(e=e.dependencies)&&no(e)&&(cl=!0)}function La(e,t,n,i){ya=e;var r=0;do{if(Sa&&(Ia=null),Ea=0,Sa=!1,25<=r)throw Error(a(301));if(r+=1,ka=wa=null,null!=e.updateQueue){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,null!=o.memoCache&&(o.memoCache.index=0)}Q.H=Ks,o=t(n,i)}while(Sa);return o}function Da(){var e=Q.H,t=e.useState()[0];return t="function"==typeof t.then?Ua(t):t,e=e.useState()[0],(null!==wa?wa.memoizedState:null)!==e&&(ya.flags|=1024),t}function Pa(){var e=0!==Ca;return Ca=0,e}function Ma(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Fa(e){if(_a){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}_a=!1}ba=0,ka=wa=ya=null,Sa=!1,Ea=Ca=0,Ia=null}function ja(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ka?ya.memoizedState=ka=e:ka=ka.next=e,ka}function za(){if(null===wa){var e=ya.alternate;e=null!==e?e.memoizedState:null}else e=wa.next;var t=null===ka?ya.memoizedState:ka.next;if(null!==t)ka=t,wa=e;else{if(null===e){if(null===ya.alternate)throw Error(a(467));throw Error(a(310))}e={memoizedState:(wa=e).memoizedState,baseState:wa.baseState,baseQueue:wa.baseQueue,queue:wa.queue,next:null},null===ka?ya.memoizedState=ka=e:ka=ka.next=e}return ka}function Ua(e){var t=Ea;return Ea+=1,null===Ia&&(Ia=[]),e=Oo(Ia,e,t),t=ya,null===(null===ka?t.memoizedState:ka.next)&&(t=t.alternate,Q.H=null===t||null===t.memoizedState?qs:Gs),e}function $a(e){if(null!==e&&"object"==typeof e){if("function"==typeof e.then)return Ua(e);if(e.$$typeof===W)return;if(e.$$typeof===D)return ro(e)}throw Error(a(438,String(e)))}function Ba(e){var t=null,n=ya.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var i=ya.alternate;null!==i&&null!==(i=i.updateQueue)&&null!=(i=i.memoCache)&&(t={data:i.data.map(function(e){return e.slice()}),index:0})}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=B;return t.index++,n}function Ha(e,t){return"function"==typeof t?t(e):t}function Wa(e){return Va(za(),wa,e)}function Va(e,t,n){var i=e.queue;if(null===i)throw Error(a(311));i.lastRenderedReducer=n;var r=e.baseQueue,o=i.pending;if(null!==o){if(null!==r){var s=r.next;r.next=o.next,o.next=s}t.baseQueue=r=o,i.pending=null}if(o=e.baseState,null===r)e.memoizedState=o;else{var l=s=null,c=null,d=t=r.next,u=!1;do{var h=-536870913&d.lane;if(h!==d.lane?(Nd&h)===h:(ba&h)===h){var p=d.revertLane;if(0===p)null!==c&&(c=c.next={lane:0,revertLane:0,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),h===bo&&(u=!0);else{if((ba&p)===p){d=d.next,p===bo&&(u=!0);continue}h={lane:0,revertLane:d.revertLane,gesture:null,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},null===c?(l=c=h,s=o):c=c.next=h,ya.lanes|=p,jd|=p}h=d.action,xa&&n(o,h),o=d.hasEagerState?d.eagerState:n(o,h)}else p={lane:h,revertLane:d.revertLane,gesture:d.gesture,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},null===c?(l=c=p,s=o):c=c.next=p,ya.lanes|=h,jd|=h;d=d.next}while(null!==d&&d!==t);if(null===c?s=o:c.next=l,!yi(o,e.memoizedState)&&(cl=!0,u&&null!==(n=yo)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=c,i.lastRenderedState=o}return null===r&&(i.lanes=0),[e.memoizedState,i.dispatch]}function qa(e){var t=za(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,o=t.memoizedState;if(null!==r){n.pending=null;var s=r=r.next;do{o=e(o,s.action),s=s.next}while(s!==r);yi(o,t.memoizedState)||(cl=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function Ga(e,t,n){var i=ya,r=za(),o=Fr;if(o){if(void 0===n)throw Error(a(407));n=n()}else n=t();var s=!yi((wa||r).memoizedState,n);if(s&&(r.memoizedState=n,cl=!0),r=r.queue,bs(Qa.bind(null,i,r,e),[e]),ps((e=r.getSnapshot!==t||s||null!==ka&&!!(1&ka.memoizedState.tag))?9:8,{destroy:void 0},Ya.bind(null,i,r,n,t),null),e){if(i.flags|=2048,null===Td)throw Error(a(349));o||127&ba||Ka(i,t,n)}return n}function Ka(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ya.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ya(e,t,n,i){t.value=n,t.getSnapshot=i,Ja(t)&&Xa(e)}function Qa(e,t,n){return n(function(){Ja(t)&&Xa(e)})}function Ja(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yi(e,n)}catch(e){return!0}}function Xa(e){var t=or(e,2);null!==t&&hu(t,0,2)}function Za(e){var t=ja();if("function"==typeof e){var n=e;if(e=n(),xa){Pe(!0);try{n()}finally{Pe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:e},t}function es(e,t,n,i){return e.baseState=n,Va(e,wa,"function"==typeof i?i:Ha)}function ts(e,t,n,i,r){if(Bs(e))throw Error(a(485));if(null!==(e=t.action)){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};null!==Q.T?n(!0):o.isTransition=!1,i(o),null===(n=t.pending)?(o.next=t.pending=o,ns(t,o)):(o.next=n.next,t.pending=n.next=o)}}function ns(e,t){var n=t.action,i=t.payload,r=e.state;if(t.isTransition){var o=Q.T,a={};a.types=null!==o?o.types:null,Q.T=a;try{var s=n(r,i),l=Q.S;null!==l&&l(a,s),is(e,t,s)}catch(n){os(e,t,n)}finally{null!==o&&null!==a.types&&(o.types=a.types),Q.T=o}}else try{is(e,t,o=n(r,i))}catch(n){os(e,t,n)}}function is(e,t,n){null!==n&&"object"==typeof n&&"function"==typeof n.then?n.then(function(n){rs(e,t,n)},function(n){return os(e,t,n)}):rs(e,t,n)}function rs(e,t,n){t.status="fulfilled",t.value=n,as(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,ns(e,n)))}function os(e,t,n){var i=e.pending;if(e.pending=null,null!==i){i=i.next;do{t.status="rejected",t.reason=n,as(t),t=t.next}while(t!==i)}e.action=null}function as(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ss(e,t){return t}function ls(e,t){if(Fr){var n=Td.formState;if(null!==n){e:{var i=ya;if(Fr){if(Mr){t:{for(var r=Mr,o=zr;8!==r.nodeType;){if(!o){r=null;break t}if(null===(r=Tp(r.nextSibling))){r=null;break t}}r="F!"===(o=r.data)||"F"===o?r:null}if(r){Mr=Tp(r.nextSibling),i="F!"===r.data;break e}}$r(i)}i=!1}i&&(t=n[0])}}return(n=ja()).memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ss,lastRenderedState:t},n.queue=i,n=zs.bind(null,ya,i),i.dispatch=n,i=Za(!1),o=$s.bind(null,ya,!1,i.queue),r={state:t,dispatch:null,action:e,pending:null},(i=ja()).queue=r,n=ts.bind(null,ya,r,o,n),r.dispatch=n,i.memoizedState=e,[t,n,!1]}function cs(e){return ds(za(),wa,e)}function ds(e,t,n){if(t=Va(e,t,ss)[0],e=Wa(Ha)[0],"object"==typeof t&&null!==t&&"function"==typeof t.then)try{var i=Ua(t)}catch(e){if(e===Eo)throw To;throw e}else i=t;var r=(t=za()).queue,o=r.dispatch;return n!==t.memoizedState&&(ya.flags|=2048,ps(9,{destroy:void 0},us.bind(null,r,n),null)),[i,o,e]}function us(e,t){e.action=t}function hs(e){var t=za(),n=wa;if(null!==n)return ds(t,n,e);za(),t=t.memoizedState;var i=(n=za()).queue.dispatch;return n.memoizedState=e,[t,i,!1]}function ps(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},null===(t=ya.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function fs(){return za().memoizedState}function gs(e,t,n,i){var r=ja();ya.flags|=e,r.memoizedState=ps(1|t,{destroy:void 0},n,void 0===i?null:i)}function ms(e,t,n,i){var r=za();i=void 0===i?null:i;var o=r.memoizedState.inst;null!==wa&&null!==i&&Na(i,wa.memoizedState.deps)?r.memoizedState=ps(t,o,n,i):(ya.flags|=e,r.memoizedState=ps(1|t,o,n,i))}function vs(e,t){gs(8390656,8,e,t)}function bs(e,t){ms(2048,8,e,t)}function ys(e){var t=za().memoizedState;return function(e){ya.flags|=4;var t=ya.updateQueue;if(null===t)t={lastEffect:null,events:null,stores:null,memoCache:null},ya.updateQueue=t,t.events=[e];else{var n=t.events;null===n?t.events=[e]:n.push(e)}}({ref:t,nextImpl:e}),function(){if(2&Id)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function ws(e,t){return ms(4,2,e,t)}function ks(e,t){return ms(4,4,e,t)}function _s(e,t){if("function"==typeof t){e=e();var n=t(e);return function(){"function"==typeof n?n():t(null)}}if(null!=t)return e=e(),t.current=e,function(){t.current=null}}function Ss(e,t,n){n=null!=n?n.concat([e]):null,ms(4,4,_s.bind(null,t,e),n)}function xs(){}function Cs(e,t){var n=za();t=void 0===t?null:t;var i=n.memoizedState;return null!==t&&Na(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Es(e,t){var n=za();t=void 0===t?null:t;var i=n.memoizedState;if(null!==t&&Na(t,i[1]))return i[0];if(i=e(),xa){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[i,t],i}function Is(e,t,n){return void 0===n||1073741824&ba&&!(261930&Nd)?e.memoizedState=t:(e.memoizedState=n,e=du(),ya.lanes|=e,jd|=e,n)}function Ts(e,t,n,i){return yi(n,t)?n:null!==na.current?(e=Is(e,n,i),yi(e,t)||(cl=!0),e):106&ba&&(!(1073741824&ba)||261930&Nd)?(e=du(),ya.lanes|=e,jd|=e,t):(cl=!0,e.memoizedState=n)}function Rs(e,t,n,i,r){var o=J.p;J.p=0!==o&&8>o?o:8;var a,s,l,c=Q.T,d={};d.types=null!==c?c.types:null,Q.T=d,$s(e,!1,t,n);try{var u=r(),h=Q.S;null!==h&&h(d,u),null!==u&&"object"==typeof u&&"function"==typeof u.then?Us(e,t,(a=i,s=[],l={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},u.then(function(){l.status="fulfilled",l.value=a;for(var e=0;e<s.length;e++)(0,s[e])(a)},function(e){for(l.status="rejected",l.reason=e,e=0;e<s.length;e++)(0,s[e])(void 0)}),l),cu()):Us(e,t,i,cu())}catch(n){Us(e,t,{then:function(){},status:"rejected",reason:n},cu())}finally{J.p=o,null!==c&&null!==d.types&&(c.types=d.types),Q.T=c}}function Ns(){}function Os(e,t,n,i){if(5!==e.tag)throw Error(a(476));var r=As(e).queue;Rs(e,r,t,X,null===n?Ns:function(){return Ls(e),n(i)})}function As(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:X},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ha,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function Ls(e){var t=As(e);null===t.next&&(t=e.alternate.memoizedState),Us(e,t.next.queue,{},cu())}function Ds(){return ro(hf)}function Ps(){return za().memoizedState}function Ms(){return za().memoizedState}function Fs(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=cu(),i=Ko(t,e=Go(n),n);return null!==i&&(hu(i,0,n),Yo(i,t,n)),t={cache:ho()},void(e.payload=t)}t=t.return}}function js(e,t,n){var i=cu();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bs(e)?Hs(t,n):null!==(n=rr(e,t,n,i))&&(hu(n,0,i),Ws(n,t,i))}function zs(e,t,n){Us(e,t,n,cu())}function Us(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bs(e))Hs(t,r);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=o(a,n);if(r.hasEagerState=!0,r.eagerState=s,yi(s,a))return ir(e,t,r,0),null===Td&&nr(),!1}catch(e){}if(null!==(n=rr(e,t,r,i)))return hu(n,0,i),Ws(n,t,i),!0}return!1}function $s(e,t,n,i){if(i={lane:2,revertLane:lh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Bs(e)){if(t)throw Error(a(479))}else null!==(t=rr(e,n,i,2))&&hu(t,0,2)}function Bs(e){var t=e.alternate;return e===ya||null!==t&&t===ya}function Hs(e,t){Sa=_a=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ws(e,t,n){if(4194048&n){var i=t.lanes;n|=i&=e.pendingLanes,t.lanes=n,Je(e,n)}}var Vs={readContext:ro,use:$a,useCallback:Ra,useContext:Ra,useEffect:Ra,useImperativeHandle:Ra,useLayoutEffect:Ra,useInsertionEffect:Ra,useMemo:Ra,useReducer:Ra,useRef:Ra,useState:Ra,useDebugValue:Ra,useDeferredValue:Ra,useTransition:Ra,useSyncExternalStore:Ra,useId:Ra,useHostTransitionStatus:Ra,useFormState:Ra,useActionState:Ra,useOptimistic:Ra,useMemoCache:Ra,useCacheRefresh:Ra,useEffectEvent:Ra},qs={readContext:ro,use:$a,useCallback:function(e,t){return ja().memoizedState=[e,void 0===t?null:t],e},useContext:ro,useEffect:vs,useImperativeHandle:function(e,t,n){n=null!=n?n.concat([e]):null,gs(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gs(4194308,4,e,t)},useInsertionEffect:function(e,t){gs(4,2,e,t)},useMemo:function(e,t){var n=ja();t=void 0===t?null:t;var i=e();if(xa){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=ja();if(void 0!==n){var r=n(t);if(xa){Pe(!0);try{n(t)}finally{Pe(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=js.bind(null,ya,e),[i.memoizedState,e]},useRef:function(e){return e={current:e},ja().memoizedState=e},useState:function(e){var t=(e=Za(e)).queue,n=zs.bind(null,ya,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xs,useDeferredValue:function(e,t){return Is(ja(),e,t)},useTransition:function(){var e=Za(!1);return e=Rs.bind(null,ya,e.queue,!0,!1),ja().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=ya,r=ja();if(Fr){if(void 0===n)throw Error(a(407));n=n()}else{if(n=t(),null===Td)throw Error(a(349));127&Nd||Ka(i,t,n)}r.memoizedState=n;var o={value:n,getSnapshot:t};return r.queue=o,vs(Qa.bind(null,i,o,e),[e]),i.flags|=2048,ps(9,{destroy:void 0},Ya.bind(null,i,o,n,t),null),n},useId:function(){var e=ja(),t=Td.identifierPrefix;if(Fr){var n=Rr;t="_"+t+"R_"+(n=(Tr&~(1<<32-Me(Tr)-1)).toString(32)+n),0<(n=Ca++)&&(t+="H"+n.toString(32)),t+="_"}else t="_"+t+"r_"+(n=Ta++).toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:ls,useActionState:ls,useOptimistic:function(e){var t=ja();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=$s.bind(null,ya,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ba,useCacheRefresh:function(){return ja().memoizedState=Fs.bind(null,ya)},useEffectEvent:function(e){var t=ja(),n={impl:e};return t.memoizedState=n,function(){if(2&Id)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Gs={readContext:ro,use:$a,useCallback:Cs,useContext:ro,useEffect:bs,useImperativeHandle:Ss,useInsertionEffect:ws,useLayoutEffect:ks,useMemo:Es,useReducer:Wa,useRef:fs,useState:function(){return Wa(Ha)},useDebugValue:xs,useDeferredValue:function(e,t){return Ts(za(),wa.memoizedState,e,t)},useTransition:function(){var e=Wa(Ha)[0],t=za().memoizedState;return["boolean"==typeof e?e:Ua(e),t]},useSyncExternalStore:Ga,useId:Ps,useHostTransitionStatus:Ds,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){return es(za(),0,e,t)},useMemoCache:Ba,useCacheRefresh:Ms,useEffectEvent:ys},Ks={readContext:ro,use:$a,useCallback:Cs,useContext:ro,useEffect:bs,useImperativeHandle:Ss,useInsertionEffect:ws,useLayoutEffect:ks,useMemo:Es,useReducer:qa,useRef:fs,useState:function(){return qa(Ha)},useDebugValue:xs,useDeferredValue:function(e,t){var n=za();return null===wa?Is(n,e,t):Ts(n,wa.memoizedState,e,t)},useTransition:function(){var e=qa(Ha)[0],t=za().memoizedState;return["boolean"==typeof e?e:Ua(e),t]},useSyncExternalStore:Ga,useId:Ps,useHostTransitionStatus:Ds,useFormState:hs,useActionState:hs,useOptimistic:function(e,t){var n=za();return null!==wa?es(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Ba,useCacheRefresh:Ms,useEffectEvent:ys};function Ys(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:E({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Qs={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=cu(),r=Go(i);r.payload=t,null!=n&&(r.callback=n),null!==(t=Ko(e,r,i))&&(hu(t,0,i),Yo(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=cu(),r=Go(i);r.tag=1,r.payload=t,null!=n&&(r.callback=n),null!==(t=Ko(e,r,i))&&(hu(t,0,i),Yo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=cu(),i=Go(n);i.tag=2,null!=t&&(i.callback=t),null!==(t=Ko(e,i,n))&&(hu(t,0,n),Yo(t,e,n))}};function Js(e,t,n,i,r,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,o,a):!(t.prototype&&t.prototype.isPureReactComponent&&wi(n,i)&&wi(r,o))}function Xs(e,t,n,i){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Qs.enqueueReplaceState(t,t.state,null)}function Zs(e,t){var n=t;if("ref"in t)for(var i in n={},t)"ref"!==i&&(n[i]=t[i]);if(e=e.defaultProps)for(var r in n===t&&(n=E({},n)),e)void 0===n[r]&&(n[r]=e[r]);return n}function el(e){Xi(e)}function tl(e){console.error(e)}function nl(e){Xi(e)}function il(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function rl(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ol(e,t,n){return(n=Go(n)).tag=3,n.payload={element:null},n.callback=function(){il(e,t)},n}function al(e){return(e=Go(e)).tag=3,e}function sl(e,t,n,i){var r=n.type.getDerivedStateFromError;if("function"==typeof r){var o=i.value;e.payload=function(){return r(o)},e.callback=function(){rl(t,n,i)}}var a=n.stateNode;null!==a&&"function"==typeof a.componentDidCatch&&(e.callback=function(){rl(t,n,i),"function"!=typeof r&&(null===Qd?Qd=new Set([this]):Qd.add(this));var e=i.stack;this.componentDidCatch(i.value,{componentStack:null!==e?e:""})})}var ll=Error(a(461)),cl=!1;function dl(e,t,n,i){t.child=null===e?Ho(t,null,n,i):Bo(t,e.child,n,i)}function ul(e,t,n,i,r){n=n.render;var o=t.ref;if("ref"in i){var a={};for(var s in i)"ref"!==s&&(a[s]=i[s])}else a=i;return io(t),i=Oa(e,t,n,a,o,r),s=Pa(),null===e||cl?(Fr&&s&&Ar(t),t.flags|=1,dl(e,t,i,r),t.child):(Ma(e,t,r),Fl(e,t,r))}function hl(e,t,n,i,r){if(null===e){var o=n.type;return"function"!=typeof o||ur(o)||void 0!==o.defaultProps||null!==n.compare?((e=fr(n.type,null,i,t,t.mode,r)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,pl(e,t,o,i,r))}if(o=e.child,!jl(e,r)){var a=o.memoizedProps;if((n=null!==(n=n.compare)?n:wi)(a,i)&&e.ref===t.ref)return Fl(e,t,r)}return t.flags|=1,(e=hr(o,i)).ref=t.ref,e.return=t,t.child=e}function pl(e,t,n,i,r){if(null!==e){var o=e.memoizedProps;if(wi(o,i)&&e.ref===t.ref){if(cl=!1,t.pendingProps=i=o,!jl(e,r))return t.lanes=e.lanes,Fl(e,t,r);131072&e.flags&&(cl=!0)}}return wl(e,t,n,i,r)}function fl(e,t,n,i){var r=i.children,o=null!==e?e.memoizedState:null;if(null===e&&null===t.stateNode&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),"hidden"===i.mode){if(128&t.flags){if(o=null!==o?o.baseLanes|n:n,null!==e){for(i=t.child=e.child,r=0;null!==i;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~o}else i=0,t.child=null;return ml(e,t,o,n,i)}if(!(536870912&n))return i=t.lanes=536870912,ml(e,t,null!==o?o.baseLanes|n:n,n,i);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&xo(0,null!==o?o.cachePool:null),null!==o?ra(t,o):oa(),ua(t)}else null!==o?(xo(0,o.cachePool),ra(t,o),ha(),t.memoizedState=null):(null!==e&&xo(0,null),oa(),ha());return dl(e,t,r,n),t.child}function gl(e,t){return null!==e&&22===e.tag||null!==t.stateNode||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ml(e,t,n,i,r){var o=So();return o=null===o?null:{parent:uo._currentValue,pool:o},t.memoizedState={baseLanes:n,cachePool:o},null!==e&&xo(0,null),oa(),ua(t),null!==e&&to(e,t,i,!0),t.childLanes=r,null}function vl(e,t){return(t=Rl({mode:t.mode,children:t.children},e.mode)).ref=e.ref,e.child=t,t.return=e,t}function bl(e,t,n){return Bo(t,e.child,null,n),(e=vl(t,t.pendingProps)).flags|=2,pa(t),t.memoizedState=null,e}function yl(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!=typeof n&&"object"!=typeof n)throw Error(a(284));null!==e&&e.ref===n||(t.flags|=4194816)}}function wl(e,t,n,i,r){return io(t),n=Oa(e,t,n,i,void 0,r),i=Pa(),null===e||cl?(Fr&&i&&Ar(t),t.flags|=1,dl(e,t,n,r),t.child):(Ma(e,t,r),Fl(e,t,r))}function kl(e,t,n,i,r,o){return io(t),t.updateQueue=null,n=La(t,i,n,r),Aa(e),i=Pa(),null===e||cl?(Fr&&i&&Ar(t),t.flags|=1,dl(e,t,n,o),t.child):(Ma(e,t,o),Fl(e,t,o))}function _l(e,t,n,i,r){if(io(t),null===t.stateNode){var o=lr,a=n.contextType;"object"==typeof a&&null!==a&&(o=ro(a)),o=new n(i,o),t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,o.updater=Qs,t.stateNode=o,o._reactInternals=t,(o=t.stateNode).props=i,o.state=t.memoizedState,o.refs={},Vo(t),a=n.contextType,o.context="object"==typeof a&&null!==a?ro(a):lr,o.state=t.memoizedState,"function"==typeof(a=n.getDerivedStateFromProps)&&(Ys(t,n,a,i),o.state=t.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(a=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),a!==o.state&&Qs.enqueueReplaceState(o,o.state,null),Zo(t,i,o,r),Xo(),o.state=t.memoizedState),"function"==typeof o.componentDidMount&&(t.flags|=4194308),i=!0}else if(null===e){o=t.stateNode;var s=t.memoizedProps,l=Zs(n,s);o.props=l;var c=o.context,d=n.contextType;a=lr,"object"==typeof d&&null!==d&&(a=ro(d));var u=n.getDerivedStateFromProps;d="function"==typeof u||"function"==typeof o.getSnapshotBeforeUpdate,s=t.pendingProps!==s,d||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s||c!==a)&&Xs(t,o,i,a),Wo=!1;var h=t.memoizedState;o.state=h,Zo(t,i,o,r),Xo(),c=t.memoizedState,s||h!==c||Wo?("function"==typeof u&&(Ys(t,n,u,i),c=t.memoizedState),(l=Wo||Js(t,n,l,i,h,c,a))?(d||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(t.flags|=4194308)):("function"==typeof o.componentDidMount&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),o.props=i,o.state=c,o.context=a,i=l):("function"==typeof o.componentDidMount&&(t.flags|=4194308),i=!1)}else{o=t.stateNode,qo(e,t),d=Zs(n,a=t.memoizedProps),o.props=d,u=t.pendingProps,h=o.context,c=n.contextType,l=lr,"object"==typeof c&&null!==c&&(l=ro(c)),(c="function"==typeof(s=n.getDerivedStateFromProps)||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a!==u||h!==l)&&Xs(t,o,i,l),Wo=!1,h=t.memoizedState,o.state=h,Zo(t,i,o,r),Xo();var p=t.memoizedState;a!==u||h!==p||Wo||null!==e&&null!==e.dependencies&&no(e.dependencies)?("function"==typeof s&&(Ys(t,n,s,i),p=t.memoizedState),(d=Wo||Js(t,n,d,i,h,p,l)||null!==e&&null!==e.dependencies&&no(e.dependencies))?(c||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(i,p,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(i,p,l)),"function"==typeof o.componentDidUpdate&&(t.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=p),o.props=i,o.state=p,o.context=l,i=d):("function"!=typeof o.componentDidUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),i=!1)}return o=i,yl(e,t),i=!!(128&t.flags),o||i?(o=t.stateNode,n=i&&"function"!=typeof n.getDerivedStateFromError?null:o.render(),t.flags|=1,null!==e&&i?(t.child=Bo(t,e.child,null,r),t.child=Bo(t,null,n,r)):dl(e,t,n,r),t.memoizedState=o.state,e=t.child):e=Fl(e,t,r),e}function Sl(e,t,n,i){return Vr(),t.flags|=256,dl(e,t,n,i),t.child}var xl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cl(e){return{baseLanes:e,cachePool:Co()}}function El(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=$d),e}function Il(e,t,n){var i,r=t.pendingProps,o=!1,s=!!(128&t.flags);if((i=s)||(i=(null===e||null!==e.memoizedState)&&!!(2&fa.current)),i&&(o=!0,t.flags&=-129),i=!!(32&t.flags),t.flags&=-33,null===e){if(Fr){if(o?ca(t):ha(),(e=Mr)?null!==(e=null!==(e=Cp(e,zr))&&"&"!==e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==Ir?{id:Tr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},(n=vr(e)).return=t,t.child=n,Pr=t,Mr=null):e=null,null===e)throw $r(t);return Ip(e)?t.lanes=32:t.lanes=536870912,null}return s=r.children,r=r.fallback,o?(ha(),s=Rl({mode:"hidden",children:s},o=t.mode),r=gr(r,o,n,null),s.return=t,r.return=t,s.sibling=r,t.child=s,(r=t.child).memoizedState=Cl(n),r.childLanes=El(e,i,n),t.memoizedState=xl,gl(null,r)):(ca(t),Tl(t,s))}var l=e.memoizedState;if(null!==l){var c=l.dehydrated;if(null!==c)return function(e,t,n,i,r,o,s,l){if(n)return 256&t.flags?(ca(t),t.flags&=-257,Nl(e,t,l)):null!==t.memoizedState?(ha(),t.child=e.child,t.flags|=128,null):(ha(),o=r.fallback,s=t.mode,r=Rl({mode:"visible",children:r.children},s),(o=gr(o,s,l,null)).flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,Bo(t,e.child,null,l),(r=t.child).memoizedState=Cl(l),r.childLanes=El(e,i,l),t.memoizedState=xl,gl(null,r));if(ca(t),Ip(o)){if(i=o.nextSibling&&o.nextSibling.dataset)var c=i.dgst;return""!==(i=c)&&((r=Error(a(419))).stack="",r.digest=i,Gr({value:r,source:null,stack:null})),Nl(e,t,l)}if(cl||to(e,t,l,!1),i=0!==(l&e.childLanes),cl||i){if(null!==na.current)return Nl(e,t,l);if(null!==(i=Td)&&0!==(r=Xe(i,l))&&r!==s.retryLane)throw s.retryLane=r,or(e,r),hu(i,0,r),ll;return Ep(o)||xu(),Nl(e,t,l)}return Ep(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Mr=Tp(o.nextSibling),Pr=t,Fr=!0,jr=null,zr=!1,null!==e&&Dr(t,e),(t=Tl(t,r.children)).flags|=134221824,t)}(e,t,s,i,r,c,l,n)}return o?(ha(),o=r.fallback,s=t.mode,c=(l=e.child).sibling,(r=hr(l,{mode:"hidden",children:r.children})).subtreeFlags=1206910976&l.subtreeFlags,null!==c?o=hr(c,o):(o=gr(o,s,n,null)).flags|=2,o.return=t,r.return=t,r.sibling=o,t.child=r,gl(null,r),r=t.child,null===(o=e.child.memoizedState)?o=Cl(n):(null!==(s=o.cachePool)?(l=uo._currentValue,s=s.parent!==l?{parent:l,pool:l}:s):s=Co(),o={baseLanes:o.baseLanes|n,cachePool:s}),r.memoizedState=o,r.childLanes=El(e,i,n),t.memoizedState=xl,gl(e.child,r)):(ca(t),e=(n=e.child).sibling,(n=hr(n,{mode:"visible",children:r.children})).return=t,n.sibling=null,null!==e&&(null===(i=t.deletions)?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function Tl(e,t){return(t=Rl({mode:"visible",children:t},e.mode)).return=e,e.child=t}function Rl(e,t){return(e=dr(22,e,null,t)).lanes=0,e}function Nl(e,t,n){return Bo(t,e.child,null,n),(e=Tl(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Ol(e,t,n){e.lanes|=t;var i=e.alternate;null!==i&&(i.lanes|=t),Zr(e.return,t,n)}function Al(e){for(var t=null;null!==e;){var n=e.alternate;null!==n&&null===va(n)&&(t=e),e=e.sibling}return t}function Ll(e,t,n,i,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r,a.treeForkCount=o)}function Dl(e){var t=e.child;for(e.child=null;null!==t;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function Pl(e,t,n){var i=t.pendingProps,r=i.revealOrder,o=i.tail;i=i.children;var a=fa.current;if(128&t.flags)return ga(0,a),null;var s=!!(2&a);if(s?(a=1&a|2,t.flags|=128):a&=1,ga(0,a),"backwards"===r&&null!==e?(Dl(e),dl(e,t,i,n),Dl(e)):dl(e,t,i,n),i=Fr?xr:0,!s&&null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Ol(e,n,t);else if(19===e.tag)Ol(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"backwards":null===(n=Al(t.child))?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null,Dl(t)),Ll(t,!0,r,null,o,i);break;case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===va(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Ll(t,!0,n,null,o,i);break;case"together":Ll(t,!1,null,null,void 0,i);break;case"independent":t.memoizedState=null;break;default:null===(n=Al(t.child))?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Ll(t,!1,r,n,o,i)}return t.child}function Ml(e,t,n){var i=t.pendingProps;return Jr(0,t.type,i.value),dl(e,t,i.children,n),t.child}function Fl(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),jd|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(to(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=hr(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=hr(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function jl(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!no(e))}function zl(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)cl=!0;else{if(!(jl(e,n)||128&t.flags))return cl=!1,function(e,t,n){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Jr(0,uo,e.memoizedState.cache),Vr();break;case 27:case 5:he(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Jr(0,t.type,t.memoizedProps.value);break;case 31:if(null!==t.memoizedState)return t.flags|=128,da(t),null;break;case 13:var i=t.memoizedState;if(null!==i){if(null!==i.dehydrated)return ca(t),t.flags|=128,null;i=to(e,t,n,!1);var r=t.child.childLanes;return i||0!==(n&r)?Il(e,t,n):(ca(t),null!==(e=Fl(e,t,n))?e.sibling:null)}ca(t);break;case 19:if(128&t.flags)return Pl(e,t,n);if(r=!!(128&e.flags),(i=0!==(n&t.childLanes))||(to(e,t,n,!1),i=0!==(n&t.childLanes)),r){if(i)return Pl(e,t,n);t.flags|=128}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),ga(0,fa.current),i)break;return null;case 22:return t.lanes=0,fl(e,t,n,t.pendingProps);case 24:Jr(0,uo,e.memoizedState.cache)}return Fl(e,t,n)}(e,t,n);cl=!!(131072&e.flags)}else cl=!1,Fr&&1048576&t.flags&&Or(t,xr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ao(t.elementType),t.type=e,"function"!=typeof e){if(null!=e){var r=e.$$typeof;if(r===P){t.tag=11,t=ul(null,t,e,i,n);break e}if(r===j){t.tag=14,t=hl(null,t,e,i,n);break e}if(r===D){t.tag=10,t.type=e,t=Ml(null,t,n);break e}}throw t=K(e)||e,Error(a(306,t,""))}ur(e)?(i=Zs(e,i),t.tag=1,t=_l(null,t,e,i,n)):(t.tag=0,t=wl(null,t,e,i,n))}return t;case 0:return wl(e,t,t.type,t.pendingProps,n);case 1:return _l(e,t,i=t.type,r=Zs(i,t.pendingProps),n);case 3:e:{if(de(t,t.stateNode.containerInfo),null===e)throw Error(a(387));i=t.pendingProps;var o=t.memoizedState;r=o.element,qo(e,t),Zo(t,i,null,n);var s=t.memoizedState;if(i=s.cache,Jr(0,uo,i),i!==o.cache&&eo(t,[uo],n,!0),Xo(),i=s.element,o.isDehydrated){if(o={element:i,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,256&t.flags){t=Sl(e,t,i,n);break e}if(i!==r){Gr(r=wr(Error(a(424)),t)),t=Sl(e,t,i,n);break e}for(e=9===(e=t.stateNode.containerInfo).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,Mr=Tp(e.firstChild),Pr=t,Fr=!0,jr=null,zr=!0,n=Ho(t,null,i,n),t.child=n;n;)n.flags=-3&n.flags|134221824,n=n.sibling}else{if(Vr(),i===r){t=Fl(e,t,n);break e}dl(e,t,i,n)}t=t.child}return t;case 26:return yl(e,t),null===e?(n=$p(t.type,null,t.pendingProps,null))?t.memoizedState=n:Fr||(t.stateNode=zh(t.type,t.pendingProps,le.current,t)):t.memoizedState=$p(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return he(t),null===e&&Fr&&(i=t.stateNode=Ap(t.type,t.pendingProps,le.current),Pr=t,zr=!0,r=Mr,Kh(t.type)?(Rp=r,Mr=Tp(i.firstChild)):Mr=r),dl(e,t,t.pendingProps.children,n),yl(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&Fr&&((r=i=Mr)&&(null!==(i=function(e,t,n,i){for(;1===e.nodeType;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(i){if(!e[ut])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(o=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(null==r.href||""===r.href?null:r.href)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin)||e.getAttribute("title")!==(null==r.title?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((o=e.getAttribute("src"))!==(null==r.src?null:r.src)||e.getAttribute("type")!==(null==r.type?null:r.type)||e.getAttribute("crossorigin")!==(null==r.crossOrigin?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var o=null==r.name?null:""+r.name;if("hidden"===r.type&&e.getAttribute("name")===o)return e}if(null===(e=Tp(e.nextSibling)))break}return null}(i,t.type,t.pendingProps,zr))?(t.stateNode=i,Pr=t,Mr=Tp(i.firstChild),zr=!1,r=!0):r=!1),r||$r(t)),he(t),r=t.type,o=t.pendingProps,s=null!==e?e.memoizedProps:null,i=o.children,Uh(r,o)?i=null:null!==s&&Uh(r,s)&&(t.flags|=32),null!==t.memoizedState&&(r=Oa(e,t,Da,null,null,n),hf._currentValue=r),yl(e,t),dl(e,t,i,n),t.child;case 6:return null===e&&Fr&&((e=n=Mr)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=Tp(e.nextSibling)))return null}return e}(n,t.pendingProps,zr))?(t.stateNode=n,Pr=t,Mr=null,e=!0):e=!1),e||$r(t)),null;case 13:return Il(e,t,n);case 4:return de(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=Bo(t,null,i,n):dl(e,t,i,n),t.child;case 11:return ul(e,t,t.type,t.pendingProps,n);case 7:return i=t.pendingProps,yl(e,t),dl(e,t,i,n),t.child;case 8:case 12:return dl(e,t,t.pendingProps.children,n),t.child;case 10:return Ml(e,t,n);case 9:return r=t.type._context,i=t.pendingProps.children,io(t),i=i(r=ro(r)),t.flags|=1,dl(e,t,i,n),t.child;case 14:return hl(e,t,t.type,t.pendingProps,n);case 15:return pl(e,t,t.type,t.pendingProps,n);case 19:return Pl(e,t,n);case 31:return function(e,t,n){var i=t.pendingProps,r=!!(128&t.flags);if(t.flags&=-129,null===e){if(Fr){if("hidden"===i.mode)return e=vl(t,i),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},gl(null,e);if(da(t),(e=Mr)?null!==(e=null!==(e=Cp(e,zr))&&"&"===e.data?e:null)&&(t.memoizedState={dehydrated:e,treeContext:null!==Ir?{id:Tr,overflow:Rr}:null,retryLane:536870912,hydrationErrors:null},(n=vr(e)).return=t,t.child=n,Pr=t,Mr=null):e=null,null===e)throw $r(t);return t.lanes=536870912,null}return vl(t,i)}var o=e.memoizedState;if(null!==o){var s=o.dehydrated;if(da(t),r)if(256&t.flags)t.flags&=-257,t=bl(e,t,n);else{if(null===t.memoizedState)throw Error(a(558));t.child=e.child,t.flags|=128,t=null}else if(cl||to(e,t,n,!1),r=0!==(n&e.childLanes),cl||r){if(null===na.current){if(null!==(i=Td)&&0!==(s=Xe(i,n))&&s!==o.retryLane)throw o.retryLane=s,or(e,s),hu(i,0,s),ll;xu()}t=bl(e,t,n)}else e=o.treeContext,Mr=Tp(s.nextSibling),Pr=t,Fr=!0,jr=null,zr=!1,null!==e&&Dr(t,e),(t=vl(t,i)).flags|=134221824;return t}return(e=hr(e.child,{mode:i.mode,children:i.children})).ref=t.ref,t.child=e,e.return=t,e}(e,t,n);case 22:return fl(e,t,n,t.pendingProps);case 24:return io(t),i=ro(uo),null===e?(null===(r=So())&&(r=Td,o=ho(),r.pooledCache=o,o.refCount++,null!==o&&(r.pooledCacheLanes|=n),r=o),t.memoizedState={parent:i,cache:r},Vo(t),Jr(0,uo,r)):(0!==(e.lanes&n)&&(qo(e,t),Zo(t,null,null,n),Xo()),r=e.memoizedState,o=t.memoizedState,r.parent!==i?(r={parent:i,cache:i},t.memoizedState=r,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=r),Jr(0,uo,i)):(i=o.cache,Jr(0,uo,i),i!==r.cache&&eo(t,[uo],n,!0))),dl(e,t,t.pendingProps.children,n),t.child;case 30:return null===t.stateNode&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),null!=(i=t.pendingProps).name&&"auto"!==i.name?t.flags|=null===e?18882560:18874368:Fr&&Ar(t),null!==e&&e.memoizedProps.name!==i.name?t.flags|=4194816:yl(e,t),dl(e,t,i.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Ul(e){e.flags|=4}function $l(e,t,n,i,r){var o;if((o=!!(32&e.mode))&&(o=null===n?ef(t,i):ef(t,i)&&(i.src!==n.src||i.srcSet!==n.srcSet)),o){if(e.flags|=16777216,(335544128&r)===r)if(e.stateNode.complete)e.flags|=8192;else{if(!ku())throw Lo=Ro,Io;e.flags|=8192}}else e.flags&=-16777217}function Bl(e,t){if("stylesheet"!==t.type||4&t.state.loading)e.flags&=-16777217;else if(e.flags|=16777216,!tf(t)){if(!ku())throw Lo=Ro,Io;e.flags|=8192}}function Hl(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Ge():536870912,e.lanes|=t,Bd|=t)}function Wl(e,t){if(!Fr)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null;break;default:for(t=e.tail,n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null}}function Vl(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=1206910976&r.subtreeFlags,i|=1206910976&r.flags,r.return=e,r=r.sibling;else for(r=e.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function ql(e,t,n){var i=t.pendingProps;switch(Lr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return Vl(t),null;case 3:return n=t.stateNode,i=null,null!==e&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Xr(uo),ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(Wr(t)?Ul(t):null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,qr())),Vl(t),null;case 26:var r=t.type,o=t.memoizedState;return null===e?(Ul(t),null!==o?(Vl(t),Bl(t,o)):(Vl(t),$l(t,r,null,i,n))):o?o!==e.memoizedState?(Ul(t),Vl(t),Bl(t,o)):(Vl(t),t.flags&=-16777217):((e=e.memoizedProps)!==i&&Ul(t),Vl(t),$l(t,r,e,i,n)),null;case 27:if(pe(t),n=le.current,r=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&Ul(t);else{if(!i){if(null===t.stateNode)throw Error(a(166));return Vl(t),t.subtreeFlags&=-33554433,null}e=ae.current,Wr(t)?Br(t):(e=Ap(r,i,n),t.stateNode=e,Ul(t))}return Vl(t),t.subtreeFlags&=-33554433,null;case 5:if(pe(t),r=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==i&&Ul(t);else{if(!i){if(null===t.stateNode)throw Error(a(166));return Vl(t),t.subtreeFlags&=-33554433,null}if(o=ae.current,Wr(t))Br(t);else{var s=Mh(le.current);switch(o){case 1:o=s.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:o=s.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":o=s.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":o=s.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":(o=s.createElement("div")).innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o="string"==typeof i.is?s.createElement("select",{is:i.is}):s.createElement("select"),i.multiple?o.multiple=!0:i.size&&(o.size=i.size);break;default:o="string"==typeof i.is?s.createElement(r,{is:i.is}):s.createElement(r)}}o[rt]=t,o[ot]=i;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)o.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;e:switch(Oh(o,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ul(t)}}return Vl(t),t.subtreeFlags&=-33554433,$l(t,t.type,null===e?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==i&&Ul(t);else{if("string"!=typeof i&&null===t.stateNode)throw Error(a(166));if(e=le.current,Wr(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,null!==(r=Pr))switch(r.tag){case 27:case 5:i=r.memoizedProps}e[rt]=t,(e=!!(e.nodeValue===n||null!==i&&!0===i.suppressHydrationWarning||Th(e.nodeValue,n)))||$r(t,!0)}else(e=Mh(e).createTextNode(i))[rt]=t,t.stateNode=e}return Vl(t),null;case 31:if(n=t.memoizedState,null===e||null!==e.memoizedState){if(i=Wr(t),null!==n){if(null===e){if(!i)throw Error(a(318));if(!(e=null!==(e=t.memoizedState)?e.dehydrated:null))throw Error(a(557));e[rt]=t}else Vr(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Vl(t),e=!1}else n=qr(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return 256&t.flags?(pa(t),t):(pa(t),null);if(128&t.flags)throw Error(a(558))}return Vl(t),null;case 13:if(i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(r=Wr(t),null!==i&&null!==i.dehydrated){if(null===e){if(!r)throw Error(a(318));if(!(r=null!==(r=t.memoizedState)?r.dehydrated:null))throw Error(a(317));r[rt]=t}else Vr(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Vl(t),r=!1}else r=qr(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return 256&t.flags?(pa(t),t):(pa(t),null)}return pa(t),128&t.flags?(t.lanes=n,t):(n=null!==i,e=null!==e&&null!==e.memoizedState,n&&(r=null,null!==(i=t.child).alternate&&null!==i.alternate.memoizedState&&null!==i.alternate.memoizedState.cachePool&&(r=i.alternate.memoizedState.cachePool.pool),o=null,null!==i.memoizedState&&null!==i.memoizedState.cachePool&&(o=i.memoizedState.cachePool.pool),o!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Hl(t,t.updateQueue),Vl(t),null);case 4:return ue(),null===e&&bh(t.stateNode.containerInfo),t.flags|=67108864,Vl(t),null;case 10:return Xr(t.type),Vl(t),null;case 19:if(ma(t),null===(i=t.memoizedState))return Vl(t),null;if(r=!!(128&t.flags),null===(o=i.rendering))if(r)Wl(i,!1);else{if(0!==Fd||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(o=va(e))){for(t.flags|=128,Wl(i,!1),e=o.updateQueue,t.updateQueue=e,Hl(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)pr(n,e),n=n.sibling;return ga(0,1&fa.current|2),Fr&&Nr(t,i.treeForkCount),t.child}e=e.sibling}null!==i.tail&&xe()>Kd&&(t.flags|=128,r=!0,Wl(i,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=va(o))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Hl(t,e),Wl(i,!0),null===i.tail&&"collapsed"!==i.tailMode&&"visible"!==i.tailMode&&!o.alternate&&!Fr)return Vl(t),null}else 2*xe()-i.renderingStartTime>Kd&&536870912!==n&&(t.flags|=128,r=!0,Wl(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=i.last)?e.sibling=o:t.child=o,i.last=o)}if(null!==i.tail){e:{for(n=e=i.tail;null!==n;){if(null!==n.alternate){n=!1;break e}n=n.sibling}n=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=xe(),e.sibling=null,o=fa.current,o=r?1&o|2:1&o,"visible"===i.tailMode||"collapsed"===i.tailMode||!n||Fr?ga(0,o):(n=o,ie(sa,t),ie(fa,n),null===la&&(la=t)),Fr&&Nr(t,i.treeForkCount),e}return Vl(t),null;case 22:case 23:return pa(t),aa(),i=null!==t.memoizedState,null!==e?null!==e.memoizedState!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?!!(536870912&n)&&!(128&t.flags)&&(Vl(t),6&t.subtreeFlags&&(t.flags|=8192)):Vl(t),null!==(n=t.updateQueue)&&Hl(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),i=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),null!==e&&ne(_o),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xr(uo),Vl(t),null;case 25:return null;case 30:return t.flags|=33554432,Vl(t),null}throw Error(a(156,t.tag))}function Gl(e,t){switch(Lr(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Xr(uo),ue(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(null!==t.memoizedState){if(pa(t),null===t.alternate)throw Error(a(340));Vr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 13:if(pa(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(a(340));Vr()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ma(t),65536&(e=t.flags)?(t.flags=-65537&e|128,null!==(e=t.memoizedState)&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ue(),null;case 10:return Xr(t.type),null;case 22:case 23:return pa(t),aa(),null!==e&&ne(_o),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return Xr(uo),null;default:return null}}function Kl(e,t){switch(Lr(t),t.tag){case 3:Xr(uo),ue();break;case 26:case 27:case 5:pe(t);break;case 4:ue();break;case 31:null!==t.memoizedState&&pa(t);break;case 13:pa(t);break;case 19:ma(t);break;case 10:Xr(t.type);break;case 22:case 23:pa(t),aa(),null!==e&&ne(_o);break;case 24:Xr(uo)}}function Yl(e,t){try{var n=t.updateQueue,i=null!==n?n.lastEffect:null;if(null!==i){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var o=n.create,a=n.inst;i=o(),a.destroy=i}n=n.next}while(n!==r)}}catch(e){Hu(t,t.return,e)}}function Ql(e,t,n){try{var i=t.updateQueue,r=null!==i?i.lastEffect:null;if(null!==r){var o=r.next;i=o;do{if((i.tag&e)===e){var a=i.inst,s=a.destroy;if(void 0!==s){a.destroy=void 0,r=t;var l=n,c=s;try{c()}catch(e){Hu(r,l,e)}}}i=i.next}while(i!==o)}}catch(e){Hu(t,t.return,e)}}function Jl(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{ta(t,n)}catch(t){Hu(e,e.return,t)}}}function Xl(e,t,n){n.props=Zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Hu(e,t,n)}}function Zl(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var r=e.stateNode,o=Yi(e.memoizedProps,r);null!==r.ref&&r.ref.name===o||(r.ref=rp(o)),i=r.ref;break;case 7:if(null===e.stateNode){var a=new op(e);f(e.child,!1,wp,a,void 0,void 0),e.stateNode=a}i=e.stateNode;break;default:i=e.stateNode}"function"==typeof n?e.refCleanup=n(i):n.current=i}}catch(n){Hu(e,t,n)}}function ec(e,t){var n=e.ref,i=e.refCleanup;if(null!==n)if("function"==typeof i)try{i()}catch(n){Hu(e,t,n)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"==typeof n)try{n(null)}catch(n){Hu(e,t,n)}else n.current=null}function tc(e,t){if((5===e.tag||27===e.tag||6===e.tag)&&null===e.alternate&&null!==t)for(var n=0;n<t.length;n++)_p(e.stateNode,t[n])}function nc(e){for(var t=e.return;null!==t&&(oc(t)&&_p(e.stateNode,t.stateNode),!rc(t));)t=t.return}function ic(e){for(var t=e.return;null!==t&&(oc(t)&&Sp(e.stateNode,t.stateNode),!rc(t));)t=t.return}function rc(e){return 5===e.tag||3===e.tag||27===e.tag}function oc(e){return e&&7===e.tag&&null!==e.stateNode}function ac(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(t){Hu(e,e.return,t)}}function sc(e,t,n){try{var i=e.stateNode;!function(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 r=null,o=null,s=null,l=null,c=null,d=null,u=null;for(f in n){var h=n[f];if(n.hasOwnProperty(f)&&null!=h)switch(f){case"checked":case"value":break;case"defaultValue":c=h;default:i.hasOwnProperty(f)||Rh(e,t,f,null,i,h)}}for(var p in i){var f=i[p];if(h=n[p],i.hasOwnProperty(p)&&(null!=f||null!=h))switch(p){case"type":f!==h&&(It=!0),o=f;break;case"name":f!==h&&(It=!0),r=f;break;case"checked":f!==h&&(It=!0),d=f;break;case"defaultChecked":f!==h&&(It=!0),u=f;break;case"value":f!==h&&(It=!0),s=f;break;case"defaultValue":f!==h&&(It=!0),l=f;break;case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(a(137,t));break;default:f!==h&&Rh(e,t,p,f,i,h)}}return void jt(e,s,l,c,d,u,o,r);case"select":for(o in f=s=l=p=null,n)if(c=n[o],n.hasOwnProperty(o)&&null!=c)switch(o){case"value":break;case"multiple":f=c;default:i.hasOwnProperty(o)||Rh(e,t,o,null,i,c)}for(r in i)if(o=i[r],c=n[r],i.hasOwnProperty(r)&&(null!=o||null!=c))switch(r){case"value":o!==c&&(It=!0),p=o;break;case"defaultValue":o!==c&&(It=!0),l=o;break;case"multiple":o!==c&&(It=!0),s=o;default:o!==c&&Rh(e,t,r,o,i,c)}return t=l,n=s,i=f,void(null!=p?$t(e,!!n,p,!1):!!i!=!!n&&(null!=t?$t(e,!!n,t,!0):$t(e,!!n,n?[]:"",!1)));case"textarea":for(l in f=p=null,n)if(r=n[l],n.hasOwnProperty(l)&&null!=r&&!i.hasOwnProperty(l))switch(l){case"value":case"children":break;default:Rh(e,t,l,null,i,r)}for(s in i)if(r=i[s],o=n[s],i.hasOwnProperty(s)&&(null!=r||null!=o))switch(s){case"value":r!==o&&(It=!0),p=r;break;case"defaultValue":r!==o&&(It=!0),f=r;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=r)throw Error(a(91));break;default:r!==o&&Rh(e,t,s,r,i,o)}return void Bt(e,p,f);case"option":for(var g in n)p=n[g],n.hasOwnProperty(g)&&null!=p&&!i.hasOwnProperty(g)&&("selected"===g?e.selected=!1:Rh(e,t,g,null,i,p));for(c in i)p=i[c],f=n[c],!i.hasOwnProperty(c)||p===f||null==p&&null==f||("selected"===c?(p!==f&&(It=!0),e.selected=p&&"function"!=typeof p&&"symbol"!=typeof p):Rh(e,t,c,p,i,f));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 m in n)p=n[m],n.hasOwnProperty(m)&&null!=p&&!i.hasOwnProperty(m)&&Rh(e,t,m,null,i,p);for(d in i)if(p=i[d],f=n[d],i.hasOwnProperty(d)&&p!==f&&(null!=p||null!=f))switch(d){case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(a(137,t));break;default:Rh(e,t,d,p,i,f)}return;default:if(Kt(t)){for(var v in n)p=n[v],n.hasOwnProperty(v)&&void 0!==p&&!i.hasOwnProperty(v)&&Nh(e,t,v,void 0,i,p);for(u in i)p=i[u],f=n[u],!i.hasOwnProperty(u)||p===f||void 0===p&&void 0===f||Nh(e,t,u,p,i,f);return}}for(var b in n)p=n[b],n.hasOwnProperty(b)&&null!=p&&!i.hasOwnProperty(b)&&Rh(e,t,b,null,i,p);for(h in i)p=i[h],f=n[h],!i.hasOwnProperty(h)||p===f||null==p&&null==f||Rh(e,t,h,p,i,f)}(i,e.type,n,t),i[ot]=t}catch(t){Hu(e,e.return,t)}}function lc(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&Kh(e.type)||4===e.tag}function cc(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||lc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&Kh(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function dc(e,t,n,i){var r=e.tag;if(5===r||6===r)r=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(r,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(r),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Xt)),tc(e,i),It=!0;else if(4!==r&&(27===r&&(tc(e,i),i=null,Kh(e.type)&&(n=e.stateNode,t=null)),null!==(e=e.child)))for(dc(e,t,n,i),e=e.sibling;null!==e;)dc(e,t,n,i),e=e.sibling}function uc(e,t,n,i){var r=e.tag;if(5===r||6===r)r=e.stateNode,t?n.insertBefore(r,t):n.appendChild(r),tc(e,i),It=!0;else if(4!==r&&(27===r&&(tc(e,i),i=null,Kh(e.type)&&(n=e.stateNode)),null!==(e=e.child)))for(uc(e,t,n,i),e=e.sibling;null!==e;)uc(e,t,n,i),e=e.sibling}function hc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Oh(t,i,n),t[rt]=e,t[ot]=n}catch(t){Hu(e,e.return,t)}}var pc=!1,fc=null;function gc(e){(30===e.tag||33554432&e.subtreeFlags)&&(pc=!0)}var mc=null;function vc(){var e=mc;return mc=null,e}var bc=0;function yc(e,t,n,i,r){return bc=0,wc(e.child,t,n,i,r)}function wc(e,t,n,i,r){for(var o=!1;null!==e;){if(5===e.tag){var a=e.stateNode;if(null!==i){var s=ep(a);i.push(s),s.view&&(o=!0)}else o||ep(a).view&&(o=!0);pc=!0,Jh(a,0===bc?t:t+"_"+bc,n),bc++}else 22===e.tag&&null!==e.memoizedState||30===e.tag&&r||wc(e.child,t,n,i,r)&&(o=!0);e=e.sibling}return o}function kc(e,t){for(;null!==e;)5===e.tag?Xh(e.stateNode,e.memoizedProps):22===e.tag&&null!==e.memoizedState||30===e.tag&&t||kc(e.child,t),e=e.sibling}function _c(e){if(18874368&e.subtreeFlags)for(e=e.child;null!==e;){if((22!==e.tag||null===e.memoizedState)&&(_c(e),30===e.tag&&18874368&e.flags&&e.stateNode.paired)){var t=e.memoizedProps;if(null==t.name||"auto"===t.name)throw Error(a(544));var n=t.name;"none"!==(t=Ji(t.default,t.share))&&(yc(e,n,t,null,!1)||kc(e.child,!1))}e=e.sibling}}function Sc(e,t){if(30===e.tag){var n=e.stateNode,i=e.memoizedProps,r=Yi(i,n),o=Ji(i.default,n.paired?i.share:i.enter);"none"!==o?yc(e,r,o,null,!1)?(_c(e),n.paired||t||uu(e,i.onEnter)):kc(e.child,!1):_c(e)}else if(33554432&e.subtreeFlags)for(e=e.child;null!==e;)Sc(e,t),e=e.sibling;else _c(e)}function xc(e){if(null!==fc&&0!==fc.size){var t=fc;if(18874368&e.subtreeFlags)for(e=e.child;null!==e;){if(22!==e.tag||null===e.memoizedState){if(30===e.tag&&18874368&e.flags){var n=e.memoizedProps,i=n.name;if(null!=i&&"auto"!==i){var r=t.get(i);if(void 0!==r){var o=Ji(n.default,n.share);if("none"!==o&&(yc(e,i,o,null,!1)?(o=e.stateNode,r.paired=o,o.paired=r,uu(e,n.onShare)):kc(e.child,!1)),t.delete(i),0===t.size)break}}}xc(e)}e=e.sibling}}}function Cc(e){if(30===e.tag){var t=e.memoizedProps,n=Yi(t,e.stateNode),i=null!==fc?fc.get(n):void 0,r=Ji(t.default,void 0!==i?t.share:t.exit);"none"!==r&&(yc(e,n,r,null,!1)?void 0!==i?(r=e.stateNode,i.paired=r,r.paired=i,fc.delete(n),uu(e,t.onShare)):uu(e,t.onExit):kc(e.child,!1)),null!==fc&&xc(e)}else if(33554432&e.subtreeFlags)for(e=e.child;null!==e;)Cc(e),e=e.sibling;else null!==fc&&xc(e)}function Ec(e){for(e=e.child;null!==e;){if(30===e.tag){var t=e.memoizedProps,n=Yi(t,e.stateNode);t=Ji(t.default,t.update),e.flags&=-5,"none"!==t&&yc(e,n,t,e.memoizedState=[],!1)}else 33554432&e.subtreeFlags&&Ec(e);e=e.sibling}}function Ic(e){if(18874368&e.subtreeFlags)for(e=e.child;null!==e;){if(22!==e.tag||null===e.memoizedState){if(30===e.tag&&18874368&e.flags){var t=e.stateNode;null!==t.paired&&(t.paired=null,kc(e.child,!1))}Ic(e)}e=e.sibling}}function Tc(e){if(30===e.tag)e.stateNode.paired=null,kc(e.child,!1),Ic(e);else if(33554432&e.subtreeFlags)for(e=e.child;null!==e;)Tc(e),e=e.sibling;else Ic(e)}function Rc(e){for(e=e.child;null!==e;)30===e.tag?kc(e.child,!1):!!(33554432&e.subtreeFlags)&&Rc(e),e=e.sibling}function Nc(e,t,n,i,r,o,a){for(var s=!1;null!==t;){if(5===t.tag){var l=t.stateNode;if(null!==o&&bc<o.length){var c,d=o[bc],u=ep(l);if((d.view||u.view)&&(s=!0),c=!(4&e.flags))if(u.clip)c=!0;else{c=d.rect;var h=u.rect;c=c.y!==h.y||c.x!==h.x||c.height!==h.height||c.width!==h.width}c&&(e.flags|=4),u.abs?u=!d.abs:(d=d.rect,u=u.rect,u=d.height!==u.height||d.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;4&e.flags&&Jh(l,0===bc?n:n+"_"+bc,r),s&&4&e.flags||(null===mc&&(mc=[]),mc.push(l,0===bc?i:i+"_"+bc,t.memoizedProps)),bc++}else 22===t.tag&&null!==t.memoizedState||(30===t.tag&&a?e.flags|=32&t.flags:Nc(e,t.child,n,i,r,o,a)&&(s=!0));t=t.sibling}return s}function Oc(e,t){for(e=e.child;null!==e;){if(30===e.tag){var n=e.memoizedProps,i=e.stateNode,r=Yi(n,i),o=Ji(n.default,n.update);if(t)var a=null===(i=i.clones)?null:i.map(tp);else a=e.memoizedState,e.memoizedState=null;i=e;var s=e.child;bc=0,r=Nc(i,s,r,r,o,a,!1),4&e.flags&&r&&(t||uu(e,n.onUpdate))}else 33554432&e.subtreeFlags&&Oc(e,t);e=e.sibling}}var Ac=!1,Lc=!1,Dc=!1,Pc=!1,Mc="function"==typeof WeakSet?WeakSet:Set,Fc=null,jc=!1,zc=!1,Uc=!1,$c=!1;function Bc(e){for(;null!==Fc;){var t=Fc,n=e,i=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(1024&r&&null!==i){n=void 0,r=i.memoizedProps,i=i.memoizedState;var o=t.stateNode;try{var s=Zs(t.type,r);n=o.getSnapshotBeforeUpdate(s,i),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Hu(t,t.return,e)}}break;case 3:if(1024&r)if(9===(n=(i=t.stateNode.containerInfo).nodeType))xp(i);else if(1===n)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":xp(i);break;default:i.textContent=""}break;case 30:n&&null!==i&&(n=Yi(i.memoizedProps,i.stateNode),"none"!==(r=Ji((r=t.memoizedProps).default,r.update))&&yc(i,n,r,i.memoizedState=[],!0));break;default:if(1024&r)throw Error(a(163))}if(null!==(i=t.sibling)){i.return=t.return,Fc=i;break}Fc=t.return}}function Hc(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:ld(e,n),4&i&&Yl(5,n);break;case 1:if(ld(e,n),4&i)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(e){Hu(n,n.return,e)}else{var r=Zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Hu(n,n.return,e)}}64&i&&Jl(n),512&i&&Zl(n,n.return);break;case 3:if(ld(e,n),64&i&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{ta(e,t)}catch(e){Hu(n,n.return,e)}}break;case 27:null===t&&4&i&&hc(n);case 26:case 5:ld(e,n),null===t&&4&i&&ac(n),512&i&&Zl(n,n.return);break;case 12:ld(e,n);break;case 31:ld(e,n),4&i&&Xc(e,n);break;case 13:ld(e,n),4&i&&Zc(e,n),64&i&&null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$~"===e.data)e._reactRetry=t;else if("$?"!==e.data||"loading"!==n.readyState)t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}(e,n=Gu.bind(null,n));break;case 22:if(!(i=null!==n.memoizedState||Ac)){var o=null!==t&&null!==t.memoizedState||Lc;t=Ac,r=Lc,Ac=i,(Lc=o)&&!r?(i=2,!!(8772&n.subtreeFlags)&&(i|=1),dd(e,n,i)):ld(e,n),Ac=t,Lc=r}break;case 30:ld(e,n),512&i&&Zl(n,n.return);break;case 7:512&i&&Zl(n,n.return);default:ld(e,n)}}function Wc(e,t){for(e=e.child;null!==e;)Vc(e,t),e=e.sibling}function Vc(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var i=n.style;"function"==typeof i.setProperty?i.setProperty("display","none","important"):i.display="none"}else{var r=e.stateNode,o=e.memoizedProps.style,a=null!=o&&o.hasOwnProperty("display")?o.display:null;r.style.display=null==a||"boolean"==typeof a?"":(""+a).trim()}}catch(t){Hu(e,e.return,t)}qc(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,It=!0}catch(t){Hu(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Qh(s,!0):Qh(e.stateNode,!1)}catch(t){Hu(e,e.return,t)}break;case 22:case 23:null===e.memoizedState&&Wc(e,t);break;default:Wc(e,t)}}function qc(e,t){if(67108864&e.subtreeFlags)for(e=e.child;null!==e;){e:{var n=e,i=t;switch(n.tag){case 4:Vc(n,i);break e;case 22:null===n.memoizedState&&qc(n,i);break e;default:qc(n,i)}}e=e.sibling}}function Gc(e){var t=e.alternate;null!==t&&(e.alternate=null,Gc(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&pt(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 Kc=null,Yc=!1;function Qc(e,t,n){for(n=n.child;null!==n;)Jc(e,t,n),n=n.sibling}function Jc(e,t,n){if(De&&"function"==typeof De.onCommitFiberUnmount)try{De.onCommitFiberUnmount(Le,n)}catch(e){}switch(n.tag){case 26:Lc||ec(n,t),Qc(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Lc&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:Lc||ec(n,t),ic(n);var i=Kc,r=Yc;Kh(n.type)&&(Kc=n.stateNode,Yc=!1),Qc(e,t,n),Lp(n.stateNode,n.type,n.memoizedProps),Kc=i,Yc=r;break;case 5:Lc||ec(n,t),ic(n);case 6:if(6===n.tag&&ic(n),i=Kc,r=Yc,Kc=null,Qc(e,t,n),Yc=r,null!==(Kc=i))if(Yc)try{(9===Kc.nodeType?Kc.body:"HTML"===Kc.nodeName?Kc.ownerDocument.body:Kc).removeChild(n.stateNode),It=!0}catch(e){Hu(n,t,e)}else try{Kc.removeChild(n.stateNode),It=!0}catch(e){Hu(n,t,e)}break;case 18:null!==Kc&&(Yc?(Yh(9===(e=Kc).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),Wf(e)):Yh(Kc,n.stateNode));break;case 4:i=Kc,r=Yc,Kc=n.stateNode.containerInfo,Yc=!0,Qc(e,t,n),Kc=i,Yc=r;break;case 0:case 11:case 14:case 15:Ql(2,n,t),Lc||Ql(4,n,t),Qc(e,t,n);break;case 1:Lc||(ec(n,t),"function"==typeof(i=n.stateNode).componentWillUnmount&&Xl(n,t,i)),Qc(e,t,n);break;case 21:Qc(e,t,n);break;case 22:Lc=(i=Lc)||null!==n.memoizedState,Qc(e,t,n),Lc=i;break;case 30:ec(n,t),Qc(e,t,n);break;case 7:Lc||ec(n,t),Qc(e,t,n);break;default:Qc(e,t,n)}}function Xc(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)){e=e.dehydrated;try{Wf(e)}catch(e){Hu(t,t.return,e)}}}function Zc(e,t){if(null===t.memoizedState&&null!==(e=t.alternate)&&null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))try{Wf(e)}catch(e){Hu(t,t.return,e)}}function ed(e,t){var n=function(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Mc),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Mc),t;default:throw Error(a(435,e.tag))}}(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var i=Ku.bind(null,e,t);t.then(i,i)}})}function td(e,t,n){var i=t.deletions;if(null!==i)for(var r=0;r<i.length;r++){var o=i[r],s=e,l=t,c=l;e:for(;null!==c;){switch(c.tag){case 27:if(Kh(c.type)){Kc=c.stateNode,Yc=!1;break e}break;case 5:Kc=c.stateNode,Yc=!1;break e;case 3:case 4:Kc=c.stateNode.containerInfo,Yc=!0;break e}c=c.return}if(null===Kc)throw Error(a(160));Jc(s,l,o),Kc=null,Yc=!1,null!==(s=o.alternate)&&(s.return=null),o.return=null}if(13886&t.subtreeFlags)for(t=t.child;null!==t;)id(t,e,n),t=t.sibling}var nd=null;function id(e,t,n){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(4&r&&null!==(i=null!==(i=e.updateQueue)?i.events:null))for(var o=0;o<i.length;o++){var s=i[o];s.ref.impl=s.nextImpl}td(t,e,n),rd(e),4&r&&(Ql(3,e,e.return),Yl(3,e),Ql(5,e,e.return));break;case 1:td(t,e,n),rd(e),512&r&&(Lc||null===i||ec(i,i.return)),64&r&&Ac&&null!==(e=e.updateQueue)&&null!==(t=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?t:n.concat(t));break;case 26:if(o=nd,td(t,e,n),rd(e),512&r&&(Lc||null===i||ec(i,i.return)),4&r)if(r=null!==i?i.memoizedState:null,n=e.memoizedState,null===i)if(null===n)if(null===e.stateNode)if(Ac)e.stateNode=zh(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,r=o.ownerDocument||o;t:switch(t){case"title":(!(i=r.getElementsByTagName("title")[0])||i[ut]||i[rt]||"http://www.w3.org/2000/svg"===i.namespaceURI||i.hasAttribute("itemprop"))&&(i=r.createElement(t),r.head.insertBefore(i,r.querySelector("head > title"))),Oh(i,t,n),i[rt]=e,bt(i),t=i;break e;case"link":if(o=Xp("link","href",r).get(t+(n.href||"")))for(s=0;s<o.length;s++)if((i=o[s]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&i.getAttribute("rel")===(null==n.rel?null:n.rel)&&i.getAttribute("title")===(null==n.title?null:n.title)&&i.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){o.splice(s,1);break t}Oh(i=r.createElement(t),t,n),r.head.appendChild(i);break;case"meta":if(o=Xp("meta","content",r).get(t+(n.content||"")))for(s=0;s<o.length;s++)if((i=o[s]).getAttribute("content")===(null==n.content?null:""+n.content)&&i.getAttribute("name")===(null==n.name?null:n.name)&&i.getAttribute("property")===(null==n.property?null:n.property)&&i.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&i.getAttribute("charset")===(null==n.charSet?null:n.charSet)){o.splice(s,1);break t}Oh(i=r.createElement(t),t,n),r.head.appendChild(i);break;default:throw Error(a(468,t))}i[rt]=e,bt(i),t=i}e.stateNode=t}else Ac||Zp(o,e.type,e.stateNode);else e.stateNode=Gp(o,n,e.memoizedProps);else r!==n?(null===r?null===(t=i.stateNode)||Lc||t.parentNode.removeChild(t):r.count--,null===n?Ac||Zp(o,e.type,e.stateNode):Gp(o,n,e.memoizedProps)):null===n&&null!==e.stateNode&&sc(e,e.memoizedProps,i.memoizedProps);break;case 27:td(t,e,n),rd(e),512&r&&(Lc||null===i||ec(i,i.return)),null!==i&&4&r&&sc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(o=Dc,Dc=!1,td(t,e,n),Dc=o,rd(e),512&r&&(Lc||null===i||ec(i,i.return)),32&e.flags){t=e.stateNode;try{Wt(t,""),It=!0}catch(t){Hu(e,e.return,t)}}4&r&&null!=e.stateNode&&sc(e,t=e.memoizedProps,null!==i?i.memoizedProps:t),1024&r&&(Pc=!0);break;case 6:if(td(t,e,n),rd(e),4&r){if(null===e.stateNode)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,It=!0}catch(t){Hu(e,e.return,t)}}break;case 3:if(It=!1,Jp=null,o=nd,nd=Fp(t.containerInfo),td(t,e,n),nd=o,rd(e),4&r&&null!==i&&i.memoizedState.isDehydrated)try{Wf(t.containerInfo)}catch(t){Hu(e,e.return,t)}Pc&&(Pc=!1,od(e)),It=!1;break;case 4:r=Dc,Dc=Ac,i=Tt(),o=nd,nd=Fp(e.stateNode.containerInfo),td(t,e,n),rd(e),nd=o,It&&zc&&(Uc=!0),It=i,Dc=r;break;case 12:td(t,e,n),rd(e);break;case 31:td(t,e,n),rd(e),4&r&&null!==(t=e.updateQueue)&&(e.updateQueue=null,ed(e,t));break;case 13:td(t,e,n),rd(e),8192&e.child.flags&&null!==e.memoizedState!=(null!==i&&null!==i.memoizedState)&&(qd=xe()),4&r&&null!==(t=e.updateQueue)&&(e.updateQueue=null,ed(e,t));break;case 22:o=null!==e.memoizedState,s=null!==i&&null!==i.memoizedState;var l=Ac,c=Lc,d=Dc;Ac=l||o,Dc=d||o,Lc=c||s,td(t,e,n),Lc=c,Dc=d,Ac=l,rd(e),8192&r&&((t=e.stateNode)._visibility=o?-2&t._visibility:1|t._visibility,!o||null===i||s||Ac||Lc||(n=Ac,i=Lc,Ac=o||Ac,Lc=t=s||Lc,cd(e,2),Ac=n,Lc=i),!o&&Dc||Wc(e,o)),4&r&&null!==(t=e.updateQueue)&&null!==(n=t.retryQueue)&&(t.retryQueue=null,ed(e,n));break;case 19:td(t,e,n),rd(e),4&r&&null!==(t=e.updateQueue)&&(e.updateQueue=null,ed(e,t));break;case 30:512&r&&(Lc||null===i||ec(i,i.return)),r=Tt(),o=zc,s=(335544064&n)===n,l=e.memoizedProps,zc=s&&"none"!==Ji(l.default,l.update),td(t,e,n),rd(e),s&&null!==i&&It&&(e.flags|=4),zc=o,It=r;break;case 21:break;case 7:512&r&&(Lc||null===i||ec(i,i.return)),i&&null!==i.stateNode&&(i.stateNode._fragmentFiber=e);default:td(t,e,n),rd(e)}}function rd(e){var t=e.flags;if(2&t){try{for(var n,i=e.return;null!==i;){if(lc(i)){n=i;break}i=i.return}i=null;for(var r=e.return;null!==r;){if(oc(r)){var o=r.stateNode;null===i?i=[o]:i.push(o)}if(rc(r))break;r=r.return}var s=i;if(null==n)throw Error(a(160));switch(n.tag){case 27:var l=n.stateNode;uc(e,cc(e),l,s);break;case 5:var c=n.stateNode;32&n.flags&&(Wt(c,""),n.flags&=-33),uc(e,cc(e),c,s);break;case 3:case 4:var d=n.stateNode.containerInfo;dc(e,cc(e),d,s);break;default:throw Error(a(161))}}catch(t){Hu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function od(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;od(t),5===t.tag&&1024&t.flags&&(t=t.stateNode,yf=!0,t.reset(),yf=!1),e=e.sibling}}function ad(e,t){if(9270&t.subtreeFlags)for(t=t.child;null!==t;)sd(t,e),t=t.sibling;else Oc(t,!1)}function sd(e,t){var n=e.alternate;if(null===n)Sc(e,!1);else switch(e.tag){case 3:if($c=jc=!1,vc(),ad(t,e),!jc&&!Uc){if(null!==(e=mc))for(var i=0;i<e.length;i+=3){n=e[i];var r=e[i+1];Xh(n,e[i+2]),null!==(n=n.ownerDocument.documentElement)&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}null!==(e=9===(e=t.containerInfo).nodeType?e.documentElement:e.ownerDocument.documentElement)&&""===e.style.viewTransitionName&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),$c=!0}mc=null;break;case 5:default:ad(t,e);break;case 4:i=jc,jc=!1,ad(t,e),jc&&(Uc=!0),jc=i;break;case 22:null===e.memoizedState&&(null!==n.memoizedState?Sc(e,!1):ad(t,e));break;case 30:i=jc,r=vc(),jc=!1,ad(t,e),jc&&(e.flags|=4);var o=e.memoizedProps,a=e.stateNode;t=Yi(o,a),a=Yi(n.memoizedProps,a);var s=Ji(o.default,o.update);"none"===s?t=!1:(o=n.memoizedState,n.memoizedState=null,n=e.child,bc=0,t=Nc(e,n,t,a,s,o,!0),bc!==(null===o?0:o.length)&&(e.flags|=32)),4&e.flags&&t?(uu(e,e.memoizedProps.onUpdate),mc=r):null!==r&&(r.push.apply(r,mc),mc=r),jc=!!(32&e.flags)||i}}function ld(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)Hc(e,t.alternate,t),t=t.sibling}function cd(e,t){for(e=e.child;null!==e;){var n=e,i=t;switch(n.tag){case 0:case 11:case 14:case 15:Ql(4,n,n.return),cd(n,i);break;case 1:ec(n,n.return);var r=n.stateNode;"function"==typeof r.componentWillUnmount&&Xl(n,n.return,r),cd(n,i);break;case 27:2&i&&Lp(n.stateNode,n.type,n.memoizedProps);case 5:ec(n,n.return),5!==n.tag&&27!==n.tag||ic(n),cd(n,i);break;case 6:ic(n);break;case 26:ec(n,n.return),r=n.stateNode,null!==n.memoizedState||null===r||Lc||r.parentNode.removeChild(r),cd(n,i);break;case 22:null===n.memoizedState&&cd(n,i);break;case 30:ec(n,n.return),cd(n,i);break;case 7:ec(n,n.return);default:cd(n,i)}e=e.sibling}}function dd(e,t,n){for(n=8772&t.subtreeFlags?n:-2&n,t=t.child;null!==t;){var i=t.alternate,r=e,o=t,a=o.flags,s=!!(1&n);switch(o.tag){case 0:case 11:case 15:dd(r,o,n),Yl(4,o);break;case 1:if(dd(r,o,n),"function"==typeof(r=(i=o).stateNode).componentDidMount)try{r.componentDidMount()}catch(e){Hu(i,i.return,e)}if(null!==(r=(i=o).updateQueue)){var l=i.stateNode;try{var c=r.shared.hiddenCallbacks;if(null!==c)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)ea(c[r],l)}catch(e){Hu(i,i.return,e)}}s&&64&a&&Jl(o),Zl(o,o.return);break;case 27:2&n&&hc(o);case 5:5!==o.tag&&27!==o.tag||nc(o),dd(r,o,n),s&&null===i&&4&a&&ac(o),Zl(o,o.return);break;case 6:nc(o);break;case 26:l=o.stateNode,null!==o.memoizedState||null===l||Ac||Zp(Fp(l.ownerDocument),o.type,l),dd(r,o,n),s&&null===i&&4&a&&ac(o),Zl(o,o.return);break;case 12:dd(r,o,n);break;case 31:dd(r,o,n),s&&4&a&&Xc(r,o);break;case 13:dd(r,o,n),s&&4&a&&Zc(r,o);break;case 22:null===o.memoizedState&&dd(r,o,n),Zl(o,o.return);break;case 30:dd(r,o,n),Zl(o,o.return);break;case 7:Zl(o,o.return);default:dd(r,o,n)}t=t.sibling}}function ud(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&po(n))}function hd(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&po(e))}function pd(e,t,n,i){var r=(335544064&n)===n;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;null!==t;)fd(e,t,n,i),t=t.sibling;else r&&Rc(t)}function fd(e,t,n,i){var r=(335544064&n)===n;r&&null===t.alternate&&null!==t.return&&null!==t.return.alternate&&Tc(t);var o=t.flags;switch(t.tag){case 0:case 11:case 15:pd(e,t,n,i),2048&o&&Yl(9,t);break;case 1:case 31:case 13:default:pd(e,t,n,i);break;case 3:pd(e,t,n,i),r&&$c&&("root"===(e=9===(e=e.containerInfo).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e).style.viewTransitionName&&(e.style.viewTransitionName=""),null!==(e=e.ownerDocument.documentElement)&&"none"===e.style.viewTransitionName&&(e.style.viewTransitionName="")),2048&o&&(o=null,null!==t.alternate&&(o=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==o&&(t.refCount++,null!=o&&po(o)));break;case 12:if(2048&o){pd(e,t,n,i),o=t.stateNode;try{var a=t.memoizedProps,s=a.id,l=a.onPostCommit;"function"==typeof l&&l(s,null===t.alternate?"mount":"update",o.passiveEffectDuration,-0)}catch(e){Hu(t,t.return,e)}}else pd(e,t,n,i);break;case 23:break;case 22:a=t.stateNode,s=t.alternate,null!==t.memoizedState?(r&&null!==s&&null===s.memoizedState&&Tc(s),2&a._visibility?pd(e,t,n,i):md(e,t)):(r&&null!==s&&null!==s.memoizedState&&Tc(t),2&a._visibility?pd(e,t,n,i):(a._visibility|=2,gd(e,t,n,i,!!(10256&t.subtreeFlags)||!1))),2048&o&&ud(s,t);break;case 24:pd(e,t,n,i),2048&o&&hd(t.alternate,t);break;case 30:r&&null!==(o=t.alternate)&&(kc(o.child,!0),kc(t.child,!0)),pd(e,t,n,i)}}function gd(e,t,n,i,r){for(r=r&&(!!(10256&t.subtreeFlags)||!1),t=t.child;null!==t;){var o=e,a=t,s=n,l=i,c=a.flags;switch(a.tag){case 0:case 11:case 15:gd(o,a,s,l,r),Yl(8,a);break;case 23:break;case 22:var d=a.stateNode;null!==a.memoizedState?2&d._visibility?gd(o,a,s,l,r):md(o,a):(d._visibility|=2,gd(o,a,s,l,r)),r&&2048&c&&ud(a.alternate,a);break;case 24:gd(o,a,s,l,r),r&&2048&c&&hd(a.alternate,a);break;default:gd(o,a,s,l,r)}t=t.sibling}}function md(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,i=t,r=i.flags;switch(i.tag){case 22:md(n,i),2048&r&&ud(i.alternate,i);break;case 24:md(n,i),2048&r&&hd(i.alternate,i);break;default:md(n,i)}t=t.sibling}}var vd=8192;function bd(e,t,n){if(e.subtreeFlags&vd)for(e=e.child;null!==e;)yd(e,t,n),e=e.sibling}function yd(e,t,n){switch(e.tag){case 26:bd(e,t,n),e.flags&vd&&(null!==e.memoizedState?function(e,t,n,i){if(!("stylesheet"!==n.type||"string"==typeof i.media&&!1===matchMedia(i.media).matches||4&n.state.loading)){if(null===n.instance){var r=Bp(i.href),o=t.querySelector(Hp(r));if(o)return null!==(t=o._p)&&"object"==typeof t&&"function"==typeof t.then&&(e.count++,e=sf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=o,void bt(o);o=t.ownerDocument||t,i=Wp(i),(r=Pp.get(r))&&Yp(i,r),bt(o=o.createElement("link"));var a=o;a._p=new Promise(function(e,t){a.onload=e,a.onerror=t}),Oh(o,"link",i),n.instance=o}null===e.stylesheets&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(3&n.state.loading)&&(e.count++,n=sf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}(n,nd,e.memoizedState,e.memoizedProps):(e=e.stateNode,(335544128&t)===t&&rf(n,e)));break;case 5:bd(e,t,n),e.flags&vd&&(e=e.stateNode,(335544128&t)===t&&rf(n,e));break;case 3:case 4:var i=nd;nd=Fp(e.stateNode.containerInfo),bd(e,t,n),nd=i;break;case 22:null===e.memoizedState&&(null!==(i=e.alternate)&&null!==i.memoizedState?(i=vd,vd=16777216,bd(e,t,n),vd=i):bd(e,t,n));break;case 30:if(0!==(e.flags&vd)&&null!=(i=e.memoizedProps.name)&&"auto"!==i){var r=e.stateNode;r.paired=null,null===fc&&(fc=new Map),fc.set(i,r)}bd(e,t,n);break;default:bd(e,t,n)}}function wd(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function kd(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];Fc=i,xd(i,e)}wd(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)_d(e),e=e.sibling}function _d(e){switch(e.tag){case 0:case 11:case 15:kd(e),2048&e.flags&&Ql(9,e,e.return);break;case 3:case 12:default:kd(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,Sd(e)):kd(e)}}function Sd(e){var t=e.deletions;if(16&e.flags){if(null!==t)for(var n=0;n<t.length;n++){var i=t[n];Fc=i,xd(i,e)}wd(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:Ql(8,t,t.return),Sd(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,Sd(t));break;default:Sd(t)}e=e.sibling}}function xd(e,t){for(;null!==Fc;){var n=Fc;switch(n.tag){case 0:case 11:case 15:Ql(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var i=n.memoizedState.cachePool.pool;null!=i&&i.refCount++}break;case 24:po(n.memoizedState.cache)}if(null!==(i=n.child))i.return=n,Fc=i;else e:for(n=e;null!==Fc;){var r=(i=Fc).sibling,o=i.return;if(Gc(i),i===n){Fc=null;break e}if(null!==r){r.return=o,Fc=r;break e}Fc=o}}}var Cd={getCacheForType:function(e){var t=ro(uo),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ro(uo).controller.signal}},Ed="function"==typeof WeakMap?WeakMap:Map,Id=0,Td=null,Rd=null,Nd=0,Od=0,Ad=null,Ld=!1,Dd=!1,Pd=!1,Md=0,Fd=0,jd=0,zd=0,Ud=0,$d=0,Bd=0,Hd=null,Wd=null,Vd=!1,qd=0,Gd=0,Kd=1/0,Yd=null,Qd=null,Jd=0,Xd=null,Zd=null,eu=0,tu=0,nu=null,iu=null,ru=null,ou=null,au=null,su=0,lu=null;function cu(){return 2&Id&&0!==Nd?Nd&-Nd:null!==Q.T?lh():tt()}function du(){if(0===$d)if(536870912&Nd&&!Fr)$d=536870912;else{var e=Ue;!(3932160&(Ue<<=1))&&(Ue=262144),$d=e}return null!==(e=sa.current)&&(e.flags|=32),$d}function uu(e,t){if(null!=t){var n=e.stateNode,i=n.ref;null===i&&(i=n.ref=rp(Yi(e.memoizedProps,n))),null===ou&&(ou=[]),ou.push(t.bind(null,i))}}function hu(e,t,n){(e!==Td||2!==Od&&9!==Od)&&null===e.cancelPendingCommit||(yu(e,0),mu(e,Nd,$d,!1)),Ye(e,n),2&Id&&e===Td||(e===Td&&(!(2&Id)&&(zd|=n),4===Fd&&mu(e,Nd,$d,!1)),th(e))}function pu(e,t,n){if(6&Id)throw Error(a(327));for(var i=!n&&!(127&t)&&0===(t&e.expiredLanes)||We(e,t),r=i?function(e,t){var n=Id;Id|=2;var i=_u(),r=Su();Td!==e||Nd!==t?(Yd=null,Kd=xe()+500,yu(e,t)):Dd=We(e,t);e:for(;;)try{if(0!==Od&&null!==Rd){t=Rd;var o=Ad;t:switch(Od){case 1:Od=0,Ad=null,Nu(e,t,o,1);break;case 2:case 9:if(No(o)){Od=0,Ad=null,Ru(t);break}t=function(){2!==Od&&9!==Od||Td!==e||(Od=7),th(e)},o.then(t,t);break e;case 3:Od=7;break e;case 4:Od=5;break e;case 7:No(o)?(Od=0,Ad=null,Ru(t)):(Od=0,Ad=null,Nu(e,t,o,7));break;case 5:var s=null;switch(Rd.tag){case 26:s=Rd.memoizedState;case 5:case 27:var l=Rd;if(s?tf(s):l.stateNode.complete){Od=0,Ad=null;var c=l.sibling;if(null!==c)Rd=c;else{var d=l.return;null!==d?(Rd=d,Ou(d)):Rd=null}break t}}Od=0,Ad=null,Nu(e,t,o,5);break;case 6:Od=0,Ad=null,Nu(e,t,o,6);break;case 8:bu(),Fd=6;break e;default:throw Error(a(462))}}Iu();break}catch(t){wu(e,t)}return Qr=Yr=null,Q.H=i,Q.A=r,Id=n,null!==Rd?0:(Td=null,Nd=0,nr(),Fd)}(e,t):Cu(e,t,!0),o=i;;){if(0===r){Dd&&!i&&mu(e,t,0,!1);break}if(n=e.current.alternate,!o||gu(n)){if(2===r){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=0!=(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;r=Hd;var c=l.current.memoizedState.isDehydrated;if(c&&(yu(l,s).flags|=256),2!==(s=Cu(l,s,!1))&&6!==s){if(Pd&&!c){l.errorRecoveryDisabledLanes|=o,zd|=o,r=4;break e}o=Wd,Wd=r,null!==o&&(null===Wd?Wd=o:Wd.push.apply(Wd,o))}r=s}if(o=!1,2!==r)continue}}if(1===r){yu(e,0),mu(e,t,0,!0);break}e:{switch(i=e,o=r){case 0:case 1:throw Error(a(345));case 4:if((4194048&t)!==t&&(62914560&t)!==t)break;case 6:mu(i,t,$d,!Ld);break e;case 2:Wd=null;break;case 3:case 5:break;default:throw Error(a(329))}if((62914560&t)===t&&10<(r=qd+300-xe())){if(mu(i,t,$d,!Ld),0!==He(i,0,!0))break e;eu=t,i.timeoutHandle=Bh(fu.bind(null,i,n,Wd,Yd,Vd,t,$d,zd,Bd,Ld,o,"Throttled",-0,0),r)}else fu(i,n,Wd,Yd,Vd,t,$d,zd,Bd,Ld,o,null,-0,0)}break}r=Cu(e,t,!1),o=!1}th(e)}function fu(e,t,n,i,r,o,a,s,l,c,d,u,h,p){e.timeoutHandle=-1;var f,g,m=t.subtreeFlags,v=(335544064&o)===o;if(u=null,(v||8192&m||!(16785408&~m))&&(fc=null,yd(t,o,u={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt}),v&&(m=u,null!=(v=(9===(v=e.containerInfo).nodeType?v:v.ownerDocument).__reactViewTransition)&&(m.count++,m.waitingForViewTransition=!0,m=sf.bind(m),v.finished.then(m,m))),m=(62914560&o)===o?qd-xe():(4194048&o)===o?Gd-xe():0,g=m,(f=u).stylesheets&&0===f.count&&df(f,f.stylesheets),null!==(m=0<f.count||0<f.imgCount?function(e){var t=setTimeout(function(){if(f.stylesheets&&df(f,f.stylesheets),f.unsuspend){var e=f.unsuspend;f.unsuspend=null,e()}},6e4+g);0<f.imgBytes&&0===of&&(of=62500*function(){if("function"==typeof performance.getEntriesByType){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],o=r.transferSize,a=r.initiatorType,s=r.duration;if(o&&s&&Lh(a)){for(a=0,s=r.responseEnd,i+=1;i<n.length;i++){var l=n[i],c=l.startTime;if(c>s)break;var d=l.transferSize,u=l.initiatorType;d&&Lh(u)&&(a+=d*((l=l.responseEnd)<s?1:(s-c)/(l-c)))}if(--i,t+=8*(o+a)/(r.duration/1e3),10<++e)break}}if(0<e)return t/e/1e6}return navigator.connection&&"number"==typeof(e=navigator.connection.downlink)?e:5}());var n=setTimeout(function(){if(f.waitingForImages=!1,0===f.count&&(f.stylesheets&&df(f,f.stylesheets),f.unsuspend)){var e=f.unsuspend;f.unsuspend=null,e()}},(f.imgBytes>of?50:800)+g);return f.unsuspend=e,function(){f.unsuspend=null,clearTimeout(t),clearTimeout(n)}}:null)))return eu=o,e.cancelPendingCommit=m(Lu.bind(null,e,t,o,n,i,r,a,s,l,c,d,u,null,h,p)),void mu(e,o,a,!c);Lu(e,t,o,n,i,0,a,s,l,0,0,u)}function gu(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&null!==(n=t.updateQueue)&&null!==(n=n.stores))for(var i=0;i<n.length;i++){var r=n[i],o=r.getSnapshot;r=r.value;try{if(!yi(o(),r))return!1}catch(e){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function mu(e,t,n,i){t=Ve(e,t),t&=~Ud,t&=~zd,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var r=t;0<r;){var o=31-Me(r),a=1<<o;i[o]=-1,r&=~a}0!==n&&Qe(e,n,t)}function vu(){return!!(6&Id)||(nh(0,!1),!1)}function bu(){if(null!==Rd){if(0===Od)var e=Rd.return;else Qr=Yr=null,Fa(e=Rd),Mo=null,Fo=0,e=Rd;for(;null!==e;)Kl(e.alternate,e),e=e.return;Rd=null}}function yu(e,t){var n=e.timeoutHandle;return-1!==n&&(e.timeoutHandle=-1,Hh(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),eu=0,bu(),Td=e,Rd=n=hr(e.current,null),Nd=t,Od=0,Ad=null,Ld=!1,Dd=We(e,t),Pd=!1,Bd=$d=Ud=zd=jd=Fd=0,Wd=Hd=null,Vd=!1,Md=Ve(e,t),nr(),n}function wu(e,t){ya=null,Q.H=Vs,t===Eo||t===To?(t=Do(),Od=3):t===Io?(t=Do(),Od=4):Od=t===ll?8:null!==t&&"object"==typeof t&&"function"==typeof t.then?6:1,Ad=t,null===Rd&&(Fd=1,il(e,wr(t,e.current)))}function ku(){var e=sa.current;return null===e||((4194048&Nd)===Nd?null===la:!!((62914560&Nd)===Nd||536870912&Nd)&&e===la)}function _u(){var e=Q.H;return Q.H=Vs,null===e?Vs:e}function Su(){var e=Q.A;return Q.A=Cd,e}function xu(){Fd=4,Ld||(4194048&Nd)!==Nd&&null!==sa.current||(Dd=!0),!(134217727&jd)&&!(134217727&zd)||null===Td||mu(Td,Nd,$d,!1)}function Cu(e,t,n){var i=Id;Id|=2;var r=_u(),o=Su();Td===e&&Nd===t||(Yd=null,yu(e,t)),t=!1;var a=Fd;e:for(;;)try{if(0!==Od&&null!==Rd){var s=Rd,l=Ad;switch(Od){case 8:bu(),a=6;break e;case 3:case 2:case 9:case 6:null===sa.current&&(t=!0);var c=Od;if(Od=0,Ad=null,Nu(e,s,l,c),n&&Dd){a=0;break e}break;default:c=Od,Od=0,Ad=null,Nu(e,s,l,c)}}Eu(),a=Fd;break}catch(t){wu(e,t)}return t&&e.shellSuspendCounter++,Qr=Yr=null,Id=i,Q.H=r,Q.A=o,null===Rd&&(Td=null,Nd=0,nr()),a}function Eu(){for(;null!==Rd;)Tu(Rd)}function Iu(){for(;null!==Rd&&!_e();)Tu(Rd)}function Tu(e){var t=zl(e.alternate,e,Md);e.memoizedProps=e.pendingProps,null===t?Ou(e):Rd=t}function Ru(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=kl(n,t,t.pendingProps,t.type,void 0,Nd);break;case 11:t=kl(n,t,t.pendingProps,t.type.render,t.ref,Nd);break;case 5:Fa(t);var i=t;i===Pr&&(Fr?(Hr(i),5===i.tag&&null!=i.stateNode&&(Mr=i.stateNode)):(Hr(i),Fr=!0));default:Kl(n,t),t=zl(n,t=Rd=pr(t,Md),Md)}e.memoizedProps=e.pendingProps,null===t?Ou(e):Rd=t}function Nu(e,t,n,i){Qr=Yr=null,Fa(t),Mo=null,Fo=0;var r=t.return;try{if(function(e,t,n,i,r){if(n.flags|=32768,null!==i&&"object"==typeof i&&"function"==typeof i.then){if(null!==(t=n.alternate)&&to(t,n,r,!0),null!==(n=sa.current)){switch(n.tag){case 31:case 13:case 19:return null===la?xu():null===n.alternate&&0===Fd&&(Fd=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===Ro?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([i]):t.add(i),Wu(e,i,r)),!1;case 22:return n.flags|=65536,i===Ro?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([i]):n.add(i),Wu(e,i,r)),!1}throw Error(a(435,n.tag))}return Wu(e,i,r),xu(),!1}if(Fr)return null!==(t=sa.current)?(!(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=r,i!==Ur&&Gr(wr(e=Error(a(422),{cause:i}),n))):(i!==Ur&&Gr(wr(t=Error(a(423),{cause:i}),n)),(e=e.current.alternate).flags|=65536,r&=-r,e.lanes|=r,i=wr(i,n),Qo(e,r=ol(e.stateNode,i,r)),4!==Fd&&(Fd=2)),!1;var o=Error(a(520),{cause:i});if(o=wr(o,n),null===Hd?Hd=[o]:Hd.push(o),4!==Fd&&(Fd=2),null===t)return!0;i=wr(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,Qo(n,e=ol(n.stateNode,i,e)),!1;case 1:if(t=n.type,o=n.stateNode,!(128&n.flags||"function"!=typeof t.getDerivedStateFromError&&(null===o||"function"!=typeof o.componentDidCatch||null!==Qd&&Qd.has(o))))return n.flags|=65536,r&=-r,n.lanes|=r,sl(r=al(r),e,n,i),Qo(n,r),!1;break;case 22:if(null!==n.memoizedState)return n.flags|=65536,!1}n=n.return}while(null!==n);return!1}(e,r,t,n,Nd))return Fd=1,il(e,wr(n,e.current)),void(Rd=null)}catch(t){if(null!==r)throw Rd=r,t;return Fd=1,il(e,wr(n,e.current)),void(Rd=null)}32768&t.flags?(Fr||1===i?e=!0:Dd||536870912&Nd?e=!1:(Ld=e=!0,(2===i||9===i||3===i||6===i)&&null!==(i=sa.current)&&13===i.tag&&(i.flags|=16384)),Au(t,e)):Ou(t)}function Ou(e){var t=e;do{if(32768&t.flags)return void Au(t,Ld);e=t.return;var n=ql(t.alternate,t,Md);if(null!==n)return void(Rd=n);if(null!==(t=t.sibling))return void(Rd=t);Rd=t=e}while(null!==t);0===Fd&&(Fd=5)}function Au(e,t){do{var n=Gl(e.alternate,e);if(null!==n)return n.flags&=32767,void(Rd=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(Rd=e);Rd=e=n}while(null!==e);Fd=6,Rd=null}function Lu(e,t,n,i,r,o,s,l,c,d,u,h){e.cancelPendingCommit=null;do{Uu()}while(0!==Jd);if(6&Id)throw Error(a(327));if(null!==t){if(t===e.current)throw Error(a(177));e===Td&&(Rd=Td=null,Nd=0),Zd=t,Xd=e,eu=n,nu=r,iu=i,function(e,t,n,i,r,o,a){var s=t.lanes|t.childLanes;if(tu=s,function(e,t,n,i,r,o){var a=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 s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=a&~n;0<n;){var d=31-Me(n),u=1<<d;s[d]=0,l[d]=-1;var h=c[d];if(null!==h)for(c[d]=null,d=0;d<h.length;d++){var p=h[d];null!==p&&(p.lane&=-536870913)}n&=~u}0!==i&&Qe(e,i,0),0!==o&&0===r&&0!==e.tag&&(e.suspendedLanes|=o&~(a&~t))}(e,n,s|=tr,i,r,o),ou=null,(335544064&n)===n?(au=function(e){var t=e.transitionTypes;return e.transitionTypes=null,t}(e),i=10262):(au=null,i=10256),0!==(t.subtreeFlags&i)||0!==(t.flags&i)?(e.callbackNode=null,e.callbackPriority=0,we(Te,function(){return $u(),null})):(e.callbackNode=null,e.callbackPriority=0),pc=!1,i=!!(13878&t.flags),13878&t.subtreeFlags||i){i=Q.T,Q.T=null,r=J.p,J.p=2,o=Id,Id|=4;try{!function(e,t,n){if(e=e.containerInfo,Dh=yf,Ei(e=Ci(e))){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(i=(i=e.ownerDocument)&&i.defaultView||window).getSelection&&i.getSelection();if(r&&0!==r.rangeCount){i=r.anchorNode;var o=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{i.nodeType,a.nodeType}catch(e){i=null;break e}var s=0,l=-1,c=-1,d=0,u=0,h=e,p=null;t:for(;;){for(var f;h!==i||0!==o&&3!==h.nodeType||(l=s+o),h!==a||0!==r&&3!==h.nodeType||(c=s+r),3===h.nodeType&&(s+=h.nodeValue.length),null!==(f=h.firstChild);)p=h,h=f;for(;;){if(h===e)break t;if(p===i&&++d===o&&(l=s),p===a&&++u===r&&(c=s),null!==(f=h.nextSibling))break;p=(h=p).parentNode}h=f}i=-1===l||-1===c?null:{start:l,end:c}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ph={focusedElem:e,selectionRange:i},yf=!1,Fc=t,t=(n=(335544064&n)===n)?9270:1024;null!==Fc;){if(e=Fc,n&&null!==(i=e.deletions))for(o=0;o<i.length;o++)n&&Cc(i[o]);if(null===e.alternate&&2&e.flags)n&&gc(e),Bc(n);else{if(22===e.tag){if(i=e.alternate,null!==e.memoizedState){null!==i&&null===i.memoizedState&&n&&Cc(i),Bc(n);continue}if(null!==i&&null!==i.memoizedState){n&&gc(e),Bc(n);continue}}i=e.child,0!==(e.subtreeFlags&t)&&null!==i?(i.return=e,Fc=i):(n&&Ec(e),Bc(n))}}fc=null}(e,t,n)}finally{Id=o,J.p=r,Q.T=i}}Jd=1,pc?ru=function(e,t,n,i,r,o,a,s,l){var c=9===t.nodeType?t:t.ownerDocument;try{var d=c.startViewTransition({update:function(){var t=c.defaultView,n=t.navigation&&t.navigation.transition,a=c.fonts.status;i();var s=[];if("loaded"===a&&(function(e){e.documentElement.clientHeight}(c),"loading"===c.fonts.status&&s.push(c.fonts.ready)),a=s.length,null!==e)for(var l=e.suspenseyImages,d=0,u=0;u<l.length;u++){var h=l[u];if(!h.complete){var p=h.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if((d+=nf(h))>of){s.length=a;break}h=new Promise(np.bind(h)),s.push(h)}}}return 0<s.length?(t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(r,r),(n?Promise.allSettled([n.finished,t]):t).then(o,o)):(r(),n?n.finished.then(o,o):void o())},types:n});c.__reactViewTransition=d;var u=[];return d.ready.then(function(){for(var e=c.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],i=n.effect,r=i.pseudoElement;if(null!=r&&r.startsWith("::view-transition")){u.push(n),n=i.getKeyframes();for(var o=r=void 0,s=!0,l=0;l<n.length;l++){var d=n[l],h=d.width;if(void 0===r)r=h;else if(r!==h){s=!1;break}if(h=d.height,void 0===o)o=h;else if(o!==h){s=!1;break}delete d.width,delete d.height,"none"===d.transform&&delete d.transform}s&&void 0!==r&&void 0!==o&&(i.setKeyframes(n),(s=getComputedStyle(i.target,i.pseudoElement)).width!==r||s.height!==o)&&((s=n[0]).width=r,s.height=o,(s=n[n.length-1]).width=r,s.height=o,i.setKeyframes(n))}}a()},function(e){c.__reactViewTransition===d&&(c.__reactViewTransition=null);try{"object"==typeof e&&null!==e&&"InvalidStateError"===e.name&&("View transition was skipped because document visibility state is hidden."!==e.message&&"Skipping view transition because document visibility state has become hidden."!==e.message&&"Skipping view transition because viewport size changed."!==e.message&&"Transition was aborted because of invalid state"!==e.message||(e=null)),null!==e&&l(e)}finally{i(),r(),a()}}),d.finished.finally(function(){for(var e=0;e<u.length;e++)u[e].cancel();c.__reactViewTransition===d&&(c.__reactViewTransition=null),s()}),d}catch(e){return i(),r(),a(),null}}(a,e.containerInfo,au,Mu,Fu,Pu,ju,$u,Du):(Mu(),Fu(),ju())}(e,t,n,s,l,c,h)}}function Du(e){0!==Jd&&(0,Xd.onRecoverableError)(e,{componentStack:null})}function Pu(){3===Jd&&(Jd=0,sd(Zd,Xd),Jd=4)}function Mu(){if(1===Jd){Jd=0;var e=Xd,t=Zd,n=eu,i=!!(13878&t.flags);if(13878&t.subtreeFlags||i){i=Q.T,Q.T=null;var r=J.p;J.p=2;var o=Id;Id|=4;try{zc=Uc=!1,id(t,e,n),n=Ph;var a=Ci(e.containerInfo),s=n.focusedElem,l=n.selectionRange;if(a!==s&&s&&s.ownerDocument&&xi(s.ownerDocument.documentElement,s)){if(null!==l&&Ei(s)){var c=l.start,d=l.end;if(void 0===d&&(d=c),"selectionStart"in s)s.selectionStart=c,s.selectionEnd=Math.min(d,s.value.length);else{var u=s.ownerDocument||document,h=u&&u.defaultView||window;if(h.getSelection){var p=h.getSelection(),f=s.textContent.length,g=Math.min(l.start,f),m=void 0===l.end?g:Math.min(l.end,f);!p.extend&&g>m&&(a=m,m=g,g=a);var v=Si(s,g),b=Si(s,m);if(v&&b&&(1!==p.rangeCount||p.anchorNode!==v.node||p.anchorOffset!==v.offset||p.focusNode!==b.node||p.focusOffset!==b.offset)){var y=u.createRange();y.setStart(v.node,v.offset),p.removeAllRanges(),g>m?(p.addRange(y),p.extend(b.node,b.offset)):(y.setEnd(b.node,b.offset),p.addRange(y))}}}}for(u=[],p=s;p=p.parentNode;)1===p.nodeType&&u.push({element:p,left:p.scrollLeft,top:p.scrollTop});for("function"==typeof s.focus&&s.focus(),s=0;s<u.length;s++){var w=u[s];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}yf=!!Dh,Ph=Dh=null}finally{Id=o,J.p=r,Q.T=i}}e.current=t,Jd=2}}function Fu(){if(2===Jd){Jd=0;var e=Xd,t=Zd,n=!!(8772&t.flags);if(8772&t.subtreeFlags||n){n=Q.T,Q.T=null;var i=J.p;J.p=2;var r=Id;Id|=4;try{Hc(e,t.alternate,t)}finally{Id=r,J.p=i,Q.T=n}}Jd=3}}function ju(){if(4===Jd||3===Jd){Jd=0;var e=ru;ru=null,Se();var t=Xd,n=Zd,i=eu,r=iu,o=(335544064&i)===i?10262:10256;if(0!==(n.subtreeFlags&o)||0!==(n.flags&o)?Jd=5:(Jd=0,Zd=Xd=null,zu(t,t.pendingLanes)),0===(o=t.pendingLanes)&&(Qd=null),et(i),n=n.stateNode,De&&"function"==typeof De.onCommitFiberRoot)try{De.onCommitFiberRoot(Le,n,void 0,!(128&~n.current.flags))}catch(e){}if(null!==r){n=Q.T,o=J.p,J.p=2,Q.T=null;try{for(var a=t.onRecoverableError,s=0;s<r.length;s++){var l=r[s];a(l.value,{componentStack:l.stack})}}finally{Q.T=n,J.p=o}}if(a=au,au=null,null!==(r=ou)&&(ou=null,null===a&&(a=[]),null!==e))for(l=0;l<r.length;l++)void 0!==(n=(0,r[l])(a))&&e.finished.finally(n);3&eu&&Uu(),th(t),o=t.pendingLanes,261930&i&&42&o?t===lu?su++:(su=0,lu=t):(su=0,lu=null),nh(0,!1)}}function zu(e,t){0===(e.pooledCacheLanes&=t)&&null!=(t=e.pooledCache)&&(e.pooledCache=null,po(t))}function Uu(){return null!==ru&&(ru.skipTransition(),ru=null),Mu(),Fu(),ju(),$u()}function $u(){if(5!==Jd)return!1;var e=Xd,t=tu;tu=0;var n=et(eu),i=Q.T,r=J.p;try{J.p=32>n?32:n,Q.T=null,n=nu,nu=null;var o=Xd,s=eu;if(Jd=0,Zd=Xd=null,eu=0,6&Id)throw Error(a(331));var l=Id;if(Id|=4,_d(o.current),fd(o,o.current,s,n),Id=l,nh(0,!1),De&&"function"==typeof De.onPostCommitFiberRoot)try{De.onPostCommitFiberRoot(Le,o)}catch(e){}return!0}finally{J.p=r,Q.T=i,zu(e,t)}}function Bu(e,t,n){t=wr(n,t),null!==(e=Ko(e,t=ol(e.stateNode,t,2),2))&&(Ye(e,2),th(e))}function Hu(e,t,n){if(3===e.tag)Bu(e,e,n);else for(;null!==t;){if(3===t.tag){Bu(t,e,n);break}if(1===t.tag){var i=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===Qd||!Qd.has(i))){e=wr(n,e),null!==(i=Ko(t,n=al(2),2))&&(sl(n,i,t,e),Ye(i,2),th(i));break}}t=t.return}}function Wu(e,t,n){var i=e.pingCache;if(null===i){i=e.pingCache=new Ed;var r=new Set;i.set(t,r)}else void 0===(r=i.get(t))&&(r=new Set,i.set(t,r));r.has(n)||(Pd=!0,r.add(n),e=Vu.bind(null,e,t,n),t.then(e,e))}function Vu(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Td===e&&(Nd&n)===n&&(4===Fd||3===Fd&&(62914560&Nd)===Nd&&300>xe()-qd?2&Id?Ud|=n:yu(e,0):Ud|=n,Bd===Nd&&(Bd=0)),th(e)}function qu(e,t){0===t&&(t=Ge()),null!==(e=or(e,t))&&(Ye(e,t),th(e))}function Gu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),qu(e,n)}function Ku(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;null!==r&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(a(314))}null!==i&&i.delete(t),qu(e,n)}var Yu=null,Qu=null,Ju=!1,Xu=!1,Zu=!1,eh=0;function th(e){e!==Qu&&null===e.next&&(null===Qu?Yu=Qu=e:Qu=Qu.next=e),Xu=!0,Ju||(Ju=!0,qh(function(){6&Id?we(Ee,ih):rh()}))}function nh(e,t){if(!Zu&&Xu){Zu=!0;do{for(var n=!1,i=Yu;null!==i;){if(!t)if(0!==e){var r=i.pendingLanes;if(0===r)var o=0;else{var a=i.suspendedLanes,s=i.pingedLanes;o=(1<<31-Me(42|e)+1)-1,o=201326741&(o&=r&~(a&~s))?201326741&o|1:o?2|o:0}0!==o&&(n=!0,sh(i,o))}else o=Nd,!(3&(o=He(i,i===Td?o:0,null!==i.cancelPendingCommit||-1!==i.timeoutHandle)))||We(i,o)||(n=!0,sh(i,o));i=i.next}}while(n);Zu=!1}}function ih(){rh()}function rh(){Xu=Ju=!1;var e,t=0;0!==eh&&((e=window.event)&&"popstate"===e.type?e!==$h&&($h=e,1):($h=null,0))&&(t=eh);for(var n=xe(),i=null,r=Yu;null!==r;){var o=r.next,a=oh(r,n);0===a?(r.next=null,null===i?Yu=o:i.next=o,null===o&&(Qu=i)):(i=r,(0!==t||3&a)&&(Xu=!0)),r=o}0!==Jd&&5!==Jd||nh(t,!1),0!==eh&&(eh=0)}function oh(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,o=-62914561&e.pendingLanes;0<o;){var a=31-Me(o),s=1<<a,l=r[a];-1===l?0!==(s&n)&&0===(s&i)||(r[a]=qe(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}if(n=Nd,n=He(e,e===(t=Td)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),i=e.callbackNode,0===n||e===t&&(2===Od||9===Od)||null!==e.cancelPendingCommit)return null!==i&&null!==i&&ke(i),e.callbackNode=null,e.callbackPriority=0;if(!(3&n)||We(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==i&&ke(i),et(n)){case 2:case 8:n=Ie;break;case 32:default:n=Te;break;case 268435456:n=Ne}return i=ah.bind(null,e),n=we(n,i),e.callbackPriority=t,e.callbackNode=n,t}return null!==i&&null!==i&&ke(i),e.callbackPriority=2,e.callbackNode=null,2}function ah(e,t){if(0!==Jd&&5!==Jd)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var i=Nd;return 0===(i=He(e,e===Td?i:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(pu(e,i,t),oh(e,xe()),null!=e.callbackNode&&e.callbackNode===n?ah.bind(null,e):null)}function sh(e,t){if(Uu())return null;pu(e,t,!0)}function lh(){if(0===eh){var e=bo;0===e&&(e=ze,!(261888&(ze<<=1))&&(ze=256)),eh=e}return eh}function ch(e){return null==e||"symbol"==typeof e||"boolean"==typeof e?null:"function"==typeof e?e:Jt(e)}for(var dh=0;dh<qi.length;dh++){var uh=qi[dh];Gi(uh.toLowerCase(),"on"+(uh[0].toUpperCase()+uh.slice(1)))}Gi(ji,"onAnimationEnd"),Gi(zi,"onAnimationIteration"),Gi(Ui,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi($i,"onTransitionRun"),Gi(Bi,"onTransitionStart"),Gi(Hi,"onTransitionCancel"),Gi(Wi,"onTransitionEnd"),St("onMouseEnter",["mouseout","mouseover"]),St("onMouseLeave",["mouseout","mouseover"]),St("onPointerEnter",["pointerout","pointerover"]),St("onPointerLeave",["pointerout","pointerover"]),_t("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_t("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_t("onBeforeInput",["compositionend","keypress","textInput","paste"]),_t("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_t("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_t("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hh="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(" "),ph=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hh));function fh(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var a=i.length-1;0<=a;a--){var s=i[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(e){Xi(e)}r.currentTarget=null,o=l}else for(a=0;a<i.length;a++){if(l=(s=i[a]).instance,c=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;o=s,r.currentTarget=c;try{o(r)}catch(e){Xi(e)}r.currentTarget=null,o=l}}}}function gh(e,t){var n=t[st];void 0===n&&(n=t[st]=new Set);var i=e+"__bubble";n.has(i)||(yh(t,e,2,!1),n.add(i))}function mh(e,t,n){var i=0;t&&(i|=4),yh(n,e,i,t)}var vh="_reactListening"+Math.random().toString(36).slice(2);function bh(e){if(!e[vh]){e[vh]=!0,wt.forEach(function(t){"selectionchange"!==t&&(ph.has(t)||mh(t,!1,e),mh(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[vh]||(t[vh]=!0,mh("selectionchange",!1,t))}}function yh(e,t,n,i){switch(Ef(t)){case 2:var r=wf;break;case 8:r=kf;break;default:r=_f}n=r.bind(null,t,n,e),r=void 0,!cn||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),i?void 0!==r?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):void 0!==r?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function wh(e,t,n,i,r){var o=i;if(!(1&t||2&t||null===i))e:for(;;){if(null===i)return;var a=i.tag;if(3===a||4===a){var l=i.stateNode.containerInfo;if(l===r)break;if(4===a)for(a=i.return;null!==a;){var c=a.tag;if((3===c||4===c)&&a.stateNode.containerInfo===r)return;a=a.return}for(;null!==l;){if(null===(a=ft(l)))return;if(5===(c=a.tag)||6===c||26===c||27===c){i=o=a;continue e}l=l.parentNode}}i=i.return}an(function(){var i=o,r=en(n),a=[];e:{var l=Vi.get(e);if(void 0!==l){var c=Sn,d=e;switch(e){case"keypress":if(0===gn(n))break e;case"keydown":case"keyup":c=jn;break;case"focusin":d="focus",c=Rn;break;case"focusout":d="blur",c=Rn;break;case"beforeblur":case"afterblur":c=Rn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=In;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=Tn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=$n;break;case ji:case zi:case Ui:c=Nn;break;case Wi:c=Bn;break;case"scroll":case"scrollend":c=Cn;break;case"wheel":c=Hn;break;case"copy":case"cut":case"paste":c=On;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=zn;break;case"submit":c=Un;break;case"toggle":case"beforetoggle":c=Wn}var u=!!(4&t),h=!u&&("scroll"===e||"scrollend"===e),p=u?null!==l?l+"Capture":null:l;u=[];for(var f,g=i;null!==g;){var m=g;if(f=m.stateNode,5!==(m=m.tag)&&26!==m&&27!==m||null===f||null===p||null!=(m=sn(g,p))&&u.push(kh(g,m,f)),h)break;g=g.return}0<u.length&&(l=new c(l,d,null,n,r),a.push({event:l,listeners:u}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(c="mouseover"===e||"pointerover"===e)&&n!==Zt&&(d=n.relatedTarget||n.fromElement)&&(ft(d)||d[at])||(l||c)&&(d=r.window===r?r:(c=r.ownerDocument)?c.defaultView||c.parentWindow:window,l?(l=i,null!==(c=(c=n.relatedTarget||n.toElement)?ft(c):null)&&(h=s(c),u=c.tag,c!==h||5!==u&&27!==u&&6!==u)&&(c=null)):(l=null,c=i),l!==c&&(u=In,m="onMouseLeave",p="onMouseEnter",g="mouse","pointerout"!==e&&"pointerover"!==e||(u=zn,m="onPointerLeave",p="onPointerEnter",g="pointer"),h=null==l?d:mt(l),f=null==c?d:mt(c),(d=new u(m,g+"leave",l,n,r)).target=h,d.relatedTarget=f,m=null,ft(r)===i&&((u=new u(p,g+"enter",c,n,r)).target=f,u.relatedTarget=h,m=u),h=m,u=l&&c?C(l,c,Sh):null,null!==l&&xh(a,d,l,u,!1),null!==c&&null!==h&&xh(a,h,c,u,!0))),"select"===(c=(l=i?mt(i):window).nodeName&&l.nodeName.toLowerCase())||"input"===c&&"file"===l.type)var v=li;else if(ni(l))if(ci)v=bi;else{v=mi;var b=gi}else!(c=l.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==l.type&&"radio"!==l.type?i&&Kt(i.elementType)&&(v=li):v=vi;switch(v&&(v=v(e,i))?ii(a,v,n,r):b&&b(e,l,i),b=i?mt(i):window,e){case"focusin":(ni(b)||"true"===b.contentEditable)&&(Ti=b,Ri=i,Ni=null);break;case"focusout":Ni=Ri=Ti=null;break;case"mousedown":Oi=!0;break;case"contextmenu":case"mouseup":case"dragend":Oi=!1,Ai(a,n,r);break;case"selectionchange":if(Ii)break;case"keydown":case"keyup":Ai(a,n,r)}var y;if(qn)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else ei?Xn(e,n)&&(w="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(w="onCompositionStart");w&&(Yn&&"ko"!==n.locale&&(ei||"onCompositionStart"!==w?"onCompositionEnd"===w&&ei&&(y=fn()):(hn="value"in(un=r)?un.value:un.textContent,ei=!0)),0<(b=_h(i,w)).length&&(w=new An(w,e,null,n,r),a.push({event:w,listeners:b}),(y||null!==(y=Zn(n)))&&(w.data=y))),(y=Kn?function(e,t){switch(e){case"compositionend":return Zn(t);case"keypress":return 32!==t.which?null:(Jn=!0,Qn);case"textInput":return(e=t.data)===Qn&&Jn?null:e;default:return null}}(e,n):function(e,t){if(ei)return"compositionend"===e||!qn&&Xn(e,t)?(e=fn(),pn=hn=un=null,ei=!1,e):null;switch(e){case"paste":default: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 Yn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(w=_h(i,"onBeforeInput")).length&&(b=new An("onBeforeInput","beforeinput",null,n,r),a.push({event:b,listeners:w}),b.data=y),function(e,t,n,i,r){if("submit"===t&&n&&n.stateNode===r){var o=ch((r[ot]||null).action),a=i.submitter;a&&null!==(t=(t=a[ot]||null)?ch(t.formAction):a.getAttribute("formAction"))&&(o=t,a=null);var s=new Sn("action","action",null,i,r);e.push({event:s,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(0!==eh){var e=new FormData(r,a);Os(n,{pending:!0,data:e,method:r.method,action:o},null,e)}}else"function"==typeof o&&(s.preventDefault(),e=new FormData(r,a),Os(n,{pending:!0,data:e,method:r.method,action:o},o,e))},currentTarget:r}]})}}(a,e,i,n,r)}fh(a,t)})}function kh(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _h(e,t){for(var n=t+"Capture",i=[];null!==e;){var r=e,o=r.stateNode;if(5!==(r=r.tag)&&26!==r&&27!==r||null===o||(null!=(r=sn(e,n))&&i.unshift(kh(e,r,o)),null!=(r=sn(e,t))&&i.push(kh(e,r,o))),3===e.tag)return i;e=e.return}return[]}function Sh(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function xh(e,t,n,i,r){for(var o=t._reactName,a=[];null!==n&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===i)break;5!==s&&26!==s&&27!==s||null===c||(l=c,r?null!=(c=sn(n,o))&&a.unshift(kh(n,c,l)):r||null!=(c=sn(n,o))&&a.push(kh(n,c,l))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Ch=/\r\n?/g,Eh=/\u0000|\uFFFD/g;function Ih(e){return("string"==typeof e?e:""+e).replace(Ch,"\n").replace(Eh,"")}function Th(e,t){return t=Ih(t),Ih(e)===t}function Rh(e,t,n,i,r,o){switch(n){case"children":if("string"==typeof i)"body"===t||"textarea"===t&&""===i||Wt(e,i);else{if("number"!=typeof i&&"bigint"!=typeof i)return;"body"!==t&&Wt(e,""+i)}break;case"className":Nt(e,"class",i);break;case"tabIndex":Nt(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Nt(e,n,i);break;case"style":return void Gt(e,i,o);case"data":if("object"!==t){Nt(e,"data",i);break}case"src":case"href":if(""===i&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==i||"function"==typeof i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Jt(i),e.setAttribute(n,i);break;case"action":case"formAction":if("function"==typeof i){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}if("function"==typeof o&&("formAction"===n?("input"!==t&&Rh(e,t,"name",r.name,r,null),Rh(e,t,"formEncType",r.formEncType,r,null),Rh(e,t,"formMethod",r.formMethod,r,null),Rh(e,t,"formTarget",r.formTarget,r,null)):(Rh(e,t,"encType",r.encType,r,null),Rh(e,t,"method",r.method,r,null),Rh(e,t,"target",r.target,r,null))),null==i||"symbol"==typeof i||"boolean"==typeof i){e.removeAttribute(n);break}i=Jt(i),e.setAttribute(n,i);break;case"onClick":return void(null!=i&&(e.onclick=Xt));case"onScroll":return void(null!=i&&gh("scroll",e));case"onScrollEnd":return void(null!=i&&gh("scrollend",e));case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(a(61));if(null!=(n=i.__html)){if(null!=r.children)throw Error(a(60));(null!=o?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"muted":e.muted=i&&"function"!=typeof i&&"symbol"!=typeof i;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==i||"function"==typeof i||"boolean"==typeof i||"symbol"==typeof i){e.removeAttribute("xlink:href");break}n=Jt(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":null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,i):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===i?e.setAttribute(n,""):!1!==i&&null!=i&&"function"!=typeof i&&"symbol"!=typeof i?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":null==i||"function"==typeof i||"symbol"==typeof i||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":gh("beforetoggle",e),gh("toggle",e),Rt(e,"popover",i);break;case"xlinkActuate":Ot(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ot(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ot(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ot(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ot(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ot(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ot(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ot(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ot(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Rt(e,"is",i);break;case"innerText":case"textContent":return;default:if(2<n.length&&("o"===n[0]||"O"===n[0])&&("n"===n[1]||"N"===n[1]))return;Rt(e,n=Yt.get(n)||n,i)}It=!0}function Nh(e,t,n,i,r,o){switch(n){case"style":return void Gt(e,i,o);case"dangerouslySetInnerHTML":if(null!=i){if("object"!=typeof i||!("__html"in i))throw Error(a(61));if(null!=(n=i.__html)){if(null!=r.children)throw Error(a(60));(null!=o?o.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if("string"==typeof i)Wt(e,i);else{if("number"!=typeof i&&"bigint"!=typeof i)return;Wt(e,""+i)}break;case"onScroll":return void(null!=i&&gh("scroll",e));case"onScrollEnd":return void(null!=i&&gh("scrollend",e));case"onClick":return void(null!=i&&(e.onclick=Xt));case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":return;default:return void(kt.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(r=n.endsWith("Capture"),o=n.slice(2,r?n.length-7:void 0),"function"==typeof(t=null!=(t=e[ot]||null)?t[n]:null)&&e.removeEventListener(o,t,r),"function"!=typeof i)?(It=!0,n in e?e[n]=i:!0===i?e.setAttribute(n,""):Rt(e,n,i)):("function"!=typeof t&&null!==t&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,i,r))))}It=!0}function Oh(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gh("error",e),gh("load",e);var i,r=!1,o=!1;for(i in n)if(n.hasOwnProperty(i)){var s=n[i];if(null!=s)switch(i){case"src":r=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Rh(e,t,i,s,n,null)}}return o&&Rh(e,t,"srcSet",n.srcSet,n,null),void(r&&Rh(e,t,"src",n.src,n,null));case"input":gh("invalid",e);var l=i=s=o=null,c=null,d=null;for(r in n)if(n.hasOwnProperty(r)){var u=n[r];if(null!=u)switch(r){case"name":o=u;break;case"type":s=u;break;case"checked":c=u;break;case"defaultChecked":d=u;break;case"value":i=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(null!=u)throw Error(a(137,t));break;default:Rh(e,t,r,u,n,null)}}return void zt(e,i,l,c,d,s,o,!1);case"select":for(o in gh("invalid",e),r=s=i=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":i=l;break;case"defaultValue":s=l;break;case"multiple":r=l;default:Rh(e,t,o,l,n,null)}return t=i,n=s,e.multiple=!!r,void(null!=t?$t(e,!!r,t,!1):null!=n&&$t(e,!!r,n,!0));case"textarea":for(s in gh("invalid",e),i=o=r=null,n)if(n.hasOwnProperty(s)&&null!=(l=n[s]))switch(s){case"value":r=l;break;case"defaultValue":o=l;break;case"children":i=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(a(91));break;default:Rh(e,t,s,l,n,null)}return void Ht(e,r,o,i);case"option":for(c in n)n.hasOwnProperty(c)&&null!=(r=n[c])&&("selected"===c?e.selected=r&&"function"!=typeof r&&"symbol"!=typeof r:Rh(e,t,c,r,n,null));return;case"dialog":gh("beforetoggle",e),gh("toggle",e),gh("cancel",e),gh("close",e);break;case"iframe":case"object":gh("load",e);break;case"video":case"audio":for(r=0;r<hh.length;r++)gh(hh[r],e);break;case"image":gh("error",e),gh("load",e);break;case"details":gh("toggle",e);break;case"embed":case"source":case"link":gh("error",e),gh("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(d in n)if(n.hasOwnProperty(d)&&null!=(r=n[d]))switch(d){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,t));default:Rh(e,t,d,r,n,null)}return;default:if(Kt(t)){for(u in n)n.hasOwnProperty(u)&&void 0!==(r=n[u])&&Nh(e,t,u,r,n,void 0);return}}for(l in n)n.hasOwnProperty(l)&&null!=(r=n[l])&&Rh(e,t,l,r,n,null)}var Ah={};function Lh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}var Dh=null,Ph=null;function Mh(e){return 9===e.nodeType?e:e.ownerDocument}function Fh(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 jh(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function zh(e,t,n,i){return(n=Mh(n).createElement(e))[rt]=i,n[ot]=t,Oh(n,e,t),bt(n),n}function Uh(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"bigint"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var $h=null,Bh="function"==typeof setTimeout?setTimeout:void 0,Hh="function"==typeof clearTimeout?clearTimeout:void 0,Wh="function"==typeof Promise?Promise:void 0,Vh="function"==typeof requestAnimationFrame?requestAnimationFrame:Bh,qh="function"==typeof queueMicrotask?queueMicrotask:void 0!==Wh?function(e){return Wh.resolve(null).then(e).catch(Gh)}:Bh;function Gh(e){setTimeout(function(){throw e})}function Kh(e){return"head"===e}function Yh(e,t){var n=t,i=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&8===r.nodeType)if("/$"===(n=r.data)||"/&"===n){if(0===i)return e.removeChild(r),void Wf(t);i--}else if("$"===n||"$?"===n||"$~"===n||"$!"===n||"&"===n)i++;else if("html"===n)Dp(e.ownerDocument.documentElement);else if("head"===n){Dp(n=e.ownerDocument.head);for(var o=n.firstChild;o;){var a=o.nextSibling,s=o.nodeName;o[ut]||"SCRIPT"===s||"STYLE"===s||"LINK"===s&&"stylesheet"===o.rel.toLowerCase()||n.removeChild(o),o=a}}else"body"===n&&Dp(e.ownerDocument.body);n=r}while(n);Wf(t)}function Qh(e,t){var n=e;e=0;do{var i=n.nextSibling;if(1===n.nodeType?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",""===n.getAttribute("style")&&n.removeAttribute("style")):3===n.nodeType&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===e)break;e--}else"$"!==n&&"$?"!==n&&"$~"!==n&&"$!"!==n||e++;n=i}while(n)}function Jh(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,null!=n&&(e.style.viewTransitionClass=n),"inline"===(n=getComputedStyle(e)).display){if(1===(t=e.getClientRects()).length)var i=1;else for(var r=i=0;r<t.length;r++){var o=t[r];0<o.width&&0<o.height&&i++}1===i&&((e=e.style).display=1===t.length?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Xh(e,t){e=e.style;var n=null!=(t=t.style)?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=null==n||"boolean"==typeof n?"":(""+n).trim(),n=null!=t?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=null==n||"boolean"==typeof n?"":(""+n).trim(),"inline-block"===e.display&&(null==t?e.display=e.margin="":(n=t.display,e.display=null==n||"boolean"==typeof n?"":n,null!=(n=t.margin)?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=null==n||"boolean"==typeof n?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=null==t||"boolean"==typeof t?"":t)))}function Zh(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:"absolute"===t.position||"fixed"===t.position,clip:"none"!==t.clipPath||"visible"!==t.overflow||"none"!==t.filter||"none"!==t.mask||"none"!==t.mask||"0px"!==t.borderRadius,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function ep(e){return Zh(e.getBoundingClientRect(),getComputedStyle(e),e)}function tp(e){var t=e.getBoundingClientRect();return Zh(t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height),getComputedStyle(e),e)}function np(e){this.addEventListener("load",e),this.addEventListener("error",e)}function ip(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}function rp(e){return{name:e,group:new ip("group",e),imagePair:new ip("image-pair",e),old:new ip("old",e),new:new ip("new",e)}}function op(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}function ap(e,t,n,i){return y(e).addEventListener(t,n,i),!1}function sp(e,t,n,i){return y(e).removeEventListener(t,n,i),!1}function lp(e){return null!=e&&"boolean"!=typeof e&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function cp(e){return null==e?"c=0":"boolean"==typeof e?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function dp(e,t,n,i){if(0===e.length)return-1;i=cp(i);for(var r=0;r<e.length;r++){var o=e[r];if(o.type===t&&o.listener===n&&cp(o.optionsOrUseCapture)===i)return r}return-1}function up(e,t){return 6!==e.tag&&function(e,t){function n(){i=!0}if(e.ownerDocument.activeElement===e)return!0;var i=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return i}(e=y(e),t)}function hp(e,t){return t.push(e),!1}function pp(e,t){return!(6===e.tag||(e=y(e))!==t&&!e.contains(t)||(t.blur(),0))}function fp(e,t){return 6===e.tag||(e=y(e),t.observe(e)),!1}function gp(e,t){return 6===e.tag||(e=y(e),t.unobserve(e)),!1}ip.prototype.animate=function(e,t){return(t="number"==typeof t?{duration:t}:E({},t)).pseudoElement=this._selector,this._scope.animate(e,t)},ip.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),i=[],r=0;r<n.length;r++){var o=n[r].effect;null!==o&&o.target===e&&o.pseudoElement===t&&i.push(n[r])}return i},ip.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)},op.prototype.addEventListener=function(e,t,n){var i=null,r=null;if(null==n||"boolean"==typeof n||null===(i=n.signal||null)||!i.aborted){null===this._eventListeners&&(this._eventListeners=[]);var o=this._eventListeners;if(-1===dp(o,e,t,n)){var a=this,s=t;null!=n&&"boolean"!=typeof n&&!0===n.once&&(s=function(i){a.removeEventListener(e,t,n),"function"==typeof t?t.call(this,i):t.handleEvent(i)}),null!==i&&(r=a.removeEventListener.bind(a,e,t,n),i.addEventListener("abort",r,{once:!0}),r=i.removeEventListener.bind(i,"abort",r)),i=lp(n),o.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:r}),f(this._fragmentFiber.child,!1,ap,e,s,i)}this._eventListeners=o}},op.prototype.removeEventListener=function(e,t,n){var i=this._eventListeners;if(null!==i&&-1!==(t=dp(i,e,t,n))){var r=i[t];n=r.attachedListener;var o=r.cleanup;r=lp(r.optionsOrUseCapture),f(this._fragmentFiber.child,!1,sp,e,n,r),i.splice(t,1),null!==o&&o()}},op.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(null===t)return!0;t=y(t);var n=this._eventListeners;if(null!==n&&0<n.length||!e.bubbles){var i=9===t.nodeType?t.createComment(""):document.createTextNode("");if(n)for(var r=0;r<n.length;r++){var o=n[r];i.addEventListener(o.type,o.attachedListener,lp(o.optionsOrUseCapture))}if(t.appendChild(i),e=i.dispatchEvent(e),n)for(r=0;r<n.length;r++)o=n[r],i.removeEventListener(o.type,o.attachedListener,lp(o.optionsOrUseCapture));return t.removeChild(i),e}return t.dispatchEvent(e)},op.prototype.focus=function(e){f(this._fragmentFiber.child,!0,up,e,void 0,void 0)},op.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!up(t[n],e);n--);},op.prototype.blur=function(){var e=g(this._fragmentFiber);null!==e&&null!==(e=Mh(e=y(e)).activeElement)&&f(this._fragmentFiber.child,!1,pp,e,void 0,void 0)},op.prototype.observeUsing=function(e){null===this._observers&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,fp,e,void 0,void 0)},op.prototype.unobserveUsing=function(e){var t=this._observers;if(null!==t&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,gp,e,void 0,void 0);for(var n=t=0;n<mp.length;n++){var i=mp[n];i.fragmentInstance===this&&i.observer===e?e.unobserve(i.instance):mp[t++]=i}mp.length=t}};var mp=[],vp=!1;function bp(e,t){if(6===e.tag){var n=(e=e.stateNode).ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=y(e),t.push.apply(t,e.getClientRects());return!1}function yp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}function wp(e,t){return kp(e=y(e),t),!1}function kp(e,t){null==e.reactFragments&&(e.reactFragments=new Set),e.reactFragments.add(t)}function _p(e,t){var n=t._eventListeners;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];e.addEventListener(r.type,r.attachedListener,lp(r.optionsOrUseCapture))}3!==e.nodeType&&(null!==(n=t._observers)&&n.forEach(function(n){for(var i=0,r=0;r<mp.length;r++){var o=mp[r];o.fragmentInstance===t&&o.observer===n&&o.instance===e||(mp[i++]=o)}mp.length=i,n.observe(e)}),kp(e,t))}function Sp(e,t){var n=t._eventListeners;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];e.removeEventListener(r.type,r.attachedListener,lp(r.optionsOrUseCapture))}3!==e.nodeType&&(null!==(n=t._observers)&&n.forEach(function(n){"string"==typeof n.rootMargin?function(e,t,n){var i;mp.push({fragmentInstance:e,observer:t,instance:n}),vp||(vp=!0,i=function(){vp=!1;var e=mp;mp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}},Vh(function(){Vh(function(e){return i()})}))}(t,n,e):n.unobserve(e)}),null!=e.reactFragments&&e.reactFragments.delete(t))}function xp(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":xp(n),pt(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function Cp(e,t){for(;8!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!t)return null;if(null===(e=Tp(e.nextSibling)))return null}return e}function Ep(e){return"$?"===e.data||"$~"===e.data}function Ip(e){return"$!"===e.data||"$?"===e.data&&"loading"!==e.ownerDocument.readyState}function Tp(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"$~"===t||"&"===t||"F!"===t||"F"===t)break;if("/$"===t||"/&"===t)return null}}return e}op.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,bp,e,void 0,void 0),e},op.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return null===t?this:y(t).getRootNode(e)},op.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(null===t)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,hp,n,void 0,void 0);var i=y(t);if(0===n.length){if(n=i,m(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;null!==t;){if(4===t.tag){t=t.stateNode.containerInfo;break e}if(3===t.tag||5===t.tag||27===t.tag)break;t=t.return}t=null}null!=t&&(n=t)}t=this._fragmentFiber;var r=i=n.compareDocumentPosition(e);return n===e?r=Node.DOCUMENT_POSITION_CONTAINS:i&Node.DOCUMENT_POSITION_CONTAINED_BY&&(r=null===(n=v(t)[1])?Node.DOCUMENT_POSITION_PRECEDING:0===(e=y(n).compareDocumentPosition(e))||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING),r|Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=y(n[0]),r=y(n[n.length-1]);var o=m(this._fragmentFiber)?t.parentElement:i;if(null==o)return Node.DOCUMENT_POSITION_DISCONNECTED;i=o.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,o=o.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var a=t.compareDocumentPosition(e),s=r.compareDocumentPosition(e),l=a&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=i&&o&&a&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,(t=i&&t===e||o&&r===e||l||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!i&&t===e||!o&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:a)&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||function(e,t,n,i,r){var o=ft(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!o)e:{for(;null!==o;){if(7===o.tag&&(o===t||o.alternate===t)){n=!0;break e}o=o.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(null===o)return r===(o=r.ownerDocument)||r===o.documentElement||r===o.body;e:{for(o=t,t=g(t);null!==o;){if(!(5!==o.tag&&3!==o.tag&&27!==o.tag||o!==t&&o.alternate!==t)){o=!0;break e}o=o.return}o=!1}return o}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!o)&&!(t=o===n)&&(null===(t=C(n,o,x))?t=!1:(f(t,!0,_,o,n),o=w,w=null,t=null!==o)),t):!!(e&Node.DOCUMENT_POSITION_FOLLOWING)&&((t=!!o)&&!(t=o===i)&&(null===(t=C(i,o,x))?t=!1:(f(t,!0,S,o,i),o=w,k=w=null,t=null!==o)),t)}(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC},op.prototype.scrollIntoView=function(e){if("object"==typeof e)throw Error(a(566));var t=[];f(this._fragmentFiber.child,!1,hp,t,void 0,void 0);var n=!1!==e;if(0===t.length){var i=v(this._fragmentFiber);if(null===(i=n?i[1]||i[0]||g(this._fragmentFiber):i[0]||i[1]))return;if(6===i.tag)return void yp(e=y(i),n);if(9!==(i=y(i)).nodeType){if(11===i.nodeType)return void(null!==(n="host"in i?i.host:null)&&n.scrollIntoView(e));i.scrollIntoView(e)}}for(i=n?t.length-1:0;i!==(n?-1:t.length);){var r=t[i];6===r.tag?yp(r=y(r),n):y(r).scrollIntoView(e),i+=n?-1:1}};var Rp=null;function Np(e){e=e.nextSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n||"/&"===n){if(0===t)return Tp(e.nextSibling);t--}else"$"!==n&&"$!"!==n&&"$?"!==n&&"$~"!==n&&"&"!==n||t++}e=e.nextSibling}return null}function Op(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n||"$~"===n||"&"===n){if(0===t)return e;t--}else"/$"!==n&&"/&"!==n||t++}e=e.previousSibling}return null}function Ap(e,t,n){switch(t=Mh(n),e){case"html":if(!(e=t.documentElement))throw Error(a(452));return e;case"head":if(!(e=t.head))throw Error(a(453));return e;case"body":if(!(e=t.body))throw Error(a(454));return e;default:throw Error(a(451))}}function Lp(e,t,n){for(var i in n){var r=n[i];n.hasOwnProperty(i)&&null!=r&&Rh(e,t,i,null,Ah,r)}null!=n.dangerouslySetInnerHTML&&(e.textContent=""),e.onclick===Xt&&(e.onclick=null),pt(e)}function Dp(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var Pp=new Map,Mp=new Set;function Fp(e){if("function"==typeof e.getRootNode){var t=e.getRootNode();if(9===t.nodeType||11===t.nodeType)return t}return 9===e.nodeType?e:e.ownerDocument}var jp=J.d;J.d={f:function(){var e=jp.f(),t=vu();return e||t},r:function(e){var t=gt(e);null!==t&&5===t.tag&&"form"===t.type?Ls(t):jp.r(e)},D:function(e){jp.D(e),Up("dns-prefetch",e,null)},C:function(e,t){jp.C(e,t),Up("preconnect",e,t)},L:function(e,t,n){jp.L(e,t,n);var i=zp;if(i&&e&&t){var r='link[rel="preload"][as="'+Ft(t)+'"]';"image"===t&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Ft(n.imageSrcSet)+'"]',"string"==typeof n.imageSizes&&(r+='[imagesizes="'+Ft(n.imageSizes)+'"]')):r+='[href="'+Ft(e)+'"]';var o=r;switch(t){case"style":o=Bp(e);break;case"script":o=Vp(e)}if(!(Pp.has(o)||(e=E({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Pp.set(o,e),null!==i.querySelector(r)||"style"===t&&i.querySelector(Hp(o))||"script"===t&&i.querySelector(qp(o))))){var a=i.createElement("link");Oh(a,"link",e),"style"===t&&(a[ht]=!0,a.onload=a.onerror=function(){yt(a)}),bt(a),i.head.appendChild(a)}}},m:function(e,t){jp.m(e,t);var n=zp;if(n&&e){var i=t&&"string"==typeof t.as?t.as:"script",r='link[rel="modulepreload"][as="'+Ft(i)+'"][href="'+Ft(e)+'"]',o=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Vp(e)}if(!Pp.has(o)&&(e=E({rel:"modulepreload",href:e},t),Pp.set(o,e),null===n.querySelector(r))){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(qp(o)))return}Oh(i=n.createElement("link"),"link",e),bt(i),n.head.appendChild(i)}}},X:function(e,t){jp.X(e,t);var n=zp;if(n&&e){var i=vt(n).hoistableScripts,r=Vp(e),o=i.get(r);o||((o=n.querySelector(qp(r)))||(e=E({src:e,async:!0},t),(t=Pp.get(r))&&Qp(e,t),bt(o=n.createElement("script")),Oh(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}},S:function(e,t,n){jp.S(e,t,n);var i=zp;if(i&&e){var r=vt(i).hoistableStyles,o=Bp(e);t=t||"default";var a=r.get(o);if(!a){var s={loading:0,preload:null};if(a=i.querySelector(Hp(o)))s.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Pp.get(o))&&Yp(e,n);var l=a=i.createElement("link");bt(l),Oh(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){s.loading|=1}),l.addEventListener("error",function(){s.loading|=2}),s.loading|=4,Kp(a,t,i)}a={type:"stylesheet",instance:a,count:1,state:s},r.set(o,a)}}},M:function(e,t){jp.M(e,t);var n=zp;if(n&&e){var i=vt(n).hoistableScripts,r=Vp(e),o=i.get(r);o||((o=n.querySelector(qp(r)))||(e=E({src:e,async:!0,type:"module"},t),(t=Pp.get(r))&&Qp(e,t),bt(o=n.createElement("script")),Oh(o,"link",e),n.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},i.set(r,o))}}};var zp="undefined"==typeof document?null:document;function Up(e,t,n){var i=zp;if(i&&"string"==typeof t&&t){var r=Ft(t);r='link[rel="'+e+'"][href="'+r+'"]',"string"==typeof n&&(r+='[crossorigin="'+n+'"]'),Mp.has(r)||(Mp.add(r),e={rel:e,crossOrigin:n,href:t},null===i.querySelector(r)&&(Oh(t=i.createElement("link"),"link",e),bt(t),i.head.appendChild(t)))}}function $p(e,t,n,i){var r=(r=le.current)?Fp(r):null;if(!r)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return"string"==typeof n.precedence&&"string"==typeof n.href?(n=Bp(n.href),(i=(t=vt(r).hoistableStyles).get(n))||(i={type:"style",instance:null,count:0,state:null},t.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"==typeof n.href&&"string"==typeof n.precedence){e=Bp(n.href);var o=vt(r).hoistableStyles,s=o.get(e);if(s||(r=r.ownerDocument||r,s={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=r.querySelector(Hp(e)))?o._p||(s.instance=o,s.state.loading=5):((o=Pp.get(e))||(o={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pp.set(e,o)),function(e,t,n,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(!0!==t[ht])return void(i.loading=1)}else(t=e.createElement("link"))[ht]=!0,t.onload=t.onerror=yt.bind(null,t),Oh(t,"link",n),bt(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}(r,e,o,s.state))),t&&null===i)throw Error(a(528,""));return s}if(t&&null!==i)throw Error(a(529,""));return null;case"script":return t=n.async,"string"==typeof(n=n.src)&&t&&"function"!=typeof t&&"symbol"!=typeof t?(n=Vp(n),(i=(t=vt(r).hoistableScripts).get(n))||(i={type:"script",instance:null,count:0,state:null},t.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Bp(e){return'href="'+Ft(e)+'"'}function Hp(e){return'link[rel="stylesheet"]['+e+"]"}function Wp(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function Vp(e){return'[src="'+Ft(e)+'"]'}function qp(e){return"script[async]"+e}function Gp(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Ft(n.href)+'"]');if(i)return t.instance=i,bt(i),i;var r=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return bt(i=(e.ownerDocument||e).createElement("style")),Oh(i,"style",r),Kp(i,n.precedence,e),t.instance=i;case"stylesheet":r=Bp(n.href);var o=e.querySelector(Hp(r));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;i=Wp(n),(r=Pp.get(r))&&Yp(i,r),bt(o=(e.ownerDocument||e).createElement("link"));var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Oh(o,"link",i),t.state.loading|=4,Kp(o,n.precedence,e),t.instance=o;case"script":return o=Vp(n.src),(r=e.querySelector(qp(o)))?(t.instance=r,bt(r),r):(i=n,(r=Pp.get(o))&&Qp(i=E({},n),r),bt(r=(e=e.ownerDocument||e).createElement("script")),Oh(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(a(443,t.type))}else"stylesheet"===t.type&&!(4&t.state.loading)&&(i=t.instance,t.state.loading|=4,Kp(i,n.precedence,e));return t.instance}function Kp(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,o=r,a=0;a<i.length;a++){var s=i[a];if(s.dataset.precedence===t)o=s;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function Yp(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Qp(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Jp=null;function Xp(e,t,n){if(null===Jp){var i=new Map,r=Jp=new Map;r.set(n,i)}else(i=(r=Jp).get(n))||(i=new Map,r.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var o=n[r];if(!(o[ut]||o[rt]||"link"===e&&"stylesheet"===o.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==o.namespaceURI){var a=o.getAttribute(t)||"";a=e+a;var s=i.get(a);s?s.push(o):i.set(a,[o])}}return i}function Zp(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function ef(e,t){return"img"===e&&null!=t.src&&""!==t.src&&null==t.onLoad&&"lazy"!==t.loading}function tf(e){return!!("stylesheet"!==e.type||3&e.state.loading)}function nf(e){return(e.width||100)*(e.height||100)*("number"==typeof devicePixelRatio?devicePixelRatio:1)*.25}function rf(e,t){"function"==typeof t.decode&&(e.imgCount++,t.complete||(e.imgBytes+=nf(t),e.suspenseyImages.push(t)),e=lf.bind(e),t.decode().then(e,e))}var of=0;function af(e){if(0===e.count&&(0===e.imgCount||!e.waitingForImages))if(e.stylesheets)df(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}function sf(){this.count--,af(this)}function lf(){this.imgCount--,af(this)}var cf=null;function df(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,cf=new Map,t.forEach(uf,e),cf=null,sf.call(e))}function uf(e,t){if(!(4&t.state.loading)){var n=cf.get(e);if(n)var i=n.get(null);else{n=new Map,cf.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var a=r[o];"LINK"!==a.nodeName&&"not all"===a.getAttribute("media")||(n.set(a.dataset.precedence,a),i=a)}i&&n.set(null,i)}a=(r=t.instance).getAttribute("data-precedence"),(o=n.get(a)||i)===i&&n.set(null,r),n.set(a,r),this.count++,i=sf.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),o?o.parentNode.insertBefore(r,o.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(r,e.firstChild),t.state.loading|=4}}var hf={$$typeof:D,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function pf(e,t,n,i,r,o,a,s,l){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=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.transitionTypes=null,this.incompleteTransitions=new Map}function ff(e,t,n,i,r,o){r=function(e){return e?e=lr:lr}(r),null===i.context?i.context=r:i.pendingContext=r,(i=Go(t)).payload={element:n},null!==(o=void 0===o?null:o)&&(i.callback=o),null!==(n=Ko(e,i,t))&&(hu(n,0,t),Yo(n,e,t))}function gf(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function mf(e,t){gf(e,t),(e=e.alternate)&&gf(e,t)}function vf(e){if(13===e.tag||31===e.tag){var t=or(e,67108864);null!==t&&hu(t,0,67108864),mf(e,67108864)}}function bf(e){if(13===e.tag||31===e.tag){var t=cu(),n=or(e,t=Ze(t));null!==n&&hu(n,0,t),mf(e,t)}}var yf=!0;function wf(e,t,n,i){var r=Q.T;Q.T=null;var o=J.p;try{J.p=2,_f(e,t,n,i)}finally{J.p=o,Q.T=r}}function kf(e,t,n,i){var r=Q.T;Q.T=null;var o=J.p;try{J.p=8,_f(e,t,n,i)}finally{J.p=o,Q.T=r}}function _f(e,t,n,i){if(yf){var r=Sf(i);if(null===r)wh(e,t,i,xf,n),Pf(e,i);else if(function(e,t,n,i,r){switch(t){case"focusin":return Tf=Mf(Tf,e,t,n,i,r),!0;case"dragenter":return Rf=Mf(Rf,e,t,n,i,r),!0;case"mouseover":return Nf=Mf(Nf,e,t,n,i,r),!0;case"pointerover":var o=r.pointerId;return Of.set(o,Mf(Of.get(o)||null,e,t,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,Af.set(o,Mf(Af.get(o)||null,e,t,n,i,r)),!0}return!1}(r,e,t,n,i))i.stopPropagation();else if(Pf(e,i),4&t&&-1<Df.indexOf(e)){for(;null!==r;){var o=gt(r);if(null!==o)switch(o.tag){case 3:if((o=o.stateNode).current.memoizedState.isDehydrated){var a=Be(o.pendingLanes);if(0!==a){var s=o;for(s.pendingLanes|=2,s.entangledLanes|=2;a;){var l=1<<31-Me(a);s.entanglements[1]|=l,a&=~l}th(o),!(6&Id)&&(Kd=xe()+500,nh(0,!1))}}break;case 31:case 13:null!==(s=or(o,2))&&hu(s,0,2),vu(),mf(o,2)}if(null===(o=Sf(i))&&wh(e,t,i,xf,n),o===r)break;r=o}null!==r&&i.stopPropagation()}else wh(e,t,i,null,n)}}function Sf(e){return Cf(e=en(e))}var xf=null;function Cf(e){if(xf=null,null!==(e=ft(e))){var t=s(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=c(t)))return e;e=null}else if(31===n){if(null!==(e=d(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xf=e,null}function Ef(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ce()){case Ee:return 2;case Ie:return 8;case Te:case Re:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var If=!1,Tf=null,Rf=null,Nf=null,Of=new Map,Af=new Map,Lf=[],Df="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 Pf(e,t){switch(e){case"focusin":case"focusout":Tf=null;break;case"dragenter":case"dragleave":Rf=null;break;case"mouseover":case"mouseout":Nf=null;break;case"pointerover":case"pointerout":Of.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Af.delete(t.pointerId)}}function Mf(e,t,n,i,r,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:o,targetContainers:[r]},null!==t&&null!==(t=gt(t))&&vf(t),e):(e.eventSystemFlags|=i,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function Ff(e){var t=ft(e.target);if(null!==t){var n=s(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=c(n)))return e.blockedOn=t,void nt(e.priority,function(){bf(n)})}else if(31===t){if(null!==(t=d(n)))return e.blockedOn=t,void nt(e.priority,function(){bf(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function jf(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sf(e.nativeEvent);if(null!==n)return null!==(t=gt(n))&&vf(t),e.blockedOn=n,!1;var i=new(n=e.nativeEvent).constructor(n.type,n);Zt=i,n.target.dispatchEvent(i),Zt=null,t.shift()}return!0}function zf(e,t,n){jf(e)&&n.delete(t)}function Uf(){If=!1,null!==Tf&&jf(Tf)&&(Tf=null),null!==Rf&&jf(Rf)&&(Rf=null),null!==Nf&&jf(Nf)&&(Nf=null),Of.forEach(zf),Af.forEach(zf)}function $f(e,t){e.blockedOn===t&&(e.blockedOn=null,If||(If=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Uf)))}var Bf=null;function Hf(e){Bf!==e&&(Bf=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Bf===e&&(Bf=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],r=e[t+2];if("function"!=typeof i){if(null===Cf(i||n))continue;break}var o=gt(n);null!==o&&(e.splice(t,3),t-=3,Os(o,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Wf(e){function t(t){return $f(t,e)}null!==Tf&&$f(Tf,e),null!==Rf&&$f(Rf,e),null!==Nf&&$f(Nf,e),Of.forEach(t),Af.forEach(t);for(var n=0;n<Lf.length;n++){var i=Lf[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Lf.length&&null===(n=Lf[0]).blockedOn;)Ff(n),null===n.blockedOn&&Lf.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(i=0;i<n.length;i+=3){var r=n[i],o=n[i+1],a=r[ot]||null;if("function"==typeof o)a||Hf(n);else if(a){var s=null;if(o&&o.hasAttribute("formAction")){if(r=o,a=o[ot]||null)s=a.formAction;else if(null!==Cf(r))continue}else s=a.action;"function"==typeof s?n[i+1]=s:(n.splice(i,3),i-=3),Hf(n)}}}function Vf(){function e(e){e.canIntercept&&"react-transition"===e.info&&e.intercept({handler:function(){return new Promise(function(e){return r=e})},focusReset:"manual",scroll:"manual"})}function t(){null!==r&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var e=navigation.currentEntry;e&&null!=e.url&&navigation.navigate(e.url,{state:e.getState(),info:"react-transition",history:"replace"})}}if("object"==typeof navigation){var i=!1,r=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),null!==r&&(r(),r=null)}}}function qf(e){this._internalRoot=e}function Gf(e){this._internalRoot=e}Gf.prototype.render=qf.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(a(409));ff(t.current,cu(),e,t,null,null)},Gf.prototype.unmount=qf.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;ff(e.current,2,null,e,null,null),vu(),t[at]=null}},Gf.prototype.unstable_scheduleHydration=function(e){if(e){var t=tt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lf.length&&0!==t&&t<Lf[n].priority;n++);Lf.splice(n,0,e),0===n&&Ff(e)}};var Kf=i.version;if("19.3.1"!==Kf)throw Error(a(527,Kf,"19.3.1"));J.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw e=Object.keys(e).join(","),Error(a(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=s(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(null===r)break;var o=r.alternate;if(null===o){if(null!==(i=r.return)){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return h(r),e;if(o===i)return h(r),t;o=o.sibling}throw Error(a(188))}if(n.return!==i.return)n=r,i=o;else{for(var l=!1,c=r.child;c;){if(c===n){l=!0,n=r,i=o;break}if(c===i){l=!0,i=r,n=o;break}c=c.sibling}if(!l){for(c=o.child;c;){if(c===n){l=!0,n=o,i=r;break}if(c===i){l=!0,i=o,n=r;break}c=c.sibling}if(!l)throw Error(a(189))}}if(n.alternate!==i)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(t),null===(e=null!==e?p(e):null)?null:e.stateNode};var Yf={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.3.1"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Qf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qf.isDisabled&&Qf.supportsFiber)try{Le=Qf.inject(Yf),De=Qf}catch(e){}}t.createRoot=function(e,t){if(!(n=e)||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(a(299));var n,i=!1,r="",o=el,s=tl,l=nl;return null!=t&&(!0===t.unstable_strictMode&&(i=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onUncaughtError&&(o=t.onUncaughtError),void 0!==t.onCaughtError&&(s=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError)),t=function(e,t,n,i,r,o,a,s,l,c,d,u){return e=new pf(e,t,n,a,l,c,d,u,s),t=1,!0===o&&(t|=24),o=dr(3,null,null,t),e.current=o,o.stateNode=e,(t=ho()).refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:i,isDehydrated:n,cache:t},Vo(o),e}(e,1,!1,null,0,i,r,null,o,s,l,Vf),e[at]=t.current,bh(e),new qf(t)}}),t=n.cw((e,t)=>{var n=l();function i(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 r(){}var o={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal"),s=Symbol.for("react.recoverable"),c=Symbol.for("react.optimistic_key"),d=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,t.browser=function(e){return{$$typeof:s,_reason:e}},t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(i(299));return function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:a,key:null==i?null:i===c?c:""+i,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=d.T,n=o.p;try{if(d.T=null,o.p=2,e)return e()}finally{d.T=t,o.p=n,o.d.f()}},t.preconnect=function(e,t){"string"==typeof e&&(t=t?"string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:null,o.d.C(e,t))},t.prefetchDNS=function(e){"string"==typeof e&&o.d.D(e)},t.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,i=u(n,t.crossOrigin),r="string"==typeof t.integrity?t.integrity:void 0,a="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?o.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:a}):"script"===n&&o.d.X(e,{crossOrigin:i,integrity:r,fetchPriority:a,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=u(t.as,t.crossOrigin);o.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0})}}else null==t&&o.d.M(e)},t.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,i=u(n,t.crossOrigin);o.d.L(e,n,{crossOrigin:i,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=u(t.as,t.crossOrigin);o.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0})}else o.d.m(e)},t.requestFormReset=function(e){o.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return d.H.useFormState(e,t,n)},t.useFormStatus=function(){return d.H.useHostTransitionStatus()},t.version="19.3.1"}),r=n.cw(t=>{!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),t.exports=e()}),o=n.cw(e=>{!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=t()}),a=n.cw((e,t)=>{var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(e,t,i){var r=null;if(void 0!==i&&(r=""+i),void 0!==t.key&&(r=""+t.key),"key"in t)for(var o in i={},t)"key"!==o&&(i[o]=t[o]);else i=t;return t=i.ref,{$$typeof:n,type:e,key:r,ref:void 0!==t?t:null,props:i}}t.Fragment=i,t.jsx=r,t.jsxs=r}),s=n.cw((e,t)=>{var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),f=Symbol.for("react.view_transition"),g=Symbol.iterator,m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,b={};function y(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||m}function w(){}function k(e,t,n){this.props=e,this.context=t,this.refs=b,this.updater=n||m}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=y.prototype;var _=k.prototype=new w;_.constructor=k,v(_,y.prototype),_.isPureReactComponent=!0;var S=Array.isArray;function x(){}var C={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function I(e,t,i){var r=i.ref;return{$$typeof:n,type:e,key:t,ref:void 0!==r?r:null,props:i}}function T(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var R=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return i[e]})):t.toString(36);var n,i}function O(e,t,r,o,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l,c,d=!1;if(null===e)d=!0;else switch(s){case"bigint":case"string":case"number":d=!0;break;case"object":switch(e.$$typeof){case n:case i:d=!0;break;case h:return O((d=e._init)(e._payload),t,r,o,a)}}if(d)return a=a(e),d=""===o?"."+N(e,0):o,S(a)?(r="",null!=d&&(r=d.replace(R,"$&/")+"/"),O(a,t,r,"",function(e){return e})):null!=a&&(T(a)&&(l=a,c=r+(null==a.key||e&&e.key===a.key?"":(""+a.key).replace(R,"$&/")+"/")+d,a=I(l.type,c,l.props)),t.push(a)),1;d=0;var u,p=""===o?".":o+":";if(S(e))for(var f=0;f<e.length;f++)d+=O(o=e[f],t,r,s=p+N(o,f),a);else if("function"==typeof(f=null===(u=e)||"object"!=typeof u?null:"function"==typeof(u=g&&u[g]||u["@@iterator"])?u:null))for(e=f.call(e),f=0;!(o=e.next()).done;)d+=O(o=o.value,t,r,s=p+N(o,f++),a);else if("object"===s){if("function"==typeof e.then)return O(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(x,x):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,r,o,a);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return d}function A(e,t,n){if(null==e)return e;var i=[],r=0;return O(e,i,"","",function(e){return t.call(n,e,r++)}),i}function L(e){if(-1===e._status){var t=(0,e._result)();t.then(function(n){0!==e._status&&-1!==e._status||(e._status=1,e._result=n,void 0===t.status&&(t.status="fulfilled",t.value=n))},function(n){0!==e._status&&-1!==e._status||(e._status=2,e._result=n,void 0===t.status&&(t.status="rejected",t.reason=n))}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function P(e){var t=C.T,n={};n.types=null!==t?t.types:null,C.T=n;try{var i=e(),r=C.S;null!==r&&r(n,i),"object"==typeof i&&null!==i&&"function"==typeof i.then&&i.then(x,D)}catch(e){D(e)}finally{null!==t&&null!==n.types&&(t.types=n.types),C.T=t}}var M={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};t.Activity=p,t.Children=M,t.Component=y,t.Fragment=r,t.Profiler=a,t.PureComponent=k,t.StrictMode=o,t.Suspense=d,t.ViewTransition=f,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}},t.addTransitionType=function e(t){var n=C.T;if(null!==n){var i=n.types;null===i?n.types=[t]:-1===i.indexOf(t)&&i.push(t)}else P(e.bind(null,t))},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cacheSignal=function(){return null},t.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var i=v({},e.props),r=e.key;if(null!=t)for(o in void 0!==t.key&&(r=""+t.key),t)!E.call(t,o)||"key"===o||"__self"===o||"__source"===o||"ref"===o&&void 0===t.ref||(i[o]=t[o]);var o=arguments.length-2;if(1===o)i.children=n;else if(1<o){for(var a=Array(o),s=0;s<o;s++)a[s]=arguments[s+2];i.children=a}return I(e.type,r,i)},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:s,_context:e},e},t.createElement=function(e,t,n){var i,r={},o=null;if(null!=t)for(i in void 0!==t.key&&(o=""+t.key),t)E.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&(r[i]=t[i]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(i in a=e.defaultProps)void 0===r[i]&&(r[i]=a[i]);return I(e,o,r)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=T,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:L}},t.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},t.startTransition=P,t.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},t.use=function(e){return C.H.use(e)},t.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)},t.useCallback=function(e,t){return C.H.useCallback(e,t)},t.useContext=function(e){return C.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return C.H.useEffect(e,t)},t.useEffectEvent=function(e){return C.H.useEffectEvent(e)},t.useId=function(){return C.H.useId()},t.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return C.H.useMemo(e,t)},t.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)},t.useRef=function(e){return C.H.useRef(e)},t.useState=function(e){return C.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return C.H.useTransition()},t.version="19.3.1"}),l=n.cw(e=>{e.exports=s()}),c=n.cw(e=>{e.exports=a()}),d=n.cw((e,t)=>{function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var i=n-1>>>1,r=e[i];if(!(0<o(r,t)))break e;e[i]=t,e[n]=r,n=i}}function i(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,r=e.length,a=r>>>1;i<a;){var s=2*(i+1)-1,l=e[s],c=s+1,d=e[c];if(0>o(l,n))c<r&&0>o(d,l)?(e[i]=d,e[c]=n,i=c):(e[i]=l,e[s]=n,i=s);else{if(!(c<r&&0>o(d,n)))break e;e[i]=d,e[c]=n,i=c}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],d=[],u=1,h=null,p=3,f=!1,g=!1,m=!1,v=!1,b="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,w="undefined"!=typeof setImmediate?setImmediate:null;function k(e){for(var t=i(d);null!==t;){if(null===t.callback)r(d);else{if(!(t.startTime<=e))break;r(d),t.sortIndex=t.expirationTime,n(c,t)}t=i(d)}}function _(e){if(m=!1,k(e),!g)if(null!==i(c))g=!0,x||(x=!0,S());else{var t=i(d);null!==t&&A(_,t.startTime-e)}}var S,x=!1,C=-1,E=5,I=-1;function T(){return!(!v&&t.unstable_now()-I<E)}function R(){if(v=!1,x){var e=t.unstable_now();I=e;var n=!0;try{e:{g=!1,m&&(m=!1,y(C),C=-1),f=!0;var o=p;try{t:{for(k(e),h=i(c);null!==h&&!(h.expirationTime>e&&T());){var a=h.callback;if("function"==typeof a){h.callback=null,p=h.priorityLevel;var s=a(h.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof s){h.callback=s,k(e),n=!0;break t}h===i(c)&&r(c),k(e)}else r(c);h=i(c)}if(null!==h)n=!0;else{var l=i(d);null!==l&&A(_,l.startTime-e),n=!1}}break e}finally{h=null,p=o,f=!1}n=void 0}}finally{n?S():x=!1}}}if("function"==typeof w)S=function(){w(R)};else if("undefined"!=typeof MessageChannel){var N=new MessageChannel,O=N.port2;N.port1.onmessage=R,S=function(){O.postMessage(null)}}else S=function(){b(R,0)};function A(e,n){C=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},t.unstable_requestPaint=function(){v=!0},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},t.unstable_scheduleCallback=function(e,r,o){var a=t.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:u++,callback:r,priorityLevel:e,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>a?(e.sortIndex=o,n(d,e),null===i(c)&&e===i(d)&&(m?(y(C),C=-1):m=!0,A(_,o-a))):(e.sortIndex=s,n(c,e),g||f||(g=!0,x||(x=!0,S()))),e},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}}),u=n.cw(e=>{e.exports=d()}),h=n.cw(e=>{var t=[];function n(e){for(var n=-1,i=0;i<t.length;i++)if(t[i].identifier===e){n=i;break}return n}function i(e,i){for(var o={},a=[],s=0;s<e.length;s++){var l=e[s],c=i.base?l[0]+i.base:l[0],d=o[c]||0,u="".concat(c," ").concat(d);o[c]=d+1;var h=n(u),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var f=r(p,i);i.byIndex=s,t.splice(s,0,{identifier:u,updater:f,references:1})}a.push(u)}return a}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var o=i(e=e||[],r=r||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var s=n(o[a]);t[s].references--}for(var l=i(e,r),c=0;c<o.length;c++){var d=n(o[c]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}o=l}}}),p=n.cw(e=>{var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}}),f=n.cw(e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}}),g=n.cw(e=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}}),m=n.cw(e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}}),v=n.cw(e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}),b=n(833),y=n.n(b);l(),r(),c();const w=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),k={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function _(e){return null!=e}const S=(0,s().createContext)({}),x=(0,s().forwardRef)(({color:e,size:t,width:n,height:i,strokeWidth:r,absoluteStrokeWidth:o,nonScalingStroke:a,className:l="",children:c,iconNode:d=[],icon:u={node:d,aliases:[],size:24},...h},p)=>{const{size:f=24,strokeWidth:g=2,absoluteStrokeWidth:m=!1,nonScalingStroke:v=!1,color:b="currentColor",className:y=""}=(0,s().useContext)(S)??{},x=Boolean(c)||(e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(h),[C,E,I=[]]=function(e,t={}){return function(e,t={}){const n=t.attributeNames??{},i=e=>n[e]??e,r=e.size??e.width??k.width,o=e.size??e.height??k.height,a=e.aliases?.filter(e=>"string"==typeof e&&""!==e.trim()).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...a],l=t.className?.split(" ").filter(Boolean)??[],c=!1===t.includeDefaultClasses?w(...l):w("lucide",...s,...l),d=t.absoluteStrokeWidth?Number(t.strokeWidth??k["stroke-width"])*Number(e.size??e.width??k.width)/Number(t.size??t.width??k.width):t.strokeWidth??k["stroke-width"];return["svg",{...Object.entries(k).reduce((e,[t,n])=>(e[i(t)]=n,e),{}),..."color"in t&&t.color&&{[i("stroke")]:t.color},..."size"in t&&_(t.size)&&{[i("width")]:t.size,[i("height")]:t.size},..."width"in t&&_(t.width)&&{[i("width")]:t.width},..."height"in t&&_(t.height)&&{[i("height")]:t.height},[i("stroke-width")]:d,...c&&{[i("class")]:c},[i("viewBox")]:`0 0 ${r} ${o}`,...!1===t.hasA11yProp?{[i("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(e=>{const[n,r,o]=e,a=t.nonScalingStroke?{[i("vector-effect")]:"non-scaling-stroke",...r}:r;return o?[n,a,o]:[n,a]})]}(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}(u,{color:e??b,width:n??t??f,height:i??t??f,strokeWidth:r??g,absoluteStrokeWidth:o??m,nonScalingStroke:a??v,className:w(y,l),hasA11yProp:x,attributes:h});return(0,s().createElement)(C,{ref:p,...E},[...I.map(([e,t])=>(0,s().createElement)(e,t)),...Array.isArray(c)?c:[c]])});function C(e,t=[],n=[]){const i="string"==typeof e?function(e,t,n=[]){if(null==t)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:(i=e,i?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),size:24,node:t,...n.length>0?{aliases:n}:{}};var i}(e,t,n):e,r=(0,s().forwardRef)(({className:e,...t},n)=>(0,s().createElement)(x,{ref:n,icon:i,className:e,...t}));return i.name&&(r.displayName=(e=>{const t=(e=>{let t="",n=!1;for(const i of e)"-"===i||"_"===i||i<=" "?n=t.length>0:(0===t.length?t+=i.toLowerCase():t+=n?i.toUpperCase():i,n=!1);return t})(e);return t.charAt(0).toUpperCase()+t.slice(1)})(i.name)),r}const E=C({name:"mic",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]}),I=C({name:"phone-off",size:24,node:[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]]}),T=(0,s().createContext)();class R{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}let N;const O=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,A={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},L=e=>A[e];let D={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(O,L)};const P={},M=(e,t,n,i)=>{U(n)&&P[n]||(U(n)&&(P[n]=new Date),((e,t,n,i)=>{const r=[n,{code:t,...i||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(r,"warn","react-i18next::",!0);U(r[0])&&(r[0]=`react-i18next:: ${r[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...r):console?.warn&&console.warn(...r)})(e,t,n,i))},F=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},j=(e,t,n)=>{e.loadNamespaces(t,F(e,n))},z=(e,t,n,i)=>{if(U(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return j(e,n,i);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,F(e,i))},U=e=>"string"==typeof e,$=(e,t,n,i)=>e.getFixedT(t,n,i),B=(e,t={})=>{const{i18n:n}=t,{i18n:i,defaultNS:r}=(0,s().useContext)(T)||{},o=n||i||N;if(o&&!o.reportNamespaces&&(o.reportNamespaces=new R),!o){M(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return U(t)?t:"object"==typeof(n=t)&&null!==n&&U(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var n},t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}o.options.react?.wait&&M(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...D,...o.options.react,...t},{useSuspense:l,keyPrefix:c}=a;let d=e||r||o.options?.defaultNS;d=U(d)?[d]:d||["translation"],o.reportNamespaces.addUsedNamespaces?.(d);const u=(o.isInitialized||o.initializedStoreOnce)&&d.every(e=>((e,t,n={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!i(t.isLanguageChangingTo,e))return!1}}):(M(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,o,a)),h=((e,t,n,i)=>(0,s().useCallback)($(e,t,n,i),[e,t,n,i]))(o,t.lng||null,"fallback"===a.nsMode?d:d[0],c),p=()=>h,f=()=>$(o,t.lng||null,"fallback"===a.nsMode?d:d[0],c),[g,m]=(0,s().useState)(p);let v=d.join();t.lng&&(v=`${t.lng}${v}`);const b=((e,t)=>{const n=(0,s().useRef)();return(0,s().useEffect)(()=>{n.current=e},[e,t]),n.current})(v),y=(0,s().useRef)(!0);(0,s().useEffect)(()=>{const{bindI18n:e,bindI18nStore:n}=a;y.current=!0,u||l||(t.lng?z(o,t.lng,d,()=>{y.current&&m(f)}):j(o,d,()=>{y.current&&m(f)})),u&&b&&b!==v&&y.current&&m(f);const i=()=>{y.current&&m(f)};return e&&o?.on(e,i),n&&o?.store.on(n,i),()=>{y.current=!1,o&&e&&e?.split(" ").forEach(e=>o.off(e,i)),n&&o&&n.split(" ").forEach(e=>o.store.off(e,i))}},[o,v]),(0,s().useEffect)(()=>{y.current&&u&&m(p)},[o,c,u]);const w=[g,o,u];if(w.t=g,w.i18n=o,w.ready=u,u)return w;if(!u&&!l)return w;throw new Promise(e=>{t.lng?z(o,t.lng,d,()=>e()):j(o,d,()=>e())})},H=e=>{const t="number"==typeof e?e:0,n=Number.isFinite(t)?Math.max(0,Math.floor(t)):0,i=Math.floor(n/60),r=n%60;return`${String(i).padStart(2,"0")}:${String(r).padStart(2,"0")}`},W=({audioLevel:e,isMuted:t=!1})=>{const n=(0,s().useRef)(0),[i,r]=(0,s().useState)(0);(0,s().useEffect)(()=>{const t=5*e*.3+.7*n.current;(Math.abs(t-n.current)>.02||e<.005)&&(n.current=t,r(t))},[e]);const o=Math.min(1,Math.max(0,i)),l=i>.03;return(0,a().jsx)("div",{className:"flex h-9 w-9 items-center justify-center gap-[2px]",children:[.4,.7,1,.7,.4].map((e,n)=>{const i=l?Math.max(.25,Math.min(.95,.25+o*e*.7)):.15;return(0,a().jsx)("span",{className:"h-5 w-[2px] origin-center rounded-full transition-transform duration-150 "+(t?"bg-slate-400":"bg-emerald-500"),style:{transform:`scaleY(${i})`,opacity:l?.7+.3*o:.4}},n)})})},V=({className:e=""})=>(0,a().jsx)("svg",{className:`h-[18px] w-[18px] ${e}`,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a().jsx)("path",{d:"M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"})}),q=()=>(0,a().jsx)("svg",{className:"h-[18px] w-[18px]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,xmlns:"http://www.w3.org/2000/svg",children:(0,a().jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),G=()=>(0,a().jsxs)("div",{className:"relative h-5 w-5",children:[(0,a().jsx)(E,{className:"h-5 w-5"}),(0,a().jsx)("svg",{className:"absolute inset-0 h-5 w-5",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a().jsx)("path",{d:"M3 3L17 17",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round"})})]}),K=()=>(0,a().jsxs)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,a().jsx)("circle",{cx:"6",cy:"5",r:"1.5"}),(0,a().jsx)("circle",{cx:"12",cy:"5",r:"1.5"}),(0,a().jsx)("circle",{cx:"18",cy:"5",r:"1.5"}),(0,a().jsx)("circle",{cx:"6",cy:"10",r:"1.5"}),(0,a().jsx)("circle",{cx:"12",cy:"10",r:"1.5"}),(0,a().jsx)("circle",{cx:"18",cy:"10",r:"1.5"}),(0,a().jsx)("circle",{cx:"6",cy:"15",r:"1.5"}),(0,a().jsx)("circle",{cx:"12",cy:"15",r:"1.5"}),(0,a().jsx)("circle",{cx:"18",cy:"15",r:"1.5"}),(0,a().jsx)("circle",{cx:"12",cy:"20",r:"1.5"})]}),Y=[["1","2","3"],["4","5","6"],["7","8","9"],["*","0","#"]],Q=({onSendDigits:e})=>{const{t}=B(),[n,i]=(0,s().useState)(null);return(0,a().jsx)("div",{className:"grid grid-cols-3 gap-2 rounded-xl border border-slate-200/80 bg-white/90 p-3 shadow-sm backdrop-blur-md dark:border-slate-700/50 dark:bg-slate-900/80",role:"group","aria-label":t("audio_widget.dtmf.label"),children:Y.flat().map(t=>(0,a().jsx)("button",{type:"button",onClick:()=>(t=>{e(t),i(t),setTimeout(()=>i(null),150)})(t),className:"flex h-11 w-11 items-center justify-center rounded-lg text-base font-semibold transition-all duration-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400 focus-visible:ring-offset-1 active:scale-95 "+(n===t?"bg-sky-100 text-sky-700 dark:bg-sky-500/20 dark:text-sky-300":"bg-slate-100 text-slate-700 hover:bg-slate-200 dark:bg-slate-700/50 dark:text-slate-200 dark:hover:bg-slate-700"),"aria-label":t,children:t},t))})},J=({onStartCall:e,onEndCall:t,onToggleMute:n,isMuted:i,onSendDigits:r,onEvent:o})=>{const{t:l}=B(),[c,d]=(0,s().useState)("idle"),[u,h]=(0,s().useState)(""),[p,f]=(0,s().useState)(""),[g,m]=(0,s().useState)(0),[v,b]=(0,s().useState)(!1),[y,w]=(0,s().useState)(!1),[k,_]=(0,s().useState)(0),[S,x]=(0,s().useState)(!1),[C,T]=(0,s().useState)(!1),R=(0,s().useRef)(null),N=(0,s().useRef)(null),O=(0,s().useRef)(null),A=(0,s().useRef)(null),L=(0,s().useRef)(null);(0,s().useEffect)(()=>("connected"===c&&A.current?L.current=window.setInterval(()=>{A.current&&_(Math.floor((Date.now()-A.current)/1e3))},1e3):L.current&&(clearInterval(L.current),L.current=null),()=>{L.current&&clearInterval(L.current)}),[c]),(0,s().useEffect)(()=>{const e=o("any",({state:e,message:t,data:n})=>{switch(e){case"audio-level":{const e=n??t;let i;i="number"==typeof e?e:"string"==typeof e?parseFloat(e):Number(e),Number.isNaN(i)||m(Math.max(0,i));break}case"warning":t&&(f(t),R.current&&clearTimeout(R.current),R.current=window.setTimeout(()=>{f(""),R.current=null},5e3));break;case"warning-cleared":f(""),R.current&&(clearTimeout(R.current),R.current=null);break;case"remote-audio":N.current&&(clearTimeout(N.current),N.current=null),O.current&&(clearTimeout(O.current),O.current=null),b(!1),w(!1);break;case"error":d("error"),h(t||l("audio_widget.errors.generic")),b(!1),w(!1),_(0),A.current=null,O.current&&(clearTimeout(O.current),O.current=null),setTimeout(()=>{d("idle"),h("")},3e3)}});return()=>{e(),R.current&&clearTimeout(R.current)}},[o,l]),(0,s().useEffect)(()=>"connected"!==c?(N.current&&(clearTimeout(N.current),N.current=null),O.current&&(clearTimeout(O.current),O.current=null),void queueMicrotask(()=>{v&&b(!1),y&&w(!1)})):g>.04?(queueMicrotask(()=>{y||w(!0),v&&b(!1)}),N.current&&(clearTimeout(N.current),N.current=null),void(O.current&&(clearTimeout(O.current),O.current=null))):void(!y||v||N.current||(N.current=window.setTimeout(()=>{b(!0),N.current=null},1400))),[g,c,y,v]),(0,s().useEffect)(()=>()=>{N.current&&clearTimeout(N.current),O.current&&clearTimeout(O.current)},[]),(0,s().useEffect)(()=>{v?(O.current&&clearTimeout(O.current),O.current=window.setTimeout(()=>{b(!1),w(!1),O.current=null},4e3)):O.current&&(clearTimeout(O.current),O.current=null)},[v]);const D="connecting"===c,P="error"===c?"bg-rose-50/80 text-rose-600 border border-rose-200/60 shadow-[0_2px_8px_rgba(244,63,94,0.12)] dark:bg-rose-500/15 dark:text-rose-300 dark:border-rose-500/30":"connected"===c?"bg-emerald-50/80 text-emerald-600 border border-emerald-200/60 shadow-[0_2px_8px_rgba(16,185,129,0.15)] hover:bg-gradient-to-br hover:from-red-500 hover:to-red-600 hover:text-white hover:border-red-500/20 hover:shadow-[0_6px_20px_rgba(239,68,68,0.35)] dark:bg-emerald-500/15 dark:text-emerald-300 dark:border-emerald-500/30 dark:hover:from-red-600 dark:hover:to-red-700 transition-colors":"connecting"===c?"bg-sky-50/80 text-sky-600 border border-sky-200/60 shadow-[0_2px_8px_rgba(14,165,233,0.12)] dark:bg-sky-500/15 dark:text-sky-300 dark:border-sky-500/30":"bg-gradient-to-br from-emerald-500 to-emerald-600 text-white border border-emerald-500/20 shadow-[0_4px_14px_rgba(16,185,129,0.25)] hover:shadow-[0_6px_20px_rgba(16,185,129,0.35)] dark:from-emerald-600 dark:to-emerald-700 dark:border-emerald-500/30",M="error"===c?"border-t-rose-400/60 border-r-rose-300/30 border-b-transparent border-l-transparent":v?"border-t-sky-400/60 border-r-sky-300/30 border-b-transparent border-l-transparent":"border-t-sky-500/60 border-r-sky-400/30 border-b-transparent border-l-transparent",F=l("idle"===c?"audio_widget.status.ready":"connecting"===c?"audio_widget.status.connecting":"connected"===c?v?"audio_widget.status.thinking":"audio_widget.status.on_call":"audio_widget.status.error"),j="error"===c?"text-rose-500 dark:text-rose-400":"connected"===c?"text-emerald-500 dark:text-emerald-400":"connecting"===c?"text-sky-500 dark:text-sky-400":"text-slate-500 dark:text-slate-400",z=l("idle"===c||"error"===c?"audio_widget.actions.start":"connecting"===c?"audio_widget.actions.cancel":"audio_widget.actions.end"),U="idle"===c?l("audio_widget.sr.ready"):"connecting"===c?l("audio_widget.sr.connecting"):"connected"===c?l(v?"audio_widget.sr.connected_thinking":"audio_widget.sr.connected"):u?l("audio_widget.sr.error_with_message",{message:u}):l("audio_widget.sr.error");return(0,a().jsxs)("div",{className:"relative font-sans text-slate-800 antialiased dark:text-slate-100",children:[p&&(0,a().jsx)("div",{className:"absolute -top-14 left-1/2 w-max max-w-[18rem] -translate-x-1/2 rounded-full bg-amber-100/90 px-4 py-2 text-xs font-medium text-amber-800 shadow-lg shadow-amber-200/70 ring-1 ring-amber-300 backdrop-blur dark:bg-amber-500/15 dark:text-amber-200 dark:ring-amber-400/40",role:"status","aria-live":"polite",children:p}),(0,a().jsxs)("div",{className:"inline-flex min-w-[260px] items-center gap-3 rounded-2xl border border-slate-200/80 bg-white/90 px-5 py-3.5 shadow-sm backdrop-blur-md backdrop-saturate-150 transition-all duration-200 hover:shadow-md dark:border-slate-700/50 dark:bg-slate-900/80 dark:shadow-xl dark:shadow-slate-950/30",children:[(0,a().jsxs)("button",{type:"button",onClick:()=>{"idle"!==c&&"error"!==c?(N.current&&(clearTimeout(N.current),N.current=null),L.current&&(clearInterval(L.current),L.current=null),t(),d("idle"),m(0),b(!1),w(!1),_(0),x(!1),T(!1),A.current=null,O.current&&(clearTimeout(O.current),O.current=null)):(async()=>{try{d("connecting"),h(""),m(0),b(!1),w(!1),_(0),A.current=null,await e(),d("connected"),A.current=Date.now(),_(0)}catch(e){d("error"),b(!1),w(!1),h(e instanceof Error?e.message:l("audio_widget.errors.start_failed")),_(0),A.current=null}})()},className:`group relative flex h-12 w-12 shrink-0 items-center justify-center rounded-full transition-all duration-200 hover:scale-[1.05] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sky-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white active:scale-[0.98] dark:focus-visible:ring-offset-slate-950 ${P}`,"aria-label":z,title:"error"===c&&u?u:F,children:[(0,a().jsx)("span",{className:"sr-only",children:U}),"connected"===c?(0,a().jsxs)(a().Fragment,{children:[(0,a().jsx)("div",{className:"absolute inset-0 flex items-center justify-center transition-opacity duration-200 group-hover:opacity-0",children:(0,a().jsx)(W,{audioLevel:g,isMuted:S})}),(0,a().jsx)("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 transition-opacity duration-200 group-hover:opacity-100",children:(0,a().jsx)(I,{className:"h-5 w-5"})})]}):"error"===c?(0,a().jsx)(q,{}):(0,a().jsx)(V,{className:"idle"===c?"fill-white":"fill-sky-600 dark:fill-sky-300"}),D?(0,a().jsx)("span",{className:`pointer-events-none absolute inset-[-4px] rounded-full border border-transparent ${M} animate-spin`}):null]}),"connected"===c&&(0,a().jsx)("button",{type:"button",onClick:()=>{n(),x(i())},className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full transition-all duration-200 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 active:scale-95 "+(S?"bg-amber-100 text-amber-700 hover:bg-amber-200 focus-visible:ring-amber-400 dark:bg-amber-500/20 dark:text-amber-300 dark:hover:bg-amber-500/30":"bg-slate-100 text-slate-600 hover:bg-slate-200 focus-visible:ring-slate-400 dark:bg-slate-700/50 dark:text-slate-300 dark:hover:bg-slate-700"),"aria-label":l(S?"audio_widget.mute.unmute_microphone":"audio_widget.mute.mute_microphone"),title:l(S?"audio_widget.mute.unmute":"audio_widget.mute.mute"),children:S?(0,a().jsx)(G,{}):(0,a().jsx)(E,{className:"h-5 w-5"})}),"connected"===c&&(0,a().jsxs)("div",{className:"relative shrink-0",children:[(0,a().jsx)("button",{type:"button",onClick:()=>T(e=>!e),className:"flex h-12 w-12 items-center justify-center rounded-full transition-all duration-200 hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 active:scale-95 "+(C?"bg-sky-100 text-sky-700 hover:bg-sky-200 focus-visible:ring-sky-400 dark:bg-sky-500/20 dark:text-sky-300 dark:hover:bg-sky-500/30":"bg-slate-100 text-slate-600 hover:bg-slate-200 focus-visible:ring-slate-400 dark:bg-slate-700/50 dark:text-slate-300 dark:hover:bg-slate-700"),"aria-label":l("audio_widget.dtmf.toggle"),title:l("audio_widget.dtmf.toggle"),"aria-expanded":C,children:(0,a().jsx)(K,{})}),C&&(0,a().jsx)("div",{className:"absolute bottom-full left-1/2 mb-5 w-max -translate-x-1/2",children:(0,a().jsx)(Q,{onSendDigits:r})})]}),(0,a().jsxs)("div",{className:"relative flex flex-col gap-1 overflow-hidden leading-tight",children:[(0,a().jsx)("span",{className:`relative z-10 text-[0.65rem] font-medium uppercase tracking-[0.25em] ${j} transition-colors duration-200`,children:F}),"connected"===c&&(0,a().jsx)("span",{className:"animate-in fade-in slide-in-from-bottom-1 relative z-10 font-mono text-[0.8rem] text-slate-600 transition-all duration-500 dark:text-slate-400",children:H(k)})]})]})]})};function X(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}function Z(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((i=i.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;var ee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),te=new Uint8Array(16);function ne(){if(!ee)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee(te)}for(var ie=[],re=0;re<256;++re)ie[re]=(re+256).toString(16).substr(1);function oe(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var r=(e=e||{}).random||(e.rng||ne)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t)for(var o=0;o<16;++o)t[i+o]=r[o];return t||function(e){var t=0,n=ie;return[n[e[t++]],n[e[t++]],n[e[t++]],n[e[t++]],"-",n[e[t++]],n[e[t++]],"-",n[e[t++]],n[e[t++]],"-",n[e[t++]],n[e[t++]],"-",n[e[t++]],n[e[t++]],n[e[t++]],n[e[t++]],n[e[t++]],n[e[t++]]].join("")}(r)}const{SDP_CREATE_OFFER_FAILED:ae,SDP_CREATE_ANSWER_FAILED:se,SDP_SET_LOCAL_DESCRIPTION_FAILED:le,SDP_SET_REMOTE_DESCRIPTION_FAILED:ce,SDP_SEND_FAILED:de,MEDIA_MICROPHONE_PERMISSION_DENIED:ue,MEDIA_DEVICE_NOT_FOUND:he,MEDIA_GET_USER_MEDIA_FAILED:pe,UNABLE_READ_AUDIO_INPUT_ON_DEVICE_CHANGE:fe,HOLD_FAILED:ge,INVALID_CALL_PARAMETERS:me,BYE_SEND_FAILED:ve,SUBSCRIBE_FAILED:be,PEER_CLOSED_DURING_INIT:ye,WEBSOCKET_CONNECTION_FAILED:we,WEBSOCKET_ERROR:ke,RECONNECTION_EXHAUSTED:_e,GATEWAY_FAILED:Se,LOGIN_FAILED:xe,INVALID_CREDENTIALS:Ce,AUTHENTICATION_REQUIRED:Ee,ICE_RESTART_FAILED:Ie,NETWORK_OFFLINE:Te,SESSION_NOT_REATTACHED:Re,UNEXPECTED_ERROR:Ne}={SDP_CREATE_OFFER_FAILED:40001,SDP_CREATE_ANSWER_FAILED:40002,SDP_SET_LOCAL_DESCRIPTION_FAILED:40003,SDP_SET_REMOTE_DESCRIPTION_FAILED:40004,SDP_SEND_FAILED:40005,MEDIA_MICROPHONE_PERMISSION_DENIED:42001,MEDIA_DEVICE_NOT_FOUND:42002,MEDIA_GET_USER_MEDIA_FAILED:42003,UNABLE_READ_AUDIO_INPUT_ON_DEVICE_CHANGE:42004,HOLD_FAILED:44001,INVALID_CALL_PARAMETERS:44002,BYE_SEND_FAILED:44003,SUBSCRIBE_FAILED:44004,PEER_CLOSED_DURING_INIT:44005,WEBSOCKET_CONNECTION_FAILED:45001,WEBSOCKET_ERROR:45002,RECONNECTION_EXHAUSTED:45003,GATEWAY_FAILED:45004,LOGIN_FAILED:46001,INVALID_CREDENTIALS:46002,AUTHENTICATION_REQUIRED:46003,ICE_RESTART_FAILED:47001,NETWORK_OFFLINE:48001,SESSION_NOT_REATTACHED:48501,UNEXPECTED_ERROR:49001},{HIGH_RTT:Oe,HIGH_JITTER:Ae,HIGH_PACKET_LOSS:Le,LOW_MOS:De,LOW_LOCAL_AUDIO:Pe,LOW_INBOUND_AUDIO:Me,LOW_BYTES_RECEIVED:Fe,LOW_BYTES_SENT:je,RECORDING_UNAVAILABLE:ze,RECORDING_BUFFER_OVERFLOW:Ue,ICE_CONNECTIVITY_LOST:$e,ICE_GATHERING_TIMEOUT:Be,ICE_GATHERING_EMPTY:He,PEER_CONNECTION_FAILED:We,ONLY_HOST_ICE_CANDIDATES:Ve,ANSWER_WHILE_PEER_ACTIVE:qe,ICE_CANDIDATE_PAIR_CHANGED:Ge,AUDIO_INPUT_DEVICE_CHANGE_SKIPPED:Ke,MULTIPLE_ACTIVE_CALLS_DETECTED:Ye,DUPLICATE_INBOUND_ANSWER:Qe,SHARED_REMOTE_ELEMENT_OVERWRITE:Je,REMOTE_AUDIO_ELEMENT_UNRESOLVED:Xe,TOKEN_EXPIRING_SOON:Ze,UNKNOWN_REATTACHED_SESSION:et,SIGNALING_RECOVERY_REQUIRED:tt,MEDIA_RECOVERY_REQUIRED:nt,RECONNECTION_FAILED_WITH_NO_AUTO_RECONNECT:it}={HIGH_RTT:31001,HIGH_JITTER:31002,HIGH_PACKET_LOSS:31003,LOW_MOS:31004,LOW_LOCAL_AUDIO:31005,LOW_INBOUND_AUDIO:31006,LOW_BYTES_RECEIVED:32001,LOW_BYTES_SENT:32002,RECORDING_UNAVAILABLE:32003,RECORDING_BUFFER_OVERFLOW:32004,ICE_CONNECTIVITY_LOST:33001,ICE_GATHERING_TIMEOUT:33002,ICE_GATHERING_EMPTY:33003,PEER_CONNECTION_FAILED:33004,ONLY_HOST_ICE_CANDIDATES:33005,ANSWER_WHILE_PEER_ACTIVE:33006,ICE_CANDIDATE_PAIR_CHANGED:33008,AUDIO_INPUT_DEVICE_CHANGE_SKIPPED:33009,MULTIPLE_ACTIVE_CALLS_DETECTED:33010,DUPLICATE_INBOUND_ANSWER:33007,SHARED_REMOTE_ELEMENT_OVERWRITE:33011,REMOTE_AUDIO_ELEMENT_UNRESOLVED:33012,TOKEN_EXPIRING_SOON:34001,UNKNOWN_REATTACHED_SESSION:35002,SIGNALING_RECOVERY_REQUIRED:36003,MEDIA_RECOVERY_REQUIRED:36004,RECONNECTION_FAILED_WITH_NO_AUTO_RECONNECT:36005},rt="wss://rtc.telnyx.com",ot={NORMAL_CLOSURE:1e3,GOING_AWAY:1001,PROTOCOL_ERROR:1002,UNSUPPORTED_DATA:1003,NO_STATUS_RECEIVED:1005,ABNORMAL_CLOSURE:1006,INVALID_FRAME_PAYLOAD:1007,POLICY_VIOLATION:1008,MESSAGE_TOO_BIG:1009,INTERNAL_ERROR:1011},at={urls:"stun:stun.l.google.com:19302"},st=[{urls:"stun:stun.telnyx.com:3478"},at,{urls:"turn:turn.telnyx.com:3478?transport=udp",username:"testuser",credential:"testpassword"},{urls:"turn:turn.telnyx.com:3478?transport=tcp",username:"testuser",credential:"testpassword"},{urls:"turns:turn.telnyx.com:443",username:"testuser",credential:"testpassword"}],lt=[{urls:"stun:stundev.telnyx.com:3478"},at,{urls:"turn:turndev.telnyx.com:3478?transport=udp",username:"testuser",credential:"testpassword"},{urls:"turn:turndev.telnyx.com:3478?transport=tcp",username:"testuser",credential:"testpassword"},{urls:"turns:turndev.telnyx.com:443",username:"testuser",credential:"testpassword"}],ct=/^(turn:)turn(dev)?\.telnyx\.com(?=[:/?]|$)/;function dt(e,t){return e.replace(ct,`$1${t}.turn$2.telnyx.com`)}var ut,ht;(ht=ut||(ut={})).SocketOpen="telnyx.socket.open",ht.SocketClose="telnyx.socket.close",ht.SocketError="telnyx.socket.error",ht.SocketMessage="telnyx.socket.message",ht.SpeedTest="telnyx.internal.speedtest",ht.SocketActivity="telnyx.internal.socketActivity",ht.Ready="telnyx.ready",ht.Error="telnyx.error",ht.Warning="telnyx.warning",ht.Notification="telnyx.notification",ht.StatsFrame="telnyx.stats.frame",ht.StatsReport="telnyx.stats.report",ht.Messages="telnyx.messages",ht.Calls="telnyx.calls",ht.MediaError="telnyx.rtc.mediaError",ht.PeerConnectionFailureError="telnyx.rtc.peerConnectionFailureError",ht.PeerConnectionSignalingStateClosed="telnyx.rtc.peerConnectionSignalingStateClosed",ht.AIConversationMessage="telnyx.ai.conversation";const pt={40001:{name:"SDP_CREATE_OFFER_FAILED",message:"Failed to create call offer",description:"The browser was unable to generate a local SDP offer. This typically indicates a WebRTC API error or invalid media constraints.",causes:["Browser WebRTC API error","Missing or invalid media constraints"],solutions:["Check getUserMedia permissions","Verify ICE server configuration"],fatal:!0},40002:{name:"SDP_CREATE_ANSWER_FAILED",message:"Failed to answer the call",description:"The browser was unable to generate a local SDP answer. The remote offer may be invalid or the browser state inconsistent.",causes:["Browser WebRTC API error","Invalid remote SDP offer"],solutions:["Retry the call","Check browser WebRTC compatibility"],fatal:!0},40003:{name:"SDP_SET_LOCAL_DESCRIPTION_FAILED",message:"Failed to apply local call settings",description:"setLocalDescription() was rejected by the browser. The generated SDP may be malformed or the browser state may be inconsistent.",causes:["Malformed SDP","Browser state inconsistency"],solutions:["Retry the call"],fatal:!0},40004:{name:"SDP_SET_REMOTE_DESCRIPTION_FAILED",message:"Failed to apply remote call settings",description:"setRemoteDescription() was rejected by the browser. The remote SDP may be malformed or contain unsupported codecs.",causes:["Malformed remote SDP","Browser codec mismatch"],solutions:["Retry the call","Check codec configuration"],fatal:!0},40005:{name:"SDP_SEND_FAILED",message:"Failed to send call data to server",description:"The Invite or Answer message could not be delivered via the signaling WebSocket. The connection may have been lost.",causes:["WebSocket connection lost","Server error"],solutions:["Check network connectivity","Retry the call"],fatal:!0},42001:{name:"MEDIA_MICROPHONE_PERMISSION_DENIED",message:"Microphone access denied",description:"The user or operating system denied microphone permission. The browser permission prompt was dismissed or OS-level access is disabled.",causes:["User denied browser permission prompt","OS-level microphone access disabled"],solutions:["Ask user to grant microphone permission in browser settings"],fatal:!0},42002:{name:"MEDIA_DEVICE_NOT_FOUND",message:"No microphone found",description:"The requested audio input device is not available. No microphone is connected, the device was disconnected, or an invalid deviceId was specified.",causes:["No microphone connected","Device was disconnected","Invalid deviceId"],solutions:["Check that a microphone is connected","Select a valid audio input device"],fatal:!0},42003:{name:"MEDIA_GET_USER_MEDIA_FAILED",message:"Failed to access microphone",description:"getUserMedia() was rejected for an unexpected reason. The device may be in use by another application or the browser encountered an internal error.",causes:["Browser error","Device in use by another application"],solutions:["Close other applications using the microphone","Retry"],fatal:!0},42004:{name:"UNABLE_READ_AUDIO_INPUT_ON_DEVICE_CHANGE",message:"Unable to read audio input settings after device change",description:"The audio input track was replaced successfully, but reading its settings failed. The call continues with the new track and the recorded microphone ID falls back to default.",causes:["MediaStreamTrack.getSettings() threw after audio input replacement"],solutions:["No call restart is required; inspect the original error if device identification remains unavailable"],fatal:!1},44001:{name:"HOLD_FAILED",message:"Failed to hold the call",description:"The server rejected or did not respond to the hold request. The WebSocket connection may have been lost during the operation.",causes:["Server error","WebSocket connection lost during hold"],solutions:["Retry the hold operation","Check network connectivity"],fatal:!1},44002:{name:"INVALID_CALL_PARAMETERS",message:"Invalid call parameters",description:"The call could not be initiated because required parameters are missing or invalid. For example, no destination number was provided to newCall().",causes:["Missing destinationNumber in call options","Invalid or empty call parameters"],solutions:["Provide a valid destinationNumber when calling newCall()","Check the call options object for required fields"],fatal:!0},44003:{name:"BYE_SEND_FAILED",message:"Failed to hang up cleanly",description:"The hangup signal could not be delivered to the server. The call was terminated locally but the server may not be aware.",causes:["WebSocket connection lost before BYE sent"],solutions:["No action needed — call is terminated locally","Check network connectivity"],fatal:!1},44004:{name:"SUBSCRIBE_FAILED",message:"Failed to subscribe to call events",description:"The Verto subscribe request for the call channel failed. This may prevent receiving call state updates from the server.",causes:["WebSocket connection lost during subscribe","Server rejected the subscription request"],solutions:["Check network connectivity","Retry the call"],fatal:!1},44005:{name:"PEER_CLOSED_DURING_INIT",message:"Call was closed during setup",description:"The PeerConnection was closed (e.g. by hangup()) while peer.init() was still running. This is a race condition: an async operation such as setRemoteDescription, getUserMedia, or the media recovery flow yielded control, and close() ran during that gap. The init() cannot continue because the underlying RTCPeerConnection has been destroyed.",causes:["call.hangup() or call.close() was called while the call was still setting up","A WebSocket Bye message arrived during getUserMedia prompt or SDP negotiation","User clicked hangup/decline before media permissions were granted"],solutions:["This is expected if the user intentionally hung up during setup — no action needed","If this happens frequently without user action, check for automatic hangup triggers that may fire too early"],fatal:!0},45001:{name:"WEBSOCKET_CONNECTION_FAILED",message:"Unable to connect to server",description:"The WebSocket connection to the signaling server could not be established. The server may be unreachable, the URL may be incorrect, or a firewall may be blocking the connection.",causes:["Server unreachable","Incorrect WebSocket URL","Firewall blocking WebSocket connections","Network interruption"],solutions:["Check network connectivity","Verify the signaling server URL","Ensure WebSocket connections are not blocked by a firewall"],fatal:!0},45002:{name:"WEBSOCKET_ERROR",message:"Connection to server lost",description:"An error occurred on the WebSocket connection after it was established. The connection may have been dropped due to network issues or server-side closure.",causes:["Network interruption","Server closed the connection","Idle timeout"],solutions:["Check network connectivity","SDK will attempt automatic reconnection if configured"],fatal:!1},45003:{name:"RECONNECTION_EXHAUSTED",message:"Unable to reconnect to server",description:"All automatic reconnection attempts have been exhausted. The SDK tried to re-establish the WebSocket connection multiple times but failed on every attempt.",causes:["Prolonged network outage","Server unreachable","Firewall or proxy blocking reconnection"],solutions:["Check network connectivity","Call client.disconnect() and client.connect() to manually retry","Notify the user that the connection was lost"],fatal:!0},45004:{name:"GATEWAY_FAILED",message:"Gateway connection failed",description:"The upstream gateway reported a FAILED, FAIL_WAIT, or TIMEOUT state. The signaling server could not establish or maintain a connection to the gateway. When autoReconnect is disabled, this is immediately fatal. When enabled, the SDK will retry until RECONNECTION_EXHAUSTED.",causes:["Gateway down or unreachable","Server-side infrastructure issue","Network partition between signaling server and gateway"],solutions:["Wait for automatic reconnection (if autoReconnect is enabled)","Call client.disconnect() and client.connect() to manually retry","Check Telnyx service status"],fatal:!1},46001:{name:"LOGIN_FAILED",message:"Authentication failed",description:"The login request was rejected by the server. The credentials may be invalid, expired, or the account may be suspended.",causes:["Invalid credentials (username/password or token)","Expired authentication token","Account suspended or disabled"],solutions:["Verify credentials","Generate a new authentication token","Check account status"],fatal:!0},46002:{name:"INVALID_CREDENTIALS",message:"Invalid credential parameters",description:"The SDK rejected the login options before sending any request to the server. This is an internal client-side validation guard — the credentials object is missing required fields or has an invalid structure. No network request was made.",causes:["Missing login and password fields","Missing or malformed authentication token","Invalid combination of credential fields in the options object"],solutions:["Provide valid login/password or a valid authentication token","Check the TelnyxRTC constructor options against the documentation","Ensure the credential object matches one of the supported auth modes (credentials, token, or anonymous)"],fatal:!0},46003:{name:"AUTHENTICATION_REQUIRED",message:"Authentication required",description:"The server rejected a request because the session is not authenticated. This can happen when the client sends a message (e.g. Invite, Subscribe, or Ping) before login completes, after a token expires mid-session, or after the server drops the authenticated state for any reason.",causes:["Message sent before login completed","Authentication token expired during the session","Server-side session was invalidated","WebSocket reconnected but re-authentication did not complete"],solutions:["Ensure the client is fully logged in before sending messages","Re-authenticate using client.login() with fresh credentials","Listen for telnyx.ready before making calls or sending requests"],fatal:!1},47001:{name:"ICE_RESTART_FAILED",message:"ICE restart failed",description:"The ICE restart Modify request could not be sent or the server returned an error. The media path could not be recovered via ICE restart.",causes:["WebSocket connection lost during ICE restart","Server rejected the Modify request","Timeout waiting for server response"],solutions:["The call may recover via WebSocket reconnect + Attach","If the call does not recover, hang up and retry"],fatal:!1},48001:{name:"NETWORK_OFFLINE",message:"Device is offline",description:"The browser reported that the device has lost network connectivity (navigator.onLine === false). All WebSocket and media connections will fail until the network is restored.",causes:["Wi-Fi or ethernet disconnected","Airplane mode enabled","Network interface went down"],solutions:["Check network connectivity","Reconnect to Wi-Fi or ethernet","Disable airplane mode"],fatal:!1},48501:{name:"SESSION_NOT_REATTACHED",message:"Active call lost after reconnect",description:"The WebSocket reconnected successfully but the server did not reattach the active call session. The server no longer knows about the call, so any subsequent call-control operation (hangup, hold, etc.) will fail with CALL_DOES_NOT_EXIST. The call is unrecoverable and must be terminated locally.",causes:["Server-side session expired during the disconnection window","Reconnect token was invalidated","Backend restarted or lost in-memory call state"],solutions:["Terminate the local call and notify the user","Start a new call","Investigate why the session was not preserved on the server"],fatal:!0},49001:{name:"UNEXPECTED_ERROR",message:"An unexpected error occurred",description:"An error was thrown that does not match any known SDK error category. This is a catch-all for unclassified failures.",causes:["Unknown or unhandled error condition"],solutions:["Check the originalError property for the underlying cause","Report the issue if it persists"],fatal:!0}},ft={31001:{name:"HIGH_RTT",message:"High network latency detected",description:"Round-trip time (RTT) exceeded the threshold for multiple consecutive samples. High latency causes perceptible audio delays.",causes:["Poor network connection","Geographic distance to media server","Network congestion"],solutions:["Check network connectivity","Use a wired connection instead of Wi-Fi","Close bandwidth-heavy applications"]},31002:{name:"HIGH_JITTER",message:"High jitter detected",description:"Jitter (variability in packet arrival time) exceeded the threshold for multiple consecutive samples. High jitter causes crackling and choppy audio.",causes:["Network congestion","Unstable Wi-Fi connection","Overloaded network equipment"],solutions:["Use a wired connection instead of Wi-Fi","Close bandwidth-heavy applications","Check network equipment"]},31003:{name:"HIGH_PACKET_LOSS",message:"High packet loss detected",description:"Packet loss exceeded the threshold for multiple consecutive samples. High packet loss causes choppy audio or dropped calls.",causes:["Network congestion","Unstable connection","Firewall or QoS misconfiguration"],solutions:["Check network connectivity","Use a wired connection","Contact network administrator"]},31004:{name:"LOW_MOS",message:"Low call quality score",description:"Mean Opinion Score (MOS) dropped below the acceptable threshold for multiple consecutive samples. This is a composite indicator of overall call quality.",causes:["Combination of high latency, jitter, and/or packet loss","Poor network conditions"],solutions:["Check network connectivity","Use a wired connection","Close bandwidth-heavy applications"]},31005:{name:"LOW_LOCAL_AUDIO",message:"Low local microphone audio detected",description:"Local outbound audio level stayed below the acceptable threshold before the microphone produced real audio, or stayed silent for a long continuous window after audio was confirmed. This may indicate that the microphone is not capturing enough audio even while RTP is being sent.",causes:["Microphone input level is too low","Wrong microphone selected","Microphone is obstructed or too far from the speaker","Operating system input gain is muted or very low"],solutions:["Check the selected microphone","Increase microphone input gain","Move closer to the microphone","Verify the microphone is not muted at the operating system or hardware level"]},31006:{name:"LOW_INBOUND_AUDIO",message:"Low inbound audio detected",description:"Inbound (remote) audio level stayed below the acceptable threshold for multiple consecutive stats intervals while RTP packets continued to flow. This may indicate the remote party is sending silence or comfort-noise (e.g. one-way audio caused by a media bridge issue), as opposed to LOW_BYTES_RECEIVED which fires when no bytes arrive at all.",causes:["Remote party microphone is muted or capturing very low audio","Media bridge or PBX is injecting comfort-noise/silence instead of forwarding real audio","One-way audio where RTP flows but content is silent (server-side media issue)","Remote party is on hold or not speaking"],solutions:["Verify the remote party is not muted and is actively speaking","Check the media bridge / PBX for comfort-noise injection or transcoding issues","Inspect PCAP RTP payload uniqueness to distinguish real audio from comfort-noise","If the issue persists, report the call for server-side media investigation"]},32001:{name:"LOW_BYTES_RECEIVED",message:"No audio data received",description:"No bytes have been received from the remote party for multiple consecutive seconds. This may indicate a network interruption or remote-side issue.",causes:["Network interruption","Remote party microphone issue","Firewall blocking inbound media"],solutions:["Check network connectivity","Ask remote party to check their microphone","Check firewall rules for media ports"]},32002:{name:"LOW_BYTES_SENT",message:"No audio data being sent",description:"No bytes have been sent for multiple consecutive seconds. This may indicate a local microphone issue or network interruption.",causes:["Microphone muted or disconnected","Network interruption","Local media track ended"],solutions:["Check that the microphone is not muted","Verify the microphone is still connected","Check network connectivity"]},32003:{name:"RECORDING_UNAVAILABLE",message:"Call recording is not available in this browser",description:"Call recording was enabled (enableCallRecording is true), but the browser does not support MediaStreamTrackProcessor (required to capture raw audio PCM). Recording is disabled for this call; the call proceeds normally. Currently affects Firefox and older Chromium (< 94).",causes:["Browser does not implement MediaStreamTrackProcessor (Firefox, Safari)","Chromium version older than 94","Recording enabled on an unsupported platform"],solutions:["Use a recent Chromium-based browser (Chrome 94+, Edge 94+) to capture recordings","Disable enableCallRecording if recording is not required for this deployment","See the enableCallRecording JSDoc for platform support details"]},32004:{name:"RECORDING_BUFFER_OVERFLOW",message:"Call recording buffer overflow — oldest packets dropped",description:"The in-memory call recording buffer reached its maxBufferBytes cap before the next scheduled flush. The oldest captured RTP packets were dropped to keep memory bounded. This indicates the flush interval is too long for the call audio rate, or the upload endpoint is slow/unreachable. The recording continues with the remaining (newer) packets.",causes:["Flush interval (callRecordingFlushIntervalMs) is larger than the buffer can hold at the current audio rate","Upload endpoint (/call_recording) is slow or unreachable, so intermediate flushes back up","A very long call with high sample rate filling the buffer between flushes"],solutions:["Reduce callRecordingFlushIntervalMs so flushes happen more frequently","Increase callRecordingMaxBufferBytes if memory headroom allows","Check the /call_recording endpoint health and network path to voice-sdk-proxy"]},33001:{name:"ICE_CONNECTIVITY_LOST",message:"Connection interrupted",description:"The ICE connection transitioned to the disconnected state. The previously selected connection path was lost and renegotiation may be required. The connection may recover automatically.",causes:["Temporary network interruption","Network interface change (e.g. Wi-Fi to cellular)","NAT rebinding"],solutions:["Wait for automatic recovery","Check network connectivity"]},33002:{name:"ICE_GATHERING_TIMEOUT",message:"ICE gathering timed out",description:"ICE candidate gathering did not complete within the safety timeout. This is typically caused by network restrictions blocking STUN/TURN. The call may still succeed if candidates arrive late.",causes:["Firewall blocking STUN/TURN","Network unreachable","STUN/TURN server not responding"],solutions:["Check STUN/TURN server reachability","Ensure UDP traffic is not blocked","Try forceRelayCandidate option"]},33003:{name:"ICE_GATHERING_EMPTY",message:"No ICE candidates gathered",description:"No ICE candidates were gathered after sending the initial SDP. This may indicate a firewall blocking all STUN/TURN traffic or no available network interface.",causes:["Firewall blocking all STUN/TURN traffic","No network interface available","VPN blocking UDP"],solutions:["Check STUN/TURN server reachability","Ensure UDP traffic is not blocked","Use forceRelayCandidate option"]},33004:{name:"PEER_CONNECTION_FAILED",message:"Connection failed",description:"RTCPeerConnection entered the failed state. This is a recoverable condition — the SDK may attempt ICE restart or the connection may recover. If it does not recover, the call will eventually be terminated.",causes:["ICE failure","DTLS handshake failure","Prolonged network interruption"],solutions:["Wait for automatic recovery","Check network connectivity","Verify TURN server credentials"]},33005:{name:"ONLY_HOST_ICE_CANDIDATES",message:"Only local network candidates available",description:"ICE gathering completed with host (local network) candidates only. This is diagnostic evidence that no server-reflexive (srflx), peer-reflexive (prflx), or relay (TURN) candidates were found; connectivity may still succeed, but network traversal options can be limited.",causes:["STUN/TURN servers unreachable","Firewall blocking UDP traffic to STUN/TURN servers","Incorrect TURN server configuration or credentials","Restrictive corporate network or VPN"],solutions:["Verify STUN/TURN server URLs and credentials","Ensure UDP traffic to STUN/TURN ports is not blocked","Check firewall or VPN settings","Try using TCP-based TURN as a fallback"]},33006:{name:"ANSWER_WHILE_PEER_ACTIVE",message:"Call answer ignored because a peer connection is already active",description:"answer() was called on a call that already has an active or connecting peer connection. Creating a second peer connection for the same call would duplicate media negotiation, confuse the remote party, and break call reporting. This is typically caused by application code invoking answer() multiple times (e.g. from multiple event handlers).",causes:["Application called answer() twice on the same call object","Multiple click handlers or event listeners triggering answer()"],solutions:["Ensure answer() is called only once per call","Disable the answer button after the first click","Check that answer() is not invoked from multiple event handlers"]},33008:{name:"ICE_CANDIDATE_PAIR_CHANGED",message:"ICE candidate pair changed mid-call",description:"The selected ICE candidate pair changed during an active call. This indicates a network path shift — for example, a Wi-Fi to cellular handoff, a NAT rebinding, or a relay fallback. The call may continue normally, but the path change can briefly affect audio quality.",causes:["Network interface change (e.g. Wi-Fi to cellular)","NAT rebinding or IP address change","Previous candidate pair failed and ICE selected an alternative","Network topology change"],solutions:["Monitor for audio quality degradation after the path change","Check network stability if changes are frequent","Verify TURN server configuration for relay fallback"]},33007:{name:"DUPLICATE_INBOUND_ANSWER",message:"Call answer ignored because another inbound call is already being answered",description:"answer() was called on an inbound call while another inbound call is already answering or active in this JavaScript runtime. Answering both legs can trigger SIP 486 USER_BUSY / LOSE_RACE when duplicate WebSocket registrations receive the same incoming call.",causes:["Multiple TelnyxRTC instances in the same page","Application code recreating a client without disconnecting the previous instance","Duplicate inbound call notifications produced by duplicate WebSocket registrations"],solutions:["Keep a single active TelnyxRTC instance for inbound call handling","Call disconnect() before replacing an SDK client instance","Only call answer() for one inbound call notification at a time"]},34001:{name:"TOKEN_EXPIRING_SOON",message:"Authentication token expiring soon",description:"The authentication token is approaching its expiration time. If the token expires the connection will be lost and calls will fail. A new token should be generated before expiration.",causes:["Token was issued with a limited lifetime"],solutions:["Generate a new authentication token","Reconnect with fresh credentials before the token expires"]},36003:{name:"SIGNALING_RECOVERY_REQUIRED",message:"Signaling recovery required",description:"The signaling (WebSocket) path has been detected as unhealthy and the SDK will force-close the socket and reconnect. The source field in the warning payload indicates what triggered the recovery (probe, request, peer_failure, or no_rtp). Active calls will be recovered via reattach after reconnection.",causes:["WebSocket probe timed out with no response","Critical signaling request timed out","Peer/media failure detected while signaling is also unhealthy"],solutions:["The SDK will automatically reconnect and recover the call","Check for network interface changes or interruptions","Verify firewall/NAT timeout settings"]},36004:{name:"MEDIA_RECOVERY_REQUIRED",message:"Media recovery required",description:"The peer connection or media flow has been detected as unhealthy while signaling is healthy. The SDK will attempt ICE restart to recover the media path. No socket reconnection is needed.",causes:["ICE connection state changed to failed","RTCPeerConnection state changed to failed","No RTP packets/bytes received while media should be active"],solutions:["The SDK will automatically attempt ICE restart","Check network connectivity and ICE candidate availability","Verify TURN server configuration"]},36005:{name:"RECONNECTION_FAILED_WITH_NO_AUTO_RECONNECT",message:"Reconnection failed — auto-reconnect disabled",description:"The WebSocket was closed and auto-reconnect is disabled, so the SDK will not attempt to reconnect. This typically occurs after the user called disconnect() or after reconnection attempts were exhausted.",causes:["Auto-reconnect was disabled by the application","Reconnection attempts were previously exhausted","The session was intentionally disconnected"],solutions:["Call connect() manually to re-establish the session","Check if disconnect() was called intentionally","Review maxReconnectAttempts configuration"]},33009:{name:"AUDIO_INPUT_DEVICE_CHANGE_SKIPPED",message:"Audio input device change skipped",description:"The SDK could not change the microphone because the active peer connection has no audio RTP sender to replace. The existing local media and mute state were left unchanged.",causes:["The call was created without an audio sender","The peer connection was not ready when setAudioInDevice was called","The call is already ending or the local media sender was removed"],solutions:["Retry after the call is active and local media is attached","Verify the call was started with audio enabled","Inspect call state and peer connection sender availability"]},33010:{name:"MULTIPLE_ACTIVE_CALLS_DETECTED",message:"Multiple active calls detected in one SDK session",description:"A new call was created or received while another call is still active (ringing, answering, active, held, or recovering) in the same SDK session. This may be intentional for some applications (e.g. call waiting, transfer) but is often abnormal and makes call reports and application behavior harder to reason about. The new call proceeds normally — this warning is diagnostic only.",causes:["Application created an outbound call while another call is active","An inbound call arrived while another call is already active","Application did not hang up the previous call before starting a new one","Call waiting or multi-call scenario (may be intentional)"],solutions:["Verify this is the expected behavior for your application","Ensure the previous call is hung up before creating a new one if only one call is expected","Use call.hold() before starting a new call if needed","Check the warning payload for call IDs to correlate which calls are involved"]},33011:{name:"SHARED_REMOTE_ELEMENT_OVERWRITE",message:"Remote media element overwritten by another call",description:"A new MediaStream was attached to an HTML media element (audio/video) that already held a different MediaStream from another active call. The SDK overwrote the existing stream (last-writer-wins), which disrupts the other call remote media playout. This happens when two concurrent calls share a single remoteElement instead of each having its own. Use a per-call remoteElement (client.newCall({ remoteElement }) or call.answer({ remoteElement })) so each call owns a distinct element.",causes:["Two concurrent calls share one remoteElement (legacy single-element app)","Application did not pass a per-call remoteElement to newCall() or answer()","A second inbound call rang into a session using one session-level remoteElement"],solutions:["Pass a distinct remoteElement per call via client.newCall({ remoteElement })","For inbound calls, override at answer time via call.answer({ remoteElement })","Give each call its own <audio>/<video> element so attach/detach lifecycles are independent"]},33012:{name:"REMOTE_AUDIO_ELEMENT_UNRESOLVED",message:"Configured remote media element could not be resolved",description:"A remote audio track arrived, but the configured call-level or session-level remoteElement did not resolve to an <audio> or <video> element, so the SDK could not attach it for playout. The call is not affected and the remote MediaStream is still available on call.remoteStream. This warning is not emitted when remoteElement is left unset, since the application is then expected to play call.remoteStream itself.",causes:["remoteElement is a string ID with no matching element in the DOM","client.remoteElement was set to a string ID before that element existed (session-level IDs are resolved when set)","A remoteElement resolver function returned null or undefined (or its promise did, or rejected)","remoteElement resolved to an element that is not <audio> or <video>"],solutions:["Make sure the element exists before setting client.remoteElement or starting/answering the call","Pass a per-call remoteElement via client.newCall({ remoteElement }) or call.answer({ remoteElement })","Use an <audio> or <video> element as remoteElement","To play call.remoteStream in your own element instead, leave remoteElement unset"]},35002:{name:"UNKNOWN_REATTACHED_SESSION",message:"Unknown reattach session after reconnect",description:"The WebSocket reconnected successfully and the server sent an Attach message for a session that does not match any active SDK call. The unknown Attach is ACK'd and ignored.",causes:["Server sent an Attach for a call that no longer exists in the SDK","Multiple Attach messages arrived and only the first was recovered","Race condition between reconnection and new inbound call"],solutions:["Check application logic for multiple simultaneous calls","Inspect the Attach callID in the warning payload for details","If a call should be active, start a new call manually"]}};function gt(e,t){const n=ft[e];return{code:e,name:n.name,message:t||n.message,description:n.description,causes:[...n.causes],solutions:[...n.solutions]}}class mt extends Error{constructor(e){super(e.message||`[${e.code}] ${e.name}`),this.name=e.name,this.code=e.code,this.description=e.description,this.causes=e.causes,this.solutions=e.solutions,this.originalError=e.originalError,this.fatal=e.fatal,Object.setPrototypeOf(this,mt.prototype)}toJSON(){return{code:this.code,name:this.name,description:this.description,message:this.message,causes:this.causes,solutions:this.solutions,originalError:this.originalError,fatal:this.fatal}}}function vt(e){if(e instanceof DOMException){if("NotAllowedError"===e.name)return ue;if("NotFoundError"===e.name||"OverconstrainedError"===e.name)return he}return pe}function bt(e,t,n,i){const r=pt[e],o=t instanceof Error?t:void 0!==t?new Error(String(t)):void 0;return new mt({code:e,name:r.name,description:r.description,message:n||r.message,causes:[...r.causes],solutions:[...r.solutions],originalError:o,fatal:null!=i?i:r.fatal})}class yt extends Error{constructor(e,t,n=""){super(`Signaling request timed out (id=${e}, method=${n||"unknown"}, timeout=${t}ms)`),this.name="RequestTimeoutError",this.requestId=e,this.timeoutMs=t,this.method=n}}class wt extends Error{constructor(e,t,n){super(`Stale request cancelled (id=${e}, gen=${t}, current=${n})`),this.name="StaleRequestError",this.requestId=e,this.staleGeneration=t,this.currentGeneration=n}}var kt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};function _t(e,t){return e(t={exports:{}},t.exports),t.exports}var St=_t(function(e){var t,n;t=kt,n=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function r(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(t,n){for(var r=0;r<i.length;r++){var o=i[r];this[o]=r<t?e:this.methodFactory(o,t,n)}this.log=this.debug}function s(e,n,i){return function(){typeof console!==t&&(a.call(this,n,i),this[e].apply(this,arguments))}}function l(i,a,l){return function(i){return"debug"===i&&(i="log"),typeof console!==t&&("trace"===i&&n?o:void 0!==console[i]?r(console,i):void 0!==console.log?r(console,"log"):e)}(i)||s.apply(this,arguments)}function c(e,n,r){var o,s=this;n=n??"WARN";var c="loglevel";function d(){var e;if(typeof window!==t&&c){try{e=window.localStorage[c]}catch(e){}if(typeof e===t)try{var n=window.document.cookie,i=n.indexOf(encodeURIComponent(c)+"=");-1!==i&&(e=/^([^;]+)/.exec(n.slice(i))[1])}catch(e){}return void 0===s.levels[e]&&(e=void 0),e}}"string"==typeof e?c+=":"+e:"symbol"==typeof e&&(c=void 0),s.name=e,s.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},s.methodFactory=r||l,s.getLevel=function(){return o},s.setLevel=function(n,r){if("string"==typeof n&&void 0!==s.levels[n.toUpperCase()]&&(n=s.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=s.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(o=n,!1!==r&&function(e){var n=(i[e]||"silent").toUpperCase();if(typeof window!==t&&c){try{return void(window.localStorage[c]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+n+";"}catch(e){}}}(n),a.call(s,n,e),typeof console===t&&n<s.levels.SILENT)return"No console available for logging"},s.setDefaultLevel=function(e){n=e,d()||s.setLevel(e,!1)},s.resetLevel=function(){s.setLevel(n,!1),function(){if(typeof window!==t&&c){try{return void window.localStorage.removeItem(c)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},s.enableAll=function(e){s.setLevel(s.levels.TRACE,e)},s.disableAll=function(e){s.setLevel(s.levels.SILENT,e)};var u=d();null==u&&(u=n),s.setLevel(u,!1)}var d=new c,u={};d.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=u[e];return t||(t=u[e]=new c(e,d.getLevel(),d.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return d.noConflict=function(){return typeof window!==t&&window.log===d&&(window.log=h),d},d.getLoggers=function(){return u},d.default=d,d},e.exports?e.exports=n():t.log=n()});const xt={debug:0,info:1,warn:2,error:3};class Ct{constructor(e={}){var t,n,i;this.buffer=[],this.isCapturing=!1,this.options={enabled:null!==(t=e.enabled)&&void 0!==t&&t,level:null!==(n=e.level)&&void 0!==n?n:"debug",maxEntries:null!==(i=e.maxEntries)&&void 0!==i?i:1e3}}start(){this.options.enabled&&(this.isCapturing=!0,this.buffer=[])}stop(){this.isCapturing=!1}addEntry(e,t,n){if(!this.isCapturing||!this.options.enabled)return;if(xt[e]<xt[this.options.level])return;const i=Object.assign({timestamp:(new Date).toISOString(),level:e,message:t},n&&Object.keys(n).length>0?{context:n}:{});this.buffer.push(i),this.buffer.length>this.options.maxEntries&&this.buffer.shift()}getLogs(){return[...this.buffer]}getLogCount(){return this.buffer.length}drain(){const e=this.buffer;return this.buffer=[],e}clear(){this.buffer=[]}isActive(){return this.isCapturing}isEnabled(){return this.options.enabled}}let Et=null;const It=St.getLogger("telnyx"),Tt={trace:0,debug:1,info:2,warn:3,error:4};let Rt=Tt.info;function Nt(e){if(null==e)return e;if("object"!=typeof e)return e;try{const t=JSON.stringify(e),n=JSON.parse(t);if("object"==typeof n&&null!==n&&Object.keys(n).length>1)return n}catch(e){}const t={};for(const n in e)try{const i=e[n];if("function"==typeof i)continue;if("object"==typeof i&&null!==i)try{t[n]=JSON.parse(JSON.stringify(i))}catch(e){t[n]=String(i)}else t[n]=i}catch(e){}return Object.keys(t).length>0?t:{value:String(e)}}const Ot=It.methodFactory;It.methodFactory=(e,t,n)=>{const i=Ot(e,t,n);return function(...t){if(Tt[e]>=Rt){const e=[(new Date).toISOString().replace("T"," ").replace("Z",""),"-"];for(const n of t)e.push(n);i(...e)}const n=Et;if(null==n?void 0:n.isActive()){const[i,...r]=t,o="string"==typeof i?i:JSON.stringify(i);let a;r.length>0&&(a=1===r.length&&"object"==typeof r[0]&&null!==r[0]?Nt(r[0]):{args:r.map(Nt)}),n.addEntry(e,o,a)}}},It.setLevel("debug",!1);const At=e=>{const[t,n,i,r,o,a]=e;let s={};try{s=JSON.parse(o.replace(/ID"/g,'Id"'))}catch(e){It.warn("Verto LA invalid media JSON string:",o)}return{participantId:Number(t),participantNumber:n,participantName:i,codec:r,media:s,participantData:a}},Lt=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}},Dt=e=>e instanceof Function||"function"==typeof e,Pt=e=>{var t;if("undefined"!=typeof HTMLMediaElement&&e instanceof HTMLMediaElement)return!0;const n=Mt(e)?null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView:null;return!!((null==n?void 0:n.HTMLMediaElement)&&e instanceof n.HTMLMediaElement)&&(It.info("Using a media element owned by another window (iframe, popout or Picture-in-Picture)"),!0)},Mt=e=>"object"==typeof e&&null!==e&&"ownerDocument"in e,Ft=e=>"object"==typeof document&&"getElementById"in document?"string"==typeof e?document.getElementById(e)||null:"function"==typeof e?e():Pt(e)?e:null:null,jt=/^(ws|wss):\/\//,zt=(e,t=null)=>{const{result:n={},error:i}=e;if(i)return{error:i};const{result:r=null}=n;if(null===r)return null!==t&&(n.node_id=t),{result:n};const{code:o=null,node_id:a=null,result:s=null}=r;return o&&"200"!==o?{error:r}:s?zt(s,a):{result:r}},Ut=({login:e,passwd:t,password:n,login_token:i})=>Boolean(e&&(t||n)||i),$t=({anonymous_login:e})=>Boolean(e)&&Boolean(e.target_id)&&Boolean(e.target_type),Bt=e=>{var t,n,i,r,o,a;let s="",l="";return(null===(n=null===(t=null==e?void 0:e.result)||void 0===t?void 0:t.params)||void 0===n?void 0:n.state)&&(s=null===(r=null===(i=null==e?void 0:e.result)||void 0===i?void 0:i.params)||void 0===r?void 0:r.state),(null===(o=null==e?void 0:e.params)||void 0===o?void 0:o.state)&&(l=null===(a=null==e?void 0:e.params)||void 0===a?void 0:a.state),s||l};function Ht({debounceTime:e}){let t,n;return{promise:new Promise((i,r)=>{t=e?Wt(i,e):i,n=r}),resolve:t,reject:n}}const Wt=(e,t)=>{let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}},Vt="telnyx-voice-sdk-id",qt="telnyx-voice-sdk-id-canary-rtc-server",Gt="telnyx-voice-sdk-session-id",Kt="telnyx-voice-sdk-session-id-stored-at",Yt="telnyx-voice-sdk-active-calls";function Qt(e=Date.now()){const t=function(){const e=Number(sessionStorage.getItem(Kt));return Number.isFinite(e)?e:null}();return null!==t&&e-t<=9e4}function Jt(){return sessionStorage.getItem(Vt)}function Xt(){const e=tn(qt);return"true"===e||"false"!==e&&void 0}function Zt(e,t=Date.now()){sessionStorage.setItem(Gt,e),sessionStorage.setItem(Kt,String(t))}function en(){sessionStorage.removeItem(Vt),sessionStorage.removeItem(qt),sessionStorage.removeItem(Gt),sessionStorage.removeItem(Kt)}function tn(e){try{return sessionStorage.getItem(e)}catch(t){return It.debug(`safeGetItem('${e}') failed: ${t instanceof Error?t.message:String(t)}`),null}}function nn(){!function(e){try{sessionStorage.removeItem(e)}catch(t){It.debug(`safeRemoveItem('${e}') failed: ${t instanceof Error?t.message:String(t)}`)}}(Yt)}function rn(e=Date.now()){const t=tn(Yt);if(!t)return null;try{const n=JSON.parse(t);if(!n||"object"!=typeof n||!Array.isArray(n.calls))return It.debug("Active-calls recovery marker payload was malformed — discarded."),nn(),null;const i=Number(n.storedAt);return!Number.isFinite(i)||e-i>9e5?(It.debug("Active-calls recovery marker was stale or had an invalid timestamp — discarded."),nn(),null):0===n.calls.length?(It.debug("Active-calls recovery marker had no call records — discarded."),nn(),null):n}catch(e){return It.debug(`Active-calls recovery marker JSON parse failed — discarded: ${e instanceof Error?e.message:String(e)}`),nn(),null}}function on(e,t,n=Date.now()){if(!Array.isArray(e)||0===e.length)return void nn();const i={sessionId:t,calls:e,storedAt:n};!function(e,t){try{sessionStorage.setItem(e,t)}catch(t){It.info(`safeSetItem('${e}') failed: ${t instanceof Error?t.message:String(t)}`)}}(Yt,JSON.stringify(i))}var an,sn,ln;!function(e){e.Offer="offer",e.Answer="answer"}(an||(an={})),function(e){e.Inbound="inbound",e.Outbound="outbound"}(sn||(sn={})),function(e){e.Invite="telnyx_rtc.invite",e.Attach="telnyx_rtc.attach",e.Answer="telnyx_rtc.answer",e.Info="telnyx_rtc.info",e.Candidate="telnyx_rtc.candidate",e.EndOfCandidates="telnyx_rtc.endOfCandidates",e.Display="telnyx_rtc.display",e.Media="telnyx_rtc.media",e.Event="telnyx_rtc.event",e.Bye="telnyx_rtc.bye",e.Punt="telnyx_rtc.punt",e.Broadcast="telnyx_rtc.broadcast",e.Subscribe="telnyx_rtc.subscribe",e.Unsubscribe="telnyx_rtc.unsubscribe",e.ClientReady="telnyx_rtc.clientReady",e.Modify="telnyx_rtc.modify",e.Ringing="telnyx_rtc.ringing",e.GatewayState="telnyx_rtc.gatewayState",e.Ping="telnyx_rtc.ping",e.Pong="telnyx_rtc.pong"}(ln||(ln={}));const cn={generic:"event",[ln.Display]:"participantData",[ln.Attach]:"participantData",conferenceUpdate:"conferenceUpdate",callUpdate:"callUpdate",vertoClientReady:"vertoClientReady",userMediaError:"userMediaError",peerConnectionFailureError:"peerConnectionFailureError",signalingStateClosed:"signalingStateClosed"},dn=8e6,un={destinationNumber:"",remoteCallerName:"Outbound Call",remoteCallerNumber:"",callerName:"",callerNumber:"",audio:!0,useStereo:!1,debug:!1,debugOutput:"socket",attach:!1,screenShare:!1,userVariables:{},mediaSettings:{useSdpASBandwidthKbps:!1,sdpASBandwidthKbps:0},mutedMicOnStart:!1,prefetchIceCandidates:!1};var hn,pn,fn,gn,mn,vn;!function(e){e[e.New=0]="New",e[e.Requesting=1]="Requesting",e[e.Trying=2]="Trying",e[e.Recovering=3]="Recovering",e[e.Ringing=4]="Ringing",e[e.Answering=5]="Answering",e[e.Early=6]="Early",e[e.Active=7]="Active",e[e.Held=8]="Held",e[e.Hangup=9]="Hangup",e[e.Destroy=10]="Destroy",e[e.Purge=11]="Purge"}(hn||(hn={})),function(e){e.Participant="participant",e.Moderator="moderator"}(pn||(pn={})),function(e){e.Join="join",e.Leave="leave",e.Bootstrap="bootstrap",e.Add="add",e.Modify="modify",e.Delete="delete",e.Clear="clear",e.ChatMessage="chatMessage",e.LayerInfo="layerInfo",e.LogoInfo="logoInfo",e.LayoutInfo="layoutInfo",e.LayoutList="layoutList",e.ModCmdResponse="modCommandResponse"}(fn||(fn={})),function(e){e.Video="videoinput",e.AudioIn="audioinput",e.AudioOut="audiooutput"}(gn||(gn={})),function(e){e.REGED="REGED",e.UNREGED="UNREGED",e.NOREG="NOREG",e.FAILED="FAILED",e.FAIL_WAIT="FAIL_WAIT",e.TIMEOUT="TIMEOUT",e.REGISTER="REGISTER",e.TRYING="TRYING",e.EXPIRED="EXPIRED",e.UNREGISTER="UNREGISTER"}(mn||(mn={})),function(e){e.Hold="hold",e.Unhold="unhold",e.ToggleHold="toggleHold",e.UpdateMedia="updateMedia"}(vn||(vn={}));const bn="GLOBAL",yn={},wn=(e,t)=>`${e}|${t}`,kn=(e,t=bn)=>wn(e,t)in yn,_n=(e,t,n=bn)=>{const i=wn(e,n);i in yn||(yn[i]=[]),yn[i].push(t)},Sn=(e,t,n=bn)=>{const i=function(r){xn(e,i,n),t(r)};return i.prototype.targetRef=t,_n(e,i,n)},xn=(e,t,n=bn)=>{if(!kn(e,n))return!1;const i=wn(e,n);if(Dt(t))for(let e=yn[i].length-1;e>=0;e--){const n=yn[i][e];(t===n||n.prototype&&t===n.prototype.targetRef)&&yn[i].splice(e,1)}else yn[i]=[];return 0===yn[i].length&&delete yn[i],!0},Cn=(e,t,n=bn,i=!0)=>{const r=i&&n!==bn;if(!kn(e,n))return r&&Cn(e,t),!1;const o=wn(e,n),a=yn[o].length;if(!a)return r&&Cn(e,t),!1;for(let e=a-1;e>=0;e--)yn[o][e](t);return r&&Cn(e,t),!0},En=e=>{const t=wn(e,"");Object.keys(yn).filter(e=>0===e.indexOf(t)).forEach(e=>delete yn[e])};let In="undefined"!=typeof WebSocket?WebSocket:null;class Tn{constructor(e){this.session=e,this.previousGatewayState="",this.lastInboundAt=0,this.socketGeneration=0,this._wsClient=null,this._host=rt,this._timers={},this._safetyTimeoutId=null,this._pendingRequestIds=new Set,this._pendingRequestTimers=new Map,this._pendingRequestRejecters=new Map,this.upDur=null,this.downDur=null;const{host:t,env:n,region:i,useCanaryRtcServer:r}=e.options;It.debug("Creating new Connection",{host:this._host,env:n,region:i,useCanaryRtcServer:r}),n&&(this._host="development"===n?"wss://rtcdev.telnyx.com":rt),t&&(this._host=(e=>`${jt.test(e)?"":"wss://"}${e}`)(t)),i&&(this._host=this._host.replace(/rtc(dev)?/,`${i}.rtc$1`))}get connected(){return!!this._wsClient&&1===this._wsClient.readyState}get connecting(){return!!this._wsClient&&0===this._wsClient.readyState}get closing(){return!!this._wsClient&&2===this._wsClient.readyState}get closed(){return!!this._wsClient&&3===this._wsClient.readyState}get isAlive(){return this.connecting||this.connected}get isDead(){return this.closing||this.closed}get host(){return this._host}connect(){var e,t;It.debug("Connection.connect() called",{host:this._host,socketGeneration:this.socketGeneration,sessionId:this.session.sessionid});const n=new URL(this._host),i=Jt();i!==this.session.reconnectTokenVoiceSdkId&&(this.session.reconnectTokenVoiceSdkId=i,this.session.reconnectTokenCanaryRtcServer=Xt());let r,o=this.session.reconnectTokenVoiceSdkId;this.session.options.rtcIp&&this.session.options.rtcPort&&(o=null,n.searchParams.set("rtc_ip",this.session.options.rtcIp),n.searchParams.set("rtc_port",this.session.options.rtcPort.toString())),o&&n.searchParams.set("voice_sdk_id",o),this.session.options.rtcIp&&this.session.options.rtcPort||(r=this.session.options.useCanaryRtcServer,"boolean"==typeof r&&n.searchParams.set("canary",String(r)),o&&r!==this.session.reconnectTokenCanaryRtcServer&&(n.searchParams.delete("voice_sdk_id"),It.debug("Canary routing changed. Refreshing voice_sdk_id",{previous:this.session.reconnectTokenCanaryRtcServer,current:r}))),this.session.callReportVoiceSdkId=n.searchParams.get("voice_sdk_id"),this.session.options.skipLastVoiceSdkId&&n.searchParams.has("voice_sdk_id")&&n.searchParams.set("skip_last_voice_sdk_id","true"),this.session.options.skipTrailing&&n.searchParams.set("skip_trailing","true");try{const t=this.socketGeneration;null===(e=this.session._registrationTimings)||void 0===e||e.mark("create WebSocket",{generation:t+1}),this._wsClient=new In(n.toString()),this.socketGeneration+=1,It.debug("WebSocket connection created",{sessionId:this.session.sessionid,voiceSdkId:this.session.callReportVoiceSdkId,socketGeneration:this.socketGeneration,reconnectCount:t}),this.lastInboundAt=0,this._cleanupPendingRequests(),this._registerSocketEvents(this._wsClient,r)}catch(e){null===(t=this.session._registrationTimings)||void 0===t||t.mark("WebSocket construction failed"),It.error("WebSocket connection failed:",e);const n=bt(we,e);Cn(ut.Error,{error:n,sessionId:this.session.sessionid},this.session.uuid),this.session._terminateActiveCallsLocally()}}sendRawText(e){var t;null===(t=this._wsClient)||void 0===t||t.send(e)}send(e,t){var n,i;const{request:r}=e,o=this.socketGeneration,a=r.method||"",s=new Promise((e,n)=>{if(r.hasOwnProperty("result"))return e();let i=!1,s=null;const l=t=>{if(null!==s&&(clearTimeout(s),this._pendingRequestTimers.delete(r.id),s=null),this._pendingRequestIds.delete(r.id),this._pendingRequestRejecters.delete(r.id),this.session.onOutboundConfirmed(),i)return;const{result:o,error:a}=zt(t);return a?n(a):e(o)};Sn(r.id,l),this._pendingRequestIds.add(r.id),this._pendingRequestRejecters.set(r.id,{reject:n,generation:o}),t&&t>0&&(s=setTimeout(()=>{if(i=!0,s=null,this._pendingRequestTimers.delete(r.id),this._pendingRequestRejecters.delete(r.id),xn(r.id,l),this._pendingRequestIds.delete(r.id),this.socketGeneration!==o)return It.debug(`Stale request timeout for ${r.id} (gen ${o}, current ${this.socketGeneration}) — settling with StaleRequestError`),void n(new wt(r.id,o,this.socketGeneration));n(new yt(r.id,t,a))},t),this._pendingRequestTimers.set(r.id,s))});return It.debug("SEND: \n",JSON.stringify(r,null,2),"\n"),this.connected&&(null===(n=this.session._registrationTimings)||void 0===n||n.requestSent(r.id,a)),null===(i=this._wsClient)||void 0===i||i.send(JSON.stringify(r)),s}close(){if(It.debug("Connection.close() called",{hasWsClient:!!this._wsClient,closing:this.closing,closed:this.closed,socketGeneration:this.socketGeneration,safetyTimeoutId:this._safetyTimeoutId,sessionId:this.session.sessionid}),!this._wsClient||this.closing)return;this._cleanupPendingRequests();const e=this._wsClient;Dt(this._wsClient._beginClose)?this._wsClient._beginClose():this._wsClient.close(),this._safetyTimeoutId||(this._safetyTimeoutId=setTimeout(()=>this._handleCloseTimeout(e),5e3))}_registerSocketEvents(e,t){const n=this.socketGeneration,i=()=>e===this._wsClient&&n===this.socketGeneration&&this.session.connection===this;e.onopen=e=>{var t;return i()&&(null===(t=this.session._registrationTimings)||void 0===t||t.mark("WebSocket open",{generation:n})),It.debug("WebSocket onopen",{socketGeneration:this.socketGeneration,sessionId:this.session.sessionid}),Cn(ut.SocketOpen,e,this.session.uuid)},e.onclose=t=>{var r;return i()&&(null===(r=this.session._registrationTimings)||void 0===r||r.mark("WebSocket closed",{generation:n,code:null==t?void 0:t.code})),this._clearSafetyTimeout(),this._safetyCleanupSocket(e,"close"),It.debug("WebSocket onclose",{code:null==t?void 0:t.code,reason:null==t?void 0:t.reason,wasClean:null==t?void 0:t.wasClean,socketGeneration:n,sessionId:this.session.sessionid}),Cn(ut.SocketClose,{event:t,socketGeneration:n},this.session.uuid)},e.onerror=t=>{var r;i()&&(null===(r=this.session._registrationTimings)||void 0===r||r.mark("WebSocket error",{generation:n})),this._clearSafetyTimeout(),this._safetyCleanupSocket(e,"error"),It.debug("WebSocket onerror",{socketGeneration:this.socketGeneration,sessionId:this.session.sessionid});const o=bt(ke);return Cn(ut.Error,{error:o,sessionId:this.session.sessionid},this.session.uuid),Cn(ut.SocketError,{error:t,sessionId:this.session.sessionid,socketGeneration:n},this.session.uuid)},e.onmessage=i=>{var r,o,a;this.lastInboundAt=Date.now(),Cn(ut.SocketActivity,{timestamp:this.lastInboundAt},this.session.uuid);const s=Lt(i.data);if("string"==typeof s)return void this._handleStringResponse(s);const l=e===this._wsClient&&n===this.socketGeneration&&this.session.connection===this;var c,d;if(l&&(null===(r=this.session._registrationTimings)||void 0===r||r.responseReceived(s)),s.voice_sdk_id&&l&&(this.session.callReportVoiceSdkId=s.voice_sdk_id,this.session.reconnectTokenVoiceSdkId=s.voice_sdk_id,this.session.reconnectTokenCanaryRtcServer=t,c=s.voice_sdk_id,d=t,sessionStorage.setItem(Vt,c),"boolean"==typeof d?sessionStorage.setItem(qt,String(d)):sessionStorage.removeItem(qt)),this._unsetTimer(s.id),It.debug("RECV: \n",JSON.stringify(s,null,2),"\n"),mn[`${null===(a=null===(o=null==s?void 0:s.result)||void 0===o?void 0:o.params)||void 0===a?void 0:a.state}`]||!Cn(s.id,s)){const e=Bt(s);Cn(ut.SocketMessage,s,this.session.uuid),Boolean(e)&&(this.previousGatewayState=e)}}}_deregisterSocketEvents(e){e.onopen=null,e.onclose=null,e.onerror=null,e.onmessage=null}_handleCloseTimeout(e){this._safetyTimeoutId=null,e&&3!==e.readyState?(It.warn("Socket stuck in CLOSING after 5s — forcefully cleaning up"),this._deregisterSocketEvents(e),this._safetyCleanupSocket(e,"timeout"),this._wsClient&&this._wsClient!==e?It.debug("Safety timeout: socket was replaced, not emitting SocketClose",{hasWsClient:!!this._wsClient,isSameSocket:this._wsClient===e}):(It.debug("Safety timeout: emitting SocketClose for stuck socket",{hasWsClient:!!this._wsClient,isSameSocket:this._wsClient===e}),Cn(ut.SocketClose,{code:ot.ABNORMAL_CLOSURE,reason:"STUCK_WS_TIMEOUT: Socket got stuck in CLOSING state and was forcefully cleaned up by safety timeout",wasClean:!1,socketGeneration:this.socketGeneration},this.session.uuid))):It.warn("Safety timeout fired but socket is already closed or cleaned up")}_clearSafetyTimeout(){this._safetyTimeoutId&&(It.debug("Clearing safety timeout"),clearTimeout(this._safetyTimeoutId),this._safetyTimeoutId=null)}_safetyCleanupSocket(e,t){this._wsClient===e?(It.debug(`Nulling socket reference (reason: ${t})`),this._wsClient=null):It.debug(`Skipping socket cleanup - old socket already replaced (reason: ${t})`)}_cleanupPendingRequests(){Array.from(this._pendingRequestIds).forEach(e=>{xn(e);const t=this._pendingRequestTimers.get(e),n=this._pendingRequestRejecters.get(e);t&&(clearTimeout(t),this._pendingRequestTimers.delete(e),n&&n.reject(new wt(e,n.generation,this.socketGeneration))),this._pendingRequestRejecters.delete(e)}),this._pendingRequestIds.clear()}_unsetTimer(e){clearTimeout(this._timers[e]),delete this._timers[e]}_handleStringResponse(e){if(/^#SP/.test(e))switch(e[3]){case"U":this.upDur=parseInt(e.substring(4));break;case"D":this.downDur=parseInt(e.substring(4)),Cn(ut.SpeedTest,{upDur:this.upDur,downDur:this.downDur},this.session.uuid)}else It.warn("Unknown message from socket",e)}}Tn.DEFAULT_REQUEST_TIMEOUT_MS=1e4;class Rn{buildRequest(e){this.request=Object.assign({jsonrpc:"2.0",id:oe()},e)}buildNotification(e){this.request=Object.assign({jsonrpc:"2.0"},e)}}const Nn={id:"callID",destinationNumber:"destination_number",remoteCallerName:"remote_caller_id_name",remoteCallerNumber:"remote_caller_id_number",callerName:"caller_id_name",callerNumber:"caller_id_number",customHeaders:"custom_headers"};class On extends Rn{constructor(e={}){if(super(),e.hasOwnProperty("dialogParams")){const t=X(e.dialogParams,["remoteSdp","localStream","remoteStream","localElement","remoteElement","onNotification","camId","micId","speakerId"]);for(const e in Nn)e&&t.hasOwnProperty(e)&&(t[Nn[e]]=t[e],delete t[e]);e.dialogParams=t}this.buildRequest({method:this.toString(),params:e})}}class An extends On{constructor(e){super(),this.method=ln.GatewayState,this.buildRequest({method:this.method,voice_sdk_id:e,params:{}})}}class Ln{constructor(e){this.pendingRequestId=null,this.onSocketMessage=e=>Z(this,void 0,void 0,function*(){e.id===this.pendingRequestId&&this.gatewayStateTask.resolve(Bt(e))}),this.getIsRegistered=()=>Z(this,void 0,void 0,function*(){const e=new An(Jt());this.pendingRequestId=e.request.id,this.gatewayStateTask=Ht({}),this.session.execute(e);const t=yield this.gatewayStateTask.promise;return!!t&&[mn.REGISTER,mn.REGED].includes(t)}),this.session=e,this.gatewayStateTask=Ht({}),this.session.on("telnyx.socket.message",this.onSocketMessage)}}class Dn extends On{constructor(e){super(),this.method=ln.Ping,this.buildRequest({method:this.method,voice_sdk_id:e,params:{}})}}class Pn{constructor(e){this._session=e,this._lastInboundAt=0,this._lastOutboundConfirmedAt=0,this._lastProbeSentAt=0,this._probeInFlight=!1,this._intervalId=null,this._pendingMediaRecovery=null,this._browserWasOffline=!1,this._onlineHandler=null,this._offlineHandler=null}static isCriticalMethod(e){return Pn.CRITICAL_METHODS.has(e)}start(){this._intervalId||(It.debug("Signaling health: monitor started"),this._lastInboundAt=Date.now(),this._lastOutboundConfirmedAt=Date.now(),this._probeInFlight=!1,this._lastProbeSentAt=0,this._setupBrowserListeners(),this._intervalId=setInterval(()=>this._check(),3e3))}stop(){this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null,this._probeInFlight=!1,this._lastProbeSentAt=0),this._pendingMediaRecovery=null,this._cleanupBrowserListeners(),It.debug("Signaling health: monitor stopped")}get isRunning(){return null!==this._intervalId}get isProbeInFlight(){return this._probeInFlight}onSocketActivity(){this._lastInboundAt=Date.now()}onOutboundConfirmed(){this._lastOutboundConfirmedAt=Date.now()}_resolveProbe(){if(!this._probeInFlight)return;if(this._probeInFlight=!1,this._lastProbeSentAt=0,this._lastInboundAt=Date.now(),this._lastOutboundConfirmedAt=Date.now(),It.debug("Signaling health: probe resolved by matching Ping response"),!this._pendingMediaRecovery)return void It.debug("Signaling health: probe resolved but no pending media recovery");const e=this._pendingMediaRecovery;this._pendingMediaRecovery=null,"healthy"===this._getSignalingHealthState()&&(It.info(`Signaling health: signaling probe resolved, triggering pending ICE restart for call ${e.callId}`),this._triggerIceRestart(e.callId,e.reason))}_probeIfNeeded(e){var t;(null===(t=this._session.connection)||void 0===t?void 0:t.connected)&&(this._probeInFlight?It.debug(`Signaling health: probe already in flight, skipping duplicate probe (${e})`):(It.info(`Signaling health: ${e}, sending signaling probe`),this._sendProbe()))}onRequestTimeout(e,t,n=""){var i;(null===(i=this._session.connection)||void 0===i?void 0:i.connected)&&(Pn.isCriticalMethod(n)?(It.warn(`Critical signaling request timed out (id=${e}, method=${n}, timeout=${t}ms) — declaring signaling unhealthy`),this._triggerSignalingRecovery(`Critical signaling request timed out (method=${n}, id=${e}, timeout=${t}ms)`,"request")):It.warn(`Non-critical signaling request timed out (id=${e}, method=${n||"unknown"}, timeout=${t}ms) — logging but not triggering signaling recovery`))}onPeerFailure(e,t){It.warn(`Signaling health: peer failure reported (callId=${e}, evidence=${t})`),this._recoverMediaOrSignaling(e,`Peer connection failure (${t})`,`Peer failure detected (${t}) while signaling is unhealthy`,"peer_failure")}onNoRtp(e,t){It.warn(`Signaling health: no RTP detected (callId=${e}, direction=${t})`),this._recoverMediaOrSignaling(e,`No RTP ${t} while media should be active`,`No RTP ${t} while signaling is unhealthy`,"no_rtp")}_setupBrowserListeners(){"undefined"==typeof window||this._onlineHandler||(this._onlineHandler=()=>{this._browserWasOffline&&(It.debug(`Signaling health: browser online — clearing browser offline state for session ${this._session.sessionid}`),this._browserWasOffline=!1)},this._offlineHandler=()=>{this._browserWasOffline=!0,It.debug(`Signaling health: browser offline signal received for session ${this._session.sessionid}`);const e=bt(Te);Cn(ut.Error,{error:e,sessionId:this._session.sessionid},this._session.uuid),this.isRunning&&this._probeIfNeeded("browser offline signal while monitor is active")},window.addEventListener("online",this._onlineHandler),window.addEventListener("offline",this._offlineHandler))}_cleanupBrowserListeners(){"undefined"!=typeof window&&this._onlineHandler&&this._offlineHandler&&(window.removeEventListener("online",this._onlineHandler),window.removeEventListener("offline",this._offlineHandler),this._onlineHandler=null,this._offlineHandler=null,this._browserWasOffline=!1)}onIceRestartFailed(e){It.warn(`Signaling health: ICE restart failed (callId=${e}) — triggering socket reconnect`),this._triggerSignalingRecovery(`ICE restart failed for call ${e}`,"peer_failure")}_check(){var e;if(!(null===(e=this._session.connection)||void 0===e?void 0:e.connected))return;const t=Date.now(),n=t-this._lastInboundAt,i=t-this._lastOutboundConfirmedAt,r=n>=2e4;if(!(r||i>=45e3))return;if(!this._probeInFlight)return It.info(r?`Signaling health: no inbound WS activity for ${Math.round(n/1e3)}s during active call, sending health probe`:`Signaling health: inbound WS activity is flowing but no outbound request has been answered for ${Math.round(i/1e3)}s, sending health probe`),void this._sendProbe();const o=t-this._lastProbeSentAt;o>=5e3&&(It.warn(`Signaling health: probe timed out after ${o}ms (inbound silent for ${Math.round(n/1e3)}s, no outbound request answered for ${Math.round(i/1e3)}s) — declaring signaling unhealthy`),this._triggerSignalingRecovery(r?"Signaling health probe timed out: no inbound WS activity after probe":"Signaling health probe timed out: inbound WS activity is flowing but no outbound request is being answered","probe"))}_sendProbe(){var e;this._probeInFlight=!0,this._lastProbeSentAt=Date.now();const t=new Dn(Jt());null===(e=this._session.connection)||void 0===e||e.send(t).then(()=>this._resolveProbe()).catch(e=>{It.warn("Signaling health: probe Ping failed to send",e)})}_recoverMediaOrSignaling(e,t,n,i){if(!this._session.hasActiveCall())return void It.debug(`Signaling health: ignoring ${i} recovery without an active call`);const r=this._getSignalingHealthState();return"healthy"===r?(It.info(`Signaling health: signaling is healthy, triggering ICE restart for call ${e}`),void this._triggerIceRestart(e,t)):"unknown"===r?(It.info(`Signaling health: signaling health is unknown, deferring ICE restart decision for call ${e}`),this._pendingMediaRecovery={callId:e,reason:t,source:i},void this._probeIfNeeded(`${i} detected with stale/unknown signaling`)):(It.info("Signaling health: signaling is unhealthy, triggering socket reconnect instead of ICE restart"),void this._triggerSignalingRecovery(n,i))}_getSignalingHealthState(){var e;if(!(null===(e=this._session.connection)||void 0===e?void 0:e.connected))return"unhealthy";if(this._probeInFlight)return"unknown";const t=Date.now(),n=this._lastInboundAt||this._session.connection.lastInboundAt||0;return 0===n?"unknown":t-n<3e3?"healthy":"unknown"}_triggerSignalingRecovery(e,t="probe"){var n,i,r;this._pendingMediaRecovery=null,this._probeInFlight=!1,this._lastProbeSentAt=0,It.debug(`Signaling recovery triggered (source=${t}, reason=${e})`);const o=gt(tt);Cn(ut.Warning,{warning:o,reason:e,source:t,sessionId:this._session.sessionid},this._session.uuid),(null===(n=this._session.connection)||void 0===n?void 0:n.connected)?(It.info("Signaling health: force-closing WebSocket to trigger reconnect"),this._session.socketDisconnect()):It.debug("Signaling health: recovery triggered but connection not connected",{connected:null===(i=this._session.connection)||void 0===i?void 0:i.connected,hasConnection:!!this._session.connection,socketGeneration:null===(r=this._session.connection)||void 0===r?void 0:r.socketGeneration})}_triggerIceRestart(e,t){It.info(`Signaling health: triggering ICE restart for call ${e}`);const n=this._session.triggerIceRestart(e);if(!n.started)return void It.info(`Signaling health: ICE restart not started for call ${e}: ${n.reason}`);const i=gt(nt);Cn(ut.Warning,{warning:i,reason:t,callId:e,sessionId:this._session.sessionid},this._session.uuid)}}Pn.CRITICAL_METHODS=new Set([ln.Modify,ln.Bye,ln.Ping]);var Mn="2.28.0",Fn=Mn;class jn extends On{constructor(e,t,n,i,r={},o,a=!1){super(),this.method="login";const s={login:e,passwd:t,login_token:n,userVariables:r,reconnection:o,loginParams:{early_sdp_answer:a},"User-Agent":{sdkVersion:Fn,data:navigator.userAgent}};i&&(s.sessid=i),this.buildRequest({method:this.method,params:s})}}class zn extends On{constructor(e,t){super(),this.buildRequest({id:e,result:{method:t}})}}class Un extends On{toString(){return ln.Invite}}class $n extends On{toString(){return ln.Answer}}class Bn extends On{toString(){return ln.Attach}}class Hn extends On{toString(){return ln.Bye}}class Wn extends On{toString(){return ln.Candidate}}class Vn extends On{toString(){return ln.EndOfCandidates}}class qn extends On{toString(){return ln.Modify}}class Gn extends On{toString(){return ln.Info}}class Kn extends On{toString(){return ln.Broadcast}}class Yn extends On{toString(){return ln.Subscribe}}class Qn extends On{toString(){return ln.Unsubscribe}}class Jn extends On{constructor(e){super(),this.method="anonymous_login";const{target_type:t,target_id:n,target_version_id:i,target_params:r,userVariables:o,sessionId:a,reconnection:s}=e,l={target_type:t,target_id:n,userVariables:o,reconnection:s,"User-Agent":{sdkVersion:Fn,data:navigator.userAgent}};a&&(l.sessid=a),i&&(l.target_version_id=i),r&&(l.target_params=r),this.buildRequest({method:this.method,params:l})}}class Xn{constructor(e){if(this.options=e,this.uuid=oe(),this.sessionid="",this.subscriptions={},this.signature=null,this.relayProtocol=null,this.contexts=[],this.timeoutErrorCode=-32e3,this.invalidMethodErrorCode=-32601,this.authenticationRequiredErrorCode=-32e3,this.callReportId=null,this.callReportVoiceSdkId=null,this.reconnectTokenVoiceSdkId=Jt(),this.reconnectTokenCanaryRtcServer=Xt(),this.dc=null,this.region=null,this.connection=null,this._jwtAuth=!1,this._autoReconnect=!0,this._idle=!1,this._reconnectAttempts=0,this._reconnectCountedGeneration=-1,this._intentionalClose=!1,this._tokenExpiryTimeout=null,this._pendingCallReportUploads=new Set,this._signalingHealthMonitor=new Pn(this),this._executeQueue=[],!this.validateOptions())throw new Error("Invalid init options");var t,n;t=e.debug?"debug":"info",Rt=null!==(n=Tt[t])&&void 0!==n?n:Tt.info,this._onSocketOpen=this._onSocketOpen.bind(this),this.onNetworkClose=this.onNetworkClose.bind(this),this._onSocketMessage=this._onSocketMessage.bind(this),this._handleLoginError=this._handleLoginError.bind(this),this._onSocketActivity=this._onSocketActivity.bind(this),this._attachListeners(),this.connection=new Tn(this),this.registerAgent=new Ln(this)}get __logger(){return It}get connected(){return this.connection&&this.connection.connected}getIsRegistered(){return Z(this,void 0,void 0,function*(){return this.registerAgent.getIsRegistered()})}get reconnectDelay(){const e=this._reconnectAttempts,t=Math.min(1e3*Math.pow(2,e-1),3e4),n=Math.floor(.25*t*(2*Math.random()-1)),i=t+n;return It.debug("Reconnect delay computed",{attempt:e,baseDelayMs:1e3,maxDelayMs:3e4,delayMs:t,jitterMs:n,totalDelay:i,sessionId:this.sessionid}),i}execute(e){var t;if(this._idle)return new Promise(t=>this._executeQueue.push({resolve:t,msg:e}));if(!this.connected)return new Promise(t=>{this._executeQueue.push({resolve:t,msg:e}),It.debug("Calling connect from execute since not currently connected."),this.connect()});const n=Pn.isCriticalMethod((null===(t=e.request)||void 0===t?void 0:t.method)||"")?Tn.DEFAULT_REQUEST_TIMEOUT_MS:void 0;return(null!=n?this.connection.send(e,n):this.connection.send(e)).catch(e=>Z(this,void 0,void 0,function*(){if(e instanceof wt)throw It.debug(`Stale request settled (id=${e.requestId}, gen=${e.staleGeneration}) — not triggering recovery`),e;if("RequestTimeoutError"===(null==e?void 0:e.name))throw this.onSignalingRequestTimeout(e.requestId,e.timeoutMs,e.method),e;if((null==e?void 0:e.code)===this.authenticationRequiredErrorCode){if(!this._autoReconnect){const t=bt(Ee,e,void 0,!0);Cn(ut.Error,{error:t,sessionId:this.sessionid},this.uuid)}yield this.login()}throw e}))}executeRaw(e){this._idle?this._executeQueue.push({msg:e}):this.connection.sendRawText(e)}trackCallReportUpload(e){this._pendingCallReportUploads.add(e),e.then(()=>this._pendingCallReportUploads.delete(e),()=>this._pendingCallReportUploads.delete(e))}_drainCallReportUploads(){return Z(this,void 0,void 0,function*(){if(0===this._pendingCallReportUploads.size)return;const e=Array.from(this._pendingCallReportUploads);let t=!1;yield Promise.race([Promise.all(e.map(e=>e.catch(()=>{}))),new Promise(e=>setTimeout(()=>{t=!0,e()},Xn.CALL_REPORT_UPLOAD_DRAIN_TIMEOUT_MS))]),t&&It.warn("Timed out waiting for pending call report uploads",{pendingCount:this._pendingCallReportUploads.size})})}validateOptions(){return Ut(this.options)||$t(this.options)}broadcast(e){}disconnect(){return Z(this,void 0,void 0,function*(){clearTimeout(this._reconnectTimeout),this._clearTokenExpiryTimeout(),this.subscriptions={},this._autoReconnect=!1,this._intentionalClose=!0,this._reconnectAttempts=0,this.relayProtocol=null,yield this._drainCallReportUploads(),this._closeConnection(),yield sessionStorage.removeItem(this.signature),this._executeQueue=[],this._detachListeners(),It.debug("Session disconnected. Cleaned up all listeners and subscriptions, closed connection, disabled auto-reconnect.")})}on(e,t){return _n(e,t,this.uuid),this}off(e,t){return xn(e,t,this.uuid),this}connect(){var e;return Z(this,void 0,void 0,function*(){null===(e=this._registrationTimings)||void 0===e||e.mark("client.connect() called"),this.connection||(It.debug("No existing connection found, creating a new one."),this.connection=new Tn(this)),this._attachListeners(),this._autoReconnect||(It.debug("autoReconnect was disabled, resetting reconnect attempts"),this._reconnectAttempts=0),this._autoReconnect=!0,this.connection.isAlive||(It.debug("Connection wasn't alive, initiating connection to the server..."),this.connection.connect()),It.debug("Connect method called. Connection initiated.")})}resetReconnectAttempts(){this._reconnectAttempts=0,this._reconnectCountedGeneration=-1}_handleLoginError(e){var t;null===(t=this._registrationTimings)||void 0===t||t.mark("login failed");const n=bt(xe,e);Cn(ut.Error,{error:n,sessionId:this.sessionid},this.uuid)}clearReconnectToken(){en(),this.reconnectTokenVoiceSdkId=null,this.reconnectTokenCanaryRtcServer=void 0}_checkTokenExpiry(){this._clearTokenExpiryTimeout();const e=this.options.login_token;if(e&&"string"==typeof e)try{const t=e.split(".");if(3!==t.length)return;const n=JSON.parse(atob(t[1])).exp;if("number"!=typeof n)return;const i=n-Math.floor(Date.now()/1e3);if(i<=0)return;if(i<=Xn.TOKEN_EXPIRY_WARNING_SECONDS)this._emitTokenExpiryWarning();else{const e=1e3*(i-Xn.TOKEN_EXPIRY_WARNING_SECONDS);this._tokenExpiryTimeout=setTimeout(()=>{this._emitTokenExpiryWarning()},e)}}catch(e){It.debug("login_token is not a decodable JWT, skipping expiry check")}}_emitTokenExpiryWarning(){const e=gt(Ze);Cn(ut.Warning,{warning:e,sessionId:this.sessionid},this.uuid)}_clearTokenExpiryTimeout(){null!==this._tokenExpiryTimeout&&(clearTimeout(this._tokenExpiryTimeout),this._tokenExpiryTimeout=null)}login({creds:e,onSuccess:t,onError:n}={}){return Z(this,void 0,void 0,function*(){if(this.connection&&this.connection.isAlive){if(e&&(void 0!==e.login&&(this.options.login=e.login),void 0!==e.password&&(this.options.password=e.password),void 0!==e.passwd&&(this.options.passwd=e.passwd),void 0!==e.login_token&&(this.options.login_token=e.login_token),void 0!==e.userVariables&&(this.options.userVariables=e.userVariables),void 0!==e.anonymous_login&&(this.options.anonymous_login=e.anonymous_login)),Ut(this.options))return this._login({type:"login",onSuccess:t,onError:n});if($t(this.options))return this._login({type:"anonymous_login",onSuccess:t,onError:n});{const e="Invalid login options provided for authentication.";It.error(e);const t=bt(Ce,void 0,e);return void Cn(ut.Error,{error:t,type:"InvalidCredentialsOptions",sessionId:this.sessionid},this.uuid)}}})}_login({type:e,onSuccess:t,onError:n}){var i,r,o,a,s,l,c;return Z(this,void 0,void 0,function*(){let d;null===(i=this._registrationTimings)||void 0===i||i.mark(`prepare ${e} request`);const u=!!Jt(),h=u&&(this.sessionid&&Qt()?this.sessionid:function(e=Date.now()){const t=sessionStorage.getItem(Gt);return t?Qt(e)?t:(sessionStorage.removeItem(Gt),sessionStorage.removeItem(Kt),null):null}())||"";if("login"===e){const e=null!==(a=null!==(r=this.options.pushWhenActive)&&void 0!==r?r:null===(o=this.options.userVariables)||void 0===o?void 0:o.push_when_active)&&void 0!==a&&a,t=Object.assign(Object.assign({},this.options.userVariables),{push_when_active:e,pn_late_fanout:e}),n=null!==(s=this.options.earlySdpAnswer)&&void 0!==s&&s;d=new jn(this.options.login,this.options.password||this.options.passwd,this.options.login_token,h,t,u,n)}else d=new Jn({target_id:this.options.anonymous_login.target_id,target_type:this.options.anonymous_login.target_type,target_version_id:this.options.anonymous_login.target_version_id,target_params:this.options.anonymous_login.target_params,sessionId:h,userVariables:this.options.userVariables,reconnection:u});const p=yield this.execute(d).catch(e=>{this._handleLoginError(e),n&&n(e)});p&&(null===(l=this._registrationTimings)||void 0===l||l.mark("login response processing started"),this.sessionid=p.sessid,this.sessionid&&Zt(this.sessionid),this._checkTokenExpiry(),t&&t(),null===(c=this._registrationTimings)||void 0===c||c.mark("login response processing complete"))})}_onSocketOpen(){return Z(this,void 0,void 0,function*(){this.startSignalingHealthMonitor()})}_flushIntermediateCallReports(e){const t=this.calls;t&&Object.values(t).forEach(t=>{if(null==t?void 0:t.flushIntermediateCallReport)try{t.flushIntermediateCallReport(e)}catch(n){It.error("Failed to flush intermediate call report",{callId:t.id,flushReason:e,error:n})}})}_getSocketCloseCodeName(e){if(void 0===e)return;const t=Object.entries(ot).find(([,t])=>t===e);return null==t?void 0:t[0]}_getSocketCloseError(e){if(e)return e instanceof Error?e.message:String(e)}_createSocketCloseFlushReason(e){return{type:(null==e?void 0:e.error)?"socket-error":"socket-close",socketClose:{code:null==e?void 0:e.code,codeName:this._getSocketCloseCodeName(null==e?void 0:e.code),reason:null==e?void 0:e.reason,wasClean:null==e?void 0:e.wasClean,error:this._getSocketCloseError(null==e?void 0:e.error)}}}onNetworkClose(e){var t,n,i,r,o;const a=null!==(n=null===(t=this.connection)||void 0===t?void 0:t.socketGeneration)&&void 0!==n?n:0,s=null!==(i=null==e?void 0:e.socketGeneration)&&void 0!==i?i:a;if(s<a)It.debug(`Skipping stale onNetworkClose for socket generation ${s} (current generation is ${a})`);else if(s!==this._reconnectCountedGeneration){this._flushIntermediateCallReports(this._createSocketCloseFlushReason(e)),It.debug("onNetworkClose called",{closeCode:null==e?void 0:e.code,closeReason:null==e?void 0:e.reason,wasClean:null==e?void 0:e.wasClean,voiceSdkId:this.callReportVoiceSdkId,sessid:this.sessionid||void 0,autoReconnect:this._autoReconnect,reconnectAttempts:this._reconnectAttempts}),this.relayProtocol&&En(this.relayProtocol);for(const e in this.subscriptions)En(e);if(this.subscriptions={},this.contexts=[],clearTimeout(this._keepAliveTimeout),clearTimeout(this._reconnectTimeout),this.stopSignalingHealthMonitor(),this.sessionid&&this._autoReconnect&&Zt(this.sessionid),this.connection&&(this.connection.previousGatewayState=""),this._autoReconnect){const e=null!==(r=this.options.maxReconnectAttempts)&&void 0!==r?r:10;if(this._reconnectCountedGeneration=s,this._reconnectAttempts+=1,e>0&&this._reconnectAttempts>e){It.info(`Reconnection exhausted after ${e} attempts. Stopping automatic reconnect.`),this._reconnectAttempts=0,this._autoReconnect=!1,this._terminateActiveCallsLocally();const t=bt(_e);return void Cn(ut.Error,{error:t,sessionId:this.sessionid},this.uuid)}const t=this.reconnectDelay;null===(o=this._registrationTimings)||void 0===o||o.mark("schedule WebSocket reconnect",{delayMs:t,attempt:this._reconnectAttempts}),It.debug(`Reconnect attempt ${this._reconnectAttempts}${e>0?` of ${e}`:""} (delay=${t}ms)`),this._reconnectTimeout=setTimeout(()=>{var e;null===(e=this._registrationTimings)||void 0===e||e.mark("WebSocket reconnect timer fired"),It.debug("Calling connect due to network close and auto-reconnect enabled."),this.connect()},t)}else if(It.debug("auto_reconnect disabled, not reconnecting",{voiceSdkId:this.callReportVoiceSdkId,sessid:this.sessionid||void 0,intentionalClose:this._intentionalClose}),!this._intentionalClose){const e=gt(it);Cn(ut.Warning,{warning:e,reason:"auto_reconnect_disabled",sessionId:this.sessionid},this.uuid)}this._intentionalClose=!1}else It.debug(`Skipping duplicate onNetworkClose for socket generation ${s} (already handled, reconnect attempt ${this._reconnectAttempts})`)}_onSocketMessage(e){}_removeSubscription(e,t){this._existsSubscription(e,t)&&(t?(delete this.subscriptions[e][t],xn(e,null,t)):(delete this.subscriptions[e],En(e)))}_addSubscription(e,t=null,n){this._existsSubscription(e,n)||(this._existsSubscription(e)||(this.subscriptions[e]={}),this.subscriptions[e][n]={},Dt(t)&&_n(e,t,n))}_existsSubscription(e,t){return!(!this.subscriptions.hasOwnProperty(e)||!(!t||t&&this.subscriptions[e].hasOwnProperty(t)))}_attachListeners(){this._detachListeners(),It.debug("Attaching socket event listeners"),this.on(ut.SocketOpen,this._onSocketOpen),this.on(ut.SocketClose,this.onNetworkClose),this.on(ut.SocketError,this.onNetworkClose),this.on(ut.SocketMessage,this._onSocketMessage),this.on(ut.SocketActivity,this._onSocketActivity)}_detachListeners(){It.debug("Detaching socket event listeners"),this.off(ut.SocketOpen,this._onSocketOpen),this.off(ut.SocketClose,this.onNetworkClose),this.off(ut.SocketError,this.onNetworkClose),this.off(ut.SocketMessage,this._onSocketMessage),this.off(ut.SocketActivity,this._onSocketActivity)}_emptyExecuteQueues(){this._executeQueue.forEach(({resolve:e,msg:t})=>{"string"==typeof t?this.executeRaw(t):e(this.execute(t))})}_closeConnection(){var e,t;this._idle=!0,clearTimeout(this._keepAliveTimeout),this.stopSignalingHealthMonitor(),It.debug("_closeConnection called",{connected:null===(e=this.connection)||void 0===e?void 0:e.connected,socketGeneration:null===(t=this.connection)||void 0===t?void 0:t.socketGeneration,voiceSdkId:this.callReportVoiceSdkId,sessid:this.sessionid||void 0}),this.connection&&this.connection.close()}_resetKeepAlive(){!1===this._pong&&(It.warn("No ping/pong received, forcing PING ACK to keep alive"),this.execute(new Dn(Jt()))),clearTimeout(this._keepAliveTimeout),this._triggerKeepAliveTimeoutCheck()}_triggerKeepAliveTimeoutCheck(){this._pong=!1,this._keepAliveTimeout=setTimeout(()=>this._resetKeepAlive(),35e3)}setPingReceived(){It.debug("Ping received"),this._pong=!0}_onSocketActivity(){this._signalingHealthMonitor.onSocketActivity()}onOutboundConfirmed(){this._signalingHealthMonitor.onOutboundConfirmed()}hasActiveCall(){const e=this.calls;if(!e)return!1;const t=new Set([hn.Early,hn.Active,hn.Held]);return Object.values(e).some(e=>e&&null!=e._state&&t.has(e._state))}_terminateActiveCallsLocally(){const e=this.calls;if(!e)return;const t=Object.keys(e);if(0!==t.length){It.debug(`Reconnection exhausted — locally terminating ${t.length} active call(s) (no BYE): ${t.join(", ")}`);for(const n of t){const t=e[n];null==t||t.hangup({},!1)}}}startSignalingHealthMonitor(){this._signalingHealthMonitor.start()}stopSignalingHealthMonitor(){this._signalingHealthMonitor.stop()}triggerIceRestart(e){const t=this.calls,n=null==t?void 0:t[e];if(!n)return It.warn(`Signaling health: cannot trigger ICE restart — call ${e} not found`),{started:!1,reason:"call not found"};const i=n.peer;if(!(null==i?void 0:i.restartIce))return It.warn(`Signaling health: cannot trigger ICE restart — no peer for call ${e}`),{started:!1,reason:"no peer"};const r=i.restartIce();return r.started||It.debug(`Signaling health: ICE restart skipped for call ${e}: ${r.reason}`),r}onSignalingRequestTimeout(e,t,n=""){this._signalingHealthMonitor.onRequestTimeout(e,t,n)}reportPeerFailure(e,t){this._signalingHealthMonitor.onPeerFailure(e,t)}reportNoRtp(e,t){this._signalingHealthMonitor.onNoRtp(e,t)}reportIceRestartFailed(e){this._signalingHealthMonitor.onIceRestartFailed(e)}static on(e,t){_n(e,t)}static off(e){xn(e)}static uuid(){return oe()}clearConnection(){this.connection=null}hasAutoReconnect(){return this._autoReconnect}}Xn.TOKEN_EXPIRY_WARNING_SECONDS=120,Xn.CALL_REPORT_UPLOAD_DRAIN_TIMEOUT_MS=1e4;const Zn=e=>navigator.mediaDevices.getUserMedia(e),ei=e=>e&&e instanceof MediaStream,ti=(e,t,n)=>{if(null==e)return null;const i=Ft(e);if(i instanceof Promise)return i.then(e=>ti(e,t,n),e=>(It.error("attachMediaStream: element resolver rejected",e),null));if(!Pt(i))return"function"==typeof e?It.warn(`attachMediaStream: element resolver returned ${i} instead of an <audio> or <video> element`):"string"==typeof e?It.warn(`attachMediaStream: id "${e}" did not resolve to an <audio> or <video> element`):It.warn("attachMediaStream: not an <audio> or <video> element:",e),null;if(i.getAttribute("autoplay")||i.setAttribute("autoplay","autoplay"),i.getAttribute("playsinline")||i.setAttribute("playsinline","playsinline"),i.srcObject&&i.srcObject!==t&&(It.warn("attachMediaStream: element already has a different MediaStream attached; overwriting will disrupt the existing call. Use a per-call remoteElement (client.newCall({ remoteElement }) or call.answer({ remoteElement })) for concurrent calls."),n)){const e=gt(Je);Cn(ut.Warning,{warning:e,callId:n.callId,sessionId:n.sessionId},n.eventTarget)}return i.srcObject=t,i},ni=(e,t)=>{const n=Ft(e);if(n){if(t&&n.srcObject!==t)return;n.srcObject=null}},ii=(e,t)=>Z(void 0,void 0,void 0,function*(){const n=Ft(e);if(null===n)return It.info("No HTMLMediaElement to attach the speakerId"),!1;if("string"!=typeof t)return It.info(`Invalid speaker deviceId: '${t}'`),!1;try{return yield n.setSinkId(t),!0}catch(e){return!1}}),ri=e=>{e&&"live"===e.readyState&&e.stop()},oi=e=>{ei(e)&&e.getTracks().forEach(ri),e=null},ai=e=>Z(void 0,void 0,void 0,function*(){It.info("RTCService.getUserMedia",e);const{audio:t,video:n}=e;if(!t&&!n)return null;try{return yield Zn(e)}catch(t){if(It.error("getUserMedia error: ",t),(e=>"NotReadableError"===e.name||"NotFoundError"===e.name||"OverconstrainedError"===e.name)(t)){const n=(e=>{const{audio:t,video:n}=e;let i=!1,r=t,o=n;if("object"==typeof t&&null!==t&&"deviceId"in t){i=!0;const e=Object.assign({},t);delete e.deviceId,r=0===Object.keys(e).length||e}if("object"==typeof n&&null!==n&&"deviceId"in n){i=!0;const e=Object.assign({},n);delete e.deviceId,o=0===Object.keys(e).length||e}return i?{audio:r,video:o}:null})(e);if(n){It.warn("Device not found or not readable, falling back to default device");try{return yield Zn(n)}catch(e){throw It.error("Fallback getUserMedia also failed: ",e),t}}}throw t}}),si=(e=null,t=!1)=>Z(void 0,void 0,void 0,function*(){let n=[];const i=yield navigator.mediaDevices.getUserMedia(((e=null)=>({audio:!e||e===gn.AudioIn||e===gn.AudioOut,video:!e||e===gn.Video}))(e)).catch(e=>(It.error(e),null));if(i){if(oi(i),n=yield navigator.mediaDevices.enumerateDevices(),e&&(n=n.filter(t=>t.kind===e)),!0===t)return n;const r=[];n=n.filter(e=>{if(!e.groupId)return!0;const t=`${e.kind}-${e.groupId}`;return!r.includes(t)&&(r.push(t),!0)})}return n}),li=[[320,240],[640,360],[640,480],[1280,720],[1920,1080]],ci=(e,t,n)=>Z(void 0,void 0,void 0,function*(){const i=yield si(n,!0);for(let n=0;n<i.length;n++){const{deviceId:r,label:o}=i[n];if(e===r||t===o)return r}return null}),di=e=>e?{id:e.id,kind:e.kind,enabled:e.enabled,muted:e.muted,readyState:e.readyState}:null,ui=e=>{var t,n,i,r,o,a;return e?(null!==(n=null===(t=e.getTracks)||void 0===t?void 0:t.call(e))&&void 0!==n?n:[...null!==(r=null===(i=e.getAudioTracks)||void 0===i?void 0:i.call(e))&&void 0!==r?r:[],...null!==(a=null===(o=e.getVideoTracks)||void 0===o?void 0:o.call(e))&&void 0!==a?a:[]]).map(e=>di(e)):[]},hi=(e,t)=>{if(!e)return!1;const{subscribed:n,alreadySubscribed:i}=pi(e);return n.includes(t)||i.includes(t)},pi=e=>{const t={subscribed:[],alreadySubscribed:[],unauthorized:[],unsubscribed:[],notSubscribed:[]};return Object.keys(t).forEach(n=>{t[n]=e[`${n}Channels`]||[]}),t},fi=(e,t=null,n=null)=>{if(!ei(e))return null;let i=[];switch(t){case"audio":i=e.getAudioTracks();break;case"video":i=e.getVideoTracks();break;default:i=e.getTracks()}i.forEach(e=>{switch(n){case"on":case!0:e.enabled=!0;break;case"off":case!1:e.enabled=!1;break;default:e.enabled=!e.enabled}})},gi=e=>{fi(e,"audio",!0)},mi=e=>{fi(e,"audio",!1)};var vi;function bi(e,t){const n=document.getElementById(t);if(n)return n;if(e&&t){const n=document.createElement("audio");return n.id=t,n.loop=!0,n.src=e,n.preload="auto",n.load(),document.body.appendChild(n),n}return null}function yi(e){e&&(e._playFulfilled=!1,e._promise=e.play(),e._promise.then(()=>{e._playFulfilled=!0}).catch(t=>{It.error("playAudio",t),e._playFulfilled=!0}))}function wi(e){e&&(e._playFulfilled?(e.pause(),e.currentTime=0):e._promise&&e._promise.then?e._promise.then(()=>{e.pause(),e.currentTime=0}):setTimeout(()=>{e.pause(),e.currentTime=0},1e3))}!function(e){e.not_supported="not supported",e.full="full",e.partial="partial"}(vi||(vi={}));const ki=e=>{const t=[],n=[];return e&&0!==e.length?(e.forEach(e=>{const i=e.mimeType.toLocaleLowerCase();i.startsWith("audio/")?t.push(e):i.startsWith("video/")&&n.push(e)}),{audioCodecs:t,videoCodecs:n}):{audioCodecs:t,videoCodecs:n}};class _i extends Rn{constructor(e,t){super(),this.method="ai_conversation",this.buildRequest({method:this.method,params:{type:"conversation.item.create",previous_item_id:null,item:{id:oe(),type:"message",role:"user",content:[{type:"input_text",text:e},...null==t?void 0:t.map(e=>({type:"image_url",image_url:{url:e}}))]}}})}}class Si extends Rn{constructor(e){super(),this.method="ai_conversation",this.buildNotification({method:this.method,params:{type:"conversation.item.create",item:e}})}}class xi{constructor(e,t,n){var i;this.getRegistrationTimingLog=n,this.peerConnection=null,this.intervalId=null,this.statsBuffer=[],this.intervalStartTime=null,this.callEndTime=null,this.logCollector=null,this.registrationTimingIncluded=!1,this.intervalAudioLevels={outbound:[],inbound:[]},this.intervalJitters=[],this.intervalRTTs=[],this.intervalBitrates={outbound:[],inbound:[]},this.previousStats={},this.previousCandidatePairSnapshot=null,this.MAX_BUFFER_SIZE=360,this.onFlushNeeded=null,this.onWarning=null,this._breachCounters={},this._activeWarnings=new Set,this._lastWarningEmitted={},this._prevPacketsReceived=null,this._prevPacketsLost=null,this._previousStatsEntryForWarnings=null,this._isHeld=!1,this._lastLocalAudioTrackSnapshotJson=null,this._hasConfirmedLocalAudio=!1,this._confirmedLocalAudioSilenceMs=0,this._segmentIndex=0,this._flushing=!1,this._stopped=!1,this.options=e,this.logCollectorOptions=t||{enabled:!1,level:"debug",maxEntries:1e3},this.callStartTime=new Date,this._lastIntermediateFlushTime=this.callStartTime,this.logCollectorOptions.enabled&&(this.logCollector=function(e){return new Ct(e)}(this.logCollectorOptions),this.logCollector.start(),i=this.logCollector,Et=i)}start(e){var t,n;this.options.enabled&&(this.peerConnection=e,this.intervalStartTime=new Date,this._lastIntermediateFlushTime=this.intervalStartTime,this._stopped=!1,It.info("CallReportCollector: Starting stats collection",{interval:this.options.interval,initialInterval:xi.INITIAL_COLLECTION_INTERVAL_MS,logCollectorActive:null!==(n=null===(t=this.logCollector)||void 0===t?void 0:t.isActive())&&void 0!==n&&n}),this._scheduleNextCollection())}stop(){var e,t;return Z(this,void 0,void 0,function*(){this._stopped=!0,this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),this.callEndTime=new Date,this.peerConnection&&this.intervalStartTime&&(yield this._collectStats(!0));const n=null!==(t=null===(e=this.logCollector)||void 0===e?void 0:e.getLogCount())&&void 0!==t?t:0;this.logCollector&&this.logCollector.stop(),It.info("CallReportCollector: Stopped stats collection",{totalIntervals:this.statsBuffer.length,totalLogs:n,duration:this.callEndTime.getTime()-this.callStartTime.getTime()})})}flush(e,t){var n,i,r,o;const a=this._getRegistrationTimingLog(),s=this.statsBuffer.length,l=null!==(i=null===(n=this.logCollector)||void 0===n?void 0:n.getLogCount())&&void 0!==i?i:0,c="socket-close"===(null==t?void 0:t.type)||"socket-error"===(null==t?void 0:t.type),d=s>0||l>0||c||!!a;if(this._flushing||!d)return It.debug("CallReportCollector: Skipping intermediate flush",{reason:this._flushing?"already-flushing":"no-stats-or-logs",flushReason:t,statsIntervals:s,logEntries:l}),null;this._flushing=!0;try{const n=this._segmentIndex++,i=this.statsBuffer;this.statsBuffer=[];const s=this._withRegistrationTiming(null!==(o=null===(r=this.logCollector)||void 0===r?void 0:r.drain())&&void 0!==o?o:[],a),l=new Date;this._lastIntermediateFlushTime=l;const c=Object.assign(Object.assign(Object.assign({summary:Object.assign(Object.assign({},e),{durationSeconds:(l.getTime()-this.callStartTime.getTime())/1e3,startTimestamp:this.callStartTime.toISOString(),endTimestamp:l.toISOString()}),stats:i},s.length>0?{logs:s}:{}),{segment:n}),t?{flushReason:t}:{});return It.info("CallReportCollector: Flushed intermediate segment",{segment:n,intervals:i.length,logEntries:s.length,callId:e.callId,flushReason:t}),c}finally{this._flushing=!1}}postReport(e,t,n,i){var r,o,a;return Z(this,void 0,void 0,function*(){const s=this._withRegistrationTiming(null!==(o=null===(r=this.logCollector)||void 0===r?void 0:r.getLogs())&&void 0!==o?o:[],this._getRegistrationTimingLog()),l=s&&s.length>0;if(!this.options.enabled)return void It.info("CallReportCollector: Skipping report — call reports disabled");if(0===this.statsBuffer.length&&!l)return void It.info("CallReportCollector: Skipping report — no stats or logs collected");const c=this._segmentIndex>0,d=this._segmentIndex,u=Object.assign(Object.assign({summary:Object.assign(Object.assign({},e),{durationSeconds:this.callEndTime&&this.callStartTime?(this.callEndTime.getTime()-this.callStartTime.getTime())/1e3:void 0,startTimestamp:this.callStartTime.toISOString(),endTimestamp:null===(a=this.callEndTime)||void 0===a?void 0:a.toISOString()}),stats:this.statsBuffer},s&&s.length>0?{logs:s}:{}),c?{segment:d}:{});yield this._sendPayload(u,t,n,i,!0)})}_getRegistrationTimingLog(){var e;if(!this.registrationTimingIncluded&&this.options.enabled&&this.logCollectorOptions.enabled&&!["warn","error"].includes(this.logCollectorOptions.level))try{return null===(e=this.getRegistrationTimingLog)||void 0===e?void 0:e.call(this)}catch(e){return}}_withRegistrationTiming(e,t){if(!this.getRegistrationTimingLog)return e;const n=e.filter(e=>{var t;return"registration_timing"!==(null===(t=e.context)||void 0===t?void 0:t.event)});return t&&(this.registrationTimingIncluded=!0,n.unshift(t)),n}sendPayload(e,t,n,i,r=!1){return Z(this,void 0,void 0,function*(){yield this._sendPayload(e,t,n,i,!1,r)})}_sendPayload(e,t,n,i,r=!0,o=!1){var a,s;return Z(this,void 0,void 0,function*(){const l=new URL(n),c=`${l.protocol.replace(/^ws/,"http")}//${l.host}/call_report`,d=r?"final report":`intermediate segment ${e.segment}`;It.info(`CallReportCollector: Posting ${d}`,{endpoint:c,intervals:e.stats.length,logEntries:null!==(s=null===(a=e.logs)||void 0===a?void 0:a.length)&&void 0!==s?s:0,callId:e.summary.callId,segment:e.segment});const u={"Content-Type":"application/json","x-call-report-id":t,"x-call-id":e.summary.callId};i&&(u["x-voice-sdk-id"]=i);const h=JSON.stringify(e),p=(r||o)&&h.length<=xi.KEEPALIVE_BODY_LIMIT_BYTES;let f;for(let e=0;e<=xi.RETRY_DELAYS_MS.length;e++){try{const t=yield fetch(c,Object.assign({method:"POST",headers:u,body:h},p?{keepalive:!0}:{}));if(t.ok)return void It.info(`CallReportCollector: Successfully posted ${d}`,{attempt:e+1,status:t.status});{const n=yield t.text();f=new Error(`Call report POST failed with status ${t.status}`),It.error(`CallReportCollector: Failed to post ${d}`,{attempt:e+1,status:t.status,error:n})}}catch(l){f=l,It.warn(`CallReportCollector: Network error posting ${d}`,{attempt:e+1,error:l})}const t=xi.RETRY_DELAYS_MS[e];if(void 0===t)break;It.info(`CallReportCollector: Retrying ${d} in ${t}ms`,{attempt:e+2}),yield new Promise(e=>setTimeout(e,t))}throw It.error(`CallReportCollector: Exhausted retries posting ${d}`,{error:f}),f instanceof Error?f:new Error("Call report POST failed after retries")})}getStatsBuffer(){return this.statsBuffer}shouldForceRelayCandidateForRecovery(){var e,t,n,i,r,o,a,s,l,c,d,u,h,p,f,g;if(this.statsBuffer.length<2)return!1;const m=this.statsBuffer[this.statsBuffer.length-1],v=this.statsBuffer[this.statsBuffer.length-2],b=null===(e=m.ice)||void 0===e?void 0:e.local;if("vpn"!==(null==b?void 0:b.networkType)||"relay"===(null==b?void 0:b.candidateType))return!1;const y=!1===(null===(t=m.ice)||void 0===t?void 0:t.writable),w="disconnected"===(null===(n=m.transport)||void 0===n?void 0:n.iceState)||"failed"===(null===(i=m.transport)||void 0===i?void 0:i.iceState),k=this._positiveDelta(null===(r=m.ice)||void 0===r?void 0:r.requestsSent,null===(o=v.ice)||void 0===o?void 0:o.requestsSent),_=this._positiveDelta(null===(a=m.ice)||void 0===a?void 0:a.responsesReceived,null===(s=v.ice)||void 0===s?void 0:s.responsesReceived),S=k>0&&0===_,x=this._positiveDelta(null===(c=null===(l=m.audio)||void 0===l?void 0:l.outbound)||void 0===c?void 0:c.bytesSent,null===(u=null===(d=v.audio)||void 0===d?void 0:d.outbound)||void 0===u?void 0:u.bytesSent),C=this._positiveDelta(null===(p=null===(h=m.audio)||void 0===h?void 0:h.inbound)||void 0===p?void 0:p.bytesReceived,null===(g=null===(f=v.audio)||void 0===f?void 0:f.inbound)||void 0===g?void 0:g.bytesReceived);return y||w||S||x>0&&0===C}getLogs(){var e,t;return null!==(t=null===(e=this.logCollector)||void 0===e?void 0:e.getLogs())&&void 0!==t?t:[]}_positiveDelta(e,t){return void 0===e||void 0===t?0:Math.max(0,e-t)}cleanup(){this._lastLocalAudioTrackSnapshotJson=null,this.logCollector&&(this.logCollector.clear(),this.logCollector=null)}setHeld(e){this._isHeld!==e&&(this._isHeld=e,this._trackBreach(Me,!1),this._trackBreach(Fe,!1))}_scheduleNextCollection(){if(this._stopped||!this.peerConnection||!this.intervalStartTime||this.intervalId)return;const e=this._collectionIntervalFor();this.intervalId=setTimeout(()=>{this.intervalId=null,this._collectStats().finally(()=>{!this._stopped&&this.peerConnection&&this._scheduleNextCollection()})},e)}_collectionIntervalFor(){const e=this._positiveInterval(this.options.interval,5e3);return Math.min(xi.INITIAL_COLLECTION_INTERVAL_MS,e)}_positiveInterval(e,t){return"number"==typeof e&&Number.isFinite(e)&&e>0?e:t}_collectStats(e=!1){var t,n;return Z(this,void 0,void 0,function*(){if(this.peerConnection&&this.intervalStartTime)try{const i=yield this.peerConnection.getStats(),r=new Date;let o=null,a=null,s=null,l=null,c=null,d=null;const u=[];let h=null;i.forEach(e=>{switch(e.type){case"outbound-rtp":"audio"===e.kind&&"audio"===e.mediaType&&(o=e);break;case"inbound-rtp":"audio"===e.kind&&"audio"===e.mediaType&&(a=e);break;case"media-playout":"audio"===e.kind&&(s=e);break;case"remote-inbound-rtp":"audio"===e.kind&&(l=e);break;case"remote-outbound-rtp":"audio"===e.kind&&(c=e);break;case"candidate-pair":(e.nominated||"succeeded"===e.state)&&u.push(e);break;case"transport":h=e}});const p=null==h?void 0:h.selectedCandidatePairId,f=p?null===(n=(t=i).get)||void 0===n?void 0:n.call(t,p):void 0,g=this._getCodec(i,null==o?void 0:o.codecId),m=this._getCodec(i,null==a?void 0:a.codecId);if(d="candidate-pair"===(null==f?void 0:f.type)?f:p?u.find(e=>e.id===p)||u[u.length-1]||null:u[u.length-1]||null,o){const e=this._getOutboundAudioLevel(i,o);if(null!==e&&this.intervalAudioLevels.outbound.push(e),void 0!==this.previousStats.outboundBytes&&void 0!==this.previousStats.timestamp){const e=(o.bytesSent||0)-this.previousStats.outboundBytes,t=(o.timestamp||r.getTime())-this.previousStats.timestamp;if(t>0){const n=8*e*1e3/t;this.intervalBitrates.outbound.push(n)}}this.previousStats.outboundBytes=o.bytesSent}if(a){const e=this._getInboundAudioLevel(i,a);if(null!==e&&this.intervalAudioLevels.inbound.push(e),void 0!==a.jitter&&this.intervalJitters.push(1e3*a.jitter),void 0!==this.previousStats.inboundBytes&&void 0!==this.previousStats.timestamp){const e=(a.bytesReceived||0)-this.previousStats.inboundBytes,t=(a.timestamp||r.getTime())-this.previousStats.timestamp;if(t>0){const n=8*e*1e3/t;this.intervalBitrates.inbound.push(n)}}this.previousStats.inboundBytes=a.bytesReceived}let v,b,y,w,k;d&&void 0!==d.currentRoundTripTime&&this.intervalRTTs.push(d.currentRoundTripTime),d&&(v=this._resolveCandidate(i,d.localCandidateId),b=this._resolveCandidate(i,d.remoteCandidateId)),d&&(y=Object.assign(Object.assign({id:d.id,localCandidateId:d.localCandidateId,remoteCandidateId:d.remoteCandidateId,state:d.state,nominated:d.nominated,writable:d.writable,currentRoundTripTime:d.currentRoundTripTime,requestsSent:d.requestsSent,responsesReceived:d.responsesReceived},v?{local:v}:{}),b?{remote:b}:{}),null!==this.previousCandidatePairSnapshot&&d.id!==this.previousCandidatePairSnapshot.id&&(It.debug("CallReportCollector: ICE candidate pair changed mid-call",{previous:this.previousCandidatePairSnapshot,current:y}),this._emitWarning(Ge)),this.previousCandidatePairSnapshot=y),o&&(w=this._getLocalAudioTrackSnapshot(),k=this._getOutboundAudioSourceStats(i,o)),this._logLocalAudioTrackSnapshot(w,k),this.previousStats.timestamp=r.getTime();const _=r.getTime()-this.intervalStartTime.getTime(),S=this._collectionIntervalFor();if(e||_>=S){const e=this._createStatsEntry(this.intervalStartTime,r,o,a,d,v,b,h,w,k,s,l,c,g,m);this.statsBuffer.push(e),this.statsBuffer.length>this.MAX_BUFFER_SIZE&&(this.statsBuffer.shift(),It.warn("CallReportCollector: Buffer size limit reached, removing oldest entry")),this._checkQualityWarnings(e,a),this._requestIntermediateFlushIfNeeded(r),this.intervalStartTime=r,this._resetIntervalAccumulators()}}catch(e){It.error("CallReportCollector: Error collecting stats",{error:e})}})}_getIntermediateReportInterval(){var e;return null!==(e=this.options.intermediateReportInterval)&&void 0!==e?e:xi.DEFAULT_INTERMEDIATE_REPORT_INTERVAL_MS}_requestIntermediateFlushIfNeeded(e){var t,n;const i=this.statsBuffer.length,r=null!==(n=null===(t=this.logCollector)||void 0===t?void 0:t.getLogCount())&&void 0!==n?n:0;if(!this.onFlushNeeded||this._flushing)return;if(0===i&&0===r)return void It.debug("CallReportCollector: Skipping intermediate flush request — no stats or logs buffered");const o=this._getIntermediateReportInterval(),a=e.getTime()-this._lastIntermediateFlushTime.getTime();let s=null;if(i>=xi.STATS_FLUSH_THRESHOLD||r>=xi.LOGS_FLUSH_THRESHOLD?s="buffer-limit":o>0&&a>=o&&(s="safety-interval"),s){It.info("CallReportCollector: Requesting intermediate report flush",{reason:s,statsIntervals:i,logEntries:r,msSinceLastFlush:a}),this._lastIntermediateFlushTime=e;try{this.onFlushNeeded()}catch(e){It.error("CallReportCollector: onFlushNeeded callback error",{error:e})}}}_checkQualityWarnings(e,t){var n,i,r,o,a,s,l,c,d,u,h,p,f,g,m;if(!this.onWarning)return;const v=null===(n=e.connection)||void 0===n?void 0:n.roundTripTimeAvg,b=null===(r=null===(i=e.audio)||void 0===i?void 0:i.inbound)||void 0===r?void 0:r.jitterAvg;let y;if(t){const e=null!==(o=t.packetsReceived)&&void 0!==o?o:0,n=null!==(a=t.packetsLost)&&void 0!==a?a:0;if(null!==this._prevPacketsReceived&&null!==this._prevPacketsLost){const t=e-this._prevPacketsReceived,i=n-this._prevPacketsLost,r=t+i;r>0&&(y=i/r*100)}this._prevPacketsReceived=e,this._prevPacketsLost=n}if(this._trackBreach(Oe,void 0!==v&&v>xi.THRESHOLD_RTT_MS),this._trackBreach(Ae,void 0!==b&&b>xi.THRESHOLD_JITTER_MS),this._trackBreach(Le,void 0!==y&&y>xi.THRESHOLD_PACKET_LOSS_PCT),this._trackLowLocalAudio(e),this._isHeld?this._trackBreach(Me,!1):this._trackLowInboundAudio(e),void 0!==v&&void 0!==b&&void 0!==y){const e=93.2-.11*b-2.5*y-1e3*v*.01,t=Math.max(1,Math.min(4.5,1+.035*e+e*(e-60)*(100-e)*7e-6));this._trackBreach(De,t<xi.THRESHOLD_MOS)}else this._trackBreach(De,!1);if(void 0!==(null===(l=null===(s=e.audio)||void 0===s?void 0:s.inbound)||void 0===l?void 0:l.bytesReceived)){const t=null===(u=null===(d=null===(c=this._previousStatsEntryForWarnings)||void 0===c?void 0:c.audio)||void 0===d?void 0:d.inbound)||void 0===u?void 0:u.bytesReceived,n=e.audio.inbound.bytesReceived;this._trackBreach(Fe,!this._isHeld&&void 0!==t&&n-t==0)}if(void 0!==(null===(p=null===(h=e.audio)||void 0===h?void 0:h.outbound)||void 0===p?void 0:p.bytesSent)){const t=null===(m=null===(g=null===(f=this._previousStatsEntryForWarnings)||void 0===f?void 0:f.audio)||void 0===g?void 0:g.outbound)||void 0===m?void 0:m.bytesSent,n=e.audio.outbound.bytesSent;this._trackBreach(je,void 0!==t&&n-t==0)}this._previousStatsEntryForWarnings=e}_trackLowLocalAudio(e){var t;const n=null===(t=e.audio)||void 0===t?void 0:t.outbound,i=null==n?void 0:n.audioLevelAvg,r=null==n?void 0:n.localTrack;if(void 0!==i&&!1!==(null==r?void 0:r.enabled)&&!0!==(null==r?void 0:r.muted))return i<=xi.THRESHOLD_LOCAL_AUDIO_LEVEL?void(this._hasConfirmedLocalAudio?(this._confirmedLocalAudioSilenceMs+=this._getStatsIntervalDurationMs(e),this._confirmedLocalAudioSilenceMs>=xi.CONFIRMED_LOCAL_AUDIO_SILENCE_MS&&this._emitWarningOncePerEpisode(Pe)):this._trackBreach(Pe,!0)):(this._hasConfirmedLocalAudio=!0,this._confirmedLocalAudioSilenceMs=0,void this._trackBreach(Pe,!1));this._resetLowLocalAudioWarning()}_resetLowLocalAudioWarning(){this._confirmedLocalAudioSilenceMs=0,this._trackBreach(Pe,!1)}_getStatsIntervalDurationMs(e){const t=new Date(e.intervalStartUtc).getTime(),n=new Date(e.intervalEndUtc).getTime()-t;return Number.isFinite(n)&&n>0?n:this.options.interval}_trackLowInboundAudio(e){var t;const n=null===(t=e.audio)||void 0===t?void 0:t.inbound,i=null==n?void 0:n.audioLevelAvg;if(void 0===i)return void this._trackBreach(Me,!1);const r=i<=xi.THRESHOLD_INBOUND_AUDIO_LEVEL;this._trackBreach(Me,r)}_trackBreach(e,t){var n,i;if(t){if(this._breachCounters[e]=(null!==(n=this._breachCounters[e])&&void 0!==n?n:0)+1,this._breachCounters[e]>=xi.CONSECUTIVE_BREACHES_REQUIRED){this._activeWarnings.add(e);const t=Date.now();t-(null!==(i=this._lastWarningEmitted[e])&&void 0!==i?i:0)>=xi.WARNING_THROTTLE_MS&&(this._lastWarningEmitted[e]=t,this._emitWarning(e))}}else this._breachCounters[e]=0,this._activeWarnings.delete(e),delete this._lastWarningEmitted[e]}_emitWarningOncePerEpisode(e){this._activeWarnings.has(e)||(this._activeWarnings.add(e),this._lastWarningEmitted[e]=Date.now(),this._emitWarning(e))}_emitWarning(e){var t;try{const n=gt(e);It.warn(`CallReportCollector: warning ${n.code}: ${n.message}`),null===(t=this.onWarning)||void 0===t||t.call(this,n)}catch(t){It.error(`CallReportCollector: Failed to emit warning ${e}`,{error:t})}}_createStatsEntry(e,t,n,i,r,o,a,s,l,c,d,u,h,p,f){const g={intervalStartUtc:e.toISOString(),intervalEndUtc:t.toISOString(),audio:{}};if(n&&(g.audio.outbound=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({packetsSent:n.packetsSent,bytesSent:n.bytesSent,audioLevelAvg:this._average(this.intervalAudioLevels.outbound),bitrateAvg:this._average(this.intervalBitrates.outbound)},l?{localTrack:l}:{}),c?{mediaSource:c}:{}),void 0!==n.retransmittedPacketsSent?{retransmittedPacketsSent:n.retransmittedPacketsSent}:{}),void 0!==n.retransmittedBytesSent?{retransmittedBytesSent:n.retransmittedBytesSent}:{}),void 0!==n.headerBytesSent?{headerBytesSent:n.headerBytesSent}:{}),void 0!==n.nackCount?{nackCount:n.nackCount}:{}),void 0!==n.targetBitrate?{targetBitrate:n.targetBitrate}:{}),void 0!==n.totalPacketSendDelay?{totalPacketSendDelay:n.totalPacketSendDelay}:{}),void 0!==n.active?{active:n.active}:{}),p?{codec:this._buildCodecSnapshot(p,n.codecId)}:{})),i&&(g.audio.inbound=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({packetsReceived:i.packetsReceived,bytesReceived:i.bytesReceived,packetsLost:i.packetsLost,packetsDiscarded:i.packetsDiscarded,jitterBufferDelay:i.jitterBufferDelay,jitterBufferEmittedCount:i.jitterBufferEmittedCount,totalSamplesReceived:i.totalSamplesReceived,concealedSamples:i.concealedSamples,concealmentEvents:i.concealmentEvents,audioLevelAvg:this._average(this.intervalAudioLevels.inbound),jitterAvg:this._average(this.intervalJitters),bitrateAvg:this._average(this.intervalBitrates.inbound)},void 0!==i.nackCount?{nackCount:i.nackCount}:{}),void 0!==i.headerBytesReceived?{headerBytesReceived:i.headerBytesReceived}:{}),void 0!==i.fecPacketsReceived?{fecPacketsReceived:i.fecPacketsReceived}:{}),void 0!==i.fecPacketsDiscarded?{fecPacketsDiscarded:i.fecPacketsDiscarded}:{}),void 0!==i.jitterBufferTargetDelay?{jitterBufferTargetDelay:i.jitterBufferTargetDelay}:{}),void 0!==i.jitterBufferMinimumDelay?{jitterBufferMinimumDelay:i.jitterBufferMinimumDelay}:{}),void 0!==i.totalSamplesDecoded?{totalSamplesDecoded:i.totalSamplesDecoded}:{}),void 0!==i.samplesDecodedWithSilence?{samplesDecodedWithSilence:i.samplesDecodedWithSilence}:{}),void 0!==i.samplesDecodedWithConcealment?{samplesDecodedWithConcealment:i.samplesDecodedWithConcealment}:{}),void 0!==i.totalAudioEnergy?{totalAudioEnergy:i.totalAudioEnergy}:{}),void 0!==i.totalSamplesDuration?{totalSamplesDuration:i.totalSamplesDuration}:{}),f?{codec:this._buildCodecSnapshot(f,i.codecId)}:{})),r&&(g.connection=Object.assign(Object.assign({roundTripTimeAvg:this._average(this.intervalRTTs),currentRoundTripTime:r.currentRoundTripTime},void 0!==r.currentRoundTripTime?{roundTripTimeSource:"candidate-pair.currentRoundTripTime"}:{}),{packetsSent:r.packetsSent,packetsReceived:r.packetsReceived,bytesSent:r.bytesSent,bytesReceived:r.bytesReceived}),g.ice=Object.assign(Object.assign({id:r.id,localCandidateId:r.localCandidateId,remoteCandidateId:r.remoteCandidateId,state:r.state,nominated:r.nominated,writable:r.writable,currentRoundTripTime:r.currentRoundTripTime,requestsSent:r.requestsSent,responsesReceived:r.responsesReceived},o?{local:o}:{}),a?{remote:a}:{})),s&&(g.transport=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},void 0!==s.iceState?{iceState:s.iceState}:{}),void 0!==s.dtlsState?{dtlsState:s.dtlsState}:{}),void 0!==s.srtpCipher?{srtpCipher:s.srtpCipher}:{}),void 0!==s.tlsVersion?{tlsVersion:s.tlsVersion}:{}),void 0!==s.selectedCandidatePairChanges?{selectedCandidatePairChanges:s.selectedCandidatePairChanges}:{}),void 0!==s.selectedCandidatePairId?{selectedCandidatePairId:s.selectedCandidatePairId}:{})),d&&(g.mediaPlayout=this._withoutUndefined({synthesizedSamplesEvents:d.synthesizedSamplesEvents,synthesizedSamplesDuration:d.synthesizedSamplesDuration,totalPlayoutDelay:d.totalPlayoutDelay,totalSamplesCount:d.totalSamplesCount,totalSamplesDuration:d.totalSamplesDuration})),u||h){const e={};if(u){const t=void 0!==u.jitter?1e3*u.jitter:void 0;let n;"number"==typeof u.totalRoundTripTime&&"number"==typeof u.roundTripTimeMeasurements&&u.roundTripTimeMeasurements>0&&(n=u.totalRoundTripTime/u.roundTripTimeMeasurements),e.inbound=this._withoutUndefined({packetsReceived:u.packetsReceived,packetsLost:u.packetsLost,fractionLost:u.fractionLost,jitter:t,roundTripTime:u.roundTripTime,totalRoundTripTime:u.totalRoundTripTime,roundTripTimeMeasurements:u.roundTripTimeMeasurements,roundTripTimeAvg:n,nackCount:u.nackCount,reportsReceived:u.reportsReceived,packetsDiscarded:u.packetsDiscarded})}h&&(e.outbound=this._withoutUndefined({packetsSent:h.packetsSent,bytesSent:h.bytesSent,reportsCount:h.reportsCount,roundTripTime:h.roundTripTime,totalPacketSendDelay:h.totalPacketSendDelay})),g.remoteRtcp=e}return g}_resolveCandidate(e,t){if(!t)return void It.debug("CallReportCollector: candidateId is empty, skipping resolve");const n=e.get(t);if(!n)return void It.debug("CallReportCollector: candidate not found in stats report",{candidateId:t});const i={};if(void 0!==n.id&&(i.id=n.id),void 0!==n.address?i.address=n.address:void 0!==n.ip&&(i.address=n.ip),void 0!==n.port&&(i.port=n.port),void 0!==n.candidateType&&(i.candidateType=n.candidateType),void 0!==n.protocol&&(i.protocol=n.protocol),void 0!==n.networkType&&(i.networkType=n.networkType),void 0!==n.url&&(i.url=n.url),void 0!==n.relayProtocol&&(i.relayProtocol=n.relayProtocol),0!==Object.keys(i).length)return i;It.debug("CallReportCollector: candidate report has no usable fields",{candidateId:t})}_getCodec(e,t){if(!t)return;const n=e.get(t);return n&&"codec"===n.type?n:void 0}_buildCodecSnapshot(e,t){const n=this._withoutUndefined(Object.assign({mimeType:e.mimeType,clockRate:e.clockRate,channels:e.channels,payloadType:e.payloadType,sdpFmtpLine:e.sdpFmtpLine},void 0!==t?{codecId:t}:{}));return Object.keys(n).length>0?n:void 0}_getOutboundMediaSource(e,t){let n;return t.mediaSourceId&&(n=e.get(t.mediaSourceId)),n||e.forEach(e=>{n||"media-source"!==e.type||"audio"!==e.kind||(n=e)}),n}_getLocalAudioTrackSnapshot(){var e,t;try{const n=null===(e=this.peerConnection)||void 0===e?void 0:e.getSenders().find(e=>{var t;return"audio"===(null===(t=e.track)||void 0===t?void 0:t.kind)}),i=null==n?void 0:n.track;if(!i)return;const r=null===(t=i.getSettings)||void 0===t?void 0:t.call(i),o=this._withoutUndefined({deviceId:null==r?void 0:r.deviceId,groupId:null==r?void 0:r.groupId,channelCount:null==r?void 0:r.channelCount,sampleRate:null==r?void 0:r.sampleRate,sampleSize:null==r?void 0:r.sampleSize,latency:null==r?void 0:r.latency,echoCancellation:null==r?void 0:r.echoCancellation,noiseSuppression:null==r?void 0:r.noiseSuppression,autoGainControl:null==r?void 0:r.autoGainControl}),a=this._withoutUndefined(Object.assign({id:i.id,label:i.label,enabled:i.enabled,muted:i.muted,readyState:i.readyState,contentHint:i.contentHint},Object.keys(o).length>0?{settings:o}:{}));return Object.keys(a).length>0?a:void 0}catch(e){return void It.debug("CallReportCollector: unable to snapshot local audio track",{error:e})}}_getOutboundAudioSourceStats(e,t){const n=this._getOutboundMediaSource(e,t);if(!n)return;const i=this._withoutUndefined({id:n.id,trackIdentifier:n.trackIdentifier,audioLevel:n.audioLevel,totalAudioEnergy:n.totalAudioEnergy,totalSamplesDuration:n.totalSamplesDuration,echoReturnLoss:n.echoReturnLoss,echoReturnLossEnhancement:n.echoReturnLossEnhancement});return Object.keys(i).length>0?i:void 0}_logLocalAudioTrackSnapshot(e,t){if(!e||0===Object.keys(e).length)return;const n=this._stableStringify(e);n!==this._lastLocalAudioTrackSnapshotJson&&(this._lastLocalAudioTrackSnapshotJson=n,It.debug("CallReportCollector: local audio track snapshot",{localTrack:e,mediaSource:t}))}_withoutUndefined(e){return Object.keys(e).reduce((t,n)=>{const i=e[n];return void 0!==i&&(t[n]=i),t},{})}_stableStringify(e){return JSON.stringify(this._sortObjectKeys(e))}_sortObjectKeys(e){return Array.isArray(e)?e.map(e=>this._sortObjectKeys(e)):e&&"object"==typeof e?Object.keys(e).sort().reduce((t,n)=>(t[n]=this._sortObjectKeys(e[n]),t),{}):e}_getOutboundAudioLevel(e,t){const n=this._getOutboundMediaSource(e,t);if(void 0!==(null==n?void 0:n.audioLevel))return n.audioLevel;if(n){const e=this._computeAudioLevelFromEnergy(n.totalAudioEnergy,n.totalSamplesDuration,"outbound");if(null!==e)return e}return this._getTrackAudioLevel(e,t.trackId)}_getInboundAudioLevel(e,t){if(void 0!==t.audioLevel)return t.audioLevel;const n=this._computeAudioLevelFromEnergy(t.totalAudioEnergy,t.totalSamplesDuration,"inbound");return null!==n?n:this._getTrackAudioLevel(e,t.trackId)}_computeAudioLevelFromEnergy(e,t,n){if(void 0===e||void 0===t)return null;const i="inbound"===n?"inboundAudioEnergy":"outboundAudioEnergy",r="inbound"===n?"inboundSamplesDuration":"outboundSamplesDuration",o=this.previousStats[i],a=this.previousStats[r];if(this.previousStats[i]=e,this.previousStats[r]=t,void 0===o||void 0===a)return null;const s=e-o,l=t-a;if(l<=0)return null;const c=Math.sqrt(s/l);return Math.min(1,Math.max(0,c))}_getTrackAudioLevel(e,t){var n;if(!t)return null;const i=e.get(t);return i&&null!==(n=i.audioLevel)&&void 0!==n?n:null}_average(e){if(0===e.length)return;const t=e.reduce((e,t)=>e+t,0);return parseFloat((t/e.length).toFixed(4))}_resetIntervalAccumulators(){this.intervalAudioLevels={outbound:[],inbound:[]},this.intervalJitters=[],this.intervalRTTs=[],this.intervalBitrates={outbound:[],inbound:[]}}}xi.INITIAL_COLLECTION_INTERVAL_MS=1e3,xi.STATS_FLUSH_THRESHOLD=300,xi.LOGS_FLUSH_THRESHOLD=800,xi.DEFAULT_INTERMEDIATE_REPORT_INTERVAL_MS=18e4,xi.CONSECUTIVE_BREACHES_REQUIRED=3,xi.THRESHOLD_RTT_MS=.4,xi.THRESHOLD_JITTER_MS=30,xi.THRESHOLD_PACKET_LOSS_PCT=1,xi.THRESHOLD_MOS=3.5,xi.THRESHOLD_LOCAL_AUDIO_LEVEL=.001,xi.CONFIRMED_LOCAL_AUDIO_SILENCE_MS=3e4,xi.THRESHOLD_INBOUND_AUDIO_LEVEL=.001,xi.WARNING_THROTTLE_MS=15e3,xi.RETRY_DELAYS_MS=[500,1e3,2e3],xi.KEEPALIVE_BODY_LIMIT_BYTES=61440;class Ci{constructor(e,t){this._buffers={local:[],remote:[]},this._bufferBytes={local:0,remote:0},this._trackStates={local:null,remote:null},this._processors=[],this._readerCancellers=[],this._flushTimerId=null,this._flushing=!1,this._stopped=!1,this._started=!1,this._startedAt=null,this._endedAt=null,this._overflowWarnedThisWindow={local:!1,remote:!1},this.onWarning=null,this._host=null,this._callReportId=null,this.options=e,this.callContext=t,this.recordingId=t.recordingId||`${t.callId}-${Date.now().toString(36)}`}start(e,t){if(!this.options.enabled||this._started)return;if("function"!=typeof MediaStreamTrackProcessor)return It.warn("CallRecorder: MediaStreamTrackProcessor unavailable — recording disabled for this call"),this._emitWarning(ze),void(this._started=!0);const n=this.options.tracks||["local","remote"];let i=0;if(n.includes("local")&&e&&(this._attach(e,"local"),i++),n.includes("remote")&&t&&(this._attach(t,"remote"),i++),0===i)return It.info("CallRecorder: no audio tracks available to record — recording idle for this call",{callId:this.callContext.callId}),void(this._started=!0);this._startedAt=new Date,this._started=!0,this._scheduleFlush(),It.info("CallRecorder: started",{callId:this.callContext.callId,tracksAttached:i,flushIntervalMs:this._flushIntervalMs(),maxBufferBytes:this._maxBufferBytes()})}stop(){this._stopped||(this._stopped=!0,this._clearFlushTimer(),this._cancelReaders(),this._endedAt=new Date,It.info("CallRecorder: stopped",{callId:this.callContext.callId,packetsBuffered:this._buffers.local.length+this._buffers.remote.length}))}postFinalReport(){return Z(this,void 0,void 0,function*(){if(!this.options.enabled)return;if(this.stop(),!this._startedAt)return void It.debug("CallRecorder: postFinalReport skipped — never started");const e=this._resolveEndpointFromContext();if(!e)return void It.debug("CallRecorder: postFinalReport skipped — no host available");const t=this.options.tracks||["local","remote"],n=this._startedAt,i=this._endedAt||new Date,r=t.flatMap(e=>{const t=this._drain(e);if(0===t.length)return[];const r=this._buildEnvelope(t,e,"final",n,i);return[{envelope:r,bodyBytes:JSON.stringify(r).length}]}),o=r.reduce((e,t)=>e+t.bodyBytes,0)<=Ci.KEEPALIVE_BODY_LIMIT_BYTES,a=(yield Promise.allSettled(r.map(({envelope:t})=>this._postRecording(e,t,o)))).find(e=>"rejected"===e.status);if(a)throw a.reason})}cleanup(){this._clearFlushTimer(),this._cancelReaders(),this._buffers={local:[],remote:[]},this._bufferBytes={local:0,remote:0},this._trackStates={local:null,remote:null}}_attach(e,t){this._trackStates[t]={ssrc:Math.floor(4294967295*Math.random())>>>0,seq:0,ts:0};try{const n=new MediaStreamTrackProcessor({track:e});this._processors.push(n);const i=n.readable.getReader();let r=!1;const o=()=>{r=!0,i.cancel().catch(()=>{}).finally(()=>{})};this._readerCancellers.push(o),(()=>{Z(this,void 0,void 0,function*(){try{for(;!r&&!this._stopped;){const{done:e,value:n}=yield i.read();if(e)break;this._onFrame(t,n)}}catch(e){this._stopped||It.warn("CallRecorder: reader loop error",{track:t,error:e})}})})()}catch(e){It.warn("CallRecorder: failed to attach track",{track:t,error:e}),this._trackStates[t]=null}}_onFrame(e,t){var n;const i=this._trackStates[e];if(!i||this._stopped)return;const r=t.numberOfFrames,o=new Float32Array(r);t.copyTo(o,{planeIndex:0}),null===(n=t.close)||void 0===n||n.call(t);const a=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);i.seq=i.seq+1&65535;const s=i.ts;i.ts+=r;const l={rtpSeq:i.seq,rtpTs:s,rtpSsrc:i.ssrc,capturedAt:(new Date).toISOString(),payloadBytes:a};this._pushPacket(l,e)}_pushPacket(e,t){const n=e.payloadBytes.length+Ci.PACKET_OVERHEAD_BYTES,i=this._maxBufferBytes(),r=this._buffers[t];if(r.push(e),this._bufferBytes[t]+=n,this._bufferBytes[t]>i){for(;r.length>1&&this._bufferBytes[t]>i;){const e=r.shift();e&&(this._bufferBytes[t]-=e.payloadBytes.length+Ci.PACKET_OVERHEAD_BYTES)}this._overflowWarnedThisWindow[t]||(this._overflowWarnedThisWindow[t]=!0,It.warn("CallRecorder: buffer overflow — oldest packets dropped",{track:t}),this._emitWarning(Ue))}}_flushIntervalMs(){var e;const t=null!==(e=this.options.flushIntervalMs)&&void 0!==e?e:15e3;return t<=0?t:Math.min(t,this._maxSafeFlushIntervalMs())}_maxSafeFlushIntervalMs(){const e=this._sampleRate()*Ci.BYTES_PER_SAMPLE+Ci.FRAMES_PER_SECOND*Ci.PACKET_OVERHEAD_BYTES;return Math.max(1e3,this._maxBufferBytes()/e*500)}_maxBufferBytes(){var e;return null!==(e=this.options.maxBufferBytes)&&void 0!==e?e:dn}_sampleRate(){var e;return null!==(e=this.options.sampleRate)&&void 0!==e?e:48e3}_scheduleFlush(){if(this._stopped||this._flushTimerId)return;const e=this._flushIntervalMs();e<=0||(this._flushTimerId=setInterval(()=>{this._periodicFlush().catch(e=>{It.error("CallRecorder: periodic flush error",{error:e})})},e))}_clearFlushTimer(){this._flushTimerId&&(clearInterval(this._flushTimerId),this._flushTimerId=null)}_cancelReaders(){for(const e of this._readerCancellers)try{e()}catch(e){}this._readerCancellers=[],this._processors=[]}_periodicFlush(){return Z(this,void 0,void 0,function*(){if(!this._flushing&&!this._stopped){this._flushing=!0;try{const e=this._resolveEndpointFromContext();if(!e)return void It.debug("CallRecorder: periodic flush skipped — no host available");const t=this.options.tracks||["local","remote"],n=this._startedAt||new Date,i=new Date;yield Promise.allSettled(t.map(t=>{const r=this._drain(t);if(0===r.length)return Promise.resolve();const o=this._buildEnvelope(r,t,"intermediate",n,i);return this._postRecording(e,o,!1).catch(e=>{It.error("CallRecorder: intermediate flush failed",{track:t,error:e})})})),this._overflowWarnedThisWindow={local:!1,remote:!1}}finally{this._flushing=!1}}})}_drain(e){const t=this._buffers[e];return this._buffers[e]=[],this._bufferBytes[e]=0,t}_resolveEndpointFromContext(){const e=this.callContext.host;return e?this._resolveEndpoint(e):this._host?this._resolveEndpoint(this._host):null}_setHost(e){this._host=e}_setCallReportId(e){e&&(this._callReportId=e)}_resolveCallReportId(){return this._callReportId||this.callContext.callReportId}_resolveEndpoint(e){const t=this.options.endpoint||"/call_recording";try{const n=new URL(e);return`${n.protocol.replace(/^ws/,"http")}//${n.host}${t}`}catch(n){return/^https?:\/\//.test(e)?`${e}${t}`:`https://${e}${t}`}}_buildEnvelope(e,t,n,i,r){let o=0;const a=e.map(e=>(o+=e.payloadBytes.length,{rtp_seq:e.rtpSeq,rtp_ts:e.rtpTs,rtp_ssrc:e.rtpSsrc,captured_at:e.capturedAt,payload_b64:this._toBase64(e.payloadBytes)}));return Object.assign(Object.assign({call_report_id:this._resolveCallReportId(),call_id:this.callContext.callId},this.callContext.voiceSdkId?{voice_sdk_id:this.callContext.voiceSdkId}:{}),{recording_id:this.recordingId,segment:n,track:t,codec:"pcm-f32-le",sample_rate:this._sampleRate(),channels:1,started_at:i.toISOString(),ended_at:r.toISOString(),packet_count:e.length,byte_count:o,packets:a})}_postRecording(e,t,n){return Z(this,void 0,void 0,function*(){const i={"Content-Type":"application/json","x-call-report-id":t.call_report_id,"x-call-id":t.call_id};t.voice_sdk_id&&(i["x-voice-sdk-id"]=t.voice_sdk_id);const r=JSON.stringify(t),o=n&&r.length<=Ci.KEEPALIVE_BODY_LIMIT_BYTES,a=this.options.fetchImpl||fetch;let s;for(let n=0;n<=Ci.RETRY_DELAYS_MS.length;n++){try{const l=yield a(e,Object.assign({method:"POST",headers:i,body:r},o?{keepalive:!0}:{}));if(l.ok)return void It.info("CallRecorder: posted",{track:t.track,segment:t.segment,attempt:n+1,status:l.status,packets:t.packet_count});{const e=yield l.text().catch(()=>"");s=new Error(`Call recording POST failed with status ${l.status}`),It.error("CallRecorder: failed to post",{track:t.track,segment:t.segment,attempt:n+1,status:l.status,error:e})}}catch(e){s=e,It.warn("CallRecorder: network error posting",{track:t.track,segment:t.segment,attempt:n+1,error:e})}const l=Ci.RETRY_DELAYS_MS[n];if(void 0===l)break;It.info("CallRecorder: retrying",{track:t.track,segment:t.segment,inMs:l,attempt:n+2}),yield new Promise(e=>setTimeout(e,l))}throw It.error("CallRecorder: exhausted retries",{track:t.track,segment:t.segment,error:s}),s instanceof Error?s:new Error("Call recording POST failed after retries")})}_emitWarning(e){var t;try{const n=gt(e);null===(t=this.onWarning)||void 0===t||t.call(this,n)}catch(t){It.warn("CallRecorder: failed to emit warning",{code:e,error:t})}}_toBase64(e){let t="";for(let n=0;n<e.length;n+=32768){const i=e.subarray(n,n+32768);t+=String.fromCharCode.apply(null,Array.from(i))}return btoa(t)}}Ci.RETRY_DELAYS_MS=[500,1e3,2e3],Ci.KEEPALIVE_BODY_LIMIT_BYTES=61440,Ci.PACKET_OVERHEAD_BYTES=160,Ci.BYTES_PER_SAMPLE=4,Ci.FRAMES_PER_SECOND=100;const Ei=e=>!e||"default"===e||"communications"===e;class Ii{constructor(e,t){this._call=e,this._recoverInput=t,this._rawDeviceCache=[],this._deviceChangeHandler=null,this._stopped=!1,this._running=!1,this._pending=!1}logDevicesAtStart(){var e,t;return Z(this,void 0,void 0,function*(){this._stopped||this._deviceChangeHandler||"undefined"!=typeof navigator&&navigator.mediaDevices&&(this._deviceChangeHandler=()=>{this._onDeviceChange()},null===(t=(e=navigator.mediaDevices).addEventListener)||void 0===t||t.call(e,"devicechange",this._deviceChangeHandler),yield this._onDeviceChange())})}stop(){var e,t;this._stopped=!0,this._deviceChangeHandler&&(null===(t=null===(e=navigator.mediaDevices)||void 0===e?void 0:e.removeEventListener)||void 0===t||t.call(e,"devicechange",this._deviceChangeHandler),this._deviceChangeHandler=null),this._rawDeviceCache=[],this._input=this._output=void 0}_usable(e,t){const n=e.filter(e=>e.kind===t);return n.some(e=>!Ei(e.deviceId))&&n.every(e=>Boolean(e.deviceId&&e.label))}_bind(e,t,n,i,r){var o;if(!t)return;if((null==e?void 0:e.owner)===t&&e.id===n)return e;if(!Ei(n))return{owner:t,id:n,physicalId:n,attempted:!1};const a=this._rawDeviceCache.filter(e=>e.kind===i);let s;if(Ei(n)){const e=r||(null===(o=a.find(e=>e.deviceId===(n||"default")))||void 0===o?void 0:o.groupId),t=a.filter(t=>e&&t.groupId===e&&!Ei(t.deviceId));1===t.length&&(s=t[0])}return s?{owner:t,id:n,physicalId:s.deviceId,attempted:!1}:void 0}_refreshBindings(){var e,t,n,i;const r=null===(n=null===(t=null===(e=this._call.peer)||void 0===e?void 0:e.instance)||void 0===t?void 0:t.getSenders().find(e=>{var t;return"audio"===(null===(t=e.track)||void 0===t?void 0:t.kind)}))||void 0===n?void 0:n.track;try{const e=null===(i=null==r?void 0:r.getSettings)||void 0===i?void 0:i.call(r);this._input=e&&(e.deviceId||e.groupId)?this._bind(this._input,r,e.deviceId||"","audioinput",e.groupId):void 0}catch(e){this._input=void 0}const o=Ft(this._call.options.remoteElement);this._output=o&&"function"==typeof o.setSinkId&&"string"==typeof o.sinkId?this._bind(this._output,o,o.sinkId,"audiooutput"):void 0}_removed(e,t,n){return Boolean(e&&!e.attempted&&this._usable(t,n)&&!t.some(t=>t.kind===n&&t.deviceId===e.physicalId))}_scan(e){var t,n;return Z(this,void 0,void 0,function*(){const i=this._rawDeviceCache;this._rawDeviceCache=["audioinput","audiooutput"].reduce((t,n)=>t.concat((this._usable(e,n)?e:i).filter(e=>e.kind===n)),[]),this._refreshBindings();const r=this._input,o=this._output,a=this._removed(r,e,"audioinput"),s=this._removed(o,e,"audiooutput");if(It.debug("MediaDeviceCollector: audio devices during call",{devices:this._rawDeviceCache,disconnected:i.filter(e=>!this._rawDeviceCache.some(t=>t.kind===e.kind&&t.deviceId===e.deviceId))}),a){r.attempted=!0;try{yield this._recoverInput()}catch(e){It.warn("Audio input disconnect recovery failed",{error:e})}}if(!this._stopped&&!this._pending){if(this._refreshBindings(),s&&this._output===o){o.attempted=!0;try{const e=yield null===(n=(t=this._call).setAudioOutDevice)||void 0===n?void 0:n.call(t,"default");this._stopped||e||It.warn("Audio output disconnect recovery failed"),e&&(this._output=void 0)}catch(e){It.warn("Audio output disconnect recovery failed",{error:e})}}this._stopped||this._pending||this._refreshBindings()}})}_onDeviceChange(){return Z(this,void 0,void 0,function*(){if(!this._stopped&&(this._pending=!0,!this._running)){this._running=!0;try{for(;this._pending&&!this._stopped;){this._pending=!1;try{const e=yield navigator.mediaDevices.enumerateDevices();if(this._stopped)return void It.debug("MediaDeviceCollector: stopped before applying enumeration",{callId:this._call.id});if(this._pending){It.debug("MediaDeviceCollector: skipping superseded enumeration",{callId:this._call.id});continue}yield this._scan(e)}catch(e){It.debug("MediaDeviceCollector: enumerate/devices failed",{error:e})}}}finally{this._running=!1}}})}}var Ti,Ri=_t(function(e,t){var n;function i(){}function r(){r.init.call(this)}function o(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function a(e,t,n,r){var a,s,l;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),l=s[t]):(s=e._events=new i,e._eventsCount=0),l){if("function"==typeof l?l=s[t]=r?[n,l]:[l,n]:r?l.unshift(n):l.push(n),!l.warned&&(a=o(e))&&0<a&&l.length>a){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=l.length,function(e){"function"==typeof console.warn?console.warn(e):console.log(e)}(c)}}else l=s[t]=n,++e._eventsCount;return e}function s(e,t,n){function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}var r=!1;return i.listener=n,i}function l(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function c(e,t){for(var n=Array(t);t--;)n[t]=e[t];return n}Object.defineProperty(t,"__esModule",{value:!0}),i.prototype=Object.create(null),r.EventEmitter=r,r.usingDomains=!1,r.prototype.domain=void 0,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.init=function(){this.domain=null,r.usingDomains&&n.active&&!(this instanceof n.Domain)&&(this.domain=n.active),this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new i,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(e){var t,n,i,r,o,a,s,l="error"===e;if(a=this._events)l=l&&null==a.error;else if(!l)return!1;if(s=this.domain,l){if(t=arguments[1],!s){if(t instanceof Error)throw t;var d=new Error('Uncaught, unspecified "error" event. ('+t+")");throw d.context=t,d}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(n=a[e]))return!1;var u="function"==typeof n;switch(i=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var i=e.length,r=c(e,i),o=0;o<i;++o)r[o].call(n)}(n,u,this);break;case 2:!function(e,t,n,i){if(t)e.call(n,i);else for(var r=e.length,o=c(e,r),a=0;a<r;++a)o[a].call(n,i)}(n,u,this,arguments[1]);break;case 3:!function(e,t,n,i,r){if(t)e.call(n,i,r);else for(var o=e.length,a=c(e,o),s=0;s<o;++s)a[s].call(n,i,r)}(n,u,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,i,r,o){if(t)e.call(n,i,r,o);else for(var a=e.length,s=c(e,a),l=0;l<a;++l)s[l].call(n,i,r,o)}(n,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];!function(e,t,n,i){if(t)e.apply(n,i);else for(var r=e.length,o=c(e,r),a=0;a<r;++a)o[a].apply(n,i)}(n,u,this,r)}return!0},r.prototype.addListener=function(e,t){return a(this,e,t,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(e,t){return a(this,e,t,!0)},r.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,s(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,s(this,e,t)),this},r.prototype.removeListener=function(e,t){var n,r,o,a,s;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new i:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,a=n.length;0<a--;)if(n[a]===t||n[a].listener&&n[a].listener===t){s=n[a].listener,o=a;break}if(0>o)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new i,this;delete r[e]}else!function(e,t){for(var n=t,i=n+1,r=e.length;i<r;n+=1,i+=1)e[n]=e[i];e.pop()}(n,o);r.removeListener&&this.emit("removeListener",e,s||t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new i,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new i:delete n[e]),this;if(0===arguments.length){for(var r,o=Object.keys(n),a=0;a<o.length;++a)"removeListener"!==(r=o[a])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new i,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},r.prototype.listeners=function(e){var t,n,i=this._events;return n=i&&(t=i[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[],n},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},r.prototype.listenerCount=l,r.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]};var d,u=new Uint8Array(16);function h(){if(!d&&!(d="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return d(u)}for(var p=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,f=[],g=0;256>g;++g)f.push((g+256).toString(16).substr(1));function m(e,t,n){var i=(e=e||{}).random||(e.rng||h)();if(i[6]=64|15&i[6],i[8]=128|63&i[8],t){n=n||0;for(var r=0;16>r;++r)t[n+r]=i[r];return t}return function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,n=(f[e[t+0]]+f[e[t+1]]+f[e[t+2]]+f[e[t+3]]+"-"+f[e[t+4]]+f[e[t+5]]+"-"+f[e[t+6]]+f[e[t+7]]+"-"+f[e[t+8]]+f[e[t+9]]+"-"+f[e[t+10]]+f[e[t+11]]+f[e[t+12]]+f[e[t+13]]+f[e[t+14]]+f[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&p.test(e)}(n))throw TypeError("Stringified UUID is invalid");return n}(i)}function v(e,t){if(!e||!t)return{};const n={...e};if(n.localCandidateId){const e=t.get(n.localCandidateId);n.local={...e}}if(n.remoteCandidateId){const e=t.get(n.remoteCandidateId);n.remote={...e}}return n}function b(e,t,n){return 8*function(e,t,n){const i=e[n],r=t?t[n]:null;return null===i||null===r?null:(i-r)/(e.timestamp-t.timestamp)*1e3}(e,t,n)}function y(e){if(!e.entries)return e;const t={};return e.forEach(function(e,n){t[n]=e}),t}function w(e,t,n={}){if(!e)return null;let i={audio:{inbound:[],outbound:[]},video:{inbound:[],outbound:[]},connection:{inbound:[],outbound:[]}};n.remote&&(i.remote={audio:{inbound:[],outbound:[]},video:{inbound:[],outbound:[]}});for(const t of e.values())switch(t.type){case"outbound-rtp":{const n=t.mediaType||t.kind,r={};let o={};if(!["audio","video"].includes(n))continue;if(t.codecId){const n=e.get(t.codecId);n&&(r.clockRate=n.clockRate,r.mimeType=n.mimeType,r.payloadType=n.payloadType)}o=e.get(t.mediaSourceId)||e.get(t.trackId)||{},i[n].outbound.push({...t,...r,track:{...o}});break}case"inbound-rtp":{let n=t.mediaType||t.kind,r={};const o={};if(!["audio","video"].includes(n))if(t.id.includes("Video"))n="video";else{if(!t.id.includes("Audio"))continue;n="audio"}if(t.codecId){const n=e.get(t.codecId);n&&(o.clockRate=n.clockRate,o.mimeType=n.mimeType,o.payloadType=n.payloadType)}if(!i.connection.id&&t.transportId){const n=e.get(t.transportId);if(n&&n.selectedCandidatePairId){const t=e.get(n.selectedCandidatePairId);i.connection=v(t,e)}}r=e.get(t.mediaSourceId)||e.get(t.trackId)||{},i[n].inbound.push({...t,...o,track:{...r}});break}case"peer-connection":i.connection.dataChannelsClosed=t.dataChannelsClosed,i.connection.dataChannelsOpened=t.dataChannelsOpened;break;case"remote-inbound-rtp":{if(!n.remote)break;let r=t.mediaType||t.kind;const o={};if(!["audio","video"].includes(r))if(t.id.includes("Video"))r="video";else{if(!t.id.includes("Audio"))continue;r="audio"}if(t.codecId){const n=e.get(t.codecId);n&&(o.clockRate=n.clockRate,o.mimeType=n.mimeType,o.payloadType=n.payloadType)}if(!i.connection.id&&t.transportId){const n=e.get(t.transportId);if(n&&n.selectedCandidatePairId){const t=e.get(n.selectedCandidatePairId);i.connection=v(t,e)}}i.remote[r].inbound.push({...t,...o});break}case"remote-outbound-rtp":{if(!n.remote)break;const r=t.mediaType||t.kind,o={};if(!["audio","video"].includes(r))continue;if(t.codecId){const n=e.get(t.codecId);n&&(o.clockRate=n.clockRate,o.mimeType=n.mimeType,o.payloadType=n.payloadType)}i.remote[r].outbound.push({...t,...o});break}}if(!i.connection.id)for(const t of e.values())"candidate-pair"===t.type&&t.nominated&&"succeeded"===t.state&&(i.connection=v(t,e));return i=function(e,t){return t?(e.audio.inbound.map(e=>{let n=t.audio.inbound.find(t=>t.id===e.id);e.bitrate=b(e,n,"bytesReceived"),e.packetRate=b(e,n,"packetsReceived")}),e.audio.outbound.map(e=>{let n=t.audio.outbound.find(t=>t.id===e.id);e.bitrate=b(e,n,"bytesSent"),e.packetRate=b(e,n,"packetsSent")}),e.video.inbound.map(e=>{let n=t.video.inbound.find(t=>t.id===e.id);e.bitrate=b(e,n,"bytesReceived"),e.packetRate=b(e,n,"packetsReceived")}),e.video.outbound.map(e=>{let n=t.video.outbound.find(t=>t.id===e.id);e.bitrate=b(e,n,"bytesSent"),e.packetRate=b(e,n,"packetsSent")}),e):e}(i,t),i}let k,_={},S=[];t.WebRTCStats=class extends r{constructor(e){if(super(),this.monitoringSetInterval=0,this.connectionMonitoringSetInterval=0,this.connectionMonitoringInterval=1e3,this.remote=!0,this.peersToMonitor={},this.timeline=[],this.statsToMonitor=["inbound-rtp","outbound-rtp","remote-inbound-rtp","remote-outbound-rtp","peer-connection","data-channel","stream","track","sender","receiver","transport","candidate-pair","local-candidate","remote-candidate"],"undefined"==typeof window)throw new Error("WebRTCStats only works in browser");const t={...e};this.isEdge=!!window.RTCIceGatherer,this.getStatsInterval=t.getStatsInterval||1e3,this.rawStats=!!t.rawStats,this.statsObject=!!t.statsObject,this.filteredStats=!!t.filteredStats,this.shouldWrapGetUserMedia=!!t.wrapGetUserMedia,"boolean"==typeof t.remote&&(this.remote=t.remote),this.debug=!!t.debug,this.logLevel=t.logLevel||"none",this.shouldWrapGetUserMedia&&this.wrapGetUserMedia()}async addPeer(e,t){return console.warn("The addPeer() method has been deprecated, please use addConnection()"),this.addConnection({peerId:e,pc:t})}async addConnection(e){const{pc:t,peerId:n}=e;let{connectionId:i,remote:r}=e;if(r="boolean"==typeof r?r:this.remote,!(t&&t instanceof RTCPeerConnection))throw new Error("Missing argument 'pc' or is not of instance RTCPeerConnection");if(!n)throw new Error("Missing argument peerId");if(this.isEdge)throw new Error("Can't monitor peers in Edge at this time.");if(this.peersToMonitor[n]){if(i&&i in this.peersToMonitor[n])throw new Error(`We are already monitoring connection with id ${i}.`);for(let e in this.peersToMonitor[n]){const i=this.peersToMonitor[n][e];if(i.pc===t)throw new Error(`We are already monitoring peer with id ${n}.`);"closed"===i.pc.connectionState&&this.removeConnection({pc:i.pc})}}const o=t.getConfiguration();return o.iceServers&&o.iceServers.forEach(function(e){delete e.credential}),i||(i=m()),this.emitEvent({event:"addConnection",tag:"peer",peerId:n,connectionId:i,data:{options:e,peerConfiguration:o}}),this.monitorPeer({peerId:n,connectionId:i,pc:t,remote:r}),{connectionId:i}}getTimeline(e){return this.timeline=this.timeline.sort((e,t)=>e.timestamp.getTime()-t.timestamp.getTime()),e?this.timeline.filter(t=>t.tag===e):this.timeline}get logger(){const e=e=>{const t=["none","error","warn","info","debug"];return t.slice(0,t.indexOf(this.logLevel)+1).indexOf(e)>-1};return{error(...t){this.debug&&e("error")&&console.error("[webrtc-stats][error] ",...t)},warn(...t){this.debug&&e("warn")&&console.warn("[webrtc-stats][warn] ",...t)},info(...t){this.debug&&e("info")&&console.log("[webrtc-stats][info] ",...t)},debug(...t){this.debug&&e("debug")&&console.debug("[webrtc-stats][debug] ",...t)}}}removeConnection(e){let t,{connectionId:n,pc:i}=e;if(!i&&!n)throw new Error("Missing arguments. You need to either send pc or a connectionId.");if(n){if("string"!=typeof n)throw new Error("connectionId must be a string.");for(let e in this.peersToMonitor)n in this.peersToMonitor[e]&&(i=this.peersToMonitor[e][n].pc,t=e)}else if(i){if(!(i instanceof RTCPeerConnection))throw new Error("pc must be an instance of RTCPeerConnection.");for(let e in this.peersToMonitor)for(let r in this.peersToMonitor[e])this.peersToMonitor[e][r].pc===i&&(n=r,t=e)}if(!i||!n)throw new Error("Could not find the desired connection.");return this.removePeerConnectionEventListeners(n,i),delete this.peersToMonitor[t][n],0===Object.values(this.peersToMonitor[t]).length&&delete this.peersToMonitor[t],{connectionId:n}}removeAllPeers(){for(let e in this.peersToMonitor)this.removePeer(e)}removePeer(e){if(this.logger.info(`Removing PeerConnection with id ${e}.`),this.peersToMonitor[e]){for(let t in this.peersToMonitor[e]){let n=this.peersToMonitor[e][t].pc;this.removePeerConnectionEventListeners(t,n)}delete this.peersToMonitor[e]}}destroy(){this.removeAllPeers(),S.forEach(e=>{this.removeTrackEventListeners(e)}),S=[],this.shouldWrapGetUserMedia&&k&&(navigator.mediaDevices.getUserMedia=k)}monitorPeer(e){let{peerId:t,connectionId:n,pc:i,remote:r}=e;if(!i)return void this.logger.warn("Did not receive pc argument when calling monitorPeer()");const o={pc:i,connectionId:n,stream:null,stats:{parsed:null,raw:null},options:{remote:r}};if(this.peersToMonitor[t]){if(n in this.peersToMonitor[t])return void this.logger.warn(`Already watching connection with ID ${n}`);this.peersToMonitor[t][n]=o}else this.peersToMonitor[t]={[n]:o};this.addPeerConnectionEventListeners(t,n,i),1===this.numberOfMonitoredPeers&&(this.startStatsMonitoring(),this.startConnectionStateMonitoring())}startStatsMonitoring(){this.monitoringSetInterval||(this.monitoringSetInterval=window.setInterval(()=>{this.numberOfMonitoredPeers||this.stopStatsMonitoring(),this.getStats().then(e=>{e.forEach(e=>{this.emitEvent(e)})})},this._getStatsInterval))}stopStatsMonitoring(){this.monitoringSetInterval&&(window.clearInterval(this.monitoringSetInterval),this.monitoringSetInterval=0)}async getStats(e=null){this.logger.info(e?`Getting stats from peer ${e}`:"Getting stats from all peers");let t={};if(e){if(!this.peersToMonitor[e])throw new Error(`Cannot get stats. Peer with id ${e} does not exist`);t[e]=this.peersToMonitor[e]}else t=this.peersToMonitor;let n=[];for(const i in t)for(const r in t[i]){const o=t[i][r],a=o.pc;if(a&&!this.checkIfConnectionIsClosed(i,r,a))try{const e=this.getTimestamp(),t=a.getStats(null);if(t){const a=await t,s=this.getTimestamp(),l=y(a),c={remote:o.options.remote},d=w(a,o.stats.parsed,c),u={event:"stats",tag:"stats",peerId:i,connectionId:r,timeTaken:s-e,data:d};!0===this.rawStats&&(u.rawStats=a),!0===this.statsObject&&(u.statsObject=l),!0===this.filteredStats&&(u.filteredStats=this.filteroutStats(l)),n.push(u),o.stats.parsed=d}else this.logger.error(`PeerConnection from peer ${i} did not return any stats data`)}catch(e){this.logger.error(e)}}return n}startConnectionStateMonitoring(){this.connectionMonitoringSetInterval=window.setInterval(()=>{this.numberOfMonitoredPeers||this.stopConnectionStateMonitoring();for(const e in this.peersToMonitor)for(const t in this.peersToMonitor[e]){const n=this.peersToMonitor[e][t].pc;this.checkIfConnectionIsClosed(e,t,n)}},this.connectionMonitoringInterval)}checkIfConnectionIsClosed(e,t,n){const i=this.isConnectionClosed(n);if(i){this.removeConnection({pc:n});let i="closed"===n.connectionState?"onconnectionstatechange":"oniceconnectionstatechange";this.emitEvent({event:i,peerId:e,connectionId:t,tag:"connection",data:"closed"})}return i}isConnectionClosed(e){return"closed"===e.connectionState||"closed"===e.iceConnectionState}stopConnectionStateMonitoring(){this.connectionMonitoringSetInterval&&(window.clearInterval(this.connectionMonitoringSetInterval),this.connectionMonitoringSetInterval=0)}wrapGetUserMedia(){if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)return void this.logger.warn("'navigator.mediaDevices.getUserMedia' is not available in browser. Will not wrap getUserMedia.");this.logger.info("Wrapping getUsermedia functions."),k=navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);const e=this.parseGetUserMedia.bind(this);navigator.mediaDevices.getUserMedia=function(){return e({constraints:arguments[0]}),k.apply(navigator.mediaDevices,arguments).then(t=>(e({stream:t}),t),t=>(e({error:t}),Promise.reject(t)))}.bind(navigator.mediaDevices)}filteroutStats(e={}){const t={...e};for(const e in t){var n=t[e];this.statsToMonitor.includes(n.type)||delete t[e]}return t}get peerConnectionListeners(){return{icecandidate:(e,t,n,i)=>{this.logger.debug("[pc-event] icecandidate | peerId: ${peerId}",i),this.emitEvent({event:"onicecandidate",tag:"connection",peerId:e,connectionId:t,data:i.candidate})},track:(e,t,n,i)=>{this.logger.debug(`[pc-event] track | peerId: ${e}`,i);const r=i.track,o=i.streams[0];e in this.peersToMonitor&&t in this.peersToMonitor[e]&&(this.peersToMonitor[e][t].stream=o),this.addTrackEventListeners(r,t),this.emitEvent({event:"ontrack",tag:"track",peerId:e,connectionId:t,data:{stream:o?this.getStreamDetails(o):null,track:r?this.getMediaTrackDetails(r):null,title:i.track.kind+":"+i.track.id+" "+i.streams.map(function(e){return"stream:"+e.id})}})},signalingstatechange:(e,t,n)=>{this.logger.debug(`[pc-event] signalingstatechange | peerId: ${e}`),this.emitEvent({event:"onsignalingstatechange",tag:"connection",peerId:e,connectionId:t,data:{signalingState:n.signalingState,localDescription:n.localDescription,remoteDescription:n.remoteDescription}})},iceconnectionstatechange:(e,t,n)=>{this.logger.debug(`[pc-event] iceconnectionstatechange | peerId: ${e}`),this.emitEvent({event:"oniceconnectionstatechange",tag:"connection",peerId:e,connectionId:t,data:n.iceConnectionState})},icegatheringstatechange:(e,t,n)=>{this.logger.debug(`[pc-event] icegatheringstatechange | peerId: ${e}`),this.emitEvent({event:"onicegatheringstatechange",tag:"connection",peerId:e,connectionId:t,data:n.iceGatheringState})},icecandidateerror:(e,t,n,i)=>{this.logger.debug(`[pc-event] icecandidateerror | peerId: ${e}`),this.emitEvent({event:"onicecandidateerror",tag:"connection",peerId:e,connectionId:t,error:{errorCode:i.errorCode}})},connectionstatechange:(e,t,n)=>{this.logger.debug(`[pc-event] connectionstatechange | peerId: ${e}`),this.emitEvent({event:"onconnectionstatechange",tag:"connection",peerId:e,connectionId:t,data:n.connectionState})},negotiationneeded:(e,t,n)=>{this.logger.debug(`[pc-event] negotiationneeded | peerId: ${e}`),this.emitEvent({event:"onnegotiationneeded",tag:"connection",peerId:e,connectionId:t})},datachannel:(e,t,n,i)=>{this.logger.debug(`[pc-event] datachannel | peerId: ${e}`,i),this.emitEvent({event:"ondatachannel",tag:"datachannel",peerId:e,connectionId:t,data:i.channel})}}}addPeerConnectionEventListeners(e,t,n){this.logger.debug(`Adding event listeners for peer ${e} and connection ${t}.`),_[t]={},Object.keys(this.peerConnectionListeners).forEach(i=>{_[t][i]=this.peerConnectionListeners[i].bind(this,e,t,n),n.addEventListener(i,_[t][i],!1)})}parseGetUserMedia(e){try{const t={event:"getUserMedia",tag:"getUserMedia",data:{...e}};e.stream&&(t.data.details=this.parseStream(e.stream),e.stream.getTracks().map(e=>{this.addTrackEventListeners(e),S.push(e)})),this.emitEvent(t)}catch(e){}}parseStream(e){const t={audio:[],video:[]};return e.getTracks().forEach(e=>{t[e.kind].push(this.getMediaTrackDetails(e))}),t}getMediaTrackDetails(e){return{enabled:e.enabled,id:e.id,contentHint:e.contentHint,kind:e.kind,label:e.label,muted:e.muted,readyState:e.readyState,constructorName:e.constructor.name,capabilities:e.getCapabilities?e.getCapabilities():{},constraints:e.getConstraints?e.getConstraints():{},settings:e.getSettings?e.getSettings():{},_track:e}}getStreamDetails(e){return{active:e.active,id:e.id,_stream:e}}getTrackEventObject(e){return{mute:t=>{this.emitEvent({event:"mute",tag:"track",connectionId:e,data:{event:t}})},unmute:t=>{this.emitEvent({event:"unmute",tag:"track",connectionId:e,data:{event:t}})},overconstrained:t=>{this.emitEvent({event:"overconstrained",tag:"track",connectionId:e,data:{event:t}})},ended:t=>{this.emitEvent({event:"ended",tag:"track",connectionId:e,data:{event:t}}),this.removeTrackEventListeners(t.target)}}}addTrackEventListeners(e,t){_[e.id]={};const n=this.getTrackEventObject(t);Object.keys(n).forEach(t=>{_[e.id][t]=n[t].bind(this),e.addEventListener(t,_[e.id][t])}),_[e.id].readyState=setInterval(()=>{if("ended"===e.readyState){let t=new CustomEvent("ended",{detail:{check:"readyState"}});e.dispatchEvent(t)}},1e3)}removeTrackEventListeners(e){if(e.id in _){const t=this.getTrackEventObject();Object.keys(t).forEach(t=>{e.removeEventListener(t,_[e.id][t])}),clearInterval(_[e.id].readyState),delete _[e.id]}}addToTimeline(e){this.timeline.push(e),this.emit("timeline",e)}emitEvent(e){const t={...e,timestamp:new Date};this.addToTimeline(t),t.tag&&this.emit(t.tag,t)}set getStatsInterval(e){if(!Number.isInteger(e))throw new Error(`getStatsInterval should be an integer, got: ${e}`);this._getStatsInterval=e,this.monitoringSetInterval&&(this.stopStatsMonitoring(),this.startStatsMonitoring())}get numberOfMonitoredPeers(){return Object.keys(this.peersToMonitor).length}removePeerConnectionEventListeners(e,t){e in _&&(Object.keys(this.peerConnectionListeners).forEach(n=>{t.removeEventListener(n,_[e][n],!1)}),delete _[e]),t.getSenders().forEach(e=>{e.track&&this.removeTrackEventListeners(e.track)}),t.getReceivers().forEach(e=>{e.track&&this.removeTrackEventListeners(e.track)})}getTimestamp(){return Date.now()}wrapGetDisplayMedia(){const e=this;if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia){const t=navigator.mediaDevices.getDisplayMedia.bind(navigator.mediaDevices),n=function(){return e.debug("navigator.mediaDevices.getDisplayMedia",null,arguments[0]),t.apply(navigator.mediaDevices,arguments).then(function(e){return e},function(t){return e.debug("navigator.mediaDevices.getDisplayMediaOnFailure",null,t.name),Promise.reject(t)})};navigator.mediaDevices.getDisplayMedia=n.bind(navigator.mediaDevices)}}}});(Ti=Ri)&&Ti.__esModule&&Object.prototype.hasOwnProperty.call(Ti,"default")&&Ti.default;var Ni=Ri.WebRTCStats;function Oi(e){return isNaN(e)?null:e>4.2?"excellent":e>=4.1&&e<=4.2?"good":e>=3.7&&e<=4?"fair":e>=3.1&&e<=3.6?"poor":"bad"}class Ai extends Rn{constructor(e,t){super(),this.buildRequest({type:"debug_report_start",debug_report_id:e,debug_report_version:1,call_id:t})}}class Li extends Rn{constructor(e,t){super(),this.buildRequest({type:"debug_report_stop",debug_report_id:e,debug_report_version:1,call_id:t})}}class Di extends Rn{constructor(e,t,n){super(),this.buildRequest({type:"debug_report_data",debug_report_id:e,debug_report_version:1,call_id:t,debug_report_data:n})}}const Pi=(e,t)=>{const{contentType:n,canvasType:i,callID:r,canvasInfo:o=null,currentLayerIdx:a=-1}=t;o&&"mcu-personal-canvas"!==i&&delete o.memberID;const s={type:cn.conferenceUpdate,call:e.calls[r],canvasInfo:Mi(o),currentLayerIdx:a};switch(n){case"layer-info":{const t=Object.assign({action:fn.LayerInfo},s);Cn(ut.Notification,t,e.uuid);break}case"layout-info":{const t=Object.assign({action:fn.LayoutInfo},s);Cn(ut.Notification,t,e.uuid);break}}},Mi=e=>{const t=JSON.stringify(e).replace(/memberID/g,"participantId").replace(/ID"/g,'Id"').replace(/POS"/g,'Pos"');return Lt(t)},Fi=["new-call-start","new-peer","get-user-media","peer-creation-end","start-negotiation","create-offer","create-answer","set-local-description","ice-gathering-started","first-candidate","first-non-host-candidate","send-sdp","ice-gathering-completed","ringing","telnyx-rtc-media","first-remote-media-track","set-remote-description","telnyx-rtc-answer","ice-connected","dtls-connected","call-active","answer-called"],ji={"new-call-start":"Call Start","new-peer":"Peer object created","get-user-media":"Media devices acquired","peer-creation-end":"Peer setup complete","start-negotiation":"SDP negotiation started","create-offer":"SDP offer generated","create-answer":"SDP answer generated","set-local-description":"Local description applied","ice-gathering-started":"ICE candidate gathering started","first-candidate":"First ICE candidate found","first-non-host-candidate":"First server-reflexive/relay candidate found","send-sdp":"SDP sent to server","ice-gathering-completed":"All ICE candidates gathered",ringing:"Remote side ringing","telnyx-rtc-media":"Early media received from server","first-remote-media-track":"First remote audio/video track received","set-remote-description":"Remote description applied","telnyx-rtc-answer":"Call answered by remote side","ice-connected":"ICE connection established","dtls-connected":"Secure media channel established (DTLS)","call-active":"Call is active","answer-called":"Answer delay (invite → call.answer)"};function zi(e,t){return`telnyx:call:${e}:${t}`}function Ui(e){try{const t=performance.getEntriesByName(e,"mark");return t.length>0?t[0].startTime:void 0}catch(e){return}}function $i(e,t,n){const i=Ui(zi(e,"new-call-start"));if(void 0===i)return{mode:t,direction:n,steps:[]};const r=[];for(const t of Fi){if("new-call-start"===t)continue;const n=Ui(zi(e,t));void 0!==n&&r.push({label:ji[t]||t,fromStart:n-i})}r.sort((e,t)=>e.fromStart-t.fromStart);const o=[];let a=0;for(const e of r)o.push({label:e.label,fromStart:e.fromStart,delta:e.fromStart-a}),a=e.fromStart;return{mode:t,direction:n,steps:o}}function Bi(e){for(const t of Fi)try{performance.clearMarks(zi(e,t))}catch(e){It.warn("Clearing performance marks is failed")}}class Hi{constructor(e,t,n,i,r){this.type=e,this.options=t,this.statsReporter=null,this.isIceRestarting=!1,this.iceDone=!1,this._negotiating=!1,this._prevConnectionState=null,this._restartedIceOnConnectionStateFailed=!1,this._sleepWakeupIntervalId=null,this._iceGatheringSafetyTimeout=null,this._gatheredCandidatesCount=0,this._firstMediaTrackMarked=!1,this._timingsCollected=!1,this._iceRestartTimeoutId=null,this.handleConnectionStateChange=()=>Z(this,void 0,void 0,function*(){var e,t;if(!this.instance)return void It.debug("Connection state change ignored: instance is null");const{connectionState:n}=this.instance;if(It.info(`[${(new Date).toISOString()}] Connection State changed: ${this._prevConnectionState} -> ${n}`),"failed"!==n&&"disconnected"!==n||(this.isDebugEnabled&&this.statsReporter&&function(e,t){return Z(this,void 0,void 0,function*(){const n={connectionState:e.connectionState,previousConnectionState:t,iceConnectionState:e.iceConnectionState,iceGatheringState:e.iceGatheringState,signalingState:e.signalingState},i=e.getTransceivers();if(i.length>0){const e=i[0].sender,t=null==e?void 0:e.transport;t&&(n.dtlsState=t.state)}e.sctp&&(n.sctpState=e.sctp.state);try{const t=yield e.getStats();t.forEach(e=>{"candidate-pair"===e.type&&"succeeded"===e.state&&(n.candidatePairState=e.state,t.forEach(t=>{"local-candidate"===t.type&&t.id===e.localCandidateId&&(n.localCandidateType=t.candidateType,n.selectedCandidatePair=n.selectedCandidatePair||{local:{},remote:{}},n.selectedCandidatePair.local={address:t.address,port:t.port,protocol:t.protocol,candidateType:t.candidateType}),"remote-candidate"===t.type&&t.id===e.remoteCandidateId&&(n.remoteCandidateType=t.candidateType,n.selectedCandidatePair=n.selectedCandidatePair||{local:{},remote:{}},n.selectedCandidatePair.remote={address:t.address,port:t.port,protocol:t.protocol,candidateType:t.candidateType})})),"transport"===e.type&&(n.dtlsCipher=e.dtlsCipher,n.srtpCipher=e.srtpCipher,n.tlsVersion=e.tlsVersion,e.dtlsState&&(n.dtlsState=e.dtlsState))})}catch(e){It.error("Error gathering connection state details:",e)}return n})}(this.instance,this._prevConnectionState).then(e=>{this.statsReporter.reportConnectionStateChange(e)}),null===(t=(e=this._session).reportPeerFailure)||void 0===t||t.call(e,this.options.id,"connection_failed")),"disconnected"===n){const e=gt($e);Cn(ut.Warning,{warning:e,callId:this.options.id,sessionId:this._session.sessionid},this.options.id)}if("failed"===n){const e=gt(We);Cn(ut.PeerConnectionFailureError,{warning:e,error:new Error(`Peer Connection failed. previous state: ${this._prevConnectionState}, current state: ${n}`),sessionId:this._session.sessionid},this.options.id)}this._prevConnectionState=n,"connected"===n&&(performance.mark(zi(this.options.id,"dtls-connected")),this.tryCollectTimings(),this._restartedIceOnConnectionStateFailed=!1),this._isTrickleIce()&&("connecting"===n&&performance.mark(zi(this.options.id,"peer-connection-connecting")),"connected"===n&&(this._clearIceGatheringSafetyTimeout(),performance.mark(zi(this.options.id,"peer-connection-connected"))))}),this._handleIceConnectionStateChange=()=>{var e,t;if(!this.instance)return void It.debug("ICE connection state change ignored: instance is null");const n=this.instance.iceConnectionState;It.debug(`[${(new Date).toISOString()}] ICE Connection State`,n),"connected"===n&&performance.mark(zi(this.options.id,"ice-connected")),"failed"===n&&(null===(t=(e=this._session).reportPeerFailure)||void 0===t||t.call(e,this.options.id,"ice_failed"))},this._handleIceGatheringStateChange=()=>{const e=this.instance.iceGatheringState;It.debug(`[${(new Date).toISOString()}] ICE Gathering State`,e),"gathering"===e?(this._gatheredCandidatesCount=0,this._startIceGatheringSafetyTimeout()):"complete"===e&&this._clearIceGatheringSafetyTimeout()},this._setCodecs=(e,t)=>{if(e.setCodecPreferences)return e.setCodecPreferences(t)},It.debug("New Peer with type:",this.type,"Options:",this.options),this._constraints={offerToReceiveAudio:!0,offerToReceiveVideo:!!t.video},this.handleSignalingStateChangeEvent=this.handleSignalingStateChangeEvent.bind(this),this.handleNegotiationNeededEvent=this.handleNegotiationNeededEvent.bind(this),this.handleTrackEvent=this.handleTrackEvent.bind(this),this.createPeerConnection=this.createPeerConnection.bind(this),this._session=n,this._trickleIceSdpFn=i,this._registerPeerEvents=r}finishIceRestart(){this.isIceRestarting&&(this.isIceRestarting=!1,this._iceRestartTimeoutId&&(clearTimeout(this._iceRestartTimeoutId),this._iceRestartTimeoutId=null))}restartIce(){return this.instance?this.isIceRestarting?(It.debug("ICE restart: already in progress, skipping"),{started:!1,reason:"already in progress"}):this._session.connected?(this.isIceRestarting=!0,this._restartedIceOnConnectionStateFailed=!0,this.instance.restartIce(),this.iceDone=!1,this._iceRestartTimeoutId=setTimeout(()=>{this.isIceRestarting&&(It.warn("ICE restart: Modify exchange timed out, clearing isIceRestarting flag"),this.isIceRestarting=!1),this._iceRestartTimeoutId=null},Hi.ICE_RESTART_TIMEOUT_MS),It.info("ICE restart: initiated by signaling health monitor"),{started:!0}):(It.debug("ICE restart: session not connected, skipping"),{started:!1,reason:"session not connected"}):(It.warn("ICE restart: no RTCPeerConnection instance"),{started:!1,reason:"no RTCPeerConnection instance"})}get isOffer(){return this.type===an.Offer}get isAnswer(){return this.type===an.Answer}get isDebugEnabled(){return this.options.debug||this._session.options.debug}get debugOutput(){return this.options.debugOutput||this._session.options.debugOutput}get restartedIceOnConnectionStateFailed(){return this._restartedIceOnConnectionStateFailed}get callEstablishmentTimings(){return this._callEstablishmentTimings}isConnectionHealthy(){return!!this.instance&&"connected"===this.instance.connectionState&&"connected"===this.instance.iceConnectionState&&"closed"!==this.instance.signalingState}startNegotiation(){performance.mark(zi(this.options.id,"start-negotiation")),this._negotiating=!0,this._isOffer()||this.isIceRestarting?this._createOffer().catch(e=>this._emitNegotiationError(e)):this._createAnswer().catch(e=>this._emitNegotiationError(e))}startTrickleIceNegotiation(){return Z(this,void 0,void 0,function*(){performance.mark(zi(this.options.id,"start-negotiation")),this._negotiating=!0,this._isOffer()||this.isIceRestarting?yield this._createOffer().then(this._trickleIceSdpFn.bind(this)):yield this._createAnswer().then(this._trickleIceSdpFn.bind(this))})}_emitNegotiationError(e){e instanceof mt&&Cn(ut.Error,{error:e,sessionId:this._session.sessionid},this.options.id)}_logTransceivers(){this.instance?(It.info("Number of transceivers:",this.instance.getTransceivers().length),this.instance.getTransceivers().forEach((e,t)=>{It.info(`>> Transceiver [${t}]:`,e.mid,e.direction,e.stopped),It.info(`>> Sender Params [${t}]:`,JSON.stringify(e.sender.getParameters(),null,2))})):It.warn("Cannot log transceivers: peer connection is null")}handleSignalingStateChangeEvent(){switch(It.info("signalingState:",this.instance.signalingState),this.instance.signalingState){case"stable":this._negotiating=!1;break;case"closed":Cn(ut.PeerConnectionSignalingStateClosed,{sessionId:this._session.sessionid},this.options.id),this.instance&&(It.debug(`[${this.options.id}] Closing peer due to signalingState closed`),this.close());break;default:this._negotiating=!0}}handleNegotiationNeededEvent(){It.info("Negotiation needed event"),"stable"!==this.instance.signalingState||this._negotiating?It.debug("Skipping negotiation, state:",this.instance.signalingState,"negotiating:",this._negotiating):this._isTrickleIce()?this.startTrickleIceNegotiation().catch(e=>this._emitNegotiationError(e)):this.startNegotiation()}handleTrackEvent(e){var t;this._firstMediaTrackMarked||(performance.mark(zi(this.options.id,"first-remote-media-track")),this._firstMediaTrackMarked=!0);const{streams:[n]}=e,{remoteElement:i,screenShare:r}=this.options;if(this.options.remoteStream=n,!1===r){const n=ti(i,this.options.remoteStream,{callId:this.options.id,sessionId:this._session.sessionid,eventTarget:this._session.uuid});"audio"===(null===(t=e.track)||void 0===t?void 0:t.kind)&&(n instanceof Promise?n.then(e=>this._warnIfRemoteElementUnresolved(e)):this._warnIfRemoteElementUnresolved(n))}}_warnIfRemoteElementUnresolved(e){const t=null!=this._session.remoteElementId&&null==this._session.remoteElement;if(null===e&&(null!=this.options.remoteElement||t)&&!this._session.markMissingRemoteAudioElementWarned(this.options.id)){const e=gt(Xe);Cn(ut.Warning,{warning:e,callId:this.options.id,sessionId:this._session.sessionid},this._session.uuid)}}tryCollectTimings(){if(this._timingsCollected)return;if(!(performance.getEntriesByName(zi(this.options.id,"call-active"),"mark").length>0)||"connected"!==this.instance.connectionState)return;this._timingsCollected=!0;const e=this._isTrickleIce()?"trickle":"non-trickle",t=this.isOffer?"outbound":"inbound",n=$i(this.options.id,e,t);this._callEstablishmentTimings=n,function(e){const{mode:t,direction:n,steps:i}=e,r=`[CallTimings][${n}][${t}]`;if(0===i.length)return void It.info(`${r} No timing data collected`);const o=Math.max(...i.map(e=>e.label.length),4)+2,a=(e,t)=>{for(;e.length<t;)e+=" ";return e},s=(e,t)=>{for(;e.length<t;)e=" "+e;return e},l=a("Step",o)+s("Delta",14)+s("From Start",14);let c="";for(let e=0;e<l.length;e++)c+="-";It.info(`${r} Call establishment timing breakdown:`),It.info(`${r} ${l}`),It.info(`${r} ${c}`),It.info(`${r} ${a("Call Start",o)}${s("-",14)}${s("0.00ms",14)}`);for(const e of i){const t=e.delta.toFixed(2)+"ms",n=e.fromStart.toFixed(2)+"ms";It.info(`${r} ${a(e.label,o)}${s(t,14)}${s(n,14)}`)}It.info(`${r} ${c}`)}(n),Bi(this.options.id)}createPeerConnection(){return Z(this,void 0,void 0,function*(){var e;if(this.instance=(e=this._config(),new window.RTCPeerConnection(e)),this.instance.onsignalingstatechange=this.handleSignalingStateChangeEvent,this.instance.onnegotiationneeded=this.handleNegotiationNeededEvent,this.instance.ontrack=this.handleTrackEvent,this.instance.addEventListener("connectionstatechange",this.handleConnectionStateChange),this.instance.addEventListener("iceconnectionstatechange",this._handleIceConnectionStateChange),this.instance.addEventListener("icegatheringstatechange",this._handleIceGatheringStateChange),this.instance.addEventListener("addstream",e=>{this.options.remoteStream=e.stream}),this._registerPeerEvents(this.instance),this._prevConnectionState=this.instance.connectionState,this.isAnswer&&(yield this._setRemoteDescription({sdp:this.options.remoteSdp,type:an.Offer}),performance.mark(zi(this.options.id,"set-remote-description")),!this.instance))throw bt(ye);const t=Boolean(this.options.receiveOnlyAudio)&&!this.options.audio;let n=null;if(this.options.localStream=yield this._retrieveLocalStream().catch(e=>Z(this,void 0,void 0,function*(){const t=this._session.options.mediaPermissionsRecovery;if((null==t?void 0:t.enabled)&&this._isAnswer()){let i=null,r=null;return yield new Promise((n,i)=>{r=setTimeout(()=>i(new Error("Media recovery flow timed out!")),t.timeout),Cn(ut.Error,{error:bt(vt(e),e,void 0,!1),callId:this.options.id,sessionId:this._session.sessionid,recoverable:!0,retryDeadline:Date.now()+t.timeout,resume:()=>{n()},reject:()=>{i(new Error("Call was rejected during media recovery flow!"))}},this._session.uuid)}).then(()=>Z(this,void 0,void 0,function*(){var e;r&&(clearTimeout(r),r=null),i=yield this._retrieveLocalStream(),null===(e=t.onSuccess)||void 0===e||e.call(t)})).catch(e=>{var i;r&&(clearTimeout(r),r=null),n=e,null===(i=t.onError)||void 0===i||i.call(t,e)}),i}return n=e,null})),!this.instance)throw bt(ye);if(!this.options.localStream&&!t)throw bt(n?vt(n):pe,null!=n?n:void 0);performance.mark(zi(this.options.id,"get-user-media")),this.options.mutedMicOnStart&&ei(this.options.localStream)&&(It.info("Muting local audio tracks on start"),mi(this.options.localStream)),this.options.applyDesiredAudioMuteState&&this.options.applyDesiredAudioMuteState(),performance.mark(zi(this.options.id,"peer-creation-end"))})}incrementGatheredCandidates(){this._gatheredCandidatesCount++}_startIceGatheringSafetyTimeout(){this._clearIceGatheringSafetyTimeout(),this._iceGatheringSafetyTimeout=setTimeout(()=>{if(this.instance)if(0===this._gatheredCandidatesCount){const e=gt(He);Cn(ut.Warning,{warning:e,callId:this.options.id,sessionId:this._session.sessionid},this.options.id)}else if("complete"!==this.instance.iceGatheringState){const e=gt(Be);Cn(ut.Warning,{warning:e,callId:this.options.id,sessionId:this._session.sessionid},this.options.id)}},Hi.ICE_GATHERING_SAFETY_TIMEOUT_MS)}_clearIceGatheringSafetyTimeout(){null!==this._iceGatheringSafetyTimeout&&(clearTimeout(this._iceGatheringSafetyTimeout),this._iceGatheringSafetyTimeout=null)}init(){var e;return Z(this,void 0,void 0,function*(){if(yield this.createPeerConnection(),!this.instance)throw bt(ye);this.isDebugEnabled&&(this.statsReporter=function(e,t){const n=oe();let i=!1;const r=new Ni({getStatsInterval:1e3,rawStats:!1,statsObject:!0,filteredStats:!1,remote:!0,debug:!1,logLevel:"warn"}),o=i=>Z(this,void 0,void 0,function*(){"stats"===i.event&&Cn(ut.StatsFrame,function({data:e}){var t,n,i,r,o,a,s,l;const{audio:c,remote:d}=e,{audio:u}=d,h=null!==(n=null===(t=u.inbound[0])||void 0===t?void 0:t.jitter)&&void 0!==n?n:1/0,p=null!==(r=null===(i=u.inbound[0])||void 0===i?void 0:i.roundTripTime)&&void 0!==r?r:1/0,f=null!==(a=null===(o=c.inbound[0])||void 0===o?void 0:o.packetsReceived)&&void 0!==a?a:-1,g=function(e){const{packetsLost:t,packetsReceived:n,jitter:i,rtt:r}=e,o=function(e){const{jitter:t,rtt:n}=e,i=t+n/2;return.024*i+.11*(i-177.3)*(i>177.3?1:0)}({rtt:r,jitter:i}),a=function(e){const{packetsLost:t,packetsReceived:n}=e,i=t/(n+t)*100;return 20*Math.log(1+i)}({packetsLost:t,packetsReceived:n}),s=93.2-o-a+0,l=1+.035*s+7e-6*s*(s-60)*(100-s);return Math.min(Math.max(l,1),5)}({jitter:1e3*h,rtt:1e3*p,packetsLost:null!==(l=null===(s=c.inbound[0])||void 0===s?void 0:s.packetsLost)&&void 0!==l?l:-1,packetsReceived:f});return{jitter:h,rtt:p,mos:g,quality:Oi(g),inboundAudio:c.inbound[0],outboundAudio:c.outbound[0],remoteInboundAudio:u.inbound[0],remoteOutboundAudio:u.outbound[0]}}(i),e.uuid),yield e.execute(new Di(n,t,i))});return{get isRunning(){return i},start:(a,s,l)=>Z(this,void 0,void 0,function*(){if(i)It.debug(`[${t}] Stats reporter already running, skipping start`);else{yield e.execute(new Ai(n,t)),r.on("timeline",o);try{yield r.addConnection({pc:a,peerId:s,connectionId:l}),i=!0}catch(e){It.error(`[${t}] Failed to start stats reporter:`,e),r.removeAllPeers(),r.destroy()}}}),stop:o=>Z(this,void 0,void 0,function*(){const a=r.getTimeline();Cn(ut.StatsReport,a,e.uuid),"file"===o&&function(e,t){const n=new Blob([JSON.stringify(e)],{type:"application/json"}),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download=`${t}.json`,r.click(),URL.revokeObjectURL(i)}(a,`webrtc-stats-${n}-${Date.now()}`),yield e.execute(new Li(n,t)),r.removeAllPeers(),r.destroy(),i=!1}),reportConnectionStateChange:e=>{const t={event:"connectionstatechange-detailed",tag:"connection",timestamp:(new Date).toISOString(),data:e};o(t)},reportIceCandidateError:e=>{const t={event:"icecandidateerror-detailed",tag:"connection",timestamp:(new Date).toISOString(),data:e};o(t)}}}(this._session,this.options.id),yield null===(e=this.statsReporter)||void 0===e?void 0:e.start(this.instance,this._session.sessionid,this._session.sessionid));const{localElement:t,localStream:n=null,screenShare:i=!1}=this.options;if(ei(n)){const e=n.getAudioTracks();let r=[...e];if(It.info("Local audio tracks: ",e),"object"==typeof this.options.audio&&e.forEach(e=>{It.info("Local audio tracks constraints: ",e.getConstraints())}),this.options.video){const t=n.getVideoTracks();r=[...e,...t],It.info("Local video tracks: ",t),"object"==typeof this.options.video&&t.forEach(e=>{It.info("Local video tracks constraints: ",e.getConstraints())})}const{audioCodecs:o,videoCodecs:a}=ki(this.options.preferred_codecs),s=(t,i,o)=>{var a,s,l;const c=null===(s=(a=this.instance).getTransceivers)||void 0===s?void 0:s.call(a);It.debug(t,{callId:this.options.id,streamId:n.id,isOffer:this.isOffer,audioTracksLength:e.length,tracksLength:r.length,tracks:r.map(di),trackIndex:o,track:di(i),transceiversLength:null!==(l=null==c?void 0:c.length)&&void 0!==l?l:null,transceivers:null==c?void 0:c.map(e=>({mid:e.mid,direction:e.direction,currentDirection:e.currentDirection,senderTrack:di(e.sender.track),receiverTrack:di(e.receiver.track)}))})};if(this.isOffer&&"function"==typeof this.instance.addTransceiver){s("Attaching local tracks using addTransceiver");const e={direction:"sendrecv",streams:[n]};r.forEach((t,n)=>{"audio"===t.kind&&(this.options.userVariables.microphoneLabel=t.label),"video"===t.kind&&(this.options.userVariables.cameraLabel=t.label),s("Before addTransceiver",t,n);const i=this.instance.addTransceiver(t,e);s("After addTransceiver",t,n),"audio"===t.kind&&o.length>0&&this._setCodecs(i,o),"video"===t.kind&&a.length>0&&this._setCodecs(i,a)})}else"function"==typeof this.instance.addTrack?(s("Attaching local tracks using addTrack"),r.forEach((e,t)=>{"audio"===e.kind&&(this.options.userVariables.microphoneLabel=e.label),"video"===e.kind&&(this.options.userVariables.cameraLabel=e.label),s("Before addTrack",e,t),this.instance.addTrack(e,n),s("After addTrack",e,t)}),this.instance.getTransceivers().forEach(e=>{"audio"===e.receiver.track.kind&&o.length>0&&this._setCodecs(e,o),"video"===e.receiver.track.kind&&a.length>0&&this._setCodecs(e,a)})):(s("Attaching local stream using legacy addStream"),this.instance.addStream(n),s("After legacy addStream"));!1===i&&ti(t,n)}else if(this.options.receiveOnlyAudio&&"function"==typeof this.instance.addTransceiver){const e=this.instance.addTransceiver("audio",{direction:"recvonly"});It.info("Added recvonly audio transceiver for receive-only mode",e);const{audioCodecs:t}=ki(this.options.preferred_codecs);t.length>0&&this._setCodecs(e,t)}this.isOffer?(this.options.negotiateAudio&&this._checkMediaToNegotiate("audio"),this.options.negotiateVideo&&this._checkMediaToNegotiate("video")):this._isTrickleIce()||this.startNegotiation(),this._isTrickleIce()&&this.startTrickleIceNegotiation().catch(e=>this._emitNegotiationError(e)),this._logTransceivers()})}_getSenderByKind(e){return this.instance.getSenders().find(({track:t})=>t&&t.kind===e)}_checkMediaToNegotiate(e){if(!this._getSenderByKind(e)){const t=this.instance.addTransceiver(e);It.info("Add transceiver",e,t)}}_createOffer(){return Z(this,void 0,void 0,function*(){if(this._isOffer()||this.isIceRestarting){this._constraints.offerToReceiveAudio=!1!==this.options.audio||Boolean(this.options.receiveOnlyAudio),this._constraints.offerToReceiveVideo=Boolean(this.options.video),It.info("_createOffer - this._constraints",this._constraints);try{const e=yield this.instance.createOffer(this._constraints);return performance.mark(zi(this.options.id,"create-offer")),yield this._setLocalDescription(e),performance.mark(zi(this.options.id,"set-local-description")),performance.mark(zi(this.options.id,"ice-gathering-started")),e}catch(e){if(It.error("Peer _createOffer error:",e),e instanceof mt)throw e;throw bt(ae,e)}}})}_setRemoteDescription(e){return Z(this,void 0,void 0,function*(){It.debug("Setting remote description",e);try{yield this.instance.setRemoteDescription(e)}catch(e){throw It.error("Peer _setRemoteDescription error:",e),bt(ce,e)}})}_createAnswer(){return Z(this,void 0,void 0,function*(){if(this._isAnswer()){if("stable"!==this.instance.signalingState&&"have-remote-offer"!==this.instance.signalingState)return It.debug("Skipping negotiation, state:",this.instance.signalingState),It.debug(" - But the signaling state isn't stable, so triggering rollback"),void(yield Promise.all([this.instance.setLocalDescription({type:"rollback"}),this.instance.setRemoteDescription({sdp:this.options.remoteSdp,type:an.Offer})]));this._logTransceivers();try{const e=yield this.instance.createAnswer();return performance.mark(zi(this.options.id,"create-answer")),yield this._setLocalDescription(e),performance.mark(zi(this.options.id,"set-local-description")),performance.mark(zi(this.options.id,"ice-gathering-started")),e}catch(e){if(It.error("Peer _createAnswer error:",e),e instanceof mt)throw e;throw bt(se,e)}}})}_setLocalDescription(e){return Z(this,void 0,void 0,function*(){try{yield this.instance.setLocalDescription(e)}catch(e){throw It.error("Peer _setLocalDescription error:",e),bt(le,e)}})}_retrieveLocalStream(){return Z(this,void 0,void 0,function*(){if(ei(this.options.localStream))return this.options.localStream;const e=yield(t=this.options,Z(void 0,void 0,void 0,function*(){let{audio:e=!0,micId:n,video:i=!1,camId:r}=t;const{micLabel:o="",camLabel:a=""}=t;return!1!==e&&n&&(n=yield ci(n,o,gn.AudioIn).catch(()=>null),n&&(e=Object.assign(Object.assign({},"object"==typeof e?e:{}),{deviceId:{exact:n}}))),!1!==i&&r&&(r=yield ci(r,a,gn.Video).catch(()=>null),r&&(i=Object.assign(Object.assign({},"object"==typeof i?i:{}),{deviceId:{exact:r}}))),{audio:e,video:i}}));var t;return ai(e)})}_isOffer(){return this.type===an.Offer}_isAnswer(){return this.type===an.Answer}_isTrickleIce(){return!0===this.options.trickleIce}_config(){const{prefetchIceCandidates:e,forceRelayCandidate:t,iceServers:n}=this.options,i={bundlePolicy:"balanced",iceCandidatePoolSize:e?1:0,iceServers:n,iceTransportPolicy:t?"relay":"all"};return It.info("RTC config",i),i}restartStatsReporter(){return Z(this,void 0,void 0,function*(){this.isDebugEnabled&&this.statsReporter&&(this.instance?this.statsReporter.isRunning?It.debug(`[${this.options.id}] Stats reporter already running, skipping restart`):(It.debug(`[${this.options.id}] Restarting stats reporter after reconnect`),yield this.statsReporter.start(this.instance,this._session.sessionid,this._session.sessionid)):It.debug(`[${this.options.id}] Cannot restart stats reporter - no peer connection instance`))})}close(){return Z(this,void 0,void 0,function*(){Bi(this.options.id),this.finishIceRestart(),this._clearIceGatheringSafetyTimeout(),null!==this._sleepWakeupIntervalId&&(clearInterval(this._sleepWakeupIntervalId),this._sleepWakeupIntervalId=null),this.isDebugEnabled&&this.statsReporter&&(yield this.statsReporter.stop(this.debugOutput)),this.instance&&(this.instance.close(),this.instance=null)})}}Hi.ICE_GATHERING_SAFETY_TIMEOUT_MS=15e3,Hi.ICE_RESTART_TIMEOUT_MS=15e3;const Wi=Fn;class Vi{constructor(e,t){var n;this.session=e,this._callReportCollector=null,this._callRecorder=null,this._mediaDeviceCollector=null,this._audioDeviceRecoveryErrors=new WeakSet,this._mediaDeviceGeneration=0,this.id="",this.recoveredCallId="",this.state=hn[hn.New],this.prevState="",this.channels=[],this.role=pn.Participant,this.extension=null,this._state=hn.New,this._prevState=hn.New,this.gotAnswer=!1,this.gotEarly=!1,this._lastSerno=0,this._targetNodeId=null,this._iceTimeout=null,this._statsBindings=[],this._statsIntervalId=null,this._pendingIceCandidates=[],this._isRemoteDescriptionSet=!1,this._signalingStateClosed=!1,this._creatingPeer=!1,this._desiredAudioMuted=!1,this._firstCandidateSent=!1,this._firstNonHostCandidateSent=!1,this._isRecovering=!1,this._wasHeldBeforeRecovery=!1,this._checkConferenceSerno=e=>{const t=e<0||!this._lastSerno||this._lastSerno&&e===this._lastSerno+1;return t&&e>=0&&(this._lastSerno=e),t},this._doStats=()=>{this.peer&&this.peer.instance&&0!==this._statsBindings.length&&this.peer.instance.getStats().then(e=>{e.forEach(e=>{this._statsBindings.forEach(t=>{if(t.callback){if(t.constraints)for(const n in t.constraints)if(t.constraints.hasOwnProperty(n)&&t.constraints[n]!==e[n])return;t.callback(e)}})})})};const{iceServers:i,speaker:r,micId:o,micLabel:a,camId:s,camLabel:l,localElement:c,remoteElement:d,options:u,mediaConstraints:{audio:h,video:p},ringtoneFile:f,ringbackFile:g}=e;this.options=Object.assign({},un,{audio:h,video:p,iceServers:(null==t?void 0:t.iceServers)&&Array.isArray(t.iceServers)?t.iceServers:i,localElement:c,remoteElement:d,micId:o,micLabel:a,camId:s,camLabel:l,speakerId:r,ringtoneFile:f,ringbackFile:g,debug:u.debug,debugOutput:u.debugOutput,trickleIce:u.trickleIce,prefetchIceCandidates:null!==(n=u.prefetchIceCandidates)&&void 0!==n?n:un.prefetchIceCandidates,forceRelayCandidate:u.forceRelayCandidate,keepConnectionAliveOnSocketClose:u.keepConnectionAliveOnSocketClose,mutedMicOnStart:u.mutedMicOnStart},t),this._onMediaError=this._onMediaError.bind(this),this._onPeerConnectionFailureError=this._onPeerConnectionFailureError.bind(this),this._onPeerConnectionSignalingStateClosed=this._onPeerConnectionSignalingStateClosed.bind(this),this._onTrickleIceSdp=this._onTrickleIceSdp.bind(this),this._registerPeerEvents=this._registerPeerEvents.bind(this),this._desiredAudioMuted=Boolean(this.options.mutedMicOnStart),this.options.applyDesiredAudioMuteState=this._applyDesiredAudioMuteState.bind(this),this._init(),this.options&&(this._ringtone=bi(this.options.ringtoneFile,"_ringtone"),this._ringback=bi(this.options.ringbackFile,"_ringback"))}get creatingPeer(){return this._creatingPeer}get signalingStateClosed(){return this._signalingStateClosed}_captureHangupCallerStack(){const e=new Error("Call.hangup caller").stack;return e?e.split("\n").map(e=>e.trim()).filter(Boolean).slice(1,11):[]}get nodeId(){return this._targetNodeId}set nodeId(e){this._targetNodeId=e}get isVideoCall(){return!!this.options.video}get telnyxIDs(){return{telnyxCallControlId:this.options.telnyxCallControlId,telnyxSessionId:this.options.telnyxSessionId,telnyxLegId:this.options.telnyxLegId}}get localStream(){return this.options.localStream}get remoteStream(){return this.options.remoteStream}get memberChannel(){return`conference-member.${this.id}`}get isAudioMuted(){return this._desiredAudioMuted}_getLocalAudioTrackId(){var e,t;return null===(t=null===(e=this.options.localStream)||void 0===e?void 0:e.getAudioTracks()[0])||void 0===t?void 0:t.id}_hasActiveUnmutedLocalAudioTrack(){const e=this.options.localStream;return!!(null==e?void 0:e.getAudioTracks)&&e.getAudioTracks().some(e=>!0===e.enabled&&!0!==e.muted&&"live"===e.readyState)}shouldForceRelayCandidateForRecovery(){var e,t;return!!this.options.forceRelayCandidate||!!this.recoveredCallId&&null!==(t=null===(e=this._callReportCollector)||void 0===e?void 0:e.shouldForceRelayCandidateForRecovery())&&void 0!==t&&t}invite(){return Z(this,void 0,void 0,function*(){this._creatingPeer=!0,this.direction=sn.Outbound,this.options.trickleIce&&this._resetTrickleIceCandidateState(),performance.mark(zi(this.id,"new-peer")),this.peer=new Hi(an.Offer,this.options,this.session,this._onTrickleIceSdp,this._registerPeerEvents);try{yield this.peer.init()}catch(e){It.error("Peer init failed, aborting call",e),this._creatingPeer=!1;const t=e instanceof mt?e:bt(Ne,e instanceof Error?e:void 0);return Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid,recoverable:!1},this.session.uuid),void this.hangup({initiator:"sdk:peer-init-failed"},!1)}this._creatingPeer=!1})}answer(e={}){var t,n,i,r,o,a,s,l;return Z(this,void 0,void 0,function*(){const c=(null!==(i=null===(n=(t=this.session).getActiveCalls)||void 0===n?void 0:n.call(t))&&void 0!==i?i:[]).filter(e=>e.id!==this.id);if(c.length>0&&It.debug(`[${this.id}] answer(): answering inbound call while ${c.length} other active call(s) exist in session ${this.session.sessionid}`),this._creatingPeer||(null===(r=this.peer)||void 0===r?void 0:r.instance)&&"closed"!==this.peer.instance.signalingState){const e=gt(qe);return Cn(ut.Warning,{warning:e,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),void It.warn(`[${this.id}] answer() ignored: peer connection already exists or is being created (signalingState: ${null!==(s=null===(a=null===(o=this.peer)||void 0===o?void 0:o.instance)||void 0===a?void 0:a.signalingState)&&void 0!==s?s:"creating"})`)}if(!this._registerInboundAnswerAttempt())return;performance.mark(zi(this.id,"answer-called")),this._creatingPeer=!0,this.stopRingtone(),this.direction=sn.Inbound,(null===(l=null==e?void 0:e.customHeaders)||void 0===l?void 0:l.length)>0&&(this.options=Object.assign(Object.assign({},this.options),{customHeaders:e.customHeaders}));const d=["micId","micLabel","speakerId","camId","camLabel","audio","video","remoteElement","localElement"];for(const t of d)void 0!==e[t]&&(this.options=Object.assign(Object.assign({},this.options),{[t]:e[t]}));this.options.trickleIce&&this._resetTrickleIceCandidateState(),performance.mark(zi(this.id,"new-peer")),this.peer=new Hi(an.Answer,this.options,this.session,this._onTrickleIceSdp,this._registerPeerEvents);try{yield this.peer.init()}catch(e){It.error("Peer init failed, aborting call",e),this._creatingPeer=!1;const t=e instanceof mt?e:bt(Ne,e instanceof Error?e:void 0);return Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid,recoverable:!1},this.session.uuid),void(yield this.hangup({initiator:"sdk:peer-init-failed"},!0))}this._creatingPeer=!1})}playRingtone(){yi(this._ringtone)}stopRingtone(){wi(this._ringtone)}playRingback(){yi(this._ringback)}stopRingback(){wi(this._ringback)}hangup(e,t){var n,i,r,o,a,s;return Z(this,void 0,void 0,function*(){const l=e||{},c=!1!==t,d=this.state,u=this.prevState,h=this._captureHangupCallerStack(),p=l.initiator||"app:call.hangup",f=this._state<hn.Active?{cause:"USER_BUSY",causeCode:17}:{cause:"NORMAL_CLEARING",causeCode:16};if(this.cause=l.cause||f.cause,this.causeCode=l.causeCode||f.causeCode,this.sipCode=l.sipCode||null,this.sipReason=l.sipReason||null,this.sipCallId=l.sip_call_id||null,this.options.customHeaders=[...null!==(n=this.options.customHeaders)&&void 0!==n?n:[],...null!==(r=null===(i=null==l?void 0:l.dialogParams)||void 0===i?void 0:i.customHeaders)&&void 0!==r?r:[]],It.debug(`[${this.id}] hangup() invoked`,{callId:this.id,execute:c,state:d,prevState:u,cause:this.cause,causeCode:this.causeCode,initiator:p,sipCode:this.sipCode,sipReason:this.sipReason,sipCallId:this.sipCallId,isRecovering:Boolean(l.isRecovering),hasDialogCustomHeaders:Boolean(null===(a=null===(o=l.dialogParams)||void 0===o?void 0:o.customHeaders)||void 0===a?void 0:a.length),callerStack:h}),l.isRecovering)return this._isRecovering=!0,this.setState(hn.Recovering),void this._finalize();if(this.setState(hn.Hangup),this.stopRingtone(),this.stopRingback(),c){const e=new Hn({sipCode:this.sipCode,sip_call_id:this.sipCallId,sessid:this.session.sessionid,dialogParams:this.options,cause:this.cause,causeCode:this.causeCode});let t;try{yield Promise.race([this._execute(e),new Promise(e=>{t=setTimeout(()=>{It.warn(`[${this.id}] BYE execution timed out after 5000ms — proceeding to destroy.`),e()},5e3)})])}catch(e){It.error("telnyx_rtc.bye failed!",e);const t=bt(ve,e);Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid)}finally{t&&clearTimeout(t)}}It.debug(`[${this.id}] Closing peer from hangup`),null===(s=this.peer)||void 0===s||s.close(),this.setState(hn.Destroy)})}hold(){const e=new qn({sessid:this.session.sessionid,action:vn.Hold,dialogParams:this.options});return this._execute(e).then(this._handleChangeHoldStateSuccess.bind(this)).catch(this._handleChangeHoldStateError.bind(this))}unhold(){const e=new qn({sessid:this.session.sessionid,action:vn.Unhold,dialogParams:this.options});return this._execute(e).then(this._handleChangeHoldStateSuccess.bind(this)).catch(this._handleChangeHoldStateError.bind(this))}toggleHold(){const e=new qn({sessid:this.session.sessionid,action:vn.ToggleHold,dialogParams:this.options});return this._execute(e).then(this._handleChangeHoldStateSuccess.bind(this)).catch(this._handleChangeHoldStateError.bind(this))}dtmf(e){const t=new Gn({sessid:this.session.sessionid,dtmf:e,dialogParams:this.options});this._execute(t)}message(e,t){const n={from:this.session.options.login,to:e,body:t},i=new Gn({sessid:this.session.sessionid,msg:n,dialogParams:this.options});this._execute(i)}muteAudio(){It.debug("muteAudio called",{callId:this.id,previousAudioState:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),this._desiredAudioMuted=!0,mi(this.options.localStream)}unmuteAudio(){It.debug("unmuteAudio called",{callId:this.id,previousAudioState:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),this._desiredAudioMuted=!1,gi(this.options.localStream)}_applyDesiredAudioMuteState(){It.debug("applyDesiredAudioMuteState called",{callId:this.id,previousAudioState:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),this._desiredAudioMuted?mi(this.options.localStream):gi(this.options.localStream)}toggleAudioMute(){It.debug("toggleAudioMute called",{callId:this.id,previousAudioState:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),this._desiredAudioMuted=!this._desiredAudioMuted,this._applyDesiredAudioMuteState()}setAudioInDevice(e,t){return Z(this,void 0,void 0,function*(){return this._setAudioInDevice(e,t)})}_setAudioInDevice(e,t,n=!1){var i,r,o,a,s,l;return Z(this,void 0,void 0,function*(){if(this._isTerminatingOrTerminated()||!(null===(i=this.peer)||void 0===i?void 0:i.instance))return;const c=void 0===t?this._desiredAudioMuted:Boolean(t),d=this._mediaDeviceGeneration,{instance:u}=this.peer,h=()=>{var e;return this._isTerminatingOrTerminated()||d!==this._mediaDeviceGeneration||(null===(e=this.peer)||void 0===e?void 0:e.instance)!==u},p=u.getSenders().find(({track:e})=>"audio"===(null==e?void 0:e.kind));if(!p)return It.warn("Skipping audio input device change: no audio sender found",{callId:this.id,deviceId:e,audioMuted:this._desiredAudioMuted,audioTrackId:this._getLocalAudioTrackId()}),void Cn(ut.Warning,{warning:gt(Ke),callId:this.id,deviceId:e,sessionId:this.session.sessionid},(null===(r=this.options)||void 0===r?void 0:r.id)||this.id);let f;It.debug("Starting audio input device change",{callId:this.id,state:this.state,deviceId:e,previousDesiredAudioMuted:this._desiredAudioMuted,newDesiredMuted:c,currentSenderTrack:di(p.track),localTracks:ui(this.options.localStream)});try{f=yield ai({audio:{deviceId:{exact:e}}})}catch(e){if(h())return;const t=bt(vt(e),e);return n&&this._audioDeviceRecoveryErrors.add(t),void Cn(ut.MediaError,t,(null===(o=this.options)||void 0===o?void 0:o.id)||this.id)}if(h())return void f.getTracks().forEach(e=>e.stop());const g=f.getAudioTracks()[0];try{if(!g)throw new Error("No audio track acquired");g.enabled=!(void 0===t?this._desiredAudioMuted:c),yield p.replaceTrack(g)}catch(e){if(f.getTracks().forEach(e=>e.stop()),h())return;const t=bt(vt(e),e);return n&&this._audioDeviceRecoveryErrors.add(t),void Cn(ut.MediaError,t,(null===(a=this.options)||void 0===a?void 0:a.id)||this.id)}if(h())return void f.getTracks().forEach(e=>e.stop());void 0!==t&&(this._desiredAudioMuted=c),g.enabled=!this._desiredAudioMuted;try{this.options.micId=(null===(l=null===(s=g.getSettings)||void 0===s?void 0:s.call(g))||void 0===l?void 0:l.deviceId)||"default"}catch(e){this.options.micId="default";const t=bt(fe,e);It.warn("Unable to read audio input settings after device change",{callId:this.id,error:t})}const{localStream:m}=this.options;m.getAudioTracks().forEach(e=>e.stop()),m.getVideoTracks().forEach(e=>f.addTrack(e)),this.options.localStream=f,It.debug("Finished audio input device change",{callId:this.id,state:this.state,deviceId:e,desiredAudioMuted:this._desiredAudioMuted,senderTrack:di(p.track),localTracks:ui(this.options.localStream)})})}muteVideo(){var e;e=this.options.localStream,fi(e,"video",!1)}unmuteVideo(){var e;e=this.options.localStream,fi(e,"video",!0)}toggleVideoMute(){var e;e=this.options.localStream,fi(e,"video",null)}setVideoDevice(e){return Z(this,void 0,void 0,function*(){const{instance:t}=this.peer,n=t.getSenders().find(({track:{kind:e}})=>"video"===e);if(n){const t=yield ai({video:{deviceId:{exact:e}}}),i=t.getVideoTracks()[0];n.replaceTrack(i);const{localElement:r,localStream:o}=this.options;ti(r,t),this.options.camId=e,o.getAudioTracks().forEach(e=>t.addTrack(e)),o.getVideoTracks().forEach(e=>e.stop()),this.options.localStream=t,this._applyDesiredAudioMuteState()}})}deaf(){mi(this.options.remoteStream)}undeaf(){gi(this.options.remoteStream)}toggleDeaf(){var e;e=this.options.remoteStream,fi(e,"audio",null)}setBandwidthEncodingsMaxBps(e,t){return Z(this,void 0,void 0,function*(){if(!this||!this.peer)return void It.error("Could not set bandwidth (reason: no peer connection). Dynamic bandwidth can only be set when there is a call running - is there any call running?)");const{instance:n}=this.peer,i=n.getSenders();if(!i)return void It.error("Could not set bandwidth (reason: no senders). Dynamic bandwidth can only be set when there is a call running - is there any call running?)");const r=i.find(({track:{kind:e}})=>e===t);if(r){const n=r.getParameters();n.encodings||(n.encodings=[{rid:"h"}]),It.info("Parameters: ",n),It.info("Setting max ","audio"===t?"audio":"video"," bandwidth to: ",e," [bps]"),n.encodings[0].maxBitrate=e,yield r.setParameters(n).then(()=>{It.info("audio"===t?"New audio":"New video"," bandwidth settings in use: ",r.getParameters())}).catch(e=>It.error(e))}else It.error("Could not set bandwidth (reason: no "+t+" sender). Dynamic bandwidth can only be set when there is a call running - is there any call running?)")})}setAudioBandwidthEncodingsMaxBps(e){this.setBandwidthEncodingsMaxBps(e,"audio")}setVideoBandwidthEncodingsMaxBps(e){this.setBandwidthEncodingsMaxBps(e,"video")}_isTerminatingOrTerminated(){return[hn.Hangup,hn.Destroy,hn.Purge].includes(this._state)}getStats(e,t){if(!e)return;const n={callback:e,constraints:t};if(this._statsBindings.push(n),!this._statsIntervalId){const e=2e3;this._startStats(e)}}setState(e){var t,n,i,r,o,a,s;switch(this._prevState=this._state,this._state=e,this.state=hn[this._state].toLowerCase(),this.prevState=hn[this._prevState].toLowerCase(),It.debug(`Call ${this.id} state change from ${this.prevState} to ${this.state}`),this._dispatchNotification({type:cn.callUpdate,call:this}),e){case hn.Purge:It.info(`[${this.id}] Entering Purge state.`);break;case hn.Active:if(performance.mark(zi(this.id,"call-active")),null===(t=this.peer)||void 0===t||t.tryCollectTimings(),this._isRecovering&&(this._isRecovering=!1,It.debug(`[${this.id}] Recovery complete, call is active`)),this._wasHeldBeforeRecovery&&(It.debug(`[${this.id}] Cleared held-before-recovery intent on transition to Active`),this._wasHeldBeforeRecovery=!1),null===(n=this._callReportCollector)||void 0===n||n.setHeld(!1),this.session.startSignalingHealthMonitor(),setTimeout(()=>{const{remoteElement:e,speakerId:t}=this.options;e&&t&&ii(e,t)},0),this._callReportCollector&&(null===(i=this.peer)||void 0===i?void 0:i.instance)&&this.session.callReportId&&this._callReportCollector.start(this.peer.instance),this._callRecorder){const e=null===(r=this.session.connection)||void 0===r?void 0:r.host;e&&this._callRecorder._setHost(e),this.session.callReportId&&this._callRecorder._setCallReportId(this.session.callReportId);const t=null===(o=this.options.localStream)||void 0===o?void 0:o.getAudioTracks()[0],n=null===(a=this.options.remoteStream)||void 0===a?void 0:a.getAudioTracks()[0];this._callRecorder.start(t,n)}this._mediaDeviceCollector||(this._mediaDeviceCollector=new Ii(this,()=>this._setAudioInDevice("default",void 0,!0)),this._mediaDeviceCollector.logDevicesAtStart());break;case hn.Held:null===(s=this._callReportCollector)||void 0===s||s.setHeld(!0);break;case hn.Destroy:this._finalize()}}handleMessage(e){const{method:t,params:n}=e;switch(t){case ln.Answer:if(performance.mark(zi(this.id,"telnyx-rtc-answer")),this.gotAnswer=!0,n.telnyx_call_control_id&&(this.options.telnyxCallControlId=n.telnyx_call_control_id),n.telnyx_session_id&&(this.options.telnyxSessionId=n.telnyx_session_id),n.telnyx_leg_id&&(this.options.telnyxLegId=n.telnyx_leg_id),this._state>=hn.Active)return;this._state>=hn.Early&&this.setState(hn.Active),this.gotEarly||this._onRemoteSdp(n.sdp),this.stopRingback(),this.stopRingtone();break;case ln.Media:if(performance.mark(zi(this.id,"telnyx-rtc-media")),this._state>=hn.Early)return;this.gotEarly=!0,this._onRemoteSdp(n.sdp);break;case ln.Display:{const{display_name:e,display_number:i,display_direction:r}=n;this.extension=i;const o=r===sn.Inbound?sn.Outbound:sn.Inbound,a={type:cn[t],call:this,displayName:e,displayNumber:i,displayDirection:o};Cn(ut.Notification,a,this.id)||Cn(ut.Notification,a,this.session.uuid);break}case ln.Candidate:this._addIceCandidate(n);break;case ln.Info:case ln.Event:{const e=Object.assign(Object.assign({},n),{type:cn.generic,call:this});Cn(ut.Notification,e,this.id)||Cn(ut.Notification,e,this.session.uuid);break}case ln.Ringing:performance.mark(zi(this.id,"ringing")),this.playRingback(),n.telnyx_call_control_id&&(this.options.telnyxCallControlId=n.telnyx_call_control_id),n.telnyx_session_id&&(this.options.telnyxSessionId=n.telnyx_session_id),n.telnyx_leg_id&&(this.options.telnyxLegId=n.telnyx_leg_id);break;case ln.Bye:const e=n.client_state||n.clientState;e&&(this.options.clientState=e),this.stopRingback(),this.stopRingtone(),this.hangup(Object.assign(Object.assign({},n),{initiator:"remote:telnyx_rtc.bye"}),!1)}}handleConferenceUpdate(e,t){return Z(this,void 0,void 0,function*(){if(!this._checkConferenceSerno(e.wireSerno)&&e.name!==t.laName)return It.error("ConferenceUpdate invalid wireSerno or packet name:",e),"INVALID_PACKET";const{action:n,data:i,hashKey:r=String(this._lastSerno),arrIndex:o}=e;switch(n){case"bootObj":{this._lastSerno=0;const{chatChannel:e,infoChannel:n,modChannel:r,laName:o,conferenceMemberID:a,role:s}=t;this._dispatchConferenceUpdate({action:fn.Join,conferenceName:o,participantId:Number(a),role:s}),e&&(yield this._subscribeConferenceChat(e)),n&&(yield this._subscribeConferenceInfo(n));const l=[];for(const e in i)l.push(Object.assign({callId:i[e][0],index:Number(e)},At(i[e][1])));this._dispatchConferenceUpdate({action:fn.Bootstrap,participants:l});break}case"add":this._dispatchConferenceUpdate(Object.assign({action:fn.Add,callId:r,index:o},At(i)));break;case"modify":this._dispatchConferenceUpdate(Object.assign({action:fn.Modify,callId:r,index:o},At(i)));break;case"del":this._dispatchConferenceUpdate(Object.assign({action:fn.Delete,callId:r,index:o},At(i)));break;case"clear":this._dispatchConferenceUpdate({action:fn.Clear});break;default:this._dispatchConferenceUpdate({action:n,data:i,callId:r,index:o})}})}_addChannel(e){this.channels.includes(e)||this.channels.push(e);const t=this.session.relayProtocol;this.session._existsSubscription(t,e)&&(this.session.subscriptions[t][e]=Object.assign(Object.assign({},this.session.subscriptions[t][e]),{callId:this.id}))}_subscribeConferenceChat(e){return Z(this,void 0,void 0,function*(){const t={nodeId:this.nodeId,channels:[e],handler:e=>{const{direction:t,from:n,fromDisplay:i,message:r,type:o}=e.data;this._dispatchConferenceUpdate({action:fn.ChatMessage,direction:t,participantNumber:n,participantName:i,messageText:r,messageType:o,messageId:e.eventSerno})}},n=yield this.session.vertoSubscribe(t).catch(e=>{It.error("ConfChat subscription error:",e)});hi(n,e)&&(this._addChannel(e),Object.defineProperties(this,{sendChatMessage:{configurable:!0,value:(t,n)=>{this.session.vertoBroadcast({nodeId:this.nodeId,channel:e,data:{action:"send",message:t,type:n}})}}}))})}_subscribeConferenceInfo(e){return Z(this,void 0,void 0,function*(){const t={nodeId:this.nodeId,channels:[e],handler:e=>{const{eventData:t}=e;"layout-info"===t.contentType?(t.callID=this.id,Pi(this.session,t)):It.error("Conference-Info unknown contentType",e)}},n=yield this.session.vertoSubscribe(t).catch(e=>{It.error("ConfInfo subscription error:",e)});hi(n,e)&&this._addChannel(e)})}_confControl(e,t={}){const n=Object.assign({application:"conf-control",callID:this.id,value:null},t);this.session.vertoBroadcast({nodeId:this.nodeId,channel:e,data:n})}_handleChangeHoldStateSuccess(e){return"active"===e.holdState?this.setState(hn.Active):this.setState(hn.Held),!0}_handleChangeHoldStateError(e){It.error(`Failed to ${e.action} on call ${this.id}`);const t=bt(ge,e);return Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),!1}_sendIceRestartModify(e,t={}){const n=new qn(Object.assign(Object.assign({sessid:this.session.sessionid,action:vn.UpdateMedia,callID:this.options.id,sdp:e},t.trickle?{trickle:!0}:{}),{dialogParams:this.options}));It.info(`ICE restart: sending ${t.trickle?"trickle ":""}Modify with new offer SDP`),this._execute(n).then(e=>Z(this,void 0,void 0,function*(){var t;(null==e?void 0:e.sdp)?(It.info("ICE restart Modify response received"),null===(t=this.peer)||void 0===t||t.finishIceRestart(),yield this._onRemoteSdp(e.sdp)):this._onIceRestartFailed("ICE restart Modify response missing SDP")})).catch(e=>{this._onIceRestartFailed("ICE restart Modify failed",e)})}_onIceRestartFailed(e,t){var n,i,r;It.error(e,t),null===(n=this.peer)||void 0===n||n.finishIceRestart();const o=bt(Ie,t);Cn(ut.Error,{error:o,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),null===(r=(i=this.session).reportIceRestartFailed)||void 0===r||r.call(i,this.id)}_onRemoteSdp(e){return Z(this,void 0,void 0,function*(){const t=new RTCSessionDescription({sdp:e,type:an.Answer});yield this.peer.instance.setRemoteDescription(t).then(()=>{performance.mark(zi(this.id,"set-remote-description")),this.options.trickleIce&&(this._isRemoteDescriptionSet=!0,this._flushPendingTrickleIceCandidates()),this.gotEarly&&this.setState(hn.Early),this.gotAnswer&&this._state!==hn.Held&&this.setState(hn.Active)}).catch(e=>Z(this,void 0,void 0,function*(){It.error("Call setRemoteDescription Error: ",e);const t=bt(ce,e);Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid);try{yield this.hangup({cause:"USER_BUSY",causeCode:17,initiator:"sdk:set-remote-description-failure"},!0)}catch(e){It.error("Error during hangup after setRemoteDescription failure:",e)}}))})}_warnIfOnlyHostIceCandidates(e){if(!(e=>{if(!e)return!1;const t=e.split(/\r?\n/).filter(e=>/^a=candidate:/i.test(e));return t.length>0&&t.every(e=>/\styp\s+host(?:\s|$)/i.test(e))})(e))return;const t=gt(Ve);It.warn(`[${this.id}] Warning ${t.code}: ${t.message}`),Cn(ut.Warning,{warning:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid)}_onIceSdp(e){var t,n,i;if(this._iceTimeout&&clearTimeout(this._iceTimeout),this._iceTimeout=null,this._isTerminatingOrTerminated())return;if(this.peer&&(this.peer.iceDone=!0),!e)return void It.warn("localDescription is null — PeerConnection may have been closed during ICE gathering");const{sdp:r,type:o}=e;null===(n=null===(t=this.peer)||void 0===t?void 0:t.instance)||void 0===n||n.removeEventListener("icecandidate",this._onIce),this._warnIfOnlyHostIceCandidates(r),performance.mark(zi(this.id,"ice-gathering-end"));let a=null;const s={sessid:this.session.sessionid,sdp:r,dialogParams:this.options,"User-Agent":`Web-${Wi}`,call_reports_enabled:!1!==this.session.options.enableCallReports};if(null===(i=this.peer)||void 0===i?void 0:i.isIceRestarting)this._sendIceRestartModify(r);else{switch(o){case an.Offer:this.setState(hn.Requesting),a=new Un(s);break;case an.Answer:this._isRecovering||this.setState(hn.Answering),a=!0===this.options.attach?new Bn(s):new $n(s);break;default:return It.error(`${this.id} - Unknown local SDP type:`,e),void this.hangup({initiator:"sdk:unknown-local-sdp-type"},!1)}performance.mark(zi(this.id,"send-sdp")),this._execute(a).then(e=>{if(this._isTerminatingOrTerminated())return void It.debug(`[${this.id}] Ignoring ${o} response because call is ${this.state}`);const{node_id:t=null}=e;this._targetNodeId=t,o===an.Offer?this.setState(hn.Trying):this._wasHeldBeforeRecovery&&this._isRecovering?this.setState(hn.Held):this.setState(hn.Active)}).catch(e=>Z(this,void 0,void 0,function*(){It.error(`${this.id} - Sending ${o} error:`,e);const t=bt(de,e);Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid);try{yield this.hangup({cause:"USER_BUSY",causeCode:17,initiator:"sdk:sdp-send-failure"},!0)}catch(e){It.error("Error during hangup after SDP send failure:",e)}}))}}_onTrickleIceSdp(e){var t;if(this._isTerminatingOrTerminated())return;if(!e)return It.error("No SDP data provided"),void this.hangup({initiator:"sdk:missing-local-sdp"},!1);const{sdp:n,type:i}=e;let r=null;const o={sessid:this.session.sessionid,sdp:n,dialogParams:this.options,trickle:!0,"User-Agent":`Web-${Wi}`,call_reports_enabled:!1!==this.session.options.enableCallReports};if(null===(t=this.peer)||void 0===t?void 0:t.isIceRestarting)this._sendIceRestartModify(n,{trickle:!0});else{switch(i){case an.Offer:this.setState(hn.Requesting),r=new Un(o);break;case an.Answer:this._isRecovering||this.setState(hn.Answering),r=!0===this.options.attach?new Bn(o):new $n(o);break;default:return It.error(`${this.id} - Unknown local SDP type:`,e),void this.hangup({initiator:"sdk:unknown-local-sdp-type"},!1)}performance.mark(zi(this.id,"send-sdp")),this._execute(r).then(e=>{if(this._isTerminatingOrTerminated())return void It.debug(`[${this.id}] Ignoring ${i} response because call is ${this.state}`);const{node_id:t=null}=e;this._targetNodeId=t,i===an.Offer?this.setState(hn.Trying):this._wasHeldBeforeRecovery&&this._isRecovering?this.setState(hn.Held):this.setState(hn.Active)}).catch(e=>Z(this,void 0,void 0,function*(){It.error(`${this.id} - Sending ${i} error:`,e);const t=bt(de,e);Cn(ut.Error,{error:t,callId:this.id,sessionId:this.session.sessionid},this.session.uuid);try{yield this.hangup({cause:"USER_BUSY",causeCode:17,initiator:"sdk:sdp-send-failure"},!0)}catch(e){It.error("Error during hangup after SDP send failure:",e)}}))}}_onIce(e){var t;if(this._isTerminatingOrTerminated())return;const{instance:n}=this.peer;if(null===this._iceTimeout){const e=this.options.attach?5e3:1e3;this._iceTimeout=setTimeout(()=>this._onIceSdp(n.localDescription),e)}e.candidate?(It.debug("RTCPeer Candidate:",e.candidate),null===(t=this.peer)||void 0===t||t.incrementGatheredCandidates(),this._trackCandidateMarks(e.candidate)):this._onIceSdp(n.localDescription)}_onTrickleIce(e){var t,n,i,r;this._isTerminatingOrTerminated()||(e.candidate&&e.candidate.candidate?(It.debug("RTCPeer Candidate:",e.candidate),null===(t=this.peer)||void 0===t||t.incrementGatheredCandidates(),this._trackCandidateMarks(e.candidate),this._sendIceCandidate(e.candidate)):(null===e.candidate&&this._warnIfOnlyHostIceCandidates(null===(r=null===(i=null===(n=this.peer)||void 0===n?void 0:n.instance)||void 0===i?void 0:i.localDescription)||void 0===r?void 0:r.sdp),this._sendEndOfCandidates()))}_sendIceCandidate(e){const t=new Wn({sessid:this.session.sessionid,candidate:e.candidate,sdpMLineIndex:e.sdpMLineIndex,sdpMid:e.sdpMid,dialogParams:this.options});this._execute(t)}_addIceCandidate(e){if(!this._isRemoteDescriptionSet)return It.debug("Remote description not set. Queued ICE candidate.",e),void this._pendingIceCandidates.push(e);this._addIceCandidateToPeer(e)}_addIceCandidateToPeer(e){const t=this.peer.instance.addIceCandidate(e);Promise.resolve(t).then(()=>{It.debug("Successfully added ICE candidate:",e)}).catch(t=>{It.error("Failed to add ICE candidate:",t,e)})}_sendEndOfCandidates(){const e=new Vn({sessid:this.session.sessionid,endOfCandidates:!0,dialogParams:this.options});this._execute(e)}_trackCandidateMarks(e){var t;if(this._firstCandidateSent||(performance.mark(zi(this.id,"first-candidate")),this._firstCandidateSent=!0),!this._firstNonHostCandidateSent){const n=null===(t=e.candidate.match(/typ (\w+)/))||void 0===t?void 0:t[1];n&&"host"!==n&&(performance.mark(zi(this.id,"first-non-host-candidate")),this._firstNonHostCandidateSent=!0)}}_resetTrickleIceCandidateState(){this._pendingIceCandidates=[],this._isRemoteDescriptionSet=!1,this._firstCandidateSent=!1,this._firstNonHostCandidateSent=!1}_flushPendingTrickleIceCandidates(){if(!this._pendingIceCandidates.length)return;const e=[...this._pendingIceCandidates];this._pendingIceCandidates=[],e.forEach(e=>{this._addIceCandidateToPeer(e)})}_registerPeerEvents(e){e.onicecandidate=e=>{var t;this.options.trickleIce?this._onTrickleIce(e):(null===(t=this.peer)||void 0===t?void 0:t.iceDone)||this._onIce(e)},e.onicegatheringstatechange=t=>{It.debug("ICE gathering state changed:",e.iceGatheringState,t),"complete"===e.iceGatheringState&&(It.debug("Finished gathering candidates"),performance.mark(zi(this.id,"ice-gathering-completed")))},e.onicecandidateerror=t=>{var n;if(It.debug("ICE candidate error:",t),null===(n=this.peer)||void 0===n?void 0:n.statsReporter){const n=function(e,t){var n,i;return{errorCode:e.errorCode,errorText:e.errorText,url:e.url,address:e.address,port:e.port,connectionState:t.connectionState,iceConnectionState:t.iceConnectionState,iceGatheringState:t.iceGatheringState,signalingState:t.signalingState,localDescriptionType:null===(n=t.localDescription)||void 0===n?void 0:n.type,remoteDescriptionType:null===(i=t.remoteDescription)||void 0===i?void 0:i.type}}(t,e);this.peer.statsReporter.reportIceCandidateError(n)}},e.addEventListener("addstream",e=>{this.options.remoteStream=e.stream})}_onMediaError(e){const t=(null==e?void 0:e.name)||"UnknownError",n=(null==e?void 0:e.message)||"Unknown media error",i=(null==e?void 0:e.originalError)||e;this._dispatchNotification({type:cn.userMediaError,error:i,call:this,errorName:t,errorMessage:n}),It.error(`Media error (${t}): ${n}`,e),Cn(ut.Error,{error:e,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),this._audioDeviceRecoveryErrors.has(e)||this.hangup({initiator:"sdk:media-error"},!1)}_onPeerConnectionFailureError(e){this._dispatchNotification({type:cn.peerConnectionFailureError,error:e.error}),It.error("Peer connection failure error"),e.warning&&Cn(ut.Warning,{warning:e.warning,callId:this.id,sessionId:this.session.sessionid},this.session.uuid)}_onPeerConnectionSignalingStateClosed(e){this._signalingStateClosed=!0,this._dispatchNotification(Object.assign({type:cn.signalingStateClosed},e)),It.debug("Peer connection signaling state closed, call is not recoverable")}_dispatchConferenceUpdate(e){this._dispatchNotification(Object.assign({type:cn.conferenceUpdate,call:this},e))}_dispatchNotification(e){!0!==this.options.screenShare&&(Cn(ut.Notification,e,this.id,!1)||Cn(ut.Notification,e,this.session.uuid))}_execute(e){return this.nodeId&&(e.targetNodeId=this.nodeId),this.session.execute(e)}_registerInboundAnswerAttempt(){var e;if(this.options.attach||this._isRecovering)return!0;const t=null===(e=this.session.calls)||void 0===e?void 0:e[this.id];if(t&&t!==this){const e=gt(Qe);return Cn(ut.Warning,{warning:e,callId:this.id,activeCallId:t.id,sessionId:this.session.sessionid},this.session.uuid),It.warn(`[${this.id}] answer() ignored: callID ${this.id} already has an active call (${t.id})`),!1}return!0}_init(){var e,t,n,i,r,o,a,s,l,c;const{id:d,userVariables:u,remoteCallerNumber:h,onNotification:p,recoveredCallId:f,wasHeldBeforeRecovery:g}=this.options;var m;this.options.id=d?d.toString():oe(),this.id=this.options.id,f&&(this.recoveredCallId=f,this._isRecovering=!0,this._wasHeldBeforeRecovery=Boolean(g)),u&&(m=u,0!==Object.keys(m).length)||(this.options.userVariables=this.session.options.userVariables||{}),h||(this.options.remoteCallerNumber=this.options.destinationNumber),this.session.calls[this.id]=this,_n(ut.MediaError,this._onMediaError,this.id),_n(ut.PeerConnectionFailureError,this._onPeerConnectionFailureError,this.id),_n(ut.PeerConnectionSignalingStateClosed,this._onPeerConnectionSignalingStateClosed,this.id),Dt(p)&&_n(ut.Notification,p.bind(this),this.id);const v=!1!==this.session.options.enableCallReports,b=this.session.options.callReportInterval||5e3,y=null!==(e=this.session.options.callReportFlushInterval)&&void 0!==e?e:18e4,w=this.session.options.debugLogLevel||"debug",k=this.session.options.debugLogMaxEntries||1e3;if(v&&(this._callReportCollector=new xi({enabled:!0,interval:b,intermediateReportInterval:y},{enabled:!0,level:w,maxEntries:k},()=>{var e;return null===(e=this.session._registrationTimings)||void 0===e?void 0:e.getLogEntry()}),this._callReportCollector.onFlushNeeded=()=>{this._flushIntermediateReport()},this._callReportCollector.onWarning=e=>{var t,n,i,r;Cn(ut.Warning,{warning:e,callId:this.id,sessionId:this.session.sessionid},this.session.uuid),e.code===Fe&&this._state!==hn.Held?null===(n=(t=this.session).reportNoRtp)||void 0===n||n.call(t,this.id,"inbound"):e.code===je&&this._state!==hn.Held&&this._hasActiveUnmutedLocalAudioTrack()&&(null===(r=(i=this.session).reportNoRtp)||void 0===r||r.call(i,this.id,"outbound"))}),!0===this.session.options.enableCallRecording){const e={enabled:!0,flushIntervalMs:null!==(t=this.session.options.callRecordingFlushIntervalMs)&&void 0!==t?t:15e3,maxBufferBytes:null!==(n=this.session.options.callRecordingMaxBufferBytes)&&void 0!==n?n:dn,sampleRate:null!==(i=this.session.options.callRecordingSampleRate)&&void 0!==i?i:48e3,tracks:null!==(r=this.session.options.callRecordingTracks)&&void 0!==r?r:["local","remote"],endpoint:null!==(o=this.session.options.callRecordingEndpoint)&&void 0!==o?o:"/call_recording"},l={callId:this.id,callReportId:null!==(a=this.session.callReportId)&&void 0!==a?a:"",voiceSdkId:this._getCallReportVoiceSdkId()};this._callRecorder=new Ci(e,l);const c=null===(s=this.session.connection)||void 0===s?void 0:s.host;c&&this._callRecorder._setHost(c),this._callRecorder.onWarning=e=>{Cn(ut.Warning,{warning:e,callId:this.id,sessionId:this.session.sessionid},this.session.uuid)}}this._isRecovering?this.setState(hn.Recovering):this.setState(hn.New),It.info(`New Call — region: ${null!==(l=this.session.region)&&void 0!==l?l:"unknown"}, dc: ${null!==(c=this.session.dc)&&void 0!==c?c:"unknown"}`,this.options)}getEstablishmentTimings(){var e,t,n;const i=null===(e=this.peer)||void 0===e?void 0:e.callEstablishmentTimings;if(i)return i;const r=(null===(t=this.options)||void 0===t?void 0:t.trickleIce)&&!(null===(n=this.peer)||void 0===n?void 0:n.isIceRestarting)?"trickle":"non-trickle";return $i(this.id,r,this.direction)}_finalize(){var e,t,n;this._mediaDeviceGeneration++,this._stopStats(),null===(e=this._mediaDeviceCollector)||void 0===e||e.stop(),this._mediaDeviceCollector=null,null===(t=this._callRecorder)||void 0===t||t.stop(),Bi(this.id),It.debug(`[${this.id}] Closing peer from _finalize`),null===(n=this.peer)||void 0===n||n.close();const{remoteStream:i,localStream:r,remoteElement:o,localElement:a}=this.options;oi(i),oi(r),ni(o,i),ni(a,r),xn(ut.MediaError,null,this.id),xn(ut.PeerConnectionFailureError,null,this.id),xn(ut.PeerConnectionSignalingStateClosed,null,this.id),this.session.calls[this.id]=null,delete this.session.calls[this.id];const s=this._postCallReport().catch(e=>{It.error("Unexpected error in _postCallReport",{error:e})});this.session.trackCallReportUpload(s)}_getCallReportVoiceSdkId(){return this.session.callReportVoiceSdkId||void 0}_getClientSummary(){var e,t,n,i,r,o,a,s,l,c,d,u;const h=this.session.options,p=h.anonymous_login;return{authentication:Object.assign({type:this._getAuthenticationType()},p?{anonymousLogin:{targetType:p.target_type,targetId:p.target_id,targetVersionId:p.target_version_id,targetParams:this._sanitizeClientOption(p.target_params)}}:{}),connection:{env:h.env,host:h.host,project:h.project,region:null!==(e=this.session.region)&&void 0!==e?e:h.region,dc:this.session.dc,rtcIp:h.rtcIp,rtcPort:h.rtcPort,autoReconnect:null===(t=h.autoReconnect)||void 0===t||t,maxReconnectAttempts:null!==(n=h.maxReconnectAttempts)&&void 0!==n?n:10,keepConnectionAliveOnSocketClose:null!==(i=h.keepConnectionAliveOnSocketClose)&&void 0!==i&&i,hangupOnBeforeUnload:!1!==h.hangupOnBeforeUnload,useCanaryRtcServer:null!==(r=h.useCanaryRtcServer)&&void 0!==r&&r,skipLastVoiceSdkId:null!==(o=h.skipLastVoiceSdkId)&&void 0!==o&&o,skipTrailing:null!==(a=h.skipTrailing)&&void 0!==a&&a},media:{audio:this._sanitizeClientOption(this.options.audio),video:this._sanitizeClientOption(this.options.video),mutedMicOnStart:null!==(s=this.options.mutedMicOnStart)&&void 0!==s&&s,prefetchIceCandidates:null!==(l=this.options.prefetchIceCandidates)&&void 0!==l&&l,forceRelayCandidate:null!==(c=this.options.forceRelayCandidate)&&void 0!==c&&c,trickleIce:null!==(d=this.options.trickleIce)&&void 0!==d&&d,iceServers:this._sanitizeIceServers(this.options.iceServers)},callReports:{enabled:!1!==h.enableCallReports,intervalMs:h.callReportInterval||5e3,flushIntervalMs:null!==(u=h.callReportFlushInterval)&&void 0!==u?u:18e4,debugLogLevel:h.debugLogLevel||"debug",debugLogMaxEntries:h.debugLogMaxEntries||1e3}}}_getAuthenticationType(){const e=this.session.options;return e.anonymous_login?"anonymous_login":e.login_token?"login_token":e.login&&(e.password||e.passwd)?"login_password":e.token?"token":"unknown"}_sanitizeIceServers(e){if(e&&0!==e.length)return e.map(({urls:e,username:t,credential:n})=>({urls:e,hasUsername:Boolean(t),hasCredential:Boolean(n)}))}_sanitizeClientOption(e,t=0){if(void 0!==e){if(null===e)return null;if("string"==typeof e)return e;if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("boolean"==typeof e)return e;if("function"!=typeof e){if(t>=4)return"[truncated]";if(Array.isArray(e))return e.map(e=>this._sanitizeClientOption(e,t+1)).filter(e=>void 0!==e);if("object"==typeof e){const n=Object.entries(e).filter(([e])=>!this._isSensitiveClientOptionKey(e)).map(([e,n])=>[e,this._sanitizeClientOption(n,t+1)]).filter(e=>void 0!==e[1]);return Object.fromEntries(n)}}}}_isSensitiveClientOptionKey(e){return/(password|passwd|credential|secret|token|authorization|auth|api[_-]?key)/i.test(e)}flushIntermediateCallReport(e={type:"manual"}){this._flushIntermediateReport(e)}_flushIntermediateReport(e={type:"buffer-limit"}){var t;if(!this._callReportCollector)return;const n=this.session.callReportId;if(!n)return void It.debug("Cannot flush intermediate report: call_report_id not available");const i=null===(t=this.session.connection)||void 0===t?void 0:t.host;if(!i)return void It.debug("Cannot flush intermediate report: connection host not available");const r={callId:this.id,destinationNumber:this.options.destinationNumber,callerNumber:this.options.callerNumber,direction:this.direction===sn.Inbound?"inbound":"outbound",state:this.state,telnyxSessionId:this.options.telnyxSessionId,telnyxLegId:this.options.telnyxLegId,sdkVersion:Wi,clientSummary:this._getClientSummary()},o=this._callReportCollector.flush(r,e);if(!o)return;It.info("Flushing intermediate call report",{callId:this.id,flushReason:e,segment:o.segment});const a=this._getCallReportVoiceSdkId(),s="page-unload"===e.type,l=this._callReportCollector.sendPayload(o,n,i,a,s).catch(e=>{It.error("Failed to post intermediate call report segment",{error:e})});this.session.trackCallReportUpload(l)}_postCallReport(){var e,t,n,i;return Z(this,void 0,void 0,function*(){if(!this._callReportCollector)return void It.warn("Call report collector not initialized");if(yield this._callReportCollector.stop(),this._callRecorder){this._callRecorder.stop();const t=null===(e=this.session.connection)||void 0===e?void 0:e.host;t&&this._callRecorder._setHost(t),this.session.callReportId&&this._callRecorder._setCallReportId(this.session.callReportId);const n=this._callRecorder.postFinalReport().catch(e=>{It.error("Failed to post final call recording",{error:e})}).finally(()=>{var e;null===(e=this._callRecorder)||void 0===e||e.cleanup()});this.session.trackCallReportUpload(n)}const r=this.session.callReportId;if(!r)return It.debug("Cannot post call report: call_report_id not available"),void this._callReportCollector.cleanup();const o={callId:this.id,destinationNumber:this.options.destinationNumber,callerNumber:this.options.callerNumber,direction:this.direction===sn.Inbound?"inbound":"outbound",state:this.state,telnyxSessionId:this.options.telnyxSessionId,telnyxLegId:this.options.telnyxLegId,sdkVersion:Wi,clientSummary:this._getClientSummary()},a=null===(t=this.session.connection)||void 0===t?void 0:t.host;if(!a)return void It.error("Cannot post call report: connection host not available");const s=this._getCallReportVoiceSdkId();try{yield this._callReportCollector.postReport(o,r,a,s)}catch(e){throw It.error("Failed to post call report",{error:e}),e}finally{null===(n=this._callReportCollector)||void 0===n||n.cleanup(),null===(i=this._callRecorder)||void 0===i||i.cleanup()}})}_startStats(e){this._statsIntervalId=setInterval(this._doStats,e),It.info("Stats started")}_stopStats(){this._statsIntervalId&&(clearInterval(this._statsIntervalId),this._statsIntervalId=null),It.debug("Stats stopped")}}Vi.setStateTelnyx=e=>{if(e){switch(e._state){case hn.Recovering:e.state="recovering";break;case hn.Requesting:case hn.Trying:case hn.Early:e.state="connecting";break;case hn.Active:e.state="active";break;case hn.Held:e.state="held";break;case hn.Hangup:case hn.Destroy:e.state="done";break;case hn.Answering:e.state="ringing";break;case hn.New:e.state="new"}return e}};class qi extends Vi{constructor(){super(...arguments),this._statsInterval=null,this.sendConversationMessage=(e,t)=>this.session.execute(new _i(e,t)),this.sendAIConversationMessage=e=>{if(!this.session.connected)throw new Error("Cannot send AI conversation message: session is not connected. sendAIConversationMessage requires an active WebSocket connection.");const t=new Si(e);this.session.connection.sendRawText(JSON.stringify(t.request))}}hangup(e={},t=!0){const n=Object.create(null,{hangup:{get:()=>super.hangup}});return Z(this,void 0,void 0,function*(){this.screenShare instanceof qi&&(yield this.screenShare.hangup(e,t)),yield n.hangup.call(this,e,t)})}startScreenShare(e){return Z(this,void 0,void 0,function*(){const t=yield(n={video:!0},navigator.mediaDevices.getDisplayMedia(n));var n;t.getTracks().forEach(e=>{e.addEventListener("ended",()=>Z(this,void 0,void 0,function*(){this.screenShare&&(yield this.screenShare.hangup({initiator:"sdk:screenshare-track-ended"}))}))});const{remoteCallerName:i,remoteCallerNumber:r,callerName:o,callerNumber:a}=this.options,s=Object.assign({screenShare:!0,localStream:t,destinationNumber:`${this.extension}-screen`,remoteCallerName:i,remoteCallerNumber:`${r}-screen`,callerName:`${o} (Screen)`,callerNumber:`${a} (Screen)`},e);return this.screenShare=new qi(this.session,s),this.screenShare.invite(),this.screenShare})}stopScreenShare(){return Z(this,void 0,void 0,function*(){this.screenShare instanceof qi&&(yield this.screenShare.hangup({initiator:"app:stopScreenShare"}))})}setAudioOutDevice(e){return Z(this,void 0,void 0,function*(){if(this._isTerminatingOrTerminated())return!1;const{remoteElement:t}=this.options,n=this._mediaDeviceGeneration;if(t&&e){const i=yield ii(t,e);return!this._isTerminatingOrTerminated()&&n===this._mediaDeviceGeneration&&this.options.remoteElement===t&&(i&&(this.options.speakerId=e),i)}return!1})}_finalize(){this._stats(!1),super._finalize()}_stats(e=!0){if(!1===e)return clearInterval(this._statsInterval);this._statsInterval=window.setInterval(()=>Z(this,void 0,void 0,function*(){const e=yield this.peer.instance.getStats(null);let t="";const n=["certificate","codec","peer-connection","stream","local-candidate","remote-candidate"],i=["id","type","timestamp"];e.forEach(e=>{n.includes(e.type)||(t+=`\n${e.type}\n`,Object.keys(e).forEach(n=>{i.includes(n)||(t+=`\t${n}: ${e[n]}\n`)}))}),It.info(t)}),2e3)}}class Gi extends Xn{constructor(e){super(e),this.calls={},this._missingRemoteAudioElementWarnedCallIds=new Set,this.autoRecoverCalls=!0,this._iceServers=[],this._localElement=null,this._localElementId=null,this._remoteElement=null,this._remoteElementId=null,this._jwtAuth=!0,this._audioConstraints=!0,this._previousAudioConstraints=!0,this._videoConstraints=!1,this._speaker=null,this._videoConstraints=e.video||!1,this.iceServers=e.iceServers,this.ringtoneFile=e.ringtoneFile,this.ringbackFile=e.ringbackFile}markMissingRemoteAudioElementWarned(e){return!!this._missingRemoteAudioElementWarnedCallIds.has(e)||(this._missingRemoteAudioElementWarnedCallIds.add(e),!1)}getActiveCalls(){return Object.values(this.calls).filter(e=>Gi.ACTIVE_CALL_STATE_NAMES.has(e.state))}_extractSafeCallIdentifiers(e){var t,n;const i={callId:e.id,state:e.state,direction:e.direction};(null===(t=e.options)||void 0===t?void 0:t.telnyxSessionId)&&(i.telnyxSessionId=e.options.telnyxSessionId),(null===(n=e.options)||void 0===n?void 0:n.telnyxLegId)&&(i.telnyxLegId=e.options.telnyxLegId);const r=e.sipCallId;return"string"==typeof r&&r&&(i.sipCallId=r),i}emitMultipleActiveCallsWarning(e){const t=this.getActiveCalls().filter(t=>t.id!==e);if(0===t.length)return;const n=gt(Ye),i=this.calls[e],r=i?this._extractSafeCallIdentifiers(i):{callId:e};Cn(ut.Warning,{warning:n,callId:e,sessionId:this.sessionid,newCall:r,activeCalls:t.map(e=>this._extractSafeCallIdentifiers(e))},this.uuid),It.warn(`MULTIPLE_ACTIVE_CALLS_DETECTED: new call ${e} created while ${t.length} other call(s) are active in session ${this.sessionid}`)}getIsRegistered(){const e=Object.create(null,{getIsRegistered:{get:()=>super.getIsRegistered}});return Z(this,void 0,void 0,function*(){return e.getIsRegistered.call(this)})}connect(){const e=Object.create(null,{connect:{get:()=>super.connect}});return Z(this,void 0,void 0,function*(){It.debug("BrowserSession.connect() called"),e.connect.call(this)})}checkPermissions(e=!0,t=!0){return Z(this,void 0,void 0,function*(){try{const n=yield ai({audio:e,video:t});return oi(n),!0}catch(e){return!1}})}logout(){this.disconnect()}disconnect(){const e=Object.create(null,{disconnect:{get:()=>super.disconnect}});return Z(this,void 0,void 0,function*(){It.info("[disconnect] Client-initiated disconnect — setting Purge with BYE on all active calls.");for(const e in this.calls){const t=this.calls[e];t.setState(hn.Purge),It.info("Start hangup for ",t),yield t.hangup({initiator:"app:client.disconnect"},!0)}this.calls={},this._missingRemoteAudioElementWarnedCallIds.clear(),yield e.disconnect.call(this)})}serverDisconnect(){const e=Object.create(null,{disconnect:{get:()=>super.disconnect}});return Z(this,void 0,void 0,function*(){It.info("[serverDisconnect] Server-initiated disconnect — setting Purge without BYE on all active calls.");for(const e in this.calls){const t=this.calls[e];t.setState(hn.Purge),t.hangup({initiator:"sdk:server-disconnect"},!1)}this.calls={},this._missingRemoteAudioElementWarnedCallIds.clear(),yield e.disconnect.call(this)})}socketDisconnect(){this._closeConnection()}handleLoginError(e){super._handleLoginError(e)}speedTest(e){return new Promise((t,n)=>{if(Sn(ut.SpeedTest,n=>{const{upDur:i,downDur:r}=n,o=r?8*e/(r/1e3)/1024:0;t({upDur:i,downDur:r,upKps:(i?8*e/(i/1e3)/1024:0).toFixed(0),downKps:o.toFixed(0)})},this.uuid),!(e=Number(e)))return n(`Invalid parameter 'bytes': ${e}`);this.executeRaw(`#SPU ${e}`);let i=e/1024;e%1024&&i++;const r=".".repeat(1024);for(let e=0;e<i;e++)this.executeRaw(`#SPB ${r}`);this.executeRaw("#SPE")})}getDevices(){return si().catch(e=>{const t=bt(vt(e),e);return Cn(ut.MediaError,t,this.uuid),[]})}getVideoDevices(){return si(gn.Video).catch(e=>(Cn(ut.MediaError,e,this.uuid),[]))}getAudioInDevices(){return si(gn.AudioIn).catch(e=>{const t=bt(vt(e),e);return Cn(ut.MediaError,t,this.uuid),[]})}getAudioOutDevices(){return si(gn.AudioOut).catch(e=>(It.error("getAudioOutDevices",e),Cn(ut.MediaError,e,this.uuid),[]))}validateDeviceId(e,t,n){return ci(e,t,n)}getDeviceResolutions(e){return Z(this,void 0,void 0,function*(){try{return yield(e=>Z(void 0,void 0,void 0,function*(){const t=[],n=yield ai({video:{deviceId:{exact:e}}}),i=n.getVideoTracks()[0];for(let e=0;e<li.length;e++){const[n,r]=li[e];(yield i.applyConstraints({width:{exact:n},height:{exact:r}}).then(()=>!0).catch(()=>!1))&&t.push({resolution:`${n}x${r}`,width:n,height:r})}return oi(n),t}))(e)}catch(e){throw e}})}get mediaConstraints(){return{audio:this._audioConstraints,video:this._videoConstraints}}setAudioSettings(e){return Z(this,void 0,void 0,function*(){if(!e)throw new Error("You need to provide the settings object");const{micId:t,micLabel:n}=e,i=X(e,["micId","micLabel"]);return(e=>{const t=navigator.mediaDevices.getSupportedConstraints();Object.keys(e).map(n=>{t.hasOwnProperty(n)&&null!==e[n]&&void 0!==e[n]||delete e[n]})})(i),this._audioConstraints=yield((e,t,n,i)=>Z(void 0,void 0,void 0,function*(){const{deviceId:n}=i;if(void 0===n&&(e||t)){const n=yield ci(e,t,"audioinput").catch(()=>null);n&&(i.deviceId={exact:n})}return i}))(t,n,0,i),this.micId=t,this.micLabel=n,this._audioConstraints})}disableMicrophone(){this._previousAudioConstraints=this._audioConstraints,this._audioConstraints=!1}enableMicrophone(){this._audioConstraints=this._previousAudioConstraints||!0}set iceServers(e){e&&Array.isArray(e)?this._iceServers=e:this._iceServers=function(e,t){const n="development"===e?lt:st;return t?n.map(e=>Object.assign(Object.assign({},e),{urls:Array.isArray(e.urls)?e.urls.map(e=>dt(e,t)):dt(e.urls,t)})):n}(this.options.env,this.options.region)}get iceServers(){return this._iceServers}set speaker(e){this._speaker=e}get speaker(){return this._speaker}set localElement(e){this._localElementId="string"==typeof e?e:null,this._localElement=Ft(e)}get localElement(){return this._localElement}get localElementId(){return this._localElementId}set remoteElement(e){this._remoteElementId="string"==typeof e?e:null,this._remoteElement=Ft(e)}get remoteElement(){return this._remoteElement}get remoteElementId(){return this._remoteElementId}vertoBroadcast({nodeId:e,channel:t="",data:n}){if(!t)throw new Error(`Invalid channel for broadcast: ${t}`);const i=new Kn({sessid:this.sessionid,eventChannel:t,data:n});e&&(i.targetNodeId=e),this.execute(i).catch(e=>e)}vertoSubscribe({nodeId:e,channels:t=[],handler:n}){return Z(this,void 0,void 0,function*(){if(!(t=t.filter(e=>e&&!this._existsSubscription(this.relayProtocol,e))).length)return{};const i=new Yn({sessid:this.sessionid,eventChannel:t});e&&(i.targetNodeId=e);const r=yield this.execute(i),{unauthorized:o=[],subscribed:a=[]}=pi(r);return o.length&&o.forEach(e=>this._removeSubscription(this.relayProtocol,e)),a.forEach(e=>this._addSubscription(this.relayProtocol,n,e)),r})}vertoUnsubscribe({nodeId:e,channels:t=[]}){return Z(this,void 0,void 0,function*(){if(!(t=t.filter(e=>e&&this._existsSubscription(this.relayProtocol,e))).length)return{};const n=new Qn({sessid:this.sessionid,eventChannel:t});e&&(n.targetNodeId=e);const i=yield this.execute(n),{unsubscribed:r=[],notSubscribed:o=[]}=pi(i);return r.forEach(e=>this._removeSubscription(this.relayProtocol,e)),o.forEach(e=>this._removeSubscription(this.relayProtocol,e)),i})}static telnyxStateCall(e){return qi.setStateTelnyx(e)}}Gi.ACTIVE_CALL_STATE_NAMES=new Set(["new","requesting","trying","recovering","ringing","answering","early","active","held"]);class Ki{constructor(e,t){this.code=t,this.message=e}}class Yi{constructor(e){this.session=e,this.retriedConnect=0,this.retriedRegister=0}_ack(e,t){const n=new zn(e,t);this.nodeId&&(n.targetNodeId=this.nodeId),this.session.execute(n)}reconnectDelay(){return 1e3*Math.floor(5*Math.random()+2)}handleMessage(e){var t,n,i,r,o,a,s,l,c,d,u,h;const{session:p}=this;p.setPingReceived();const{id:f,method:g,params:m={},voice_sdk_id:v}=e,b=null==m?void 0:m.callID,y=null==m?void 0:m.eventChannel,w=null==m?void 0:m.eventType,k=p.calls[b],_=null===(t=null==k?void 0:k.peer)||void 0===t?void 0:t.isConnectionHealthy(),S=new Set(Object.keys(p.calls));if(Array.isArray(null==m?void 0:m.reattached_sessions)&&S.size){It.debug(`Reattach: active call IDs before cleanup check: [${Array.from(S).join(", ")}].`);const e=0===m.reattached_sessions.length,t=m.reattached_sessions.some(e=>S.has(e));if(e||!t)for(const e of Object.keys(p.calls)){const t=p.calls[e];It.debug(`Session not reattached — terminating active call ${e} `);const n=bt(Re);Cn(ut.Error,{error:n,callId:e,sessionId:p.sessionid},p.uuid),t.hangup({},!1)}}if(Array.isArray(null==m?void 0:m.reattached_sessions)&&p.sessionid){const t=rn();if(t&&t.calls.length>0)if(t.sessionId!==p.sessionid)It.debug(`Recovery markers were saved for a different sessid (saved=${t.sessionId}, current=${p.sessionid}) — ignoring all.`),nn();else{const n=new Set(m.reattached_sessions),i=[];for(const r of t.calls)try{if(n.has(r.id)){It.debug(`Recovery marker for call ${r.id} was reattached — keeping for Attach element restore.`),i.push(r);continue}It.info(`Recovery marker for call ${r.id} (sessid=${p.sessionid}) was not reattached — emitting SESSION_NOT_REATTACHED.`);const e=bt(Re);Cn(ut.Error,{error:e,callId:r.id,sessionId:p.sessionid,customHeaders:r.customHeaders},p.uuid)}catch(e){It.debug(`Recovery marker for a saved call failed to process (callId=${null==r?void 0:r.id}) — skipping: ${e instanceof Error?e.message:String(e)}`),i.push(r)}on(i,t.sessionId,t.storedAt)}}if("channelPvtData"===w)return this._handlePvtEvent(m.pvtData);const x=({recoveredCallId:e,forceRelayCandidateForRecovery:t,mutedMicOnStart:n,remoteElement:i,localElement:r,wasHeldBeforeRecovery:o}={})=>{var a,s,l,c,d,u;const h={audio:!0,video:p.options.video,remoteSdp:m.sdp,destinationNumber:m.callee_id_number,remoteCallerName:m.caller_id_name,remoteCallerNumber:m.caller_id_number,callerName:m.callee_id_name,callerNumber:m.callee_id_number,attach:g===ln.Attach,mediaSettings:m.mediaSettings,debug:null!==(a=p.options.debug)&&void 0!==a&&a,debugOutput:null!==(s=p.options.debugOutput)&&void 0!==s?s:"socket",trickleIce:null!==(l=p.options.trickleIce)&&void 0!==l&&l,prefetchIceCandidates:null!==(c=p.options.prefetchIceCandidates)&&void 0!==c&&c,forceRelayCandidate:"boolean"==typeof t?t:null!==(d=p.options.forceRelayCandidate)&&void 0!==d&&d,keepConnectionAliveOnSocketClose:null!==(u=p.options.keepConnectionAliveOnSocketClose)&&void 0!==u&&u,mutedMicOnStart:null!=n?n:p.options.mutedMicOnStart};b&&(h.id=b),m.telnyx_call_control_id&&(h.telnyxCallControlId=m.telnyx_call_control_id),m.telnyx_session_id&&(h.telnyxSessionId=m.telnyx_session_id),m.telnyx_leg_id&&(h.telnyxLegId=m.telnyx_leg_id),m.client_state&&(h.clientState=m.client_state),m.dialogParams&&m.dialogParams.custom_headers&&m.dialogParams.custom_headers.length&&(h.customHeaders=m.dialogParams.custom_headers),e&&(h.recoveredCallId=e),o&&(h.wasHeldBeforeRecovery=o),void 0!==i&&(h.remoteElement=i),void 0!==r&&(h.localElement=r),performance.mark(zi(h.id,"new-call-start"));const f=new qi(p,h);return f.nodeId=this.nodeId,f},C=new An(v),E=new Dn(v);switch(g){case ln.Answer:case ln.Display:case ln.Candidate:case ln.Ringing:case ln.Bye:case ln.Media:if(!b||!k)return void It.error(`Received ${g} for non existing call:`,m);k.handleMessage(e),this._ack(f,g);break;case ln.Ping:this.session.setPingReceived(),this.session.execute(E);break;case ln.Punt:p.options.keepConnectionAliveOnSocketClose&&_?(It.info("[punt] Received PUNT from server. keepConnectionAliveOnSocketClose=true — disconnecting socket only, keeping calls alive."),p.socketDisconnect(),this._ack(f,g)):(It.info("[punt] Received PUNT from server — calling serverDisconnect() to purge all calls without BYE."),p.serverDisconnect());break;case ln.Invite:{const e=x();e.direction=sn.Inbound,e.playRingtone(),e.setState(hn.Ringing),this.session.emitMultipleActiveCallsWarning(e.id),this._ack(f,g);break}case ln.Attach:{const e=k||null;if(0===Object.keys(p.calls).length){let e,t;It.warn(`[${(new Date).toISOString()}][${b}] Attach: SDK doens't have any active call therefore we recover first arrived attach session ${b}`);let n=!1,i=!1;const r=rn();if(r&&r.sessionId===p.sessionid){const o=r.calls.find(e=>null!==e&&"object"==typeof e&&e.id===b);o&&(e=o.remoteElement,t=o.localElement,n=!0===o.wasHeld,"boolean"==typeof o.forceRelayCandidate&&(i=o.forceRelayCandidate),(e||t)&&It.info(`[${b}] Attach: restoring per-call media elements from recovery marker (remoteElement=${null!=e?e:"<none>"}, localElement=${null!=t?t:"<none>"}).`),"boolean"==typeof o.forceRelayCandidate&&It.info(`[${b}] Attach: restoring forceRelayCandidate=${o.forceRelayCandidate} from recovery marker.`))}const o=x({recoveredCallId:b,forceRelayCandidateForRecovery:i,remoteElement:e,localElement:t,wasHeldBeforeRecovery:n});o.answer(),this.session.emitMultipleActiveCallsWarning(o.id),this._ack(f,g);break}if(e){const t=e.id,n="held"===e.state,i=e.shouldForceRelayCandidateForRecovery();i&&It.warn(`[${(new Date).toISOString()}][${b}] Attach: forcing relay candidate for recovery`),It.info(`[${(new Date).toISOString()}][${b}] Attach: recovering active call ${t}.`),e.hangup({isRecovering:!0,initiator:"sdk:attach-recovery"},!1);const r=x({recoveredCallId:t,forceRelayCandidateForRecovery:i,mutedMicOnStart:e.isAudioMuted,remoteElement:e.options.remoteElement,localElement:e.options.localElement,wasHeldBeforeRecovery:n});r.answer(),this.session.emitMultipleActiveCallsWarning(r.id),this._ack(f,g);break}It.warn(`Attach: callID ${b} does not match any active calls. `),Cn(ut.Warning,{warning:gt(et),callId:b,params:m,sessionId:p.sessionid},p.uuid),this._ack(f,g);break}case ln.Event:case"webrtc.event":if(!y)return void It.error("Verto received an unknown event:",m);const t=p.relayProtocol,w=y.split(".")[0];p._existsSubscription(t,y)?Cn(t,m,y):y===p.sessionid?this._handleSessionEvent(m.eventData):p._existsSubscription(t,w)?Cn(t,m,w):p.calls.hasOwnProperty(y)?p.calls[y].handleMessage(e):Cn(ut.Notification,m,p.uuid);break;case ln.Info:m.type=cn.generic,Cn(ut.Notification,m,p.uuid);break;case ln.ClientReady:this.session.execute(C);break;case"ai_conversation":Cn(ut.AIConversationMessage,{method:"ai_conversation",params:m,voice_sdk_id:v},p.uuid);break;default:{const t=Bt(e);if(t){switch(t){case mn.REGISTER:case mn.REGED:if(!this.isDuplicateGatewayState(t,[mn.REGED,mn.REGISTER])){this.session._triggerKeepAliveTimeoutCheck(),this.retriedRegister=0,t===mn.REGED&&this.session.resetReconnectAttempts();const u=null===(i=null===(n=null==e?void 0:e.result)||void 0===n?void 0:n.params)||void 0===i?void 0:i.call_report_id;u&&(p.callReportId=u,It.debug("Captured call_report_id from REGED:",u));const h=null===(o=null===(r=null==e?void 0:e.result)||void 0===r?void 0:r.params)||void 0===o?void 0:o.dc;h&&(p.dc=h);const f=null===(s=null===(a=null==e?void 0:e.result)||void 0===a?void 0:a.params)||void 0===s?void 0:s.region;f&&(p.region=f),It.info(`Connected to Telnyx — region: ${null!==(l=p.region)&&void 0!==l?l:"unknown"}, dc: ${null!==(c=p.dc)&&void 0!==c?c:"unknown"}`),m.type=cn.vertoClientReady,null===(d=p._registrationTimings)||void 0===d||d.finish(p.sessionid),Cn(ut.Ready,m,p.uuid)}break;case mn.UNREGED:case mn.NOREG:if(this.retriedRegister+=1,5===this.retriedRegister){this.retriedRegister=0;const e=new Ki("Fail to register the user, the server tried 5 times","UNREGED|NOREG"),t=bt(xe,e);Cn(ut.Error,{error:t,sessionId:p.sessionid},p.uuid);break}{const e=this.reconnectDelay();null===(u=p._registrationTimings)||void 0===u||u.mark("schedule gateway state retry",{state:t,attempt:this.retriedRegister,delayMs:e}),setTimeout(()=>{var e;null===(e=p._registrationTimings)||void 0===e||e.mark("gateway state retry timer fired"),this.session.execute(C)},e);break}case mn.FAILED:case mn.FAIL_WAIT:case mn.TIMEOUT:if(!this.isDuplicateGatewayState(t,[mn.FAILED,mn.FAIL_WAIT,mn.TIMEOUT])){const e=bt(Se,new Error(`Gateway state: ${t}`));if(Cn(ut.Error,{error:e,sessionId:p.sessionid},p.uuid),p.options.skipLastVoiceSdkId=!0,It.debug(`Set skipLastVoiceSdkId=true on session options to avoid sticky reconnect to same b2bua-rtc instance (sessionId=${p.sessionid})`),!this.session.hasAutoReconnect()){this.retriedConnect=0;const e=new Ki("Fail to connect the server, the server tried 5 times","FAILED|FAIL_WAIT|TIMEOUT");this.session._terminateActiveCallsLocally();const t=bt(_e,e);Cn(ut.Error,{error:t,sessionId:p.sessionid},p.uuid);break}if(this.retriedConnect+=1,5===this.retriedConnect){this.retriedConnect=0,this.session._terminateActiveCallsLocally();const e=bt(_e,new Error("Connection Retry Failed"));Cn(ut.Error,{error:e,sessionId:p.sessionid},p.uuid);break}{const e=this.reconnectDelay();null===(h=p._registrationTimings)||void 0===h||h.mark("schedule gateway reconnect",{state:t,attempt:this.retriedConnect,delayMs:e}),setTimeout(()=>{var e;if(null===(e=p._registrationTimings)||void 0===e||e.mark("gateway reconnect timer fired"),It.debug(`Reconnecting... Retry ${this.retriedConnect} of 5`),this.session.options.keepConnectionAliveOnSocketClose){const e=Object.values(p.calls).some(e=>{var t;return(null===(t=e.peer)||void 0===t?void 0:t.instance)&&!e.signalingStateClosed});if(e)return It.debug("Reconnecting by keeping the existing session due to keepConnectionAliveOnSocketClose option being set."),void this.session.socketDisconnect();It.debug("keepConnectionAliveOnSocketClose is set but all peer connections have signalingState closed, doing full reconnect")}this.session.disconnect().then(()=>{this.session.clearConnection(),this.session.connect()})},e)}}break;default:It.warn("GatewayState message unknown method:",e)}break}It.debug("Verto message unknown method:",e);break}}}isDuplicateGatewayState(e,t){const{previousGatewayState:n}=this.session.connection,i=t.includes(n);return i&&It.debug(`Gateway state '${e}' received but previous state was '${n}' — guard condition met, skipping re-emission (sessionId=${this.session.sessionid})`),i}_retrieveCallId(e,t){const n=Object.keys(this.session.calls);if("bootObj"!==e.action)return n.find(e=>this.session.calls[e].channels.includes(t));{const t=e.data.find(e=>n.includes(e[0]));if(t instanceof Array)return t[0]}}_handlePvtEvent(e){return Z(this,void 0,void 0,function*(){const{session:t}=this,n=t.relayProtocol,{action:i,laChannel:r,laName:o,chatChannel:a,infoChannel:s,modChannel:l,conferenceMemberID:c,role:d,callID:u}=e;switch(i){case"conference-liveArray-join":{const n=()=>{t.vertoBroadcast({nodeId:this.nodeId,channel:r,data:{liveArray:{command:"bootstrap",context:r,name:o}}})},i={nodeId:this.nodeId,channels:[r],handler:({data:i})=>{const a=u||this._retrieveCallId(i,r);if(a&&t.calls.hasOwnProperty(a)){const s=t.calls[a];s._addChannel(r),s.extension=o,s.handleConferenceUpdate(i,e).then(e=>{"INVALID_PACKET"===e&&n()})}}},a=yield t.vertoSubscribe(i).catch(e=>{It.error("liveArray subscription error:",e);const n=bt(be,e);Cn(ut.Error,{error:n,sessionId:t.sessionid},t.uuid)});hi(a,r)&&n();break}case"conference-liveArray-part":{let e=null;if(r&&t._existsSubscription(n,r)){const{callId:i=null}=t.subscriptions[n][r];if(e=t.calls[i]||null,null!==i){const n={type:cn.conferenceUpdate,action:fn.Leave,conferenceName:o,participantId:Number(c),role:d};Cn(ut.Notification,n,i,!1)||Cn(ut.Notification,n,t.uuid),null===e&&xn(ut.Notification,null,i)}}const i=[r,a,s,l];t.vertoUnsubscribe({nodeId:this.nodeId,channels:i}).then(({unsubscribedChannels:t=[]})=>{e&&(e.channels=e.channels.filter(e=>!t.includes(e)))}).catch(e=>{It.error("liveArray unsubscribe error:",e)});break}}})}_handleSessionEvent(e){switch(e.contentType){case"layout-info":case"layer-info":Pi(this.session,e);break;case"logo-info":{const t={type:cn.conferenceUpdate,action:fn.LogoInfo,logo:e.logoURL};Cn(ut.Notification,t,this.session.uuid);break}}}}class Qi extends Gi{constructor(e){super(e),this.relayProtocol="verto-protocol",this.timeoutErrorCode=-329990,this.handleLoginOnSocketOpen=()=>Z(this,void 0,void 0,function*(){this._idle=!1;const{autoReconnect:e=!0}=this.options;yield this.login({onSuccess:()=>{this._autoReconnect=e}})}),this.handleAnonymousLoginOnSocketOpen=()=>Z(this,void 0,void 0,function*(){this._idle=!1,yield this.login()}),this._vertoHandler=new Yi(this),window.addEventListener("beforeunload",t=>{if(It.debug("Window beforeunload triggered."),!1!==e.hangupOnBeforeUnload)return en(),void(this.calls&&Object.keys(this.calls).forEach(e=>{this.calls[e]&&(It.info(`Hanging up call due to window unload: ${e}`),this.calls[e].hangup({initiator:"sdk:beforeunload"},!0))}));try{const e=this.getActiveCalls().map(e=>{const t={id:e.id,customHeaders:e.options.customHeaders,forceRelayCandidate:e.shouldForceRelayCandidateForRecovery()};return"held"===e.state&&(t.wasHeld=!0),"string"==typeof e.options.remoteElement?t.remoteElement=e.options.remoteElement:this.remoteElementId&&e.options.remoteElement===this.remoteElement&&(t.remoteElement=this.remoteElementId),"string"==typeof e.options.localElement?t.localElement=e.options.localElement:this.localElementId&&e.options.localElement===this.localElement&&(t.localElement=this.localElementId),t});if(this.getActiveCalls().forEach(e=>{if(e.flushIntermediateCallReport)try{It.debug(`beforeunload: flushing call report for ${e.id}.`),e.flushIntermediateCallReport({type:"page-unload"})}catch(t){It.debug(`beforeunload: failed to flush call report for ${e.id}: ${t instanceof Error?t.message:String(t)}`)}}),!this.sessionid||0===e.length)return It.debug(`No sessionID ${this.sessionid} or activeCalls ${e.length} during saving calls recover marker!`),void nn();It.info(`Saving recovery marker for ${e.length} active call(s) before unload (sessid=${this.sessionid}): [${e.map(e=>e.id).join(", ")}].`),on(e,this.sessionid)}catch(e){const t=this.calls?Object.keys(this.calls):[];It.debug(`Failed to save active-calls recovery marker before unload (active call ids: [${t.join(", ")}]): ${e instanceof Error?e.message:String(e)}`)}}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&!1===e.hangupOnBeforeUnload&&this.sessionid&&this.hasActiveCall()&&(It.debug("visibilitychange → hidden: re-stamping reconnect session-id freshness."),Zt(this.sessionid))})}validateOptions(){return Ut(this.options)||$t(this.options)}newCall(e){if(!this.validateCallOptions(e))throw bt(me,void 0,"Error: destinationNumber is required");const t=new qi(this,e);return e.id||It.debug(`newCall: callId was not provided in options, SDK-generated ID: ${t.id}`),this.emitMultipleActiveCallsWarning(t.id),performance.mark(zi(t.id,"new-call-start")),t.invite(),t}broadcast(e){return this.vertoBroadcast(e)}subscribe(e){return this.vertoSubscribe(e)}unsubscribe(e){return this.vertoUnsubscribe(e)}validateCallOptions(e){return!!$t(this.options)||Boolean(e.destinationNumber)}_onSocketOpen(){const e=Object.create(null,{_onSocketOpen:{get:()=>super._onSocketOpen}});return Z(this,void 0,void 0,function*(){return e._onSocketOpen.call(this),Ut(this.options)?this.handleLoginOnSocketOpen():$t(this.options)?this.handleAnonymousLoginOnSocketOpen():void 0})}_onSocketMessage(e){this._vertoHandler.handleMessage(e)}}const Ji=e=>Number(e.toFixed(2)),Xi=(e={})=>Object.entries(e).filter(([,e])=>void 0!==e).map(([e,t])=>`${e}=${t}${e.endsWith("Ms")?" ms":""}`).join(", ");class Zi{constructor(e){this.sdkVersion=e,this.clientId="",this.startedAtUtc=(new Date).toISOString(),this.previousStep="new TelnyxRTC()",this.clockAdjusted=!1,this.finished=!1,this.socketAttempts=0,this.droppedSteps=0,this.droppedRequests=0,this.entries=[{timestamp:this.startedAtUtc,step:"new TelnyxRTC()",deltaMs:0,elapsedMs:0}],this.requests=new Map;try{const e=performance.now.bind(performance),t=e();if(!Number.isFinite(t))throw new Error("Clock unavailable");this.readClock=e,this.startedAt=t,this.clock="performance"}catch(e){this.readClock=Date.now,this.startedAt=this.readClock(),this.clock="date"}this.previousAt=this.startedAt}now(){try{const e=this.readClock();if(Number.isFinite(e)&&e>=this.previousAt)return e}catch(e){}return this.clockAdjusted=!0,this.previousAt}record(e,t,n=this.now(),i=!0){const r=Ji(n-this.previousAt);(!this.longestInterval||r>this.longestInterval.durationMs)&&(this.longestInterval={from:this.previousStep,to:e,durationMs:r}),this.previousAt=n,this.previousStep=e;const o=Object.assign({timestamp:(new Date).toISOString(),step:e,deltaMs:r,elapsedMs:Ji(n-this.startedAt)},t?{details:t}:{});return this.entries.length===Zi.MAX_STEPS&&(this.entries.shift(),this.droppedSteps+=1),this.entries.push(o),i&&this.logStep(o),o}logStep(e){try{const t=Xi(e.details);It.info(`[TelnyxRTC registration ${this.clientId}] ${e.timestamp} +${e.deltaMs} ms / ${e.elapsedMs} ms total: ${e.step}`+(t?` (${t})`:""))}catch(e){}}mark(e,t){if(this.finished)return;const n=this.now();"TelnyxRTC constructor complete"===e&&(this.constructorFinishedAt=n),"client.connect() called"===e&&void 0===this.connectStartedAt&&(this.connectStartedAt=n),"create WebSocket"===e&&(this.socketAttempts+=1,this.requests.clear()),"WebSocket closed"!==e&&"WebSocket error"!==e||this.requests.clear(),this.record(e,t,n)}requestSent(e,t){if(this.finished||!(e=>"login"===e||"anonymous_login"===e||e===ln.GatewayState)(t)||"string"!=typeof e||e.length>128)return;const n=this.now();this.requests.has(e)||this.requests.size!==Zi.MAX_REQUESTS||(this.requests.delete(this.requests.keys().next().value),this.droppedRequests+=1),this.requests.set(e,{method:t,startedAt:n}),this.record(`send ${t}`,{requestId:e},n)}responseReceived(e){var t,n,i;if(this.finished||!e)return;const r=this.now(),o="string"==typeof e.id?e.id:void 0,a=this.requests.get(o),s={};a&&(s.requestId=o,s.requestMs=Ji(r-a.startedAt),this.requests.delete(o));const l=(null===(n=null===(t=e.result)||void 0===t?void 0:t.params)||void 0===n?void 0:n.state)||(null===(i=e.params)||void 0===i?void 0:i.state);Object.values(mn).includes(l)&&(s.state=l),e.method===ln.ClientReady?this.record("receive server clientReady",s,r):a?this.record(`receive ${a.method}${e.error?" error":""}`,s,r):s.state&&this.record("receive gateway state",s,r)}finish(e){if(this.finished)return;const t=this.now(),n=this.record("emit telnyx.ready (vertoClientReady) to app",void 0,t,!1);this.finished=!0,this.requests.clear(),this.completedAtUtc=n.timestamp,this.summary=Object.assign(Object.assign(Object.assign({event:"registration_timing",schemaVersion:1,scope:"initial_registration",clientId:this.clientId,sessionId:e,sdkVersion:this.sdkVersion,startedAt:this.startedAtUtc,timestamp:this.completedAtUtc,clock:this.clock,clockAdjusted:this.clockAdjusted,totalMs:Ji(t-this.startedAt)},void 0!==this.constructorFinishedAt?{constructorMs:Ji(this.constructorFinishedAt-this.startedAt)}:{}),void 0!==this.connectStartedAt?Object.assign({connectToReadyMs:Ji(t-this.connectStartedAt)},void 0!==this.constructorFinishedAt?{appWaitBeforeConnectMs:Ji(this.connectStartedAt-this.constructorFinishedAt)}:{}):{}),{socketAttempts:this.socketAttempts,droppedSteps:this.droppedSteps,droppedRequests:this.droppedRequests,longestInterval:this.longestInterval,steps:this.entries}),this.entries=[],Promise.resolve().then(()=>{this.logStep(n);try{const e=this.summary,t=[`${e.totalMs} ms total`];void 0!==e.constructorMs&&t.push(`constructor=${e.constructorMs} ms`),void 0!==e.appWaitBeforeConnectMs&&t.push(`app wait=${e.appWaitBeforeConnectMs} ms`),void 0!==e.connectToReadyMs&&t.push(`connect-to-ready=${e.connectToReadyMs} ms`);const n=e.longestInterval;It.info(`[TelnyxRTC registration ${this.clientId}] ${e.timestamp} COMPLETE: ${t.join("; ")}; longest interval: ${n.from} → ${n.to} (${n.durationMs} ms); socket attempts=${e.socketAttempts}; dropped steps=${e.droppedSteps}`)}catch(e){}try{(function(){const e=Tt.info;return e>=Rt&&e>=It.getLevel()})()&&"undefined"!=typeof console&&"function"==typeof console.table&&console.table(this.summary.steps.map(e=>Object.assign(Object.assign({},e),{details:Xi(e.details)})))}catch(e){}})}getLogEntry(){if(this.summary)return{timestamp:this.completedAtUtc,level:"info",message:"Registration timing",context:JSON.parse(JSON.stringify(this.summary))}}}function er(e){return{options:e,statsSamples:[]}}function tr(e){return(Array.isArray(e.urls)?e.urls:[e.urls]).some(e=>/^turns?:/i.test(e))}function nr(e){var t;let n=e;const i=n.match(/^([a-z]+:)(\/\/)?([^@]*@)(.+)$/i);i&&(n=i[1]+(null!==(t=i[2])&&void 0!==t?t:"")+i[4]);const r=n.indexOf("?transport=");return-1!==r&&(n=n.substring(0,r)),n}function ir(e){const t=e.indexOf("?transport=");if(-1===t)return;const n=e.substring(t+11).toLowerCase(),i=n.indexOf("&");return-1===i?n:n.substring(0,i)}function rr(e,t,n){var i;if(!e||!t)return!1;if(nr(e)!==nr(t))return!1;const r=ir(t);if(void 0===r)return!0;const o=null!==(i=ir(e))&&void 0!==i?i:null==n?void 0:n.toLowerCase();return void 0===o||o===r}Zi.MAX_STEPS=128,Zi.MAX_REQUESTS=32;const or=2e3;function ar(e,t,n){return Z(this,void 0,void 0,function*(){if("undefined"==typeof AudioContext)return null;let i,r,o;try{i=new AudioContext,r=i.createAnalyser(),o=i.createMediaStreamSource(e),r.fftSize=2048,o.connect(r);const a=new Float32Array(r.fftSize),s=Date.now()+t;let l=0,c=0,d=0;for(;Date.now()<s;){r.getFloatTimeDomainData(a);let e=0;for(const t of a)e+=t*t;const t=Math.sqrt(e/a.length);l=Math.max(l,t),c+=t,d+=1;const n=s-Date.now();n>0&&(yield new Promise(e=>setTimeout(e,Math.min(100,n))))}return{audioLevel:l,audioDetected:l>=n,audioLevelStats:{peak:l,average:d>0?c/d:0,samples:d}}}catch(e){return null}finally{try{null==o||o.disconnect(),null==r||r.disconnect(),yield null==i?void 0:i.close()}catch(e){}}})}function sr(e,t){return Z(this,void 0,void 0,function*(){if("undefined"!=typeof MediaRecorder)try{const n=["audio/webm;codecs=opus","audio/webm"].find(e=>"function"!=typeof MediaRecorder.isTypeSupported||MediaRecorder.isTypeSupported(e)),i=n?new MediaRecorder(e,{mimeType:n}):new MediaRecorder(e),r=[],o=Date.now();return yield new Promise(e=>{let a=!1;const s=t=>{a||(a=!0,clearTimeout(l),clearTimeout(c),e(t))};i.ondataavailable=({data:e})=>{e.size>0&&r.push(e)},i.onerror=()=>s(),i.onstop=()=>Z(this,void 0,void 0,function*(){const e=i.mimeType||n||"audio/webm",t=yield(a=new Blob(r,{type:e}),new Promise(e=>{try{const t=new FileReader;t.onloadend=()=>e("string"==typeof t.result?t.result:void 0),t.onerror=()=>e(void 0),t.readAsDataURL(a)}catch(t){e(void 0)}}));var a;s(t?{recordingDataUrl:t,recordingMimeType:e,recordingDurationMs:Date.now()-o}:void 0)});const l=setTimeout(()=>{try{"inactive"!==i.state&&i.stop()}catch(e){s()}},t),c=setTimeout(()=>s(),t+1e3);i.start()})}catch(e){return}})}function lr(e){var t,n;return Z(this,void 0,void 0,function*(){const i=function(e){var t,n;const i=e&&"object"==typeof e?e:void 0;return{sampleDurationMs:Math.max(0,null!==(t=null==i?void 0:i.sampleDurationMs)&&void 0!==t?t:or),silenceThreshold:Math.min(1,Math.max(0,null!==(n=null==i?void 0:i.silenceThreshold)&&void 0!==n?n:.01)),record:!0===(null==i?void 0:i.record),warnOnRecording:null==i?void 0:i.warnOnRecording}}(e.options.microphone),r=yield function(){var e;return Z(this,void 0,void 0,function*(){if("undefined"==typeof navigator||"function"!=typeof(null===(e=navigator.permissions)||void 0===e?void 0:e.query))return"unknown";try{return(yield navigator.permissions.query({name:"microphone"})).state}catch(e){return"unknown"}})}(),{report:o,stream:a}=yield function(){var e;return Z(this,void 0,void 0,function*(){if("undefined"==typeof navigator||"function"!=typeof(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia))return{report:{activeCapturePerformed:!1,captureError:"not_supported",captureErrorMessage:"getUserMedia is not available in this environment"},stream:void 0};try{return{report:{deviceAvailable:!0},stream:yield navigator.mediaDevices.getUserMedia({audio:!0})}}catch(e){const{captureError:t,captureErrorMessage:n}=function(e){const t=e&&"object"==typeof e&&"name"in e?String(e.name):"",n=e instanceof Error?e.message:String(e);return"NotAllowedError"===t||"PermissionDeniedError"===t||"SecurityError"===t?{captureError:"permission_denied",captureErrorMessage:`Microphone permission denied: ${n}`}:"NotFoundError"===t||"DevicesNotFoundError"===t||"OverconstrainedError"===t||"ConstraintNotSatisfiedError"===t?{captureError:"no_device",captureErrorMessage:`No microphone device found: ${n}`}:"TypeError"===t?{captureError:"not_supported",captureErrorMessage:`Microphone capture is not supported: ${n}`}:{captureError:"unknown",captureErrorMessage:n}}(e);return{report:{activeCapturePerformed:!1,captureError:t,captureErrorMessage:n,deviceAvailable:!1},stream:void 0}}})}(),s=yield function(){var e;return Z(this,void 0,void 0,function*(){if("undefined"!=typeof navigator&&"function"==typeof(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.enumerateDevices))try{const e=(yield navigator.mediaDevices.enumerateDevices()).filter(({kind:e})=>"audioinput"===e).map(({deviceId:e,label:t})=>({deviceId:e||"",label:t||"",kind:"audioinput"}));return{devices:e,deviceCount:e.length,deviceAvailable:e.length>0,labelsAccessible:e.some(({label:e})=>e.length>0)}}catch(e){return}})}(),l=a?"granted":"permission_denied"===o.captureError?"denied":r,c={currentPermissionState:l,isPermissionGrantedCurrently:"granted"===l,isGetUserMediaFailed:!a,deviceAvailable:(null==s?void 0:s.deviceAvailable)||o.deviceAvailable||!1,deviceCount:null!==(t=null==s?void 0:s.deviceCount)&&void 0!==t?t:0,devices:null!==(n=null==s?void 0:s.devices)&&void 0!==n?n:[],labelsAccessible:null==s?void 0:s.labelsAccessible,captureError:o.captureError,captureErrorMessage:o.captureErrorMessage,activeCapturePerformed:o.activeCapturePerformed};if(a)try{const e=yield function(e,t,n){var i,r,o;return Z(this,void 0,void 0,function*(){e.activeCapturePerformed=!0,e.recordingPerformed=n.record,n.record&&n.warnOnRecording&&n.warnOnRecording("To check your microphone, we will be recorded your voice for a few seconds and played back to you so you can hear how it sounds.");const[a,s]=yield Promise.all([ar(t,null!==(i=n.sampleDurationMs)&&void 0!==i?i:or,null!==(r=n.silenceThreshold)&&void 0!==r?r:.01),n.record?sr(t,null!==(o=n.sampleDurationMs)&&void 0!==o?o:or):Promise.resolve(void 0)]);return a&&(e.audioLevel=a.audioLevel,e.audioDetected=a.audioDetected,e.audioLevelStats=a.audioLevelStats),s&&(e.recordingDataUrl=s.recordingDataUrl,e.recordingMimeType=s.recordingMimeType,e.recordingDurationMs=s.recordingDurationMs,e.recordingPerformed=!0),s})}(c,a,i);e&&(c.playbackPerformed=yield(d=e.recordingDataUrl,u=e.recordingDurationMs+5e3,"undefined"==typeof Audio?Promise.resolve(!1):new Promise(e=>{let t,n=!1;const i=setTimeout(()=>r(!1),u),r=r=>{n||(n=!0,clearTimeout(i),t&&(t.onended=null,t.onerror=null,t.paused||t.pause(),t.src=""),e(r))};try{t=new Audio(d),t.onended=()=>r(!0),t.onerror=()=>r(!1),t.play().catch(()=>r(!1))}catch(e){r(!1)}})))}finally{try{a.getTracks().forEach(e=>e.stop())}catch(e){}}var d,u;const h=function(e){const t=[],n=(e,n)=>t.push({code:e,message:n,source:"microphone"});"denied"===e.currentPermissionState&&n("microphone_permission_denied","Microphone permission has been denied by the user."),!1===e.deviceAvailable&&n("microphone_no_device","No audio input device is available.");const i=e.captureError?{permission_denied:["microphone_capture_permission_denied","Active microphone capture was denied permission."],no_device:["microphone_capture_no_device","No microphone device was found for active capture."],not_supported:["microphone_capture_not_supported","Active microphone capture is not supported."],unknown:["microphone_capture_failed","Active microphone capture failed."]}[e.captureError]:void 0;return i&&n(...i),e.activeCapturePerformed&&!1===e.audioDetected&&n("microphone_silent","No audio was detected above the silence threshold during active capture."),t}(c);return h.length>0&&(c.reasons=h),Object.keys(c).length>0?c:void 0})}function cr(e){if("number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e))return e}function dr(e){const t=e.filter(e=>void 0!==cr(e));if(0===t.length)return;let n=1/0,i=-1/0,r=0;for(const e of t)e<n&&(n=e),e>i&&(i=e),r+=e;return{min:n,max:i,average:r/t.length}}function ur(e){var t,n;const i=[],r=new Set;e.forEach(e=>{const t=e;i.push(t),"transport"===t.type&&"string"==typeof t.selectedCandidatePairId&&r.add(t.selectedCandidatePairId)});const o=i.filter(e=>"candidate-pair"===e.type);return null!==(n=null!==(t=o.find(e=>r.has(e.id)))&&void 0!==t?t:o.find(e=>!0===e.selected||!0===e.nominated&&"succeeded"===e.state))&&void 0!==n?n:o.find(e=>"succeeded"===e.state)}function hr(e,t){let n=0,i=!1;for(const r of e){const e=cr(r[t]);void 0!==e&&(n+=e,i=!0)}return i?n:void 0}function pr(e,t,n=!1){const i=[];return e.forEach(e=>{const r=e;r.type!==t||n&&!function(e){var t;const n=null!==(t=e.kind)&&void 0!==t?t:e.mediaType;return void 0===n||"audio"===n}(r)||i.push(r)}),i}function fr(e,t){const n=void 0===e.packets?void 0!==t.packets:void 0!==t.packets&&t.packets>e.packets,i=void 0===e.bytes?void 0!==t.bytes:void 0!==t.bytes&&t.bytes>e.bytes;return n||i}function gr(e,t){if(void 0!==e&&void 0!==t)return cr(t-e)}function mr(e,t){var n,i;if(!e.some(e=>pr(e,`${t}-rtp`,!0).length>0))return;const r=e.map(e=>function(e,t){const n=pr(e,`${t}-rtp`,!0);return"outbound"===t?{packets:hr(n,"packetsSent"),bytes:hr(n,"bytesSent")}:{packets:hr(n,"packetsReceived"),bytes:hr(n,"bytesReceived")}}(e,t)).filter(({packets:e,bytes:t})=>void 0!==e||void 0!==t),o=null!==(n=r[0])&&void 0!==n?n:{},a=null!==(i=r[r.length-1])&&void 0!==i?i:{},s=gr(o.packets,a.packets),l=gr(o.bytes,a.bytes);return Object.assign(Object.assign(Object.assign(Object.assign({flowing:r.length>1&&fr(o,a)},void 0!==a.packets?{packets:a.packets}:{}),void 0!==a.bytes?{bytes:a.bytes}:{}),void 0!==s?{packetsDelta:s}:{}),void 0!==l?{bytesDelta:l}:{})}function vr(e,t){const n=[];for(const i of e)for(const e of pr(i,t,!0)){const t=cr(e.jitter);if(void 0!==t){const e=1e3*t;e>=0&&n.push(e)}}return n}function br(e){const t=hr(e,"packetsReceived"),n=hr(e,"packetsLost"),i=e.map(e=>cr(e.fractionLost)).filter(e=>void 0!==e&&e>=0&&e<=1),r=i.length>0?Math.max(...i):void 0,o=void 0!==t&&void 0!==n?t+n:void 0;return{packetsReceived:t,packetsLost:n,packetLossFraction:null!=r?r:void 0!==n&&void 0!==o&&o>0?n/o:void 0}}function yr(e){let t;return e.forEach(e=>{void 0===t&&(t=cr(e.timestamp))}),t}function wr(e){return"number"==typeof e&&Number.isFinite(e)&&e>=0?e:void 0}function kr(e,t){return e.find(e=>e.label===t)}class _r{constructor(){this.startedAtMonoMs=Sr()}build(e={}){var t,n;const i={};try{const r=null===(n=null===(t=e.call)||void 0===t?void 0:t.getEstablishmentTimings)||void 0===n?void 0:n.call(t);if(r){i.callEstablishment={mode:r.mode,direction:r.direction,steps:r.steps.map(e=>Object.assign({},e))};const e=kr(r.steps,"ICE candidate gathering started"),t=kr(r.steps,"All ICE candidates gathered"),n=wr(e&&t?t.fromStart-e.fromStart:void 0);void 0!==n&&(i.iceGatheringMs=n);const o=kr(r.steps,"First server-reflexive/relay candidate found"),a=wr(e&&o?o.fromStart-e.fromStart:void 0);void 0!==a&&(i.firstNonHostCandidateMs=a)}}catch(e){}return i}complete(e){const t=Sr()-this.startedAtMonoMs;Number.isFinite(t)&&t>=0&&(e.totalMs=t)}}function Sr(){try{if("undefined"!=typeof performance&&"function"==typeof performance.now)return performance.now()}catch(e){}return Date.now()}function xr(){return new _r}const Cr="ice_only_host_candidates",Er={inconclusive:0,ready:1,degraded:2,blocked:3,permission_denied:4};function Ir(e,t){return e?t?Er[e]>=Er[t]?e:t:e:t}function Tr(e,t,n){return{code:e,message:t,source:n}}function Rr(e,t,n){return{code:e,message:t,source:n}}function Nr(e,t=!1){var n;if(!e)return{reasons:[],warnings:[]};const i={reasons:[],warnings:[]},{reasons:r,warnings:o}=i,a=e.candidates.length>0;a||(r.push(Tr("ice_no_candidates","No ICE candidates were gathered.","ice")),i.verdict="inconclusive"),a&&e.onlyHostCandidates&&(e.hasSelectedPair?o.push(Rr(Cr,"Only host ICE candidates were found. Connectivity succeeded, but NAT traversal may not be possible.","ice")):(r.push(Tr(Cr,"Only host ICE candidates were found. NAT traversal may not be possible.","ice")),i.verdict=Ir(i.verdict,"degraded"))),e.isTurnRequired&&!t&&(r.push(Tr("ice_turn_required","The selected ICE candidate pair requires a TURN relay.","ice")),i.verdict=Ir(i.verdict,"degraded"));const s=void 0!==e.iceConnectionState&&"new"!==e.iceConnectionState;a&&!e.hasSelectedPair&&s&&(r.push(Tr("ice_no_selected_pair","No ICE candidate pair was selected. Connectivity failed.","ice")),i.verdict=Ir(i.verdict,"blocked")),!1===e.candidateGatheringCompleted&&(r.push(Tr("ice_gathering_timeout","ICE gathering did not complete within the timeout.","ice")),i.verdict=Ir(i.verdict,"degraded"));const l=(null!==(n=e.serverCandidateComparison)&&void 0!==n?n:[]).filter(({hasCandidates:e})=>!e);return l.length>0&&o.push(Rr("ice_server_no_candidates",`${l.length} configured ICE server${1===l.length?"":"s"} produced no candidates.`,"ice")),e.hasMultipleNetworkInterfaces&&o.push(Rr("ice_multiple_interfaces","Multiple network interfaces were detected on the host.","ice")),e.vpnDetected&&o.push(Rr("ice_vpn_detected","A VPN appears to be active and may affect media routing.","ice")),!i.verdict&&a&&(i.verdict="ready"),i}function Or(e){if(e.established&&!e.error)return{reasons:[],warnings:[]};const t=Array.isArray(e.server.urls)?e.server.urls.join(", "):e.server.urls;return{verdict:"degraded",reasons:[Tr("ice_server_failed",e.error?`ICE server [${t}] failed: ${e.error}`:`ICE server [${t}] did not establish a diagnostic call.`,"ice")],warnings:[]}}function Ar(e,t=!0){var n;if(!e)return{reasons:[],warnings:[]};const i={reasons:[],warnings:[]},{reasons:r,warnings:o}=i,a=t?e.reasons:null===(n=e.reasons)||void 0===n?void 0:n.filter(({code:e})=>"network_low_bitrate"!==e);switch((null==a?void 0:a.length)&&(r.push(...a),i.verdict="degraded"),e.quality){case"poor":r.push(Tr("network_poor_quality","Network quality is poor.","network")),i.verdict=Ir(i.verdict,"blocked");break;case"fair":o.push(Rr("network_fair_quality","Network quality is fair.","network")),i.verdict=Ir(i.verdict,"degraded");break;case"good":i.verdict=Ir(i.verdict,"ready")}const s=[e.inbound,e.outbound].filter(e=>!!e);if(t&&s.length>0){const e=s.filter(({flowing:e})=>e).length;2===s.length&&2===e?i.verdict=Ir(i.verdict,"ready"):e>0?(r.push(Tr("network_one_way_audio","Audio RTP is flowing in only one direction.","network")),i.verdict=Ir(i.verdict,"blocked")):(r.push(Tr("network_no_audio_flow","No inbound or outbound audio RTP is flowing.","network")),i.verdict=Ir(i.verdict,"blocked"))}return i}function Lr(e){var t;if(!e)return{reasons:[],warnings:[]};const n={reasons:[],warnings:[]};(null===(t=e.reasons)||void 0===t?void 0:t.length)&&n.reasons.push(...e.reasons);const i="denied"===e.currentPermissionState||!1===e.isPermissionGrantedCurrently||"permission_denied"===e.captureError,r=!1===e.deviceAvailable||void 0!==e.captureError,o=!0===e.activeCapturePerformed&&!1===e.audioDetected;return i?n.verdict="permission_denied":r?n.verdict="blocked":o?n.verdict="degraded":(!0===e.activeCapturePerformed&&!0===e.audioDetected||!0!==e.activeCapturePerformed&&!0===e.isPermissionGrantedCurrently&&!1!==e.deviceAvailable)&&(n.verdict="ready"),n}class Dr{constructor(e){this.options=e}run(){return Z(this,void 0,void 0,function*(){switch(this.options.mode){case"network-only":return this.runNetworkOnly();case"microphone-only":return this.runMicrophoneOnly(er(this.options));default:return this.runFull()}})}runFull(){return Z(this,void 0,void 0,function*(){const e=yield this.runTest({diagnosticOptions:this.options,modules:{ice:!!this.options.ice,network:!!this.options.network,microphone:!!this.options.microphone},autoHangup:!1!==this.options.autoHangup});return e.setupFailed?e.error?Pr({callId:e.callId,timings:e.timings},e.error):{version:1,verdict:"inconclusive",reasons:[{code:"call_setup_timeout",message:"The diagnostic call did not reach the established state",source:"diagnostic"}],callId:e.callId,timings:e.timings}:Pr({ice:e.ice,network:e.network,microphone:e.microphone,timings:e.timings,callId:e.callId,raw:e.raw},e.error)})}runNetworkOnly(){var e,t,n;return Z(this,void 0,void 0,function*(){const i=this.options.client.iceServers,r=function(e){const t=[];for(const n of e)(Array.isArray(n.urls)?n.urls:[n.urls]).forEach(e=>{t.push(Object.assign(Object.assign({},n),{urls:e}))});return t}(null!==(n=null!==(t=null===(e=this.options.rtcConfig)||void 0===e?void 0:e.iceServers)&&void 0!==t?t:i)&&void 0!==n?n:[]);let o=[];const a=xr();let s;try{return o=yield Promise.all(r.map(e=>Z(this,void 0,void 0,function*(){const t=yield this.runTest({diagnosticOptions:Object.assign(Object.assign({},this.options),{durationMs:3e3,statsSampleIntervalMs:500,rtcConfig:Object.assign(Object.assign({},this.options.rtcConfig),{iceServers:[e]})}),iceServers:[e],forceRelayCandidate:tr(e),modules:{ice:!0,network:!!this.options.network,microphone:!1},autoHangup:!0}),n=function(e){return e.error?e.error.message:e.setupFailed?"The diagnostic call did not reach the established state":e.ice?0===e.ice.candidates.length?"No ICE candidates were gathered":e.ice.hasSelectedPair?void 0:"No ICE candidate pair was selected":"No ICE report was produced"}(t);return{server:e,established:void 0===n,callId:t.callId,ice:t.ice,network:t.network,timings:t.timings,error:n}}))),s=Pr({serverTests:o,timings:a.build()},void 0,{networkOnly:!0}),s}catch(e){return s=Pr({timings:a.build()},Mr(e),{networkOnly:!0}),s}finally{(null==s?void 0:s.timings)&&a.complete(s.timings)}})}runTest(e){return Z(this,void 0,void 0,function*(){const t=er(e.diagnosticOptions),n=xr();let i,r,o,a=!1;const s=e=>{e.callId===(null==i?void 0:i.id)&&(r=Mr(e.error))};e.diagnosticOptions.client.on("telnyx.error",s);try{if(i=this.createDiagnosticCall(e.diagnosticOptions,e.iceServers,e.forceRelayCandidate),t.call=i,a=yield this.waitForCallEstablishment(i),!a)return o={established:!1,setupFailed:!0,callId:i.id,timings:n.build({call:i}),error:r},o;yield this.collectSamples(i,t);const s=e.modules.ice?function(e){var t,n;const i=null===(n=null===(t=e.call)||void 0===t?void 0:t.peer)||void 0===n?void 0:n.instance,r=e.statsSamples[e.statsSamples.length-1];if(!i||!r)return;const o=function(e,t){var n;const i=[],r=new Set,o=new Map,a=new Map,s={host:0,srflx:0,prflx:0,relay:0};e.forEach(e=>{switch(e.type){case"local-candidate":{const t=e;s[t.candidateType]++,a.set(t.id,t);break}case"remote-candidate":{const t=e;o.set(t.id,t);break}case"candidate-pair":{const t=e;i.push(t);break}case"transport":{const t=e;"string"==typeof t.selectedCandidatePairId&&r.add(t.selectedCandidatePairId);break}}});const l=function(e,t,n,i){var r,o;const a=e.find(e=>t.has(e.id)),s=e.find(e=>!0===e.selected),l=e.find(e=>!0===e.nominated&&"succeeded"===e.state),c=e.filter(e=>"succeeded"===e.state),d=null!==(o=null!==(r=null!=a?a:s)&&void 0!==r?r:l)&&void 0!==o?o:1===c.length?c[0]:void 0;return d?Object.assign(Object.assign({},d),{localCandidate:n.get(d.localCandidateId),remoteCandidate:i.get(d.remoteCandidateId)}):null}(i,r,a,o),c=s.relay>0,d=0===s.srflx&&0===s.relay&&0===s.prflx,u=t.iceGatheringState,h=t.iceConnectionState,p="complete"===u,f="relay"===(null===(n=null==l?void 0:l.localCandidate)||void 0===n?void 0:n.candidateType),{hasMultipleNetworkInterfaces:g,vpnDetected:m}=function(e){if(0===e.size)return{hasMultipleNetworkInterfaces:void 0,vpnDetected:void 0};const t=Array.from(e.values());return{hasMultipleNetworkInterfaces:new Set(t.filter(e=>"host"===e.candidateType).map(e=>e.address)).size>=2,vpnDetected:t.some(e=>"vpn"===e.networkType)}}(a);return{candidateGatheringCompleted:p,gatheringComplete:p,candidateCounts:s,candidates:Array.from(a.values()),hasRelayCandidate:c,onlyHostCandidates:d,isTurnRequired:f,hasMultipleNetworkInterfaces:g,vpnDetected:m,hasSelectedPair:!!l,selectedPair:null!=l?l:void 0,iceGatheringState:u,iceConnectionState:h}}(r,i),a=i.getConfiguration().iceServers;return a&&(o.serverCandidateComparison=function(e,t){var n,i;if(!e||0===e.length)return;const r=[];for(const o of e){const e=Array.isArray(o.urls)?o.urls:[o.urls],a=t.filter(t=>e.some(e=>rr(t.url,e,t.protocol))),s=null!==(i=null===(n=a[0])||void 0===n?void 0:n.candidateType)&&void 0!==i?i:null,l=a.length>0;r.push({urls:o.urls,hasCandidates:l,candidateType:s,candidates:a,candidateCount:a.length})}return r}(a,o.candidates)),o}(t):void 0,l=e.modules.network?function(e){if(0===e.statsSamples.length)return{quality:"unknown",reasons:[]};const t=e.statsSamples,n=mr(t,"inbound"),i=mr(t,"outbound"),r=dr(function(e){var t;const n=[];for(const i of e){let e=!1;const r=pr(i,"remote-inbound-rtp",!0);for(const t of r){const i=cr(t.roundTripTime);if(void 0!==i){const t=1e3*i;t>=0&&(n.push(t),e=!0)}}if(!e){const e=cr(null===(t=ur(i))||void 0===t?void 0:t.currentRoundTripTime);if(void 0!==e){const t=1e3*e;t>=0&&n.push(t)}}}return n}(t)),o=(a=dr(vr(t,"inbound-rtp")),s=dr(vr(t,"remote-inbound-rtp")),void 0===(null==a?void 0:a.average)?s:void 0===(null==s?void 0:s.average)?a:s.average>a.average?s:a);var a,s;const l=function(e,t,n){var i;if(0===e.length)return;const r=e[e.length-1],o=pr(r,"inbound-rtp",!0),a=pr(r,"remote-inbound-rtp",!0),s=function(e,t){return void 0===e.packetLossFraction?t:void 0===t.packetLossFraction?e:t.packetLossFraction>e.packetLossFraction?t:e}(br(o),br(a));let l=null==n?void 0:n.packets,c=null!==(i=s.packetsReceived)&&void 0!==i?i:null==t?void 0:t.packets;const d=s.packetsLost,u=s.packetLossFraction,h=ur(r);return void 0===l&&(l=cr(null==h?void 0:h.packetsSent)),void 0===c&&(c=cr(null==h?void 0:h.packetsReceived)),void 0!==l||void 0!==c||void 0!==d?{packetsSent:l,packetsReceived:c,packetsLost:d,packetLossFraction:u}:void 0}(t,n,i),c=function(e,t,n){if(0===e.length)return;const i=e[e.length-1];let r=null==n?void 0:n.bytes,o=null==t?void 0:t.bytes;const a=ur(i);return void 0===r&&(r=cr(null==a?void 0:a.bytesSent)),void 0===o&&(o=cr(null==a?void 0:a.bytesReceived)),void 0!==r||void 0!==o?{bytesSent:r,bytesReceived:o}:void 0}(t,n,i),d=function(e,t,n){if(e.length<2)return;const i=e[0],r=e[e.length-1],o=yr(i),a=yr(r);if(void 0===o||void 0===a)return;const s=(a-o)/1e3;if(s<=0)return;const l=void 0!==(null==n?void 0:n.bytesDelta)&&n.bytesDelta>=0?8*n.bytesDelta/s:void 0,c=void 0!==(null==t?void 0:t.bytesDelta)&&t.bytesDelta>=0?8*t.bytesDelta/s:void 0;return void 0!==l||void 0!==c?{outbound:l,inbound:c}:void 0}(t,n,i),u=function(e,t,n){let i=!1,r="good";return void 0!==(null==e?void 0:e.average)&&(i=!0,e.average>=500?r="poor":e.average>=300&&"good"===r&&(r="fair")),void 0!==(null==t?void 0:t.average)&&(i=!0,t.average>=100?r="poor":t.average>=30&&"good"===r&&(r="fair")),void 0!==(null==n?void 0:n.packetLossFraction)&&(i=!0,n.packetLossFraction>=.05?r="poor":n.packetLossFraction>=.02&&"good"===r&&(r="fair")),i?r:"unknown"}(r,o,l),h=function(e,t,n,i){const r=[];return void 0!==(null==e?void 0:e.average)&&(e.average>=500?r.push({code:"network_high_rtt",message:`Average RTT is ${Math.round(e.average)}ms (poor: ≥500ms threshold)`,source:"network"}):e.average>=300&&r.push({code:"network_high_rtt",message:`Average RTT is ${Math.round(e.average)}ms (degraded: ≥300ms threshold)`,source:"network"})),void 0!==(null==t?void 0:t.average)&&(t.average>=100?r.push({code:"network_high_jitter",message:`Average jitter is ${Math.round(t.average)}ms (poor: ≥100ms threshold)`,source:"network"}):t.average>=30&&r.push({code:"network_high_jitter",message:`Average jitter is ${Math.round(t.average)}ms (degraded: ≥30ms threshold)`,source:"network"})),void 0!==(null==n?void 0:n.packetLossFraction)&&(n.packetLossFraction>=.05?r.push({code:"network_packet_loss",message:`Packet loss is ${(100*n.packetLossFraction).toFixed(1)}% (poor: ≥5% threshold)`,source:"network"}):n.packetLossFraction>=.02&&r.push({code:"network_packet_loss",message:`Packet loss is ${(100*n.packetLossFraction).toFixed(1)}% (degraded: ≥2% threshold)`,source:"network"})),i&&(void 0!==i.outbound&&i.outbound<8e3&&r.push({code:"network_low_bitrate",message:`Outbound audio bitrate is ${Math.round(i.outbound)} bps (<8000 bps threshold)`,source:"network"}),void 0!==i.inbound&&i.inbound<8e3&&r.push({code:"network_low_bitrate",message:`Inbound audio bitrate is ${Math.round(i.inbound)} bps (<8000 bps threshold)`,source:"network"})),r}(r,o,l,"network-only"===e.options.mode?void 0:d);return{quality:u,rtt:r,jitter:o,packets:l,bytes:c,bitrate:d,inbound:n,outbound:i,reasons:h.length>0?h:void 0}}(t):void 0,c=e.modules.microphone?yield lr(t):void 0;return o={established:!0,setupFailed:!1,callId:i.id,ice:s,network:l,microphone:c,timings:n.build({call:i}),raw:{samples:t.statsSamples.length?t.statsSamples:void 0}},o}catch(e){return t.error=Mr(e),o={established:a,setupFailed:!1,callId:null==i?void 0:i.id,timings:n.build({call:i}),error:t.error},o}finally{if(e.diagnosticOptions.client.off("telnyx.error",s),i&&e.autoHangup)try{yield i.hangup()}catch(e){}(null==o?void 0:o.timings)&&n.complete(o.timings)}})}runMicrophoneOnly(e){return Z(this,void 0,void 0,function*(){const t=xr();let n;try{return n=Pr({microphone:this.options.microphone?yield lr(e):void 0,timings:t.build()},e.error),n}catch(i){return e.error=Mr(i),n=Pr({timings:t.build()},e.error),n}finally{(null==n?void 0:n.timings)&&t.complete(n.timings)}})}waitForCallEstablishment(e){return Z(this,void 0,void 0,function*(){const t=Date.now()+3e4,n=()=>{var t,n;return"active"===e.state&&"connected"===(null===(n=null===(t=e.peer)||void 0===t?void 0:t.instance)||void 0===n?void 0:n.connectionState)};for(;Date.now()<t;){if(n())return!0;if(["done","hangup","destroy"].includes(e.state))return!1;yield Fr(500)}return n()})}createDiagnosticCall(e,t,n=!1){const{client:i,destinationNumber:r,callerName:o,callerNumber:a,audio:s,debug:l,rtcConfig:c}=e;return i.newCall({destinationNumber:r,callerName:o,callerNumber:a,audio:s,debug:!0===l,iceServers:null!=t?t:null==c?void 0:c.iceServers,forceRelayCandidate:n})}collectSamples(e,t){var n,i,r;return Z(this,void 0,void 0,function*(){const o=null!==(n=t.options.durationMs)&&void 0!==n?n:5e3,a=null!==(i=t.options.statsSampleIntervalMs)&&void 0!==i?i:1e3,s=Date.now()+o;for(;Date.now()<s;){try{const n=yield null===(r=e.peer.instance)||void 0===r?void 0:r.getStats();n&&t.statsSamples.push(n)}catch(e){}yield Fr(Math.min(a,Math.max(0,s-Date.now())))}})}}function Pr(e,t,n){const{verdict:i,reasons:r,warnings:o}=function(e,t,n={}){var i,r;const o=[Nr(e.ice),Ar(e.network),Lr(e.microphone),...(null!==(i=e.serverTests)&&void 0!==i?i:[]).flatMap(e=>[Nr(e.ice,n.networkOnly&&tr(e.server)),Ar(e.network,!n.networkOnly),Or(e)])],a=o.flatMap(e=>e.reasons),s=o.flatMap(e=>e.warnings);let l=o.reduce((e,t)=>Ir(e,t.verdict),void 0);if(n.networkOnly&&(null===(r=e.serverTests)||void 0===r?void 0:r.length)){const t=e.serverTests.filter(e=>e.established&&!e.error).length;0===t?l="blocked":t<e.serverTests.length&&(l="degraded")}if(t)switch(t.code){case ue:a.push(Tr("microphone_capture_permission_denied","Microphone access was denied while establishing the diagnostic call.","microphone")),l=Ir(l,"permission_denied");break;case he:a.push(Tr("microphone_capture_no_device","No microphone device was available while establishing the diagnostic call.","microphone")),l=Ir(l,"blocked");break;case pe:a.push(Tr("microphone_capture_failed","Microphone capture failed while establishing the diagnostic call.","microphone")),l=Ir(l,"blocked");break;default:a.push(Tr("diagnostic_run_error",`Diagnostic run encountered an error: ${t.message}`,"diagnostic")),l=Ir(l,"blocked")}return{verdict:null!=l?l:"inconclusive",reasons:a,warnings:s}}(e,t,n);return Object.assign(Object.assign({},e),{version:1,verdict:null!=i?i:"inconclusive",reasons:r.length?r:void 0,warnings:o.length?o:void 0})}function Mr(e){return e instanceof Error?e:new Error(String(e))}function Fr(e){return new Promise(t=>setTimeout(t,e))}const jr="+1-872-231-5806";class zr extends Qi{constructor(e){const t=new Zi(Mn);super(e),this._registrationTimings=t,t.clientId=this.uuid,It.info(`SDK version: ${Mn}`),t.mark("TelnyxRTC constructor complete")}newCall(e){return super.newCall(e)}runPreCall(e={}){var t,n;return Z(this,void 0,void 0,function*(){const i={client:this,destinationNumber:null!==(t=e.destinationNumber)&&void 0!==t?t:jr,durationMs:e.durationMs,ice:!0,network:!0,microphone:!0,mode:"full",rtcConfig:{iceServers:null!==(n=e.iceServers)&&void 0!==n?n:this.iceServers}};return new Dr(i).run()})}runNetworkCheck(e={}){var t;return Z(this,void 0,void 0,function*(){const n={client:this,destinationNumber:jr,ice:!0,network:!0,microphone:!1,mode:"network-only",rtcConfig:{iceServers:null!==(t=e.iceServers)&&void 0!==t?t:this.iceServers}};return new Dr(n).run()})}runMicrophoneCheck(e={}){var t;return Z(this,void 0,void 0,function*(){const n={client:this,ice:!1,network:!1,microphone:{sampleDurationMs:e.durationMs,silenceThreshold:e.silenceThreshold,record:null!==(t=e.record)&&void 0!==t&&t,warnOnRecording:e.warnOnRecording},mode:"microphone-only"};return new Dr(n).run()})}static webRTCInfo(){return function(){try{const{browserInfo:e,name:t,version:n,supportAudio:i,supportVideo:r}=function(){if(!window||!window.navigator||!window.navigator.userAgent)throw new Error("You should use @telnyx/webrtc in a web browser such as Chrome|Firefox|Safari");if(navigator.userAgent.match(/chrom(e|ium)/gim)&&!navigator.userAgent.match(/OPR\/[0-9]{2}/gi)&&!navigator.userAgent.match(/edg/gim)){const e=navigator.userAgent.match(/chrom(e|ium)\/[0-9]+\./gim)[0].split("/"),t=e[0],n=parseInt(e[1],10);return{browserInfo:navigator.userAgent,name:t,version:n,supportAudio:!0,supportVideo:!0}}if(navigator.userAgent.match(/firefox/gim)&&!navigator.userAgent.match(/OPR\/[0-9]{2}/gi)&&!navigator.userAgent.match(/edg/gim)){const e=navigator.userAgent.match(/firefox\/[0-9]+\./gim)[0].split("/"),t=e[0],n=parseInt(e[1],10);return{browserInfo:navigator.userAgent,name:t,version:n,supportAudio:!0,supportVideo:!1}}if(navigator.userAgent.match(/safari/gim)&&!navigator.userAgent.match(/OPR\/[0-9]{2}/gi)&&!navigator.userAgent.match(/edg/gim)){const e=navigator.userAgent.match(/safari/gim)[0],t=navigator.userAgent.match(/version\/[0-9]+\./gim)[0].split("/"),n=parseInt(t[1],10);return{browserInfo:navigator.userAgent,name:e,version:n,supportAudio:!0,supportVideo:!0}}if(navigator.userAgent.match(/edg/gim)&&!navigator.userAgent.match(/OPR\/[0-9]{2}/gi)){const e=navigator.userAgent.match(/edg\/[0-9]+\./gim)[0].split("/"),t=e[0],n=parseInt(e[1],10);return{browserInfo:navigator.userAgent,name:t,version:n,supportAudio:!0,supportVideo:!0}}throw new Error("This browser does not support @telnyx/webrtc. To see browser support list: `TelnyxRTC.webRTCSupportedBrowserList()`")}(),o=window.RTCPeerConnection,a=window.RTCSessionDescription,s=window.RTCIceCandidate,l=window.navigator&&window.navigator.mediaDevices,c=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia||navigator.mozGetUserMedia;return{browserInfo:e,browserName:t,browserVersion:n,supportWebRTC:!!(o&&a&&s&&l&&c),supportWebRTCAudio:i,supportWebRTCVideo:r,supportRTCPeerConnection:!!o,supportSessionDescription:!!a,supportIceCandidate:!!s,supportMediaDevices:!!l,supportGetUserMedia:!!ai}}catch(e){return e.message}}()}static webRTCSupportedBrowserList(){return[{operationSystem:"Android",supported:[{browserName:"Chrome",features:["audio"],supported:vi.full},{browserName:"Firefox",features:["audio"],supported:vi.partial},{browserName:"Safari",supported:vi.not_supported},{browserName:"Edge",supported:vi.not_supported}]},{operationSystem:"iOS",supported:[{browserName:"Chrome",supported:vi.not_supported},{browserName:"Firefox",supported:vi.not_supported},{browserName:"Safari",features:["video","audio"],supported:vi.full},{browserName:"Edge",supported:vi.not_supported}]},{operationSystem:"Linux",supported:[{browserName:"Chrome",features:["video","audio"],supported:vi.full},{browserName:"Firefox",features:["audio"],supported:vi.partial},{browserName:"Safari",supported:vi.not_supported},{browserName:"Edge",supported:vi.not_supported}]},{operationSystem:"MacOS",supported:[{browserName:"Chrome",features:["video","audio"],supported:vi.full},{browserName:"Firefox",features:["audio"],supported:vi.partial},{browserName:"Safari",features:["video","audio"],supported:vi.full},{browserName:"Edge",features:["audio"],supported:vi.partial}]},{operationSystem:"Windows",supported:[{browserName:"Chrome",features:["video","audio"],supported:vi.full},{browserName:"Firefox",features:["audio"],supported:vi.partial},{browserName:"Safari",supported:vi.not_supported},{browserName:"Edge",features:["audio"],supported:vi.partial}]}]}}class Ur{constructor(){this.analyserNode=null,this.audioSource=null,this.animationId=null,this.audioContext=null}start(e,t){try{this.audioContext=new AudioContext,this.audioSource=this.audioContext.createMediaStreamSource(e),this.analyserNode=this.audioContext.createAnalyser(),this.analyserNode.fftSize=256,this.analyserNode.smoothingTimeConstant=.3,this.audioSource.connect(this.analyserNode);const n=new Float32Array(this.analyserNode.fftSize),i=()=>{if(!this.analyserNode)return void this.stop();this.analyserNode.getFloatTimeDomainData(n);let e=0;for(const t of n)e+=t*t;const r=Math.sqrt(e/n.length),o=Math.min(1,10*r);t((o>.01?o:0).toFixed(3)),this.animationId=requestAnimationFrame(i)};i()}catch{}}stop(){if(null!==this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=null),this.audioSource){try{this.audioSource.disconnect()}catch{}this.audioSource=null}this.audioContext&&(this.audioContext.close().catch(()=>{}),this.audioContext=null),this.analyserNode=null}}const $r={NotAllowedError:"Microphone permission denied",NotFoundError:"No microphone found",NotReadableError:"Microphone is in use by another application",OverconstrainedError:"Microphone does not support required settings"};class Br{constructor(e){this.options=e,this.client=null,this.call=null,this.localStream=null,this.remoteAudio=null,this.audioMonitor=null,this.state="idle",this.eventListeners=new Map,this.connectResolve=null,this.connectReject=null,this.readyTimeout=null,this.cleaningUp=!1,this.handleReady=()=>{if(this.client&&this.localStream){try{this.call=this.client.newCall({destinationNumber:"moveo-test",audio:!0,localStream:this.localStream,remoteElement:this.ensureRemoteAudioElement()})}catch(e){const t=e instanceof Error?e.message:"Failed to start Telnyx call";return this.emitError(t),void this.cleanup()}this.audioMonitor=new Ur,this.audioMonitor.start(this.localStream,e=>{this.emit("audio-level",e,Number(e))})}},this.handleClientError=e=>{const t=e instanceof Error?e.message:"object"==typeof e&&e&&"message"in e?String(e.message):"Telnyx client error";this.emitError(t),this.cleanup()},this.handleNotification=e=>{if("userMediaError"===e.type)return this.emitError(e.error?.message||"Microphone access failed"),void this.cleanup();if("callUpdate"!==e.type||!e.call)return;const t=e.call.state;switch(t){case"new":break;case"trying":case"requesting":case"ringing":this.setState("connecting");break;case"active":this.setState("connected"),this.clearReadyTimeout(),this.connectResolve?.(),this.connectResolve=null,this.connectReject=null;break;case"held":this.emitError("Call on hold"),this.cleanup();break;case"hangup":case"destroy":case"purge":"hangup"!==t&&this.emitError("Call ended unexpectedly"),this.cleanup(!0);break;default:this.emitError(`Unexpected call state: ${t}`),this.cleanup()}}}async connect(){let e;this.setState("connecting");try{e=await this.fetchToken()}catch(e){const t=e instanceof Error?e.message:"Token fetch failed";throw this.emitError(t),new Error(t)}try{this.localStream=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})}catch(e){const t=e instanceof Error?e.name:"",n=$r[t]||"Microphone access failed";throw this.emitError(n),new Error(n)}return this.client=new zr({login_token:e}),this.client.on("telnyx.ready",this.handleReady),this.client.on("telnyx.error",this.handleClientError),this.client.on("telnyx.notification",this.handleNotification),this.client.connect(),new Promise((e,t)=>{this.connectResolve=e,this.connectReject=t,this.readyTimeout=setTimeout(()=>{this.connectReject&&(this.emitError("Could not connect to Telnyx"),this.cleanup())},15e3)})}disconnect(){this.cleanup()}toggleMute(){return!!this.call&&(this.call.isAudioMuted?(this.call.unmuteAudio(),!1):(this.call.muteAudio(),!0))}isMuted(){return this.call?.isAudioMuted??!1}sendDigits(e){if(this.call)for(const t of e)this.call.dtmf(t)}on(e,t){const n=this.eventListeners.get(e)??new Set;return n.add(t),this.eventListeners.set(e,n),()=>this.off(e,t)}off(e,t){const n=this.eventListeners.get(e);n&&(n.delete(t),0===n.size&&this.eventListeners.delete(e))}async fetchToken(){const e=`${this.options.host}/v1/telnyxvoice/${encodeURIComponent(this.options.integrationId)}/token`,t=await fetch(e,{method:"GET"});if(!t.ok){if(404===t.status)throw new Error(`Integration ID "${this.options.integrationId}" was not found.`);throw new Error(`Unable to fetch Telnyx token (status ${t.status} ${t.statusText}).`)}const n=(await t.text()).trim();if(!n)throw new Error("Empty token response from Telnyx token endpoint");let i;try{i=JSON.parse(n)}catch{return n}if(i&&"object"==typeof i&&"token"in i&&"string"==typeof i.token)return i.token;throw new Error(`Unexpected Telnyx token response shape: ${n.slice(0,200)}`)}ensureRemoteAudioElement(){return this.remoteAudio||(this.remoteAudio=document.createElement("audio"),this.remoteAudio.autoplay=!0,document.body.appendChild(this.remoteAudio)),this.remoteAudio}cleanup(e=!1){if(!this.cleaningUp){this.cleaningUp=!0,this.clearReadyTimeout(),this.client&&(this.client.off("telnyx.ready",this.handleReady),this.client.off("telnyx.error",this.handleClientError),this.client.off("telnyx.notification",this.handleNotification)),this.call=null;try{this.audioMonitor?.stop()}catch{}if(this.audioMonitor=null,this.client)try{(e?this.client.serverDisconnect():this.client.disconnect()).catch(()=>{})}catch{}this.client=null;try{this.localStream?.getTracks().forEach(e=>e.stop())}catch{}if(this.localStream=null,this.remoteAudio){try{this.remoteAudio.srcObject=null,this.remoteAudio.remove()}catch{}this.remoteAudio=null}this.connectReject&&this.connectReject(new Error("Call disconnected before connection completed")),this.connectResolve=null,this.connectReject=null,this.setState("idle"),this.cleaningUp=!1}}clearReadyTimeout(){this.readyTimeout&&(clearTimeout(this.readyTimeout),this.readyTimeout=null)}setState(e){this.state!==e&&(this.state=e,this.emit("state-change",e,e))}emitError(e){this.emit("error",e),this.setState("error")}emit(e,t,n){const i={state:e,message:t,data:n},r=e=>{const t=this.eventListeners.get(e);t&&t.forEach(e=>{try{e(i)}catch{}})};r(e),r("any")}}class Hr{constructor(e){this.provider=null,this.widgetRoot=null,this.widgetContainer=null,this.widgetKey=0,this.prevProviderState=null,this.mq=null,this.mqListener=null,this.config={host:e.host||"https://channels.moveo.ai",integrationId:e.integrationId},this.log=y()(`moveo:telnyx:controller:${e.integrationId}`)}async init(){return this.provider=new Br({integrationId:this.config.integrationId,host:this.config.host}),this.provider.on("state-change",({data:e})=>{const t=e,n=this.prevProviderState;"idle"!==t||"connected"!==n&&"reconnecting"!==n||this.resetWidget(),this.prevProviderState=t}),this.createWidgetContainer(),this.renderWidget(),this.log("TelnyxController initialized"),this}async startCall(){await(this.provider?.connect())}endCall(){this.provider?.disconnect()}toggleMute(){this.provider?.toggleMute()}isMuted(){return this.provider?.isMuted()??!1}sendDigits(e){this.provider?.sendDigits(e)}on(e,t){return this.provider?.on(e,t)??(()=>{})}off(e,t){this.provider?.off(e,t)}destroy(){this.provider?.disconnect(),this.provider=null,this.mq&&this.mqListener&&this.mq.removeEventListener("change",this.mqListener),this.mq=null,this.mqListener=null,this.widgetRoot&&(this.widgetRoot.unmount(),this.widgetRoot=null),this.widgetContainer&&(document.body.removeChild(this.widgetContainer),this.widgetContainer=null)}createWidgetContainer(){this.widgetContainer=document.createElement("div"),this.widgetContainer.id="moveo-telnyx-widget",this.widgetContainer.style.position="fixed",this.widgetContainer.style.zIndex="2147483647",this.widgetContainer.style.bottom="20px",this.widgetContainer.style.right="20px",this.applyDarkMode(),document.body.appendChild(this.widgetContainer)}applyDarkMode(){if(!this.widgetContainer||"function"!=typeof window.matchMedia)return;this.mq=window.matchMedia("(prefers-color-scheme: dark)");const e=e=>{this.widgetContainer?.classList.toggle("dark",e)};e(this.mq.matches),this.mqListener=t=>e(t.matches),this.mq.addEventListener("change",this.mqListener)}resetWidget(){this.widgetKey++,this.widgetRoot&&this.renderWidgetElement()}renderWidget(){if(!this.widgetContainer)throw new Error("Widget container not created");this.widgetRoot=(0,e().createRoot)(this.widgetContainer),this.renderWidgetElement()}renderWidgetElement(){this.widgetRoot.render((0,s().createElement)(J,{key:this.widgetKey,onStartCall:this.startCall.bind(this),onEndCall:this.endCall.bind(this),onToggleMute:this.toggleMute.bind(this),isMuted:this.isMuted.bind(this),onSendDigits:this.sendDigits.bind(this),onEvent:this.on.bind(this)}))}}const Wr=e=>"string"==typeof e,Vr=()=>{let e,t;const n=new Promise((n,i)=>{e=n,t=i});return n.resolve=e,n.reject=t,n},qr=e=>null==e?"":String(e),Gr=/###/g,Kr=e=>e&&e.includes("###")?e.replace(Gr,"."):e,Yr=e=>!e||Wr(e),Qr=(e,t,n)=>{const i=Wr(t)?t.split("."):t;let r=0;for(;r<i.length-1;){if(Yr(e))return{};const t=Kr(i[r]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return Yr(e)?{}:{obj:e,k:Kr(i[r])}},Jr=(e,t,n)=>{const{obj:i,k:r}=Qr(e,t,Object);if(void 0!==i||1===t.length)return void(i[r]=n);let o=t[t.length-1],a=t.slice(0,t.length-1),s=Qr(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=Qr(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},Xr=(e,t)=>{const{obj:n,k:i}=Qr(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},Zr=(e,t,n)=>{for(const i in t)"__proto__"!==i&&"constructor"!==i&&(Object.prototype.hasOwnProperty.call(e,i)?Wr(e[i])||e[i]instanceof String||Wr(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):Zr(e[i],t[i],n):e[i]=t[i]);return e},eo=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),to={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},no=e=>Wr(e)?e.replace(/[&<>"'\/]/g,e=>to[e]):e,io=[" ",",","?","!",";"],ro=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),oo=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const i=t.split(n);let r=e;for(let e=0;e<i.length;){if(!r||"object"!=typeof r)return;let t,o="";for(let a=e;a<i.length;++a)if(a!==e&&(o+=n),o+=i[a],t=r[o],"function"!=typeof t&&"__proto__"!==o||Object.prototype.hasOwnProperty.call(r,o)||(t=void 0),void 0!==t){if(["string","number","boolean"].includes(typeof t)&&a<i.length-1)continue;e+=a-e+1;break}r=t}return r},ao=e=>e?.replace(/_/g,"-"),so={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class lo{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||so,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,i){return i&&!this.debug?null:(e=e.map(e=>Wr(e)?e.replace(/[\r\n\x00-\x1F\x7F]/g," "):e),Wr(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new lo(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new lo(this.logger,e)}}var co=new lo;class uo{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}once(e,t){const n=(...i)=>{t(...i),this.off(e,n)};return this.on(e,n),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let i=0;i<n;i++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,i])=>{for(let r=0;r<i;r++)n(e,...t)})}}const ho=new WeakSet;class po extends uo{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,i={}){const r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=void 0!==i.ignoreJSONStructure?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.includes(".")?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):Wr(n)&&r?a.push(...n.split(r)):a.push(n)));const s=Xr(this.data,a);return null!=s||t||n||!e.includes(".")||(e=a[0],t=a[1],n=a.slice(2).join(".")),null==s&&o&&Wr(n)?oo(this.data?.[e]?.[t],n,r):s}addResource(e,t,n,i,r={silent:!1}){const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.includes(".")&&(a=e.split("."),i=t,t=a[1]),this.addNamespaces(t),Jr(this.data,a,i),r.silent||this.emit("added",e,t,n,i)}addResources(e,t,n,i={silent:!1}){for(const i in n)(Wr(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});i.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,i,r,o={silent:!1,skipCopy:!1}){let a=[e,t];e.includes(".")&&(a=e.split("."),i=n,n=t,t=a[1]),this.addNamespaces(t);let s=Xr(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),i?Zr(s,n,r):s={...s,...n},Jr(this.data,a,s),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>{const n=t[e];return!!ho.has(n)||!(!n||0===Object.keys(n).length)&&("object"==typeof n&&ho.add(n),!0)})}toJSON(){return this.data}}var fo={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,r){return e.forEach(e=>{t=this.processors[e]?.process(t,n,i,r)??t}),t}};const go=Symbol("i18next/PATH_KEY");function mo(e,t){const{[go]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(i,r)=>(n?.revoke?.(),r===go?e:(e.push(r),n=Proxy.revocable(i,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}()),i=t?.keySeparator??".",r=t?.nsSeparator??":",o="strict"===t?.enableSelector;if(n.length>1&&r){const e=t?.ns,a=o?Array.isArray(e)?e:e?[e]:null:Array.isArray(e)?e:null;if(a&&(o?a:a.length>1?a.slice(1):[]).includes(n[0]))return`${n[0]}${r}${n.slice(1).join(i)}`}return n.join(i)}const vo=e=>!Wr(e)&&"boolean"!=typeof e&&"number"!=typeof e;class bo extends uo{constructor(e,t={}){var n,i;super(),n=e,i=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(i[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=co.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const i=this.resolve(e,n);if(void 0===i?.res)return!1;const r=vo(i.res);return!1!==n.returnObjects||!r}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const o=n&&e.includes(n),a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const i=io.filter(e=>!t.includes(e)&&!n.includes(e));if(0===i.length)return!0;const r=ro.getRegExp(`(${i.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!r.test(e);if(!o){const t=e.indexOf(n);t>0&&!r.test(e.substring(0,t))&&(o=!0)}return o})(e,n,i));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Wr(r)?[r]:r};const o=e.split(n);(n!==i||n===i&&this.options.ns.includes(o[0]))&&(r=o.shift()),e=o.join(i)}return{key:e,namespaces:Wr(r)?[r]:r}}translate(e,t,n){let i="object"==typeof t?{...t}:t;if("object"!=typeof i&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof i&&(i={...i}),i||(i={}),null==e)return"";"function"==typeof e&&(e=mo(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(e=>"function"==typeof e?mo(e,{...this.options,...i}):String(e));const r=void 0!==i.returnDetails?i.returnDetails:this.options.returnDetails,o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],i),l=s[s.length-1];let c=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const d=i.lng||this.language,u=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===d?.toLowerCase())return u?r?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${c}${a}`:r?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:a;const h=this.resolve(e,i);let p=h?.res;const f=h?.usedKey||a,g=h?.exactUsedKey||a,m=void 0!==i.joinArrays?i.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,b=void 0!==i.count&&!Wr(i.count),y=bo.hasDefaultValue(i),w=b?this.pluralResolver.getSuffix(d,i.count,i):"",k=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):"",_=b&&!i.ordinal&&0===i.count,S=_&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${w}`]||i[`defaultValue${k}`]||i.defaultValue;let x=p;v&&!p&&y&&(x=S);const C=vo(x),E=Object.prototype.toString.apply(x);if(!(v&&x&&C)||["[object Number]","[object Function]","[object RegExp]"].includes(E)||Wr(m)&&Array.isArray(x))if(v&&Wr(m)&&Array.isArray(p))p=p.join(m),p&&(p=this.extendTranslation(p,e,i,h,n));else{let t=!1,r=!1;!this.isValidLookup(p)&&y&&(t=!0,p=S),this.isValidLookup(p)||(r=!0,p=a);const s=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:p,u=y&&S!==p&&this.options.updateMissing;if(r||t||u){if(this.logger.log(u?"updateKey":"missingKey",d,l,b&&!u?`${a}${this.pluralResolver.getSuffix(d,i.count,i)}`:a,u?S:p),o){const e=this.resolve(a,{...i,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);const n=(e,t,n)=>{const r=y&&n!==p?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,u,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,u,i),this.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,i);_&&i[`defaultValue${this.options.pluralSeparator}zero`]&&!t.includes(`${this.options.pluralSeparator}zero`)&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,i[`defaultValue${t}`]||S)})}):n(e,a,S))}p=this.extendTranslation(p,e,i,h,n),r&&p===a&&this.options.appendNamespaceToMissingKey&&(p=`${l}${c}${a}`),(r||t)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,t?p:void 0,i))}else{if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,x,{...i,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(h.res=e,h.usedParams=this.getUsedParamsDetails(i),h):e}if(o){const e=Array.isArray(x),t=e?[]:{},n=e?g:f;for(const e in x)if(Object.prototype.hasOwnProperty.call(x,e)){const r=`${n}${o}${e}`;t[e]=y&&!p?this.translate(r,{...i,defaultValue:vo(S)?S[e]:void 0,joinArrays:!1,ns:s}):this.translate(r,{...i,joinArrays:!1,ns:s}),t[e]===r&&(t[e]=x[e])}p=t}}return r?(h.res=p,h.usedParams=this.getUsedParamsDetails(i),h):p}extendTranslation(e,t,n,i,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const o=Wr(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!Wr(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||i.usedLng,n),o){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&i&&i.res&&(n.lng=this.language||i.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>r?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,a=Wr(o)?[o]:o;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=fo.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,i,r,o,a;return Wr(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>"function"==typeof e?mo(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;i=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=void 0!==t.count&&!Wr(t.count),u=d&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(Wr(t.context)||"number"==typeof t.context)&&""!==t.context,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(a=e,this.checkedLoadedFor[`${p[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(this.checkedLoadedFor[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(i=>{if(this.isValidLookup(n))return;o=i;const a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,i,e,t);else{let e;d&&(e=this.pluralResolver.getSuffix(i,t.count,t));const n=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&e.startsWith(r)&&a.push(l+e.replace(r,this.options.pluralSeparator)),a.push(l+e),u&&a.push(l+n)),h){const i=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(i),d&&(t.ordinal&&e.startsWith(r)&&a.push(i+e.replace(r,this.options.pluralSeparator)),a.push(i+e),u&&a.push(i+n))}}let s;for(;s=a.pop();)this.isValidLookup(n)||(r=s,n=this.getResource(i,e,s,t))}))})}),{res:n,usedKey:i,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,i):this.resourceStore.getResource(e,t,n,i)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Wr(e.replace);let i=n?e.replace:e;if(n&&void 0!==e.count&&(i={...i,count:e.count}),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!n){i={...i};for(const e of t)delete i[e]}return i}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.startsWith("defaultValue")&&void 0!==e[t])return!0;return!1}}class yo{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=co.create("languageUtils"),this.resolveHierarchyCache={}}clearCache(){this.resolveHierarchyCache={}}getScriptPartFromCode(e){if(!(e=ao(e))||!e.includes("-"))return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=ao(e))||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Wr(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(e=>e===i||!(!e.includes("-")&&!i.includes("-"))&&!(!e.includes("-")||i.includes("-")||e.slice(0,e.indexOf("-"))!==i))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Wr(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.options.fallbackLng,i=Array.isArray(n)?n.join("|"):n;i!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=i);const r=void 0===t||!1===t||Wr(t),o=void 0===t&&"function"==typeof this.options.fallbackLng;let a=null;if(Wr(e)&&r&&!o){let n;n=void 0===t?"undefined":!1===t?"boolean:false":`string:${t}`,a=`${e.length}:${e}|${n}`}if(null!==a){const e=this.resolveHierarchyCache[a];if(void 0!==e)return e.slice()}const s=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),l=[],c=e=>{e&&(this.isSupportedCode(e)?l.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Wr(e)&&(e.includes("-")||e.includes("_"))?("languageOnly"!==this.options.load&&c(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&c(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&c(this.getLanguagePartFromCode(e))):Wr(e)&&c(this.formatLanguageCode(e)),s.forEach(e=>{const t=this.formatLanguageCode(e);l.includes(t)||c(t)}),null!==a?(this.resolveHierarchyCache[a]=l,l.slice()):l}}const wo={zero:0,one:1,two:2,few:3,many:4,other:5},ko={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _o{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=co.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=ao("dev"===e?"en":e),i=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:n,type:i});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let o;try{o=new Intl.PluralRules(n,{type:i})}catch(n){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),ko;if(!e.match(/-|_/))return ko;const i=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(i,t)}return this.pluralRulesCache[r]=o,o}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>wo[e]-wo[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const i=this.getRule(e,n);return i?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const So=(e,t,n,i=".",r=!0)=>{let o=((e,t,n)=>{const i=Xr(e,n);return void 0!==i?i:Xr(t,n)})(e,t,n);return!o&&r&&Wr(n)&&(o=oo(e,n,i),void 0===o&&(o=oo(t,n,i))),o};class xo{constructor(e={}){this.logger=co.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:i,prefix:r,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:u,nestingPrefixEscaped:h,nestingSuffix:p,nestingSuffixEscaped:f,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:no,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==i&&i,this.prefix=r?eo(r):o||"{{",this.suffix=a?eo(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":d?eo(d):"-",this.unescapeSuffix=this.unescapePrefix?"":c?eo(c):"",this.nestingPrefix=u?eo(u):h||eo("$t("),this.nestingSuffix=p?eo(p):f||eo(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,i){let r,o,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(!e.includes(this.formatSeparator)){const r=So(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(r,void 0,n,{...i,...t,interpolationkey:e}):r}const r=e.split(this.formatSeparator),o=r.shift().trim(),a=r.join(this.formatSeparator).trim();return this.format(So(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...i,...t,interpolationkey:o})};this.resetRegExp(),!this.escapeValue&&"string"==typeof e&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const c=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=void 0!==i?.interpolation?.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,u=[{regex:this.regexpUnescape,safeValue:e=>e},{regex:this.regexp,safeValue:e=>this.escapeValue?this.escape(e):e}],h=[];let p=0;return u.forEach(t=>{for(a=0;r=t.regex.exec(e);){const n=r.index-p,s=h.find(([e,t])=>n>=e&&n<t);if(s){t.regex.lastIndex=s[1]+p;continue}const u=r[1].trim();if(o=l(u),void 0===o)if("function"==typeof c){const t=c(e,r,i);o=Wr(t)?t:""}else if(i&&Object.prototype.hasOwnProperty.call(i,u))o="";else{if(d){o=r[0];continue}this.logger.warn(`missed to pass in variable ${u} for interpolating ${e}`),o=""}else Wr(o)||this.useRawValueToEscape||(o=qr(o));const f=qr(t.safeValue(o));if(e=e.slice(0,r.index)+f+e.slice(r.index+r[0].length),d?(t.regex===this.regexpUnescape?h.push([r.index,r.index+f.length]):p+=f.length-r[0].length,t.regex.lastIndex+=f.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let i,r,o;const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(!e.includes(n))return e;const i=e.split(new RegExp(`${eo(n)}[ ]*{`));let r=`{${i[1]}`;e=i[0],r=this.interpolate(r,o);const a=r.match(/'/g),s=r.match(/"/g);((a?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(r=r.replace(/'/g,'"'));try{o=JSON.parse(r),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${r}`}return o.defaultValue&&o.defaultValue.includes(this.prefix)&&delete o.defaultValue,e},s=new RegExp(this.nestingRegexp);let l="",c=0;for(;i=s.exec(e);){let d=[];o={...n},o=o.replace&&!Wr(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/s.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(-1!==u&&(d=i[1].slice(u).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),r=t(a.call(this,i[1].trim(),o),o),r&&i[0]===e&&!Wr(r))return r;Wr(r)||(r=qr(r)),r||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),r=""),d.length&&(r=d.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:i[1].trim()}),r.trim())),l+=e.slice(c,i.index)+qr(r),c=s.lastIndex,this.regexp.lastIndex=0}return c?l+e.slice(c):e}}const Co=e=>{const t={};return(n,i,r)=>{let o,a=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(a={...a,[r.interpolationkey]:void 0});try{o=i+JSON.stringify(a)}catch(t){return e(ao(i),r)(n)}let s=t[o];return s||(s=e(ao(i),r),t[o]=s),s(n)}},Eo=e=>(t,n,i)=>e(ao(n),i)(t);class Io{constructor(e={}){this.logger=co.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Co:Eo;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Co(t)}format(e,t,n,i={}){if(!t)return e;if(null==e)return e;const r=t.split(this.formatSeparator),o=[];for(let e=0;e<r.length;e++){let t=r[e];for(;t.indexOf("(")>-1&&!t.includes(")")&&e+1<r.length;)t=`${t}${this.formatSeparator}${r[++e]}`;o.push(t)}const a=o.reduce((e,t)=>{const{formatName:r,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.includes("(")){const i=e.split("(");t=i[0].toLowerCase().trim();const r=i[1].slice(0,-1);"currency"!==t||r.includes(":")?"relativetime"!==t||r.includes(":")?r.split(";").forEach(e=>{if(e){const[t,...i]=e.split(":"),r=i.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=r),"false"===r&&(n[o]=!1),"true"===r&&(n[o]=!0),isNaN(r)||(n[o]=parseInt(r,10))}}):n.range||(n.range=r.trim()):n.currency||(n.currency=r.trim())}return{formatName:t,formatOptions:n}})(t);if(this.formats[r]){let t=e;try{const a=i?.formatParams?.[i.interpolationkey]||{},s=a.locale||a.lng||i.locale||i.lng||n;t=this.formats[r](e,s,{...o,...i,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${r}`),e},e);return a}}class To extends uo{constructor(e,t,n,i={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=co.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,i.backend,i)}queueLoad(e,t,n,i){const r={},o={},a={},s={};return e.forEach(e=>{let i=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,i=!1,void 0===o[a]&&(o[a]=!0),void 0===r[a]&&(r[a]=!0),void 0===s[t]&&(s[t]=!0)))}),i||(a[e]=!0)}),(Object.keys(r).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(r),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const i=e.split("|"),r=i[0],o=i[1];t&&this.emit("failedLoading",r,o,t),!t&&n&&this.store.addResourceBundle(r,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:i,k:r}=Qr(e,t,Object);i[r]=i[r]||[],i[r].push(n)})(n.loaded,[r],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,i=0,r=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:r,callback:o});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&i<this.maxRetries?setTimeout(()=>{this.read(e,t,n,i+1,2*r,o)},r):o(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t,n={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Wr(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Wr(t)&&(t=[t]);const r=this.queueLoad(e,t,n,i);if(!r.toLoad.length)return r.pending.length||i(),null;r.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),i=n[0],r=n[1];this.read(i,r,"read",void 0,void 0,(n,o)=>{n&&this.logger.warn(`${t}loading namespace ${r} for language ${i} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${i}`,o),this.loaded(e,n,o)})}saveMissing(e,t,n,i,r,o={},a=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const s={...o,isUpdate:r},l=this.backend.create.bind(this.backend);if(l.length<6)try{let r;r=5===l.length?l(e,t,n,i,s):l(e,t,n,i),r&&"function"==typeof r.then?r.then(e=>a(null,e)).catch(a):a(null,r)}catch(e){a(e)}else l(e,t,n,i,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,i)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Ro=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Wr(e[1])&&(t.defaultValue=e[1]),Wr(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),No=e=>(Wr(e.ns)&&(e.ns=[e.ns]),Wr(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Wr(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Oo=()=>{};class Ao extends uo{constructor(e={},t){var n;if(super(),this.options=No(e),this.services={},this.logger=co,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Wr(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const n=Ro();this.options={...n,...this.options,...No(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler);const i=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?co.init(i(this.modules.logger),this.options):co.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Io;const t=new yo(this.options);this.store=new po(this.options.resources,this.options);const n=this.services;n.logger=co,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new _o(t,{prepend:this.options.pluralSeparator}),e&&(n.formatter=i(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new xo(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new To(i(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=i(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=i(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new bo(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Oo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const r=Vr(),o=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(n),t(e,n)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),r}loadResources(e,t=Oo){let n=t;const i=Wr(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===i?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&(e.includes(t)||e.push(t))})};i?t(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const i=Vr();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Oo),this.services.backendConnector.reload(e,t,e=>{i.resolve(),n(e)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&fo.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!["cimode","dev"].includes(e)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!["cimode","dev"].includes(t)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}this.resolvedLanguage||this.languages.includes(e)||!this.store.hasLanguageSomeTranslations(e)||(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Vr();this.emit("languageChanging",e);const i=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},r=(r,o)=>{o?this.isLanguageChangingTo===e&&(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(r,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Wr(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Wr(t)?[t]:t);o&&(this.language||i(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{r(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}getFixedT(e,t,n,i){const r=i?.scopeNs,o=(e,t,...i)=>{let a;a="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},a.lng=a.lng||o.lng,a.lngs=a.lngs||o.lngs;const s=void 0!==a.ns&&null!==a.ns;a.ns=a.ns||o.ns,""!==a.keyPrefix&&(a.keyPrefix=a.keyPrefix||n||o.keyPrefix);const l={...this.options,...a};Array.isArray(r)&&!s&&(l.ns=r),"function"==typeof a.keyPrefix&&(a.keyPrefix=mo(a.keyPrefix,l));const c=this.options.keySeparator||".";let d;return a.keyPrefix&&Array.isArray(e)?d=e.map(e=>("function"==typeof e&&(e=mo(e,l)),`${a.keyPrefix}${c}${e}`)):("function"==typeof e&&(e=mo(e,l)),d=a.keyPrefix?`${a.keyPrefix}${c}${e}`:e),this.t(d,a)};return Wr(e)?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}if(this.hasResourceBundle(n,e))return!0;if(!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:a}=this.services,s=t.lng?a.isSupportedCode(n)&&a.toResolveHierarchy(n,!1)[0]:n;return!(s&&!o(s,e)||i&&!o(r,e))}loadNamespaces(e,t){const n=Vr();return this.options.ns?(Wr(e)&&(e=[e]),e.forEach(e=>{this.options.ns.includes(e)||this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Vr();Wr(e)&&(e=[e]);const i=this.options.preload||[],r=e.filter(e=>!i.includes(e)&&this.services.languageUtils.isSupportedCode(e));return r.length?(this.options.preload=i.concat(r),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new yo(Ro());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].includes(t.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new Ao(e,t);return n.createInstance=Ao.createInstance,n}cloneInstance(e={},t=Oo){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const i={...this.options,preload:!1,...e,isClone:!0},r=new Ao(i);if(void 0===e.debug&&void 0===e.prefix||(r.logger=r.logger.clone(e)),["store","services","language"].forEach(e=>{r[e]=this[e]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},n){const e=t=>{const n=Array.isArray(t)?[...t]:{...t};return Object.keys(n).forEach(t=>{n[t]&&"object"==typeof n[t]&&(n[t]=e(n[t]))}),n},t=e(this.store.data);r.store=new po(t,i),r.services.resourceStore=r.store}if(e.interpolation){const t={...Ro().interpolation,...this.options.interpolation,...e.interpolation},n={...i,interpolation:t};r.services.interpolator=new xo(n)}return r.translator=new bo(r.services,i),r.translator.on("*",(e,...t)=>{r.emit(e,...t)}),r.init(i,t),r.translator.options=i,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Lo=Ao.createInstance(),{slice:Do,forEach:Po}=(Lo.createInstance,Lo.dir,Lo.init,Lo.loadResources,Lo.reloadResources,Lo.use,Lo.changeLanguage,Lo.getFixedT,Lo.t,Lo.exists,Lo.setDefaultNamespace,Lo.hasLoadedNamespace,Lo.loadNamespaces,Lo.loadLanguages,[]),Mo=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Fo={create(e,t,n,i,r={path:"/",sameSite:"strict"}){n&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+60*n*1e3)),i&&(r.domain=i),document.cookie=((e,t,n={path:"/"})=>{const i=n;let r=`${e}=${encodeURIComponent(t)}`;if(i.maxAge>0){const e=i.maxAge-0;if(Number.isNaN(e))throw new Error("maxAge should be a Number");r+=`; Max-Age=${Math.floor(e)}`}if(i.domain){if(!Mo.test(i.domain))throw new TypeError("option domain is invalid");r+=`; Domain=${i.domain}`}if(i.path){if(!Mo.test(i.path))throw new TypeError("option path is invalid");r+=`; Path=${i.path}`}if(i.expires){if("function"!=typeof i.expires.toUTCString)throw new TypeError("option expires is invalid");r+=`; Expires=${i.expires.toUTCString()}`}if(i.httpOnly&&(r+="; HttpOnly"),i.secure&&(r+="; Secure"),i.sameSite)switch("string"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:r+="; SameSite=Strict";break;case"lax":r+="; SameSite=Lax";break;case"strict":r+="; SameSite=Strict";break;case"none":r+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i.partitioned&&(r+="; Partitioned"),r})(e,t,r)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let i=n[e];for(;" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var jo={name:"cookie",lookup({lookupCookie:e}){if(e&&"undefined"!=typeof document)return Fo.read(e)||void 0},cacheUserLanguage(e,{lookupCookie:t,cookieMinutes:n,cookieDomain:i,cookieOptions:r}){t&&"undefined"!=typeof document&&Fo.create(t,e,n,i,r)}},zo={name:"querystring",lookup({lookupQuerystring:e}){let t;if("undefined"!=typeof window){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const i=n.substring(1).split("&");for(let n=0;n<i.length;n++){const r=i[n].indexOf("=");r>0&&i[n].substring(0,r)===e&&(t=i[n].substring(r+1))}}return t}},Uo={name:"hash",lookup({lookupHash:e,lookupFromHashIndex:t}){let n;if("undefined"!=typeof window){const{hash:i}=window.location;if(i&&i.length>2){const r=i.substring(1);if(e){const t=r.split("&");for(let i=0;i<t.length;i++){const r=t[i].indexOf("=");r>0&&t[i].substring(0,r)===e&&(n=t[i].substring(r+1))}}if(n)return n;if(!n&&t>-1){const e=i.match(/\/([a-zA-Z][a-zA-Z0-9-]*)?/g);if(!Array.isArray(e))return;const n="number"==typeof t?t:0;return e[n]?.replace("/","")}}}return n}};let $o=null;const Bo=()=>{if(null!==$o)return $o;try{if($o="undefined"!=typeof window&&null!==window.localStorage,!$o)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){$o=!1}return $o};var Ho={name:"localStorage",lookup({lookupLocalStorage:e}){if(e&&Bo())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(e,{lookupLocalStorage:t}){t&&Bo()&&window.localStorage.setItem(t,e)}};let Wo=null;const Vo=()=>{if(null!==Wo)return Wo;try{if(Wo="undefined"!=typeof window&&null!==window.sessionStorage,!Wo)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Wo=!1}return Wo};var qo={name:"sessionStorage",lookup({lookupSessionStorage:e}){if(e&&Vo())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(e,{lookupSessionStorage:t}){t&&Vo()&&window.sessionStorage.setItem(t,e)}},Go={name:"navigator",lookup(e){const t=[];if("undefined"!=typeof navigator){const{languages:e,userLanguage:n,language:i}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),i&&t.push(i)}return t.length>0?t:void 0}},Ko={name:"htmlTag",lookup({htmlTag:e}){let t;const n=e||("undefined"!=typeof document?document.documentElement:null);return n&&"function"==typeof n.getAttribute&&(t=n.getAttribute("lang")),t}},Yo={name:"path",lookup({lookupFromPathIndex:e}){if("undefined"==typeof window)return;const t=window.location.pathname.match(/\/([a-zA-Z][a-zA-Z0-9-]*)?/g);if(!Array.isArray(t))return;const n="number"==typeof e?e:0;return t[n]?.replace("/","")}},Qo={name:"subdomain",lookup({lookupFromSubdomainIndex:e}){const t="number"==typeof e?e+1:1,n="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5}(?:-(?:[a-z]{4}|[a-z]{2}|\d{3}))*)\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};let Jo=!1;try{document.cookie,Jo=!0}catch(ht){}const Xo=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Jo||Xo.splice(1,1);class Zo{constructor(e,t={}){this.type="languageDetector",this.detectors={},this.init(e,t)}init(e={languageUtils:{}},t={},n={}){this.services=e,this.options=function(e){return Po.call(Do.call(arguments,1),t=>{if(t)for(const n in t)void 0===e[n]&&(e[n]=t[n])}),e}(t,this.options||{},{order:Xo,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=e=>e.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(jo),this.addDetector(zo),this.addDetector(Ho),this.addDetector(qo),this.addDetector(Go),this.addDetector(Ko),this.addDetector(Yo),this.addDetector(Qo),this.addDetector(Uo)}addDetector(e){return this.detectors[e.name]=e,this}detect(e=this.options.order){let t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&"string"==typeof n&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>{return null!=e&&!("string"==typeof(t=e)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(e=>e.test(t)));var t}).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e,t=this.options.caches){t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}}Zo.type="languageDetector";const ea={type:"3rdParty",init(e){((e={})=>{D={...D,...e}})(e.options.react),(e=>{N=e})(e)}},ta=JSON.parse('{"Gp":{"actions":{"cancel":"Ακύρωση δοκιμαστικής κλήσης ήχου","end":"Τερματισμός δοκιμαστικής κλήσης ήχου","end_call":"Τερματισμός κλήσης","start":"Έναρξη δοκιμαστικής κλήσης ήχου","start_call":"Έναρξη κλήσης"},"composer_placeholder":"Μπορείτε και να γράψετε…","dtmf":{"label":"Πληκτρολόγιο DTMF","toggle":"Πληκτρολόγιο"},"end_confirm":{"title":"Τερματισμός κλήσης;"},"errors":{"generic":"Παρουσιάστηκε σφάλμα","start_failed":"Δεν ήταν δυνατή η έναρξη της κλήσης"},"mute":{"mute":"Σίγαση","mute_microphone":"Σίγαση μικροφώνου","unmute":"Άρση σίγασης","unmute_microphone":"Άρση σίγασης μικροφώνου"},"sr":{"connected":"Η κλήση συνδέθηκε","connected_thinking":"Η κλήση συνδέθηκε, δημιουργία απάντησης","connecting":"Σύνδεση κλήσης","error":"Σφάλμα κλήσης","error_with_message":"Σφάλμα κλήσης: {{message}}","ready":"Έτοιμο για πραγματοποίηση κλήσης"},"status":{"connecting":"Σύνδεση","error":"Σφάλμα","listening":"Ακούει","muted":"Σίγαση","on_call":"Σε κλήση","ready":"Έτοιμο","reconnecting":"Επανασύνδεση","speaking":"Μιλάει","thinking":"Σκέφτεται"},"transcript":{"call_ended":"Η φωνητική κλήση έληξε · <0>{{duration}}</0>","call_started":"Η κλήση ξεκίνησε · <0>{{time}}</0>","reconnected":"Επανασυνδέθηκε","typed":"Πληκτρολογήθηκε"}}}'),na=JSON.parse('{"Gp":{"actions":{"cancel":"Cancel audio preview call","end":"End audio preview call","end_call":"End call","start":"Start audio preview call","start_call":"Start a call"},"composer_placeholder":"You can type too…","dtmf":{"label":"DTMF keypad","toggle":"Keypad"},"end_confirm":{"title":"End the call?"},"errors":{"generic":"An error occurred","start_failed":"Failed to start call"},"mute":{"mute":"Mute","mute_microphone":"Mute microphone","unmute":"Unmute","unmute_microphone":"Unmute microphone"},"sr":{"connected":"Call connected","connected_thinking":"Call connected, generating response","connecting":"Connecting call","error":"Call error","error_with_message":"Call error: {{message}}","ready":"Ready to place a call"},"status":{"connecting":"Connecting","error":"Error","listening":"Listening","muted":"Muted","on_call":"On call","ready":"Ready","reconnecting":"Reconnecting","speaking":"Speaking","thinking":"Thinking"},"transcript":{"call_ended":"Voice call ended · <0>{{duration}}</0>","call_started":"Call started · <0>{{time}}</0>","reconnected":"Reconnected","typed":"Typed"}}}'),ia=JSON.parse('{"Gp":{"actions":{"cancel":"Cancelar chamada de prévia de áudio","end":"Encerrar chamada de prévia de áudio","end_call":"Encerrar chamada","start":"Iniciar chamada de prévia de áudio","start_call":"Iniciar uma chamada"},"composer_placeholder":"Você também pode digitar…","dtmf":{"label":"Teclado DTMF","toggle":"Teclado"},"end_confirm":{"title":"Encerrar a chamada?"},"errors":{"generic":"Ocorreu um erro","start_failed":"Não foi possível iniciar a chamada"},"mute":{"mute":"Silenciar","mute_microphone":"Silenciar microfone","unmute":"Reativar","unmute_microphone":"Ativar microfone"},"sr":{"connected":"Chamada conectada","connected_thinking":"Chamada conectada, gerando resposta","connecting":"Conectando chamada","error":"Erro na chamada","error_with_message":"Erro na chamada: {{message}}","ready":"Pronto para iniciar uma chamada"},"status":{"connecting":"Conectando","error":"Erro","listening":"Ouvindo","muted":"Silenciado","on_call":"Em chamada","ready":"Pronto","reconnecting":"Reconectando","speaking":"Falando","thinking":"Pensando"},"transcript":{"call_ended":"Chamada de voz encerrada · <0>{{duration}}</0>","call_started":"Chamada iniciada · <0>{{time}}</0>","reconnected":"Reconectado","typed":"Digitado"}}}'),ra={el:{translation:{audio_widget:ta.Gp}},en:{translation:{audio_widget:na.Gp}},"pt-br":{translation:{audio_widget:ia.Gp}}};Lo.createInstance().use(Zo).use(ea).init({resources:ra,lowerCaseLng:!0,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1},detection:{order:["navigator"]}}),h(),m(),p(),g(),f(),v();var oa=n(511),aa={};aa.styleTagTransform=function e(){return e.c||(e.c=n.n(v()))}()(),aa.setAttributes=function e(){return e.c||(e.c=n.n(g()))}()(),aa.insert=function e(){return e.c||(e.c=n.n(p()))}()().bind(null,"head"),aa.domAPI=function e(){return e.c||(e.c=n.n(m()))}()(),aa.insertStyleElement=function e(){return e.c||(e.c=n.n(f()))}()(),function e(){return e.c||(e.c=n.n(h()))}()()(oa.A,aa),oa.A&&oa.A.locals&&oa.A.locals;const sa=y()("moveo:telnyx:main"),la=async e=>{if(sa("MoveoTelnyx.init() called with config",e),!e.integrationId){const e=new Error("integrationId is required in config");throw sa("Initialization failed: integrationId is required",e),e}sa("Creating TelnyxController instance");const t=new Hr(e);return sa("Initializing TelnyxController"),await t.init(),sa("MoveoTelnyx initialization complete"),t},ca=Object.assign(la,{init:la,TelnyxController:Hr})})(),i=i.default,i})());