voxnix 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{background-color:transparent;--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-2{top:.5rem;right:.5rem;bottom:.5rem;left:.5rem}.-right-0\\.5{right:-.125rem}.-right-1{right:-.25rem}.-top-0\\.5{top:-.125rem}.-top-1{top:-.25rem}.bottom-6{bottom:1.5rem}.bottom-full{bottom:100%}.left-1\\/2{left:50%}.left-3{left:.75rem}.right-0{right:0}.right-3{right:.75rem}.top-3{top:.75rem}.top-6{top:1.5rem}.z-10{z-index:10}.z-50{z-index:50}.z-\\[9999\\]{z-index:9999}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-6{margin-bottom:1.5rem}.ml-auto{margin-left:auto}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1\\.5{height:.375rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-9{height:2.25rem}.h-\\[18px\\]{height:18px}.h-px{height:1px}.min-h-\\[280px\\]{min-height:280px}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[44px\\]{min-height:44px}.min-h-\\[56px\\]{min-height:56px}.w-1\\.5{width:.375rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-20{width:5rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-9{width:2.25rem}.w-\\[18px\\]{width:18px}.w-\\[360px\\]{width:360px}.w-full{width:100%}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[260px\\]{max-width:260px}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.origin-bottom-left{transform-origin:bottom left}.origin-bottom-right{transform-origin:bottom right}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-7{gap:1.75rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-50{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.border-green-100{--tw-border-opacity: 1;border-color:rgb(220 252 231 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-primary{--tw-border-opacity: 1;border-color:rgb(63 49 146 / var(--tw-border-opacity, 1))}.border-primary\\/15{border-color:#3f319226}.border-primary\\/20{border-color:#3f319233}.border-red-100{--tw-border-opacity: 1;border-color:rgb(254 226 226 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-t-gray-600{--tw-border-opacity: 1;border-top-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-t-primary{--tw-border-opacity: 1;border-top-color:rgb(63 49 146 / var(--tw-border-opacity, 1))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-50\\/60{background-color:#f9fafb99}.bg-gray-50\\/70{background-color:#f9fafbb3}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\\/15{background-color:#22c55e26}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(63 49 146 / var(--tw-bg-opacity, 1))}.bg-primary\\/10{background-color:#3f31921a}.bg-primary\\/15{background-color:#3f319226}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\\/15{background-color:#ef444426}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/90{background-color:#ffffffe6}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\\[\\#3f3192\\]{--tw-gradient-from: #3f3192 var(--tw-gradient-from-position);--tw-gradient-to: rgb(63 49 146 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-\\[\\#5240c2\\]{--tw-gradient-to: #5240c2 var(--tw-gradient-to-position)}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position)}.fill-white{fill:#fff}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-6{padding:1.5rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pt-1{padding-top:.25rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[22px\\]{font-size:22px}.text-\\[28px\\]{font-size:28px}.text-\\[9px\\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.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)}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-\\[0\\.12em\\]{letter-spacing:.12em}.tracking-\\[0\\.18em\\]{letter-spacing:.18em}.tracking-\\[0\\.25em\\]{letter-spacing:.25em}.tracking-\\[0\\.2em\\]{letter-spacing:.2em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(63 49 146 / var(--tw-text-opacity, 1))}.text-primary\\/70{color:#3f3192b3}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/50{color:#ffffff80}.opacity-75{opacity:.75}.shadow-\\[0_20px_60px_rgba\\(0\\,0\\,0\\,0\\.18\\)\\,0_4px_16px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow: 0 20px 60px rgba(0,0,0,.18),0 4px 16px rgba(0,0,0,.08);--tw-shadow-colored: 0 20px 60px var(--tw-shadow-color), 0 4px 16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_2px_6px_rgba\\(0\\,0\\,0\\,0\\.07\\)\\]{--tw-shadow: 0 2px 6px rgba(0,0,0,.07);--tw-shadow-colored: 0 2px 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(239\\,68\\,68\\,0\\.35\\)\\]{--tw-shadow: 0 2px 8px rgba(239,68,68,.35);--tw-shadow-colored: 0 2px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(63\\,49\\,146\\,0\\.35\\)\\]{--tw-shadow: 0 2px 8px rgba(63,49,146,.35);--tw-shadow-colored: 0 2px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_4px_14px_rgba\\(239\\,68\\,68\\,0\\.4\\)\\]{--tw-shadow: 0 4px 14px rgba(239,68,68,.4);--tw-shadow-colored: 0 4px 14px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_4px_14px_rgba\\(34\\,197\\,94\\,0\\.4\\)\\]{--tw-shadow: 0 4px 14px rgba(34,197,94,.4);--tw-shadow-colored: 0 4px 14px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/30{--tw-shadow-color: rgb(63 49 146 / .3);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.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)}.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-md{--tw-backdrop-blur: blur(12px);-webkit-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-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,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}@keyframes fadeIn{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}@keyframes slideUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.animate-fadeIn{animation:fadeIn .25s cubic-bezier(.16,1,.3,1) forwards}.animate-slideUp{animation:slideUp .3s cubic-bezier(.16,1,.3,1) forwards}.placeholder\\:text-2xl::-moz-placeholder{font-size:1.5rem;line-height:2rem}.placeholder\\:text-2xl::placeholder{font-size:1.5rem;line-height:2rem}.placeholder\\:font-normal::-moz-placeholder{font-weight:400}.placeholder\\:font-normal::placeholder{font-weight:400}.placeholder\\:text-gray-300::-moz-placeholder{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.placeholder\\:text-gray-300::placeholder{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.last\\:border-0:last-child{border-width:0px}.hover\\:border-primary\\/20:hover{border-color:#3f319233}.hover\\:bg-amber-50:hover{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:bg-green-50:hover{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.hover\\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary-hover:hover{--tw-bg-opacity: 1;background-color:rgb(43 32 102 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary\\/5:hover{background-color:#3f31920d}.hover\\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\\:from-green-600:hover{--tw-gradient-from: #16a34a var(--tw-gradient-from-position);--tw-gradient-to: rgb(22 163 74 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\\:to-green-700:hover{--tw-gradient-to: #15803d var(--tw-gradient-to-position)}.hover\\:text-amber-800:hover{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.hover\\:text-gray-500:hover{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.hover\\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\\:text-green-800:hover{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:shadow-\\[0_4px_12px_rgba\\(63\\,49\\,146\\,0\\.13\\)\\]:hover{--tw-shadow: 0 4px 12px rgba(63,49,146,.13);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-\\[0_6px_18px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]:hover{--tw-shadow: 0 6px 18px rgba(239,68,68,.5);--tw-shadow-colored: 0 6px 18px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-\\[0_6px_20px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]:hover{--tw-shadow: 0 6px 20px rgba(239,68,68,.5);--tw-shadow-colored: 0 6px 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-\\[0_6px_20px_rgba\\(34\\,197\\,94\\,0\\.5\\)\\]:hover{--tw-shadow: 0 6px 20px rgba(34,197,94,.5);--tw-shadow-colored: 0 6px 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\\:border-primary:focus{--tw-border-opacity: 1;border-color:rgb(63 49 146 / var(--tw-border-opacity, 1))}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-primary:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(63 49 146 / var(--tw-ring-opacity, 1))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:bg-primary\\/10:active{background-color:#3f31921a}.active\\:shadow-none:active{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:from-gray-200:disabled{--tw-gradient-from: #e5e7eb var(--tw-gradient-from-position);--tw-gradient-to: rgb(229 231 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.disabled\\:to-gray-200:disabled{--tw-gradient-to: #e5e7eb var(--tw-gradient-to-position)}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:shadow-none:disabled{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}')),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
- (function(Yt,Q){typeof exports=="object"&&typeof module<"u"?Q(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],Q):(Yt=typeof globalThis<"u"?globalThis:Yt||self,Q(Yt.OmnixWidget={},Yt.React,Yt.ReactDOM))})(this,function(Yt,Q,Go){"use strict";function Vo(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Hr=Vo(Go);var se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zo(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Ko(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(s){var i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return r[s]}})}),t}var zs={exports:{}},Pr={};/**
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{background-color:transparent;--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-2{top:.5rem;right:.5rem;bottom:.5rem;left:.5rem}.-right-0\\.5{right:-.125rem}.-right-1{right:-.25rem}.-top-0\\.5{top:-.125rem}.-top-1{top:-.25rem}.bottom-6{bottom:1.5rem}.bottom-full{bottom:100%}.left-1\\/2{left:50%}.left-3{left:.75rem}.right-0{right:0}.right-3{right:.75rem}.top-3{top:.75rem}.top-6{top:1.5rem}.z-10{z-index:10}.z-50{z-index:50}.z-\\[9999\\]{z-index:9999}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-1\\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-6{margin-bottom:1.5rem}.ml-auto{margin-left:auto}.mt-1{margin-top:.25rem}.mt-1\\.5{margin-top:.375rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1\\.5{height:.375rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-9{height:2.25rem}.h-\\[18px\\]{height:18px}.h-px{height:1px}.min-h-\\[280px\\]{min-height:280px}.min-h-\\[300px\\]{min-height:300px}.min-h-\\[44px\\]{min-height:44px}.min-h-\\[56px\\]{min-height:56px}.w-1\\.5{width:.375rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-20{width:5rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\\.5{width:.875rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-9{width:2.25rem}.w-\\[18px\\]{width:18px}.w-\\[360px\\]{width:360px}.w-full{width:100%}.max-w-\\[220px\\]{max-width:220px}.max-w-\\[260px\\]{max-width:260px}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.origin-bottom-left{transform-origin:bottom left}.origin-bottom-right{transform-origin:bottom right}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-2\\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-7{gap:1.75rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-4{border-width:4px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-50{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.border-green-100{--tw-border-opacity: 1;border-color:rgb(220 252 231 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-primary{--tw-border-opacity: 1;border-color:rgb(63 49 146 / var(--tw-border-opacity, 1))}.border-primary\\/15{border-color:#3f319226}.border-primary\\/20{border-color:#3f319233}.border-red-100{--tw-border-opacity: 1;border-color:rgb(254 226 226 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity, 1))}.border-t-gray-600{--tw-border-opacity: 1;border-top-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-t-primary{--tw-border-opacity: 1;border-top-color:rgb(63 49 146 / var(--tw-border-opacity, 1))}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-blue-400{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-400{--tw-bg-opacity: 1;background-color:rgb(156 163 175 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-50\\/60{background-color:#f9fafb99}.bg-gray-50\\/70{background-color:#f9fafbb3}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\\/15{background-color:#22c55e26}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(63 49 146 / var(--tw-bg-opacity, 1))}.bg-primary\\/10{background-color:#3f31921a}.bg-primary\\/15{background-color:#3f319226}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\\/15{background-color:#ef444426}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\\/90{background-color:#ffffffe6}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\\[\\#3f3192\\]{--tw-gradient-from: #3f3192 var(--tw-gradient-from-position);--tw-gradient-to: rgb(63 49 146 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-green-500{--tw-gradient-from: #22c55e var(--tw-gradient-from-position);--tw-gradient-to: rgb(34 197 94 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-\\[\\#5240c2\\]{--tw-gradient-to: #5240c2 var(--tw-gradient-to-position)}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position)}.fill-white{fill:#fff}.p-1{padding:.25rem}.p-1\\.5{padding:.375rem}.p-6{padding:1.5rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2\\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pt-1{padding-top:.25rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[22px\\]{font-size:22px}.text-\\[28px\\]{font-size:28px}.text-\\[9px\\]{font-size:9px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-\\[0\\.12em\\]{letter-spacing:.12em}.tracking-\\[0\\.18em\\]{letter-spacing:.18em}.tracking-\\[0\\.25em\\]{letter-spacing:.25em}.tracking-\\[0\\.2em\\]{letter-spacing:.2em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(63 49 146 / var(--tw-text-opacity, 1))}.text-primary\\/70{color:#3f3192b3}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/50{color:#ffffff80}.opacity-75{opacity:.75}.shadow-\\[0_20px_60px_rgba\\(0\\,0\\,0\\,0\\.18\\)\\,0_4px_16px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow: 0 20px 60px rgba(0,0,0,.18),0 4px 16px rgba(0,0,0,.08);--tw-shadow-colored: 0 20px 60px var(--tw-shadow-color), 0 4px 16px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_2px_6px_rgba\\(0\\,0\\,0\\,0\\.07\\)\\]{--tw-shadow: 0 2px 6px rgba(0,0,0,.07);--tw-shadow-colored: 0 2px 6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(239\\,68\\,68\\,0\\.35\\)\\]{--tw-shadow: 0 2px 8px rgba(239,68,68,.35);--tw-shadow-colored: 0 2px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_2px_8px_rgba\\(63\\,49\\,146\\,0\\.35\\)\\]{--tw-shadow: 0 2px 8px rgba(63,49,146,.35);--tw-shadow-colored: 0 2px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_4px_14px_rgba\\(239\\,68\\,68\\,0\\.4\\)\\]{--tw-shadow: 0 4px 14px rgba(239,68,68,.4);--tw-shadow-colored: 0 4px 14px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0_4px_14px_rgba\\(34\\,197\\,94\\,0\\.4\\)\\]{--tw-shadow: 0 4px 14px rgba(34,197,94,.4);--tw-shadow-colored: 0 4px 14px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary\\/30{--tw-shadow-color: rgb(63 49 146 / .3);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.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-md{--tw-backdrop-blur: blur(12px);-webkit-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-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-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}@keyframes fadeIn{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}@keyframes slideUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.animate-fadeIn{animation:fadeIn .25s cubic-bezier(.16,1,.3,1) forwards}.animate-slideUp{animation:slideUp .3s cubic-bezier(.16,1,.3,1) forwards}.placeholder\\:text-2xl::-moz-placeholder{font-size:1.5rem;line-height:2rem}.placeholder\\:text-2xl::placeholder{font-size:1.5rem;line-height:2rem}.placeholder\\:font-normal::-moz-placeholder{font-weight:400}.placeholder\\:font-normal::placeholder{font-weight:400}.placeholder\\:text-gray-300::-moz-placeholder{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.placeholder\\:text-gray-300::placeholder{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.last\\:border-0:last-child{border-width:0px}.hover\\:border-primary\\/20:hover{border-color:#3f319233}.hover\\:bg-amber-50:hover{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:bg-green-50:hover{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.hover\\:bg-green-600:hover{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary-hover:hover{--tw-bg-opacity: 1;background-color:rgb(43 32 102 / var(--tw-bg-opacity, 1))}.hover\\:bg-primary\\/5:hover{background-color:#3f31920d}.hover\\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\\:from-green-600:hover{--tw-gradient-from: #16a34a var(--tw-gradient-from-position);--tw-gradient-to: rgb(22 163 74 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.hover\\:to-green-700:hover{--tw-gradient-to: #15803d var(--tw-gradient-to-position)}.hover\\:text-amber-800:hover{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.hover\\:text-gray-500:hover{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.hover\\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\\:text-green-800:hover{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.hover\\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\\:shadow-\\[0_4px_12px_rgba\\(63\\,49\\,146\\,0\\.13\\)\\]:hover{--tw-shadow: 0 4px 12px rgba(63,49,146,.13);--tw-shadow-colored: 0 4px 12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-\\[0_6px_18px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]:hover{--tw-shadow: 0 6px 18px rgba(239,68,68,.5);--tw-shadow-colored: 0 6px 18px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-\\[0_6px_20px_rgba\\(239\\,68\\,68\\,0\\.5\\)\\]:hover{--tw-shadow: 0 6px 20px rgba(239,68,68,.5);--tw-shadow-colored: 0 6px 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\\:shadow-\\[0_6px_20px_rgba\\(34\\,197\\,94\\,0\\.5\\)\\]:hover{--tw-shadow: 0 6px 20px rgba(34,197,94,.5);--tw-shadow-colored: 0 6px 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\\:border-primary:focus{--tw-border-opacity: 1;border-color:rgb(63 49 146 / var(--tw-border-opacity, 1))}.focus\\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-primary:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(63 49 146 / var(--tw-ring-opacity, 1))}.active\\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:bg-primary\\/10:active{background-color:#3f31921a}.active\\:shadow-none:active{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:from-gray-200:disabled{--tw-gradient-from: #e5e7eb var(--tw-gradient-from-position);--tw-gradient-to: rgb(229 231 235 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.disabled\\:to-gray-200:disabled{--tw-gradient-to: #e5e7eb var(--tw-gradient-to-position)}.disabled\\:text-gray-400:disabled{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:shadow-none:disabled{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}')),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
2
+ (function(Yt,re){typeof exports=="object"&&typeof module<"u"?re(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],re):(Yt=typeof globalThis<"u"?globalThis:Yt||self,re(Yt.OmnixWidget={},Yt.React,Yt.ReactDOM))})(this,function(Yt,re,jo){"use strict";function Uo(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Hr=Uo(jo);var se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lo(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Yo(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(s){var i=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:function(){return r[s]}})}),t}var zs={exports:{}},Pr={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.min.js
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var kn;function Zo(){if(kn)return Pr;kn=1;var r=Q,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n={key:!0,ref:!0,__self:!0,__source:!0};function a(o,d,c){var l,g={},u=null,y=null;c!==void 0&&(u=""+c),d.key!==void 0&&(u=""+d.key),d.ref!==void 0&&(y=d.ref);for(l in d)s.call(d,l)&&!n.hasOwnProperty(l)&&(g[l]=d[l]);if(o&&o.defaultProps)for(l in d=o.defaultProps,d)g[l]===void 0&&(g[l]=d[l]);return{$$typeof:e,type:o,key:u,ref:y,props:g,_owner:i.current}}return Pr.Fragment=t,Pr.jsx=a,Pr.jsxs=a,Pr}var $r={};/**
10
+ */var Fn;function Wo(){if(Fn)return Pr;Fn=1;var r=re,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n={key:!0,ref:!0,__self:!0,__source:!0};function a(o,d,c){var l,g={},u=null,y=null;c!==void 0&&(u=""+c),d.key!==void 0&&(u=""+d.key),d.ref!==void 0&&(y=d.ref);for(l in d)s.call(d,l)&&!n.hasOwnProperty(l)&&(g[l]=d[l]);if(o&&o.defaultProps)for(l in d=o.defaultProps,d)g[l]===void 0&&(g[l]=d[l]);return{$$typeof:e,type:o,key:u,ref:y,props:g,_owner:i.current}}return Pr.Fragment=t,Pr.jsx=a,Pr.jsxs=a,Pr}var $r={};/**
11
11
  * @license React
12
12
  * react-jsx-runtime.development.js
13
13
  *
@@ -15,110 +15,110 @@
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var Bn;function Xo(){return Bn||(Bn=1,process.env.NODE_ENV!=="production"&&function(){var r=Q,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),w=Symbol.iterator,b="@@iterator";function C(D){if(D===null||typeof D!="object")return null;var O=w&&D[w]||D[b];return typeof O=="function"?O:null}var x=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(D){{for(var O=arguments.length,V=new Array(O>1?O-1:0),te=1;te<O;te++)V[te-1]=arguments[te];E("error",D,V)}}function E(D,O,V){{var te=x.ReactDebugCurrentFrame,ve=te.getStackAddendum();ve!==""&&(O+="%s",V=V.concat([ve]));var be=V.map(function(de){return String(de)});be.unshift("Warning: "+O),Function.prototype.apply.call(console[D],console,be)}}var _=!1,R=!1,T=!1,F=!1,h=!1,N;N=Symbol.for("react.module.reference");function A(D){return!!(typeof D=="string"||typeof D=="function"||D===s||D===n||h||D===i||D===c||D===l||F||D===y||_||R||T||typeof D=="object"&&D!==null&&(D.$$typeof===u||D.$$typeof===g||D.$$typeof===a||D.$$typeof===o||D.$$typeof===d||D.$$typeof===N||D.getModuleId!==void 0))}function f(D,O,V){var te=D.displayName;if(te)return te;var ve=O.displayName||O.name||"";return ve!==""?V+"("+ve+")":V}function v(D){return D.displayName||"Context"}function m(D){if(D==null)return null;if(typeof D.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case s:return"Fragment";case t:return"Portal";case n:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case o:var O=D;return v(O)+".Consumer";case a:var V=D;return v(V._context)+".Provider";case d:return f(D,D.render,"ForwardRef");case g:var te=D.displayName||null;return te!==null?te:m(D.type)||"Memo";case u:{var ve=D,be=ve._payload,de=ve._init;try{return m(de(be))}catch{return null}}}return null}var L=Object.assign,j=0,X,W,ie,he,ue,I,P;function $(){}$.__reactDisabledLog=!0;function H(){{if(j===0){X=console.log,W=console.info,ie=console.warn,he=console.error,ue=console.group,I=console.groupCollapsed,P=console.groupEnd;var D={configurable:!0,enumerable:!0,value:$,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}j++}}function we(){{if(j--,j===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},D,{value:X}),info:L({},D,{value:W}),warn:L({},D,{value:ie}),error:L({},D,{value:he}),group:L({},D,{value:ue}),groupCollapsed:L({},D,{value:I}),groupEnd:L({},D,{value:P})})}j<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=x.ReactCurrentDispatcher,ke;function q(D,O,V){{if(ke===void 0)try{throw Error()}catch(ve){var te=ve.stack.trim().match(/\n( *(at )?)/);ke=te&&te[1]||""}return`
19
- `+ke+D}}var K=!1,Ee;{var ct=typeof WeakMap=="function"?WeakMap:Map;Ee=new ct}function pt(D,O){if(!D||K)return"";{var V=Ee.get(D);if(V!==void 0)return V}var te;K=!0;var ve=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=pe.current,pe.current=null,H();try{if(O){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(Je){te=Je}Reflect.construct(D,[],de)}else{try{de.call()}catch(Je){te=Je}D.call(de.prototype)}}else{try{throw Error()}catch(Je){te=Je}D()}}catch(Je){if(Je&&te&&typeof Je.stack=="string"){for(var ae=Je.stack.split(`
20
- `),Ve=te.stack.split(`
18
+ */var kn;function Go(){return kn||(kn=1,process.env.NODE_ENV!=="production"&&function(){var r=re,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),w=Symbol.iterator,b="@@iterator";function C(D){if(D===null||typeof D!="object")return null;var O=w&&D[w]||D[b];return typeof O=="function"?O:null}var x=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(D){{for(var O=arguments.length,V=new Array(O>1?O-1:0),ee=1;ee<O;ee++)V[ee-1]=arguments[ee];E("error",D,V)}}function E(D,O,V){{var ee=x.ReactDebugCurrentFrame,ve=ee.getStackAddendum();ve!==""&&(O+="%s",V=V.concat([ve]));var be=V.map(function(de){return String(de)});be.unshift("Warning: "+O),Function.prototype.apply.call(console[D],console,be)}}var _=!1,T=!1,S=!1,R=!1,h=!1,N;N=Symbol.for("react.module.reference");function A(D){return!!(typeof D=="string"||typeof D=="function"||D===s||D===n||h||D===i||D===c||D===l||R||D===y||_||T||S||typeof D=="object"&&D!==null&&(D.$$typeof===u||D.$$typeof===g||D.$$typeof===a||D.$$typeof===o||D.$$typeof===d||D.$$typeof===N||D.getModuleId!==void 0))}function f(D,O,V){var ee=D.displayName;if(ee)return ee;var ve=O.displayName||O.name||"";return ve!==""?V+"("+ve+")":V}function v(D){return D.displayName||"Context"}function m(D){if(D==null)return null;if(typeof D.tag=="number"&&p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof D=="function")return D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case s:return"Fragment";case t:return"Portal";case n:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case l:return"SuspenseList"}if(typeof D=="object")switch(D.$$typeof){case o:var O=D;return v(O)+".Consumer";case a:var V=D;return v(V._context)+".Provider";case d:return f(D,D.render,"ForwardRef");case g:var ee=D.displayName||null;return ee!==null?ee:m(D.type)||"Memo";case u:{var ve=D,be=ve._payload,de=ve._init;try{return m(de(be))}catch{return null}}}return null}var U=Object.assign,q=0,X,W,ie,he,ue,I,P;function $(){}$.__reactDisabledLog=!0;function H(){{if(q===0){X=console.log,W=console.info,ie=console.warn,he=console.error,ue=console.group,I=console.groupCollapsed,P=console.groupEnd;var D={configurable:!0,enumerable:!0,value:$,writable:!0};Object.defineProperties(console,{info:D,log:D,warn:D,error:D,group:D,groupCollapsed:D,groupEnd:D})}q++}}function we(){{if(q--,q===0){var D={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},D,{value:X}),info:U({},D,{value:W}),warn:U({},D,{value:ie}),error:U({},D,{value:he}),group:U({},D,{value:ue}),groupCollapsed:U({},D,{value:I}),groupEnd:U({},D,{value:P})})}q<0&&p("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=x.ReactCurrentDispatcher,ke;function j(D,O,V){{if(ke===void 0)try{throw Error()}catch(ve){var ee=ve.stack.trim().match(/\n( *(at )?)/);ke=ee&&ee[1]||""}return`
19
+ `+ke+D}}var K=!1,Ee;{var ct=typeof WeakMap=="function"?WeakMap:Map;Ee=new ct}function pt(D,O){if(!D||K)return"";{var V=Ee.get(D);if(V!==void 0)return V}var ee;K=!0;var ve=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var be;be=pe.current,pe.current=null,H();try{if(O){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(Je){ee=Je}Reflect.construct(D,[],de)}else{try{de.call()}catch(Je){ee=Je}D.call(de.prototype)}}else{try{throw Error()}catch(Je){ee=Je}D()}}catch(Je){if(Je&&ee&&typeof Je.stack=="string"){for(var ae=Je.stack.split(`
20
+ `),Ve=ee.stack.split(`
21
21
  `),Re=ae.length-1,Be=Ve.length-1;Re>=1&&Be>=0&&ae[Re]!==Ve[Be];)Be--;for(;Re>=1&&Be>=0;Re--,Be--)if(ae[Re]!==Ve[Be]){if(Re!==1||Be!==1)do if(Re--,Be--,Be<0||ae[Re]!==Ve[Be]){var dt=`
22
- `+ae[Re].replace(" at new "," at ");return D.displayName&&dt.includes("<anonymous>")&&(dt=dt.replace("<anonymous>",D.displayName)),typeof D=="function"&&Ee.set(D,dt),dt}while(Re>=1&&Be>=0);break}}}finally{K=!1,pe.current=be,we(),Error.prepareStackTrace=ve}var Ir=D?D.displayName||D.name:"",pr=Ir?q(Ir):"";return typeof D=="function"&&Ee.set(D,pr),pr}function Ue(D,O,V){return pt(D,!1)}function Ne(D){var O=D.prototype;return!!(O&&O.isReactComponent)}function lt(D,O,V){if(D==null)return"";if(typeof D=="function")return pt(D,Ne(D));if(typeof D=="string")return q(D);switch(D){case c:return q("Suspense");case l:return q("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case d:return Ue(D.render);case g:return lt(D.type,O,V);case u:{var te=D,ve=te._payload,be=te._init;try{return lt(be(ve),O,V)}catch{}}}return""}var Xe=Object.prototype.hasOwnProperty,Tt={},mt=x.ReactDebugCurrentFrame;function vt(D){if(D){var O=D._owner,V=lt(D.type,D._source,O?O.type:null);mt.setExtraStackFrame(V)}else mt.setExtraStackFrame(null)}function gr(D,O,V,te,ve){{var be=Function.call.bind(Xe);for(var de in D)if(be(D,de)){var ae=void 0;try{if(typeof D[de]!="function"){var Ve=Error((te||"React class")+": "+V+" type `"+de+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[de]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ve.name="Invariant Violation",Ve}ae=D[de](O,de,te,V,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Re){ae=Re}ae&&!(ae instanceof Error)&&(vt(ve),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",te||"React class",V,de,typeof ae),vt(null)),ae instanceof Error&&!(ae.message in Tt)&&(Tt[ae.message]=!0,vt(ve),p("Failed %s type: %s",V,ae.message),vt(null))}}}var rt=Array.isArray;function Ye(D){return rt(D)}function Rt(D){{var O=typeof Symbol=="function"&&Symbol.toStringTag,V=O&&D[Symbol.toStringTag]||D.constructor.name||"Object";return V}}function Fr(D){try{return es(D),!1}catch{return!0}}function es(D){return""+D}function Lt(D){if(Fr(D))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Rt(D)),es(D)}var tr=x.ReactCurrentOwner,Cn={key:!0,ref:!0,__self:!0,__source:!0},ts,rs;function rr(D){if(Xe.call(D,"ref")){var O=Object.getOwnPropertyDescriptor(D,"ref").get;if(O&&O.isReactWarning)return!1}return D.ref!==void 0}function xr(D){if(Xe.call(D,"key")){var O=Object.getOwnPropertyDescriptor(D,"key").get;if(O&&O.isReactWarning)return!1}return D.key!==void 0}function _n(D,O){typeof D.ref=="string"&&tr.current}function Ns(D,O){{var V=function(){ts||(ts=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};V.isReactWarning=!0,Object.defineProperty(D,"key",{get:V,configurable:!0})}}function Ms(D,O){{var V=function(){rs||(rs=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};V.isReactWarning=!0,Object.defineProperty(D,"ref",{get:V,configurable:!0})}}var Dn=function(D,O,V,te,ve,be,de){var ae={$$typeof:e,type:D,key:O,ref:V,props:de,_owner:be};return ae._store={},Object.defineProperty(ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:te}),Object.defineProperty(ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ve}),Object.freeze&&(Object.freeze(ae.props),Object.freeze(ae)),ae};function An(D,O,V,te,ve){{var be,de={},ae=null,Ve=null;V!==void 0&&(Lt(V),ae=""+V),xr(O)&&(Lt(O.key),ae=""+O.key),rr(O)&&(Ve=O.ref,_n(O,ve));for(be in O)Xe.call(O,be)&&!Cn.hasOwnProperty(be)&&(de[be]=O[be]);if(D&&D.defaultProps){var Re=D.defaultProps;for(be in Re)de[be]===void 0&&(de[be]=Re[be])}if(ae||Ve){var Be=typeof D=="function"?D.displayName||D.name||"Unknown":D;ae&&Ns(de,Be),Ve&&Ms(de,Be)}return Dn(D,ae,Ve,ve,te,tr.current,de)}}var kr=x.ReactCurrentOwner,js=x.ReactDebugCurrentFrame;function Ut(D){if(D){var O=D._owner,V=lt(D.type,D._source,O?O.type:null);js.setExtraStackFrame(V)}else js.setExtraStackFrame(null)}var ss;ss=!1;function Br(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function qs(){{if(kr.current){var D=m(kr.current.type);if(D)return`
22
+ `+ae[Re].replace(" at new "," at ");return D.displayName&&dt.includes("<anonymous>")&&(dt=dt.replace("<anonymous>",D.displayName)),typeof D=="function"&&Ee.set(D,dt),dt}while(Re>=1&&Be>=0);break}}}finally{K=!1,pe.current=be,we(),Error.prepareStackTrace=ve}var Ir=D?D.displayName||D.name:"",pr=Ir?j(Ir):"";return typeof D=="function"&&Ee.set(D,pr),pr}function Le(D,O,V){return pt(D,!1)}function Ne(D){var O=D.prototype;return!!(O&&O.isReactComponent)}function lt(D,O,V){if(D==null)return"";if(typeof D=="function")return pt(D,Ne(D));if(typeof D=="string")return j(D);switch(D){case c:return j("Suspense");case l:return j("SuspenseList")}if(typeof D=="object")switch(D.$$typeof){case d:return Le(D.render);case g:return lt(D.type,O,V);case u:{var ee=D,ve=ee._payload,be=ee._init;try{return lt(be(ve),O,V)}catch{}}}return""}var Xe=Object.prototype.hasOwnProperty,Tt={},mt=x.ReactDebugCurrentFrame;function vt(D){if(D){var O=D._owner,V=lt(D.type,D._source,O?O.type:null);mt.setExtraStackFrame(V)}else mt.setExtraStackFrame(null)}function gr(D,O,V,ee,ve){{var be=Function.call.bind(Xe);for(var de in D)if(be(D,de)){var ae=void 0;try{if(typeof D[de]!="function"){var Ve=Error((ee||"React class")+": "+V+" type `"+de+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof D[de]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ve.name="Invariant Violation",Ve}ae=D[de](O,de,ee,V,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Re){ae=Re}ae&&!(ae instanceof Error)&&(vt(ve),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",ee||"React class",V,de,typeof ae),vt(null)),ae instanceof Error&&!(ae.message in Tt)&&(Tt[ae.message]=!0,vt(ve),p("Failed %s type: %s",V,ae.message),vt(null))}}}var rt=Array.isArray;function Ye(D){return rt(D)}function Rt(D){{var O=typeof Symbol=="function"&&Symbol.toStringTag,V=O&&D[Symbol.toStringTag]||D.constructor.name||"Object";return V}}function Fr(D){try{return es(D),!1}catch{return!0}}function es(D){return""+D}function Ut(D){if(Fr(D))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Rt(D)),es(D)}var tr=x.ReactCurrentOwner,bn={key:!0,ref:!0,__self:!0,__source:!0},ts,rs;function rr(D){if(Xe.call(D,"ref")){var O=Object.getOwnPropertyDescriptor(D,"ref").get;if(O&&O.isReactWarning)return!1}return D.ref!==void 0}function xr(D){if(Xe.call(D,"key")){var O=Object.getOwnPropertyDescriptor(D,"key").get;if(O&&O.isReactWarning)return!1}return D.key!==void 0}function Cn(D,O){typeof D.ref=="string"&&tr.current}function Ns(D,O){{var V=function(){ts||(ts=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};V.isReactWarning=!0,Object.defineProperty(D,"key",{get:V,configurable:!0})}}function Ms(D,O){{var V=function(){rs||(rs=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",O))};V.isReactWarning=!0,Object.defineProperty(D,"ref",{get:V,configurable:!0})}}var _n=function(D,O,V,ee,ve,be,de){var ae={$$typeof:e,type:D,key:O,ref:V,props:de,_owner:be};return ae._store={},Object.defineProperty(ae._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ae,"_self",{configurable:!1,enumerable:!1,writable:!1,value:ee}),Object.defineProperty(ae,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ve}),Object.freeze&&(Object.freeze(ae.props),Object.freeze(ae)),ae};function Dn(D,O,V,ee,ve){{var be,de={},ae=null,Ve=null;V!==void 0&&(Ut(V),ae=""+V),xr(O)&&(Ut(O.key),ae=""+O.key),rr(O)&&(Ve=O.ref,Cn(O,ve));for(be in O)Xe.call(O,be)&&!bn.hasOwnProperty(be)&&(de[be]=O[be]);if(D&&D.defaultProps){var Re=D.defaultProps;for(be in Re)de[be]===void 0&&(de[be]=Re[be])}if(ae||Ve){var Be=typeof D=="function"?D.displayName||D.name||"Unknown":D;ae&&Ns(de,Be),Ve&&Ms(de,Be)}return _n(D,ae,Ve,ve,ee,tr.current,de)}}var kr=x.ReactCurrentOwner,qs=x.ReactDebugCurrentFrame;function Lt(D){if(D){var O=D._owner,V=lt(D.type,D._source,O?O.type:null);qs.setExtraStackFrame(V)}else qs.setExtraStackFrame(null)}var ss;ss=!1;function Br(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function js(){{if(kr.current){var D=m(kr.current.type);if(D)return`
23
23
 
24
- Check the render method of \``+D+"`."}return""}}function Sn(D){return""}var Ls={};function Us(D){{var O=qs();if(!O){var V=typeof D=="string"?D:D.displayName||D.name;V&&(O=`
24
+ Check the render method of \``+D+"`."}return""}}function An(D){return""}var Us={};function Ls(D){{var O=js();if(!O){var V=typeof D=="string"?D:D.displayName||D.name;V&&(O=`
25
25
 
26
- Check the top-level render call using <`+V+">.")}return O}}function Ys(D,O){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var V=Us(O);if(Ls[V])return;Ls[V]=!0;var te="";D&&D._owner&&D._owner!==kr.current&&(te=" It was passed a child from "+m(D._owner.type)+"."),Ut(D),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',V,te),Ut(null)}}function Ws(D,O){{if(typeof D!="object")return;if(Ye(D))for(var V=0;V<D.length;V++){var te=D[V];Br(te)&&Ys(te,O)}else if(Br(D))D._store&&(D._store.validated=!0);else if(D){var ve=C(D);if(typeof ve=="function"&&ve!==D.entries)for(var be=ve.call(D),de;!(de=be.next()).done;)Br(de.value)&&Ys(de.value,O)}}}function Gs(D){{var O=D.type;if(O==null||typeof O=="string")return;var V;if(typeof O=="function")V=O.propTypes;else if(typeof O=="object"&&(O.$$typeof===d||O.$$typeof===g))V=O.propTypes;else return;if(V){var te=m(O);gr(V,D.props,"prop",te,D)}else if(O.PropTypes!==void 0&&!ss){ss=!0;var ve=m(O);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ve||"Unknown")}typeof O.getDefaultProps=="function"&&!O.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Tn(D){{for(var O=Object.keys(D.props),V=0;V<O.length;V++){var te=O[V];if(te!=="children"&&te!=="key"){Ut(D),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",te),Ut(null);break}}D.ref!==null&&(Ut(D),p("Invalid attribute `ref` supplied to `React.Fragment`."),Ut(null))}}var is={};function We(D,O,V,te,ve,be){{var de=A(D);if(!de){var ae="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(ae+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ve=Sn();Ve?ae+=Ve:ae+=qs();var Re;D===null?Re="null":Ye(D)?Re="array":D!==void 0&&D.$$typeof===e?(Re="<"+(m(D.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):Re=typeof D,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Re,ae)}var Be=An(D,O,V,ve,be);if(Be==null)return Be;if(de){var dt=O.children;if(dt!==void 0)if(te)if(Ye(dt)){for(var Ir=0;Ir<dt.length;Ir++)Ws(dt[Ir],D);Object.freeze&&Object.freeze(dt)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ws(dt,D)}if(Xe.call(O,"key")){var pr=m(D),Je=Object.keys(O).filter(function(Yu){return Yu!=="key"}),Fn=Je.length>0?"{key: someKey, "+Je.join(": ..., ")+": ...}":"{key: someKey}";if(!is[pr+Fn]){var Uu=Je.length>0?"{"+Je.join(": ..., ")+": ...}":"{}";p(`A props object containing a "key" prop is being spread into JSX:
26
+ Check the top-level render call using <`+V+">.")}return O}}function Ys(D,O){{if(!D._store||D._store.validated||D.key!=null)return;D._store.validated=!0;var V=Ls(O);if(Us[V])return;Us[V]=!0;var ee="";D&&D._owner&&D._owner!==kr.current&&(ee=" It was passed a child from "+m(D._owner.type)+"."),Lt(D),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',V,ee),Lt(null)}}function Ws(D,O){{if(typeof D!="object")return;if(Ye(D))for(var V=0;V<D.length;V++){var ee=D[V];Br(ee)&&Ys(ee,O)}else if(Br(D))D._store&&(D._store.validated=!0);else if(D){var ve=C(D);if(typeof ve=="function"&&ve!==D.entries)for(var be=ve.call(D),de;!(de=be.next()).done;)Br(de.value)&&Ys(de.value,O)}}}function Gs(D){{var O=D.type;if(O==null||typeof O=="string")return;var V;if(typeof O=="function")V=O.propTypes;else if(typeof O=="object"&&(O.$$typeof===d||O.$$typeof===g))V=O.propTypes;else return;if(V){var ee=m(O);gr(V,D.props,"prop",ee,D)}else if(O.PropTypes!==void 0&&!ss){ss=!0;var ve=m(O);p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ve||"Unknown")}typeof O.getDefaultProps=="function"&&!O.getDefaultProps.isReactClassApproved&&p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Sn(D){{for(var O=Object.keys(D.props),V=0;V<O.length;V++){var ee=O[V];if(ee!=="children"&&ee!=="key"){Lt(D),p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",ee),Lt(null);break}}D.ref!==null&&(Lt(D),p("Invalid attribute `ref` supplied to `React.Fragment`."),Lt(null))}}var is={};function We(D,O,V,ee,ve,be){{var de=A(D);if(!de){var ae="";(D===void 0||typeof D=="object"&&D!==null&&Object.keys(D).length===0)&&(ae+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ve=An();Ve?ae+=Ve:ae+=js();var Re;D===null?Re="null":Ye(D)?Re="array":D!==void 0&&D.$$typeof===e?(Re="<"+(m(D.type)||"Unknown")+" />",ae=" Did you accidentally export a JSX literal instead of a component?"):Re=typeof D,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Re,ae)}var Be=Dn(D,O,V,ve,be);if(Be==null)return Be;if(de){var dt=O.children;if(dt!==void 0)if(ee)if(Ye(dt)){for(var Ir=0;Ir<dt.length;Ir++)Ws(dt[Ir],D);Object.freeze&&Object.freeze(dt)}else p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ws(dt,D)}if(Xe.call(O,"key")){var pr=m(D),Je=Object.keys(O).filter(function(Fu){return Fu!=="key"}),Rn=Je.length>0?"{key: someKey, "+Je.join(": ..., ")+": ...}":"{key: someKey}";if(!is[pr+Rn]){var Ru=Je.length>0?"{"+Je.join(": ..., ")+": ...}":"{}";p(`A props object containing a "key" prop is being spread into JSX:
27
27
  let props = %s;
28
28
  <%s {...props} />
29
29
  React keys must be passed directly to JSX without using spread:
30
30
  let props = %s;
31
- <%s key={someKey} {...props} />`,Fn,pr,Uu,pr),is[pr+Fn]=!0}}return D===s?Tn(Be):Gs(Be),Be}}function Ft(D,O,V){return We(D,O,V,!0)}function Vs(D,O,V){return We(D,O,V,!1)}var Rn=Vs,Lu=Ft;$r.Fragment=s,$r.jsx=Rn,$r.jsxs=Lu}()),$r}process.env.NODE_ENV==="production"?zs.exports=Zo():zs.exports=Xo();var S=zs.exports;/**
31
+ <%s key={someKey} {...props} />`,Rn,pr,Ru,pr),is[pr+Rn]=!0}}return D===s?Sn(Be):Gs(Be),Be}}function Ft(D,O,V){return We(D,O,V,!0)}function Vs(D,O,V){return We(D,O,V,!1)}var Tn=Vs,Tu=Ft;$r.Fragment=s,$r.jsx=Tn,$r.jsxs=Tu}()),$r}process.env.NODE_ENV==="production"?zs.exports=Wo():zs.exports=Go();var F=zs.exports;/**
32
32
  * @license lucide-react v0.344.0 - ISC
33
33
  *
34
34
  * This source code is licensed under the ISC license.
35
35
  * See the LICENSE file in the root directory of this source tree.
36
- */var Jo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
36
+ */var Vo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
37
37
  * @license lucide-react v0.344.0 - ISC
38
38
  *
39
39
  * This source code is licensed under the ISC license.
40
40
  * See the LICENSE file in the root directory of this source tree.
41
- */const Qo=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),je=(r,e)=>{const t=Q.forwardRef(({color:s="currentColor",size:i=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:d,...c},l)=>Q.createElement("svg",{ref:l,...Jo,width:i,height:i,stroke:s,strokeWidth:a?Number(n)*24/Number(i):n,className:["lucide",`lucide-${Qo(r)}`,o].join(" "),...c},[...e.map(([g,u])=>Q.createElement(g,u)),...Array.isArray(d)?d:[d]]));return t.displayName=`${r}`,t};/**
41
+ */const zo=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),qe=(r,e)=>{const t=re.forwardRef(({color:s="currentColor",size:i=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:d,...c},l)=>re.createElement("svg",{ref:l,...Vo,width:i,height:i,stroke:s,strokeWidth:a?Number(n)*24/Number(i):n,className:["lucide",`lucide-${zo(r)}`,o].join(" "),...c},[...e.map(([g,u])=>re.createElement(g,u)),...Array.isArray(d)?d:[d]]));return t.displayName=`${r}`,t};/**
42
42
  * @license lucide-react v0.344.0 - ISC
43
43
  *
44
44
  * This source code is licensed under the ISC license.
45
45
  * See the LICENSE file in the root directory of this source tree.
46
- */const e0=je("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
46
+ */const Ko=qe("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
47
47
  * @license lucide-react v0.344.0 - ISC
48
48
  *
49
49
  * This source code is licensed under the ISC license.
50
50
  * See the LICENSE file in the root directory of this source tree.
51
- */const t0=je("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
51
+ */const Zo=qe("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
52
52
  * @license lucide-react v0.344.0 - ISC
53
53
  *
54
54
  * This source code is licensed under the ISC license.
55
55
  * See the LICENSE file in the root directory of this source tree.
56
- */const r0=je("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
56
+ */const Xo=qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
57
57
  * @license lucide-react v0.344.0 - ISC
58
58
  *
59
59
  * This source code is licensed under the ISC license.
60
60
  * See the LICENSE file in the root directory of this source tree.
61
- */const s0=je("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
61
+ */const Jo=qe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
62
62
  * @license lucide-react v0.344.0 - ISC
63
63
  *
64
64
  * This source code is licensed under the ISC license.
65
65
  * See the LICENSE file in the root directory of this source tree.
66
- */const In=je("Coffee",[["path",{d:"M17 8h1a4 4 0 1 1 0 8h-1",key:"jx4kbh"}],["path",{d:"M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z",key:"1bxrl0"}],["line",{x1:"6",x2:"6",y1:"2",y2:"4",key:"1cr9l3"}],["line",{x1:"10",x2:"10",y1:"2",y2:"4",key:"170wym"}],["line",{x1:"14",x2:"14",y1:"2",y2:"4",key:"1c5f70"}]]);/**
66
+ */const Bn=qe("Coffee",[["path",{d:"M17 8h1a4 4 0 1 1 0 8h-1",key:"jx4kbh"}],["path",{d:"M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z",key:"1bxrl0"}],["line",{x1:"6",x2:"6",y1:"2",y2:"4",key:"1cr9l3"}],["line",{x1:"10",x2:"10",y1:"2",y2:"4",key:"170wym"}],["line",{x1:"14",x2:"14",y1:"2",y2:"4",key:"1c5f70"}]]);/**
67
67
  * @license lucide-react v0.344.0 - ISC
68
68
  *
69
69
  * This source code is licensed under the ISC license.
70
70
  * See the LICENSE file in the root directory of this source tree.
71
- */const i0=je("Delete",[["path",{d:"M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Z",key:"1oy587"}],["line",{x1:"18",x2:"12",y1:"9",y2:"15",key:"1olkx5"}],["line",{x1:"12",x2:"18",y1:"9",y2:"15",key:"1n50pc"}]]);/**
71
+ */const Qo=qe("Delete",[["path",{d:"M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2Z",key:"1oy587"}],["line",{x1:"18",x2:"12",y1:"9",y2:"15",key:"1olkx5"}],["line",{x1:"12",x2:"18",y1:"9",y2:"15",key:"1n50pc"}]]);/**
72
72
  * @license lucide-react v0.344.0 - ISC
73
73
  *
74
74
  * This source code is licensed under the ISC license.
75
75
  * See the LICENSE file in the root directory of this source tree.
76
- */const n0=je("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
76
+ */const e0=qe("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
77
77
  * @license lucide-react v0.344.0 - ISC
78
78
  *
79
79
  * This source code is licensed under the ISC license.
80
80
  * See the LICENSE file in the root directory of this source tree.
81
- */const a0=je("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
81
+ */const t0=qe("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
82
82
  * @license lucide-react v0.344.0 - ISC
83
83
  *
84
84
  * This source code is licensed under the ISC license.
85
85
  * See the LICENSE file in the root directory of this source tree.
86
- */const o0=je("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
86
+ */const r0=qe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
87
87
  * @license lucide-react v0.344.0 - ISC
88
88
  *
89
89
  * This source code is licensed under the ISC license.
90
90
  * See the LICENSE file in the root directory of this source tree.
91
- */const Hn=je("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
91
+ */const In=qe("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
92
92
  * @license lucide-react v0.344.0 - ISC
93
93
  *
94
94
  * This source code is licensed under the ISC license.
95
95
  * See the LICENSE file in the root directory of this source tree.
96
- */const c0=je("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/**
96
+ */const s0=qe("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/**
97
97
  * @license lucide-react v0.344.0 - ISC
98
98
  *
99
99
  * This source code is licensed under the ISC license.
100
100
  * See the LICENSE file in the root directory of this source tree.
101
- */const ns=je("PhoneOff",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]);/**
101
+ */const ns=qe("PhoneOff",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]);/**
102
102
  * @license lucide-react v0.344.0 - ISC
103
103
  *
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
- */const as=je("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
106
+ */const as=qe("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
107
107
  * @license lucide-react v0.344.0 - ISC
108
108
  *
109
109
  * This source code is licensed under the ISC license.
110
110
  * See the LICENSE file in the root directory of this source tree.
111
- */const l0=je("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
111
+ */const i0=qe("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
112
112
  * @license lucide-react v0.344.0 - ISC
113
113
  *
114
114
  * This source code is licensed under the ISC license.
115
115
  * See the LICENSE file in the root directory of this source tree.
116
- */const Pn=je("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
116
+ */const Hn=qe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
117
117
  * @license lucide-react v0.344.0 - ISC
118
118
  *
119
119
  * This source code is licensed under the ISC license.
120
120
  * See the LICENSE file in the root directory of this source tree.
121
- */const d0=je("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),h0=[{n:"1",l:""},{n:"2",l:"ABC"},{n:"3",l:"DEF"},{n:"4",l:"GHI"},{n:"5",l:"JKL"},{n:"6",l:"MNO"},{n:"7",l:"PQRS"},{n:"8",l:"TUV"},{n:"9",l:"WXYZ"},{n:"*",l:""},{n:"0",l:"+"},{n:"#",l:""}],$n=({onKeyPress:r})=>S.jsx("div",{className:"grid grid-cols-3 gap-2.5 w-full px-5 py-2",children:h0.map(({n:e,l:t})=>S.jsxs("button",{onClick:()=>r(e),className:`
121
+ */const n0=qe("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),a0=[{n:"1",l:""},{n:"2",l:"ABC"},{n:"3",l:"DEF"},{n:"4",l:"GHI"},{n:"5",l:"JKL"},{n:"6",l:"MNO"},{n:"7",l:"PQRS"},{n:"8",l:"TUV"},{n:"9",l:"WXYZ"},{n:"*",l:""},{n:"0",l:"+"},{n:"#",l:""}],Pn=({onKeyPress:r})=>F.jsx("div",{className:"grid grid-cols-3 gap-2.5 w-full px-5 py-2",children:a0.map(({n:e,l:t})=>F.jsxs("button",{onClick:()=>r(e),className:`
122
122
  relative flex flex-col items-center justify-center
123
123
  h-16 rounded-2xl select-none
124
124
  bg-white border border-gray-100
@@ -127,7 +127,7 @@ React keys must be passed directly to JSX without using spread:
127
127
  hover:border-primary/20 hover:bg-primary/5
128
128
  active:shadow-none active:bg-primary/10 active:scale-95
129
129
  transition-all duration-150
130
- `,children:[S.jsx("span",{className:"text-[22px] font-medium text-gray-800 leading-none",children:e}),t?S.jsx("span",{className:"text-[9px] text-gray-400 font-semibold tracking-[0.18em] mt-1.5",children:t}):S.jsx("span",{className:"h-3.5"})]},e))});class u0{constructor(){this.listeners={}}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}off(e,t){this.listeners[e]&&(this.listeners[e]=this.listeners[e].filter(s=>s!==t))}emitLocal(e,t){this.listeners[e]&&this.listeners[e].forEach(s=>{try{s(t)}catch(i){console.error(`Error in event listener for ${e}:`,i)}})}emitToParent(e,t){this.emitLocal(e,t)}}const Z=new u0;var On={exports:{}};function f0(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ks={exports:{}};const g0=Ko(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Nn;function oe(){return Nn||(Nn=1,function(r,e){(function(t,s){r.exports=s()})(se,function(){var t=t||function(s,i){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof se<"u"&&se.crypto&&(n=se.crypto),!n&&typeof f0=="function")try{n=g0}catch{}var a=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function p(){}return function(E){var _;return p.prototype=E,_=new p,p.prototype=null,_}}(),d={},c=d.lib={},l=c.Base=function(){return{extend:function(p){var E=o(this);return p&&E.mixIn(p),(!E.hasOwnProperty("init")||this.init===E.init)&&(E.init=function(){E.$super.init.apply(this,arguments)}),E.init.prototype=E,E.$super=this,E},create:function(){var p=this.extend();return p.init.apply(p,arguments),p},init:function(){},mixIn:function(p){for(var E in p)p.hasOwnProperty(E)&&(this[E]=p[E]);p.hasOwnProperty("toString")&&(this.toString=p.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=c.WordArray=l.extend({init:function(p,E){p=this.words=p||[],E!=i?this.sigBytes=E:this.sigBytes=p.length*4},toString:function(p){return(p||y).stringify(this)},concat:function(p){var E=this.words,_=p.words,R=this.sigBytes,T=p.sigBytes;if(this.clamp(),R%4)for(var F=0;F<T;F++){var h=_[F>>>2]>>>24-F%4*8&255;E[R+F>>>2]|=h<<24-(R+F)%4*8}else for(var N=0;N<T;N+=4)E[R+N>>>2]=_[N>>>2];return this.sigBytes+=T,this},clamp:function(){var p=this.words,E=this.sigBytes;p[E>>>2]&=4294967295<<32-E%4*8,p.length=s.ceil(E/4)},clone:function(){var p=l.clone.call(this);return p.words=this.words.slice(0),p},random:function(p){for(var E=[],_=0;_<p;_+=4)E.push(a());return new g.init(E,p)}}),u=d.enc={},y=u.Hex={stringify:function(p){for(var E=p.words,_=p.sigBytes,R=[],T=0;T<_;T++){var F=E[T>>>2]>>>24-T%4*8&255;R.push((F>>>4).toString(16)),R.push((F&15).toString(16))}return R.join("")},parse:function(p){for(var E=p.length,_=[],R=0;R<E;R+=2)_[R>>>3]|=parseInt(p.substr(R,2),16)<<24-R%8*4;return new g.init(_,E/2)}},w=u.Latin1={stringify:function(p){for(var E=p.words,_=p.sigBytes,R=[],T=0;T<_;T++){var F=E[T>>>2]>>>24-T%4*8&255;R.push(String.fromCharCode(F))}return R.join("")},parse:function(p){for(var E=p.length,_=[],R=0;R<E;R++)_[R>>>2]|=(p.charCodeAt(R)&255)<<24-R%4*8;return new g.init(_,E)}},b=u.Utf8={stringify:function(p){try{return decodeURIComponent(escape(w.stringify(p)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(p){return w.parse(unescape(encodeURIComponent(p)))}},C=c.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(p){typeof p=="string"&&(p=b.parse(p)),this._data.concat(p),this._nDataBytes+=p.sigBytes},_process:function(p){var E,_=this._data,R=_.words,T=_.sigBytes,F=this.blockSize,h=F*4,N=T/h;p?N=s.ceil(N):N=s.max((N|0)-this._minBufferSize,0);var A=N*F,f=s.min(A*4,T);if(A){for(var v=0;v<A;v+=F)this._doProcessBlock(R,v);E=R.splice(0,A),_.sigBytes-=f}return new g.init(E,f)},clone:function(){var p=l.clone.call(this);return p._data=this._data.clone(),p},_minBufferSize:0});c.Hasher=C.extend({cfg:l.extend(),init:function(p){this.cfg=this.cfg.extend(p),this.reset()},reset:function(){C.reset.call(this),this._doReset()},update:function(p){return this._append(p),this._process(),this},finalize:function(p){p&&this._append(p);var E=this._doFinalize();return E},blockSize:16,_createHelper:function(p){return function(E,_){return new p.init(_).finalize(E)}},_createHmacHelper:function(p){return function(E,_){return new x.HMAC.init(p,_).finalize(E)}}});var x=d.algo={};return d}(Math);return t})}(Ks)),Ks.exports}var Zs={exports:{}},Mn;function os(){return Mn||(Mn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.Base,o=n.WordArray,d=i.x64={};d.Word=a.extend({init:function(c,l){this.high=c,this.low=l}}),d.WordArray=a.extend({init:function(c,l){c=this.words=c||[],l!=s?this.sigBytes=l:this.sigBytes=c.length*8},toX32:function(){for(var c=this.words,l=c.length,g=[],u=0;u<l;u++){var y=c[u];g.push(y.high),g.push(y.low)}return o.create(g,this.sigBytes)},clone:function(){for(var c=a.clone.call(this),l=c.words=this.words.slice(0),g=l.length,u=0;u<g;u++)l[u]=l[u].clone();return c}})}(),t})}(Zs)),Zs.exports}var Xs={exports:{}},jn;function x0(){return jn||(jn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){if(typeof ArrayBuffer=="function"){var s=t,i=s.lib,n=i.WordArray,a=n.init,o=n.init=function(d){if(d instanceof ArrayBuffer&&(d=new Uint8Array(d)),(d instanceof Int8Array||typeof Uint8ClampedArray<"u"&&d instanceof Uint8ClampedArray||d instanceof Int16Array||d instanceof Uint16Array||d instanceof Int32Array||d instanceof Uint32Array||d instanceof Float32Array||d instanceof Float64Array)&&(d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength)),d instanceof Uint8Array){for(var c=d.byteLength,l=[],g=0;g<c;g++)l[g>>>2]|=d[g]<<24-g%4*8;a.call(this,l,c)}else a.apply(this,arguments)};o.prototype=n}}(),t.lib.WordArray})}(Xs)),Xs.exports}var Js={exports:{}},qn;function p0(){return qn||(qn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=s.enc;a.Utf16=a.Utf16BE={stringify:function(d){for(var c=d.words,l=d.sigBytes,g=[],u=0;u<l;u+=2){var y=c[u>>>2]>>>16-u%4*8&65535;g.push(String.fromCharCode(y))}return g.join("")},parse:function(d){for(var c=d.length,l=[],g=0;g<c;g++)l[g>>>1]|=d.charCodeAt(g)<<16-g%2*16;return n.create(l,c*2)}},a.Utf16LE={stringify:function(d){for(var c=d.words,l=d.sigBytes,g=[],u=0;u<l;u+=2){var y=o(c[u>>>2]>>>16-u%4*8&65535);g.push(String.fromCharCode(y))}return g.join("")},parse:function(d){for(var c=d.length,l=[],g=0;g<c;g++)l[g>>>1]|=o(d.charCodeAt(g)<<16-g%2*16);return n.create(l,c*2)}};function o(d){return d<<8&4278255360|d>>>8&16711935}}(),t.enc.Utf16})}(Js)),Js.exports}var Qs={exports:{}},Ln;function sr(){return Ln||(Ln=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=s.enc;a.Base64={stringify:function(d){var c=d.words,l=d.sigBytes,g=this._map;d.clamp();for(var u=[],y=0;y<l;y+=3)for(var w=c[y>>>2]>>>24-y%4*8&255,b=c[y+1>>>2]>>>24-(y+1)%4*8&255,C=c[y+2>>>2]>>>24-(y+2)%4*8&255,x=w<<16|b<<8|C,p=0;p<4&&y+p*.75<l;p++)u.push(g.charAt(x>>>6*(3-p)&63));var E=g.charAt(64);if(E)for(;u.length%4;)u.push(E);return u.join("")},parse:function(d){var c=d.length,l=this._map,g=this._reverseMap;if(!g){g=this._reverseMap=[];for(var u=0;u<l.length;u++)g[l.charCodeAt(u)]=u}var y=l.charAt(64);if(y){var w=d.indexOf(y);w!==-1&&(c=w)}return o(d,c,g)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function o(d,c,l){for(var g=[],u=0,y=0;y<c;y++)if(y%4){var w=l[d.charCodeAt(y-1)]<<y%4*2,b=l[d.charCodeAt(y)]>>>6-y%4*2,C=w|b;g[u>>>2]|=C<<24-u%4*8,u++}return n.create(g,u)}}(),t.enc.Base64})}(Qs)),Qs.exports}var ei={exports:{}},Un;function m0(){return Un||(Un=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=s.enc;a.Base64url={stringify:function(d,c){c===void 0&&(c=!0);var l=d.words,g=d.sigBytes,u=c?this._safe_map:this._map;d.clamp();for(var y=[],w=0;w<g;w+=3)for(var b=l[w>>>2]>>>24-w%4*8&255,C=l[w+1>>>2]>>>24-(w+1)%4*8&255,x=l[w+2>>>2]>>>24-(w+2)%4*8&255,p=b<<16|C<<8|x,E=0;E<4&&w+E*.75<g;E++)y.push(u.charAt(p>>>6*(3-E)&63));var _=u.charAt(64);if(_)for(;y.length%4;)y.push(_);return y.join("")},parse:function(d,c){c===void 0&&(c=!0);var l=d.length,g=c?this._safe_map:this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var y=0;y<g.length;y++)u[g.charCodeAt(y)]=y}var w=g.charAt(64);if(w){var b=d.indexOf(w);b!==-1&&(l=b)}return o(d,l,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function o(d,c,l){for(var g=[],u=0,y=0;y<c;y++)if(y%4){var w=l[d.charCodeAt(y-1)]<<y%4*2,b=l[d.charCodeAt(y)]>>>6-y%4*2,C=w|b;g[u>>>2]|=C<<24-u%4*8,u++}return n.create(g,u)}}(),t.enc.Base64url})}(ei)),ei.exports}var ti={exports:{}},Yn;function ir(){return Yn||(Yn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.WordArray,o=n.Hasher,d=i.algo,c=[];(function(){for(var b=0;b<64;b++)c[b]=s.abs(s.sin(b+1))*4294967296|0})();var l=d.MD5=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(b,C){for(var x=0;x<16;x++){var p=C+x,E=b[p];b[p]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}var _=this._hash.words,R=b[C+0],T=b[C+1],F=b[C+2],h=b[C+3],N=b[C+4],A=b[C+5],f=b[C+6],v=b[C+7],m=b[C+8],L=b[C+9],j=b[C+10],X=b[C+11],W=b[C+12],ie=b[C+13],he=b[C+14],ue=b[C+15],I=_[0],P=_[1],$=_[2],H=_[3];I=g(I,P,$,H,R,7,c[0]),H=g(H,I,P,$,T,12,c[1]),$=g($,H,I,P,F,17,c[2]),P=g(P,$,H,I,h,22,c[3]),I=g(I,P,$,H,N,7,c[4]),H=g(H,I,P,$,A,12,c[5]),$=g($,H,I,P,f,17,c[6]),P=g(P,$,H,I,v,22,c[7]),I=g(I,P,$,H,m,7,c[8]),H=g(H,I,P,$,L,12,c[9]),$=g($,H,I,P,j,17,c[10]),P=g(P,$,H,I,X,22,c[11]),I=g(I,P,$,H,W,7,c[12]),H=g(H,I,P,$,ie,12,c[13]),$=g($,H,I,P,he,17,c[14]),P=g(P,$,H,I,ue,22,c[15]),I=u(I,P,$,H,T,5,c[16]),H=u(H,I,P,$,f,9,c[17]),$=u($,H,I,P,X,14,c[18]),P=u(P,$,H,I,R,20,c[19]),I=u(I,P,$,H,A,5,c[20]),H=u(H,I,P,$,j,9,c[21]),$=u($,H,I,P,ue,14,c[22]),P=u(P,$,H,I,N,20,c[23]),I=u(I,P,$,H,L,5,c[24]),H=u(H,I,P,$,he,9,c[25]),$=u($,H,I,P,h,14,c[26]),P=u(P,$,H,I,m,20,c[27]),I=u(I,P,$,H,ie,5,c[28]),H=u(H,I,P,$,F,9,c[29]),$=u($,H,I,P,v,14,c[30]),P=u(P,$,H,I,W,20,c[31]),I=y(I,P,$,H,A,4,c[32]),H=y(H,I,P,$,m,11,c[33]),$=y($,H,I,P,X,16,c[34]),P=y(P,$,H,I,he,23,c[35]),I=y(I,P,$,H,T,4,c[36]),H=y(H,I,P,$,N,11,c[37]),$=y($,H,I,P,v,16,c[38]),P=y(P,$,H,I,j,23,c[39]),I=y(I,P,$,H,ie,4,c[40]),H=y(H,I,P,$,R,11,c[41]),$=y($,H,I,P,h,16,c[42]),P=y(P,$,H,I,f,23,c[43]),I=y(I,P,$,H,L,4,c[44]),H=y(H,I,P,$,W,11,c[45]),$=y($,H,I,P,ue,16,c[46]),P=y(P,$,H,I,F,23,c[47]),I=w(I,P,$,H,R,6,c[48]),H=w(H,I,P,$,v,10,c[49]),$=w($,H,I,P,he,15,c[50]),P=w(P,$,H,I,A,21,c[51]),I=w(I,P,$,H,W,6,c[52]),H=w(H,I,P,$,h,10,c[53]),$=w($,H,I,P,j,15,c[54]),P=w(P,$,H,I,T,21,c[55]),I=w(I,P,$,H,m,6,c[56]),H=w(H,I,P,$,ue,10,c[57]),$=w($,H,I,P,f,15,c[58]),P=w(P,$,H,I,ie,21,c[59]),I=w(I,P,$,H,N,6,c[60]),H=w(H,I,P,$,X,10,c[61]),$=w($,H,I,P,F,15,c[62]),P=w(P,$,H,I,L,21,c[63]),_[0]=_[0]+I|0,_[1]=_[1]+P|0,_[2]=_[2]+$|0,_[3]=_[3]+H|0},_doFinalize:function(){var b=this._data,C=b.words,x=this._nDataBytes*8,p=b.sigBytes*8;C[p>>>5]|=128<<24-p%32;var E=s.floor(x/4294967296),_=x;C[(p+64>>>9<<4)+15]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,C[(p+64>>>9<<4)+14]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,b.sigBytes=(C.length+1)*4,this._process();for(var R=this._hash,T=R.words,F=0;F<4;F++){var h=T[F];T[F]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360}return R},clone:function(){var b=o.clone.call(this);return b._hash=this._hash.clone(),b}});function g(b,C,x,p,E,_,R){var T=b+(C&x|~C&p)+E+R;return(T<<_|T>>>32-_)+C}function u(b,C,x,p,E,_,R){var T=b+(C&p|x&~p)+E+R;return(T<<_|T>>>32-_)+C}function y(b,C,x,p,E,_,R){var T=b+(C^x^p)+E+R;return(T<<_|T>>>32-_)+C}function w(b,C,x,p,E,_,R){var T=b+(x^(C|~p))+E+R;return(T<<_|T>>>32-_)+C}i.MD5=o._createHelper(l),i.HmacMD5=o._createHmacHelper(l)}(Math),t.MD5})}(ti)),ti.exports}var ri={exports:{}},Wn;function Gn(){return Wn||(Wn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=i.Hasher,o=s.algo,d=[],c=o.SHA1=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(l,g){for(var u=this._hash.words,y=u[0],w=u[1],b=u[2],C=u[3],x=u[4],p=0;p<80;p++){if(p<16)d[p]=l[g+p]|0;else{var E=d[p-3]^d[p-8]^d[p-14]^d[p-16];d[p]=E<<1|E>>>31}var _=(y<<5|y>>>27)+x+d[p];p<20?_+=(w&b|~w&C)+1518500249:p<40?_+=(w^b^C)+1859775393:p<60?_+=(w&b|w&C|b&C)-1894007588:_+=(w^b^C)-899497514,x=C,C=b,b=w<<30|w>>>2,w=y,y=_}u[0]=u[0]+y|0,u[1]=u[1]+w|0,u[2]=u[2]+b|0,u[3]=u[3]+C|0,u[4]=u[4]+x|0},_doFinalize:function(){var l=this._data,g=l.words,u=this._nDataBytes*8,y=l.sigBytes*8;return g[y>>>5]|=128<<24-y%32,g[(y+64>>>9<<4)+14]=Math.floor(u/4294967296),g[(y+64>>>9<<4)+15]=u,l.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var l=a.clone.call(this);return l._hash=this._hash.clone(),l}});s.SHA1=a._createHelper(c),s.HmacSHA1=a._createHmacHelper(c)}(),t.SHA1})}(ri)),ri.exports}var si={exports:{}},Vn;function ii(){return Vn||(Vn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.WordArray,o=n.Hasher,d=i.algo,c=[],l=[];(function(){function y(x){for(var p=s.sqrt(x),E=2;E<=p;E++)if(!(x%E))return!1;return!0}function w(x){return(x-(x|0))*4294967296|0}for(var b=2,C=0;C<64;)y(b)&&(C<8&&(c[C]=w(s.pow(b,1/2))),l[C]=w(s.pow(b,1/3)),C++),b++})();var g=[],u=d.SHA256=o.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(y,w){for(var b=this._hash.words,C=b[0],x=b[1],p=b[2],E=b[3],_=b[4],R=b[5],T=b[6],F=b[7],h=0;h<64;h++){if(h<16)g[h]=y[w+h]|0;else{var N=g[h-15],A=(N<<25|N>>>7)^(N<<14|N>>>18)^N>>>3,f=g[h-2],v=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;g[h]=A+g[h-7]+v+g[h-16]}var m=_&R^~_&T,L=C&x^C&p^x&p,j=(C<<30|C>>>2)^(C<<19|C>>>13)^(C<<10|C>>>22),X=(_<<26|_>>>6)^(_<<21|_>>>11)^(_<<7|_>>>25),W=F+X+m+l[h]+g[h],ie=j+L;F=T,T=R,R=_,_=E+W|0,E=p,p=x,x=C,C=W+ie|0}b[0]=b[0]+C|0,b[1]=b[1]+x|0,b[2]=b[2]+p|0,b[3]=b[3]+E|0,b[4]=b[4]+_|0,b[5]=b[5]+R|0,b[6]=b[6]+T|0,b[7]=b[7]+F|0},_doFinalize:function(){var y=this._data,w=y.words,b=this._nDataBytes*8,C=y.sigBytes*8;return w[C>>>5]|=128<<24-C%32,w[(C+64>>>9<<4)+14]=s.floor(b/4294967296),w[(C+64>>>9<<4)+15]=b,y.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var y=o.clone.call(this);return y._hash=this._hash.clone(),y}});i.SHA256=o._createHelper(u),i.HmacSHA256=o._createHmacHelper(u)}(Math),t.SHA256})}(si)),si.exports}var ni={exports:{}},zn;function v0(){return zn||(zn=1,function(r,e){(function(t,s,i){r.exports=s(oe(),ii())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=s.algo,o=a.SHA256,d=a.SHA224=o.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var c=o._doFinalize.call(this);return c.sigBytes-=4,c}});s.SHA224=o._createHelper(d),s.HmacSHA224=o._createHmacHelper(d)}(),t.SHA224})}(ni)),ni.exports}var ai={exports:{}},Kn;function Zn(){return Kn||(Kn=1,function(r,e){(function(t,s,i){r.exports=s(oe(),os())})(se,function(t){return function(){var s=t,i=s.lib,n=i.Hasher,a=s.x64,o=a.Word,d=a.WordArray,c=s.algo;function l(){return o.create.apply(o,arguments)}var g=[l(1116352408,3609767458),l(1899447441,602891725),l(3049323471,3964484399),l(3921009573,2173295548),l(961987163,4081628472),l(1508970993,3053834265),l(2453635748,2937671579),l(2870763221,3664609560),l(3624381080,2734883394),l(310598401,1164996542),l(607225278,1323610764),l(1426881987,3590304994),l(1925078388,4068182383),l(2162078206,991336113),l(2614888103,633803317),l(3248222580,3479774868),l(3835390401,2666613458),l(4022224774,944711139),l(264347078,2341262773),l(604807628,2007800933),l(770255983,1495990901),l(1249150122,1856431235),l(1555081692,3175218132),l(1996064986,2198950837),l(2554220882,3999719339),l(2821834349,766784016),l(2952996808,2566594879),l(3210313671,3203337956),l(3336571891,1034457026),l(3584528711,2466948901),l(113926993,3758326383),l(338241895,168717936),l(666307205,1188179964),l(773529912,1546045734),l(1294757372,1522805485),l(1396182291,2643833823),l(1695183700,2343527390),l(1986661051,1014477480),l(2177026350,1206759142),l(2456956037,344077627),l(2730485921,1290863460),l(2820302411,3158454273),l(3259730800,3505952657),l(3345764771,106217008),l(3516065817,3606008344),l(3600352804,1432725776),l(4094571909,1467031594),l(275423344,851169720),l(430227734,3100823752),l(506948616,1363258195),l(659060556,3750685593),l(883997877,3785050280),l(958139571,3318307427),l(1322822218,3812723403),l(1537002063,2003034995),l(1747873779,3602036899),l(1955562222,1575990012),l(2024104815,1125592928),l(2227730452,2716904306),l(2361852424,442776044),l(2428436474,593698344),l(2756734187,3733110249),l(3204031479,2999351573),l(3329325298,3815920427),l(3391569614,3928383900),l(3515267271,566280711),l(3940187606,3454069534),l(4118630271,4000239992),l(116418474,1914138554),l(174292421,2731055270),l(289380356,3203993006),l(460393269,320620315),l(685471733,587496836),l(852142971,1086792851),l(1017036298,365543100),l(1126000580,2618297676),l(1288033470,3409855158),l(1501505948,4234509866),l(1607167915,987167468),l(1816402316,1246189591)],u=[];(function(){for(var w=0;w<80;w++)u[w]=l()})();var y=c.SHA512=n.extend({_doReset:function(){this._hash=new d.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(w,b){for(var C=this._hash.words,x=C[0],p=C[1],E=C[2],_=C[3],R=C[4],T=C[5],F=C[6],h=C[7],N=x.high,A=x.low,f=p.high,v=p.low,m=E.high,L=E.low,j=_.high,X=_.low,W=R.high,ie=R.low,he=T.high,ue=T.low,I=F.high,P=F.low,$=h.high,H=h.low,we=N,pe=A,ke=f,q=v,K=m,Ee=L,ct=j,pt=X,Ue=W,Ne=ie,lt=he,Xe=ue,Tt=I,mt=P,vt=$,gr=H,rt=0;rt<80;rt++){var Ye,Rt,Fr=u[rt];if(rt<16)Rt=Fr.high=w[b+rt*2]|0,Ye=Fr.low=w[b+rt*2+1]|0;else{var es=u[rt-15],Lt=es.high,tr=es.low,Cn=(Lt>>>1|tr<<31)^(Lt>>>8|tr<<24)^Lt>>>7,ts=(tr>>>1|Lt<<31)^(tr>>>8|Lt<<24)^(tr>>>7|Lt<<25),rs=u[rt-2],rr=rs.high,xr=rs.low,_n=(rr>>>19|xr<<13)^(rr<<3|xr>>>29)^rr>>>6,Ns=(xr>>>19|rr<<13)^(xr<<3|rr>>>29)^(xr>>>6|rr<<26),Ms=u[rt-7],Dn=Ms.high,An=Ms.low,kr=u[rt-16],js=kr.high,Ut=kr.low;Ye=ts+An,Rt=Cn+Dn+(Ye>>>0<ts>>>0?1:0),Ye=Ye+Ns,Rt=Rt+_n+(Ye>>>0<Ns>>>0?1:0),Ye=Ye+Ut,Rt=Rt+js+(Ye>>>0<Ut>>>0?1:0),Fr.high=Rt,Fr.low=Ye}var ss=Ue&lt^~Ue&Tt,Br=Ne&Xe^~Ne&mt,qs=we&ke^we&K^ke&K,Sn=pe&q^pe&Ee^q&Ee,Ls=(we>>>28|pe<<4)^(we<<30|pe>>>2)^(we<<25|pe>>>7),Us=(pe>>>28|we<<4)^(pe<<30|we>>>2)^(pe<<25|we>>>7),Ys=(Ue>>>14|Ne<<18)^(Ue>>>18|Ne<<14)^(Ue<<23|Ne>>>9),Ws=(Ne>>>14|Ue<<18)^(Ne>>>18|Ue<<14)^(Ne<<23|Ue>>>9),Gs=g[rt],Tn=Gs.high,is=Gs.low,We=gr+Ws,Ft=vt+Ys+(We>>>0<gr>>>0?1:0),We=We+Br,Ft=Ft+ss+(We>>>0<Br>>>0?1:0),We=We+is,Ft=Ft+Tn+(We>>>0<is>>>0?1:0),We=We+Ye,Ft=Ft+Rt+(We>>>0<Ye>>>0?1:0),Vs=Us+Sn,Rn=Ls+qs+(Vs>>>0<Us>>>0?1:0);vt=Tt,gr=mt,Tt=lt,mt=Xe,lt=Ue,Xe=Ne,Ne=pt+We|0,Ue=ct+Ft+(Ne>>>0<pt>>>0?1:0)|0,ct=K,pt=Ee,K=ke,Ee=q,ke=we,q=pe,pe=We+Vs|0,we=Ft+Rn+(pe>>>0<We>>>0?1:0)|0}A=x.low=A+pe,x.high=N+we+(A>>>0<pe>>>0?1:0),v=p.low=v+q,p.high=f+ke+(v>>>0<q>>>0?1:0),L=E.low=L+Ee,E.high=m+K+(L>>>0<Ee>>>0?1:0),X=_.low=X+pt,_.high=j+ct+(X>>>0<pt>>>0?1:0),ie=R.low=ie+Ne,R.high=W+Ue+(ie>>>0<Ne>>>0?1:0),ue=T.low=ue+Xe,T.high=he+lt+(ue>>>0<Xe>>>0?1:0),P=F.low=P+mt,F.high=I+Tt+(P>>>0<mt>>>0?1:0),H=h.low=H+gr,h.high=$+vt+(H>>>0<gr>>>0?1:0)},_doFinalize:function(){var w=this._data,b=w.words,C=this._nDataBytes*8,x=w.sigBytes*8;b[x>>>5]|=128<<24-x%32,b[(x+128>>>10<<5)+30]=Math.floor(C/4294967296),b[(x+128>>>10<<5)+31]=C,w.sigBytes=b.length*4,this._process();var p=this._hash.toX32();return p},clone:function(){var w=n.clone.call(this);return w._hash=this._hash.clone(),w},blockSize:1024/32});s.SHA512=n._createHelper(y),s.HmacSHA512=n._createHmacHelper(y)}(),t.SHA512})}(ai)),ai.exports}var oi={exports:{}},Xn;function y0(){return Xn||(Xn=1,function(r,e){(function(t,s,i){r.exports=s(oe(),os(),Zn())})(se,function(t){return function(){var s=t,i=s.x64,n=i.Word,a=i.WordArray,o=s.algo,d=o.SHA512,c=o.SHA384=d.extend({_doReset:function(){this._hash=new a.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var l=d._doFinalize.call(this);return l.sigBytes-=16,l}});s.SHA384=d._createHelper(c),s.HmacSHA384=d._createHmacHelper(c)}(),t.SHA384})}(oi)),oi.exports}var ci={exports:{}},Jn;function w0(){return Jn||(Jn=1,function(r,e){(function(t,s,i){r.exports=s(oe(),os())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.WordArray,o=n.Hasher,d=i.x64,c=d.Word,l=i.algo,g=[],u=[],y=[];(function(){for(var C=1,x=0,p=0;p<24;p++){g[C+5*x]=(p+1)*(p+2)/2%64;var E=x%5,_=(2*C+3*x)%5;C=E,x=_}for(var C=0;C<5;C++)for(var x=0;x<5;x++)u[C+5*x]=x+(2*C+3*x)%5*5;for(var R=1,T=0;T<24;T++){for(var F=0,h=0,N=0;N<7;N++){if(R&1){var A=(1<<N)-1;A<32?h^=1<<A:F^=1<<A-32}R&128?R=R<<1^113:R<<=1}y[T]=c.create(F,h)}})();var w=[];(function(){for(var C=0;C<25;C++)w[C]=c.create()})();var b=l.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var C=this._state=[],x=0;x<25;x++)C[x]=new c.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(C,x){for(var p=this._state,E=this.blockSize/2,_=0;_<E;_++){var R=C[x+2*_],T=C[x+2*_+1];R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var F=p[_];F.high^=T,F.low^=R}for(var h=0;h<24;h++){for(var N=0;N<5;N++){for(var A=0,f=0,v=0;v<5;v++){var F=p[N+5*v];A^=F.high,f^=F.low}var m=w[N];m.high=A,m.low=f}for(var N=0;N<5;N++)for(var L=w[(N+4)%5],j=w[(N+1)%5],X=j.high,W=j.low,A=L.high^(X<<1|W>>>31),f=L.low^(W<<1|X>>>31),v=0;v<5;v++){var F=p[N+5*v];F.high^=A,F.low^=f}for(var ie=1;ie<25;ie++){var A,f,F=p[ie],he=F.high,ue=F.low,I=g[ie];I<32?(A=he<<I|ue>>>32-I,f=ue<<I|he>>>32-I):(A=ue<<I-32|he>>>64-I,f=he<<I-32|ue>>>64-I);var P=w[u[ie]];P.high=A,P.low=f}var $=w[0],H=p[0];$.high=H.high,$.low=H.low;for(var N=0;N<5;N++)for(var v=0;v<5;v++){var ie=N+5*v,F=p[ie],we=w[ie],pe=w[(N+1)%5+5*v],ke=w[(N+2)%5+5*v];F.high=we.high^~pe.high&ke.high,F.low=we.low^~pe.low&ke.low}var F=p[0],q=y[h];F.high^=q.high,F.low^=q.low}},_doFinalize:function(){var C=this._data,x=C.words;this._nDataBytes*8;var p=C.sigBytes*8,E=this.blockSize*32;x[p>>>5]|=1<<24-p%32,x[(s.ceil((p+1)/E)*E>>>5)-1]|=128,C.sigBytes=x.length*4,this._process();for(var _=this._state,R=this.cfg.outputLength/8,T=R/8,F=[],h=0;h<T;h++){var N=_[h],A=N.high,f=N.low;A=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,f=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,F.push(f),F.push(A)}return new a.init(F,R)},clone:function(){for(var C=o.clone.call(this),x=C._state=this._state.slice(0),p=0;p<25;p++)x[p]=x[p].clone();return C}});i.SHA3=o._createHelper(b),i.HmacSHA3=o._createHmacHelper(b)}(Math),t.SHA3})}(ci)),ci.exports}var li={exports:{}},Qn;function E0(){return Qn||(Qn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){/** @preserve
130
+ `,children:[F.jsx("span",{className:"text-[22px] font-medium text-gray-800 leading-none",children:e}),t?F.jsx("span",{className:"text-[9px] text-gray-400 font-semibold tracking-[0.18em] mt-1.5",children:t}):F.jsx("span",{className:"h-3.5"})]},e))});class o0{constructor(){this.listeners={}}on(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.off(e,t)}off(e,t){this.listeners[e]&&(this.listeners[e]=this.listeners[e].filter(s=>s!==t))}emitLocal(e,t){this.listeners[e]&&this.listeners[e].forEach(s=>{try{s(t)}catch(i){console.error(`Error in event listener for ${e}:`,i)}})}emitToParent(e,t){this.emitLocal(e,t)}}const Z=new o0;var $n={exports:{}};function c0(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ks={exports:{}};const l0=Yo(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var On;function oe(){return On||(On=1,function(r,e){(function(t,s){r.exports=s()})(se,function(){var t=t||function(s,i){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof se<"u"&&se.crypto&&(n=se.crypto),!n&&typeof c0=="function")try{n=l0}catch{}var a=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function p(){}return function(E){var _;return p.prototype=E,_=new p,p.prototype=null,_}}(),d={},c=d.lib={},l=c.Base=function(){return{extend:function(p){var E=o(this);return p&&E.mixIn(p),(!E.hasOwnProperty("init")||this.init===E.init)&&(E.init=function(){E.$super.init.apply(this,arguments)}),E.init.prototype=E,E.$super=this,E},create:function(){var p=this.extend();return p.init.apply(p,arguments),p},init:function(){},mixIn:function(p){for(var E in p)p.hasOwnProperty(E)&&(this[E]=p[E]);p.hasOwnProperty("toString")&&(this.toString=p.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=c.WordArray=l.extend({init:function(p,E){p=this.words=p||[],E!=i?this.sigBytes=E:this.sigBytes=p.length*4},toString:function(p){return(p||y).stringify(this)},concat:function(p){var E=this.words,_=p.words,T=this.sigBytes,S=p.sigBytes;if(this.clamp(),T%4)for(var R=0;R<S;R++){var h=_[R>>>2]>>>24-R%4*8&255;E[T+R>>>2]|=h<<24-(T+R)%4*8}else for(var N=0;N<S;N+=4)E[T+N>>>2]=_[N>>>2];return this.sigBytes+=S,this},clamp:function(){var p=this.words,E=this.sigBytes;p[E>>>2]&=4294967295<<32-E%4*8,p.length=s.ceil(E/4)},clone:function(){var p=l.clone.call(this);return p.words=this.words.slice(0),p},random:function(p){for(var E=[],_=0;_<p;_+=4)E.push(a());return new g.init(E,p)}}),u=d.enc={},y=u.Hex={stringify:function(p){for(var E=p.words,_=p.sigBytes,T=[],S=0;S<_;S++){var R=E[S>>>2]>>>24-S%4*8&255;T.push((R>>>4).toString(16)),T.push((R&15).toString(16))}return T.join("")},parse:function(p){for(var E=p.length,_=[],T=0;T<E;T+=2)_[T>>>3]|=parseInt(p.substr(T,2),16)<<24-T%8*4;return new g.init(_,E/2)}},w=u.Latin1={stringify:function(p){for(var E=p.words,_=p.sigBytes,T=[],S=0;S<_;S++){var R=E[S>>>2]>>>24-S%4*8&255;T.push(String.fromCharCode(R))}return T.join("")},parse:function(p){for(var E=p.length,_=[],T=0;T<E;T++)_[T>>>2]|=(p.charCodeAt(T)&255)<<24-T%4*8;return new g.init(_,E)}},b=u.Utf8={stringify:function(p){try{return decodeURIComponent(escape(w.stringify(p)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(p){return w.parse(unescape(encodeURIComponent(p)))}},C=c.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(p){typeof p=="string"&&(p=b.parse(p)),this._data.concat(p),this._nDataBytes+=p.sigBytes},_process:function(p){var E,_=this._data,T=_.words,S=_.sigBytes,R=this.blockSize,h=R*4,N=S/h;p?N=s.ceil(N):N=s.max((N|0)-this._minBufferSize,0);var A=N*R,f=s.min(A*4,S);if(A){for(var v=0;v<A;v+=R)this._doProcessBlock(T,v);E=T.splice(0,A),_.sigBytes-=f}return new g.init(E,f)},clone:function(){var p=l.clone.call(this);return p._data=this._data.clone(),p},_minBufferSize:0});c.Hasher=C.extend({cfg:l.extend(),init:function(p){this.cfg=this.cfg.extend(p),this.reset()},reset:function(){C.reset.call(this),this._doReset()},update:function(p){return this._append(p),this._process(),this},finalize:function(p){p&&this._append(p);var E=this._doFinalize();return E},blockSize:16,_createHelper:function(p){return function(E,_){return new p.init(_).finalize(E)}},_createHmacHelper:function(p){return function(E,_){return new x.HMAC.init(p,_).finalize(E)}}});var x=d.algo={};return d}(Math);return t})}(Ks)),Ks.exports}var Zs={exports:{}},Nn;function os(){return Nn||(Nn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.Base,o=n.WordArray,d=i.x64={};d.Word=a.extend({init:function(c,l){this.high=c,this.low=l}}),d.WordArray=a.extend({init:function(c,l){c=this.words=c||[],l!=s?this.sigBytes=l:this.sigBytes=c.length*8},toX32:function(){for(var c=this.words,l=c.length,g=[],u=0;u<l;u++){var y=c[u];g.push(y.high),g.push(y.low)}return o.create(g,this.sigBytes)},clone:function(){for(var c=a.clone.call(this),l=c.words=this.words.slice(0),g=l.length,u=0;u<g;u++)l[u]=l[u].clone();return c}})}(),t})}(Zs)),Zs.exports}var Xs={exports:{}},Mn;function d0(){return Mn||(Mn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){if(typeof ArrayBuffer=="function"){var s=t,i=s.lib,n=i.WordArray,a=n.init,o=n.init=function(d){if(d instanceof ArrayBuffer&&(d=new Uint8Array(d)),(d instanceof Int8Array||typeof Uint8ClampedArray<"u"&&d instanceof Uint8ClampedArray||d instanceof Int16Array||d instanceof Uint16Array||d instanceof Int32Array||d instanceof Uint32Array||d instanceof Float32Array||d instanceof Float64Array)&&(d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength)),d instanceof Uint8Array){for(var c=d.byteLength,l=[],g=0;g<c;g++)l[g>>>2]|=d[g]<<24-g%4*8;a.call(this,l,c)}else a.apply(this,arguments)};o.prototype=n}}(),t.lib.WordArray})}(Xs)),Xs.exports}var Js={exports:{}},qn;function h0(){return qn||(qn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=s.enc;a.Utf16=a.Utf16BE={stringify:function(d){for(var c=d.words,l=d.sigBytes,g=[],u=0;u<l;u+=2){var y=c[u>>>2]>>>16-u%4*8&65535;g.push(String.fromCharCode(y))}return g.join("")},parse:function(d){for(var c=d.length,l=[],g=0;g<c;g++)l[g>>>1]|=d.charCodeAt(g)<<16-g%2*16;return n.create(l,c*2)}},a.Utf16LE={stringify:function(d){for(var c=d.words,l=d.sigBytes,g=[],u=0;u<l;u+=2){var y=o(c[u>>>2]>>>16-u%4*8&65535);g.push(String.fromCharCode(y))}return g.join("")},parse:function(d){for(var c=d.length,l=[],g=0;g<c;g++)l[g>>>1]|=o(d.charCodeAt(g)<<16-g%2*16);return n.create(l,c*2)}};function o(d){return d<<8&4278255360|d>>>8&16711935}}(),t.enc.Utf16})}(Js)),Js.exports}var Qs={exports:{}},jn;function sr(){return jn||(jn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=s.enc;a.Base64={stringify:function(d){var c=d.words,l=d.sigBytes,g=this._map;d.clamp();for(var u=[],y=0;y<l;y+=3)for(var w=c[y>>>2]>>>24-y%4*8&255,b=c[y+1>>>2]>>>24-(y+1)%4*8&255,C=c[y+2>>>2]>>>24-(y+2)%4*8&255,x=w<<16|b<<8|C,p=0;p<4&&y+p*.75<l;p++)u.push(g.charAt(x>>>6*(3-p)&63));var E=g.charAt(64);if(E)for(;u.length%4;)u.push(E);return u.join("")},parse:function(d){var c=d.length,l=this._map,g=this._reverseMap;if(!g){g=this._reverseMap=[];for(var u=0;u<l.length;u++)g[l.charCodeAt(u)]=u}var y=l.charAt(64);if(y){var w=d.indexOf(y);w!==-1&&(c=w)}return o(d,c,g)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function o(d,c,l){for(var g=[],u=0,y=0;y<c;y++)if(y%4){var w=l[d.charCodeAt(y-1)]<<y%4*2,b=l[d.charCodeAt(y)]>>>6-y%4*2,C=w|b;g[u>>>2]|=C<<24-u%4*8,u++}return n.create(g,u)}}(),t.enc.Base64})}(Qs)),Qs.exports}var ei={exports:{}},Un;function u0(){return Un||(Un=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=s.enc;a.Base64url={stringify:function(d,c){c===void 0&&(c=!0);var l=d.words,g=d.sigBytes,u=c?this._safe_map:this._map;d.clamp();for(var y=[],w=0;w<g;w+=3)for(var b=l[w>>>2]>>>24-w%4*8&255,C=l[w+1>>>2]>>>24-(w+1)%4*8&255,x=l[w+2>>>2]>>>24-(w+2)%4*8&255,p=b<<16|C<<8|x,E=0;E<4&&w+E*.75<g;E++)y.push(u.charAt(p>>>6*(3-E)&63));var _=u.charAt(64);if(_)for(;y.length%4;)y.push(_);return y.join("")},parse:function(d,c){c===void 0&&(c=!0);var l=d.length,g=c?this._safe_map:this._map,u=this._reverseMap;if(!u){u=this._reverseMap=[];for(var y=0;y<g.length;y++)u[g.charCodeAt(y)]=y}var w=g.charAt(64);if(w){var b=d.indexOf(w);b!==-1&&(l=b)}return o(d,l,u)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function o(d,c,l){for(var g=[],u=0,y=0;y<c;y++)if(y%4){var w=l[d.charCodeAt(y-1)]<<y%4*2,b=l[d.charCodeAt(y)]>>>6-y%4*2,C=w|b;g[u>>>2]|=C<<24-u%4*8,u++}return n.create(g,u)}}(),t.enc.Base64url})}(ei)),ei.exports}var ti={exports:{}},Ln;function ir(){return Ln||(Ln=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.WordArray,o=n.Hasher,d=i.algo,c=[];(function(){for(var b=0;b<64;b++)c[b]=s.abs(s.sin(b+1))*4294967296|0})();var l=d.MD5=o.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(b,C){for(var x=0;x<16;x++){var p=C+x,E=b[p];b[p]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360}var _=this._hash.words,T=b[C+0],S=b[C+1],R=b[C+2],h=b[C+3],N=b[C+4],A=b[C+5],f=b[C+6],v=b[C+7],m=b[C+8],U=b[C+9],q=b[C+10],X=b[C+11],W=b[C+12],ie=b[C+13],he=b[C+14],ue=b[C+15],I=_[0],P=_[1],$=_[2],H=_[3];I=g(I,P,$,H,T,7,c[0]),H=g(H,I,P,$,S,12,c[1]),$=g($,H,I,P,R,17,c[2]),P=g(P,$,H,I,h,22,c[3]),I=g(I,P,$,H,N,7,c[4]),H=g(H,I,P,$,A,12,c[5]),$=g($,H,I,P,f,17,c[6]),P=g(P,$,H,I,v,22,c[7]),I=g(I,P,$,H,m,7,c[8]),H=g(H,I,P,$,U,12,c[9]),$=g($,H,I,P,q,17,c[10]),P=g(P,$,H,I,X,22,c[11]),I=g(I,P,$,H,W,7,c[12]),H=g(H,I,P,$,ie,12,c[13]),$=g($,H,I,P,he,17,c[14]),P=g(P,$,H,I,ue,22,c[15]),I=u(I,P,$,H,S,5,c[16]),H=u(H,I,P,$,f,9,c[17]),$=u($,H,I,P,X,14,c[18]),P=u(P,$,H,I,T,20,c[19]),I=u(I,P,$,H,A,5,c[20]),H=u(H,I,P,$,q,9,c[21]),$=u($,H,I,P,ue,14,c[22]),P=u(P,$,H,I,N,20,c[23]),I=u(I,P,$,H,U,5,c[24]),H=u(H,I,P,$,he,9,c[25]),$=u($,H,I,P,h,14,c[26]),P=u(P,$,H,I,m,20,c[27]),I=u(I,P,$,H,ie,5,c[28]),H=u(H,I,P,$,R,9,c[29]),$=u($,H,I,P,v,14,c[30]),P=u(P,$,H,I,W,20,c[31]),I=y(I,P,$,H,A,4,c[32]),H=y(H,I,P,$,m,11,c[33]),$=y($,H,I,P,X,16,c[34]),P=y(P,$,H,I,he,23,c[35]),I=y(I,P,$,H,S,4,c[36]),H=y(H,I,P,$,N,11,c[37]),$=y($,H,I,P,v,16,c[38]),P=y(P,$,H,I,q,23,c[39]),I=y(I,P,$,H,ie,4,c[40]),H=y(H,I,P,$,T,11,c[41]),$=y($,H,I,P,h,16,c[42]),P=y(P,$,H,I,f,23,c[43]),I=y(I,P,$,H,U,4,c[44]),H=y(H,I,P,$,W,11,c[45]),$=y($,H,I,P,ue,16,c[46]),P=y(P,$,H,I,R,23,c[47]),I=w(I,P,$,H,T,6,c[48]),H=w(H,I,P,$,v,10,c[49]),$=w($,H,I,P,he,15,c[50]),P=w(P,$,H,I,A,21,c[51]),I=w(I,P,$,H,W,6,c[52]),H=w(H,I,P,$,h,10,c[53]),$=w($,H,I,P,q,15,c[54]),P=w(P,$,H,I,S,21,c[55]),I=w(I,P,$,H,m,6,c[56]),H=w(H,I,P,$,ue,10,c[57]),$=w($,H,I,P,f,15,c[58]),P=w(P,$,H,I,ie,21,c[59]),I=w(I,P,$,H,N,6,c[60]),H=w(H,I,P,$,X,10,c[61]),$=w($,H,I,P,R,15,c[62]),P=w(P,$,H,I,U,21,c[63]),_[0]=_[0]+I|0,_[1]=_[1]+P|0,_[2]=_[2]+$|0,_[3]=_[3]+H|0},_doFinalize:function(){var b=this._data,C=b.words,x=this._nDataBytes*8,p=b.sigBytes*8;C[p>>>5]|=128<<24-p%32;var E=s.floor(x/4294967296),_=x;C[(p+64>>>9<<4)+15]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,C[(p+64>>>9<<4)+14]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360,b.sigBytes=(C.length+1)*4,this._process();for(var T=this._hash,S=T.words,R=0;R<4;R++){var h=S[R];S[R]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360}return T},clone:function(){var b=o.clone.call(this);return b._hash=this._hash.clone(),b}});function g(b,C,x,p,E,_,T){var S=b+(C&x|~C&p)+E+T;return(S<<_|S>>>32-_)+C}function u(b,C,x,p,E,_,T){var S=b+(C&p|x&~p)+E+T;return(S<<_|S>>>32-_)+C}function y(b,C,x,p,E,_,T){var S=b+(C^x^p)+E+T;return(S<<_|S>>>32-_)+C}function w(b,C,x,p,E,_,T){var S=b+(x^(C|~p))+E+T;return(S<<_|S>>>32-_)+C}i.MD5=o._createHelper(l),i.HmacMD5=o._createHmacHelper(l)}(Math),t.MD5})}(ti)),ti.exports}var ri={exports:{}},Yn;function Wn(){return Yn||(Yn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=i.Hasher,o=s.algo,d=[],c=o.SHA1=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(l,g){for(var u=this._hash.words,y=u[0],w=u[1],b=u[2],C=u[3],x=u[4],p=0;p<80;p++){if(p<16)d[p]=l[g+p]|0;else{var E=d[p-3]^d[p-8]^d[p-14]^d[p-16];d[p]=E<<1|E>>>31}var _=(y<<5|y>>>27)+x+d[p];p<20?_+=(w&b|~w&C)+1518500249:p<40?_+=(w^b^C)+1859775393:p<60?_+=(w&b|w&C|b&C)-1894007588:_+=(w^b^C)-899497514,x=C,C=b,b=w<<30|w>>>2,w=y,y=_}u[0]=u[0]+y|0,u[1]=u[1]+w|0,u[2]=u[2]+b|0,u[3]=u[3]+C|0,u[4]=u[4]+x|0},_doFinalize:function(){var l=this._data,g=l.words,u=this._nDataBytes*8,y=l.sigBytes*8;return g[y>>>5]|=128<<24-y%32,g[(y+64>>>9<<4)+14]=Math.floor(u/4294967296),g[(y+64>>>9<<4)+15]=u,l.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var l=a.clone.call(this);return l._hash=this._hash.clone(),l}});s.SHA1=a._createHelper(c),s.HmacSHA1=a._createHmacHelper(c)}(),t.SHA1})}(ri)),ri.exports}var si={exports:{}},Gn;function ii(){return Gn||(Gn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.WordArray,o=n.Hasher,d=i.algo,c=[],l=[];(function(){function y(x){for(var p=s.sqrt(x),E=2;E<=p;E++)if(!(x%E))return!1;return!0}function w(x){return(x-(x|0))*4294967296|0}for(var b=2,C=0;C<64;)y(b)&&(C<8&&(c[C]=w(s.pow(b,1/2))),l[C]=w(s.pow(b,1/3)),C++),b++})();var g=[],u=d.SHA256=o.extend({_doReset:function(){this._hash=new a.init(c.slice(0))},_doProcessBlock:function(y,w){for(var b=this._hash.words,C=b[0],x=b[1],p=b[2],E=b[3],_=b[4],T=b[5],S=b[6],R=b[7],h=0;h<64;h++){if(h<16)g[h]=y[w+h]|0;else{var N=g[h-15],A=(N<<25|N>>>7)^(N<<14|N>>>18)^N>>>3,f=g[h-2],v=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;g[h]=A+g[h-7]+v+g[h-16]}var m=_&T^~_&S,U=C&x^C&p^x&p,q=(C<<30|C>>>2)^(C<<19|C>>>13)^(C<<10|C>>>22),X=(_<<26|_>>>6)^(_<<21|_>>>11)^(_<<7|_>>>25),W=R+X+m+l[h]+g[h],ie=q+U;R=S,S=T,T=_,_=E+W|0,E=p,p=x,x=C,C=W+ie|0}b[0]=b[0]+C|0,b[1]=b[1]+x|0,b[2]=b[2]+p|0,b[3]=b[3]+E|0,b[4]=b[4]+_|0,b[5]=b[5]+T|0,b[6]=b[6]+S|0,b[7]=b[7]+R|0},_doFinalize:function(){var y=this._data,w=y.words,b=this._nDataBytes*8,C=y.sigBytes*8;return w[C>>>5]|=128<<24-C%32,w[(C+64>>>9<<4)+14]=s.floor(b/4294967296),w[(C+64>>>9<<4)+15]=b,y.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var y=o.clone.call(this);return y._hash=this._hash.clone(),y}});i.SHA256=o._createHelper(u),i.HmacSHA256=o._createHmacHelper(u)}(Math),t.SHA256})}(si)),si.exports}var ni={exports:{}},Vn;function f0(){return Vn||(Vn=1,function(r,e){(function(t,s,i){r.exports=s(oe(),ii())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=s.algo,o=a.SHA256,d=a.SHA224=o.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var c=o._doFinalize.call(this);return c.sigBytes-=4,c}});s.SHA224=o._createHelper(d),s.HmacSHA224=o._createHmacHelper(d)}(),t.SHA224})}(ni)),ni.exports}var ai={exports:{}},zn;function Kn(){return zn||(zn=1,function(r,e){(function(t,s,i){r.exports=s(oe(),os())})(se,function(t){return function(){var s=t,i=s.lib,n=i.Hasher,a=s.x64,o=a.Word,d=a.WordArray,c=s.algo;function l(){return o.create.apply(o,arguments)}var g=[l(1116352408,3609767458),l(1899447441,602891725),l(3049323471,3964484399),l(3921009573,2173295548),l(961987163,4081628472),l(1508970993,3053834265),l(2453635748,2937671579),l(2870763221,3664609560),l(3624381080,2734883394),l(310598401,1164996542),l(607225278,1323610764),l(1426881987,3590304994),l(1925078388,4068182383),l(2162078206,991336113),l(2614888103,633803317),l(3248222580,3479774868),l(3835390401,2666613458),l(4022224774,944711139),l(264347078,2341262773),l(604807628,2007800933),l(770255983,1495990901),l(1249150122,1856431235),l(1555081692,3175218132),l(1996064986,2198950837),l(2554220882,3999719339),l(2821834349,766784016),l(2952996808,2566594879),l(3210313671,3203337956),l(3336571891,1034457026),l(3584528711,2466948901),l(113926993,3758326383),l(338241895,168717936),l(666307205,1188179964),l(773529912,1546045734),l(1294757372,1522805485),l(1396182291,2643833823),l(1695183700,2343527390),l(1986661051,1014477480),l(2177026350,1206759142),l(2456956037,344077627),l(2730485921,1290863460),l(2820302411,3158454273),l(3259730800,3505952657),l(3345764771,106217008),l(3516065817,3606008344),l(3600352804,1432725776),l(4094571909,1467031594),l(275423344,851169720),l(430227734,3100823752),l(506948616,1363258195),l(659060556,3750685593),l(883997877,3785050280),l(958139571,3318307427),l(1322822218,3812723403),l(1537002063,2003034995),l(1747873779,3602036899),l(1955562222,1575990012),l(2024104815,1125592928),l(2227730452,2716904306),l(2361852424,442776044),l(2428436474,593698344),l(2756734187,3733110249),l(3204031479,2999351573),l(3329325298,3815920427),l(3391569614,3928383900),l(3515267271,566280711),l(3940187606,3454069534),l(4118630271,4000239992),l(116418474,1914138554),l(174292421,2731055270),l(289380356,3203993006),l(460393269,320620315),l(685471733,587496836),l(852142971,1086792851),l(1017036298,365543100),l(1126000580,2618297676),l(1288033470,3409855158),l(1501505948,4234509866),l(1607167915,987167468),l(1816402316,1246189591)],u=[];(function(){for(var w=0;w<80;w++)u[w]=l()})();var y=c.SHA512=n.extend({_doReset:function(){this._hash=new d.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(w,b){for(var C=this._hash.words,x=C[0],p=C[1],E=C[2],_=C[3],T=C[4],S=C[5],R=C[6],h=C[7],N=x.high,A=x.low,f=p.high,v=p.low,m=E.high,U=E.low,q=_.high,X=_.low,W=T.high,ie=T.low,he=S.high,ue=S.low,I=R.high,P=R.low,$=h.high,H=h.low,we=N,pe=A,ke=f,j=v,K=m,Ee=U,ct=q,pt=X,Le=W,Ne=ie,lt=he,Xe=ue,Tt=I,mt=P,vt=$,gr=H,rt=0;rt<80;rt++){var Ye,Rt,Fr=u[rt];if(rt<16)Rt=Fr.high=w[b+rt*2]|0,Ye=Fr.low=w[b+rt*2+1]|0;else{var es=u[rt-15],Ut=es.high,tr=es.low,bn=(Ut>>>1|tr<<31)^(Ut>>>8|tr<<24)^Ut>>>7,ts=(tr>>>1|Ut<<31)^(tr>>>8|Ut<<24)^(tr>>>7|Ut<<25),rs=u[rt-2],rr=rs.high,xr=rs.low,Cn=(rr>>>19|xr<<13)^(rr<<3|xr>>>29)^rr>>>6,Ns=(xr>>>19|rr<<13)^(xr<<3|rr>>>29)^(xr>>>6|rr<<26),Ms=u[rt-7],_n=Ms.high,Dn=Ms.low,kr=u[rt-16],qs=kr.high,Lt=kr.low;Ye=ts+Dn,Rt=bn+_n+(Ye>>>0<ts>>>0?1:0),Ye=Ye+Ns,Rt=Rt+Cn+(Ye>>>0<Ns>>>0?1:0),Ye=Ye+Lt,Rt=Rt+qs+(Ye>>>0<Lt>>>0?1:0),Fr.high=Rt,Fr.low=Ye}var ss=Le&lt^~Le&Tt,Br=Ne&Xe^~Ne&mt,js=we&ke^we&K^ke&K,An=pe&j^pe&Ee^j&Ee,Us=(we>>>28|pe<<4)^(we<<30|pe>>>2)^(we<<25|pe>>>7),Ls=(pe>>>28|we<<4)^(pe<<30|we>>>2)^(pe<<25|we>>>7),Ys=(Le>>>14|Ne<<18)^(Le>>>18|Ne<<14)^(Le<<23|Ne>>>9),Ws=(Ne>>>14|Le<<18)^(Ne>>>18|Le<<14)^(Ne<<23|Le>>>9),Gs=g[rt],Sn=Gs.high,is=Gs.low,We=gr+Ws,Ft=vt+Ys+(We>>>0<gr>>>0?1:0),We=We+Br,Ft=Ft+ss+(We>>>0<Br>>>0?1:0),We=We+is,Ft=Ft+Sn+(We>>>0<is>>>0?1:0),We=We+Ye,Ft=Ft+Rt+(We>>>0<Ye>>>0?1:0),Vs=Ls+An,Tn=Us+js+(Vs>>>0<Ls>>>0?1:0);vt=Tt,gr=mt,Tt=lt,mt=Xe,lt=Le,Xe=Ne,Ne=pt+We|0,Le=ct+Ft+(Ne>>>0<pt>>>0?1:0)|0,ct=K,pt=Ee,K=ke,Ee=j,ke=we,j=pe,pe=We+Vs|0,we=Ft+Tn+(pe>>>0<We>>>0?1:0)|0}A=x.low=A+pe,x.high=N+we+(A>>>0<pe>>>0?1:0),v=p.low=v+j,p.high=f+ke+(v>>>0<j>>>0?1:0),U=E.low=U+Ee,E.high=m+K+(U>>>0<Ee>>>0?1:0),X=_.low=X+pt,_.high=q+ct+(X>>>0<pt>>>0?1:0),ie=T.low=ie+Ne,T.high=W+Le+(ie>>>0<Ne>>>0?1:0),ue=S.low=ue+Xe,S.high=he+lt+(ue>>>0<Xe>>>0?1:0),P=R.low=P+mt,R.high=I+Tt+(P>>>0<mt>>>0?1:0),H=h.low=H+gr,h.high=$+vt+(H>>>0<gr>>>0?1:0)},_doFinalize:function(){var w=this._data,b=w.words,C=this._nDataBytes*8,x=w.sigBytes*8;b[x>>>5]|=128<<24-x%32,b[(x+128>>>10<<5)+30]=Math.floor(C/4294967296),b[(x+128>>>10<<5)+31]=C,w.sigBytes=b.length*4,this._process();var p=this._hash.toX32();return p},clone:function(){var w=n.clone.call(this);return w._hash=this._hash.clone(),w},blockSize:1024/32});s.SHA512=n._createHelper(y),s.HmacSHA512=n._createHmacHelper(y)}(),t.SHA512})}(ai)),ai.exports}var oi={exports:{}},Zn;function g0(){return Zn||(Zn=1,function(r,e){(function(t,s,i){r.exports=s(oe(),os(),Kn())})(se,function(t){return function(){var s=t,i=s.x64,n=i.Word,a=i.WordArray,o=s.algo,d=o.SHA512,c=o.SHA384=d.extend({_doReset:function(){this._hash=new a.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var l=d._doFinalize.call(this);return l.sigBytes-=16,l}});s.SHA384=d._createHelper(c),s.HmacSHA384=d._createHmacHelper(c)}(),t.SHA384})}(oi)),oi.exports}var ci={exports:{}},Xn;function x0(){return Xn||(Xn=1,function(r,e){(function(t,s,i){r.exports=s(oe(),os())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.WordArray,o=n.Hasher,d=i.x64,c=d.Word,l=i.algo,g=[],u=[],y=[];(function(){for(var C=1,x=0,p=0;p<24;p++){g[C+5*x]=(p+1)*(p+2)/2%64;var E=x%5,_=(2*C+3*x)%5;C=E,x=_}for(var C=0;C<5;C++)for(var x=0;x<5;x++)u[C+5*x]=x+(2*C+3*x)%5*5;for(var T=1,S=0;S<24;S++){for(var R=0,h=0,N=0;N<7;N++){if(T&1){var A=(1<<N)-1;A<32?h^=1<<A:R^=1<<A-32}T&128?T=T<<1^113:T<<=1}y[S]=c.create(R,h)}})();var w=[];(function(){for(var C=0;C<25;C++)w[C]=c.create()})();var b=l.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var C=this._state=[],x=0;x<25;x++)C[x]=new c.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(C,x){for(var p=this._state,E=this.blockSize/2,_=0;_<E;_++){var T=C[x+2*_],S=C[x+2*_+1];T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360;var R=p[_];R.high^=S,R.low^=T}for(var h=0;h<24;h++){for(var N=0;N<5;N++){for(var A=0,f=0,v=0;v<5;v++){var R=p[N+5*v];A^=R.high,f^=R.low}var m=w[N];m.high=A,m.low=f}for(var N=0;N<5;N++)for(var U=w[(N+4)%5],q=w[(N+1)%5],X=q.high,W=q.low,A=U.high^(X<<1|W>>>31),f=U.low^(W<<1|X>>>31),v=0;v<5;v++){var R=p[N+5*v];R.high^=A,R.low^=f}for(var ie=1;ie<25;ie++){var A,f,R=p[ie],he=R.high,ue=R.low,I=g[ie];I<32?(A=he<<I|ue>>>32-I,f=ue<<I|he>>>32-I):(A=ue<<I-32|he>>>64-I,f=he<<I-32|ue>>>64-I);var P=w[u[ie]];P.high=A,P.low=f}var $=w[0],H=p[0];$.high=H.high,$.low=H.low;for(var N=0;N<5;N++)for(var v=0;v<5;v++){var ie=N+5*v,R=p[ie],we=w[ie],pe=w[(N+1)%5+5*v],ke=w[(N+2)%5+5*v];R.high=we.high^~pe.high&ke.high,R.low=we.low^~pe.low&ke.low}var R=p[0],j=y[h];R.high^=j.high,R.low^=j.low}},_doFinalize:function(){var C=this._data,x=C.words;this._nDataBytes*8;var p=C.sigBytes*8,E=this.blockSize*32;x[p>>>5]|=1<<24-p%32,x[(s.ceil((p+1)/E)*E>>>5)-1]|=128,C.sigBytes=x.length*4,this._process();for(var _=this._state,T=this.cfg.outputLength/8,S=T/8,R=[],h=0;h<S;h++){var N=_[h],A=N.high,f=N.low;A=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360,f=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360,R.push(f),R.push(A)}return new a.init(R,T)},clone:function(){for(var C=o.clone.call(this),x=C._state=this._state.slice(0),p=0;p<25;p++)x[p]=x[p].clone();return C}});i.SHA3=o._createHelper(b),i.HmacSHA3=o._createHmacHelper(b)}(Math),t.SHA3})}(ci)),ci.exports}var li={exports:{}},Jn;function p0(){return Jn||(Jn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){/** @preserve
131
131
  (c) 2012 by Cédric Mesnil. All rights reserved.
132
132
 
133
133
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -136,11 +136,11 @@ React keys must be passed directly to JSX without using spread:
136
136
  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
137
137
 
138
138
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
139
- */return function(s){var i=t,n=i.lib,a=n.WordArray,o=n.Hasher,d=i.algo,c=a.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=a.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),g=a.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=a.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),y=a.create([0,1518500249,1859775393,2400959708,2840853838]),w=a.create([1352829926,1548603684,1836072691,2053994217,0]),b=d.RIPEMD160=o.extend({_doReset:function(){this._hash=a.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(T,F){for(var h=0;h<16;h++){var N=F+h,A=T[N];T[N]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var f=this._hash.words,v=y.words,m=w.words,L=c.words,j=l.words,X=g.words,W=u.words,ie,he,ue,I,P,$,H,we,pe,ke;$=ie=f[0],H=he=f[1],we=ue=f[2],pe=I=f[3],ke=P=f[4];for(var q,h=0;h<80;h+=1)q=ie+T[F+L[h]]|0,h<16?q+=C(he,ue,I)+v[0]:h<32?q+=x(he,ue,I)+v[1]:h<48?q+=p(he,ue,I)+v[2]:h<64?q+=E(he,ue,I)+v[3]:q+=_(he,ue,I)+v[4],q=q|0,q=R(q,X[h]),q=q+P|0,ie=P,P=I,I=R(ue,10),ue=he,he=q,q=$+T[F+j[h]]|0,h<16?q+=_(H,we,pe)+m[0]:h<32?q+=E(H,we,pe)+m[1]:h<48?q+=p(H,we,pe)+m[2]:h<64?q+=x(H,we,pe)+m[3]:q+=C(H,we,pe)+m[4],q=q|0,q=R(q,W[h]),q=q+ke|0,$=ke,ke=pe,pe=R(we,10),we=H,H=q;q=f[1]+ue+pe|0,f[1]=f[2]+I+ke|0,f[2]=f[3]+P+$|0,f[3]=f[4]+ie+H|0,f[4]=f[0]+he+we|0,f[0]=q},_doFinalize:function(){var T=this._data,F=T.words,h=this._nDataBytes*8,N=T.sigBytes*8;F[N>>>5]|=128<<24-N%32,F[(N+64>>>9<<4)+14]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,T.sigBytes=(F.length+1)*4,this._process();for(var A=this._hash,f=A.words,v=0;v<5;v++){var m=f[v];f[v]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360}return A},clone:function(){var T=o.clone.call(this);return T._hash=this._hash.clone(),T}});function C(T,F,h){return T^F^h}function x(T,F,h){return T&F|~T&h}function p(T,F,h){return(T|~F)^h}function E(T,F,h){return T&h|F&~h}function _(T,F,h){return T^(F|~h)}function R(T,F){return T<<F|T>>>32-F}i.RIPEMD160=o._createHelper(b),i.HmacRIPEMD160=o._createHmacHelper(b)}(),t.RIPEMD160})}(li)),li.exports}var di={exports:{}},ea;function hi(){return ea||(ea=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){(function(){var s=t,i=s.lib,n=i.Base,a=s.enc,o=a.Utf8,d=s.algo;d.HMAC=n.extend({init:function(c,l){c=this._hasher=new c.init,typeof l=="string"&&(l=o.parse(l));var g=c.blockSize,u=g*4;l.sigBytes>u&&(l=c.finalize(l)),l.clamp();for(var y=this._oKey=l.clone(),w=this._iKey=l.clone(),b=y.words,C=w.words,x=0;x<g;x++)b[x]^=1549556828,C[x]^=909522486;y.sigBytes=w.sigBytes=u,this.reset()},reset:function(){var c=this._hasher;c.reset(),c.update(this._iKey)},update:function(c){return this._hasher.update(c),this},finalize:function(c){var l=this._hasher,g=l.finalize(c);l.reset();var u=l.finalize(this._oKey.clone().concat(g));return u}})})()})}(di)),di.exports}var ui={exports:{}},ta;function b0(){return ta||(ta=1,function(r,e){(function(t,s,i){r.exports=s(oe(),ii(),hi())})(se,function(t){return function(){var s=t,i=s.lib,n=i.Base,a=i.WordArray,o=s.algo,d=o.SHA256,c=o.HMAC,l=o.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:d,iterations:25e4}),init:function(g){this.cfg=this.cfg.extend(g)},compute:function(g,u){for(var y=this.cfg,w=c.create(y.hasher,g),b=a.create(),C=a.create([1]),x=b.words,p=C.words,E=y.keySize,_=y.iterations;x.length<E;){var R=w.update(u).finalize(C);w.reset();for(var T=R.words,F=T.length,h=R,N=1;N<_;N++){h=w.finalize(h),w.reset();for(var A=h.words,f=0;f<F;f++)T[f]^=A[f]}b.concat(R),p[0]++}return b.sigBytes=E*4,b}});s.PBKDF2=function(g,u,y){return l.create(y).compute(g,u)}}(),t.PBKDF2})}(ui)),ui.exports}var fi={exports:{}},ra;function Wt(){return ra||(ra=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Gn(),hi())})(se,function(t){return function(){var s=t,i=s.lib,n=i.Base,a=i.WordArray,o=s.algo,d=o.MD5,c=o.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:d,iterations:1}),init:function(l){this.cfg=this.cfg.extend(l)},compute:function(l,g){for(var u,y=this.cfg,w=y.hasher.create(),b=a.create(),C=b.words,x=y.keySize,p=y.iterations;C.length<x;){u&&w.update(u),u=w.update(l).finalize(g),w.reset();for(var E=1;E<p;E++)u=w.finalize(u),w.reset();b.concat(u)}return b.sigBytes=x*4,b}});s.EvpKDF=function(l,g,u){return c.create(u).compute(l,g)}}(),t.EvpKDF})}(fi)),fi.exports}var gi={exports:{}},sa;function Pe(){return sa||(sa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Wt())})(se,function(t){t.lib.Cipher||function(s){var i=t,n=i.lib,a=n.Base,o=n.WordArray,d=n.BufferedBlockAlgorithm,c=i.enc;c.Utf8;var l=c.Base64,g=i.algo,u=g.EvpKDF,y=n.Cipher=d.extend({cfg:a.extend(),createEncryptor:function(A,f){return this.create(this._ENC_XFORM_MODE,A,f)},createDecryptor:function(A,f){return this.create(this._DEC_XFORM_MODE,A,f)},init:function(A,f,v){this.cfg=this.cfg.extend(v),this._xformMode=A,this._key=f,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(A){return this._append(A),this._process()},finalize:function(A){A&&this._append(A);var f=this._doFinalize();return f},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function A(f){return typeof f=="string"?N:T}return function(f){return{encrypt:function(v,m,L){return A(m).encrypt(f,v,m,L)},decrypt:function(v,m,L){return A(m).decrypt(f,v,m,L)}}}}()});n.StreamCipher=y.extend({_doFinalize:function(){var A=this._process(!0);return A},blockSize:1});var w=i.mode={},b=n.BlockCipherMode=a.extend({createEncryptor:function(A,f){return this.Encryptor.create(A,f)},createDecryptor:function(A,f){return this.Decryptor.create(A,f)},init:function(A,f){this._cipher=A,this._iv=f}}),C=w.CBC=function(){var A=b.extend();A.Encryptor=A.extend({processBlock:function(v,m){var L=this._cipher,j=L.blockSize;f.call(this,v,m,j),L.encryptBlock(v,m),this._prevBlock=v.slice(m,m+j)}}),A.Decryptor=A.extend({processBlock:function(v,m){var L=this._cipher,j=L.blockSize,X=v.slice(m,m+j);L.decryptBlock(v,m),f.call(this,v,m,j),this._prevBlock=X}});function f(v,m,L){var j,X=this._iv;X?(j=X,this._iv=s):j=this._prevBlock;for(var W=0;W<L;W++)v[m+W]^=j[W]}return A}(),x=i.pad={},p=x.Pkcs7={pad:function(A,f){for(var v=f*4,m=v-A.sigBytes%v,L=m<<24|m<<16|m<<8|m,j=[],X=0;X<m;X+=4)j.push(L);var W=o.create(j,m);A.concat(W)},unpad:function(A){var f=A.words[A.sigBytes-1>>>2]&255;A.sigBytes-=f}};n.BlockCipher=y.extend({cfg:y.cfg.extend({mode:C,padding:p}),reset:function(){var A;y.reset.call(this);var f=this.cfg,v=f.iv,m=f.mode;this._xformMode==this._ENC_XFORM_MODE?A=m.createEncryptor:(A=m.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==A?this._mode.init(this,v&&v.words):(this._mode=A.call(m,this,v&&v.words),this._mode.__creator=A)},_doProcessBlock:function(A,f){this._mode.processBlock(A,f)},_doFinalize:function(){var A,f=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(f.pad(this._data,this.blockSize),A=this._process(!0)):(A=this._process(!0),f.unpad(A)),A},blockSize:128/32});var E=n.CipherParams=a.extend({init:function(A){this.mixIn(A)},toString:function(A){return(A||this.formatter).stringify(this)}}),_=i.format={},R=_.OpenSSL={stringify:function(A){var f,v=A.ciphertext,m=A.salt;return m?f=o.create([1398893684,1701076831]).concat(m).concat(v):f=v,f.toString(l)},parse:function(A){var f,v=l.parse(A),m=v.words;return m[0]==1398893684&&m[1]==1701076831&&(f=o.create(m.slice(2,4)),m.splice(0,4),v.sigBytes-=16),E.create({ciphertext:v,salt:f})}},T=n.SerializableCipher=a.extend({cfg:a.extend({format:R}),encrypt:function(A,f,v,m){m=this.cfg.extend(m);var L=A.createEncryptor(v,m),j=L.finalize(f),X=L.cfg;return E.create({ciphertext:j,key:v,iv:X.iv,algorithm:A,mode:X.mode,padding:X.padding,blockSize:A.blockSize,formatter:m.format})},decrypt:function(A,f,v,m){m=this.cfg.extend(m),f=this._parse(f,m.format);var L=A.createDecryptor(v,m).finalize(f.ciphertext);return L},_parse:function(A,f){return typeof A=="string"?f.parse(A,this):A}}),F=i.kdf={},h=F.OpenSSL={execute:function(A,f,v,m,L){if(m||(m=o.random(64/8)),L)var j=u.create({keySize:f+v,hasher:L}).compute(A,m);else var j=u.create({keySize:f+v}).compute(A,m);var X=o.create(j.words.slice(f),v*4);return j.sigBytes=f*4,E.create({key:j,iv:X,salt:m})}},N=n.PasswordBasedCipher=T.extend({cfg:T.cfg.extend({kdf:h}),encrypt:function(A,f,v,m){m=this.cfg.extend(m);var L=m.kdf.execute(v,A.keySize,A.ivSize,m.salt,m.hasher);m.iv=L.iv;var j=T.encrypt.call(this,A,f,L.key,m);return j.mixIn(L),j},decrypt:function(A,f,v,m){m=this.cfg.extend(m),f=this._parse(f,m.format);var L=m.kdf.execute(v,A.keySize,A.ivSize,f.salt,m.hasher);m.iv=L.iv;var j=T.decrypt.call(this,A,f,L.key,m);return j}})}()})}(gi)),gi.exports}var xi={exports:{}},ia;function C0(){return ia||(ia=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.mode.CFB=function(){var s=t.lib.BlockCipherMode.extend();s.Encryptor=s.extend({processBlock:function(n,a){var o=this._cipher,d=o.blockSize;i.call(this,n,a,d,o),this._prevBlock=n.slice(a,a+d)}}),s.Decryptor=s.extend({processBlock:function(n,a){var o=this._cipher,d=o.blockSize,c=n.slice(a,a+d);i.call(this,n,a,d,o),this._prevBlock=c}});function i(n,a,o,d){var c,l=this._iv;l?(c=l.slice(0),this._iv=void 0):c=this._prevBlock,d.encryptBlock(c,0);for(var g=0;g<o;g++)n[a+g]^=c[g]}return s}(),t.mode.CFB})}(xi)),xi.exports}var pi={exports:{}},na;function _0(){return na||(na=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.mode.CTR=function(){var s=t.lib.BlockCipherMode.extend(),i=s.Encryptor=s.extend({processBlock:function(n,a){var o=this._cipher,d=o.blockSize,c=this._iv,l=this._counter;c&&(l=this._counter=c.slice(0),this._iv=void 0);var g=l.slice(0);o.encryptBlock(g,0),l[d-1]=l[d-1]+1|0;for(var u=0;u<d;u++)n[a+u]^=g[u]}});return s.Decryptor=i,s}(),t.mode.CTR})}(pi)),pi.exports}var mi={exports:{}},aa;function D0(){return aa||(aa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){/** @preserve
139
+ */return function(s){var i=t,n=i.lib,a=n.WordArray,o=n.Hasher,d=i.algo,c=a.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=a.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),g=a.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=a.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),y=a.create([0,1518500249,1859775393,2400959708,2840853838]),w=a.create([1352829926,1548603684,1836072691,2053994217,0]),b=d.RIPEMD160=o.extend({_doReset:function(){this._hash=a.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(S,R){for(var h=0;h<16;h++){var N=R+h,A=S[N];S[N]=(A<<8|A>>>24)&16711935|(A<<24|A>>>8)&4278255360}var f=this._hash.words,v=y.words,m=w.words,U=c.words,q=l.words,X=g.words,W=u.words,ie,he,ue,I,P,$,H,we,pe,ke;$=ie=f[0],H=he=f[1],we=ue=f[2],pe=I=f[3],ke=P=f[4];for(var j,h=0;h<80;h+=1)j=ie+S[R+U[h]]|0,h<16?j+=C(he,ue,I)+v[0]:h<32?j+=x(he,ue,I)+v[1]:h<48?j+=p(he,ue,I)+v[2]:h<64?j+=E(he,ue,I)+v[3]:j+=_(he,ue,I)+v[4],j=j|0,j=T(j,X[h]),j=j+P|0,ie=P,P=I,I=T(ue,10),ue=he,he=j,j=$+S[R+q[h]]|0,h<16?j+=_(H,we,pe)+m[0]:h<32?j+=E(H,we,pe)+m[1]:h<48?j+=p(H,we,pe)+m[2]:h<64?j+=x(H,we,pe)+m[3]:j+=C(H,we,pe)+m[4],j=j|0,j=T(j,W[h]),j=j+ke|0,$=ke,ke=pe,pe=T(we,10),we=H,H=j;j=f[1]+ue+pe|0,f[1]=f[2]+I+ke|0,f[2]=f[3]+P+$|0,f[3]=f[4]+ie+H|0,f[4]=f[0]+he+we|0,f[0]=j},_doFinalize:function(){var S=this._data,R=S.words,h=this._nDataBytes*8,N=S.sigBytes*8;R[N>>>5]|=128<<24-N%32,R[(N+64>>>9<<4)+14]=(h<<8|h>>>24)&16711935|(h<<24|h>>>8)&4278255360,S.sigBytes=(R.length+1)*4,this._process();for(var A=this._hash,f=A.words,v=0;v<5;v++){var m=f[v];f[v]=(m<<8|m>>>24)&16711935|(m<<24|m>>>8)&4278255360}return A},clone:function(){var S=o.clone.call(this);return S._hash=this._hash.clone(),S}});function C(S,R,h){return S^R^h}function x(S,R,h){return S&R|~S&h}function p(S,R,h){return(S|~R)^h}function E(S,R,h){return S&h|R&~h}function _(S,R,h){return S^(R|~h)}function T(S,R){return S<<R|S>>>32-R}i.RIPEMD160=o._createHelper(b),i.HmacRIPEMD160=o._createHmacHelper(b)}(),t.RIPEMD160})}(li)),li.exports}var di={exports:{}},Qn;function hi(){return Qn||(Qn=1,function(r,e){(function(t,s){r.exports=s(oe())})(se,function(t){(function(){var s=t,i=s.lib,n=i.Base,a=s.enc,o=a.Utf8,d=s.algo;d.HMAC=n.extend({init:function(c,l){c=this._hasher=new c.init,typeof l=="string"&&(l=o.parse(l));var g=c.blockSize,u=g*4;l.sigBytes>u&&(l=c.finalize(l)),l.clamp();for(var y=this._oKey=l.clone(),w=this._iKey=l.clone(),b=y.words,C=w.words,x=0;x<g;x++)b[x]^=1549556828,C[x]^=909522486;y.sigBytes=w.sigBytes=u,this.reset()},reset:function(){var c=this._hasher;c.reset(),c.update(this._iKey)},update:function(c){return this._hasher.update(c),this},finalize:function(c){var l=this._hasher,g=l.finalize(c);l.reset();var u=l.finalize(this._oKey.clone().concat(g));return u}})})()})}(di)),di.exports}var ui={exports:{}},ea;function m0(){return ea||(ea=1,function(r,e){(function(t,s,i){r.exports=s(oe(),ii(),hi())})(se,function(t){return function(){var s=t,i=s.lib,n=i.Base,a=i.WordArray,o=s.algo,d=o.SHA256,c=o.HMAC,l=o.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:d,iterations:25e4}),init:function(g){this.cfg=this.cfg.extend(g)},compute:function(g,u){for(var y=this.cfg,w=c.create(y.hasher,g),b=a.create(),C=a.create([1]),x=b.words,p=C.words,E=y.keySize,_=y.iterations;x.length<E;){var T=w.update(u).finalize(C);w.reset();for(var S=T.words,R=S.length,h=T,N=1;N<_;N++){h=w.finalize(h),w.reset();for(var A=h.words,f=0;f<R;f++)S[f]^=A[f]}b.concat(T),p[0]++}return b.sigBytes=E*4,b}});s.PBKDF2=function(g,u,y){return l.create(y).compute(g,u)}}(),t.PBKDF2})}(ui)),ui.exports}var fi={exports:{}},ta;function Wt(){return ta||(ta=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Wn(),hi())})(se,function(t){return function(){var s=t,i=s.lib,n=i.Base,a=i.WordArray,o=s.algo,d=o.MD5,c=o.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:d,iterations:1}),init:function(l){this.cfg=this.cfg.extend(l)},compute:function(l,g){for(var u,y=this.cfg,w=y.hasher.create(),b=a.create(),C=b.words,x=y.keySize,p=y.iterations;C.length<x;){u&&w.update(u),u=w.update(l).finalize(g),w.reset();for(var E=1;E<p;E++)u=w.finalize(u),w.reset();b.concat(u)}return b.sigBytes=x*4,b}});s.EvpKDF=function(l,g,u){return c.create(u).compute(l,g)}}(),t.EvpKDF})}(fi)),fi.exports}var gi={exports:{}},ra;function Pe(){return ra||(ra=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Wt())})(se,function(t){t.lib.Cipher||function(s){var i=t,n=i.lib,a=n.Base,o=n.WordArray,d=n.BufferedBlockAlgorithm,c=i.enc;c.Utf8;var l=c.Base64,g=i.algo,u=g.EvpKDF,y=n.Cipher=d.extend({cfg:a.extend(),createEncryptor:function(A,f){return this.create(this._ENC_XFORM_MODE,A,f)},createDecryptor:function(A,f){return this.create(this._DEC_XFORM_MODE,A,f)},init:function(A,f,v){this.cfg=this.cfg.extend(v),this._xformMode=A,this._key=f,this.reset()},reset:function(){d.reset.call(this),this._doReset()},process:function(A){return this._append(A),this._process()},finalize:function(A){A&&this._append(A);var f=this._doFinalize();return f},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function A(f){return typeof f=="string"?N:S}return function(f){return{encrypt:function(v,m,U){return A(m).encrypt(f,v,m,U)},decrypt:function(v,m,U){return A(m).decrypt(f,v,m,U)}}}}()});n.StreamCipher=y.extend({_doFinalize:function(){var A=this._process(!0);return A},blockSize:1});var w=i.mode={},b=n.BlockCipherMode=a.extend({createEncryptor:function(A,f){return this.Encryptor.create(A,f)},createDecryptor:function(A,f){return this.Decryptor.create(A,f)},init:function(A,f){this._cipher=A,this._iv=f}}),C=w.CBC=function(){var A=b.extend();A.Encryptor=A.extend({processBlock:function(v,m){var U=this._cipher,q=U.blockSize;f.call(this,v,m,q),U.encryptBlock(v,m),this._prevBlock=v.slice(m,m+q)}}),A.Decryptor=A.extend({processBlock:function(v,m){var U=this._cipher,q=U.blockSize,X=v.slice(m,m+q);U.decryptBlock(v,m),f.call(this,v,m,q),this._prevBlock=X}});function f(v,m,U){var q,X=this._iv;X?(q=X,this._iv=s):q=this._prevBlock;for(var W=0;W<U;W++)v[m+W]^=q[W]}return A}(),x=i.pad={},p=x.Pkcs7={pad:function(A,f){for(var v=f*4,m=v-A.sigBytes%v,U=m<<24|m<<16|m<<8|m,q=[],X=0;X<m;X+=4)q.push(U);var W=o.create(q,m);A.concat(W)},unpad:function(A){var f=A.words[A.sigBytes-1>>>2]&255;A.sigBytes-=f}};n.BlockCipher=y.extend({cfg:y.cfg.extend({mode:C,padding:p}),reset:function(){var A;y.reset.call(this);var f=this.cfg,v=f.iv,m=f.mode;this._xformMode==this._ENC_XFORM_MODE?A=m.createEncryptor:(A=m.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==A?this._mode.init(this,v&&v.words):(this._mode=A.call(m,this,v&&v.words),this._mode.__creator=A)},_doProcessBlock:function(A,f){this._mode.processBlock(A,f)},_doFinalize:function(){var A,f=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(f.pad(this._data,this.blockSize),A=this._process(!0)):(A=this._process(!0),f.unpad(A)),A},blockSize:128/32});var E=n.CipherParams=a.extend({init:function(A){this.mixIn(A)},toString:function(A){return(A||this.formatter).stringify(this)}}),_=i.format={},T=_.OpenSSL={stringify:function(A){var f,v=A.ciphertext,m=A.salt;return m?f=o.create([1398893684,1701076831]).concat(m).concat(v):f=v,f.toString(l)},parse:function(A){var f,v=l.parse(A),m=v.words;return m[0]==1398893684&&m[1]==1701076831&&(f=o.create(m.slice(2,4)),m.splice(0,4),v.sigBytes-=16),E.create({ciphertext:v,salt:f})}},S=n.SerializableCipher=a.extend({cfg:a.extend({format:T}),encrypt:function(A,f,v,m){m=this.cfg.extend(m);var U=A.createEncryptor(v,m),q=U.finalize(f),X=U.cfg;return E.create({ciphertext:q,key:v,iv:X.iv,algorithm:A,mode:X.mode,padding:X.padding,blockSize:A.blockSize,formatter:m.format})},decrypt:function(A,f,v,m){m=this.cfg.extend(m),f=this._parse(f,m.format);var U=A.createDecryptor(v,m).finalize(f.ciphertext);return U},_parse:function(A,f){return typeof A=="string"?f.parse(A,this):A}}),R=i.kdf={},h=R.OpenSSL={execute:function(A,f,v,m,U){if(m||(m=o.random(64/8)),U)var q=u.create({keySize:f+v,hasher:U}).compute(A,m);else var q=u.create({keySize:f+v}).compute(A,m);var X=o.create(q.words.slice(f),v*4);return q.sigBytes=f*4,E.create({key:q,iv:X,salt:m})}},N=n.PasswordBasedCipher=S.extend({cfg:S.cfg.extend({kdf:h}),encrypt:function(A,f,v,m){m=this.cfg.extend(m);var U=m.kdf.execute(v,A.keySize,A.ivSize,m.salt,m.hasher);m.iv=U.iv;var q=S.encrypt.call(this,A,f,U.key,m);return q.mixIn(U),q},decrypt:function(A,f,v,m){m=this.cfg.extend(m),f=this._parse(f,m.format);var U=m.kdf.execute(v,A.keySize,A.ivSize,f.salt,m.hasher);m.iv=U.iv;var q=S.decrypt.call(this,A,f,U.key,m);return q}})}()})}(gi)),gi.exports}var xi={exports:{}},sa;function v0(){return sa||(sa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.mode.CFB=function(){var s=t.lib.BlockCipherMode.extend();s.Encryptor=s.extend({processBlock:function(n,a){var o=this._cipher,d=o.blockSize;i.call(this,n,a,d,o),this._prevBlock=n.slice(a,a+d)}}),s.Decryptor=s.extend({processBlock:function(n,a){var o=this._cipher,d=o.blockSize,c=n.slice(a,a+d);i.call(this,n,a,d,o),this._prevBlock=c}});function i(n,a,o,d){var c,l=this._iv;l?(c=l.slice(0),this._iv=void 0):c=this._prevBlock,d.encryptBlock(c,0);for(var g=0;g<o;g++)n[a+g]^=c[g]}return s}(),t.mode.CFB})}(xi)),xi.exports}var pi={exports:{}},ia;function y0(){return ia||(ia=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.mode.CTR=function(){var s=t.lib.BlockCipherMode.extend(),i=s.Encryptor=s.extend({processBlock:function(n,a){var o=this._cipher,d=o.blockSize,c=this._iv,l=this._counter;c&&(l=this._counter=c.slice(0),this._iv=void 0);var g=l.slice(0);o.encryptBlock(g,0),l[d-1]=l[d-1]+1|0;for(var u=0;u<d;u++)n[a+u]^=g[u]}});return s.Decryptor=i,s}(),t.mode.CTR})}(pi)),pi.exports}var mi={exports:{}},na;function w0(){return na||(na=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){/** @preserve
140
140
  * Counter block mode compatible with Dr Brian Gladman fileenc.c
141
141
  * derived from CryptoJS.mode.CTR
142
142
  * Jan Hruby jhruby.web@gmail.com
143
- */return t.mode.CTRGladman=function(){var s=t.lib.BlockCipherMode.extend();function i(o){if((o>>24&255)===255){var d=o>>16&255,c=o>>8&255,l=o&255;d===255?(d=0,c===255?(c=0,l===255?l=0:++l):++c):++d,o=0,o+=d<<16,o+=c<<8,o+=l}else o+=1<<24;return o}function n(o){return(o[0]=i(o[0]))===0&&(o[1]=i(o[1])),o}var a=s.Encryptor=s.extend({processBlock:function(o,d){var c=this._cipher,l=c.blockSize,g=this._iv,u=this._counter;g&&(u=this._counter=g.slice(0),this._iv=void 0),n(u);var y=u.slice(0);c.encryptBlock(y,0);for(var w=0;w<l;w++)o[d+w]^=y[w]}});return s.Decryptor=a,s}(),t.mode.CTRGladman})}(mi)),mi.exports}var vi={exports:{}},oa;function A0(){return oa||(oa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.mode.OFB=function(){var s=t.lib.BlockCipherMode.extend(),i=s.Encryptor=s.extend({processBlock:function(n,a){var o=this._cipher,d=o.blockSize,c=this._iv,l=this._keystream;c&&(l=this._keystream=c.slice(0),this._iv=void 0),o.encryptBlock(l,0);for(var g=0;g<d;g++)n[a+g]^=l[g]}});return s.Decryptor=i,s}(),t.mode.OFB})}(vi)),vi.exports}var yi={exports:{}},ca;function S0(){return ca||(ca=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.mode.ECB=function(){var s=t.lib.BlockCipherMode.extend();return s.Encryptor=s.extend({processBlock:function(i,n){this._cipher.encryptBlock(i,n)}}),s.Decryptor=s.extend({processBlock:function(i,n){this._cipher.decryptBlock(i,n)}}),s}(),t.mode.ECB})}(yi)),yi.exports}var wi={exports:{}},la;function T0(){return la||(la=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.AnsiX923={pad:function(s,i){var n=s.sigBytes,a=i*4,o=a-n%a,d=n+o-1;s.clamp(),s.words[d>>>2]|=o<<24-d%4*8,s.sigBytes+=o},unpad:function(s){var i=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=i}},t.pad.Ansix923})}(wi)),wi.exports}var Ei={exports:{}},da;function R0(){return da||(da=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.Iso10126={pad:function(s,i){var n=i*4,a=n-s.sigBytes%n;s.concat(t.lib.WordArray.random(a-1)).concat(t.lib.WordArray.create([a<<24],1))},unpad:function(s){var i=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=i}},t.pad.Iso10126})}(Ei)),Ei.exports}var bi={exports:{}},ha;function F0(){return ha||(ha=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.Iso97971={pad:function(s,i){s.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(s,i)},unpad:function(s){t.pad.ZeroPadding.unpad(s),s.sigBytes--}},t.pad.Iso97971})}(bi)),bi.exports}var Ci={exports:{}},ua;function k0(){return ua||(ua=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.ZeroPadding={pad:function(s,i){var n=i*4;s.clamp(),s.sigBytes+=n-(s.sigBytes%n||n)},unpad:function(s){for(var i=s.words,n=s.sigBytes-1,n=s.sigBytes-1;n>=0;n--)if(i[n>>>2]>>>24-n%4*8&255){s.sigBytes=n+1;break}}},t.pad.ZeroPadding})}(Ci)),Ci.exports}var _i={exports:{}},fa;function B0(){return fa||(fa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(_i)),_i.exports}var Di={exports:{}},ga;function I0(){return ga||(ga=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.CipherParams,o=i.enc,d=o.Hex,c=i.format;c.Hex={stringify:function(l){return l.ciphertext.toString(d)},parse:function(l){var g=d.parse(l);return a.create({ciphertext:g})}}}(),t.format.Hex})}(Di)),Di.exports}var Ai={exports:{}},xa;function H0(){return xa||(xa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.BlockCipher,a=s.algo,o=[],d=[],c=[],l=[],g=[],u=[],y=[],w=[],b=[],C=[];(function(){for(var E=[],_=0;_<256;_++)_<128?E[_]=_<<1:E[_]=_<<1^283;for(var R=0,T=0,_=0;_<256;_++){var F=T^T<<1^T<<2^T<<3^T<<4;F=F>>>8^F&255^99,o[R]=F,d[F]=R;var h=E[R],N=E[h],A=E[N],f=E[F]*257^F*16843008;c[R]=f<<24|f>>>8,l[R]=f<<16|f>>>16,g[R]=f<<8|f>>>24,u[R]=f;var f=A*16843009^N*65537^h*257^R*16843008;y[F]=f<<24|f>>>8,w[F]=f<<16|f>>>16,b[F]=f<<8|f>>>24,C[F]=f,R?(R=h^E[E[E[A^h]]],T^=E[E[T]]):R=T=1}})();var x=[0,1,2,4,8,16,32,64,128,27,54],p=a.AES=n.extend({_doReset:function(){var E;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var _=this._keyPriorReset=this._key,R=_.words,T=_.sigBytes/4,F=this._nRounds=T+6,h=(F+1)*4,N=this._keySchedule=[],A=0;A<h;A++)A<T?N[A]=R[A]:(E=N[A-1],A%T?T>6&&A%T==4&&(E=o[E>>>24]<<24|o[E>>>16&255]<<16|o[E>>>8&255]<<8|o[E&255]):(E=E<<8|E>>>24,E=o[E>>>24]<<24|o[E>>>16&255]<<16|o[E>>>8&255]<<8|o[E&255],E^=x[A/T|0]<<24),N[A]=N[A-T]^E);for(var f=this._invKeySchedule=[],v=0;v<h;v++){var A=h-v;if(v%4)var E=N[A];else var E=N[A-4];v<4||A<=4?f[v]=E:f[v]=y[o[E>>>24]]^w[o[E>>>16&255]]^b[o[E>>>8&255]]^C[o[E&255]]}}},encryptBlock:function(E,_){this._doCryptBlock(E,_,this._keySchedule,c,l,g,u,o)},decryptBlock:function(E,_){var R=E[_+1];E[_+1]=E[_+3],E[_+3]=R,this._doCryptBlock(E,_,this._invKeySchedule,y,w,b,C,d);var R=E[_+1];E[_+1]=E[_+3],E[_+3]=R},_doCryptBlock:function(E,_,R,T,F,h,N,A){for(var f=this._nRounds,v=E[_]^R[0],m=E[_+1]^R[1],L=E[_+2]^R[2],j=E[_+3]^R[3],X=4,W=1;W<f;W++){var ie=T[v>>>24]^F[m>>>16&255]^h[L>>>8&255]^N[j&255]^R[X++],he=T[m>>>24]^F[L>>>16&255]^h[j>>>8&255]^N[v&255]^R[X++],ue=T[L>>>24]^F[j>>>16&255]^h[v>>>8&255]^N[m&255]^R[X++],I=T[j>>>24]^F[v>>>16&255]^h[m>>>8&255]^N[L&255]^R[X++];v=ie,m=he,L=ue,j=I}var ie=(A[v>>>24]<<24|A[m>>>16&255]<<16|A[L>>>8&255]<<8|A[j&255])^R[X++],he=(A[m>>>24]<<24|A[L>>>16&255]<<16|A[j>>>8&255]<<8|A[v&255])^R[X++],ue=(A[L>>>24]<<24|A[j>>>16&255]<<16|A[v>>>8&255]<<8|A[m&255])^R[X++],I=(A[j>>>24]<<24|A[v>>>16&255]<<16|A[m>>>8&255]<<8|A[L&255])^R[X++];E[_]=ie,E[_+1]=he,E[_+2]=ue,E[_+3]=I},keySize:256/32});s.AES=n._createHelper(p)}(),t.AES})}(Ai)),Ai.exports}var Si={exports:{}},pa;function P0(){return pa||(pa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=i.BlockCipher,o=s.algo,d=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],c=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],g=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],y=o.DES=a.extend({_doReset:function(){for(var x=this._key,p=x.words,E=[],_=0;_<56;_++){var R=d[_]-1;E[_]=p[R>>>5]>>>31-R%32&1}for(var T=this._subKeys=[],F=0;F<16;F++){for(var h=T[F]=[],N=l[F],_=0;_<24;_++)h[_/6|0]|=E[(c[_]-1+N)%28]<<31-_%6,h[4+(_/6|0)]|=E[28+(c[_+24]-1+N)%28]<<31-_%6;h[0]=h[0]<<1|h[0]>>>31;for(var _=1;_<7;_++)h[_]=h[_]>>>(_-1)*4+3;h[7]=h[7]<<5|h[7]>>>27}for(var A=this._invSubKeys=[],_=0;_<16;_++)A[_]=T[15-_]},encryptBlock:function(x,p){this._doCryptBlock(x,p,this._subKeys)},decryptBlock:function(x,p){this._doCryptBlock(x,p,this._invSubKeys)},_doCryptBlock:function(x,p,E){this._lBlock=x[p],this._rBlock=x[p+1],w.call(this,4,252645135),w.call(this,16,65535),b.call(this,2,858993459),b.call(this,8,16711935),w.call(this,1,1431655765);for(var _=0;_<16;_++){for(var R=E[_],T=this._lBlock,F=this._rBlock,h=0,N=0;N<8;N++)h|=g[N][((F^R[N])&u[N])>>>0];this._lBlock=F,this._rBlock=T^h}var A=this._lBlock;this._lBlock=this._rBlock,this._rBlock=A,w.call(this,1,1431655765),b.call(this,8,16711935),b.call(this,2,858993459),w.call(this,16,65535),w.call(this,4,252645135),x[p]=this._lBlock,x[p+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function w(x,p){var E=(this._lBlock>>>x^this._rBlock)&p;this._rBlock^=E,this._lBlock^=E<<x}function b(x,p){var E=(this._rBlock>>>x^this._lBlock)&p;this._lBlock^=E,this._rBlock^=E<<x}s.DES=a._createHelper(y);var C=o.TripleDES=a.extend({_doReset:function(){var x=this._key,p=x.words;if(p.length!==2&&p.length!==4&&p.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var E=p.slice(0,2),_=p.length<4?p.slice(0,2):p.slice(2,4),R=p.length<6?p.slice(0,2):p.slice(4,6);this._des1=y.createEncryptor(n.create(E)),this._des2=y.createEncryptor(n.create(_)),this._des3=y.createEncryptor(n.create(R))},encryptBlock:function(x,p){this._des1.encryptBlock(x,p),this._des2.decryptBlock(x,p),this._des3.encryptBlock(x,p)},decryptBlock:function(x,p){this._des3.decryptBlock(x,p),this._des2.encryptBlock(x,p),this._des1.decryptBlock(x,p)},keySize:192/32,ivSize:64/32,blockSize:64/32});s.TripleDES=a._createHelper(C)}(),t.TripleDES})}(Si)),Si.exports}var Ti={exports:{}},ma;function $0(){return ma||(ma=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,a=s.algo,o=a.RC4=n.extend({_doReset:function(){for(var l=this._key,g=l.words,u=l.sigBytes,y=this._S=[],w=0;w<256;w++)y[w]=w;for(var w=0,b=0;w<256;w++){var C=w%u,x=g[C>>>2]>>>24-C%4*8&255;b=(b+y[w]+x)%256;var p=y[w];y[w]=y[b],y[b]=p}this._i=this._j=0},_doProcessBlock:function(l,g){l[g]^=d.call(this)},keySize:256/32,ivSize:0});function d(){for(var l=this._S,g=this._i,u=this._j,y=0,w=0;w<4;w++){g=(g+1)%256,u=(u+l[g])%256;var b=l[g];l[g]=l[u],l[u]=b,y|=l[(l[g]+l[u])%256]<<24-w*8}return this._i=g,this._j=u,y}s.RC4=n._createHelper(o);var c=a.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var l=this.cfg.drop;l>0;l--)d.call(this)}});s.RC4Drop=n._createHelper(c)}(),t.RC4})}(Ti)),Ti.exports}var Ri={exports:{}},va;function O0(){return va||(va=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,a=s.algo,o=[],d=[],c=[],l=a.Rabbit=n.extend({_doReset:function(){for(var u=this._key.words,y=this.cfg.iv,w=0;w<4;w++)u[w]=(u[w]<<8|u[w]>>>24)&16711935|(u[w]<<24|u[w]>>>8)&4278255360;var b=this._X=[u[0],u[3]<<16|u[2]>>>16,u[1],u[0]<<16|u[3]>>>16,u[2],u[1]<<16|u[0]>>>16,u[3],u[2]<<16|u[1]>>>16],C=this._C=[u[2]<<16|u[2]>>>16,u[0]&4294901760|u[1]&65535,u[3]<<16|u[3]>>>16,u[1]&4294901760|u[2]&65535,u[0]<<16|u[0]>>>16,u[2]&4294901760|u[3]&65535,u[1]<<16|u[1]>>>16,u[3]&4294901760|u[0]&65535];this._b=0;for(var w=0;w<4;w++)g.call(this);for(var w=0;w<8;w++)C[w]^=b[w+4&7];if(y){var x=y.words,p=x[0],E=x[1],_=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,R=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,T=_>>>16|R&4294901760,F=R<<16|_&65535;C[0]^=_,C[1]^=T,C[2]^=R,C[3]^=F,C[4]^=_,C[5]^=T,C[6]^=R,C[7]^=F;for(var w=0;w<4;w++)g.call(this)}},_doProcessBlock:function(u,y){var w=this._X;g.call(this),o[0]=w[0]^w[5]>>>16^w[3]<<16,o[1]=w[2]^w[7]>>>16^w[5]<<16,o[2]=w[4]^w[1]>>>16^w[7]<<16,o[3]=w[6]^w[3]>>>16^w[1]<<16;for(var b=0;b<4;b++)o[b]=(o[b]<<8|o[b]>>>24)&16711935|(o[b]<<24|o[b]>>>8)&4278255360,u[y+b]^=o[b]},blockSize:128/32,ivSize:64/32});function g(){for(var u=this._X,y=this._C,w=0;w<8;w++)d[w]=y[w];y[0]=y[0]+1295307597+this._b|0,y[1]=y[1]+3545052371+(y[0]>>>0<d[0]>>>0?1:0)|0,y[2]=y[2]+886263092+(y[1]>>>0<d[1]>>>0?1:0)|0,y[3]=y[3]+1295307597+(y[2]>>>0<d[2]>>>0?1:0)|0,y[4]=y[4]+3545052371+(y[3]>>>0<d[3]>>>0?1:0)|0,y[5]=y[5]+886263092+(y[4]>>>0<d[4]>>>0?1:0)|0,y[6]=y[6]+1295307597+(y[5]>>>0<d[5]>>>0?1:0)|0,y[7]=y[7]+3545052371+(y[6]>>>0<d[6]>>>0?1:0)|0,this._b=y[7]>>>0<d[7]>>>0?1:0;for(var w=0;w<8;w++){var b=u[w]+y[w],C=b&65535,x=b>>>16,p=((C*C>>>17)+C*x>>>15)+x*x,E=((b&4294901760)*b|0)+((b&65535)*b|0);c[w]=p^E}u[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,u[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,u[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,u[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,u[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,u[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,u[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,u[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}s.Rabbit=n._createHelper(l)}(),t.Rabbit})}(Ri)),Ri.exports}var Fi={exports:{}},ya;function N0(){return ya||(ya=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,a=s.algo,o=[],d=[],c=[],l=a.RabbitLegacy=n.extend({_doReset:function(){var u=this._key.words,y=this.cfg.iv,w=this._X=[u[0],u[3]<<16|u[2]>>>16,u[1],u[0]<<16|u[3]>>>16,u[2],u[1]<<16|u[0]>>>16,u[3],u[2]<<16|u[1]>>>16],b=this._C=[u[2]<<16|u[2]>>>16,u[0]&4294901760|u[1]&65535,u[3]<<16|u[3]>>>16,u[1]&4294901760|u[2]&65535,u[0]<<16|u[0]>>>16,u[2]&4294901760|u[3]&65535,u[1]<<16|u[1]>>>16,u[3]&4294901760|u[0]&65535];this._b=0;for(var C=0;C<4;C++)g.call(this);for(var C=0;C<8;C++)b[C]^=w[C+4&7];if(y){var x=y.words,p=x[0],E=x[1],_=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,R=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,T=_>>>16|R&4294901760,F=R<<16|_&65535;b[0]^=_,b[1]^=T,b[2]^=R,b[3]^=F,b[4]^=_,b[5]^=T,b[6]^=R,b[7]^=F;for(var C=0;C<4;C++)g.call(this)}},_doProcessBlock:function(u,y){var w=this._X;g.call(this),o[0]=w[0]^w[5]>>>16^w[3]<<16,o[1]=w[2]^w[7]>>>16^w[5]<<16,o[2]=w[4]^w[1]>>>16^w[7]<<16,o[3]=w[6]^w[3]>>>16^w[1]<<16;for(var b=0;b<4;b++)o[b]=(o[b]<<8|o[b]>>>24)&16711935|(o[b]<<24|o[b]>>>8)&4278255360,u[y+b]^=o[b]},blockSize:128/32,ivSize:64/32});function g(){for(var u=this._X,y=this._C,w=0;w<8;w++)d[w]=y[w];y[0]=y[0]+1295307597+this._b|0,y[1]=y[1]+3545052371+(y[0]>>>0<d[0]>>>0?1:0)|0,y[2]=y[2]+886263092+(y[1]>>>0<d[1]>>>0?1:0)|0,y[3]=y[3]+1295307597+(y[2]>>>0<d[2]>>>0?1:0)|0,y[4]=y[4]+3545052371+(y[3]>>>0<d[3]>>>0?1:0)|0,y[5]=y[5]+886263092+(y[4]>>>0<d[4]>>>0?1:0)|0,y[6]=y[6]+1295307597+(y[5]>>>0<d[5]>>>0?1:0)|0,y[7]=y[7]+3545052371+(y[6]>>>0<d[6]>>>0?1:0)|0,this._b=y[7]>>>0<d[7]>>>0?1:0;for(var w=0;w<8;w++){var b=u[w]+y[w],C=b&65535,x=b>>>16,p=((C*C>>>17)+C*x>>>15)+x*x,E=((b&4294901760)*b|0)+((b&65535)*b|0);c[w]=p^E}u[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,u[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,u[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,u[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,u[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,u[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,u[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,u[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}s.RabbitLegacy=n._createHelper(l)}(),t.RabbitLegacy})}(Fi)),Fi.exports}var ki={exports:{}},wa;function M0(){return wa||(wa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.BlockCipher,a=s.algo;const o=16,d=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],c=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var l={pbox:[],sbox:[]};function g(C,x){let p=x>>24&255,E=x>>16&255,_=x>>8&255,R=x&255,T=C.sbox[0][p]+C.sbox[1][E];return T=T^C.sbox[2][_],T=T+C.sbox[3][R],T}function u(C,x,p){let E=x,_=p,R;for(let T=0;T<o;++T)E=E^C.pbox[T],_=g(C,E)^_,R=E,E=_,_=R;return R=E,E=_,_=R,_=_^C.pbox[o],E=E^C.pbox[o+1],{left:E,right:_}}function y(C,x,p){let E=x,_=p,R;for(let T=o+1;T>1;--T)E=E^C.pbox[T],_=g(C,E)^_,R=E,E=_,_=R;return R=E,E=_,_=R,_=_^C.pbox[1],E=E^C.pbox[0],{left:E,right:_}}function w(C,x,p){for(let F=0;F<4;F++){C.sbox[F]=[];for(let h=0;h<256;h++)C.sbox[F][h]=c[F][h]}let E=0;for(let F=0;F<o+2;F++)C.pbox[F]=d[F]^x[E],E++,E>=p&&(E=0);let _=0,R=0,T=0;for(let F=0;F<o+2;F+=2)T=u(C,_,R),_=T.left,R=T.right,C.pbox[F]=_,C.pbox[F+1]=R;for(let F=0;F<4;F++)for(let h=0;h<256;h+=2)T=u(C,_,R),_=T.left,R=T.right,C.sbox[F][h]=_,C.sbox[F][h+1]=R;return!0}var b=a.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var C=this._keyPriorReset=this._key,x=C.words,p=C.sigBytes/4;w(l,x,p)}},encryptBlock:function(C,x){var p=u(l,C[x],C[x+1]);C[x]=p.left,C[x+1]=p.right},decryptBlock:function(C,x){var p=y(l,C[x],C[x+1]);C[x]=p.left,C[x+1]=p.right},blockSize:64/32,keySize:128/32,ivSize:64/32});s.Blowfish=n._createHelper(b)}(),t.Blowfish})}(ki)),ki.exports}(function(r,e){(function(t,s,i){r.exports=s(oe(),os(),x0(),p0(),sr(),m0(),ir(),Gn(),ii(),v0(),Zn(),y0(),w0(),E0(),hi(),b0(),Wt(),Pe(),C0(),_0(),D0(),A0(),S0(),T0(),R0(),F0(),k0(),B0(),I0(),H0(),P0(),$0(),O0(),N0(),M0())})(se,function(t){return t})})(On);var j0=On.exports;const nr=zo(j0);let ce=null,Ae=null,mr=null;const Ge={setConfig(r){ce=r},getConfig(){return ce},decrypt(r,e=null,t=null){var s,i;try{const n=e||((s=ce==null?void 0:ce.env)==null?void 0:s.DECODE_IV)||"default_iv_1234",a=t||((i=ce==null?void 0:ce.env)==null?void 0:i.DECODE_KEY)||"default_key_1234",o=nr.enc.Base64.parse(r),d=nr.enc.Utf8.parse(a),c=nr.enc.Utf8.parse(n);return nr.AES.decrypt({ciphertext:o},d,{iv:c,mode:nr.mode.CTR,padding:nr.pad.NoPadding}).toString(nr.enc.Utf8)}catch(n){return console.log("ERROR ===> failed decrypt:",n),!1}},pushSound(){try{mr&&clearInterval(mr);const r=()=>{try{(!Ae||Ae.state==="closed")&&(Ae=new(window.AudioContext||window.webkitAudioContext)),Ae.state==="suspended"&&Ae.resume();const e=Ae.createOscillator(),t=Ae.createOscillator(),s=Ae.createGain();e.type="sine",t.type="sine",e.frequency.setValueAtTime(400,Ae.currentTime),t.frequency.setValueAtTime(450,Ae.currentTime);const i=Ae.createOscillator(),n=Ae.createGain();i.frequency.value=25,n.gain.value=15,i.connect(n),n.connect(e.frequency),n.connect(t.frequency),e.connect(s),t.connect(s),s.connect(Ae.destination),s.gain.setValueAtTime(0,Ae.currentTime),s.gain.linearRampToValueAtTime(.08,Ae.currentTime+.05),s.gain.setValueAtTime(.08,Ae.currentTime+1.2),s.gain.linearRampToValueAtTime(0,Ae.currentTime+1.3),i.start(),e.start(),t.start(),i.stop(Ae.currentTime+1.4),e.stop(Ae.currentTime+1.4),t.stop(Ae.currentTime+1.4)}catch(e){console.warn("Failed to play synthesized tone:",e)}};r(),mr=setInterval(r,3e3)}catch(r){console.warn("AudioContext initialization failed:",r)}},stopSound(){mr&&(clearInterval(mr),mr=null),Ae&&(Ae.close().catch(()=>{}),Ae=null)},pushNotification(r){Z.emitToParent("show_notification",{message:r})},toHHMMSS(r){const e=parseInt(r,10),t=Math.floor(e/3600),s=Math.floor(e/60)%60,i=e%60;return[t,s,i].map(n=>n<10?"0"+n:n).filter((n,a)=>n!=="00"||a>0).join(":")},mute(r,e,t,s){r?e?r.unmute():r.mute():s&&(e?s.unmuteAudio():s.muteAudio()),t(!e)},hold(r,e,t,s){r?e?r.unhold():r.hold():s&&(e?s.unhold():s.hold()),t(!e)},async hangup(r,e,t,s,i,n,a,o){s&&await s(!1),i&&i(!1),n&&n(0),r&&r.current&&clearInterval(r.current),e?(await(e==null?void 0:e.terminate("hangup")),a&&a(!1),Z.emitLocal("yeastarSession",!1)):t&&(await(t==null?void 0:t.hangup()),o&&o(!1),Z.emitLocal("flashphonerCall",!1))},attachRemoteAudio(r){if(!r)return;let e=document.getElementById("ys-remote-audio");e||(e=document.createElement("audio"),e.id="ys-remote-audio",e.autoplay=!0,e.playsInline=!0,e.hidden=!0,document.body.appendChild(e)),e.srcObject=r,e.play().catch(()=>{console.warn("User gesture needed to play audio"),Z.emitLocal("needUserGestureToPlay",!0)})},getContactName(r){return r&&((ce==null?void 0:ce.contacts)||{1001:"John Doe",1002:"Jane Smith","08123456789":"Alice Johnson",123:"Customer Support"})[r]||null},async updateExtensionStatus(r,e="Ready",t="ready"){var s,i,n;try{const a=(ce==null?void 0:ce["X-CPAAS-Key-Fingerprint"])||(ce==null?void 0:ce.fingerprint)||(ce==null?void 0:ce.cpaasKeyFingerprint)||((s=ce==null?void 0:ce.env)==null?void 0:s.fingerprint)||((i=ce==null?void 0:ce.env)==null?void 0:i.X_CPAAS_Key_Fingerprint)||((n=ce==null?void 0:ce.pabxConfig)==null?void 0:n["X-CPAAS-Key-Fingerprint"]);if(!a)return console.warn("X-CPAAS-Key-Fingerprint not found. Cannot update extension status."),!1;const o=await fetch("https://api-cpaas.omnix.co.id/voice/extensions/status",{method:"POST",headers:{"X-CPAAS-Key-Fingerprint":a,"Content-Type":"application/json"},body:JSON.stringify({extension:r,status:e,reason:t})}),d=await o.json();return console.log(`[ExtStatus] ${e}/${t}:`,d),o.ok}catch(a){return console.error("Failed to update extension status:",a),!1}},getExtensionUsername(){var r,e;return((r=ce==null?void 0:ce.auth)==null?void 0:r.user_pbx)||((e=ce==null?void 0:ce.auth)==null?void 0:e.username)||null}};function q0({initialRegisterStatus:r="CONNECTING",autoReady:e=!0,showAuxButton:t=!1,auxOptions:s=[]}){const[i,n]=Q.useState(""),[a,o]=Q.useState("Idle"),[d,c]=Q.useState("00:00"),[l,g]=Q.useState(!1),[u,y]=Q.useState(!1),[w,b]=Q.useState(!1),[C,x]=Q.useState(""),[p,E]=Q.useState(""),[_,R]=Q.useState(""),[T,F]=Q.useState(r),[h,N]=Q.useState(""),[A,f]=Q.useState(e&&r==="REGISTERED"?"READY":"NOT_READY"),[v,m]=Q.useState(!1),[L,j]=Q.useState(null),X=Q.useCallback(q=>{E(q),setTimeout(()=>E(""),4e3)},[]);Q.useEffect(()=>{const q=[Z.on("call_status",K=>{o(K),K!=="InCall"&&(b(!1),x(""),y(!1),g(!1))}),Z.on("call_duration",c),Z.on("incoming_call",K=>{var pt,Ue,Ne,lt,Xe,Tt,mt,vt;const Ee=((Ue=(pt=K==null?void 0:K.remoteIdentity)==null?void 0:pt.uri)==null?void 0:Ue.user)||(K==null?void 0:K.from_id)||"Unknown",ct=((Ne=K==null?void 0:K.remoteIdentity)==null?void 0:Ne.displayName)||((Xe=(lt=K==null?void 0:K.request)==null?void 0:lt.from)==null?void 0:Xe.displayName)||((vt=(mt=(Tt=K==null?void 0:K.incomingInviteRequest)==null?void 0:Tt.message)==null?void 0:mt.from)==null?void 0:vt.displayName)||(K==null?void 0:K.from_name)||Ge.getContactName(Ee)||"";n(Ee),R(ct),o("Ringing")}),Z.on("register_status",K=>{const Ee=typeof K=="string"?K:(K==null?void 0:K.status)??"FAILED",ct=typeof K=="object"?K==null?void 0:K.reason:"";F(Ee),N(Ee==="FAILED"?ct||"Failed to connect to Voice Platform":""),Ee!=="REGISTERED"&&f("NOT_READY")}),Z.on("agent_status",K=>{f(K),K!=="AUX"&&j(null)}),Z.on("call_failed",K=>X(K||"Call Failed"))];return()=>q.forEach(K=>K())},[X]),Q.useEffect(()=>{a==="Idle"&&R(Ge.getContactName(i)||"")},[i,a]),Q.useEffect(()=>{const q=K=>{K.metaKey||K.ctrlKey||K.altKey||(a==="InCall"&&/^[0-9*#]$/.test(K.key)?P(K.key):a==="Idle"&&T==="REGISTERED"&&/^[0-9+*#]$/.test(K.key)?n(Ee=>Ee+K.key):a==="Idle"&&K.key==="Backspace"?n(Ee=>Ee.slice(0,-1)):a==="Idle"&&K.key==="Enter"&&I())};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[a,T,i]);const W=async(q,K)=>{const Ee=Ge.getExtensionUsername();if(!Ee)return!1;m(!0);const ct=await Ge.updateExtensionStatus(Ee,q,K);return m(!1),ct},ie=async()=>{await W("Ready","ready")&&(f("READY"),j(null),Z.emitLocal("agent_status","READY"))},he=async()=>{await W("Logout","not_ready")&&(f("NOT_READY"),j(null),Z.emitLocal("agent_status","NOT_READY"))},ue=async(q=null)=>{const K=(q==null?void 0:q.code)||"AUX",Ee=(q==null?void 0:q.label)||"AUX";await W("AUX",K)&&(f("AUX"),j({code:K,label:Ee}),Z.emitLocal("agent_status","AUX")),setShowAuxMenu(!1)},I=()=>{const q=i.trim();q&&Z.emitLocal("local_dial",{number:q})},P=q=>{x(K=>K+q),Z.emitLocal("local_dtmf",{key:q})},$=()=>Z.emitLocal("local_hangup"),H=()=>Z.emitLocal("local_answer"),we=()=>Z.emitLocal("local_reject"),pe=()=>{const q=!l;g(q),Z.emitLocal("local_toggle_mute",{muted:q})},ke=()=>{Z.emitLocal("local_toggle_hold",{isOnHold:u,setIsOnHold:y})};return a==="Ringing"?S.jsxs(Or,{error:p,children:[S.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-10 gap-7 min-h-[300px] animate-fadeIn",children:[S.jsx(Bi,{color:"green",pulse:!0,children:S.jsx(Pn,{className:"w-9 h-9 text-green-600"})}),S.jsxs("div",{className:"text-center space-y-1",children:[S.jsx("p",{className:"text-lg font-bold text-gray-800 leading-tight",children:_||i||"Unknown"}),_&&S.jsx("p",{className:"text-sm font-mono text-gray-400 tracking-wider",children:i}),S.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-green-50 border border-green-100 mt-1",children:[S.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"}),S.jsx("span",{className:"text-[11px] font-semibold text-green-600 uppercase tracking-widest",children:"Incoming Call"})]})]})]}),S.jsxs(Ea,{children:[S.jsx(Ii,{color:"red",size:"lg",onClick:we,title:"Reject",children:S.jsx(ns,{className:"w-6 h-6"})}),S.jsx(Ii,{color:"green",size:"lg",onClick:H,title:"Answer",pulse:!0,children:S.jsx(as,{className:"w-6 h-6 fill-white"})})]})]}):a==="Calling..."?S.jsxs(Or,{error:p,children:[S.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-10 gap-7 min-h-[300px] animate-fadeIn",children:[S.jsx(Bi,{color:"primary",pulse:!0,children:S.jsx(c0,{className:"w-9 h-9 text-primary"})}),S.jsxs("div",{className:"text-center space-y-1",children:[S.jsx("p",{className:"text-lg font-bold text-gray-800 leading-tight",children:_||i}),_&&S.jsx("p",{className:"text-xs font-mono text-gray-400 tracking-wider",children:i}),S.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/8 border border-primary/15 mt-1",children:[S.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary animate-pulse"}),S.jsx("span",{className:"text-[11px] font-semibold text-primary uppercase tracking-widest",children:"Dialing..."})]})]})]}),S.jsx(Ea,{children:S.jsx(Ii,{color:"red",size:"lg",onClick:$,title:"Cancel",children:S.jsx(ns,{className:"w-6 h-6"})})})]}):a==="InCall"?S.jsxs(Or,{error:p,children:[w?S.jsxs("div",{className:"animate-fadeIn",children:[S.jsxs("div",{className:"px-6 pt-5 pb-2 text-center",children:[S.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-[0.2em] mb-2",children:"DTMF"}),S.jsx("div",{className:"min-h-[44px] flex items-center justify-center",children:S.jsx("span",{className:"text-3xl font-light text-gray-700 tracking-[0.25em] font-mono",children:C||S.jsx("span",{className:"text-gray-200",children:"—"})})})]}),S.jsx($n,{onKeyPress:P})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-10 gap-7 min-h-[300px] animate-fadeIn",children:[S.jsx(Bi,{color:u?"primary":"green",pulse:!u,children:u?S.jsx(Hn,{className:"w-9 h-9 text-primary"}):S.jsx(Pn,{className:"w-9 h-9 text-green-600"})}),S.jsxs("div",{className:"text-center space-y-1",children:[S.jsx("p",{className:"text-base font-bold text-gray-800 leading-tight",children:_||i||"Connected"}),_&&S.jsx("p",{className:"text-xs font-mono text-gray-400 tracking-wider",children:i}),S.jsxs("div",{className:"flex items-center justify-center gap-2 mt-1",children:[!u&&S.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"}),S.jsx("span",{className:`text-sm font-mono font-semibold ${u?"text-primary":"text-green-600"}`,children:u?"On Hold":d})]})]})]}),S.jsx("div",{className:"border-t border-gray-100 bg-gray-50/60 px-6 py-4",children:S.jsxs("div",{className:"flex items-center justify-between gap-2 max-w-[260px] mx-auto",children:[S.jsx(Hi,{onClick:pe,active:l,activeColor:"red",title:l?"Unmute":"Mute",children:l?S.jsx(a0,{className:"w-[18px] h-[18px]"}):S.jsx(o0,{className:"w-[18px] h-[18px]"})}),S.jsx(Hi,{onClick:ke,active:u,activeColor:"primary",title:u?"Resume":"Hold",children:u?S.jsx(l0,{className:"w-[18px] h-[18px]"}):S.jsx(Hn,{className:"w-[18px] h-[18px]"})}),S.jsx(Hi,{onClick:()=>b(q=>!q),active:w,activeColor:"primary",title:"Keypad",children:S.jsx(n0,{className:"w-[18px] h-[18px]"})}),S.jsx("button",{onClick:$,title:"End Call",className:"w-12 h-12 rounded-full bg-red-500 hover:bg-red-600 text-white flex items-center justify-center shadow-[0_4px_14px_rgba(239,68,68,0.4)] hover:shadow-[0_6px_18px_rgba(239,68,68,0.5)] transition-all active:scale-95",children:S.jsx(ns,{className:"w-5 h-5"})})]})})]}):T==="REGISTERED"?S.jsxs(Or,{error:p,children:[S.jsxs("div",{className:"px-5 pt-5 pb-1",children:[S.jsxs("div",{className:"relative flex items-center justify-center min-h-[56px] bg-gray-50 rounded-2xl border border-gray-100 px-10",children:[S.jsx("input",{type:"text",value:i,onChange:q=>n(q.target.value.replace(/[^0-9+*#]/g,"")),onKeyDown:q=>q.key==="Enter"&&I(),className:"w-full text-center text-[28px] font-light text-gray-800 tracking-[0.12em] bg-transparent outline-none placeholder:text-gray-300 placeholder:text-2xl placeholder:font-normal",placeholder:"Enter number"}),i&&S.jsx("button",{onClick:()=>n(q=>q.slice(0,-1)),onMouseDown:q=>q.preventDefault(),className:"absolute right-3 p-1.5 rounded-full text-gray-300 hover:text-gray-500 hover:bg-gray-200 transition-all",children:S.jsx(i0,{className:"w-4 h-4"})})]}),_&&S.jsx("p",{className:"text-center text-xs text-primary/70 font-medium mt-1.5 tracking-wide",children:_})]}),S.jsx($n,{onKeyPress:q=>n(K=>K+q)}),S.jsx("div",{className:"px-5 pb-4 pt-1 flex justify-center",children:S.jsxs("button",{onClick:I,disabled:!i.trim(),className:`
143
+ */return t.mode.CTRGladman=function(){var s=t.lib.BlockCipherMode.extend();function i(o){if((o>>24&255)===255){var d=o>>16&255,c=o>>8&255,l=o&255;d===255?(d=0,c===255?(c=0,l===255?l=0:++l):++c):++d,o=0,o+=d<<16,o+=c<<8,o+=l}else o+=1<<24;return o}function n(o){return(o[0]=i(o[0]))===0&&(o[1]=i(o[1])),o}var a=s.Encryptor=s.extend({processBlock:function(o,d){var c=this._cipher,l=c.blockSize,g=this._iv,u=this._counter;g&&(u=this._counter=g.slice(0),this._iv=void 0),n(u);var y=u.slice(0);c.encryptBlock(y,0);for(var w=0;w<l;w++)o[d+w]^=y[w]}});return s.Decryptor=a,s}(),t.mode.CTRGladman})}(mi)),mi.exports}var vi={exports:{}},aa;function E0(){return aa||(aa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.mode.OFB=function(){var s=t.lib.BlockCipherMode.extend(),i=s.Encryptor=s.extend({processBlock:function(n,a){var o=this._cipher,d=o.blockSize,c=this._iv,l=this._keystream;c&&(l=this._keystream=c.slice(0),this._iv=void 0),o.encryptBlock(l,0);for(var g=0;g<d;g++)n[a+g]^=l[g]}});return s.Decryptor=i,s}(),t.mode.OFB})}(vi)),vi.exports}var yi={exports:{}},oa;function b0(){return oa||(oa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.mode.ECB=function(){var s=t.lib.BlockCipherMode.extend();return s.Encryptor=s.extend({processBlock:function(i,n){this._cipher.encryptBlock(i,n)}}),s.Decryptor=s.extend({processBlock:function(i,n){this._cipher.decryptBlock(i,n)}}),s}(),t.mode.ECB})}(yi)),yi.exports}var wi={exports:{}},ca;function C0(){return ca||(ca=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.AnsiX923={pad:function(s,i){var n=s.sigBytes,a=i*4,o=a-n%a,d=n+o-1;s.clamp(),s.words[d>>>2]|=o<<24-d%4*8,s.sigBytes+=o},unpad:function(s){var i=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=i}},t.pad.Ansix923})}(wi)),wi.exports}var Ei={exports:{}},la;function _0(){return la||(la=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.Iso10126={pad:function(s,i){var n=i*4,a=n-s.sigBytes%n;s.concat(t.lib.WordArray.random(a-1)).concat(t.lib.WordArray.create([a<<24],1))},unpad:function(s){var i=s.words[s.sigBytes-1>>>2]&255;s.sigBytes-=i}},t.pad.Iso10126})}(Ei)),Ei.exports}var bi={exports:{}},da;function D0(){return da||(da=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.Iso97971={pad:function(s,i){s.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(s,i)},unpad:function(s){t.pad.ZeroPadding.unpad(s),s.sigBytes--}},t.pad.Iso97971})}(bi)),bi.exports}var Ci={exports:{}},ha;function A0(){return ha||(ha=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.ZeroPadding={pad:function(s,i){var n=i*4;s.clamp(),s.sigBytes+=n-(s.sigBytes%n||n)},unpad:function(s){for(var i=s.words,n=s.sigBytes-1,n=s.sigBytes-1;n>=0;n--)if(i[n>>>2]>>>24-n%4*8&255){s.sigBytes=n+1;break}}},t.pad.ZeroPadding})}(Ci)),Ci.exports}var _i={exports:{}},ua;function S0(){return ua||(ua=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(_i)),_i.exports}var Di={exports:{}},fa;function T0(){return fa||(fa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),Pe())})(se,function(t){return function(s){var i=t,n=i.lib,a=n.CipherParams,o=i.enc,d=o.Hex,c=i.format;c.Hex={stringify:function(l){return l.ciphertext.toString(d)},parse:function(l){var g=d.parse(l);return a.create({ciphertext:g})}}}(),t.format.Hex})}(Di)),Di.exports}var Ai={exports:{}},ga;function R0(){return ga||(ga=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.BlockCipher,a=s.algo,o=[],d=[],c=[],l=[],g=[],u=[],y=[],w=[],b=[],C=[];(function(){for(var E=[],_=0;_<256;_++)_<128?E[_]=_<<1:E[_]=_<<1^283;for(var T=0,S=0,_=0;_<256;_++){var R=S^S<<1^S<<2^S<<3^S<<4;R=R>>>8^R&255^99,o[T]=R,d[R]=T;var h=E[T],N=E[h],A=E[N],f=E[R]*257^R*16843008;c[T]=f<<24|f>>>8,l[T]=f<<16|f>>>16,g[T]=f<<8|f>>>24,u[T]=f;var f=A*16843009^N*65537^h*257^T*16843008;y[R]=f<<24|f>>>8,w[R]=f<<16|f>>>16,b[R]=f<<8|f>>>24,C[R]=f,T?(T=h^E[E[E[A^h]]],S^=E[E[S]]):T=S=1}})();var x=[0,1,2,4,8,16,32,64,128,27,54],p=a.AES=n.extend({_doReset:function(){var E;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var _=this._keyPriorReset=this._key,T=_.words,S=_.sigBytes/4,R=this._nRounds=S+6,h=(R+1)*4,N=this._keySchedule=[],A=0;A<h;A++)A<S?N[A]=T[A]:(E=N[A-1],A%S?S>6&&A%S==4&&(E=o[E>>>24]<<24|o[E>>>16&255]<<16|o[E>>>8&255]<<8|o[E&255]):(E=E<<8|E>>>24,E=o[E>>>24]<<24|o[E>>>16&255]<<16|o[E>>>8&255]<<8|o[E&255],E^=x[A/S|0]<<24),N[A]=N[A-S]^E);for(var f=this._invKeySchedule=[],v=0;v<h;v++){var A=h-v;if(v%4)var E=N[A];else var E=N[A-4];v<4||A<=4?f[v]=E:f[v]=y[o[E>>>24]]^w[o[E>>>16&255]]^b[o[E>>>8&255]]^C[o[E&255]]}}},encryptBlock:function(E,_){this._doCryptBlock(E,_,this._keySchedule,c,l,g,u,o)},decryptBlock:function(E,_){var T=E[_+1];E[_+1]=E[_+3],E[_+3]=T,this._doCryptBlock(E,_,this._invKeySchedule,y,w,b,C,d);var T=E[_+1];E[_+1]=E[_+3],E[_+3]=T},_doCryptBlock:function(E,_,T,S,R,h,N,A){for(var f=this._nRounds,v=E[_]^T[0],m=E[_+1]^T[1],U=E[_+2]^T[2],q=E[_+3]^T[3],X=4,W=1;W<f;W++){var ie=S[v>>>24]^R[m>>>16&255]^h[U>>>8&255]^N[q&255]^T[X++],he=S[m>>>24]^R[U>>>16&255]^h[q>>>8&255]^N[v&255]^T[X++],ue=S[U>>>24]^R[q>>>16&255]^h[v>>>8&255]^N[m&255]^T[X++],I=S[q>>>24]^R[v>>>16&255]^h[m>>>8&255]^N[U&255]^T[X++];v=ie,m=he,U=ue,q=I}var ie=(A[v>>>24]<<24|A[m>>>16&255]<<16|A[U>>>8&255]<<8|A[q&255])^T[X++],he=(A[m>>>24]<<24|A[U>>>16&255]<<16|A[q>>>8&255]<<8|A[v&255])^T[X++],ue=(A[U>>>24]<<24|A[q>>>16&255]<<16|A[v>>>8&255]<<8|A[m&255])^T[X++],I=(A[q>>>24]<<24|A[v>>>16&255]<<16|A[m>>>8&255]<<8|A[U&255])^T[X++];E[_]=ie,E[_+1]=he,E[_+2]=ue,E[_+3]=I},keySize:256/32});s.AES=n._createHelper(p)}(),t.AES})}(Ai)),Ai.exports}var Si={exports:{}},xa;function F0(){return xa||(xa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.WordArray,a=i.BlockCipher,o=s.algo,d=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],c=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],g=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],y=o.DES=a.extend({_doReset:function(){for(var x=this._key,p=x.words,E=[],_=0;_<56;_++){var T=d[_]-1;E[_]=p[T>>>5]>>>31-T%32&1}for(var S=this._subKeys=[],R=0;R<16;R++){for(var h=S[R]=[],N=l[R],_=0;_<24;_++)h[_/6|0]|=E[(c[_]-1+N)%28]<<31-_%6,h[4+(_/6|0)]|=E[28+(c[_+24]-1+N)%28]<<31-_%6;h[0]=h[0]<<1|h[0]>>>31;for(var _=1;_<7;_++)h[_]=h[_]>>>(_-1)*4+3;h[7]=h[7]<<5|h[7]>>>27}for(var A=this._invSubKeys=[],_=0;_<16;_++)A[_]=S[15-_]},encryptBlock:function(x,p){this._doCryptBlock(x,p,this._subKeys)},decryptBlock:function(x,p){this._doCryptBlock(x,p,this._invSubKeys)},_doCryptBlock:function(x,p,E){this._lBlock=x[p],this._rBlock=x[p+1],w.call(this,4,252645135),w.call(this,16,65535),b.call(this,2,858993459),b.call(this,8,16711935),w.call(this,1,1431655765);for(var _=0;_<16;_++){for(var T=E[_],S=this._lBlock,R=this._rBlock,h=0,N=0;N<8;N++)h|=g[N][((R^T[N])&u[N])>>>0];this._lBlock=R,this._rBlock=S^h}var A=this._lBlock;this._lBlock=this._rBlock,this._rBlock=A,w.call(this,1,1431655765),b.call(this,8,16711935),b.call(this,2,858993459),w.call(this,16,65535),w.call(this,4,252645135),x[p]=this._lBlock,x[p+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function w(x,p){var E=(this._lBlock>>>x^this._rBlock)&p;this._rBlock^=E,this._lBlock^=E<<x}function b(x,p){var E=(this._rBlock>>>x^this._lBlock)&p;this._lBlock^=E,this._rBlock^=E<<x}s.DES=a._createHelper(y);var C=o.TripleDES=a.extend({_doReset:function(){var x=this._key,p=x.words;if(p.length!==2&&p.length!==4&&p.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var E=p.slice(0,2),_=p.length<4?p.slice(0,2):p.slice(2,4),T=p.length<6?p.slice(0,2):p.slice(4,6);this._des1=y.createEncryptor(n.create(E)),this._des2=y.createEncryptor(n.create(_)),this._des3=y.createEncryptor(n.create(T))},encryptBlock:function(x,p){this._des1.encryptBlock(x,p),this._des2.decryptBlock(x,p),this._des3.encryptBlock(x,p)},decryptBlock:function(x,p){this._des3.decryptBlock(x,p),this._des2.encryptBlock(x,p),this._des1.decryptBlock(x,p)},keySize:192/32,ivSize:64/32,blockSize:64/32});s.TripleDES=a._createHelper(C)}(),t.TripleDES})}(Si)),Si.exports}var Ti={exports:{}},pa;function k0(){return pa||(pa=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,a=s.algo,o=a.RC4=n.extend({_doReset:function(){for(var l=this._key,g=l.words,u=l.sigBytes,y=this._S=[],w=0;w<256;w++)y[w]=w;for(var w=0,b=0;w<256;w++){var C=w%u,x=g[C>>>2]>>>24-C%4*8&255;b=(b+y[w]+x)%256;var p=y[w];y[w]=y[b],y[b]=p}this._i=this._j=0},_doProcessBlock:function(l,g){l[g]^=d.call(this)},keySize:256/32,ivSize:0});function d(){for(var l=this._S,g=this._i,u=this._j,y=0,w=0;w<4;w++){g=(g+1)%256,u=(u+l[g])%256;var b=l[g];l[g]=l[u],l[u]=b,y|=l[(l[g]+l[u])%256]<<24-w*8}return this._i=g,this._j=u,y}s.RC4=n._createHelper(o);var c=a.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var l=this.cfg.drop;l>0;l--)d.call(this)}});s.RC4Drop=n._createHelper(c)}(),t.RC4})}(Ti)),Ti.exports}var Ri={exports:{}},ma;function B0(){return ma||(ma=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,a=s.algo,o=[],d=[],c=[],l=a.Rabbit=n.extend({_doReset:function(){for(var u=this._key.words,y=this.cfg.iv,w=0;w<4;w++)u[w]=(u[w]<<8|u[w]>>>24)&16711935|(u[w]<<24|u[w]>>>8)&4278255360;var b=this._X=[u[0],u[3]<<16|u[2]>>>16,u[1],u[0]<<16|u[3]>>>16,u[2],u[1]<<16|u[0]>>>16,u[3],u[2]<<16|u[1]>>>16],C=this._C=[u[2]<<16|u[2]>>>16,u[0]&4294901760|u[1]&65535,u[3]<<16|u[3]>>>16,u[1]&4294901760|u[2]&65535,u[0]<<16|u[0]>>>16,u[2]&4294901760|u[3]&65535,u[1]<<16|u[1]>>>16,u[3]&4294901760|u[0]&65535];this._b=0;for(var w=0;w<4;w++)g.call(this);for(var w=0;w<8;w++)C[w]^=b[w+4&7];if(y){var x=y.words,p=x[0],E=x[1],_=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,T=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,S=_>>>16|T&4294901760,R=T<<16|_&65535;C[0]^=_,C[1]^=S,C[2]^=T,C[3]^=R,C[4]^=_,C[5]^=S,C[6]^=T,C[7]^=R;for(var w=0;w<4;w++)g.call(this)}},_doProcessBlock:function(u,y){var w=this._X;g.call(this),o[0]=w[0]^w[5]>>>16^w[3]<<16,o[1]=w[2]^w[7]>>>16^w[5]<<16,o[2]=w[4]^w[1]>>>16^w[7]<<16,o[3]=w[6]^w[3]>>>16^w[1]<<16;for(var b=0;b<4;b++)o[b]=(o[b]<<8|o[b]>>>24)&16711935|(o[b]<<24|o[b]>>>8)&4278255360,u[y+b]^=o[b]},blockSize:128/32,ivSize:64/32});function g(){for(var u=this._X,y=this._C,w=0;w<8;w++)d[w]=y[w];y[0]=y[0]+1295307597+this._b|0,y[1]=y[1]+3545052371+(y[0]>>>0<d[0]>>>0?1:0)|0,y[2]=y[2]+886263092+(y[1]>>>0<d[1]>>>0?1:0)|0,y[3]=y[3]+1295307597+(y[2]>>>0<d[2]>>>0?1:0)|0,y[4]=y[4]+3545052371+(y[3]>>>0<d[3]>>>0?1:0)|0,y[5]=y[5]+886263092+(y[4]>>>0<d[4]>>>0?1:0)|0,y[6]=y[6]+1295307597+(y[5]>>>0<d[5]>>>0?1:0)|0,y[7]=y[7]+3545052371+(y[6]>>>0<d[6]>>>0?1:0)|0,this._b=y[7]>>>0<d[7]>>>0?1:0;for(var w=0;w<8;w++){var b=u[w]+y[w],C=b&65535,x=b>>>16,p=((C*C>>>17)+C*x>>>15)+x*x,E=((b&4294901760)*b|0)+((b&65535)*b|0);c[w]=p^E}u[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,u[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,u[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,u[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,u[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,u[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,u[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,u[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}s.Rabbit=n._createHelper(l)}(),t.Rabbit})}(Ri)),Ri.exports}var Fi={exports:{}},va;function I0(){return va||(va=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.StreamCipher,a=s.algo,o=[],d=[],c=[],l=a.RabbitLegacy=n.extend({_doReset:function(){var u=this._key.words,y=this.cfg.iv,w=this._X=[u[0],u[3]<<16|u[2]>>>16,u[1],u[0]<<16|u[3]>>>16,u[2],u[1]<<16|u[0]>>>16,u[3],u[2]<<16|u[1]>>>16],b=this._C=[u[2]<<16|u[2]>>>16,u[0]&4294901760|u[1]&65535,u[3]<<16|u[3]>>>16,u[1]&4294901760|u[2]&65535,u[0]<<16|u[0]>>>16,u[2]&4294901760|u[3]&65535,u[1]<<16|u[1]>>>16,u[3]&4294901760|u[0]&65535];this._b=0;for(var C=0;C<4;C++)g.call(this);for(var C=0;C<8;C++)b[C]^=w[C+4&7];if(y){var x=y.words,p=x[0],E=x[1],_=(p<<8|p>>>24)&16711935|(p<<24|p>>>8)&4278255360,T=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,S=_>>>16|T&4294901760,R=T<<16|_&65535;b[0]^=_,b[1]^=S,b[2]^=T,b[3]^=R,b[4]^=_,b[5]^=S,b[6]^=T,b[7]^=R;for(var C=0;C<4;C++)g.call(this)}},_doProcessBlock:function(u,y){var w=this._X;g.call(this),o[0]=w[0]^w[5]>>>16^w[3]<<16,o[1]=w[2]^w[7]>>>16^w[5]<<16,o[2]=w[4]^w[1]>>>16^w[7]<<16,o[3]=w[6]^w[3]>>>16^w[1]<<16;for(var b=0;b<4;b++)o[b]=(o[b]<<8|o[b]>>>24)&16711935|(o[b]<<24|o[b]>>>8)&4278255360,u[y+b]^=o[b]},blockSize:128/32,ivSize:64/32});function g(){for(var u=this._X,y=this._C,w=0;w<8;w++)d[w]=y[w];y[0]=y[0]+1295307597+this._b|0,y[1]=y[1]+3545052371+(y[0]>>>0<d[0]>>>0?1:0)|0,y[2]=y[2]+886263092+(y[1]>>>0<d[1]>>>0?1:0)|0,y[3]=y[3]+1295307597+(y[2]>>>0<d[2]>>>0?1:0)|0,y[4]=y[4]+3545052371+(y[3]>>>0<d[3]>>>0?1:0)|0,y[5]=y[5]+886263092+(y[4]>>>0<d[4]>>>0?1:0)|0,y[6]=y[6]+1295307597+(y[5]>>>0<d[5]>>>0?1:0)|0,y[7]=y[7]+3545052371+(y[6]>>>0<d[6]>>>0?1:0)|0,this._b=y[7]>>>0<d[7]>>>0?1:0;for(var w=0;w<8;w++){var b=u[w]+y[w],C=b&65535,x=b>>>16,p=((C*C>>>17)+C*x>>>15)+x*x,E=((b&4294901760)*b|0)+((b&65535)*b|0);c[w]=p^E}u[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,u[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,u[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,u[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,u[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,u[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,u[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,u[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}s.RabbitLegacy=n._createHelper(l)}(),t.RabbitLegacy})}(Fi)),Fi.exports}var ki={exports:{}},ya;function H0(){return ya||(ya=1,function(r,e){(function(t,s,i){r.exports=s(oe(),sr(),ir(),Wt(),Pe())})(se,function(t){return function(){var s=t,i=s.lib,n=i.BlockCipher,a=s.algo;const o=16,d=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],c=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var l={pbox:[],sbox:[]};function g(C,x){let p=x>>24&255,E=x>>16&255,_=x>>8&255,T=x&255,S=C.sbox[0][p]+C.sbox[1][E];return S=S^C.sbox[2][_],S=S+C.sbox[3][T],S}function u(C,x,p){let E=x,_=p,T;for(let S=0;S<o;++S)E=E^C.pbox[S],_=g(C,E)^_,T=E,E=_,_=T;return T=E,E=_,_=T,_=_^C.pbox[o],E=E^C.pbox[o+1],{left:E,right:_}}function y(C,x,p){let E=x,_=p,T;for(let S=o+1;S>1;--S)E=E^C.pbox[S],_=g(C,E)^_,T=E,E=_,_=T;return T=E,E=_,_=T,_=_^C.pbox[1],E=E^C.pbox[0],{left:E,right:_}}function w(C,x,p){for(let R=0;R<4;R++){C.sbox[R]=[];for(let h=0;h<256;h++)C.sbox[R][h]=c[R][h]}let E=0;for(let R=0;R<o+2;R++)C.pbox[R]=d[R]^x[E],E++,E>=p&&(E=0);let _=0,T=0,S=0;for(let R=0;R<o+2;R+=2)S=u(C,_,T),_=S.left,T=S.right,C.pbox[R]=_,C.pbox[R+1]=T;for(let R=0;R<4;R++)for(let h=0;h<256;h+=2)S=u(C,_,T),_=S.left,T=S.right,C.sbox[R][h]=_,C.sbox[R][h+1]=T;return!0}var b=a.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var C=this._keyPriorReset=this._key,x=C.words,p=C.sigBytes/4;w(l,x,p)}},encryptBlock:function(C,x){var p=u(l,C[x],C[x+1]);C[x]=p.left,C[x+1]=p.right},decryptBlock:function(C,x){var p=y(l,C[x],C[x+1]);C[x]=p.left,C[x+1]=p.right},blockSize:64/32,keySize:128/32,ivSize:64/32});s.Blowfish=n._createHelper(b)}(),t.Blowfish})}(ki)),ki.exports}(function(r,e){(function(t,s,i){r.exports=s(oe(),os(),d0(),h0(),sr(),u0(),ir(),Wn(),ii(),f0(),Kn(),g0(),x0(),p0(),hi(),m0(),Wt(),Pe(),v0(),y0(),w0(),E0(),b0(),C0(),_0(),D0(),A0(),S0(),T0(),R0(),F0(),k0(),B0(),I0(),H0())})(se,function(t){return t})})($n);var P0=$n.exports;const nr=Lo(P0);let ce=null,Ae=null,mr=null;const Ge={setConfig(r){ce=r},getConfig(){return ce},decrypt(r,e=null,t=null){var s,i;try{const n=e||((s=ce==null?void 0:ce.env)==null?void 0:s.DECODE_IV)||"default_iv_1234",a=t||((i=ce==null?void 0:ce.env)==null?void 0:i.DECODE_KEY)||"default_key_1234",o=nr.enc.Base64.parse(r),d=nr.enc.Utf8.parse(a),c=nr.enc.Utf8.parse(n);return nr.AES.decrypt({ciphertext:o},d,{iv:c,mode:nr.mode.CTR,padding:nr.pad.NoPadding}).toString(nr.enc.Utf8)}catch(n){return console.log("ERROR ===> failed decrypt:",n),!1}},pushSound(){try{mr&&clearInterval(mr);const r=()=>{try{(!Ae||Ae.state==="closed")&&(Ae=new(window.AudioContext||window.webkitAudioContext)),Ae.state==="suspended"&&Ae.resume();const e=Ae.createOscillator(),t=Ae.createOscillator(),s=Ae.createGain();e.type="sine",t.type="sine",e.frequency.setValueAtTime(400,Ae.currentTime),t.frequency.setValueAtTime(450,Ae.currentTime);const i=Ae.createOscillator(),n=Ae.createGain();i.frequency.value=25,n.gain.value=15,i.connect(n),n.connect(e.frequency),n.connect(t.frequency),e.connect(s),t.connect(s),s.connect(Ae.destination),s.gain.setValueAtTime(0,Ae.currentTime),s.gain.linearRampToValueAtTime(.08,Ae.currentTime+.05),s.gain.setValueAtTime(.08,Ae.currentTime+1.2),s.gain.linearRampToValueAtTime(0,Ae.currentTime+1.3),i.start(),e.start(),t.start(),i.stop(Ae.currentTime+1.4),e.stop(Ae.currentTime+1.4),t.stop(Ae.currentTime+1.4)}catch(e){console.warn("Failed to play synthesized tone:",e)}};r(),mr=setInterval(r,3e3)}catch(r){console.warn("AudioContext initialization failed:",r)}},stopSound(){mr&&(clearInterval(mr),mr=null),Ae&&(Ae.close().catch(()=>{}),Ae=null)},pushNotification(r){Z.emitToParent("show_notification",{message:r})},toHHMMSS(r){const e=parseInt(r,10),t=Math.floor(e/3600),s=Math.floor(e/60)%60,i=e%60;return[t,s,i].map(n=>n<10?"0"+n:n).filter((n,a)=>n!=="00"||a>0).join(":")},mute(r,e,t,s){r?e?r.unmute():r.mute():s&&(e?s.unmuteAudio():s.muteAudio()),t(!e)},hold(r,e,t,s){r?e?r.unhold():r.hold():s&&(e?s.unhold():s.hold()),t(!e)},async hangup(r,e,t,s,i,n,a,o){s&&await s(!1),i&&i(!1),n&&n(0),r&&r.current&&clearInterval(r.current),e?(await(e==null?void 0:e.terminate("hangup")),a&&a(!1),Z.emitLocal("yeastarSession",!1)):t&&(await(t==null?void 0:t.hangup()),o&&o(!1),Z.emitLocal("flashphonerCall",!1))},attachRemoteAudio(r){if(!r)return;let e=document.getElementById("ys-remote-audio");e||(e=document.createElement("audio"),e.id="ys-remote-audio",e.autoplay=!0,e.playsInline=!0,e.hidden=!0,document.body.appendChild(e)),e.srcObject=r,e.play().catch(()=>{console.warn("User gesture needed to play audio"),Z.emitLocal("needUserGestureToPlay",!0)})},getContactName(r){return r&&((ce==null?void 0:ce.contacts)||{1001:"John Doe",1002:"Jane Smith","08123456789":"Alice Johnson",123:"Customer Support"})[r]||null},async updateExtensionStatus(r,e="Ready",t="ready"){var s,i,n;try{const a=(ce==null?void 0:ce["X-CPAAS-Key-Fingerprint"])||(ce==null?void 0:ce.fingerprint)||(ce==null?void 0:ce.cpaasKeyFingerprint)||((s=ce==null?void 0:ce.env)==null?void 0:s.fingerprint)||((i=ce==null?void 0:ce.env)==null?void 0:i.X_CPAAS_Key_Fingerprint)||((n=ce==null?void 0:ce.pabxConfig)==null?void 0:n["X-CPAAS-Key-Fingerprint"]);if(!a)return console.warn("X-CPAAS-Key-Fingerprint not found. Cannot update extension status."),!1;const o=await fetch("https://api-cpaas.omnix.co.id/voice/extensions/status",{method:"POST",headers:{"X-CPAAS-Key-Fingerprint":a,"Content-Type":"application/json"},body:JSON.stringify({extension:r,status:e,reason:t})}),d=await o.json();return console.log(`[ExtStatus] ${e}/${t}:`,d),o.ok}catch(a){return console.error("Failed to update extension status:",a),!1}},getExtensionUsername(){var r,e;return((r=ce==null?void 0:ce.auth)==null?void 0:r.user_pbx)||((e=ce==null?void 0:ce.auth)==null?void 0:e.username)||null}};function $0({initialRegisterStatus:r="CONNECTING",autoReady:e=!0,showAuxButton:t=!1,auxOptions:s=[]}){const[i,n]=re.useState(""),[a,o]=re.useState("Idle"),[d,c]=re.useState("00:00"),[l,g]=re.useState(!1),[u,y]=re.useState(!1),[w,b]=re.useState(!1),[C,x]=re.useState(""),[p,E]=re.useState(""),[_,T]=re.useState(""),[S,R]=re.useState(r),[h,N]=re.useState(""),[A,f]=re.useState(e&&r==="REGISTERED"?"READY":"NOT_READY"),[v,m]=re.useState(!1),[U,q]=re.useState(null),X=re.useCallback(j=>{E(j),setTimeout(()=>E(""),4e3)},[]);re.useEffect(()=>{const j=[Z.on("call_status",K=>{o(K),K!=="InCall"&&(b(!1),x(""),y(!1),g(!1))}),Z.on("call_duration",c),Z.on("incoming_call",K=>{var pt,Le,Ne,lt,Xe,Tt,mt,vt;const Ee=((Le=(pt=K==null?void 0:K.remoteIdentity)==null?void 0:pt.uri)==null?void 0:Le.user)||(K==null?void 0:K.from_id)||"Unknown",ct=((Ne=K==null?void 0:K.remoteIdentity)==null?void 0:Ne.displayName)||((Xe=(lt=K==null?void 0:K.request)==null?void 0:lt.from)==null?void 0:Xe.displayName)||((vt=(mt=(Tt=K==null?void 0:K.incomingInviteRequest)==null?void 0:Tt.message)==null?void 0:mt.from)==null?void 0:vt.displayName)||(K==null?void 0:K.from_name)||Ge.getContactName(Ee)||"";n(Ee),T(ct),o("Ringing")}),Z.on("register_status",K=>{const Ee=typeof K=="string"?K:(K==null?void 0:K.status)??"FAILED",ct=typeof K=="object"?K==null?void 0:K.reason:"";R(Ee),N(Ee==="FAILED"?ct||"Failed to connect to Voice Platform":""),Ee!=="REGISTERED"&&f("NOT_READY")}),Z.on("agent_status",K=>{f(K),K!=="AUX"&&q(null)}),Z.on("call_failed",K=>X(K||"Call Failed"))];return()=>j.forEach(K=>K())},[X]),re.useEffect(()=>{a==="Idle"&&T(Ge.getContactName(i)||"")},[i,a]),re.useEffect(()=>{const j=K=>{K.metaKey||K.ctrlKey||K.altKey||(a==="InCall"&&/^[0-9*#]$/.test(K.key)?P(K.key):a==="Idle"&&S==="REGISTERED"&&/^[0-9+*#]$/.test(K.key)?n(Ee=>Ee+K.key):a==="Idle"&&K.key==="Backspace"?n(Ee=>Ee.slice(0,-1)):a==="Idle"&&K.key==="Enter"&&I())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[a,S,i]);const W=async(j,K)=>{const Ee=Ge.getExtensionUsername();if(!Ee)return!1;m(!0);const ct=await Ge.updateExtensionStatus(Ee,j,K);return m(!1),ct},ie=async()=>{await W("Ready","ready")&&(f("READY"),q(null),Z.emitLocal("agent_status","READY"))},he=async()=>{await W("Logout","not_ready")&&(f("NOT_READY"),q(null),Z.emitLocal("agent_status","NOT_READY"))},ue=async(j=null)=>{const K=(j==null?void 0:j.code)||"AUX",Ee=(j==null?void 0:j.label)||"AUX";await W("AUX",K)&&(f("AUX"),q({code:K,label:Ee}),Z.emitLocal("agent_status","AUX")),setShowAuxMenu(!1)},I=()=>{const j=i.trim();j&&Z.emitLocal("local_dial",{number:j})},P=j=>{x(K=>K+j),Z.emitLocal("local_dtmf",{key:j})},$=()=>Z.emitLocal("local_hangup"),H=()=>Z.emitLocal("local_answer"),we=()=>Z.emitLocal("local_reject"),pe=()=>{const j=!l;g(j),Z.emitLocal("local_toggle_mute",{muted:j})},ke=()=>{Z.emitLocal("local_toggle_hold",{isOnHold:u,setIsOnHold:y})};return a==="Ringing"?F.jsxs(Or,{error:p,children:[F.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-10 gap-7 min-h-[300px] animate-fadeIn",children:[F.jsx(Bi,{color:"green",pulse:!0,children:F.jsx(Hn,{className:"w-9 h-9 text-green-600"})}),F.jsxs("div",{className:"text-center space-y-1",children:[F.jsx("p",{className:"text-lg font-bold text-gray-800 leading-tight",children:_||i||"Unknown"}),_&&F.jsx("p",{className:"text-sm font-mono text-gray-400 tracking-wider",children:i}),F.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-green-50 border border-green-100 mt-1",children:[F.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"}),F.jsx("span",{className:"text-[11px] font-semibold text-green-600 uppercase tracking-widest",children:"Incoming Call"})]})]})]}),F.jsxs(wa,{children:[F.jsx(Ii,{color:"red",size:"lg",onClick:we,title:"Reject",children:F.jsx(ns,{className:"w-6 h-6"})}),F.jsx(Ii,{color:"green",size:"lg",onClick:H,title:"Answer",pulse:!0,children:F.jsx(as,{className:"w-6 h-6 fill-white"})})]})]}):a==="Calling..."?F.jsxs(Or,{error:p,children:[F.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-10 gap-7 min-h-[300px] animate-fadeIn",children:[F.jsx(Bi,{color:"primary",pulse:!0,children:F.jsx(s0,{className:"w-9 h-9 text-primary"})}),F.jsxs("div",{className:"text-center space-y-1",children:[F.jsx("p",{className:"text-lg font-bold text-gray-800 leading-tight",children:_||i}),_&&F.jsx("p",{className:"text-xs font-mono text-gray-400 tracking-wider",children:i}),F.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-primary/8 border border-primary/15 mt-1",children:[F.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary animate-pulse"}),F.jsx("span",{className:"text-[11px] font-semibold text-primary uppercase tracking-widest",children:"Dialing..."})]})]})]}),F.jsx(wa,{children:F.jsx(Ii,{color:"red",size:"lg",onClick:$,title:"Cancel",children:F.jsx(ns,{className:"w-6 h-6"})})})]}):a==="InCall"?F.jsxs(Or,{error:p,children:[w?F.jsxs("div",{className:"animate-fadeIn",children:[F.jsxs("div",{className:"px-6 pt-5 pb-2 text-center",children:[F.jsx("p",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-[0.2em] mb-2",children:"DTMF"}),F.jsx("div",{className:"min-h-[44px] flex items-center justify-center",children:F.jsx("span",{className:"text-3xl font-light text-gray-700 tracking-[0.25em] font-mono",children:C||F.jsx("span",{className:"text-gray-200",children:"—"})})})]}),F.jsx(Pn,{onKeyPress:P})]}):F.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-10 gap-7 min-h-[300px] animate-fadeIn",children:[F.jsx(Bi,{color:u?"primary":"green",pulse:!u,children:u?F.jsx(In,{className:"w-9 h-9 text-primary"}):F.jsx(Hn,{className:"w-9 h-9 text-green-600"})}),F.jsxs("div",{className:"text-center space-y-1",children:[F.jsx("p",{className:"text-base font-bold text-gray-800 leading-tight",children:_||i||"Connected"}),_&&F.jsx("p",{className:"text-xs font-mono text-gray-400 tracking-wider",children:i}),F.jsxs("div",{className:"flex items-center justify-center gap-2 mt-1",children:[!u&&F.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"}),F.jsx("span",{className:`text-sm font-mono font-semibold ${u?"text-primary":"text-green-600"}`,children:u?"On Hold":d})]})]})]}),F.jsx("div",{className:"border-t border-gray-100 bg-gray-50/60 px-6 py-4",children:F.jsxs("div",{className:"flex items-center justify-between gap-2 max-w-[260px] mx-auto",children:[F.jsx(Hi,{onClick:pe,active:l,activeColor:"red",title:l?"Unmute":"Mute",children:l?F.jsx(t0,{className:"w-[18px] h-[18px]"}):F.jsx(r0,{className:"w-[18px] h-[18px]"})}),F.jsx(Hi,{onClick:ke,active:u,activeColor:"primary",title:u?"Resume":"Hold",children:u?F.jsx(i0,{className:"w-[18px] h-[18px]"}):F.jsx(In,{className:"w-[18px] h-[18px]"})}),F.jsx(Hi,{onClick:()=>b(j=>!j),active:w,activeColor:"primary",title:"Keypad",children:F.jsx(e0,{className:"w-[18px] h-[18px]"})}),F.jsx("button",{onClick:$,title:"End Call",className:"w-12 h-12 rounded-full bg-red-500 hover:bg-red-600 text-white flex items-center justify-center shadow-[0_4px_14px_rgba(239,68,68,0.4)] hover:shadow-[0_6px_18px_rgba(239,68,68,0.5)] transition-all active:scale-95",children:F.jsx(ns,{className:"w-5 h-5"})})]})})]}):S==="REGISTERED"?F.jsxs(Or,{error:p,children:[F.jsxs("div",{className:"px-5 pt-5 pb-1",children:[F.jsxs("div",{className:"relative flex items-center justify-center min-h-[56px] bg-gray-50 rounded-2xl border border-gray-100 px-10",children:[F.jsx("input",{type:"text",value:i,onChange:j=>n(j.target.value.replace(/[^0-9+*#]/g,"")),onKeyDown:j=>j.key==="Enter"&&I(),className:"w-full text-center text-[28px] font-light text-gray-800 tracking-[0.12em] bg-transparent outline-none placeholder:text-gray-300 placeholder:text-2xl placeholder:font-normal",placeholder:"Enter number"}),i&&F.jsx("button",{onClick:()=>n(j=>j.slice(0,-1)),onMouseDown:j=>j.preventDefault(),className:"absolute right-3 p-1.5 rounded-full text-gray-300 hover:text-gray-500 hover:bg-gray-200 transition-all",children:F.jsx(Qo,{className:"w-4 h-4"})})]}),_&&F.jsx("p",{className:"text-center text-xs text-primary/70 font-medium mt-1.5 tracking-wide",children:_})]}),F.jsx(Pn,{onKeyPress:j=>n(K=>K+j)}),F.jsx("div",{className:"px-5 pb-4 pt-1 flex justify-center",children:F.jsxs("button",{onClick:I,disabled:!i.trim(),className:`
144
144
  flex items-center gap-3 px-10 py-3.5 rounded-full
145
145
  bg-gradient-to-r from-green-500 to-green-600
146
146
  hover:from-green-600 hover:to-green-700
@@ -150,40 +150,35 @@ React keys must be passed directly to JSX without using spread:
150
150
  hover:shadow-[0_6px_20px_rgba(34,197,94,0.5)]
151
151
  disabled:shadow-none
152
152
  transition-all active:scale-95
153
- `,children:[S.jsx(as,{className:"w-4 h-4 fill-white"}),"Call"]})}),S.jsx(L0,{agentStatus:A,currentAux:L,loading:v,autoReady:e,showAuxButton:t,auxOptions:s,onReady:ie,onNotReady:he,onAux:ue})]}):S.jsx(Or,{error:p,children:S.jsx("div",{className:"flex flex-col items-center justify-center px-6 py-12 gap-4 min-h-[280px] animate-fadeIn",children:T==="CONNECTING"?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"relative w-16 h-16",children:[S.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/20"}),S.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-transparent border-t-primary animate-spin"}),S.jsx("div",{className:"absolute inset-2 rounded-full bg-primary/10 flex items-center justify-center",children:S.jsx(as,{className:"w-5 h-5 text-primary",style:{transform:"rotate(90deg)"}})})]}),S.jsxs("div",{className:"text-center space-y-1",children:[S.jsx("p",{className:"text-sm font-semibold text-gray-700",children:"Connecting to server"}),S.jsx("p",{className:"text-xs text-gray-400",children:"Please wait..."})]})]}):S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"w-16 h-16 rounded-full bg-red-50 border-2 border-red-100 flex items-center justify-center",children:S.jsx(ns,{className:"w-7 h-7 text-red-400"})}),S.jsxs("div",{className:"text-center space-y-1.5",children:[S.jsx("p",{className:"text-sm font-bold text-red-600",children:"Not Registered"}),h&&S.jsx("p",{className:"text-xs text-gray-400 max-w-[220px] leading-relaxed",children:h})]})]})})})}function Or({children:r,error:e}){return S.jsxs("div",{className:"w-full relative select-none",children:[e&&S.jsxs("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 px-4 py-2 rounded-full bg-red-500 text-white text-xs font-semibold shadow-lg animate-slideUp whitespace-nowrap",children:[S.jsx(e0,{className:"w-3.5 h-3.5 shrink-0"}),e]}),r]})}function Ea({children:r}){return S.jsx("div",{className:"border-t border-gray-100 bg-gray-50/60 px-6 py-5 flex items-center justify-center gap-10 animate-slideUp",children:r})}function Bi({children:r,color:e="green",pulse:t=!1}){const s={green:{ring:"bg-green-500/15",ring2:"bg-green-500/8",wrap:"bg-green-50 border-green-200"},primary:{ring:"bg-primary/15",ring2:"bg-primary/8",wrap:"bg-primary/10 border-primary/20"},red:{ring:"bg-red-500/15",ring2:"bg-red-500/8",wrap:"bg-red-50 border-red-200"}},i=s[e]||s.green;return S.jsxs("div",{className:"relative flex items-center justify-center w-20 h-20",children:[t&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:`absolute w-20 h-20 rounded-full ${i.ring} animate-ping opacity-75`}),S.jsx("span",{className:`absolute w-28 h-28 rounded-full ${i.ring2} animate-pulse`})]}),S.jsx("div",{className:`relative z-10 w-16 h-16 rounded-full ${i.wrap} border-2 flex items-center justify-center shadow-sm`,children:r})]})}function Ii({children:r,onClick:e,color:t="gray",size:s="md",title:i,pulse:n=!1}){const a={md:"w-12 h-12",lg:"w-14 h-14"},o={green:"bg-green-500 hover:bg-green-600 shadow-[0_4px_14px_rgba(34,197,94,0.4)] hover:shadow-[0_6px_20px_rgba(34,197,94,0.5)]",red:"bg-red-500 hover:bg-red-600 shadow-[0_4px_14px_rgba(239,68,68,0.4)] hover:shadow-[0_6px_20px_rgba(239,68,68,0.5)]",gray:"bg-white border border-gray-200 text-gray-600 hover:bg-gray-50 shadow-sm"};return S.jsx("button",{onClick:e,title:i,className:`${a[s]} rounded-full text-white flex items-center justify-center transition-all active:scale-95 ${o[t]} ${n?"animate-pulse":""}`,children:r})}const ba={READY:{dot:"bg-green-500",label:"Ready",text:"text-green-700",bg:"bg-green-50 border-green-200"},NOT_READY:{dot:"bg-gray-400",label:"Not Ready",text:"text-gray-600",bg:"bg-gray-50 border-gray-200"},AUX:{dot:"bg-amber-400",label:"AUX",text:"text-amber-700",bg:"bg-amber-50 border-amber-200"}};function L0({agentStatus:r,currentAux:e,loading:t,autoReady:s,showAuxButton:i,auxOptions:n,onReady:a,onNotReady:o,onAux:d}){const[c,l]=Q.useState(!1),g=Q.useRef(null);Q.useEffect(()=>{const p=E=>{g.current&&!g.current.contains(E.target)&&l(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const u=ba[r]||ba.NOT_READY,y=r==="AUX"&&e?`AUX: ${e.label}`:u.label,w=!s||i,b=()=>{l(!1),a()},C=()=>{l(!1),o()},x=p=>{l(!1),d(p)};return S.jsx("div",{className:"border-t border-gray-100 bg-gray-50/70 px-4 py-3",children:S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[S.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full border text-xs font-semibold ${u.bg} ${u.text}`,children:[S.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u.dot}`}),y]}),w&&S.jsxs("div",{className:"relative",ref:g,children:[S.jsxs("button",{onClick:()=>!t&&l(p=>!p),disabled:t,className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-[11px] font-semibold bg-white border border-gray-200 text-gray-600 hover:bg-gray-50 transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",children:[t?S.jsx("span",{className:"w-3 h-3 border-2 border-gray-300 border-t-gray-600 rounded-full animate-spin"}):S.jsx(s0,{className:`w-3 h-3 transition-transform duration-150 ${c?"":"rotate-180"}`}),"Status"]}),c&&S.jsxs("div",{className:"absolute bottom-full mb-1.5 right-0 w-48 bg-white rounded-xl shadow-xl border border-gray-100 overflow-hidden z-50 animate-slideUp",children:[!s&&S.jsxs(S.Fragment,{children:[S.jsxs("button",{onClick:b,disabled:r==="READY",className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-left text-xs font-medium text-gray-700 hover:bg-green-50 hover:text-green-800 transition-colors disabled:opacity-40 disabled:cursor-not-allowed border-b border-gray-50",children:[S.jsx(t0,{className:"w-3.5 h-3.5 text-green-500 shrink-0"}),"Ready",r==="READY"&&S.jsx("span",{className:"ml-auto text-[10px] text-green-500 font-semibold",children:"✓ Active"})]}),S.jsxs("button",{onClick:C,disabled:r==="NOT_READY",className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-left text-xs font-medium text-gray-700 hover:bg-gray-100 transition-colors disabled:opacity-40 disabled:cursor-not-allowed border-b border-gray-50",children:[S.jsx(d0,{className:"w-3.5 h-3.5 text-gray-400 shrink-0"}),"Not Ready",r==="NOT_READY"&&S.jsx("span",{className:"ml-auto text-[10px] text-gray-400 font-semibold",children:"✓ Active"})]})]}),!s&&i&&n.length>0&&S.jsxs("div",{className:"px-3.5 py-1.5 flex items-center gap-2",children:[S.jsx("div",{className:"flex-1 h-px bg-gray-100"}),S.jsx("span",{className:"text-[10px] text-gray-400 font-semibold uppercase tracking-wider",children:"AUX"}),S.jsx("div",{className:"flex-1 h-px bg-gray-100"})]}),i&&n.map(p=>S.jsxs("button",{onClick:()=>x(p),disabled:r==="AUX"&&(e==null?void 0:e.code)===p.code,className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-left text-xs font-medium text-gray-700 hover:bg-amber-50 hover:text-amber-800 transition-colors border-b border-gray-50 last:border-0 disabled:opacity-40 disabled:cursor-not-allowed",children:[S.jsx(In,{className:"w-3.5 h-3.5 text-amber-500 shrink-0"}),p.label,r==="AUX"&&(e==null?void 0:e.code)===p.code&&S.jsx("span",{className:"ml-auto text-[10px] text-amber-500 font-semibold",children:"✓ Active"})]},p.code)),i&&n.length===0&&S.jsxs("button",{onClick:()=>x(null),disabled:r==="AUX",className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-left text-xs font-medium text-gray-700 hover:bg-amber-50 hover:text-amber-800 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[S.jsx(In,{className:"w-3.5 h-3.5 text-amber-500 shrink-0"}),"AUX",r==="AUX"&&S.jsx("span",{className:"ml-auto text-[10px] text-amber-500 font-semibold",children:"✓ Active"})]})]})]})]})})}function Hi({children:r,onClick:e,active:t,activeColor:s="primary",title:i}){const n={red:"bg-red-500 border-red-500 text-white shadow-[0_2px_8px_rgba(239,68,68,0.35)]",primary:"bg-primary border-primary text-white shadow-[0_2px_8px_rgba(63,49,146,0.35)]"};return S.jsx("button",{onClick:e,title:i,className:`
153
+ `,children:[F.jsx(as,{className:"w-4 h-4 fill-white"}),"Call"]})}),F.jsx(O0,{agentStatus:A,currentAux:U,loading:v,autoReady:e,showAuxButton:t,auxOptions:s,onReady:ie,onNotReady:he,onAux:ue})]}):F.jsx(Or,{error:p,children:F.jsx("div",{className:"flex flex-col items-center justify-center px-6 py-12 gap-4 min-h-[280px] animate-fadeIn",children:S==="CONNECTING"?F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"relative w-16 h-16",children:[F.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-primary/20"}),F.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-transparent border-t-primary animate-spin"}),F.jsx("div",{className:"absolute inset-2 rounded-full bg-primary/10 flex items-center justify-center",children:F.jsx(as,{className:"w-5 h-5 text-primary",style:{transform:"rotate(90deg)"}})})]}),F.jsxs("div",{className:"text-center space-y-1",children:[F.jsx("p",{className:"text-sm font-semibold text-gray-700",children:"Connecting to server"}),F.jsx("p",{className:"text-xs text-gray-400",children:"Please wait..."})]})]}):F.jsxs(F.Fragment,{children:[F.jsx("div",{className:"w-16 h-16 rounded-full bg-red-50 border-2 border-red-100 flex items-center justify-center",children:F.jsx(ns,{className:"w-7 h-7 text-red-400"})}),F.jsxs("div",{className:"text-center space-y-1.5",children:[F.jsx("p",{className:"text-sm font-bold text-red-600",children:"Not Registered"}),h&&F.jsx("p",{className:"text-xs text-gray-400 max-w-[220px] leading-relaxed",children:h})]})]})})})}function Or({children:r,error:e}){return F.jsxs("div",{className:"w-full relative select-none",children:[e&&F.jsxs("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 z-50 flex items-center gap-2 px-4 py-2 rounded-full bg-red-500 text-white text-xs font-semibold shadow-lg animate-slideUp whitespace-nowrap",children:[F.jsx(Ko,{className:"w-3.5 h-3.5 shrink-0"}),e]}),r]})}function wa({children:r}){return F.jsx("div",{className:"border-t border-gray-100 bg-gray-50/60 px-6 py-5 flex items-center justify-center gap-10 animate-slideUp",children:r})}function Bi({children:r,color:e="green",pulse:t=!1}){const s={green:{ring:"bg-green-500/15",ring2:"bg-green-500/8",wrap:"bg-green-50 border-green-200"},primary:{ring:"bg-primary/15",ring2:"bg-primary/8",wrap:"bg-primary/10 border-primary/20"},red:{ring:"bg-red-500/15",ring2:"bg-red-500/8",wrap:"bg-red-50 border-red-200"}},i=s[e]||s.green;return F.jsxs("div",{className:"relative flex items-center justify-center w-20 h-20",children:[t&&F.jsxs(F.Fragment,{children:[F.jsx("span",{className:`absolute w-20 h-20 rounded-full ${i.ring} animate-ping opacity-75`}),F.jsx("span",{className:`absolute w-28 h-28 rounded-full ${i.ring2} animate-pulse`})]}),F.jsx("div",{className:`relative z-10 w-16 h-16 rounded-full ${i.wrap} border-2 flex items-center justify-center shadow-sm`,children:r})]})}function Ii({children:r,onClick:e,color:t="gray",size:s="md",title:i,pulse:n=!1}){const a={md:"w-12 h-12",lg:"w-14 h-14"},o={green:"bg-green-500 hover:bg-green-600 shadow-[0_4px_14px_rgba(34,197,94,0.4)] hover:shadow-[0_6px_20px_rgba(34,197,94,0.5)]",red:"bg-red-500 hover:bg-red-600 shadow-[0_4px_14px_rgba(239,68,68,0.4)] hover:shadow-[0_6px_20px_rgba(239,68,68,0.5)]",gray:"bg-white border border-gray-200 text-gray-600 hover:bg-gray-50 shadow-sm"};return F.jsx("button",{onClick:e,title:i,className:`${a[s]} rounded-full text-white flex items-center justify-center transition-all active:scale-95 ${o[t]} ${n?"animate-pulse":""}`,children:r})}const Ea={READY:{dot:"bg-green-500",label:"Ready",text:"text-green-700",bg:"bg-green-50 border-green-200"},NOT_READY:{dot:"bg-gray-400",label:"Not Ready",text:"text-gray-600",bg:"bg-gray-50 border-gray-200"},AUX:{dot:"bg-amber-400",label:"AUX",text:"text-amber-700",bg:"bg-amber-50 border-amber-200"}};function O0({agentStatus:r,currentAux:e,loading:t,autoReady:s,showAuxButton:i,auxOptions:n,onReady:a,onNotReady:o,onAux:d}){const[c,l]=re.useState(!1),g=re.useRef(null);re.useEffect(()=>{const p=E=>{g.current&&!g.current.contains(E.target)&&l(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const u=Ea[r]||Ea.NOT_READY,y=r==="AUX"&&e?`AUX: ${e.label}`:u.label,w=!s||i,b=()=>{l(!1),a()},C=()=>{l(!1),o()},x=p=>{l(!1),d(p)};return F.jsx("div",{className:"border-t border-gray-100 bg-gray-50/70 px-4 py-3",children:F.jsxs("div",{className:"flex items-center justify-between gap-2",children:[F.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full border text-xs font-semibold ${u.bg} ${u.text}`,children:[F.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u.dot}`}),y]}),w&&F.jsxs("div",{className:"relative",ref:g,children:[F.jsxs("button",{onClick:()=>!t&&l(p=>!p),disabled:t,className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-[11px] font-semibold bg-white border border-gray-200 text-gray-600 hover:bg-gray-50 transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",children:[t?F.jsx("span",{className:"w-3 h-3 border-2 border-gray-300 border-t-gray-600 rounded-full animate-spin"}):F.jsx(Jo,{className:`w-3 h-3 transition-transform duration-150 ${c?"":"rotate-180"}`}),"Status"]}),c&&F.jsxs("div",{className:"absolute bottom-full mb-1.5 right-0 w-48 bg-white rounded-xl shadow-xl border border-gray-100 overflow-hidden z-50 animate-slideUp",children:[!s&&F.jsxs(F.Fragment,{children:[F.jsxs("button",{onClick:b,disabled:r==="READY",className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-left text-xs font-medium text-gray-700 hover:bg-green-50 hover:text-green-800 transition-colors disabled:opacity-40 disabled:cursor-not-allowed border-b border-gray-50",children:[F.jsx(Zo,{className:"w-3.5 h-3.5 text-green-500 shrink-0"}),"Ready",r==="READY"&&F.jsx("span",{className:"ml-auto text-[10px] text-green-500 font-semibold",children:"✓ Active"})]}),F.jsxs("button",{onClick:C,disabled:r==="NOT_READY",className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-left text-xs font-medium text-gray-700 hover:bg-gray-100 transition-colors disabled:opacity-40 disabled:cursor-not-allowed border-b border-gray-50",children:[F.jsx(n0,{className:"w-3.5 h-3.5 text-gray-400 shrink-0"}),"Not Ready",r==="NOT_READY"&&F.jsx("span",{className:"ml-auto text-[10px] text-gray-400 font-semibold",children:"✓ Active"})]})]}),!s&&i&&n.length>0&&F.jsxs("div",{className:"px-3.5 py-1.5 flex items-center gap-2",children:[F.jsx("div",{className:"flex-1 h-px bg-gray-100"}),F.jsx("span",{className:"text-[10px] text-gray-400 font-semibold uppercase tracking-wider",children:"AUX"}),F.jsx("div",{className:"flex-1 h-px bg-gray-100"})]}),i&&n.map(p=>F.jsxs("button",{onClick:()=>x(p),disabled:r==="AUX"&&(e==null?void 0:e.code)===p.code,className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-left text-xs font-medium text-gray-700 hover:bg-amber-50 hover:text-amber-800 transition-colors border-b border-gray-50 last:border-0 disabled:opacity-40 disabled:cursor-not-allowed",children:[F.jsx(Bn,{className:"w-3.5 h-3.5 text-amber-500 shrink-0"}),p.label,r==="AUX"&&(e==null?void 0:e.code)===p.code&&F.jsx("span",{className:"ml-auto text-[10px] text-amber-500 font-semibold",children:"✓ Active"})]},p.code)),i&&n.length===0&&F.jsxs("button",{onClick:()=>x(null),disabled:r==="AUX",className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-left text-xs font-medium text-gray-700 hover:bg-amber-50 hover:text-amber-800 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[F.jsx(Bn,{className:"w-3.5 h-3.5 text-amber-500 shrink-0"}),"AUX",r==="AUX"&&F.jsx("span",{className:"ml-auto text-[10px] text-amber-500 font-semibold",children:"✓ Active"})]})]})]})]})})}function Hi({children:r,onClick:e,active:t,activeColor:s="primary",title:i}){const n={red:"bg-red-500 border-red-500 text-white shadow-[0_2px_8px_rgba(239,68,68,0.35)]",primary:"bg-primary border-primary text-white shadow-[0_2px_8px_rgba(63,49,146,0.35)]"};return F.jsx("button",{onClick:e,title:i,className:`
154
154
  w-11 h-11 rounded-full flex items-center justify-center
155
155
  border transition-all active:scale-95
156
156
  ${t?n[s]:"bg-white border-gray-200 text-gray-500 hover:bg-gray-100 hover:text-gray-700"}
157
- `,children:r})}const Pi="omnix:console-log",Ca={warn:console.warn.bind(console),error:console.error.bind(console)};let _a=!1;function U0(r){return r.map(e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e,null,2)}catch{return String(e)}}).join(" ")}function Da(r,e){const t=new CustomEvent(Pi,{detail:{level:r,message:U0(e),timestamp:new Date}});document.dispatchEvent(t)}function Y0(){_a||(_a=!0,console.warn=function(...r){Ca.warn(...r),Da("warn",r)},console.error=function(...r){Ca.error(...r),Da("error",r)})}const W0=5,Aa=6e3;function G0(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:S.jsx("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 1.999-.29 4.499-2.599 4.499H4.645c-2.309 0-3.752-2.5-2.598-4.499L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})})}function V0(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"18",height:"18",children:S.jsx("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25zm-1.72 6.97a.75.75 0 10-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 101.06 1.06L12 13.06l1.72 1.72a.75.75 0 101.06-1.06L13.06 12l1.72-1.72a.75.75 0 10-1.06-1.06L12 10.94l-1.72-1.72z",clipRule:"evenodd"})})}function z0(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",width:"14",height:"14",children:S.jsx("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}function K0({toast:r,onDismiss:e}){const t=r.level==="error",s=r.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),[i,n]=Q.useState(100),a=Q.useRef(null),o=Q.useRef(Date.now());Q.useEffect(()=>{const c=()=>{const l=Date.now()-o.current,g=Math.max(0,100-l/Aa*100);n(g),g>0&&(a.current=requestAnimationFrame(c))};return a.current=requestAnimationFrame(c),()=>cancelAnimationFrame(a.current)},[]);const d=t?{bg:"rgba(30,10,10,0.97)",border:"rgba(239,68,68,0.55)",icon:"#f87171",label:"#fca5a5",labelBg:"rgba(239,68,68,0.18)",bar:"#ef4444",text:"#fef2f2",time:"rgba(252,165,165,0.6)",closeBg:"rgba(239,68,68,0.15)",closeHover:"rgba(239,68,68,0.35)"}:{bg:"rgba(20,18,10,0.97)",border:"rgba(234,179,8,0.55)",icon:"#facc15",label:"#fde047",labelBg:"rgba(234,179,8,0.18)",bar:"#eab308",text:"#fefce8",time:"rgba(253,224,71,0.6)",closeBg:"rgba(234,179,8,0.15)",closeHover:"rgba(234,179,8,0.35)"};return S.jsxs("div",{style:{background:d.bg,border:`1px solid ${d.border}`,borderRadius:"14px",padding:"12px 14px 10px",width:"340px",boxShadow:"0 8px 32px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06)",position:"relative",overflow:"hidden",backdropFilter:"blur(12px)",animation:"devToastIn 0.28s cubic-bezier(0.16,1,0.3,1) forwards"},children:[S.jsx("div",{style:{position:"absolute",bottom:0,left:0,height:"3px",width:`${i}%`,background:d.bar,borderRadius:"0 0 0 14px",transition:"width 0.1s linear",opacity:.7}}),S.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"7px"},children:[S.jsx("span",{style:{color:d.icon,flexShrink:0},children:t?S.jsx(V0,{}):S.jsx(G0,{})}),S.jsx("span",{style:{fontSize:"11px",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:d.label,background:d.labelBg,padding:"2px 7px",borderRadius:"5px"},children:t?"Error":"Warning"}),S.jsx("span",{style:{marginLeft:"auto",fontSize:"10px",color:d.time,fontVariantNumeric:"tabular-nums"},children:s}),S.jsx("button",{onClick:()=>e(r.id),style:{background:d.closeBg,border:"none",borderRadius:"6px",color:d.label,cursor:"pointer",padding:"3px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background 0.15s"},onMouseEnter:c=>c.currentTarget.style.background=d.closeHover,onMouseLeave:c=>c.currentTarget.style.background=d.closeBg,title:"Dismiss",children:S.jsx(z0,{})})]}),S.jsx("div",{style:{fontSize:"12px",color:d.text,lineHeight:1.55,wordBreak:"break-word",fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace",maxHeight:"100px",overflowY:"auto",paddingRight:"2px"},children:r.message})]})}let Z0=0;function X0(){const[r,e]=Q.useState([]),t=Q.useCallback(s=>{e(i=>i.filter(n=>n.id!==s))},[]);return Q.useEffect(()=>{const s=i=>{const{level:n,message:a,timestamp:o}=i.detail,d=++Z0;e(c=>[{id:d,level:n,message:a,timestamp:o},...c].slice(0,W0)),setTimeout(()=>t(d),Aa)};return document.addEventListener(Pi,s),()=>document.removeEventListener(Pi,s)},[t]),r.length===0?null:S.jsxs(S.Fragment,{children:[S.jsx("style",{children:`
158
- @keyframes devToastIn {
159
- from { opacity: 0; transform: translateX(24px) scale(0.96); }
160
- to { opacity: 1; transform: translateX(0) scale(1); }
161
- }
162
- `}),S.jsx("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:2147483647,display:"flex",flexDirection:"column",gap:"10px",pointerEvents:"none",fontFamily:"'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},children:r.map(s=>S.jsx("div",{style:{pointerEvents:"all"},children:S.jsx(K0,{toast:s,onDismiss:t})},s.id))})]})}const J0="0.21.1";class ar extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class $i extends ar{constructor(e){super(e||"Unsupported content type.")}}class Oi extends ar{constructor(e){super(e||"Request pending.")}}class Q0 extends ar{constructor(e){super(e||"Unspecified session description handler error.")}}class Ni extends ar{constructor(){super("The session has terminated.")}}class Nr extends ar{constructor(e){super(e||"An error occurred during state transition.")}}class ec{constructor(e){this.incomingAckRequest=e}get request(){return this.incomingAckRequest.message}}class tc{constructor(e){this.incomingByeRequest=e}get request(){return this.incomingByeRequest.message}accept(e){return this.incomingByeRequest.accept(e),Promise.resolve()}reject(e){return this.incomingByeRequest.reject(e),Promise.resolve()}}class rc{constructor(e){this.incomingCancelRequest=e}get request(){return this.incomingCancelRequest}}class Mr{constructor(){this.listeners=new Array}addListener(e,t){const s=i=>{this.removeListener(s),e(i)};(t==null?void 0:t.once)===!0?this.listeners.push(s):this.listeners.push(e)}emit(e){this.listeners.slice().forEach(t=>t(e))}removeAllListeners(){this.listeners=[]}removeListener(e){this.listeners=this.listeners.filter(t=>t!==e)}on(e){return this.addListener(e)}off(e){return this.removeListener(e)}once(e){return this.addListener(e,{once:!0})}}class sc{constructor(e){this.incomingInfoRequest=e}get request(){return this.incomingInfoRequest.message}accept(e){return this.incomingInfoRequest.accept(e),Promise.resolve()}reject(e){return this.incomingInfoRequest.reject(e),Promise.resolve()}}class Sa{constructor(e){this.parameters={};for(const t in e)e.hasOwnProperty(t)&&this.setParam(t,e[t])}setParam(e,t){e&&(this.parameters[e.toLowerCase()]=typeof t>"u"||t===null?null:t.toString())}getParam(e){if(e)return this.parameters[e.toLowerCase()]}hasParam(e){return!!(e&&this.parameters[e.toLowerCase()]!==void 0)}deleteParam(e){if(e=e.toLowerCase(),this.hasParam(e)){const t=this.parameters[e];return delete this.parameters[e],t}}clearParams(){this.parameters={}}}class ze extends Sa{constructor(e,t,s){super(s),this.uri=e,this._displayName=t}get friendlyName(){return this.displayName||this.uri.aor}get displayName(){return this._displayName}set displayName(e){this._displayName=e}clone(){return new ze(this.uri.clone(),this._displayName,JSON.parse(JSON.stringify(this.parameters)))}toString(){let e=this.displayName||this.displayName==="0"?'"'+this.displayName+'" ':"";e+="<"+this.uri.toString()+">";for(const t in this.parameters)this.parameters.hasOwnProperty(t)&&(e+=";"+t,this.parameters[t]!==null&&(e+="="+this.parameters[t]));return e}}class yt extends Sa{constructor(e="sip",t,s,i,n,a){if(super(n||{}),this.headers={},!s)throw new TypeError('missing or invalid "host" parameter');for(const o in a)a.hasOwnProperty(o)&&this.setHeader(o,a[o]);this.raw={scheme:e,user:t,host:s,port:i},this.normal={scheme:e.toLowerCase(),user:t,host:s.toLowerCase(),port:i}}get scheme(){return this.normal.scheme}set scheme(e){this.raw.scheme=e,this.normal.scheme=e.toLowerCase()}get user(){return this.normal.user}set user(e){this.normal.user=this.raw.user=e}get host(){return this.normal.host}set host(e){this.raw.host=e,this.normal.host=e.toLowerCase()}get aor(){return this.normal.user+"@"+this.normal.host}get port(){return this.normal.port}set port(e){this.normal.port=this.raw.port=e}setHeader(e,t){this.headers[this.headerize(e)]=t instanceof Array?t:[t]}getHeader(e){if(e)return this.headers[this.headerize(e)]}hasHeader(e){return!!e&&!!this.headers.hasOwnProperty(this.headerize(e))}deleteHeader(e){if(e=this.headerize(e),this.headers.hasOwnProperty(e)){const t=this.headers[e];return delete this.headers[e],t}}clearHeaders(){this.headers={}}clone(){return new yt(this._raw.scheme,this._raw.user||"",this._raw.host,this._raw.port,JSON.parse(JSON.stringify(this.parameters)),JSON.parse(JSON.stringify(this.headers)))}toRaw(){return this._toString(this._raw)}toString(){return this._toString(this._normal)}get _normal(){return this.normal}get _raw(){return this.raw}_toString(e){let t=e.scheme+":";e.scheme.toLowerCase().match("^sips?$")||(t+="//"),e.user&&(t+=this.escapeUser(e.user)+"@"),t+=e.host,(e.port||e.port===0)&&(t+=":"+e.port);for(const i in this.parameters)this.parameters.hasOwnProperty(i)&&(t+=";"+i,this.parameters[i]!==null&&(t+="="+this.parameters[i]));const s=[];for(const i in this.headers)if(this.headers.hasOwnProperty(i))for(const n in this.headers[i])this.headers[i].hasOwnProperty(n)&&s.push(i+"="+this.headers[i][n]);return s.length>0&&(t+="?"+s.join("&")),t}escapeUser(e){let t;try{t=decodeURIComponent(e)}catch(s){throw s}return encodeURIComponent(t).replace(/%3A/ig,":").replace(/%2B/ig,"+").replace(/%3F/ig,"?").replace(/%2F/ig,"/")}headerize(e){const t={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},s=e.toLowerCase().replace(/_/g,"-").split("-"),i=s.length;let n="";for(let a=0;a<i;a++)a!==0&&(n+="-"),n+=s[a].charAt(0).toUpperCase()+s[a].substring(1);return t[n]&&(n=t[n]),n}}function Ta(r,e){if(r.scheme!==e.scheme||r.user!==e.user||r.host!==e.host||r.port!==e.port)return!1;function t(n,a){const o=Object.keys(n.parameters),d=Object.keys(a.parameters);return!(!o.filter(l=>d.includes(l)).every(l=>n.parameters[l]===a.parameters[l])||!["user","ttl","method","transport"].every(l=>n.hasParam(l)&&a.hasParam(l)||!n.hasParam(l)&&!a.hasParam(l))||!["maddr"].every(l=>n.hasParam(l)&&a.hasParam(l)||!n.hasParam(l)&&!a.hasParam(l)))}if(!t(r,e))return!1;const s=Object.keys(r.headers),i=Object.keys(e.headers);if(s.length!==0||i.length!==0){if(s.length!==i.length)return!1;const n=s.filter(a=>i.includes(a));if(n.length!==i.length||!n.every(a=>r.headers[a].length&&e.headers[a].length&&r.headers[a][0]===e.headers[a][0]))return!1}return!0}function Mi(r,e,t){return t=t||" ",r.length>e?r:(e-=r.length,t+=t.repeat(e),r+t.slice(0,e))}class vr extends Error{constructor(e,t,s,i){super(),this.message=e,this.expected=t,this.found=s,this.location=i,this.name="SyntaxError",typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf(this,vr.prototype):this.__proto__=vr.prototype,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,vr)}static buildMessage(e,t){function s(c){return c.charCodeAt(0).toString(16).toUpperCase()}function i(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,l=>"\\x0"+s(l)).replace(/[\x10-\x1F\x7F-\x9F]/g,l=>"\\x"+s(l))}function n(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,l=>"\\x0"+s(l)).replace(/[\x10-\x1F\x7F-\x9F]/g,l=>"\\x"+s(l))}function a(c){switch(c.type){case"literal":return'"'+i(c.text)+'"';case"class":const l=c.parts.map(g=>Array.isArray(g)?n(g[0])+"-"+n(g[1]):n(g));return"["+(c.inverted?"^":"")+l+"]";case"any":return"any character";case"end":return"end of input";case"other":return c.description}}function o(c){const l=c.map(a);let g,u;if(l.sort(),l.length>0){for(g=1,u=1;g<l.length;g++)l[g-1]!==l[g]&&(l[u]=l[g],u++);l.length=u}switch(l.length){case 1:return l[0];case 2:return l[0]+" or "+l[1];default:return l.slice(0,-1).join(", ")+", or "+l[l.length-1]}}function d(c){return c?'"'+i(c)+'"':"end of input"}return"Expected "+o(e)+" but "+d(t)+" found."}format(e){let t="Error: "+this.message;if(this.location){let s=null,i;for(i=0;i<e.length;i++)if(e[i].source===this.location.source){s=e[i].text.split(/\r\n|\n|\r/g);break}let n=this.location.start,a=this.location.source+":"+n.line+":"+n.column;if(s){let o=this.location.end,d=Mi("",n.line.toString().length," "),c=s[n.line-1],l=n.line===o.line?o.column:c.length+1;t+=`
157
+ `,children:r})}const N0="0.21.1";class ar extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}class Pi extends ar{constructor(e){super(e||"Unsupported content type.")}}class $i extends ar{constructor(e){super(e||"Request pending.")}}class M0 extends ar{constructor(e){super(e||"Unspecified session description handler error.")}}class Oi extends ar{constructor(){super("The session has terminated.")}}class Nr extends ar{constructor(e){super(e||"An error occurred during state transition.")}}class q0{constructor(e){this.incomingAckRequest=e}get request(){return this.incomingAckRequest.message}}class j0{constructor(e){this.incomingByeRequest=e}get request(){return this.incomingByeRequest.message}accept(e){return this.incomingByeRequest.accept(e),Promise.resolve()}reject(e){return this.incomingByeRequest.reject(e),Promise.resolve()}}class U0{constructor(e){this.incomingCancelRequest=e}get request(){return this.incomingCancelRequest}}class Mr{constructor(){this.listeners=new Array}addListener(e,t){const s=i=>{this.removeListener(s),e(i)};(t==null?void 0:t.once)===!0?this.listeners.push(s):this.listeners.push(e)}emit(e){this.listeners.slice().forEach(t=>t(e))}removeAllListeners(){this.listeners=[]}removeListener(e){this.listeners=this.listeners.filter(t=>t!==e)}on(e){return this.addListener(e)}off(e){return this.removeListener(e)}once(e){return this.addListener(e,{once:!0})}}class L0{constructor(e){this.incomingInfoRequest=e}get request(){return this.incomingInfoRequest.message}accept(e){return this.incomingInfoRequest.accept(e),Promise.resolve()}reject(e){return this.incomingInfoRequest.reject(e),Promise.resolve()}}class ba{constructor(e){this.parameters={};for(const t in e)e.hasOwnProperty(t)&&this.setParam(t,e[t])}setParam(e,t){e&&(this.parameters[e.toLowerCase()]=typeof t>"u"||t===null?null:t.toString())}getParam(e){if(e)return this.parameters[e.toLowerCase()]}hasParam(e){return!!(e&&this.parameters[e.toLowerCase()]!==void 0)}deleteParam(e){if(e=e.toLowerCase(),this.hasParam(e)){const t=this.parameters[e];return delete this.parameters[e],t}}clearParams(){this.parameters={}}}class ze extends ba{constructor(e,t,s){super(s),this.uri=e,this._displayName=t}get friendlyName(){return this.displayName||this.uri.aor}get displayName(){return this._displayName}set displayName(e){this._displayName=e}clone(){return new ze(this.uri.clone(),this._displayName,JSON.parse(JSON.stringify(this.parameters)))}toString(){let e=this.displayName||this.displayName==="0"?'"'+this.displayName+'" ':"";e+="<"+this.uri.toString()+">";for(const t in this.parameters)this.parameters.hasOwnProperty(t)&&(e+=";"+t,this.parameters[t]!==null&&(e+="="+this.parameters[t]));return e}}class yt extends ba{constructor(e="sip",t,s,i,n,a){if(super(n||{}),this.headers={},!s)throw new TypeError('missing or invalid "host" parameter');for(const o in a)a.hasOwnProperty(o)&&this.setHeader(o,a[o]);this.raw={scheme:e,user:t,host:s,port:i},this.normal={scheme:e.toLowerCase(),user:t,host:s.toLowerCase(),port:i}}get scheme(){return this.normal.scheme}set scheme(e){this.raw.scheme=e,this.normal.scheme=e.toLowerCase()}get user(){return this.normal.user}set user(e){this.normal.user=this.raw.user=e}get host(){return this.normal.host}set host(e){this.raw.host=e,this.normal.host=e.toLowerCase()}get aor(){return this.normal.user+"@"+this.normal.host}get port(){return this.normal.port}set port(e){this.normal.port=this.raw.port=e}setHeader(e,t){this.headers[this.headerize(e)]=t instanceof Array?t:[t]}getHeader(e){if(e)return this.headers[this.headerize(e)]}hasHeader(e){return!!e&&!!this.headers.hasOwnProperty(this.headerize(e))}deleteHeader(e){if(e=this.headerize(e),this.headers.hasOwnProperty(e)){const t=this.headers[e];return delete this.headers[e],t}}clearHeaders(){this.headers={}}clone(){return new yt(this._raw.scheme,this._raw.user||"",this._raw.host,this._raw.port,JSON.parse(JSON.stringify(this.parameters)),JSON.parse(JSON.stringify(this.headers)))}toRaw(){return this._toString(this._raw)}toString(){return this._toString(this._normal)}get _normal(){return this.normal}get _raw(){return this.raw}_toString(e){let t=e.scheme+":";e.scheme.toLowerCase().match("^sips?$")||(t+="//"),e.user&&(t+=this.escapeUser(e.user)+"@"),t+=e.host,(e.port||e.port===0)&&(t+=":"+e.port);for(const i in this.parameters)this.parameters.hasOwnProperty(i)&&(t+=";"+i,this.parameters[i]!==null&&(t+="="+this.parameters[i]));const s=[];for(const i in this.headers)if(this.headers.hasOwnProperty(i))for(const n in this.headers[i])this.headers[i].hasOwnProperty(n)&&s.push(i+"="+this.headers[i][n]);return s.length>0&&(t+="?"+s.join("&")),t}escapeUser(e){let t;try{t=decodeURIComponent(e)}catch(s){throw s}return encodeURIComponent(t).replace(/%3A/ig,":").replace(/%2B/ig,"+").replace(/%3F/ig,"?").replace(/%2F/ig,"/")}headerize(e){const t={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},s=e.toLowerCase().replace(/_/g,"-").split("-"),i=s.length;let n="";for(let a=0;a<i;a++)a!==0&&(n+="-"),n+=s[a].charAt(0).toUpperCase()+s[a].substring(1);return t[n]&&(n=t[n]),n}}function Ca(r,e){if(r.scheme!==e.scheme||r.user!==e.user||r.host!==e.host||r.port!==e.port)return!1;function t(n,a){const o=Object.keys(n.parameters),d=Object.keys(a.parameters);return!(!o.filter(l=>d.includes(l)).every(l=>n.parameters[l]===a.parameters[l])||!["user","ttl","method","transport"].every(l=>n.hasParam(l)&&a.hasParam(l)||!n.hasParam(l)&&!a.hasParam(l))||!["maddr"].every(l=>n.hasParam(l)&&a.hasParam(l)||!n.hasParam(l)&&!a.hasParam(l)))}if(!t(r,e))return!1;const s=Object.keys(r.headers),i=Object.keys(e.headers);if(s.length!==0||i.length!==0){if(s.length!==i.length)return!1;const n=s.filter(a=>i.includes(a));if(n.length!==i.length||!n.every(a=>r.headers[a].length&&e.headers[a].length&&r.headers[a][0]===e.headers[a][0]))return!1}return!0}function Ni(r,e,t){return t=t||" ",r.length>e?r:(e-=r.length,t+=t.repeat(e),r+t.slice(0,e))}class vr extends Error{constructor(e,t,s,i){super(),this.message=e,this.expected=t,this.found=s,this.location=i,this.name="SyntaxError",typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf(this,vr.prototype):this.__proto__=vr.prototype,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,vr)}static buildMessage(e,t){function s(c){return c.charCodeAt(0).toString(16).toUpperCase()}function i(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,l=>"\\x0"+s(l)).replace(/[\x10-\x1F\x7F-\x9F]/g,l=>"\\x"+s(l))}function n(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,l=>"\\x0"+s(l)).replace(/[\x10-\x1F\x7F-\x9F]/g,l=>"\\x"+s(l))}function a(c){switch(c.type){case"literal":return'"'+i(c.text)+'"';case"class":const l=c.parts.map(g=>Array.isArray(g)?n(g[0])+"-"+n(g[1]):n(g));return"["+(c.inverted?"^":"")+l+"]";case"any":return"any character";case"end":return"end of input";case"other":return c.description}}function o(c){const l=c.map(a);let g,u;if(l.sort(),l.length>0){for(g=1,u=1;g<l.length;g++)l[g-1]!==l[g]&&(l[u]=l[g],u++);l.length=u}switch(l.length){case 1:return l[0];case 2:return l[0]+" or "+l[1];default:return l.slice(0,-1).join(", ")+", or "+l[l.length-1]}}function d(c){return c?'"'+i(c)+'"':"end of input"}return"Expected "+o(e)+" but "+d(t)+" found."}format(e){let t="Error: "+this.message;if(this.location){let s=null,i;for(i=0;i<e.length;i++)if(e[i].source===this.location.source){s=e[i].text.split(/\r\n|\n|\r/g);break}let n=this.location.start,a=this.location.source+":"+n.line+":"+n.column;if(s){let o=this.location.end,d=Ni("",n.line.toString().length," "),c=s[n.line-1],l=n.line===o.line?o.column:c.length+1;t+=`
163
158
  --> `+a+`
164
159
  `+d+` |
165
160
  `+n.line+" | "+c+`
166
- `+d+" | "+Mi("",n.column-1," ")+Mi("",l-n.column,"^")}else t+=`
167
- at `+a}return t}}function ic(r,e){e=e!==void 0?e:{};const t={},s=e.grammarSource,i={Contact:119,Name_Addr_Header:156,Record_Route:176,Request_Response:81,SIP_URI:45,Subscription_State:186,Supported:191,Require:182,Via:194,absoluteURI:84,Call_ID:118,Content_Disposition:130,Content_Length:135,Content_Type:136,CSeq:146,displayName:122,Event:149,From:151,host:52,Max_Forwards:154,Min_SE:213,Proxy_Authenticate:157,quoted_string:40,Refer_To:178,Replaces:179,Session_Expires:210,stun_URI:217,To:192,turn_URI:223,uuid:226,WWW_Authenticate:209,challenge:158,sipfrag:230,Referred_By:231};let n=119;const a=[`\r
161
+ `+d+" | "+Ni("",n.column-1," ")+Ni("",l-n.column,"^")}else t+=`
162
+ at `+a}return t}}function Y0(r,e){e=e!==void 0?e:{};const t={},s=e.grammarSource,i={Contact:119,Name_Addr_Header:156,Record_Route:176,Request_Response:81,SIP_URI:45,Subscription_State:186,Supported:191,Require:182,Via:194,absoluteURI:84,Call_ID:118,Content_Disposition:130,Content_Length:135,Content_Type:136,CSeq:146,displayName:122,Event:149,From:151,host:52,Max_Forwards:154,Min_SE:213,Proxy_Authenticate:157,quoted_string:40,Refer_To:178,Replaces:179,Session_Expires:210,stun_URI:217,To:192,turn_URI:223,uuid:226,WWW_Authenticate:209,challenge:158,sipfrag:230,Referred_By:231};let n=119;const a=[`\r
168
163
  `,x(`\r
169
- `,!1),/^[0-9]/,p([["0","9"]],!1,!1),/^[a-zA-Z]/,p([["a","z"],["A","Z"]],!1,!1),/^[0-9a-fA-F]/,p([["0","9"],["a","f"],["A","F"]],!1,!1),/^[\0-\xFF]/,p([["\0","ÿ"]],!1,!1),/^["]/,p(['"'],!1,!1)," ",x(" ",!1)," ",x(" ",!1),/^[a-zA-Z0-9]/,p([["a","z"],["A","Z"],["0","9"]],!1,!1),";",x(";",!1),"/",x("/",!1),"?",x("?",!1),":",x(":",!1),"@",x("@",!1),"&",x("&",!1),"=",x("=",!1),"+",x("+",!1),"$",x("$",!1),",",x(",",!1),"-",x("-",!1),"_",x("_",!1),".",x(".",!1),"!",x("!",!1),"~",x("~",!1),"*",x("*",!1),"'",x("'",!1),"(",x("(",!1),")",x(")",!1),"%",x("%",!1),function(){return" "},function(){return":"},/^[!-~]/,p([["!","~"]],!1,!1),/^[\x80-\uFFFF]/,p([["€","￿"]],!1,!1),/^[\x80-\xBF]/,p([["€","¿"]],!1,!1),/^[a-f]/,p([["a","f"]],!1,!1),"`",x("`",!1),"<",x("<",!1),">",x(">",!1),"\\",x("\\",!1),"[",x("[",!1),"]",x("]",!1),"{",x("{",!1),"}",x("}",!1),function(){return"*"},function(){return"/"},function(){return"="},function(){return"("},function(){return")"},function(){return">"},function(){return"<"},function(){return","},function(){return";"},function(){return":"},function(){return'"'},/^[!-']/,p([["!","'"]],!1,!1),/^[*-[]/,p([["*","["]],!1,!1),/^[\]-~]/,p([["]","~"]],!1,!1),function(f){return f},/^[#-[]/,p([["#","["]],!1,!1),/^[\0-\t]/,p([["\0"," "]],!1,!1),/^[\v-\f]/,p([["\v","\f"]],!1,!1),/^[\x0E-\x7F]/,p([["",""]],!1,!1),function(){e=e||{data:{}},e.data.uri=new yt(e.data.scheme,e.data.user,e.data.host,e.data.port),delete e.data.scheme,delete e.data.user,delete e.data.host,delete e.data.host_type,delete e.data.port},function(){e=e||{data:{}},e.data.uri=new yt(e.data.scheme,e.data.user,e.data.host,e.data.port,e.data.uri_params,e.data.uri_headers),delete e.data.scheme,delete e.data.user,delete e.data.host,delete e.data.host_type,delete e.data.port,delete e.data.uri_params,e.startRule==="SIP_URI"&&(e.data=e.data.uri)},"sips",x("sips",!0),"sip",x("sip",!0),function(f){e=e||{data:{}},e.data.scheme=f},function(){e=e||{data:{}},e.data.user=decodeURIComponent(b().slice(0,-1))},function(){e=e||{data:{}},e.data.password=b()},function(){return e=e||{data:{}},e.data.host=b(),e.data.host},function(){return e=e||{data:{}},e.data.host_type="domain",b()},/^[a-zA-Z0-9_\-]/,p([["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),/^[a-zA-Z0-9\-]/,p([["a","z"],["A","Z"],["0","9"],"-"],!1,!1),function(){return e=e||{data:{}},e.data.host_type="IPv6",b()},"::",x("::",!1),function(){return e=e||{data:{}},e.data.host_type="IPv6",b()},function(){return e=e||{data:{}},e.data.host_type="IPv4",b()},"25",x("25",!1),/^[0-5]/,p([["0","5"]],!1,!1),"2",x("2",!1),/^[0-4]/,p([["0","4"]],!1,!1),"1",x("1",!1),/^[1-9]/,p([["1","9"]],!1,!1),function(f){return e=e||{data:{}},f=parseInt(f.join("")),e.data.port=f,f},"transport=",x("transport=",!0),"udp",x("udp",!0),"tcp",x("tcp",!0),"sctp",x("sctp",!0),"tls",x("tls",!0),function(f){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.transport=f.toLowerCase()},"user=",x("user=",!0),"phone",x("phone",!0),"ip",x("ip",!0),function(f){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.user=f.toLowerCase()},"method=",x("method=",!0),function(f){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.method=f},"ttl=",x("ttl=",!0),function(f){e=e||{data:{}},e.data.params||(e.data.params={}),e.data.params.ttl=f},"maddr=",x("maddr=",!0),function(f){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.maddr=f},"lr",x("lr",!0),function(){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.lr=void 0},function(f,v){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),v===null?v=void 0:v=v[1],e.data.uri_params[f.toLowerCase()]=v},function(f,v){f=f.join("").toLowerCase(),v=v.join(""),e=e||{data:{}},e.data.uri_headers||(e.data.uri_headers={}),e.data.uri_headers[f]?e.data.uri_headers[f].push(v):e.data.uri_headers[f]=[v]},function(){e=e||{data:{}},e.startRule==="Refer_To"&&(e.data.uri=new yt(e.data.scheme,e.data.user,e.data.host,e.data.port,e.data.uri_params,e.data.uri_headers),delete e.data.scheme,delete e.data.user,delete e.data.host,delete e.data.host_type,delete e.data.port,delete e.data.uri_params)},"//",x("//",!1),function(){e=e||{data:{}},e.data.scheme=b()},x("SIP",!0),function(){e=e||{data:{}},e.data.sip_version=b()},"INVITE",x("INVITE",!1),"ACK",x("ACK",!1),"VXACH",x("VXACH",!1),"OPTIONS",x("OPTIONS",!1),"BYE",x("BYE",!1),"CANCEL",x("CANCEL",!1),"REGISTER",x("REGISTER",!1),"SUBSCRIBE",x("SUBSCRIBE",!1),"NOTIFY",x("NOTIFY",!1),"REFER",x("REFER",!1),"PUBLISH",x("PUBLISH",!1),function(){return e=e||{data:{}},e.data.method=b(),e.data.method},function(f){e=e||{data:{}},e.data.status_code=parseInt(f.join(""))},function(){e=e||{data:{}},e.data.reason_phrase=b()},function(){e=e||{data:{}},e.data=b()},function(){var f,v;for(e=e||{data:{}},v=e.data.multi_header.length,f=0;f<v;f++)if(e.data.multi_header[f].parsed===null){e.data=null;break}e.data!==null?e.data=e.data.multi_header:e.data=-1},function(){var f;e=e||{data:{}},e.data.multi_header||(e.data.multi_header=[]);try{f=new ze(e.data.uri,e.data.displayName,e.data.params),delete e.data.uri,delete e.data.displayName,delete e.data.params}catch{f=null}e.data.multi_header.push({position:d,offset:C().start.offset,parsed:f})},function(f){f=b().trim(),f[0]==='"'&&(f=f.substring(1,f.length-1)),e=e||{data:{}},e.data.displayName=f},"q",x("q",!0),function(f){e=e||{data:{}},e.data.params||(e.data.params={}),e.data.params.q=f},"expires",x("expires",!0),function(f){e=e||{data:{}},e.data.params||(e.data.params={}),e.data.params.expires=f},function(f){return parseInt(f.join(""))},"0",x("0",!1),function(){return parseFloat(b())},function(f,v){e=e||{data:{}},e.data.params||(e.data.params={}),v===null?v=void 0:v=v[1],e.data.params[f.toLowerCase()]=v},"render",x("render",!0),"session",x("session",!0),"icon",x("icon",!0),"alert",x("alert",!0),function(){e=e||{data:{}},e.startRule==="Content_Disposition"&&(e.data.type=b().toLowerCase())},"handling",x("handling",!0),"optional",x("optional",!0),"required",x("required",!0),function(f){e=e||{data:{}},e.data=parseInt(f.join(""))},function(){e=e||{data:{}},e.data=b()},"text",x("text",!0),"image",x("image",!0),"audio",x("audio",!0),"video",x("video",!0),"application",x("application",!0),"message",x("message",!0),"multipart",x("multipart",!0),"x-",x("x-",!0),function(f){e=e||{data:{}},e.data.value=parseInt(f.join(""))},function(f){e=e||{data:{}},e.data=f},function(f){e=e||{data:{}},e.data.event=f.toLowerCase()},function(){e=e||{data:{}};var f=e.data.tag;e.data=new ze(e.data.uri,e.data.displayName,e.data.params),f&&e.data.setParam("tag",f)},"tag",x("tag",!0),function(f){e=e||{data:{}},e.data.tag=f},function(f){e=e||{data:{}},e.data=parseInt(f.join(""))},function(f){e=e||{data:{}},e.data=f},function(){e=e||{data:{}},e.data=new ze(e.data.uri,e.data.displayName,e.data.params)},"digest",x("Digest",!0),"realm",x("realm",!0),function(f){e=e||{data:{}},e.data.realm=f},"domain",x("domain",!0),"nonce",x("nonce",!0),function(f){e=e||{data:{}},e.data.nonce=f},"opaque",x("opaque",!0),function(f){e=e||{data:{}},e.data.opaque=f},"stale",x("stale",!0),"true",x("true",!0),function(){e=e||{data:{}},e.data.stale=!0},"false",x("false",!0),function(){e=e||{data:{}},e.data.stale=!1},"algorithm",x("algorithm",!0),"md5",x("MD5",!0),"md5-sess",x("MD5-sess",!0),function(f){e=e||{data:{}},e.data.algorithm=f.toUpperCase()},"qop",x("qop",!0),"auth-int",x("auth-int",!0),"auth",x("auth",!0),function(f){e=e||{data:{}},e.data.qop||(e.data.qop=[]),e.data.qop.push(f.toLowerCase())},function(f){e=e||{data:{}},e.data.value=parseInt(f.join(""))},function(){var f,v;for(e=e||{data:{}},v=e.data.multi_header.length,f=0;f<v;f++)if(e.data.multi_header[f].parsed===null){e.data=null;break}e.data!==null?e.data=e.data.multi_header:e.data=-1},function(){var f;e=e||{data:{}},e.data.multi_header||(e.data.multi_header=[]);try{f=new ze(e.data.uri,e.data.displayName,e.data.params),delete e.data.uri,delete e.data.displayName,delete e.data.params}catch{f=null}e.data.multi_header.push({position:d,offset:C().start.offset,parsed:f})},function(){e=e||{data:{}},e.data=new ze(e.data.uri,e.data.displayName,e.data.params)},function(){e=e||{data:{}},e.data.replaces_from_tag&&e.data.replaces_to_tag||(e.data=-1)},function(){e=e||{data:{}},e.data={call_id:e.data}},"from-tag",x("from-tag",!0),function(f){e=e||{data:{}},e.data.replaces_from_tag=f},"to-tag",x("to-tag",!0),function(f){e=e||{data:{}},e.data.replaces_to_tag=f},"early-only",x("early-only",!0),function(){e=e||{data:{}},e.data.early_only=!0},function(f,v){return v},function(f,v){return A(f,v)},function(f){e=e||{data:{}},e.startRule==="Require"&&(e.data=f||[])},function(f){e=e||{data:{}},e.data.value=parseInt(f.join(""))},"active",x("active",!0),"pending",x("pending",!0),"terminated",x("terminated",!0),function(){e=e||{data:{}},e.data.state=b()},"reason",x("reason",!0),function(f){e=e||{data:{}},typeof f<"u"&&(e.data.reason=f)},function(f){e=e||{data:{}},typeof f<"u"&&(e.data.expires=f)},"retry_after",x("retry_after",!0),function(f){e=e||{data:{}},typeof f<"u"&&(e.data.retry_after=f)},"deactivated",x("deactivated",!0),"probation",x("probation",!0),"rejected",x("rejected",!0),"timeout",x("timeout",!0),"giveup",x("giveup",!0),"noresource",x("noresource",!0),"invariant",x("invariant",!0),function(f){e=e||{data:{}},e.startRule==="Supported"&&(e.data=f||[])},function(){e=e||{data:{}};var f=e.data.tag;e.data=new ze(e.data.uri,e.data.displayName,e.data.params),f&&e.data.setParam("tag",f)},"ttl",x("ttl",!0),function(f){e=e||{data:{}},e.data.ttl=f},"maddr",x("maddr",!0),function(f){e=e||{data:{}},e.data.maddr=f},"received",x("received",!0),function(f){e=e||{data:{}},e.data.received=f},"branch",x("branch",!0),function(f){e=e||{data:{}},e.data.branch=f},"rport",x("rport",!0),function(f){e=e||{data:{}},typeof f<"u"&&(e.data.rport=f.join(""))},function(f){e=e||{data:{}},e.data.protocol=f},x("UDP",!0),x("TCP",!0),x("TLS",!0),x("SCTP",!0),function(f){e=e||{data:{}},e.data.transport=f},function(){e=e||{data:{}},e.data.host=b()},function(f){e=e||{data:{}},e.data.port=parseInt(f.join(""))},function(f){return parseInt(f.join(""))},function(f){e=e||{data:{}},e.startRule==="Session_Expires"&&(e.data.deltaSeconds=f)},"refresher",x("refresher",!1),"uas",x("uas",!1),"uac",x("uac",!1),function(f){e=e||{data:{}},e.startRule==="Session_Expires"&&(e.data.refresher=f)},function(f){e=e||{data:{}},e.startRule==="Min_SE"&&(e.data=f)},"stuns",x("stuns",!0),"stun",x("stun",!0),function(f){e=e||{data:{}},e.data.scheme=f},function(f){e=e||{data:{}},e.data.host=f},"?transport=",x("?transport=",!1),"turns",x("turns",!0),"turn",x("turn",!0),function(f){e=e||{data:{}},e.data.transport=f},function(){e=e||{data:{}},e.data=b()},"Referred-By",x("Referred-By",!1),"b",x("b",!1),"cid",x("cid",!1)],o=[h('2 ""6 7!'),h('4"""5!7#'),h('4$""5!7%'),h(`4&""5!7'`),h(";'.# &;("),h('4(""5!7)'),h('4*""5!7+'),h('2,""6,7-'),h('2.""6.7/'),h('40""5!71'),h('22""6273.‰ &24""6475.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),h(";).# &;,"),h('2F""6F7G.} &2H""6H7I.q &2J""6J7K.e &2L""6L7M.Y &2N""6N7O.M &2P""6P7Q.A &2R""6R7S.5 &2T""6T7U.) &2V""6V7W'),h(`%%2X""6X7Y/5#;#/,$;#/#$+#)(#'#("'#&'#/"!&,)`),h(`%%$;$0#*;$&/,#; /#$+")("'#&'#." &"/=#$;$/&#0#*;$&&&#/'$8":Z" )("'#&'#`),h(';.." &"'),h(`%$;'.# &;(0)*;'.# &;(&/?#28""6879/0$;//'$8#:[# )(#'#("'#&'#`),h(`%%$;2/&#0#*;2&&&#/g#$%$;.0#*;.&/,#;2/#$+")("'#&'#0=*%$;.0#*;.&/,#;2/#$+")("'#&'#&/#$+")("'#&'#/"!&,)`),h('4\\""5!7].# &;3'),h('4^""5!7_'),h('4`""5!7a'),h(';!.) &4b""5!7c'),h('%$;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/ž#0›*;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),h('%$;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/’#0*;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),h(`2T""6T7U.ã &2V""6V7W.× &2f""6f7g.Ë &2h""6h7i.¿ &2:""6:7;.³ &2D""6D7E.§ &22""6273.› &28""6879. &2j""6j7k.ƒ &;&.} &24""6475.q &2l""6l7m.e &2n""6n7o.Y &26""6677.M &2>""6>7?.A &2p""6p7q.5 &2r""6r7s.) &;'.# &;(`),h('%$;).ī &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s/Ĵ#0ı*;).ī &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s&&&#/"!&,)'),h(`%;//?#2P""6P7Q/0$;//'$8#:t# )(#'#("'#&'#`),h(`%;//?#24""6475/0$;//'$8#:u# )(#'#("'#&'#`),h(`%;//?#2>""6>7?/0$;//'$8#:v# )(#'#("'#&'#`),h(`%;//?#2T""6T7U/0$;//'$8#:w# )(#'#("'#&'#`),h(`%;//?#2V""6V7W/0$;//'$8#:x# )(#'#("'#&'#`),h(`%2h""6h7i/0#;//'$8":y" )("'#&'#`),h(`%;//6#2f""6f7g/'$8":z" )("'#&'#`),h(`%;//?#2D""6D7E/0$;//'$8#:{# )(#'#("'#&'#`),h(`%;//?#22""6273/0$;//'$8#:|# )(#'#("'#&'#`),h(`%;//?#28""6879/0$;//'$8#:}# )(#'#("'#&'#`),h(`%;//0#;&/'$8":~" )("'#&'#`),h(`%;&/0#;//'$8":~" )("'#&'#`),h(`%;=/T#$;G.) &;K.# &;F0/*;G.) &;K.# &;F&/,$;>/#$+#)(#'#("'#&'#`),h('4""5!7€.A &4""5!7‚.5 &4ƒ""5!7„.) &;3.# &;.'),h(`%%;//Q#;&/H$$;J.# &;K0)*;J.# &;K&/,$;&/#$+$)($'#(#'#("'#&'#/"!&,)`),h(`%;//]#;&/T$%$;J.# &;K0)*;J.# &;K&/"!&,)/1$;&/($8$:…$!!)($'#(#'#("'#&'#`),h(';..G &2L""6L7M.; &4†""5!7‡./ &4ƒ""5!7„.# &;3'),h(`%2j""6j7k/J#4ˆ""5!7‰.5 &4Š""5!7‹.) &4Œ""5!7/#$+")("'#&'#`),h(`%;N/M#28""6879/>$;O." &"/0$;S/'$8$:Ž$ )($'#(#'#("'#&'#`),h(`%;N/d#28""6879/U$;O." &"/G$;S/>$;_/5$;l." &"/'$8&:& )(&'#(%'#($'#(#'#("'#&'#`),h(`%3""5$7‘.) &3’""5#7“/' 8!:”!! )`),h(`%;P/]#%28""6879/,#;R/#$+")("'#&'#." &"/6$2:""6:7;/'$8#:•# )(#'#("'#&'#`),h("$;+.) &;-.# &;Q/2#0/*;+.) &;-.# &;Q&&&#"),h('2<""6<7=.q &2>""6>7?.e &2@""6@7A.Y &2B""6B7C.M &2D""6D7E.A &22""6273.5 &26""6677.) &24""6475'),h('%$;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E0e*;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E&/& 8!:–! )'),h(`%;T/J#%28""6879/,#;^/#$+")("'#&'#." &"/#$+")("'#&'#`),h("%;U.) &;\\.# &;X/& 8!:—! )"),h(`%$%;V/2#2J""6J7K/#$+")("'#&'#0<*%;V/2#2J""6J7K/#$+")("'#&'#&/D#;W/;$2J""6J7K." &"/'$8#:˜# )(#'#("'#&'#`),h('$4™""5!7š/,#0)*4™""5!7š&&&#'),h(`%4$""5!7%/?#$4›""5!7œ0)*4›""5!7œ&/#$+")("'#&'#`),h(`%2l""6l7m/?#;Y/6$2n""6n7o/'$8#:# )(#'#("'#&'#`),h(`%%;Z/³#28""6879/¤$;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+-)(-'#(,'#(+'#(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.ސ &%2ž""6ž7Ÿ/¤#;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+,)(,'#(+'#(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.۹ &%2ž""6ž7Ÿ/Œ#;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.ٺ &%2ž""6ž7Ÿ/t#;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#.ؓ &%2ž""6ž7Ÿ/\\#;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+&)(&'#(%'#($'#(#'#("'#&'#.ׄ &%2ž""6ž7Ÿ/D#;Z/;$28""6879/,$;[/#$+$)($'#(#'#("'#&'#.֍ &%2ž""6ž7Ÿ/,#;[/#$+")("'#&'#.ծ &%2ž""6ž7Ÿ/,#;Z/#$+")("'#&'#.Տ &%;Z/›#2ž""6ž7Ÿ/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$++)(+'#(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ӈ &%;Z/ª#%28""6879/,#;Z/#$+")("'#&'#." &"/ƒ$2ž""6ž7Ÿ/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.а &%;Z/¹#%28""6879/,#;Z/#$+")("'#&'#." &"/’$%28""6879/,#;Z/#$+")("'#&'#." &"/k$2ž""6ž7Ÿ/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+))()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ί &%;Z/È#%28""6879/,#;Z/#$+")("'#&'#." &"/¡$%28""6879/,#;Z/#$+")("'#&'#." &"/z$%28""6879/,#;Z/#$+")("'#&'#." &"/S$2ž""6ž7Ÿ/D$;Z/;$28""6879/,$;[/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#.˕ &%;Z/×#%28""6879/,#;Z/#$+")("'#&'#." &"/°$%28""6879/,#;Z/#$+")("'#&'#." &"/‰$%28""6879/,#;Z/#$+")("'#&'#." &"/b$%28""6879/,#;Z/#$+")("'#&'#." &"/;$2ž""6ž7Ÿ/,$;[/#$+')(''#(&'#(%'#($'#(#'#("'#&'#.ȑ &%;Z/þ#%28""6879/,#;Z/#$+")("'#&'#." &"/×$%28""6879/,#;Z/#$+")("'#&'#." &"/°$%28""6879/,#;Z/#$+")("'#&'#." &"/‰$%28""6879/,#;Z/#$+")("'#&'#." &"/b$%28""6879/,#;Z/#$+")("'#&'#." &"/;$2ž""6ž7Ÿ/,$;Z/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ħ &%;Z/Ĝ#%28""6879/,#;Z/#$+")("'#&'#." &"/õ$%28""6879/,#;Z/#$+")("'#&'#." &"/Î$%28""6879/,#;Z/#$+")("'#&'#." &"/§$%28""6879/,#;Z/#$+")("'#&'#." &"/€$%28""6879/,#;Z/#$+")("'#&'#." &"/Y$%28""6879/,#;Z/#$+")("'#&'#." &"/2$2ž""6ž7Ÿ/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#/& 8!: ! )`),h(`%;#/M#;#." &"/?$;#." &"/1$;#." &"/#$+$)($'#(#'#("'#&'#`),h(`%;Z/;#28""6879/,$;Z/#$+#)(#'#("'#&'#.# &;\\`),h(`%;]/o#2J""6J7K/\`$;]/W$2J""6J7K/H$;]/?$2J""6J7K/0$;]/'$8':¡' )(''#(&'#(%'#($'#(#'#("'#&'#`),h(`%2¢""6¢7£/2#4¤""5!7¥/#$+")("'#&'#.˜ &%2¦""6¦7§/;#4¨""5!7©/,$;!/#$+#)(#'#("'#&'#.j &%2ª""6ª7«/5#;!/,$;!/#$+#)(#'#("'#&'#.B &%4¬""5!7­/,#;!/#$+")("'#&'#.# &;!`),h(`%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%'#($'#(#'#("'#&'#/' 8!:®!! )`),h(`$%22""6273/,#;\`/#$+")("'#&'#0<*%22""6273/,#;\`/#$+")("'#&'#&`),h(";a.A &;b.; &;c.5 &;d./ &;e.) &;f.# &;g"),h(`%3¯""5*7°/a#3±""5#7².G &3³""5#7´.; &3µ""5$7¶./ &3·""5#7¸.# &;6/($8":¹"! )("'#&'#`),h(`%3º""5%7»/I#3¼""5%7½./ &3¾""5"7¿.# &;6/($8":À"! )("'#&'#`),h(`%3Á""5'7Â/1#;/($8":Ã"! )("'#&'#`),h(`%3Ä""5$7Å/1#;ð/($8":Æ"! )("'#&'#`),h(`%3Ç""5&7È/1#;T/($8":É"! )("'#&'#`),h(`%3Ê""5"7Ë/N#%2>""6>7?/,#;6/#$+")("'#&'#." &"/'$8":Ì" )("'#&'#`),h(`%;h/P#%2>""6>7?/,#;i/#$+")("'#&'#." &"/)$8":Í""! )("'#&'#`),h('%$;j/&#0#*;j&&&#/"!&,)'),h('%$;j/&#0#*;j&&&#/"!&,)'),h(";k.) &;+.# &;-"),h('2l""6l7m.e &2n""6n7o.Y &24""6475.M &28""6879.A &2<""6<7=.5 &2@""6@7A.) &2B""6B7C'),h(`%26""6677/n#;m/e$$%2<""6<7=/,#;m/#$+")("'#&'#0<*%2<""6<7=/,#;m/#$+")("'#&'#&/#$+#)(#'#("'#&'#`),h(`%;n/A#2>""6>7?/2$;o/)$8#:Î#"" )(#'#("'#&'#`),h("$;p.) &;+.# &;-/2#0/*;p.) &;+.# &;-&&&#"),h("$;p.) &;+.# &;-0/*;p.) &;+.# &;-&"),h('2l""6l7m.e &2n""6n7o.Y &24""6475.M &26""6677.A &28""6879.5 &2@""6@7A.) &2B""6B7C'),h(";‘.# &;r"),h(`%;/G#;'/>$;s/5$;'/,$;„/#$+%)(%'#($'#(#'#("'#&'#`),h(";M.# &;t"),h(`%;/E#28""6879/6$;u.# &;x/'$8#:Ï# )(#'#("'#&'#`),h(`%;v.# &;w/J#%26""6677/,#;ƒ/#$+")("'#&'#." &"/#$+")("'#&'#`),h(`%2Ð""6Ð7Ñ/:#;€/1$;w." &"/#$+#)(#'#("'#&'#`),h(`%24""6475/,#;{/#$+")("'#&'#`),h(`%;z/3#$;y0#*;y&/#$+")("'#&'#`),h(";*.) &;+.# &;-"),h(';+. &;-.‰ &22""6273.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),h(`%;|/e#$%24""6475/,#;|/#$+")("'#&'#0<*%24""6475/,#;|/#$+")("'#&'#&/#$+")("'#&'#`),h(`%$;~0#*;~&/e#$%22""6273/,#;}/#$+")("'#&'#0<*%22""6273/,#;}/#$+")("'#&'#&/#$+")("'#&'#`),h("$;~0#*;~&"),h(';+.w &;-.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),h(`%%;"/‡#$;".G &;!.A &2@""6@7A.5 &2F""6F7G.) &2J""6J7K0M*;".G &;!.A &2@""6@7A.5 &2F""6F7G.) &2J""6J7K&/#$+")("'#&'#/& 8!:Ò! )`),h(";.# &;‚"),h(`%%;O/2#2:""6:7;/#$+")("'#&'#." &"/,#;S/#$+")("'#&'#." &"`),h('$;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A/Œ#0‰*;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A&&&#'),h("$;y0#*;y&"),h(`%3’""5#7Ó/q#24""6475/b$$;!/&#0#*;!&&&#/L$2J""6J7K/=$$;!/&#0#*;!&&&#/'$8%:Ô% )(%'#($'#(#'#("'#&'#`),h('2Õ""6Õ7Ö'),h('2×""6×7Ø'),h('2Ù""6Ù7Ú'),h('2Û""6Û7Ü'),h('2Ý""6Ý7Þ'),h('2ß""6ß7à'),h('2á""6á7â'),h('2ã""6ã7ä'),h('2å""6å7æ'),h('2ç""6ç7è'),h('2é""6é7ê'),h("%;….Y &;†.S &;ˆ.M &;‰.G &;Š.A &;‹.; &;Œ.5 &;./ &;.) &;Ž.# &;6/& 8!:ë! )"),h(`%;„/G#;'/>$;’/5$;'/,$;”/#$+%)(%'#($'#(#'#("'#&'#`),h("%;“/' 8!:ì!! )"),h(`%;!/5#;!/,$;!/#$+#)(#'#("'#&'#`),h("%$;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(0G*;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(&/& 8!:í! )"),h(`%;¶/Y#$%;A/,#;¶/#$+")("'#&'#06*%;A/,#;¶/#$+")("'#&'#&/#$+")("'#&'#`),h(`%;9/N#%2:""6:7;/,#;9/#$+")("'#&'#." &"/'$8":î" )("'#&'#`),h(`%;:.c &%;˜/Y#$%;A/,#;˜/#$+")("'#&'#06*%;A/,#;˜/#$+")("'#&'#&/#$+")("'#&'#/& 8!:ï! )`),h(`%;L.# &;™/]#$%;B/,#;›/#$+")("'#&'#06*%;B/,#;›/#$+")("'#&'#&/'$8":ð" )("'#&'#`),h(`%;š." &"/>#;@/5$;M/,$;?/#$+$)($'#(#'#("'#&'#`),h(`%%;6/Y#$%;./,#;6/#$+")("'#&'#06*%;./,#;6/#$+")("'#&'#&/#$+")("'#&'#.# &;H/' 8!:ñ!! )`),h(";œ.) &;.# &; "),h(`%3ò""5!7ó/:#;</1$;Ÿ/($8#:ô#! )(#'#("'#&'#`),h(`%3õ""5'7ö/:#;</1$;ž/($8#:÷#! )(#'#("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:ø!! )"),h(`%2ù""6ù7ú/o#%2J""6J7K/M#;!." &"/?$;!." &"/1$;!." &"/#$+$)($'#(#'#("'#&'#." &"/'$8":û" )("'#&'#`),h(`%;6/J#%;</,#;¡/#$+")("'#&'#." &"/)$8":ü""! )("'#&'#`),h(";6.) &;T.# &;H"),h(`%;£/Y#$%;B/,#;¤/#$+")("'#&'#06*%;B/,#;¤/#$+")("'#&'#&/#$+")("'#&'#`),h(`%3ý""5&7þ.G &3ÿ""5'7Ā.; &3ā""5$7Ă./ &3ă""5%7Ą.# &;6/& 8!:ą! )`),h(";¥.# &; "),h(`%3Ć""5(7ć/M#;</D$3Ĉ""5(7ĉ./ &3Ċ""5(7ċ.# &;6/#$+#)(#'#("'#&'#`),h(`%;6/Y#$%;A/,#;6/#$+")("'#&'#06*%;A/,#;6/#$+")("'#&'#&/#$+")("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:Č!! )"),h("%;©/& 8!:č! )"),h(`%;ª/k#;;/b$;¯/Y$$%;B/,#;°/#$+")("'#&'#06*%;B/,#;°/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),h(";«.# &;¬"),h('3Ď""5$7ď.S &3Đ""5%7đ.G &3Ē""5%7ē.; &3Ĕ""5%7ĕ./ &3Ė""5+7ė.# &;­'),h(`3Ę""5'7ę./ &3Ě""5)7ě.# &;­`),h(";6.# &;®"),h(`%3Ĝ""5"7ĝ/,#;6/#$+")("'#&'#`),h(";­.# &;6"),h(`%;6/5#;</,$;±/#$+#)(#'#("'#&'#`),h(";6.# &;H"),h(`%;³/5#;./,$;/#$+#)(#'#("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:Ğ!! )"),h("%;ž/' 8!:ğ!! )"),h(`%;¶/^#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/($8":Ġ"!!)("'#&'#`),h(`%%;7/e#$%2J""6J7K/,#;7/#$+")("'#&'#0<*%2J""6J7K/,#;7/#$+")("'#&'#&/#$+")("'#&'#/"!&,)`),h(`%;L.# &;™/]#$%;B/,#;¸/#$+")("'#&'#06*%;B/,#;¸/#$+")("'#&'#&/'$8":ġ" )("'#&'#`),h(";¹.# &; "),h(`%3Ģ""5#7ģ/:#;</1$;6/($8#:Ĥ#! )(#'#("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:ĥ!! )"),h("%;ž/' 8!:Ħ!! )"),h(`%$;š0#*;š&/x#;@/o$;M/f$;?/]$$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/'$8%:ħ% )(%'#($'#(#'#("'#&'#`),h(";¾"),h(`%3Ĩ""5&7ĩ/k#;./b$;Á/Y$$%;A/,#;Á/#$+")("'#&'#06*%;A/,#;Á/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#.# &;¿`),h(`%;6/k#;./b$;À/Y$$%;A/,#;À/#$+")("'#&'#06*%;A/,#;À/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),h(`%;6/;#;</2$;6.# &;H/#$+#)(#'#("'#&'#`),h(";Â.G &;Ä.A &;Æ.; &;È.5 &;É./ &;Ê.) &;Ë.# &;À"),h(`%3Ī""5%7ī/5#;</,$;Ã/#$+#)(#'#("'#&'#`),h("%;I/' 8!:Ĭ!! )"),h(`%3ĭ""5&7Į/—#;</Ž$;D/…$;Å/|$$%$;'/&#0#*;'&&&#/,#;Å/#$+")("'#&'#0C*%$;'/&#0#*;'&&&#/,#;Å/#$+")("'#&'#&/,$;E/#$+&)(&'#(%'#($'#(#'#("'#&'#`),h(";t.# &;w"),h(`%3į""5%7İ/5#;</,$;Ç/#$+#)(#'#("'#&'#`),h("%;I/' 8!:ı!! )"),h(`%3IJ""5&7ij/:#;</1$;I/($8#:Ĵ#! )(#'#("'#&'#`),h(`%3ĵ""5%7Ķ/]#;</T$%3ķ""5$7ĸ/& 8!:Ĺ! ).4 &%3ĺ""5%7Ļ/& 8!:ļ! )/#$+#)(#'#("'#&'#`),h(`%3Ľ""5)7ľ/R#;</I$3Ŀ""5#7ŀ./ &3Ł""5(7ł.# &;6/($8#:Ń#! )(#'#("'#&'#`),h(`%3ń""5#7Ņ/“#;</Š$;D/$%;Ì/e#$%2D""6D7E/,#;Ì/#$+")("'#&'#0<*%2D""6D7E/,#;Ì/#$+")("'#&'#&/#$+")("'#&'#/,$;E/#$+%)(%'#($'#(#'#("'#&'#`),h(`%3ņ""5(7Ň./ &3ň""5$7ʼn.# &;6/' 8!:Ŋ!! )`),h(`%;6/Y#$%;A/,#;6/#$+")("'#&'#06*%;A/,#;6/#$+")("'#&'#&/#$+")("'#&'#`),h(`%;Ï/G#;./>$;Ï/5$;./,$;/#$+%)(%'#($'#(#'#("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:ŋ!! )"),h(`%;Ñ/]#$%;A/,#;Ñ/#$+")("'#&'#06*%;A/,#;Ñ/#$+")("'#&'#&/'$8":Ō" )("'#&'#`),h(`%;™/]#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/'$8":ō" )("'#&'#`),h(`%;L.O &;™.I &%;@." &"/:#;t/1$;?." &"/#$+#)(#'#("'#&'#/]#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/'$8":Ŏ" )("'#&'#`),h(`%;Ô/]#$%;B/,#;Õ/#$+")("'#&'#06*%;B/,#;Õ/#$+")("'#&'#&/'$8":ŏ" )("'#&'#`),h("%;–/& 8!:Ő! )"),h(`%3ő""5(7Œ/:#;</1$;6/($8#:œ#! )(#'#("'#&'#.g &%3Ŕ""5&7ŕ/:#;</1$;6/($8#:Ŗ#! )(#'#("'#&'#.: &%3ŗ""5*7Ř/& 8!:ř! ).# &; `),h(`%%;6/k#$%;A/2#;6/)$8":Ś""$ )("'#&'#0<*%;A/2#;6/)$8":Ś""$ )("'#&'#&/)$8":ś""! )("'#&'#." &"/' 8!:Ŝ!! )`),h(`%;Ø/Y#$%;A/,#;Ø/#$+")("'#&'#06*%;A/,#;Ø/#$+")("'#&'#&/#$+")("'#&'#`),h(`%;™/Y#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/#$+")("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:ŝ!! )"),h(`%;Û/Y#$%;B/,#;Ü/#$+")("'#&'#06*%;B/,#;Ü/#$+")("'#&'#&/#$+")("'#&'#`),h(`%3Ş""5&7ş.; &3Š""5'7š./ &3Ţ""5*7ţ.# &;6/& 8!:Ť! )`),h(`%3ť""5&7Ŧ/:#;</1$;Ý/($8#:ŧ#! )(#'#("'#&'#.} &%3õ""5'7ö/:#;</1$;ž/($8#:Ũ#! )(#'#("'#&'#.P &%3ũ""5+7Ū/:#;</1$;ž/($8#:ū#! )(#'#("'#&'#.# &; `),h(`3Ŭ""5+7ŭ.k &3Ů""5)7ů._ &3Ű""5(7ű.S &3Ų""5'7ų.G &3Ŵ""5&7ŵ.; &3Ŷ""5*7ŷ./ &3Ÿ""5)7Ź.# &;6`),h(';1." &"'),h(`%%;6/k#$%;A/2#;6/)$8":Ś""$ )("'#&'#0<*%;A/2#;6/)$8":Ś""$ )("'#&'#&/)$8":ś""! )("'#&'#." &"/' 8!:ź!! )`),h(`%;L.# &;™/]#$%;B/,#;á/#$+")("'#&'#06*%;B/,#;á/#$+")("'#&'#&/'$8":Ż" )("'#&'#`),h(";¹.# &; "),h(`%;ã/Y#$%;A/,#;ã/#$+")("'#&'#06*%;A/,#;ã/#$+")("'#&'#&/#$+")("'#&'#`),h(`%;ê/k#;./b$;í/Y$$%;B/,#;ä/#$+")("'#&'#06*%;B/,#;ä/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),h(";å.; &;æ.5 &;ç./ &;è.) &;é.# &; "),h(`%3ż""5#7Ž/:#;</1$;ð/($8#:ž#! )(#'#("'#&'#`),h(`%3ſ""5%7ƀ/:#;</1$;T/($8#:Ɓ#! )(#'#("'#&'#`),h(`%3Ƃ""5(7ƃ/F#;</=$;\\.) &;Y.# &;X/($8#:Ƅ#! )(#'#("'#&'#`),h(`%3ƅ""5&7Ɔ/:#;</1$;6/($8#:Ƈ#! )(#'#("'#&'#`),h(`%3ƈ""5%7Ɖ/A#;</8$$;!0#*;!&/($8#:Ɗ#! )(#'#("'#&'#`),h(`%;ë/G#;;/>$;6/5$;;/,$;ì/#$+%)(%'#($'#(#'#("'#&'#`),h(`%3’""5#7Ó.# &;6/' 8!:Ƌ!! )`),h(`%3±""5#7ƌ.G &3³""5#7ƍ.; &3·""5#7Ǝ./ &3µ""5$7Ə.# &;6/' 8!:Ɛ!! )`),h(`%;î/D#%;C/,#;ï/#$+")("'#&'#." &"/#$+")("'#&'#`),h("%;U.) &;\\.# &;X/& 8!:Ƒ! )"),h(`%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%'#($'#(#'#("'#&'#/' 8!:ƒ!! )`),h(`%%;!/?#;!." &"/1$;!." &"/#$+#)(#'#("'#&'#/' 8!:Ɠ!! )`),h(";¾"),h(`%;ž/^#$%;B/,#;ó/#$+")("'#&'#06*%;B/,#;ó/#$+")("'#&'#&/($8":Ɣ"!!)("'#&'#`),h(";ô.# &; "),h(`%2ƕ""6ƕ7Ɩ/L#;</C$2Ɨ""6Ɨ7Ƙ.) &2ƙ""6ƙ7ƚ/($8#:ƛ#! )(#'#("'#&'#`),h(`%;ž/^#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/($8":Ɯ"!!)("'#&'#`),h(`%;6/5#;0/,$;÷/#$+#)(#'#("'#&'#`),h("$;2.) &;4.# &;.0/*;2.) &;4.# &;.&"),h("$;%0#*;%&"),h(`%;ú/;#28""6879/,$;û/#$+#)(#'#("'#&'#`),h(`%3Ɲ""5%7ƞ.) &3Ɵ""5$7Ơ/' 8!:ơ!! )`),h(`%;ü/J#%28""6879/,#;^/#$+")("'#&'#." &"/#$+")("'#&'#`),h("%;\\.) &;X.# &;‚/' 8!:Ƣ!! )"),h(';".S &;!.M &2F""6F7G.A &2J""6J7K.5 &2H""6H7I.) &2N""6N7O'),h('2L""6L7M.• &2B""6B7C.‰ &2<""6<7=.} &2R""6R7S.q &2T""6T7U.e &2V""6V7W.Y &2P""6P7Q.M &2@""6@7A.A &2D""6D7E.5 &22""6273.) &2>""6>7?'),h(`%;Ā/b#28""6879/S$;û/J$%2ƣ""6ƣ7Ƥ/,#;ì/#$+")("'#&'#." &"/#$+$)($'#(#'#("'#&'#`),h(`%3ƥ""5%7Ʀ.) &3Ƨ""5$7ƨ/' 8!:ơ!! )`),h(`%3±""5#7².6 &3³""5#7´.* &$;+0#*;+&/' 8!:Ʃ!! )`),h(`%;Ą/‡#2F""6F7G/x$;ă/o$2F""6F7G/\`$;ă/W$2F""6F7G/H$;ă/?$2F""6F7G/0$;ą/'$8):ƪ) )()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#`),h(`%;#/>#;#/5$;#/,$;#/#$+$)($'#(#'#("'#&'#`),h(`%;ă/,#;ă/#$+")("'#&'#`),h(`%;ă/5#;ă/,$;ă/#$+#)(#'#("'#&'#`),h(`%;q/T#$;m0#*;m&/D$%; /,#;ø/#$+")("'#&'#." &"/#$+#)(#'#("'#&'#`),h(`%2ƫ""6ƫ7Ƭ.) &2ƭ""6ƭ7Ʈ/w#;0/n$;Ĉ/e$$%;B/2#;ĉ.# &; /#$+")("'#&'#0<*%;B/2#;ĉ.# &; /#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),h(";™.# &;L"),h(`%2Ư""6Ư7ư/5#;</,$;Ċ/#$+#)(#'#("'#&'#`),h(`%;D/S#;,/J$2:""6:7;/;$;,.# &;T/,$;E/#$+%)(%'#($'#(#'#("'#&'#`)];let d=0,c=0;const l=[{line:1,column:1}];let g=0,u=[],y=0,w;if(e.startRule!==void 0){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function b(){return r.substring(c,d)}function C(){return R(c,d)}function x(f,v){return{type:"literal",text:f,ignoreCase:v}}function p(f,v,m){return{type:"class",parts:f,inverted:v,ignoreCase:m}}function E(){return{type:"end"}}function _(f){let v=l[f],m;if(v)return v;for(m=f-1;!l[m];)m--;for(v=l[m],v={line:v.line,column:v.column};m<f;)r.charCodeAt(m)===10?(v.line++,v.column=1):v.column++,m++;return l[f]=v,v}function R(f,v){const m=_(f),L=_(v);return{source:s,start:{offset:f,line:m.line,column:m.column},end:{offset:v,line:L.line,column:L.column}}}function T(f){d<g||(d>g&&(g=d,u=[]),u.push(f))}function F(f,v,m){return new vr(vr.buildMessage(f,v),f,v,m)}function h(f){return f.split("").map(v=>v.charCodeAt(0)-32)}function N(f){const v=o[f];let m=0;const L=[];let j=v.length;const X=[],W=[];let ie;for(;;){for(;m<j;)switch(v[m]){case 0:W.push(a[v[m+1]]),m+=2;break;case 1:W.push(void 0),m++;break;case 2:W.push(null),m++;break;case 3:W.push(t),m++;break;case 4:W.push([]),m++;break;case 5:W.push(d),m++;break;case 6:W.pop(),m++;break;case 7:d=W.pop(),m++;break;case 8:W.length-=v[m+1],m+=2;break;case 9:W.splice(-2,1),m++;break;case 10:W[W.length-2].push(W.pop()),m++;break;case 11:W.push(W.splice(W.length-v[m+1],v[m+1])),m+=2;break;case 12:W.push(r.substring(W.pop(),d)),m++;break;case 13:X.push(j),L.push(m+3+v[m+1]+v[m+2]),W[W.length-1]?(j=m+3+v[m+1],m+=3):(j=m+3+v[m+1]+v[m+2],m+=3+v[m+1]);break;case 14:X.push(j),L.push(m+3+v[m+1]+v[m+2]),W[W.length-1]===t?(j=m+3+v[m+1],m+=3):(j=m+3+v[m+1]+v[m+2],m+=3+v[m+1]);break;case 15:X.push(j),L.push(m+3+v[m+1]+v[m+2]),W[W.length-1]!==t?(j=m+3+v[m+1],m+=3):(j=m+3+v[m+1]+v[m+2],m+=3+v[m+1]);break;case 16:W[W.length-1]!==t?(X.push(j),L.push(m),j=m+2+v[m+1],m+=2):m+=2+v[m+1];break;case 17:X.push(j),L.push(m+3+v[m+1]+v[m+2]),r.length>d?(j=m+3+v[m+1],m+=3):(j=m+3+v[m+1]+v[m+2],m+=3+v[m+1]);break;case 18:X.push(j),L.push(m+4+v[m+2]+v[m+3]),r.substr(d,a[v[m+1]].length)===a[v[m+1]]?(j=m+4+v[m+2],m+=4):(j=m+4+v[m+2]+v[m+3],m+=4+v[m+2]);break;case 19:X.push(j),L.push(m+4+v[m+2]+v[m+3]),r.substr(d,a[v[m+1]].length).toLowerCase()===a[v[m+1]]?(j=m+4+v[m+2],m+=4):(j=m+4+v[m+2]+v[m+3],m+=4+v[m+2]);break;case 20:X.push(j),L.push(m+4+v[m+2]+v[m+3]),a[v[m+1]].test(r.charAt(d))?(j=m+4+v[m+2],m+=4):(j=m+4+v[m+2]+v[m+3],m+=4+v[m+2]);break;case 21:W.push(r.substr(d,v[m+1])),d+=v[m+1],m+=2;break;case 22:W.push(a[v[m+1]]),d+=a[v[m+1]].length,m+=2;break;case 23:W.push(t),y===0&&T(a[v[m+1]]),m+=2;break;case 24:c=W[W.length-1-v[m+1]],m+=2;break;case 25:c=d,m++;break;case 26:ie=v.slice(m+4,m+4+v[m+3]).map(function(he){return W[W.length-1-he]}),W.splice(W.length-v[m+2],v[m+2],a[v[m+1]].apply(null,ie)),m+=4+v[m+3];break;case 27:W.push(N(v[m+1])),m+=2;break;case 28:y++,m++;break;case 29:y--,m++;break;default:throw new Error("Invalid opcode: "+v[m]+".")}if(X.length>0)j=X.pop(),m=L.pop();else break}return W[0]}e.data={};function A(f,v){return[f].concat(v)}if(w=N(n),w!==t&&d===r.length)return w;throw w!==t&&d<r.length&&T(E()),F(u,g<r.length?r.charAt(g):null,g<r.length?R(g,g+1):R(g,g))}const nc=ic;var Ie;(function(r){function e(i,n){const a={startRule:n};try{nc(i,a)}catch{a.data=-1}return a.data}r.parse=e;function t(i){const n=r.parse(i,"Name_Addr_Header");return n!==-1?n:void 0}r.nameAddrHeaderParse=t;function s(i){const n=r.parse(i,"SIP_URI");return n!==-1?n:void 0}r.URIParse=s})(Ie=Ie||(Ie={}));const ac={100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"};function or(r,e=32){let t="";for(let s=0;s<r;s++){const i=Math.floor(Math.random()*e);t+=i.toString(e)}return t}function cs(r){return ac[r]||""}function ls(){return or(10)}function wt(r){const e={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},t=r.toLowerCase().replace(/_/g,"-").split("-"),s=t.length;let i="";for(let n=0;n<s;n++)n!==0&&(i+="-"),i+=t[n].charAt(0).toUpperCase()+t[n].substring(1);return e[i]&&(i=e[i]),i}function jr(r){return encodeURIComponent(r).replace(/%[A-F\d]{2}/g,"U").length}class Ra{constructor(){this.headers={}}addHeader(e,t){const s={raw:t};e=wt(e),this.headers[e]?this.headers[e].push(s):this.headers[e]=[s]}getHeader(e){const t=this.headers[wt(e)];if(t){if(t[0])return t[0].raw}else return}getHeaders(e){const t=this.headers[wt(e)],s=[];if(!t)return[];for(const i of t)s.push(i.raw);return s}hasHeader(e){return!!this.headers[wt(e)]}parseHeader(e,t=0){if(e=wt(e),this.headers[e]){if(t>=this.headers[e].length)return}else return;const s=this.headers[e][t],i=s.raw;if(s.parsed)return s.parsed;const n=Ie.parse(i,e.replace(/-/g,"_"));if(n===-1){this.headers[e].splice(t,1);return}else return s.parsed=n,n}s(e,t=0){return this.parseHeader(e,t)}setHeader(e,t){this.headers[wt(e)]=[{raw:t}]}toString(){return this.data}}class yr extends Ra{constructor(){super()}}class Gt extends Ra{constructor(){super()}}class cr{constructor(e,t,s,i,n,a,o){this.headers={},this.extraHeaders=[],this.options=cr.getDefaultOptions(),n&&(this.options=Object.assign(Object.assign({},this.options),n),this.options.optionTags&&this.options.optionTags.length&&(this.options.optionTags=this.options.optionTags.slice()),this.options.routeSet&&this.options.routeSet.length&&(this.options.routeSet=this.options.routeSet.slice())),a&&a.length&&(this.extraHeaders=a.slice()),o&&(this.body={body:o.content,contentType:o.contentType}),this.method=e,this.ruri=t.clone(),this.fromURI=s.clone(),this.fromTag=this.options.fromTag?this.options.fromTag:ls(),this.from=cr.makeNameAddrHeader(this.fromURI,this.options.fromDisplayName,this.fromTag),this.toURI=i.clone(),this.toTag=this.options.toTag,this.to=cr.makeNameAddrHeader(this.toURI,this.options.toDisplayName,this.toTag),this.callId=this.options.callId?this.options.callId:this.options.callIdPrefix+or(15),this.cseq=this.options.cseq,this.setHeader("route",this.options.routeSet),this.setHeader("via",""),this.setHeader("to",this.to.toString()),this.setHeader("from",this.from.toString()),this.setHeader("cseq",this.cseq+" "+this.method),this.setHeader("call-id",this.callId),this.setHeader("max-forwards","70")}static getDefaultOptions(){return{callId:"",callIdPrefix:"",cseq:1,toDisplayName:"",toTag:"",fromDisplayName:"",fromTag:"",forceRport:!1,hackViaTcp:!1,optionTags:["outbound"],routeSet:[],userAgentString:"sip.js",viaHost:""}}static makeNameAddrHeader(e,t,s){const i={};return s&&(i.tag=s),new ze(e,t,i)}getHeader(e){const t=this.headers[wt(e)];if(t){if(t[0])return t[0]}else{const s=new RegExp("^\\s*"+e+"\\s*:","i");for(const i of this.extraHeaders)if(s.test(i))return i.substring(i.indexOf(":")+1).trim()}}getHeaders(e){const t=[],s=this.headers[wt(e)];if(s)for(const i of s)t.push(i);else{const i=new RegExp("^\\s*"+e+"\\s*:","i");for(const n of this.extraHeaders)i.test(n)&&t.push(n.substring(n.indexOf(":")+1).trim())}return t}hasHeader(e){if(this.headers[wt(e)])return!0;{const t=new RegExp("^\\s*"+e+"\\s*:","i");for(const s of this.extraHeaders)if(t.test(s))return!0}return!1}setHeader(e,t){this.headers[wt(e)]=t instanceof Array?t:[t]}setViaHeader(e,t){this.options.hackViaTcp&&(t="TCP");let s="SIP/2.0/"+t;s+=" "+this.options.viaHost+";branch="+e,this.options.forceRport&&(s+=";rport"),this.setHeader("via",s),this.branch=e}toString(){let e="";e+=this.method+" "+this.ruri.toRaw()+` SIP/2.0\r
164
+ `,!1),/^[0-9]/,p([["0","9"]],!1,!1),/^[a-zA-Z]/,p([["a","z"],["A","Z"]],!1,!1),/^[0-9a-fA-F]/,p([["0","9"],["a","f"],["A","F"]],!1,!1),/^[\0-\xFF]/,p([["\0","ÿ"]],!1,!1),/^["]/,p(['"'],!1,!1)," ",x(" ",!1)," ",x(" ",!1),/^[a-zA-Z0-9]/,p([["a","z"],["A","Z"],["0","9"]],!1,!1),";",x(";",!1),"/",x("/",!1),"?",x("?",!1),":",x(":",!1),"@",x("@",!1),"&",x("&",!1),"=",x("=",!1),"+",x("+",!1),"$",x("$",!1),",",x(",",!1),"-",x("-",!1),"_",x("_",!1),".",x(".",!1),"!",x("!",!1),"~",x("~",!1),"*",x("*",!1),"'",x("'",!1),"(",x("(",!1),")",x(")",!1),"%",x("%",!1),function(){return" "},function(){return":"},/^[!-~]/,p([["!","~"]],!1,!1),/^[\x80-\uFFFF]/,p([["€","￿"]],!1,!1),/^[\x80-\xBF]/,p([["€","¿"]],!1,!1),/^[a-f]/,p([["a","f"]],!1,!1),"`",x("`",!1),"<",x("<",!1),">",x(">",!1),"\\",x("\\",!1),"[",x("[",!1),"]",x("]",!1),"{",x("{",!1),"}",x("}",!1),function(){return"*"},function(){return"/"},function(){return"="},function(){return"("},function(){return")"},function(){return">"},function(){return"<"},function(){return","},function(){return";"},function(){return":"},function(){return'"'},/^[!-']/,p([["!","'"]],!1,!1),/^[*-[]/,p([["*","["]],!1,!1),/^[\]-~]/,p([["]","~"]],!1,!1),function(f){return f},/^[#-[]/,p([["#","["]],!1,!1),/^[\0-\t]/,p([["\0"," "]],!1,!1),/^[\v-\f]/,p([["\v","\f"]],!1,!1),/^[\x0E-\x7F]/,p([["",""]],!1,!1),function(){e=e||{data:{}},e.data.uri=new yt(e.data.scheme,e.data.user,e.data.host,e.data.port),delete e.data.scheme,delete e.data.user,delete e.data.host,delete e.data.host_type,delete e.data.port},function(){e=e||{data:{}},e.data.uri=new yt(e.data.scheme,e.data.user,e.data.host,e.data.port,e.data.uri_params,e.data.uri_headers),delete e.data.scheme,delete e.data.user,delete e.data.host,delete e.data.host_type,delete e.data.port,delete e.data.uri_params,e.startRule==="SIP_URI"&&(e.data=e.data.uri)},"sips",x("sips",!0),"sip",x("sip",!0),function(f){e=e||{data:{}},e.data.scheme=f},function(){e=e||{data:{}},e.data.user=decodeURIComponent(b().slice(0,-1))},function(){e=e||{data:{}},e.data.password=b()},function(){return e=e||{data:{}},e.data.host=b(),e.data.host},function(){return e=e||{data:{}},e.data.host_type="domain",b()},/^[a-zA-Z0-9_\-]/,p([["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),/^[a-zA-Z0-9\-]/,p([["a","z"],["A","Z"],["0","9"],"-"],!1,!1),function(){return e=e||{data:{}},e.data.host_type="IPv6",b()},"::",x("::",!1),function(){return e=e||{data:{}},e.data.host_type="IPv6",b()},function(){return e=e||{data:{}},e.data.host_type="IPv4",b()},"25",x("25",!1),/^[0-5]/,p([["0","5"]],!1,!1),"2",x("2",!1),/^[0-4]/,p([["0","4"]],!1,!1),"1",x("1",!1),/^[1-9]/,p([["1","9"]],!1,!1),function(f){return e=e||{data:{}},f=parseInt(f.join("")),e.data.port=f,f},"transport=",x("transport=",!0),"udp",x("udp",!0),"tcp",x("tcp",!0),"sctp",x("sctp",!0),"tls",x("tls",!0),function(f){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.transport=f.toLowerCase()},"user=",x("user=",!0),"phone",x("phone",!0),"ip",x("ip",!0),function(f){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.user=f.toLowerCase()},"method=",x("method=",!0),function(f){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.method=f},"ttl=",x("ttl=",!0),function(f){e=e||{data:{}},e.data.params||(e.data.params={}),e.data.params.ttl=f},"maddr=",x("maddr=",!0),function(f){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.maddr=f},"lr",x("lr",!0),function(){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),e.data.uri_params.lr=void 0},function(f,v){e=e||{data:{}},e.data.uri_params||(e.data.uri_params={}),v===null?v=void 0:v=v[1],e.data.uri_params[f.toLowerCase()]=v},function(f,v){f=f.join("").toLowerCase(),v=v.join(""),e=e||{data:{}},e.data.uri_headers||(e.data.uri_headers={}),e.data.uri_headers[f]?e.data.uri_headers[f].push(v):e.data.uri_headers[f]=[v]},function(){e=e||{data:{}},e.startRule==="Refer_To"&&(e.data.uri=new yt(e.data.scheme,e.data.user,e.data.host,e.data.port,e.data.uri_params,e.data.uri_headers),delete e.data.scheme,delete e.data.user,delete e.data.host,delete e.data.host_type,delete e.data.port,delete e.data.uri_params)},"//",x("//",!1),function(){e=e||{data:{}},e.data.scheme=b()},x("SIP",!0),function(){e=e||{data:{}},e.data.sip_version=b()},"INVITE",x("INVITE",!1),"ACK",x("ACK",!1),"VXACH",x("VXACH",!1),"OPTIONS",x("OPTIONS",!1),"BYE",x("BYE",!1),"CANCEL",x("CANCEL",!1),"REGISTER",x("REGISTER",!1),"SUBSCRIBE",x("SUBSCRIBE",!1),"NOTIFY",x("NOTIFY",!1),"REFER",x("REFER",!1),"PUBLISH",x("PUBLISH",!1),function(){return e=e||{data:{}},e.data.method=b(),e.data.method},function(f){e=e||{data:{}},e.data.status_code=parseInt(f.join(""))},function(){e=e||{data:{}},e.data.reason_phrase=b()},function(){e=e||{data:{}},e.data=b()},function(){var f,v;for(e=e||{data:{}},v=e.data.multi_header.length,f=0;f<v;f++)if(e.data.multi_header[f].parsed===null){e.data=null;break}e.data!==null?e.data=e.data.multi_header:e.data=-1},function(){var f;e=e||{data:{}},e.data.multi_header||(e.data.multi_header=[]);try{f=new ze(e.data.uri,e.data.displayName,e.data.params),delete e.data.uri,delete e.data.displayName,delete e.data.params}catch{f=null}e.data.multi_header.push({position:d,offset:C().start.offset,parsed:f})},function(f){f=b().trim(),f[0]==='"'&&(f=f.substring(1,f.length-1)),e=e||{data:{}},e.data.displayName=f},"q",x("q",!0),function(f){e=e||{data:{}},e.data.params||(e.data.params={}),e.data.params.q=f},"expires",x("expires",!0),function(f){e=e||{data:{}},e.data.params||(e.data.params={}),e.data.params.expires=f},function(f){return parseInt(f.join(""))},"0",x("0",!1),function(){return parseFloat(b())},function(f,v){e=e||{data:{}},e.data.params||(e.data.params={}),v===null?v=void 0:v=v[1],e.data.params[f.toLowerCase()]=v},"render",x("render",!0),"session",x("session",!0),"icon",x("icon",!0),"alert",x("alert",!0),function(){e=e||{data:{}},e.startRule==="Content_Disposition"&&(e.data.type=b().toLowerCase())},"handling",x("handling",!0),"optional",x("optional",!0),"required",x("required",!0),function(f){e=e||{data:{}},e.data=parseInt(f.join(""))},function(){e=e||{data:{}},e.data=b()},"text",x("text",!0),"image",x("image",!0),"audio",x("audio",!0),"video",x("video",!0),"application",x("application",!0),"message",x("message",!0),"multipart",x("multipart",!0),"x-",x("x-",!0),function(f){e=e||{data:{}},e.data.value=parseInt(f.join(""))},function(f){e=e||{data:{}},e.data=f},function(f){e=e||{data:{}},e.data.event=f.toLowerCase()},function(){e=e||{data:{}};var f=e.data.tag;e.data=new ze(e.data.uri,e.data.displayName,e.data.params),f&&e.data.setParam("tag",f)},"tag",x("tag",!0),function(f){e=e||{data:{}},e.data.tag=f},function(f){e=e||{data:{}},e.data=parseInt(f.join(""))},function(f){e=e||{data:{}},e.data=f},function(){e=e||{data:{}},e.data=new ze(e.data.uri,e.data.displayName,e.data.params)},"digest",x("Digest",!0),"realm",x("realm",!0),function(f){e=e||{data:{}},e.data.realm=f},"domain",x("domain",!0),"nonce",x("nonce",!0),function(f){e=e||{data:{}},e.data.nonce=f},"opaque",x("opaque",!0),function(f){e=e||{data:{}},e.data.opaque=f},"stale",x("stale",!0),"true",x("true",!0),function(){e=e||{data:{}},e.data.stale=!0},"false",x("false",!0),function(){e=e||{data:{}},e.data.stale=!1},"algorithm",x("algorithm",!0),"md5",x("MD5",!0),"md5-sess",x("MD5-sess",!0),function(f){e=e||{data:{}},e.data.algorithm=f.toUpperCase()},"qop",x("qop",!0),"auth-int",x("auth-int",!0),"auth",x("auth",!0),function(f){e=e||{data:{}},e.data.qop||(e.data.qop=[]),e.data.qop.push(f.toLowerCase())},function(f){e=e||{data:{}},e.data.value=parseInt(f.join(""))},function(){var f,v;for(e=e||{data:{}},v=e.data.multi_header.length,f=0;f<v;f++)if(e.data.multi_header[f].parsed===null){e.data=null;break}e.data!==null?e.data=e.data.multi_header:e.data=-1},function(){var f;e=e||{data:{}},e.data.multi_header||(e.data.multi_header=[]);try{f=new ze(e.data.uri,e.data.displayName,e.data.params),delete e.data.uri,delete e.data.displayName,delete e.data.params}catch{f=null}e.data.multi_header.push({position:d,offset:C().start.offset,parsed:f})},function(){e=e||{data:{}},e.data=new ze(e.data.uri,e.data.displayName,e.data.params)},function(){e=e||{data:{}},e.data.replaces_from_tag&&e.data.replaces_to_tag||(e.data=-1)},function(){e=e||{data:{}},e.data={call_id:e.data}},"from-tag",x("from-tag",!0),function(f){e=e||{data:{}},e.data.replaces_from_tag=f},"to-tag",x("to-tag",!0),function(f){e=e||{data:{}},e.data.replaces_to_tag=f},"early-only",x("early-only",!0),function(){e=e||{data:{}},e.data.early_only=!0},function(f,v){return v},function(f,v){return A(f,v)},function(f){e=e||{data:{}},e.startRule==="Require"&&(e.data=f||[])},function(f){e=e||{data:{}},e.data.value=parseInt(f.join(""))},"active",x("active",!0),"pending",x("pending",!0),"terminated",x("terminated",!0),function(){e=e||{data:{}},e.data.state=b()},"reason",x("reason",!0),function(f){e=e||{data:{}},typeof f<"u"&&(e.data.reason=f)},function(f){e=e||{data:{}},typeof f<"u"&&(e.data.expires=f)},"retry_after",x("retry_after",!0),function(f){e=e||{data:{}},typeof f<"u"&&(e.data.retry_after=f)},"deactivated",x("deactivated",!0),"probation",x("probation",!0),"rejected",x("rejected",!0),"timeout",x("timeout",!0),"giveup",x("giveup",!0),"noresource",x("noresource",!0),"invariant",x("invariant",!0),function(f){e=e||{data:{}},e.startRule==="Supported"&&(e.data=f||[])},function(){e=e||{data:{}};var f=e.data.tag;e.data=new ze(e.data.uri,e.data.displayName,e.data.params),f&&e.data.setParam("tag",f)},"ttl",x("ttl",!0),function(f){e=e||{data:{}},e.data.ttl=f},"maddr",x("maddr",!0),function(f){e=e||{data:{}},e.data.maddr=f},"received",x("received",!0),function(f){e=e||{data:{}},e.data.received=f},"branch",x("branch",!0),function(f){e=e||{data:{}},e.data.branch=f},"rport",x("rport",!0),function(f){e=e||{data:{}},typeof f<"u"&&(e.data.rport=f.join(""))},function(f){e=e||{data:{}},e.data.protocol=f},x("UDP",!0),x("TCP",!0),x("TLS",!0),x("SCTP",!0),function(f){e=e||{data:{}},e.data.transport=f},function(){e=e||{data:{}},e.data.host=b()},function(f){e=e||{data:{}},e.data.port=parseInt(f.join(""))},function(f){return parseInt(f.join(""))},function(f){e=e||{data:{}},e.startRule==="Session_Expires"&&(e.data.deltaSeconds=f)},"refresher",x("refresher",!1),"uas",x("uas",!1),"uac",x("uac",!1),function(f){e=e||{data:{}},e.startRule==="Session_Expires"&&(e.data.refresher=f)},function(f){e=e||{data:{}},e.startRule==="Min_SE"&&(e.data=f)},"stuns",x("stuns",!0),"stun",x("stun",!0),function(f){e=e||{data:{}},e.data.scheme=f},function(f){e=e||{data:{}},e.data.host=f},"?transport=",x("?transport=",!1),"turns",x("turns",!0),"turn",x("turn",!0),function(f){e=e||{data:{}},e.data.transport=f},function(){e=e||{data:{}},e.data=b()},"Referred-By",x("Referred-By",!1),"b",x("b",!1),"cid",x("cid",!1)],o=[h('2 ""6 7!'),h('4"""5!7#'),h('4$""5!7%'),h(`4&""5!7'`),h(";'.# &;("),h('4(""5!7)'),h('4*""5!7+'),h('2,""6,7-'),h('2.""6.7/'),h('40""5!71'),h('22""6273.‰ &24""6475.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),h(";).# &;,"),h('2F""6F7G.} &2H""6H7I.q &2J""6J7K.e &2L""6L7M.Y &2N""6N7O.M &2P""6P7Q.A &2R""6R7S.5 &2T""6T7U.) &2V""6V7W'),h(`%%2X""6X7Y/5#;#/,$;#/#$+#)(#'#("'#&'#/"!&,)`),h(`%%$;$0#*;$&/,#; /#$+")("'#&'#." &"/=#$;$/&#0#*;$&&&#/'$8":Z" )("'#&'#`),h(';.." &"'),h(`%$;'.# &;(0)*;'.# &;(&/?#28""6879/0$;//'$8#:[# )(#'#("'#&'#`),h(`%%$;2/&#0#*;2&&&#/g#$%$;.0#*;.&/,#;2/#$+")("'#&'#0=*%$;.0#*;.&/,#;2/#$+")("'#&'#&/#$+")("'#&'#/"!&,)`),h('4\\""5!7].# &;3'),h('4^""5!7_'),h('4`""5!7a'),h(';!.) &4b""5!7c'),h('%$;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/ž#0›*;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),h('%$;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/’#0*;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),h(`2T""6T7U.ã &2V""6V7W.× &2f""6f7g.Ë &2h""6h7i.¿ &2:""6:7;.³ &2D""6D7E.§ &22""6273.› &28""6879. &2j""6j7k.ƒ &;&.} &24""6475.q &2l""6l7m.e &2n""6n7o.Y &26""6677.M &2>""6>7?.A &2p""6p7q.5 &2r""6r7s.) &;'.# &;(`),h('%$;).ī &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s/Ĵ#0ı*;).ī &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s&&&#/"!&,)'),h(`%;//?#2P""6P7Q/0$;//'$8#:t# )(#'#("'#&'#`),h(`%;//?#24""6475/0$;//'$8#:u# )(#'#("'#&'#`),h(`%;//?#2>""6>7?/0$;//'$8#:v# )(#'#("'#&'#`),h(`%;//?#2T""6T7U/0$;//'$8#:w# )(#'#("'#&'#`),h(`%;//?#2V""6V7W/0$;//'$8#:x# )(#'#("'#&'#`),h(`%2h""6h7i/0#;//'$8":y" )("'#&'#`),h(`%;//6#2f""6f7g/'$8":z" )("'#&'#`),h(`%;//?#2D""6D7E/0$;//'$8#:{# )(#'#("'#&'#`),h(`%;//?#22""6273/0$;//'$8#:|# )(#'#("'#&'#`),h(`%;//?#28""6879/0$;//'$8#:}# )(#'#("'#&'#`),h(`%;//0#;&/'$8":~" )("'#&'#`),h(`%;&/0#;//'$8":~" )("'#&'#`),h(`%;=/T#$;G.) &;K.# &;F0/*;G.) &;K.# &;F&/,$;>/#$+#)(#'#("'#&'#`),h('4""5!7€.A &4""5!7‚.5 &4ƒ""5!7„.) &;3.# &;.'),h(`%%;//Q#;&/H$$;J.# &;K0)*;J.# &;K&/,$;&/#$+$)($'#(#'#("'#&'#/"!&,)`),h(`%;//]#;&/T$%$;J.# &;K0)*;J.# &;K&/"!&,)/1$;&/($8$:…$!!)($'#(#'#("'#&'#`),h(';..G &2L""6L7M.; &4†""5!7‡./ &4ƒ""5!7„.# &;3'),h(`%2j""6j7k/J#4ˆ""5!7‰.5 &4Š""5!7‹.) &4Œ""5!7/#$+")("'#&'#`),h(`%;N/M#28""6879/>$;O." &"/0$;S/'$8$:Ž$ )($'#(#'#("'#&'#`),h(`%;N/d#28""6879/U$;O." &"/G$;S/>$;_/5$;l." &"/'$8&:& )(&'#(%'#($'#(#'#("'#&'#`),h(`%3""5$7‘.) &3’""5#7“/' 8!:”!! )`),h(`%;P/]#%28""6879/,#;R/#$+")("'#&'#." &"/6$2:""6:7;/'$8#:•# )(#'#("'#&'#`),h("$;+.) &;-.# &;Q/2#0/*;+.) &;-.# &;Q&&&#"),h('2<""6<7=.q &2>""6>7?.e &2@""6@7A.Y &2B""6B7C.M &2D""6D7E.A &22""6273.5 &26""6677.) &24""6475'),h('%$;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E0e*;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E&/& 8!:–! )'),h(`%;T/J#%28""6879/,#;^/#$+")("'#&'#." &"/#$+")("'#&'#`),h("%;U.) &;\\.# &;X/& 8!:—! )"),h(`%$%;V/2#2J""6J7K/#$+")("'#&'#0<*%;V/2#2J""6J7K/#$+")("'#&'#&/D#;W/;$2J""6J7K." &"/'$8#:˜# )(#'#("'#&'#`),h('$4™""5!7š/,#0)*4™""5!7š&&&#'),h(`%4$""5!7%/?#$4›""5!7œ0)*4›""5!7œ&/#$+")("'#&'#`),h(`%2l""6l7m/?#;Y/6$2n""6n7o/'$8#:# )(#'#("'#&'#`),h(`%%;Z/³#28""6879/¤$;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+-)(-'#(,'#(+'#(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.ސ &%2ž""6ž7Ÿ/¤#;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+,)(,'#(+'#(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.۹ &%2ž""6ž7Ÿ/Œ#;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.ٺ &%2ž""6ž7Ÿ/t#;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#.ؓ &%2ž""6ž7Ÿ/\\#;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+&)(&'#(%'#($'#(#'#("'#&'#.ׄ &%2ž""6ž7Ÿ/D#;Z/;$28""6879/,$;[/#$+$)($'#(#'#("'#&'#.֍ &%2ž""6ž7Ÿ/,#;[/#$+")("'#&'#.ծ &%2ž""6ž7Ÿ/,#;Z/#$+")("'#&'#.Տ &%;Z/›#2ž""6ž7Ÿ/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$++)(+'#(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ӈ &%;Z/ª#%28""6879/,#;Z/#$+")("'#&'#." &"/ƒ$2ž""6ž7Ÿ/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*'#()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.а &%;Z/¹#%28""6879/,#;Z/#$+")("'#&'#." &"/’$%28""6879/,#;Z/#$+")("'#&'#." &"/k$2ž""6ž7Ÿ/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+))()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ί &%;Z/È#%28""6879/,#;Z/#$+")("'#&'#." &"/¡$%28""6879/,#;Z/#$+")("'#&'#." &"/z$%28""6879/,#;Z/#$+")("'#&'#." &"/S$2ž""6ž7Ÿ/D$;Z/;$28""6879/,$;[/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#.˕ &%;Z/×#%28""6879/,#;Z/#$+")("'#&'#." &"/°$%28""6879/,#;Z/#$+")("'#&'#." &"/‰$%28""6879/,#;Z/#$+")("'#&'#." &"/b$%28""6879/,#;Z/#$+")("'#&'#." &"/;$2ž""6ž7Ÿ/,$;[/#$+')(''#(&'#(%'#($'#(#'#("'#&'#.ȑ &%;Z/þ#%28""6879/,#;Z/#$+")("'#&'#." &"/×$%28""6879/,#;Z/#$+")("'#&'#." &"/°$%28""6879/,#;Z/#$+")("'#&'#." &"/‰$%28""6879/,#;Z/#$+")("'#&'#." &"/b$%28""6879/,#;Z/#$+")("'#&'#." &"/;$2ž""6ž7Ÿ/,$;Z/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#.Ħ &%;Z/Ĝ#%28""6879/,#;Z/#$+")("'#&'#." &"/õ$%28""6879/,#;Z/#$+")("'#&'#." &"/Î$%28""6879/,#;Z/#$+")("'#&'#." &"/§$%28""6879/,#;Z/#$+")("'#&'#." &"/€$%28""6879/,#;Z/#$+")("'#&'#." &"/Y$%28""6879/,#;Z/#$+")("'#&'#." &"/2$2ž""6ž7Ÿ/#$+()(('#(''#(&'#(%'#($'#(#'#("'#&'#/& 8!: ! )`),h(`%;#/M#;#." &"/?$;#." &"/1$;#." &"/#$+$)($'#(#'#("'#&'#`),h(`%;Z/;#28""6879/,$;Z/#$+#)(#'#("'#&'#.# &;\\`),h(`%;]/o#2J""6J7K/\`$;]/W$2J""6J7K/H$;]/?$2J""6J7K/0$;]/'$8':¡' )(''#(&'#(%'#($'#(#'#("'#&'#`),h(`%2¢""6¢7£/2#4¤""5!7¥/#$+")("'#&'#.˜ &%2¦""6¦7§/;#4¨""5!7©/,$;!/#$+#)(#'#("'#&'#.j &%2ª""6ª7«/5#;!/,$;!/#$+#)(#'#("'#&'#.B &%4¬""5!7­/,#;!/#$+")("'#&'#.# &;!`),h(`%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%'#($'#(#'#("'#&'#/' 8!:®!! )`),h(`$%22""6273/,#;\`/#$+")("'#&'#0<*%22""6273/,#;\`/#$+")("'#&'#&`),h(";a.A &;b.; &;c.5 &;d./ &;e.) &;f.# &;g"),h(`%3¯""5*7°/a#3±""5#7².G &3³""5#7´.; &3µ""5$7¶./ &3·""5#7¸.# &;6/($8":¹"! )("'#&'#`),h(`%3º""5%7»/I#3¼""5%7½./ &3¾""5"7¿.# &;6/($8":À"! )("'#&'#`),h(`%3Á""5'7Â/1#;/($8":Ã"! )("'#&'#`),h(`%3Ä""5$7Å/1#;ð/($8":Æ"! )("'#&'#`),h(`%3Ç""5&7È/1#;T/($8":É"! )("'#&'#`),h(`%3Ê""5"7Ë/N#%2>""6>7?/,#;6/#$+")("'#&'#." &"/'$8":Ì" )("'#&'#`),h(`%;h/P#%2>""6>7?/,#;i/#$+")("'#&'#." &"/)$8":Í""! )("'#&'#`),h('%$;j/&#0#*;j&&&#/"!&,)'),h('%$;j/&#0#*;j&&&#/"!&,)'),h(";k.) &;+.# &;-"),h('2l""6l7m.e &2n""6n7o.Y &24""6475.M &28""6879.A &2<""6<7=.5 &2@""6@7A.) &2B""6B7C'),h(`%26""6677/n#;m/e$$%2<""6<7=/,#;m/#$+")("'#&'#0<*%2<""6<7=/,#;m/#$+")("'#&'#&/#$+#)(#'#("'#&'#`),h(`%;n/A#2>""6>7?/2$;o/)$8#:Î#"" )(#'#("'#&'#`),h("$;p.) &;+.# &;-/2#0/*;p.) &;+.# &;-&&&#"),h("$;p.) &;+.# &;-0/*;p.) &;+.# &;-&"),h('2l""6l7m.e &2n""6n7o.Y &24""6475.M &26""6677.A &28""6879.5 &2@""6@7A.) &2B""6B7C'),h(";‘.# &;r"),h(`%;/G#;'/>$;s/5$;'/,$;„/#$+%)(%'#($'#(#'#("'#&'#`),h(";M.# &;t"),h(`%;/E#28""6879/6$;u.# &;x/'$8#:Ï# )(#'#("'#&'#`),h(`%;v.# &;w/J#%26""6677/,#;ƒ/#$+")("'#&'#." &"/#$+")("'#&'#`),h(`%2Ð""6Ð7Ñ/:#;€/1$;w." &"/#$+#)(#'#("'#&'#`),h(`%24""6475/,#;{/#$+")("'#&'#`),h(`%;z/3#$;y0#*;y&/#$+")("'#&'#`),h(";*.) &;+.# &;-"),h(';+. &;-.‰ &22""6273.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),h(`%;|/e#$%24""6475/,#;|/#$+")("'#&'#0<*%24""6475/,#;|/#$+")("'#&'#&/#$+")("'#&'#`),h(`%$;~0#*;~&/e#$%22""6273/,#;}/#$+")("'#&'#0<*%22""6273/,#;}/#$+")("'#&'#&/#$+")("'#&'#`),h("$;~0#*;~&"),h(';+.w &;-.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),h(`%%;"/‡#$;".G &;!.A &2@""6@7A.5 &2F""6F7G.) &2J""6J7K0M*;".G &;!.A &2@""6@7A.5 &2F""6F7G.) &2J""6J7K&/#$+")("'#&'#/& 8!:Ò! )`),h(";.# &;‚"),h(`%%;O/2#2:""6:7;/#$+")("'#&'#." &"/,#;S/#$+")("'#&'#." &"`),h('$;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A/Œ#0‰*;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A&&&#'),h("$;y0#*;y&"),h(`%3’""5#7Ó/q#24""6475/b$$;!/&#0#*;!&&&#/L$2J""6J7K/=$$;!/&#0#*;!&&&#/'$8%:Ô% )(%'#($'#(#'#("'#&'#`),h('2Õ""6Õ7Ö'),h('2×""6×7Ø'),h('2Ù""6Ù7Ú'),h('2Û""6Û7Ü'),h('2Ý""6Ý7Þ'),h('2ß""6ß7à'),h('2á""6á7â'),h('2ã""6ã7ä'),h('2å""6å7æ'),h('2ç""6ç7è'),h('2é""6é7ê'),h("%;….Y &;†.S &;ˆ.M &;‰.G &;Š.A &;‹.; &;Œ.5 &;./ &;.) &;Ž.# &;6/& 8!:ë! )"),h(`%;„/G#;'/>$;’/5$;'/,$;”/#$+%)(%'#($'#(#'#("'#&'#`),h("%;“/' 8!:ì!! )"),h(`%;!/5#;!/,$;!/#$+#)(#'#("'#&'#`),h("%$;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(0G*;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(&/& 8!:í! )"),h(`%;¶/Y#$%;A/,#;¶/#$+")("'#&'#06*%;A/,#;¶/#$+")("'#&'#&/#$+")("'#&'#`),h(`%;9/N#%2:""6:7;/,#;9/#$+")("'#&'#." &"/'$8":î" )("'#&'#`),h(`%;:.c &%;˜/Y#$%;A/,#;˜/#$+")("'#&'#06*%;A/,#;˜/#$+")("'#&'#&/#$+")("'#&'#/& 8!:ï! )`),h(`%;L.# &;™/]#$%;B/,#;›/#$+")("'#&'#06*%;B/,#;›/#$+")("'#&'#&/'$8":ð" )("'#&'#`),h(`%;š." &"/>#;@/5$;M/,$;?/#$+$)($'#(#'#("'#&'#`),h(`%%;6/Y#$%;./,#;6/#$+")("'#&'#06*%;./,#;6/#$+")("'#&'#&/#$+")("'#&'#.# &;H/' 8!:ñ!! )`),h(";œ.) &;.# &; "),h(`%3ò""5!7ó/:#;</1$;Ÿ/($8#:ô#! )(#'#("'#&'#`),h(`%3õ""5'7ö/:#;</1$;ž/($8#:÷#! )(#'#("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:ø!! )"),h(`%2ù""6ù7ú/o#%2J""6J7K/M#;!." &"/?$;!." &"/1$;!." &"/#$+$)($'#(#'#("'#&'#." &"/'$8":û" )("'#&'#`),h(`%;6/J#%;</,#;¡/#$+")("'#&'#." &"/)$8":ü""! )("'#&'#`),h(";6.) &;T.# &;H"),h(`%;£/Y#$%;B/,#;¤/#$+")("'#&'#06*%;B/,#;¤/#$+")("'#&'#&/#$+")("'#&'#`),h(`%3ý""5&7þ.G &3ÿ""5'7Ā.; &3ā""5$7Ă./ &3ă""5%7Ą.# &;6/& 8!:ą! )`),h(";¥.# &; "),h(`%3Ć""5(7ć/M#;</D$3Ĉ""5(7ĉ./ &3Ċ""5(7ċ.# &;6/#$+#)(#'#("'#&'#`),h(`%;6/Y#$%;A/,#;6/#$+")("'#&'#06*%;A/,#;6/#$+")("'#&'#&/#$+")("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:Č!! )"),h("%;©/& 8!:č! )"),h(`%;ª/k#;;/b$;¯/Y$$%;B/,#;°/#$+")("'#&'#06*%;B/,#;°/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),h(";«.# &;¬"),h('3Ď""5$7ď.S &3Đ""5%7đ.G &3Ē""5%7ē.; &3Ĕ""5%7ĕ./ &3Ė""5+7ė.# &;­'),h(`3Ę""5'7ę./ &3Ě""5)7ě.# &;­`),h(";6.# &;®"),h(`%3Ĝ""5"7ĝ/,#;6/#$+")("'#&'#`),h(";­.# &;6"),h(`%;6/5#;</,$;±/#$+#)(#'#("'#&'#`),h(";6.# &;H"),h(`%;³/5#;./,$;/#$+#)(#'#("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:Ğ!! )"),h("%;ž/' 8!:ğ!! )"),h(`%;¶/^#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/($8":Ġ"!!)("'#&'#`),h(`%%;7/e#$%2J""6J7K/,#;7/#$+")("'#&'#0<*%2J""6J7K/,#;7/#$+")("'#&'#&/#$+")("'#&'#/"!&,)`),h(`%;L.# &;™/]#$%;B/,#;¸/#$+")("'#&'#06*%;B/,#;¸/#$+")("'#&'#&/'$8":ġ" )("'#&'#`),h(";¹.# &; "),h(`%3Ģ""5#7ģ/:#;</1$;6/($8#:Ĥ#! )(#'#("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:ĥ!! )"),h("%;ž/' 8!:Ħ!! )"),h(`%$;š0#*;š&/x#;@/o$;M/f$;?/]$$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/'$8%:ħ% )(%'#($'#(#'#("'#&'#`),h(";¾"),h(`%3Ĩ""5&7ĩ/k#;./b$;Á/Y$$%;A/,#;Á/#$+")("'#&'#06*%;A/,#;Á/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#.# &;¿`),h(`%;6/k#;./b$;À/Y$$%;A/,#;À/#$+")("'#&'#06*%;A/,#;À/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),h(`%;6/;#;</2$;6.# &;H/#$+#)(#'#("'#&'#`),h(";Â.G &;Ä.A &;Æ.; &;È.5 &;É./ &;Ê.) &;Ë.# &;À"),h(`%3Ī""5%7ī/5#;</,$;Ã/#$+#)(#'#("'#&'#`),h("%;I/' 8!:Ĭ!! )"),h(`%3ĭ""5&7Į/—#;</Ž$;D/…$;Å/|$$%$;'/&#0#*;'&&&#/,#;Å/#$+")("'#&'#0C*%$;'/&#0#*;'&&&#/,#;Å/#$+")("'#&'#&/,$;E/#$+&)(&'#(%'#($'#(#'#("'#&'#`),h(";t.# &;w"),h(`%3į""5%7İ/5#;</,$;Ç/#$+#)(#'#("'#&'#`),h("%;I/' 8!:ı!! )"),h(`%3IJ""5&7ij/:#;</1$;I/($8#:Ĵ#! )(#'#("'#&'#`),h(`%3ĵ""5%7Ķ/]#;</T$%3ķ""5$7ĸ/& 8!:Ĺ! ).4 &%3ĺ""5%7Ļ/& 8!:ļ! )/#$+#)(#'#("'#&'#`),h(`%3Ľ""5)7ľ/R#;</I$3Ŀ""5#7ŀ./ &3Ł""5(7ł.# &;6/($8#:Ń#! )(#'#("'#&'#`),h(`%3ń""5#7Ņ/“#;</Š$;D/$%;Ì/e#$%2D""6D7E/,#;Ì/#$+")("'#&'#0<*%2D""6D7E/,#;Ì/#$+")("'#&'#&/#$+")("'#&'#/,$;E/#$+%)(%'#($'#(#'#("'#&'#`),h(`%3ņ""5(7Ň./ &3ň""5$7ʼn.# &;6/' 8!:Ŋ!! )`),h(`%;6/Y#$%;A/,#;6/#$+")("'#&'#06*%;A/,#;6/#$+")("'#&'#&/#$+")("'#&'#`),h(`%;Ï/G#;./>$;Ï/5$;./,$;/#$+%)(%'#($'#(#'#("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:ŋ!! )"),h(`%;Ñ/]#$%;A/,#;Ñ/#$+")("'#&'#06*%;A/,#;Ñ/#$+")("'#&'#&/'$8":Ō" )("'#&'#`),h(`%;™/]#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/'$8":ō" )("'#&'#`),h(`%;L.O &;™.I &%;@." &"/:#;t/1$;?." &"/#$+#)(#'#("'#&'#/]#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/'$8":Ŏ" )("'#&'#`),h(`%;Ô/]#$%;B/,#;Õ/#$+")("'#&'#06*%;B/,#;Õ/#$+")("'#&'#&/'$8":ŏ" )("'#&'#`),h("%;–/& 8!:Ő! )"),h(`%3ő""5(7Œ/:#;</1$;6/($8#:œ#! )(#'#("'#&'#.g &%3Ŕ""5&7ŕ/:#;</1$;6/($8#:Ŗ#! )(#'#("'#&'#.: &%3ŗ""5*7Ř/& 8!:ř! ).# &; `),h(`%%;6/k#$%;A/2#;6/)$8":Ś""$ )("'#&'#0<*%;A/2#;6/)$8":Ś""$ )("'#&'#&/)$8":ś""! )("'#&'#." &"/' 8!:Ŝ!! )`),h(`%;Ø/Y#$%;A/,#;Ø/#$+")("'#&'#06*%;A/,#;Ø/#$+")("'#&'#&/#$+")("'#&'#`),h(`%;™/Y#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/#$+")("'#&'#`),h("%$;!/&#0#*;!&&&#/' 8!:ŝ!! )"),h(`%;Û/Y#$%;B/,#;Ü/#$+")("'#&'#06*%;B/,#;Ü/#$+")("'#&'#&/#$+")("'#&'#`),h(`%3Ş""5&7ş.; &3Š""5'7š./ &3Ţ""5*7ţ.# &;6/& 8!:Ť! )`),h(`%3ť""5&7Ŧ/:#;</1$;Ý/($8#:ŧ#! )(#'#("'#&'#.} &%3õ""5'7ö/:#;</1$;ž/($8#:Ũ#! )(#'#("'#&'#.P &%3ũ""5+7Ū/:#;</1$;ž/($8#:ū#! )(#'#("'#&'#.# &; `),h(`3Ŭ""5+7ŭ.k &3Ů""5)7ů._ &3Ű""5(7ű.S &3Ų""5'7ų.G &3Ŵ""5&7ŵ.; &3Ŷ""5*7ŷ./ &3Ÿ""5)7Ź.# &;6`),h(';1." &"'),h(`%%;6/k#$%;A/2#;6/)$8":Ś""$ )("'#&'#0<*%;A/2#;6/)$8":Ś""$ )("'#&'#&/)$8":ś""! )("'#&'#." &"/' 8!:ź!! )`),h(`%;L.# &;™/]#$%;B/,#;á/#$+")("'#&'#06*%;B/,#;á/#$+")("'#&'#&/'$8":Ż" )("'#&'#`),h(";¹.# &; "),h(`%;ã/Y#$%;A/,#;ã/#$+")("'#&'#06*%;A/,#;ã/#$+")("'#&'#&/#$+")("'#&'#`),h(`%;ê/k#;./b$;í/Y$$%;B/,#;ä/#$+")("'#&'#06*%;B/,#;ä/#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),h(";å.; &;æ.5 &;ç./ &;è.) &;é.# &; "),h(`%3ż""5#7Ž/:#;</1$;ð/($8#:ž#! )(#'#("'#&'#`),h(`%3ſ""5%7ƀ/:#;</1$;T/($8#:Ɓ#! )(#'#("'#&'#`),h(`%3Ƃ""5(7ƃ/F#;</=$;\\.) &;Y.# &;X/($8#:Ƅ#! )(#'#("'#&'#`),h(`%3ƅ""5&7Ɔ/:#;</1$;6/($8#:Ƈ#! )(#'#("'#&'#`),h(`%3ƈ""5%7Ɖ/A#;</8$$;!0#*;!&/($8#:Ɗ#! )(#'#("'#&'#`),h(`%;ë/G#;;/>$;6/5$;;/,$;ì/#$+%)(%'#($'#(#'#("'#&'#`),h(`%3’""5#7Ó.# &;6/' 8!:Ƌ!! )`),h(`%3±""5#7ƌ.G &3³""5#7ƍ.; &3·""5#7Ǝ./ &3µ""5$7Ə.# &;6/' 8!:Ɛ!! )`),h(`%;î/D#%;C/,#;ï/#$+")("'#&'#." &"/#$+")("'#&'#`),h("%;U.) &;\\.# &;X/& 8!:Ƒ! )"),h(`%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%'#($'#(#'#("'#&'#/' 8!:ƒ!! )`),h(`%%;!/?#;!." &"/1$;!." &"/#$+#)(#'#("'#&'#/' 8!:Ɠ!! )`),h(";¾"),h(`%;ž/^#$%;B/,#;ó/#$+")("'#&'#06*%;B/,#;ó/#$+")("'#&'#&/($8":Ɣ"!!)("'#&'#`),h(";ô.# &; "),h(`%2ƕ""6ƕ7Ɩ/L#;</C$2Ɨ""6Ɨ7Ƙ.) &2ƙ""6ƙ7ƚ/($8#:ƛ#! )(#'#("'#&'#`),h(`%;ž/^#$%;B/,#; /#$+")("'#&'#06*%;B/,#; /#$+")("'#&'#&/($8":Ɯ"!!)("'#&'#`),h(`%;6/5#;0/,$;÷/#$+#)(#'#("'#&'#`),h("$;2.) &;4.# &;.0/*;2.) &;4.# &;.&"),h("$;%0#*;%&"),h(`%;ú/;#28""6879/,$;û/#$+#)(#'#("'#&'#`),h(`%3Ɲ""5%7ƞ.) &3Ɵ""5$7Ơ/' 8!:ơ!! )`),h(`%;ü/J#%28""6879/,#;^/#$+")("'#&'#." &"/#$+")("'#&'#`),h("%;\\.) &;X.# &;‚/' 8!:Ƣ!! )"),h(';".S &;!.M &2F""6F7G.A &2J""6J7K.5 &2H""6H7I.) &2N""6N7O'),h('2L""6L7M.• &2B""6B7C.‰ &2<""6<7=.} &2R""6R7S.q &2T""6T7U.e &2V""6V7W.Y &2P""6P7Q.M &2@""6@7A.A &2D""6D7E.5 &22""6273.) &2>""6>7?'),h(`%;Ā/b#28""6879/S$;û/J$%2ƣ""6ƣ7Ƥ/,#;ì/#$+")("'#&'#." &"/#$+$)($'#(#'#("'#&'#`),h(`%3ƥ""5%7Ʀ.) &3Ƨ""5$7ƨ/' 8!:ơ!! )`),h(`%3±""5#7².6 &3³""5#7´.* &$;+0#*;+&/' 8!:Ʃ!! )`),h(`%;Ą/‡#2F""6F7G/x$;ă/o$2F""6F7G/\`$;ă/W$2F""6F7G/H$;ă/?$2F""6F7G/0$;ą/'$8):ƪ) )()'#(('#(''#(&'#(%'#($'#(#'#("'#&'#`),h(`%;#/>#;#/5$;#/,$;#/#$+$)($'#(#'#("'#&'#`),h(`%;ă/,#;ă/#$+")("'#&'#`),h(`%;ă/5#;ă/,$;ă/#$+#)(#'#("'#&'#`),h(`%;q/T#$;m0#*;m&/D$%; /,#;ø/#$+")("'#&'#." &"/#$+#)(#'#("'#&'#`),h(`%2ƫ""6ƫ7Ƭ.) &2ƭ""6ƭ7Ʈ/w#;0/n$;Ĉ/e$$%;B/2#;ĉ.# &; /#$+")("'#&'#0<*%;B/2#;ĉ.# &; /#$+")("'#&'#&/#$+$)($'#(#'#("'#&'#`),h(";™.# &;L"),h(`%2Ư""6Ư7ư/5#;</,$;Ċ/#$+#)(#'#("'#&'#`),h(`%;D/S#;,/J$2:""6:7;/;$;,.# &;T/,$;E/#$+%)(%'#($'#(#'#("'#&'#`)];let d=0,c=0;const l=[{line:1,column:1}];let g=0,u=[],y=0,w;if(e.startRule!==void 0){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');n=i[e.startRule]}function b(){return r.substring(c,d)}function C(){return T(c,d)}function x(f,v){return{type:"literal",text:f,ignoreCase:v}}function p(f,v,m){return{type:"class",parts:f,inverted:v,ignoreCase:m}}function E(){return{type:"end"}}function _(f){let v=l[f],m;if(v)return v;for(m=f-1;!l[m];)m--;for(v=l[m],v={line:v.line,column:v.column};m<f;)r.charCodeAt(m)===10?(v.line++,v.column=1):v.column++,m++;return l[f]=v,v}function T(f,v){const m=_(f),U=_(v);return{source:s,start:{offset:f,line:m.line,column:m.column},end:{offset:v,line:U.line,column:U.column}}}function S(f){d<g||(d>g&&(g=d,u=[]),u.push(f))}function R(f,v,m){return new vr(vr.buildMessage(f,v),f,v,m)}function h(f){return f.split("").map(v=>v.charCodeAt(0)-32)}function N(f){const v=o[f];let m=0;const U=[];let q=v.length;const X=[],W=[];let ie;for(;;){for(;m<q;)switch(v[m]){case 0:W.push(a[v[m+1]]),m+=2;break;case 1:W.push(void 0),m++;break;case 2:W.push(null),m++;break;case 3:W.push(t),m++;break;case 4:W.push([]),m++;break;case 5:W.push(d),m++;break;case 6:W.pop(),m++;break;case 7:d=W.pop(),m++;break;case 8:W.length-=v[m+1],m+=2;break;case 9:W.splice(-2,1),m++;break;case 10:W[W.length-2].push(W.pop()),m++;break;case 11:W.push(W.splice(W.length-v[m+1],v[m+1])),m+=2;break;case 12:W.push(r.substring(W.pop(),d)),m++;break;case 13:X.push(q),U.push(m+3+v[m+1]+v[m+2]),W[W.length-1]?(q=m+3+v[m+1],m+=3):(q=m+3+v[m+1]+v[m+2],m+=3+v[m+1]);break;case 14:X.push(q),U.push(m+3+v[m+1]+v[m+2]),W[W.length-1]===t?(q=m+3+v[m+1],m+=3):(q=m+3+v[m+1]+v[m+2],m+=3+v[m+1]);break;case 15:X.push(q),U.push(m+3+v[m+1]+v[m+2]),W[W.length-1]!==t?(q=m+3+v[m+1],m+=3):(q=m+3+v[m+1]+v[m+2],m+=3+v[m+1]);break;case 16:W[W.length-1]!==t?(X.push(q),U.push(m),q=m+2+v[m+1],m+=2):m+=2+v[m+1];break;case 17:X.push(q),U.push(m+3+v[m+1]+v[m+2]),r.length>d?(q=m+3+v[m+1],m+=3):(q=m+3+v[m+1]+v[m+2],m+=3+v[m+1]);break;case 18:X.push(q),U.push(m+4+v[m+2]+v[m+3]),r.substr(d,a[v[m+1]].length)===a[v[m+1]]?(q=m+4+v[m+2],m+=4):(q=m+4+v[m+2]+v[m+3],m+=4+v[m+2]);break;case 19:X.push(q),U.push(m+4+v[m+2]+v[m+3]),r.substr(d,a[v[m+1]].length).toLowerCase()===a[v[m+1]]?(q=m+4+v[m+2],m+=4):(q=m+4+v[m+2]+v[m+3],m+=4+v[m+2]);break;case 20:X.push(q),U.push(m+4+v[m+2]+v[m+3]),a[v[m+1]].test(r.charAt(d))?(q=m+4+v[m+2],m+=4):(q=m+4+v[m+2]+v[m+3],m+=4+v[m+2]);break;case 21:W.push(r.substr(d,v[m+1])),d+=v[m+1],m+=2;break;case 22:W.push(a[v[m+1]]),d+=a[v[m+1]].length,m+=2;break;case 23:W.push(t),y===0&&S(a[v[m+1]]),m+=2;break;case 24:c=W[W.length-1-v[m+1]],m+=2;break;case 25:c=d,m++;break;case 26:ie=v.slice(m+4,m+4+v[m+3]).map(function(he){return W[W.length-1-he]}),W.splice(W.length-v[m+2],v[m+2],a[v[m+1]].apply(null,ie)),m+=4+v[m+3];break;case 27:W.push(N(v[m+1])),m+=2;break;case 28:y++,m++;break;case 29:y--,m++;break;default:throw new Error("Invalid opcode: "+v[m]+".")}if(X.length>0)q=X.pop(),m=U.pop();else break}return W[0]}e.data={};function A(f,v){return[f].concat(v)}if(w=N(n),w!==t&&d===r.length)return w;throw w!==t&&d<r.length&&S(E()),R(u,g<r.length?r.charAt(g):null,g<r.length?T(g,g+1):T(g,g))}const W0=Y0;var Ie;(function(r){function e(i,n){const a={startRule:n};try{W0(i,a)}catch{a.data=-1}return a.data}r.parse=e;function t(i){const n=r.parse(i,"Name_Addr_Header");return n!==-1?n:void 0}r.nameAddrHeaderParse=t;function s(i){const n=r.parse(i,"SIP_URI");return n!==-1?n:void 0}r.URIParse=s})(Ie=Ie||(Ie={}));const G0={100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"};function or(r,e=32){let t="";for(let s=0;s<r;s++){const i=Math.floor(Math.random()*e);t+=i.toString(e)}return t}function cs(r){return G0[r]||""}function ls(){return or(10)}function wt(r){const e={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},t=r.toLowerCase().replace(/_/g,"-").split("-"),s=t.length;let i="";for(let n=0;n<s;n++)n!==0&&(i+="-"),i+=t[n].charAt(0).toUpperCase()+t[n].substring(1);return e[i]&&(i=e[i]),i}function qr(r){return encodeURIComponent(r).replace(/%[A-F\d]{2}/g,"U").length}class _a{constructor(){this.headers={}}addHeader(e,t){const s={raw:t};e=wt(e),this.headers[e]?this.headers[e].push(s):this.headers[e]=[s]}getHeader(e){const t=this.headers[wt(e)];if(t){if(t[0])return t[0].raw}else return}getHeaders(e){const t=this.headers[wt(e)],s=[];if(!t)return[];for(const i of t)s.push(i.raw);return s}hasHeader(e){return!!this.headers[wt(e)]}parseHeader(e,t=0){if(e=wt(e),this.headers[e]){if(t>=this.headers[e].length)return}else return;const s=this.headers[e][t],i=s.raw;if(s.parsed)return s.parsed;const n=Ie.parse(i,e.replace(/-/g,"_"));if(n===-1){this.headers[e].splice(t,1);return}else return s.parsed=n,n}s(e,t=0){return this.parseHeader(e,t)}setHeader(e,t){this.headers[wt(e)]=[{raw:t}]}toString(){return this.data}}class yr extends _a{constructor(){super()}}class Gt extends _a{constructor(){super()}}class cr{constructor(e,t,s,i,n,a,o){this.headers={},this.extraHeaders=[],this.options=cr.getDefaultOptions(),n&&(this.options=Object.assign(Object.assign({},this.options),n),this.options.optionTags&&this.options.optionTags.length&&(this.options.optionTags=this.options.optionTags.slice()),this.options.routeSet&&this.options.routeSet.length&&(this.options.routeSet=this.options.routeSet.slice())),a&&a.length&&(this.extraHeaders=a.slice()),o&&(this.body={body:o.content,contentType:o.contentType}),this.method=e,this.ruri=t.clone(),this.fromURI=s.clone(),this.fromTag=this.options.fromTag?this.options.fromTag:ls(),this.from=cr.makeNameAddrHeader(this.fromURI,this.options.fromDisplayName,this.fromTag),this.toURI=i.clone(),this.toTag=this.options.toTag,this.to=cr.makeNameAddrHeader(this.toURI,this.options.toDisplayName,this.toTag),this.callId=this.options.callId?this.options.callId:this.options.callIdPrefix+or(15),this.cseq=this.options.cseq,this.setHeader("route",this.options.routeSet),this.setHeader("via",""),this.setHeader("to",this.to.toString()),this.setHeader("from",this.from.toString()),this.setHeader("cseq",this.cseq+" "+this.method),this.setHeader("call-id",this.callId),this.setHeader("max-forwards","70")}static getDefaultOptions(){return{callId:"",callIdPrefix:"",cseq:1,toDisplayName:"",toTag:"",fromDisplayName:"",fromTag:"",forceRport:!1,hackViaTcp:!1,optionTags:["outbound"],routeSet:[],userAgentString:"sip.js",viaHost:""}}static makeNameAddrHeader(e,t,s){const i={};return s&&(i.tag=s),new ze(e,t,i)}getHeader(e){const t=this.headers[wt(e)];if(t){if(t[0])return t[0]}else{const s=new RegExp("^\\s*"+e+"\\s*:","i");for(const i of this.extraHeaders)if(s.test(i))return i.substring(i.indexOf(":")+1).trim()}}getHeaders(e){const t=[],s=this.headers[wt(e)];if(s)for(const i of s)t.push(i);else{const i=new RegExp("^\\s*"+e+"\\s*:","i");for(const n of this.extraHeaders)i.test(n)&&t.push(n.substring(n.indexOf(":")+1).trim())}return t}hasHeader(e){if(this.headers[wt(e)])return!0;{const t=new RegExp("^\\s*"+e+"\\s*:","i");for(const s of this.extraHeaders)if(t.test(s))return!0}return!1}setHeader(e,t){this.headers[wt(e)]=t instanceof Array?t:[t]}setViaHeader(e,t){this.options.hackViaTcp&&(t="TCP");let s="SIP/2.0/"+t;s+=" "+this.options.viaHost+";branch="+e,this.options.forceRport&&(s+=";rport"),this.setHeader("via",s),this.branch=e}toString(){let e="";e+=this.method+" "+this.ruri.toRaw()+` SIP/2.0\r
170
165
  `;for(const t in this.headers)if(this.headers[t])for(const s of this.headers[t])e+=t+": "+s+`\r
171
166
  `;for(const t of this.extraHeaders)e+=t.trim()+`\r
172
167
  `;return e+="Supported: "+this.options.optionTags.join(", ")+`\r
173
168
  `,e+="User-Agent: "+this.options.userAgentString+`\r
174
- `,this.body?typeof this.body=="string"?(e+="Content-Length: "+jr(this.body)+`\r
169
+ `,this.body?typeof this.body=="string"?(e+="Content-Length: "+qr(this.body)+`\r
175
170
  \r
176
171
  `,e+=this.body):this.body.body&&this.body.contentType?(e+="Content-Type: "+this.body.contentType+`\r
177
- `,e+="Content-Length: "+jr(this.body.body)+`\r
172
+ `,e+="Content-Length: "+qr(this.body.body)+`\r
178
173
  \r
179
174
  `,e+=this.body.body):e+=`Content-Length: 0\r
180
175
  \r
181
176
  `:e+=`Content-Length: 0\r
182
177
  \r
183
- `,e}}function Fa(r){return r==="application/sdp"?"session":"render"}function ds(r){const e=typeof r=="string"?r:r.body,t=typeof r=="string"?"application/sdp":r.contentType;return{contentDisposition:Fa(t),contentType:t,content:e}}function ka(r){return r&&typeof r.content=="string"&&typeof r.contentType=="string"&&r.contentDisposition===void 0?!0:typeof r.contentDisposition=="string"}function qr(r){let e,t,s;if(r instanceof yr&&r.body){const i=r.parseHeader("Content-Disposition");e=i?i.type:void 0,t=r.parseHeader("Content-Type"),s=r.body}if(r instanceof Gt&&r.body){const i=r.parseHeader("Content-Disposition");e=i?i.type:void 0,t=r.parseHeader("Content-Type"),s=r.body}if(r instanceof cr&&r.body)if(e=r.getHeader("Content-Disposition"),t=r.getHeader("Content-Type"),typeof r.body=="string"){if(!t)throw new Error("Header content type header does not equal body content type.");s=r.body}else{if(t&&t!==r.body.contentType)throw new Error("Header content type header does not equal body content type.");t=r.body.contentType,s=r.body.body}if(ka(r)&&(e=r.contentDisposition,t=r.contentType,s=r.content),!!s){if(t&&!e&&(e=Fa(t)),!e)throw new Error("Content disposition undefined.");if(!t)throw new Error("Content type undefined.");return{contentDisposition:e,contentType:t,content:s}}}var st;(function(r){r.Initial="Initial",r.Early="Early",r.AckWait="AckWait",r.Confirmed="Confirmed",r.Terminated="Terminated"})(st=st||(st={}));var U;(function(r){r.Initial="Initial",r.HaveLocalOffer="HaveLocalOffer",r.HaveRemoteOffer="HaveRemoteOffer",r.Stable="Stable",r.Closed="Closed"})(U=U||(U={}));const kt=500,oc=4e3,Ba=5e3,$e={T1:kt,T2:oc,TIMER_B:64*kt,TIMER_D:0*kt,TIMER_F:64*kt,TIMER_H:64*kt,TIMER_I:0*Ba,TIMER_J:0*kt,TIMER_K:0*Ba,TIMER_L:64*kt,TIMER_M:64*kt,TIMER_N:64*kt,PROVISIONAL_RESPONSE_INTERVAL:6e4};class Vt extends ar{constructor(e){super(e||"Transaction state error.")}}var G;(function(r){r.ACK="ACK",r.BYE="BYE",r.CANCEL="CANCEL",r.INFO="INFO",r.INVITE="INVITE",r.MESSAGE="MESSAGE",r.NOTIFY="NOTIFY",r.OPTIONS="OPTIONS",r.REGISTER="REGISTER",r.UPDATE="UPDATE",r.SUBSCRIBE="SUBSCRIBE",r.PUBLISH="PUBLISH",r.REFER="REFER",r.PRACK="PRACK"})(G=G||(G={}));const zt=[G.ACK,G.BYE,G.CANCEL,G.INFO,G.INVITE,G.MESSAGE,G.NOTIFY,G.OPTIONS,G.PRACK,G.REFER,G.REGISTER,G.SUBSCRIBE];class Ia{constructor(e){this.incomingMessageRequest=e}get request(){return this.incomingMessageRequest.message}accept(e){return this.incomingMessageRequest.accept(e),Promise.resolve()}reject(e){return this.incomingMessageRequest.reject(e),Promise.resolve()}}class ji{constructor(e){this.incomingNotifyRequest=e}get request(){return this.incomingNotifyRequest.message}accept(e){return this.incomingNotifyRequest.accept(e),Promise.resolve()}reject(e){return this.incomingNotifyRequest.reject(e),Promise.resolve()}}class cc{constructor(e,t){this.incomingReferRequest=e,this.session=t}get referTo(){const e=this.incomingReferRequest.message.parseHeader("refer-to");if(!(e instanceof ze))throw new Error("Failed to parse Refer-To header.");return e}get referredBy(){return this.incomingReferRequest.message.getHeader("referred-by")}get replaces(){const e=this.referTo.uri.getHeader("replaces");return e instanceof Array?e[0]:e}get request(){return this.incomingReferRequest.message}accept(e={statusCode:202}){return this.incomingReferRequest.accept(e),Promise.resolve()}reject(e){return this.incomingReferRequest.reject(e),Promise.resolve()}makeInviter(e){if(this.inviter)return this.inviter;const t=this.referTo.uri.clone();t.clearHeaders(),e=e||{};const s=(e.extraHeaders||[]).slice(),i=this.replaces;i&&s.push("Replaces: "+decodeURIComponent(i));const n=this.referredBy;return n&&s.push("Referred-By: "+n),e.extraHeaders=s,this.inviter=this.session.userAgent._makeInviter(t,e),this.inviter._referred=this.session,this.session._referral=this.inviter,this.inviter}}var B;(function(r){r.Initial="Initial",r.Establishing="Establishing",r.Established="Established",r.Terminating="Terminating",r.Terminated="Terminated"})(B=B||(B={}));class Lr{constructor(e,t={}){this.pendingReinvite=!1,this.pendingReinviteAck=!1,this._state=B.Initial,this.delegate=t.delegate,this._stateEventEmitter=new Mr,this._userAgent=e}dispose(){switch(this.logger.log(`Session ${this.id} in state ${this._state} is being disposed`),delete this.userAgent._sessions[this.id],this._sessionDescriptionHandler&&this._sessionDescriptionHandler.close(),this.state){case B.Initial:break;case B.Establishing:break;case B.Established:return new Promise(e=>{this._bye({onAccept:()=>e(),onRedirect:()=>e(),onReject:()=>e()})});case B.Terminating:break;case B.Terminated:break;default:throw new Error("Unknown state.")}return Promise.resolve()}get assertedIdentity(){return this._assertedIdentity}get dialog(){return this._dialog}get id(){return this._id}get replacee(){return this._replacee}get sessionDescriptionHandler(){return this._sessionDescriptionHandler}get sessionDescriptionHandlerFactory(){return this.userAgent.configuration.sessionDescriptionHandlerFactory}get sessionDescriptionHandlerModifiers(){return this._sessionDescriptionHandlerModifiers||[]}set sessionDescriptionHandlerModifiers(e){this._sessionDescriptionHandlerModifiers=e.slice()}get sessionDescriptionHandlerOptions(){return this._sessionDescriptionHandlerOptions||{}}set sessionDescriptionHandlerOptions(e){this._sessionDescriptionHandlerOptions=Object.assign({},e)}get sessionDescriptionHandlerModifiersReInvite(){return this._sessionDescriptionHandlerModifiersReInvite||[]}set sessionDescriptionHandlerModifiersReInvite(e){this._sessionDescriptionHandlerModifiersReInvite=e.slice()}get sessionDescriptionHandlerOptionsReInvite(){return this._sessionDescriptionHandlerOptionsReInvite||{}}set sessionDescriptionHandlerOptionsReInvite(e){this._sessionDescriptionHandlerOptionsReInvite=Object.assign({},e)}get state(){return this._state}get stateChange(){return this._stateEventEmitter}get userAgent(){return this._userAgent}bye(e={}){let t="Session.bye() may only be called if established session.";switch(this.state){case B.Initial:typeof this.cancel=="function"?(t+=" However Inviter.invite() has not yet been called.",t+=" Perhaps you should have called Inviter.cancel()?"):typeof this.reject=="function"&&(t+=" However Invitation.accept() has not yet been called.",t+=" Perhaps you should have called Invitation.reject()?");break;case B.Establishing:typeof this.cancel=="function"?(t+=" However a dialog does not yet exist.",t+=" Perhaps you should have called Inviter.cancel()?"):typeof this.reject=="function"&&(t+=" However Invitation.accept() has not yet been called (or not yet resolved).",t+=" Perhaps you should have called Invitation.reject()?");break;case B.Established:{const s=e.requestDelegate,i=this.copyRequestOptions(e.requestOptions);return this._bye(s,i)}case B.Terminating:t+=" However this session is already terminating.",typeof this.cancel=="function"?t+=" Perhaps you have already called Inviter.cancel()?":typeof this.reject=="function"&&(t+=" Perhaps you have already called Session.bye()?");break;case B.Terminated:t+=" However this session is already terminated.";break;default:throw new Error("Unknown state")}return this.logger.error(t),Promise.reject(new Error(`Invalid session state ${this.state}`))}info(e={}){if(this.state!==B.Established)return this.logger.error("Session.info() may only be called if established session."),Promise.reject(new Error(`Invalid session state ${this.state}`));const t=e.requestDelegate,s=this.copyRequestOptions(e.requestOptions);return this._info(t,s)}invite(e={}){if(this.logger.log("Session.invite"),this.state!==B.Established)return Promise.reject(new Error(`Invalid session state ${this.state}`));if(this.pendingReinvite)return Promise.reject(new Oi("Reinvite in progress. Please wait until complete, then try again."));this.pendingReinvite=!0,e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiersReInvite=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptionsReInvite=e.sessionDescriptionHandlerOptions);const t={onAccept:n=>{const a=qr(n.message);if(!a){this.logger.error("Received 2xx response to re-INVITE without a session description"),this.ackAndBye(n,400,"Missing session description"),this.stateTransition(B.Terminated),this.pendingReinvite=!1;return}if(e.withoutSdp){const o={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.setOfferAndGetAnswer(a,o).then(d=>{n.ack({body:d})}).catch(d=>{this.logger.error("Failed to handle offer in 2xx response to re-INVITE"),this.logger.error(d.message),this.state===B.Terminated?n.ack():(this.ackAndBye(n,488,"Bad Media Description"),this.stateTransition(B.Terminated))}).then(()=>{this.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)})}else{const o={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.setAnswer(a,o).then(()=>{n.ack()}).catch(d=>{this.logger.error("Failed to handle answer in 2xx response to re-INVITE"),this.logger.error(d.message),this.state!==B.Terminated?(this.ackAndBye(n,488,"Bad Media Description"),this.stateTransition(B.Terminated)):n.ack()}).then(()=>{this.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)})}},onProgress:n=>{},onRedirect:n=>{},onReject:n=>{this.logger.warn("Received a non-2xx response to re-INVITE"),this.pendingReinvite=!1,e.withoutSdp?e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n):this.rollbackOffer().catch(a=>{if(this.logger.error("Failed to rollback offer on non-2xx response to re-INVITE"),this.logger.error(a.message),this.state!==B.Terminated){if(!this.dialog)throw new Error("Dialog undefined.");const o=[];o.push("Reason: "+this.getReasonHeaderValue(500,"Internal Server Error")),this.dialog.bye(void 0,{extraHeaders:o}),this.stateTransition(B.Terminated)}}).then(()=>{e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n)})},onTrying:n=>{}},s=e.requestOptions||{};if(s.extraHeaders=(s.extraHeaders||[]).slice(),s.extraHeaders.push("Allow: "+zt.toString()),s.extraHeaders.push("Contact: "+this._contact),e.withoutSdp){if(!this.dialog)throw this.pendingReinvite=!1,new Error("Dialog undefined.");return Promise.resolve(this.dialog.invite(t,s))}const i={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};return this.getOffer(i).then(n=>{if(!this.dialog)throw this.pendingReinvite=!1,new Error("Dialog undefined.");return s.body=n,this.dialog.invite(t,s)}).catch(n=>{throw this.logger.error(n.message),this.logger.error("Failed to send re-INVITE"),this.pendingReinvite=!1,n})}message(e={}){if(this.state!==B.Established)return this.logger.error("Session.message() may only be called if established session."),Promise.reject(new Error(`Invalid session state ${this.state}`));const t=e.requestDelegate,s=this.copyRequestOptions(e.requestOptions);return this._message(t,s)}refer(e,t={}){if(this.state!==B.Established)return this.logger.error("Session.refer() may only be called if established session."),Promise.reject(new Error(`Invalid session state ${this.state}`));if(e instanceof Lr&&!e.dialog)return this.logger.error("Session.refer() may only be called with session which is established. You are perhaps attempting to attended transfer to a target for which there is not dialog yet established. Perhaps you are attempting a 'semi-attended' tansfer? Regardless, this is not supported. The recommended approached is to check to see if the target Session is in the Established state before calling refer(); if the state is not Established you may proceed by falling back using a URI as the target (blind transfer)."),Promise.reject(new Error(`Invalid session state ${this.state}`));const s=t.requestDelegate,i=this.copyRequestOptions(t.requestOptions);return i.extraHeaders=i.extraHeaders?i.extraHeaders.concat(this.referExtraHeaders(this.referToString(e))):this.referExtraHeaders(this.referToString(e)),this._refer(t.onNotify,s,i)}_bye(e,t){if(!this.dialog)return Promise.reject(new Error("Session dialog undefined."));const s=this.dialog;switch(s.sessionState){case st.Initial:throw new Error(`Invalid dialog state ${s.sessionState}`);case st.Early:throw new Error(`Invalid dialog state ${s.sessionState}`);case st.AckWait:return this.stateTransition(B.Terminating),new Promise(i=>{s.delegate={onAck:()=>{const n=s.bye(e,t);return this.stateTransition(B.Terminated),i(n),Promise.resolve()},onAckTimeout:()=>{const n=s.bye(e,t);this.stateTransition(B.Terminated),i(n)}}});case st.Confirmed:{const i=s.bye(e,t);return this.stateTransition(B.Terminated),Promise.resolve(i)}case st.Terminated:throw new Error(`Invalid dialog state ${s.sessionState}`);default:throw new Error("Unrecognized state.")}}_info(e,t){return this.dialog?Promise.resolve(this.dialog.info(e,t)):Promise.reject(new Error("Session dialog undefined."))}_message(e,t){return this.dialog?Promise.resolve(this.dialog.message(e,t)):Promise.reject(new Error("Session dialog undefined."))}_refer(e,t,s){return this.dialog?(this.onNotify=e,Promise.resolve(this.dialog.refer(t,s))):Promise.reject(new Error("Session dialog undefined."))}ackAndBye(e,t,s){e.ack();const i=[];t&&i.push("Reason: "+this.getReasonHeaderValue(t,s)),e.session.bye(void 0,{extraHeaders:i})}onAckRequest(e){if(this.logger.log("Session.onAckRequest"),this.state!==B.Established&&this.state!==B.Terminating)return this.logger.error(`ACK received while in state ${this.state}, dropping request`),Promise.resolve();const t=this.dialog;if(!t)throw new Error("Dialog undefined.");const s={sessionDescriptionHandlerOptions:this.pendingReinviteAck?this.sessionDescriptionHandlerOptionsReInvite:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.pendingReinviteAck?this._sessionDescriptionHandlerModifiersReInvite:this._sessionDescriptionHandlerModifiers};if(this.delegate&&this.delegate.onAck){const i=new ec(e);this.delegate.onAck(i)}switch(this.pendingReinviteAck=!1,t.signalingState){case U.Initial:{this.logger.error(`Invalid signaling state ${t.signalingState}.`);const i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return t.bye(void 0,{extraHeaders:i}),this.stateTransition(B.Terminated),Promise.resolve()}case U.Stable:{const i=qr(e.message);return i?i.contentDisposition==="render"?(this._renderbody=i.content,this._rendertype=i.contentType,Promise.resolve()):i.contentDisposition!=="session"?Promise.resolve():this.setAnswer(i,s).catch(n=>{this.logger.error(n.message);const a=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];t.bye(void 0,{extraHeaders:a}),this.stateTransition(B.Terminated)}):Promise.resolve()}case U.HaveLocalOffer:{this.logger.error(`Invalid signaling state ${t.signalingState}.`);const i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return t.bye(void 0,{extraHeaders:i}),this.stateTransition(B.Terminated),Promise.resolve()}case U.HaveRemoteOffer:{this.logger.error(`Invalid signaling state ${t.signalingState}.`);const i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return t.bye(void 0,{extraHeaders:i}),this.stateTransition(B.Terminated),Promise.resolve()}case U.Closed:throw new Error(`Invalid signaling state ${t.signalingState}.`);default:throw new Error(`Invalid signaling state ${t.signalingState}.`)}}onByeRequest(e){if(this.logger.log("Session.onByeRequest"),this.state!==B.Established){this.logger.error(`BYE received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onBye){const t=new tc(e);this.delegate.onBye(t)}else e.accept();this.stateTransition(B.Terminated)}onInfoRequest(e){if(this.logger.log("Session.onInfoRequest"),this.state!==B.Established){this.logger.error(`INFO received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onInfo){const t=new sc(e);this.delegate.onInfo(t)}else e.accept()}onInviteRequest(e){if(this.logger.log("Session.onInviteRequest"),this.state!==B.Established){this.logger.error(`INVITE received while in state ${this.state}, dropping request`);return}this.pendingReinviteAck=!0;const t=["Contact: "+this._contact];if(e.message.hasHeader("P-Asserted-Identity")){const i=e.message.getHeader("P-Asserted-Identity");if(!i)throw new Error("Header undefined.");this._assertedIdentity=Ie.nameAddrHeaderParse(i)}const s={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.generateResponseOfferAnswerInDialog(s).then(i=>{const n=e.accept({statusCode:200,extraHeaders:t,body:i});this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,n.message,200)}).catch(i=>{if(this.logger.error(i.message),this.logger.error("Failed to handle to re-INVITE request"),!this.dialog)throw new Error("Dialog undefined.");if(this.logger.error(this.dialog.signalingState),this.dialog.signalingState===U.Stable){const n=e.reject({statusCode:488});this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,n.message,488);return}this.rollbackOffer().then(()=>{const n=e.reject({statusCode:488});this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,n.message,488)}).catch(n=>{this.logger.error(n.message),this.logger.error("Failed to rollback offer on re-INVITE request");const a=e.reject({statusCode:488});if(this.state!==B.Terminated){if(!this.dialog)throw new Error("Dialog undefined.");const o=[];o.push("Reason: "+this.getReasonHeaderValue(500,"Internal Server Error")),this.dialog.bye(void 0,{extraHeaders:o}),this.stateTransition(B.Terminated)}this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,a.message,488)})})}onMessageRequest(e){if(this.logger.log("Session.onMessageRequest"),this.state!==B.Established){this.logger.error(`MESSAGE received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onMessage){const t=new Ia(e);this.delegate.onMessage(t)}else e.accept()}onNotifyRequest(e){if(this.logger.log("Session.onNotifyRequest"),this.state!==B.Established){this.logger.error(`NOTIFY received while in state ${this.state}, dropping request`);return}if(this.onNotify){const t=new ji(e);this.onNotify(t);return}if(this.delegate&&this.delegate.onNotify){const t=new ji(e);this.delegate.onNotify(t)}else e.accept()}onPrackRequest(e){if(this.logger.log("Session.onPrackRequest"),this.state!==B.Established){this.logger.error(`PRACK received while in state ${this.state}, dropping request`);return}throw new Error("Unimplemented.")}onReferRequest(e){if(this.logger.log("Session.onReferRequest"),this.state!==B.Established){this.logger.error(`REFER received while in state ${this.state}, dropping request`);return}if(!e.message.hasHeader("refer-to")){this.logger.warn("Invalid REFER packet. A refer-to header is required. Rejecting."),e.reject();return}const t=new cc(e,this);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(t):(this.logger.log("No delegate available to handle REFER, automatically accepting and following."),t.accept().then(()=>t.makeInviter(this._referralInviterOptions).invite()).catch(s=>{this.logger.error(s.message)}))}generateResponseOfferAnswer(e,t){if(this.dialog)return this.generateResponseOfferAnswerInDialog(t);const s=qr(e.message);return!s||s.contentDisposition!=="session"?this.getOffer(t):this.setOfferAndGetAnswer(s,t)}generateResponseOfferAnswerInDialog(e){if(!this.dialog)throw new Error("Dialog undefined.");switch(this.dialog.signalingState){case U.Initial:return this.getOffer(e);case U.HaveLocalOffer:return Promise.resolve(void 0);case U.HaveRemoteOffer:if(!this.dialog.offer)throw new Error(`Session offer undefined in signaling state ${this.dialog.signalingState}.`);return this.setOfferAndGetAnswer(this.dialog.offer,e);case U.Stable:return this.state!==B.Established?Promise.resolve(void 0):this.getOffer(e);case U.Closed:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);default:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`)}}getOffer(e){const t=this.setupSessionDescriptionHandler(),s=e.sessionDescriptionHandlerOptions,i=e.sessionDescriptionHandlerModifiers;try{return t.getDescription(s,i).then(n=>ds(n)).catch(n=>{this.logger.error("Session.getOffer: SDH getDescription rejected...");const a=n instanceof Error?n:new Error("Session.getOffer unknown error.");throw this.logger.error(a.message),a})}catch(n){this.logger.error("Session.getOffer: SDH getDescription threw...");const a=n instanceof Error?n:new Error(n);return this.logger.error(a.message),Promise.reject(a)}}rollbackOffer(){const e=this.setupSessionDescriptionHandler();if(e.rollbackDescription===void 0)return Promise.resolve();try{return e.rollbackDescription().catch(t=>{this.logger.error("Session.rollbackOffer: SDH rollbackDescription rejected...");const s=t instanceof Error?t:new Error("Session.rollbackOffer unknown error.");throw this.logger.error(s.message),s})}catch(t){this.logger.error("Session.rollbackOffer: SDH rollbackDescription threw...");const s=t instanceof Error?t:new Error(t);return this.logger.error(s.message),Promise.reject(s)}}setAnswer(e,t){const s=this.setupSessionDescriptionHandler(),i=t.sessionDescriptionHandlerOptions,n=t.sessionDescriptionHandlerModifiers;try{if(!s.hasDescription(e.contentType))return Promise.reject(new $i)}catch(a){this.logger.error("Session.setAnswer: SDH hasDescription threw...");const o=a instanceof Error?a:new Error(a);return this.logger.error(o.message),Promise.reject(o)}try{return s.setDescription(e.content,i,n).catch(a=>{this.logger.error("Session.setAnswer: SDH setDescription rejected...");const o=a instanceof Error?a:new Error("Session.setAnswer unknown error.");throw this.logger.error(o.message),o})}catch(a){this.logger.error("Session.setAnswer: SDH setDescription threw...");const o=a instanceof Error?a:new Error(a);return this.logger.error(o.message),Promise.reject(o)}}setOfferAndGetAnswer(e,t){const s=this.setupSessionDescriptionHandler(),i=t.sessionDescriptionHandlerOptions,n=t.sessionDescriptionHandlerModifiers;try{if(!s.hasDescription(e.contentType))return Promise.reject(new $i)}catch(a){this.logger.error("Session.setOfferAndGetAnswer: SDH hasDescription threw...");const o=a instanceof Error?a:new Error(a);return this.logger.error(o.message),Promise.reject(o)}try{return s.setDescription(e.content,i,n).then(()=>s.getDescription(i,n)).then(a=>ds(a)).catch(a=>{this.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription rejected...");const o=a instanceof Error?a:new Error("Session.setOfferAndGetAnswer unknown error.");throw this.logger.error(o.message),o})}catch(a){this.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription threw...");const o=a instanceof Error?a:new Error(a);return this.logger.error(o.message),Promise.reject(o)}}setSessionDescriptionHandler(e){if(this._sessionDescriptionHandler)throw new Error("Session description handler defined.");this._sessionDescriptionHandler=e}setupSessionDescriptionHandler(){var e;return this._sessionDescriptionHandler?this._sessionDescriptionHandler:(this._sessionDescriptionHandler=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions),!((e=this.delegate)===null||e===void 0)&&e.onSessionDescriptionHandler&&this.delegate.onSessionDescriptionHandler(this._sessionDescriptionHandler,!1),this._sessionDescriptionHandler)}stateTransition(e){const t=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};switch(this._state){case B.Initial:e!==B.Establishing&&e!==B.Established&&e!==B.Terminating&&e!==B.Terminated&&t();break;case B.Establishing:e!==B.Established&&e!==B.Terminating&&e!==B.Terminated&&t();break;case B.Established:e!==B.Terminating&&e!==B.Terminated&&t();break;case B.Terminating:e!==B.Terminated&&t();break;case B.Terminated:t();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log(`Session ${this.id} transitioned to state ${this._state}`),this._stateEventEmitter.emit(this._state),e===B.Terminated&&this.dispose()}copyRequestOptions(e={}){const t=e.extraHeaders?e.extraHeaders.slice():void 0,s=e.body?{contentDisposition:e.body.contentDisposition||"render",contentType:e.body.contentType||"text/plain",content:e.body.content||""}:void 0;return{extraHeaders:t,body:s}}getReasonHeaderValue(e,t){const s=e;let i=cs(e);return!i&&t&&(i=t),"SIP;cause="+s+';text="'+i+'"'}referExtraHeaders(e){const t=[];return t.push("Referred-By: <"+this.userAgent.configuration.uri+">"),t.push("Contact: "+this._contact),t.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),t.push("Refer-To: "+e),t}referToString(e){let t;if(e instanceof yt)t=e.toString();else{if(!e.dialog)throw new Error("Dialog undefined.");const s=e.remoteIdentity.friendlyName,i=e.dialog.remoteTarget.toString(),n=e.dialog.callId,a=e.dialog.remoteTag,o=e.dialog.localTag,d=encodeURIComponent(`${n};to-tag=${a};from-tag=${o}`);t=`"${s}" <${i}?Replaces=${d}>`}return t}}var ht;(function(r){r.Required="Required",r.Supported="Supported",r.Unsupported="Unsupported"})(ht=ht||(ht={}));const lc={"100rel":!0,199:!0,answermode:!0,"early-session":!0,eventlist:!0,explicitsub:!0,"from-change":!0,"geolocation-http":!0,"geolocation-sip":!0,gin:!0,gruu:!0,histinfo:!0,ice:!0,join:!0,"multiple-refer":!0,norefersub:!0,nosub:!0,outbound:!0,path:!0,policy:!0,precondition:!0,pref:!0,privacy:!0,"recipient-list-invite":!0,"recipient-list-message":!0,"recipient-list-subscribe":!0,replaces:!0,"resource-priority":!0,"sdp-anat":!0,"sec-agree":!0,tdialog:!0,timer:!0,uui:!0};class dc extends Lr{constructor(e,t){super(e),this.incomingInviteRequest=t,this.disposed=!1,this.expiresTimer=void 0,this.isCanceled=!1,this.rel100="none",this.rseq=Math.floor(Math.random()*1e4),this.userNoAnswerTimer=void 0,this.waitingForPrack=!1,this.logger=e.getLogger("sip.Invitation");const s=this.incomingInviteRequest.message,i=s.getHeader("require");i&&i.toLowerCase().includes("100rel")&&(this.rel100="required");const n=s.getHeader("supported");if(n&&n.toLowerCase().includes("100rel")&&(this.rel100="supported"),s.toTag=t.toTag,typeof s.toTag!="string")throw new TypeError("toTag should have been a string.");if(this.userNoAnswerTimer=setTimeout(()=>{t.reject({statusCode:480}),this.stateTransition(B.Terminated)},this.userAgent.configuration.noAnswerTimeout?this.userAgent.configuration.noAnswerTimeout*1e3:6e4),s.hasHeader("expires")){const d=Number(s.getHeader("expires")||0)*1e3;this.expiresTimer=setTimeout(()=>{this.state===B.Initial&&(t.reject({statusCode:487}),this.stateTransition(B.Terminated))},d)}const a=this.request.getHeader("P-Asserted-Identity");a&&(this._assertedIdentity=Ie.nameAddrHeaderParse(a)),this._contact=this.userAgent.contact.toString();const o=s.parseHeader("Content-Disposition");o&&o.type==="render"&&(this._renderbody=s.body,this._rendertype=s.getHeader("Content-Type")),this._id=s.callId+s.fromTag,this.userAgent._sessions[this._id]=this}dispose(){if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.expiresTimer&&(clearTimeout(this.expiresTimer),this.expiresTimer=void 0),this.userNoAnswerTimer&&(clearTimeout(this.userNoAnswerTimer),this.userNoAnswerTimer=void 0),this.prackNeverArrived(),this.state){case B.Initial:return this.reject().then(()=>super.dispose());case B.Establishing:return this.reject().then(()=>super.dispose());case B.Established:return super.dispose();case B.Terminating:return super.dispose();case B.Terminated:return super.dispose();default:throw new Error("Unknown state.")}}get autoSendAnInitialProvisionalResponse(){return this.rel100!=="required"&&this.userAgent.configuration.sendInitialProvisionalResponse}get body(){return this.incomingInviteRequest.message.body}get localIdentity(){return this.request.to}get remoteIdentity(){return this.request.from}get request(){return this.incomingInviteRequest.message}accept(e={}){if(this.logger.log("Invitation.accept"),this.state!==B.Initial){const t=new Error(`Invalid session state ${this.state}`);return this.logger.error(t.message),Promise.reject(t)}return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.stateTransition(B.Establishing),this.sendAccept(e).then(({message:t,session:s})=>{s.delegate={onAck:i=>this.onAckRequest(i),onAckTimeout:()=>this.onAckTimeout(),onBye:i=>this.onByeRequest(i),onInfo:i=>this.onInfoRequest(i),onInvite:i=>this.onInviteRequest(i),onMessage:i=>this.onMessageRequest(i),onNotify:i=>this.onNotifyRequest(i),onPrack:i=>this.onPrackRequest(i),onRefer:i=>this.onReferRequest(i)},this._dialog=s,this.stateTransition(B.Established),this._replacee&&this._replacee._bye()}).catch(t=>this.handleResponseError(t))}progress(e={}){if(this.logger.log("Invitation.progress"),this.state!==B.Initial){const s=new Error(`Invalid session state ${this.state}`);return this.logger.error(s.message),Promise.reject(s)}const t=e.statusCode||180;if(t<100||t>199)throw new TypeError("Invalid statusCode: "+t);return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.waitingForPrack?(this.logger.warn("Unexpected call for progress while waiting for prack, ignoring"),Promise.resolve()):e.statusCode===100?this.sendProgressTrying().then(()=>{}).catch(s=>this.handleResponseError(s)):this.rel100!=="required"&&!(this.rel100==="supported"&&e.rel100)&&!(this.rel100==="supported"&&this.userAgent.configuration.sipExtension100rel===ht.Required)?this.sendProgress(e).then(()=>{}).catch(s=>this.handleResponseError(s)):this.sendProgressReliableWaitForPrack(e).then(()=>{}).catch(s=>this.handleResponseError(s))}reject(e={}){if(this.logger.log("Invitation.reject"),this.state!==B.Initial&&this.state!==B.Establishing){const a=new Error(`Invalid session state ${this.state}`);return this.logger.error(a.message),Promise.reject(a)}const t=e.statusCode||480,s=e.reasonPhrase?e.reasonPhrase:cs(t),i=e.extraHeaders||[];if(t<300||t>699)throw new TypeError("Invalid statusCode: "+t);const n=e.body?ds(e.body):void 0;return t<400?this.incomingInviteRequest.redirect([],{statusCode:t,reasonPhrase:s,extraHeaders:i,body:n}):this.incomingInviteRequest.reject({statusCode:t,reasonPhrase:s,extraHeaders:i,body:n}),this.stateTransition(B.Terminated),Promise.resolve()}_onCancel(e){if(this.logger.log("Invitation._onCancel"),this.state!==B.Initial&&this.state!==B.Establishing){this.logger.error(`CANCEL received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onCancel){const t=new rc(e);this.delegate.onCancel(t)}this.isCanceled=!0,this.incomingInviteRequest.reject({statusCode:487}),this.stateTransition(B.Terminated)}handlePrackOfferAnswer(e){if(!this.dialog)throw new Error("Dialog undefined.");const t=qr(e.message);if(!t||t.contentDisposition!=="session")return Promise.resolve(void 0);const s={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers};switch(this.dialog.signalingState){case U.Initial:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);case U.Stable:return this.setAnswer(t,s).then(()=>{});case U.HaveLocalOffer:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);case U.HaveRemoteOffer:return this.setOfferAndGetAnswer(t,s);case U.Closed:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);default:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`)}}handleResponseError(e){let t=480;if(e instanceof Error?this.logger.error(e.message):this.logger.error(e),e instanceof $i?(this.logger.error("A session description handler occurred while sending response (content type unsupported"),t=415):e instanceof Q0?this.logger.error("A session description handler occurred while sending response"):e instanceof Ni?this.logger.error("Session ended before response could be formulated and sent (while waiting for PRACK)"):e instanceof Vt&&this.logger.error("Session changed state before response could be formulated and sent"),this.state===B.Initial||this.state===B.Establishing)try{this.incomingInviteRequest.reject({statusCode:t}),this.stateTransition(B.Terminated)}catch(s){throw this.logger.error("An error occurred attempting to reject the request while handling another error"),s}if(this.isCanceled){this.logger.warn("An error occurred while attempting to formulate and send a response to an incoming INVITE. However a CANCEL was received and processed while doing so which can (and often does) result in errors occurring as the session terminates in the meantime. Said error is being ignored.");return}throw e}onAckTimeout(){if(this.logger.log("Invitation.onAckTimeout"),!this.dialog)throw new Error("Dialog undefined.");this.logger.log("No ACK received for an extended period of time, terminating session"),this.dialog.bye(),this.stateTransition(B.Terminated)}sendAccept(e={}){const t={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},s=e.extraHeaders||[];return this.waitingForPrack?this.waitForArrivalOfPrack().then(()=>clearTimeout(this.userNoAnswerTimer)).then(()=>this.generateResponseOfferAnswer(this.incomingInviteRequest,t)).then(i=>this.incomingInviteRequest.accept({statusCode:200,body:i,extraHeaders:s})):(clearTimeout(this.userNoAnswerTimer),this.generateResponseOfferAnswer(this.incomingInviteRequest,t).then(i=>this.incomingInviteRequest.accept({statusCode:200,body:i,extraHeaders:s})))}sendProgress(e={}){const t=e.statusCode||180,s=e.reasonPhrase,i=(e.extraHeaders||[]).slice(),n=e.body?ds(e.body):void 0;if(t===183&&!n)return this.sendProgressWithSDP(e);try{const a=this.incomingInviteRequest.progress({statusCode:t,reasonPhrase:s,extraHeaders:i,body:n});return this._dialog=a.session,Promise.resolve(a)}catch(a){return Promise.reject(a)}}sendProgressWithSDP(e={}){const t={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},s=e.statusCode||183,i=e.reasonPhrase,n=(e.extraHeaders||[]).slice();return this.generateResponseOfferAnswer(this.incomingInviteRequest,t).then(a=>this.incomingInviteRequest.progress({statusCode:s,reasonPhrase:i,extraHeaders:n,body:a})).then(a=>(this._dialog=a.session,a))}sendProgressReliable(e={}){return e.extraHeaders=(e.extraHeaders||[]).slice(),e.extraHeaders.push("Require: 100rel"),e.extraHeaders.push("RSeq: "+Math.floor(Math.random()*1e4)),this.sendProgressWithSDP(e)}sendProgressReliableWaitForPrack(e={}){const t={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},s=e.statusCode||183,i=e.reasonPhrase,n=(e.extraHeaders||[]).slice();n.push("Require: 100rel"),n.push("RSeq: "+this.rseq++);let a;return new Promise((o,d)=>{this.waitingForPrack=!0,this.generateResponseOfferAnswer(this.incomingInviteRequest,t).then(c=>(a=c,this.incomingInviteRequest.progress({statusCode:s,reasonPhrase:i,extraHeaders:n,body:a}))).then(c=>{this._dialog=c.session;let l,g;c.session.delegate={onPrack:x=>{l=x,clearTimeout(y),clearTimeout(C),this.waitingForPrack&&(this.waitingForPrack=!1,this.handlePrackOfferAnswer(l).then(p=>{try{g=l.accept({statusCode:200,body:p}),this.prackArrived(),o({prackRequest:l,prackResponse:g,progressResponse:c})}catch(E){d(E)}}).catch(p=>d(p)))}};const y=setTimeout(()=>{this.waitingForPrack&&(this.waitingForPrack=!1,this.logger.warn("No PRACK received, rejecting INVITE."),clearTimeout(C),this.reject({statusCode:504}).then(()=>d(new Ni)).catch(x=>d(x)))},$e.T1*64),w=()=>{try{this.incomingInviteRequest.progress({statusCode:s,reasonPhrase:i,extraHeaders:n,body:a})}catch(x){this.waitingForPrack=!1,d(x);return}C=setTimeout(w,b*=2)};let b=$e.T1,C=setTimeout(w,b)}).catch(c=>{this.waitingForPrack=!1,d(c)})})}sendProgressTrying(){try{const e=this.incomingInviteRequest.trying();return Promise.resolve(e)}catch(e){return Promise.reject(e)}}waitForArrivalOfPrack(){if(this.waitingForPrackPromise)throw new Error("Already waiting for PRACK");return this.waitingForPrackPromise=new Promise((e,t)=>{this.waitingForPrackResolve=e,this.waitingForPrackReject=t}),this.waitingForPrackPromise}prackArrived(){this.waitingForPrackResolve&&this.waitingForPrackResolve(),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0}prackNeverArrived(){this.waitingForPrackReject&&this.waitingForPrackReject(new Ni),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0}}class Ha extends Lr{constructor(e,t,s={}){super(e,s),this.disposed=!1,this.earlyMedia=!1,this.earlyMediaSessionDescriptionHandlers=new Map,this.isCanceled=!1,this.inviteWithoutSdp=!1,this.logger=e.getLogger("sip.Inviter"),this.earlyMedia=s.earlyMedia!==void 0?s.earlyMedia:this.earlyMedia,this.fromTag=ls(),this.inviteWithoutSdp=s.inviteWithoutSdp!==void 0?s.inviteWithoutSdp:this.inviteWithoutSdp;const i=Object.assign({},s);i.params=Object.assign({},s.params);const n=s.anonymous||!1,a=e.contact.toString({anonymous:n,outbound:n?!e.contact.tempGruu:!e.contact.pubGruu});n&&e.configuration.uri&&(i.params.fromDisplayName="Anonymous",i.params.fromUri="sip:anonymous@anonymous.invalid");let o=e.userAgentCore.configuration.aor;if(i.params.fromUri&&(o=typeof i.params.fromUri=="string"?Ie.URIParse(i.params.fromUri):i.params.fromUri),!o)throw new TypeError("Invalid from URI: "+i.params.fromUri);let d=t;if(i.params.toUri&&(d=typeof i.params.toUri=="string"?Ie.URIParse(i.params.toUri):i.params.toUri),!d)throw new TypeError("Invalid to URI: "+i.params.toUri);const c=Object.assign({},i.params);c.fromTag=this.fromTag;const l=(i.extraHeaders||[]).slice();n&&e.configuration.uri&&(l.push("P-Preferred-Identity: "+e.configuration.uri.toString()),l.push("Privacy: id")),l.push("Contact: "+a),l.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),e.configuration.sipExtension100rel===ht.Required&&l.push("Require: 100rel"),e.configuration.sipExtensionReplaces===ht.Required&&l.push("Require: replaces"),i.extraHeaders=l;const g=void 0;this.outgoingRequestMessage=e.userAgentCore.makeOutgoingRequestMessage(G.INVITE,t,o,d,c,l,g),this._contact=a,this._referralInviterOptions=i,this._renderbody=s.renderbody,this._rendertype=s.rendertype,s.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=s.sessionDescriptionHandlerModifiers),s.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=s.sessionDescriptionHandlerOptions),s.sessionDescriptionHandlerModifiersReInvite&&(this.sessionDescriptionHandlerModifiersReInvite=s.sessionDescriptionHandlerModifiersReInvite),s.sessionDescriptionHandlerOptionsReInvite&&(this.sessionDescriptionHandlerOptionsReInvite=s.sessionDescriptionHandlerOptionsReInvite),this._id=this.outgoingRequestMessage.callId+this.fromTag,this.userAgent._sessions[this._id]=this}dispose(){if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.disposeEarlyMedia(),this.state){case B.Initial:return this.cancel().then(()=>super.dispose());case B.Establishing:return this.cancel().then(()=>super.dispose());case B.Established:return super.dispose();case B.Terminating:return super.dispose();case B.Terminated:return super.dispose();default:throw new Error("Unknown state.")}}get body(){return this.outgoingRequestMessage.body}get localIdentity(){return this.outgoingRequestMessage.from}get remoteIdentity(){return this.outgoingRequestMessage.to}get request(){return this.outgoingRequestMessage}cancel(e={}){if(this.logger.log("Inviter.cancel"),this.state!==B.Initial&&this.state!==B.Establishing){const s=new Error(`Invalid session state ${this.state}`);return this.logger.error(s.message),Promise.reject(s)}this.isCanceled=!0,this.stateTransition(B.Terminating);function t(s,i){if(s&&s<200||s>699)throw new TypeError("Invalid statusCode: "+s);if(s){const n=s,a=cs(s)||i;return"SIP;cause="+n+';text="'+a+'"'}}if(this.outgoingInviteRequest){let s;e.statusCode&&e.reasonPhrase&&(s=t(e.statusCode,e.reasonPhrase)),this.outgoingInviteRequest.cancel(s,e)}else this.logger.warn("Canceled session before INVITE was sent"),this.stateTransition(B.Terminated);return Promise.resolve()}invite(e={}){if(this.logger.log("Inviter.invite"),this.state!==B.Initial)return super.invite(e);if(e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),e.withoutSdp||this.inviteWithoutSdp)return this._renderbody&&this._rendertype&&(this.outgoingRequestMessage.body={contentType:this._rendertype,body:this._renderbody}),this.stateTransition(B.Establishing),Promise.resolve(this.sendInvite(e));const t={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.getOffer(t).then(s=>(this.outgoingRequestMessage.body={body:s.content,contentType:s.contentType},this.stateTransition(B.Establishing),this.sendInvite(e))).catch(s=>{throw this.logger.log(s.message),this.state!==B.Terminated&&this.stateTransition(B.Terminated),s})}sendInvite(e={}){return this.outgoingInviteRequest=this.userAgent.userAgentCore.invite(this.outgoingRequestMessage,{onAccept:t=>{if(this.dialog){this.logger.log("Additional confirmed dialog, sending ACK and BYE"),this.ackAndBye(t);return}if(this.isCanceled){this.logger.log("Canceled session accepted, sending ACK and BYE"),this.ackAndBye(t),this.stateTransition(B.Terminated);return}this.notifyReferer(t),this.onAccept(t).then(()=>{this.disposeEarlyMedia()}).catch(()=>{this.disposeEarlyMedia()}).then(()=>{e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(t)})},onProgress:t=>{this.isCanceled||(this.notifyReferer(t),this.onProgress(t).catch(()=>{this.disposeEarlyMedia()}).then(()=>{e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(t)}))},onRedirect:t=>{this.notifyReferer(t),this.onRedirect(t),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(t)},onReject:t=>{this.notifyReferer(t),this.onReject(t),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(t)},onTrying:t=>{this.notifyReferer(t),this.onTrying(t),e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(t)}}),this.outgoingInviteRequest}disposeEarlyMedia(){this.earlyMediaSessionDescriptionHandlers.forEach(e=>{e.close()}),this.earlyMediaSessionDescriptionHandlers.clear()}notifyReferer(e){if(!this._referred)return;if(!(this._referred instanceof Lr))throw new Error("Referred session not instance of session");if(!this._referred.dialog)return;if(!e.message.statusCode)throw new Error("Status code undefined.");if(!e.message.reasonPhrase)throw new Error("Reason phrase undefined.");const t=e.message.statusCode,s=e.message.reasonPhrase,i=`SIP/2.0 ${t} ${s}`.trim(),n=this._referred.dialog.notify(void 0,{extraHeaders:["Event: refer","Subscription-State: terminated"],body:{contentDisposition:"render",contentType:"message/sipfrag",content:i}});n.delegate={onReject:()=>{this._referred=void 0}}}onAccept(e){if(this.logger.log("Inviter.onAccept"),this.state!==B.Establishing)return this.logger.error(`Accept received while in state ${this.state}, dropping response`),Promise.reject(new Error(`Invalid session state ${this.state}`));const t=e.message,s=e.session;switch(t.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=Ie.nameAddrHeaderParse(t.getHeader("P-Asserted-Identity"))),s.delegate={onAck:i=>this.onAckRequest(i),onBye:i=>this.onByeRequest(i),onInfo:i=>this.onInfoRequest(i),onInvite:i=>this.onInviteRequest(i),onMessage:i=>this.onMessageRequest(i),onNotify:i=>this.onNotifyRequest(i),onPrack:i=>this.onPrackRequest(i),onRefer:i=>this.onReferRequest(i)},this._dialog=s,s.signalingState){case U.Initial:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(B.Terminated),Promise.reject(new Error("Bad Media Description"));case U.HaveLocalOffer:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(B.Terminated),Promise.reject(new Error("Bad Media Description"));case U.HaveRemoteOffer:{if(!this._dialog.offer)throw new Error(`Session offer undefined in signaling state ${this._dialog.signalingState}.`);const i={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setOfferAndGetAnswer(this._dialog.offer,i).then(n=>{e.ack({body:n}),this.stateTransition(B.Established)}).catch(n=>{throw this.ackAndBye(e,488,"Invalid session description"),this.stateTransition(B.Terminated),n})}case U.Stable:{if(this.earlyMediaSessionDescriptionHandlers.size>0){const a=this.earlyMediaSessionDescriptionHandlers.get(s.id);if(!a)throw new Error("Session description handler undefined.");return this.setSessionDescriptionHandler(a),this.earlyMediaSessionDescriptionHandlers.delete(s.id),e.ack(),this.stateTransition(B.Established),Promise.resolve()}if(this.earlyMediaDialog){if(this.earlyMediaDialog!==s){this.earlyMedia&&this.logger.error("You have set the 'earlyMedia' option to 'true' which requires that your INVITE requests do not fork and yet this INVITE request did in fact fork. Consequentially and not surprisingly the end point which accepted the INVITE (confirmed dialog) does not match the end point with which early media has been setup (early dialog) and thus this session is unable to proceed. In accordance with the SIP specifications, the SIP servers your end point is connected to determine if an INVITE forks and the forking behavior of those servers cannot be controlled by this library. If you wish to use early media with this library you must configure those servers accordingly. Alternatively you may set the 'earlyMedia' to 'false' which will allow this library to function with any INVITE requests which do fork.");const a=new Error("Early media dialog does not equal confirmed dialog, terminating session");return this.logger.error(a.message),this.ackAndBye(e,488,"Not Acceptable Here"),this.stateTransition(B.Terminated),Promise.reject(a)}return e.ack(),this.stateTransition(B.Established),Promise.resolve()}const i=s.answer;if(!i)throw new Error("Answer is undefined.");const n={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(i,n).then(()=>{let a;this._renderbody&&this._rendertype&&(a={body:{contentDisposition:"render",contentType:this._rendertype,content:this._renderbody}}),e.ack(a),this.stateTransition(B.Established)}).catch(a=>{throw this.logger.error(a.message),this.ackAndBye(e,488,"Not Acceptable Here"),this.stateTransition(B.Terminated),a})}case U.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}}onProgress(e){var t;if(this.logger.log("Inviter.onProgress"),this.state!==B.Establishing)return this.logger.error(`Progress received while in state ${this.state}, dropping response`),Promise.reject(new Error(`Invalid session state ${this.state}`));if(!this.outgoingInviteRequest)throw new Error("Outgoing INVITE request undefined.");const s=e.message,i=e.session;s.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=Ie.nameAddrHeaderParse(s.getHeader("P-Asserted-Identity")));const n=s.getHeader("require"),a=s.getHeader("rseq"),d=!!(n&&n.includes("100rel")&&a?Number(a):void 0),c=[];switch(d&&c.push("RAck: "+s.getHeader("rseq")+" "+s.getHeader("cseq")),i.signalingState){case U.Initial:return d&&(this.logger.warn("First reliable provisional response received MUST contain an offer when INVITE does not contain an offer."),e.prack({extraHeaders:c})),Promise.resolve();case U.HaveLocalOffer:return d&&e.prack({extraHeaders:c}),Promise.resolve();case U.HaveRemoteOffer:if(!d)return this.logger.warn("Non-reliable provisional response MUST NOT contain an initial offer, discarding response."),Promise.resolve();{const l=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions||{});return!((t=this.delegate)===null||t===void 0)&&t.onSessionDescriptionHandler&&this.delegate.onSessionDescriptionHandler(l,!0),this.earlyMediaSessionDescriptionHandlers.set(i.id,l),l.setDescription(s.body,this.sessionDescriptionHandlerOptions,this.sessionDescriptionHandlerModifiers).then(()=>l.getDescription(this.sessionDescriptionHandlerOptions,this.sessionDescriptionHandlerModifiers)).then(g=>{const u={contentDisposition:"session",contentType:g.contentType,content:g.body};e.prack({extraHeaders:c,body:u})}).catch(g=>{throw this.stateTransition(B.Terminated),g})}case U.Stable:if(d&&e.prack({extraHeaders:c}),this.earlyMedia&&!this.earlyMediaDialog){this.earlyMediaDialog=i;const l=i.answer;if(!l)throw new Error("Answer is undefined.");const g={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(l,g).catch(u=>{throw this.stateTransition(B.Terminated),u})}return Promise.resolve();case U.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}}onRedirect(e){if(this.logger.log("Inviter.onRedirect"),this.state!==B.Establishing&&this.state!==B.Terminating){this.logger.error(`Redirect received while in state ${this.state}, dropping response`);return}this.stateTransition(B.Terminated)}onReject(e){if(this.logger.log("Inviter.onReject"),this.state!==B.Establishing&&this.state!==B.Terminating){this.logger.error(`Reject received while in state ${this.state}, dropping response`);return}this.stateTransition(B.Terminated)}onTrying(e){if(this.logger.log("Inviter.onTrying"),this.state!==B.Establishing){this.logger.error(`Trying received while in state ${this.state}, dropping response`);return}}}var me;(function(r){r.Initial="Initial",r.Registered="Registered",r.Unregistered="Unregistered",r.Terminated="Terminated"})(me=me||(me={}));class Et{constructor(e,t={}){this.disposed=!1,this._contacts=[],this._retryAfter=void 0,this._state=me.Initial,this._waiting=!1,this._stateEventEmitter=new Mr,this._waitingEventEmitter=new Mr,this.userAgent=e;const s=e.configuration.uri.clone();if(s.user=void 0,this.options=Object.assign(Object.assign(Object.assign({},Et.defaultOptions()),{registrar:s}),Et.stripUndefinedProperties(t)),this.options.extraContactHeaderParams=(this.options.extraContactHeaderParams||[]).slice(),this.options.extraHeaders=(this.options.extraHeaders||[]).slice(),!this.options.registrar)throw new Error("Registrar undefined.");if(this.options.registrar=this.options.registrar.clone(),this.options.regId&&!this.options.instanceId?this.options.instanceId=this.userAgent.instanceId:!this.options.regId&&this.options.instanceId&&(this.options.regId=1),this.options.instanceId&&Ie.parse(this.options.instanceId,"uuid")===-1)throw new Error("Invalid instanceId.");if(this.options.regId&&this.options.regId<0)throw new Error("Invalid regId.");const i=this.options.registrar,n=this.options.params&&this.options.params.fromUri||e.userAgentCore.configuration.aor,a=this.options.params&&this.options.params.toUri||e.configuration.uri,o=this.options.params||{},d=(t.extraHeaders||[]).slice();if(this.request=e.userAgentCore.makeOutgoingRequestMessage(G.REGISTER,i,n,a,o,d,void 0),this.expires=this.options.expires||Et.defaultExpires,this.expires<0)throw new Error("Invalid expires.");if(this.refreshFrequency=this.options.refreshFrequency||Et.defaultRefreshFrequency,this.refreshFrequency<50||this.refreshFrequency>99)throw new Error("Invalid refresh frequency. The value represents a percentage of the expiration time and should be between 50 and 99.");this.logger=e.getLogger("sip.Registerer"),this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach(c=>{const l=this.options[c];switch(c){case"registrar":this.logger.log("· "+c+": "+l);break;default:this.logger.log("· "+c+": "+JSON.stringify(l))}})),this.id=this.request.callId+this.request.from.parameters.tag,this.userAgent._registerers[this.id]=this}static defaultOptions(){return{expires:Et.defaultExpires,extraContactHeaderParams:[],extraHeaders:[],logConfiguration:!0,instanceId:"",params:{},regId:0,registrar:new yt("sip","anonymous","anonymous.invalid"),refreshFrequency:Et.defaultRefreshFrequency}}static stripUndefinedProperties(e){return Object.keys(e).reduce((t,s)=>(e[s]!==void 0&&(t[s]=e[s]),t),{})}get contacts(){return this._contacts.slice()}get retryAfter(){return this._retryAfter}get state(){return this._state}get stateChange(){return this._stateEventEmitter}dispose(){return this.disposed?Promise.resolve():(this.disposed=!0,this.logger.log(`Registerer ${this.id} in state ${this.state} is being disposed`),delete this.userAgent._registerers[this.id],new Promise(e=>{const t=()=>{if(!this.waiting&&this._state===me.Registered){this.stateChange.addListener(()=>{this.terminated(),e()},{once:!0}),this.unregister();return}this.terminated(),e()};this.waiting?this.waitingChange.addListener(()=>{t()},{once:!0}):t()}))}register(e={}){if(this.state===me.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();const i=new Oi("REGISTER request already in progress, waiting for final response");return Promise.reject(i)}e.requestOptions&&(this.options=Object.assign(Object.assign({},this.options),e.requestOptions));const t=(this.options.extraHeaders||[]).slice();t.push("Contact: "+this.generateContactHeader(this.expires)),t.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),this.request.extraHeaders=t,this.waitingToggle(!0);const s=this.userAgent.userAgentCore.register(this.request,{onAccept:i=>{let n;i.message.hasHeader("expires")&&(n=Number(i.message.getHeader("expires"))),this._contacts=i.message.getHeaders("contact");let a=this._contacts.length;if(!a){this.logger.error("No Contact header in response to REGISTER, dropping response."),this.unregistered();return}let o;for(;a--;){if(o=i.message.parseHeader("contact",a),!o)throw new Error("Contact undefined");if(this.userAgent.contact.pubGruu&&Ta(o.uri,this.userAgent.contact.pubGruu)){n=Number(o.getParam("expires"));break}if(this.userAgent.configuration.contactName===""){if(o.uri.user===this.userAgent.contact.uri.user){n=Number(o.getParam("expires"));break}}else if(Ta(o.uri,this.userAgent.contact.uri)){n=Number(o.getParam("expires"));break}o=void 0}if(o===void 0){this.logger.error("No Contact header pointing to us, dropping response"),this.unregistered(),this.waitingToggle(!1);return}if(n===void 0){this.logger.error("Contact pointing to us is missing expires parameter, dropping response"),this.unregistered(),this.waitingToggle(!1);return}if(o.hasParam("temp-gruu")){const d=o.getParam("temp-gruu");d&&(this.userAgent.contact.tempGruu=Ie.URIParse(d.replace(/"/g,"")))}if(o.hasParam("pub-gruu")){const d=o.getParam("pub-gruu");d&&(this.userAgent.contact.pubGruu=Ie.URIParse(d.replace(/"/g,"")))}this.registered(n),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(i),this.waitingToggle(!1)},onProgress:i=>{e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(i)},onRedirect:i=>{this.logger.error("Redirect received. Not supported."),this.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(i),this.waitingToggle(!1)},onReject:i=>{if(i.message.statusCode===423){if(!i.message.hasHeader("min-expires")){this.logger.error("423 response received for REGISTER without Min-Expires, dropping response"),this.unregistered(),this.waitingToggle(!1);return}this.expires=Number(i.message.getHeader("min-expires")),this.waitingToggle(!1),this.register();return}this.logger.warn(`Failed to register, status code ${i.message.statusCode}`);let n=NaN;if(i.message.statusCode===500||i.message.statusCode===503){const a=i.message.getHeader("retry-after");a&&(n=Number.parseInt(a,void 0))}this._retryAfter=isNaN(n)?void 0:n,this.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(i),this._retryAfter=void 0,this.waitingToggle(!1)},onTrying:i=>{e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(i)}});return Promise.resolve(s)}unregister(e={}){if(this.state===me.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed&&this.state!==me.Registered)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();const i=new Oi("REGISTER request already in progress, waiting for final response");return Promise.reject(i)}this._state!==me.Registered&&!e.all&&this.logger.warn("Not currently registered, but sending an unregister anyway.");const t=(e.requestOptions&&e.requestOptions.extraHeaders||[]).slice();this.request.extraHeaders=t,e.all?(t.push("Contact: *"),t.push("Expires: 0")):t.push("Contact: "+this.generateContactHeader(0)),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),this.registrationTimer!==void 0&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),this.waitingToggle(!0);const s=this.userAgent.userAgentCore.register(this.request,{onAccept:i=>{this._contacts=i.message.getHeaders("contact"),this.unregistered(),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(i),this.waitingToggle(!1)},onProgress:i=>{e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(i)},onRedirect:i=>{this.logger.error("Unregister redirected. Not currently supported."),this.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(i),this.waitingToggle(!1)},onReject:i=>{this.logger.error(`Unregister rejected with status code ${i.message.statusCode}`),this.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(i),this.waitingToggle(!1)},onTrying:i=>{e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(i)}});return Promise.resolve(s)}clearTimers(){this.registrationTimer!==void 0&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),this.registrationExpiredTimer!==void 0&&(clearTimeout(this.registrationExpiredTimer),this.registrationExpiredTimer=void 0)}generateContactHeader(e){let t=this.userAgent.contact.toString({register:!0});return this.options.regId&&this.options.instanceId&&(t+=";reg-id="+this.options.regId,t+=';+sip.instance="<urn:uuid:'+this.options.instanceId+'>"'),this.options.extraContactHeaderParams&&this.options.extraContactHeaderParams.forEach(s=>{t+=";"+s}),t+=";expires="+e,t}registered(e){this.clearTimers(),this.registrationTimer=setTimeout(()=>{this.registrationTimer=void 0,this.register()},this.refreshFrequency/100*e*1e3),this.registrationExpiredTimer=setTimeout(()=>{this.logger.warn("Registration expired"),this.unregistered()},e*1e3),this._state!==me.Registered&&this.stateTransition(me.Registered)}unregistered(){this.clearTimers(),this._state!==me.Unregistered&&this.stateTransition(me.Unregistered)}terminated(){this.clearTimers(),this._state!==me.Terminated&&this.stateTransition(me.Terminated)}stateTransition(e){const t=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};switch(this._state){case me.Initial:e!==me.Registered&&e!==me.Unregistered&&e!==me.Terminated&&t();break;case me.Registered:e!==me.Unregistered&&e!==me.Terminated&&t();break;case me.Unregistered:e!==me.Registered&&e!==me.Terminated&&t();break;case me.Terminated:t();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log(`Registration transitioned to state ${this._state}`),this._stateEventEmitter.emit(this._state),e===me.Terminated&&this.dispose()}get waiting(){return this._waiting}get waitingChange(){return this._waitingEventEmitter}waitingToggle(e){if(this._waiting===e)throw new Error(`Invalid waiting transition from ${this._waiting} to ${e}`);this._waiting=e,this.logger.log(`Waiting toggled to ${this._waiting}`),this._waitingEventEmitter.emit(this._waiting)}waitingWarning(){let e="An attempt was made to send a REGISTER request while a prior one was still in progress.";e+=" RFC 3261 requires UAs MUST NOT send a new registration until they have received a final response",e+=" from the registrar for the previous one or the previous REGISTER request has timed out.",e+=" Note that if the transport disconnects, you still must wait for the prior request to time out before",e+=" sending a new REGISTER request or alternatively dispose of the current Registerer and create a new Registerer.",this.logger.warn(e)}stateError(){let t=`An attempt was made to send a REGISTER request when the Registerer ${this.state===me.Terminated?"is in 'Terminated' state":"has been disposed"}.`;t+=" The Registerer transitions to 'Terminated' when Registerer.dispose() is called.",t+=" Perhaps you called UserAgent.stop() which dipsoses of all Registerers?",this.logger.error(t)}}Et.defaultExpires=600,Et.defaultRefreshFrequency=99;var fe;(function(r){r.Initial="Initial",r.NotifyWait="NotifyWait",r.Pending="Pending",r.Active="Active",r.Terminated="Terminated"})(fe=fe||(fe={}));var ee;(function(r){r.Connecting="Connecting",r.Connected="Connected",r.Disconnecting="Disconnecting",r.Disconnected="Disconnected"})(ee=ee||(ee={}));var Me;(function(r){r.Started="Started",r.Stopped="Stopped"})(Me=Me||(Me={}));class Fe{constructor(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){const t=Fe.hexChars,s=Fe.hexOut;let i,n,a,o;for(o=0;o<4;o+=1)for(n=o*8,i=e[o],a=0;a<8;a+=2)s[n+1+a]=t.charAt(i&15),i>>>=4,s[n+0+a]=t.charAt(i&15),i>>>=4;return s.join("")}static _md5cycle(e,t){let s=e[0],i=e[1],n=e[2],a=e[3];s+=(i&n|~i&a)+t[0]-680876936|0,s=(s<<7|s>>>25)+i|0,a+=(s&i|~s&n)+t[1]-389564586|0,a=(a<<12|a>>>20)+s|0,n+=(a&s|~a&i)+t[2]+606105819|0,n=(n<<17|n>>>15)+a|0,i+=(n&a|~n&s)+t[3]-1044525330|0,i=(i<<22|i>>>10)+n|0,s+=(i&n|~i&a)+t[4]-176418897|0,s=(s<<7|s>>>25)+i|0,a+=(s&i|~s&n)+t[5]+1200080426|0,a=(a<<12|a>>>20)+s|0,n+=(a&s|~a&i)+t[6]-1473231341|0,n=(n<<17|n>>>15)+a|0,i+=(n&a|~n&s)+t[7]-45705983|0,i=(i<<22|i>>>10)+n|0,s+=(i&n|~i&a)+t[8]+1770035416|0,s=(s<<7|s>>>25)+i|0,a+=(s&i|~s&n)+t[9]-1958414417|0,a=(a<<12|a>>>20)+s|0,n+=(a&s|~a&i)+t[10]-42063|0,n=(n<<17|n>>>15)+a|0,i+=(n&a|~n&s)+t[11]-1990404162|0,i=(i<<22|i>>>10)+n|0,s+=(i&n|~i&a)+t[12]+1804603682|0,s=(s<<7|s>>>25)+i|0,a+=(s&i|~s&n)+t[13]-40341101|0,a=(a<<12|a>>>20)+s|0,n+=(a&s|~a&i)+t[14]-1502002290|0,n=(n<<17|n>>>15)+a|0,i+=(n&a|~n&s)+t[15]+1236535329|0,i=(i<<22|i>>>10)+n|0,s+=(i&a|n&~a)+t[1]-165796510|0,s=(s<<5|s>>>27)+i|0,a+=(s&n|i&~n)+t[6]-1069501632|0,a=(a<<9|a>>>23)+s|0,n+=(a&i|s&~i)+t[11]+643717713|0,n=(n<<14|n>>>18)+a|0,i+=(n&s|a&~s)+t[0]-373897302|0,i=(i<<20|i>>>12)+n|0,s+=(i&a|n&~a)+t[5]-701558691|0,s=(s<<5|s>>>27)+i|0,a+=(s&n|i&~n)+t[10]+38016083|0,a=(a<<9|a>>>23)+s|0,n+=(a&i|s&~i)+t[15]-660478335|0,n=(n<<14|n>>>18)+a|0,i+=(n&s|a&~s)+t[4]-405537848|0,i=(i<<20|i>>>12)+n|0,s+=(i&a|n&~a)+t[9]+568446438|0,s=(s<<5|s>>>27)+i|0,a+=(s&n|i&~n)+t[14]-1019803690|0,a=(a<<9|a>>>23)+s|0,n+=(a&i|s&~i)+t[3]-187363961|0,n=(n<<14|n>>>18)+a|0,i+=(n&s|a&~s)+t[8]+1163531501|0,i=(i<<20|i>>>12)+n|0,s+=(i&a|n&~a)+t[13]-1444681467|0,s=(s<<5|s>>>27)+i|0,a+=(s&n|i&~n)+t[2]-51403784|0,a=(a<<9|a>>>23)+s|0,n+=(a&i|s&~i)+t[7]+1735328473|0,n=(n<<14|n>>>18)+a|0,i+=(n&s|a&~s)+t[12]-1926607734|0,i=(i<<20|i>>>12)+n|0,s+=(i^n^a)+t[5]-378558|0,s=(s<<4|s>>>28)+i|0,a+=(s^i^n)+t[8]-2022574463|0,a=(a<<11|a>>>21)+s|0,n+=(a^s^i)+t[11]+1839030562|0,n=(n<<16|n>>>16)+a|0,i+=(n^a^s)+t[14]-35309556|0,i=(i<<23|i>>>9)+n|0,s+=(i^n^a)+t[1]-1530992060|0,s=(s<<4|s>>>28)+i|0,a+=(s^i^n)+t[4]+1272893353|0,a=(a<<11|a>>>21)+s|0,n+=(a^s^i)+t[7]-155497632|0,n=(n<<16|n>>>16)+a|0,i+=(n^a^s)+t[10]-1094730640|0,i=(i<<23|i>>>9)+n|0,s+=(i^n^a)+t[13]+681279174|0,s=(s<<4|s>>>28)+i|0,a+=(s^i^n)+t[0]-358537222|0,a=(a<<11|a>>>21)+s|0,n+=(a^s^i)+t[3]-722521979|0,n=(n<<16|n>>>16)+a|0,i+=(n^a^s)+t[6]+76029189|0,i=(i<<23|i>>>9)+n|0,s+=(i^n^a)+t[9]-640364487|0,s=(s<<4|s>>>28)+i|0,a+=(s^i^n)+t[12]-421815835|0,a=(a<<11|a>>>21)+s|0,n+=(a^s^i)+t[15]+530742520|0,n=(n<<16|n>>>16)+a|0,i+=(n^a^s)+t[2]-995338651|0,i=(i<<23|i>>>9)+n|0,s+=(n^(i|~a))+t[0]-198630844|0,s=(s<<6|s>>>26)+i|0,a+=(i^(s|~n))+t[7]+1126891415|0,a=(a<<10|a>>>22)+s|0,n+=(s^(a|~i))+t[14]-1416354905|0,n=(n<<15|n>>>17)+a|0,i+=(a^(n|~s))+t[5]-57434055|0,i=(i<<21|i>>>11)+n|0,s+=(n^(i|~a))+t[12]+1700485571|0,s=(s<<6|s>>>26)+i|0,a+=(i^(s|~n))+t[3]-1894986606|0,a=(a<<10|a>>>22)+s|0,n+=(s^(a|~i))+t[10]-1051523|0,n=(n<<15|n>>>17)+a|0,i+=(a^(n|~s))+t[1]-2054922799|0,i=(i<<21|i>>>11)+n|0,s+=(n^(i|~a))+t[8]+1873313359|0,s=(s<<6|s>>>26)+i|0,a+=(i^(s|~n))+t[15]-30611744|0,a=(a<<10|a>>>22)+s|0,n+=(s^(a|~i))+t[6]-1560198380|0,n=(n<<15|n>>>17)+a|0,i+=(a^(n|~s))+t[13]+1309151649|0,i=(i<<21|i>>>11)+n|0,s+=(n^(i|~a))+t[4]-145523070|0,s=(s<<6|s>>>26)+i|0,a+=(i^(s|~n))+t[11]-1120210379|0,a=(a<<10|a>>>22)+s|0,n+=(s^(a|~i))+t[2]+718787259|0,n=(n<<15|n>>>17)+a|0,i+=(a^(n|~s))+t[9]-343485551|0,i=(i<<21|i>>>11)+n|0,e[0]=s+e[0]|0,e[1]=i+e[1]|0,e[2]=n+e[2]|0,e[3]=a+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(Fe.stateIdentity),this}appendStr(e){const t=this._buffer8,s=this._buffer32;let i=this._bufferLength,n,a;for(a=0;a<e.length;a+=1){if(n=e.charCodeAt(a),n<128)t[i++]=n;else if(n<2048)t[i++]=(n>>>6)+192,t[i++]=n&63|128;else if(n<55296||n>56319)t[i++]=(n>>>12)+224,t[i++]=n>>>6&63|128,t[i++]=n&63|128;else{if(n=(n-55296)*1024+(e.charCodeAt(++a)-56320)+65536,n>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");t[i++]=(n>>>18)+240,t[i++]=n>>>12&63|128,t[i++]=n>>>6&63|128,t[i++]=n&63|128}i>=64&&(this._dataLength+=64,Fe._md5cycle(this._state,s),i-=64,s[0]=s[16])}return this._bufferLength=i,this}appendAsciiStr(e){const t=this._buffer8,s=this._buffer32;let i=this._bufferLength,n,a=0;for(;;){for(n=Math.min(e.length-a,64-i);n--;)t[i++]=e.charCodeAt(a++);if(i<64)break;this._dataLength+=64,Fe._md5cycle(this._state,s),i=0}return this._bufferLength=i,this}appendByteArray(e){const t=this._buffer8,s=this._buffer32;let i=this._bufferLength,n,a=0;for(;;){for(n=Math.min(e.length-a,64-i);n--;)t[i++]=e[a++];if(i<64)break;this._dataLength+=64,Fe._md5cycle(this._state,s),i=0}return this._bufferLength=i,this}getState(){const e=this,t=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[t[0],t[1],t[2],t[3]]}}setState(e){const t=e.buffer,s=e.state,i=this._state;let n;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],n=0;n<t.length;n+=1)this._buffer8[n]=t.charCodeAt(n)}end(e=!1){const t=this._bufferLength,s=this._buffer8,i=this._buffer32,n=(t>>2)+1;let a;if(this._dataLength+=t,s[t]=128,s[t+1]=s[t+2]=s[t+3]=0,i.set(Fe.buffer32Identity.subarray(n),n),t>55&&(Fe._md5cycle(this._state,i),i.set(Fe.buffer32Identity)),a=this._dataLength*8,a<=4294967295)i[14]=a;else{const o=a.toString(16).match(/(.*?)(.{0,8})$/);if(o===null)return;const d=parseInt(o[2],16),c=parseInt(o[1],16)||0;i[14]=d,i[15]=c}return Fe._md5cycle(this._state,i),e?this._state:Fe._hex(this._state)}}Fe.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),Fe.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Fe.hexChars="0123456789abcdef",Fe.hexOut=[],Fe.onePassHasher=new Fe,Fe.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592"&&console.error("Md5 self test failed.");function Kt(r){return Fe.hashStr(r)}class hc{constructor(e,t,s,i){this.logger=e.getLogger("sipjs.digestauthentication"),this.username=s,this.password=i,this.ha1=t,this.nc=0,this.ncHex="00000000"}authenticate(e,t,s){if(this.algorithm=t.algorithm,this.realm=t.realm,this.nonce=t.nonce,this.opaque=t.opaque,this.stale=t.stale,this.algorithm){if(this.algorithm!=="MD5")return this.logger.warn("challenge with Digest algorithm different than 'MD5', authentication aborted"),!1}else this.algorithm="MD5";if(!this.realm)return this.logger.warn("challenge without Digest realm, authentication aborted"),!1;if(!this.nonce)return this.logger.warn("challenge without Digest nonce, authentication aborted"),!1;if(t.qop)if(t.qop.indexOf("auth")>-1)this.qop="auth";else if(t.qop.indexOf("auth-int")>-1)this.qop="auth-int";else return this.logger.warn("challenge without Digest qop different than 'auth' or 'auth-int', authentication aborted"),!1;else this.qop=void 0;return this.method=e.method,this.uri=e.ruri,this.cnonce=or(12),this.nc+=1,this.updateNcHex(),this.nc===4294967296&&(this.nc=1,this.ncHex="00000001"),this.calculateResponse(s),!0}toString(){const e=[];if(!this.response)throw new Error("response field does not exist, cannot generate Authorization header");return e.push("algorithm="+this.algorithm),e.push('username="'+this.username+'"'),e.push('realm="'+this.realm+'"'),e.push('nonce="'+this.nonce+'"'),e.push('uri="'+this.uri+'"'),e.push('response="'+this.response+'"'),this.opaque&&e.push('opaque="'+this.opaque+'"'),this.qop&&(e.push("qop="+this.qop),e.push('cnonce="'+this.cnonce+'"'),e.push("nc="+this.ncHex)),"Digest "+e.join(", ")}updateNcHex(){const e=Number(this.nc).toString(16);this.ncHex="00000000".substr(0,8-e.length)+e}calculateResponse(e){let t,s;t=this.ha1,(t===""||t===void 0)&&(t=Kt(this.username+":"+this.realm+":"+this.password)),this.qop==="auth"?(s=Kt(this.method+":"+this.uri),this.response=Kt(t+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth:"+s)):this.qop==="auth-int"?(s=Kt(this.method+":"+this.uri+":"+Kt(e||"")),this.response=Kt(t+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth-int:"+s)):this.qop===void 0&&(s=Kt(this.method+":"+this.uri),this.response=Kt(t+":"+this.nonce+":"+s))}}var Oe;(function(r){r[r.error=0]="error",r[r.warn=1]="warn",r[r.log=2]="log",r[r.debug=3]="debug"})(Oe=Oe||(Oe={}));class Pa{constructor(e,t,s){this.logger=e,this.category=t,this.label=s}error(e){this.genericLog(Oe.error,e)}warn(e){this.genericLog(Oe.warn,e)}log(e){this.genericLog(Oe.log,e)}debug(e){this.genericLog(Oe.debug,e)}genericLog(e,t){this.logger.genericLog(e,this.category,this.label,t)}get level(){return this.logger.level}set level(e){this.logger.level=e}}class uc{constructor(){this.builtinEnabled=!0,this._level=Oe.log,this.loggers={},this.logger=this.getLogger("sip:loggerfactory")}get level(){return this._level}set level(e){e>=0&&e<=3?this._level=e:e>3?this._level=3:Oe.hasOwnProperty(e)?this._level=e:this.logger.error("invalid 'level' parameter value: "+JSON.stringify(e))}get connector(){return this._connector}set connector(e){e?typeof e=="function"?this._connector=e:this.logger.error("invalid 'connector' parameter value: "+JSON.stringify(e)):this._connector=void 0}getLogger(e,t){if(t&&this.level===3)return new Pa(this,e,t);if(this.loggers[e])return this.loggers[e];{const s=new Pa(this,e);return this.loggers[e]=s,s}}genericLog(e,t,s,i){this.level>=e&&this.builtinEnabled&&this.print(e,t,s,i),this.connector&&this.connector(Oe[e],t,s,i)}print(e,t,s,i){if(typeof i=="string"){const n=[new Date,t];s&&n.push(s),i=n.concat(i).join(" | ")}switch(e){case Oe.error:console.error(i);break;case Oe.warn:console.warn(i);break;case Oe.log:console.log(i);break;case Oe.debug:console.debug(i);break}}}var hs;(function(r){function e(i,n){let a=n,o=0,d=0;if(i.substring(a,a+2).match(/(^\r\n)/))return-2;for(;o===0;){if(d=i.indexOf(`\r
178
+ `,e}}function Da(r){return r==="application/sdp"?"session":"render"}function ds(r){const e=typeof r=="string"?r:r.body,t=typeof r=="string"?"application/sdp":r.contentType;return{contentDisposition:Da(t),contentType:t,content:e}}function Aa(r){return r&&typeof r.content=="string"&&typeof r.contentType=="string"&&r.contentDisposition===void 0?!0:typeof r.contentDisposition=="string"}function jr(r){let e,t,s;if(r instanceof yr&&r.body){const i=r.parseHeader("Content-Disposition");e=i?i.type:void 0,t=r.parseHeader("Content-Type"),s=r.body}if(r instanceof Gt&&r.body){const i=r.parseHeader("Content-Disposition");e=i?i.type:void 0,t=r.parseHeader("Content-Type"),s=r.body}if(r instanceof cr&&r.body)if(e=r.getHeader("Content-Disposition"),t=r.getHeader("Content-Type"),typeof r.body=="string"){if(!t)throw new Error("Header content type header does not equal body content type.");s=r.body}else{if(t&&t!==r.body.contentType)throw new Error("Header content type header does not equal body content type.");t=r.body.contentType,s=r.body.body}if(Aa(r)&&(e=r.contentDisposition,t=r.contentType,s=r.content),!!s){if(t&&!e&&(e=Da(t)),!e)throw new Error("Content disposition undefined.");if(!t)throw new Error("Content type undefined.");return{contentDisposition:e,contentType:t,content:s}}}var st;(function(r){r.Initial="Initial",r.Early="Early",r.AckWait="AckWait",r.Confirmed="Confirmed",r.Terminated="Terminated"})(st=st||(st={}));var L;(function(r){r.Initial="Initial",r.HaveLocalOffer="HaveLocalOffer",r.HaveRemoteOffer="HaveRemoteOffer",r.Stable="Stable",r.Closed="Closed"})(L=L||(L={}));const kt=500,V0=4e3,Sa=5e3,$e={T1:kt,T2:V0,TIMER_B:64*kt,TIMER_D:0*kt,TIMER_F:64*kt,TIMER_H:64*kt,TIMER_I:0*Sa,TIMER_J:0*kt,TIMER_K:0*Sa,TIMER_L:64*kt,TIMER_M:64*kt,TIMER_N:64*kt,PROVISIONAL_RESPONSE_INTERVAL:6e4};class Vt extends ar{constructor(e){super(e||"Transaction state error.")}}var G;(function(r){r.ACK="ACK",r.BYE="BYE",r.CANCEL="CANCEL",r.INFO="INFO",r.INVITE="INVITE",r.MESSAGE="MESSAGE",r.NOTIFY="NOTIFY",r.OPTIONS="OPTIONS",r.REGISTER="REGISTER",r.UPDATE="UPDATE",r.SUBSCRIBE="SUBSCRIBE",r.PUBLISH="PUBLISH",r.REFER="REFER",r.PRACK="PRACK"})(G=G||(G={}));const zt=[G.ACK,G.BYE,G.CANCEL,G.INFO,G.INVITE,G.MESSAGE,G.NOTIFY,G.OPTIONS,G.PRACK,G.REFER,G.REGISTER,G.SUBSCRIBE];class Ta{constructor(e){this.incomingMessageRequest=e}get request(){return this.incomingMessageRequest.message}accept(e){return this.incomingMessageRequest.accept(e),Promise.resolve()}reject(e){return this.incomingMessageRequest.reject(e),Promise.resolve()}}class Mi{constructor(e){this.incomingNotifyRequest=e}get request(){return this.incomingNotifyRequest.message}accept(e){return this.incomingNotifyRequest.accept(e),Promise.resolve()}reject(e){return this.incomingNotifyRequest.reject(e),Promise.resolve()}}class z0{constructor(e,t){this.incomingReferRequest=e,this.session=t}get referTo(){const e=this.incomingReferRequest.message.parseHeader("refer-to");if(!(e instanceof ze))throw new Error("Failed to parse Refer-To header.");return e}get referredBy(){return this.incomingReferRequest.message.getHeader("referred-by")}get replaces(){const e=this.referTo.uri.getHeader("replaces");return e instanceof Array?e[0]:e}get request(){return this.incomingReferRequest.message}accept(e={statusCode:202}){return this.incomingReferRequest.accept(e),Promise.resolve()}reject(e){return this.incomingReferRequest.reject(e),Promise.resolve()}makeInviter(e){if(this.inviter)return this.inviter;const t=this.referTo.uri.clone();t.clearHeaders(),e=e||{};const s=(e.extraHeaders||[]).slice(),i=this.replaces;i&&s.push("Replaces: "+decodeURIComponent(i));const n=this.referredBy;return n&&s.push("Referred-By: "+n),e.extraHeaders=s,this.inviter=this.session.userAgent._makeInviter(t,e),this.inviter._referred=this.session,this.session._referral=this.inviter,this.inviter}}var B;(function(r){r.Initial="Initial",r.Establishing="Establishing",r.Established="Established",r.Terminating="Terminating",r.Terminated="Terminated"})(B=B||(B={}));class Ur{constructor(e,t={}){this.pendingReinvite=!1,this.pendingReinviteAck=!1,this._state=B.Initial,this.delegate=t.delegate,this._stateEventEmitter=new Mr,this._userAgent=e}dispose(){switch(this.logger.log(`Session ${this.id} in state ${this._state} is being disposed`),delete this.userAgent._sessions[this.id],this._sessionDescriptionHandler&&this._sessionDescriptionHandler.close(),this.state){case B.Initial:break;case B.Establishing:break;case B.Established:return new Promise(e=>{this._bye({onAccept:()=>e(),onRedirect:()=>e(),onReject:()=>e()})});case B.Terminating:break;case B.Terminated:break;default:throw new Error("Unknown state.")}return Promise.resolve()}get assertedIdentity(){return this._assertedIdentity}get dialog(){return this._dialog}get id(){return this._id}get replacee(){return this._replacee}get sessionDescriptionHandler(){return this._sessionDescriptionHandler}get sessionDescriptionHandlerFactory(){return this.userAgent.configuration.sessionDescriptionHandlerFactory}get sessionDescriptionHandlerModifiers(){return this._sessionDescriptionHandlerModifiers||[]}set sessionDescriptionHandlerModifiers(e){this._sessionDescriptionHandlerModifiers=e.slice()}get sessionDescriptionHandlerOptions(){return this._sessionDescriptionHandlerOptions||{}}set sessionDescriptionHandlerOptions(e){this._sessionDescriptionHandlerOptions=Object.assign({},e)}get sessionDescriptionHandlerModifiersReInvite(){return this._sessionDescriptionHandlerModifiersReInvite||[]}set sessionDescriptionHandlerModifiersReInvite(e){this._sessionDescriptionHandlerModifiersReInvite=e.slice()}get sessionDescriptionHandlerOptionsReInvite(){return this._sessionDescriptionHandlerOptionsReInvite||{}}set sessionDescriptionHandlerOptionsReInvite(e){this._sessionDescriptionHandlerOptionsReInvite=Object.assign({},e)}get state(){return this._state}get stateChange(){return this._stateEventEmitter}get userAgent(){return this._userAgent}bye(e={}){let t="Session.bye() may only be called if established session.";switch(this.state){case B.Initial:typeof this.cancel=="function"?(t+=" However Inviter.invite() has not yet been called.",t+=" Perhaps you should have called Inviter.cancel()?"):typeof this.reject=="function"&&(t+=" However Invitation.accept() has not yet been called.",t+=" Perhaps you should have called Invitation.reject()?");break;case B.Establishing:typeof this.cancel=="function"?(t+=" However a dialog does not yet exist.",t+=" Perhaps you should have called Inviter.cancel()?"):typeof this.reject=="function"&&(t+=" However Invitation.accept() has not yet been called (or not yet resolved).",t+=" Perhaps you should have called Invitation.reject()?");break;case B.Established:{const s=e.requestDelegate,i=this.copyRequestOptions(e.requestOptions);return this._bye(s,i)}case B.Terminating:t+=" However this session is already terminating.",typeof this.cancel=="function"?t+=" Perhaps you have already called Inviter.cancel()?":typeof this.reject=="function"&&(t+=" Perhaps you have already called Session.bye()?");break;case B.Terminated:t+=" However this session is already terminated.";break;default:throw new Error("Unknown state")}return this.logger.error(t),Promise.reject(new Error(`Invalid session state ${this.state}`))}info(e={}){if(this.state!==B.Established)return this.logger.error("Session.info() may only be called if established session."),Promise.reject(new Error(`Invalid session state ${this.state}`));const t=e.requestDelegate,s=this.copyRequestOptions(e.requestOptions);return this._info(t,s)}invite(e={}){if(this.logger.log("Session.invite"),this.state!==B.Established)return Promise.reject(new Error(`Invalid session state ${this.state}`));if(this.pendingReinvite)return Promise.reject(new $i("Reinvite in progress. Please wait until complete, then try again."));this.pendingReinvite=!0,e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiersReInvite=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptionsReInvite=e.sessionDescriptionHandlerOptions);const t={onAccept:n=>{const a=jr(n.message);if(!a){this.logger.error("Received 2xx response to re-INVITE without a session description"),this.ackAndBye(n,400,"Missing session description"),this.stateTransition(B.Terminated),this.pendingReinvite=!1;return}if(e.withoutSdp){const o={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.setOfferAndGetAnswer(a,o).then(d=>{n.ack({body:d})}).catch(d=>{this.logger.error("Failed to handle offer in 2xx response to re-INVITE"),this.logger.error(d.message),this.state===B.Terminated?n.ack():(this.ackAndBye(n,488,"Bad Media Description"),this.stateTransition(B.Terminated))}).then(()=>{this.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)})}else{const o={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.setAnswer(a,o).then(()=>{n.ack()}).catch(d=>{this.logger.error("Failed to handle answer in 2xx response to re-INVITE"),this.logger.error(d.message),this.state!==B.Terminated?(this.ackAndBye(n,488,"Bad Media Description"),this.stateTransition(B.Terminated)):n.ack()}).then(()=>{this.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)})}},onProgress:n=>{},onRedirect:n=>{},onReject:n=>{this.logger.warn("Received a non-2xx response to re-INVITE"),this.pendingReinvite=!1,e.withoutSdp?e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n):this.rollbackOffer().catch(a=>{if(this.logger.error("Failed to rollback offer on non-2xx response to re-INVITE"),this.logger.error(a.message),this.state!==B.Terminated){if(!this.dialog)throw new Error("Dialog undefined.");const o=[];o.push("Reason: "+this.getReasonHeaderValue(500,"Internal Server Error")),this.dialog.bye(void 0,{extraHeaders:o}),this.stateTransition(B.Terminated)}}).then(()=>{e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n)})},onTrying:n=>{}},s=e.requestOptions||{};if(s.extraHeaders=(s.extraHeaders||[]).slice(),s.extraHeaders.push("Allow: "+zt.toString()),s.extraHeaders.push("Contact: "+this._contact),e.withoutSdp){if(!this.dialog)throw this.pendingReinvite=!1,new Error("Dialog undefined.");return Promise.resolve(this.dialog.invite(t,s))}const i={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};return this.getOffer(i).then(n=>{if(!this.dialog)throw this.pendingReinvite=!1,new Error("Dialog undefined.");return s.body=n,this.dialog.invite(t,s)}).catch(n=>{throw this.logger.error(n.message),this.logger.error("Failed to send re-INVITE"),this.pendingReinvite=!1,n})}message(e={}){if(this.state!==B.Established)return this.logger.error("Session.message() may only be called if established session."),Promise.reject(new Error(`Invalid session state ${this.state}`));const t=e.requestDelegate,s=this.copyRequestOptions(e.requestOptions);return this._message(t,s)}refer(e,t={}){if(this.state!==B.Established)return this.logger.error("Session.refer() may only be called if established session."),Promise.reject(new Error(`Invalid session state ${this.state}`));if(e instanceof Ur&&!e.dialog)return this.logger.error("Session.refer() may only be called with session which is established. You are perhaps attempting to attended transfer to a target for which there is not dialog yet established. Perhaps you are attempting a 'semi-attended' tansfer? Regardless, this is not supported. The recommended approached is to check to see if the target Session is in the Established state before calling refer(); if the state is not Established you may proceed by falling back using a URI as the target (blind transfer)."),Promise.reject(new Error(`Invalid session state ${this.state}`));const s=t.requestDelegate,i=this.copyRequestOptions(t.requestOptions);return i.extraHeaders=i.extraHeaders?i.extraHeaders.concat(this.referExtraHeaders(this.referToString(e))):this.referExtraHeaders(this.referToString(e)),this._refer(t.onNotify,s,i)}_bye(e,t){if(!this.dialog)return Promise.reject(new Error("Session dialog undefined."));const s=this.dialog;switch(s.sessionState){case st.Initial:throw new Error(`Invalid dialog state ${s.sessionState}`);case st.Early:throw new Error(`Invalid dialog state ${s.sessionState}`);case st.AckWait:return this.stateTransition(B.Terminating),new Promise(i=>{s.delegate={onAck:()=>{const n=s.bye(e,t);return this.stateTransition(B.Terminated),i(n),Promise.resolve()},onAckTimeout:()=>{const n=s.bye(e,t);this.stateTransition(B.Terminated),i(n)}}});case st.Confirmed:{const i=s.bye(e,t);return this.stateTransition(B.Terminated),Promise.resolve(i)}case st.Terminated:throw new Error(`Invalid dialog state ${s.sessionState}`);default:throw new Error("Unrecognized state.")}}_info(e,t){return this.dialog?Promise.resolve(this.dialog.info(e,t)):Promise.reject(new Error("Session dialog undefined."))}_message(e,t){return this.dialog?Promise.resolve(this.dialog.message(e,t)):Promise.reject(new Error("Session dialog undefined."))}_refer(e,t,s){return this.dialog?(this.onNotify=e,Promise.resolve(this.dialog.refer(t,s))):Promise.reject(new Error("Session dialog undefined."))}ackAndBye(e,t,s){e.ack();const i=[];t&&i.push("Reason: "+this.getReasonHeaderValue(t,s)),e.session.bye(void 0,{extraHeaders:i})}onAckRequest(e){if(this.logger.log("Session.onAckRequest"),this.state!==B.Established&&this.state!==B.Terminating)return this.logger.error(`ACK received while in state ${this.state}, dropping request`),Promise.resolve();const t=this.dialog;if(!t)throw new Error("Dialog undefined.");const s={sessionDescriptionHandlerOptions:this.pendingReinviteAck?this.sessionDescriptionHandlerOptionsReInvite:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.pendingReinviteAck?this._sessionDescriptionHandlerModifiersReInvite:this._sessionDescriptionHandlerModifiers};if(this.delegate&&this.delegate.onAck){const i=new q0(e);this.delegate.onAck(i)}switch(this.pendingReinviteAck=!1,t.signalingState){case L.Initial:{this.logger.error(`Invalid signaling state ${t.signalingState}.`);const i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return t.bye(void 0,{extraHeaders:i}),this.stateTransition(B.Terminated),Promise.resolve()}case L.Stable:{const i=jr(e.message);return i?i.contentDisposition==="render"?(this._renderbody=i.content,this._rendertype=i.contentType,Promise.resolve()):i.contentDisposition!=="session"?Promise.resolve():this.setAnswer(i,s).catch(n=>{this.logger.error(n.message);const a=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];t.bye(void 0,{extraHeaders:a}),this.stateTransition(B.Terminated)}):Promise.resolve()}case L.HaveLocalOffer:{this.logger.error(`Invalid signaling state ${t.signalingState}.`);const i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return t.bye(void 0,{extraHeaders:i}),this.stateTransition(B.Terminated),Promise.resolve()}case L.HaveRemoteOffer:{this.logger.error(`Invalid signaling state ${t.signalingState}.`);const i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return t.bye(void 0,{extraHeaders:i}),this.stateTransition(B.Terminated),Promise.resolve()}case L.Closed:throw new Error(`Invalid signaling state ${t.signalingState}.`);default:throw new Error(`Invalid signaling state ${t.signalingState}.`)}}onByeRequest(e){if(this.logger.log("Session.onByeRequest"),this.state!==B.Established){this.logger.error(`BYE received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onBye){const t=new j0(e);this.delegate.onBye(t)}else e.accept();this.stateTransition(B.Terminated)}onInfoRequest(e){if(this.logger.log("Session.onInfoRequest"),this.state!==B.Established){this.logger.error(`INFO received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onInfo){const t=new L0(e);this.delegate.onInfo(t)}else e.accept()}onInviteRequest(e){if(this.logger.log("Session.onInviteRequest"),this.state!==B.Established){this.logger.error(`INVITE received while in state ${this.state}, dropping request`);return}this.pendingReinviteAck=!0;const t=["Contact: "+this._contact];if(e.message.hasHeader("P-Asserted-Identity")){const i=e.message.getHeader("P-Asserted-Identity");if(!i)throw new Error("Header undefined.");this._assertedIdentity=Ie.nameAddrHeaderParse(i)}const s={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.generateResponseOfferAnswerInDialog(s).then(i=>{const n=e.accept({statusCode:200,extraHeaders:t,body:i});this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,n.message,200)}).catch(i=>{if(this.logger.error(i.message),this.logger.error("Failed to handle to re-INVITE request"),!this.dialog)throw new Error("Dialog undefined.");if(this.logger.error(this.dialog.signalingState),this.dialog.signalingState===L.Stable){const n=e.reject({statusCode:488});this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,n.message,488);return}this.rollbackOffer().then(()=>{const n=e.reject({statusCode:488});this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,n.message,488)}).catch(n=>{this.logger.error(n.message),this.logger.error("Failed to rollback offer on re-INVITE request");const a=e.reject({statusCode:488});if(this.state!==B.Terminated){if(!this.dialog)throw new Error("Dialog undefined.");const o=[];o.push("Reason: "+this.getReasonHeaderValue(500,"Internal Server Error")),this.dialog.bye(void 0,{extraHeaders:o}),this.stateTransition(B.Terminated)}this.delegate&&this.delegate.onInvite&&this.delegate.onInvite(e.message,a.message,488)})})}onMessageRequest(e){if(this.logger.log("Session.onMessageRequest"),this.state!==B.Established){this.logger.error(`MESSAGE received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onMessage){const t=new Ta(e);this.delegate.onMessage(t)}else e.accept()}onNotifyRequest(e){if(this.logger.log("Session.onNotifyRequest"),this.state!==B.Established){this.logger.error(`NOTIFY received while in state ${this.state}, dropping request`);return}if(this.onNotify){const t=new Mi(e);this.onNotify(t);return}if(this.delegate&&this.delegate.onNotify){const t=new Mi(e);this.delegate.onNotify(t)}else e.accept()}onPrackRequest(e){if(this.logger.log("Session.onPrackRequest"),this.state!==B.Established){this.logger.error(`PRACK received while in state ${this.state}, dropping request`);return}throw new Error("Unimplemented.")}onReferRequest(e){if(this.logger.log("Session.onReferRequest"),this.state!==B.Established){this.logger.error(`REFER received while in state ${this.state}, dropping request`);return}if(!e.message.hasHeader("refer-to")){this.logger.warn("Invalid REFER packet. A refer-to header is required. Rejecting."),e.reject();return}const t=new z0(e,this);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(t):(this.logger.log("No delegate available to handle REFER, automatically accepting and following."),t.accept().then(()=>t.makeInviter(this._referralInviterOptions).invite()).catch(s=>{this.logger.error(s.message)}))}generateResponseOfferAnswer(e,t){if(this.dialog)return this.generateResponseOfferAnswerInDialog(t);const s=jr(e.message);return!s||s.contentDisposition!=="session"?this.getOffer(t):this.setOfferAndGetAnswer(s,t)}generateResponseOfferAnswerInDialog(e){if(!this.dialog)throw new Error("Dialog undefined.");switch(this.dialog.signalingState){case L.Initial:return this.getOffer(e);case L.HaveLocalOffer:return Promise.resolve(void 0);case L.HaveRemoteOffer:if(!this.dialog.offer)throw new Error(`Session offer undefined in signaling state ${this.dialog.signalingState}.`);return this.setOfferAndGetAnswer(this.dialog.offer,e);case L.Stable:return this.state!==B.Established?Promise.resolve(void 0):this.getOffer(e);case L.Closed:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);default:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`)}}getOffer(e){const t=this.setupSessionDescriptionHandler(),s=e.sessionDescriptionHandlerOptions,i=e.sessionDescriptionHandlerModifiers;try{return t.getDescription(s,i).then(n=>ds(n)).catch(n=>{this.logger.error("Session.getOffer: SDH getDescription rejected...");const a=n instanceof Error?n:new Error("Session.getOffer unknown error.");throw this.logger.error(a.message),a})}catch(n){this.logger.error("Session.getOffer: SDH getDescription threw...");const a=n instanceof Error?n:new Error(n);return this.logger.error(a.message),Promise.reject(a)}}rollbackOffer(){const e=this.setupSessionDescriptionHandler();if(e.rollbackDescription===void 0)return Promise.resolve();try{return e.rollbackDescription().catch(t=>{this.logger.error("Session.rollbackOffer: SDH rollbackDescription rejected...");const s=t instanceof Error?t:new Error("Session.rollbackOffer unknown error.");throw this.logger.error(s.message),s})}catch(t){this.logger.error("Session.rollbackOffer: SDH rollbackDescription threw...");const s=t instanceof Error?t:new Error(t);return this.logger.error(s.message),Promise.reject(s)}}setAnswer(e,t){const s=this.setupSessionDescriptionHandler(),i=t.sessionDescriptionHandlerOptions,n=t.sessionDescriptionHandlerModifiers;try{if(!s.hasDescription(e.contentType))return Promise.reject(new Pi)}catch(a){this.logger.error("Session.setAnswer: SDH hasDescription threw...");const o=a instanceof Error?a:new Error(a);return this.logger.error(o.message),Promise.reject(o)}try{return s.setDescription(e.content,i,n).catch(a=>{this.logger.error("Session.setAnswer: SDH setDescription rejected...");const o=a instanceof Error?a:new Error("Session.setAnswer unknown error.");throw this.logger.error(o.message),o})}catch(a){this.logger.error("Session.setAnswer: SDH setDescription threw...");const o=a instanceof Error?a:new Error(a);return this.logger.error(o.message),Promise.reject(o)}}setOfferAndGetAnswer(e,t){const s=this.setupSessionDescriptionHandler(),i=t.sessionDescriptionHandlerOptions,n=t.sessionDescriptionHandlerModifiers;try{if(!s.hasDescription(e.contentType))return Promise.reject(new Pi)}catch(a){this.logger.error("Session.setOfferAndGetAnswer: SDH hasDescription threw...");const o=a instanceof Error?a:new Error(a);return this.logger.error(o.message),Promise.reject(o)}try{return s.setDescription(e.content,i,n).then(()=>s.getDescription(i,n)).then(a=>ds(a)).catch(a=>{this.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription rejected...");const o=a instanceof Error?a:new Error("Session.setOfferAndGetAnswer unknown error.");throw this.logger.error(o.message),o})}catch(a){this.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription threw...");const o=a instanceof Error?a:new Error(a);return this.logger.error(o.message),Promise.reject(o)}}setSessionDescriptionHandler(e){if(this._sessionDescriptionHandler)throw new Error("Session description handler defined.");this._sessionDescriptionHandler=e}setupSessionDescriptionHandler(){var e;return this._sessionDescriptionHandler?this._sessionDescriptionHandler:(this._sessionDescriptionHandler=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions),!((e=this.delegate)===null||e===void 0)&&e.onSessionDescriptionHandler&&this.delegate.onSessionDescriptionHandler(this._sessionDescriptionHandler,!1),this._sessionDescriptionHandler)}stateTransition(e){const t=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};switch(this._state){case B.Initial:e!==B.Establishing&&e!==B.Established&&e!==B.Terminating&&e!==B.Terminated&&t();break;case B.Establishing:e!==B.Established&&e!==B.Terminating&&e!==B.Terminated&&t();break;case B.Established:e!==B.Terminating&&e!==B.Terminated&&t();break;case B.Terminating:e!==B.Terminated&&t();break;case B.Terminated:t();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log(`Session ${this.id} transitioned to state ${this._state}`),this._stateEventEmitter.emit(this._state),e===B.Terminated&&this.dispose()}copyRequestOptions(e={}){const t=e.extraHeaders?e.extraHeaders.slice():void 0,s=e.body?{contentDisposition:e.body.contentDisposition||"render",contentType:e.body.contentType||"text/plain",content:e.body.content||""}:void 0;return{extraHeaders:t,body:s}}getReasonHeaderValue(e,t){const s=e;let i=cs(e);return!i&&t&&(i=t),"SIP;cause="+s+';text="'+i+'"'}referExtraHeaders(e){const t=[];return t.push("Referred-By: <"+this.userAgent.configuration.uri+">"),t.push("Contact: "+this._contact),t.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),t.push("Refer-To: "+e),t}referToString(e){let t;if(e instanceof yt)t=e.toString();else{if(!e.dialog)throw new Error("Dialog undefined.");const s=e.remoteIdentity.friendlyName,i=e.dialog.remoteTarget.toString(),n=e.dialog.callId,a=e.dialog.remoteTag,o=e.dialog.localTag,d=encodeURIComponent(`${n};to-tag=${a};from-tag=${o}`);t=`"${s}" <${i}?Replaces=${d}>`}return t}}var ht;(function(r){r.Required="Required",r.Supported="Supported",r.Unsupported="Unsupported"})(ht=ht||(ht={}));const K0={"100rel":!0,199:!0,answermode:!0,"early-session":!0,eventlist:!0,explicitsub:!0,"from-change":!0,"geolocation-http":!0,"geolocation-sip":!0,gin:!0,gruu:!0,histinfo:!0,ice:!0,join:!0,"multiple-refer":!0,norefersub:!0,nosub:!0,outbound:!0,path:!0,policy:!0,precondition:!0,pref:!0,privacy:!0,"recipient-list-invite":!0,"recipient-list-message":!0,"recipient-list-subscribe":!0,replaces:!0,"resource-priority":!0,"sdp-anat":!0,"sec-agree":!0,tdialog:!0,timer:!0,uui:!0};class Z0 extends Ur{constructor(e,t){super(e),this.incomingInviteRequest=t,this.disposed=!1,this.expiresTimer=void 0,this.isCanceled=!1,this.rel100="none",this.rseq=Math.floor(Math.random()*1e4),this.userNoAnswerTimer=void 0,this.waitingForPrack=!1,this.logger=e.getLogger("sip.Invitation");const s=this.incomingInviteRequest.message,i=s.getHeader("require");i&&i.toLowerCase().includes("100rel")&&(this.rel100="required");const n=s.getHeader("supported");if(n&&n.toLowerCase().includes("100rel")&&(this.rel100="supported"),s.toTag=t.toTag,typeof s.toTag!="string")throw new TypeError("toTag should have been a string.");if(this.userNoAnswerTimer=setTimeout(()=>{t.reject({statusCode:480}),this.stateTransition(B.Terminated)},this.userAgent.configuration.noAnswerTimeout?this.userAgent.configuration.noAnswerTimeout*1e3:6e4),s.hasHeader("expires")){const d=Number(s.getHeader("expires")||0)*1e3;this.expiresTimer=setTimeout(()=>{this.state===B.Initial&&(t.reject({statusCode:487}),this.stateTransition(B.Terminated))},d)}const a=this.request.getHeader("P-Asserted-Identity");a&&(this._assertedIdentity=Ie.nameAddrHeaderParse(a)),this._contact=this.userAgent.contact.toString();const o=s.parseHeader("Content-Disposition");o&&o.type==="render"&&(this._renderbody=s.body,this._rendertype=s.getHeader("Content-Type")),this._id=s.callId+s.fromTag,this.userAgent._sessions[this._id]=this}dispose(){if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.expiresTimer&&(clearTimeout(this.expiresTimer),this.expiresTimer=void 0),this.userNoAnswerTimer&&(clearTimeout(this.userNoAnswerTimer),this.userNoAnswerTimer=void 0),this.prackNeverArrived(),this.state){case B.Initial:return this.reject().then(()=>super.dispose());case B.Establishing:return this.reject().then(()=>super.dispose());case B.Established:return super.dispose();case B.Terminating:return super.dispose();case B.Terminated:return super.dispose();default:throw new Error("Unknown state.")}}get autoSendAnInitialProvisionalResponse(){return this.rel100!=="required"&&this.userAgent.configuration.sendInitialProvisionalResponse}get body(){return this.incomingInviteRequest.message.body}get localIdentity(){return this.request.to}get remoteIdentity(){return this.request.from}get request(){return this.incomingInviteRequest.message}accept(e={}){if(this.logger.log("Invitation.accept"),this.state!==B.Initial){const t=new Error(`Invalid session state ${this.state}`);return this.logger.error(t.message),Promise.reject(t)}return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.stateTransition(B.Establishing),this.sendAccept(e).then(({message:t,session:s})=>{s.delegate={onAck:i=>this.onAckRequest(i),onAckTimeout:()=>this.onAckTimeout(),onBye:i=>this.onByeRequest(i),onInfo:i=>this.onInfoRequest(i),onInvite:i=>this.onInviteRequest(i),onMessage:i=>this.onMessageRequest(i),onNotify:i=>this.onNotifyRequest(i),onPrack:i=>this.onPrackRequest(i),onRefer:i=>this.onReferRequest(i)},this._dialog=s,this.stateTransition(B.Established),this._replacee&&this._replacee._bye()}).catch(t=>this.handleResponseError(t))}progress(e={}){if(this.logger.log("Invitation.progress"),this.state!==B.Initial){const s=new Error(`Invalid session state ${this.state}`);return this.logger.error(s.message),Promise.reject(s)}const t=e.statusCode||180;if(t<100||t>199)throw new TypeError("Invalid statusCode: "+t);return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.waitingForPrack?(this.logger.warn("Unexpected call for progress while waiting for prack, ignoring"),Promise.resolve()):e.statusCode===100?this.sendProgressTrying().then(()=>{}).catch(s=>this.handleResponseError(s)):this.rel100!=="required"&&!(this.rel100==="supported"&&e.rel100)&&!(this.rel100==="supported"&&this.userAgent.configuration.sipExtension100rel===ht.Required)?this.sendProgress(e).then(()=>{}).catch(s=>this.handleResponseError(s)):this.sendProgressReliableWaitForPrack(e).then(()=>{}).catch(s=>this.handleResponseError(s))}reject(e={}){if(this.logger.log("Invitation.reject"),this.state!==B.Initial&&this.state!==B.Establishing){const a=new Error(`Invalid session state ${this.state}`);return this.logger.error(a.message),Promise.reject(a)}const t=e.statusCode||480,s=e.reasonPhrase?e.reasonPhrase:cs(t),i=e.extraHeaders||[];if(t<300||t>699)throw new TypeError("Invalid statusCode: "+t);const n=e.body?ds(e.body):void 0;return t<400?this.incomingInviteRequest.redirect([],{statusCode:t,reasonPhrase:s,extraHeaders:i,body:n}):this.incomingInviteRequest.reject({statusCode:t,reasonPhrase:s,extraHeaders:i,body:n}),this.stateTransition(B.Terminated),Promise.resolve()}_onCancel(e){if(this.logger.log("Invitation._onCancel"),this.state!==B.Initial&&this.state!==B.Establishing){this.logger.error(`CANCEL received while in state ${this.state}, dropping request`);return}if(this.delegate&&this.delegate.onCancel){const t=new U0(e);this.delegate.onCancel(t)}this.isCanceled=!0,this.incomingInviteRequest.reject({statusCode:487}),this.stateTransition(B.Terminated)}handlePrackOfferAnswer(e){if(!this.dialog)throw new Error("Dialog undefined.");const t=jr(e.message);if(!t||t.contentDisposition!=="session")return Promise.resolve(void 0);const s={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers};switch(this.dialog.signalingState){case L.Initial:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);case L.Stable:return this.setAnswer(t,s).then(()=>{});case L.HaveLocalOffer:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);case L.HaveRemoteOffer:return this.setOfferAndGetAnswer(t,s);case L.Closed:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`);default:throw new Error(`Invalid signaling state ${this.dialog.signalingState}.`)}}handleResponseError(e){let t=480;if(e instanceof Error?this.logger.error(e.message):this.logger.error(e),e instanceof Pi?(this.logger.error("A session description handler occurred while sending response (content type unsupported"),t=415):e instanceof M0?this.logger.error("A session description handler occurred while sending response"):e instanceof Oi?this.logger.error("Session ended before response could be formulated and sent (while waiting for PRACK)"):e instanceof Vt&&this.logger.error("Session changed state before response could be formulated and sent"),this.state===B.Initial||this.state===B.Establishing)try{this.incomingInviteRequest.reject({statusCode:t}),this.stateTransition(B.Terminated)}catch(s){throw this.logger.error("An error occurred attempting to reject the request while handling another error"),s}if(this.isCanceled){this.logger.warn("An error occurred while attempting to formulate and send a response to an incoming INVITE. However a CANCEL was received and processed while doing so which can (and often does) result in errors occurring as the session terminates in the meantime. Said error is being ignored.");return}throw e}onAckTimeout(){if(this.logger.log("Invitation.onAckTimeout"),!this.dialog)throw new Error("Dialog undefined.");this.logger.log("No ACK received for an extended period of time, terminating session"),this.dialog.bye(),this.stateTransition(B.Terminated)}sendAccept(e={}){const t={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},s=e.extraHeaders||[];return this.waitingForPrack?this.waitForArrivalOfPrack().then(()=>clearTimeout(this.userNoAnswerTimer)).then(()=>this.generateResponseOfferAnswer(this.incomingInviteRequest,t)).then(i=>this.incomingInviteRequest.accept({statusCode:200,body:i,extraHeaders:s})):(clearTimeout(this.userNoAnswerTimer),this.generateResponseOfferAnswer(this.incomingInviteRequest,t).then(i=>this.incomingInviteRequest.accept({statusCode:200,body:i,extraHeaders:s})))}sendProgress(e={}){const t=e.statusCode||180,s=e.reasonPhrase,i=(e.extraHeaders||[]).slice(),n=e.body?ds(e.body):void 0;if(t===183&&!n)return this.sendProgressWithSDP(e);try{const a=this.incomingInviteRequest.progress({statusCode:t,reasonPhrase:s,extraHeaders:i,body:n});return this._dialog=a.session,Promise.resolve(a)}catch(a){return Promise.reject(a)}}sendProgressWithSDP(e={}){const t={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},s=e.statusCode||183,i=e.reasonPhrase,n=(e.extraHeaders||[]).slice();return this.generateResponseOfferAnswer(this.incomingInviteRequest,t).then(a=>this.incomingInviteRequest.progress({statusCode:s,reasonPhrase:i,extraHeaders:n,body:a})).then(a=>(this._dialog=a.session,a))}sendProgressReliable(e={}){return e.extraHeaders=(e.extraHeaders||[]).slice(),e.extraHeaders.push("Require: 100rel"),e.extraHeaders.push("RSeq: "+Math.floor(Math.random()*1e4)),this.sendProgressWithSDP(e)}sendProgressReliableWaitForPrack(e={}){const t={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},s=e.statusCode||183,i=e.reasonPhrase,n=(e.extraHeaders||[]).slice();n.push("Require: 100rel"),n.push("RSeq: "+this.rseq++);let a;return new Promise((o,d)=>{this.waitingForPrack=!0,this.generateResponseOfferAnswer(this.incomingInviteRequest,t).then(c=>(a=c,this.incomingInviteRequest.progress({statusCode:s,reasonPhrase:i,extraHeaders:n,body:a}))).then(c=>{this._dialog=c.session;let l,g;c.session.delegate={onPrack:x=>{l=x,clearTimeout(y),clearTimeout(C),this.waitingForPrack&&(this.waitingForPrack=!1,this.handlePrackOfferAnswer(l).then(p=>{try{g=l.accept({statusCode:200,body:p}),this.prackArrived(),o({prackRequest:l,prackResponse:g,progressResponse:c})}catch(E){d(E)}}).catch(p=>d(p)))}};const y=setTimeout(()=>{this.waitingForPrack&&(this.waitingForPrack=!1,this.logger.warn("No PRACK received, rejecting INVITE."),clearTimeout(C),this.reject({statusCode:504}).then(()=>d(new Oi)).catch(x=>d(x)))},$e.T1*64),w=()=>{try{this.incomingInviteRequest.progress({statusCode:s,reasonPhrase:i,extraHeaders:n,body:a})}catch(x){this.waitingForPrack=!1,d(x);return}C=setTimeout(w,b*=2)};let b=$e.T1,C=setTimeout(w,b)}).catch(c=>{this.waitingForPrack=!1,d(c)})})}sendProgressTrying(){try{const e=this.incomingInviteRequest.trying();return Promise.resolve(e)}catch(e){return Promise.reject(e)}}waitForArrivalOfPrack(){if(this.waitingForPrackPromise)throw new Error("Already waiting for PRACK");return this.waitingForPrackPromise=new Promise((e,t)=>{this.waitingForPrackResolve=e,this.waitingForPrackReject=t}),this.waitingForPrackPromise}prackArrived(){this.waitingForPrackResolve&&this.waitingForPrackResolve(),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0}prackNeverArrived(){this.waitingForPrackReject&&this.waitingForPrackReject(new Oi),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0}}class Ra extends Ur{constructor(e,t,s={}){super(e,s),this.disposed=!1,this.earlyMedia=!1,this.earlyMediaSessionDescriptionHandlers=new Map,this.isCanceled=!1,this.inviteWithoutSdp=!1,this.logger=e.getLogger("sip.Inviter"),this.earlyMedia=s.earlyMedia!==void 0?s.earlyMedia:this.earlyMedia,this.fromTag=ls(),this.inviteWithoutSdp=s.inviteWithoutSdp!==void 0?s.inviteWithoutSdp:this.inviteWithoutSdp;const i=Object.assign({},s);i.params=Object.assign({},s.params);const n=s.anonymous||!1,a=e.contact.toString({anonymous:n,outbound:n?!e.contact.tempGruu:!e.contact.pubGruu});n&&e.configuration.uri&&(i.params.fromDisplayName="Anonymous",i.params.fromUri="sip:anonymous@anonymous.invalid");let o=e.userAgentCore.configuration.aor;if(i.params.fromUri&&(o=typeof i.params.fromUri=="string"?Ie.URIParse(i.params.fromUri):i.params.fromUri),!o)throw new TypeError("Invalid from URI: "+i.params.fromUri);let d=t;if(i.params.toUri&&(d=typeof i.params.toUri=="string"?Ie.URIParse(i.params.toUri):i.params.toUri),!d)throw new TypeError("Invalid to URI: "+i.params.toUri);const c=Object.assign({},i.params);c.fromTag=this.fromTag;const l=(i.extraHeaders||[]).slice();n&&e.configuration.uri&&(l.push("P-Preferred-Identity: "+e.configuration.uri.toString()),l.push("Privacy: id")),l.push("Contact: "+a),l.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),e.configuration.sipExtension100rel===ht.Required&&l.push("Require: 100rel"),e.configuration.sipExtensionReplaces===ht.Required&&l.push("Require: replaces"),i.extraHeaders=l;const g=void 0;this.outgoingRequestMessage=e.userAgentCore.makeOutgoingRequestMessage(G.INVITE,t,o,d,c,l,g),this._contact=a,this._referralInviterOptions=i,this._renderbody=s.renderbody,this._rendertype=s.rendertype,s.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=s.sessionDescriptionHandlerModifiers),s.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=s.sessionDescriptionHandlerOptions),s.sessionDescriptionHandlerModifiersReInvite&&(this.sessionDescriptionHandlerModifiersReInvite=s.sessionDescriptionHandlerModifiersReInvite),s.sessionDescriptionHandlerOptionsReInvite&&(this.sessionDescriptionHandlerOptionsReInvite=s.sessionDescriptionHandlerOptionsReInvite),this._id=this.outgoingRequestMessage.callId+this.fromTag,this.userAgent._sessions[this._id]=this}dispose(){if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.disposeEarlyMedia(),this.state){case B.Initial:return this.cancel().then(()=>super.dispose());case B.Establishing:return this.cancel().then(()=>super.dispose());case B.Established:return super.dispose();case B.Terminating:return super.dispose();case B.Terminated:return super.dispose();default:throw new Error("Unknown state.")}}get body(){return this.outgoingRequestMessage.body}get localIdentity(){return this.outgoingRequestMessage.from}get remoteIdentity(){return this.outgoingRequestMessage.to}get request(){return this.outgoingRequestMessage}cancel(e={}){if(this.logger.log("Inviter.cancel"),this.state!==B.Initial&&this.state!==B.Establishing){const s=new Error(`Invalid session state ${this.state}`);return this.logger.error(s.message),Promise.reject(s)}this.isCanceled=!0,this.stateTransition(B.Terminating);function t(s,i){if(s&&s<200||s>699)throw new TypeError("Invalid statusCode: "+s);if(s){const n=s,a=cs(s)||i;return"SIP;cause="+n+';text="'+a+'"'}}if(this.outgoingInviteRequest){let s;e.statusCode&&e.reasonPhrase&&(s=t(e.statusCode,e.reasonPhrase)),this.outgoingInviteRequest.cancel(s,e)}else this.logger.warn("Canceled session before INVITE was sent"),this.stateTransition(B.Terminated);return Promise.resolve()}invite(e={}){if(this.logger.log("Inviter.invite"),this.state!==B.Initial)return super.invite(e);if(e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),e.withoutSdp||this.inviteWithoutSdp)return this._renderbody&&this._rendertype&&(this.outgoingRequestMessage.body={contentType:this._rendertype,body:this._renderbody}),this.stateTransition(B.Establishing),Promise.resolve(this.sendInvite(e));const t={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.getOffer(t).then(s=>(this.outgoingRequestMessage.body={body:s.content,contentType:s.contentType},this.stateTransition(B.Establishing),this.sendInvite(e))).catch(s=>{throw this.logger.log(s.message),this.state!==B.Terminated&&this.stateTransition(B.Terminated),s})}sendInvite(e={}){return this.outgoingInviteRequest=this.userAgent.userAgentCore.invite(this.outgoingRequestMessage,{onAccept:t=>{if(this.dialog){this.logger.log("Additional confirmed dialog, sending ACK and BYE"),this.ackAndBye(t);return}if(this.isCanceled){this.logger.log("Canceled session accepted, sending ACK and BYE"),this.ackAndBye(t),this.stateTransition(B.Terminated);return}this.notifyReferer(t),this.onAccept(t).then(()=>{this.disposeEarlyMedia()}).catch(()=>{this.disposeEarlyMedia()}).then(()=>{e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(t)})},onProgress:t=>{this.isCanceled||(this.notifyReferer(t),this.onProgress(t).catch(()=>{this.disposeEarlyMedia()}).then(()=>{e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(t)}))},onRedirect:t=>{this.notifyReferer(t),this.onRedirect(t),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(t)},onReject:t=>{this.notifyReferer(t),this.onReject(t),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(t)},onTrying:t=>{this.notifyReferer(t),this.onTrying(t),e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(t)}}),this.outgoingInviteRequest}disposeEarlyMedia(){this.earlyMediaSessionDescriptionHandlers.forEach(e=>{e.close()}),this.earlyMediaSessionDescriptionHandlers.clear()}notifyReferer(e){if(!this._referred)return;if(!(this._referred instanceof Ur))throw new Error("Referred session not instance of session");if(!this._referred.dialog)return;if(!e.message.statusCode)throw new Error("Status code undefined.");if(!e.message.reasonPhrase)throw new Error("Reason phrase undefined.");const t=e.message.statusCode,s=e.message.reasonPhrase,i=`SIP/2.0 ${t} ${s}`.trim(),n=this._referred.dialog.notify(void 0,{extraHeaders:["Event: refer","Subscription-State: terminated"],body:{contentDisposition:"render",contentType:"message/sipfrag",content:i}});n.delegate={onReject:()=>{this._referred=void 0}}}onAccept(e){if(this.logger.log("Inviter.onAccept"),this.state!==B.Establishing)return this.logger.error(`Accept received while in state ${this.state}, dropping response`),Promise.reject(new Error(`Invalid session state ${this.state}`));const t=e.message,s=e.session;switch(t.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=Ie.nameAddrHeaderParse(t.getHeader("P-Asserted-Identity"))),s.delegate={onAck:i=>this.onAckRequest(i),onBye:i=>this.onByeRequest(i),onInfo:i=>this.onInfoRequest(i),onInvite:i=>this.onInviteRequest(i),onMessage:i=>this.onMessageRequest(i),onNotify:i=>this.onNotifyRequest(i),onPrack:i=>this.onPrackRequest(i),onRefer:i=>this.onReferRequest(i)},this._dialog=s,s.signalingState){case L.Initial:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(B.Terminated),Promise.reject(new Error("Bad Media Description"));case L.HaveLocalOffer:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(B.Terminated),Promise.reject(new Error("Bad Media Description"));case L.HaveRemoteOffer:{if(!this._dialog.offer)throw new Error(`Session offer undefined in signaling state ${this._dialog.signalingState}.`);const i={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setOfferAndGetAnswer(this._dialog.offer,i).then(n=>{e.ack({body:n}),this.stateTransition(B.Established)}).catch(n=>{throw this.ackAndBye(e,488,"Invalid session description"),this.stateTransition(B.Terminated),n})}case L.Stable:{if(this.earlyMediaSessionDescriptionHandlers.size>0){const a=this.earlyMediaSessionDescriptionHandlers.get(s.id);if(!a)throw new Error("Session description handler undefined.");return this.setSessionDescriptionHandler(a),this.earlyMediaSessionDescriptionHandlers.delete(s.id),e.ack(),this.stateTransition(B.Established),Promise.resolve()}if(this.earlyMediaDialog){if(this.earlyMediaDialog!==s){this.earlyMedia&&this.logger.error("You have set the 'earlyMedia' option to 'true' which requires that your INVITE requests do not fork and yet this INVITE request did in fact fork. Consequentially and not surprisingly the end point which accepted the INVITE (confirmed dialog) does not match the end point with which early media has been setup (early dialog) and thus this session is unable to proceed. In accordance with the SIP specifications, the SIP servers your end point is connected to determine if an INVITE forks and the forking behavior of those servers cannot be controlled by this library. If you wish to use early media with this library you must configure those servers accordingly. Alternatively you may set the 'earlyMedia' to 'false' which will allow this library to function with any INVITE requests which do fork.");const a=new Error("Early media dialog does not equal confirmed dialog, terminating session");return this.logger.error(a.message),this.ackAndBye(e,488,"Not Acceptable Here"),this.stateTransition(B.Terminated),Promise.reject(a)}return e.ack(),this.stateTransition(B.Established),Promise.resolve()}const i=s.answer;if(!i)throw new Error("Answer is undefined.");const n={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(i,n).then(()=>{let a;this._renderbody&&this._rendertype&&(a={body:{contentDisposition:"render",contentType:this._rendertype,content:this._renderbody}}),e.ack(a),this.stateTransition(B.Established)}).catch(a=>{throw this.logger.error(a.message),this.ackAndBye(e,488,"Not Acceptable Here"),this.stateTransition(B.Terminated),a})}case L.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}}onProgress(e){var t;if(this.logger.log("Inviter.onProgress"),this.state!==B.Establishing)return this.logger.error(`Progress received while in state ${this.state}, dropping response`),Promise.reject(new Error(`Invalid session state ${this.state}`));if(!this.outgoingInviteRequest)throw new Error("Outgoing INVITE request undefined.");const s=e.message,i=e.session;s.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=Ie.nameAddrHeaderParse(s.getHeader("P-Asserted-Identity")));const n=s.getHeader("require"),a=s.getHeader("rseq"),d=!!(n&&n.includes("100rel")&&a?Number(a):void 0),c=[];switch(d&&c.push("RAck: "+s.getHeader("rseq")+" "+s.getHeader("cseq")),i.signalingState){case L.Initial:return d&&(this.logger.warn("First reliable provisional response received MUST contain an offer when INVITE does not contain an offer."),e.prack({extraHeaders:c})),Promise.resolve();case L.HaveLocalOffer:return d&&e.prack({extraHeaders:c}),Promise.resolve();case L.HaveRemoteOffer:if(!d)return this.logger.warn("Non-reliable provisional response MUST NOT contain an initial offer, discarding response."),Promise.resolve();{const l=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions||{});return!((t=this.delegate)===null||t===void 0)&&t.onSessionDescriptionHandler&&this.delegate.onSessionDescriptionHandler(l,!0),this.earlyMediaSessionDescriptionHandlers.set(i.id,l),l.setDescription(s.body,this.sessionDescriptionHandlerOptions,this.sessionDescriptionHandlerModifiers).then(()=>l.getDescription(this.sessionDescriptionHandlerOptions,this.sessionDescriptionHandlerModifiers)).then(g=>{const u={contentDisposition:"session",contentType:g.contentType,content:g.body};e.prack({extraHeaders:c,body:u})}).catch(g=>{throw this.stateTransition(B.Terminated),g})}case L.Stable:if(d&&e.prack({extraHeaders:c}),this.earlyMedia&&!this.earlyMediaDialog){this.earlyMediaDialog=i;const l=i.answer;if(!l)throw new Error("Answer is undefined.");const g={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(l,g).catch(u=>{throw this.stateTransition(B.Terminated),u})}return Promise.resolve();case L.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}}onRedirect(e){if(this.logger.log("Inviter.onRedirect"),this.state!==B.Establishing&&this.state!==B.Terminating){this.logger.error(`Redirect received while in state ${this.state}, dropping response`);return}this.stateTransition(B.Terminated)}onReject(e){if(this.logger.log("Inviter.onReject"),this.state!==B.Establishing&&this.state!==B.Terminating){this.logger.error(`Reject received while in state ${this.state}, dropping response`);return}this.stateTransition(B.Terminated)}onTrying(e){if(this.logger.log("Inviter.onTrying"),this.state!==B.Establishing){this.logger.error(`Trying received while in state ${this.state}, dropping response`);return}}}var me;(function(r){r.Initial="Initial",r.Registered="Registered",r.Unregistered="Unregistered",r.Terminated="Terminated"})(me=me||(me={}));class Et{constructor(e,t={}){this.disposed=!1,this._contacts=[],this._retryAfter=void 0,this._state=me.Initial,this._waiting=!1,this._stateEventEmitter=new Mr,this._waitingEventEmitter=new Mr,this.userAgent=e;const s=e.configuration.uri.clone();if(s.user=void 0,this.options=Object.assign(Object.assign(Object.assign({},Et.defaultOptions()),{registrar:s}),Et.stripUndefinedProperties(t)),this.options.extraContactHeaderParams=(this.options.extraContactHeaderParams||[]).slice(),this.options.extraHeaders=(this.options.extraHeaders||[]).slice(),!this.options.registrar)throw new Error("Registrar undefined.");if(this.options.registrar=this.options.registrar.clone(),this.options.regId&&!this.options.instanceId?this.options.instanceId=this.userAgent.instanceId:!this.options.regId&&this.options.instanceId&&(this.options.regId=1),this.options.instanceId&&Ie.parse(this.options.instanceId,"uuid")===-1)throw new Error("Invalid instanceId.");if(this.options.regId&&this.options.regId<0)throw new Error("Invalid regId.");const i=this.options.registrar,n=this.options.params&&this.options.params.fromUri||e.userAgentCore.configuration.aor,a=this.options.params&&this.options.params.toUri||e.configuration.uri,o=this.options.params||{},d=(t.extraHeaders||[]).slice();if(this.request=e.userAgentCore.makeOutgoingRequestMessage(G.REGISTER,i,n,a,o,d,void 0),this.expires=this.options.expires||Et.defaultExpires,this.expires<0)throw new Error("Invalid expires.");if(this.refreshFrequency=this.options.refreshFrequency||Et.defaultRefreshFrequency,this.refreshFrequency<50||this.refreshFrequency>99)throw new Error("Invalid refresh frequency. The value represents a percentage of the expiration time and should be between 50 and 99.");this.logger=e.getLogger("sip.Registerer"),this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach(c=>{const l=this.options[c];switch(c){case"registrar":this.logger.log("· "+c+": "+l);break;default:this.logger.log("· "+c+": "+JSON.stringify(l))}})),this.id=this.request.callId+this.request.from.parameters.tag,this.userAgent._registerers[this.id]=this}static defaultOptions(){return{expires:Et.defaultExpires,extraContactHeaderParams:[],extraHeaders:[],logConfiguration:!0,instanceId:"",params:{},regId:0,registrar:new yt("sip","anonymous","anonymous.invalid"),refreshFrequency:Et.defaultRefreshFrequency}}static stripUndefinedProperties(e){return Object.keys(e).reduce((t,s)=>(e[s]!==void 0&&(t[s]=e[s]),t),{})}get contacts(){return this._contacts.slice()}get retryAfter(){return this._retryAfter}get state(){return this._state}get stateChange(){return this._stateEventEmitter}dispose(){return this.disposed?Promise.resolve():(this.disposed=!0,this.logger.log(`Registerer ${this.id} in state ${this.state} is being disposed`),delete this.userAgent._registerers[this.id],new Promise(e=>{const t=()=>{if(!this.waiting&&this._state===me.Registered){this.stateChange.addListener(()=>{this.terminated(),e()},{once:!0}),this.unregister();return}this.terminated(),e()};this.waiting?this.waitingChange.addListener(()=>{t()},{once:!0}):t()}))}register(e={}){if(this.state===me.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();const i=new $i("REGISTER request already in progress, waiting for final response");return Promise.reject(i)}e.requestOptions&&(this.options=Object.assign(Object.assign({},this.options),e.requestOptions));const t=(this.options.extraHeaders||[]).slice();t.push("Contact: "+this.generateContactHeader(this.expires)),t.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),this.request.extraHeaders=t,this.waitingToggle(!0);const s=this.userAgent.userAgentCore.register(this.request,{onAccept:i=>{let n;i.message.hasHeader("expires")&&(n=Number(i.message.getHeader("expires"))),this._contacts=i.message.getHeaders("contact");let a=this._contacts.length;if(!a){this.logger.error("No Contact header in response to REGISTER, dropping response."),this.unregistered();return}let o;for(;a--;){if(o=i.message.parseHeader("contact",a),!o)throw new Error("Contact undefined");if(this.userAgent.contact.pubGruu&&Ca(o.uri,this.userAgent.contact.pubGruu)){n=Number(o.getParam("expires"));break}if(this.userAgent.configuration.contactName===""){if(o.uri.user===this.userAgent.contact.uri.user){n=Number(o.getParam("expires"));break}}else if(Ca(o.uri,this.userAgent.contact.uri)){n=Number(o.getParam("expires"));break}o=void 0}if(o===void 0){this.logger.error("No Contact header pointing to us, dropping response"),this.unregistered(),this.waitingToggle(!1);return}if(n===void 0){this.logger.error("Contact pointing to us is missing expires parameter, dropping response"),this.unregistered(),this.waitingToggle(!1);return}if(o.hasParam("temp-gruu")){const d=o.getParam("temp-gruu");d&&(this.userAgent.contact.tempGruu=Ie.URIParse(d.replace(/"/g,"")))}if(o.hasParam("pub-gruu")){const d=o.getParam("pub-gruu");d&&(this.userAgent.contact.pubGruu=Ie.URIParse(d.replace(/"/g,"")))}this.registered(n),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(i),this.waitingToggle(!1)},onProgress:i=>{e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(i)},onRedirect:i=>{this.logger.error("Redirect received. Not supported."),this.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(i),this.waitingToggle(!1)},onReject:i=>{if(i.message.statusCode===423){if(!i.message.hasHeader("min-expires")){this.logger.error("423 response received for REGISTER without Min-Expires, dropping response"),this.unregistered(),this.waitingToggle(!1);return}this.expires=Number(i.message.getHeader("min-expires")),this.waitingToggle(!1),this.register();return}this.logger.warn(`Failed to register, status code ${i.message.statusCode}`);let n=NaN;if(i.message.statusCode===500||i.message.statusCode===503){const a=i.message.getHeader("retry-after");a&&(n=Number.parseInt(a,void 0))}this._retryAfter=isNaN(n)?void 0:n,this.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(i),this._retryAfter=void 0,this.waitingToggle(!1)},onTrying:i=>{e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(i)}});return Promise.resolve(s)}unregister(e={}){if(this.state===me.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed&&this.state!==me.Registered)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();const i=new $i("REGISTER request already in progress, waiting for final response");return Promise.reject(i)}this._state!==me.Registered&&!e.all&&this.logger.warn("Not currently registered, but sending an unregister anyway.");const t=(e.requestOptions&&e.requestOptions.extraHeaders||[]).slice();this.request.extraHeaders=t,e.all?(t.push("Contact: *"),t.push("Expires: 0")):t.push("Contact: "+this.generateContactHeader(0)),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),this.registrationTimer!==void 0&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),this.waitingToggle(!0);const s=this.userAgent.userAgentCore.register(this.request,{onAccept:i=>{this._contacts=i.message.getHeaders("contact"),this.unregistered(),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(i),this.waitingToggle(!1)},onProgress:i=>{e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(i)},onRedirect:i=>{this.logger.error("Unregister redirected. Not currently supported."),this.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(i),this.waitingToggle(!1)},onReject:i=>{this.logger.error(`Unregister rejected with status code ${i.message.statusCode}`),this.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(i),this.waitingToggle(!1)},onTrying:i=>{e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(i)}});return Promise.resolve(s)}clearTimers(){this.registrationTimer!==void 0&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),this.registrationExpiredTimer!==void 0&&(clearTimeout(this.registrationExpiredTimer),this.registrationExpiredTimer=void 0)}generateContactHeader(e){let t=this.userAgent.contact.toString({register:!0});return this.options.regId&&this.options.instanceId&&(t+=";reg-id="+this.options.regId,t+=';+sip.instance="<urn:uuid:'+this.options.instanceId+'>"'),this.options.extraContactHeaderParams&&this.options.extraContactHeaderParams.forEach(s=>{t+=";"+s}),t+=";expires="+e,t}registered(e){this.clearTimers(),this.registrationTimer=setTimeout(()=>{this.registrationTimer=void 0,this.register()},this.refreshFrequency/100*e*1e3),this.registrationExpiredTimer=setTimeout(()=>{this.logger.warn("Registration expired"),this.unregistered()},e*1e3),this._state!==me.Registered&&this.stateTransition(me.Registered)}unregistered(){this.clearTimers(),this._state!==me.Unregistered&&this.stateTransition(me.Unregistered)}terminated(){this.clearTimers(),this._state!==me.Terminated&&this.stateTransition(me.Terminated)}stateTransition(e){const t=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};switch(this._state){case me.Initial:e!==me.Registered&&e!==me.Unregistered&&e!==me.Terminated&&t();break;case me.Registered:e!==me.Unregistered&&e!==me.Terminated&&t();break;case me.Unregistered:e!==me.Registered&&e!==me.Terminated&&t();break;case me.Terminated:t();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log(`Registration transitioned to state ${this._state}`),this._stateEventEmitter.emit(this._state),e===me.Terminated&&this.dispose()}get waiting(){return this._waiting}get waitingChange(){return this._waitingEventEmitter}waitingToggle(e){if(this._waiting===e)throw new Error(`Invalid waiting transition from ${this._waiting} to ${e}`);this._waiting=e,this.logger.log(`Waiting toggled to ${this._waiting}`),this._waitingEventEmitter.emit(this._waiting)}waitingWarning(){let e="An attempt was made to send a REGISTER request while a prior one was still in progress.";e+=" RFC 3261 requires UAs MUST NOT send a new registration until they have received a final response",e+=" from the registrar for the previous one or the previous REGISTER request has timed out.",e+=" Note that if the transport disconnects, you still must wait for the prior request to time out before",e+=" sending a new REGISTER request or alternatively dispose of the current Registerer and create a new Registerer.",this.logger.warn(e)}stateError(){let t=`An attempt was made to send a REGISTER request when the Registerer ${this.state===me.Terminated?"is in 'Terminated' state":"has been disposed"}.`;t+=" The Registerer transitions to 'Terminated' when Registerer.dispose() is called.",t+=" Perhaps you called UserAgent.stop() which dipsoses of all Registerers?",this.logger.error(t)}}Et.defaultExpires=600,Et.defaultRefreshFrequency=99;var fe;(function(r){r.Initial="Initial",r.NotifyWait="NotifyWait",r.Pending="Pending",r.Active="Active",r.Terminated="Terminated"})(fe=fe||(fe={}));var Q;(function(r){r.Connecting="Connecting",r.Connected="Connected",r.Disconnecting="Disconnecting",r.Disconnected="Disconnected"})(Q=Q||(Q={}));var Me;(function(r){r.Started="Started",r.Stopped="Stopped"})(Me=Me||(Me={}));class Fe{constructor(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}static hashStr(e,t=!1){return this.onePassHasher.start().appendStr(e).end(t)}static hashAsciiStr(e,t=!1){return this.onePassHasher.start().appendAsciiStr(e).end(t)}static _hex(e){const t=Fe.hexChars,s=Fe.hexOut;let i,n,a,o;for(o=0;o<4;o+=1)for(n=o*8,i=e[o],a=0;a<8;a+=2)s[n+1+a]=t.charAt(i&15),i>>>=4,s[n+0+a]=t.charAt(i&15),i>>>=4;return s.join("")}static _md5cycle(e,t){let s=e[0],i=e[1],n=e[2],a=e[3];s+=(i&n|~i&a)+t[0]-680876936|0,s=(s<<7|s>>>25)+i|0,a+=(s&i|~s&n)+t[1]-389564586|0,a=(a<<12|a>>>20)+s|0,n+=(a&s|~a&i)+t[2]+606105819|0,n=(n<<17|n>>>15)+a|0,i+=(n&a|~n&s)+t[3]-1044525330|0,i=(i<<22|i>>>10)+n|0,s+=(i&n|~i&a)+t[4]-176418897|0,s=(s<<7|s>>>25)+i|0,a+=(s&i|~s&n)+t[5]+1200080426|0,a=(a<<12|a>>>20)+s|0,n+=(a&s|~a&i)+t[6]-1473231341|0,n=(n<<17|n>>>15)+a|0,i+=(n&a|~n&s)+t[7]-45705983|0,i=(i<<22|i>>>10)+n|0,s+=(i&n|~i&a)+t[8]+1770035416|0,s=(s<<7|s>>>25)+i|0,a+=(s&i|~s&n)+t[9]-1958414417|0,a=(a<<12|a>>>20)+s|0,n+=(a&s|~a&i)+t[10]-42063|0,n=(n<<17|n>>>15)+a|0,i+=(n&a|~n&s)+t[11]-1990404162|0,i=(i<<22|i>>>10)+n|0,s+=(i&n|~i&a)+t[12]+1804603682|0,s=(s<<7|s>>>25)+i|0,a+=(s&i|~s&n)+t[13]-40341101|0,a=(a<<12|a>>>20)+s|0,n+=(a&s|~a&i)+t[14]-1502002290|0,n=(n<<17|n>>>15)+a|0,i+=(n&a|~n&s)+t[15]+1236535329|0,i=(i<<22|i>>>10)+n|0,s+=(i&a|n&~a)+t[1]-165796510|0,s=(s<<5|s>>>27)+i|0,a+=(s&n|i&~n)+t[6]-1069501632|0,a=(a<<9|a>>>23)+s|0,n+=(a&i|s&~i)+t[11]+643717713|0,n=(n<<14|n>>>18)+a|0,i+=(n&s|a&~s)+t[0]-373897302|0,i=(i<<20|i>>>12)+n|0,s+=(i&a|n&~a)+t[5]-701558691|0,s=(s<<5|s>>>27)+i|0,a+=(s&n|i&~n)+t[10]+38016083|0,a=(a<<9|a>>>23)+s|0,n+=(a&i|s&~i)+t[15]-660478335|0,n=(n<<14|n>>>18)+a|0,i+=(n&s|a&~s)+t[4]-405537848|0,i=(i<<20|i>>>12)+n|0,s+=(i&a|n&~a)+t[9]+568446438|0,s=(s<<5|s>>>27)+i|0,a+=(s&n|i&~n)+t[14]-1019803690|0,a=(a<<9|a>>>23)+s|0,n+=(a&i|s&~i)+t[3]-187363961|0,n=(n<<14|n>>>18)+a|0,i+=(n&s|a&~s)+t[8]+1163531501|0,i=(i<<20|i>>>12)+n|0,s+=(i&a|n&~a)+t[13]-1444681467|0,s=(s<<5|s>>>27)+i|0,a+=(s&n|i&~n)+t[2]-51403784|0,a=(a<<9|a>>>23)+s|0,n+=(a&i|s&~i)+t[7]+1735328473|0,n=(n<<14|n>>>18)+a|0,i+=(n&s|a&~s)+t[12]-1926607734|0,i=(i<<20|i>>>12)+n|0,s+=(i^n^a)+t[5]-378558|0,s=(s<<4|s>>>28)+i|0,a+=(s^i^n)+t[8]-2022574463|0,a=(a<<11|a>>>21)+s|0,n+=(a^s^i)+t[11]+1839030562|0,n=(n<<16|n>>>16)+a|0,i+=(n^a^s)+t[14]-35309556|0,i=(i<<23|i>>>9)+n|0,s+=(i^n^a)+t[1]-1530992060|0,s=(s<<4|s>>>28)+i|0,a+=(s^i^n)+t[4]+1272893353|0,a=(a<<11|a>>>21)+s|0,n+=(a^s^i)+t[7]-155497632|0,n=(n<<16|n>>>16)+a|0,i+=(n^a^s)+t[10]-1094730640|0,i=(i<<23|i>>>9)+n|0,s+=(i^n^a)+t[13]+681279174|0,s=(s<<4|s>>>28)+i|0,a+=(s^i^n)+t[0]-358537222|0,a=(a<<11|a>>>21)+s|0,n+=(a^s^i)+t[3]-722521979|0,n=(n<<16|n>>>16)+a|0,i+=(n^a^s)+t[6]+76029189|0,i=(i<<23|i>>>9)+n|0,s+=(i^n^a)+t[9]-640364487|0,s=(s<<4|s>>>28)+i|0,a+=(s^i^n)+t[12]-421815835|0,a=(a<<11|a>>>21)+s|0,n+=(a^s^i)+t[15]+530742520|0,n=(n<<16|n>>>16)+a|0,i+=(n^a^s)+t[2]-995338651|0,i=(i<<23|i>>>9)+n|0,s+=(n^(i|~a))+t[0]-198630844|0,s=(s<<6|s>>>26)+i|0,a+=(i^(s|~n))+t[7]+1126891415|0,a=(a<<10|a>>>22)+s|0,n+=(s^(a|~i))+t[14]-1416354905|0,n=(n<<15|n>>>17)+a|0,i+=(a^(n|~s))+t[5]-57434055|0,i=(i<<21|i>>>11)+n|0,s+=(n^(i|~a))+t[12]+1700485571|0,s=(s<<6|s>>>26)+i|0,a+=(i^(s|~n))+t[3]-1894986606|0,a=(a<<10|a>>>22)+s|0,n+=(s^(a|~i))+t[10]-1051523|0,n=(n<<15|n>>>17)+a|0,i+=(a^(n|~s))+t[1]-2054922799|0,i=(i<<21|i>>>11)+n|0,s+=(n^(i|~a))+t[8]+1873313359|0,s=(s<<6|s>>>26)+i|0,a+=(i^(s|~n))+t[15]-30611744|0,a=(a<<10|a>>>22)+s|0,n+=(s^(a|~i))+t[6]-1560198380|0,n=(n<<15|n>>>17)+a|0,i+=(a^(n|~s))+t[13]+1309151649|0,i=(i<<21|i>>>11)+n|0,s+=(n^(i|~a))+t[4]-145523070|0,s=(s<<6|s>>>26)+i|0,a+=(i^(s|~n))+t[11]-1120210379|0,a=(a<<10|a>>>22)+s|0,n+=(s^(a|~i))+t[2]+718787259|0,n=(n<<15|n>>>17)+a|0,i+=(a^(n|~s))+t[9]-343485551|0,i=(i<<21|i>>>11)+n|0,e[0]=s+e[0]|0,e[1]=i+e[1]|0,e[2]=n+e[2]|0,e[3]=a+e[3]|0}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(Fe.stateIdentity),this}appendStr(e){const t=this._buffer8,s=this._buffer32;let i=this._bufferLength,n,a;for(a=0;a<e.length;a+=1){if(n=e.charCodeAt(a),n<128)t[i++]=n;else if(n<2048)t[i++]=(n>>>6)+192,t[i++]=n&63|128;else if(n<55296||n>56319)t[i++]=(n>>>12)+224,t[i++]=n>>>6&63|128,t[i++]=n&63|128;else{if(n=(n-55296)*1024+(e.charCodeAt(++a)-56320)+65536,n>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");t[i++]=(n>>>18)+240,t[i++]=n>>>12&63|128,t[i++]=n>>>6&63|128,t[i++]=n&63|128}i>=64&&(this._dataLength+=64,Fe._md5cycle(this._state,s),i-=64,s[0]=s[16])}return this._bufferLength=i,this}appendAsciiStr(e){const t=this._buffer8,s=this._buffer32;let i=this._bufferLength,n,a=0;for(;;){for(n=Math.min(e.length-a,64-i);n--;)t[i++]=e.charCodeAt(a++);if(i<64)break;this._dataLength+=64,Fe._md5cycle(this._state,s),i=0}return this._bufferLength=i,this}appendByteArray(e){const t=this._buffer8,s=this._buffer32;let i=this._bufferLength,n,a=0;for(;;){for(n=Math.min(e.length-a,64-i);n--;)t[i++]=e[a++];if(i<64)break;this._dataLength+=64,Fe._md5cycle(this._state,s),i=0}return this._bufferLength=i,this}getState(){const e=this,t=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[t[0],t[1],t[2],t[3]]}}setState(e){const t=e.buffer,s=e.state,i=this._state;let n;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],n=0;n<t.length;n+=1)this._buffer8[n]=t.charCodeAt(n)}end(e=!1){const t=this._bufferLength,s=this._buffer8,i=this._buffer32,n=(t>>2)+1;let a;if(this._dataLength+=t,s[t]=128,s[t+1]=s[t+2]=s[t+3]=0,i.set(Fe.buffer32Identity.subarray(n),n),t>55&&(Fe._md5cycle(this._state,i),i.set(Fe.buffer32Identity)),a=this._dataLength*8,a<=4294967295)i[14]=a;else{const o=a.toString(16).match(/(.*?)(.{0,8})$/);if(o===null)return;const d=parseInt(o[2],16),c=parseInt(o[1],16)||0;i[14]=d,i[15]=c}return Fe._md5cycle(this._state,i),e?this._state:Fe._hex(this._state)}}Fe.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),Fe.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Fe.hexChars="0123456789abcdef",Fe.hexOut=[],Fe.onePassHasher=new Fe,Fe.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592"&&console.error("Md5 self test failed.");function Kt(r){return Fe.hashStr(r)}class X0{constructor(e,t,s,i){this.logger=e.getLogger("sipjs.digestauthentication"),this.username=s,this.password=i,this.ha1=t,this.nc=0,this.ncHex="00000000"}authenticate(e,t,s){if(this.algorithm=t.algorithm,this.realm=t.realm,this.nonce=t.nonce,this.opaque=t.opaque,this.stale=t.stale,this.algorithm){if(this.algorithm!=="MD5")return this.logger.warn("challenge with Digest algorithm different than 'MD5', authentication aborted"),!1}else this.algorithm="MD5";if(!this.realm)return this.logger.warn("challenge without Digest realm, authentication aborted"),!1;if(!this.nonce)return this.logger.warn("challenge without Digest nonce, authentication aborted"),!1;if(t.qop)if(t.qop.indexOf("auth")>-1)this.qop="auth";else if(t.qop.indexOf("auth-int")>-1)this.qop="auth-int";else return this.logger.warn("challenge without Digest qop different than 'auth' or 'auth-int', authentication aborted"),!1;else this.qop=void 0;return this.method=e.method,this.uri=e.ruri,this.cnonce=or(12),this.nc+=1,this.updateNcHex(),this.nc===4294967296&&(this.nc=1,this.ncHex="00000001"),this.calculateResponse(s),!0}toString(){const e=[];if(!this.response)throw new Error("response field does not exist, cannot generate Authorization header");return e.push("algorithm="+this.algorithm),e.push('username="'+this.username+'"'),e.push('realm="'+this.realm+'"'),e.push('nonce="'+this.nonce+'"'),e.push('uri="'+this.uri+'"'),e.push('response="'+this.response+'"'),this.opaque&&e.push('opaque="'+this.opaque+'"'),this.qop&&(e.push("qop="+this.qop),e.push('cnonce="'+this.cnonce+'"'),e.push("nc="+this.ncHex)),"Digest "+e.join(", ")}updateNcHex(){const e=Number(this.nc).toString(16);this.ncHex="00000000".substr(0,8-e.length)+e}calculateResponse(e){let t,s;t=this.ha1,(t===""||t===void 0)&&(t=Kt(this.username+":"+this.realm+":"+this.password)),this.qop==="auth"?(s=Kt(this.method+":"+this.uri),this.response=Kt(t+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth:"+s)):this.qop==="auth-int"?(s=Kt(this.method+":"+this.uri+":"+Kt(e||"")),this.response=Kt(t+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth-int:"+s)):this.qop===void 0&&(s=Kt(this.method+":"+this.uri),this.response=Kt(t+":"+this.nonce+":"+s))}}var Oe;(function(r){r[r.error=0]="error",r[r.warn=1]="warn",r[r.log=2]="log",r[r.debug=3]="debug"})(Oe=Oe||(Oe={}));class Fa{constructor(e,t,s){this.logger=e,this.category=t,this.label=s}error(e){this.genericLog(Oe.error,e)}warn(e){this.genericLog(Oe.warn,e)}log(e){this.genericLog(Oe.log,e)}debug(e){this.genericLog(Oe.debug,e)}genericLog(e,t){this.logger.genericLog(e,this.category,this.label,t)}get level(){return this.logger.level}set level(e){this.logger.level=e}}class J0{constructor(){this.builtinEnabled=!0,this._level=Oe.log,this.loggers={},this.logger=this.getLogger("sip:loggerfactory")}get level(){return this._level}set level(e){e>=0&&e<=3?this._level=e:e>3?this._level=3:Oe.hasOwnProperty(e)?this._level=e:this.logger.error("invalid 'level' parameter value: "+JSON.stringify(e))}get connector(){return this._connector}set connector(e){e?typeof e=="function"?this._connector=e:this.logger.error("invalid 'connector' parameter value: "+JSON.stringify(e)):this._connector=void 0}getLogger(e,t){if(t&&this.level===3)return new Fa(this,e,t);if(this.loggers[e])return this.loggers[e];{const s=new Fa(this,e);return this.loggers[e]=s,s}}genericLog(e,t,s,i){this.level>=e&&this.builtinEnabled&&this.print(e,t,s,i),this.connector&&this.connector(Oe[e],t,s,i)}print(e,t,s,i){if(typeof i=="string"){const n=[new Date,t];s&&n.push(s),i=n.concat(i).join(" | ")}switch(e){case Oe.error:console.error(i);break;case Oe.warn:console.warn(i);break;case Oe.log:console.log(i);break;case Oe.debug:console.debug(i);break}}}var hs;(function(r){function e(i,n){let a=n,o=0,d=0;if(i.substring(a,a+2).match(/(^\r\n)/))return-2;for(;o===0;){if(d=i.indexOf(`\r
184
179
  `,a),d===-1)return d;!i.substring(d+2,d+4).match(/(^\r\n)/)&&i.charAt(d+2).match(/(^\s+)/)?a=d+2:o=d}return o}r.getHeader=e;function t(i,n,a,o){const d=n.indexOf(":",a),c=n.substring(a,d).trim(),l=n.substring(d+1,o).trim();let g;switch(c.toLowerCase()){case"via":case"v":i.addHeader("via",l),i.getHeaders("via").length===1?(g=i.parseHeader("Via"),g&&(i.via=g,i.viaBranch=g.branch)):g=0;break;case"from":case"f":i.setHeader("from",l),g=i.parseHeader("from"),g&&(i.from=g,i.fromTag=g.getParam("tag"));break;case"to":case"t":i.setHeader("to",l),g=i.parseHeader("to"),g&&(i.to=g,i.toTag=g.getParam("tag"));break;case"record-route":if(g=Ie.parse(l,"Record_Route"),g===-1){g=void 0;break}if(!(g instanceof Array)){g=void 0;break}g.forEach(u=>{i.addHeader("record-route",l.substring(u.position,u.offset)),i.headers["Record-Route"][i.getHeaders("record-route").length-1].parsed=u.parsed});break;case"call-id":case"i":i.setHeader("call-id",l),g=i.parseHeader("call-id"),g&&(i.callId=l);break;case"contact":case"m":if(g=Ie.parse(l,"Contact"),g===-1){g=void 0;break}if(!(g instanceof Array)){g=void 0;break}g.forEach(u=>{i.addHeader("contact",l.substring(u.position,u.offset)),i.headers.Contact[i.getHeaders("contact").length-1].parsed=u.parsed});break;case"content-length":case"l":i.setHeader("content-length",l),g=i.parseHeader("content-length");break;case"content-type":case"c":i.setHeader("content-type",l),g=i.parseHeader("content-type");break;case"cseq":i.setHeader("cseq",l),g=i.parseHeader("cseq"),g&&(i.cseq=g.value),i instanceof Gt&&(i.method=g.method);break;case"max-forwards":i.setHeader("max-forwards",l),g=i.parseHeader("max-forwards");break;case"www-authenticate":i.setHeader("www-authenticate",l),g=i.parseHeader("www-authenticate");break;case"proxy-authenticate":i.setHeader("proxy-authenticate",l),g=i.parseHeader("proxy-authenticate");break;case"refer-to":case"r":i.setHeader("refer-to",l),g=i.parseHeader("refer-to"),g&&(i.referTo=g);break;default:i.addHeader(c.toLowerCase(),l),g=0}return g===void 0?{error:"error parsing header '"+c+"'"}:!0}r.parseHeader=t;function s(i,n){let a=0,o=i.indexOf(`\r
185
- `);if(o===-1){n.warn("no CRLF found, not a SIP message, discarded");return}const d=i.substring(0,o),c=Ie.parse(d,"Request_Response");let l;if(c===-1){n.warn('error parsing first line of SIP message: "'+d+'"');return}else c.status_code?(l=new Gt,l.statusCode=c.status_code,l.reasonPhrase=c.reason_phrase):(l=new yr,l.method=c.method,l.ruri=c.uri);l.data=i,a=o+2;let g;for(;;){if(o=e(i,a),o===-2){g=a+2;break}else if(o===-1){n.error("malformed message");return}const u=t(l,i,a,o);if(u&&u!==!0){n.error(u.error);return}a=o+2}return l.hasHeader("content-length")?l.body=i.substr(g,Number(l.getHeader("content-length"))):l.body=i.substring(g),l}r.parseMessage=s})(hs=hs||(hs={}));function $a(r,e){const t=`\r
186
- `;if(e.statusCode<100||e.statusCode>699)throw new TypeError("Invalid statusCode: "+e.statusCode);const s=e.reasonPhrase?e.reasonPhrase:cs(e.statusCode);let i="SIP/2.0 "+e.statusCode+" "+s+t;e.statusCode>=100&&e.statusCode<200,e.statusCode;const n="From: "+r.getHeader("From")+t,a="Call-ID: "+r.callId+t,o="CSeq: "+r.cseq+" "+r.method+t,d=r.getHeaders("via").reduce((y,w)=>y+"Via: "+w+t,"");let c="To: "+r.getHeader("to");if(e.statusCode>100&&!r.parseHeader("to").hasParam("tag")){let y=e.toTag;y||(y=ls()),c+=";tag="+y}c+=t;let l="";e.supported&&(l="Supported: "+e.supported.join(", ")+t);let g="";e.userAgent&&(g="User-Agent: "+e.userAgent+t);let u="";return e.extraHeaders&&(u=e.extraHeaders.reduce((y,w)=>y+w.trim()+t,"")),i+=d,i+=n,i+=c,i+=o,i+=a,i+=l,i+=g,i+=u,e.body?(i+="Content-Type: "+e.body.contentType+t,i+="Content-Length: "+jr(e.body.content)+t+t,i+=e.body.content):i+="Content-Length: 0"+t+t,{message:i}}class qi extends ar{constructor(e){super(e||"Unspecified transport error.")}}class Oa{constructor(e,t,s,i,n){this._transport=e,this._user=t,this._id=s,this._state=i,this.listeners=new Array,this.logger=t.loggerFactory.getLogger(n,s),this.logger.debug(`Constructing ${this.typeToString()} with id ${this.id}.`)}dispose(){this.logger.debug(`Destroyed ${this.typeToString()} with id ${this.id}.`)}get id(){return this._id}get kind(){throw new Error("Invalid kind.")}get state(){return this._state}get transport(){return this._transport}addStateChangeListener(e,t){const s=()=>{this.removeStateChangeListener(s),e()};(t==null?void 0:t.once)===!0?this.listeners.push(s):this.listeners.push(e)}notifyStateChangeListeners(){this.listeners.slice().forEach(e=>e())}removeStateChangeListener(e){this.listeners=this.listeners.filter(t=>t!==e)}logTransportError(e,t){this.logger.error(e.message),this.logger.error(`Transport error occurred in ${this.typeToString()} with id ${this.id}.`),this.logger.error(t)}send(e){return this.transport.send(e).catch(t=>{if(t instanceof qi)throw this.onTransportError(t),t;let s;throw t&&typeof t.message=="string"?s=new qi(t.message):s=new qi,this.onTransportError(s),s})}setState(e){this.logger.debug(`State change to "${e}" on ${this.typeToString()} with id ${this.id}.`),this._state=e,this._user.onStateChange&&this._user.onStateChange(e),this.notifyStateChangeListeners()}typeToString(){return"UnknownType"}}class Na extends Oa{constructor(e,t,s,i,n){super(t,s,e.viaBranch,i,n),this._request=e,this.user=s}get request(){return this._request}}var k;(function(r){r.Accepted="Accepted",r.Calling="Calling",r.Completed="Completed",r.Confirmed="Confirmed",r.Proceeding="Proceeding",r.Terminated="Terminated",r.Trying="Trying"})(k=k||(k={}));class Ke extends Na{constructor(e,t,s){super(e,t,s,k.Proceeding,"sip.transaction.ist")}dispose(){this.stopProgressExtensionTimer(),this.H&&(clearTimeout(this.H),this.H=void 0),this.I&&(clearTimeout(this.I),this.I=void 0),this.L&&(clearTimeout(this.L),this.L=void 0),super.dispose()}get kind(){return"ist"}receiveRequest(e){switch(this.state){case k.Proceeding:if(e.method===G.INVITE){this.lastProvisionalResponse&&this.send(this.lastProvisionalResponse).catch(s=>{this.logTransportError(s,"Failed to send retransmission of provisional response.")});return}break;case k.Accepted:if(e.method===G.INVITE)return;break;case k.Completed:if(e.method===G.INVITE){if(!this.lastFinalResponse)throw new Error("Last final response undefined.");this.send(this.lastFinalResponse).catch(s=>{this.logTransportError(s,"Failed to send retransmission of final response.")});return}if(e.method===G.ACK){this.stateTransition(k.Confirmed);return}break;case k.Confirmed:if(e.method===G.INVITE||e.method===G.ACK)return;break;case k.Terminated:if(e.method===G.INVITE||e.method===G.ACK)return;break;default:throw new Error(`Invalid state ${this.state}`)}const t=`INVITE server transaction received unexpected ${e.method} request while in state ${this.state}.`;this.logger.warn(t)}receiveResponse(e,t){if(e<100||e>699)throw new Error(`Invalid status code ${e}`);switch(this.state){case k.Proceeding:if(e>=100&&e<=199){this.lastProvisionalResponse=t,e>100&&this.startProgressExtensionTimer(),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send 1xx response.")});return}if(e>=200&&e<=299){this.lastFinalResponse=t,this.stateTransition(k.Accepted),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send 2xx response.")});return}if(e>=300&&e<=699){this.lastFinalResponse=t,this.stateTransition(k.Completed),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send non-2xx final response.")});return}break;case k.Accepted:if(e>=200&&e<=299){this.send(t).catch(i=>{this.logTransportError(i,"Failed to send 2xx response.")});return}break;case k.Completed:break;case k.Confirmed:break;case k.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}const s=`INVITE server transaction received unexpected ${e} response from TU while in state ${this.state}.`;throw this.logger.error(s),new Error(s)}retransmitAcceptedResponse(){this.state===k.Accepted&&this.lastFinalResponse&&this.send(this.lastFinalResponse).catch(e=>{this.logTransportError(e,"Failed to send 2xx response.")})}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e)}typeToString(){return"INVITE server transaction"}stateTransition(e){const t=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case k.Proceeding:t();break;case k.Accepted:case k.Completed:this.state!==k.Proceeding&&t();break;case k.Confirmed:this.state!==k.Completed&&t();break;case k.Terminated:this.state!==k.Accepted&&this.state!==k.Completed&&this.state!==k.Confirmed&&t();break;default:t()}this.stopProgressExtensionTimer(),e===k.Accepted&&(this.L=setTimeout(()=>this.timerL(),$e.TIMER_L)),e===k.Completed&&(this.H=setTimeout(()=>this.timerH(),$e.TIMER_H)),e===k.Confirmed&&(this.I=setTimeout(()=>this.timerI(),$e.TIMER_I)),e===k.Terminated&&this.dispose(),this.setState(e)}startProgressExtensionTimer(){this.progressExtensionTimer===void 0&&(this.progressExtensionTimer=setInterval(()=>{if(this.logger.debug(`Progress extension timer expired for INVITE server transaction ${this.id}.`),!this.lastProvisionalResponse)throw new Error("Last provisional response undefined.");this.send(this.lastProvisionalResponse).catch(e=>{this.logTransportError(e,"Failed to send retransmission of provisional response.")})},$e.PROVISIONAL_RESPONSE_INTERVAL))}stopProgressExtensionTimer(){this.progressExtensionTimer!==void 0&&(clearInterval(this.progressExtensionTimer),this.progressExtensionTimer=void 0)}timerG(){}timerH(){this.logger.debug(`Timer H expired for INVITE server transaction ${this.id}.`),this.state===k.Completed&&(this.logger.warn("ACK to negative final response was never received, terminating transaction."),this.stateTransition(k.Terminated))}timerI(){this.logger.debug(`Timer I expired for INVITE server transaction ${this.id}.`),this.stateTransition(k.Terminated)}timerL(){this.logger.debug(`Timer L expired for INVITE server transaction ${this.id}.`),this.state===k.Accepted&&this.stateTransition(k.Terminated)}}class us extends Oa{constructor(e,t,s,i,n){super(t,s,us.makeId(e),i,n),this._request=e,this.user=s,e.setViaHeader(this.id,t.protocol)}static makeId(e){if(e.method==="CANCEL"){if(!e.branch)throw new Error("Outgoing CANCEL request without a branch.");return e.branch}else return"z9hG4bK"+Math.floor(Math.random()*1e7)}get request(){return this._request}onRequestTimeout(){this.user.onRequestTimeout&&this.user.onRequestTimeout()}}class Qe extends us{constructor(e,t,s){super(e,t,s,k.Trying,"sip.transaction.nict"),this.F=setTimeout(()=>this.timerF(),$e.TIMER_F),this.send(e.toString()).catch(i=>{this.logTransportError(i,"Failed to send initial outgoing request.")})}dispose(){this.F&&(clearTimeout(this.F),this.F=void 0),this.K&&(clearTimeout(this.K),this.K=void 0),super.dispose()}get kind(){return"nict"}receiveResponse(e){const t=e.statusCode;if(!t||t<100||t>699)throw new Error(`Invalid status code ${t}`);switch(this.state){case k.Trying:if(t>=100&&t<=199){this.stateTransition(k.Proceeding),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=200&&t<=699){if(this.stateTransition(k.Completed),t===408){this.onRequestTimeout();return}this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case k.Proceeding:if(t>=100&&t<=199&&this.user.receiveResponse)return this.user.receiveResponse(e);if(t>=200&&t<=699){if(this.stateTransition(k.Completed),t===408){this.onRequestTimeout();return}this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case k.Completed:return;case k.Terminated:return;default:throw new Error(`Invalid state ${this.state}`)}const s=`Non-INVITE client transaction received unexpected ${t} response while in state ${this.state}.`;this.logger.warn(s)}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(k.Terminated,!0)}typeToString(){return"non-INVITE client transaction"}stateTransition(e,t=!1){const s=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case k.Trying:s();break;case k.Proceeding:this.state!==k.Trying&&s();break;case k.Completed:this.state!==k.Trying&&this.state!==k.Proceeding&&s();break;case k.Terminated:this.state!==k.Trying&&this.state!==k.Proceeding&&this.state!==k.Completed&&(t||s());break;default:s()}e===k.Completed&&(this.F&&(clearTimeout(this.F),this.F=void 0),this.K=setTimeout(()=>this.timerK(),$e.TIMER_K)),e===k.Terminated&&this.dispose(),this.setState(e)}timerF(){this.logger.debug(`Timer F expired for non-INVITE client transaction ${this.id}.`),(this.state===k.Trying||this.state===k.Proceeding)&&(this.onRequestTimeout(),this.stateTransition(k.Terminated))}timerK(){this.state===k.Completed&&this.stateTransition(k.Terminated)}}class wr{constructor(e,t){this.core=e,this.dialogState=t,this.core.dialogs.set(this.id,this)}static initialDialogStateForUserAgentClient(e,t){const i=t.getHeaders("record-route").reverse(),n=t.parseHeader("contact");if(!n)throw new Error("Contact undefined.");if(!(n instanceof ze))throw new Error("Contact not instance of NameAddrHeader.");const a=n.uri,o=e.cseq,d=void 0,c=e.callId,l=e.fromTag,g=t.toTag;if(!c)throw new Error("Call id undefined.");if(!l)throw new Error("From tag undefined.");if(!g)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");const u=e.from.uri,y=e.to.uri;if(!t.statusCode)throw new Error("Incoming response status code undefined.");const w=t.statusCode<200;return{id:c+l+g,early:w,callId:c,localTag:l,remoteTag:g,localSequenceNumber:o,remoteSequenceNumber:d,localURI:u,remoteURI:y,remoteTarget:a,routeSet:i,secure:!1}}static initialDialogStateForUserAgentServer(e,t,s=!1){const n=e.getHeaders("record-route"),a=e.parseHeader("contact");if(!a)throw new Error("Contact undefined.");if(!(a instanceof ze))throw new Error("Contact not instance of NameAddrHeader.");const o=a.uri,d=e.cseq,c=void 0,l=e.callId,g=t,u=e.fromTag,y=e.from.uri,w=e.to.uri;return{id:l+g+u,early:s,callId:l,localTag:g,remoteTag:u,localSequenceNumber:c,remoteSequenceNumber:d,localURI:w,remoteURI:y,remoteTarget:o,routeSet:n,secure:!1}}dispose(){this.core.dialogs.delete(this.id)}get id(){return this.dialogState.id}get early(){return this.dialogState.early}get callId(){return this.dialogState.callId}get localTag(){return this.dialogState.localTag}get remoteTag(){return this.dialogState.remoteTag}get localSequenceNumber(){return this.dialogState.localSequenceNumber}get remoteSequenceNumber(){return this.dialogState.remoteSequenceNumber}get localURI(){return this.dialogState.localURI}get remoteURI(){return this.dialogState.remoteURI}get remoteTarget(){return this.dialogState.remoteTarget}get routeSet(){return this.dialogState.routeSet}get secure(){return this.dialogState.secure}get userAgentCore(){return this.core}confirm(){this.dialogState.early=!1}receiveRequest(e){if(e.method!==G.ACK){if(this.remoteSequenceNumber){if(e.cseq<=this.remoteSequenceNumber)throw new Error("Out of sequence in dialog request. Did you forget to call sequenceGuard()?");this.dialogState.remoteSequenceNumber=e.cseq}this.remoteSequenceNumber||(this.dialogState.remoteSequenceNumber=e.cseq)}}recomputeRouteSet(e){this.dialogState.routeSet=e.getHeaders("record-route").reverse()}createOutgoingRequestMessage(e,t){const s=this.remoteURI,i=this.remoteTag,n=this.localURI,a=this.localTag,o=this.callId;let d;t&&t.cseq?d=t.cseq:this.dialogState.localSequenceNumber?d=this.dialogState.localSequenceNumber+=1:d=this.dialogState.localSequenceNumber=1;const c=this.remoteTarget,l=this.routeSet,g=t&&t.extraHeaders,u=t&&t.body;return this.userAgentCore.makeOutgoingRequestMessage(e,c,n,s,{callId:o,cseq:d,fromTag:a,toTag:i,routeSet:l},g,u)}incrementLocalSequenceNumber(){if(!this.dialogState.localSequenceNumber)throw new Error("Local sequence number undefined.");this.dialogState.localSequenceNumber+=1}sequenceGuard(e){return e.method===G.ACK?!0:this.remoteSequenceNumber&&e.cseq<=this.remoteSequenceNumber?(this.core.replyStateless(e,{statusCode:500}),!1):!0}}class Zt extends us{constructor(e,t,s){super(e,t,s,k.Calling,"sip.transaction.ict"),this.ackRetransmissionCache=new Map,this.B=setTimeout(()=>this.timerB(),$e.TIMER_B),this.send(e.toString()).catch(i=>{this.logTransportError(i,"Failed to send initial outgoing request.")})}dispose(){this.B&&(clearTimeout(this.B),this.B=void 0),this.D&&(clearTimeout(this.D),this.D=void 0),this.M&&(clearTimeout(this.M),this.M=void 0),super.dispose()}get kind(){return"ict"}ackResponse(e){const t=e.toTag;if(!t)throw new Error("To tag undefined.");const s="z9hG4bK"+Math.floor(Math.random()*1e7);e.setViaHeader(s,this.transport.protocol),this.ackRetransmissionCache.set(t,e),this.send(e.toString()).catch(i=>{this.logTransportError(i,"Failed to send ACK to 2xx response.")})}receiveResponse(e){const t=e.statusCode;if(!t||t<100||t>699)throw new Error(`Invalid status code ${t}`);switch(this.state){case k.Calling:if(t>=100&&t<=199){this.stateTransition(k.Proceeding),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=200&&t<=299){this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition(k.Accepted),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=300&&t<=699){this.stateTransition(k.Completed),this.ack(e),this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case k.Proceeding:if(t>=100&&t<=199){this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=200&&t<=299){this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition(k.Accepted),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=300&&t<=699){this.stateTransition(k.Completed),this.ack(e),this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case k.Accepted:if(t>=200&&t<=299){if(!this.ackRetransmissionCache.has(e.toTag)){this.ackRetransmissionCache.set(e.toTag,void 0),this.user.receiveResponse&&this.user.receiveResponse(e);return}const i=this.ackRetransmissionCache.get(e.toTag);if(i){this.send(i.toString()).catch(n=>{this.logTransportError(n,"Failed to send retransmission of ACK to 2xx response.")});return}return}break;case k.Completed:if(t>=300&&t<=699){this.ack(e);return}break;case k.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}const s=`Received unexpected ${t} response while in state ${this.state}.`;this.logger.warn(s)}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(k.Terminated,!0)}typeToString(){return"INVITE client transaction"}ack(e){const t=this.request.ruri,s=this.request.callId,i=this.request.cseq,n=this.request.getHeader("from"),a=e.getHeader("to"),o=this.request.getHeader("via"),d=this.request.getHeader("route");if(!n)throw new Error("From undefined.");if(!a)throw new Error("To undefined.");if(!o)throw new Error("Via undefined.");let c=`ACK ${t} SIP/2.0\r
180
+ `);if(o===-1){n.warn("no CRLF found, not a SIP message, discarded");return}const d=i.substring(0,o),c=Ie.parse(d,"Request_Response");let l;if(c===-1){n.warn('error parsing first line of SIP message: "'+d+'"');return}else c.status_code?(l=new Gt,l.statusCode=c.status_code,l.reasonPhrase=c.reason_phrase):(l=new yr,l.method=c.method,l.ruri=c.uri);l.data=i,a=o+2;let g;for(;;){if(o=e(i,a),o===-2){g=a+2;break}else if(o===-1){n.error("malformed message");return}const u=t(l,i,a,o);if(u&&u!==!0){n.error(u.error);return}a=o+2}return l.hasHeader("content-length")?l.body=i.substr(g,Number(l.getHeader("content-length"))):l.body=i.substring(g),l}r.parseMessage=s})(hs=hs||(hs={}));function ka(r,e){const t=`\r
181
+ `;if(e.statusCode<100||e.statusCode>699)throw new TypeError("Invalid statusCode: "+e.statusCode);const s=e.reasonPhrase?e.reasonPhrase:cs(e.statusCode);let i="SIP/2.0 "+e.statusCode+" "+s+t;e.statusCode>=100&&e.statusCode<200,e.statusCode;const n="From: "+r.getHeader("From")+t,a="Call-ID: "+r.callId+t,o="CSeq: "+r.cseq+" "+r.method+t,d=r.getHeaders("via").reduce((y,w)=>y+"Via: "+w+t,"");let c="To: "+r.getHeader("to");if(e.statusCode>100&&!r.parseHeader("to").hasParam("tag")){let y=e.toTag;y||(y=ls()),c+=";tag="+y}c+=t;let l="";e.supported&&(l="Supported: "+e.supported.join(", ")+t);let g="";e.userAgent&&(g="User-Agent: "+e.userAgent+t);let u="";return e.extraHeaders&&(u=e.extraHeaders.reduce((y,w)=>y+w.trim()+t,"")),i+=d,i+=n,i+=c,i+=o,i+=a,i+=l,i+=g,i+=u,e.body?(i+="Content-Type: "+e.body.contentType+t,i+="Content-Length: "+qr(e.body.content)+t+t,i+=e.body.content):i+="Content-Length: 0"+t+t,{message:i}}class qi extends ar{constructor(e){super(e||"Unspecified transport error.")}}class Ba{constructor(e,t,s,i,n){this._transport=e,this._user=t,this._id=s,this._state=i,this.listeners=new Array,this.logger=t.loggerFactory.getLogger(n,s),this.logger.debug(`Constructing ${this.typeToString()} with id ${this.id}.`)}dispose(){this.logger.debug(`Destroyed ${this.typeToString()} with id ${this.id}.`)}get id(){return this._id}get kind(){throw new Error("Invalid kind.")}get state(){return this._state}get transport(){return this._transport}addStateChangeListener(e,t){const s=()=>{this.removeStateChangeListener(s),e()};(t==null?void 0:t.once)===!0?this.listeners.push(s):this.listeners.push(e)}notifyStateChangeListeners(){this.listeners.slice().forEach(e=>e())}removeStateChangeListener(e){this.listeners=this.listeners.filter(t=>t!==e)}logTransportError(e,t){this.logger.error(e.message),this.logger.error(`Transport error occurred in ${this.typeToString()} with id ${this.id}.`),this.logger.error(t)}send(e){return this.transport.send(e).catch(t=>{if(t instanceof qi)throw this.onTransportError(t),t;let s;throw t&&typeof t.message=="string"?s=new qi(t.message):s=new qi,this.onTransportError(s),s})}setState(e){this.logger.debug(`State change to "${e}" on ${this.typeToString()} with id ${this.id}.`),this._state=e,this._user.onStateChange&&this._user.onStateChange(e),this.notifyStateChangeListeners()}typeToString(){return"UnknownType"}}class Ia extends Ba{constructor(e,t,s,i,n){super(t,s,e.viaBranch,i,n),this._request=e,this.user=s}get request(){return this._request}}var k;(function(r){r.Accepted="Accepted",r.Calling="Calling",r.Completed="Completed",r.Confirmed="Confirmed",r.Proceeding="Proceeding",r.Terminated="Terminated",r.Trying="Trying"})(k=k||(k={}));class Ke extends Ia{constructor(e,t,s){super(e,t,s,k.Proceeding,"sip.transaction.ist")}dispose(){this.stopProgressExtensionTimer(),this.H&&(clearTimeout(this.H),this.H=void 0),this.I&&(clearTimeout(this.I),this.I=void 0),this.L&&(clearTimeout(this.L),this.L=void 0),super.dispose()}get kind(){return"ist"}receiveRequest(e){switch(this.state){case k.Proceeding:if(e.method===G.INVITE){this.lastProvisionalResponse&&this.send(this.lastProvisionalResponse).catch(s=>{this.logTransportError(s,"Failed to send retransmission of provisional response.")});return}break;case k.Accepted:if(e.method===G.INVITE)return;break;case k.Completed:if(e.method===G.INVITE){if(!this.lastFinalResponse)throw new Error("Last final response undefined.");this.send(this.lastFinalResponse).catch(s=>{this.logTransportError(s,"Failed to send retransmission of final response.")});return}if(e.method===G.ACK){this.stateTransition(k.Confirmed);return}break;case k.Confirmed:if(e.method===G.INVITE||e.method===G.ACK)return;break;case k.Terminated:if(e.method===G.INVITE||e.method===G.ACK)return;break;default:throw new Error(`Invalid state ${this.state}`)}const t=`INVITE server transaction received unexpected ${e.method} request while in state ${this.state}.`;this.logger.warn(t)}receiveResponse(e,t){if(e<100||e>699)throw new Error(`Invalid status code ${e}`);switch(this.state){case k.Proceeding:if(e>=100&&e<=199){this.lastProvisionalResponse=t,e>100&&this.startProgressExtensionTimer(),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send 1xx response.")});return}if(e>=200&&e<=299){this.lastFinalResponse=t,this.stateTransition(k.Accepted),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send 2xx response.")});return}if(e>=300&&e<=699){this.lastFinalResponse=t,this.stateTransition(k.Completed),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send non-2xx final response.")});return}break;case k.Accepted:if(e>=200&&e<=299){this.send(t).catch(i=>{this.logTransportError(i,"Failed to send 2xx response.")});return}break;case k.Completed:break;case k.Confirmed:break;case k.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}const s=`INVITE server transaction received unexpected ${e} response from TU while in state ${this.state}.`;throw this.logger.error(s),new Error(s)}retransmitAcceptedResponse(){this.state===k.Accepted&&this.lastFinalResponse&&this.send(this.lastFinalResponse).catch(e=>{this.logTransportError(e,"Failed to send 2xx response.")})}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e)}typeToString(){return"INVITE server transaction"}stateTransition(e){const t=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case k.Proceeding:t();break;case k.Accepted:case k.Completed:this.state!==k.Proceeding&&t();break;case k.Confirmed:this.state!==k.Completed&&t();break;case k.Terminated:this.state!==k.Accepted&&this.state!==k.Completed&&this.state!==k.Confirmed&&t();break;default:t()}this.stopProgressExtensionTimer(),e===k.Accepted&&(this.L=setTimeout(()=>this.timerL(),$e.TIMER_L)),e===k.Completed&&(this.H=setTimeout(()=>this.timerH(),$e.TIMER_H)),e===k.Confirmed&&(this.I=setTimeout(()=>this.timerI(),$e.TIMER_I)),e===k.Terminated&&this.dispose(),this.setState(e)}startProgressExtensionTimer(){this.progressExtensionTimer===void 0&&(this.progressExtensionTimer=setInterval(()=>{if(this.logger.debug(`Progress extension timer expired for INVITE server transaction ${this.id}.`),!this.lastProvisionalResponse)throw new Error("Last provisional response undefined.");this.send(this.lastProvisionalResponse).catch(e=>{this.logTransportError(e,"Failed to send retransmission of provisional response.")})},$e.PROVISIONAL_RESPONSE_INTERVAL))}stopProgressExtensionTimer(){this.progressExtensionTimer!==void 0&&(clearInterval(this.progressExtensionTimer),this.progressExtensionTimer=void 0)}timerG(){}timerH(){this.logger.debug(`Timer H expired for INVITE server transaction ${this.id}.`),this.state===k.Completed&&(this.logger.warn("ACK to negative final response was never received, terminating transaction."),this.stateTransition(k.Terminated))}timerI(){this.logger.debug(`Timer I expired for INVITE server transaction ${this.id}.`),this.stateTransition(k.Terminated)}timerL(){this.logger.debug(`Timer L expired for INVITE server transaction ${this.id}.`),this.state===k.Accepted&&this.stateTransition(k.Terminated)}}class us extends Ba{constructor(e,t,s,i,n){super(t,s,us.makeId(e),i,n),this._request=e,this.user=s,e.setViaHeader(this.id,t.protocol)}static makeId(e){if(e.method==="CANCEL"){if(!e.branch)throw new Error("Outgoing CANCEL request without a branch.");return e.branch}else return"z9hG4bK"+Math.floor(Math.random()*1e7)}get request(){return this._request}onRequestTimeout(){this.user.onRequestTimeout&&this.user.onRequestTimeout()}}class Qe extends us{constructor(e,t,s){super(e,t,s,k.Trying,"sip.transaction.nict"),this.F=setTimeout(()=>this.timerF(),$e.TIMER_F),this.send(e.toString()).catch(i=>{this.logTransportError(i,"Failed to send initial outgoing request.")})}dispose(){this.F&&(clearTimeout(this.F),this.F=void 0),this.K&&(clearTimeout(this.K),this.K=void 0),super.dispose()}get kind(){return"nict"}receiveResponse(e){const t=e.statusCode;if(!t||t<100||t>699)throw new Error(`Invalid status code ${t}`);switch(this.state){case k.Trying:if(t>=100&&t<=199){this.stateTransition(k.Proceeding),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=200&&t<=699){if(this.stateTransition(k.Completed),t===408){this.onRequestTimeout();return}this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case k.Proceeding:if(t>=100&&t<=199&&this.user.receiveResponse)return this.user.receiveResponse(e);if(t>=200&&t<=699){if(this.stateTransition(k.Completed),t===408){this.onRequestTimeout();return}this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case k.Completed:return;case k.Terminated:return;default:throw new Error(`Invalid state ${this.state}`)}const s=`Non-INVITE client transaction received unexpected ${t} response while in state ${this.state}.`;this.logger.warn(s)}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(k.Terminated,!0)}typeToString(){return"non-INVITE client transaction"}stateTransition(e,t=!1){const s=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case k.Trying:s();break;case k.Proceeding:this.state!==k.Trying&&s();break;case k.Completed:this.state!==k.Trying&&this.state!==k.Proceeding&&s();break;case k.Terminated:this.state!==k.Trying&&this.state!==k.Proceeding&&this.state!==k.Completed&&(t||s());break;default:s()}e===k.Completed&&(this.F&&(clearTimeout(this.F),this.F=void 0),this.K=setTimeout(()=>this.timerK(),$e.TIMER_K)),e===k.Terminated&&this.dispose(),this.setState(e)}timerF(){this.logger.debug(`Timer F expired for non-INVITE client transaction ${this.id}.`),(this.state===k.Trying||this.state===k.Proceeding)&&(this.onRequestTimeout(),this.stateTransition(k.Terminated))}timerK(){this.state===k.Completed&&this.stateTransition(k.Terminated)}}class wr{constructor(e,t){this.core=e,this.dialogState=t,this.core.dialogs.set(this.id,this)}static initialDialogStateForUserAgentClient(e,t){const i=t.getHeaders("record-route").reverse(),n=t.parseHeader("contact");if(!n)throw new Error("Contact undefined.");if(!(n instanceof ze))throw new Error("Contact not instance of NameAddrHeader.");const a=n.uri,o=e.cseq,d=void 0,c=e.callId,l=e.fromTag,g=t.toTag;if(!c)throw new Error("Call id undefined.");if(!l)throw new Error("From tag undefined.");if(!g)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");const u=e.from.uri,y=e.to.uri;if(!t.statusCode)throw new Error("Incoming response status code undefined.");const w=t.statusCode<200;return{id:c+l+g,early:w,callId:c,localTag:l,remoteTag:g,localSequenceNumber:o,remoteSequenceNumber:d,localURI:u,remoteURI:y,remoteTarget:a,routeSet:i,secure:!1}}static initialDialogStateForUserAgentServer(e,t,s=!1){const n=e.getHeaders("record-route"),a=e.parseHeader("contact");if(!a)throw new Error("Contact undefined.");if(!(a instanceof ze))throw new Error("Contact not instance of NameAddrHeader.");const o=a.uri,d=e.cseq,c=void 0,l=e.callId,g=t,u=e.fromTag,y=e.from.uri,w=e.to.uri;return{id:l+g+u,early:s,callId:l,localTag:g,remoteTag:u,localSequenceNumber:c,remoteSequenceNumber:d,localURI:w,remoteURI:y,remoteTarget:o,routeSet:n,secure:!1}}dispose(){this.core.dialogs.delete(this.id)}get id(){return this.dialogState.id}get early(){return this.dialogState.early}get callId(){return this.dialogState.callId}get localTag(){return this.dialogState.localTag}get remoteTag(){return this.dialogState.remoteTag}get localSequenceNumber(){return this.dialogState.localSequenceNumber}get remoteSequenceNumber(){return this.dialogState.remoteSequenceNumber}get localURI(){return this.dialogState.localURI}get remoteURI(){return this.dialogState.remoteURI}get remoteTarget(){return this.dialogState.remoteTarget}get routeSet(){return this.dialogState.routeSet}get secure(){return this.dialogState.secure}get userAgentCore(){return this.core}confirm(){this.dialogState.early=!1}receiveRequest(e){if(e.method!==G.ACK){if(this.remoteSequenceNumber){if(e.cseq<=this.remoteSequenceNumber)throw new Error("Out of sequence in dialog request. Did you forget to call sequenceGuard()?");this.dialogState.remoteSequenceNumber=e.cseq}this.remoteSequenceNumber||(this.dialogState.remoteSequenceNumber=e.cseq)}}recomputeRouteSet(e){this.dialogState.routeSet=e.getHeaders("record-route").reverse()}createOutgoingRequestMessage(e,t){const s=this.remoteURI,i=this.remoteTag,n=this.localURI,a=this.localTag,o=this.callId;let d;t&&t.cseq?d=t.cseq:this.dialogState.localSequenceNumber?d=this.dialogState.localSequenceNumber+=1:d=this.dialogState.localSequenceNumber=1;const c=this.remoteTarget,l=this.routeSet,g=t&&t.extraHeaders,u=t&&t.body;return this.userAgentCore.makeOutgoingRequestMessage(e,c,n,s,{callId:o,cseq:d,fromTag:a,toTag:i,routeSet:l},g,u)}incrementLocalSequenceNumber(){if(!this.dialogState.localSequenceNumber)throw new Error("Local sequence number undefined.");this.dialogState.localSequenceNumber+=1}sequenceGuard(e){return e.method===G.ACK?!0:this.remoteSequenceNumber&&e.cseq<=this.remoteSequenceNumber?(this.core.replyStateless(e,{statusCode:500}),!1):!0}}class Zt extends us{constructor(e,t,s){super(e,t,s,k.Calling,"sip.transaction.ict"),this.ackRetransmissionCache=new Map,this.B=setTimeout(()=>this.timerB(),$e.TIMER_B),this.send(e.toString()).catch(i=>{this.logTransportError(i,"Failed to send initial outgoing request.")})}dispose(){this.B&&(clearTimeout(this.B),this.B=void 0),this.D&&(clearTimeout(this.D),this.D=void 0),this.M&&(clearTimeout(this.M),this.M=void 0),super.dispose()}get kind(){return"ict"}ackResponse(e){const t=e.toTag;if(!t)throw new Error("To tag undefined.");const s="z9hG4bK"+Math.floor(Math.random()*1e7);e.setViaHeader(s,this.transport.protocol),this.ackRetransmissionCache.set(t,e),this.send(e.toString()).catch(i=>{this.logTransportError(i,"Failed to send ACK to 2xx response.")})}receiveResponse(e){const t=e.statusCode;if(!t||t<100||t>699)throw new Error(`Invalid status code ${t}`);switch(this.state){case k.Calling:if(t>=100&&t<=199){this.stateTransition(k.Proceeding),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=200&&t<=299){this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition(k.Accepted),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=300&&t<=699){this.stateTransition(k.Completed),this.ack(e),this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case k.Proceeding:if(t>=100&&t<=199){this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=200&&t<=299){this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition(k.Accepted),this.user.receiveResponse&&this.user.receiveResponse(e);return}if(t>=300&&t<=699){this.stateTransition(k.Completed),this.ack(e),this.user.receiveResponse&&this.user.receiveResponse(e);return}break;case k.Accepted:if(t>=200&&t<=299){if(!this.ackRetransmissionCache.has(e.toTag)){this.ackRetransmissionCache.set(e.toTag,void 0),this.user.receiveResponse&&this.user.receiveResponse(e);return}const i=this.ackRetransmissionCache.get(e.toTag);if(i){this.send(i.toString()).catch(n=>{this.logTransportError(n,"Failed to send retransmission of ACK to 2xx response.")});return}return}break;case k.Completed:if(t>=300&&t<=699){this.ack(e);return}break;case k.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}const s=`Received unexpected ${t} response while in state ${this.state}.`;this.logger.warn(s)}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(k.Terminated,!0)}typeToString(){return"INVITE client transaction"}ack(e){const t=this.request.ruri,s=this.request.callId,i=this.request.cseq,n=this.request.getHeader("from"),a=e.getHeader("to"),o=this.request.getHeader("via"),d=this.request.getHeader("route");if(!n)throw new Error("From undefined.");if(!a)throw new Error("To undefined.");if(!o)throw new Error("Via undefined.");let c=`ACK ${t} SIP/2.0\r
187
182
  `;d&&(c+=`Route: ${d}\r
188
183
  `),c+=`Via: ${o}\r
189
184
  `,c+=`To: ${a}\r
@@ -193,31 +188,31 @@ React keys must be passed directly to JSX without using spread:
193
188
  `,c+=`Max-Forwards: 70\r
194
189
  `,c+=`Content-Length: 0\r
195
190
  \r
196
- `,this.send(c).catch(l=>{this.logTransportError(l,"Failed to send ACK to non-2xx response.")})}stateTransition(e,t=!1){const s=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case k.Calling:s();break;case k.Proceeding:this.state!==k.Calling&&s();break;case k.Accepted:case k.Completed:this.state!==k.Calling&&this.state!==k.Proceeding&&s();break;case k.Terminated:this.state!==k.Calling&&this.state!==k.Accepted&&this.state!==k.Completed&&(t||s());break;default:s()}this.B&&(clearTimeout(this.B),this.B=void 0),k.Proceeding,e===k.Completed&&(this.D=setTimeout(()=>this.timerD(),$e.TIMER_D)),e===k.Accepted&&(this.M=setTimeout(()=>this.timerM(),$e.TIMER_M)),e===k.Terminated&&this.dispose(),this.setState(e)}timerA(){}timerB(){this.logger.debug(`Timer B expired for INVITE client transaction ${this.id}.`),this.state===k.Calling&&(this.onRequestTimeout(),this.stateTransition(k.Terminated))}timerD(){this.logger.debug(`Timer D expired for INVITE client transaction ${this.id}.`),this.state===k.Completed&&this.stateTransition(k.Terminated)}timerM(){this.logger.debug(`Timer M expired for INVITE client transaction ${this.id}.`),this.state===k.Accepted&&this.stateTransition(k.Terminated)}}class qe{constructor(e,t,s,i){this.transactionConstructor=e,this.core=t,this.message=s,this.delegate=i,this.challenged=!1,this.stale=!1,this.logger=this.loggerFactory.getLogger("sip.user-agent-client"),this.init()}dispose(){this.transaction.dispose()}get loggerFactory(){return this.core.loggerFactory}get transaction(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction}cancel(e,t={}){if(!this.transaction)throw new Error("Transaction undefined.");if(!this.message.to)throw new Error("To undefined.");if(!this.message.from)throw new Error("From undefined.");const s=this.core.makeOutgoingRequestMessage(G.CANCEL,this.message.ruri,this.message.from.uri,this.message.to.uri,{toTag:this.message.toTag,fromTag:this.message.fromTag,callId:this.message.callId,cseq:this.message.cseq},t.extraHeaders);return s.branch=this.message.branch,this.message.headers.Route&&(s.headers.Route=this.message.headers.Route),e&&s.setHeader("Reason",e),this.transaction.state===k.Proceeding?new qe(Qe,this.core,s):this.transaction.addStateChangeListener(()=>{this.transaction&&this.transaction.state===k.Proceeding&&new qe(Qe,this.core,s)},{once:!0}),s}authenticationGuard(e,t){const s=e.statusCode;if(!s)throw new Error("Response status code undefined.");if(s!==401&&s!==407)return!0;let i,n;if(s===401?(i=e.parseHeader("www-authenticate"),n="authorization"):(i=e.parseHeader("proxy-authenticate"),n="proxy-authorization"),!i)return this.logger.warn(s+" with wrong or missing challenge, cannot authenticate"),!0;if(this.challenged&&(this.stale||i.stale!==!0))return this.logger.warn(s+" apparently in authentication loop, cannot authenticate"),!0;if(!this.credentials&&(this.credentials=this.core.configuration.authenticationFactory(),!this.credentials))return this.logger.warn("Unable to obtain credentials, cannot authenticate"),!0;if(!this.credentials.authenticate(this.message,i))return!0;this.challenged=!0,i.stale&&(this.stale=!0);let a=this.message.cseq+=1;return t&&t.localSequenceNumber&&(t.incrementLocalSequenceNumber(),a=this.message.cseq=t.localSequenceNumber),this.message.setHeader("cseq",a+" "+this.message.method),this.message.setHeader(n,this.credentials.toString()),this.init(),!1}onRequestTimeout(){this.logger.warn("User agent client request timed out. Generating internal 408 Request Timeout.");const e=new Gt;e.statusCode=408,e.reasonPhrase="Request Timeout",this.receiveResponse(e)}onTransportError(e){this.logger.error(e.message),this.logger.error("User agent client request transport error. Generating internal 503 Service Unavailable.");const t=new Gt;t.statusCode=503,t.reasonPhrase="Service Unavailable",this.receiveResponse(t)}receiveResponse(e){if(!this.authenticationGuard(e))return;const t=e.statusCode?e.statusCode.toString():"";if(!t)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(t):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(t):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e});break;case/^2[0-9]{2}$/.test(t):this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e});break;case/^3[0-9]{2}$/.test(t):this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(t):this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error(`Invalid status code ${t}`)}}init(){const e={loggerFactory:this.loggerFactory,onRequestTimeout:()=>this.onRequestTimeout(),onStateChange:i=>{i===k.Terminated&&(this.core.userAgentClients.delete(s),t===this._transaction&&this.dispose())},onTransportError:i=>this.onTransportError(i),receiveResponse:i=>this.receiveResponse(i)},t=new this.transactionConstructor(this.message,this.core.transport,e);this._transaction=t;const s=t.id+t.request.method;this.core.userAgentClients.set(s,this)}}class fc extends qe{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.BYE,s);super(Qe,e.userAgentCore,i,t),e.dispose()}}class et extends Na{constructor(e,t,s){super(e,t,s,k.Trying,"sip.transaction.nist")}dispose(){this.J&&(clearTimeout(this.J),this.J=void 0),super.dispose()}get kind(){return"nist"}receiveRequest(e){switch(this.state){case k.Trying:break;case k.Proceeding:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch(t=>{this.logTransportError(t,"Failed to send retransmission of provisional response.")});break;case k.Completed:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch(t=>{this.logTransportError(t,"Failed to send retransmission of final response.")});break;case k.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}}receiveResponse(e,t){if(e<100||e>699)throw new Error(`Invalid status code ${e}`);if(e>100&&e<=199)throw new Error("Provisional response other than 100 not allowed.");switch(this.state){case k.Trying:if(this.lastResponse=t,e>=100&&e<200){this.stateTransition(k.Proceeding),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send provisional response.")});return}if(e>=200&&e<=699){this.stateTransition(k.Completed),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send final response.")});return}break;case k.Proceeding:if(this.lastResponse=t,e>=200&&e<=699){this.stateTransition(k.Completed),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send final response.")});return}break;case k.Completed:return;case k.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}const s=`Non-INVITE server transaction received unexpected ${e} response from TU while in state ${this.state}.`;throw this.logger.error(s),new Error(s)}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(k.Terminated,!0)}typeToString(){return"non-INVITE server transaction"}stateTransition(e,t=!1){const s=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case k.Trying:s();break;case k.Proceeding:this.state!==k.Trying&&s();break;case k.Completed:this.state!==k.Trying&&this.state!==k.Proceeding&&s();break;case k.Terminated:this.state!==k.Proceeding&&this.state!==k.Completed&&(t||s());break;default:s()}e===k.Completed&&(this.J=setTimeout(()=>this.timerJ(),$e.TIMER_J)),e===k.Terminated&&this.dispose(),this.setState(e)}timerJ(){this.logger.debug(`Timer J expired for NON-INVITE server transaction ${this.id}.`),this.state===k.Completed&&this.stateTransition(k.Terminated)}}class bt{constructor(e,t,s,i){this.transactionConstructor=e,this.core=t,this.message=s,this.delegate=i,this.logger=this.loggerFactory.getLogger("sip.user-agent-server"),this.toTag=s.toTag?s.toTag:ls(),this.init()}dispose(){this.transaction.dispose()}get loggerFactory(){return this.core.loggerFactory}get transaction(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction}accept(e={statusCode:200}){if(!this.acceptable)throw new Vt(`${this.message.method} not acceptable in state ${this.transaction.state}.`);const t=e.statusCode;if(t<200||t>299)throw new TypeError(`Invalid statusCode: ${t}`);return this.reply(e)}progress(e={statusCode:180}){if(!this.progressable)throw new Vt(`${this.message.method} not progressable in state ${this.transaction.state}.`);const t=e.statusCode;if(t<101||t>199)throw new TypeError(`Invalid statusCode: ${t}`);return this.reply(e)}redirect(e,t={statusCode:302}){if(!this.redirectable)throw new Vt(`${this.message.method} not redirectable in state ${this.transaction.state}.`);const s=t.statusCode;if(s<300||s>399)throw new TypeError(`Invalid statusCode: ${s}`);const i=new Array;return e.forEach(a=>i.push(`Contact: ${a.toString()}`)),t.extraHeaders=(t.extraHeaders||[]).concat(i),this.reply(t)}reject(e={statusCode:480}){if(!this.rejectable)throw new Vt(`${this.message.method} not rejectable in state ${this.transaction.state}.`);const t=e.statusCode;if(t<400||t>699)throw new TypeError(`Invalid statusCode: ${t}`);return this.reply(e)}trying(e){if(!this.tryingable)throw new Vt(`${this.message.method} not tryingable in state ${this.transaction.state}.`);return this.reply({statusCode:100})}receiveCancel(e){this.delegate&&this.delegate.onCancel&&this.delegate.onCancel(e)}get acceptable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding||this.transaction.state===k.Accepted;if(this.transaction instanceof et)return this.transaction.state===k.Trying||this.transaction.state===k.Proceeding;throw new Error("Unknown transaction type.")}get progressable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding;if(this.transaction instanceof et)return!1;throw new Error("Unknown transaction type.")}get redirectable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding;if(this.transaction instanceof et)return this.transaction.state===k.Trying||this.transaction.state===k.Proceeding;throw new Error("Unknown transaction type.")}get rejectable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding;if(this.transaction instanceof et)return this.transaction.state===k.Trying||this.transaction.state===k.Proceeding;throw new Error("Unknown transaction type.")}get tryingable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding;if(this.transaction instanceof et)return this.transaction.state===k.Trying;throw new Error("Unknown transaction type.")}reply(e){!e.toTag&&e.statusCode!==100&&(e.toTag=this.toTag),e.userAgent=e.userAgent||this.core.configuration.userAgentHeaderFieldValue,e.supported=e.supported||this.core.configuration.supportedOptionTagsResponse;const t=$a(this.message,e);return this.transaction.receiveResponse(e.statusCode,t.message),t}init(){const e={loggerFactory:this.loggerFactory,onStateChange:i=>{i===k.Terminated&&(this.core.userAgentServers.delete(s),this.dispose())},onTransportError:i=>{this.logger.error(i.message),this.delegate&&this.delegate.onTransportError?this.delegate.onTransportError(i):this.logger.error("User agent server response transport error.")}},t=new this.transactionConstructor(this.message,this.core.transport,e);this._transaction=t;const s=t.id;this.core.userAgentServers.set(t.id,this)}}class gc extends bt{constructor(e,t,s){super(et,e.userAgentCore,t,s)}}class xc extends qe{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.INFO,s);super(Qe,e.userAgentCore,i,t)}}class pc extends bt{constructor(e,t,s){super(et,e.userAgentCore,t,s)}}class Ma extends qe{constructor(e,t,s){super(Qe,e,t,s)}}class ja extends bt{constructor(e,t,s){super(et,e,t,s)}}class mc extends qe{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.NOTIFY,s);super(Qe,e.userAgentCore,i,t)}}function vc(r){return r.userAgentCore!==void 0}class fs extends bt{constructor(e,t,s){const i=vc(e)?e.userAgentCore:e;super(et,i,t,s)}}class yc extends qe{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.PRACK,s);super(Qe,e.userAgentCore,i,t),e.signalingStateTransition(i)}}class wc extends bt{constructor(e,t,s){super(et,e.userAgentCore,t,s),e.signalingStateTransition(t),this.dialog=e}accept(e={statusCode:200}){return e.body&&this.dialog.signalingStateTransition(e.body),super.accept(e)}}class Ec extends qe{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.INVITE,s);super(Zt,e.userAgentCore,i,t),this.delegate=t,e.signalingStateTransition(i),e.reinviteUserAgentClient=this,this.dialog=e}receiveResponse(e){if(!this.authenticationGuard(e,this.dialog))return;const t=e.statusCode?e.statusCode.toString():"";if(!t)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(t):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(t):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:this.dialog,prack:s=>{throw new Error("Unimplemented.")}});break;case/^2[0-9]{2}$/.test(t):this.dialog.signalingStateTransition(e),this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e,session:this.dialog,ack:s=>this.dialog.ack(s)});break;case/^3[0-9]{2}$/.test(t):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(t):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error(`Invalid status code ${t}`)}}}class bc extends bt{constructor(e,t,s){super(Ke,e.userAgentCore,t,s),e.reinviteUserAgentServer=this,this.dialog=e}accept(e={statusCode:200}){e.extraHeaders=e.extraHeaders||[],e.extraHeaders=e.extraHeaders.concat(this.dialog.routeSet.map(n=>`Record-Route: ${n}`));const t=super.accept(e),s=this.dialog,i=Object.assign(Object.assign({},t),{session:s});return e.body&&this.dialog.signalingStateTransition(e.body),this.dialog.reConfirm(),i}progress(e={statusCode:180}){const t=super.progress(e),s=this.dialog,i=Object.assign(Object.assign({},t),{session:s});return e.body&&this.dialog.signalingStateTransition(e.body),i}redirect(e,t={statusCode:302}){throw this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,new Error("Unimplemented.")}reject(e={statusCode:488}){return this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,super.reject(e)}}class Cc extends qe{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.REFER,s);super(Qe,e.userAgentCore,i,t)}}function _c(r){return r.userAgentCore!==void 0}class qa extends bt{constructor(e,t,s){const i=_c(e)?e.userAgentCore:e;super(et,i,t,s)}}class gs extends wr{constructor(e,t,s,i){super(t,s),this.initialTransaction=e,this._signalingState=U.Initial,this.ackWait=!1,this.ackProcessing=!1,this.delegate=i,e instanceof Ke&&(this.ackWait=!0),this.early||this.start2xxRetransmissionTimer(),this.signalingStateTransition(e.request),this.logger=t.loggerFactory.getLogger("sip.invite-dialog"),this.logger.log(`INVITE dialog ${this.id} constructed`)}dispose(){super.dispose(),this._signalingState=U.Closed,this._offer=void 0,this._answer=void 0,this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.logger.log(`INVITE dialog ${this.id} destroyed`)}get sessionState(){return this.early?st.Early:this.ackWait?st.AckWait:this._signalingState===U.Closed?st.Terminated:st.Confirmed}get signalingState(){return this._signalingState}get offer(){return this._offer}get answer(){return this._answer}confirm(){this.early&&this.start2xxRetransmissionTimer(),super.confirm()}reConfirm(){this.reinviteUserAgentServer&&this.startReInvite2xxRetransmissionTimer()}ack(e={}){this.logger.log(`INVITE dialog ${this.id} sending ACK request`);let t;if(this.reinviteUserAgentClient){if(!(this.reinviteUserAgentClient.transaction instanceof Zt))throw new Error("Transaction not instance of InviteClientTransaction.");t=this.reinviteUserAgentClient.transaction,this.reinviteUserAgentClient=void 0}else{if(!(this.initialTransaction instanceof Zt))throw new Error("Initial transaction not instance of InviteClientTransaction.");t=this.initialTransaction}const s=this.createOutgoingRequestMessage(G.ACK,{cseq:t.request.cseq,extraHeaders:e.extraHeaders,body:e.body});return t.ackResponse(s),this.signalingStateTransition(s),{message:s}}bye(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending BYE request`),this.initialTransaction instanceof Ke){if(this.early)throw new Error("UAS MUST NOT send a BYE on early dialogs.");if(this.ackWait&&this.initialTransaction.state!==k.Terminated)throw new Error("UAS MUST NOT send a BYE on a confirmed dialog until it has received an ACK for its 2xx response or until the server transaction times out.")}return new fc(this,e,t)}info(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending INFO request`),this.early)throw new Error("Dialog not confirmed.");return new xc(this,e,t)}invite(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending INVITE request`),this.early)throw new Error("Dialog not confirmed.");if(this.reinviteUserAgentClient)throw new Error("There is an ongoing re-INVITE client transaction.");if(this.reinviteUserAgentServer)throw new Error("There is an ongoing re-INVITE server transaction.");return new Ec(this,e,t)}message(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending MESSAGE request`),this.early)throw new Error("Dialog not confirmed.");const s=this.createOutgoingRequestMessage(G.MESSAGE,t);return new Ma(this.core,s,e)}notify(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending NOTIFY request`),this.early)throw new Error("Dialog not confirmed.");return new mc(this,e,t)}prack(e,t){return this.logger.log(`INVITE dialog ${this.id} sending PRACK request`),new yc(this,e,t)}refer(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending REFER request`),this.early)throw new Error("Dialog not confirmed.");return new Cc(this,e,t)}receiveRequest(e){if(this.logger.log(`INVITE dialog ${this.id} received ${e.method} request`),e.method===G.ACK){if(this.ackWait){if(this.initialTransaction instanceof Zt){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}if(this.initialTransaction.request.cseq!==e.cseq){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}this.ackWait=!1}else{if(!this.reinviteUserAgentServer){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}if(this.reinviteUserAgentServer.transaction.request.cseq!==e.cseq){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}this.reinviteUserAgentServer=void 0}if(this.signalingStateTransition(e),this.delegate&&this.delegate.onAck){const t=this.delegate.onAck({message:e});t instanceof Promise&&(this.ackProcessing=!0,t.then(()=>this.ackProcessing=!1).catch(()=>this.ackProcessing=!1))}return}if(!this.sequenceGuard(e)){this.logger.log(`INVITE dialog ${this.id} rejected out of order ${e.method} request.`);return}if(super.receiveRequest(e),e.method===G.INVITE){const t=()=>{const n=this.ackWait?"waiting for initial ACK":"processing initial ACK";this.logger.warn(`INVITE dialog ${this.id} received re-INVITE while ${n}`);let a="RFC 5407 suggests the following to avoid this race condition... ";a+=" Note: Implementation issues are outside the scope of this document,",a+=" but the following tip is provided for avoiding race conditions of",a+=" this type. The caller can delay sending re-INVITE F6 for some period",a+=" of time (2 seconds, perhaps), after which the caller can reasonably",a+=" assume that its ACK has been received. Implementors can decouple the",a+=" actions of the user (e.g., pressing the hold button) from the actions",a+=" of the protocol (the sending of re-INVITE F6), so that the UA can",a+=" behave like this. In this case, it is the implementor's choice as to",a+=" how long to wait. In most cases, such an implementation may be",a+=" useful to prevent the type of race condition shown in this section.",a+=" This document expresses no preference about whether or not they",a+=" should wait for an ACK to be delivered. After considering the impact",a+=" on user experience, implementors should decide whether or not to wait",a+=" for a while, because the user experience depends on the",a+=" implementation and has no direct bearing on protocol behavior.",this.logger.warn(a)},i=[`Retry-After: ${Math.floor(Math.random()*10)+1}`];if(this.ackProcessing){this.core.replyStateless(e,{statusCode:500,extraHeaders:i}),t();return}if(this.ackWait&&this.signalingState!==U.Stable){this.core.replyStateless(e,{statusCode:500,extraHeaders:i}),t();return}if(this.reinviteUserAgentServer){this.core.replyStateless(e,{statusCode:500,extraHeaders:i});return}if(this.reinviteUserAgentClient){this.core.replyStateless(e,{statusCode:491});return}}if(e.method===G.INVITE){const t=e.parseHeader("contact");if(!t)throw new Error("Contact undefined.");if(!(t instanceof ze))throw new Error("Contact not instance of NameAddrHeader.");this.dialogState.remoteTarget=t.uri}switch(e.method){case G.BYE:{const t=new gc(this,e);this.delegate&&this.delegate.onBye?this.delegate.onBye(t):t.accept(),this.dispose()}break;case G.INFO:{const t=new pc(this,e);this.delegate&&this.delegate.onInfo?this.delegate.onInfo(t):t.reject({statusCode:469,extraHeaders:["Recv-Info:"]})}break;case G.INVITE:{const t=new bc(this,e);this.signalingStateTransition(e),this.delegate&&this.delegate.onInvite?this.delegate.onInvite(t):t.reject({statusCode:488})}break;case G.MESSAGE:{const t=new ja(this.core,e);this.delegate&&this.delegate.onMessage?this.delegate.onMessage(t):t.accept()}break;case G.NOTIFY:{const t=new fs(this,e);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(t):t.accept()}break;case G.PRACK:{const t=new wc(this,e);this.delegate&&this.delegate.onPrack?this.delegate.onPrack(t):t.accept()}break;case G.REFER:{const t=new qa(this,e);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(t):t.reject()}break;default:this.logger.log(`INVITE dialog ${this.id} received unimplemented ${e.method} request`),this.core.replyStateless(e,{statusCode:501});break}}reliableSequenceGuard(e){const t=e.statusCode;if(!t)throw new Error("Status code undefined");if(t>100&&t<200){const s=e.getHeader("require"),i=e.getHeader("rseq"),n=s&&s.includes("100rel")&&i?Number(i):void 0;if(n){if(this.rseq&&this.rseq+1!==n)return!1;this.rseq=this.rseq?this.rseq+1:n}}return!0}signalingStateRollback(){(this._signalingState===U.HaveLocalOffer||this.signalingState===U.HaveRemoteOffer)&&this._rollbackOffer&&this._rollbackAnswer&&(this._signalingState=U.Stable,this._offer=this._rollbackOffer,this._answer=this._rollbackAnswer)}signalingStateTransition(e){const t=qr(e);if(!(!t||t.contentDisposition!=="session")){if(this._signalingState===U.Stable&&(this._rollbackOffer=this._offer,this._rollbackAnswer=this._answer),e instanceof yr)switch(this._signalingState){case U.Initial:case U.Stable:this._signalingState=U.HaveRemoteOffer,this._offer=t,this._answer=void 0;break;case U.HaveLocalOffer:this._signalingState=U.Stable,this._answer=t;break;case U.HaveRemoteOffer:break;case U.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof Gt)switch(this._signalingState){case U.Initial:case U.Stable:this._signalingState=U.HaveRemoteOffer,this._offer=t,this._answer=void 0;break;case U.HaveLocalOffer:this._signalingState=U.Stable,this._answer=t;break;case U.HaveRemoteOffer:break;case U.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof cr)switch(this._signalingState){case U.Initial:case U.Stable:this._signalingState=U.HaveLocalOffer,this._offer=t,this._answer=void 0;break;case U.HaveLocalOffer:break;case U.HaveRemoteOffer:this._signalingState=U.Stable,this._answer=t;break;case U.Closed:break;default:throw new Error("Unexpected signaling state.")}if(ka(e))switch(this._signalingState){case U.Initial:case U.Stable:this._signalingState=U.HaveLocalOffer,this._offer=t,this._answer=void 0;break;case U.HaveLocalOffer:break;case U.HaveRemoteOffer:this._signalingState=U.Stable,this._answer=t;break;case U.Closed:break;default:throw new Error("Unexpected signaling state.")}}}start2xxRetransmissionTimer(){if(this.initialTransaction instanceof Ke){const e=this.initialTransaction;let t=$e.T1;const s=()=>{if(!this.ackWait){this.invite2xxTimer=void 0;return}this.logger.log("No ACK for 2xx response received, attempting retransmission"),e.retransmitAcceptedResponse(),t=Math.min(t*2,$e.T2),this.invite2xxTimer=setTimeout(s,t)};this.invite2xxTimer=setTimeout(s,t);const i=()=>{e.state===k.Terminated&&(e.removeStateChangeListener(i),this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.ackWait&&(this.delegate&&this.delegate.onAckTimeout?this.delegate.onAckTimeout():this.bye()))};e.addStateChangeListener(i)}}startReInvite2xxRetransmissionTimer(){if(this.reinviteUserAgentServer&&this.reinviteUserAgentServer.transaction instanceof Ke){const e=this.reinviteUserAgentServer.transaction;let t=$e.T1;const s=()=>{if(!this.reinviteUserAgentServer){this.invite2xxTimer=void 0;return}this.logger.log("No ACK for 2xx response received, attempting retransmission"),e.retransmitAcceptedResponse(),t=Math.min(t*2,$e.T2),this.invite2xxTimer=setTimeout(s,t)};this.invite2xxTimer=setTimeout(s,t);const i=()=>{e.state===k.Terminated&&(e.removeStateChangeListener(i),this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.reinviteUserAgentServer)};e.addStateChangeListener(i)}}}class Dc extends qe{constructor(e,t,s){super(Zt,e,t,s),this.confirmedDialogAcks=new Map,this.confirmedDialogs=new Map,this.earlyDialogs=new Map,this.delegate=s}dispose(){this.earlyDialogs.forEach(e=>e.dispose()),this.earlyDialogs.clear(),super.dispose()}onTransportError(e){if(this.transaction.state===k.Calling)return super.onTransportError(e);this.logger.error(e.message),this.logger.error("User agent client request transport error while sending ACK.")}receiveResponse(e){if(!this.authenticationGuard(e))return;const t=e.statusCode?e.statusCode.toString():"";if(!t)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(t):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});return;case/^1[0-9]{2}$/.test(t):{if(!e.toTag){this.logger.warn("Non-100 1xx INVITE response received without a to tag, dropping.");return}if(!e.parseHeader("contact")){this.logger.error("Non-100 1xx INVITE response received without a Contact header field, dropping.");return}const i=wr.initialDialogStateForUserAgentClient(this.message,e);let n=this.earlyDialogs.get(i.id);if(!n){const o=this.transaction;if(!(o instanceof Zt))throw new Error("Transaction not instance of InviteClientTransaction.");n=new gs(o,this.core,i),this.earlyDialogs.set(n.id,n)}if(!n.reliableSequenceGuard(e)){this.logger.warn("1xx INVITE reliable response received out of order or is a retransmission, dropping.");return}(n.signalingState===U.Initial||n.signalingState===U.HaveLocalOffer)&&n.signalingStateTransition(e);const a=n;this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:a,prack:o=>a.prack(void 0,o)})}return;case/^2[0-9]{2}$/.test(t):{if(!e.toTag){this.logger.error("2xx INVITE response received without a to tag, dropping.");return}if(!e.parseHeader("contact")){this.logger.error("2xx INVITE response received without a Contact header field, dropping.");return}const i=wr.initialDialogStateForUserAgentClient(this.message,e);let n=this.confirmedDialogs.get(i.id);if(n){const o=this.confirmedDialogAcks.get(i.id);if(o){const d=this.transaction;if(!(d instanceof Zt))throw new Error("Client transaction not instance of InviteClientTransaction.");d.ackResponse(o.message)}return}if(n=this.earlyDialogs.get(i.id),n)n.confirm(),n.recomputeRouteSet(e),this.earlyDialogs.delete(n.id),this.confirmedDialogs.set(n.id,n);else{const o=this.transaction;if(!(o instanceof Zt))throw new Error("Transaction not instance of InviteClientTransaction.");n=new gs(o,this.core,i),this.confirmedDialogs.set(n.id,n)}(n.signalingState===U.Initial||n.signalingState===U.HaveLocalOffer)&&n.signalingStateTransition(e);const a=n;if(this.delegate&&this.delegate.onAccept)this.delegate.onAccept({message:e,session:a,ack:o=>{const d=a.ack(o);return this.confirmedDialogAcks.set(a.id,d),d}});else{const o=a.ack();this.confirmedDialogAcks.set(a.id,o)}}return;case/^3[0-9]{2}$/.test(t):this.earlyDialogs.forEach(s=>s.dispose()),this.earlyDialogs.clear(),this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});return;case/^[4-6][0-9]{2}$/.test(t):this.earlyDialogs.forEach(s=>s.dispose()),this.earlyDialogs.clear(),this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});return;default:throw new Error(`Invalid status code ${t}`)}}}class Li extends bt{constructor(e,t,s){super(Ke,e,t,s),this.core=e}dispose(){this.earlyDialog&&this.earlyDialog.dispose(),super.dispose()}accept(e={statusCode:200}){if(!this.acceptable)throw new Vt(`${this.message.method} not acceptable in state ${this.transaction.state}.`);if(!this.confirmedDialog)if(this.earlyDialog)this.earlyDialog.confirm(),this.confirmedDialog=this.earlyDialog,this.earlyDialog=void 0;else{const d=this.transaction;if(!(d instanceof Ke))throw new Error("Transaction not instance of InviteClientTransaction.");const c=wr.initialDialogStateForUserAgentServer(this.message,this.toTag);this.confirmedDialog=new gs(d,this.core,c)}const t=this.message.getHeaders("record-route").map(d=>`Record-Route: ${d}`),s=`Contact: ${this.core.configuration.contact.toString()}`,i="Allow: "+zt.toString();if(!e.body){if(this.confirmedDialog.signalingState===U.Stable)e.body=this.confirmedDialog.answer;else if(this.confirmedDialog.signalingState===U.Initial||this.confirmedDialog.signalingState===U.HaveRemoteOffer)throw new Error("Response must have a body.")}e.statusCode=e.statusCode||200,e.extraHeaders=e.extraHeaders||[],e.extraHeaders=e.extraHeaders.concat(t),e.extraHeaders.push(i),e.extraHeaders.push(s);const n=super.accept(e),a=this.confirmedDialog,o=Object.assign(Object.assign({},n),{session:a});return e.body&&this.confirmedDialog.signalingState!==U.Stable&&this.confirmedDialog.signalingStateTransition(e.body),o}progress(e={statusCode:180}){if(!this.progressable)throw new Vt(`${this.message.method} not progressable in state ${this.transaction.state}.`);if(!this.earlyDialog){const o=this.transaction;if(!(o instanceof Ke))throw new Error("Transaction not instance of InviteClientTransaction.");const d=wr.initialDialogStateForUserAgentServer(this.message,this.toTag,!0);this.earlyDialog=new gs(o,this.core,d)}const t=this.message.getHeaders("record-route").map(o=>`Record-Route: ${o}`),s=`Contact: ${this.core.configuration.contact}`;e.extraHeaders=e.extraHeaders||[],e.extraHeaders=e.extraHeaders.concat(t),e.extraHeaders.push(s);const i=super.progress(e),n=this.earlyDialog,a=Object.assign(Object.assign({},i),{session:n});return e.body&&this.earlyDialog.signalingState!==U.Stable&&this.earlyDialog.signalingStateTransition(e.body),a}redirect(e,t={statusCode:302}){return super.redirect(e,t)}reject(e={statusCode:486}){return super.reject(e)}}class Ac extends qe{constructor(e,t,s){super(Qe,e,t,s)}}class Sc extends qe{constructor(e,t,s){super(Qe,e,t,s)}}class Tc extends bt{constructor(e,t,s){super(et,e,t,s),this.core=e}}class Rc extends qe{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.SUBSCRIBE,s);super(Qe,e.userAgentCore,i,t),this.dialog=e}waitNotifyStop(){}receiveResponse(e){if(e.statusCode&&e.statusCode>=200&&e.statusCode<300){const t=e.getHeader("Expires");if(!t)this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE");else{const s=Number(t);this.dialog.subscriptionExpires>s&&(this.dialog.subscriptionExpires=s)}}e.statusCode&&e.statusCode>=400&&e.statusCode<700&&[404,405,410,416,480,481,482,483,484,485,489,501,604].includes(e.statusCode)&&this.dialog.terminate(),super.receiveResponse(e)}}class La extends wr{constructor(e,t,s,i,n,a){super(i,n),this.delegate=a,this._autoRefresh=!1,this._subscriptionEvent=e,this._subscriptionExpires=t,this._subscriptionExpiresInitial=t,this._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),this._subscriptionRefresh=void 0,this._subscriptionRefreshLastSet=void 0,this._subscriptionState=s,this.logger=i.loggerFactory.getLogger("sip.subscribe-dialog"),this.logger.log(`SUBSCRIBE dialog ${this.id} constructed`)}static initialDialogStateForSubscription(e,t){const i=t.getHeaders("record-route"),n=t.parseHeader("contact");if(!n)throw new Error("Contact undefined.");if(!(n instanceof ze))throw new Error("Contact not instance of NameAddrHeader.");const a=n.uri,o=e.cseq,d=void 0,c=e.callId,l=e.fromTag,g=t.fromTag;if(!c)throw new Error("Call id undefined.");if(!l)throw new Error("From tag undefined.");if(!g)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");const u=e.from.uri,y=e.to.uri;return{id:c+l+g,early:!1,callId:c,localTag:l,remoteTag:g,localSequenceNumber:o,remoteSequenceNumber:d,localURI:u,remoteURI:y,remoteTarget:a,routeSet:i,secure:!1}}dispose(){super.dispose(),this.N&&(clearTimeout(this.N),this.N=void 0),this.refreshTimerClear(),this.logger.log(`SUBSCRIBE dialog ${this.id} destroyed`)}get autoRefresh(){return this._autoRefresh}set autoRefresh(e){this._autoRefresh=!0,this.refreshTimerSet()}get subscriptionEvent(){return this._subscriptionEvent}get subscriptionExpires(){const e=Math.floor(Date.now()/1e3)-this._subscriptionExpiresLastSet,t=this._subscriptionExpires-e;return Math.max(t,0)}set subscriptionExpires(e){if(e<0)throw new Error("Expires must be greater than or equal to zero.");if(this._subscriptionExpires=e,this._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),this.autoRefresh){const t=this.subscriptionRefresh;(t===void 0||t>=e)&&this.refreshTimerSet()}}get subscriptionExpiresInitial(){return this._subscriptionExpiresInitial}get subscriptionRefresh(){if(this._subscriptionRefresh===void 0||this._subscriptionRefreshLastSet===void 0)return;const e=Math.floor(Date.now()/1e3)-this._subscriptionRefreshLastSet,t=this._subscriptionRefresh-e;return Math.max(t,0)}get subscriptionState(){return this._subscriptionState}receiveRequest(e){if(this.logger.log(`SUBSCRIBE dialog ${this.id} received ${e.method} request`),!this.sequenceGuard(e)){this.logger.log(`SUBSCRIBE dialog ${this.id} rejected out of order ${e.method} request.`);return}switch(super.receiveRequest(e),e.method){case G.NOTIFY:this.onNotify(e);break;default:this.logger.log(`SUBSCRIBE dialog ${this.id} received unimplemented ${e.method} request`),this.core.replyStateless(e,{statusCode:501});break}}refresh(){const e="Allow: "+zt.toString(),t={};return t.extraHeaders=(t.extraHeaders||[]).slice(),t.extraHeaders.push(e),t.extraHeaders.push("Event: "+this.subscriptionEvent),t.extraHeaders.push("Expires: "+this.subscriptionExpiresInitial),t.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,t)}subscribe(e,t={}){var s;if(this.subscriptionState!==fe.Pending&&this.subscriptionState!==fe.Active)throw new Error(`Invalid state ${this.subscriptionState}. May only re-subscribe while in state "pending" or "active".`);this.logger.log(`SUBSCRIBE dialog ${this.id} sending SUBSCRIBE request`);const i=new Rc(this,e,t);return this.N&&(clearTimeout(this.N),this.N=void 0),!((s=t.extraHeaders)===null||s===void 0)&&s.includes("Expires: 0")||(this.N=setTimeout(()=>this.timerN(),$e.TIMER_N)),i}terminate(){this.stateTransition(fe.Terminated),this.onTerminated()}unsubscribe(){const e="Allow: "+zt.toString(),t={};return t.extraHeaders=(t.extraHeaders||[]).slice(),t.extraHeaders.push(e),t.extraHeaders.push("Event: "+this.subscriptionEvent),t.extraHeaders.push("Expires: 0"),t.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,t)}onNotify(e){const t=e.parseHeader("Event").event;if(!t||t!==this.subscriptionEvent){this.core.replyStateless(e,{statusCode:489});return}this.N&&(clearTimeout(this.N),this.N=void 0);const s=e.parseHeader("Subscription-State");if(!s||!s.state){this.core.replyStateless(e,{statusCode:489});return}const i=s.state,n=s.expires?Math.max(s.expires,0):void 0;switch(i){case"pending":this.stateTransition(fe.Pending,n);break;case"active":this.stateTransition(fe.Active,n);break;case"terminated":this.stateTransition(fe.Terminated,n);break;default:this.logger.warn("Unrecognized subscription state.");break}const a=new fs(this,e);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(a):a.accept()}onRefresh(e){this.delegate&&this.delegate.onRefresh&&this.delegate.onRefresh(e)}onTerminated(){this.delegate&&this.delegate.onTerminated&&this.delegate.onTerminated()}refreshTimerClear(){this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)}refreshTimerSet(){if(this.refreshTimerClear(),this.autoRefresh&&this.subscriptionExpires>0){const e=this.subscriptionExpires*900;this._subscriptionRefresh=Math.floor(e/1e3),this._subscriptionRefreshLastSet=Math.floor(Date.now()/1e3),this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,this._subscriptionRefresh=void 0,this._subscriptionRefreshLastSet=void 0,this.onRefresh(this.refresh())},e)}}stateTransition(e,t){const s=()=>{this.logger.warn(`Invalid subscription state transition from ${this.subscriptionState} to ${e}`)};switch(e){case fe.Initial:s();return;case fe.NotifyWait:s();return;case fe.Pending:if(this.subscriptionState!==fe.NotifyWait&&this.subscriptionState!==fe.Pending){s();return}break;case fe.Active:if(this.subscriptionState!==fe.NotifyWait&&this.subscriptionState!==fe.Pending&&this.subscriptionState!==fe.Active){s();return}break;case fe.Terminated:if(this.subscriptionState!==fe.NotifyWait&&this.subscriptionState!==fe.Pending&&this.subscriptionState!==fe.Active){s();return}break;default:s();return}e===fe.Pending&&t&&(this.subscriptionExpires=t),e===fe.Active&&t&&(this.subscriptionExpires=t),e===fe.Terminated&&this.dispose(),this._subscriptionState=e}timerN(){this.logger.warn("Timer N expired for SUBSCRIBE dialog. Timed out waiting for NOTIFY."),this.subscriptionState!==fe.Terminated&&(this.stateTransition(fe.Terminated),this.onTerminated())}}class Fc extends qe{constructor(e,t,s){const i=t.getHeader("Event");if(!i)throw new Error("Event undefined");const n=t.getHeader("Expires");if(!n)throw new Error("Expires undefined");super(Qe,e,t,s),this.delegate=s,this.subscriberId=t.callId+t.fromTag+i,this.subscriptionExpiresRequested=this.subscriptionExpires=Number(n),this.subscriptionEvent=i,this.subscriptionState=fe.NotifyWait,this.waitNotifyStart()}dispose(){super.dispose()}onNotify(e){const t=e.message.parseHeader("Event").event;if(!t||t!==this.subscriptionEvent){this.logger.warn("Failed to parse event."),e.reject({statusCode:489});return}const s=e.message.parseHeader("Subscription-State");if(!s||!s.state){this.logger.warn("Failed to parse subscription state."),e.reject({statusCode:489});return}const i=s.state;switch(i){case"pending":break;case"active":break;case"terminated":break;default:this.logger.warn(`Invalid subscription state ${i}`),e.reject({statusCode:489});return}if(i!=="terminated"&&!e.message.parseHeader("contact")){this.logger.warn("Failed to parse contact."),e.reject({statusCode:489});return}if(this.dialog)throw new Error("Dialog already created. This implementation only supports install of single subscriptions.");switch(this.waitNotifyStop(),this.subscriptionExpires=s.expires?Math.min(this.subscriptionExpires,Math.max(s.expires,0)):this.subscriptionExpires,i){case"pending":this.subscriptionState=fe.Pending;break;case"active":this.subscriptionState=fe.Active;break;case"terminated":this.subscriptionState=fe.Terminated;break;default:throw new Error(`Unrecognized state ${i}.`)}if(this.subscriptionState!==fe.Terminated){const n=La.initialDialogStateForSubscription(this.message,e.message);this.dialog=new La(this.subscriptionEvent,this.subscriptionExpires,this.subscriptionState,this.core,n)}if(this.delegate&&this.delegate.onNotify){const n=e,a=this.dialog;this.delegate.onNotify({request:n,subscription:a})}else e.accept()}waitNotifyStart(){this.N||(this.core.subscribers.set(this.subscriberId,this),this.N=setTimeout(()=>this.timerN(),$e.TIMER_N))}waitNotifyStop(){this.N&&(this.core.subscribers.delete(this.subscriberId),clearTimeout(this.N),this.N=void 0)}receiveResponse(e){if(this.authenticationGuard(e)){if(e.statusCode&&e.statusCode>=200&&e.statusCode<300){const t=e.getHeader("Expires");if(!t)this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE");else{const s=Number(t);s>this.subscriptionExpiresRequested&&this.logger.warn("Expires header in a 200-class response to SUBSCRIBE with a higher value than the one in the request"),s<this.subscriptionExpires&&(this.subscriptionExpires=s)}this.dialog&&this.dialog.subscriptionExpires>this.subscriptionExpires&&(this.dialog.subscriptionExpires=this.subscriptionExpires)}e.statusCode&&e.statusCode>=300&&e.statusCode<700&&this.waitNotifyStop(),super.receiveResponse(e)}}timerN(){this.logger.warn("Timer N expired for SUBSCRIBE user agent client. Timed out waiting for NOTIFY."),this.waitNotifyStop(),this.delegate&&this.delegate.onNotifyTimeout&&this.delegate.onNotifyTimeout()}}class kc extends bt{constructor(e,t,s){super(et,e,t,s),this.core=e}}const Ua=["application/sdp","application/dtmf-relay"];class Bc{constructor(e,t={}){this.userAgentClients=new Map,this.userAgentServers=new Map,this.configuration=e,this.delegate=t,this.dialogs=new Map,this.subscribers=new Map,this.logger=e.loggerFactory.getLogger("sip.user-agent-core")}dispose(){this.reset()}reset(){this.dialogs.forEach(e=>e.dispose()),this.dialogs.clear(),this.subscribers.forEach(e=>e.dispose()),this.subscribers.clear(),this.userAgentClients.forEach(e=>e.dispose()),this.userAgentClients.clear(),this.userAgentServers.forEach(e=>e.dispose()),this.userAgentServers.clear()}get loggerFactory(){return this.configuration.loggerFactory}get transport(){const e=this.configuration.transportAccessor();if(!e)throw new Error("Transport undefined.");return e}invite(e,t){return new Dc(this,e,t)}message(e,t){return new Ma(this,e,t)}publish(e,t){return new Ac(this,e,t)}register(e,t){return new Sc(this,e,t)}subscribe(e,t){return new Fc(this,e,t)}request(e,t){return new qe(Qe,this,e,t)}makeOutgoingRequestMessage(e,t,s,i,n,a,o){const d=this.configuration.sipjsId,c=this.configuration.displayName,l=this.configuration.viaForceRport,g=this.configuration.hackViaTcp,u=this.configuration.supportedOptionTags.slice();e===G.REGISTER&&u.push("path","gruu"),e===G.INVITE&&(this.configuration.contact.pubGruu||this.configuration.contact.tempGruu)&&u.push("gruu");const y=this.configuration.routeSet,w=this.configuration.userAgentHeaderFieldValue,b=this.configuration.viaHost,x=Object.assign(Object.assign({},{callIdPrefix:d,forceRport:l,fromDisplayName:c,hackViaTcp:g,optionTags:u,routeSet:y,userAgentString:w,viaHost:b}),n);return new cr(e,t,s,i,x,a,o)}receiveIncomingRequestFromTransport(e){this.receiveRequestFromTransport(e)}receiveIncomingResponseFromTransport(e){this.receiveResponseFromTransport(e)}replyStateless(e,t){const s=this.configuration.userAgentHeaderFieldValue,i=this.configuration.supportedOptionTagsResponse;t=Object.assign(Object.assign({},t),{userAgent:s,supported:i});const n=$a(e,t);return this.transport.send(n.message).catch(a=>{a instanceof Error&&this.logger.error(a.message),this.logger.error(`Transport error occurred sending stateless reply to ${e.method} request.`)}),n}receiveRequestFromTransport(e){const t=e.viaBranch,s=this.userAgentServers.get(t);if(e.method===G.ACK&&s&&s.transaction.state===k.Accepted&&s instanceof Li){this.logger.warn(`Discarding out of dialog ACK after 2xx response sent on transaction ${t}.`);return}if(e.method===G.CANCEL){s?(this.replyStateless(e,{statusCode:200}),s.transaction instanceof Ke&&s.transaction.state===k.Proceeding&&s instanceof Li&&s.receiveCancel(e)):this.replyStateless(e,{statusCode:481});return}if(s){s.transaction.receiveRequest(e);return}this.receiveRequest(e)}receiveRequest(e){if(!zt.includes(e.method)){const i="Allow: "+zt.toString();this.replyStateless(e,{statusCode:405,extraHeaders:[i]});return}if(!e.ruri)throw new Error("Request-URI undefined.");if(e.ruri.scheme!=="sip"){this.replyStateless(e,{statusCode:416});return}const t=e.ruri,s=i=>!!i&&i.user===t.user;if(!s(this.configuration.aor)&&!(s(this.configuration.contact.uri)||s(this.configuration.contact.pubGruu)||s(this.configuration.contact.tempGruu))){this.logger.warn("Request-URI does not point to us."),e.method!==G.ACK&&this.replyStateless(e,{statusCode:404});return}if(e.method===G.INVITE&&!e.hasHeader("Contact")){this.replyStateless(e,{statusCode:400,reasonPhrase:"Missing Contact Header"});return}if(!e.toTag){const i=e.viaBranch;if(!this.userAgentServers.has(i)&&Array.from(this.userAgentServers.values()).some(a=>a.transaction.request.fromTag===e.fromTag&&a.transaction.request.callId===e.callId&&a.transaction.request.cseq===e.cseq)){this.replyStateless(e,{statusCode:482});return}}e.toTag?this.receiveInsideDialogRequest(e):this.receiveOutsideDialogRequest(e)}receiveInsideDialogRequest(e){if(e.method===G.NOTIFY){const i=e.parseHeader("Event");if(!i||!i.event){this.replyStateless(e,{statusCode:489});return}const n=e.callId+e.toTag+i.event,a=this.subscribers.get(n);if(a){const o=new fs(this,e);a.onNotify(o);return}}const t=e.callId+e.toTag+e.fromTag,s=this.dialogs.get(t);if(s){if(e.method===G.OPTIONS){const i="Allow: "+zt.toString(),n="Accept: "+Ua.toString();this.replyStateless(e,{statusCode:200,extraHeaders:[i,n]});return}s.receiveRequest(e);return}e.method!==G.ACK&&this.replyStateless(e,{statusCode:481})}receiveOutsideDialogRequest(e){switch(e.method){case G.ACK:break;case G.BYE:this.replyStateless(e,{statusCode:481});break;case G.CANCEL:throw new Error(`Unexpected out of dialog request method ${e.method}.`);case G.INFO:this.replyStateless(e,{statusCode:405});break;case G.INVITE:{const t=new Li(this,e);this.delegate.onInvite?this.delegate.onInvite(t):t.reject()}break;case G.MESSAGE:{const t=new ja(this,e);this.delegate.onMessage?this.delegate.onMessage(t):t.accept()}break;case G.NOTIFY:{const t=new fs(this,e);this.delegate.onNotify?this.delegate.onNotify(t):t.reject({statusCode:405})}break;case G.OPTIONS:{const t="Allow: "+zt.toString(),s="Accept: "+Ua.toString();this.replyStateless(e,{statusCode:200,extraHeaders:[t,s]})}break;case G.REFER:{const t=new qa(this,e);this.delegate.onRefer?this.delegate.onRefer(t):t.reject({statusCode:405})}break;case G.REGISTER:{const t=new Tc(this,e);this.delegate.onRegister?this.delegate.onRegister(t):t.reject({statusCode:405})}break;case G.SUBSCRIBE:{const t=new kc(this,e);this.delegate.onSubscribe?this.delegate.onSubscribe(t):t.reject({statusCode:480})}break;default:throw new Error(`Unexpected out of dialog request method ${e.method}.`)}}receiveResponseFromTransport(e){if(e.getHeaders("via").length>1){this.logger.warn("More than one Via header field present in the response, dropping");return}const t=e.viaBranch+e.method,s=this.userAgentClients.get(t);s?s.transaction.receiveResponse(e):this.logger.warn(`Discarding unmatched ${e.statusCode} response to ${e.method} ${t}.`)}}function Ic(){return r=>!r.audio&&!r.video?Promise.resolve(new MediaStream):navigator.mediaDevices===void 0?Promise.reject(new Error("Media devices not available in insecure contexts.")):navigator.mediaDevices.getUserMedia.call(navigator.mediaDevices,r)}function Hc(){return{bundlePolicy:"balanced",certificates:void 0,iceCandidatePoolSize:0,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",rtcpMuxPolicy:"require"}}class Bt{constructor(e,t,s){e.debug("SessionDescriptionHandler.constructor"),this.logger=e,this.mediaStreamFactory=t,this.sessionDescriptionHandlerConfiguration=s,this._localMediaStream=new MediaStream,this._remoteMediaStream=new MediaStream,this._peerConnection=new RTCPeerConnection(s==null?void 0:s.peerConnectionConfiguration),this.initPeerConnectionEventHandlers()}get localMediaStream(){return this._localMediaStream}get remoteMediaStream(){return this._remoteMediaStream}get dataChannel(){return this._dataChannel}get peerConnection(){return this._peerConnection}get peerConnectionDelegate(){return this._peerConnectionDelegate}set peerConnectionDelegate(e){this._peerConnectionDelegate=e}static dispatchAddTrackEvent(e,t){e.dispatchEvent(new MediaStreamTrackEvent("addtrack",{track:t}))}static dispatchRemoveTrackEvent(e,t){e.dispatchEvent(new MediaStreamTrackEvent("removetrack",{track:t}))}close(){this.logger.debug("SessionDescriptionHandler.close"),this._peerConnection!==void 0&&(this._peerConnection.getReceivers().forEach(e=>{e.track&&e.track.stop()}),this._peerConnection.getSenders().forEach(e=>{e.track&&e.track.stop()}),this._dataChannel&&this._dataChannel.close(),this._peerConnection.close(),this._peerConnection=void 0)}enableReceiverTracks(e){const t=this.peerConnection;if(!t)throw new Error("Peer connection closed.");t.getReceivers().forEach(s=>{s.track&&(s.track.enabled=e)})}enableSenderTracks(e){const t=this.peerConnection;if(!t)throw new Error("Peer connection closed.");t.getSenders().forEach(s=>{s.track&&(s.track.enabled=e)})}getDescription(e,t){var s,i;if(this.logger.debug("SessionDescriptionHandler.getDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=e==null?void 0:e.onDataChannel;const n=(s=e==null?void 0:e.offerOptions)===null||s===void 0?void 0:s.iceRestart,a=(e==null?void 0:e.iceGatheringTimeout)===void 0?(i=this.sessionDescriptionHandlerConfiguration)===null||i===void 0?void 0:i.iceGatheringTimeout:e==null?void 0:e.iceGatheringTimeout;return this.getLocalMediaStream(e).then(()=>this.updateDirection(e)).then(()=>this.createDataChannel(e)).then(()=>this.createLocalOfferOrAnswer(e)).then(o=>this.applyModifiers(o,t)).then(o=>this.setLocalSessionDescription(o)).then(()=>this.waitForIceGatheringComplete(n,a)).then(()=>this.getLocalSessionDescription()).then(o=>({body:o.sdp,contentType:"application/sdp"})).catch(o=>{throw this.logger.error("SessionDescriptionHandler.getDescription failed - "+o),o})}hasDescription(e){return this.logger.debug("SessionDescriptionHandler.hasDescription"),e==="application/sdp"}iceGatheringComplete(){this.logger.debug("SessionDescriptionHandler.iceGatheringComplete"),this.iceGatheringCompleteTimeoutId!==void 0&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - clearing timeout"),clearTimeout(this.iceGatheringCompleteTimeoutId),this.iceGatheringCompleteTimeoutId=void 0),this.iceGatheringCompletePromise!==void 0&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - resolving promise"),this.iceGatheringCompleteResolve&&this.iceGatheringCompleteResolve(),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0)}sendDtmf(e,t){if(this.logger.debug("SessionDescriptionHandler.sendDtmf"),this._peerConnection===void 0)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - peer connection closed"),!1;const s=this._peerConnection.getSenders();if(s.length===0)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no senders"),!1;const i=s[0].dtmf;if(!i)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no DTMF sender"),!1;const n=t==null?void 0:t.duration,a=t==null?void 0:t.interToneGap;try{i.insertDTMF(e,n,a)}catch(o){return this.logger.error(o.toString()),!1}return this.logger.log("SessionDescriptionHandler.sendDtmf sent via RTP: "+e.toString()),!0}setDescription(e,t,s){if(this.logger.debug("SessionDescriptionHandler.setDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=t==null?void 0:t.onDataChannel;const i=this._peerConnection.signalingState==="have-local-offer"?"answer":"offer";return this.getLocalMediaStream(t).then(()=>this.applyModifiers({sdp:e,type:i},s)).then(n=>this.setRemoteSessionDescription(n)).catch(n=>{throw this.logger.error("SessionDescriptionHandler.setDescription failed - "+n),n})}applyModifiers(e,t){return this.logger.debug("SessionDescriptionHandler.applyModifiers"),!t||t.length===0?Promise.resolve(e):t.reduce((s,i)=>s.then(i),Promise.resolve(e)).then(s=>{if(this.logger.debug("SessionDescriptionHandler.applyModifiers - modified sdp"),!s.sdp||!s.type)throw new Error("Invalid SDP.");return{sdp:s.sdp,type:s.type}})}createDataChannel(e){if(this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));if((e==null?void 0:e.dataChannel)!==!0||this._dataChannel)return Promise.resolve();switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.createDataChannel - creating data channel");try{return this._dataChannel=this._peerConnection.createDataChannel((e==null?void 0:e.dataChannelLabel)||"",e==null?void 0:e.dataChannelOptions),this.onDataChannel&&this.onDataChannel(this._dataChannel),Promise.resolve()}catch(t){return Promise.reject(t)}case"have-remote-offer":return Promise.resolve();case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}}createLocalOfferOrAnswer(e){if(this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP offer"),this._peerConnection.createOffer(e==null?void 0:e.offerOptions);case"have-remote-offer":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP answer"),this._peerConnection.createAnswer(e==null?void 0:e.answerOptions);case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}}getLocalMediaStream(e){if(this.logger.debug("SessionDescriptionHandler.getLocalMediaStream"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));let t=Object.assign({},e==null?void 0:e.constraints);if(this.localMediaStreamConstraints){if(t.audio=t.audio||this.localMediaStreamConstraints.audio,t.video=t.video||this.localMediaStreamConstraints.video,JSON.stringify(this.localMediaStreamConstraints.audio)===JSON.stringify(t.audio)&&JSON.stringify(this.localMediaStreamConstraints.video)===JSON.stringify(t.video))return Promise.resolve()}else t.audio===void 0&&t.video===void 0&&(t={audio:!0});return this.localMediaStreamConstraints=t,this.mediaStreamFactory(t,this,e).then(s=>this.setLocalMediaStream(s))}setLocalMediaStream(e){if(this.logger.debug("SessionDescriptionHandler.setLocalMediaStream"),!this._peerConnection)throw new Error("Peer connection undefined.");const t=this._peerConnection,s=this._localMediaStream,i=[],n=d=>{const c=d.kind;if(c!=="audio"&&c!=="video")throw new Error(`Unknown new track kind ${c}.`);const l=t.getSenders().find(g=>g.track&&g.track.kind===c);l?i.push(new Promise(g=>{this.logger.debug(`SessionDescriptionHandler.setLocalMediaStream - replacing sender ${c} track`),g()}).then(()=>l.replaceTrack(d).then(()=>{const g=s.getTracks().find(u=>u.kind===c);g&&(g.stop(),s.removeTrack(g),Bt.dispatchRemoveTrackEvent(s,g)),s.addTrack(d),Bt.dispatchAddTrackEvent(s,d)}).catch(g=>{throw this.logger.error(`SessionDescriptionHandler.setLocalMediaStream - failed to replace sender ${c} track`),g}))):i.push(new Promise(g=>{this.logger.debug(`SessionDescriptionHandler.setLocalMediaStream - adding sender ${c} track`),g()}).then(()=>{try{t.addTrack(d,s)}catch(g){throw this.logger.error(`SessionDescriptionHandler.setLocalMediaStream - failed to add sender ${c} track`),g}s.addTrack(d),Bt.dispatchAddTrackEvent(s,d)}))},a=e.getAudioTracks();a.length&&n(a[0]);const o=e.getVideoTracks();return o.length&&n(o[0]),i.reduce((d,c)=>d.then(()=>c),Promise.resolve())}getLocalSessionDescription(){if(this.logger.debug("SessionDescriptionHandler.getLocalSessionDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));const e=this._peerConnection.localDescription;return e?Promise.resolve(e):Promise.reject(new Error("Failed to get local session description"))}setLocalSessionDescription(e){return this.logger.debug("SessionDescriptionHandler.setLocalSessionDescription"),this._peerConnection===void 0?Promise.reject(new Error("Peer connection closed.")):this._peerConnection.setLocalDescription(e)}setRemoteSessionDescription(e){if(this.logger.debug("SessionDescriptionHandler.setRemoteSessionDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));const t=e.sdp;let s;switch(this._peerConnection.signalingState){case"stable":s="offer";break;case"have-local-offer":s="answer";break;case"have-local-pranswer":case"have-remote-offer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return t?this._peerConnection.setRemoteDescription({sdp:t,type:s}):(this.logger.error("SessionDescriptionHandler.setRemoteSessionDescription failed - cannot set null sdp"),Promise.reject(new Error("SDP is undefined")))}setRemoteTrack(e){this.logger.debug("SessionDescriptionHandler.setRemoteTrack");const t=this._remoteMediaStream;t.getTrackById(e.id)?this.logger.debug(`SessionDescriptionHandler.setRemoteTrack - have remote ${e.kind} track`):e.kind==="audio"?(this.logger.debug(`SessionDescriptionHandler.setRemoteTrack - adding remote ${e.kind} track`),t.getAudioTracks().forEach(s=>{s.stop(),t.removeTrack(s),Bt.dispatchRemoveTrackEvent(t,s)}),t.addTrack(e),Bt.dispatchAddTrackEvent(t,e)):e.kind==="video"&&(this.logger.debug(`SessionDescriptionHandler.setRemoteTrack - adding remote ${e.kind} track`),t.getVideoTracks().forEach(s=>{s.stop(),t.removeTrack(s),Bt.dispatchRemoveTrackEvent(t,s)}),t.addTrack(e),Bt.dispatchAddTrackEvent(t,e))}updateDirection(e){if(this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.updateDirection - setting offer direction");{const t=s=>{switch(s){case"inactive":return e!=null&&e.hold?"inactive":"recvonly";case"recvonly":return e!=null&&e.hold?"inactive":"recvonly";case"sendonly":return e!=null&&e.hold?"sendonly":"sendrecv";case"sendrecv":return e!=null&&e.hold?"sendonly":"sendrecv";case"stopped":return"stopped";default:throw new Error("Should never happen")}};this._peerConnection.getTransceivers().forEach(s=>{if(s.direction){const i=t(s.direction);s.direction!==i&&(s.direction=i)}})}break;case"have-remote-offer":this.logger.debug("SessionDescriptionHandler.updateDirection - setting answer direction");{const t=(()=>{const i=this._peerConnection.remoteDescription;if(!i)throw new Error("Failed to read remote offer");const n=/a=sendrecv\r\n|a=sendonly\r\n|a=recvonly\r\n|a=inactive\r\n/.exec(i.sdp);if(n)switch(n[0]){case`a=inactive\r
191
+ `,this.send(c).catch(l=>{this.logTransportError(l,"Failed to send ACK to non-2xx response.")})}stateTransition(e,t=!1){const s=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case k.Calling:s();break;case k.Proceeding:this.state!==k.Calling&&s();break;case k.Accepted:case k.Completed:this.state!==k.Calling&&this.state!==k.Proceeding&&s();break;case k.Terminated:this.state!==k.Calling&&this.state!==k.Accepted&&this.state!==k.Completed&&(t||s());break;default:s()}this.B&&(clearTimeout(this.B),this.B=void 0),k.Proceeding,e===k.Completed&&(this.D=setTimeout(()=>this.timerD(),$e.TIMER_D)),e===k.Accepted&&(this.M=setTimeout(()=>this.timerM(),$e.TIMER_M)),e===k.Terminated&&this.dispose(),this.setState(e)}timerA(){}timerB(){this.logger.debug(`Timer B expired for INVITE client transaction ${this.id}.`),this.state===k.Calling&&(this.onRequestTimeout(),this.stateTransition(k.Terminated))}timerD(){this.logger.debug(`Timer D expired for INVITE client transaction ${this.id}.`),this.state===k.Completed&&this.stateTransition(k.Terminated)}timerM(){this.logger.debug(`Timer M expired for INVITE client transaction ${this.id}.`),this.state===k.Accepted&&this.stateTransition(k.Terminated)}}class je{constructor(e,t,s,i){this.transactionConstructor=e,this.core=t,this.message=s,this.delegate=i,this.challenged=!1,this.stale=!1,this.logger=this.loggerFactory.getLogger("sip.user-agent-client"),this.init()}dispose(){this.transaction.dispose()}get loggerFactory(){return this.core.loggerFactory}get transaction(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction}cancel(e,t={}){if(!this.transaction)throw new Error("Transaction undefined.");if(!this.message.to)throw new Error("To undefined.");if(!this.message.from)throw new Error("From undefined.");const s=this.core.makeOutgoingRequestMessage(G.CANCEL,this.message.ruri,this.message.from.uri,this.message.to.uri,{toTag:this.message.toTag,fromTag:this.message.fromTag,callId:this.message.callId,cseq:this.message.cseq},t.extraHeaders);return s.branch=this.message.branch,this.message.headers.Route&&(s.headers.Route=this.message.headers.Route),e&&s.setHeader("Reason",e),this.transaction.state===k.Proceeding?new je(Qe,this.core,s):this.transaction.addStateChangeListener(()=>{this.transaction&&this.transaction.state===k.Proceeding&&new je(Qe,this.core,s)},{once:!0}),s}authenticationGuard(e,t){const s=e.statusCode;if(!s)throw new Error("Response status code undefined.");if(s!==401&&s!==407)return!0;let i,n;if(s===401?(i=e.parseHeader("www-authenticate"),n="authorization"):(i=e.parseHeader("proxy-authenticate"),n="proxy-authorization"),!i)return this.logger.warn(s+" with wrong or missing challenge, cannot authenticate"),!0;if(this.challenged&&(this.stale||i.stale!==!0))return this.logger.warn(s+" apparently in authentication loop, cannot authenticate"),!0;if(!this.credentials&&(this.credentials=this.core.configuration.authenticationFactory(),!this.credentials))return this.logger.warn("Unable to obtain credentials, cannot authenticate"),!0;if(!this.credentials.authenticate(this.message,i))return!0;this.challenged=!0,i.stale&&(this.stale=!0);let a=this.message.cseq+=1;return t&&t.localSequenceNumber&&(t.incrementLocalSequenceNumber(),a=this.message.cseq=t.localSequenceNumber),this.message.setHeader("cseq",a+" "+this.message.method),this.message.setHeader(n,this.credentials.toString()),this.init(),!1}onRequestTimeout(){this.logger.warn("User agent client request timed out. Generating internal 408 Request Timeout.");const e=new Gt;e.statusCode=408,e.reasonPhrase="Request Timeout",this.receiveResponse(e)}onTransportError(e){this.logger.error(e.message),this.logger.error("User agent client request transport error. Generating internal 503 Service Unavailable.");const t=new Gt;t.statusCode=503,t.reasonPhrase="Service Unavailable",this.receiveResponse(t)}receiveResponse(e){if(!this.authenticationGuard(e))return;const t=e.statusCode?e.statusCode.toString():"";if(!t)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(t):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(t):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e});break;case/^2[0-9]{2}$/.test(t):this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e});break;case/^3[0-9]{2}$/.test(t):this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(t):this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error(`Invalid status code ${t}`)}}init(){const e={loggerFactory:this.loggerFactory,onRequestTimeout:()=>this.onRequestTimeout(),onStateChange:i=>{i===k.Terminated&&(this.core.userAgentClients.delete(s),t===this._transaction&&this.dispose())},onTransportError:i=>this.onTransportError(i),receiveResponse:i=>this.receiveResponse(i)},t=new this.transactionConstructor(this.message,this.core.transport,e);this._transaction=t;const s=t.id+t.request.method;this.core.userAgentClients.set(s,this)}}class Q0 extends je{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.BYE,s);super(Qe,e.userAgentCore,i,t),e.dispose()}}class et extends Ia{constructor(e,t,s){super(e,t,s,k.Trying,"sip.transaction.nist")}dispose(){this.J&&(clearTimeout(this.J),this.J=void 0),super.dispose()}get kind(){return"nist"}receiveRequest(e){switch(this.state){case k.Trying:break;case k.Proceeding:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch(t=>{this.logTransportError(t,"Failed to send retransmission of provisional response.")});break;case k.Completed:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch(t=>{this.logTransportError(t,"Failed to send retransmission of final response.")});break;case k.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}}receiveResponse(e,t){if(e<100||e>699)throw new Error(`Invalid status code ${e}`);if(e>100&&e<=199)throw new Error("Provisional response other than 100 not allowed.");switch(this.state){case k.Trying:if(this.lastResponse=t,e>=100&&e<200){this.stateTransition(k.Proceeding),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send provisional response.")});return}if(e>=200&&e<=699){this.stateTransition(k.Completed),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send final response.")});return}break;case k.Proceeding:if(this.lastResponse=t,e>=200&&e<=699){this.stateTransition(k.Completed),this.send(t).catch(i=>{this.logTransportError(i,"Failed to send final response.")});return}break;case k.Completed:return;case k.Terminated:break;default:throw new Error(`Invalid state ${this.state}`)}const s=`Non-INVITE server transaction received unexpected ${e} response from TU while in state ${this.state}.`;throw this.logger.error(s),new Error(s)}onTransportError(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(k.Terminated,!0)}typeToString(){return"non-INVITE server transaction"}stateTransition(e,t=!1){const s=()=>{throw new Error(`Invalid state transition from ${this.state} to ${e}`)};switch(e){case k.Trying:s();break;case k.Proceeding:this.state!==k.Trying&&s();break;case k.Completed:this.state!==k.Trying&&this.state!==k.Proceeding&&s();break;case k.Terminated:this.state!==k.Proceeding&&this.state!==k.Completed&&(t||s());break;default:s()}e===k.Completed&&(this.J=setTimeout(()=>this.timerJ(),$e.TIMER_J)),e===k.Terminated&&this.dispose(),this.setState(e)}timerJ(){this.logger.debug(`Timer J expired for NON-INVITE server transaction ${this.id}.`),this.state===k.Completed&&this.stateTransition(k.Terminated)}}class bt{constructor(e,t,s,i){this.transactionConstructor=e,this.core=t,this.message=s,this.delegate=i,this.logger=this.loggerFactory.getLogger("sip.user-agent-server"),this.toTag=s.toTag?s.toTag:ls(),this.init()}dispose(){this.transaction.dispose()}get loggerFactory(){return this.core.loggerFactory}get transaction(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction}accept(e={statusCode:200}){if(!this.acceptable)throw new Vt(`${this.message.method} not acceptable in state ${this.transaction.state}.`);const t=e.statusCode;if(t<200||t>299)throw new TypeError(`Invalid statusCode: ${t}`);return this.reply(e)}progress(e={statusCode:180}){if(!this.progressable)throw new Vt(`${this.message.method} not progressable in state ${this.transaction.state}.`);const t=e.statusCode;if(t<101||t>199)throw new TypeError(`Invalid statusCode: ${t}`);return this.reply(e)}redirect(e,t={statusCode:302}){if(!this.redirectable)throw new Vt(`${this.message.method} not redirectable in state ${this.transaction.state}.`);const s=t.statusCode;if(s<300||s>399)throw new TypeError(`Invalid statusCode: ${s}`);const i=new Array;return e.forEach(a=>i.push(`Contact: ${a.toString()}`)),t.extraHeaders=(t.extraHeaders||[]).concat(i),this.reply(t)}reject(e={statusCode:480}){if(!this.rejectable)throw new Vt(`${this.message.method} not rejectable in state ${this.transaction.state}.`);const t=e.statusCode;if(t<400||t>699)throw new TypeError(`Invalid statusCode: ${t}`);return this.reply(e)}trying(e){if(!this.tryingable)throw new Vt(`${this.message.method} not tryingable in state ${this.transaction.state}.`);return this.reply({statusCode:100})}receiveCancel(e){this.delegate&&this.delegate.onCancel&&this.delegate.onCancel(e)}get acceptable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding||this.transaction.state===k.Accepted;if(this.transaction instanceof et)return this.transaction.state===k.Trying||this.transaction.state===k.Proceeding;throw new Error("Unknown transaction type.")}get progressable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding;if(this.transaction instanceof et)return!1;throw new Error("Unknown transaction type.")}get redirectable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding;if(this.transaction instanceof et)return this.transaction.state===k.Trying||this.transaction.state===k.Proceeding;throw new Error("Unknown transaction type.")}get rejectable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding;if(this.transaction instanceof et)return this.transaction.state===k.Trying||this.transaction.state===k.Proceeding;throw new Error("Unknown transaction type.")}get tryingable(){if(this.transaction instanceof Ke)return this.transaction.state===k.Proceeding;if(this.transaction instanceof et)return this.transaction.state===k.Trying;throw new Error("Unknown transaction type.")}reply(e){!e.toTag&&e.statusCode!==100&&(e.toTag=this.toTag),e.userAgent=e.userAgent||this.core.configuration.userAgentHeaderFieldValue,e.supported=e.supported||this.core.configuration.supportedOptionTagsResponse;const t=ka(this.message,e);return this.transaction.receiveResponse(e.statusCode,t.message),t}init(){const e={loggerFactory:this.loggerFactory,onStateChange:i=>{i===k.Terminated&&(this.core.userAgentServers.delete(s),this.dispose())},onTransportError:i=>{this.logger.error(i.message),this.delegate&&this.delegate.onTransportError?this.delegate.onTransportError(i):this.logger.error("User agent server response transport error.")}},t=new this.transactionConstructor(this.message,this.core.transport,e);this._transaction=t;const s=t.id;this.core.userAgentServers.set(t.id,this)}}class ec extends bt{constructor(e,t,s){super(et,e.userAgentCore,t,s)}}class tc extends je{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.INFO,s);super(Qe,e.userAgentCore,i,t)}}class rc extends bt{constructor(e,t,s){super(et,e.userAgentCore,t,s)}}class Ha extends je{constructor(e,t,s){super(Qe,e,t,s)}}class Pa extends bt{constructor(e,t,s){super(et,e,t,s)}}class sc extends je{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.NOTIFY,s);super(Qe,e.userAgentCore,i,t)}}function ic(r){return r.userAgentCore!==void 0}class fs extends bt{constructor(e,t,s){const i=ic(e)?e.userAgentCore:e;super(et,i,t,s)}}class nc extends je{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.PRACK,s);super(Qe,e.userAgentCore,i,t),e.signalingStateTransition(i)}}class ac extends bt{constructor(e,t,s){super(et,e.userAgentCore,t,s),e.signalingStateTransition(t),this.dialog=e}accept(e={statusCode:200}){return e.body&&this.dialog.signalingStateTransition(e.body),super.accept(e)}}class oc extends je{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.INVITE,s);super(Zt,e.userAgentCore,i,t),this.delegate=t,e.signalingStateTransition(i),e.reinviteUserAgentClient=this,this.dialog=e}receiveResponse(e){if(!this.authenticationGuard(e,this.dialog))return;const t=e.statusCode?e.statusCode.toString():"";if(!t)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(t):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(t):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:this.dialog,prack:s=>{throw new Error("Unimplemented.")}});break;case/^2[0-9]{2}$/.test(t):this.dialog.signalingStateTransition(e),this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e,session:this.dialog,ack:s=>this.dialog.ack(s)});break;case/^3[0-9]{2}$/.test(t):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(t):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error(`Invalid status code ${t}`)}}}class cc extends bt{constructor(e,t,s){super(Ke,e.userAgentCore,t,s),e.reinviteUserAgentServer=this,this.dialog=e}accept(e={statusCode:200}){e.extraHeaders=e.extraHeaders||[],e.extraHeaders=e.extraHeaders.concat(this.dialog.routeSet.map(n=>`Record-Route: ${n}`));const t=super.accept(e),s=this.dialog,i=Object.assign(Object.assign({},t),{session:s});return e.body&&this.dialog.signalingStateTransition(e.body),this.dialog.reConfirm(),i}progress(e={statusCode:180}){const t=super.progress(e),s=this.dialog,i=Object.assign(Object.assign({},t),{session:s});return e.body&&this.dialog.signalingStateTransition(e.body),i}redirect(e,t={statusCode:302}){throw this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,new Error("Unimplemented.")}reject(e={statusCode:488}){return this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,super.reject(e)}}class lc extends je{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.REFER,s);super(Qe,e.userAgentCore,i,t)}}function dc(r){return r.userAgentCore!==void 0}class $a extends bt{constructor(e,t,s){const i=dc(e)?e.userAgentCore:e;super(et,i,t,s)}}class gs extends wr{constructor(e,t,s,i){super(t,s),this.initialTransaction=e,this._signalingState=L.Initial,this.ackWait=!1,this.ackProcessing=!1,this.delegate=i,e instanceof Ke&&(this.ackWait=!0),this.early||this.start2xxRetransmissionTimer(),this.signalingStateTransition(e.request),this.logger=t.loggerFactory.getLogger("sip.invite-dialog"),this.logger.log(`INVITE dialog ${this.id} constructed`)}dispose(){super.dispose(),this._signalingState=L.Closed,this._offer=void 0,this._answer=void 0,this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.logger.log(`INVITE dialog ${this.id} destroyed`)}get sessionState(){return this.early?st.Early:this.ackWait?st.AckWait:this._signalingState===L.Closed?st.Terminated:st.Confirmed}get signalingState(){return this._signalingState}get offer(){return this._offer}get answer(){return this._answer}confirm(){this.early&&this.start2xxRetransmissionTimer(),super.confirm()}reConfirm(){this.reinviteUserAgentServer&&this.startReInvite2xxRetransmissionTimer()}ack(e={}){this.logger.log(`INVITE dialog ${this.id} sending ACK request`);let t;if(this.reinviteUserAgentClient){if(!(this.reinviteUserAgentClient.transaction instanceof Zt))throw new Error("Transaction not instance of InviteClientTransaction.");t=this.reinviteUserAgentClient.transaction,this.reinviteUserAgentClient=void 0}else{if(!(this.initialTransaction instanceof Zt))throw new Error("Initial transaction not instance of InviteClientTransaction.");t=this.initialTransaction}const s=this.createOutgoingRequestMessage(G.ACK,{cseq:t.request.cseq,extraHeaders:e.extraHeaders,body:e.body});return t.ackResponse(s),this.signalingStateTransition(s),{message:s}}bye(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending BYE request`),this.initialTransaction instanceof Ke){if(this.early)throw new Error("UAS MUST NOT send a BYE on early dialogs.");if(this.ackWait&&this.initialTransaction.state!==k.Terminated)throw new Error("UAS MUST NOT send a BYE on a confirmed dialog until it has received an ACK for its 2xx response or until the server transaction times out.")}return new Q0(this,e,t)}info(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending INFO request`),this.early)throw new Error("Dialog not confirmed.");return new tc(this,e,t)}invite(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending INVITE request`),this.early)throw new Error("Dialog not confirmed.");if(this.reinviteUserAgentClient)throw new Error("There is an ongoing re-INVITE client transaction.");if(this.reinviteUserAgentServer)throw new Error("There is an ongoing re-INVITE server transaction.");return new oc(this,e,t)}message(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending MESSAGE request`),this.early)throw new Error("Dialog not confirmed.");const s=this.createOutgoingRequestMessage(G.MESSAGE,t);return new Ha(this.core,s,e)}notify(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending NOTIFY request`),this.early)throw new Error("Dialog not confirmed.");return new sc(this,e,t)}prack(e,t){return this.logger.log(`INVITE dialog ${this.id} sending PRACK request`),new nc(this,e,t)}refer(e,t){if(this.logger.log(`INVITE dialog ${this.id} sending REFER request`),this.early)throw new Error("Dialog not confirmed.");return new lc(this,e,t)}receiveRequest(e){if(this.logger.log(`INVITE dialog ${this.id} received ${e.method} request`),e.method===G.ACK){if(this.ackWait){if(this.initialTransaction instanceof Zt){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}if(this.initialTransaction.request.cseq!==e.cseq){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}this.ackWait=!1}else{if(!this.reinviteUserAgentServer){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}if(this.reinviteUserAgentServer.transaction.request.cseq!==e.cseq){this.logger.warn(`INVITE dialog ${this.id} received unexpected ${e.method} request, dropping.`);return}this.reinviteUserAgentServer=void 0}if(this.signalingStateTransition(e),this.delegate&&this.delegate.onAck){const t=this.delegate.onAck({message:e});t instanceof Promise&&(this.ackProcessing=!0,t.then(()=>this.ackProcessing=!1).catch(()=>this.ackProcessing=!1))}return}if(!this.sequenceGuard(e)){this.logger.log(`INVITE dialog ${this.id} rejected out of order ${e.method} request.`);return}if(super.receiveRequest(e),e.method===G.INVITE){const t=()=>{const n=this.ackWait?"waiting for initial ACK":"processing initial ACK";this.logger.warn(`INVITE dialog ${this.id} received re-INVITE while ${n}`);let a="RFC 5407 suggests the following to avoid this race condition... ";a+=" Note: Implementation issues are outside the scope of this document,",a+=" but the following tip is provided for avoiding race conditions of",a+=" this type. The caller can delay sending re-INVITE F6 for some period",a+=" of time (2 seconds, perhaps), after which the caller can reasonably",a+=" assume that its ACK has been received. Implementors can decouple the",a+=" actions of the user (e.g., pressing the hold button) from the actions",a+=" of the protocol (the sending of re-INVITE F6), so that the UA can",a+=" behave like this. In this case, it is the implementor's choice as to",a+=" how long to wait. In most cases, such an implementation may be",a+=" useful to prevent the type of race condition shown in this section.",a+=" This document expresses no preference about whether or not they",a+=" should wait for an ACK to be delivered. After considering the impact",a+=" on user experience, implementors should decide whether or not to wait",a+=" for a while, because the user experience depends on the",a+=" implementation and has no direct bearing on protocol behavior.",this.logger.warn(a)},i=[`Retry-After: ${Math.floor(Math.random()*10)+1}`];if(this.ackProcessing){this.core.replyStateless(e,{statusCode:500,extraHeaders:i}),t();return}if(this.ackWait&&this.signalingState!==L.Stable){this.core.replyStateless(e,{statusCode:500,extraHeaders:i}),t();return}if(this.reinviteUserAgentServer){this.core.replyStateless(e,{statusCode:500,extraHeaders:i});return}if(this.reinviteUserAgentClient){this.core.replyStateless(e,{statusCode:491});return}}if(e.method===G.INVITE){const t=e.parseHeader("contact");if(!t)throw new Error("Contact undefined.");if(!(t instanceof ze))throw new Error("Contact not instance of NameAddrHeader.");this.dialogState.remoteTarget=t.uri}switch(e.method){case G.BYE:{const t=new ec(this,e);this.delegate&&this.delegate.onBye?this.delegate.onBye(t):t.accept(),this.dispose()}break;case G.INFO:{const t=new rc(this,e);this.delegate&&this.delegate.onInfo?this.delegate.onInfo(t):t.reject({statusCode:469,extraHeaders:["Recv-Info:"]})}break;case G.INVITE:{const t=new cc(this,e);this.signalingStateTransition(e),this.delegate&&this.delegate.onInvite?this.delegate.onInvite(t):t.reject({statusCode:488})}break;case G.MESSAGE:{const t=new Pa(this.core,e);this.delegate&&this.delegate.onMessage?this.delegate.onMessage(t):t.accept()}break;case G.NOTIFY:{const t=new fs(this,e);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(t):t.accept()}break;case G.PRACK:{const t=new ac(this,e);this.delegate&&this.delegate.onPrack?this.delegate.onPrack(t):t.accept()}break;case G.REFER:{const t=new $a(this,e);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(t):t.reject()}break;default:this.logger.log(`INVITE dialog ${this.id} received unimplemented ${e.method} request`),this.core.replyStateless(e,{statusCode:501});break}}reliableSequenceGuard(e){const t=e.statusCode;if(!t)throw new Error("Status code undefined");if(t>100&&t<200){const s=e.getHeader("require"),i=e.getHeader("rseq"),n=s&&s.includes("100rel")&&i?Number(i):void 0;if(n){if(this.rseq&&this.rseq+1!==n)return!1;this.rseq=this.rseq?this.rseq+1:n}}return!0}signalingStateRollback(){(this._signalingState===L.HaveLocalOffer||this.signalingState===L.HaveRemoteOffer)&&this._rollbackOffer&&this._rollbackAnswer&&(this._signalingState=L.Stable,this._offer=this._rollbackOffer,this._answer=this._rollbackAnswer)}signalingStateTransition(e){const t=jr(e);if(!(!t||t.contentDisposition!=="session")){if(this._signalingState===L.Stable&&(this._rollbackOffer=this._offer,this._rollbackAnswer=this._answer),e instanceof yr)switch(this._signalingState){case L.Initial:case L.Stable:this._signalingState=L.HaveRemoteOffer,this._offer=t,this._answer=void 0;break;case L.HaveLocalOffer:this._signalingState=L.Stable,this._answer=t;break;case L.HaveRemoteOffer:break;case L.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof Gt)switch(this._signalingState){case L.Initial:case L.Stable:this._signalingState=L.HaveRemoteOffer,this._offer=t,this._answer=void 0;break;case L.HaveLocalOffer:this._signalingState=L.Stable,this._answer=t;break;case L.HaveRemoteOffer:break;case L.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof cr)switch(this._signalingState){case L.Initial:case L.Stable:this._signalingState=L.HaveLocalOffer,this._offer=t,this._answer=void 0;break;case L.HaveLocalOffer:break;case L.HaveRemoteOffer:this._signalingState=L.Stable,this._answer=t;break;case L.Closed:break;default:throw new Error("Unexpected signaling state.")}if(Aa(e))switch(this._signalingState){case L.Initial:case L.Stable:this._signalingState=L.HaveLocalOffer,this._offer=t,this._answer=void 0;break;case L.HaveLocalOffer:break;case L.HaveRemoteOffer:this._signalingState=L.Stable,this._answer=t;break;case L.Closed:break;default:throw new Error("Unexpected signaling state.")}}}start2xxRetransmissionTimer(){if(this.initialTransaction instanceof Ke){const e=this.initialTransaction;let t=$e.T1;const s=()=>{if(!this.ackWait){this.invite2xxTimer=void 0;return}this.logger.log("No ACK for 2xx response received, attempting retransmission"),e.retransmitAcceptedResponse(),t=Math.min(t*2,$e.T2),this.invite2xxTimer=setTimeout(s,t)};this.invite2xxTimer=setTimeout(s,t);const i=()=>{e.state===k.Terminated&&(e.removeStateChangeListener(i),this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.ackWait&&(this.delegate&&this.delegate.onAckTimeout?this.delegate.onAckTimeout():this.bye()))};e.addStateChangeListener(i)}}startReInvite2xxRetransmissionTimer(){if(this.reinviteUserAgentServer&&this.reinviteUserAgentServer.transaction instanceof Ke){const e=this.reinviteUserAgentServer.transaction;let t=$e.T1;const s=()=>{if(!this.reinviteUserAgentServer){this.invite2xxTimer=void 0;return}this.logger.log("No ACK for 2xx response received, attempting retransmission"),e.retransmitAcceptedResponse(),t=Math.min(t*2,$e.T2),this.invite2xxTimer=setTimeout(s,t)};this.invite2xxTimer=setTimeout(s,t);const i=()=>{e.state===k.Terminated&&(e.removeStateChangeListener(i),this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.reinviteUserAgentServer)};e.addStateChangeListener(i)}}}class hc extends je{constructor(e,t,s){super(Zt,e,t,s),this.confirmedDialogAcks=new Map,this.confirmedDialogs=new Map,this.earlyDialogs=new Map,this.delegate=s}dispose(){this.earlyDialogs.forEach(e=>e.dispose()),this.earlyDialogs.clear(),super.dispose()}onTransportError(e){if(this.transaction.state===k.Calling)return super.onTransportError(e);this.logger.error(e.message),this.logger.error("User agent client request transport error while sending ACK.")}receiveResponse(e){if(!this.authenticationGuard(e))return;const t=e.statusCode?e.statusCode.toString():"";if(!t)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(t):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});return;case/^1[0-9]{2}$/.test(t):{if(!e.toTag){this.logger.warn("Non-100 1xx INVITE response received without a to tag, dropping.");return}if(!e.parseHeader("contact")){this.logger.error("Non-100 1xx INVITE response received without a Contact header field, dropping.");return}const i=wr.initialDialogStateForUserAgentClient(this.message,e);let n=this.earlyDialogs.get(i.id);if(!n){const o=this.transaction;if(!(o instanceof Zt))throw new Error("Transaction not instance of InviteClientTransaction.");n=new gs(o,this.core,i),this.earlyDialogs.set(n.id,n)}if(!n.reliableSequenceGuard(e)){this.logger.warn("1xx INVITE reliable response received out of order or is a retransmission, dropping.");return}(n.signalingState===L.Initial||n.signalingState===L.HaveLocalOffer)&&n.signalingStateTransition(e);const a=n;this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:a,prack:o=>a.prack(void 0,o)})}return;case/^2[0-9]{2}$/.test(t):{if(!e.toTag){this.logger.error("2xx INVITE response received without a to tag, dropping.");return}if(!e.parseHeader("contact")){this.logger.error("2xx INVITE response received without a Contact header field, dropping.");return}const i=wr.initialDialogStateForUserAgentClient(this.message,e);let n=this.confirmedDialogs.get(i.id);if(n){const o=this.confirmedDialogAcks.get(i.id);if(o){const d=this.transaction;if(!(d instanceof Zt))throw new Error("Client transaction not instance of InviteClientTransaction.");d.ackResponse(o.message)}return}if(n=this.earlyDialogs.get(i.id),n)n.confirm(),n.recomputeRouteSet(e),this.earlyDialogs.delete(n.id),this.confirmedDialogs.set(n.id,n);else{const o=this.transaction;if(!(o instanceof Zt))throw new Error("Transaction not instance of InviteClientTransaction.");n=new gs(o,this.core,i),this.confirmedDialogs.set(n.id,n)}(n.signalingState===L.Initial||n.signalingState===L.HaveLocalOffer)&&n.signalingStateTransition(e);const a=n;if(this.delegate&&this.delegate.onAccept)this.delegate.onAccept({message:e,session:a,ack:o=>{const d=a.ack(o);return this.confirmedDialogAcks.set(a.id,d),d}});else{const o=a.ack();this.confirmedDialogAcks.set(a.id,o)}}return;case/^3[0-9]{2}$/.test(t):this.earlyDialogs.forEach(s=>s.dispose()),this.earlyDialogs.clear(),this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});return;case/^[4-6][0-9]{2}$/.test(t):this.earlyDialogs.forEach(s=>s.dispose()),this.earlyDialogs.clear(),this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});return;default:throw new Error(`Invalid status code ${t}`)}}}class ji extends bt{constructor(e,t,s){super(Ke,e,t,s),this.core=e}dispose(){this.earlyDialog&&this.earlyDialog.dispose(),super.dispose()}accept(e={statusCode:200}){if(!this.acceptable)throw new Vt(`${this.message.method} not acceptable in state ${this.transaction.state}.`);if(!this.confirmedDialog)if(this.earlyDialog)this.earlyDialog.confirm(),this.confirmedDialog=this.earlyDialog,this.earlyDialog=void 0;else{const d=this.transaction;if(!(d instanceof Ke))throw new Error("Transaction not instance of InviteClientTransaction.");const c=wr.initialDialogStateForUserAgentServer(this.message,this.toTag);this.confirmedDialog=new gs(d,this.core,c)}const t=this.message.getHeaders("record-route").map(d=>`Record-Route: ${d}`),s=`Contact: ${this.core.configuration.contact.toString()}`,i="Allow: "+zt.toString();if(!e.body){if(this.confirmedDialog.signalingState===L.Stable)e.body=this.confirmedDialog.answer;else if(this.confirmedDialog.signalingState===L.Initial||this.confirmedDialog.signalingState===L.HaveRemoteOffer)throw new Error("Response must have a body.")}e.statusCode=e.statusCode||200,e.extraHeaders=e.extraHeaders||[],e.extraHeaders=e.extraHeaders.concat(t),e.extraHeaders.push(i),e.extraHeaders.push(s);const n=super.accept(e),a=this.confirmedDialog,o=Object.assign(Object.assign({},n),{session:a});return e.body&&this.confirmedDialog.signalingState!==L.Stable&&this.confirmedDialog.signalingStateTransition(e.body),o}progress(e={statusCode:180}){if(!this.progressable)throw new Vt(`${this.message.method} not progressable in state ${this.transaction.state}.`);if(!this.earlyDialog){const o=this.transaction;if(!(o instanceof Ke))throw new Error("Transaction not instance of InviteClientTransaction.");const d=wr.initialDialogStateForUserAgentServer(this.message,this.toTag,!0);this.earlyDialog=new gs(o,this.core,d)}const t=this.message.getHeaders("record-route").map(o=>`Record-Route: ${o}`),s=`Contact: ${this.core.configuration.contact}`;e.extraHeaders=e.extraHeaders||[],e.extraHeaders=e.extraHeaders.concat(t),e.extraHeaders.push(s);const i=super.progress(e),n=this.earlyDialog,a=Object.assign(Object.assign({},i),{session:n});return e.body&&this.earlyDialog.signalingState!==L.Stable&&this.earlyDialog.signalingStateTransition(e.body),a}redirect(e,t={statusCode:302}){return super.redirect(e,t)}reject(e={statusCode:486}){return super.reject(e)}}class uc extends je{constructor(e,t,s){super(Qe,e,t,s)}}class fc extends je{constructor(e,t,s){super(Qe,e,t,s)}}class gc extends bt{constructor(e,t,s){super(et,e,t,s),this.core=e}}class xc extends je{constructor(e,t,s){const i=e.createOutgoingRequestMessage(G.SUBSCRIBE,s);super(Qe,e.userAgentCore,i,t),this.dialog=e}waitNotifyStop(){}receiveResponse(e){if(e.statusCode&&e.statusCode>=200&&e.statusCode<300){const t=e.getHeader("Expires");if(!t)this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE");else{const s=Number(t);this.dialog.subscriptionExpires>s&&(this.dialog.subscriptionExpires=s)}}e.statusCode&&e.statusCode>=400&&e.statusCode<700&&[404,405,410,416,480,481,482,483,484,485,489,501,604].includes(e.statusCode)&&this.dialog.terminate(),super.receiveResponse(e)}}class Oa extends wr{constructor(e,t,s,i,n,a){super(i,n),this.delegate=a,this._autoRefresh=!1,this._subscriptionEvent=e,this._subscriptionExpires=t,this._subscriptionExpiresInitial=t,this._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),this._subscriptionRefresh=void 0,this._subscriptionRefreshLastSet=void 0,this._subscriptionState=s,this.logger=i.loggerFactory.getLogger("sip.subscribe-dialog"),this.logger.log(`SUBSCRIBE dialog ${this.id} constructed`)}static initialDialogStateForSubscription(e,t){const i=t.getHeaders("record-route"),n=t.parseHeader("contact");if(!n)throw new Error("Contact undefined.");if(!(n instanceof ze))throw new Error("Contact not instance of NameAddrHeader.");const a=n.uri,o=e.cseq,d=void 0,c=e.callId,l=e.fromTag,g=t.fromTag;if(!c)throw new Error("Call id undefined.");if(!l)throw new Error("From tag undefined.");if(!g)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");const u=e.from.uri,y=e.to.uri;return{id:c+l+g,early:!1,callId:c,localTag:l,remoteTag:g,localSequenceNumber:o,remoteSequenceNumber:d,localURI:u,remoteURI:y,remoteTarget:a,routeSet:i,secure:!1}}dispose(){super.dispose(),this.N&&(clearTimeout(this.N),this.N=void 0),this.refreshTimerClear(),this.logger.log(`SUBSCRIBE dialog ${this.id} destroyed`)}get autoRefresh(){return this._autoRefresh}set autoRefresh(e){this._autoRefresh=!0,this.refreshTimerSet()}get subscriptionEvent(){return this._subscriptionEvent}get subscriptionExpires(){const e=Math.floor(Date.now()/1e3)-this._subscriptionExpiresLastSet,t=this._subscriptionExpires-e;return Math.max(t,0)}set subscriptionExpires(e){if(e<0)throw new Error("Expires must be greater than or equal to zero.");if(this._subscriptionExpires=e,this._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),this.autoRefresh){const t=this.subscriptionRefresh;(t===void 0||t>=e)&&this.refreshTimerSet()}}get subscriptionExpiresInitial(){return this._subscriptionExpiresInitial}get subscriptionRefresh(){if(this._subscriptionRefresh===void 0||this._subscriptionRefreshLastSet===void 0)return;const e=Math.floor(Date.now()/1e3)-this._subscriptionRefreshLastSet,t=this._subscriptionRefresh-e;return Math.max(t,0)}get subscriptionState(){return this._subscriptionState}receiveRequest(e){if(this.logger.log(`SUBSCRIBE dialog ${this.id} received ${e.method} request`),!this.sequenceGuard(e)){this.logger.log(`SUBSCRIBE dialog ${this.id} rejected out of order ${e.method} request.`);return}switch(super.receiveRequest(e),e.method){case G.NOTIFY:this.onNotify(e);break;default:this.logger.log(`SUBSCRIBE dialog ${this.id} received unimplemented ${e.method} request`),this.core.replyStateless(e,{statusCode:501});break}}refresh(){const e="Allow: "+zt.toString(),t={};return t.extraHeaders=(t.extraHeaders||[]).slice(),t.extraHeaders.push(e),t.extraHeaders.push("Event: "+this.subscriptionEvent),t.extraHeaders.push("Expires: "+this.subscriptionExpiresInitial),t.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,t)}subscribe(e,t={}){var s;if(this.subscriptionState!==fe.Pending&&this.subscriptionState!==fe.Active)throw new Error(`Invalid state ${this.subscriptionState}. May only re-subscribe while in state "pending" or "active".`);this.logger.log(`SUBSCRIBE dialog ${this.id} sending SUBSCRIBE request`);const i=new xc(this,e,t);return this.N&&(clearTimeout(this.N),this.N=void 0),!((s=t.extraHeaders)===null||s===void 0)&&s.includes("Expires: 0")||(this.N=setTimeout(()=>this.timerN(),$e.TIMER_N)),i}terminate(){this.stateTransition(fe.Terminated),this.onTerminated()}unsubscribe(){const e="Allow: "+zt.toString(),t={};return t.extraHeaders=(t.extraHeaders||[]).slice(),t.extraHeaders.push(e),t.extraHeaders.push("Event: "+this.subscriptionEvent),t.extraHeaders.push("Expires: 0"),t.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,t)}onNotify(e){const t=e.parseHeader("Event").event;if(!t||t!==this.subscriptionEvent){this.core.replyStateless(e,{statusCode:489});return}this.N&&(clearTimeout(this.N),this.N=void 0);const s=e.parseHeader("Subscription-State");if(!s||!s.state){this.core.replyStateless(e,{statusCode:489});return}const i=s.state,n=s.expires?Math.max(s.expires,0):void 0;switch(i){case"pending":this.stateTransition(fe.Pending,n);break;case"active":this.stateTransition(fe.Active,n);break;case"terminated":this.stateTransition(fe.Terminated,n);break;default:this.logger.warn("Unrecognized subscription state.");break}const a=new fs(this,e);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(a):a.accept()}onRefresh(e){this.delegate&&this.delegate.onRefresh&&this.delegate.onRefresh(e)}onTerminated(){this.delegate&&this.delegate.onTerminated&&this.delegate.onTerminated()}refreshTimerClear(){this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)}refreshTimerSet(){if(this.refreshTimerClear(),this.autoRefresh&&this.subscriptionExpires>0){const e=this.subscriptionExpires*900;this._subscriptionRefresh=Math.floor(e/1e3),this._subscriptionRefreshLastSet=Math.floor(Date.now()/1e3),this.refreshTimer=setTimeout(()=>{this.refreshTimer=void 0,this._subscriptionRefresh=void 0,this._subscriptionRefreshLastSet=void 0,this.onRefresh(this.refresh())},e)}}stateTransition(e,t){const s=()=>{this.logger.warn(`Invalid subscription state transition from ${this.subscriptionState} to ${e}`)};switch(e){case fe.Initial:s();return;case fe.NotifyWait:s();return;case fe.Pending:if(this.subscriptionState!==fe.NotifyWait&&this.subscriptionState!==fe.Pending){s();return}break;case fe.Active:if(this.subscriptionState!==fe.NotifyWait&&this.subscriptionState!==fe.Pending&&this.subscriptionState!==fe.Active){s();return}break;case fe.Terminated:if(this.subscriptionState!==fe.NotifyWait&&this.subscriptionState!==fe.Pending&&this.subscriptionState!==fe.Active){s();return}break;default:s();return}e===fe.Pending&&t&&(this.subscriptionExpires=t),e===fe.Active&&t&&(this.subscriptionExpires=t),e===fe.Terminated&&this.dispose(),this._subscriptionState=e}timerN(){this.logger.warn("Timer N expired for SUBSCRIBE dialog. Timed out waiting for NOTIFY."),this.subscriptionState!==fe.Terminated&&(this.stateTransition(fe.Terminated),this.onTerminated())}}class pc extends je{constructor(e,t,s){const i=t.getHeader("Event");if(!i)throw new Error("Event undefined");const n=t.getHeader("Expires");if(!n)throw new Error("Expires undefined");super(Qe,e,t,s),this.delegate=s,this.subscriberId=t.callId+t.fromTag+i,this.subscriptionExpiresRequested=this.subscriptionExpires=Number(n),this.subscriptionEvent=i,this.subscriptionState=fe.NotifyWait,this.waitNotifyStart()}dispose(){super.dispose()}onNotify(e){const t=e.message.parseHeader("Event").event;if(!t||t!==this.subscriptionEvent){this.logger.warn("Failed to parse event."),e.reject({statusCode:489});return}const s=e.message.parseHeader("Subscription-State");if(!s||!s.state){this.logger.warn("Failed to parse subscription state."),e.reject({statusCode:489});return}const i=s.state;switch(i){case"pending":break;case"active":break;case"terminated":break;default:this.logger.warn(`Invalid subscription state ${i}`),e.reject({statusCode:489});return}if(i!=="terminated"&&!e.message.parseHeader("contact")){this.logger.warn("Failed to parse contact."),e.reject({statusCode:489});return}if(this.dialog)throw new Error("Dialog already created. This implementation only supports install of single subscriptions.");switch(this.waitNotifyStop(),this.subscriptionExpires=s.expires?Math.min(this.subscriptionExpires,Math.max(s.expires,0)):this.subscriptionExpires,i){case"pending":this.subscriptionState=fe.Pending;break;case"active":this.subscriptionState=fe.Active;break;case"terminated":this.subscriptionState=fe.Terminated;break;default:throw new Error(`Unrecognized state ${i}.`)}if(this.subscriptionState!==fe.Terminated){const n=Oa.initialDialogStateForSubscription(this.message,e.message);this.dialog=new Oa(this.subscriptionEvent,this.subscriptionExpires,this.subscriptionState,this.core,n)}if(this.delegate&&this.delegate.onNotify){const n=e,a=this.dialog;this.delegate.onNotify({request:n,subscription:a})}else e.accept()}waitNotifyStart(){this.N||(this.core.subscribers.set(this.subscriberId,this),this.N=setTimeout(()=>this.timerN(),$e.TIMER_N))}waitNotifyStop(){this.N&&(this.core.subscribers.delete(this.subscriberId),clearTimeout(this.N),this.N=void 0)}receiveResponse(e){if(this.authenticationGuard(e)){if(e.statusCode&&e.statusCode>=200&&e.statusCode<300){const t=e.getHeader("Expires");if(!t)this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE");else{const s=Number(t);s>this.subscriptionExpiresRequested&&this.logger.warn("Expires header in a 200-class response to SUBSCRIBE with a higher value than the one in the request"),s<this.subscriptionExpires&&(this.subscriptionExpires=s)}this.dialog&&this.dialog.subscriptionExpires>this.subscriptionExpires&&(this.dialog.subscriptionExpires=this.subscriptionExpires)}e.statusCode&&e.statusCode>=300&&e.statusCode<700&&this.waitNotifyStop(),super.receiveResponse(e)}}timerN(){this.logger.warn("Timer N expired for SUBSCRIBE user agent client. Timed out waiting for NOTIFY."),this.waitNotifyStop(),this.delegate&&this.delegate.onNotifyTimeout&&this.delegate.onNotifyTimeout()}}class mc extends bt{constructor(e,t,s){super(et,e,t,s),this.core=e}}const Na=["application/sdp","application/dtmf-relay"];class vc{constructor(e,t={}){this.userAgentClients=new Map,this.userAgentServers=new Map,this.configuration=e,this.delegate=t,this.dialogs=new Map,this.subscribers=new Map,this.logger=e.loggerFactory.getLogger("sip.user-agent-core")}dispose(){this.reset()}reset(){this.dialogs.forEach(e=>e.dispose()),this.dialogs.clear(),this.subscribers.forEach(e=>e.dispose()),this.subscribers.clear(),this.userAgentClients.forEach(e=>e.dispose()),this.userAgentClients.clear(),this.userAgentServers.forEach(e=>e.dispose()),this.userAgentServers.clear()}get loggerFactory(){return this.configuration.loggerFactory}get transport(){const e=this.configuration.transportAccessor();if(!e)throw new Error("Transport undefined.");return e}invite(e,t){return new hc(this,e,t)}message(e,t){return new Ha(this,e,t)}publish(e,t){return new uc(this,e,t)}register(e,t){return new fc(this,e,t)}subscribe(e,t){return new pc(this,e,t)}request(e,t){return new je(Qe,this,e,t)}makeOutgoingRequestMessage(e,t,s,i,n,a,o){const d=this.configuration.sipjsId,c=this.configuration.displayName,l=this.configuration.viaForceRport,g=this.configuration.hackViaTcp,u=this.configuration.supportedOptionTags.slice();e===G.REGISTER&&u.push("path","gruu"),e===G.INVITE&&(this.configuration.contact.pubGruu||this.configuration.contact.tempGruu)&&u.push("gruu");const y=this.configuration.routeSet,w=this.configuration.userAgentHeaderFieldValue,b=this.configuration.viaHost,x=Object.assign(Object.assign({},{callIdPrefix:d,forceRport:l,fromDisplayName:c,hackViaTcp:g,optionTags:u,routeSet:y,userAgentString:w,viaHost:b}),n);return new cr(e,t,s,i,x,a,o)}receiveIncomingRequestFromTransport(e){this.receiveRequestFromTransport(e)}receiveIncomingResponseFromTransport(e){this.receiveResponseFromTransport(e)}replyStateless(e,t){const s=this.configuration.userAgentHeaderFieldValue,i=this.configuration.supportedOptionTagsResponse;t=Object.assign(Object.assign({},t),{userAgent:s,supported:i});const n=ka(e,t);return this.transport.send(n.message).catch(a=>{a instanceof Error&&this.logger.error(a.message),this.logger.error(`Transport error occurred sending stateless reply to ${e.method} request.`)}),n}receiveRequestFromTransport(e){const t=e.viaBranch,s=this.userAgentServers.get(t);if(e.method===G.ACK&&s&&s.transaction.state===k.Accepted&&s instanceof ji){this.logger.warn(`Discarding out of dialog ACK after 2xx response sent on transaction ${t}.`);return}if(e.method===G.CANCEL){s?(this.replyStateless(e,{statusCode:200}),s.transaction instanceof Ke&&s.transaction.state===k.Proceeding&&s instanceof ji&&s.receiveCancel(e)):this.replyStateless(e,{statusCode:481});return}if(s){s.transaction.receiveRequest(e);return}this.receiveRequest(e)}receiveRequest(e){if(!zt.includes(e.method)){const i="Allow: "+zt.toString();this.replyStateless(e,{statusCode:405,extraHeaders:[i]});return}if(!e.ruri)throw new Error("Request-URI undefined.");if(e.ruri.scheme!=="sip"){this.replyStateless(e,{statusCode:416});return}const t=e.ruri,s=i=>!!i&&i.user===t.user;if(!s(this.configuration.aor)&&!(s(this.configuration.contact.uri)||s(this.configuration.contact.pubGruu)||s(this.configuration.contact.tempGruu))){this.logger.warn("Request-URI does not point to us."),e.method!==G.ACK&&this.replyStateless(e,{statusCode:404});return}if(e.method===G.INVITE&&!e.hasHeader("Contact")){this.replyStateless(e,{statusCode:400,reasonPhrase:"Missing Contact Header"});return}if(!e.toTag){const i=e.viaBranch;if(!this.userAgentServers.has(i)&&Array.from(this.userAgentServers.values()).some(a=>a.transaction.request.fromTag===e.fromTag&&a.transaction.request.callId===e.callId&&a.transaction.request.cseq===e.cseq)){this.replyStateless(e,{statusCode:482});return}}e.toTag?this.receiveInsideDialogRequest(e):this.receiveOutsideDialogRequest(e)}receiveInsideDialogRequest(e){if(e.method===G.NOTIFY){const i=e.parseHeader("Event");if(!i||!i.event){this.replyStateless(e,{statusCode:489});return}const n=e.callId+e.toTag+i.event,a=this.subscribers.get(n);if(a){const o=new fs(this,e);a.onNotify(o);return}}const t=e.callId+e.toTag+e.fromTag,s=this.dialogs.get(t);if(s){if(e.method===G.OPTIONS){const i="Allow: "+zt.toString(),n="Accept: "+Na.toString();this.replyStateless(e,{statusCode:200,extraHeaders:[i,n]});return}s.receiveRequest(e);return}e.method!==G.ACK&&this.replyStateless(e,{statusCode:481})}receiveOutsideDialogRequest(e){switch(e.method){case G.ACK:break;case G.BYE:this.replyStateless(e,{statusCode:481});break;case G.CANCEL:throw new Error(`Unexpected out of dialog request method ${e.method}.`);case G.INFO:this.replyStateless(e,{statusCode:405});break;case G.INVITE:{const t=new ji(this,e);this.delegate.onInvite?this.delegate.onInvite(t):t.reject()}break;case G.MESSAGE:{const t=new Pa(this,e);this.delegate.onMessage?this.delegate.onMessage(t):t.accept()}break;case G.NOTIFY:{const t=new fs(this,e);this.delegate.onNotify?this.delegate.onNotify(t):t.reject({statusCode:405})}break;case G.OPTIONS:{const t="Allow: "+zt.toString(),s="Accept: "+Na.toString();this.replyStateless(e,{statusCode:200,extraHeaders:[t,s]})}break;case G.REFER:{const t=new $a(this,e);this.delegate.onRefer?this.delegate.onRefer(t):t.reject({statusCode:405})}break;case G.REGISTER:{const t=new gc(this,e);this.delegate.onRegister?this.delegate.onRegister(t):t.reject({statusCode:405})}break;case G.SUBSCRIBE:{const t=new mc(this,e);this.delegate.onSubscribe?this.delegate.onSubscribe(t):t.reject({statusCode:480})}break;default:throw new Error(`Unexpected out of dialog request method ${e.method}.`)}}receiveResponseFromTransport(e){if(e.getHeaders("via").length>1){this.logger.warn("More than one Via header field present in the response, dropping");return}const t=e.viaBranch+e.method,s=this.userAgentClients.get(t);s?s.transaction.receiveResponse(e):this.logger.warn(`Discarding unmatched ${e.statusCode} response to ${e.method} ${t}.`)}}function yc(){return r=>!r.audio&&!r.video?Promise.resolve(new MediaStream):navigator.mediaDevices===void 0?Promise.reject(new Error("Media devices not available in insecure contexts.")):navigator.mediaDevices.getUserMedia.call(navigator.mediaDevices,r)}function wc(){return{bundlePolicy:"balanced",certificates:void 0,iceCandidatePoolSize:0,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",rtcpMuxPolicy:"require"}}class Bt{constructor(e,t,s){e.debug("SessionDescriptionHandler.constructor"),this.logger=e,this.mediaStreamFactory=t,this.sessionDescriptionHandlerConfiguration=s,this._localMediaStream=new MediaStream,this._remoteMediaStream=new MediaStream,this._peerConnection=new RTCPeerConnection(s==null?void 0:s.peerConnectionConfiguration),this.initPeerConnectionEventHandlers()}get localMediaStream(){return this._localMediaStream}get remoteMediaStream(){return this._remoteMediaStream}get dataChannel(){return this._dataChannel}get peerConnection(){return this._peerConnection}get peerConnectionDelegate(){return this._peerConnectionDelegate}set peerConnectionDelegate(e){this._peerConnectionDelegate=e}static dispatchAddTrackEvent(e,t){e.dispatchEvent(new MediaStreamTrackEvent("addtrack",{track:t}))}static dispatchRemoveTrackEvent(e,t){e.dispatchEvent(new MediaStreamTrackEvent("removetrack",{track:t}))}close(){this.logger.debug("SessionDescriptionHandler.close"),this._peerConnection!==void 0&&(this._peerConnection.getReceivers().forEach(e=>{e.track&&e.track.stop()}),this._peerConnection.getSenders().forEach(e=>{e.track&&e.track.stop()}),this._dataChannel&&this._dataChannel.close(),this._peerConnection.close(),this._peerConnection=void 0)}enableReceiverTracks(e){const t=this.peerConnection;if(!t)throw new Error("Peer connection closed.");t.getReceivers().forEach(s=>{s.track&&(s.track.enabled=e)})}enableSenderTracks(e){const t=this.peerConnection;if(!t)throw new Error("Peer connection closed.");t.getSenders().forEach(s=>{s.track&&(s.track.enabled=e)})}getDescription(e,t){var s,i;if(this.logger.debug("SessionDescriptionHandler.getDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=e==null?void 0:e.onDataChannel;const n=(s=e==null?void 0:e.offerOptions)===null||s===void 0?void 0:s.iceRestart,a=(e==null?void 0:e.iceGatheringTimeout)===void 0?(i=this.sessionDescriptionHandlerConfiguration)===null||i===void 0?void 0:i.iceGatheringTimeout:e==null?void 0:e.iceGatheringTimeout;return this.getLocalMediaStream(e).then(()=>this.updateDirection(e)).then(()=>this.createDataChannel(e)).then(()=>this.createLocalOfferOrAnswer(e)).then(o=>this.applyModifiers(o,t)).then(o=>this.setLocalSessionDescription(o)).then(()=>this.waitForIceGatheringComplete(n,a)).then(()=>this.getLocalSessionDescription()).then(o=>({body:o.sdp,contentType:"application/sdp"})).catch(o=>{throw this.logger.error("SessionDescriptionHandler.getDescription failed - "+o),o})}hasDescription(e){return this.logger.debug("SessionDescriptionHandler.hasDescription"),e==="application/sdp"}iceGatheringComplete(){this.logger.debug("SessionDescriptionHandler.iceGatheringComplete"),this.iceGatheringCompleteTimeoutId!==void 0&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - clearing timeout"),clearTimeout(this.iceGatheringCompleteTimeoutId),this.iceGatheringCompleteTimeoutId=void 0),this.iceGatheringCompletePromise!==void 0&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - resolving promise"),this.iceGatheringCompleteResolve&&this.iceGatheringCompleteResolve(),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0)}sendDtmf(e,t){if(this.logger.debug("SessionDescriptionHandler.sendDtmf"),this._peerConnection===void 0)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - peer connection closed"),!1;const s=this._peerConnection.getSenders();if(s.length===0)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no senders"),!1;const i=s[0].dtmf;if(!i)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no DTMF sender"),!1;const n=t==null?void 0:t.duration,a=t==null?void 0:t.interToneGap;try{i.insertDTMF(e,n,a)}catch(o){return this.logger.error(o.toString()),!1}return this.logger.log("SessionDescriptionHandler.sendDtmf sent via RTP: "+e.toString()),!0}setDescription(e,t,s){if(this.logger.debug("SessionDescriptionHandler.setDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=t==null?void 0:t.onDataChannel;const i=this._peerConnection.signalingState==="have-local-offer"?"answer":"offer";return this.getLocalMediaStream(t).then(()=>this.applyModifiers({sdp:e,type:i},s)).then(n=>this.setRemoteSessionDescription(n)).catch(n=>{throw this.logger.error("SessionDescriptionHandler.setDescription failed - "+n),n})}applyModifiers(e,t){return this.logger.debug("SessionDescriptionHandler.applyModifiers"),!t||t.length===0?Promise.resolve(e):t.reduce((s,i)=>s.then(i),Promise.resolve(e)).then(s=>{if(this.logger.debug("SessionDescriptionHandler.applyModifiers - modified sdp"),!s.sdp||!s.type)throw new Error("Invalid SDP.");return{sdp:s.sdp,type:s.type}})}createDataChannel(e){if(this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));if((e==null?void 0:e.dataChannel)!==!0||this._dataChannel)return Promise.resolve();switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.createDataChannel - creating data channel");try{return this._dataChannel=this._peerConnection.createDataChannel((e==null?void 0:e.dataChannelLabel)||"",e==null?void 0:e.dataChannelOptions),this.onDataChannel&&this.onDataChannel(this._dataChannel),Promise.resolve()}catch(t){return Promise.reject(t)}case"have-remote-offer":return Promise.resolve();case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}}createLocalOfferOrAnswer(e){if(this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP offer"),this._peerConnection.createOffer(e==null?void 0:e.offerOptions);case"have-remote-offer":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP answer"),this._peerConnection.createAnswer(e==null?void 0:e.answerOptions);case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}}getLocalMediaStream(e){if(this.logger.debug("SessionDescriptionHandler.getLocalMediaStream"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));let t=Object.assign({},e==null?void 0:e.constraints);if(this.localMediaStreamConstraints){if(t.audio=t.audio||this.localMediaStreamConstraints.audio,t.video=t.video||this.localMediaStreamConstraints.video,JSON.stringify(this.localMediaStreamConstraints.audio)===JSON.stringify(t.audio)&&JSON.stringify(this.localMediaStreamConstraints.video)===JSON.stringify(t.video))return Promise.resolve()}else t.audio===void 0&&t.video===void 0&&(t={audio:!0});return this.localMediaStreamConstraints=t,this.mediaStreamFactory(t,this,e).then(s=>this.setLocalMediaStream(s))}setLocalMediaStream(e){if(this.logger.debug("SessionDescriptionHandler.setLocalMediaStream"),!this._peerConnection)throw new Error("Peer connection undefined.");const t=this._peerConnection,s=this._localMediaStream,i=[],n=d=>{const c=d.kind;if(c!=="audio"&&c!=="video")throw new Error(`Unknown new track kind ${c}.`);const l=t.getSenders().find(g=>g.track&&g.track.kind===c);l?i.push(new Promise(g=>{this.logger.debug(`SessionDescriptionHandler.setLocalMediaStream - replacing sender ${c} track`),g()}).then(()=>l.replaceTrack(d).then(()=>{const g=s.getTracks().find(u=>u.kind===c);g&&(g.stop(),s.removeTrack(g),Bt.dispatchRemoveTrackEvent(s,g)),s.addTrack(d),Bt.dispatchAddTrackEvent(s,d)}).catch(g=>{throw this.logger.error(`SessionDescriptionHandler.setLocalMediaStream - failed to replace sender ${c} track`),g}))):i.push(new Promise(g=>{this.logger.debug(`SessionDescriptionHandler.setLocalMediaStream - adding sender ${c} track`),g()}).then(()=>{try{t.addTrack(d,s)}catch(g){throw this.logger.error(`SessionDescriptionHandler.setLocalMediaStream - failed to add sender ${c} track`),g}s.addTrack(d),Bt.dispatchAddTrackEvent(s,d)}))},a=e.getAudioTracks();a.length&&n(a[0]);const o=e.getVideoTracks();return o.length&&n(o[0]),i.reduce((d,c)=>d.then(()=>c),Promise.resolve())}getLocalSessionDescription(){if(this.logger.debug("SessionDescriptionHandler.getLocalSessionDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));const e=this._peerConnection.localDescription;return e?Promise.resolve(e):Promise.reject(new Error("Failed to get local session description"))}setLocalSessionDescription(e){return this.logger.debug("SessionDescriptionHandler.setLocalSessionDescription"),this._peerConnection===void 0?Promise.reject(new Error("Peer connection closed.")):this._peerConnection.setLocalDescription(e)}setRemoteSessionDescription(e){if(this.logger.debug("SessionDescriptionHandler.setRemoteSessionDescription"),this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));const t=e.sdp;let s;switch(this._peerConnection.signalingState){case"stable":s="offer";break;case"have-local-offer":s="answer";break;case"have-local-pranswer":case"have-remote-offer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return t?this._peerConnection.setRemoteDescription({sdp:t,type:s}):(this.logger.error("SessionDescriptionHandler.setRemoteSessionDescription failed - cannot set null sdp"),Promise.reject(new Error("SDP is undefined")))}setRemoteTrack(e){this.logger.debug("SessionDescriptionHandler.setRemoteTrack");const t=this._remoteMediaStream;t.getTrackById(e.id)?this.logger.debug(`SessionDescriptionHandler.setRemoteTrack - have remote ${e.kind} track`):e.kind==="audio"?(this.logger.debug(`SessionDescriptionHandler.setRemoteTrack - adding remote ${e.kind} track`),t.getAudioTracks().forEach(s=>{s.stop(),t.removeTrack(s),Bt.dispatchRemoveTrackEvent(t,s)}),t.addTrack(e),Bt.dispatchAddTrackEvent(t,e)):e.kind==="video"&&(this.logger.debug(`SessionDescriptionHandler.setRemoteTrack - adding remote ${e.kind} track`),t.getVideoTracks().forEach(s=>{s.stop(),t.removeTrack(s),Bt.dispatchRemoveTrackEvent(t,s)}),t.addTrack(e),Bt.dispatchAddTrackEvent(t,e))}updateDirection(e){if(this._peerConnection===void 0)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.updateDirection - setting offer direction");{const t=s=>{switch(s){case"inactive":return e!=null&&e.hold?"inactive":"recvonly";case"recvonly":return e!=null&&e.hold?"inactive":"recvonly";case"sendonly":return e!=null&&e.hold?"sendonly":"sendrecv";case"sendrecv":return e!=null&&e.hold?"sendonly":"sendrecv";case"stopped":return"stopped";default:throw new Error("Should never happen")}};this._peerConnection.getTransceivers().forEach(s=>{if(s.direction){const i=t(s.direction);s.direction!==i&&(s.direction=i)}})}break;case"have-remote-offer":this.logger.debug("SessionDescriptionHandler.updateDirection - setting answer direction");{const t=(()=>{const i=this._peerConnection.remoteDescription;if(!i)throw new Error("Failed to read remote offer");const n=/a=sendrecv\r\n|a=sendonly\r\n|a=recvonly\r\n|a=inactive\r\n/.exec(i.sdp);if(n)switch(n[0]){case`a=inactive\r
197
192
  `:return"inactive";case`a=recvonly\r
198
193
  `:return"recvonly";case`a=sendonly\r
199
194
  `:return"sendonly";case`a=sendrecv\r
200
- `:return"sendrecv";default:throw new Error("Should never happen")}return"sendrecv"})(),s=(()=>{switch(t){case"inactive":return"inactive";case"recvonly":return"sendonly";case"sendonly":return e!=null&&e.hold?"inactive":"recvonly";case"sendrecv":return e!=null&&e.hold?"sendonly":"sendrecv";default:throw new Error("Should never happen")}})();this._peerConnection.getTransceivers().forEach(i=>{i.direction&&i.direction!=="stopped"&&i.direction!==s&&(i.direction=s)})}break;case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return Promise.resolve()}waitForIceGatheringComplete(e=!1,t=0){return this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete"),this._peerConnection===void 0?Promise.reject("Peer connection closed."):!e&&this._peerConnection.iceGatheringState==="complete"?(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - already complete"),Promise.resolve()):(this.iceGatheringCompletePromise!==void 0&&(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - rejecting prior waiting promise"),this.iceGatheringCompleteReject&&this.iceGatheringCompleteReject(new Error("Promise superseded.")),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0),this.iceGatheringCompletePromise=new Promise((s,i)=>{this.iceGatheringCompleteResolve=s,this.iceGatheringCompleteReject=i,t>0&&(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout in "+t),this.iceGatheringCompleteTimeoutId=setTimeout(()=>{this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout"),this.iceGatheringComplete()},t))}),this.iceGatheringCompletePromise)}initPeerConnectionEventHandlers(){if(this.logger.debug("SessionDescriptionHandler.initPeerConnectionEventHandlers"),!this._peerConnection)throw new Error("Peer connection undefined.");const e=this._peerConnection;e.onconnectionstatechange=t=>{var s;const i=e.connectionState;this.logger.debug(`SessionDescriptionHandler.onconnectionstatechange ${i}`),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onconnectionstatechange&&this._peerConnectionDelegate.onconnectionstatechange(t)},e.ondatachannel=t=>{var s;this.logger.debug("SessionDescriptionHandler.ondatachannel"),this._dataChannel=t.channel,this.onDataChannel&&this.onDataChannel(this._dataChannel),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.ondatachannel&&this._peerConnectionDelegate.ondatachannel(t)},e.onicecandidate=t=>{var s;this.logger.debug("SessionDescriptionHandler.onicecandidate"),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onicecandidate&&this._peerConnectionDelegate.onicecandidate(t)},e.onicecandidateerror=t=>{var s;this.logger.debug("SessionDescriptionHandler.onicecandidateerror"),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onicecandidateerror&&this._peerConnectionDelegate.onicecandidateerror(t)},e.oniceconnectionstatechange=t=>{var s;const i=e.iceConnectionState;this.logger.debug(`SessionDescriptionHandler.oniceconnectionstatechange ${i}`),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.oniceconnectionstatechange&&this._peerConnectionDelegate.oniceconnectionstatechange(t)},e.onicegatheringstatechange=t=>{var s;const i=e.iceGatheringState;this.logger.debug(`SessionDescriptionHandler.onicegatheringstatechange ${i}`),i==="complete"&&this.iceGatheringComplete(),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onicegatheringstatechange&&this._peerConnectionDelegate.onicegatheringstatechange(t)},e.onnegotiationneeded=t=>{var s;this.logger.debug("SessionDescriptionHandler.onnegotiationneeded"),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onnegotiationneeded&&this._peerConnectionDelegate.onnegotiationneeded(t)},e.onsignalingstatechange=t=>{var s;const i=e.signalingState;this.logger.debug(`SessionDescriptionHandler.onsignalingstatechange ${i}`),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onsignalingstatechange&&this._peerConnectionDelegate.onsignalingstatechange(t)},e.ontrack=t=>{var s;const i=t.track.kind,n=t.track.enabled?"enabled":"disabled";this.logger.debug(`SessionDescriptionHandler.ontrack ${i} ${n}`),this.setRemoteTrack(t.track),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.ontrack&&this._peerConnectionDelegate.ontrack(t)}}}function Pc(r){return(e,t)=>{r===void 0&&(r=Ic());const i={iceGatheringTimeout:(t==null?void 0:t.iceGatheringTimeout)!==void 0?t==null?void 0:t.iceGatheringTimeout:5e3,peerConnectionConfiguration:Object.assign(Object.assign({},Hc()),t==null?void 0:t.peerConnectionConfiguration)},n=e.userAgent.getLogger("sip.SessionDescriptionHandler");return new Bt(n,r,i)}}class xs{constructor(e,t){if(this._state=ee.Disconnected,this.transitioningState=!1,this._stateEventEmitter=new Mr,this.logger=e,t){const n=t,a=n==null?void 0:n.wsServers,o=n==null?void 0:n.maxReconnectionAttempts;a!==void 0&&this.logger.warn('The transport option "wsServers" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),o!==void 0&&this.logger.warn('The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),a&&!t.server&&(typeof a=="string"&&(t.server=a),a instanceof Array&&(t.server=a[0]))}this.configuration=Object.assign(Object.assign({},xs.defaultOptions),t);const s=this.configuration.server,i=Ie.parse(s,"absoluteURI");if(i===-1)throw this.logger.error(`Invalid WebSocket Server URL "${s}"`),new Error("Invalid WebSocket Server URL");if(!["wss","ws","udp"].includes(i.scheme))throw this.logger.error(`Invalid scheme in WebSocket Server URL "${s}"`),new Error("Invalid scheme in WebSocket Server URL");this._protocol=i.scheme.toUpperCase()}dispose(){return this.disconnect()}get protocol(){return this._protocol}get server(){return this.configuration.server}get state(){return this._state}get stateChange(){return this._stateEventEmitter}get ws(){return this._ws}connect(){return this._connect()}disconnect(){return this._disconnect()}isConnected(){return this.state===ee.Connected}send(e){return this._send(e)}_connect(){switch(this.logger.log(`Connecting ${this.server}`),this.state){case ee.Connecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(ee.Connecting));if(!this.connectPromise)throw new Error("Connect promise must be defined.");return this.connectPromise;case ee.Connected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(ee.Connecting));if(this.connectPromise)throw new Error("Connect promise must not be defined.");return Promise.resolve();case ee.Disconnecting:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(ee.Connecting)}catch(t){if(t instanceof Nr)return Promise.reject(t);throw t}break;case ee.Disconnected:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(ee.Connecting)}catch(t){if(t instanceof Nr)return Promise.reject(t);throw t}break;default:throw new Error("Unknown state")}let e;try{e=new WebSocket(this.server,"sip"),e.binaryType="arraybuffer",e.addEventListener("close",t=>this.onWebSocketClose(t,e)),e.addEventListener("error",t=>this.onWebSocketError(t,e)),e.addEventListener("open",t=>this.onWebSocketOpen(t,e)),e.addEventListener("message",t=>this.onWebSocketMessage(t,e)),this._ws=e}catch(t){return this._ws=void 0,this.logger.error("WebSocket construction failed."),this.logger.error(t.toString()),new Promise((s,i)=>{this.connectResolve=s,this.connectReject=i,this.transitionState(ee.Disconnected,t)})}return this.connectPromise=new Promise((t,s)=>{this.connectResolve=t,this.connectReject=s,this.connectTimeout=setTimeout(()=>{this.logger.warn("Connect timed out. Exceeded time set in configuration.connectionTimeout: "+this.configuration.connectionTimeout+"s."),e.close(1e3)},this.configuration.connectionTimeout*1e3)}),this.connectPromise}_disconnect(){switch(this.logger.log(`Disconnecting ${this.server}`),this.state){case ee.Connecting:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(ee.Disconnecting)}catch(t){if(t instanceof Nr)return Promise.reject(t);throw t}break;case ee.Connected:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(ee.Disconnecting)}catch(t){if(t instanceof Nr)return Promise.reject(t);throw t}break;case ee.Disconnecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(ee.Disconnecting));if(!this.disconnectPromise)throw new Error("Disconnect promise must be defined.");return this.disconnectPromise;case ee.Disconnected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(ee.Disconnecting));if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");return Promise.resolve();default:throw new Error("Unknown state")}if(!this._ws)throw new Error("WebSocket must be defined.");const e=this._ws;return this.disconnectPromise=new Promise((t,s)=>{this.disconnectResolve=t,this.disconnectReject=s;try{e.close(1e3)}catch(i){throw this.logger.error("WebSocket close failed."),this.logger.error(i.toString()),i}}),this.disconnectPromise}_send(e){if(this.configuration.traceSip===!0&&this.logger.log(`Sending WebSocket message:
195
+ `:return"sendrecv";default:throw new Error("Should never happen")}return"sendrecv"})(),s=(()=>{switch(t){case"inactive":return"inactive";case"recvonly":return"sendonly";case"sendonly":return e!=null&&e.hold?"inactive":"recvonly";case"sendrecv":return e!=null&&e.hold?"sendonly":"sendrecv";default:throw new Error("Should never happen")}})();this._peerConnection.getTransceivers().forEach(i=>{i.direction&&i.direction!=="stopped"&&i.direction!==s&&(i.direction=s)})}break;case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return Promise.resolve()}waitForIceGatheringComplete(e=!1,t=0){return this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete"),this._peerConnection===void 0?Promise.reject("Peer connection closed."):!e&&this._peerConnection.iceGatheringState==="complete"?(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - already complete"),Promise.resolve()):(this.iceGatheringCompletePromise!==void 0&&(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - rejecting prior waiting promise"),this.iceGatheringCompleteReject&&this.iceGatheringCompleteReject(new Error("Promise superseded.")),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0),this.iceGatheringCompletePromise=new Promise((s,i)=>{this.iceGatheringCompleteResolve=s,this.iceGatheringCompleteReject=i,t>0&&(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout in "+t),this.iceGatheringCompleteTimeoutId=setTimeout(()=>{this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout"),this.iceGatheringComplete()},t))}),this.iceGatheringCompletePromise)}initPeerConnectionEventHandlers(){if(this.logger.debug("SessionDescriptionHandler.initPeerConnectionEventHandlers"),!this._peerConnection)throw new Error("Peer connection undefined.");const e=this._peerConnection;e.onconnectionstatechange=t=>{var s;const i=e.connectionState;this.logger.debug(`SessionDescriptionHandler.onconnectionstatechange ${i}`),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onconnectionstatechange&&this._peerConnectionDelegate.onconnectionstatechange(t)},e.ondatachannel=t=>{var s;this.logger.debug("SessionDescriptionHandler.ondatachannel"),this._dataChannel=t.channel,this.onDataChannel&&this.onDataChannel(this._dataChannel),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.ondatachannel&&this._peerConnectionDelegate.ondatachannel(t)},e.onicecandidate=t=>{var s;this.logger.debug("SessionDescriptionHandler.onicecandidate"),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onicecandidate&&this._peerConnectionDelegate.onicecandidate(t)},e.onicecandidateerror=t=>{var s;this.logger.debug("SessionDescriptionHandler.onicecandidateerror"),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onicecandidateerror&&this._peerConnectionDelegate.onicecandidateerror(t)},e.oniceconnectionstatechange=t=>{var s;const i=e.iceConnectionState;this.logger.debug(`SessionDescriptionHandler.oniceconnectionstatechange ${i}`),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.oniceconnectionstatechange&&this._peerConnectionDelegate.oniceconnectionstatechange(t)},e.onicegatheringstatechange=t=>{var s;const i=e.iceGatheringState;this.logger.debug(`SessionDescriptionHandler.onicegatheringstatechange ${i}`),i==="complete"&&this.iceGatheringComplete(),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onicegatheringstatechange&&this._peerConnectionDelegate.onicegatheringstatechange(t)},e.onnegotiationneeded=t=>{var s;this.logger.debug("SessionDescriptionHandler.onnegotiationneeded"),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onnegotiationneeded&&this._peerConnectionDelegate.onnegotiationneeded(t)},e.onsignalingstatechange=t=>{var s;const i=e.signalingState;this.logger.debug(`SessionDescriptionHandler.onsignalingstatechange ${i}`),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.onsignalingstatechange&&this._peerConnectionDelegate.onsignalingstatechange(t)},e.ontrack=t=>{var s;const i=t.track.kind,n=t.track.enabled?"enabled":"disabled";this.logger.debug(`SessionDescriptionHandler.ontrack ${i} ${n}`),this.setRemoteTrack(t.track),!((s=this._peerConnectionDelegate)===null||s===void 0)&&s.ontrack&&this._peerConnectionDelegate.ontrack(t)}}}function Ec(r){return(e,t)=>{r===void 0&&(r=yc());const i={iceGatheringTimeout:(t==null?void 0:t.iceGatheringTimeout)!==void 0?t==null?void 0:t.iceGatheringTimeout:5e3,peerConnectionConfiguration:Object.assign(Object.assign({},wc()),t==null?void 0:t.peerConnectionConfiguration)},n=e.userAgent.getLogger("sip.SessionDescriptionHandler");return new Bt(n,r,i)}}class xs{constructor(e,t){if(this._state=Q.Disconnected,this.transitioningState=!1,this._stateEventEmitter=new Mr,this.logger=e,t){const n=t,a=n==null?void 0:n.wsServers,o=n==null?void 0:n.maxReconnectionAttempts;a!==void 0&&this.logger.warn('The transport option "wsServers" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),o!==void 0&&this.logger.warn('The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),a&&!t.server&&(typeof a=="string"&&(t.server=a),a instanceof Array&&(t.server=a[0]))}this.configuration=Object.assign(Object.assign({},xs.defaultOptions),t);const s=this.configuration.server,i=Ie.parse(s,"absoluteURI");if(i===-1)throw this.logger.error(`Invalid WebSocket Server URL "${s}"`),new Error("Invalid WebSocket Server URL");if(!["wss","ws","udp"].includes(i.scheme))throw this.logger.error(`Invalid scheme in WebSocket Server URL "${s}"`),new Error("Invalid scheme in WebSocket Server URL");this._protocol=i.scheme.toUpperCase()}dispose(){return this.disconnect()}get protocol(){return this._protocol}get server(){return this.configuration.server}get state(){return this._state}get stateChange(){return this._stateEventEmitter}get ws(){return this._ws}connect(){return this._connect()}disconnect(){return this._disconnect()}isConnected(){return this.state===Q.Connected}send(e){return this._send(e)}_connect(){switch(this.logger.log(`Connecting ${this.server}`),this.state){case Q.Connecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(Q.Connecting));if(!this.connectPromise)throw new Error("Connect promise must be defined.");return this.connectPromise;case Q.Connected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(Q.Connecting));if(this.connectPromise)throw new Error("Connect promise must not be defined.");return Promise.resolve();case Q.Disconnecting:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(Q.Connecting)}catch(t){if(t instanceof Nr)return Promise.reject(t);throw t}break;case Q.Disconnected:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(Q.Connecting)}catch(t){if(t instanceof Nr)return Promise.reject(t);throw t}break;default:throw new Error("Unknown state")}let e;try{e=new WebSocket(this.server,"sip"),e.binaryType="arraybuffer",e.addEventListener("close",t=>this.onWebSocketClose(t,e)),e.addEventListener("error",t=>this.onWebSocketError(t,e)),e.addEventListener("open",t=>this.onWebSocketOpen(t,e)),e.addEventListener("message",t=>this.onWebSocketMessage(t,e)),this._ws=e}catch(t){return this._ws=void 0,this.logger.error("WebSocket construction failed."),this.logger.error(t.toString()),new Promise((s,i)=>{this.connectResolve=s,this.connectReject=i,this.transitionState(Q.Disconnected,t)})}return this.connectPromise=new Promise((t,s)=>{this.connectResolve=t,this.connectReject=s,this.connectTimeout=setTimeout(()=>{this.logger.warn("Connect timed out. Exceeded time set in configuration.connectionTimeout: "+this.configuration.connectionTimeout+"s."),e.close(1e3)},this.configuration.connectionTimeout*1e3)}),this.connectPromise}_disconnect(){switch(this.logger.log(`Disconnecting ${this.server}`),this.state){case Q.Connecting:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(Q.Disconnecting)}catch(t){if(t instanceof Nr)return Promise.reject(t);throw t}break;case Q.Connected:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(Q.Disconnecting)}catch(t){if(t instanceof Nr)return Promise.reject(t);throw t}break;case Q.Disconnecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(Q.Disconnecting));if(!this.disconnectPromise)throw new Error("Disconnect promise must be defined.");return this.disconnectPromise;case Q.Disconnected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(Q.Disconnecting));if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");return Promise.resolve();default:throw new Error("Unknown state")}if(!this._ws)throw new Error("WebSocket must be defined.");const e=this._ws;return this.disconnectPromise=new Promise((t,s)=>{this.disconnectResolve=t,this.disconnectReject=s;try{e.close(1e3)}catch(i){throw this.logger.error("WebSocket close failed."),this.logger.error(i.toString()),i}}),this.disconnectPromise}_send(e){if(this.configuration.traceSip===!0&&this.logger.log(`Sending WebSocket message:
201
196
 
202
197
  `+e+`
203
- `),this._state!==ee.Connected)return Promise.reject(new Error("Not connected."));if(!this._ws)throw new Error("WebSocket undefined.");try{this._ws.send(e)}catch(t){return t instanceof Error?Promise.reject(t):Promise.reject(new Error("WebSocket send failed."))}return Promise.resolve()}onWebSocketClose(e,t){if(t!==this._ws)return;const s=`WebSocket closed ${this.server} (code: ${e.code})`,i=this.disconnectPromise?void 0:new Error(s);i&&this.logger.warn("WebSocket closed unexpectedly"),this.logger.log(s),this._ws=void 0,this.transitionState(ee.Disconnected,i)}onWebSocketError(e,t){t===this._ws&&this.logger.error("WebSocket error occurred.")}onWebSocketMessage(e,t){if(t!==this._ws)return;const s=e.data;let i;if(/^(\r\n)+$/.test(s)){this.clearKeepAliveTimeout(),this.configuration.traceSip===!0&&this.logger.log("Received WebSocket message with CRLF Keep Alive response");return}if(!s){this.logger.warn("Received empty message, discarding...");return}if(typeof s!="string"){try{i=new TextDecoder().decode(new Uint8Array(s))}catch(n){this.logger.error(n.toString()),this.logger.error("Received WebSocket binary message failed to be converted into string, message discarded");return}this.configuration.traceSip===!0&&this.logger.log(`Received WebSocket binary message:
198
+ `),this._state!==Q.Connected)return Promise.reject(new Error("Not connected."));if(!this._ws)throw new Error("WebSocket undefined.");try{this._ws.send(e)}catch(t){return t instanceof Error?Promise.reject(t):Promise.reject(new Error("WebSocket send failed."))}return Promise.resolve()}onWebSocketClose(e,t){if(t!==this._ws)return;const s=`WebSocket closed ${this.server} (code: ${e.code})`,i=this.disconnectPromise?void 0:new Error(s);i&&this.logger.warn("WebSocket closed unexpectedly"),this.logger.log(s),this._ws=void 0,this.transitionState(Q.Disconnected,i)}onWebSocketError(e,t){t===this._ws&&this.logger.error("WebSocket error occurred.")}onWebSocketMessage(e,t){if(t!==this._ws)return;const s=e.data;let i;if(/^(\r\n)+$/.test(s)){this.clearKeepAliveTimeout(),this.configuration.traceSip===!0&&this.logger.log("Received WebSocket message with CRLF Keep Alive response");return}if(!s){this.logger.warn("Received empty message, discarding...");return}if(typeof s!="string"){try{i=new TextDecoder().decode(new Uint8Array(s))}catch(n){this.logger.error(n.toString()),this.logger.error("Received WebSocket binary message failed to be converted into string, message discarded");return}this.configuration.traceSip===!0&&this.logger.log(`Received WebSocket binary message:
204
199
 
205
200
  `+i+`
206
201
  `)}else i=s,this.configuration.traceSip===!0&&this.logger.log(`Received WebSocket text message:
207
202
 
208
203
  `+i+`
209
- `);if(this.state!==ee.Connected){this.logger.warn("Received message while not connected, discarding...");return}if(this.onMessage)try{this.onMessage(i)}catch(n){throw this.logger.error(n.toString()),this.logger.error("Exception thrown by onMessage callback"),n}}onWebSocketOpen(e,t){t===this._ws&&this._state===ee.Connecting&&(this.logger.log(`WebSocket opened ${this.server}`),this.transitionState(ee.Connected))}transitionLoopDetectedError(e){let t="A state transition loop has been detected.";return t+=` An attempt to transition from ${this._state} to ${e} before the prior transition completed.`,t+=" Perhaps you are synchronously calling connect() or disconnect() from a callback or state change handler?",this.logger.error(t),new Nr("Loop detected.")}transitionState(e,t){const s=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};if(this.transitioningState)throw this.transitionLoopDetectedError(e);switch(this.transitioningState=!0,this._state){case ee.Connecting:e!==ee.Connected&&e!==ee.Disconnecting&&e!==ee.Disconnected&&s();break;case ee.Connected:e!==ee.Disconnecting&&e!==ee.Disconnected&&s();break;case ee.Disconnecting:e!==ee.Connecting&&e!==ee.Disconnected&&s();break;case ee.Disconnected:e!==ee.Connecting&&s();break;default:throw new Error("Unknown state.")}const i=this._state;this._state=e;const n=this.connectResolve,a=this.connectReject;i===ee.Connecting&&(this.connectPromise=void 0,this.connectResolve=void 0,this.connectReject=void 0);const o=this.disconnectResolve,d=this.disconnectReject;if(i===ee.Disconnecting&&(this.disconnectPromise=void 0,this.disconnectResolve=void 0,this.disconnectReject=void 0),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0),this.logger.log(`Transitioned from ${i} to ${this._state}`),this._stateEventEmitter.emit(this._state),e===ee.Connected&&(this.startSendingKeepAlives(),this.onConnect))try{this.onConnect()}catch(c){throw this.logger.error(c.toString()),this.logger.error("Exception thrown by onConnect callback"),c}if(i===ee.Connected&&(this.stopSendingKeepAlives(),this.onDisconnect))try{t?this.onDisconnect(t):this.onDisconnect()}catch(c){throw this.logger.error(c.toString()),this.logger.error("Exception thrown by onDisconnect callback"),c}if(i===ee.Connecting){if(!n)throw new Error("Connect resolve undefined.");if(!a)throw new Error("Connect reject undefined.");e===ee.Connected?n():a(t||new Error("Connect aborted."))}if(i===ee.Disconnecting){if(!o)throw new Error("Disconnect resolve undefined.");if(!d)throw new Error("Disconnect reject undefined.");e===ee.Disconnected?o():d(t||new Error("Disconnect aborted."))}this.transitioningState=!1}clearKeepAliveTimeout(){this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveDebounceTimeout=void 0}sendKeepAlive(){return this.keepAliveDebounceTimeout?Promise.resolve():(this.keepAliveDebounceTimeout=setTimeout(()=>{this.clearKeepAliveTimeout()},this.configuration.keepAliveDebounce*1e3),this.send(`\r
204
+ `);if(this.state!==Q.Connected){this.logger.warn("Received message while not connected, discarding...");return}if(this.onMessage)try{this.onMessage(i)}catch(n){throw this.logger.error(n.toString()),this.logger.error("Exception thrown by onMessage callback"),n}}onWebSocketOpen(e,t){t===this._ws&&this._state===Q.Connecting&&(this.logger.log(`WebSocket opened ${this.server}`),this.transitionState(Q.Connected))}transitionLoopDetectedError(e){let t="A state transition loop has been detected.";return t+=` An attempt to transition from ${this._state} to ${e} before the prior transition completed.`,t+=" Perhaps you are synchronously calling connect() or disconnect() from a callback or state change handler?",this.logger.error(t),new Nr("Loop detected.")}transitionState(e,t){const s=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};if(this.transitioningState)throw this.transitionLoopDetectedError(e);switch(this.transitioningState=!0,this._state){case Q.Connecting:e!==Q.Connected&&e!==Q.Disconnecting&&e!==Q.Disconnected&&s();break;case Q.Connected:e!==Q.Disconnecting&&e!==Q.Disconnected&&s();break;case Q.Disconnecting:e!==Q.Connecting&&e!==Q.Disconnected&&s();break;case Q.Disconnected:e!==Q.Connecting&&s();break;default:throw new Error("Unknown state.")}const i=this._state;this._state=e;const n=this.connectResolve,a=this.connectReject;i===Q.Connecting&&(this.connectPromise=void 0,this.connectResolve=void 0,this.connectReject=void 0);const o=this.disconnectResolve,d=this.disconnectReject;if(i===Q.Disconnecting&&(this.disconnectPromise=void 0,this.disconnectResolve=void 0,this.disconnectReject=void 0),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0),this.logger.log(`Transitioned from ${i} to ${this._state}`),this._stateEventEmitter.emit(this._state),e===Q.Connected&&(this.startSendingKeepAlives(),this.onConnect))try{this.onConnect()}catch(c){throw this.logger.error(c.toString()),this.logger.error("Exception thrown by onConnect callback"),c}if(i===Q.Connected&&(this.stopSendingKeepAlives(),this.onDisconnect))try{t?this.onDisconnect(t):this.onDisconnect()}catch(c){throw this.logger.error(c.toString()),this.logger.error("Exception thrown by onDisconnect callback"),c}if(i===Q.Connecting){if(!n)throw new Error("Connect resolve undefined.");if(!a)throw new Error("Connect reject undefined.");e===Q.Connected?n():a(t||new Error("Connect aborted."))}if(i===Q.Disconnecting){if(!o)throw new Error("Disconnect resolve undefined.");if(!d)throw new Error("Disconnect reject undefined.");e===Q.Disconnected?o():d(t||new Error("Disconnect aborted."))}this.transitioningState=!1}clearKeepAliveTimeout(){this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveDebounceTimeout=void 0}sendKeepAlive(){return this.keepAliveDebounceTimeout?Promise.resolve():(this.keepAliveDebounceTimeout=setTimeout(()=>{this.clearKeepAliveTimeout()},this.configuration.keepAliveDebounce*1e3),this.send(`\r
210
205
  \r
211
- `))}startSendingKeepAlives(){const e=t=>{const s=t*.8;return 1e3*(Math.random()*(t-s)+s)};this.configuration.keepAliveInterval&&!this.keepAliveInterval&&(this.keepAliveInterval=setInterval(()=>{this.sendKeepAlive(),this.startSendingKeepAlives()},e(this.configuration.keepAliveInterval)))}stopSendingKeepAlives(){this.keepAliveInterval&&clearInterval(this.keepAliveInterval),this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveInterval=void 0,this.keepAliveDebounceTimeout=void 0}}xs.defaultOptions={server:"",connectionTimeout:5,keepAliveInterval:0,keepAliveDebounce:10,traceSip:!0};class lr{constructor(e={}){if(this._publishers={},this._registerers={},this._sessions={},this._subscriptions={},this._state=Me.Stopped,this._stateEventEmitter=new Mr,this.delegate=e.delegate,this.options=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},lr.defaultOptions()),{sipjsId:or(5)}),{uri:new yt("sip","anonymous."+or(6),"anonymous.invalid")}),{viaHost:or(12)+".invalid"}),lr.stripUndefinedProperties(e)),this.options.hackIpInContact)if(typeof this.options.hackIpInContact=="boolean"&&this.options.hackIpInContact){const i=Math.floor(Math.random()*254+1);this.options.viaHost="192.0.2."+i}else this.options.hackIpInContact&&(this.options.viaHost=this.options.hackIpInContact);switch(this.loggerFactory=new uc,this.logger=this.loggerFactory.getLogger("sip.UserAgent"),this.loggerFactory.builtinEnabled=this.options.logBuiltinEnabled,this.loggerFactory.connector=this.options.logConnector,this.options.logLevel){case"error":this.loggerFactory.level=Oe.error;break;case"warn":this.loggerFactory.level=Oe.warn;break;case"log":this.loggerFactory.level=Oe.log;break;case"debug":this.loggerFactory.level=Oe.debug;break}if(this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach(t=>{const s=this.options[t];switch(t){case"uri":case"sessionDescriptionHandlerFactory":this.logger.log("· "+t+": "+s);break;case"authorizationPassword":this.logger.log("· "+t+": NOT SHOWN");break;case"transportConstructor":this.logger.log("· "+t+": "+s.name);break;default:this.logger.log("· "+t+": "+JSON.stringify(s))}})),this.options.transportOptions){const t=this.options.transportOptions,s=t.maxReconnectionAttempts,i=t.reconnectionTimeout;s!==void 0&&this.logger.warn('The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),i!==void 0&&this.logger.warn('The transport option "reconnectionTimeout" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),e.reconnectionDelay===void 0&&i!==void 0&&(this.options.reconnectionDelay=i),e.reconnectionAttempts===void 0&&s!==void 0&&(this.options.reconnectionAttempts=s)}if(e.reconnectionDelay!==void 0&&this.logger.warn('The user agent option "reconnectionDelay" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),e.reconnectionAttempts!==void 0&&this.logger.warn('The user agent option "reconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),this._transport=new this.options.transportConstructor(this.getLogger("sip.Transport"),this.options.transportOptions),this.initTransportCallbacks(),this._contact=this.initContact(),this._instanceId=this.options.instanceId?this.options.instanceId:lr.newUUID(),Ie.parse(this._instanceId,"uuid")===-1)throw new Error("Invalid instanceId.");this._userAgentCore=this.initCore()}static makeURI(e){return Ie.URIParse(e)}static defaultOptions(){return{allowLegacyNotifications:!1,authorizationHa1:"",authorizationPassword:"",authorizationUsername:"",delegate:{},contactName:"",contactParams:{transport:"ws"},displayName:"",forceRport:!1,gracefulShutdown:!0,hackAllowUnregisteredOptionTags:!1,hackIpInContact:!1,hackViaTcp:!1,instanceId:"",instanceIdAlwaysAdded:!1,logBuiltinEnabled:!0,logConfiguration:!0,logConnector:()=>{},logLevel:"log",noAnswerTimeout:60,preloadedRouteSet:[],reconnectionAttempts:0,reconnectionDelay:4,sendInitialProvisionalResponse:!0,sessionDescriptionHandlerFactory:Pc(),sessionDescriptionHandlerFactoryOptions:{},sipExtension100rel:ht.Unsupported,sipExtensionReplaces:ht.Unsupported,sipExtensionExtraSupported:[],sipjsId:"",transportConstructor:xs,transportOptions:{},uri:new yt("sip","anonymous","anonymous.invalid"),userAgentString:"SIP.js/"+J0,viaHost:""}}static newUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const s=Math.floor(Math.random()*16);return(t==="x"?s:s%4+8).toString(16)})}static stripUndefinedProperties(e){return Object.keys(e).reduce((t,s)=>(e[s]!==void 0&&(t[s]=e[s]),t),{})}get configuration(){return this.options}get contact(){return this._contact}get instanceId(){return this._instanceId}get state(){return this._state}get stateChange(){return this._stateEventEmitter}get transport(){return this._transport}get userAgentCore(){return this._userAgentCore}getLogger(e,t){return this.loggerFactory.getLogger(e,t)}getLoggerFactory(){return this.loggerFactory}isConnected(){return this.transport.isConnected()}reconnect(){return this.state===Me.Stopped?Promise.reject(new Error("User agent stopped.")):Promise.resolve().then(()=>this.transport.connect())}start(){return this.state===Me.Started?(this.logger.warn("User agent already started"),Promise.resolve()):(this.logger.log(`Starting ${this.configuration.uri}`),this.transitionState(Me.Started),this.transport.connect())}async stop(){if(this.state===Me.Stopped)return this.logger.warn("User agent already stopped"),Promise.resolve();if(this.logger.log(`Stopping ${this.configuration.uri}`),!this.options.gracefulShutdown)return this.logger.log("Dispose of transport"),this.transport.dispose().catch(o=>{throw this.logger.error(o.message),o}),this.logger.log("Dispose of core"),this.userAgentCore.dispose(),this._publishers={},this._registerers={},this._sessions={},this._subscriptions={},this.transitionState(Me.Stopped),Promise.resolve();const e=Object.assign({},this._publishers),t=Object.assign({},this._registerers),s=Object.assign({},this._sessions),i=Object.assign({},this._subscriptions),n=this.transport,a=this.userAgentCore;this.logger.log("Dispose of registerers");for(const o in t)t[o]&&await t[o].dispose().catch(d=>{throw this.logger.error(d.message),delete this._registerers[o],d});this.logger.log("Dispose of sessions");for(const o in s)s[o]&&await s[o].dispose().catch(d=>{throw this.logger.error(d.message),delete this._sessions[o],d});this.logger.log("Dispose of subscriptions");for(const o in i)i[o]&&await i[o].dispose().catch(d=>{throw this.logger.error(d.message),delete this._subscriptions[o],d});this.logger.log("Dispose of publishers");for(const o in e)e[o]&&await e[o].dispose().catch(d=>{throw this.logger.error(d.message),delete this._publishers[o],d});this.logger.log("Dispose of transport"),await n.dispose().catch(o=>{throw this.logger.error(o.message),o}),this.logger.log("Dispose of core"),a.dispose(),this.transitionState(Me.Stopped)}_makeInviter(e,t){return new Ha(this,e,t)}attemptReconnection(e=1){const t=this.options.reconnectionAttempts,s=this.options.reconnectionDelay;if(e>t){this.logger.log("Maximum reconnection attempts reached");return}this.logger.log(`Reconnection attempt ${e} of ${t} - trying`),setTimeout(()=>{this.reconnect().then(()=>{this.logger.log(`Reconnection attempt ${e} of ${t} - succeeded`)}).catch(i=>{this.logger.error(i.message),this.logger.log(`Reconnection attempt ${e} of ${t} - failed`),this.attemptReconnection(++e)})},e===1?0:s*1e3)}initContact(){const e=this.options.contactName!==""?this.options.contactName:or(8),t=this.options.contactParams;return{pubGruu:void 0,tempGruu:void 0,uri:new yt("sip",e,this.options.viaHost,void 0,t),toString:(i={})=>{const n=i.anonymous||!1,a=i.outbound||!1,o=i.register||!1;let d="<";return n?d+=this.contact.tempGruu||`sip:anonymous@anonymous.invalid;transport=${t.transport?t.transport:"ws"}`:o?d+=this.contact.uri:d+=this.contact.pubGruu||this.contact.uri,a&&(d+=";ob"),d+=">",this.options.instanceIdAlwaysAdded&&(d+=';+sip.instance="<urn:uuid:'+this._instanceId+'>"'),d}}}initCore(){let e=[];e.push("outbound"),this.options.sipExtension100rel===ht.Supported&&e.push("100rel"),this.options.sipExtensionReplaces===ht.Supported&&e.push("replaces"),this.options.sipExtensionExtraSupported&&e.push(...this.options.sipExtensionExtraSupported),this.options.hackAllowUnregisteredOptionTags||(e=e.filter(n=>lc[n])),e=Array.from(new Set(e));const t=e.slice();(this.contact.pubGruu||this.contact.tempGruu)&&t.push("gruu");const s={aor:this.options.uri,contact:this.contact,displayName:this.options.displayName,loggerFactory:this.loggerFactory,hackViaTcp:this.options.hackViaTcp,routeSet:this.options.preloadedRouteSet,supportedOptionTags:e,supportedOptionTagsResponse:t,sipjsId:this.options.sipjsId,userAgentHeaderFieldValue:this.options.userAgentString,viaForceRport:this.options.forceRport,viaHost:this.options.viaHost,authenticationFactory:()=>{const n=this.options.authorizationUsername?this.options.authorizationUsername:this.options.uri.user,a=this.options.authorizationPassword?this.options.authorizationPassword:void 0,o=this.options.authorizationHa1?this.options.authorizationHa1:void 0;return new hc(this.getLoggerFactory(),o,n,a)},transportAccessor:()=>this.transport},i={onInvite:n=>{var a;const o=new dc(this,n);if(n.delegate={onCancel:d=>{o._onCancel(d)},onTransportError:d=>{this.logger.error("A transport error has occurred while handling an incoming INVITE request.")}},n.trying(),this.options.sipExtensionReplaces!==ht.Unsupported){const c=n.message.parseHeader("replaces");if(c){const l=c.call_id;if(typeof l!="string")throw new Error("Type of call id is not string");const g=c.replaces_to_tag;if(typeof g!="string")throw new Error("Type of to tag is not string");const u=c.replaces_from_tag;if(typeof u!="string")throw new Error("type of from tag is not string");const y=l+g+u,w=this.userAgentCore.dialogs.get(y);if(!w){o.reject({statusCode:481});return}if(!w.early&&c.early_only===!0){o.reject({statusCode:486});return}const b=this._sessions[l+u]||this._sessions[l+g]||void 0;if(!b)throw new Error("Session does not exist.");o._replacee=b}}if(!((a=this.delegate)===null||a===void 0)&&a.onInvite){if(o.autoSendAnInitialProvisionalResponse){o.progress().then(()=>{var d;if(((d=this.delegate)===null||d===void 0?void 0:d.onInvite)===void 0)throw new Error("onInvite undefined.");this.delegate.onInvite(o)});return}this.delegate.onInvite(o);return}o.reject({statusCode:486})},onMessage:n=>{if(this.delegate&&this.delegate.onMessage){const a=new Ia(n);this.delegate.onMessage(a)}else n.accept()},onNotify:n=>{if(this.delegate&&this.delegate.onNotify){const a=new ji(n);this.delegate.onNotify(a)}else this.options.allowLegacyNotifications?n.accept():n.reject({statusCode:481})},onRefer:n=>{this.logger.warn("Received an out of dialog REFER request"),this.delegate&&this.delegate.onReferRequest?this.delegate.onReferRequest(n):n.reject({statusCode:405})},onRegister:n=>{this.logger.warn("Received an out of dialog REGISTER request"),this.delegate&&this.delegate.onRegisterRequest?this.delegate.onRegisterRequest(n):n.reject({statusCode:405})},onSubscribe:n=>{this.logger.warn("Received an out of dialog SUBSCRIBE request"),this.delegate&&this.delegate.onSubscribeRequest?this.delegate.onSubscribeRequest(n):n.reject({statusCode:405})}};return new Bc(s,i)}initTransportCallbacks(){this.transport.onConnect=()=>this.onTransportConnect(),this.transport.onDisconnect=e=>this.onTransportDisconnect(e),this.transport.onMessage=e=>this.onTransportMessage(e)}onTransportConnect(){this.state!==Me.Stopped&&this.delegate&&this.delegate.onConnect&&this.delegate.onConnect()}onTransportDisconnect(e){this.state!==Me.Stopped&&(this.delegate&&this.delegate.onDisconnect&&this.delegate.onDisconnect(e),e&&this.options.reconnectionAttempts>0&&this.attemptReconnection())}onTransportMessage(e){const t=hs.parseMessage(e,this.getLogger("sip.Parser"));if(!t){this.logger.warn("Failed to parse incoming message. Dropping.");return}if(this.state===Me.Stopped&&t instanceof yr){this.logger.warn(`Received ${t.method} request while stopped. Dropping.`);return}const s=()=>{const i=["from","to","call_id","cseq","via"];for(const n of i)if(!t.hasHeader(n))return this.logger.warn(`Missing mandatory header field : ${n}.`),!1;return!0};if(t instanceof yr){if(!s()){this.logger.warn("Request missing mandatory header field. Dropping.");return}if(!t.toTag&&t.callId.substr(0,5)===this.options.sipjsId){this.userAgentCore.replyStateless(t,{statusCode:482});return}const i=jr(t.body),n=t.getHeader("content-length");if(n&&i<Number(n)){this.userAgentCore.replyStateless(t,{statusCode:400});return}}if(t instanceof Gt){if(!s()){this.logger.warn("Response missing mandatory header field. Dropping.");return}if(t.getHeaders("via").length>1){this.logger.warn("More than one Via header field present in the response. Dropping.");return}if(t.via.host!==this.options.viaHost||t.via.port!==void 0){this.logger.warn("Via sent-by in the response does not match UA Via host value. Dropping.");return}const i=jr(t.body),n=t.getHeader("content-length");if(n&&i<Number(n)){this.logger.warn("Message body length is lower than the value in Content-Length header field. Dropping.");return}}if(t instanceof yr){this.userAgentCore.receiveIncomingRequestFromTransport(t);return}if(t instanceof Gt){this.userAgentCore.receiveIncomingResponseFromTransport(t);return}throw new Error("Invalid message type.")}transitionState(e,t){const s=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};switch(this._state){case Me.Started:e!==Me.Stopped&&s();break;case Me.Stopped:e!==Me.Started&&s();break;default:throw new Error("Unknown state.")}this.logger.log(`Transitioned from ${this._state} to ${e}`),this._state=e,this._stateEventEmitter.emit(this._state)}}//! moment.js
206
+ `))}startSendingKeepAlives(){const e=t=>{const s=t*.8;return 1e3*(Math.random()*(t-s)+s)};this.configuration.keepAliveInterval&&!this.keepAliveInterval&&(this.keepAliveInterval=setInterval(()=>{this.sendKeepAlive(),this.startSendingKeepAlives()},e(this.configuration.keepAliveInterval)))}stopSendingKeepAlives(){this.keepAliveInterval&&clearInterval(this.keepAliveInterval),this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveInterval=void 0,this.keepAliveDebounceTimeout=void 0}}xs.defaultOptions={server:"",connectionTimeout:5,keepAliveInterval:0,keepAliveDebounce:10,traceSip:!0};class lr{constructor(e={}){if(this._publishers={},this._registerers={},this._sessions={},this._subscriptions={},this._state=Me.Stopped,this._stateEventEmitter=new Mr,this.delegate=e.delegate,this.options=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},lr.defaultOptions()),{sipjsId:or(5)}),{uri:new yt("sip","anonymous."+or(6),"anonymous.invalid")}),{viaHost:or(12)+".invalid"}),lr.stripUndefinedProperties(e)),this.options.hackIpInContact)if(typeof this.options.hackIpInContact=="boolean"&&this.options.hackIpInContact){const i=Math.floor(Math.random()*254+1);this.options.viaHost="192.0.2."+i}else this.options.hackIpInContact&&(this.options.viaHost=this.options.hackIpInContact);switch(this.loggerFactory=new J0,this.logger=this.loggerFactory.getLogger("sip.UserAgent"),this.loggerFactory.builtinEnabled=this.options.logBuiltinEnabled,this.loggerFactory.connector=this.options.logConnector,this.options.logLevel){case"error":this.loggerFactory.level=Oe.error;break;case"warn":this.loggerFactory.level=Oe.warn;break;case"log":this.loggerFactory.level=Oe.log;break;case"debug":this.loggerFactory.level=Oe.debug;break}if(this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach(t=>{const s=this.options[t];switch(t){case"uri":case"sessionDescriptionHandlerFactory":this.logger.log("· "+t+": "+s);break;case"authorizationPassword":this.logger.log("· "+t+": NOT SHOWN");break;case"transportConstructor":this.logger.log("· "+t+": "+s.name);break;default:this.logger.log("· "+t+": "+JSON.stringify(s))}})),this.options.transportOptions){const t=this.options.transportOptions,s=t.maxReconnectionAttempts,i=t.reconnectionTimeout;s!==void 0&&this.logger.warn('The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),i!==void 0&&this.logger.warn('The transport option "reconnectionTimeout" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),e.reconnectionDelay===void 0&&i!==void 0&&(this.options.reconnectionDelay=i),e.reconnectionAttempts===void 0&&s!==void 0&&(this.options.reconnectionAttempts=s)}if(e.reconnectionDelay!==void 0&&this.logger.warn('The user agent option "reconnectionDelay" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),e.reconnectionAttempts!==void 0&&this.logger.warn('The user agent option "reconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.'),this._transport=new this.options.transportConstructor(this.getLogger("sip.Transport"),this.options.transportOptions),this.initTransportCallbacks(),this._contact=this.initContact(),this._instanceId=this.options.instanceId?this.options.instanceId:lr.newUUID(),Ie.parse(this._instanceId,"uuid")===-1)throw new Error("Invalid instanceId.");this._userAgentCore=this.initCore()}static makeURI(e){return Ie.URIParse(e)}static defaultOptions(){return{allowLegacyNotifications:!1,authorizationHa1:"",authorizationPassword:"",authorizationUsername:"",delegate:{},contactName:"",contactParams:{transport:"ws"},displayName:"",forceRport:!1,gracefulShutdown:!0,hackAllowUnregisteredOptionTags:!1,hackIpInContact:!1,hackViaTcp:!1,instanceId:"",instanceIdAlwaysAdded:!1,logBuiltinEnabled:!0,logConfiguration:!0,logConnector:()=>{},logLevel:"log",noAnswerTimeout:60,preloadedRouteSet:[],reconnectionAttempts:0,reconnectionDelay:4,sendInitialProvisionalResponse:!0,sessionDescriptionHandlerFactory:Ec(),sessionDescriptionHandlerFactoryOptions:{},sipExtension100rel:ht.Unsupported,sipExtensionReplaces:ht.Unsupported,sipExtensionExtraSupported:[],sipjsId:"",transportConstructor:xs,transportOptions:{},uri:new yt("sip","anonymous","anonymous.invalid"),userAgentString:"SIP.js/"+N0,viaHost:""}}static newUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const s=Math.floor(Math.random()*16);return(t==="x"?s:s%4+8).toString(16)})}static stripUndefinedProperties(e){return Object.keys(e).reduce((t,s)=>(e[s]!==void 0&&(t[s]=e[s]),t),{})}get configuration(){return this.options}get contact(){return this._contact}get instanceId(){return this._instanceId}get state(){return this._state}get stateChange(){return this._stateEventEmitter}get transport(){return this._transport}get userAgentCore(){return this._userAgentCore}getLogger(e,t){return this.loggerFactory.getLogger(e,t)}getLoggerFactory(){return this.loggerFactory}isConnected(){return this.transport.isConnected()}reconnect(){return this.state===Me.Stopped?Promise.reject(new Error("User agent stopped.")):Promise.resolve().then(()=>this.transport.connect())}start(){return this.state===Me.Started?(this.logger.warn("User agent already started"),Promise.resolve()):(this.logger.log(`Starting ${this.configuration.uri}`),this.transitionState(Me.Started),this.transport.connect())}async stop(){if(this.state===Me.Stopped)return this.logger.warn("User agent already stopped"),Promise.resolve();if(this.logger.log(`Stopping ${this.configuration.uri}`),!this.options.gracefulShutdown)return this.logger.log("Dispose of transport"),this.transport.dispose().catch(o=>{throw this.logger.error(o.message),o}),this.logger.log("Dispose of core"),this.userAgentCore.dispose(),this._publishers={},this._registerers={},this._sessions={},this._subscriptions={},this.transitionState(Me.Stopped),Promise.resolve();const e=Object.assign({},this._publishers),t=Object.assign({},this._registerers),s=Object.assign({},this._sessions),i=Object.assign({},this._subscriptions),n=this.transport,a=this.userAgentCore;this.logger.log("Dispose of registerers");for(const o in t)t[o]&&await t[o].dispose().catch(d=>{throw this.logger.error(d.message),delete this._registerers[o],d});this.logger.log("Dispose of sessions");for(const o in s)s[o]&&await s[o].dispose().catch(d=>{throw this.logger.error(d.message),delete this._sessions[o],d});this.logger.log("Dispose of subscriptions");for(const o in i)i[o]&&await i[o].dispose().catch(d=>{throw this.logger.error(d.message),delete this._subscriptions[o],d});this.logger.log("Dispose of publishers");for(const o in e)e[o]&&await e[o].dispose().catch(d=>{throw this.logger.error(d.message),delete this._publishers[o],d});this.logger.log("Dispose of transport"),await n.dispose().catch(o=>{throw this.logger.error(o.message),o}),this.logger.log("Dispose of core"),a.dispose(),this.transitionState(Me.Stopped)}_makeInviter(e,t){return new Ra(this,e,t)}attemptReconnection(e=1){const t=this.options.reconnectionAttempts,s=this.options.reconnectionDelay;if(e>t){this.logger.log("Maximum reconnection attempts reached");return}this.logger.log(`Reconnection attempt ${e} of ${t} - trying`),setTimeout(()=>{this.reconnect().then(()=>{this.logger.log(`Reconnection attempt ${e} of ${t} - succeeded`)}).catch(i=>{this.logger.error(i.message),this.logger.log(`Reconnection attempt ${e} of ${t} - failed`),this.attemptReconnection(++e)})},e===1?0:s*1e3)}initContact(){const e=this.options.contactName!==""?this.options.contactName:or(8),t=this.options.contactParams;return{pubGruu:void 0,tempGruu:void 0,uri:new yt("sip",e,this.options.viaHost,void 0,t),toString:(i={})=>{const n=i.anonymous||!1,a=i.outbound||!1,o=i.register||!1;let d="<";return n?d+=this.contact.tempGruu||`sip:anonymous@anonymous.invalid;transport=${t.transport?t.transport:"ws"}`:o?d+=this.contact.uri:d+=this.contact.pubGruu||this.contact.uri,a&&(d+=";ob"),d+=">",this.options.instanceIdAlwaysAdded&&(d+=';+sip.instance="<urn:uuid:'+this._instanceId+'>"'),d}}}initCore(){let e=[];e.push("outbound"),this.options.sipExtension100rel===ht.Supported&&e.push("100rel"),this.options.sipExtensionReplaces===ht.Supported&&e.push("replaces"),this.options.sipExtensionExtraSupported&&e.push(...this.options.sipExtensionExtraSupported),this.options.hackAllowUnregisteredOptionTags||(e=e.filter(n=>K0[n])),e=Array.from(new Set(e));const t=e.slice();(this.contact.pubGruu||this.contact.tempGruu)&&t.push("gruu");const s={aor:this.options.uri,contact:this.contact,displayName:this.options.displayName,loggerFactory:this.loggerFactory,hackViaTcp:this.options.hackViaTcp,routeSet:this.options.preloadedRouteSet,supportedOptionTags:e,supportedOptionTagsResponse:t,sipjsId:this.options.sipjsId,userAgentHeaderFieldValue:this.options.userAgentString,viaForceRport:this.options.forceRport,viaHost:this.options.viaHost,authenticationFactory:()=>{const n=this.options.authorizationUsername?this.options.authorizationUsername:this.options.uri.user,a=this.options.authorizationPassword?this.options.authorizationPassword:void 0,o=this.options.authorizationHa1?this.options.authorizationHa1:void 0;return new X0(this.getLoggerFactory(),o,n,a)},transportAccessor:()=>this.transport},i={onInvite:n=>{var a;const o=new Z0(this,n);if(n.delegate={onCancel:d=>{o._onCancel(d)},onTransportError:d=>{this.logger.error("A transport error has occurred while handling an incoming INVITE request.")}},n.trying(),this.options.sipExtensionReplaces!==ht.Unsupported){const c=n.message.parseHeader("replaces");if(c){const l=c.call_id;if(typeof l!="string")throw new Error("Type of call id is not string");const g=c.replaces_to_tag;if(typeof g!="string")throw new Error("Type of to tag is not string");const u=c.replaces_from_tag;if(typeof u!="string")throw new Error("type of from tag is not string");const y=l+g+u,w=this.userAgentCore.dialogs.get(y);if(!w){o.reject({statusCode:481});return}if(!w.early&&c.early_only===!0){o.reject({statusCode:486});return}const b=this._sessions[l+u]||this._sessions[l+g]||void 0;if(!b)throw new Error("Session does not exist.");o._replacee=b}}if(!((a=this.delegate)===null||a===void 0)&&a.onInvite){if(o.autoSendAnInitialProvisionalResponse){o.progress().then(()=>{var d;if(((d=this.delegate)===null||d===void 0?void 0:d.onInvite)===void 0)throw new Error("onInvite undefined.");this.delegate.onInvite(o)});return}this.delegate.onInvite(o);return}o.reject({statusCode:486})},onMessage:n=>{if(this.delegate&&this.delegate.onMessage){const a=new Ta(n);this.delegate.onMessage(a)}else n.accept()},onNotify:n=>{if(this.delegate&&this.delegate.onNotify){const a=new Mi(n);this.delegate.onNotify(a)}else this.options.allowLegacyNotifications?n.accept():n.reject({statusCode:481})},onRefer:n=>{this.logger.warn("Received an out of dialog REFER request"),this.delegate&&this.delegate.onReferRequest?this.delegate.onReferRequest(n):n.reject({statusCode:405})},onRegister:n=>{this.logger.warn("Received an out of dialog REGISTER request"),this.delegate&&this.delegate.onRegisterRequest?this.delegate.onRegisterRequest(n):n.reject({statusCode:405})},onSubscribe:n=>{this.logger.warn("Received an out of dialog SUBSCRIBE request"),this.delegate&&this.delegate.onSubscribeRequest?this.delegate.onSubscribeRequest(n):n.reject({statusCode:405})}};return new vc(s,i)}initTransportCallbacks(){this.transport.onConnect=()=>this.onTransportConnect(),this.transport.onDisconnect=e=>this.onTransportDisconnect(e),this.transport.onMessage=e=>this.onTransportMessage(e)}onTransportConnect(){this.state!==Me.Stopped&&this.delegate&&this.delegate.onConnect&&this.delegate.onConnect()}onTransportDisconnect(e){this.state!==Me.Stopped&&(this.delegate&&this.delegate.onDisconnect&&this.delegate.onDisconnect(e),e&&this.options.reconnectionAttempts>0&&this.attemptReconnection())}onTransportMessage(e){const t=hs.parseMessage(e,this.getLogger("sip.Parser"));if(!t){this.logger.warn("Failed to parse incoming message. Dropping.");return}if(this.state===Me.Stopped&&t instanceof yr){this.logger.warn(`Received ${t.method} request while stopped. Dropping.`);return}const s=()=>{const i=["from","to","call_id","cseq","via"];for(const n of i)if(!t.hasHeader(n))return this.logger.warn(`Missing mandatory header field : ${n}.`),!1;return!0};if(t instanceof yr){if(!s()){this.logger.warn("Request missing mandatory header field. Dropping.");return}if(!t.toTag&&t.callId.substr(0,5)===this.options.sipjsId){this.userAgentCore.replyStateless(t,{statusCode:482});return}const i=qr(t.body),n=t.getHeader("content-length");if(n&&i<Number(n)){this.userAgentCore.replyStateless(t,{statusCode:400});return}}if(t instanceof Gt){if(!s()){this.logger.warn("Response missing mandatory header field. Dropping.");return}if(t.getHeaders("via").length>1){this.logger.warn("More than one Via header field present in the response. Dropping.");return}if(t.via.host!==this.options.viaHost||t.via.port!==void 0){this.logger.warn("Via sent-by in the response does not match UA Via host value. Dropping.");return}const i=qr(t.body),n=t.getHeader("content-length");if(n&&i<Number(n)){this.logger.warn("Message body length is lower than the value in Content-Length header field. Dropping.");return}}if(t instanceof yr){this.userAgentCore.receiveIncomingRequestFromTransport(t);return}if(t instanceof Gt){this.userAgentCore.receiveIncomingResponseFromTransport(t);return}throw new Error("Invalid message type.")}transitionState(e,t){const s=()=>{throw new Error(`Invalid state transition from ${this._state} to ${e}`)};switch(this._state){case Me.Started:e!==Me.Stopped&&s();break;case Me.Stopped:e!==Me.Started&&s();break;default:throw new Error("Unknown state.")}this.logger.log(`Transitioned from ${this._state} to ${e}`),this._state=e,this._stateEventEmitter.emit(this._state)}}//! moment.js
212
207
  //! version : 2.30.1
213
208
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
214
209
  //! license : MIT
215
210
  //! momentjs.com
216
- var Ya;function Y(){return Ya.apply(null,arguments)}function $c(r){Ya=r}function ut(r){return r instanceof Array||Object.prototype.toString.call(r)==="[object Array]"}function dr(r){return r!=null&&Object.prototype.toString.call(r)==="[object Object]"}function ge(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function Ui(r){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(r).length===0;var e;for(e in r)if(ge(r,e))return!1;return!0}function Ze(r){return r===void 0}function It(r){return typeof r=="number"||Object.prototype.toString.call(r)==="[object Number]"}function Ur(r){return r instanceof Date||Object.prototype.toString.call(r)==="[object Date]"}function Wa(r,e){var t=[],s,i=r.length;for(s=0;s<i;++s)t.push(e(r[s],s));return t}function Xt(r,e){for(var t in e)ge(e,t)&&(r[t]=e[t]);return ge(e,"toString")&&(r.toString=e.toString),ge(e,"valueOf")&&(r.valueOf=e.valueOf),r}function Ct(r,e,t,s){return yo(r,e,t,s,!0).utc()}function Oc(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function re(r){return r._pf==null&&(r._pf=Oc()),r._pf}var Yi;Array.prototype.some?Yi=Array.prototype.some:Yi=function(r){var e=Object(this),t=e.length>>>0,s;for(s=0;s<t;s++)if(s in e&&r.call(this,e[s],s,e))return!0;return!1};function Wi(r){var e=null,t=!1,s=r._d&&!isNaN(r._d.getTime());if(s&&(e=re(r),t=Yi.call(e.parsedDateParts,function(i){return i!=null}),s=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t),r._strict&&(s=s&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(r))r._isValid=s;else return s;return r._isValid}function ps(r){var e=Ct(NaN);return r!=null?Xt(re(e),r):re(e).userInvalidated=!0,e}var Ga=Y.momentProperties=[],Gi=!1;function Vi(r,e){var t,s,i,n=Ga.length;if(Ze(e._isAMomentObject)||(r._isAMomentObject=e._isAMomentObject),Ze(e._i)||(r._i=e._i),Ze(e._f)||(r._f=e._f),Ze(e._l)||(r._l=e._l),Ze(e._strict)||(r._strict=e._strict),Ze(e._tzm)||(r._tzm=e._tzm),Ze(e._isUTC)||(r._isUTC=e._isUTC),Ze(e._offset)||(r._offset=e._offset),Ze(e._pf)||(r._pf=re(e)),Ze(e._locale)||(r._locale=e._locale),n>0)for(t=0;t<n;t++)s=Ga[t],i=e[s],Ze(i)||(r[s]=i);return r}function Yr(r){Vi(this,r),this._d=new Date(r._d!=null?r._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Gi===!1&&(Gi=!0,Y.updateOffset(this),Gi=!1)}function ft(r){return r instanceof Yr||r!=null&&r._isAMomentObject!=null}function Va(r){Y.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+r)}function it(r,e){var t=!0;return Xt(function(){if(Y.deprecationHandler!=null&&Y.deprecationHandler(null,r),t){var s=[],i,n,a,o=arguments.length;for(n=0;n<o;n++){if(i="",typeof arguments[n]=="object"){i+=`
217
- [`+n+"] ";for(a in arguments[0])ge(arguments[0],a)&&(i+=a+": "+arguments[0][a]+", ");i=i.slice(0,-2)}else i=arguments[n];s.push(i)}Va(r+`
211
+ var Ma;function Y(){return Ma.apply(null,arguments)}function bc(r){Ma=r}function ut(r){return r instanceof Array||Object.prototype.toString.call(r)==="[object Array]"}function dr(r){return r!=null&&Object.prototype.toString.call(r)==="[object Object]"}function ge(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function Ui(r){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(r).length===0;var e;for(e in r)if(ge(r,e))return!1;return!0}function Ze(r){return r===void 0}function It(r){return typeof r=="number"||Object.prototype.toString.call(r)==="[object Number]"}function Lr(r){return r instanceof Date||Object.prototype.toString.call(r)==="[object Date]"}function qa(r,e){var t=[],s,i=r.length;for(s=0;s<i;++s)t.push(e(r[s],s));return t}function Xt(r,e){for(var t in e)ge(e,t)&&(r[t]=e[t]);return ge(e,"toString")&&(r.toString=e.toString),ge(e,"valueOf")&&(r.valueOf=e.valueOf),r}function Ct(r,e,t,s){return go(r,e,t,s,!0).utc()}function Cc(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function te(r){return r._pf==null&&(r._pf=Cc()),r._pf}var Li;Array.prototype.some?Li=Array.prototype.some:Li=function(r){var e=Object(this),t=e.length>>>0,s;for(s=0;s<t;s++)if(s in e&&r.call(this,e[s],s,e))return!0;return!1};function Yi(r){var e=null,t=!1,s=r._d&&!isNaN(r._d.getTime());if(s&&(e=te(r),t=Li.call(e.parsedDateParts,function(i){return i!=null}),s=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t),r._strict&&(s=s&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(r))r._isValid=s;else return s;return r._isValid}function ps(r){var e=Ct(NaN);return r!=null?Xt(te(e),r):te(e).userInvalidated=!0,e}var ja=Y.momentProperties=[],Wi=!1;function Gi(r,e){var t,s,i,n=ja.length;if(Ze(e._isAMomentObject)||(r._isAMomentObject=e._isAMomentObject),Ze(e._i)||(r._i=e._i),Ze(e._f)||(r._f=e._f),Ze(e._l)||(r._l=e._l),Ze(e._strict)||(r._strict=e._strict),Ze(e._tzm)||(r._tzm=e._tzm),Ze(e._isUTC)||(r._isUTC=e._isUTC),Ze(e._offset)||(r._offset=e._offset),Ze(e._pf)||(r._pf=te(e)),Ze(e._locale)||(r._locale=e._locale),n>0)for(t=0;t<n;t++)s=ja[t],i=e[s],Ze(i)||(r[s]=i);return r}function Yr(r){Gi(this,r),this._d=new Date(r._d!=null?r._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Wi===!1&&(Wi=!0,Y.updateOffset(this),Wi=!1)}function ft(r){return r instanceof Yr||r!=null&&r._isAMomentObject!=null}function Ua(r){Y.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+r)}function it(r,e){var t=!0;return Xt(function(){if(Y.deprecationHandler!=null&&Y.deprecationHandler(null,r),t){var s=[],i,n,a,o=arguments.length;for(n=0;n<o;n++){if(i="",typeof arguments[n]=="object"){i+=`
212
+ [`+n+"] ";for(a in arguments[0])ge(arguments[0],a)&&(i+=a+": "+arguments[0][a]+", ");i=i.slice(0,-2)}else i=arguments[n];s.push(i)}Ua(r+`
218
213
  Arguments: `+Array.prototype.slice.call(s).join("")+`
219
- `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var za={};function Ka(r,e){Y.deprecationHandler!=null&&Y.deprecationHandler(r,e),za[r]||(Va(e),za[r]=!0)}Y.suppressDeprecationWarnings=!1,Y.deprecationHandler=null;function _t(r){return typeof Function<"u"&&r instanceof Function||Object.prototype.toString.call(r)==="[object Function]"}function Nc(r){var e,t;for(t in r)ge(r,t)&&(e=r[t],_t(e)?this[t]=e:this["_"+t]=e);this._config=r,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function zi(r,e){var t=Xt({},r),s;for(s in e)ge(e,s)&&(dr(r[s])&&dr(e[s])?(t[s]={},Xt(t[s],r[s]),Xt(t[s],e[s])):e[s]!=null?t[s]=e[s]:delete t[s]);for(s in r)ge(r,s)&&!ge(e,s)&&dr(r[s])&&(t[s]=Xt({},t[s]));return t}function Ki(r){r!=null&&this.set(r)}var Zi;Object.keys?Zi=Object.keys:Zi=function(r){var e,t=[];for(e in r)ge(r,e)&&t.push(e);return t};var Mc={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function jc(r,e,t){var s=this._calendar[r]||this._calendar.sameElse;return _t(s)?s.call(e,t):s}function Dt(r,e,t){var s=""+Math.abs(r),i=e-s.length,n=r>=0;return(n?t?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var Xi=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ms=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ji={},Er={};function J(r,e,t,s){var i=s;typeof s=="string"&&(i=function(){return this[s]()}),r&&(Er[r]=i),e&&(Er[e[0]]=function(){return Dt(i.apply(this,arguments),e[1],e[2])}),t&&(Er[t]=function(){return this.localeData().ordinal(i.apply(this,arguments),r)})}function qc(r){return r.match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"")}function Lc(r){var e=r.match(Xi),t,s;for(t=0,s=e.length;t<s;t++)Er[e[t]]?e[t]=Er[e[t]]:e[t]=qc(e[t]);return function(i){var n="",a;for(a=0;a<s;a++)n+=_t(e[a])?e[a].call(i,r):e[a];return n}}function vs(r,e){return r.isValid()?(e=Za(e,r.localeData()),Ji[e]=Ji[e]||Lc(e),Ji[e](r)):r.localeData().invalidDate()}function Za(r,e){var t=5;function s(i){return e.longDateFormat(i)||i}for(ms.lastIndex=0;t>=0&&ms.test(r);)r=r.replace(ms,s),ms.lastIndex=0,t-=1;return r}var Uc={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Yc(r){var e=this._longDateFormat[r],t=this._longDateFormat[r.toUpperCase()];return e||!t?e:(this._longDateFormat[r]=t.match(Xi).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[r])}var Wc="Invalid date";function Gc(){return this._invalidDate}var Vc="%d",zc=/\d{1,2}/;function Kc(r){return this._ordinal.replace("%d",r)}var Zc={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Xc(r,e,t,s){var i=this._relativeTime[t];return _t(i)?i(r,e,t,s):i.replace(/%d/i,r)}function Jc(r,e){var t=this._relativeTime[r>0?"future":"past"];return _t(t)?t(e):t.replace(/%s/i,e)}var Xa={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function nt(r){return typeof r=="string"?Xa[r]||Xa[r.toLowerCase()]:void 0}function Qi(r){var e={},t,s;for(s in r)ge(r,s)&&(t=nt(s),t&&(e[t]=r[s]));return e}var Qc={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function el(r){var e=[],t;for(t in r)ge(r,t)&&e.push({unit:t,priority:Qc[t]});return e.sort(function(s,i){return s.priority-i.priority}),e}var Ja=/\d/,tt=/\d\d/,Qa=/\d{3}/,en=/\d{4}/,ys=/[+-]?\d{6}/,Ce=/\d\d?/,eo=/\d\d\d\d?/,to=/\d\d\d\d\d\d?/,ws=/\d{1,3}/,tn=/\d{1,4}/,Es=/[+-]?\d{1,6}/,br=/\d+/,bs=/[+-]?\d+/,tl=/Z|[+-]\d\d:?\d\d/gi,Cs=/Z|[+-]\d\d(?::?\d\d)?/gi,rl=/[+-]?\d+(\.\d{1,3})?/,Wr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Cr=/^[1-9]\d?/,rn=/^([1-9]\d|\d)/,_s;_s={};function z(r,e,t){_s[r]=_t(e)?e:function(s,i){return s&&t?t:e}}function sl(r,e){return ge(_s,r)?_s[r](e._strict,e._locale):new RegExp(il(r))}function il(r){return Ht(r.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,s,i,n){return t||s||i||n}))}function Ht(r){return r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function at(r){return r<0?Math.ceil(r)||0:Math.floor(r)}function ne(r){var e=+r,t=0;return e!==0&&isFinite(e)&&(t=at(e)),t}var sn={};function ye(r,e){var t,s=e,i;for(typeof r=="string"&&(r=[r]),It(e)&&(s=function(n,a){a[e]=ne(n)}),i=r.length,t=0;t<i;t++)sn[r[t]]=s}function Gr(r,e){ye(r,function(t,s,i,n){i._w=i._w||{},e(t,i._w,i,n)})}function nl(r,e,t){e!=null&&ge(sn,r)&&sn[r](e,t._a,t,r)}function Ds(r){return r%4===0&&r%100!==0||r%400===0}var Le=0,Pt=1,At=2,He=3,gt=4,$t=5,hr=6,al=7,ol=8;J("Y",0,0,function(){var r=this.year();return r<=9999?Dt(r,4):"+"+r}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),z("Y",bs),z("YY",Ce,tt),z("YYYY",tn,en),z("YYYYY",Es,ys),z("YYYYYY",Es,ys),ye(["YYYYY","YYYYYY"],Le),ye("YYYY",function(r,e){e[Le]=r.length===2?Y.parseTwoDigitYear(r):ne(r)}),ye("YY",function(r,e){e[Le]=Y.parseTwoDigitYear(r)}),ye("Y",function(r,e){e[Le]=parseInt(r,10)});function Vr(r){return Ds(r)?366:365}Y.parseTwoDigitYear=function(r){return ne(r)+(ne(r)>68?1900:2e3)};var ro=_r("FullYear",!0);function cl(){return Ds(this.year())}function _r(r,e){return function(t){return t!=null?(so(this,r,t),Y.updateOffset(this,e),this):zr(this,r)}}function zr(r,e){if(!r.isValid())return NaN;var t=r._d,s=r._isUTC;switch(e){case"Milliseconds":return s?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return s?t.getUTCSeconds():t.getSeconds();case"Minutes":return s?t.getUTCMinutes():t.getMinutes();case"Hours":return s?t.getUTCHours():t.getHours();case"Date":return s?t.getUTCDate():t.getDate();case"Day":return s?t.getUTCDay():t.getDay();case"Month":return s?t.getUTCMonth():t.getMonth();case"FullYear":return s?t.getUTCFullYear():t.getFullYear();default:return NaN}}function so(r,e,t){var s,i,n,a,o;if(!(!r.isValid()||isNaN(t))){switch(s=r._d,i=r._isUTC,e){case"Milliseconds":return void(i?s.setUTCMilliseconds(t):s.setMilliseconds(t));case"Seconds":return void(i?s.setUTCSeconds(t):s.setSeconds(t));case"Minutes":return void(i?s.setUTCMinutes(t):s.setMinutes(t));case"Hours":return void(i?s.setUTCHours(t):s.setHours(t));case"Date":return void(i?s.setUTCDate(t):s.setDate(t));case"FullYear":break;default:return}n=t,a=r.month(),o=r.date(),o=o===29&&a===1&&!Ds(n)?28:o,i?s.setUTCFullYear(n,a,o):s.setFullYear(n,a,o)}}function ll(r){return r=nt(r),_t(this[r])?this[r]():this}function dl(r,e){if(typeof r=="object"){r=Qi(r);var t=el(r),s,i=t.length;for(s=0;s<i;s++)this[t[s].unit](r[t[s].unit])}else if(r=nt(r),_t(this[r]))return this[r](e);return this}function hl(r,e){return(r%e+e)%e}var Te;Array.prototype.indexOf?Te=Array.prototype.indexOf:Te=function(r){var e;for(e=0;e<this.length;++e)if(this[e]===r)return e;return-1};function nn(r,e){if(isNaN(r)||isNaN(e))return NaN;var t=hl(e,12);return r+=(e-t)/12,t===1?Ds(r)?29:28:31-t%7%2}J("M",["MM",2],"Mo",function(){return this.month()+1}),J("MMM",0,0,function(r){return this.localeData().monthsShort(this,r)}),J("MMMM",0,0,function(r){return this.localeData().months(this,r)}),z("M",Ce,Cr),z("MM",Ce,tt),z("MMM",function(r,e){return e.monthsShortRegex(r)}),z("MMMM",function(r,e){return e.monthsRegex(r)}),ye(["M","MM"],function(r,e){e[Pt]=ne(r)-1}),ye(["MMM","MMMM"],function(r,e,t,s){var i=t._locale.monthsParse(r,s,t._strict);i!=null?e[Pt]=i:re(t).invalidMonth=r});var ul="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),io="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),no=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,fl=Wr,gl=Wr;function xl(r,e){return r?ut(this._months)?this._months[r.month()]:this._months[(this._months.isFormat||no).test(e)?"format":"standalone"][r.month()]:ut(this._months)?this._months:this._months.standalone}function pl(r,e){return r?ut(this._monthsShort)?this._monthsShort[r.month()]:this._monthsShort[no.test(e)?"format":"standalone"][r.month()]:ut(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ml(r,e,t){var s,i,n,a=r.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)n=Ct([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(n,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(n,"").toLocaleLowerCase();return t?e==="MMM"?(i=Te.call(this._shortMonthsParse,a),i!==-1?i:null):(i=Te.call(this._longMonthsParse,a),i!==-1?i:null):e==="MMM"?(i=Te.call(this._shortMonthsParse,a),i!==-1?i:(i=Te.call(this._longMonthsParse,a),i!==-1?i:null)):(i=Te.call(this._longMonthsParse,a),i!==-1?i:(i=Te.call(this._shortMonthsParse,a),i!==-1?i:null))}function vl(r,e,t){var s,i,n;if(this._monthsParseExact)return ml.call(this,r,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=Ct([2e3,s]),t&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!t&&!this._monthsParse[s]&&(n="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(n.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[s].test(r))return s;if(t&&e==="MMM"&&this._shortMonthsParse[s].test(r))return s;if(!t&&this._monthsParse[s].test(r))return s}}function ao(r,e){if(!r.isValid())return r;if(typeof e=="string"){if(/^\d+$/.test(e))e=ne(e);else if(e=r.localeData().monthsParse(e),!It(e))return r}var t=e,s=r.date();return s=s<29?s:Math.min(s,nn(r.year(),t)),r._isUTC?r._d.setUTCMonth(t,s):r._d.setMonth(t,s),r}function oo(r){return r!=null?(ao(this,r),Y.updateOffset(this,!0),this):zr(this,"Month")}function yl(){return nn(this.year(),this.month())}function wl(r){return this._monthsParseExact?(ge(this,"_monthsRegex")||co.call(this),r?this._monthsShortStrictRegex:this._monthsShortRegex):(ge(this,"_monthsShortRegex")||(this._monthsShortRegex=fl),this._monthsShortStrictRegex&&r?this._monthsShortStrictRegex:this._monthsShortRegex)}function El(r){return this._monthsParseExact?(ge(this,"_monthsRegex")||co.call(this),r?this._monthsStrictRegex:this._monthsRegex):(ge(this,"_monthsRegex")||(this._monthsRegex=gl),this._monthsStrictRegex&&r?this._monthsStrictRegex:this._monthsRegex)}function co(){function r(d,c){return c.length-d.length}var e=[],t=[],s=[],i,n,a,o;for(i=0;i<12;i++)n=Ct([2e3,i]),a=Ht(this.monthsShort(n,"")),o=Ht(this.months(n,"")),e.push(a),t.push(o),s.push(o),s.push(a);e.sort(r),t.sort(r),s.sort(r),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function bl(r,e,t,s,i,n,a){var o;return r<100&&r>=0?(o=new Date(r+400,e,t,s,i,n,a),isFinite(o.getFullYear())&&o.setFullYear(r)):o=new Date(r,e,t,s,i,n,a),o}function Kr(r){var e,t;return r<100&&r>=0?(t=Array.prototype.slice.call(arguments),t[0]=r+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(r)):e=new Date(Date.UTC.apply(null,arguments)),e}function As(r,e,t){var s=7+e-t,i=(7+Kr(r,0,s).getUTCDay()-e)%7;return-i+s-1}function lo(r,e,t,s,i){var n=(7+t-s)%7,a=As(r,s,i),o=1+7*(e-1)+n+a,d,c;return o<=0?(d=r-1,c=Vr(d)+o):o>Vr(r)?(d=r+1,c=o-Vr(r)):(d=r,c=o),{year:d,dayOfYear:c}}function Zr(r,e,t){var s=As(r.year(),e,t),i=Math.floor((r.dayOfYear()-s-1)/7)+1,n,a;return i<1?(a=r.year()-1,n=i+Ot(a,e,t)):i>Ot(r.year(),e,t)?(n=i-Ot(r.year(),e,t),a=r.year()+1):(a=r.year(),n=i),{week:n,year:a}}function Ot(r,e,t){var s=As(r,e,t),i=As(r+1,e,t);return(Vr(r)-s+i)/7}J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),z("w",Ce,Cr),z("ww",Ce,tt),z("W",Ce,Cr),z("WW",Ce,tt),Gr(["w","ww","W","WW"],function(r,e,t,s){e[s.substr(0,1)]=ne(r)});function Cl(r){return Zr(r,this._week.dow,this._week.doy).week}var _l={dow:0,doy:6};function Dl(){return this._week.dow}function Al(){return this._week.doy}function Sl(r){var e=this.localeData().week(this);return r==null?e:this.add((r-e)*7,"d")}function Tl(r){var e=Zr(this,1,4).week;return r==null?e:this.add((r-e)*7,"d")}J("d",0,"do","day"),J("dd",0,0,function(r){return this.localeData().weekdaysMin(this,r)}),J("ddd",0,0,function(r){return this.localeData().weekdaysShort(this,r)}),J("dddd",0,0,function(r){return this.localeData().weekdays(this,r)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),z("d",Ce),z("e",Ce),z("E",Ce),z("dd",function(r,e){return e.weekdaysMinRegex(r)}),z("ddd",function(r,e){return e.weekdaysShortRegex(r)}),z("dddd",function(r,e){return e.weekdaysRegex(r)}),Gr(["dd","ddd","dddd"],function(r,e,t,s){var i=t._locale.weekdaysParse(r,s,t._strict);i!=null?e.d=i:re(t).invalidWeekday=r}),Gr(["d","e","E"],function(r,e,t,s){e[s]=ne(r)});function Rl(r,e){return typeof r!="string"?r:isNaN(r)?(r=e.weekdaysParse(r),typeof r=="number"?r:null):parseInt(r,10)}function Fl(r,e){return typeof r=="string"?e.weekdaysParse(r)%7||7:isNaN(r)?null:r}function an(r,e){return r.slice(e,7).concat(r.slice(0,e))}var kl="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ho="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Bl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Il=Wr,Hl=Wr,Pl=Wr;function $l(r,e){var t=ut(this._weekdays)?this._weekdays:this._weekdays[r&&r!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return r===!0?an(t,this._week.dow):r?t[r.day()]:t}function Ol(r){return r===!0?an(this._weekdaysShort,this._week.dow):r?this._weekdaysShort[r.day()]:this._weekdaysShort}function Nl(r){return r===!0?an(this._weekdaysMin,this._week.dow):r?this._weekdaysMin[r.day()]:this._weekdaysMin}function Ml(r,e,t){var s,i,n,a=r.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)n=Ct([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(n,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(n,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(n,"").toLocaleLowerCase();return t?e==="dddd"?(i=Te.call(this._weekdaysParse,a),i!==-1?i:null):e==="ddd"?(i=Te.call(this._shortWeekdaysParse,a),i!==-1?i:null):(i=Te.call(this._minWeekdaysParse,a),i!==-1?i:null):e==="dddd"?(i=Te.call(this._weekdaysParse,a),i!==-1||(i=Te.call(this._shortWeekdaysParse,a),i!==-1)?i:(i=Te.call(this._minWeekdaysParse,a),i!==-1?i:null)):e==="ddd"?(i=Te.call(this._shortWeekdaysParse,a),i!==-1||(i=Te.call(this._weekdaysParse,a),i!==-1)?i:(i=Te.call(this._minWeekdaysParse,a),i!==-1?i:null)):(i=Te.call(this._minWeekdaysParse,a),i!==-1||(i=Te.call(this._weekdaysParse,a),i!==-1)?i:(i=Te.call(this._shortWeekdaysParse,a),i!==-1?i:null))}function jl(r,e,t){var s,i,n;if(this._weekdaysParseExact)return Ml.call(this,r,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=Ct([2e3,1]).day(s),t&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(n="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(n.replace(".",""),"i")),t&&e==="dddd"&&this._fullWeekdaysParse[s].test(r))return s;if(t&&e==="ddd"&&this._shortWeekdaysParse[s].test(r))return s;if(t&&e==="dd"&&this._minWeekdaysParse[s].test(r))return s;if(!t&&this._weekdaysParse[s].test(r))return s}}function ql(r){if(!this.isValid())return r!=null?this:NaN;var e=zr(this,"Day");return r!=null?(r=Rl(r,this.localeData()),this.add(r-e,"d")):e}function Ll(r){if(!this.isValid())return r!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return r==null?e:this.add(r-e,"d")}function Ul(r){if(!this.isValid())return r!=null?this:NaN;if(r!=null){var e=Fl(r,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function Yl(r){return this._weekdaysParseExact?(ge(this,"_weekdaysRegex")||on.call(this),r?this._weekdaysStrictRegex:this._weekdaysRegex):(ge(this,"_weekdaysRegex")||(this._weekdaysRegex=Il),this._weekdaysStrictRegex&&r?this._weekdaysStrictRegex:this._weekdaysRegex)}function Wl(r){return this._weekdaysParseExact?(ge(this,"_weekdaysRegex")||on.call(this),r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ge(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Hl),this._weekdaysShortStrictRegex&&r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Gl(r){return this._weekdaysParseExact?(ge(this,"_weekdaysRegex")||on.call(this),r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ge(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Pl),this._weekdaysMinStrictRegex&&r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function on(){function r(l,g){return g.length-l.length}var e=[],t=[],s=[],i=[],n,a,o,d,c;for(n=0;n<7;n++)a=Ct([2e3,1]).day(n),o=Ht(this.weekdaysMin(a,"")),d=Ht(this.weekdaysShort(a,"")),c=Ht(this.weekdays(a,"")),e.push(o),t.push(d),s.push(c),i.push(o),i.push(d),i.push(c);e.sort(r),t.sort(r),s.sort(r),i.sort(r),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function cn(){return this.hours()%12||12}function Vl(){return this.hours()||24}J("H",["HH",2],0,"hour"),J("h",["hh",2],0,cn),J("k",["kk",2],0,Vl),J("hmm",0,0,function(){return""+cn.apply(this)+Dt(this.minutes(),2)}),J("hmmss",0,0,function(){return""+cn.apply(this)+Dt(this.minutes(),2)+Dt(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+Dt(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+Dt(this.minutes(),2)+Dt(this.seconds(),2)});function uo(r,e){J(r,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}uo("a",!0),uo("A",!1);function fo(r,e){return e._meridiemParse}z("a",fo),z("A",fo),z("H",Ce,rn),z("h",Ce,Cr),z("k",Ce,Cr),z("HH",Ce,tt),z("hh",Ce,tt),z("kk",Ce,tt),z("hmm",eo),z("hmmss",to),z("Hmm",eo),z("Hmmss",to),ye(["H","HH"],He),ye(["k","kk"],function(r,e,t){var s=ne(r);e[He]=s===24?0:s}),ye(["a","A"],function(r,e,t){t._isPm=t._locale.isPM(r),t._meridiem=r}),ye(["h","hh"],function(r,e,t){e[He]=ne(r),re(t).bigHour=!0}),ye("hmm",function(r,e,t){var s=r.length-2;e[He]=ne(r.substr(0,s)),e[gt]=ne(r.substr(s)),re(t).bigHour=!0}),ye("hmmss",function(r,e,t){var s=r.length-4,i=r.length-2;e[He]=ne(r.substr(0,s)),e[gt]=ne(r.substr(s,2)),e[$t]=ne(r.substr(i)),re(t).bigHour=!0}),ye("Hmm",function(r,e,t){var s=r.length-2;e[He]=ne(r.substr(0,s)),e[gt]=ne(r.substr(s))}),ye("Hmmss",function(r,e,t){var s=r.length-4,i=r.length-2;e[He]=ne(r.substr(0,s)),e[gt]=ne(r.substr(s,2)),e[$t]=ne(r.substr(i))});function zl(r){return(r+"").toLowerCase().charAt(0)==="p"}var Kl=/[ap]\.?m?\.?/i,Zl=_r("Hours",!0);function Xl(r,e,t){return r>11?t?"pm":"PM":t?"am":"AM"}var go={calendar:Mc,longDateFormat:Uc,invalidDate:Wc,ordinal:Vc,dayOfMonthOrdinalParse:zc,relativeTime:Zc,months:ul,monthsShort:io,week:_l,weekdays:kl,weekdaysMin:Bl,weekdaysShort:ho,meridiemParse:Kl},De={},Xr={},Jr;function Jl(r,e){var t,s=Math.min(r.length,e.length);for(t=0;t<s;t+=1)if(r[t]!==e[t])return t;return s}function xo(r){return r&&r.toLowerCase().replace("_","-")}function Ql(r){for(var e=0,t,s,i,n;e<r.length;){for(n=xo(r[e]).split("-"),t=n.length,s=xo(r[e+1]),s=s?s.split("-"):null;t>0;){if(i=Ss(n.slice(0,t).join("-")),i)return i;if(s&&s.length>=t&&Jl(n,s)>=t-1)break;t--}e++}return Jr}function ed(r){return!!(r&&r.match("^[^/\\\\]*$"))}function Ss(r){var e=null,t;if(De[r]===void 0&&typeof module<"u"&&module&&module.exports&&ed(r))try{e=Jr._abbr,t=require,t("./locale/"+r),Jt(e)}catch{De[r]=null}return De[r]}function Jt(r,e){var t;return r&&(Ze(e)?t=Nt(r):t=ln(r,e),t?Jr=t:typeof console<"u"&&console.warn&&console.warn("Locale "+r+" not found. Did you forget to load it?")),Jr._abbr}function ln(r,e){if(e!==null){var t,s=go;if(e.abbr=r,De[r]!=null)Ka("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=De[r]._config;else if(e.parentLocale!=null)if(De[e.parentLocale]!=null)s=De[e.parentLocale]._config;else if(t=Ss(e.parentLocale),t!=null)s=t._config;else return Xr[e.parentLocale]||(Xr[e.parentLocale]=[]),Xr[e.parentLocale].push({name:r,config:e}),null;return De[r]=new Ki(zi(s,e)),Xr[r]&&Xr[r].forEach(function(i){ln(i.name,i.config)}),Jt(r),De[r]}else return delete De[r],null}function td(r,e){if(e!=null){var t,s,i=go;De[r]!=null&&De[r].parentLocale!=null?De[r].set(zi(De[r]._config,e)):(s=Ss(r),s!=null&&(i=s._config),e=zi(i,e),s==null&&(e.abbr=r),t=new Ki(e),t.parentLocale=De[r],De[r]=t),Jt(r)}else De[r]!=null&&(De[r].parentLocale!=null?(De[r]=De[r].parentLocale,r===Jt()&&Jt(r)):De[r]!=null&&delete De[r]);return De[r]}function Nt(r){var e;if(r&&r._locale&&r._locale._abbr&&(r=r._locale._abbr),!r)return Jr;if(!ut(r)){if(e=Ss(r),e)return e;r=[r]}return Ql(r)}function rd(){return Zi(De)}function dn(r){var e,t=r._a;return t&&re(r).overflow===-2&&(e=t[Pt]<0||t[Pt]>11?Pt:t[At]<1||t[At]>nn(t[Le],t[Pt])?At:t[He]<0||t[He]>24||t[He]===24&&(t[gt]!==0||t[$t]!==0||t[hr]!==0)?He:t[gt]<0||t[gt]>59?gt:t[$t]<0||t[$t]>59?$t:t[hr]<0||t[hr]>999?hr:-1,re(r)._overflowDayOfYear&&(e<Le||e>At)&&(e=At),re(r)._overflowWeeks&&e===-1&&(e=al),re(r)._overflowWeekday&&e===-1&&(e=ol),re(r).overflow=e),r}var sd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,id=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,nd=/Z|[+-]\d\d(?::?\d\d)?/,Ts=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],hn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ad=/^\/?Date\((-?\d+)/i,od=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,cd={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function po(r){var e,t,s=r._i,i=sd.exec(s)||id.exec(s),n,a,o,d,c=Ts.length,l=hn.length;if(i){for(re(r).iso=!0,e=0,t=c;e<t;e++)if(Ts[e][1].exec(i[1])){a=Ts[e][0],n=Ts[e][2]!==!1;break}if(a==null){r._isValid=!1;return}if(i[3]){for(e=0,t=l;e<t;e++)if(hn[e][1].exec(i[3])){o=(i[2]||" ")+hn[e][0];break}if(o==null){r._isValid=!1;return}}if(!n&&o!=null){r._isValid=!1;return}if(i[4])if(nd.exec(i[4]))d="Z";else{r._isValid=!1;return}r._f=a+(o||"")+(d||""),fn(r)}else r._isValid=!1}function ld(r,e,t,s,i,n){var a=[dd(r),io.indexOf(e),parseInt(t,10),parseInt(s,10),parseInt(i,10)];return n&&a.push(parseInt(n,10)),a}function dd(r){var e=parseInt(r,10);return e<=49?2e3+e:e<=999?1900+e:e}function hd(r){return r.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ud(r,e,t){if(r){var s=ho.indexOf(r),i=new Date(e[0],e[1],e[2]).getDay();if(s!==i)return re(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function fd(r,e,t){if(r)return cd[r];if(e)return 0;var s=parseInt(t,10),i=s%100,n=(s-i)/100;return n*60+i}function mo(r){var e=od.exec(hd(r._i)),t;if(e){if(t=ld(e[4],e[3],e[2],e[5],e[6],e[7]),!ud(e[1],t,r))return;r._a=t,r._tzm=fd(e[8],e[9],e[10]),r._d=Kr.apply(null,r._a),r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),re(r).rfc2822=!0}else r._isValid=!1}function gd(r){var e=ad.exec(r._i);if(e!==null){r._d=new Date(+e[1]);return}if(po(r),r._isValid===!1)delete r._isValid;else return;if(mo(r),r._isValid===!1)delete r._isValid;else return;r._strict?r._isValid=!1:Y.createFromInputFallback(r)}Y.createFromInputFallback=it("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(r){r._d=new Date(r._i+(r._useUTC?" UTC":""))});function Dr(r,e,t){return r??e??t}function xd(r){var e=new Date(Y.now());return r._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function un(r){var e,t,s=[],i,n,a;if(!r._d){for(i=xd(r),r._w&&r._a[At]==null&&r._a[Pt]==null&&pd(r),r._dayOfYear!=null&&(a=Dr(r._a[Le],i[Le]),(r._dayOfYear>Vr(a)||r._dayOfYear===0)&&(re(r)._overflowDayOfYear=!0),t=Kr(a,0,r._dayOfYear),r._a[Pt]=t.getUTCMonth(),r._a[At]=t.getUTCDate()),e=0;e<3&&r._a[e]==null;++e)r._a[e]=s[e]=i[e];for(;e<7;e++)r._a[e]=s[e]=r._a[e]==null?e===2?1:0:r._a[e];r._a[He]===24&&r._a[gt]===0&&r._a[$t]===0&&r._a[hr]===0&&(r._nextDay=!0,r._a[He]=0),r._d=(r._useUTC?Kr:bl).apply(null,s),n=r._useUTC?r._d.getUTCDay():r._d.getDay(),r._tzm!=null&&r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),r._nextDay&&(r._a[He]=24),r._w&&typeof r._w.d<"u"&&r._w.d!==n&&(re(r).weekdayMismatch=!0)}}function pd(r){var e,t,s,i,n,a,o,d,c;e=r._w,e.GG!=null||e.W!=null||e.E!=null?(n=1,a=4,t=Dr(e.GG,r._a[Le],Zr(_e(),1,4).year),s=Dr(e.W,1),i=Dr(e.E,1),(i<1||i>7)&&(d=!0)):(n=r._locale._week.dow,a=r._locale._week.doy,c=Zr(_e(),n,a),t=Dr(e.gg,r._a[Le],c.year),s=Dr(e.w,c.week),e.d!=null?(i=e.d,(i<0||i>6)&&(d=!0)):e.e!=null?(i=e.e+n,(e.e<0||e.e>6)&&(d=!0)):i=n),s<1||s>Ot(t,n,a)?re(r)._overflowWeeks=!0:d!=null?re(r)._overflowWeekday=!0:(o=lo(t,s,i,n,a),r._a[Le]=o.year,r._dayOfYear=o.dayOfYear)}Y.ISO_8601=function(){},Y.RFC_2822=function(){};function fn(r){if(r._f===Y.ISO_8601){po(r);return}if(r._f===Y.RFC_2822){mo(r);return}r._a=[],re(r).empty=!0;var e=""+r._i,t,s,i,n,a,o=e.length,d=0,c,l;for(i=Za(r._f,r._locale).match(Xi)||[],l=i.length,t=0;t<l;t++)n=i[t],s=(e.match(sl(n,r))||[])[0],s&&(a=e.substr(0,e.indexOf(s)),a.length>0&&re(r).unusedInput.push(a),e=e.slice(e.indexOf(s)+s.length),d+=s.length),Er[n]?(s?re(r).empty=!1:re(r).unusedTokens.push(n),nl(n,s,r)):r._strict&&!s&&re(r).unusedTokens.push(n);re(r).charsLeftOver=o-d,e.length>0&&re(r).unusedInput.push(e),r._a[He]<=12&&re(r).bigHour===!0&&r._a[He]>0&&(re(r).bigHour=void 0),re(r).parsedDateParts=r._a.slice(0),re(r).meridiem=r._meridiem,r._a[He]=md(r._locale,r._a[He],r._meridiem),c=re(r).era,c!==null&&(r._a[Le]=r._locale.erasConvertYear(c,r._a[Le])),un(r),dn(r)}function md(r,e,t){var s;return t==null?e:r.meridiemHour!=null?r.meridiemHour(e,t):(r.isPM!=null&&(s=r.isPM(t),s&&e<12&&(e+=12),!s&&e===12&&(e=0)),e)}function vd(r){var e,t,s,i,n,a,o=!1,d=r._f.length;if(d===0){re(r).invalidFormat=!0,r._d=new Date(NaN);return}for(i=0;i<d;i++)n=0,a=!1,e=Vi({},r),r._useUTC!=null&&(e._useUTC=r._useUTC),e._f=r._f[i],fn(e),Wi(e)&&(a=!0),n+=re(e).charsLeftOver,n+=re(e).unusedTokens.length*10,re(e).score=n,o?n<s&&(s=n,t=e):(s==null||n<s||a)&&(s=n,t=e,a&&(o=!0));Xt(r,t||e)}function yd(r){if(!r._d){var e=Qi(r._i),t=e.day===void 0?e.date:e.day;r._a=Wa([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),un(r)}}function wd(r){var e=new Yr(dn(vo(r)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function vo(r){var e=r._i,t=r._f;return r._locale=r._locale||Nt(r._l),e===null||t===void 0&&e===""?ps({nullInput:!0}):(typeof e=="string"&&(r._i=e=r._locale.preparse(e)),ft(e)?new Yr(dn(e)):(Ur(e)?r._d=e:ut(t)?vd(r):t?fn(r):Ed(r),Wi(r)||(r._d=null),r))}function Ed(r){var e=r._i;Ze(e)?r._d=new Date(Y.now()):Ur(e)?r._d=new Date(e.valueOf()):typeof e=="string"?gd(r):ut(e)?(r._a=Wa(e.slice(0),function(t){return parseInt(t,10)}),un(r)):dr(e)?yd(r):It(e)?r._d=new Date(e):Y.createFromInputFallback(r)}function yo(r,e,t,s,i){var n={};return(e===!0||e===!1)&&(s=e,e=void 0),(t===!0||t===!1)&&(s=t,t=void 0),(dr(r)&&Ui(r)||ut(r)&&r.length===0)&&(r=void 0),n._isAMomentObject=!0,n._useUTC=n._isUTC=i,n._l=t,n._i=r,n._f=e,n._strict=s,wd(n)}function _e(r,e,t,s){return yo(r,e,t,s,!1)}var bd=it("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var r=_e.apply(null,arguments);return this.isValid()&&r.isValid()?r<this?this:r:ps()}),Cd=it("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var r=_e.apply(null,arguments);return this.isValid()&&r.isValid()?r>this?this:r:ps()});function wo(r,e){var t,s;if(e.length===1&&ut(e[0])&&(e=e[0]),!e.length)return _e();for(t=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][r](t))&&(t=e[s]);return t}function _d(){var r=[].slice.call(arguments,0);return wo("isBefore",r)}function Dd(){var r=[].slice.call(arguments,0);return wo("isAfter",r)}var Ad=function(){return Date.now?Date.now():+new Date},Qr=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Sd(r){var e,t=!1,s,i=Qr.length;for(e in r)if(ge(r,e)&&!(Te.call(Qr,e)!==-1&&(r[e]==null||!isNaN(r[e]))))return!1;for(s=0;s<i;++s)if(r[Qr[s]]){if(t)return!1;parseFloat(r[Qr[s]])!==ne(r[Qr[s]])&&(t=!0)}return!0}function Td(){return this._isValid}function Rd(){return xt(NaN)}function Rs(r){var e=Qi(r),t=e.year||0,s=e.quarter||0,i=e.month||0,n=e.week||e.isoWeek||0,a=e.day||0,o=e.hour||0,d=e.minute||0,c=e.second||0,l=e.millisecond||0;this._isValid=Sd(e),this._milliseconds=+l+c*1e3+d*6e4+o*1e3*60*60,this._days=+a+n*7,this._months=+i+s*3+t*12,this._data={},this._locale=Nt(),this._bubble()}function Fs(r){return r instanceof Rs}function gn(r){return r<0?Math.round(-1*r)*-1:Math.round(r)}function Fd(r,e,t){var s=Math.min(r.length,e.length),i=Math.abs(r.length-e.length),n=0,a;for(a=0;a<s;a++)ne(r[a])!==ne(e[a])&&n++;return n+i}function Eo(r,e){J(r,0,0,function(){var t=this.utcOffset(),s="+";return t<0&&(t=-t,s="-"),s+Dt(~~(t/60),2)+e+Dt(~~t%60,2)})}Eo("Z",":"),Eo("ZZ",""),z("Z",Cs),z("ZZ",Cs),ye(["Z","ZZ"],function(r,e,t){t._useUTC=!0,t._tzm=xn(Cs,r)});var kd=/([\+\-]|\d\d)/gi;function xn(r,e){var t=(e||"").match(r),s,i,n;return t===null?null:(s=t[t.length-1]||[],i=(s+"").match(kd)||["-",0,0],n=+(i[1]*60)+ne(i[2]),n===0?0:i[0]==="+"?n:-n)}function pn(r,e){var t,s;return e._isUTC?(t=e.clone(),s=(ft(r)||Ur(r)?r.valueOf():_e(r).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+s),Y.updateOffset(t,!1),t):_e(r).local()}function mn(r){return-Math.round(r._d.getTimezoneOffset())}Y.updateOffset=function(){};function Bd(r,e,t){var s=this._offset||0,i;if(!this.isValid())return r!=null?this:NaN;if(r!=null){if(typeof r=="string"){if(r=xn(Cs,r),r===null)return this}else Math.abs(r)<16&&!t&&(r=r*60);return!this._isUTC&&e&&(i=mn(this)),this._offset=r,this._isUTC=!0,i!=null&&this.add(i,"m"),s!==r&&(!e||this._changeInProgress?Do(this,xt(r-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Y.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:mn(this)}function Id(r,e){return r!=null?(typeof r!="string"&&(r=-r),this.utcOffset(r,e),this):-this.utcOffset()}function Hd(r){return this.utcOffset(0,r)}function Pd(r){return this._isUTC&&(this.utcOffset(0,r),this._isUTC=!1,r&&this.subtract(mn(this),"m")),this}function $d(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var r=xn(tl,this._i);r!=null?this.utcOffset(r):this.utcOffset(0,!0)}return this}function Od(r){return this.isValid()?(r=r?_e(r).utcOffset():0,(this.utcOffset()-r)%60===0):!1}function Nd(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Md(){if(!Ze(this._isDSTShifted))return this._isDSTShifted;var r={},e;return Vi(r,this),r=vo(r),r._a?(e=r._isUTC?Ct(r._a):_e(r._a),this._isDSTShifted=this.isValid()&&Fd(r._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function jd(){return this.isValid()?!this._isUTC:!1}function qd(){return this.isValid()?this._isUTC:!1}function bo(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Ld=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ud=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function xt(r,e){var t=r,s=null,i,n,a;return Fs(r)?t={ms:r._milliseconds,d:r._days,M:r._months}:It(r)||!isNaN(+r)?(t={},e?t[e]=+r:t.milliseconds=+r):(s=Ld.exec(r))?(i=s[1]==="-"?-1:1,t={y:0,d:ne(s[At])*i,h:ne(s[He])*i,m:ne(s[gt])*i,s:ne(s[$t])*i,ms:ne(gn(s[hr]*1e3))*i}):(s=Ud.exec(r))?(i=s[1]==="-"?-1:1,t={y:ur(s[2],i),M:ur(s[3],i),w:ur(s[4],i),d:ur(s[5],i),h:ur(s[6],i),m:ur(s[7],i),s:ur(s[8],i)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(a=Yd(_e(t.from),_e(t.to)),t={},t.ms=a.milliseconds,t.M=a.months),n=new Rs(t),Fs(r)&&ge(r,"_locale")&&(n._locale=r._locale),Fs(r)&&ge(r,"_isValid")&&(n._isValid=r._isValid),n}xt.fn=Rs.prototype,xt.invalid=Rd;function ur(r,e){var t=r&&parseFloat(r.replace(",","."));return(isNaN(t)?0:t)*e}function Co(r,e){var t={};return t.months=e.month()-r.month()+(e.year()-r.year())*12,r.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+r.clone().add(t.months,"M"),t}function Yd(r,e){var t;return r.isValid()&&e.isValid()?(e=pn(e,r),r.isBefore(e)?t=Co(r,e):(t=Co(e,r),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function _o(r,e){return function(t,s){var i,n;return s!==null&&!isNaN(+s)&&(Ka(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=t,t=s,s=n),i=xt(t,s),Do(this,i,r),this}}function Do(r,e,t,s){var i=e._milliseconds,n=gn(e._days),a=gn(e._months);r.isValid()&&(s=s??!0,a&&ao(r,zr(r,"Month")+a*t),n&&so(r,"Date",zr(r,"Date")+n*t),i&&r._d.setTime(r._d.valueOf()+i*t),s&&Y.updateOffset(r,n||a))}var Wd=_o(1,"add"),Gd=_o(-1,"subtract");function Ao(r){return typeof r=="string"||r instanceof String}function Vd(r){return ft(r)||Ur(r)||Ao(r)||It(r)||Kd(r)||zd(r)||r===null||r===void 0}function zd(r){var e=dr(r)&&!Ui(r),t=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,n,a=s.length;for(i=0;i<a;i+=1)n=s[i],t=t||ge(r,n);return e&&t}function Kd(r){var e=ut(r),t=!1;return e&&(t=r.filter(function(s){return!It(s)&&Ao(r)}).length===0),e&&t}function Zd(r){var e=dr(r)&&!Ui(r),t=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,n;for(i=0;i<s.length;i+=1)n=s[i],t=t||ge(r,n);return e&&t}function Xd(r,e){var t=r.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function Jd(r,e){arguments.length===1&&(arguments[0]?Vd(arguments[0])?(r=arguments[0],e=void 0):Zd(arguments[0])&&(e=arguments[0],r=void 0):(r=void 0,e=void 0));var t=r||_e(),s=pn(t,this).startOf("day"),i=Y.calendarFormat(this,s)||"sameElse",n=e&&(_t(e[i])?e[i].call(this,t):e[i]);return this.format(n||this.localeData().calendar(i,this,_e(t)))}function Qd(){return new Yr(this)}function eh(r,e){var t=ft(r)?r:_e(r);return this.isValid()&&t.isValid()?(e=nt(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function th(r,e){var t=ft(r)?r:_e(r);return this.isValid()&&t.isValid()?(e=nt(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function rh(r,e,t,s){var i=ft(r)?r:_e(r),n=ft(e)?e:_e(e);return this.isValid()&&i.isValid()&&n.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(i,t):!this.isBefore(i,t))&&(s[1]===")"?this.isBefore(n,t):!this.isAfter(n,t))):!1}function sh(r,e){var t=ft(r)?r:_e(r),s;return this.isValid()&&t.isValid()?(e=nt(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(s=t.valueOf(),this.clone().startOf(e).valueOf()<=s&&s<=this.clone().endOf(e).valueOf())):!1}function ih(r,e){return this.isSame(r,e)||this.isAfter(r,e)}function nh(r,e){return this.isSame(r,e)||this.isBefore(r,e)}function ah(r,e,t){var s,i,n;if(!this.isValid())return NaN;if(s=pn(r,this),!s.isValid())return NaN;switch(i=(s.utcOffset()-this.utcOffset())*6e4,e=nt(e),e){case"year":n=ks(this,s)/12;break;case"month":n=ks(this,s);break;case"quarter":n=ks(this,s)/3;break;case"second":n=(this-s)/1e3;break;case"minute":n=(this-s)/6e4;break;case"hour":n=(this-s)/36e5;break;case"day":n=(this-s-i)/864e5;break;case"week":n=(this-s-i)/6048e5;break;default:n=this-s}return t?n:at(n)}function ks(r,e){if(r.date()<e.date())return-ks(e,r);var t=(e.year()-r.year())*12+(e.month()-r.month()),s=r.clone().add(t,"months"),i,n;return e-s<0?(i=r.clone().add(t-1,"months"),n=(e-s)/(s-i)):(i=r.clone().add(t+1,"months"),n=(e-s)/(i-s)),-(t+n)||0}Y.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",Y.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function oh(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ch(r){if(!this.isValid())return null;var e=r!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?vs(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):_t(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",vs(t,"Z")):vs(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function lh(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var r="moment",e="",t,s,i,n;return this.isLocal()||(r=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+r+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",n=e+'[")]',this.format(t+s+i+n)}function dh(r){r||(r=this.isUtc()?Y.defaultFormatUtc:Y.defaultFormat);var e=vs(this,r);return this.localeData().postformat(e)}function hh(r,e){return this.isValid()&&(ft(r)&&r.isValid()||_e(r).isValid())?xt({to:this,from:r}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function uh(r){return this.from(_e(),r)}function fh(r,e){return this.isValid()&&(ft(r)&&r.isValid()||_e(r).isValid())?xt({from:this,to:r}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function gh(r){return this.to(_e(),r)}function So(r){var e;return r===void 0?this._locale._abbr:(e=Nt(r),e!=null&&(this._locale=e),this)}var To=it("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(r){return r===void 0?this.localeData():this.locale(r)});function Ro(){return this._locale}var Bs=1e3,Ar=60*Bs,Is=60*Ar,Fo=(365*400+97)*24*Is;function Sr(r,e){return(r%e+e)%e}function ko(r,e,t){return r<100&&r>=0?new Date(r+400,e,t)-Fo:new Date(r,e,t).valueOf()}function Bo(r,e,t){return r<100&&r>=0?Date.UTC(r+400,e,t)-Fo:Date.UTC(r,e,t)}function xh(r){var e,t;if(r=nt(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?Bo:ko,r){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Sr(e+(this._isUTC?0:this.utcOffset()*Ar),Is);break;case"minute":e=this._d.valueOf(),e-=Sr(e,Ar);break;case"second":e=this._d.valueOf(),e-=Sr(e,Bs);break}return this._d.setTime(e),Y.updateOffset(this,!0),this}function ph(r){var e,t;if(r=nt(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?Bo:ko,r){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Is-Sr(e+(this._isUTC?0:this.utcOffset()*Ar),Is)-1;break;case"minute":e=this._d.valueOf(),e+=Ar-Sr(e,Ar)-1;break;case"second":e=this._d.valueOf(),e+=Bs-Sr(e,Bs)-1;break}return this._d.setTime(e),Y.updateOffset(this,!0),this}function mh(){return this._d.valueOf()-(this._offset||0)*6e4}function vh(){return Math.floor(this.valueOf()/1e3)}function yh(){return new Date(this.valueOf())}function wh(){var r=this;return[r.year(),r.month(),r.date(),r.hour(),r.minute(),r.second(),r.millisecond()]}function Eh(){var r=this;return{years:r.year(),months:r.month(),date:r.date(),hours:r.hours(),minutes:r.minutes(),seconds:r.seconds(),milliseconds:r.milliseconds()}}function bh(){return this.isValid()?this.toISOString():null}function Ch(){return Wi(this)}function _h(){return Xt({},re(this))}function Dh(){return re(this).overflow}function Ah(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}J("N",0,0,"eraAbbr"),J("NN",0,0,"eraAbbr"),J("NNN",0,0,"eraAbbr"),J("NNNN",0,0,"eraName"),J("NNNNN",0,0,"eraNarrow"),J("y",["y",1],"yo","eraYear"),J("y",["yy",2],0,"eraYear"),J("y",["yyy",3],0,"eraYear"),J("y",["yyyy",4],0,"eraYear"),z("N",vn),z("NN",vn),z("NNN",vn),z("NNNN",Oh),z("NNNNN",Nh),ye(["N","NN","NNN","NNNN","NNNNN"],function(r,e,t,s){var i=t._locale.erasParse(r,s,t._strict);i?re(t).era=i:re(t).invalidEra=r}),z("y",br),z("yy",br),z("yyy",br),z("yyyy",br),z("yo",Mh),ye(["y","yy","yyy","yyyy"],Le),ye(["yo"],function(r,e,t,s){var i;t._locale._eraYearOrdinalRegex&&(i=r.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[Le]=t._locale.eraYearOrdinalParse(r,i):e[Le]=parseInt(r,10)});function Sh(r,e){var t,s,i,n=this._eras||Nt("en")._eras;for(t=0,s=n.length;t<s;++t){switch(typeof n[t].since){case"string":i=Y(n[t].since).startOf("day"),n[t].since=i.valueOf();break}switch(typeof n[t].until){case"undefined":n[t].until=1/0;break;case"string":i=Y(n[t].until).startOf("day").valueOf(),n[t].until=i.valueOf();break}}return n}function Th(r,e,t){var s,i,n=this.eras(),a,o,d;for(r=r.toUpperCase(),s=0,i=n.length;s<i;++s)if(a=n[s].name.toUpperCase(),o=n[s].abbr.toUpperCase(),d=n[s].narrow.toUpperCase(),t)switch(e){case"N":case"NN":case"NNN":if(o===r)return n[s];break;case"NNNN":if(a===r)return n[s];break;case"NNNNN":if(d===r)return n[s];break}else if([a,o,d].indexOf(r)>=0)return n[s]}function Rh(r,e){var t=r.since<=r.until?1:-1;return e===void 0?Y(r.since).year():Y(r.since).year()+(e-r.offset)*t}function Fh(){var r,e,t,s=this.localeData().eras();for(r=0,e=s.length;r<e;++r)if(t=this.clone().startOf("day").valueOf(),s[r].since<=t&&t<=s[r].until||s[r].until<=t&&t<=s[r].since)return s[r].name;return""}function kh(){var r,e,t,s=this.localeData().eras();for(r=0,e=s.length;r<e;++r)if(t=this.clone().startOf("day").valueOf(),s[r].since<=t&&t<=s[r].until||s[r].until<=t&&t<=s[r].since)return s[r].narrow;return""}function Bh(){var r,e,t,s=this.localeData().eras();for(r=0,e=s.length;r<e;++r)if(t=this.clone().startOf("day").valueOf(),s[r].since<=t&&t<=s[r].until||s[r].until<=t&&t<=s[r].since)return s[r].abbr;return""}function Ih(){var r,e,t,s,i=this.localeData().eras();for(r=0,e=i.length;r<e;++r)if(t=i[r].since<=i[r].until?1:-1,s=this.clone().startOf("day").valueOf(),i[r].since<=s&&s<=i[r].until||i[r].until<=s&&s<=i[r].since)return(this.year()-Y(i[r].since).year())*t+i[r].offset;return this.year()}function Hh(r){return ge(this,"_erasNameRegex")||yn.call(this),r?this._erasNameRegex:this._erasRegex}function Ph(r){return ge(this,"_erasAbbrRegex")||yn.call(this),r?this._erasAbbrRegex:this._erasRegex}function $h(r){return ge(this,"_erasNarrowRegex")||yn.call(this),r?this._erasNarrowRegex:this._erasRegex}function vn(r,e){return e.erasAbbrRegex(r)}function Oh(r,e){return e.erasNameRegex(r)}function Nh(r,e){return e.erasNarrowRegex(r)}function Mh(r,e){return e._eraYearOrdinalRegex||br}function yn(){var r=[],e=[],t=[],s=[],i,n,a,o,d,c=this.eras();for(i=0,n=c.length;i<n;++i)a=Ht(c[i].name),o=Ht(c[i].abbr),d=Ht(c[i].narrow),e.push(a),r.push(o),t.push(d),s.push(a),s.push(o),s.push(d);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}J(0,["gg",2],0,function(){return this.weekYear()%100}),J(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Hs(r,e){J(0,[r,r.length],0,e)}Hs("gggg","weekYear"),Hs("ggggg","weekYear"),Hs("GGGG","isoWeekYear"),Hs("GGGGG","isoWeekYear"),z("G",bs),z("g",bs),z("GG",Ce,tt),z("gg",Ce,tt),z("GGGG",tn,en),z("gggg",tn,en),z("GGGGG",Es,ys),z("ggggg",Es,ys),Gr(["gggg","ggggg","GGGG","GGGGG"],function(r,e,t,s){e[s.substr(0,2)]=ne(r)}),Gr(["gg","GG"],function(r,e,t,s){e[s]=Y.parseTwoDigitYear(r)});function jh(r){return Io.call(this,r,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function qh(r){return Io.call(this,r,this.isoWeek(),this.isoWeekday(),1,4)}function Lh(){return Ot(this.year(),1,4)}function Uh(){return Ot(this.isoWeekYear(),1,4)}function Yh(){var r=this.localeData()._week;return Ot(this.year(),r.dow,r.doy)}function Wh(){var r=this.localeData()._week;return Ot(this.weekYear(),r.dow,r.doy)}function Io(r,e,t,s,i){var n;return r==null?Zr(this,s,i).year:(n=Ot(r,s,i),e>n&&(e=n),Gh.call(this,r,e,t,s,i))}function Gh(r,e,t,s,i){var n=lo(r,e,t,s,i),a=Kr(n.year,0,n.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}J("Q",0,"Qo","quarter"),z("Q",Ja),ye("Q",function(r,e){e[Pt]=(ne(r)-1)*3});function Vh(r){return r==null?Math.ceil((this.month()+1)/3):this.month((r-1)*3+this.month()%3)}J("D",["DD",2],"Do","date"),z("D",Ce,Cr),z("DD",Ce,tt),z("Do",function(r,e){return r?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),ye(["D","DD"],At),ye("Do",function(r,e){e[At]=ne(r.match(Ce)[0])});var Ho=_r("Date",!0);J("DDD",["DDDD",3],"DDDo","dayOfYear"),z("DDD",ws),z("DDDD",Qa),ye(["DDD","DDDD"],function(r,e,t){t._dayOfYear=ne(r)});function zh(r){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return r==null?e:this.add(r-e,"d")}J("m",["mm",2],0,"minute"),z("m",Ce,rn),z("mm",Ce,tt),ye(["m","mm"],gt);var Kh=_r("Minutes",!1);J("s",["ss",2],0,"second"),z("s",Ce,rn),z("ss",Ce,tt),ye(["s","ss"],$t);var Zh=_r("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return this.millisecond()*10}),J(0,["SSSSS",5],0,function(){return this.millisecond()*100}),J(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),J(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),J(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),J(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),z("S",ws,Ja),z("SS",ws,tt),z("SSS",ws,Qa);var Qt,Po;for(Qt="SSSS";Qt.length<=9;Qt+="S")z(Qt,br);function Xh(r,e){e[hr]=ne(("0."+r)*1e3)}for(Qt="S";Qt.length<=9;Qt+="S")ye(Qt,Xh);Po=_r("Milliseconds",!1),J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");function Jh(){return this._isUTC?"UTC":""}function Qh(){return this._isUTC?"Coordinated Universal Time":""}var M=Yr.prototype;M.add=Wd,M.calendar=Jd,M.clone=Qd,M.diff=ah,M.endOf=ph,M.format=dh,M.from=hh,M.fromNow=uh,M.to=fh,M.toNow=gh,M.get=ll,M.invalidAt=Dh,M.isAfter=eh,M.isBefore=th,M.isBetween=rh,M.isSame=sh,M.isSameOrAfter=ih,M.isSameOrBefore=nh,M.isValid=Ch,M.lang=To,M.locale=So,M.localeData=Ro,M.max=Cd,M.min=bd,M.parsingFlags=_h,M.set=dl,M.startOf=xh,M.subtract=Gd,M.toArray=wh,M.toObject=Eh,M.toDate=yh,M.toISOString=ch,M.inspect=lh,typeof Symbol<"u"&&Symbol.for!=null&&(M[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),M.toJSON=bh,M.toString=oh,M.unix=vh,M.valueOf=mh,M.creationData=Ah,M.eraName=Fh,M.eraNarrow=kh,M.eraAbbr=Bh,M.eraYear=Ih,M.year=ro,M.isLeapYear=cl,M.weekYear=jh,M.isoWeekYear=qh,M.quarter=M.quarters=Vh,M.month=oo,M.daysInMonth=yl,M.week=M.weeks=Sl,M.isoWeek=M.isoWeeks=Tl,M.weeksInYear=Yh,M.weeksInWeekYear=Wh,M.isoWeeksInYear=Lh,M.isoWeeksInISOWeekYear=Uh,M.date=Ho,M.day=M.days=ql,M.weekday=Ll,M.isoWeekday=Ul,M.dayOfYear=zh,M.hour=M.hours=Zl,M.minute=M.minutes=Kh,M.second=M.seconds=Zh,M.millisecond=M.milliseconds=Po,M.utcOffset=Bd,M.utc=Hd,M.local=Pd,M.parseZone=$d,M.hasAlignedHourOffset=Od,M.isDST=Nd,M.isLocal=jd,M.isUtcOffset=qd,M.isUtc=bo,M.isUTC=bo,M.zoneAbbr=Jh,M.zoneName=Qh,M.dates=it("dates accessor is deprecated. Use date instead.",Ho),M.months=it("months accessor is deprecated. Use month instead",oo),M.years=it("years accessor is deprecated. Use year instead",ro),M.zone=it("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Id),M.isDSTShifted=it("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Md);function eu(r){return _e(r*1e3)}function tu(){return _e.apply(null,arguments).parseZone()}function $o(r){return r}var xe=Ki.prototype;xe.calendar=jc,xe.longDateFormat=Yc,xe.invalidDate=Gc,xe.ordinal=Kc,xe.preparse=$o,xe.postformat=$o,xe.relativeTime=Xc,xe.pastFuture=Jc,xe.set=Nc,xe.eras=Sh,xe.erasParse=Th,xe.erasConvertYear=Rh,xe.erasAbbrRegex=Ph,xe.erasNameRegex=Hh,xe.erasNarrowRegex=$h,xe.months=xl,xe.monthsShort=pl,xe.monthsParse=vl,xe.monthsRegex=El,xe.monthsShortRegex=wl,xe.week=Cl,xe.firstDayOfYear=Al,xe.firstDayOfWeek=Dl,xe.weekdays=$l,xe.weekdaysMin=Nl,xe.weekdaysShort=Ol,xe.weekdaysParse=jl,xe.weekdaysRegex=Yl,xe.weekdaysShortRegex=Wl,xe.weekdaysMinRegex=Gl,xe.isPM=zl,xe.meridiem=Xl;function Ps(r,e,t,s){var i=Nt(),n=Ct().set(s,e);return i[t](n,r)}function Oo(r,e,t){if(It(r)&&(e=r,r=void 0),r=r||"",e!=null)return Ps(r,e,t,"month");var s,i=[];for(s=0;s<12;s++)i[s]=Ps(r,s,t,"month");return i}function wn(r,e,t,s){typeof r=="boolean"?(It(e)&&(t=e,e=void 0),e=e||""):(e=r,t=e,r=!1,It(e)&&(t=e,e=void 0),e=e||"");var i=Nt(),n=r?i._week.dow:0,a,o=[];if(t!=null)return Ps(e,(t+n)%7,s,"day");for(a=0;a<7;a++)o[a]=Ps(e,(a+n)%7,s,"day");return o}function ru(r,e){return Oo(r,e,"months")}function su(r,e){return Oo(r,e,"monthsShort")}function iu(r,e,t){return wn(r,e,t,"weekdays")}function nu(r,e,t){return wn(r,e,t,"weekdaysShort")}function au(r,e,t){return wn(r,e,t,"weekdaysMin")}Jt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(r){var e=r%10,t=ne(r%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return r+t}}),Y.lang=it("moment.lang is deprecated. Use moment.locale instead.",Jt),Y.langData=it("moment.langData is deprecated. Use moment.localeData instead.",Nt);var Mt=Math.abs;function ou(){var r=this._data;return this._milliseconds=Mt(this._milliseconds),this._days=Mt(this._days),this._months=Mt(this._months),r.milliseconds=Mt(r.milliseconds),r.seconds=Mt(r.seconds),r.minutes=Mt(r.minutes),r.hours=Mt(r.hours),r.months=Mt(r.months),r.years=Mt(r.years),this}function No(r,e,t,s){var i=xt(e,t);return r._milliseconds+=s*i._milliseconds,r._days+=s*i._days,r._months+=s*i._months,r._bubble()}function cu(r,e){return No(this,r,e,1)}function lu(r,e){return No(this,r,e,-1)}function Mo(r){return r<0?Math.floor(r):Math.ceil(r)}function du(){var r=this._milliseconds,e=this._days,t=this._months,s=this._data,i,n,a,o,d;return r>=0&&e>=0&&t>=0||r<=0&&e<=0&&t<=0||(r+=Mo(En(t)+e)*864e5,e=0,t=0),s.milliseconds=r%1e3,i=at(r/1e3),s.seconds=i%60,n=at(i/60),s.minutes=n%60,a=at(n/60),s.hours=a%24,e+=at(a/24),d=at(jo(e)),t+=d,e-=Mo(En(d)),o=at(t/12),t%=12,s.days=e,s.months=t,s.years=o,this}function jo(r){return r*4800/146097}function En(r){return r*146097/4800}function hu(r){if(!this.isValid())return NaN;var e,t,s=this._milliseconds;if(r=nt(r),r==="month"||r==="quarter"||r==="year")switch(e=this._days+s/864e5,t=this._months+jo(e),r){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(En(this._months)),r){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return e*24+s/36e5;case"minute":return e*1440+s/6e4;case"second":return e*86400+s/1e3;case"millisecond":return Math.floor(e*864e5)+s;default:throw new Error("Unknown unit "+r)}}function jt(r){return function(){return this.as(r)}}var qo=jt("ms"),uu=jt("s"),fu=jt("m"),gu=jt("h"),xu=jt("d"),pu=jt("w"),mu=jt("M"),vu=jt("Q"),yu=jt("y"),wu=qo;function Eu(){return xt(this)}function bu(r){return r=nt(r),this.isValid()?this[r+"s"]():NaN}function fr(r){return function(){return this.isValid()?this._data[r]:NaN}}var Cu=fr("milliseconds"),_u=fr("seconds"),Du=fr("minutes"),Au=fr("hours"),Su=fr("days"),Tu=fr("months"),Ru=fr("years");function Fu(){return at(this.days()/7)}var qt=Math.round,Tr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function ku(r,e,t,s,i){return i.relativeTime(e||1,!!t,r,s)}function Bu(r,e,t,s){var i=xt(r).abs(),n=qt(i.as("s")),a=qt(i.as("m")),o=qt(i.as("h")),d=qt(i.as("d")),c=qt(i.as("M")),l=qt(i.as("w")),g=qt(i.as("y")),u=n<=t.ss&&["s",n]||n<t.s&&["ss",n]||a<=1&&["m"]||a<t.m&&["mm",a]||o<=1&&["h"]||o<t.h&&["hh",o]||d<=1&&["d"]||d<t.d&&["dd",d];return t.w!=null&&(u=u||l<=1&&["w"]||l<t.w&&["ww",l]),u=u||c<=1&&["M"]||c<t.M&&["MM",c]||g<=1&&["y"]||["yy",g],u[2]=e,u[3]=+r>0,u[4]=s,ku.apply(null,u)}function Iu(r){return r===void 0?qt:typeof r=="function"?(qt=r,!0):!1}function Hu(r,e){return Tr[r]===void 0?!1:e===void 0?Tr[r]:(Tr[r]=e,r==="s"&&(Tr.ss=e-1),!0)}function Pu(r,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,s=Tr,i,n;return typeof r=="object"&&(e=r,r=!1),typeof r=="boolean"&&(t=r),typeof e=="object"&&(s=Object.assign({},Tr,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),i=this.localeData(),n=Bu(this,!t,s,i),t&&(n=i.pastFuture(+this,n)),i.postformat(n)}var bn=Math.abs;function Rr(r){return(r>0)-(r<0)||+r}function $s(){if(!this.isValid())return this.localeData().invalidDate();var r=bn(this._milliseconds)/1e3,e=bn(this._days),t=bn(this._months),s,i,n,a,o=this.asSeconds(),d,c,l,g;return o?(s=at(r/60),i=at(s/60),r%=60,s%=60,n=at(t/12),t%=12,a=r?r.toFixed(3).replace(/\.?0+$/,""):"",d=o<0?"-":"",c=Rr(this._months)!==Rr(o)?"-":"",l=Rr(this._days)!==Rr(o)?"-":"",g=Rr(this._milliseconds)!==Rr(o)?"-":"",d+"P"+(n?c+n+"Y":"")+(t?c+t+"M":"")+(e?l+e+"D":"")+(i||s||r?"T":"")+(i?g+i+"H":"")+(s?g+s+"M":"")+(r?g+a+"S":"")):"P0D"}var le=Rs.prototype;le.isValid=Td,le.abs=ou,le.add=cu,le.subtract=lu,le.as=hu,le.asMilliseconds=qo,le.asSeconds=uu,le.asMinutes=fu,le.asHours=gu,le.asDays=xu,le.asWeeks=pu,le.asMonths=mu,le.asQuarters=vu,le.asYears=yu,le.valueOf=wu,le._bubble=du,le.clone=Eu,le.get=bu,le.milliseconds=Cu,le.seconds=_u,le.minutes=Du,le.hours=Au,le.days=Su,le.weeks=Fu,le.months=Tu,le.years=Ru,le.humanize=Pu,le.toISOString=$s,le.toString=$s,le.toJSON=$s,le.locale=So,le.localeData=Ro,le.toIsoString=it("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$s),le.lang=To,J("X",0,0,"unix"),J("x",0,0,"valueOf"),z("x",bs),z("X",rl),ye("X",function(r,e,t){t._d=new Date(parseFloat(r)*1e3)}),ye("x",function(r,e,t){t._d=new Date(ne(r))});//! moment.js
220
- Y.version="2.30.1",$c(_e),Y.fn=M,Y.min=_d,Y.max=Dd,Y.now=Ad,Y.utc=Ct,Y.unix=eu,Y.months=ru,Y.isDate=Ur,Y.locale=Jt,Y.invalid=ps,Y.duration=xt,Y.isMoment=ft,Y.weekdays=iu,Y.parseZone=tu,Y.localeData=Nt,Y.isDuration=Fs,Y.monthsShort=su,Y.weekdaysMin=au,Y.defineLocale=ln,Y.updateLocale=td,Y.locales=rd,Y.weekdaysShort=nu,Y.normalizeUnits=nt,Y.relativeTimeRounding=Iu,Y.relativeTimeThreshold=Hu,Y.calendarFormat=Xd,Y.prototype=M,Y.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};let Os=null,Se=null,Lo=null,St=null;function $u(r,e){if(!r||!r.sessionDescriptionHandler)return;const t=r.sessionDescriptionHandler.peerConnection;t&&t.getSenders().forEach(s=>{s.track&&s.track.kind==="audio"&&(s.track.enabled=e)})}function Uo(r){St||(St=document.createElement("audio"),St.id="voxnix-remote-audio",St.autoplay=!0,document.body.appendChild(St));const e=new MediaStream;if(r.sessionDescriptionHandler&&r.sessionDescriptionHandler.peerConnection){r.sessionDescriptionHandler.peerConnection.getReceivers().forEach(s=>{s.track&&e.addTrack(s.track)});const t=r.sessionDescriptionHandler.peerConnection;if(!t._isSetRemoteDescPatched){const s=t.setRemoteDescription.bind(t);t.setRemoteDescription=function(i){if(i&&i.sdp&&i.type==="answer"){const a=(((t.localDescription||{}).sdp||"").match(/^m=/gm)||[]).length,o=(i.sdp.match(/^m=/gm)||[]).length;if(console.log("[RTC Patch] local offer m-lines:",a,"| remote answer m-lines:",o),a>0&&o>a){const d=i.sdp.split(/\r?\n/);let c=0,l=!1;const g=[];for(const y of d)y.startsWith("m=")&&(c++,l=c>a),l||g.push(y);let u=g.join(`\r
214
+ `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var La={};function Ya(r,e){Y.deprecationHandler!=null&&Y.deprecationHandler(r,e),La[r]||(Ua(e),La[r]=!0)}Y.suppressDeprecationWarnings=!1,Y.deprecationHandler=null;function _t(r){return typeof Function<"u"&&r instanceof Function||Object.prototype.toString.call(r)==="[object Function]"}function _c(r){var e,t;for(t in r)ge(r,t)&&(e=r[t],_t(e)?this[t]=e:this["_"+t]=e);this._config=r,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Vi(r,e){var t=Xt({},r),s;for(s in e)ge(e,s)&&(dr(r[s])&&dr(e[s])?(t[s]={},Xt(t[s],r[s]),Xt(t[s],e[s])):e[s]!=null?t[s]=e[s]:delete t[s]);for(s in r)ge(r,s)&&!ge(e,s)&&dr(r[s])&&(t[s]=Xt({},t[s]));return t}function zi(r){r!=null&&this.set(r)}var Ki;Object.keys?Ki=Object.keys:Ki=function(r){var e,t=[];for(e in r)ge(r,e)&&t.push(e);return t};var Dc={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Ac(r,e,t){var s=this._calendar[r]||this._calendar.sameElse;return _t(s)?s.call(e,t):s}function Dt(r,e,t){var s=""+Math.abs(r),i=e-s.length,n=r>=0;return(n?t?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+s}var Zi=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ms=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Xi={},Er={};function J(r,e,t,s){var i=s;typeof s=="string"&&(i=function(){return this[s]()}),r&&(Er[r]=i),e&&(Er[e[0]]=function(){return Dt(i.apply(this,arguments),e[1],e[2])}),t&&(Er[t]=function(){return this.localeData().ordinal(i.apply(this,arguments),r)})}function Sc(r){return r.match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"")}function Tc(r){var e=r.match(Zi),t,s;for(t=0,s=e.length;t<s;t++)Er[e[t]]?e[t]=Er[e[t]]:e[t]=Sc(e[t]);return function(i){var n="",a;for(a=0;a<s;a++)n+=_t(e[a])?e[a].call(i,r):e[a];return n}}function vs(r,e){return r.isValid()?(e=Wa(e,r.localeData()),Xi[e]=Xi[e]||Tc(e),Xi[e](r)):r.localeData().invalidDate()}function Wa(r,e){var t=5;function s(i){return e.longDateFormat(i)||i}for(ms.lastIndex=0;t>=0&&ms.test(r);)r=r.replace(ms,s),ms.lastIndex=0,t-=1;return r}var Rc={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Fc(r){var e=this._longDateFormat[r],t=this._longDateFormat[r.toUpperCase()];return e||!t?e:(this._longDateFormat[r]=t.match(Zi).map(function(s){return s==="MMMM"||s==="MM"||s==="DD"||s==="dddd"?s.slice(1):s}).join(""),this._longDateFormat[r])}var kc="Invalid date";function Bc(){return this._invalidDate}var Ic="%d",Hc=/\d{1,2}/;function Pc(r){return this._ordinal.replace("%d",r)}var $c={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Oc(r,e,t,s){var i=this._relativeTime[t];return _t(i)?i(r,e,t,s):i.replace(/%d/i,r)}function Nc(r,e){var t=this._relativeTime[r>0?"future":"past"];return _t(t)?t(e):t.replace(/%s/i,e)}var Ga={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function nt(r){return typeof r=="string"?Ga[r]||Ga[r.toLowerCase()]:void 0}function Ji(r){var e={},t,s;for(s in r)ge(r,s)&&(t=nt(s),t&&(e[t]=r[s]));return e}var Mc={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function qc(r){var e=[],t;for(t in r)ge(r,t)&&e.push({unit:t,priority:Mc[t]});return e.sort(function(s,i){return s.priority-i.priority}),e}var Va=/\d/,tt=/\d\d/,za=/\d{3}/,Qi=/\d{4}/,ys=/[+-]?\d{6}/,Ce=/\d\d?/,Ka=/\d\d\d\d?/,Za=/\d\d\d\d\d\d?/,ws=/\d{1,3}/,en=/\d{1,4}/,Es=/[+-]?\d{1,6}/,br=/\d+/,bs=/[+-]?\d+/,jc=/Z|[+-]\d\d:?\d\d/gi,Cs=/Z|[+-]\d\d(?::?\d\d)?/gi,Uc=/[+-]?\d+(\.\d{1,3})?/,Wr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Cr=/^[1-9]\d?/,tn=/^([1-9]\d|\d)/,_s;_s={};function z(r,e,t){_s[r]=_t(e)?e:function(s,i){return s&&t?t:e}}function Lc(r,e){return ge(_s,r)?_s[r](e._strict,e._locale):new RegExp(Yc(r))}function Yc(r){return Ht(r.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,s,i,n){return t||s||i||n}))}function Ht(r){return r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function at(r){return r<0?Math.ceil(r)||0:Math.floor(r)}function ne(r){var e=+r,t=0;return e!==0&&isFinite(e)&&(t=at(e)),t}var rn={};function ye(r,e){var t,s=e,i;for(typeof r=="string"&&(r=[r]),It(e)&&(s=function(n,a){a[e]=ne(n)}),i=r.length,t=0;t<i;t++)rn[r[t]]=s}function Gr(r,e){ye(r,function(t,s,i,n){i._w=i._w||{},e(t,i._w,i,n)})}function Wc(r,e,t){e!=null&&ge(rn,r)&&rn[r](e,t._a,t,r)}function Ds(r){return r%4===0&&r%100!==0||r%400===0}var Ue=0,Pt=1,At=2,He=3,gt=4,$t=5,hr=6,Gc=7,Vc=8;J("Y",0,0,function(){var r=this.year();return r<=9999?Dt(r,4):"+"+r}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),z("Y",bs),z("YY",Ce,tt),z("YYYY",en,Qi),z("YYYYY",Es,ys),z("YYYYYY",Es,ys),ye(["YYYYY","YYYYYY"],Ue),ye("YYYY",function(r,e){e[Ue]=r.length===2?Y.parseTwoDigitYear(r):ne(r)}),ye("YY",function(r,e){e[Ue]=Y.parseTwoDigitYear(r)}),ye("Y",function(r,e){e[Ue]=parseInt(r,10)});function Vr(r){return Ds(r)?366:365}Y.parseTwoDigitYear=function(r){return ne(r)+(ne(r)>68?1900:2e3)};var Xa=_r("FullYear",!0);function zc(){return Ds(this.year())}function _r(r,e){return function(t){return t!=null?(Ja(this,r,t),Y.updateOffset(this,e),this):zr(this,r)}}function zr(r,e){if(!r.isValid())return NaN;var t=r._d,s=r._isUTC;switch(e){case"Milliseconds":return s?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return s?t.getUTCSeconds():t.getSeconds();case"Minutes":return s?t.getUTCMinutes():t.getMinutes();case"Hours":return s?t.getUTCHours():t.getHours();case"Date":return s?t.getUTCDate():t.getDate();case"Day":return s?t.getUTCDay():t.getDay();case"Month":return s?t.getUTCMonth():t.getMonth();case"FullYear":return s?t.getUTCFullYear():t.getFullYear();default:return NaN}}function Ja(r,e,t){var s,i,n,a,o;if(!(!r.isValid()||isNaN(t))){switch(s=r._d,i=r._isUTC,e){case"Milliseconds":return void(i?s.setUTCMilliseconds(t):s.setMilliseconds(t));case"Seconds":return void(i?s.setUTCSeconds(t):s.setSeconds(t));case"Minutes":return void(i?s.setUTCMinutes(t):s.setMinutes(t));case"Hours":return void(i?s.setUTCHours(t):s.setHours(t));case"Date":return void(i?s.setUTCDate(t):s.setDate(t));case"FullYear":break;default:return}n=t,a=r.month(),o=r.date(),o=o===29&&a===1&&!Ds(n)?28:o,i?s.setUTCFullYear(n,a,o):s.setFullYear(n,a,o)}}function Kc(r){return r=nt(r),_t(this[r])?this[r]():this}function Zc(r,e){if(typeof r=="object"){r=Ji(r);var t=qc(r),s,i=t.length;for(s=0;s<i;s++)this[t[s].unit](r[t[s].unit])}else if(r=nt(r),_t(this[r]))return this[r](e);return this}function Xc(r,e){return(r%e+e)%e}var Te;Array.prototype.indexOf?Te=Array.prototype.indexOf:Te=function(r){var e;for(e=0;e<this.length;++e)if(this[e]===r)return e;return-1};function sn(r,e){if(isNaN(r)||isNaN(e))return NaN;var t=Xc(e,12);return r+=(e-t)/12,t===1?Ds(r)?29:28:31-t%7%2}J("M",["MM",2],"Mo",function(){return this.month()+1}),J("MMM",0,0,function(r){return this.localeData().monthsShort(this,r)}),J("MMMM",0,0,function(r){return this.localeData().months(this,r)}),z("M",Ce,Cr),z("MM",Ce,tt),z("MMM",function(r,e){return e.monthsShortRegex(r)}),z("MMMM",function(r,e){return e.monthsRegex(r)}),ye(["M","MM"],function(r,e){e[Pt]=ne(r)-1}),ye(["MMM","MMMM"],function(r,e,t,s){var i=t._locale.monthsParse(r,s,t._strict);i!=null?e[Pt]=i:te(t).invalidMonth=r});var Jc="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Qa="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),eo=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Qc=Wr,el=Wr;function tl(r,e){return r?ut(this._months)?this._months[r.month()]:this._months[(this._months.isFormat||eo).test(e)?"format":"standalone"][r.month()]:ut(this._months)?this._months:this._months.standalone}function rl(r,e){return r?ut(this._monthsShort)?this._monthsShort[r.month()]:this._monthsShort[eo.test(e)?"format":"standalone"][r.month()]:ut(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function sl(r,e,t){var s,i,n,a=r.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)n=Ct([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(n,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(n,"").toLocaleLowerCase();return t?e==="MMM"?(i=Te.call(this._shortMonthsParse,a),i!==-1?i:null):(i=Te.call(this._longMonthsParse,a),i!==-1?i:null):e==="MMM"?(i=Te.call(this._shortMonthsParse,a),i!==-1?i:(i=Te.call(this._longMonthsParse,a),i!==-1?i:null)):(i=Te.call(this._longMonthsParse,a),i!==-1?i:(i=Te.call(this._shortMonthsParse,a),i!==-1?i:null))}function il(r,e,t){var s,i,n;if(this._monthsParseExact)return sl.call(this,r,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=Ct([2e3,s]),t&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!t&&!this._monthsParse[s]&&(n="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(n.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[s].test(r))return s;if(t&&e==="MMM"&&this._shortMonthsParse[s].test(r))return s;if(!t&&this._monthsParse[s].test(r))return s}}function to(r,e){if(!r.isValid())return r;if(typeof e=="string"){if(/^\d+$/.test(e))e=ne(e);else if(e=r.localeData().monthsParse(e),!It(e))return r}var t=e,s=r.date();return s=s<29?s:Math.min(s,sn(r.year(),t)),r._isUTC?r._d.setUTCMonth(t,s):r._d.setMonth(t,s),r}function ro(r){return r!=null?(to(this,r),Y.updateOffset(this,!0),this):zr(this,"Month")}function nl(){return sn(this.year(),this.month())}function al(r){return this._monthsParseExact?(ge(this,"_monthsRegex")||so.call(this),r?this._monthsShortStrictRegex:this._monthsShortRegex):(ge(this,"_monthsShortRegex")||(this._monthsShortRegex=Qc),this._monthsShortStrictRegex&&r?this._monthsShortStrictRegex:this._monthsShortRegex)}function ol(r){return this._monthsParseExact?(ge(this,"_monthsRegex")||so.call(this),r?this._monthsStrictRegex:this._monthsRegex):(ge(this,"_monthsRegex")||(this._monthsRegex=el),this._monthsStrictRegex&&r?this._monthsStrictRegex:this._monthsRegex)}function so(){function r(d,c){return c.length-d.length}var e=[],t=[],s=[],i,n,a,o;for(i=0;i<12;i++)n=Ct([2e3,i]),a=Ht(this.monthsShort(n,"")),o=Ht(this.months(n,"")),e.push(a),t.push(o),s.push(o),s.push(a);e.sort(r),t.sort(r),s.sort(r),this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function cl(r,e,t,s,i,n,a){var o;return r<100&&r>=0?(o=new Date(r+400,e,t,s,i,n,a),isFinite(o.getFullYear())&&o.setFullYear(r)):o=new Date(r,e,t,s,i,n,a),o}function Kr(r){var e,t;return r<100&&r>=0?(t=Array.prototype.slice.call(arguments),t[0]=r+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(r)):e=new Date(Date.UTC.apply(null,arguments)),e}function As(r,e,t){var s=7+e-t,i=(7+Kr(r,0,s).getUTCDay()-e)%7;return-i+s-1}function io(r,e,t,s,i){var n=(7+t-s)%7,a=As(r,s,i),o=1+7*(e-1)+n+a,d,c;return o<=0?(d=r-1,c=Vr(d)+o):o>Vr(r)?(d=r+1,c=o-Vr(r)):(d=r,c=o),{year:d,dayOfYear:c}}function Zr(r,e,t){var s=As(r.year(),e,t),i=Math.floor((r.dayOfYear()-s-1)/7)+1,n,a;return i<1?(a=r.year()-1,n=i+Ot(a,e,t)):i>Ot(r.year(),e,t)?(n=i-Ot(r.year(),e,t),a=r.year()+1):(a=r.year(),n=i),{week:n,year:a}}function Ot(r,e,t){var s=As(r,e,t),i=As(r+1,e,t);return(Vr(r)-s+i)/7}J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),z("w",Ce,Cr),z("ww",Ce,tt),z("W",Ce,Cr),z("WW",Ce,tt),Gr(["w","ww","W","WW"],function(r,e,t,s){e[s.substr(0,1)]=ne(r)});function ll(r){return Zr(r,this._week.dow,this._week.doy).week}var dl={dow:0,doy:6};function hl(){return this._week.dow}function ul(){return this._week.doy}function fl(r){var e=this.localeData().week(this);return r==null?e:this.add((r-e)*7,"d")}function gl(r){var e=Zr(this,1,4).week;return r==null?e:this.add((r-e)*7,"d")}J("d",0,"do","day"),J("dd",0,0,function(r){return this.localeData().weekdaysMin(this,r)}),J("ddd",0,0,function(r){return this.localeData().weekdaysShort(this,r)}),J("dddd",0,0,function(r){return this.localeData().weekdays(this,r)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),z("d",Ce),z("e",Ce),z("E",Ce),z("dd",function(r,e){return e.weekdaysMinRegex(r)}),z("ddd",function(r,e){return e.weekdaysShortRegex(r)}),z("dddd",function(r,e){return e.weekdaysRegex(r)}),Gr(["dd","ddd","dddd"],function(r,e,t,s){var i=t._locale.weekdaysParse(r,s,t._strict);i!=null?e.d=i:te(t).invalidWeekday=r}),Gr(["d","e","E"],function(r,e,t,s){e[s]=ne(r)});function xl(r,e){return typeof r!="string"?r:isNaN(r)?(r=e.weekdaysParse(r),typeof r=="number"?r:null):parseInt(r,10)}function pl(r,e){return typeof r=="string"?e.weekdaysParse(r)%7||7:isNaN(r)?null:r}function nn(r,e){return r.slice(e,7).concat(r.slice(0,e))}var ml="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),no="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),vl="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),yl=Wr,wl=Wr,El=Wr;function bl(r,e){var t=ut(this._weekdays)?this._weekdays:this._weekdays[r&&r!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return r===!0?nn(t,this._week.dow):r?t[r.day()]:t}function Cl(r){return r===!0?nn(this._weekdaysShort,this._week.dow):r?this._weekdaysShort[r.day()]:this._weekdaysShort}function _l(r){return r===!0?nn(this._weekdaysMin,this._week.dow):r?this._weekdaysMin[r.day()]:this._weekdaysMin}function Dl(r,e,t){var s,i,n,a=r.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)n=Ct([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(n,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(n,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(n,"").toLocaleLowerCase();return t?e==="dddd"?(i=Te.call(this._weekdaysParse,a),i!==-1?i:null):e==="ddd"?(i=Te.call(this._shortWeekdaysParse,a),i!==-1?i:null):(i=Te.call(this._minWeekdaysParse,a),i!==-1?i:null):e==="dddd"?(i=Te.call(this._weekdaysParse,a),i!==-1||(i=Te.call(this._shortWeekdaysParse,a),i!==-1)?i:(i=Te.call(this._minWeekdaysParse,a),i!==-1?i:null)):e==="ddd"?(i=Te.call(this._shortWeekdaysParse,a),i!==-1||(i=Te.call(this._weekdaysParse,a),i!==-1)?i:(i=Te.call(this._minWeekdaysParse,a),i!==-1?i:null)):(i=Te.call(this._minWeekdaysParse,a),i!==-1||(i=Te.call(this._weekdaysParse,a),i!==-1)?i:(i=Te.call(this._shortWeekdaysParse,a),i!==-1?i:null))}function Al(r,e,t){var s,i,n;if(this._weekdaysParseExact)return Dl.call(this,r,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=Ct([2e3,1]).day(s),t&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(n="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(n.replace(".",""),"i")),t&&e==="dddd"&&this._fullWeekdaysParse[s].test(r))return s;if(t&&e==="ddd"&&this._shortWeekdaysParse[s].test(r))return s;if(t&&e==="dd"&&this._minWeekdaysParse[s].test(r))return s;if(!t&&this._weekdaysParse[s].test(r))return s}}function Sl(r){if(!this.isValid())return r!=null?this:NaN;var e=zr(this,"Day");return r!=null?(r=xl(r,this.localeData()),this.add(r-e,"d")):e}function Tl(r){if(!this.isValid())return r!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return r==null?e:this.add(r-e,"d")}function Rl(r){if(!this.isValid())return r!=null?this:NaN;if(r!=null){var e=pl(r,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function Fl(r){return this._weekdaysParseExact?(ge(this,"_weekdaysRegex")||an.call(this),r?this._weekdaysStrictRegex:this._weekdaysRegex):(ge(this,"_weekdaysRegex")||(this._weekdaysRegex=yl),this._weekdaysStrictRegex&&r?this._weekdaysStrictRegex:this._weekdaysRegex)}function kl(r){return this._weekdaysParseExact?(ge(this,"_weekdaysRegex")||an.call(this),r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ge(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=wl),this._weekdaysShortStrictRegex&&r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Bl(r){return this._weekdaysParseExact?(ge(this,"_weekdaysRegex")||an.call(this),r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ge(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=El),this._weekdaysMinStrictRegex&&r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function an(){function r(l,g){return g.length-l.length}var e=[],t=[],s=[],i=[],n,a,o,d,c;for(n=0;n<7;n++)a=Ct([2e3,1]).day(n),o=Ht(this.weekdaysMin(a,"")),d=Ht(this.weekdaysShort(a,"")),c=Ht(this.weekdays(a,"")),e.push(o),t.push(d),s.push(c),i.push(o),i.push(d),i.push(c);e.sort(r),t.sort(r),s.sort(r),i.sort(r),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function on(){return this.hours()%12||12}function Il(){return this.hours()||24}J("H",["HH",2],0,"hour"),J("h",["hh",2],0,on),J("k",["kk",2],0,Il),J("hmm",0,0,function(){return""+on.apply(this)+Dt(this.minutes(),2)}),J("hmmss",0,0,function(){return""+on.apply(this)+Dt(this.minutes(),2)+Dt(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+Dt(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+Dt(this.minutes(),2)+Dt(this.seconds(),2)});function ao(r,e){J(r,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}ao("a",!0),ao("A",!1);function oo(r,e){return e._meridiemParse}z("a",oo),z("A",oo),z("H",Ce,tn),z("h",Ce,Cr),z("k",Ce,Cr),z("HH",Ce,tt),z("hh",Ce,tt),z("kk",Ce,tt),z("hmm",Ka),z("hmmss",Za),z("Hmm",Ka),z("Hmmss",Za),ye(["H","HH"],He),ye(["k","kk"],function(r,e,t){var s=ne(r);e[He]=s===24?0:s}),ye(["a","A"],function(r,e,t){t._isPm=t._locale.isPM(r),t._meridiem=r}),ye(["h","hh"],function(r,e,t){e[He]=ne(r),te(t).bigHour=!0}),ye("hmm",function(r,e,t){var s=r.length-2;e[He]=ne(r.substr(0,s)),e[gt]=ne(r.substr(s)),te(t).bigHour=!0}),ye("hmmss",function(r,e,t){var s=r.length-4,i=r.length-2;e[He]=ne(r.substr(0,s)),e[gt]=ne(r.substr(s,2)),e[$t]=ne(r.substr(i)),te(t).bigHour=!0}),ye("Hmm",function(r,e,t){var s=r.length-2;e[He]=ne(r.substr(0,s)),e[gt]=ne(r.substr(s))}),ye("Hmmss",function(r,e,t){var s=r.length-4,i=r.length-2;e[He]=ne(r.substr(0,s)),e[gt]=ne(r.substr(s,2)),e[$t]=ne(r.substr(i))});function Hl(r){return(r+"").toLowerCase().charAt(0)==="p"}var Pl=/[ap]\.?m?\.?/i,$l=_r("Hours",!0);function Ol(r,e,t){return r>11?t?"pm":"PM":t?"am":"AM"}var co={calendar:Dc,longDateFormat:Rc,invalidDate:kc,ordinal:Ic,dayOfMonthOrdinalParse:Hc,relativeTime:$c,months:Jc,monthsShort:Qa,week:dl,weekdays:ml,weekdaysMin:vl,weekdaysShort:no,meridiemParse:Pl},De={},Xr={},Jr;function Nl(r,e){var t,s=Math.min(r.length,e.length);for(t=0;t<s;t+=1)if(r[t]!==e[t])return t;return s}function lo(r){return r&&r.toLowerCase().replace("_","-")}function Ml(r){for(var e=0,t,s,i,n;e<r.length;){for(n=lo(r[e]).split("-"),t=n.length,s=lo(r[e+1]),s=s?s.split("-"):null;t>0;){if(i=Ss(n.slice(0,t).join("-")),i)return i;if(s&&s.length>=t&&Nl(n,s)>=t-1)break;t--}e++}return Jr}function ql(r){return!!(r&&r.match("^[^/\\\\]*$"))}function Ss(r){var e=null,t;if(De[r]===void 0&&typeof module<"u"&&module&&module.exports&&ql(r))try{e=Jr._abbr,t=require,t("./locale/"+r),Jt(e)}catch{De[r]=null}return De[r]}function Jt(r,e){var t;return r&&(Ze(e)?t=Nt(r):t=cn(r,e),t?Jr=t:typeof console<"u"&&console.warn&&console.warn("Locale "+r+" not found. Did you forget to load it?")),Jr._abbr}function cn(r,e){if(e!==null){var t,s=co;if(e.abbr=r,De[r]!=null)Ya("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=De[r]._config;else if(e.parentLocale!=null)if(De[e.parentLocale]!=null)s=De[e.parentLocale]._config;else if(t=Ss(e.parentLocale),t!=null)s=t._config;else return Xr[e.parentLocale]||(Xr[e.parentLocale]=[]),Xr[e.parentLocale].push({name:r,config:e}),null;return De[r]=new zi(Vi(s,e)),Xr[r]&&Xr[r].forEach(function(i){cn(i.name,i.config)}),Jt(r),De[r]}else return delete De[r],null}function jl(r,e){if(e!=null){var t,s,i=co;De[r]!=null&&De[r].parentLocale!=null?De[r].set(Vi(De[r]._config,e)):(s=Ss(r),s!=null&&(i=s._config),e=Vi(i,e),s==null&&(e.abbr=r),t=new zi(e),t.parentLocale=De[r],De[r]=t),Jt(r)}else De[r]!=null&&(De[r].parentLocale!=null?(De[r]=De[r].parentLocale,r===Jt()&&Jt(r)):De[r]!=null&&delete De[r]);return De[r]}function Nt(r){var e;if(r&&r._locale&&r._locale._abbr&&(r=r._locale._abbr),!r)return Jr;if(!ut(r)){if(e=Ss(r),e)return e;r=[r]}return Ml(r)}function Ul(){return Ki(De)}function ln(r){var e,t=r._a;return t&&te(r).overflow===-2&&(e=t[Pt]<0||t[Pt]>11?Pt:t[At]<1||t[At]>sn(t[Ue],t[Pt])?At:t[He]<0||t[He]>24||t[He]===24&&(t[gt]!==0||t[$t]!==0||t[hr]!==0)?He:t[gt]<0||t[gt]>59?gt:t[$t]<0||t[$t]>59?$t:t[hr]<0||t[hr]>999?hr:-1,te(r)._overflowDayOfYear&&(e<Ue||e>At)&&(e=At),te(r)._overflowWeeks&&e===-1&&(e=Gc),te(r)._overflowWeekday&&e===-1&&(e=Vc),te(r).overflow=e),r}var Ll=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Yl=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wl=/Z|[+-]\d\d(?::?\d\d)?/,Ts=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],dn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Gl=/^\/?Date\((-?\d+)/i,Vl=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,zl={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ho(r){var e,t,s=r._i,i=Ll.exec(s)||Yl.exec(s),n,a,o,d,c=Ts.length,l=dn.length;if(i){for(te(r).iso=!0,e=0,t=c;e<t;e++)if(Ts[e][1].exec(i[1])){a=Ts[e][0],n=Ts[e][2]!==!1;break}if(a==null){r._isValid=!1;return}if(i[3]){for(e=0,t=l;e<t;e++)if(dn[e][1].exec(i[3])){o=(i[2]||" ")+dn[e][0];break}if(o==null){r._isValid=!1;return}}if(!n&&o!=null){r._isValid=!1;return}if(i[4])if(Wl.exec(i[4]))d="Z";else{r._isValid=!1;return}r._f=a+(o||"")+(d||""),un(r)}else r._isValid=!1}function Kl(r,e,t,s,i,n){var a=[Zl(r),Qa.indexOf(e),parseInt(t,10),parseInt(s,10),parseInt(i,10)];return n&&a.push(parseInt(n,10)),a}function Zl(r){var e=parseInt(r,10);return e<=49?2e3+e:e<=999?1900+e:e}function Xl(r){return r.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Jl(r,e,t){if(r){var s=no.indexOf(r),i=new Date(e[0],e[1],e[2]).getDay();if(s!==i)return te(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function Ql(r,e,t){if(r)return zl[r];if(e)return 0;var s=parseInt(t,10),i=s%100,n=(s-i)/100;return n*60+i}function uo(r){var e=Vl.exec(Xl(r._i)),t;if(e){if(t=Kl(e[4],e[3],e[2],e[5],e[6],e[7]),!Jl(e[1],t,r))return;r._a=t,r._tzm=Ql(e[8],e[9],e[10]),r._d=Kr.apply(null,r._a),r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),te(r).rfc2822=!0}else r._isValid=!1}function ed(r){var e=Gl.exec(r._i);if(e!==null){r._d=new Date(+e[1]);return}if(ho(r),r._isValid===!1)delete r._isValid;else return;if(uo(r),r._isValid===!1)delete r._isValid;else return;r._strict?r._isValid=!1:Y.createFromInputFallback(r)}Y.createFromInputFallback=it("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(r){r._d=new Date(r._i+(r._useUTC?" UTC":""))});function Dr(r,e,t){return r??e??t}function td(r){var e=new Date(Y.now());return r._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function hn(r){var e,t,s=[],i,n,a;if(!r._d){for(i=td(r),r._w&&r._a[At]==null&&r._a[Pt]==null&&rd(r),r._dayOfYear!=null&&(a=Dr(r._a[Ue],i[Ue]),(r._dayOfYear>Vr(a)||r._dayOfYear===0)&&(te(r)._overflowDayOfYear=!0),t=Kr(a,0,r._dayOfYear),r._a[Pt]=t.getUTCMonth(),r._a[At]=t.getUTCDate()),e=0;e<3&&r._a[e]==null;++e)r._a[e]=s[e]=i[e];for(;e<7;e++)r._a[e]=s[e]=r._a[e]==null?e===2?1:0:r._a[e];r._a[He]===24&&r._a[gt]===0&&r._a[$t]===0&&r._a[hr]===0&&(r._nextDay=!0,r._a[He]=0),r._d=(r._useUTC?Kr:cl).apply(null,s),n=r._useUTC?r._d.getUTCDay():r._d.getDay(),r._tzm!=null&&r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),r._nextDay&&(r._a[He]=24),r._w&&typeof r._w.d<"u"&&r._w.d!==n&&(te(r).weekdayMismatch=!0)}}function rd(r){var e,t,s,i,n,a,o,d,c;e=r._w,e.GG!=null||e.W!=null||e.E!=null?(n=1,a=4,t=Dr(e.GG,r._a[Ue],Zr(_e(),1,4).year),s=Dr(e.W,1),i=Dr(e.E,1),(i<1||i>7)&&(d=!0)):(n=r._locale._week.dow,a=r._locale._week.doy,c=Zr(_e(),n,a),t=Dr(e.gg,r._a[Ue],c.year),s=Dr(e.w,c.week),e.d!=null?(i=e.d,(i<0||i>6)&&(d=!0)):e.e!=null?(i=e.e+n,(e.e<0||e.e>6)&&(d=!0)):i=n),s<1||s>Ot(t,n,a)?te(r)._overflowWeeks=!0:d!=null?te(r)._overflowWeekday=!0:(o=io(t,s,i,n,a),r._a[Ue]=o.year,r._dayOfYear=o.dayOfYear)}Y.ISO_8601=function(){},Y.RFC_2822=function(){};function un(r){if(r._f===Y.ISO_8601){ho(r);return}if(r._f===Y.RFC_2822){uo(r);return}r._a=[],te(r).empty=!0;var e=""+r._i,t,s,i,n,a,o=e.length,d=0,c,l;for(i=Wa(r._f,r._locale).match(Zi)||[],l=i.length,t=0;t<l;t++)n=i[t],s=(e.match(Lc(n,r))||[])[0],s&&(a=e.substr(0,e.indexOf(s)),a.length>0&&te(r).unusedInput.push(a),e=e.slice(e.indexOf(s)+s.length),d+=s.length),Er[n]?(s?te(r).empty=!1:te(r).unusedTokens.push(n),Wc(n,s,r)):r._strict&&!s&&te(r).unusedTokens.push(n);te(r).charsLeftOver=o-d,e.length>0&&te(r).unusedInput.push(e),r._a[He]<=12&&te(r).bigHour===!0&&r._a[He]>0&&(te(r).bigHour=void 0),te(r).parsedDateParts=r._a.slice(0),te(r).meridiem=r._meridiem,r._a[He]=sd(r._locale,r._a[He],r._meridiem),c=te(r).era,c!==null&&(r._a[Ue]=r._locale.erasConvertYear(c,r._a[Ue])),hn(r),ln(r)}function sd(r,e,t){var s;return t==null?e:r.meridiemHour!=null?r.meridiemHour(e,t):(r.isPM!=null&&(s=r.isPM(t),s&&e<12&&(e+=12),!s&&e===12&&(e=0)),e)}function id(r){var e,t,s,i,n,a,o=!1,d=r._f.length;if(d===0){te(r).invalidFormat=!0,r._d=new Date(NaN);return}for(i=0;i<d;i++)n=0,a=!1,e=Gi({},r),r._useUTC!=null&&(e._useUTC=r._useUTC),e._f=r._f[i],un(e),Yi(e)&&(a=!0),n+=te(e).charsLeftOver,n+=te(e).unusedTokens.length*10,te(e).score=n,o?n<s&&(s=n,t=e):(s==null||n<s||a)&&(s=n,t=e,a&&(o=!0));Xt(r,t||e)}function nd(r){if(!r._d){var e=Ji(r._i),t=e.day===void 0?e.date:e.day;r._a=qa([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(s){return s&&parseInt(s,10)}),hn(r)}}function ad(r){var e=new Yr(ln(fo(r)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function fo(r){var e=r._i,t=r._f;return r._locale=r._locale||Nt(r._l),e===null||t===void 0&&e===""?ps({nullInput:!0}):(typeof e=="string"&&(r._i=e=r._locale.preparse(e)),ft(e)?new Yr(ln(e)):(Lr(e)?r._d=e:ut(t)?id(r):t?un(r):od(r),Yi(r)||(r._d=null),r))}function od(r){var e=r._i;Ze(e)?r._d=new Date(Y.now()):Lr(e)?r._d=new Date(e.valueOf()):typeof e=="string"?ed(r):ut(e)?(r._a=qa(e.slice(0),function(t){return parseInt(t,10)}),hn(r)):dr(e)?nd(r):It(e)?r._d=new Date(e):Y.createFromInputFallback(r)}function go(r,e,t,s,i){var n={};return(e===!0||e===!1)&&(s=e,e=void 0),(t===!0||t===!1)&&(s=t,t=void 0),(dr(r)&&Ui(r)||ut(r)&&r.length===0)&&(r=void 0),n._isAMomentObject=!0,n._useUTC=n._isUTC=i,n._l=t,n._i=r,n._f=e,n._strict=s,ad(n)}function _e(r,e,t,s){return go(r,e,t,s,!1)}var cd=it("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var r=_e.apply(null,arguments);return this.isValid()&&r.isValid()?r<this?this:r:ps()}),ld=it("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var r=_e.apply(null,arguments);return this.isValid()&&r.isValid()?r>this?this:r:ps()});function xo(r,e){var t,s;if(e.length===1&&ut(e[0])&&(e=e[0]),!e.length)return _e();for(t=e[0],s=1;s<e.length;++s)(!e[s].isValid()||e[s][r](t))&&(t=e[s]);return t}function dd(){var r=[].slice.call(arguments,0);return xo("isBefore",r)}function hd(){var r=[].slice.call(arguments,0);return xo("isAfter",r)}var ud=function(){return Date.now?Date.now():+new Date},Qr=["year","quarter","month","week","day","hour","minute","second","millisecond"];function fd(r){var e,t=!1,s,i=Qr.length;for(e in r)if(ge(r,e)&&!(Te.call(Qr,e)!==-1&&(r[e]==null||!isNaN(r[e]))))return!1;for(s=0;s<i;++s)if(r[Qr[s]]){if(t)return!1;parseFloat(r[Qr[s]])!==ne(r[Qr[s]])&&(t=!0)}return!0}function gd(){return this._isValid}function xd(){return xt(NaN)}function Rs(r){var e=Ji(r),t=e.year||0,s=e.quarter||0,i=e.month||0,n=e.week||e.isoWeek||0,a=e.day||0,o=e.hour||0,d=e.minute||0,c=e.second||0,l=e.millisecond||0;this._isValid=fd(e),this._milliseconds=+l+c*1e3+d*6e4+o*1e3*60*60,this._days=+a+n*7,this._months=+i+s*3+t*12,this._data={},this._locale=Nt(),this._bubble()}function Fs(r){return r instanceof Rs}function fn(r){return r<0?Math.round(-1*r)*-1:Math.round(r)}function pd(r,e,t){var s=Math.min(r.length,e.length),i=Math.abs(r.length-e.length),n=0,a;for(a=0;a<s;a++)ne(r[a])!==ne(e[a])&&n++;return n+i}function po(r,e){J(r,0,0,function(){var t=this.utcOffset(),s="+";return t<0&&(t=-t,s="-"),s+Dt(~~(t/60),2)+e+Dt(~~t%60,2)})}po("Z",":"),po("ZZ",""),z("Z",Cs),z("ZZ",Cs),ye(["Z","ZZ"],function(r,e,t){t._useUTC=!0,t._tzm=gn(Cs,r)});var md=/([\+\-]|\d\d)/gi;function gn(r,e){var t=(e||"").match(r),s,i,n;return t===null?null:(s=t[t.length-1]||[],i=(s+"").match(md)||["-",0,0],n=+(i[1]*60)+ne(i[2]),n===0?0:i[0]==="+"?n:-n)}function xn(r,e){var t,s;return e._isUTC?(t=e.clone(),s=(ft(r)||Lr(r)?r.valueOf():_e(r).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+s),Y.updateOffset(t,!1),t):_e(r).local()}function pn(r){return-Math.round(r._d.getTimezoneOffset())}Y.updateOffset=function(){};function vd(r,e,t){var s=this._offset||0,i;if(!this.isValid())return r!=null?this:NaN;if(r!=null){if(typeof r=="string"){if(r=gn(Cs,r),r===null)return this}else Math.abs(r)<16&&!t&&(r=r*60);return!this._isUTC&&e&&(i=pn(this)),this._offset=r,this._isUTC=!0,i!=null&&this.add(i,"m"),s!==r&&(!e||this._changeInProgress?wo(this,xt(r-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Y.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?s:pn(this)}function yd(r,e){return r!=null?(typeof r!="string"&&(r=-r),this.utcOffset(r,e),this):-this.utcOffset()}function wd(r){return this.utcOffset(0,r)}function Ed(r){return this._isUTC&&(this.utcOffset(0,r),this._isUTC=!1,r&&this.subtract(pn(this),"m")),this}function bd(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var r=gn(jc,this._i);r!=null?this.utcOffset(r):this.utcOffset(0,!0)}return this}function Cd(r){return this.isValid()?(r=r?_e(r).utcOffset():0,(this.utcOffset()-r)%60===0):!1}function _d(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Dd(){if(!Ze(this._isDSTShifted))return this._isDSTShifted;var r={},e;return Gi(r,this),r=fo(r),r._a?(e=r._isUTC?Ct(r._a):_e(r._a),this._isDSTShifted=this.isValid()&&pd(r._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Ad(){return this.isValid()?!this._isUTC:!1}function Sd(){return this.isValid()?this._isUTC:!1}function mo(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Td=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Rd=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function xt(r,e){var t=r,s=null,i,n,a;return Fs(r)?t={ms:r._milliseconds,d:r._days,M:r._months}:It(r)||!isNaN(+r)?(t={},e?t[e]=+r:t.milliseconds=+r):(s=Td.exec(r))?(i=s[1]==="-"?-1:1,t={y:0,d:ne(s[At])*i,h:ne(s[He])*i,m:ne(s[gt])*i,s:ne(s[$t])*i,ms:ne(fn(s[hr]*1e3))*i}):(s=Rd.exec(r))?(i=s[1]==="-"?-1:1,t={y:ur(s[2],i),M:ur(s[3],i),w:ur(s[4],i),d:ur(s[5],i),h:ur(s[6],i),m:ur(s[7],i),s:ur(s[8],i)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(a=Fd(_e(t.from),_e(t.to)),t={},t.ms=a.milliseconds,t.M=a.months),n=new Rs(t),Fs(r)&&ge(r,"_locale")&&(n._locale=r._locale),Fs(r)&&ge(r,"_isValid")&&(n._isValid=r._isValid),n}xt.fn=Rs.prototype,xt.invalid=xd;function ur(r,e){var t=r&&parseFloat(r.replace(",","."));return(isNaN(t)?0:t)*e}function vo(r,e){var t={};return t.months=e.month()-r.month()+(e.year()-r.year())*12,r.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+r.clone().add(t.months,"M"),t}function Fd(r,e){var t;return r.isValid()&&e.isValid()?(e=xn(e,r),r.isBefore(e)?t=vo(r,e):(t=vo(e,r),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function yo(r,e){return function(t,s){var i,n;return s!==null&&!isNaN(+s)&&(Ya(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=t,t=s,s=n),i=xt(t,s),wo(this,i,r),this}}function wo(r,e,t,s){var i=e._milliseconds,n=fn(e._days),a=fn(e._months);r.isValid()&&(s=s??!0,a&&to(r,zr(r,"Month")+a*t),n&&Ja(r,"Date",zr(r,"Date")+n*t),i&&r._d.setTime(r._d.valueOf()+i*t),s&&Y.updateOffset(r,n||a))}var kd=yo(1,"add"),Bd=yo(-1,"subtract");function Eo(r){return typeof r=="string"||r instanceof String}function Id(r){return ft(r)||Lr(r)||Eo(r)||It(r)||Pd(r)||Hd(r)||r===null||r===void 0}function Hd(r){var e=dr(r)&&!Ui(r),t=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,n,a=s.length;for(i=0;i<a;i+=1)n=s[i],t=t||ge(r,n);return e&&t}function Pd(r){var e=ut(r),t=!1;return e&&(t=r.filter(function(s){return!It(s)&&Eo(r)}).length===0),e&&t}function $d(r){var e=dr(r)&&!Ui(r),t=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,n;for(i=0;i<s.length;i+=1)n=s[i],t=t||ge(r,n);return e&&t}function Od(r,e){var t=r.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function Nd(r,e){arguments.length===1&&(arguments[0]?Id(arguments[0])?(r=arguments[0],e=void 0):$d(arguments[0])&&(e=arguments[0],r=void 0):(r=void 0,e=void 0));var t=r||_e(),s=xn(t,this).startOf("day"),i=Y.calendarFormat(this,s)||"sameElse",n=e&&(_t(e[i])?e[i].call(this,t):e[i]);return this.format(n||this.localeData().calendar(i,this,_e(t)))}function Md(){return new Yr(this)}function qd(r,e){var t=ft(r)?r:_e(r);return this.isValid()&&t.isValid()?(e=nt(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function jd(r,e){var t=ft(r)?r:_e(r);return this.isValid()&&t.isValid()?(e=nt(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function Ud(r,e,t,s){var i=ft(r)?r:_e(r),n=ft(e)?e:_e(e);return this.isValid()&&i.isValid()&&n.isValid()?(s=s||"()",(s[0]==="("?this.isAfter(i,t):!this.isBefore(i,t))&&(s[1]===")"?this.isBefore(n,t):!this.isAfter(n,t))):!1}function Ld(r,e){var t=ft(r)?r:_e(r),s;return this.isValid()&&t.isValid()?(e=nt(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(s=t.valueOf(),this.clone().startOf(e).valueOf()<=s&&s<=this.clone().endOf(e).valueOf())):!1}function Yd(r,e){return this.isSame(r,e)||this.isAfter(r,e)}function Wd(r,e){return this.isSame(r,e)||this.isBefore(r,e)}function Gd(r,e,t){var s,i,n;if(!this.isValid())return NaN;if(s=xn(r,this),!s.isValid())return NaN;switch(i=(s.utcOffset()-this.utcOffset())*6e4,e=nt(e),e){case"year":n=ks(this,s)/12;break;case"month":n=ks(this,s);break;case"quarter":n=ks(this,s)/3;break;case"second":n=(this-s)/1e3;break;case"minute":n=(this-s)/6e4;break;case"hour":n=(this-s)/36e5;break;case"day":n=(this-s-i)/864e5;break;case"week":n=(this-s-i)/6048e5;break;default:n=this-s}return t?n:at(n)}function ks(r,e){if(r.date()<e.date())return-ks(e,r);var t=(e.year()-r.year())*12+(e.month()-r.month()),s=r.clone().add(t,"months"),i,n;return e-s<0?(i=r.clone().add(t-1,"months"),n=(e-s)/(s-i)):(i=r.clone().add(t+1,"months"),n=(e-s)/(i-s)),-(t+n)||0}Y.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",Y.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Vd(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function zd(r){if(!this.isValid())return null;var e=r!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?vs(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):_t(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",vs(t,"Z")):vs(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Kd(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var r="moment",e="",t,s,i,n;return this.isLocal()||(r=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+r+'("]',s=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",n=e+'[")]',this.format(t+s+i+n)}function Zd(r){r||(r=this.isUtc()?Y.defaultFormatUtc:Y.defaultFormat);var e=vs(this,r);return this.localeData().postformat(e)}function Xd(r,e){return this.isValid()&&(ft(r)&&r.isValid()||_e(r).isValid())?xt({to:this,from:r}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Jd(r){return this.from(_e(),r)}function Qd(r,e){return this.isValid()&&(ft(r)&&r.isValid()||_e(r).isValid())?xt({from:this,to:r}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function eh(r){return this.to(_e(),r)}function bo(r){var e;return r===void 0?this._locale._abbr:(e=Nt(r),e!=null&&(this._locale=e),this)}var Co=it("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(r){return r===void 0?this.localeData():this.locale(r)});function _o(){return this._locale}var Bs=1e3,Ar=60*Bs,Is=60*Ar,Do=(365*400+97)*24*Is;function Sr(r,e){return(r%e+e)%e}function Ao(r,e,t){return r<100&&r>=0?new Date(r+400,e,t)-Do:new Date(r,e,t).valueOf()}function So(r,e,t){return r<100&&r>=0?Date.UTC(r+400,e,t)-Do:Date.UTC(r,e,t)}function th(r){var e,t;if(r=nt(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?So:Ao,r){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Sr(e+(this._isUTC?0:this.utcOffset()*Ar),Is);break;case"minute":e=this._d.valueOf(),e-=Sr(e,Ar);break;case"second":e=this._d.valueOf(),e-=Sr(e,Bs);break}return this._d.setTime(e),Y.updateOffset(this,!0),this}function rh(r){var e,t;if(r=nt(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?So:Ao,r){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=Is-Sr(e+(this._isUTC?0:this.utcOffset()*Ar),Is)-1;break;case"minute":e=this._d.valueOf(),e+=Ar-Sr(e,Ar)-1;break;case"second":e=this._d.valueOf(),e+=Bs-Sr(e,Bs)-1;break}return this._d.setTime(e),Y.updateOffset(this,!0),this}function sh(){return this._d.valueOf()-(this._offset||0)*6e4}function ih(){return Math.floor(this.valueOf()/1e3)}function nh(){return new Date(this.valueOf())}function ah(){var r=this;return[r.year(),r.month(),r.date(),r.hour(),r.minute(),r.second(),r.millisecond()]}function oh(){var r=this;return{years:r.year(),months:r.month(),date:r.date(),hours:r.hours(),minutes:r.minutes(),seconds:r.seconds(),milliseconds:r.milliseconds()}}function ch(){return this.isValid()?this.toISOString():null}function lh(){return Yi(this)}function dh(){return Xt({},te(this))}function hh(){return te(this).overflow}function uh(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}J("N",0,0,"eraAbbr"),J("NN",0,0,"eraAbbr"),J("NNN",0,0,"eraAbbr"),J("NNNN",0,0,"eraName"),J("NNNNN",0,0,"eraNarrow"),J("y",["y",1],"yo","eraYear"),J("y",["yy",2],0,"eraYear"),J("y",["yyy",3],0,"eraYear"),J("y",["yyyy",4],0,"eraYear"),z("N",mn),z("NN",mn),z("NNN",mn),z("NNNN",Ch),z("NNNNN",_h),ye(["N","NN","NNN","NNNN","NNNNN"],function(r,e,t,s){var i=t._locale.erasParse(r,s,t._strict);i?te(t).era=i:te(t).invalidEra=r}),z("y",br),z("yy",br),z("yyy",br),z("yyyy",br),z("yo",Dh),ye(["y","yy","yyy","yyyy"],Ue),ye(["yo"],function(r,e,t,s){var i;t._locale._eraYearOrdinalRegex&&(i=r.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[Ue]=t._locale.eraYearOrdinalParse(r,i):e[Ue]=parseInt(r,10)});function fh(r,e){var t,s,i,n=this._eras||Nt("en")._eras;for(t=0,s=n.length;t<s;++t){switch(typeof n[t].since){case"string":i=Y(n[t].since).startOf("day"),n[t].since=i.valueOf();break}switch(typeof n[t].until){case"undefined":n[t].until=1/0;break;case"string":i=Y(n[t].until).startOf("day").valueOf(),n[t].until=i.valueOf();break}}return n}function gh(r,e,t){var s,i,n=this.eras(),a,o,d;for(r=r.toUpperCase(),s=0,i=n.length;s<i;++s)if(a=n[s].name.toUpperCase(),o=n[s].abbr.toUpperCase(),d=n[s].narrow.toUpperCase(),t)switch(e){case"N":case"NN":case"NNN":if(o===r)return n[s];break;case"NNNN":if(a===r)return n[s];break;case"NNNNN":if(d===r)return n[s];break}else if([a,o,d].indexOf(r)>=0)return n[s]}function xh(r,e){var t=r.since<=r.until?1:-1;return e===void 0?Y(r.since).year():Y(r.since).year()+(e-r.offset)*t}function ph(){var r,e,t,s=this.localeData().eras();for(r=0,e=s.length;r<e;++r)if(t=this.clone().startOf("day").valueOf(),s[r].since<=t&&t<=s[r].until||s[r].until<=t&&t<=s[r].since)return s[r].name;return""}function mh(){var r,e,t,s=this.localeData().eras();for(r=0,e=s.length;r<e;++r)if(t=this.clone().startOf("day").valueOf(),s[r].since<=t&&t<=s[r].until||s[r].until<=t&&t<=s[r].since)return s[r].narrow;return""}function vh(){var r,e,t,s=this.localeData().eras();for(r=0,e=s.length;r<e;++r)if(t=this.clone().startOf("day").valueOf(),s[r].since<=t&&t<=s[r].until||s[r].until<=t&&t<=s[r].since)return s[r].abbr;return""}function yh(){var r,e,t,s,i=this.localeData().eras();for(r=0,e=i.length;r<e;++r)if(t=i[r].since<=i[r].until?1:-1,s=this.clone().startOf("day").valueOf(),i[r].since<=s&&s<=i[r].until||i[r].until<=s&&s<=i[r].since)return(this.year()-Y(i[r].since).year())*t+i[r].offset;return this.year()}function wh(r){return ge(this,"_erasNameRegex")||vn.call(this),r?this._erasNameRegex:this._erasRegex}function Eh(r){return ge(this,"_erasAbbrRegex")||vn.call(this),r?this._erasAbbrRegex:this._erasRegex}function bh(r){return ge(this,"_erasNarrowRegex")||vn.call(this),r?this._erasNarrowRegex:this._erasRegex}function mn(r,e){return e.erasAbbrRegex(r)}function Ch(r,e){return e.erasNameRegex(r)}function _h(r,e){return e.erasNarrowRegex(r)}function Dh(r,e){return e._eraYearOrdinalRegex||br}function vn(){var r=[],e=[],t=[],s=[],i,n,a,o,d,c=this.eras();for(i=0,n=c.length;i<n;++i)a=Ht(c[i].name),o=Ht(c[i].abbr),d=Ht(c[i].narrow),e.push(a),r.push(o),t.push(d),s.push(a),s.push(o),s.push(d);this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}J(0,["gg",2],0,function(){return this.weekYear()%100}),J(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Hs(r,e){J(0,[r,r.length],0,e)}Hs("gggg","weekYear"),Hs("ggggg","weekYear"),Hs("GGGG","isoWeekYear"),Hs("GGGGG","isoWeekYear"),z("G",bs),z("g",bs),z("GG",Ce,tt),z("gg",Ce,tt),z("GGGG",en,Qi),z("gggg",en,Qi),z("GGGGG",Es,ys),z("ggggg",Es,ys),Gr(["gggg","ggggg","GGGG","GGGGG"],function(r,e,t,s){e[s.substr(0,2)]=ne(r)}),Gr(["gg","GG"],function(r,e,t,s){e[s]=Y.parseTwoDigitYear(r)});function Ah(r){return To.call(this,r,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Sh(r){return To.call(this,r,this.isoWeek(),this.isoWeekday(),1,4)}function Th(){return Ot(this.year(),1,4)}function Rh(){return Ot(this.isoWeekYear(),1,4)}function Fh(){var r=this.localeData()._week;return Ot(this.year(),r.dow,r.doy)}function kh(){var r=this.localeData()._week;return Ot(this.weekYear(),r.dow,r.doy)}function To(r,e,t,s,i){var n;return r==null?Zr(this,s,i).year:(n=Ot(r,s,i),e>n&&(e=n),Bh.call(this,r,e,t,s,i))}function Bh(r,e,t,s,i){var n=io(r,e,t,s,i),a=Kr(n.year,0,n.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}J("Q",0,"Qo","quarter"),z("Q",Va),ye("Q",function(r,e){e[Pt]=(ne(r)-1)*3});function Ih(r){return r==null?Math.ceil((this.month()+1)/3):this.month((r-1)*3+this.month()%3)}J("D",["DD",2],"Do","date"),z("D",Ce,Cr),z("DD",Ce,tt),z("Do",function(r,e){return r?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),ye(["D","DD"],At),ye("Do",function(r,e){e[At]=ne(r.match(Ce)[0])});var Ro=_r("Date",!0);J("DDD",["DDDD",3],"DDDo","dayOfYear"),z("DDD",ws),z("DDDD",za),ye(["DDD","DDDD"],function(r,e,t){t._dayOfYear=ne(r)});function Hh(r){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return r==null?e:this.add(r-e,"d")}J("m",["mm",2],0,"minute"),z("m",Ce,tn),z("mm",Ce,tt),ye(["m","mm"],gt);var Ph=_r("Minutes",!1);J("s",["ss",2],0,"second"),z("s",Ce,tn),z("ss",Ce,tt),ye(["s","ss"],$t);var $h=_r("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return this.millisecond()*10}),J(0,["SSSSS",5],0,function(){return this.millisecond()*100}),J(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),J(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),J(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),J(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),z("S",ws,Va),z("SS",ws,tt),z("SSS",ws,za);var Qt,Fo;for(Qt="SSSS";Qt.length<=9;Qt+="S")z(Qt,br);function Oh(r,e){e[hr]=ne(("0."+r)*1e3)}for(Qt="S";Qt.length<=9;Qt+="S")ye(Qt,Oh);Fo=_r("Milliseconds",!1),J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");function Nh(){return this._isUTC?"UTC":""}function Mh(){return this._isUTC?"Coordinated Universal Time":""}var M=Yr.prototype;M.add=kd,M.calendar=Nd,M.clone=Md,M.diff=Gd,M.endOf=rh,M.format=Zd,M.from=Xd,M.fromNow=Jd,M.to=Qd,M.toNow=eh,M.get=Kc,M.invalidAt=hh,M.isAfter=qd,M.isBefore=jd,M.isBetween=Ud,M.isSame=Ld,M.isSameOrAfter=Yd,M.isSameOrBefore=Wd,M.isValid=lh,M.lang=Co,M.locale=bo,M.localeData=_o,M.max=ld,M.min=cd,M.parsingFlags=dh,M.set=Zc,M.startOf=th,M.subtract=Bd,M.toArray=ah,M.toObject=oh,M.toDate=nh,M.toISOString=zd,M.inspect=Kd,typeof Symbol<"u"&&Symbol.for!=null&&(M[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),M.toJSON=ch,M.toString=Vd,M.unix=ih,M.valueOf=sh,M.creationData=uh,M.eraName=ph,M.eraNarrow=mh,M.eraAbbr=vh,M.eraYear=yh,M.year=Xa,M.isLeapYear=zc,M.weekYear=Ah,M.isoWeekYear=Sh,M.quarter=M.quarters=Ih,M.month=ro,M.daysInMonth=nl,M.week=M.weeks=fl,M.isoWeek=M.isoWeeks=gl,M.weeksInYear=Fh,M.weeksInWeekYear=kh,M.isoWeeksInYear=Th,M.isoWeeksInISOWeekYear=Rh,M.date=Ro,M.day=M.days=Sl,M.weekday=Tl,M.isoWeekday=Rl,M.dayOfYear=Hh,M.hour=M.hours=$l,M.minute=M.minutes=Ph,M.second=M.seconds=$h,M.millisecond=M.milliseconds=Fo,M.utcOffset=vd,M.utc=wd,M.local=Ed,M.parseZone=bd,M.hasAlignedHourOffset=Cd,M.isDST=_d,M.isLocal=Ad,M.isUtcOffset=Sd,M.isUtc=mo,M.isUTC=mo,M.zoneAbbr=Nh,M.zoneName=Mh,M.dates=it("dates accessor is deprecated. Use date instead.",Ro),M.months=it("months accessor is deprecated. Use month instead",ro),M.years=it("years accessor is deprecated. Use year instead",Xa),M.zone=it("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",yd),M.isDSTShifted=it("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Dd);function qh(r){return _e(r*1e3)}function jh(){return _e.apply(null,arguments).parseZone()}function ko(r){return r}var xe=zi.prototype;xe.calendar=Ac,xe.longDateFormat=Fc,xe.invalidDate=Bc,xe.ordinal=Pc,xe.preparse=ko,xe.postformat=ko,xe.relativeTime=Oc,xe.pastFuture=Nc,xe.set=_c,xe.eras=fh,xe.erasParse=gh,xe.erasConvertYear=xh,xe.erasAbbrRegex=Eh,xe.erasNameRegex=wh,xe.erasNarrowRegex=bh,xe.months=tl,xe.monthsShort=rl,xe.monthsParse=il,xe.monthsRegex=ol,xe.monthsShortRegex=al,xe.week=ll,xe.firstDayOfYear=ul,xe.firstDayOfWeek=hl,xe.weekdays=bl,xe.weekdaysMin=_l,xe.weekdaysShort=Cl,xe.weekdaysParse=Al,xe.weekdaysRegex=Fl,xe.weekdaysShortRegex=kl,xe.weekdaysMinRegex=Bl,xe.isPM=Hl,xe.meridiem=Ol;function Ps(r,e,t,s){var i=Nt(),n=Ct().set(s,e);return i[t](n,r)}function Bo(r,e,t){if(It(r)&&(e=r,r=void 0),r=r||"",e!=null)return Ps(r,e,t,"month");var s,i=[];for(s=0;s<12;s++)i[s]=Ps(r,s,t,"month");return i}function yn(r,e,t,s){typeof r=="boolean"?(It(e)&&(t=e,e=void 0),e=e||""):(e=r,t=e,r=!1,It(e)&&(t=e,e=void 0),e=e||"");var i=Nt(),n=r?i._week.dow:0,a,o=[];if(t!=null)return Ps(e,(t+n)%7,s,"day");for(a=0;a<7;a++)o[a]=Ps(e,(a+n)%7,s,"day");return o}function Uh(r,e){return Bo(r,e,"months")}function Lh(r,e){return Bo(r,e,"monthsShort")}function Yh(r,e,t){return yn(r,e,t,"weekdays")}function Wh(r,e,t){return yn(r,e,t,"weekdaysShort")}function Gh(r,e,t){return yn(r,e,t,"weekdaysMin")}Jt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(r){var e=r%10,t=ne(r%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return r+t}}),Y.lang=it("moment.lang is deprecated. Use moment.locale instead.",Jt),Y.langData=it("moment.langData is deprecated. Use moment.localeData instead.",Nt);var Mt=Math.abs;function Vh(){var r=this._data;return this._milliseconds=Mt(this._milliseconds),this._days=Mt(this._days),this._months=Mt(this._months),r.milliseconds=Mt(r.milliseconds),r.seconds=Mt(r.seconds),r.minutes=Mt(r.minutes),r.hours=Mt(r.hours),r.months=Mt(r.months),r.years=Mt(r.years),this}function Io(r,e,t,s){var i=xt(e,t);return r._milliseconds+=s*i._milliseconds,r._days+=s*i._days,r._months+=s*i._months,r._bubble()}function zh(r,e){return Io(this,r,e,1)}function Kh(r,e){return Io(this,r,e,-1)}function Ho(r){return r<0?Math.floor(r):Math.ceil(r)}function Zh(){var r=this._milliseconds,e=this._days,t=this._months,s=this._data,i,n,a,o,d;return r>=0&&e>=0&&t>=0||r<=0&&e<=0&&t<=0||(r+=Ho(wn(t)+e)*864e5,e=0,t=0),s.milliseconds=r%1e3,i=at(r/1e3),s.seconds=i%60,n=at(i/60),s.minutes=n%60,a=at(n/60),s.hours=a%24,e+=at(a/24),d=at(Po(e)),t+=d,e-=Ho(wn(d)),o=at(t/12),t%=12,s.days=e,s.months=t,s.years=o,this}function Po(r){return r*4800/146097}function wn(r){return r*146097/4800}function Xh(r){if(!this.isValid())return NaN;var e,t,s=this._milliseconds;if(r=nt(r),r==="month"||r==="quarter"||r==="year")switch(e=this._days+s/864e5,t=this._months+Po(e),r){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(wn(this._months)),r){case"week":return e/7+s/6048e5;case"day":return e+s/864e5;case"hour":return e*24+s/36e5;case"minute":return e*1440+s/6e4;case"second":return e*86400+s/1e3;case"millisecond":return Math.floor(e*864e5)+s;default:throw new Error("Unknown unit "+r)}}function qt(r){return function(){return this.as(r)}}var $o=qt("ms"),Jh=qt("s"),Qh=qt("m"),eu=qt("h"),tu=qt("d"),ru=qt("w"),su=qt("M"),iu=qt("Q"),nu=qt("y"),au=$o;function ou(){return xt(this)}function cu(r){return r=nt(r),this.isValid()?this[r+"s"]():NaN}function fr(r){return function(){return this.isValid()?this._data[r]:NaN}}var lu=fr("milliseconds"),du=fr("seconds"),hu=fr("minutes"),uu=fr("hours"),fu=fr("days"),gu=fr("months"),xu=fr("years");function pu(){return at(this.days()/7)}var jt=Math.round,Tr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function mu(r,e,t,s,i){return i.relativeTime(e||1,!!t,r,s)}function vu(r,e,t,s){var i=xt(r).abs(),n=jt(i.as("s")),a=jt(i.as("m")),o=jt(i.as("h")),d=jt(i.as("d")),c=jt(i.as("M")),l=jt(i.as("w")),g=jt(i.as("y")),u=n<=t.ss&&["s",n]||n<t.s&&["ss",n]||a<=1&&["m"]||a<t.m&&["mm",a]||o<=1&&["h"]||o<t.h&&["hh",o]||d<=1&&["d"]||d<t.d&&["dd",d];return t.w!=null&&(u=u||l<=1&&["w"]||l<t.w&&["ww",l]),u=u||c<=1&&["M"]||c<t.M&&["MM",c]||g<=1&&["y"]||["yy",g],u[2]=e,u[3]=+r>0,u[4]=s,mu.apply(null,u)}function yu(r){return r===void 0?jt:typeof r=="function"?(jt=r,!0):!1}function wu(r,e){return Tr[r]===void 0?!1:e===void 0?Tr[r]:(Tr[r]=e,r==="s"&&(Tr.ss=e-1),!0)}function Eu(r,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,s=Tr,i,n;return typeof r=="object"&&(e=r,r=!1),typeof r=="boolean"&&(t=r),typeof e=="object"&&(s=Object.assign({},Tr,e),e.s!=null&&e.ss==null&&(s.ss=e.s-1)),i=this.localeData(),n=vu(this,!t,s,i),t&&(n=i.pastFuture(+this,n)),i.postformat(n)}var En=Math.abs;function Rr(r){return(r>0)-(r<0)||+r}function $s(){if(!this.isValid())return this.localeData().invalidDate();var r=En(this._milliseconds)/1e3,e=En(this._days),t=En(this._months),s,i,n,a,o=this.asSeconds(),d,c,l,g;return o?(s=at(r/60),i=at(s/60),r%=60,s%=60,n=at(t/12),t%=12,a=r?r.toFixed(3).replace(/\.?0+$/,""):"",d=o<0?"-":"",c=Rr(this._months)!==Rr(o)?"-":"",l=Rr(this._days)!==Rr(o)?"-":"",g=Rr(this._milliseconds)!==Rr(o)?"-":"",d+"P"+(n?c+n+"Y":"")+(t?c+t+"M":"")+(e?l+e+"D":"")+(i||s||r?"T":"")+(i?g+i+"H":"")+(s?g+s+"M":"")+(r?g+a+"S":"")):"P0D"}var le=Rs.prototype;le.isValid=gd,le.abs=Vh,le.add=zh,le.subtract=Kh,le.as=Xh,le.asMilliseconds=$o,le.asSeconds=Jh,le.asMinutes=Qh,le.asHours=eu,le.asDays=tu,le.asWeeks=ru,le.asMonths=su,le.asQuarters=iu,le.asYears=nu,le.valueOf=au,le._bubble=Zh,le.clone=ou,le.get=cu,le.milliseconds=lu,le.seconds=du,le.minutes=hu,le.hours=uu,le.days=fu,le.weeks=pu,le.months=gu,le.years=xu,le.humanize=Eu,le.toISOString=$s,le.toString=$s,le.toJSON=$s,le.locale=bo,le.localeData=_o,le.toIsoString=it("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$s),le.lang=Co,J("X",0,0,"unix"),J("x",0,0,"valueOf"),z("x",bs),z("X",Uc),ye("X",function(r,e,t){t._d=new Date(parseFloat(r)*1e3)}),ye("x",function(r,e,t){t._d=new Date(ne(r))});//! moment.js
215
+ Y.version="2.30.1",bc(_e),Y.fn=M,Y.min=dd,Y.max=hd,Y.now=ud,Y.utc=Ct,Y.unix=qh,Y.months=Uh,Y.isDate=Lr,Y.locale=Jt,Y.invalid=ps,Y.duration=xt,Y.isMoment=ft,Y.weekdays=Yh,Y.parseZone=jh,Y.localeData=Nt,Y.isDuration=Fs,Y.monthsShort=Lh,Y.weekdaysMin=Gh,Y.defineLocale=cn,Y.updateLocale=jl,Y.locales=Ul,Y.weekdaysShort=Wh,Y.normalizeUnits=nt,Y.relativeTimeRounding=yu,Y.relativeTimeThreshold=wu,Y.calendarFormat=Od,Y.prototype=M,Y.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};let Os=null,Se=null,Oo=null,St=null;function bu(r,e){if(!r||!r.sessionDescriptionHandler)return;const t=r.sessionDescriptionHandler.peerConnection;t&&t.getSenders().forEach(s=>{s.track&&s.track.kind==="audio"&&(s.track.enabled=e)})}function No(r){St||(St=document.createElement("audio"),St.id="voxnix-remote-audio",St.autoplay=!0,document.body.appendChild(St));const e=new MediaStream;if(r.sessionDescriptionHandler&&r.sessionDescriptionHandler.peerConnection){r.sessionDescriptionHandler.peerConnection.getReceivers().forEach(s=>{s.track&&e.addTrack(s.track)});const t=r.sessionDescriptionHandler.peerConnection;if(!t._isSetRemoteDescPatched){const s=t.setRemoteDescription.bind(t);t.setRemoteDescription=function(i){if(i&&i.sdp&&i.type==="answer"){const a=(((t.localDescription||{}).sdp||"").match(/^m=/gm)||[]).length,o=(i.sdp.match(/^m=/gm)||[]).length;if(console.log("[RTC Patch] local offer m-lines:",a,"| remote answer m-lines:",o),a>0&&o>a){const d=i.sdp.split(/\r?\n/);let c=0,l=!1;const g=[];for(const y of d)y.startsWith("m=")&&(c++,l=c>a),l||g.push(y);let u=g.join(`\r
221
216
  `);u.endsWith(`\r
222
217
  `)||(u+=`\r
223
- `),console.log("[RTC Patch] filtered to",(u.match(/^m=/gm)||[]).length,"m-lines. Applying to Chrome."),i={type:"answer",sdp:u}}}return s(i)},t._isSetRemoteDescPatched=!0}}St.srcObject=e,St.play().catch(t=>console.error("Error playing media:",t))}function Yo(){St&&(St.srcObject=null,St.pause())}const Ou=()=>{Z.on("incoming_call",()=>{Ge.pushSound()}),Z.on("local_dial",({number:r})=>{if(Os){const e=lr.makeURI(`sip:${r}@${Os.configuration.uri.domain}`),t=new Ha(Os,e);t.stateChange.addListener(s=>{s===B.Establishing?Z.emitLocal("call_status","Calling..."):s===B.Established?(Uo(t),Se=t,Z.emitLocal("call_status","InCall")):s===B.Terminated&&(Yo(),Z.emitLocal("call_status","Idle"),Se=null)}),t.invite()}}),Z.on("local_hangup",()=>{Ge.stopSound(),Se&&(Se.state===B.Established?Se.bye():typeof Se.reject=="function"?Se.reject():Se.cancel()),Z.emitLocal("call_status","Idle"),Z.emitLocal("call_duration","00:00"),Z.emitToParent("sync_call_ended")}),Z.on("local_reject",()=>{Ge.stopSound(),Se&&(typeof Se.reject=="function"?Se.reject():Se.cancel()),Z.emitLocal("call_status","Idle"),Z.emitLocal("call_duration","00:00"),Z.emitToParent("sync_call_ended")}),Z.on("local_answer",()=>{Ge.stopSound();const r={sessionDescriptionHandlerOptions:{constraints:{audio:!0,video:!1}}};Se&&Se.accept(r)}),Z.on("local_toggle_mute",({muted:r})=>{Se&&$u(Se,!r)}),Z.on("local_toggle_hold",({isOnHold:r,setIsOnHold:e})=>{if(Se)try{const t=!r,s={sessionDescriptionHandlerOptions:{hold:t}};Se.invite(s).then(()=>{e(t),console.log(t?"Call successfully put on hold":"Call successfully resumed")}).catch(i=>{console.error("Hold/Unhold failed",i)})}catch(t){console.error("Gagal mengubah status hold:",t)}}),Z.on("local_dtmf",({key:r})=>{Se&&Se.sessionDescriptionHandler&&Se.sessionDescriptionHandler.sendDtmf(r)})},Nu=async r=>{var a,o;window.__sipjsEventsBound||(Ou(),window.__sipjsEventsBound=!0);const{auth:e}=r;if(!e)return;const t=e.user_pbx||e.username,s=e.pwd_pbx||e.secret,i=((o=(a=e.pabx_host)==null?void 0:a.replace("http://",""))==null?void 0:o.replace("https://",""))||e.pbxurl,n=e.port||8089;if(!(!t||!i))try{const d=lr.makeURI(`sip:${t}@${i}`);if(!d)throw new Error("Failed to create SIP URI");const c=`wss://${i}:${n}`,l=new lr({uri:d,transportOptions:{server:c},authorizationUsername:t,authorizationPassword:s,sessionDescriptionHandlerFactoryOptions:{peerConnectionConfiguration:{iceServers:[]},constraints:{audio:!0,video:!1}},logLevel:"warn"});Os=l;const g=new Et(l);g.stateChange.addListener(async u=>{var y;u===me.Registered?((y=Ge.getConfig())==null?void 0:y.autoReady)!==!1?await Ge.updateExtensionStatus(t,"Ready","ready")?(Z.emitLocal("register_status","REGISTERED"),Z.emitLocal("agent_status","READY")):Z.emitLocal("register_status",{status:"FAILED",reason:"Failed to hit extension ready API"}):(Z.emitLocal("register_status","REGISTERED"),Z.emitLocal("agent_status","NOT_READY")):(u===me.Unregistered||u===me.Terminated)&&Z.emitLocal("register_status",{status:"FAILED",reason:"SIP Unregistered or Terminated"})}),l.delegate={onInvite(u){let y=!1;Se=u,Z.emitLocal("sipjsSession",u),Ge.pushSound(),Ge.pushNotification(`New incoming call from ${u.remoteIdentity.uri.user}`),Z.emitLocal("incoming_call",u),Z.emitToParent("sync_incoming_call",u),u.stateChange.addListener(w=>{if(w===B.Established){Uo(u),y=!0,Z.emitLocal("call_status","InCall"),Z.emitToParent("sync_call_answered",u);const b=Y();Lo=setInterval(()=>{const C=Y.duration(Y().diff(b));Z.emitLocal("call_duration",Ge.toHHMMSS(C.asSeconds()))},1e3)}else w===B.Terminated&&(Yo(),clearInterval(Lo),Ge.stopSound(),Z.emitLocal("call_duration","00:00"),Z.emitLocal("call_status","Idle"),y?Z.emitToParent("sync_call_ended",u):Z.emitToParent("sync_call_unanswered"),Se=null)})}},await l.start(),await g.register()}catch(d){console.error("SipJS init error:",d),Z.emitLocal("register_status",{status:"FAILED",reason:d.message||"Failed to connect to SIP server"})}};Y0();const Wo={"bottom-left":"bottom-6 left-3 items-start","bottom-right":"bottom-6 right-3 items-end","top-left":"top-6 left-3 items-start","top-right":"top-6 right-3 items-end"};function Mu({config:r,placement:e="bottom-left",offset:t,onIncomingCall:s,onCallAnswered:i,onCallEnded:n,onCallUnanswered:a,onRegisterStatus:o,onAgentStatus:d}){const[c,l]=Q.useState(!1),[g,u]=Q.useState("CONNECTING"),[y,w]=Q.useState("NOT_READY"),[b,C]=Q.useState(!1),x=Q.useRef(!1),p=Q.useRef({}),E=(r==null?void 0:r.autoReady)!==!1,_=(r==null?void 0:r.showAuxButton)===!0,R=(r==null?void 0:r.auxOptions)||[];Q.useEffect(()=>{p.current={onIncomingCall:s,onCallAnswered:i,onCallEnded:n,onCallUnanswered:a,onRegisterStatus:o,onAgentStatus:d}}),Q.useEffect(()=>{var f;r&&Ge.setConfig(r);const A=(r==null?void 0:r.auth)||((f=r==null?void 0:r.pabxConfig)==null?void 0:f.auth)||{};!x.current&&(A.username||A.user_pbx)&&(A.pwd_pbx||A.secret)&&(A.pabx_host||A.pbxurl||A.host)&&(x.current=!0,Nu({auth:A}))},[r]),Q.useEffect(()=>{const A=[Z.on("register_status",f=>{var m,L;const v=typeof f=="string"?f:(f==null?void 0:f.status)??"FAILED";u(v),v==="REGISTERED"&&l(!0),(L=(m=p.current).onRegisterStatus)==null||L.call(m,v==="FAILED"?f:v)}),Z.on("agent_status",f=>{var v,m;w(f),(m=(v=p.current).onAgentStatus)==null||m.call(v,f)}),Z.on("sync_incoming_call",f=>{var v,m;C(!0),l(!0),(m=(v=p.current).onIncomingCall)==null||m.call(v,f)}),Z.on("sync_call_answered",f=>{var v,m;C(!1),(m=(v=p.current).onCallAnswered)==null||m.call(v,f)}),Z.on("sync_call_ended",f=>{var v,m;C(!1),(m=(v=p.current).onCallEnded)==null||m.call(v,f)}),Z.on("sync_call_unanswered",f=>{var v,m;C(!1),(m=(v=p.current).onCallUnanswered)==null||m.call(v,f)})];return()=>A.forEach(f=>f())},[]);const T=Wo[e]||Wo["bottom-left"],F=g!=="REGISTERED"?g==="FAILED"?"bg-red-500":"bg-blue-400":y==="READY"?"bg-green-500":y==="AUX"?"bg-amber-400":"bg-gray-400",h=t?{position:"fixed",zIndex:9999,...t}:void 0,N=e!=null&&e.includes("right")?"origin-bottom-right":"origin-bottom-left";return S.jsxs(S.Fragment,{children:[S.jsx(X0,{}),S.jsxs("div",{className:t?void 0:`fixed ${T} z-[9999] flex flex-col gap-3`,style:h,children:[S.jsxs("div",{className:`w-[360px] bg-white rounded-3xl overflow-hidden ${N} shadow-[0_20px_60px_rgba(0,0,0,0.18),0_4px_16px_rgba(0,0,0,0.08)] ${c?"animate-slideUp":"hidden"}`,children:[S.jsxs("div",{className:"flex items-center justify-between px-4 py-3.5 bg-gradient-to-r from-[#3f3192] to-[#5240c2]",children:[S.jsx("div",{className:"flex items-center gap-2.5",children:S.jsx("span",{className:"text-white font-semibold text-sm tracking-wide",children:"Voice Widget"})}),S.jsx("button",{onClick:()=>l(!1),className:"text-white/50 hover:text-white transition-colors p-1 rounded-lg",title:"Minimize",children:S.jsx(r0,{className:"w-4 h-4"})})]}),S.jsx(q0,{initialRegisterStatus:g,autoReady:E,showAuxButton:_,auxOptions:R})]}),S.jsxs("button",{onClick:()=>l(A=>!A),className:"w-12 h-12 rounded-full bg-primary hover:bg-primary-hover text-white shadow-lg shadow-primary/30 flex items-center justify-center transition-all active:scale-95 relative",title:"Voice Widget",children:[S.jsx(as,{className:"w-5 h-5"}),b&&S.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-green-500 border-2 border-white animate-ping"}),S.jsx("span",{className:`absolute -top-0.5 -right-0.5 w-3 h-3 rounded-full border-2 border-white ${F}`})]})]})]})}let er=null,ot=null;function ju(r,e){if(Hr.createRoot){const t=Hr.createRoot(e);return t.render(r),{render:s=>t.render(s),unmount:()=>t.unmount()}}return Hr.render(r,e),{render:t=>Hr.render(t,e),unmount:()=>Hr.unmountComponentAtNode(e)}}const qu={init(r={}){const{container:e,placement:t="bottom-left",offset:s,platform:i="sipjs",auth:n,pabxConfig:a,autoReady:o=!0,showAuxButton:d=!1,auxOptions:c=[],onIncomingCall:l,onCallAnswered:g,onCallEnded:u,onCallUnanswered:y,onRegisterStatus:w,onAgentStatus:b,...C}=r;typeof e=="string"?ot=document.querySelector(e):e instanceof HTMLElement&&(ot=e),ot||(ot=document.createElement("div"),ot.id="omnix-widget-root",document.body.appendChild(ot)),er&&(er.unmount(),er=null);const x=Q.createElement(Mu,{config:{platform:i,auth:n,pabxConfig:a,autoReady:o,showAuxButton:d,auxOptions:c,...C},placement:t,offset:s,onIncomingCall:l,onCallAnswered:g,onCallEnded:u,onCallUnanswered:y,onRegisterStatus:w,onAgentStatus:b});return er=ju(x,ot),{answer:()=>Z.emitLocal("local_answer"),hangup:()=>Z.emitLocal("local_hangup"),reject:()=>Z.emitLocal("local_reject"),mute:p=>Z.emitLocal("local_toggle_mute",{muted:p}),hold:p=>Z.emitLocal("local_toggle_hold",{isOnHold:p,setIsOnHold:()=>{}}),dial:p=>Z.emitLocal("local_dial",{number:p}),destroy:()=>{er==null||er.unmount(),er=null,(ot==null?void 0:ot.id)==="omnix-widget-root"&&ot.remove(),ot=null}}}};Yt.OmnixWidget=qu,Object.defineProperty(Yt,Symbol.toStringTag,{value:"Module"})});
218
+ `),console.log("[RTC Patch] filtered to",(u.match(/^m=/gm)||[]).length,"m-lines. Applying to Chrome."),i={type:"answer",sdp:u}}}return s(i)},t._isSetRemoteDescPatched=!0}}St.srcObject=e,St.play().catch(t=>console.error("Error playing media:",t))}function Mo(){St&&(St.srcObject=null,St.pause())}const Cu=()=>{Z.on("incoming_call",()=>{Ge.pushSound()}),Z.on("local_dial",({number:r})=>{if(Os){const e=lr.makeURI(`sip:${r}@${Os.configuration.uri.domain}`),t=new Ra(Os,e);t.stateChange.addListener(s=>{s===B.Establishing?Z.emitLocal("call_status","Calling..."):s===B.Established?(No(t),Se=t,Z.emitLocal("call_status","InCall")):s===B.Terminated&&(Mo(),Z.emitLocal("call_status","Idle"),Se=null)}),t.invite()}}),Z.on("local_hangup",()=>{Ge.stopSound(),Se&&(Se.state===B.Established?Se.bye():typeof Se.reject=="function"?Se.reject():Se.cancel()),Z.emitLocal("call_status","Idle"),Z.emitLocal("call_duration","00:00"),Z.emitToParent("sync_call_ended")}),Z.on("local_reject",()=>{Ge.stopSound(),Se&&(typeof Se.reject=="function"?Se.reject():Se.cancel()),Z.emitLocal("call_status","Idle"),Z.emitLocal("call_duration","00:00"),Z.emitToParent("sync_call_ended")}),Z.on("local_answer",()=>{Ge.stopSound();const r={sessionDescriptionHandlerOptions:{constraints:{audio:!0,video:!1}}};Se&&Se.accept(r)}),Z.on("local_toggle_mute",({muted:r})=>{Se&&bu(Se,!r)}),Z.on("local_toggle_hold",({isOnHold:r,setIsOnHold:e})=>{if(Se)try{const t=!r,s={sessionDescriptionHandlerOptions:{hold:t}};Se.invite(s).then(()=>{e(t),console.log(t?"Call successfully put on hold":"Call successfully resumed")}).catch(i=>{console.error("Hold/Unhold failed",i)})}catch(t){console.error("Gagal mengubah status hold:",t)}}),Z.on("local_dtmf",({key:r})=>{Se&&Se.sessionDescriptionHandler&&Se.sessionDescriptionHandler.sendDtmf(r)})},_u=async r=>{var a,o;window.__sipjsEventsBound||(Cu(),window.__sipjsEventsBound=!0);const{auth:e}=r;if(!e)return;const t=e.user_pbx||e.username,s=e.pwd_pbx||e.secret,i=((o=(a=e.pabx_host)==null?void 0:a.replace("http://",""))==null?void 0:o.replace("https://",""))||e.pbxurl,n=e.port||8089;if(!(!t||!i))try{const d=lr.makeURI(`sip:${t}@${i}`);if(!d)throw new Error("Failed to create SIP URI");const c=`wss://${i}:${n}`,l=new lr({uri:d,transportOptions:{server:c,useSSL:!0},authorizationUsername:t,authorizationPassword:s,sessionDescriptionHandlerFactoryOptions:{peerConnectionConfiguration:{iceServers:[]},constraints:{audio:!0,video:!1}},logLevel:"warn",contactParams:{transport:"tls"}});Os=l;const g=new Et(l);g.stateChange.addListener(async u=>{var y;u===me.Registered?((y=Ge.getConfig())==null?void 0:y.autoReady)!==!1?await Ge.updateExtensionStatus(t,"Ready","ready")?(Z.emitLocal("register_status","REGISTERED"),Z.emitLocal("agent_status","READY")):Z.emitLocal("register_status",{status:"FAILED",reason:"Failed to hit extension ready API"}):(Z.emitLocal("register_status","REGISTERED"),Z.emitLocal("agent_status","NOT_READY")):(u===me.Unregistered||u===me.Terminated)&&Z.emitLocal("register_status",{status:"FAILED",reason:"SIP Unregistered or Terminated"})}),l.delegate={onInvite(u){let y=!1;Se=u,Z.emitLocal("sipjsSession",u),Ge.pushSound(),Ge.pushNotification(`New incoming call from ${u.remoteIdentity.uri.user}`),Z.emitLocal("incoming_call",u),Z.emitToParent("sync_incoming_call",u),u.stateChange.addListener(w=>{if(w===B.Established){No(u),y=!0,Z.emitLocal("call_status","InCall"),Z.emitToParent("sync_call_answered",u);const b=Y();Oo=setInterval(()=>{const C=Y.duration(Y().diff(b));Z.emitLocal("call_duration",Ge.toHHMMSS(C.asSeconds()))},1e3)}else w===B.Terminated&&(Mo(),clearInterval(Oo),Ge.stopSound(),Z.emitLocal("call_duration","00:00"),Z.emitLocal("call_status","Idle"),y?Z.emitToParent("sync_call_ended",u):Z.emitToParent("sync_call_unanswered"),Se=null)})}},await l.start(),await g.register()}catch(d){console.error("SipJS init error:",d),Z.emitLocal("register_status",{status:"FAILED",reason:d.message||"Failed to connect to SIP server"})}},qo={"bottom-left":"bottom-6 left-3 items-start","bottom-right":"bottom-6 right-3 items-end","top-left":"top-6 left-3 items-start","top-right":"top-6 right-3 items-end"};function Du({config:r,placement:e="bottom-left",offset:t,onIncomingCall:s,onCallAnswered:i,onCallEnded:n,onCallUnanswered:a,onRegisterStatus:o,onAgentStatus:d}){const[c,l]=re.useState(!1),[g,u]=re.useState("CONNECTING"),[y,w]=re.useState("NOT_READY"),[b,C]=re.useState(!1),x=re.useRef(!1),p=re.useRef({}),E=(r==null?void 0:r.autoReady)!==!1,_=(r==null?void 0:r.showAuxButton)===!0,T=(r==null?void 0:r.auxOptions)||[];re.useEffect(()=>{p.current={onIncomingCall:s,onCallAnswered:i,onCallEnded:n,onCallUnanswered:a,onRegisterStatus:o,onAgentStatus:d}}),re.useEffect(()=>{var f;r&&Ge.setConfig(r);const A=(r==null?void 0:r.auth)||((f=r==null?void 0:r.pabxConfig)==null?void 0:f.auth)||{};!x.current&&(A.username||A.user_pbx)&&(A.pwd_pbx||A.secret)&&(A.pabx_host||A.pbxurl||A.host)&&(x.current=!0,_u({auth:A}))},[r]),re.useEffect(()=>{const A=[Z.on("register_status",f=>{var m,U;const v=typeof f=="string"?f:(f==null?void 0:f.status)??"FAILED";u(v),v==="REGISTERED"&&l(!0),(U=(m=p.current).onRegisterStatus)==null||U.call(m,v==="FAILED"?f:v)}),Z.on("agent_status",f=>{var v,m;w(f),(m=(v=p.current).onAgentStatus)==null||m.call(v,f)}),Z.on("sync_incoming_call",f=>{var v,m;C(!0),l(!0),(m=(v=p.current).onIncomingCall)==null||m.call(v,f)}),Z.on("sync_call_answered",f=>{var v,m;C(!1),(m=(v=p.current).onCallAnswered)==null||m.call(v,f)}),Z.on("sync_call_ended",f=>{var v,m;C(!1),(m=(v=p.current).onCallEnded)==null||m.call(v,f)}),Z.on("sync_call_unanswered",f=>{var v,m;C(!1),(m=(v=p.current).onCallUnanswered)==null||m.call(v,f)})];return()=>A.forEach(f=>f())},[]);const S=qo[e]||qo["bottom-left"],R=g!=="REGISTERED"?g==="FAILED"?"bg-red-500":"bg-blue-400":y==="READY"?"bg-green-500":y==="AUX"?"bg-amber-400":"bg-gray-400",h=t?{position:"fixed",zIndex:9999,...t}:void 0,N=e!=null&&e.includes("right")?"origin-bottom-right":"origin-bottom-left";return F.jsxs("div",{className:t?void 0:`fixed ${S} z-[9999] flex flex-col gap-3`,style:h,children:[F.jsxs("div",{className:`w-[360px] bg-white rounded-3xl overflow-hidden ${N} shadow-[0_20px_60px_rgba(0,0,0,0.18),0_4px_16px_rgba(0,0,0,0.08)] ${c?"animate-slideUp":"hidden"}`,children:[F.jsxs("div",{className:"flex items-center justify-between px-4 py-3.5 bg-gradient-to-r from-[#3f3192] to-[#5240c2]",children:[F.jsx("div",{className:"flex items-center gap-2.5",children:F.jsx("span",{className:"text-white font-semibold text-sm tracking-wide",children:"Voice Widget"})}),F.jsx("button",{onClick:()=>l(!1),className:"text-white/50 hover:text-white transition-colors p-1 rounded-lg",title:"Minimize",children:F.jsx(Xo,{className:"w-4 h-4"})})]}),F.jsx($0,{initialRegisterStatus:g,autoReady:E,showAuxButton:_,auxOptions:T})]}),F.jsxs("button",{onClick:()=>l(A=>!A),className:"w-12 h-12 rounded-full bg-primary hover:bg-primary-hover text-white shadow-lg shadow-primary/30 flex items-center justify-center transition-all active:scale-95 relative",title:"Voice Widget",children:[F.jsx(as,{className:"w-5 h-5"}),b&&F.jsx("span",{className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-green-500 border-2 border-white animate-ping"}),F.jsx("span",{className:`absolute -top-0.5 -right-0.5 w-3 h-3 rounded-full border-2 border-white ${R}`})]})]})}let er=null,ot=null;function Au(r,e){if(Hr.createRoot){const t=Hr.createRoot(e);return t.render(r),{render:s=>t.render(s),unmount:()=>t.unmount()}}return Hr.render(r,e),{render:t=>Hr.render(t,e),unmount:()=>Hr.unmountComponentAtNode(e)}}const Su={init(r={}){const{container:e,placement:t="bottom-left",offset:s,platform:i="sipjs",auth:n,pabxConfig:a,autoReady:o=!0,showAuxButton:d=!1,auxOptions:c=[],onIncomingCall:l,onCallAnswered:g,onCallEnded:u,onCallUnanswered:y,onRegisterStatus:w,onAgentStatus:b,...C}=r;typeof e=="string"?ot=document.querySelector(e):e instanceof HTMLElement&&(ot=e),ot||(ot=document.createElement("div"),ot.id="omnix-widget-root",document.body.appendChild(ot)),er&&(er.unmount(),er=null);const x=re.createElement(Du,{config:{platform:i,auth:n,pabxConfig:a,autoReady:o,showAuxButton:d,auxOptions:c,...C},placement:t,offset:s,onIncomingCall:l,onCallAnswered:g,onCallEnded:u,onCallUnanswered:y,onRegisterStatus:w,onAgentStatus:b});return er=Au(x,ot),{answer:()=>Z.emitLocal("local_answer"),hangup:()=>Z.emitLocal("local_hangup"),reject:()=>Z.emitLocal("local_reject"),mute:p=>Z.emitLocal("local_toggle_mute",{muted:p}),hold:p=>Z.emitLocal("local_toggle_hold",{isOnHold:p,setIsOnHold:()=>{}}),dial:p=>Z.emitLocal("local_dial",{number:p}),destroy:()=>{er==null||er.unmount(),er=null,(ot==null?void 0:ot.id)==="omnix-widget-root"&&ot.remove(),ot=null}}}};Yt.OmnixWidget=Su,Object.defineProperty(Yt,Symbol.toStringTag,{value:"Module"})});