ed-widget 1.56.9 → 1.56.10-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ed-widget.js +5 -5
- package/npm/ed-widget.js +5 -5
- package/package.json +1 -1
package/npm/ed-widget.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.id="ed-widget-bundle-style",t.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Inter:ital,wght@0,100..900;1,100..900&display=swap";*,: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}.ed-pointer-events-none{pointer-events:none!important}.ed-fixed{position:fixed!important}.ed-absolute{position:absolute!important}.ed-relative{position:relative!important}.ed-sticky{position:sticky!important}.ed-inset-0{top:0!important;right:0!important;bottom:0!important;left:0!important}.ed-inset-2{top:.5rem!important;right:.5rem!important;bottom:.5rem!important;left:.5rem!important}.\\!ed-top-\\[10px\\]{top:10px!important}.\\!ed-top-\\[25px\\]{top:25px!important}.-ed-right-0\\.5{right:-.125rem!important}.-ed-right-4{right:-1rem!important}.-ed-top-3{top:-.75rem!important}.ed-bottom-0{bottom:0!important}.ed-bottom-16{bottom:4rem!important}.ed-bottom-28{bottom:7rem!important}.ed-bottom-32{bottom:8rem!important}.ed-bottom-5{bottom:1.25rem!important}.ed-bottom-8{bottom:2rem!important}.ed-bottom-\\[-4px\\]{bottom:-4px!important}.ed-left-0{left:0!important}.ed-left-1\\/2{left:50%!important}.ed-left-\\[-4px\\]{left:-4px!important}.ed-right-0{right:0!important}.ed-right-16{right:4rem!important}.ed-right-3{right:.75rem!important}.ed-right-5{right:1.25rem!important}.ed-right-8{right:2rem!important}.ed-right-\\[-4px\\]{right:-4px!important}.ed-top-0{top:0!important}.ed-top-1\\/2{top:50%!important}.ed-top-3{top:.75rem!important}.ed-top-5{top:1.25rem!important}.ed-top-9{top:2.25rem!important}.ed-top-\\[-4px\\]{top:-4px!important}.ed-z-10{z-index:10!important}.ed-z-\\[1000\\]{z-index:1000!important}.ed-z-\\[1100\\]{z-index:1100!important}.ed-z-\\[9999998\\]{z-index:9999998!important}.ed-z-\\[9999999\\]{z-index:9999999!important}.ed-z-\\[9999\\]{z-index:9999!important}.ed-z-\\[999\\]{z-index:999!important}.ed--mx-5{margin-left:-1.25rem!important;margin-right:-1.25rem!important}.ed-mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.ed-mx-3{margin-left:.75rem!important;margin-right:.75rem!important}.ed-mx-auto{margin-left:auto!important;margin-right:auto!important}.ed-my-10{margin-top:2.5rem!important;margin-bottom:2.5rem!important}.ed-my-12{margin-top:3rem!important;margin-bottom:3rem!important}.ed-my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.ed-my-4{margin-top:1rem!important;margin-bottom:1rem!important}.ed-mb-1{margin-bottom:.25rem!important}.ed-mb-2{margin-bottom:.5rem!important}.ed-mb-3{margin-bottom:.75rem!important}.ed-mb-4{margin-bottom:1rem!important}.ed-mb-5{margin-bottom:1.25rem!important}.ed-mb-6{margin-bottom:1.5rem!important}.ed-ml-1{margin-left:.25rem!important}.ed-ml-16{margin-left:4rem!important}.ed-ml-2{margin-left:.5rem!important}.ed-ml-3{margin-left:.75rem!important}.ed-ml-auto{margin-left:auto!important}.ed-mr-1{margin-right:.25rem!important}.ed-mt-1{margin-top:.25rem!important}.ed-mt-2{margin-top:.5rem!important}.ed-mt-2\\.5{margin-top:.625rem!important}.ed-mt-3{margin-top:.75rem!important}.ed-mt-4{margin-top:1rem!important}.ed-mt-5{margin-top:1.25rem!important}.ed-mt-6{margin-top:1.5rem!important}.ed-line-clamp-1{overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:1!important}.ed-line-clamp-2{overflow:hidden!important;display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:2!important}.ed-block{display:block!important}.ed-inline-block{display:inline-block!important}.ed-inline{display:inline!important}.ed-flex{display:flex!important}.ed-inline-flex{display:inline-flex!important}.ed-grid{display:grid!important}.ed-hidden{display:none!important}.ed-size-1{width:.25rem!important;height:.25rem!important}.ed-size-1\\.5{width:.375rem!important;height:.375rem!important}.ed-size-10{width:2.5rem!important;height:2.5rem!important}.ed-size-12{width:3rem!important;height:3rem!important}.ed-size-4{width:1rem!important;height:1rem!important}.ed-size-5{width:1.25rem!important;height:1.25rem!important}.ed-size-7{width:1.75rem!important;height:1.75rem!important}.ed-size-9{width:2.25rem!important;height:2.25rem!important}.ed-size-full{width:100%!important;height:100%!important}.ed-h-0{height:0px!important}.ed-h-10{height:2.5rem!important}.ed-h-2{height:.5rem!important}.ed-h-2\\/3{height:66.666667%!important}.ed-h-20{height:5rem!important}.ed-h-4{height:1rem!important}.ed-h-5{height:1.25rem!important}.ed-h-7{height:1.75rem!important}.ed-h-8{height:2rem!important}.ed-h-\\[140px\\]{height:140px!important}.ed-h-\\[41px\\]{height:41px!important}.ed-h-\\[500px\\]{height:500px!important}.ed-h-\\[50px\\]{height:50px!important}.ed-h-\\[calc\\(100\\%-48px\\)\\]{height:calc(100% - 48px)!important}.ed-h-\\[calc\\(100vh-200px\\)\\]{height:calc(100vh - 200px)!important}.ed-h-\\[calc\\(100vh-25rem\\)\\]{height:calc(100vh - 25rem)!important}.ed-h-\\[calc\\(90vh-20px\\)\\]{height:calc(90vh - 20px)!important}.ed-h-auto{height:auto!important}.ed-h-dvh{height:100dvh!important}.ed-h-full{height:100%!important}.ed-h-max{height:-moz-max-content!important;height:max-content!important}.ed-max-h-0{max-height:0px!important}.ed-max-h-96{max-height:24rem!important}.ed-max-h-\\[704px\\]{max-height:704px!important}.ed-max-h-\\[90vh\\]{max-height:90vh!important}.ed-max-h-full{max-height:100%!important}.ed-min-h-\\[24px\\]{min-height:24px!important}.ed-min-h-min{min-height:-moz-min-content!important;min-height:min-content!important}.ed-w-0{width:0px!important}.ed-w-10{width:2.5rem!important}.ed-w-11\\/12{width:91.666667%!important}.ed-w-2{width:.5rem!important}.ed-w-4{width:1rem!important}.ed-w-40{width:10rem!important}.ed-w-5{width:1.25rem!important}.ed-w-7{width:1.75rem!important}.ed-w-8{width:2rem!important}.ed-w-\\[400px\\]{width:400px!important}.ed-w-\\[50px\\]{width:50px!important}.ed-w-\\[calc\\(100\\%-20px\\)\\]{width:calc(100% - 20px)!important}.ed-w-\\[calc\\(100\\%-50px\\)\\]{width:calc(100% - 50px)!important}.ed-w-fit{width:-moz-fit-content!important;width:fit-content!important}.ed-w-full{width:100%!important}.ed-w-max{width:-moz-max-content!important;width:max-content!important}.ed-w-min{width:-moz-min-content!important;width:min-content!important}.ed-w-px{width:1px!important}.ed-w-screen{width:100vw!important}.ed-min-w-0{min-width:0px!important}.ed-min-w-4{min-width:1rem!important}.ed-min-w-\\[16rem\\]{min-width:16rem!important}.ed-min-w-\\[3rem\\]{min-width:3rem!important}.ed-min-w-\\[60px\\]{min-width:60px!important}.ed-max-w-\\[100px\\]{max-width:100px!important}.ed-max-w-\\[140px\\]{max-width:140px!important}.ed-max-w-\\[150px\\]{max-width:150px!important}.ed-max-w-\\[280px\\]{max-width:280px!important}.ed-max-w-\\[65\\%\\]{max-width:65%!important}.ed-max-w-\\[85\\%\\]{max-width:85%!important}.ed-max-w-\\[87\\%\\]{max-width:87%!important}.ed-max-w-\\[90vw\\]{max-width:90vw!important}.ed-flex-1{flex:1 1 0%!important}.ed-flex-shrink-0,.ed-shrink-0{flex-shrink:0!important}.ed-origin-center{transform-origin:center!important}.-ed-translate-x-1\\/2,.ed--translate-x-1\\/2{--tw-translate-x: -50% !important;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))!important}.ed--translate-x-2{--tw-translate-x: -.5rem !important;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))!important}.ed--translate-y-1\\/2{--tw-translate-y: -50% !important;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))!important}.ed-rotate-0{--tw-rotate: 0deg !important;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))!important}.ed-rotate-\\[360deg\\]{--tw-rotate: 360deg !important;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))!important}.ed-scale-0{--tw-scale-x: 0 !important;--tw-scale-y: 0 !important;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))!important}.ed-scale-100{--tw-scale-x: 1 !important;--tw-scale-y: 1 !important;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))!important}.ed-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))!important}@keyframes ed-bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.ed-animate-bounce{animation:ed-bounce 1s infinite!important}@keyframes ed-spin{to{transform:rotate(360deg)}}.ed-animate-spin{animation:ed-spin 1s linear infinite!important}.ed-cursor-not-allowed{cursor:not-allowed!important}.ed-cursor-pointer{cursor:pointer!important}.ed-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.ed-resize-none{resize:none!important}.ed-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.ed-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.ed-flex-col{flex-direction:column!important}.ed-flex-wrap{flex-wrap:wrap!important}.ed-flex-nowrap{flex-wrap:nowrap!important}.ed-items-start{align-items:flex-start!important}.ed-items-center{align-items:center!important}.ed-justify-start{justify-content:flex-start!important}.ed-justify-end{justify-content:flex-end!important}.ed-justify-center{justify-content:center!important}.ed-justify-between{justify-content:space-between!important}.ed-gap-0\\.5{gap:.125rem!important}.ed-gap-1{gap:.25rem!important}.ed-gap-2{gap:.5rem!important}.ed-gap-2\\.5{gap:.625rem!important}.ed-gap-3{gap:.75rem!important}.ed-gap-4{gap:1rem!important}.ed-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0 !important;margin-right:calc(.5rem * var(--tw-space-x-reverse))!important;margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))!important}.ed-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.5rem * var(--tw-space-y-reverse))!important}.ed-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(.75rem * var(--tw-space-y-reverse))!important}.ed-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(1rem * var(--tw-space-y-reverse))!important}.ed-space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0 !important;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)))!important;margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))!important}.ed-overflow-hidden{overflow:hidden!important}.ed-overflow-x-auto{overflow-x:auto!important}.ed-overflow-y-auto{overflow-y:auto!important}.ed-truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.ed-whitespace-nowrap{white-space:nowrap!important}.ed-whitespace-pre-line{white-space:pre-line!important}.ed-break-words{overflow-wrap:break-word!important}.\\!ed-rounded,.ed-rounded{border-radius:.25rem!important}.ed-rounded-3xl{border-radius:1.5rem!important}.ed-rounded-\\[10px\\]{border-radius:10px!important}.ed-rounded-\\[20px\\]{border-radius:20px!important}.ed-rounded-\\[5px\\]{border-radius:5px!important}.ed-rounded-\\[7px\\]{border-radius:7px!important}.ed-rounded-\\[8px\\]{border-radius:8px!important}.ed-rounded-full{border-radius:9999px!important}.ed-rounded-lg{border-radius:.5rem!important}.ed-rounded-md{border-radius:.375rem!important}.ed-rounded-b-\\[10px\\]{border-bottom-right-radius:10px!important;border-bottom-left-radius:10px!important}.ed-rounded-l-lg{border-top-left-radius:.5rem!important;border-bottom-left-radius:.5rem!important}.ed-rounded-r-lg{border-top-right-radius:.5rem!important;border-bottom-right-radius:.5rem!important}.ed-rounded-t-\\[10px\\]{border-top-left-radius:10px!important;border-top-right-radius:10px!important}.ed-rounded-t-xl{border-top-left-radius:.75rem!important;border-top-right-radius:.75rem!important}.ed-border{border-width:1px!important}.ed-border-0{border-width:0px!important}.ed-border-2{border-width:2px!important}.ed-border-4{border-width:4px!important}.ed-border-b{border-bottom-width:1px!important}.ed-border-l{border-left-width:1px!important}.ed-border-t{border-top-width:1px!important}.ed-border-solid{border-style:solid!important}.ed-border-dashed{border-style:dashed!important}.ed-border-\\[\\#8F99AD\\]{--tw-border-opacity: 1 !important;border-color:rgb(143 153 173 / var(--tw-border-opacity, 1))!important}.ed-border-\\[\\#96D4AB\\]{--tw-border-opacity: 1 !important;border-color:rgb(150 212 171 / var(--tw-border-opacity, 1))!important}.ed-border-\\[\\#A4D1F1\\]{--tw-border-opacity: 1 !important;border-color:rgb(164 209 241 / var(--tw-border-opacity, 1))!important}.ed-border-blue-100{--tw-border-opacity: 1 !important;border-color:rgb(219 234 254 / var(--tw-border-opacity, 1))!important}.ed-border-border-dark{--tw-border-opacity: 1 !important;border-color:rgb(59 59 59 / var(--tw-border-opacity, 1))!important}.ed-border-border-light{--tw-border-opacity: 1 !important;border-color:rgb(216 224 237 / var(--tw-border-opacity, 1))!important}.ed-border-brand{border-color:var(--ed-brand-color)!important}.ed-border-disabled{--tw-border-opacity: 1 !important;border-color:rgb(248 249 251 / var(--tw-border-opacity, 1))!important}.ed-border-gray{--tw-border-opacity: 1 !important;border-color:rgb(216 224 237 / var(--tw-border-opacity, 1))!important}.ed-border-red{--tw-border-opacity: 1 !important;border-color:rgb(254 71 91 / var(--tw-border-opacity, 1))!important}.ed-border-regular{--tw-border-opacity: 1 !important;border-color:rgb(92 93 118 / var(--tw-border-opacity, 1))!important}.ed-border-x-transparent{border-left-color:transparent!important;border-right-color:transparent!important}.ed-border-y-transparent{border-top-color:transparent!important;border-bottom-color:transparent!important}.ed-border-b-transparent{border-bottom-color:transparent!important}.ed-border-l-transparent{border-left-color:transparent!important}.ed-border-r-transparent{border-right-color:transparent!important}.ed-border-t-transparent{border-top-color:transparent!important}.ed-bg-\\[\\#DBF8E2\\]{--tw-bg-opacity: 1 !important;background-color:rgb(219 248 226 / var(--tw-bg-opacity, 1))!important}.ed-bg-\\[\\#DDF2FF\\]{--tw-bg-opacity: 1 !important;background-color:rgb(221 242 255 / var(--tw-bg-opacity, 1))!important}.ed-bg-black\\/15{background-color:#00000026!important}.ed-bg-black\\/50{background-color:#00000080!important}.ed-bg-black\\/70{background-color:#000000b3!important}.ed-bg-black\\/80{background-color:#000c!important}.ed-bg-blue-50{--tw-bg-opacity: 1 !important;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))!important}.ed-bg-blue-light{--tw-bg-opacity: 1 !important;background-color:rgb(227 242 253 / var(--tw-bg-opacity, 1))!important}.ed-bg-border{--tw-bg-opacity: 1 !important;background-color:rgb(183 183 183 / var(--tw-bg-opacity, 1))!important}.ed-bg-border-dark{--tw-bg-opacity: 1 !important;background-color:rgb(59 59 59 / var(--tw-bg-opacity, 1))!important}.ed-bg-brand{background-color:var(--ed-brand-color)!important}.ed-bg-brand-light{--tw-bg-opacity: 1 !important;background-color:rgb(230 246 252 / var(--tw-bg-opacity, 1))!important}.ed-bg-gray{--tw-bg-opacity: 1 !important;background-color:rgb(243 244 248 / var(--tw-bg-opacity, 1))!important}.ed-bg-gray-900{--tw-bg-opacity: 1 !important;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))!important}.ed-bg-gray-deep{--tw-bg-opacity: 1 !important;background-color:rgb(143 153 173 / var(--tw-bg-opacity, 1))!important}.ed-bg-gray-light{--tw-bg-opacity: 1 !important;background-color:rgb(238 240 243 / var(--tw-bg-opacity, 1))!important}.ed-bg-green{--tw-bg-opacity: 1 !important;background-color:rgb(12 170 27 / var(--tw-bg-opacity, 1))!important}.ed-bg-red{--tw-bg-opacity: 1 !important;background-color:rgb(254 71 91 / var(--tw-bg-opacity, 1))!important}.ed-bg-transparent{background-color:transparent!important}.ed-bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))!important}.ed-bg-white-light{--tw-bg-opacity: 1 !important;background-color:rgb(250 251 252 / var(--tw-bg-opacity, 1))!important}.ed-bg-white\\/30{background-color:#ffffff4d!important}.ed-bg-yellow{--tw-bg-opacity: 1 !important;background-color:rgb(255 171 0 / var(--tw-bg-opacity, 1))!important}.ed-bg-none{background-image:none!important}.ed-fill-border-regular{fill:#797979!important}.ed-fill-brand{fill:var(--ed-brand-color)!important}.ed-fill-white{fill:#fff!important}.ed-stroke-border-regular{stroke:#797979!important}.ed-stroke-brand{stroke:var(--ed-brand-color)!important}.ed-object-contain{-o-object-fit:contain!important;object-fit:contain!important}.ed-object-cover{-o-object-fit:cover!important;object-fit:cover!important}.ed-p-0{padding:0!important}.ed-p-1{padding:.25rem!important}.ed-p-1\\.5{padding:.375rem!important}.ed-p-2{padding:.5rem!important}.ed-p-2\\.5{padding:.625rem!important}.ed-p-3{padding:.75rem!important}.ed-p-4{padding:1rem!important}.ed-p-5{padding:1.25rem!important}.ed-px-1{padding-left:.25rem!important;padding-right:.25rem!important}.ed-px-2{padding-left:.5rem!important;padding-right:.5rem!important}.ed-px-2\\.5{padding-left:.625rem!important;padding-right:.625rem!important}.ed-px-3{padding-left:.75rem!important;padding-right:.75rem!important}.ed-px-4{padding-left:1rem!important;padding-right:1rem!important}.ed-px-5{padding-left:1.25rem!important;padding-right:1.25rem!important}.ed-px-6{padding-left:1.5rem!important;padding-right:1.5rem!important}.ed-px-7{padding-left:1.75rem!important;padding-right:1.75rem!important}.ed-px-9{padding-left:2.25rem!important;padding-right:2.25rem!important}.ed-px-\\[25px\\]{padding-left:25px!important;padding-right:25px!important}.ed-py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.ed-py-1\\.5{padding-top:.375rem!important;padding-bottom:.375rem!important}.ed-py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.ed-py-2\\.5{padding-top:.625rem!important;padding-bottom:.625rem!important}.ed-py-3{padding-top:.75rem!important;padding-bottom:.75rem!important}.ed-py-4{padding-top:1rem!important;padding-bottom:1rem!important}.ed-py-5{padding-top:1.25rem!important;padding-bottom:1.25rem!important}.ed-py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.ed-py-8{padding-top:2rem!important;padding-bottom:2rem!important}.ed-py-\\[9px\\]{padding-top:9px!important;padding-bottom:9px!important}.ed-pb-1{padding-bottom:.25rem!important}.ed-pb-2{padding-bottom:.5rem!important}.ed-pb-5{padding-bottom:1.25rem!important}.ed-pb-6{padding-bottom:1.5rem!important}.ed-pl-16{padding-left:4rem!important}.ed-pl-2{padding-left:.5rem!important}.ed-pl-4{padding-left:1rem!important}.ed-pr-6{padding-right:1.5rem!important}.ed-pt-1{padding-top:.25rem!important}.ed-pt-16{padding-top:4rem!important}.ed-pt-2\\.5{padding-top:.625rem!important}.ed-pt-3{padding-top:.75rem!important}.ed-pt-5{padding-top:1.25rem!important}.ed-pt-6{padding-top:1.5rem!important}.ed-text-left{text-align:left!important}.ed-text-center{text-align:center!important}.ed-text-10{font-size:10px!important}.ed-text-12{font-size:12px!important}.ed-text-14{font-size:14px!important}.ed-text-16{font-size:16px!important}.ed-text-18{font-size:18px!important}.ed-text-24{font-size:24px!important}.ed-text-\\[13px\\]{font-size:13px!important}.ed-text-sm{font-size:.875rem!important;line-height:1.25rem!important}.ed-font-bold{font-weight:700!important}.ed-font-medium{font-weight:500!important}.ed-font-normal{font-weight:400!important}.ed-font-semibold{font-weight:600!important}.ed-lowercase{text-transform:lowercase!important}.ed-leading-\\[21px\\]{line-height:21px!important}.ed-leading-none{line-height:1!important}.ed-text-\\[\\#0E9342\\]{--tw-text-opacity: 1 !important;color:rgb(14 147 66 / var(--tw-text-opacity, 1))!important}.ed-text-\\[\\#1173C8\\]{--tw-text-opacity: 1 !important;color:rgb(17 115 200 / var(--tw-text-opacity, 1))!important}.ed-text-blue-600{--tw-text-opacity: 1 !important;color:rgb(37 99 235 / var(--tw-text-opacity, 1))!important}.ed-text-border{--tw-text-opacity: 1 !important;color:rgb(183 183 183 / var(--tw-text-opacity, 1))!important}.ed-text-border-dark{--tw-text-opacity: 1 !important;color:rgb(59 59 59 / var(--tw-text-opacity, 1))!important}.ed-text-border-regular{--tw-text-opacity: 1 !important;color:rgb(121 121 121 / var(--tw-text-opacity, 1))!important}.ed-text-brand{color:var(--ed-brand-color)!important}.ed-text-brand-link{--tw-text-opacity: 1 !important;color:rgb(0 78 146 / var(--tw-text-opacity, 1))!important}.ed-text-dark{--tw-text-opacity: 1 !important;color:rgb(33 33 78 / var(--tw-text-opacity, 1))!important}.ed-text-gray-500{--tw-text-opacity: 1 !important;color:rgb(107 114 128 / var(--tw-text-opacity, 1))!important}.ed-text-gray-900{--tw-text-opacity: 1 !important;color:rgb(17 24 39 / var(--tw-text-opacity, 1))!important}.ed-text-red{--tw-text-opacity: 1 !important;color:rgb(254 71 91 / var(--tw-text-opacity, 1))!important}.ed-text-regular{--tw-text-opacity: 1 !important;color:rgb(92 93 118 / var(--tw-text-opacity, 1))!important}.ed-text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity, 1))!important}.ed-underline{text-decoration-line:underline!important}.ed-opacity-0{opacity:0!important}.ed-opacity-100{opacity:1!important}.ed-opacity-25{opacity:.25!important}.ed-opacity-50{opacity:.5!important}.ed-opacity-75{opacity:.75!important}.ed-shadow-\\[0_-4px_50px_rgba\\(0\\,0\\,0\\,0\\.2\\)\\]{--tw-shadow: 0 -4px 50px rgba(0,0,0,.2) !important;--tw-shadow-colored: 0 -4px 50px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.ed-shadow-\\[0_-8px_10px_rgba\\(0\\,0\\,0\\,0\\.02\\)\\]{--tw-shadow: 0 -8px 10px rgba(0,0,0,.02) !important;--tw-shadow-colored: 0 -8px 10px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.ed-shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.ed-outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.ed-transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.ed-transition-all{transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.ed-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.ed-transition-opacity{transition-property:opacity!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.ed-transition-transform{transition-property:transform!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.ed-delay-150{transition-delay:.15s!important}.ed-delay-75{transition-delay:75ms!important}.ed-duration-200{transition-duration:.2s!important}.ed-duration-300{transition-duration:.3s!important}.ed-duration-500{transition-duration:.5s!important}.ed-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)!important}:root{--ed-brand-color: #00a1e0;--ed-brand-link-color: #004e92;--ed-border-light: #d8e0ed;--ed-border: #b7b7b7;--ed-font-montserrat: "Montserrat";--ed-main-font: "Poppins"}.ed-scope{font-family:var(--ed-main-font)}.ed-scope .btn_hover_color{position:relative}.ed-scope .btn_hover_color:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:inherit;transition:.3s ease}.ed-scope .btn_hover_color:hover:before{background:#0003}.ed-no-scrollbar::-webkit-scrollbar{display:none}.ed-no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.ed-scope .ant-tooltip{z-index:9999999!important}.ed-scope .ant-tooltip-inner{size:12px!important;font-weight:500!important;color:#b7b7b7!important;font-family:var(--font-montserrat);background-color:#fff!important;box-shadow:0 0 15px #0000000f}.ed-scope .ant-tooltip-arrow{display:none!important}.ed-article-group:hover .ed-article-title{text-decoration:underline}.ed-article-group:hover .ed-external-icon{opacity:1;transition:opacity .3s ease-in-out}.ed-category-card:hover{box-shadow:0 0 15px #0000000f}.ed-category-card:hover .ed-category-title{color:var(--ed-brand-link-color)}.ed-category-card:hover .ed-category-desc{color:#3b3b3b}.ed-category-card:hover .ed-category-count{color:#797979}.ed-category-card:hover .ed-chevron-wrapper{opacity:1;transform:translate(.5rem);transition:all .3s ease}.ed-article-button:hover{background-color:#fafbfc}.ed-article-button:hover .ed-article-title{color:var(--ed-brand-link-color)}.ed-article-button:hover .ed-chevron-wrapper{opacity:1;transform:translate(.5rem);transition:all .3s ease}.ed-article-row-button:hover{background-color:#fafbfc}.ed-article-row-button:hover .ed-article-title{color:var(--ed-brand-link-color)}.ed-article-row-button:hover .ed-chevron-wrapper{opacity:1;transform:translate(.5rem);transition:opacity .3s ease,transform .3s ease}.ed-custom-children{display:none;transition:all;transition-duration:.5s}.ed-custom-wrapper:hover .ed-custom-children{display:block}.placeholder\\:ed-text-14::-moz-placeholder{font-size:14px!important}.placeholder\\:ed-text-14::placeholder{font-size:14px!important}.placeholder\\:ed-text-16::-moz-placeholder{font-size:16px!important}.placeholder\\:ed-text-16::placeholder{font-size:16px!important}.placeholder\\:ed-font-medium::-moz-placeholder{font-weight:500!important}.placeholder\\:ed-font-medium::placeholder{font-weight:500!important}.placeholder\\:ed-leading-\\[21px\\]::-moz-placeholder{line-height:21px!important}.placeholder\\:ed-leading-\\[21px\\]::placeholder{line-height:21px!important}.placeholder\\:ed-text-border::-moz-placeholder{--tw-text-opacity: 1 !important;color:rgb(183 183 183 / var(--tw-text-opacity, 1))!important}.placeholder\\:ed-text-border::placeholder{--tw-text-opacity: 1 !important;color:rgb(183 183 183 / var(--tw-text-opacity, 1))!important}.placeholder\\:ed-text-border-regular::-moz-placeholder{--tw-text-opacity: 1 !important;color:rgb(121 121 121 / var(--tw-text-opacity, 1))!important}.placeholder\\:ed-text-border-regular::placeholder{--tw-text-opacity: 1 !important;color:rgb(121 121 121 / var(--tw-text-opacity, 1))!important}.hover\\:ed-size-14:hover{width:3.5rem!important;height:3.5rem!important}.hover\\:ed-scale-110:hover{--tw-scale-x: 1.1 !important;--tw-scale-y: 1.1 !important;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))!important}.hover\\:ed-border-border-dark:hover{--tw-border-opacity: 1 !important;border-color:rgb(59 59 59 / var(--tw-border-opacity, 1))!important}.hover\\:ed-border-brand:hover{border-color:var(--ed-brand-color)!important}.hover\\:ed-bg-dark\\/15:hover{background-color:#21214e26!important}.hover\\:ed-bg-gray-50:hover{--tw-bg-opacity: 1 !important;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))!important}.hover\\:ed-bg-white-light:hover{--tw-bg-opacity: 1 !important;background-color:rgb(250 251 252 / var(--tw-bg-opacity, 1))!important}.hover\\:ed-text-border-dark:hover{--tw-text-opacity: 1 !important;color:rgb(59 59 59 / var(--tw-text-opacity, 1))!important}.hover\\:ed-opacity-90:hover{opacity:.9!important}.focus\\:ed-border-brand:focus{border-color:var(--ed-brand-color)!important}.focus\\:ed-outline-none:focus{outline:2px solid transparent!important;outline-offset:2px!important}.disabled\\:ed-cursor-not-allowed:disabled{cursor:not-allowed!important}.disabled\\:ed-bg-brand:disabled{background-color:var(--ed-brand-color)!important}.disabled\\:ed-opacity-50:disabled{opacity:.5!important}.ed-group:hover .group-hover\\:ed-text-brand{color:var(--ed-brand-color)!important}.ed-tiptap{--ghq-checklist-bg-color: rgba(15, 22, 36, .05);--ghq-checklist-bg-active-color: rgba(29, 30, 32, .98);--ghq-checklist-border-color: rgba(37, 39, 45, .1);--ghq-checklist-border-active-color: rgba(29, 30, 32, .98);--ghq-checklist-check-icon-color: rgba(255, 255, 255, 1);--ghq-checklist-text-active: rgba(52, 55, 60, .64)}.dark .ed-tiptap{--ghq-checklist-bg-color: rgba(231, 231, 243, .07);--ghq-checklist-bg-active-color: rgba(255, 255, 255, .96);--ghq-checklist-border-color: rgba(238, 238, 246, .11);--ghq-checklist-border-active-color: rgba(255, 255, 255, .96);--ghq-checklist-check-icon-color: rgba(0, 0, 0, 1);--ghq-checklist-text-active: rgba(251, 251, 254, .75)}.ed-tiptap:first-child{margin-top:0}.ed-tiptap table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}.ed-tiptap table td,.ed-tiptap table th{border:1px solid rgba(61,37,20,.12);box-sizing:border-box;min-width:1em;padding:6px 8px;position:relative;vertical-align:top}.ed-tiptap table td>*,.ed-tiptap table th>*{margin-bottom:0}.ed-tiptap table th{background-color:#3d25140d;font-weight:700;text-align:left}.ed-tiptap table th[data-background-color]{background-color:inherit}.ed-tiptap table .selectedCell:after{background:#3d251414;content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.ed-tiptap table .column-resize-handle{background-color:var(--brand-color);bottom:-2px;pointer-events:none;position:absolute;right:-2px;top:0;width:4px}.ed-tiptap .tableWrapper{margin:1.5rem 0;overflow-x:auto}.ed-tiptap.resize-cursor{cursor:ew-resize;cursor:col-resize}.ed-tiptap ol,.ed-tiptap ul{margin-top:1.5em;margin-bottom:1.5em;padding-left:1.5em}.ed-tiptap ol:first-child,.ed-tiptap ul:first-child{margin-top:0}.ed-tiptap ol:last-child,.ed-tiptap ul:last-child{margin-bottom:0}.ed-tiptap ol ol,.ed-tiptap ol ul,.ed-tiptap ul ol,.ed-tiptap ul ul{margin-top:0;margin-bottom:0}.ed-tiptap li p{margin-top:0;line-height:1.6}.ed-tiptap ol{list-style:decimal}.ed-tiptap ol ol{list-style:lower-alpha}.ed-tiptap ol ol ol{list-style:lower-roman}.ed-tiptap ul:not([data-type=taskList]){list-style:disc}.ed-tiptap ul:not([data-type=taskList]) ul{list-style:square}.ed-tiptap ul:not([data-type=taskList]) ul ul{list-style:square}.ed-tiptap ul[data-type=taskList]{padding-left:.25em}.ed-tiptap ul[data-type=taskList] li{display:flex;flex-direction:row;align-items:flex-start}.ed-tiptap ul[data-type=taskList] li:not(:has(>p:first-child)){list-style-type:none}.ed-tiptap ul[data-type=taskList] li[data-checked=true]>div>p{opacity:.5;text-decoration:line-through}.ed-tiptap ul[data-type=taskList] li[data-checked=true]>div>p span{text-decoration:line-through}.ed-tiptap ul[data-type=taskList] li label{position:relative;padding-top:.375rem;padding-right:.5rem}.ed-tiptap ul[data-type=taskList] li label input[type=checkbox]{position:absolute;opacity:0;width:0;height:0}.ed-tiptap ul[data-type=taskList] li label span{display:block;width:1em;height:1em;border:1px solid var(--ghq-checklist-border-color);border-radius:var(--ghq-radius-xs, .25rem);position:relative;cursor:pointer;background-color:var(--ghq-checklist-bg-color);transition:background-color 80ms ease-out,border-color 80ms ease-out}.ed-tiptap ul[data-type=taskList] li label span:before{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:.75em;height:.75em;background-color:var(--ghq-checklist-check-icon-color);opacity:0;-webkit-mask:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000/svg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E) center/contain no-repeat;mask:url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000/svg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E) center/contain no-repeat}.ed-tiptap ul[data-type=taskList] li label input[type=checkbox]:checked+span{background:var(--ghq-checklist-bg-active-color);border-color:var(--ghq-checklist-border-active-color)}.ed-tiptap ul[data-type=taskList] li label input[type=checkbox]:checked+span:before{opacity:1}.ed-tiptap ul[data-type=taskList] li div{flex:1 1 0%;min-width:0}.ed-tiptap.ProseMirror blockquote{position:relative;padding-left:1em;padding-top:.375em;padding-bottom:.375em;margin:1.5rem 0}.ed-tiptap.ProseMirror blockquote p{margin-top:0}.ed-tiptap.ProseMirror blockquote:before,.ed-tiptap.ProseMirror blockquote.is-empty:before{position:absolute;bottom:0;left:0;top:0;height:100%;width:.25em;background-color:#222325;content:"";border-radius:0}.ed-tiptap.ProseMirror code{background-color:#0f16240d;color:#404145;border:1px solid rgba(37,39,45,.1);font-family:JetBrains Mono NL,monospace;font-size:.875em;line-height:1.4;border-radius:6px;padding:.1em .2em}.ed-tiptap.ProseMirror pre{background-color:#3838380a;color:#2c2d30;border:1px solid rgba(37,39,45,.1);margin-top:1.5em;margin-bottom:1.5em;padding:1em;font-size:1rem;border-radius:6px}.ed-tiptap.ProseMirror pre code{background-color:transparent;border:none;border-radius:0;-webkit-text-fill-color:inherit;color:inherit}.ed-tiptap.ProseMirror h1,.ed-tiptap.ProseMirror h2,.ed-tiptap.ProseMirror h3,.ed-tiptap.ProseMirror h4{position:relative;color:inherit;font-style:inherit}.ed-tiptap.ProseMirror h1:first-child,.ed-tiptap.ProseMirror h2:first-child,.ed-tiptap.ProseMirror h3:first-child,.ed-tiptap.ProseMirror h4:first-child{margin-top:0}.ed-tiptap.ProseMirror h1{font-size:1.5em;font-weight:700}.ed-tiptap.ProseMirror h2{font-size:1.25em;font-weight:700}.ed-tiptap.ProseMirror h3{font-size:1.125em;font-weight:600}.ed-tiptap.ProseMirror h4{font-size:1em;font-weight:600}.ed-tiptap.ProseMirror hr{border:none;height:1px;background-color:#25272d1a}.ed-tiptap.ProseMirror [data-type=horizontalRule]{margin-top:2.25em;margin-bottom:2.25em;padding-top:.75rem;padding-bottom:.75rem}.ed-tiptap.ProseMirror>*{position:relative}.ed-tiptap.ProseMirror p{font-size:1rem;line-height:1.25;font-weight:400}.ed-tiptap.ProseMirror span{font-size:inherit}.ed-tiptap.ProseMirror a{color:var(--brand-color)!important}.ed-tiptap.ProseMirror a{color:var(--brand-color);text-decoration:underline}.ed-tiptap.ProseMirror s,.ed-tiptap.ProseMirror s span{text-decoration:line-through}.ed-tiptap.ProseMirror u,.ed-tiptap.ProseMirror u span{text-decoration:underline}.ed-tiptap.ProseMirror [data-type=emoji] img{display:inline-block;width:1.25em;height:1.25em;cursor:text}.ed-tiptap.ProseMirror [data-type=mention]{display:inline-block}.ed-tiptap.ProseMirror .ed-tiptap-thread.ed-tiptap-thread--unresolved.ed-tiptap-thread--inline{transition:color .2s ease-in-out,background-color .2s ease-in-out;color:#34373c;border-bottom:2px dashed #fcd34d;font-weight:600}.ed-tiptap.ProseMirror .ed-tiptap-thread.ed-tiptap-thread--unresolved.ed-tiptap-thread--block:not(:has(img)){border-radius:.25rem;border-bottom:.125rem dashed #fcd34d;padding-bottom:.5rem;outline:.25rem solid transparent}.ed-tiptap.ProseMirror .ed-tiptap-thread.ed-tiptap-thread--resolved.ed-tiptap-thread--inline.ed-tiptap-thread--selected{background-color:#fcd34d;border-color:transparent;opacity:.5}.ed-tiptap.ProseMirror p.is-empty:first-child:before{color:#adb5bd;content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ed-tiptap.ProseMirror .prosemirror-dropcursor-block,.ed-tiptap.ProseMirror .prosemirror-dropcursor-inline{background:var(--brand-color);border-radius:.25rem;margin-left:-1px;margin-right:-1px;width:100%;height:.188rem;cursor:grabbing}.ed-tiptap.ProseMirror span:has(>span>.node-image .image-component img){width:auto!important;height:auto!important}.ed-tiptap.ProseMirror .image-component img{max-width:340px!important;width:auto!important;height:auto!important;-o-object-fit:contain!important;object-fit:contain!important}')),document.head.appendChild(t)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
-
(function(Ln,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react"),require("react/jsx-runtime"),require("react-dom/client"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-dom/client","react-dom"],O):(Ln=typeof globalThis<"u"?globalThis:Ln||self,O(Ln.EasyDeskChatWidget={},Ln.React,Ln.ReactJsxRuntime,Ln.ReactDOMClient,Ln.ReactDOM))})(this,(function(Ln,O,E,U2,es){"use strict";var O$=Object.defineProperty;var N$=(Ln,O,E)=>O in Ln?O$(Ln,O,{enumerable:!0,configurable:!0,writable:!0,value:E}):Ln[O]=E;var se=(Ln,O,E)=>N$(Ln,typeof O!="symbol"?O+"":O,E);var Qx;function a3(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const I=a3(O),B2=!1;function Ai(e){try{return e()}catch{}}const Zh=Ai(()=>globalThis)||Ai(()=>window)||Ai(()=>self)||Ai(()=>global)||Ai(function(){return Ai.constructor("return this")()}),Kh="4.2.
|
|
2
|
+
(function(Ln,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react"),require("react/jsx-runtime"),require("react-dom/client"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-dom/client","react-dom"],O):(Ln=typeof globalThis<"u"?globalThis:Ln||self,O(Ln.EasyDeskChatWidget={},Ln.React,Ln.ReactJsxRuntime,Ln.ReactDOMClient,Ln.ReactDOM))})(this,(function(Ln,O,E,U2,es){"use strict";var O$=Object.defineProperty;var N$=(Ln,O,E)=>O in Ln?O$(Ln,O,{enumerable:!0,configurable:!0,writable:!0,value:E}):Ln[O]=E;var se=(Ln,O,E)=>N$(Ln,typeof O!="symbol"?O+"":O,E);var Qx;function a3(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const I=a3(O),B2=!1;function Ai(e){try{return e()}catch{}}const Zh=Ai(()=>globalThis)||Ai(()=>window)||Ai(()=>self)||Ai(()=>global)||Ai(function(){return Ai.constructor("return this")()}),Kh="4.2.5",z2=new Map;function H2(e){const t=z2.get(e)||1;return z2.set(e,t+1),`${e}:${t}:${Math.random().toString(36).slice(2)}`}function s3(e,t=0){const n=H2("stringifyForDisplay");return JSON.stringify(e,(r,i)=>i===void 0?n:i,t).split(JSON.stringify(n)).join("<undefined>")}const W2="Invariant Violation";class Qh extends Error{constructor(t=W2){super(t),this.name=W2,Object.setPrototypeOf(this,Qh.prototype)}}const G2=["debug","log","warn","error","silent"];let l3=G2.indexOf("silent");function at(e,...t){if(!e)throw si(...t)}function _u(e){return function(t,...n){if(G2.indexOf(e)>=l3){const r=console[e]||console.log;if(typeof t=="number"){const i=t;t=Z2(i),t||(t=K2(i,n),n=[])}r(t,...n)}}}at.debug=_u("debug"),at.log=_u("log"),at.warn=_u("warn"),at.error=_u("error");function si(e,...t){return new Qh(Z2(e,t)||K2(e,t))}const Y2=Symbol.for("ApolloErrorMessageHandler_"+Kh);function Jh(e){if(typeof e=="string")return e;try{return s3(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Z2(e,t=[]){if(e)return Zh[Y2]&&Zh[Y2](e,t.map(Jh))}function K2(e,t=[]){if(e)return typeof e=="string"?t.reduce((n,r)=>n.replace(/%[sdfo]/,Jh(r)),e):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:Kh,message:e,args:t.map(Jh)}))}`}const Q2=Symbol.for("__APOLLO_CONTEXT__");function qh(){at("createContext"in I,37);let e=I.createContext[Q2];return e||(Object.defineProperty(I.createContext,Q2,{value:e=I.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}const c3=({client:e,children:t})=>{const n=qh(),r=I.useContext(n),i=I.useMemo(()=>({...r,client:e||r.client}),[r,e]);return at(i.client,38),I.createElement(n.Provider,{value:i},t)};function ma(e){const t=I.useContext(qh()),n=e||t.client;return at(!!n,28),n}const{toString:J2,hasOwnProperty:u3}=Object.prototype,q2=Function.prototype.toString,Xh=new Map;function pt(e,t){try{return $h(e,t)}finally{Xh.clear()}}function $h(e,t){if(e===t)return!0;const n=J2.call(e),r=J2.call(t);if(n!==r)return!1;switch(n){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if($2(e,t))return!0;const i=X2(e),o=X2(t),a=i.length;if(a!==o.length)return!1;for(let s=0;s<a;++s)if(!u3.call(t,i[s]))return!1;for(let s=0;s<a;++s){const c=i[s];if(!$h(e[c],t[c]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if($2(e,t))return!0;const i=e.entries(),o=n==="[object Map]";for(;;){const a=i.next();if(a.done)break;const[s,c]=a.value;if(!t.has(s)||o&&!$h(c,t.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=q2.call(e);return i!==q2.call(t)?!1:!h3(i,f3)}}return!1}function X2(e){return Object.keys(e).filter(d3,e)}function d3(e){return this[e]!==void 0}const f3="{ [native code] }";function h3(e,t){const n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n}function $2(e,t){let n=Xh.get(e);if(n){if(n.has(t))return!0}else Xh.set(e,n=new Set);return n.add(t),!1}function p3(e,t){if(!!!e)throw new Error(t)}const eb={Name:[],Document:["definitions"],OperationDefinition:["description","name","variableDefinitions","directives","selectionSet"],VariableDefinition:["description","variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["description","name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","directives","locations"],SchemaExtension:["directives","operationTypes"],DirectiveExtension:["name","directives"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"],TypeCoordinate:["name"],MemberCoordinate:["name","memberName"],ArgumentCoordinate:["name","fieldName","argumentName"],DirectiveCoordinate:["name"],DirectiveArgumentCoordinate:["name","argumentName"]},m3=new Set(Object.keys(eb));function tb(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&m3.has(t)}var ga;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(ga||(ga={}));var xt;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.DIRECTIVE_EXTENSION="DirectiveExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension",e.TYPE_COORDINATE="TypeCoordinate",e.MEMBER_COORDINATE="MemberCoordinate",e.ARGUMENT_COORDINATE="ArgumentCoordinate",e.DIRECTIVE_COORDINATE="DirectiveCoordinate",e.DIRECTIVE_ARGUMENT_COORDINATE="DirectiveArgumentCoordinate"})(xt||(xt={}));function nb(e){return e===9||e===32}function g3(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,o=r.length>1&&r.slice(1).every(m=>m.length===0||nb(m.charCodeAt(0))),a=n.endsWith('\\"""'),s=e.endsWith('"')&&!a,c=e.endsWith("\\"),u=s||c,d=!i||e.length>70||u||o||a;let h="";const p=i&&nb(e.charCodeAt(0));return(d&&!p||o)&&(h+=`
|
|
3
3
|
`),h+=n,(d||u)&&(h+=`
|
|
4
4
|
`),'"""'+h+'"""'}const v3=10,rb=2;function y3(e){return xu(e,[])}function xu(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return b3(e,t);default:return String(e)}}function b3(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(E3(e)){const r=e.toJSON();if(r!==e)return typeof r=="string"?r:xu(r,n)}else if(Array.isArray(e))return C3(e,n);return S3(e,n)}function E3(e){return typeof e.toJSON=="function"}function S3(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>rb?"["+w3(e)+"]":"{ "+n.map(([i,o])=>i+": "+xu(o,t)).join(", ")+" }"}function C3(e,t){if(e.length===0)return"[]";if(t.length>rb)return"[Array]";const n=Math.min(v3,e.length),r=e.length-n,i=[];for(let o=0;o<n;++o)i.push(xu(e[o],t));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function w3(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}function _3(e){return`"${e.replace(x3,A3)}"`}const x3=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function A3(e){return k3[e.charCodeAt(0)]}const k3=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],ep=Object.freeze({});function Ki(e,t,n=eb){const r=new Map;for(const S of Object.values(xt))r.set(S,T3(t,S));let i,o=Array.isArray(e),a=[e],s=-1,c=[],u=e,d,h;const p=[],m=[];do{s++;const S=s===a.length,w=S&&c.length!==0;if(S){if(d=m.length===0?void 0:p[p.length-1],u=h,h=m.pop(),w)if(o){u=u.slice();let _=0;for(const[C,k]of c){const T=C-_;k===null?(u.splice(T,1),_++):u[T]=k}}else{u={...u};for(const[_,C]of c)u[_]=C}s=i.index,a=i.keys,c=i.edits,o=i.inArray,i=i.prev}else if(h){if(d=o?s:a[s],u=h[d],u==null)continue;p.push(d)}let A;if(!Array.isArray(u)){var y,b;tb(u)||p3(!1,`Invalid AST Node: ${y3(u)}.`);const _=S?(y=r.get(u.kind))===null||y===void 0?void 0:y.leave:(b=r.get(u.kind))===null||b===void 0?void 0:b.enter;if(A=_==null?void 0:_.call(t,u,d,h,p,m),A===ep)break;if(A===!1){if(!S){p.pop();continue}}else if(A!==void 0&&(c.push([d,A]),!S))if(tb(A))u=A;else{p.pop();continue}}if(A===void 0&&w&&c.push([d,u]),S)p.pop();else{var v;i={inArray:o,index:s,keys:a,edits:c,prev:i},o=Array.isArray(u),a=o?u:(v=n[u.kind])!==null&&v!==void 0?v:[],s=-1,c=[],h&&m.push(h),h=u}}while(i!==void 0);return c.length!==0?c[c.length-1][1]:e}function T3(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function O3(e){return Ki(e,R3)}const N3=80,R3={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>Le(e.definitions,`
|
|
5
5
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
|
39
39
|
`):"",this.name="UnsubscriptionError",this.errors=n}});function ku(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Rl=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=ts(a),c=s.next();!c.done;c=s.next()){var u=c.value;u.remove(this)}}catch(b){t={error:b}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}else a.remove(this);var d=this.initialTeardown;if(dn(d))try{d()}catch(b){o=b instanceof ip?b.errors:[b]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var p=ts(h),m=p.next();!m.done;m=p.next()){var y=m.value;try{sb(y)}catch(b){o=o??[],b instanceof ip?o=rs(rs([],ns(o)),ns(b.errors)):o.push(b)}}}catch(b){r={error:b}}finally{try{m&&!m.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}}if(o)throw new ip(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)sb(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},e.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},e.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},e.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&ku(n,t)},e.prototype.remove=function(t){var n=this._finalizers;n&&ku(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),ob=Rl.EMPTY;function ab(e){return e instanceof Rl||e&&"closed"in e&&dn(e.remove)&&dn(e.add)&&dn(e.unsubscribe)}function sb(e){dn(e)?e():e.unsubscribe()}var L3={Promise:void 0},F3={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,rs([e,t],ns(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function lb(e){F3.setTimeout(function(){throw e})}function cb(){}function Tu(e){e()}var op=(function(e){li(t,e);function t(n){var r=e.call(this)||this;return r.isStopped=!1,n?(r.destination=n,ab(n)&&n.add(r)):r.destination=V3,r}return t.create=function(n,r,i){return new Pl(n,r,i)},t.prototype.next=function(n){this.isStopped||this._next(n)},t.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(n){this.destination.next(n)},t.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Rl),j3=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var n=this.partialObserver;if(n.next)try{n.next(t)}catch(r){Ou(r)}},e.prototype.error=function(t){var n=this.partialObserver;if(n.error)try{n.error(t)}catch(r){Ou(r)}else Ou(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(n){Ou(n)}},e})(),Pl=(function(e){li(t,e);function t(n,r,i){var o=e.call(this)||this,a;return dn(n)||!n?a={next:n??void 0,error:r??void 0,complete:i??void 0}:a=n,o.destination=new j3(a),o}return t})(op);function Ou(e){lb(e)}function D3(e){throw e}var V3={closed:!0,next:cb,error:D3,complete:cb},ap=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Nu(e){return e}function U3(e){return e.length===0?Nu:e.length===1?e[0]:function(n){return e.reduce(function(r,i){return i(r)},n)}}var Yt=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(t,n,r){var i=this,o=z3(t)?t:new Pl(t,n,r);return Tu(function(){var a=i,s=a.operator,c=a.source;o.add(s?s.call(o,c):c?i._subscribe(o):i._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(n){t.error(n)}},e.prototype.forEach=function(t,n){var r=this;return n=ub(n),new n(function(i,o){var a=new Pl({next:function(s){try{t(s)}catch(c){o(c),a.unsubscribe()}},error:o,complete:i});r.subscribe(a)})},e.prototype._subscribe=function(t){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(t)},e.prototype[ap]=function(){return this},e.prototype.pipe=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return U3(t)(this)},e.prototype.toPromise=function(t){var n=this;return t=ub(t),new t(function(r,i){var o;n.subscribe(function(a){return o=a},function(a){return i(a)},function(){return r(o)})})},e.create=function(t){return new e(t)},e})();function ub(e){var t;return(t=e??L3.Promise)!==null&&t!==void 0?t:Promise}function B3(e){return e&&dn(e.next)&&dn(e.error)&&dn(e.complete)}function z3(e){return e&&e instanceof op||B3(e)&&ab(e)}function H3(e){return dn(e==null?void 0:e.lift)}function Ti(e){return function(t){if(H3(t))return t.lift(function(n){try{return e(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function ho(e,t,n,r,i){return new W3(e,t,n,r,i)}var W3=(function(e){li(t,e);function t(n,r,i,o,a,s){var c=e.call(this,n)||this;return c.onFinalize=a,c.shouldUnsubscribe=s,c._next=r?function(u){try{r(u)}catch(d){n.error(d)}}:e.prototype._next,c._error=o?function(u){try{o(u)}catch(d){n.error(d)}finally{this.unsubscribe()}}:e.prototype._error,c._complete=i?function(){try{i()}catch(u){n.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,c}return t.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},t})(op),G3=rp(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),os=(function(e){li(t,e);function t(){var n=e.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return t.prototype.lift=function(n){var r=new db(this,this);return r.operator=n,r},t.prototype._throwIfClosed=function(){if(this.closed)throw new G3},t.prototype.next=function(n){var r=this;Tu(function(){var i,o;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var a=ts(r.currentObservers),s=a.next();!s.done;s=a.next()){var c=s.value;c.next(n)}}catch(u){i={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}}})},t.prototype.error=function(n){var r=this;Tu(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},t.prototype.complete=function(){var n=this;Tu(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(n){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,n)},t.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},t.prototype._innerSubscribe=function(n){var r=this,i=this,o=i.hasError,a=i.isStopped,s=i.observers;return o||a?ob:(this.currentObservers=null,s.push(n),new Rl(function(){r.currentObservers=null,ku(s,n)}))},t.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,o=r.thrownError,a=r.isStopped;i?n.error(o):a&&n.complete()},t.prototype.asObservable=function(){var n=new Yt;return n.source=this,n},t.create=function(n,r){return new db(n,r)},t})(Yt),db=(function(e){li(t,e);function t(n,r){var i=e.call(this)||this;return i.destination=n,i.source=r,i}return t.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},t.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},t.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},t.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:ob},t})(os),Y3=(function(e){li(t,e);function t(n){var r=e.call(this)||this;return r._value=n,r}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(n){var r=e.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},t.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,o=n._value;if(r)throw i;return this._throwIfClosed(),o},t.prototype.next=function(n){e.prototype.next.call(this,this._value=n)},t})(os),sp={now:function(){return(sp.delegate||Date).now()},delegate:void 0},fb=(function(e){li(t,e);function t(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=sp);var o=e.call(this)||this;return o._bufferSize=n,o._windowTime=r,o._timestampProvider=i,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=r===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,r),o}return t.prototype.next=function(n){var r=this,i=r.isStopped,o=r._buffer,a=r._infiniteTimeWindow,s=r._timestampProvider,c=r._windowTime;i||(o.push(n),!a&&o.push(s.now()+c)),this._trimBuffer(),e.prototype.next.call(this,n)},t.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,o=i._infiniteTimeWindow,a=i._buffer,s=a.slice(),c=0;c<s.length&&!n.closed;c+=o?1:2)n.next(s[c]);return this._checkFinalizedStatuses(n),r},t.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,o=n._buffer,a=n._infiniteTimeWindow,s=(a?1:2)*r;if(r<1/0&&s<o.length&&o.splice(0,o.length-s),!a){for(var c=i.now(),u=0,d=1;d<o.length&&o[d]<=c;d+=2)u=d;u&&o.splice(0,u+1)}},t})(os),Z3=(function(e){li(t,e);function t(n,r){return e.call(this)||this}return t.prototype.schedule=function(n,r){return this},t})(Rl),hb={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,rs([e,t],ns(n)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},pb=(function(e){li(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return t.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var o=this.id,a=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(a,o,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(a,this.id,r),this},t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),hb.setInterval(n.flush.bind(n,this),i)},t.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&hb.clearInterval(r)},t.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(n,r){var i=!1,o;try{this.work(n)}catch(a){i=!0,o=a||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,o=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,ku(o,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Z3),K3=1,lp,cp={};function mb(e){return e in cp?(delete cp[e],!0):!1}var gb={setImmediate:function(e){var t=K3++;return cp[t]=!0,lp||(lp=Promise.resolve()),lp.then(function(){return mb(t)&&e()}),t},clearImmediate:function(e){mb(e)}},Q3=gb.setImmediate,J3=gb.clearImmediate,vb={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Q3.apply(void 0,rs([],ns(e)))},clearImmediate:function(e){return J3(e)},delegate:void 0},q3=(function(e){li(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.scheduler=n,i.work=r,i}return t.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),i!==null&&i>0?e.prototype.requestAsyncId.call(this,n,r,i):(n.actions.push(this),n._scheduled||(n._scheduled=vb.setImmediate(n.flush.bind(n,void 0))))},t.prototype.recycleAsyncId=function(n,r,i){var o;if(i===void 0&&(i=0),i!=null?i>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,n,r,i);var a=n.actions;r!=null&&((o=a[a.length-1])===null||o===void 0?void 0:o.id)!==r&&(vb.clearImmediate(r),n._scheduled===r&&(n._scheduled=void 0))},t})(pb),yb=(function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(t,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,t).schedule(r,n)},e.now=sp.now,e})(),bb=(function(e){li(t,e);function t(n,r){r===void 0&&(r=yb.now);var i=e.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},t})(yb),X3=(function(e){li(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(n){this._active=!0;var r=this._scheduled;this._scheduled=void 0;var i=this.actions,o;n=n||i.shift();do if(o=n.execute(n.state,n.delay))break;while((n=i[0])&&n.id===r&&i.shift());if(this._active=!1,o){for(;(n=i[0])&&n.id===r&&i.shift();)n.unsubscribe();throw o}},t})(bb),$3=new X3(q3),eA=new bb(pb),tA=eA,Il=new Yt(function(e){return e.complete()});function nA(e){return e&&dn(e.schedule)}function rA(e){return e[e.length-1]}function Eb(e){return nA(rA(e))?e.pop():void 0}var Sb=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function Cb(e){return dn(e==null?void 0:e.then)}function wb(e){return dn(e[ap])}function _b(e){return Symbol.asyncIterator&&dn(e==null?void 0:e[Symbol.asyncIterator])}function xb(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function iA(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ab=iA();function kb(e){return dn(e==null?void 0:e[Ab])}function Tb(e){return I3(this,arguments,function(){var n,r,i,o;return ib(this,function(a){switch(a.label){case 0:n=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,is(n.read())];case 3:return r=a.sent(),i=r.value,o=r.done,o?[4,is(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,is(i)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function Ob(e){return dn(e==null?void 0:e.getReader)}function Lo(e){if(e instanceof Yt)return e;if(e!=null){if(wb(e))return oA(e);if(Sb(e))return aA(e);if(Cb(e))return sA(e);if(_b(e))return Nb(e);if(kb(e))return lA(e);if(Ob(e))return cA(e)}throw xb(e)}function oA(e){return new Yt(function(t){var n=e[ap]();if(dn(n.subscribe))return n.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function aA(e){return new Yt(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function sA(e){return new Yt(function(t){e.then(function(n){t.closed||(t.next(n),t.complete())},function(n){return t.error(n)}).then(null,lb)})}function lA(e){return new Yt(function(t){var n,r;try{for(var i=ts(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.next(a),t.closed)return}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function Nb(e){return new Yt(function(t){uA(e,t).catch(function(n){return t.error(n)})})}function cA(e){return Nb(Tb(e))}function uA(e,t){var n,r,i,o;return P3(this,void 0,void 0,function(){var a,s;return ib(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=M3(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(a=r.value,t.next(a),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function va(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(o),!i)return o}function up(e,t){return t===void 0&&(t=0),Ti(function(n,r){n.subscribe(ho(r,function(i){return va(r,e,function(){return r.next(i)},t)},function(){return va(r,e,function(){return r.complete()},t)},function(i){return va(r,e,function(){return r.error(i)},t)}))})}function Rb(e,t){return t===void 0&&(t=0),Ti(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function dA(e,t){return Lo(e).pipe(Rb(t),up(t))}function fA(e,t){return Lo(e).pipe(Rb(t),up(t))}function hA(e,t){return new Yt(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function pA(e,t){return new Yt(function(n){var r;return va(n,t,function(){r=e[Ab](),va(n,t,function(){var i,o,a;try{i=r.next(),o=i.value,a=i.done}catch(s){n.error(s);return}a?n.complete():n.next(o)},0,!0)}),function(){return dn(r==null?void 0:r.return)&&r.return()}})}function Pb(e,t){if(!e)throw new Error("Iterable cannot be null");return new Yt(function(n){va(n,t,function(){var r=e[Symbol.asyncIterator]();va(n,t,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function mA(e,t){return Pb(Tb(e),t)}function gA(e,t){if(e!=null){if(wb(e))return dA(e,t);if(Sb(e))return hA(e,t);if(Cb(e))return fA(e,t);if(_b(e))return Pb(e,t);if(kb(e))return pA(e,t);if(Ob(e))return mA(e,t)}throw xb(e)}function ya(e,t){return t?gA(e,t):Lo(e)}function ba(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Eb(e);return ya(e,n)}function Ib(e,t){var n=dn(e)?e:function(){return e},r=function(i){return i.error(n())};return new Yt(r)}var Mb;(function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"})(Mb||(Mb={}));var dp=(function(){function e(t,n,r){this.kind=t,this.value=n,this.error=r,this.hasValue=t==="N"}return e.prototype.observe=function(t){return vA(this,t)},e.prototype.do=function(t,n,r){var i=this,o=i.kind,a=i.value,s=i.error;return o==="N"?t==null?void 0:t(a):o==="E"?n==null?void 0:n(s):r==null?void 0:r()},e.prototype.accept=function(t,n,r){var i;return dn((i=t)===null||i===void 0?void 0:i.next)?this.observe(t):this.do(t,n,r)},e.prototype.toObservable=function(){var t=this,n=t.kind,r=t.value,i=t.error,o=n==="N"?ba(r):n==="E"?Ib(function(){return i}):n==="C"?Il:0;if(!o)throw new TypeError("Unexpected notification kind "+n);return o},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e})();function vA(e,t){var n,r,i,o=e,a=o.kind,s=o.value,c=o.error;if(typeof a!="string")throw new TypeError('Invalid notification, missing "kind"');a==="N"?(n=t.next)===null||n===void 0||n.call(t,s):a==="E"?(r=t.error)===null||r===void 0||r.call(t,c):(i=t.complete)===null||i===void 0||i.call(t)}var yA=rp(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function bA(e,t){var n=typeof t=="object";return new Promise(function(r,i){var o=!1,a;e.subscribe({next:function(s){a=s,o=!0},error:i,complete:function(){o?r(a):n?r(t.defaultValue):i(new yA)}})})}function EA(e){return e instanceof Date&&!isNaN(e)}function Fo(e,t){return Ti(function(n,r){var i=0;n.subscribe(ho(r,function(o){r.next(e.call(t,o,i++))}))})}function SA(e,t,n,r,i,o,a,s){var c=[],u=0,d=0,h=!1,p=function(){h&&!c.length&&!u&&t.complete()},m=function(b){return u<r?y(b):c.push(b)},y=function(b){u++;var v=!1;Lo(n(b,d++)).subscribe(ho(t,function(S){t.next(S)},function(){v=!0},void 0,function(){if(v)try{u--;for(var S=function(){var w=c.shift();a||y(w)};c.length&&u<r;)S();p()}catch(w){t.error(w)}}))};return e.subscribe(ho(t,m,function(){h=!0,p()})),function(){}}function as(e,t,n){return n===void 0&&(n=1/0),dn(t)?as(function(r,i){return Fo(function(o,a){return t(r,o,i,a)})(Lo(e(r,i)))},n):(typeof t=="number"&&(n=t),Ti(function(r,i){return SA(r,i,e,n)}))}function CA(e){return as(Nu,e)}function wA(){return CA(1)}function fp(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wA()(ya(e,Eb(e)))}function _A(e,t,n){return n===void 0&&(n=tA),new Yt(function(r){var i=EA(e)?+e-n.now():e;i<0&&(i=0);var o=0;return n.schedule(function(){r.closed||(r.next(o++),r.complete())},i)})}function Lb(e,t){return Ti(function(n,r){var i=0;n.subscribe(ho(r,function(o){return e.call(t,o,i++)&&r.next(o)}))})}function Ru(e){return Ti(function(t,n){var r=null,i=!1,o;r=t.subscribe(ho(n,void 0,void 0,function(a){o=Lo(e(a,Ru(e)(t))),r?(r.unsubscribe(),r=null,o.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,o.subscribe(n))})}function xA(e,t){return t===void 0&&(t=Nu),e=e??AA,Ti(function(n,r){var i,o=!0;n.subscribe(ho(r,function(a){var s=t(a);(o||!e(i,s))&&(o=!1,i=s,r.next(a))}))})}function AA(e,t){return e===t}function kA(e){return Ti(function(t,n){try{t.subscribe(n)}finally{n.add(e)}})}function TA(){return Ti(function(e,t){e.subscribe(ho(t,function(n){t.next(dp.createNext(n))},function(){t.next(dp.createComplete()),t.complete()},function(n){t.next(dp.createError(n)),t.complete()}))})}function Ml(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new os}:t,r=e.resetOnError,i=r===void 0?!0:r,o=e.resetOnComplete,a=o===void 0?!0:o,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(u){var d,h,p,m=0,y=!1,b=!1,v=function(){h==null||h.unsubscribe(),h=void 0},S=function(){v(),d=p=void 0,y=b=!1},w=function(){var A=d;S(),A==null||A.unsubscribe()};return Ti(function(A,_){m++,!b&&!y&&v();var C=p=p??n();_.add(function(){m--,m===0&&!b&&!y&&(h=hp(w,c))}),C.subscribe(_),!d&&m>0&&(d=new Pl({next:function(k){return C.next(k)},error:function(k){b=!0,v(),h=hp(S,i,k),C.error(k)},complete:function(){y=!0,v(),h=hp(S,a),C.complete()}}),Lo(A).subscribe(d))})(u)}}function hp(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(t===!0){e();return}if(t!==!1){var i=new Pl({next:function(){i.unsubscribe(),e()}});return Lo(t.apply(void 0,rs([],ns(n)))).subscribe(i)}}function pp(e,t,n){var r,i,o,a,s=!1;return e&&typeof e=="object"?(r=e.bufferSize,a=r===void 0?1/0:r,i=e.windowTime,t=i===void 0?1/0:i,o=e.refCount,s=o===void 0?!1:o,n=e.scheduler):a=e??1/0,Ml({connector:function(){return new fb(a,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function Ll(e,t,n){var r=dn(e)||t||n?{next:e,error:t,complete:n}:e;return r?Ti(function(i,o){var a;(a=r.subscribe)===null||a===void 0||a.call(r);var s=!0;i.subscribe(ho(o,function(c){var u;(u=r.next)===null||u===void 0||u.call(r,c),o.next(c)},function(){var c;s=!1,(c=r.complete)===null||c===void 0||c.call(r),o.complete()},function(c){var u;s=!1,(u=r.error)===null||u===void 0||u.call(r,c),o.error(c)},function(){var c,u;s&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(u=r.finalize)===null||u===void 0||u.call(r)}))}):Nu}function ss(e,t,n,r){if(n.kind===xt.INT||n.kind===xt.FLOAT)e[t.value]=Number(n.value);else if(n.kind===xt.BOOLEAN||n.kind===xt.STRING)e[t.value]=n.value;else if(n.kind===xt.OBJECT){const i={};n.fields.map(o=>ss(i,o.name,o.value,r)),e[t.value]=i}else if(n.kind===xt.VARIABLE){const i=(r||{})[n.name.value];e[t.value]=i}else if(n.kind===xt.LIST)e[t.value]=n.values.map(i=>{const o={};return ss(o,t,i,r),o[t.value]});else if(n.kind===xt.ENUM)e[t.value]=n.value;else if(n.kind===xt.NULL)e[t.value]=null;else throw si(19,t.value,n.kind)}function mp(e,t){if(e.arguments&&e.arguments.length){const n={};return e.arguments.forEach(({name:r,value:i})=>ss(n,r,i,t)),n}return null}const Fb=typeof Ai(()=>window.document.createElement)=="function",OA=Symbol.for("apollo.cacheSize"),po={...Zh[OA]};function ls(e,t){var n;return((n=e.definitions.find(r=>r.kind==="OperationDefinition"&&!!r.name))==null?void 0:n.name.value)??t}const NA=()=>Object.create(null),{forEach:RA,slice:jb}=Array.prototype,{hasOwnProperty:PA}=Object.prototype;class Qi{constructor(t=!0,n=NA){this.weakness=t,this.makeData=n}lookup(){return this.lookupArray(arguments)}lookupArray(t){let n=this;return RA.call(t,r=>n=n.getChildTrie(r)),PA.call(n,"data")?n.data:n.data=this.makeData(jb.call(t))}peek(){return this.peekArray(arguments)}peekArray(t){let n=this;for(let r=0,i=t.length;n&&r<i;++r){const o=n.mapFor(t[r],!1);n=o&&o.get(t[r])}return n&&n.data}remove(){return this.removeArray(arguments)}removeArray(t){let n;if(t.length){const r=t[0],i=this.mapFor(r,!1),o=i&&i.get(r);o&&(n=o.removeArray(jb.call(t,1)),!o.data&&!o.weak&&!(o.strong&&o.strong.size)&&i.delete(r))}else n=this.data,delete this.data;return n}getChildTrie(t){const n=this.mapFor(t,!0);let r=n.get(t);return r||n.set(t,r=new Qi(this.weakness,this.makeData)),r}mapFor(t,n){return this.weakness&&IA(t)?this.weak||(n?this.weak=new WeakMap:void 0):this.strong||(n?this.strong=new Map:void 0)}}function IA(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}function MA(){}class gp{constructor(t=1/0,n=MA){this.max=t,this.dispose=n,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const n=this.getNode(t);return n&&n.value}get size(){return this.map.size}getNode(t){const n=this.map.get(t);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(t,n){let r=this.getNode(t);return r?r.value=n:(r={key:t,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(t,r),r.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const n=this.map.get(t);return n?(n===this.newest&&(this.newest=n.older),n===this.oldest&&(this.oldest=n.newer),n.newer&&(n.newer.older=n.older),n.older&&(n.older.newer=n.newer),this.map.delete(t),this.dispose(n.value,t),!0):!1}}function vp(){}const LA=vp,FA=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},jA=typeof WeakMap<"u"?WeakMap:Map,DA=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:vp,unregister:vp}},VA=10024;class Pu{constructor(t=1/0,n=LA){this.max=t,this.dispose=n,this.map=new jA,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const r=this.unfinalizedNodes.values();for(let i=0;i<VA;i++){const o=r.next().value;if(!o)break;this.unfinalizedNodes.delete(o);const a=o.key;delete o.key,o.keyRef=new FA(a),this.registry.register(a,o,o)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new DA(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const n=this.getNode(t);return n&&n.value}getNode(t){const n=this.map.get(t);if(n&&n!==this.newest){const{older:r,newer:i}=n;i&&(i.older=r),r&&(r.newer=i),n.older=this.newest,n.older.newer=n,n.newer=null,this.newest=n,n===this.oldest&&(this.oldest=i)}return n}set(t,n){let r=this.getNode(t);return r?r.value=n:(r={key:t,value:n,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(t,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(t){t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.size--;const n=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,n),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),n&&this.map.delete(n)}delete(t){const n=this.map.get(t);return n?(this.deleteNode(n),!0):!1}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}const yp=new WeakSet;function Db(e){e.size<=(e.max||-1)||yp.has(e)||(yp.add(e),setTimeout(()=>{e.clean(),yp.delete(e)},100))}const bp=function(e,t){const n=new Pu(e,t);return n.set=function(r,i){const o=Pu.prototype.set.call(this,r,i);return Db(this),o},n},UA=function(e,t){const n=new gp(e,t);return n.set=function(r,i){const o=gp.prototype.set.call(this,r,i);return Db(this),o},n};function Vb(e,{max:t,makeCacheKey:n=r=>r}){const r=new Qi(!0),i=new bp(t);return(...o)=>{const a=r.lookupArray(n(o)),s=i.get(a);if(s){if(s.error)throw s.error;return s.result}const c=i.set(a,{});try{return c.result=e(...o)}catch(u){throw c.error=u,u}}}const jo=Vb((e,t)=>{at(e&&e.kind==="Document",1);const n=e.definitions.filter(r=>r.kind==="OperationDefinition");t&&at(n.length==1&&n[0].operation===t,4,t,t,n[0].operation),Ki(e,{Field(r,i,o,a){var s;if(r.alias&&(r.alias.value==="__typename"||r.alias.value.startsWith("__ac_"))&&r.alias.value!==r.name.value){let c=e,u=[];for(const d of a)c=c[d],c.kind===xt.FIELD&&u.push(((s=c.alias)==null?void 0:s.value)||c.name.value);throw u.splice(-1,1,r.name.value),si(5,r.alias.value,u.join("."),n[0].operation,ls(e,"(anonymous)"))}}})},{max:po.checkDocument||2e3});function BA(e){return e.length===0?Il:new Yt(t=>{const{length:n}=e,r=new Array(n),i=new Map;e.forEach((c,u)=>{i.has(c)||i.set(c,new Set),i.get(c).add(u)});let o=i.size,a=i.size,s;i.forEach((c,u)=>{let d=!1;const h=u.subscribe({next:p=>{c.forEach(m=>r[m]=p),d||(d=!0,a--),a||(s||(s=new Set(e.filter(m=>m.dirty))),s.delete(u),s.size||(t.next(r.slice()),s=void 0))},complete:()=>{o--,o||t.complete()},error:t.error.bind(t)});t.add(h)})})}function zr(...e){const t={};return e.forEach(n=>{n&&Reflect.ownKeys(n).forEach(r=>{const i=n[r];i!==void 0&&(t[r]=i)})}),t}function Fl(e=[]){const t={};return e.forEach(n=>{t[n.name.value]=n}),t}function rr(e){return e!==null&&typeof e=="object"}const{hasOwnProperty:zA}=Object.prototype,HA=function(e,t,n){return this.merge(e[n],t[n])},Ub=e=>isNaN(+e)?{}:[];class cs{constructor(t={}){se(this,"options");se(this,"reconciler");se(this,"isObject",rr);se(this,"pastCopies",new Set);this.options=t,this.reconciler=t.reconciler||HA}merge(t,n,r={}){const i=r.atPath;if(i!=null&&i.length){const[o,...a]=i;t===void 0&&(t=Ub(o));let s=t[o];s===void 0&&a.length&&(s=Ub(a[0]));const c=this.merge(s,n,{...r,atPath:a});return s!==c&&(t=this.shallowCopyForMerge(t),t[o]=c),t}return Array.isArray(t)&&Array.isArray(n)&&this.options.arrayMerge==="truncate"&&t.length>n.length&&(t=t.slice(0,n.length),this.pastCopies.add(t)),rr(n)&&rr(t)?(Object.keys(n).forEach(o=>{if(zA.call(t,o)){const a=t[o];if(n[o]!==a){const s=this.reconciler(t,n,o);s!==a&&(t=this.shallowCopyForMerge(t),t[o]=s)}}else t=this.shallowCopyForMerge(t),t[o]=n[o]}),t):n}shallowCopyForMerge(t){return rr(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t={__proto__:Object.getPrototypeOf(t),...t},this.pastCopies.add(t))),t}}function Ep(e){const t={},n=e&&e.variableDefinitions;return n&&n.length&&n.forEach(r=>{r.defaultValue&&ss(t,r.variable.name,r.defaultValue)}),t}function Iu(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{const n=e.name.value;if(typeof t=="function")return t(n);const r=t&&t[n];return at(r,9,n),r||null}default:return null}}function WA(e,t){let n=t;const r=[];return e.definitions.forEach(o=>{if(o.kind==="OperationDefinition")throw si(10,o.operation,o.name?` named '${o.name.value}'`:"");o.kind==="FragmentDefinition"&&r.push(o)}),typeof n>"u"&&(at(r.length===1,11,r.length),n=r[0].name.value),{...e,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}},...e.definitions]}}function GA(e){at(e.kind==="Document",6),at(e.definitions.length<=1,7);const t=e.definitions[0];return at(t.kind==="FragmentDefinition",8),t}function jl(e){return e.definitions.filter(t=>t.kind==="FragmentDefinition")}function Sp(e){jo(e);let t;for(let n of e.definitions){if(n.kind==="OperationDefinition")return n;n.kind==="FragmentDefinition"&&!t&&(t=n)}if(t)return t;throw si(12)}function mo(e){return jo(e),e.definitions.filter(t=>t.kind==="OperationDefinition")[0]}function YA(e){const t=mo(e);return at(t&&t.operation==="query",13),t}const go=Object.assign(function(t){return JSON.stringify(t,ZA)},{reset(){Dl=new UA(po.canonicalStringify||1e3)}});let Dl;go.reset();function ZA(e,t){if(t&&typeof t=="object"){const n=Object.getPrototypeOf(t);if(n===Object.prototype||n===null){const r=Object.keys(t);if(r.every(KA))return t;const i=JSON.stringify(r);let o=Dl.get(i);if(!o){r.sort();const s=JSON.stringify(r);o=Dl.get(s)||r,Dl.set(i,o),Dl.set(s,o)}const a=Object.create(n);return o.forEach(s=>{a[s]=t[s]}),a}}return t}function KA(e,t,n){return t===0||n[t-1]<=e}const QA=["connection","include","skip","client","rest","export","nonreactive","stream"];let Vl=go;const Bb=Object.assign(function(e,t,n){if(t&&n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){const i=n.connection.filter?n.connection.filter:[];i.sort();const o={};i.forEach(s=>{o[s]=t[s]});const a=Vl(o);if(a!=="{}")return`${n.connection.key}(${a})`}return n.connection.key}let r=e;if(t){const i=Vl(t);i!=="{}"&&(r+=`(${i})`)}return n&&Object.keys(n).forEach(i=>{QA.indexOf(i)===-1&&(n[i]&&Object.keys(n[i]).length?r+=`@${i}(${Vl(n[i])})`:r+=`@${i}`)}),r},{setStringify(e){const t=Vl;return Vl=e,t}});function us(e){var t;return!!((t=e.errors)!=null&&t.length)}function ds(e,t,n){const r=new Set(e),i=r.size;return Ki(t,{Directive(o){if(r.delete(o.name.value)&&(!n||!r.size))return ep}}),n?!r.size:r.size<i}function JA(e){let t=!1;return Ki(e,{Directive:{enter(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(r=>r.name.value==="always"&&r.value.kind==="BooleanValue"&&r.value.value===!0),t))return ep}}}),t}const On=Array.isArray;function qA(e){return rr(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function Ul(e){return e.kind==="Field"}function Cp(e){return Array.isArray(e)&&e.length>0}function fs(e){return{__ref:String(e)}}function R$(e){return e}function XA(e){let t=e[0]||{};const n=e.length;if(n>1){const r=new cs;for(let i=1;i<n;++i)t=r.merge(t,e[i])}return t}function Ea(e,t){return zr(e,t,t.variables&&{variables:zr({...e&&e.variables,...t.variables})})}function wp(e){return e.catch(()=>{}),e}function $A(e,t){jo(t);const n=zb(""),r=zb(""),i=v=>{for(let S=0,w;S<v.length&&(w=v[S]);++S)if(!On(w)){if(w.kind===xt.OPERATION_DEFINITION)return n(w.name&&w.name.value);if(w.kind===xt.FRAGMENT_DEFINITION)return r(w.name.value)}return at.error(14),null};let o=0;for(let v=t.definitions.length-1;v>=0;--v)t.definitions[v].kind===xt.OPERATION_DEFINITION&&++o;const a=ek(e),s=v=>Cp(v)&&v.map(a).some(S=>S&&S.remove),c=new Map;let u=!1;const d={enter(v){if(s(v.directives))return u=!0,null}},h=Ki(t,{Field:d,InlineFragment:d,VariableDefinition:{enter(){return!1}},Variable:{enter(v,S,w,A,_){const C=i(_);C&&C.variables.add(v.name.value)}},FragmentSpread:{enter(v,S,w,A,_){if(s(v.directives))return u=!0,null;const C=i(_);C&&C.fragmentSpreads.add(v.name.value)}},FragmentDefinition:{enter(v,S,w,A){c.set(JSON.stringify(A),v)},leave(v,S,w,A){const _=c.get(JSON.stringify(A));if(v===_)return v;if(o>0&&v.selectionSet.selections.every(C=>C.kind===xt.FIELD&&C.name.value==="__typename"))return r(v.name.value).removed=!0,u=!0,null}},Directive:{leave(v){if(a(v))return u=!0,null}}});if(!u)return t;const p=v=>(v.transitiveVars||(v.transitiveVars=new Set(v.variables),v.removed||v.fragmentSpreads.forEach(S=>{p(r(S)).transitiveVars.forEach(w=>{v.transitiveVars.add(w)})})),v),m=new Set;h.definitions.forEach(v=>{v.kind===xt.OPERATION_DEFINITION?p(n(v.name&&v.name.value)).fragmentSpreads.forEach(S=>{m.add(S)}):v.kind===xt.FRAGMENT_DEFINITION&&o===0&&!r(v.name.value).removed&&m.add(v.name.value)}),m.forEach(v=>{p(r(v)).fragmentSpreads.forEach(S=>{m.add(S)})});const y=v=>!!(!m.has(v)||r(v).removed),b={enter(v){if(y(v.name.value))return null}};return tk(Ki(h,{FragmentSpread:b,FragmentDefinition:b,OperationDefinition:{leave(v){if(v.variableDefinitions){const S=p(n(v.name&&v.name.value)).transitiveVars;if(S.size<v.variableDefinitions.length)return{...v,variableDefinitions:v.variableDefinitions.filter(w=>S.has(w.variable.name.value))}}}}}))}function zb(e){const t=new Map;return function(r=e){let i=t.get(r);return i||t.set(r,i={variables:new Set,fragmentSpreads:new Set}),i}}function ek(e){const t=new Map,n=new Map;return e.forEach(r=>{r&&(r.name?t.set(r.name,r):r.test&&n.set(r.test,r))}),r=>{let i=t.get(r.name.value);return!i&&n.size&&n.forEach((o,a)=>{a(r)&&(i=o)}),i}}function Hb(e,t){return!e||e.selectionSet.selections.every(n=>n.kind===xt.FRAGMENT_SPREAD&&Hb(t[n.name.value],t))}function tk(e){return Hb(mo(e)||GA(e),Fl(jl(e)))?null:e}function nk(e){return Ki(e,{FragmentSpread(t){var n;if(!((n=t.directives)!=null&&n.some(({name:r})=>r.value==="unmask")))return null}})}function hs(e){return e.alias?e.alias.value:e.name.value}function Mu({directives:e},t){return!e||!e.length?!0:ik(e).every(({directive:n,ifArgument:r})=>{let i=!1;return r.value.kind==="Variable"?(i=t&&t[r.value.name.value],at(i!==void 0,15,n.name.value)):i=r.value.value,n.name.value==="skip"?!i:i})}function rk({name:{value:e}}){return e==="skip"||e==="include"}function ik(e){const t=[];return e&&e.length&&e.forEach(n=>{if(!rk(n))return;const r=n.arguments,i=n.name.value;at(r&&r.length===1,16,i);const o=r[0];at(o.name&&o.name.value==="if",17,i);const a=o.value;at(a&&(a.kind==="Variable"||a.kind==="BooleanValue"),18,i),t.push({directive:n,ifArgument:o})}),t}function ok(e,t){let n=null;e.directives&&(n={},e.directives.forEach(i=>{n[i.name.value]={},i.arguments&&i.arguments.forEach(({name:o,value:a})=>ss(n[i.name.value],o,a,t))}));let r=null;return e.arguments&&e.arguments.length&&(r={},e.arguments.forEach(({name:i,value:o})=>ss(r,i,o,t))),Bb(e.name.value,r,n)}function Bl(e){const t={data:e.data};return e.error&&(t.error=e.error),t}function _p(e,t=()=>{}){return n=>new Yt(r=>{let i=t();return n.subscribe({next(o){let a;try{a=e(o,i)}catch(s){r.error(s)}a!==void 0&&r.next(a)},error(o){r.error(o)},complete(){r.complete()}})})}function Wb(e,{data:t,...n},{data:r,...i},o){return pt(n,i)&&Lu(Sp(e).selectionSet,t,r,{fragmentMap:Fl(jl(e)),variables:o})}function Lu(e,t,n,r){if(t===n)return!0;const i=new Set;return e.selections.every(o=>{if(i.has(o)||(i.add(o),!Mu(o,r.variables))||Gb(o))return!0;if(Ul(o)){const a=hs(o),s=t&&t[a],c=n&&n[a],u=o.selectionSet;if(!u)return pt(s,c);const d=Array.isArray(s),h=Array.isArray(c);if(d!==h)return!1;if(d&&h){const p=s.length;if(c.length!==p)return!1;for(let m=0;m<p;++m)if(!Lu(u,s[m],c[m],r))return!1;return!0}return Lu(u,s,c,r)}else{const a=Iu(o,r.fragmentMap);if(a)return Gb(a)?!0:Lu(a.selectionSet,t,n,r)}})}function Gb(e){return!!e.directives&&e.directives.some(ak)}function ak(e){return e.name.value==="nonreactive"}function sk(e,t){let n,r;function i(o){return o!==n&&(n=o,r=t(n)),r}return Object.assign(e.pipe(Fo(i),pp({bufferSize:1,refCount:!0})),{getCurrentResult:()=>i(e.getCurrentResult())})}const lk=Vb(function(t,n,r){return sk(t,r)},{max:1,makeCacheKey:e=>e.slice(0,2)}),Yb=Symbol.for("apollo.result.extensions"),Do=Symbol.for("apollo.result.streamInfo"),xp=Symbol.for("apollo.observableQuery.variablesUnknown");let Zn=null;const Zb={};let ck=1;const uk=()=>class{constructor(){this.id=["slot",ck++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let t=Zn;t;t=t.parent)if(this.id in t.slots){const n=t.slots[this.id];if(n===Zb)break;return t!==Zn&&(Zn.slots[this.id]=n),!0}return Zn&&(Zn.slots[this.id]=Zb),!1}getValue(){if(this.hasValue())return Zn.slots[this.id]}withValue(t,n,r,i){const o={__proto__:null,[this.id]:t},a=Zn;Zn={parent:a,slots:o};try{return n.apply(i,r)}finally{Zn=a}}static bind(t){const n=Zn;return function(){const r=Zn;try{return Zn=n,t.apply(this,arguments)}finally{Zn=r}}}static noContext(t,n,r){if(Zn){const i=Zn;try{return Zn=null,t.apply(r,n)}finally{Zn=i}}else return t.apply(r,n)}};function Kb(e){try{return e()}catch{}}const Ap="@wry/context:Slot",Qb=Kb(()=>globalThis)||Kb(()=>global)||Object.create(null),Fu=Qb[Ap]||Array[Ap]||(function(e){try{Object.defineProperty(Qb,Ap,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}})(uk()),{bind:I$,noContext:M$}=Fu,ju=new Fu,{hasOwnProperty:dk}=Object.prototype,kp=Array.from||function(e){const t=[];return e.forEach(n=>t.push(n)),t};function Tp(e){const{unsubscribe:t}=e;typeof t=="function"&&(e.unsubscribe=void 0,t())}const zl=[],fk=100;function ps(e,t){if(!e)throw new Error(t||"assertion failure")}function Jb(e,t){const n=e.length;return n>0&&n===t.length&&e[n-1]===t[n-1]}function qb(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function Xb(e){return e.slice(0)}class Du{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++Du.count}peek(){if(this.value.length===1&&!Vo(this))return $b(this),this.value[0]}recompute(t){return ps(!this.recomputing,"already recomputing"),$b(this),Vo(this)?hk(this,t):qb(this.value)}setDirty(){this.dirty||(this.dirty=!0,e6(this),Tp(this))}dispose(){this.setDirty(),o6(this),Op(this,(t,n)=>{t.setDirty(),a6(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=zl.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(kp(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),zl.push(this.deps),this.deps=null)}}Du.count=0;function $b(e){const t=ju.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Vo(e)?n6(t,e):r6(t,e),t}function hk(e,t){return o6(e),ju.withValue(e,pk,[e,t]),gk(e,t)&&mk(e),qb(e.value)}function pk(e,t){e.recomputing=!0;const{normalizeResult:n}=e;let r;n&&e.value.length===1&&(r=Xb(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),n&&r&&!Jb(r,e.value))try{e.value[0]=n(e.value[0],r[0])}catch{}}catch(i){e.value[1]=i}e.recomputing=!1}function Vo(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function mk(e){e.dirty=!1,!Vo(e)&&t6(e)}function e6(e){Op(e,n6)}function t6(e){Op(e,r6)}function Op(e,t){const n=e.parents.size;if(n){const r=kp(e.parents);for(let i=0;i<n;++i)t(r[i],e)}}function n6(e,t){ps(e.childValues.has(t)),ps(Vo(t));const n=!Vo(e);if(!e.dirtyChildren)e.dirtyChildren=zl.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),n&&e6(e)}function r6(e,t){ps(e.childValues.has(t)),ps(!Vo(t));const n=e.childValues.get(t);n.length===0?e.childValues.set(t,Xb(t.value)):Jb(n,t.value)||e.setDirty(),i6(e,t),!Vo(e)&&t6(e)}function i6(e,t){const n=e.dirtyChildren;n&&(n.delete(t),n.size===0&&(zl.length<fk&&zl.push(n),e.dirtyChildren=null))}function o6(e){e.childValues.size>0&&e.childValues.forEach((t,n)=>{a6(e,n)}),e.forgetDeps(),ps(e.dirtyChildren===null)}function a6(e,t){t.parents.delete(e),e.childValues.delete(t),i6(e,t)}function gk(e,t){if(typeof e.subscribe=="function")try{Tp(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}const vk={setDirty:!0,dispose:!0,forget:!0};function s6(e){const t=new Map;function n(r){const i=ju.getValue();if(i){let o=t.get(r);o||t.set(r,o=new Set),i.dependOn(o)}}return n.dirty=function(i,o){const a=t.get(i);if(a){const s=o&&dk.call(vk,o)?o:"setDirty";kp(a).forEach(c=>c[s]()),t.delete(i),Tp(a)}},n}let l6;function c6(...e){return(l6||(l6=new Qi(typeof WeakMap=="function"))).lookupArray(e)}const Np=new Set;function Hl(e,{max:t=Math.pow(2,16),keyArgs:n,makeCacheKey:r=c6,normalizeResult:i,subscribe:o,cache:a=gp}=Object.create(null)){const s=typeof a=="function"?new a(t,p=>p.dispose()):a,c=function(){const p=r.apply(null,n?n.apply(null,arguments):arguments);if(p===void 0)return e.apply(null,arguments);let m=s.get(p);m||(s.set(p,m=new Du(e)),m.normalizeResult=i,m.subscribe=o,m.forget=()=>s.delete(p));const y=m.recompute(Array.prototype.slice.call(arguments));return s.set(p,m),Np.add(s),ju.hasValue()||(Np.forEach(b=>b.clean()),Np.clear()),y};Object.defineProperty(c,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(c.options={max:t,keyArgs:n,makeCacheKey:r,normalizeResult:i,subscribe:o,cache:s});function u(p){const m=p&&s.get(p);m&&m.setDirty()}c.dirtyKey=u,c.dirty=function(){u(r.apply(null,arguments))};function d(p){const m=p&&s.get(p);if(m)return m.peek()}c.peekKey=d,c.peek=function(){return d(r.apply(null,arguments))};function h(p){return p?s.delete(p):!1}return c.forgetKey=h,c.forget=function(){return h(r.apply(null,arguments))},c.makeCacheKey=r,c.getKey=n?function(){return r.apply(null,n.apply(null,arguments))}:r,Object.freeze(c)}function yk(...e){return c6.bind(null,...e)}class bk{constructor(){se(this,"startRequest")}isIncrementalResult(t){return!1}prepareRequest(t){return at(!ds(["defer","stream"],t.query),67),t}extractErrors(){}}function Ek(e,{client:t}){const n={query:e.query,variables:e.variables||{},extensions:e.extensions||{},operationName:ls(e.query),operationType:mo(e.query).operation};let r={...e.context};const i=a=>{typeof a=="function"?r={...r,...a(o())}:r={...r,...a}},o=()=>Object.freeze({...r});return Object.defineProperty(n,"setContext",{enumerable:!1,value:i}),Object.defineProperty(n,"getContext",{enumerable:!1,value:o}),Object.defineProperty(n,"client",{enumerable:!1,value:t}),n}function Sk(e,t){const n={...e},r=new Set(Object.keys(e));return Ki(t,{Variable(i,o,a){a&&a.kind!=="VariableDefinition"&&r.delete(i.name.value)}}),r.forEach(i=>{delete n[i]}),n}class Fn{constructor(t){se(this,"left");se(this,"right");t&&(this.request=t)}static empty(){return new Fn(()=>Il)}static from(t){if(t.length===0)return Fn.empty();const[n,...r]=t;return n.concat(...r)}static split(t,n,r=new Fn((i,o)=>o(i))){const i=new Fn((o,a)=>t(o)?n.request(o,a):r.request(o,a));return Object.assign(i,{left:n,right:r})}static execute(t,n,r){return t.request(Ek(n,r),()=>Il)}static concat(...t){return Fn.from(t)}split(t,n,r){return this.concat(Fn.split(t,n,r))}concat(...t){return t.length===0?this:t.reduce(this.combine.bind(this),this)}combine(t,n){const r=new Fn((i,o)=>t.request(i,a=>n.request(a,o)));return Object.assign(r,{left:t,right:n})}request(t,n){throw si(65)}}const Rp=Fn.execute;function Ck(e){return e}class vo{constructor(t,n={}){se(this,"transform");se(this,"cached");se(this,"resultCache",new WeakSet);se(this,"left");se(this,"right");this.transform=t,n.getCacheKey&&(this.getCacheKey=n.getCacheKey),this.cached=n.cache!==!1,this.resetCache()}getCacheKey(t){return[t]}static identity(){return new vo(Ck,{cache:!1})}static split(t,n,r=vo.identity()){return Object.assign(new vo(i=>(t(i)?n:r).transformDocument(i),{cache:!1}),{left:n,right:r})}resetCache(){if(this.cached){const t=new Qi;this.performWork=Hl(vo.prototype.performWork.bind(this),{makeCacheKey:n=>{const r=this.getCacheKey(n);if(r)return at(Array.isArray(r),20),t.lookupArray(r)},max:po["documentTransform.cache"],cache:Pu})}}performWork(t){return jo(t),this.transform(t)}transformDocument(t){if(this.resultCache.has(t))return t;const n=this.performWork(t);return this.resultCache.add(n),n}concat(t){return Object.assign(new vo(n=>t.transformDocument(this.transformDocument(n)),{cache:!1}),{left:this,right:t})}}let Pp;const Sa=Object.assign(e=>{let t=Pp.get(e);return t||(t=O3(e),Pp.set(e,t)),t},{reset(){Pp=new bp(po.print||2e3)}});Sa.reset();function Jt(e){return!!(e&&typeof e=="object"&&typeof e.__ref=="string")}const u6={kind:xt.FIELD,name:{kind:xt.NAME,value:"__typename"}},d6=Object.assign(function(e){return Ki(e,{SelectionSet:{enter(t,n,r){if(r&&r.kind===xt.OPERATION_DEFINITION)return;const{selections:i}=t;if(!i||i.some(s=>s.kind===xt.FIELD&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)))return;const a=r;if(!(a.kind===xt.FIELD&&a.directives&&a.directives.some(s=>s.name.value==="export")))return{...t,selections:[...i,u6]}}}})},{added(e){return e===u6}});function f6(e,t){var n;return((n=mo(e))==null?void 0:n.operation)===t}function wk(e){return f6(e,"mutation")}function _k(e){return f6(e,"subscription")}function h6(e){return e===7||e===8}function Vu(e){return!h6(e)}class xk{constructor(){se(this,"assumeImmutableResults",!1);se(this,"fragmentWatches",new Qi(!0));se(this,"onAfterBroadcast",t=>t());se(this,"getFragmentDoc",Hl(WA,{max:po["cache.fragmentQueryDocuments"]||1e3,cache:Pu,makeCacheKey:yk(this)}))}lookupFragment(t){return null}batch(t){const n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0;let r;return this.performTransaction(()=>r=t.update(this),n),r}recordOptimisticTransaction(t,n){this.performTransaction(t,n)}transformDocument(t){return t}transformForLink(t){return t}identify(t){}gc(){return[]}modify(t){return!1}readQuery(t,n=!!t.optimistic){return this.read({...t,rootId:t.id||"ROOT_QUERY",optimistic:n})}watchFragment(t){const{fragment:n,fragmentName:r,from:i}=t,o=this.getFragmentDoc(n,r),s=(Array.isArray(i)?i:[i]).map(m=>m==null?m:this.toCacheId(m));if(!Array.isArray(i)){const m=this.watchSingleFragment(s[0],o,t);return i===null?m:lk(m,Symbol.for("apollo.transform.individualResult"),y=>({...y,data:y.data??{}}))}let c;function u(m){const y=m.reduce((b,v,S)=>(b.data.push(v.data),b.complete&&(b.complete=v.complete),b.dataState=b.complete?"complete":"partial",v.missing&&(b.missing||(b.missing={}),b.missing[S]=v.missing),b),{data:[],dataState:"complete",complete:!0});return pt(c,y)||(c=y),c}if(s.length===0)return kk;let d=!1;const h=s.map(m=>this.watchSingleFragment(m,o,t)),p=BA(h).pipe(Fo(u),Ll({subscribe:()=>d=!0,unsubscribe:()=>d=!1}),pp({bufferSize:1,refCount:!0}));return Object.assign(p,{getCurrentResult:()=>{if(d&&c)return c;const m=h.map(y=>y.getCurrentResult());return u(m)}})}watchSingleFragment(t,n,r){if(t===null)return Ak;const{optimistic:i=!0,variables:o}=r,a=[n,go({id:t,optimistic:i,variables:o})],s=this.fragmentWatches.lookupArray(a);if(!s.observable){let d=function(p){const m=p.result;return(!u||!Wb(n,{data:u.data},{data:m},r.variables))&&(u={data:m,dataState:p.complete?"complete":"partial",complete:p.complete},p.missing&&(u.missing=p.missing.missing)),u},c=!1,u;const h=new Yt(p=>{c=!0;const m=this.watch({variables:o,returnPartialData:!0,id:t,query:n,optimistic:i,immediate:!0,callback:y=>{h.dirty=!0,this.onAfterBroadcast(()=>{p.next(d(y)),h.dirty=!1})}});return()=>{c=!1,m(),this.fragmentWatches.removeArray(a)}}).pipe(xA(),Ml({connector:()=>new fb(1),resetOnRefCountZero:()=>_A(0)}));s.observable=Object.assign(h,{dirty:!1,getCurrentResult:()=>c&&u?u:d(this.diff({id:t,query:n,returnPartialData:!0,optimistic:i,variables:o}))})}return s.observable}readFragment(t,n=!!t.optimistic){const r=t.from!==void 0?this.toCacheId(t.from):t.id;return this.read({...t,query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:r,optimistic:n})}writeQuery({id:t,data:n,...r}){return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))}writeFragment({data:t,fragment:n,fragmentName:r,...i}){const o=i.from!==void 0?this.toCacheId(i.from):i.id;return this.write(Object.assign(i,{query:this.getFragmentDoc(n,r),dataId:o,result:t}))}updateQuery(t,n){return this.batch({update(r){const i=r.readQuery(t),o=n(i);return o==null?i:(r.writeQuery({...t,data:o}),o)}})}updateFragment(t,n){return this.batch({update(r){const i=r.readFragment(t),o=n(i);return o==null?i:(r.writeFragment({...t,data:o}),o)}})}toCacheId(t){return typeof t=="string"?t:this.identify(t)}}const p6=Object.freeze({data:null,dataState:"complete",complete:!0}),Ak=Object.assign(new Yt(e=>{e.next(p6)}),{dirty:!1,getCurrentResult:()=>p6}),m6=Object.freeze({data:[],dataState:"complete",complete:!0}),kk=Object.assign(new Yt(e=>{e.next(m6)}),{getCurrentResult:()=>m6});class Ip extends Error{constructor(n,r,i,o){super(n);se(this,"message");se(this,"path");se(this,"query");se(this,"variables");se(this,"missing");if(this.message=n,this.path=r,this.query=i,this.variables=o,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let a=this.path.length-1;a>=0;--a)this.missing={[this.path[a]]:this.missing}}else this.missing=this.path;this.__proto__=Ip.prototype}}const{hasOwnProperty:jn}=Object.prototype;function g6({__typename:e,id:t,_id:n},r){if(typeof e=="string"&&(r&&(r.keyObject=t!=null?{id:t}:n!=null?{_id:n}:void 0),t==null&&n!=null&&(t=n),t!=null))return`${e}:${typeof t=="number"||typeof t=="string"?t:JSON.stringify(t)}`}const Tk={dataIdFromObject:g6,resultCaching:!0};function Ok(e){return zr(Tk,e)}const v6=/^[_a-z][_0-9a-z]*/i;function ms(e){const t=e.match(v6);return t?t[0]:e}function Mp(e,t,n){return rr(t)?On(t)?t.every(r=>Mp(e,r,n)):e.selections.every(r=>{if(Ul(r)&&Mu(r,n)){const i=hs(r);return jn.call(t,i)&&(!r.selectionSet||Mp(r.selectionSet,t[i],n))}return!0}):!1}function gs(e){return rr(e)&&!Jt(e)&&!On(e)}function Nk(){return new cs}function y6(e,t){const n=Fl(jl(e));return{fragmentMap:n,lookupFragment(r){let i=n[r];return!i&&t&&(i=t.lookup(r)),i||null}}}const Uu={},Lp=()=>Uu,b6={};class Bu{constructor(t,n){se(this,"policies");se(this,"group");se(this,"data",{});se(this,"rootIds",{});se(this,"refs",{});se(this,"getFieldValue",(t,n)=>Jt(t)?this.get(t.__ref,n):t&&t[n]);se(this,"canRead",t=>Jt(t)?this.has(t.__ref):typeof t=="object");se(this,"toReference",(t,n)=>{if(typeof t=="string")return fs(t);if(Jt(t))return t;const[r]=this.policies.identify(t);if(r){const i=fs(r);return n&&this.merge(r,t),i}});this.policies=t,this.group=n}toObject(){return{...this.data}}has(t){return this.lookup(t,!0)!==void 0}get(t,n){if(this.group.depend(t,n),jn.call(this.data,t)){const r=this.data[t];if(r&&jn.call(r,n))return r[n]}if(n==="__typename"&&jn.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof Ji)return this.parent.get(t,n)}lookup(t,n){if(n&&this.group.depend(t,"__exists"),jn.call(this.data,t))return this.data[t];if(this instanceof Ji)return this.parent.lookup(t,n);if(this.policies.rootTypenamesById[t])return{}}merge(t,n){let r;Jt(t)&&(t=t.__ref),Jt(n)&&(n=n.__ref);const i=typeof t=="string"?this.lookup(r=t):t,o=typeof n=="string"?this.lookup(r=n):n;if(!o)return;at(typeof r=="string",104);const a=new cs({reconciler:Ik}).merge(i,o);if(this.data[r]=a,a!==i&&(delete this.refs[r],this.group.caching)){const s={};i||(s.__exists=1),Object.keys(o).forEach(c=>{if(!i||i[c]!==a[c]){s[c]=1;const u=ms(c);u!==c&&!this.policies.hasKeyArgs(a.__typename,u)&&(s[u]=1),a[c]===void 0&&!(this instanceof Ji)&&delete a[c]}}),s.__typename&&!(i&&i.__typename)&&this.policies.rootTypenamesById[r]===a.__typename&&delete s.__typename,Object.keys(s).forEach(c=>this.group.dirty(r,c))}}modify(t,n,r){const i=this.lookup(t);if(i){const o={};let a=!1,s=!0;const c={DELETE:Uu,INVALIDATE:b6,isReference:Jt,toReference:this.toReference,canRead:this.canRead,readField:(u,d)=>this.policies.readField(typeof u=="string"?{fieldName:u,from:d||fs(t)}:u,{store:this})};if(Object.keys(i).forEach(u=>{const d=ms(u);let h=i[u];if(h===void 0)return;const p=typeof n=="function"?n:n[u]||(r?void 0:n[d]);if(p){let m=p===Lp?Uu:p(h,{...c,fieldName:d,storeFieldName:u,storage:this.getStorage(t,u)});m===b6?this.group.dirty(t,u):(m===Uu&&(m=void 0),m!==h&&(o[u]=m,a=!0,h=m))}h!==void 0&&(s=!1)}),a)return this.merge(t,o),s&&(this instanceof Ji?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1}delete(t,n,r){const i=this.lookup(t);if(i){const o=this.getFieldValue(i,"__typename"),a=n&&r?this.policies.getStoreFieldName({typename:o,fieldName:n,args:r}):n;return this.modify(t,a?{[a]:Lp}:Lp,!!r)}return!1}evict(t,n){let r=!1;return t.id&&(jn.call(this.data,t.id)&&(r=this.delete(t.id,t.fieldName,t.args)),this instanceof Ji&&this!==n&&(r=this.parent.evict(t,n)||r),(t.fieldName||r)&&this.group.dirty(t.id,t.fieldName||"__exists")),r}clear(){this.replace(null)}extract(){const t=this.toObject(),n=[];return this.getRootIdSet().forEach(r=>{jn.call(this.policies.rootTypenamesById,r)||n.push(r)}),n.length&&(t.__META={extraRootIds:n.sort()}),t}replace(t){if(Object.keys(this.data).forEach(n=>{t&&jn.call(t,n)||this.delete(n)}),t){const{__META:n,...r}=t;Object.keys(r).forEach(i=>{this.merge(i,r[i])}),n&&n.extraRootIds.forEach(this.retain,this)}}retain(t){return this.rootIds[t]=(this.rootIds[t]||0)+1}release(t){if(this.rootIds[t]>0){const n=--this.rootIds[t];return n||delete this.rootIds[t],n}return 0}getRootIdSet(t=new Set){return Object.keys(this.rootIds).forEach(t.add,t),this instanceof Ji?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t}gc(){const t=this.getRootIdSet(),n=this.toObject();t.forEach(i=>{jn.call(n,i)&&(Object.keys(this.findChildRefIds(i)).forEach(t.add,t),delete n[i])});const r=Object.keys(n);if(r.length){let i=this;for(;i instanceof Ji;)i=i.parent;r.forEach(o=>i.delete(o))}return r}findChildRefIds(t){if(!jn.call(this.refs,t)){const n=this.refs[t]={},r=this.data[t];if(!r)return n;const i=new Set([r]);i.forEach(o=>{Jt(o)&&(n[o.__ref]=!0),rr(o)&&Object.keys(o).forEach(a=>{const s=o[a];rr(s)&&i.add(s)})})}return this.refs[t]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}get supportsResultCaching(){return this.group.caching}}class E6{constructor(t,n=null){se(this,"caching");se(this,"parent");se(this,"d",null);se(this,"keyMaker");this.caching=t,this.parent=n,this.resetCaching()}resetCaching(){this.d=this.caching?s6():null,this.keyMaker=new Qi}depend(t,n){if(this.d){this.d(Fp(t,n));const r=ms(n);r!==n&&this.d(Fp(t,r)),this.parent&&this.parent.depend(t,n)}}dirty(t,n){this.d&&this.d.dirty(Fp(t,n),n==="__exists"?"forget":"setDirty")}}function Fp(e,t){return t+"#"+e}function S6(e,t){Wl(e)&&e.group.depend(t,"__exists")}class Rk extends Bu{constructor({policies:n,resultCaching:r=!0,seed:i}){super(n,new E6(r));se(this,"stump",new Pk(this));se(this,"storageTrie",new Qi);i&&this.replace(i)}addLayer(n,r){return this.stump.addLayer(n,r)}removeLayer(){return this}getStorage(){return this.storageTrie.lookupArray(arguments)}}Bu.Root=Rk;class Ji extends Bu{constructor(n,r,i,o){super(r.policies,o);se(this,"id");se(this,"parent");se(this,"replay");se(this,"group");this.id=n,this.parent=r,this.replay=i,this.group=o,i(this)}addLayer(n,r){return new Ji(n,this,r,this.group)}removeLayer(n){const r=this.parent.removeLayer(n);return n===this.id?(this.group.caching&&Object.keys(this.data).forEach(i=>{const o=this.data[i],a=r.lookup(i);a?o?o!==a&&Object.keys(o).forEach(s=>{pt(o[s],a[s])||this.group.dirty(i,s)}):(this.group.dirty(i,"__exists"),Object.keys(a).forEach(s=>{this.group.dirty(i,s)})):this.delete(i)}),r):r===this.parent?this:r.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(n){const r=this.parent.findChildRefIds(n);return jn.call(this.data,n)?{...r,...super.findChildRefIds(n)}:r}getStorage(...n){let r=this.parent;for(;r.parent;)r=r.parent;return r.getStorage(...n)}}class Pk extends Ji{constructor(t){super("EntityStore.Stump",t,()=>{},new E6(t.group.caching,t.group))}removeLayer(){return this}merge(t,n){return this.parent.merge(t,n)}}function Ik(e,t,n){const r=e[n],i=t[n];return pt(r,i)?r:i}function Wl(e){return!!(e&&e.supportsResultCaching)}const C6=new Fu;function Mk(e){var r,i;const t=(r=e.directives)==null?void 0:r.find(({name:o})=>o.value==="unmask");if(!t)return"mask";const n=(i=t.arguments)==null?void 0:i.find(({name:o})=>o.value==="mode");return n&&"value"in n.value&&n.value.value==="migrate"?"migrate":"unmask"}function w6(e,t,n){return C6.withValue(!0,()=>Gl(e,t,n,!1))}function Lk(e,t){if(t.has(e))return t.get(e);const n=Array.isArray(e)?[]:{};return t.set(e,n),n}function Gl(e,t,n,r,i){const{knownChanged:o}=n,a=Lk(e,n.mutableTargets);if(Array.isArray(e)){for(const[s,c]of Array.from(e.entries())){if(c===null){a[s]=null;continue}const u=Gl(c,t,n,r);o.has(u)&&o.add(a),a[s]=u}return o.has(a)?a:e}for(const s of t.selections){let c;if(r&&o.add(a),s.kind===xt.FIELD){const u=hs(s),d=s.selectionSet;if(c=a[u]||e[u],c===void 0)continue;if(d&&c!==null){const h=Gl(e[u],d,n,r);o.has(h)&&(c=h)}a[u]=c}if(s.kind===xt.INLINE_FRAGMENT&&(!s.typeCondition||n.cache.fragmentMatches(s,e.__typename))&&(c=Gl(e,s.selectionSet,n,r)),s.kind===xt.FRAGMENT_SPREAD){const u=s.name.value,d=n.fragmentMap[u]||(n.fragmentMap[u]=n.cache.lookupFragment(u));at(d,39,u);const h=Mk(s);h!=="mask"&&(c=Gl(e,d.selectionSet,n,h==="migrate"))}o.has(c)&&o.add(a)}return"__typename"in e&&!("__typename"in a)&&(a.__typename=e.__typename),Object.keys(a).length!==Object.keys(e).length&&o.add(a),o.has(a)?a:e}function Fk(e,t,n,r){const i=t.definitions.filter(a=>a.kind===xt.FRAGMENT_DEFINITION);typeof r>"u"&&(at(i.length===1,41,i.length),r=i[0].name.value);const o=i.find(a=>a.name.value===r);return at(!!o,42,r),e==null||pt(e,{})?e:w6(e,o.selectionSet,{operationName:o.name.value,fragmentMap:Fl(jl(t)),cache:n,mutableTargets:new WeakMap,knownChanged:new WeakSet})}function jk(e,t,n){var i;const r=mo(t);return at(r,43),e==null?e:w6(e,r.selectionSet,{operationType:r.operation,operationName:(i=r.name)==null?void 0:i.value,fragmentMap:Fl(jl(t)),cache:n,mutableTargets:new WeakMap,knownChanged:new WeakSet})}const _6={};function jp(e){const t=JSON.stringify(e);return _6[t]||(_6[t]={})}function x6(e){const t=jp(e);return t.keyFieldsFn||(t.keyFieldsFn=(n,r)=>{const i=(a,s)=>r.readField(s,a),o=r.keyObject=Dp(e,a=>{let s=vs(r.storeObject,a,i);return s===void 0&&n!==r.storeObject&&jn.call(n,a[0])&&(s=vs(n,a,T6)),at(s!==void 0,107,a.join("."),n),s});return`${r.typename}:${JSON.stringify(o)}`})}function A6(e){const t=jp(e);return t.keyArgsFn||(t.keyArgsFn=(n,{field:r,variables:i,fieldName:o})=>{const a=Dp(e,c=>{const u=c[0],d=u.charAt(0);if(d==="@"){if(r&&Cp(r.directives)){const h=u.slice(1),p=r.directives.find(y=>y.name.value===h),m=p&&mp(p,i);return m&&vs(m,c.slice(1))}return}if(d==="$"){const h=u.slice(1);if(i&&jn.call(i,h)){const p=c.slice(0);return p[0]=h,vs(i,p)}return}if(n)return vs(n,c)}),s=JSON.stringify(a);return(n||s!=="{}")&&(o+=":"+s),o})}function Dp(e,t){const n=new cs;return k6(e).reduce((r,i)=>{let o=t(i);if(o!==void 0){for(let a=i.length-1;a>=0;--a)o={[i[a]]:o};r=n.merge(r,o)}return r},{})}function k6(e){const t=jp(e);if(!t.paths){const n=t.paths=[],r=[];e.forEach((i,o)=>{On(i)?(k6(i).forEach(a=>n.push(r.concat(a))),r.length=0):(r.push(i),On(e[o+1])||(n.push(r.slice(0)),r.length=0))})}return t.paths}function T6(e,t){return e[t]}function vs(e,t,n){return n=n||T6,O6(t.reduce(function r(i,o){return On(i)?i.map(a=>r(a,o)):i&&n(i,o)},e))}function O6(e){return rr(e)?On(e)?e.map(O6):Dp(Object.keys(e).sort(),t=>vs(e,t)):e}const N6=new Fu,R6=new WeakMap;function Yl(e){let t=R6.get(e);return t||R6.set(e,t={vars:new Set,dep:s6()}),t}function P6(e){Yl(e).vars.forEach(t=>t.forgetCache(e))}function Dk(e){Yl(e).vars.forEach(t=>t.attachCache(e))}function Vk(e){const t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach(s=>{Yl(s).dep.dirty(r),Uk(s)});const a=Array.from(n);n.clear(),a.forEach(s=>s(e))}}else{const a=N6.getValue();a&&(i(a),Yl(a).dep(r))}return e};r.onNextChange=o=>(n.add(o),()=>{n.delete(o)});const i=r.attachCache=o=>(t.add(o),Yl(o).vars.add(r),r);return r.forgetCache=o=>t.delete(o),r}function Uk(e){e.broadcastWatches&&e.broadcastWatches()}function Vp(e){return e.args!==void 0?e.args:e.field?mp(e.field,e.variables):null}const Bk=()=>{},I6=(e,t)=>t.fieldName,M6=(e,t,{mergeObjects:n})=>n(e,t),L6=(e,t)=>t,zk=(e,t,{streamFieldInfo:n,existingData:r})=>{if(!e&&!r)return t;const i=[],o=e??r,a=n!=null&&n.isLastChunk?t.length:Math.max(o.length,t.length);for(let s=0;s<a;s++)i[s]=t[s]===void 0?o[s]:t[s];return i};class Hk{constructor(t){se(this,"config");se(this,"typePolicies",{});se(this,"toBeAdded",{});se(this,"supertypeMap",new Map);se(this,"fuzzySubtypes",new Map);se(this,"cache");se(this,"rootIdsByTypename",{});se(this,"rootTypenamesById",{});se(this,"usingPossibleTypes",!1);this.config=t,this.config={dataIdFromObject:g6,...t},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}identify(t,n){var d;const r=this,i=n&&(n.typename||((d=n.storeObject)==null?void 0:d.__typename))||t.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const o=n&&n.storeObject||t,a={...n,typename:i,storeObject:o,readField:n&&n.readField||((...h)=>{const p=Up(h,o);return r.readField(p,{store:r.cache.data,variables:p.variables})})};let s;const c=i&&this.getTypePolicy(i);let u=c&&c.keyFn||this.config.dataIdFromObject;return C6.withValue(!0,()=>{for(;u;){const h=u({...t,...o},a);if(On(h))u=x6(h);else{s=h;break}}}),s=s?String(s):void 0,a.keyObject?[s,a.keyObject]:[s]}addTypePolicies(t){Object.keys(t).forEach(n=>{const{queryType:r,mutationType:i,subscriptionType:o,...a}=t[n];r&&this.setRootTypename("Query",n),i&&this.setRootTypename("Mutation",n),o&&this.setRootTypename("Subscription",n),jn.call(this.toBeAdded,n)?this.toBeAdded[n].push(a):this.toBeAdded[n]=[a]})}updateTypePolicy(t,n,r){const i=this.getTypePolicy(t),{keyFields:o,fields:a}=n;function s(c,u){c.merge=typeof u=="function"?u:u===!0?M6:u===!1?L6:c.merge}s(i,n.merge),i.keyFn=o===!1?Bk:On(o)?x6(o):typeof o=="function"?o:i.keyFn,a&&Object.keys(a).forEach(c=>{let u=r[c];(!u||(u==null?void 0:u.typename)!==t)&&(u=r[c]={typename:t});const d=a[c];if(typeof d=="function")u.read=d;else{const{keyArgs:h,read:p,merge:m}=d;u.keyFn=h===!1?I6:On(h)?A6(h):typeof h=="function"?h:u.keyFn,typeof p=="function"&&(u.read=p),s(u,m)}u.read&&u.merge&&(u.keyFn=u.keyFn||I6)})}setRootTypename(t,n=t){const r="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[r];n!==i&&(at(!i||i===t,108,t),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[n]=r,this.rootTypenamesById[r]=n)}addPossibleTypes(t){this.usingPossibleTypes=!0,Object.keys(t).forEach(n=>{this.getSupertypeSet(n,!0),t[n].forEach(r=>{this.getSupertypeSet(r,!0).add(n);const i=r.match(v6);(!i||i[0]!==r)&&this.fuzzySubtypes.set(r,new RegExp(r))})})}getTypePolicy(t){if(!jn.call(this.typePolicies,t)){const r=this.typePolicies[t]={};r.fields={};let i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach((o,a)=>{if(o.test(t)){const s=this.supertypeMap.get(a);s&&s.forEach(c=>i.add(c))}})),i&&i.size&&i.forEach(o=>{const{fields:a,...s}=this.getTypePolicy(o);Object.assign(r,s),Object.assign(r.fields,a)})}const n=this.toBeAdded[t];return n&&n.length&&n.splice(0).forEach(r=>{this.updateTypePolicy(t,r,this.typePolicies[t].fields)}),this.typePolicies[t]}getFieldPolicy(t,n){if(t)return this.getTypePolicy(t).fields[n]}getSupertypeSet(t,n){let r=this.supertypeMap.get(t);return!r&&n&&this.supertypeMap.set(t,r=new Set),r}fragmentMatches(t,n,r,i){if(!t.typeCondition)return!0;if(!n)return!1;const o=t.typeCondition.name.value;if(n===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o)){const a=this.getSupertypeSet(n,!0),s=[a],c=d=>{const h=this.getSupertypeSet(d,!1);h&&h.size&&s.indexOf(h)<0&&s.push(h)};let u=!!(r&&this.fuzzySubtypes.size);for(let d=0;d<s.length;++d){const h=s[d];if(h.has(o))return a.has(o)||a.add(o),!0;h.forEach(c),u&&d===s.length-1&&Mp(t.selectionSet,r,i)&&(u=!1,this.fuzzySubtypes.forEach((p,m)=>{const y=n.match(p);y&&y[0]===n&&c(m)}))}}return!1}hasKeyArgs(t,n){const r=this.getFieldPolicy(t,n);return!!(r&&r.keyFn)}getStoreFieldName(t){const{typename:n,fieldName:r}=t,i=this.getFieldPolicy(n,r);let o,a=i&&i.keyFn;if(a&&n){const s={typename:n,fieldName:r,field:t.field||null,variables:t.variables},c=Vp(t);for(;a;){const u=a(c,s);if(On(u))a=A6(u);else{o=u||r;break}}}return o===void 0&&(o=t.field?ok(t.field,t.variables):Bb(r,Vp(t))),o===!1?r:r===ms(o)?o:r+":"+o}readField(t,n){const r=t.from;if(!r||!(t.field||t.fieldName))return;if(t.typename===void 0){const d=n.store.getFieldValue(r,"__typename");d&&(t.typename=d)}const o=this.getStoreFieldName(t),a=ms(o),s=n.store.getFieldValue(r,o),c=this.getFieldPolicy(t.typename,a),u=c&&c.read;if(u){const d=F6(this,r,t,n,n.store.getStorage(Jt(r)?r.__ref:r,o));return N6.withValue(this.cache,u,[s,d])}return s}getReadFunction(t,n){const r=this.getFieldPolicy(t,n);return r&&r.read}getMergeFunction(t,n,r){let i=this.getFieldPolicy(t,n),o=i&&i.merge;return!o&&r&&(i=this.getTypePolicy(r),o=i&&i.merge),o}runMergeFunction(t,n,{field:r,typename:i,merge:o,path:a},s,c){var p,m,y;const u=t;if(o===M6)return j6(s.store)(t,n);if(o===L6)return n;s.overwrite&&(t=void 0);const d=(y=(m=(p=s.extensions)==null?void 0:p[Do])==null?void 0:m.deref())==null?void 0:y.peekArray(a);if(d){const{current:b,previous:v}=d;if(v&&pt(v.incoming,n)&&pt(v.streamFieldInfo,b))return v.result}const h=o(t,n,Wk(this,void 0,{typename:i,fieldName:r.name.value,field:r,variables:s.variables,path:a},s,c||{},u));return d&&(d.previous={incoming:n,streamFieldInfo:d.current,result:h}),h}}function F6(e,t,n,r,i){const o=e.getStoreFieldName(n),a=ms(o),s=n.variables||r.variables,{toReference:c,canRead:u}=r.store;return{args:Vp(n),field:n.field||null,fieldName:a,storeFieldName:o,variables:s,isReference:Jt,toReference:c,storage:i,cache:e.cache,canRead:u,readField(...d){return e.readField(Up(d,t,s),r)},mergeObjects:j6(r.store)}}function Wk(e,t,n,r,i,o){var c;const a={...F6(e,t,n,r,i),extensions:r.extensions,existingData:o},s=r.extensions;if(s&&Do in s){const{[Do]:u,...d}=s,h=(c=u==null?void 0:u.deref())==null?void 0:c.peekArray(n.path);h&&(a.streamFieldInfo=h.current),a.extensions=Object.keys(d).length===0?void 0:d}return a}function Up(e,t,n){const{0:r,1:i,length:o}=e;let a;return typeof r=="string"?a={fieldName:r,from:o>1?i:t}:(a={...r},jn.call(a,"from")||(a.from=t)),a.variables===void 0&&(a.variables=n),a}function j6(e){return function(n,r){if(On(n)||On(r))throw si(111);if(rr(n)&&rr(r)){const i=e.getFieldValue(n,"__typename"),o=e.getFieldValue(r,"__typename");if(i&&o&&i!==o)return r;if(Jt(n)&&gs(r))return e.merge(n.__ref,r),n;if(gs(n)&&Jt(r))return e.merge(n,r.__ref),r;if(gs(n)&&gs(r))return{...n,...r}}return r}}function D6(e){return[e.selectionSet,e.objectOrReference,e.context]}class Gk{constructor(t){se(this,"executeSelectionSet");se(this,"executeSubSelectedArray");se(this,"config");se(this,"knownResults",new WeakMap);this.config=t,this.executeSelectionSet=Hl(n=>{const r=D6(n),i=this.executeSelectionSet.peek(...r);return i||(S6(n.context.store,n.enclosingRef.__ref),this.execSelectionSetImpl(n))},{max:po["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:D6,makeCacheKey(n,r,i){if(Wl(i.store))return i.store.makeCacheKey(n,Jt(r)?r.__ref:r,i.varString)}}),this.executeSubSelectedArray=Hl(n=>(S6(n.context.store,n.enclosingRef.__ref),this.execSubSelectedArrayImpl(n)),{max:po["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:n,array:r,context:i}){if(Wl(i.store))return i.store.makeCacheKey(n,r,i.varString)}})}diffQueryAgainstStore({store:t,query:n,rootId:r="ROOT_QUERY",variables:i,returnPartialData:o=!0}){const a=this.config.cache.policies;i={...Ep(YA(n)),...i};const s=fs(r),c=this.executeSelectionSet({selectionSet:Sp(n).selectionSet,objectOrReference:s,enclosingRef:s,context:{store:t,query:n,policies:a,variables:i,varString:go(i),...y6(n,this.config.fragments)}});let u;c.missing&&(u=new Ip(Yk(c.missing),c.missing,n,i));const d=!u,{result:h}=c;return{result:d?h:o?Object.keys(h).length===0?null:h:null,complete:d,missing:u}}isFresh(t,n,r,i){if(Wl(i.store)&&this.knownResults.get(t)===r){const o=this.executeSelectionSet.peek(r,n,i);if(o&&t===o.result)return!0}return!1}execSelectionSetImpl({selectionSet:t,objectOrReference:n,enclosingRef:r,context:i}){if(Jt(n)&&!i.policies.rootTypenamesById[n.__ref]&&!i.store.has(n.__ref))return{result:{},missing:`Dangling reference to missing ${n.__ref} object`};const{variables:o,policies:a,store:s}=i,c=s.getFieldValue(n,"__typename"),u=[];let d;const h=new cs;typeof c=="string"&&!a.rootIdsByTypename[c]&&u.push({__typename:c});function p(S,w){return S.missing&&(d=h.merge(d,{[w]:S.missing})),S.result}const m=new Set(t.selections);m.forEach(S=>{if(Mu(S,o))if(Ul(S)){let w=a.readField({fieldName:S.name.value,field:S,variables:i.variables,from:n},i);const A=hs(S);w===void 0?d6.added(S)||(d=h.merge(d,{[A]:`Can't find field '${S.name.value}' on ${Jt(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)}`})):On(w)?w.length>0&&(w=p(this.executeSubSelectedArray({field:S,array:w,enclosingRef:r,context:i}),A)):S.selectionSet&&w!=null&&(w=p(this.executeSelectionSet({selectionSet:S.selectionSet,objectOrReference:w,enclosingRef:Jt(w)?w:r,context:i}),A)),w!==void 0&&u.push({[A]:w})}else{const w=Iu(S,i.lookupFragment);if(!w&&S.kind===xt.FRAGMENT_SPREAD)throw si(112,S.name.value);w&&a.fragmentMatches(w,c)&&w.selectionSet.selections.forEach(m.add,m)}});const b={result:XA(u),missing:d},v=b;return v.result&&this.knownResults.set(v.result,t),v}execSubSelectedArrayImpl({field:t,array:n,enclosingRef:r,context:i}){let o,a=new cs;function s(c,u){return c.missing&&(o=a.merge(o,{[u]:c.missing})),c.result}return t.selectionSet&&(n=n.filter(c=>c===void 0||i.store.canRead(c))),n=n.map((c,u)=>c===null?null:On(c)?s(this.executeSubSelectedArray({field:t,array:c,enclosingRef:r,context:i}),u):t.selectionSet?s(this.executeSelectionSet({selectionSet:t.selectionSet,objectOrReference:c,enclosingRef:Jt(c)?c:r,context:i}),u):c),{result:n,missing:o}}}function Yk(e){try{JSON.stringify(e,(t,n)=>{if(typeof n=="string")throw n;return n})}catch(t){return t}}function Bp(e,t,n){const r=`${t}${n}`;let i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:{...e,clientOnly:t,deferred:n}),i}class Zk{constructor(t,n,r){se(this,"cache");se(this,"reader");se(this,"fragments");this.cache=t,this.reader=n,this.fragments=r}writeToStore(t,{query:n,result:r,dataId:i,variables:o,overwrite:a,extensions:s}){const c=mo(n),u=Nk();o={...Ep(c),...o};const d={store:t,written:{},merge(p,m){return u.merge(p,m)},variables:o,varString:go(o),...y6(n,this.fragments),overwrite:!!a,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map,extensions:s},h=this.processSelectionSet({result:r||{},dataId:i,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:d,path:[]});if(!Jt(h))throw si(114,r);return d.incomingById.forEach(({storeObject:p,mergeTree:m,fieldNodeSet:y},b)=>{const v=fs(b);if(m&&m.map.size){const S=this.applyMerges(m,v,p,d);if(Jt(S))return;p=S}t.merge(b,p)}),t.retain(h.__ref),h}processSelectionSet({dataId:t,result:n,selectionSet:r,context:i,mergeTree:o,path:a}){const{policies:s}=this.cache;let c={};const u=t&&s.rootTypenamesById[t]||Hp(n,r,i.fragmentMap)||t&&i.store.get(t,"__typename");typeof u=="string"&&(c.__typename=u);const d=(...p)=>{const m=Up(p,c,i.variables);if(Jt(m.from)){const y=i.incomingById.get(m.from.__ref);if(y){const b=s.readField({...m,from:y.storeObject},i);if(b!==void 0)return b}}return s.readField(m,i)},h=new Set;this.flattenFields(r,n,i,u).forEach((p,m)=>{var S;const y=hs(m),b=n[y],v=[...a,m.name.value];if(h.add(m),b!==void 0){const w=s.getStoreFieldName({typename:u,fieldName:m.name.value,field:m,variables:p.variables}),A=U6(o,w);let _=this.processFieldValue(b,m,m.selectionSet?Bp(p,!1,!1):p,A,v),C;m.selectionSet&&(Jt(_)||gs(_))&&(C=d("__typename",_));const k=s.getMergeFunction(u,m.name.value,C);k?A.info={field:m,typename:u,merge:k,path:v}:ds(["stream"],m)&&Array.isArray(_)&&((S=p.extensions)!=null&&S[Do])?A.info={field:m,typename:u,merge:zk,path:v}:B6(o,w),c=p.merge(c,{[w]:_})}});try{const[p,m]=s.identify(n,{typename:u,selectionSet:r,fragmentMap:i.fragmentMap,storeObject:c,readField:d});t=t||p,m&&(c=i.merge(c,m))}catch(p){if(!t)throw p}if(typeof t=="string"){const p=fs(t),m=i.written[t]||(i.written[t]=[]);if(m.indexOf(r)>=0||(m.push(r),this.reader&&this.reader.isFresh(n,p,r,i)))return p;const y=i.incomingById.get(t);return y?(y.storeObject=i.merge(y.storeObject,c),y.mergeTree=zp(y.mergeTree,o),h.forEach(b=>y.fieldNodeSet.add(b))):i.incomingById.set(t,{storeObject:c,mergeTree:zu(o)?void 0:o,fieldNodeSet:h}),p}return c}processFieldValue(t,n,r,i,o){return!n.selectionSet||t===null?t:On(t)?t.map((a,s)=>{const c=this.processFieldValue(a,n,r,U6(i,s),[...o,s]);return B6(i,s),c}):this.processSelectionSet({result:t,selectionSet:n.selectionSet,context:r,mergeTree:i,path:o})}flattenFields(t,n,r,i=Hp(n,t,r.fragmentMap)){const o=new Map,{policies:a}=this.cache,s=new Qi(!1);return(function c(u,d){const h=s.lookup(u,d.clientOnly,d.deferred);h.visited||(h.visited=!0,u.selections.forEach(p=>{if(!Mu(p,r.variables))return;let{clientOnly:m,deferred:y}=d;if(!(m&&y)&&Cp(p.directives)&&p.directives.forEach(b=>{const v=b.name.value;if(v==="client"&&(m=!0),v==="defer"){const S=mp(b,r.variables);(!S||S.if!==!1)&&(y=!0)}}),Ul(p)){const b=o.get(p);b&&(m=m&&b.clientOnly,y=y&&b.deferred),o.set(p,Bp(r,m,y))}else{const b=Iu(p,r.lookupFragment);if(!b&&p.kind===xt.FRAGMENT_SPREAD)throw si(116,p.name.value);b&&a.fragmentMatches(b,i,n,r.variables)&&c(b.selectionSet,Bp(r,m,y))}}))})(t,r),o}applyMerges(t,n,r,i,o){if(t.map.size&&!Jt(r)){const a=!On(r)&&(Jt(n)||gs(n))?n:void 0,s=r;a&&!o&&(o=[Jt(a)?a.__ref:a]);let c;const u=(d,h)=>On(d)?typeof h=="number"?d[h]:void 0:i.store.getFieldValue(d,String(h));t.map.forEach((d,h)=>{const p=u(a,h),m=u(s,h);if(m===void 0)return;o&&o.push(h);const y=this.applyMerges(d,p,m,i,o);y!==m&&(c=c||new Map,c.set(h,y)),o&&at(o.pop()===h)}),c&&(r=On(s)?s.slice(0):{...s},c.forEach((d,h)=>{r[h]=d}))}return t.info?this.cache.policies.runMergeFunction(n,r,t.info,i,o&&i.store.getStorage(...o)):r}}const V6=[];function U6({map:e},t){return e.has(t)||e.set(t,V6.pop()||{map:new Map}),e.get(t)}function zp(e,t){if(e===t||!t||zu(t))return e;if(!e||zu(e))return t;const n=e.info&&t.info?{...e.info,...t.info}:e.info||t.info,r=e.map.size&&t.map.size,i=r?new Map:e.map.size?e.map:t.map,o={info:n,map:i};if(r){const a=new Set(t.map.keys());e.map.forEach((s,c)=>{o.map.set(c,zp(s,t.map.get(c))),a.delete(c)}),a.forEach(s=>{o.map.set(s,zp(t.map.get(s),e.map.get(s)))})}return o}function zu(e){return!e||!(e.info||e.map.size)}function B6({map:e},t){const n=e.get(t);n&&zu(n)&&(V6.push(n),e.delete(t))}function Hp(e,t,n){let r;for(const i of t.selections)if(Ul(i)){if(i.name.value==="__typename")return e[hs(i)]}else r?r.push(i):r=[i];if(typeof e.__typename=="string")return e.__typename;if(r)for(const i of r){const o=Hp(e,Iu(i,n).selectionSet,n);if(typeof o=="string")return o}}class Kk extends xk{constructor(n={}){super();se(this,"data");se(this,"optimisticData");se(this,"config");se(this,"watches",new Set);se(this,"storeReader");se(this,"storeWriter");se(this,"addTypenameTransform",new vo(d6));se(this,"maybeBroadcastWatch");se(this,"assumeImmutableResults",!0);se(this,"policies");se(this,"makeVar",Vk);se(this,"txCount",0);this.config=Ok(n),this.policies=new Hk({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const n=this.data=new Bu.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=n.stump,this.resetResultCache()}resetResultCache(){const{fragments:n}=this.config;this.addTypenameTransform.resetCache(),n==null||n.resetCaches(),this.storeWriter=new Zk(this,this.storeReader=new Gk({cache:this,fragments:n}),n),this.maybeBroadcastWatch=Hl((r,i)=>this.broadcastWatch(r,i),{max:po["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:r=>{const i=r.optimistic?this.optimisticData:this.data;if(Wl(i)){const{optimistic:o,id:a,variables:s}=r;return i.makeCacheKey(r.query,r.callback,go({optimistic:o,id:a,variables:s}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(r=>r.resetCaching())}restore(n){return this.init(),n&&this.data.replace(n),this}extract(n=!1){return(n?this.optimisticData:this.data).extract()}read(n){const{returnPartialData:r=!1}=n;return this.storeReader.diffQueryAgainstStore({...n,store:n.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r}).result}write(n){try{return++this.txCount,this.storeWriter.writeToStore(this.data,n)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}}modify(n){if(jn.call(n,"id")&&!n.id)return!1;const r=n.optimistic?this.optimisticData:this.data;try{return++this.txCount,r.modify(n.id||"ROOT_QUERY",n.fields,!1)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}}diff(n){return this.storeReader.diffQueryAgainstStore({...n,store:n.optimistic?this.optimisticData:this.data,rootId:n.id||"ROOT_QUERY",config:this.config})}watch(n){return this.watches.size||Dk(this),this.watches.add(n),n.immediate&&this.maybeBroadcastWatch(n),()=>{this.watches.delete(n)&&!this.watches.size&&P6(this),this.maybeBroadcastWatch.forget(n)}}gc(n){go.reset(),Sa.reset();const r=this.optimisticData.gc();return n&&!this.txCount&&n.resetResultCache&&this.resetResultCache(),r}retain(n,r){return(r?this.optimisticData:this.data).retain(n)}release(n,r){return(r?this.optimisticData:this.data).release(n)}identify(n){if(Jt(n))return n.__ref;try{return this.policies.identify(n)[0]}catch{}}evict(n){if(!n.id){if(jn.call(n,"id"))return!1;n={...n,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(n,this.data)}finally{!--this.txCount&&n.broadcast!==!1&&this.broadcastWatches()}}reset(n){return this.init(),go.reset(),n&&n.discardWatches?(this.watches.forEach(r=>this.maybeBroadcastWatch.forget(r)),this.watches.clear(),P6(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(n){const r=this.optimisticData.removeLayer(n);r!==this.optimisticData&&(this.optimisticData=r,this.broadcastWatches())}batch(n){const{update:r,optimistic:i=!0,removeOptimistic:o,onWatchUpdated:a}=n;let s;const c=d=>{const{data:h,optimisticData:p}=this;++this.txCount,d&&(this.data=this.optimisticData=d);try{return s=r(this)}finally{--this.txCount,this.data=h,this.optimisticData=p}},u=new Set;return a&&!this.txCount&&this.broadcastWatches({...n,onWatchUpdated(d){return u.add(d),!1}}),typeof i=="string"?this.optimisticData=this.optimisticData.addLayer(i,c):i===!1?c(this.data):c(),typeof o=="string"&&(this.optimisticData=this.optimisticData.removeLayer(o)),a&&u.size?(this.broadcastWatches({...n,onWatchUpdated(d,h){const p=a.call(this,d,h);return p!==!1&&u.delete(d),p}}),u.size&&u.forEach(d=>this.maybeBroadcastWatch.dirty(d))):this.broadcastWatches(n),s}performTransaction(n,r){return this.batch({update:n,optimistic:r||r!==null})}transformDocument(n){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(n))}fragmentMatches(n,r){return this.policies.fragmentMatches(n,r)}lookupFragment(n){var r;return((r=this.config.fragments)==null?void 0:r.lookup(n))||null}resolvesClientField(n,r){return!!this.policies.getReadFunction(n,r)}broadcastWatches(n){if(!this.txCount){const r=this.onAfterBroadcast,i=new Set;this.onAfterBroadcast=o=>{i.add(o)};try{this.watches.forEach(o=>this.maybeBroadcastWatch(o,n)),i.forEach(o=>o())}finally{this.onAfterBroadcast=r}}}addFragmentsToDocument(n){const{fragments:r}=this.config;return r?r.transform(n):n}broadcastWatch(n,r){const{lastDiff:i}=n,o=this.diff(n);r&&(n.optimistic&&typeof r.optimistic=="string"&&(o.fromOptimisticTransaction=!0),r.onWatchUpdated&&r.onWatchUpdated.call(this,n,o,i)===!1)||(!i||!pt(i.result,o.result))&&n.callback(n.lastDiff=o,i)}}function Zl(e,t){return typeof e=="object"&&e!==null&&e[Symbol.for("apollo.error")]===t}function Kl(e){Object.defineProperty(e,Symbol.for("apollo.error"),{value:e.name,enumerable:!1,writable:!1,configurable:!1})}function z6(e){return e.map(t=>t.message||"Error message not found.").join(`
|
|
40
40
|
`)}const ru=class ru extends Error{constructor(n){super(ru.formatMessage(n,{defaultFormatMessage:z6}));se(this,"errors");this.name="CombinedProtocolErrors",this.errors=n,Kl(this),Object.setPrototypeOf(this,ru.prototype)}static is(n){return Zl(n,"CombinedProtocolErrors")}};se(ru,"formatMessage",z6);let Hu=ru;function Qk(e){return e!==null&&typeof e=="object"&&typeof e.message=="string"&&typeof e.name=="string"&&(typeof e.stack=="string"||typeof e.stack>"u")}class Wp extends Error{static is(t){return Zl(t,"UnconventionalError")}constructor(t){super("An error of unexpected shape occurred.",{cause:t}),this.name="UnconventionalError",Kl(this),Object.setPrototypeOf(this,Wp.prototype)}}function H6(e){return e.filter(t=>t).map(t=>t.message||"Error message not found.").join(`
|
|
41
|
-
`)}const iu=class iu extends Error{constructor(n,r=n.errors||[]){super(iu.formatMessage(r,{result:n,defaultFormatMessage:H6}));se(this,"errors");se(this,"data");se(this,"extensions");this.errors=r,this.data=n.data,this.extensions=n.extensions,this.name="CombinedGraphQLErrors",Kl(this),Object.setPrototypeOf(this,iu.prototype)}static is(n){return Zl(n,"CombinedGraphQLErrors")}};se(iu,"formatMessage",H6);let yo=iu;const Jk=new WeakSet;function qk(e){Jk.add(e)}class Wu extends Error{constructor(n,r){super(n);se(this,"response");se(this,"statusCode");se(this,"bodyText");this.name="ServerError",this.response=r.response,this.statusCode=r.response.status,this.bodyText=r.bodyText,Kl(this),Object.setPrototypeOf(this,Wu.prototype)}static is(n){return Zl(n,"ServerError")}}class Gu extends Error{constructor(n,r){super(n instanceof Error?n.message:"Could not parse server response",{cause:n});se(this,"response");se(this,"statusCode");se(this,"bodyText");this.name="ServerParseError",this.response=r.response,this.statusCode=r.response.status,this.bodyText=r.bodyText,Kl(this),Object.setPrototypeOf(this,Gu.prototype)}static is(n){return Zl(n,"ServerParseError")}}const Ql=Symbol();function W6(e){return"extensions"in e?Hu.is(e.extensions[Ql]):!1}function Gp(e){return Qk(e)?e:typeof e=="string"?new Error(e,{cause:e}):new Wp(e)}var Je;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error",e[e.streaming=9]="streaming"})(Je||(Je={}));const{assign:G6}=Object,ys={loading:!0,networkStatus:Je.loading,data:void 0,dataState:"empty",partial:!0},Yp={loading:!1,networkStatus:Je.ready,data:void 0,dataState:"empty",partial:!0};Qx=Symbol.observable;class Zp{constructor({queryManager:t,options:n,transformedQuery:r=t.transform(n.query)}){se(this,"options");se(this,"queryName");se(this,"variablesUnknown",!1);se(this,"_lastWrite");se(this,"unsubscribeFromCache");se(this,"input");se(this,"subject");se(this,"isTornDown");se(this,"queryManager");se(this,"subscriptions",new Set);se(this,"waitForNetworkResult");se(this,"lastQuery");se(this,"linkSubscription");se(this,"pollingInfo");se(this,"subscribe");se(this,"pipe");se(this,Qx);se(this,"@@observable");se(this,"stableLastResult");se(this,"didWarnCacheOnlyPolling",!1);se(this,"dirty",!1);se(this,"notifyTimeout");se(this,"activeOperations",new Set);se(this,"operator",_p(t=>{const{query:n,variables:r,meta:i}=t;if(t.source==="setResult")return{query:n,variables:r,result:t.value,meta:i};if(t.kind==="C"||!Jl(t,this))return;let o;const a=this.subject.getValue();if(t.source==="cache"){if(o=t.value,o.networkStatus===Je.ready&&o.partial&&(!this.options.returnPartialData||a.result.networkStatus===Je.error)&&this.options.fetchPolicy!=="cache-only")return}else if(t.source==="network")this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),o=t.kind==="E"?{...Jl(a,t)?a.result:{data:void 0,dataState:"empty",partial:!0},error:t.error,networkStatus:Je.error,loading:!1}:t.value,t.kind==="E"&&o.dataState==="streaming"&&(o.dataState="complete"),o.error&&(i.shouldEmit=1);else if(t.source==="newNetworkStatus"){const s=Jl(a,t)?a.result:this.getInitialResult(i.fetchPolicy),{resetError:c}=t.value,u=c?void 0:s.error,d=u?Je.error:Je.ready;o={...s,error:u,networkStatus:d}}return at(o),o.error||delete o.error,o.networkStatus=this.calculateNetworkStatus(o.networkStatus),o.loading=Vu(o.networkStatus),o=this.maskResult(o),a.result.data!==void 0&&o.data!==a.result.data&&pt(o.data,a.result.data)&&(o.data=a.result.data),{query:n,variables:r,result:o,meta:i}}));this.queryManager=t,this.waitForNetworkResult=n.fetchPolicy==="network-only",this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:i="cache-first"}={}}=t.defaultOptions,{fetchPolicy:o=i,initialFetchPolicy:a=o==="standby"?i:o}=n;n[xp]&&(at(o==="standby",82),this.variablesUnknown=!0),this.lastQuery=r,this.options={...n,initialFetchPolicy:a,fetchPolicy:o,variables:this.getVariablesWithDefaults(n.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const s=mo(this.query);this.queryName=s&&s.name&&s.name.value}get query(){return this.lastQuery}get variables(){return this.options.variables}get networkStatus(){return this.subject.getValue().result.networkStatus}get cache(){return this.queryManager.cache}initializeObservablesQueue(){this.subject=new Y3({query:this.query,variables:this.variables,result:ys,meta:{}});const t=this.subject.pipe(Ll({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),_p(({query:n,variables:r,result:i,meta:o},a)=>{const{shouldEmit:s}=o;if(i===ys&&(a.previous=void 0,a.previousVariables=void 0),this.options.fetchPolicy==="standby"||s===2)return;if(s===1)return d();const{previous:c,previousVariables:u}=a;if(c){const h=this.queryManager.getDocumentInfo(n),p=this.queryManager.dataMasking,m=p?h.nonReactiveQuery:n;if((p||h.hasNonreactiveDirective?Wb(m,c,i,r):pt(c,i))&&pt(u,r))return}if(s===3&&(!this.options.notifyOnNetworkStatusChange||pt(c,i)))return;return d();function d(){return a.previous=i,a.previousVariables=r,i}},()=>({})));this.pipe=t.pipe.bind(t),this.subscribe=t.subscribe.bind(t),this.input=new os,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}getCacheDiff({optimistic:t=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:t})}getInitialResult(t){let n=t||this.options.fetchPolicy;this.queryManager.prioritizeCacheValues&&(n==="network-only"||n==="cache-and-network")&&(n="cache-first");const r=()=>{const i=this.getCacheDiff(),o=this.options.returnPartialData||i.complete?i.result??void 0:void 0;return this.maskResult({data:o,dataState:i.complete?"complete":o===void 0?"empty":"partial",loading:!i.complete,networkStatus:i.complete?Je.ready:Je.loading,partial:!i.complete})};switch(n){case"cache-only":return{...r(),loading:!1,networkStatus:Je.ready};case"cache-first":return r();case"cache-and-network":return{...r(),loading:!0,networkStatus:Je.loading};case"standby":return Yp;default:return ys}}resubscribeCache(){var c;const{variables:t,fetchPolicy:n}=this.options,r=this.query,i=n==="standby"||n==="no-cache"||this.waitForNetworkResult,o=!Jl({query:r,variables:t},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((i||o)&&((c=this.unsubscribeFromCache)==null||c.call(this)),i||!o)return;const a={query:r,variables:t,optimistic:!0,watcher:this,callback:u=>{const d=this.queryManager.getDocumentInfo(r);if((d.hasClientExports||d.hasForcedResolvers)&&(a.lastDiff=void 0),a.lastOwnDiff===u)return;const{result:h}=this.subject.getValue();!u.complete&&(h.error||h===ys||h===Yp)||pt(h.data,u.result)||this.scheduleNotify()}},s=this.cache.watch(a);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,s()},{query:r,variables:t})}getCurrentResult(){const{result:t}=this.subject.getValue();let n=t.networkStatus===Je.error||this.hasObservers()||this.options.fetchPolicy==="no-cache"?t:this.getInitialResult();return n===ys&&(n=this.getInitialResult()),pt(this.stableLastResult,n)||(this.stableLastResult=n),this.stableLastResult}refetch(t){const{fetchPolicy:n}=this.options,r={pollInterval:0};return n==="no-cache"?r.fetchPolicy="no-cache":r.fetchPolicy="network-only",t&&!pt(this.variables,t)&&(r.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...t})),this._lastWrite=void 0,this._reobserve(r,{newNetworkStatus:Je.refetch})}fetchMore({query:t,variables:n,context:r,errorPolicy:i,updateQuery:o}){at(this.options.fetchPolicy!=="cache-only",84,ls(this.query,"(anonymous)"));const a={...zr(this.options,{errorPolicy:"none"},{query:t,context:r,errorPolicy:i}),variables:t?n:{...this.variables,...n},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};a.query=this.transformDocument(a.query),this.lastQuery=t?this.transformDocument(this.options.query):a.query;let s=!1;const c=this.options.fetchPolicy!=="no-cache";c||at(o,85);const{finalize:u,pushNotification:d}=this.pushOperation(Je.fetchMore);d({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:h,operator:p}=Y6(),{observable:m}=this.queryManager.fetchObservableWithInfo(a,{networkStatus:Je.fetchMore,exposeExtensions:!0}),y=m.pipe(p,Lb(b=>b.kind==="N"&&b.source==="network")).subscribe({next:b=>{s=!1;const v=b.value,S=v[Yb];if(h6(b.value.networkStatus)&&u(),c){const w=this.getCacheDiff();this.cache.batch({update:A=>{o?A.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:S},_=>o(_,{fetchMoreResult:v.data,variables:a.variables})):A.writeQuery({query:a.query,variables:a.variables,data:v.data,extensions:S})},onWatchUpdated:(A,_)=>{if(A.watcher===this&&!pt(_.result,w.result)){s=!0;const C=this.getCurrentResult();Vu(v.networkStatus)&&d({kind:"N",source:"network",value:{...C,networkStatus:v.networkStatus===Je.error?Je.ready:v.networkStatus,loading:!1,data:_.result,dataState:v.dataState==="streaming"?"streaming":"complete"}})}}})}else{const w=this.getCurrentResult(),A=o(w.data,{fetchMoreResult:v.data,variables:a.variables});d({kind:"N",value:{...w,networkStatus:Je.ready,loading:!1,data:A,dataState:w.dataState==="streaming"?"streaming":"complete"},source:"network"})}}});return wp(h.then(b=>Bl(this.maskResult(b))).finally(()=>{if(y.unsubscribe(),u(),c&&!s){const b=this.getCurrentResult();b.dataState==="streaming"?d({kind:"N",source:"network",value:{...b,dataState:"complete",networkStatus:Je.ready}}):d({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(t){const n=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:r=>{const{updateQuery:i,onError:o}=t,{error:a}=r;if(a){o?o(a):at.error(86,a);return}i&&this.updateQuery((s,c)=>i(s,{subscriptionData:r,...c}))}});return this.subscriptions.add(n),()=>{this.subscriptions.delete(n)&&n.unsubscribe()}}applyOptions(t){const n=zr(this.options,t||{});G6(this.options,n),this.updatePolling()}async setVariables(t){return t=this.getVariablesWithDefaults(t),pt(this.variables,t)?Bl(this.getCurrentResult()):(this.options.variables=t,this.hasObservers()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},{newNetworkStatus:Je.setVariables}):Bl(this.getCurrentResult()))}updateQuery(t){const{queryManager:n}=this,{result:r,complete:i}=this.getCacheDiff({optimistic:!1}),o=t(r,{variables:this.variables,complete:!!i,previousData:r});o&&(this.cache.writeQuery({query:this.options.query,data:o,variables:this.variables}),n.broadcastQueries())}startPolling(t){this.options.pollInterval=t,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(t,n){if(n.nextFetchPolicy){const{fetchPolicy:r="cache-first",initialFetchPolicy:i=r}=n;r==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy.call(n,r,{reason:t,options:n,observable:this,initialFetchPolicy:i}):t==="variables-changed"?n.fetchPolicy=i:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy}fetch(t,n,r,i){const o=this.options.fetchPolicy;t.context??(t.context={});let a=!1;const s=()=>{a=!0},c=v=>new Yt(S=>{try{return v.subscribe({next(w){a=!0,S.next(w)},error:w=>S.error(w),complete:()=>S.complete()})}finally{a||(m.override=n,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:h,variables:p,meta:{shouldEmit:3,fetchPolicy:o}}))}});let{observable:u,fromLink:d}=this.queryManager.fetchObservableWithInfo(t,{networkStatus:n,query:r,onCacheHit:s,fetchQueryOperator:c,observableQuery:this});const{query:h,variables:p}=this,m={abort:()=>{b.unsubscribe()},query:h,variables:p};this.activeOperations.add(m);let y=n==Je.refetch||n==Je.setVariables;u=u.pipe(i,Ml());const b=u.pipe(Ll({next:v=>{v.source==="newNetworkStatus"||v.kind==="N"&&v.value.loading?m.override=n:delete m.override},finalize:()=>this.activeOperations.delete(m)})).subscribe({next:v=>{const S={};y&&v.kind==="N"&&"loading"in v.value&&!v.value.loading&&(y=!1,S.shouldEmit=1),this.input.next({...v,query:h,variables:p,meta:S})}});return{fromLink:d,subscription:b,observable:u}}updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:t,options:{fetchPolicy:n,pollInterval:r}}=this,i=()=>{const{options:c}=this;return!c.pollInterval||!this.hasObservers()||c.fetchPolicy==="cache-only"||c.fetchPolicy==="standby"};if(i()){this.cancelPolling();return}if((t==null?void 0:t.interval)===r)return;const o=t||(this.pollingInfo={});o.interval=r;const a=()=>{var c,u;if(i())return this.cancelPolling();this.pollingInfo&&(!Vu(this.networkStatus)&&!((u=(c=this.options).skipPollAttempt)!=null&&u.call(c))?this._reobserve({fetchPolicy:this.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},{newNetworkStatus:Je.poll}).then(s,s):s())},s=()=>{const c=this.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(a,c.interval))};s()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(t){return this._reobserve(t)}_reobserve(t,n){this.isTornDown=!1;let{newNetworkStatus:r}=n||{};this.queryManager.obsQueries.add(this);const i=r===Je.refetch||r===Je.poll,o=this.variables,a=this.options.fetchPolicy,s=zr(this.options,t||{});this.variablesUnknown&&(this.variablesUnknown=s.fetchPolicy==="standby");const c=i?s:G6(this.options,s),u=this.transformDocument(c.query);this.lastQuery=u,t&&"variables"in t&&(c.variables=this.getVariablesWithDefaults(t.variables)),i||(this.updatePolling(),t&&t.variables&&!pt(t.variables,o)&&c.fetchPolicy!=="standby"&&(c.fetchPolicy===a||typeof c.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",c),r===void 0&&(r=Je.setVariables)));const d=this.networkStatus;r||(r=Je.loading,d!==Je.loading&&(t!=null&&t.variables)&&!pt(t.variables,o)&&(r=Je.setVariables),c.fetchPolicy==="standby"&&(r=Je.ready)),c.fetchPolicy==="standby"&&this.cancelPolling(),this.resubscribeCache();const{promise:h,operator:p}=Y6(c.fetchPolicy==="standby"?{data:void 0}:void 0),{subscription:m,observable:y,fromLink:b}=this.fetch(c,r,u,p);!i&&(b||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=m);const v=Object.assign(wp(h.then(S=>Bl(this.maskResult(S))).finally(()=>{!this.hasObservers()&&this.activeOperations.size===0&&this.tearDownQuery()})),{retain:()=>{const S=y.subscribe({}),w=()=>S.unsubscribe();return h.then(w,w),v}});return v}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){var t;this.isTornDown||(this.resetNotifications(),(t=this.unsubscribeFromCache)==null||t.call(this),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(n=>n.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(t){return this.queryManager.transform(t)}maskResult(t){const n=this.queryManager.maskOperation({document:this.query,data:t.data,fetchPolicy:this.options.fetchPolicy,cause:this});return n===t.data?t:{...t,data:n}}resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(t=!1){if(!t){const r=this.queryManager.getDocumentInfo(this.query);if(r.hasClientExports||r.hasForcedResolvers)return}const{dirty:n}=this;if(this.resetNotifications(),n&&(this.options.fetchPolicy==="cache-only"||this.options.fetchPolicy==="cache-and-network"||!this.activeOperations.size)){const r=this.getCacheDiff();pt(r.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:r.result,dataState:r.complete?"complete":r.result?"partial":"empty",networkStatus:Je.ready,loading:!1,error:void 0,partial:!r.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}pushOperation(t){let n=!1;const{query:r,variables:i}=this,o=()=>{this.activeOperations.delete(a)},a={override:t,abort:()=>{n=!0,o()},query:r,variables:i};return this.activeOperations.add(a),{finalize:o,pushNotification:(s,c)=>{n||this.input.next({...s,query:r,variables:i,meta:{...c}})}}}calculateNetworkStatus(t){if(t===Je.streaming)return t;const n=Array.from(this.activeOperations.values()).reverse().find(r=>Jl(r,this)&&r.override!==void 0);return(n==null?void 0:n.override)??t}abortActiveOperations(){this.activeOperations.forEach(t=>t.abort())}reset(){const t=this.options.fetchPolicy==="cache-only";this.setResult(t?Yp:ys,{shouldEmit:t?1:2}),this.abortActiveOperations()}setResult(t,n){this.input.next({source:"setResult",kind:"N",value:t,query:this.query,variables:this.variables,meta:{...n}})}reobserveCacheFirst(){const{fetchPolicy:t,nextFetchPolicy:n}=this.options;t==="cache-and-network"||t==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(r,i){return this.nextFetchPolicy=n,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(r,i):t}}):this.reobserve()}getVariablesWithDefaults(t){return this.queryManager.getVariables(this.query,t)}}function Jl(e,t){return!!(e&&t&&e.query===t.query&&pt(e.variables,t.variables))}function Y6(e){let t=e,n,r;const i=new Promise((a,s)=>{n=a,r=s}),o=Ll({next(a){if(a.kind==="E")return r(a.error);a.kind==="N"&&a.source!=="newNetworkStatus"&&!a.value.loading&&(t=a.value)},finalize:()=>{if(t)n(t);else{const a="The operation was aborted.",s="AbortError";r(typeof DOMException<"u"?new DOMException(a,s):Object.assign(new Error(a),{name:s}))}}});return{promise:i,operator:o}}const Z6={},bs=new WeakMap;function Kp(e,t){const n=e[t];typeof n=="function"&&(e[t]=function(){return bs.set(e,(bs.get(e)+1)%1e15),n.apply(this,arguments)})}const K6=new WeakMap;class Qp{constructor(t,n){se(this,"lastRequestId",1);se(this,"cache");se(this,"queryManager");se(this,"id");se(this,"observableQuery");se(this,"incremental");se(this,"_lastWrite");const r=this.cache=t.cache,i=(K6.get(t)||0)+1;K6.set(t,i),this.id=i+"",this.observableQuery=n,this.queryManager=t,bs.has(r)||(bs.set(r,0),Kp(r,"evict"),Kp(r,"modify"),Kp(r,"reset"))}get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(t){(this.observableQuery||this)._lastWrite=t}resetLastWrite(){this.lastWrite=void 0}shouldWrite(t,n){var i,o;const{lastWrite:r}=this;return!(r&&r.dmCount===bs.get(this.cache)&&pt(n,r.variables)&&pt(t.data,r.result.data)&&((i=t.extensions)==null?void 0:i[Do])===((o=r.result.extensions)==null?void 0:o[Do]))}get hasNext(){return this.incremental?this.incremental.hasNext:!1}maybeHandleIncrementalResult(t,n,r){const{incrementalHandler:i}=this.queryManager;return i.isIncrementalResult(n)?(this.incremental||(this.incremental=i.startRequest({query:r})),this.incremental.handle(t,n)):n}markQueryResult(t,{document:n,variables:r,errorPolicy:i,cacheWriteBehavior:o}){var d;const a={query:n,variables:r,returnPartialData:!0,optimistic:!0};(d=this.observableQuery)==null||d.resetNotifications();const s=o===0,c=s?void 0:this.cache.diff(a);let u=this.maybeHandleIncrementalResult(c==null?void 0:c.result,t,n);return s||(Jp(u,i)?this.cache.batch({onWatchUpdated:(h,p)=>{h.watcher===this.observableQuery&&(h.lastOwnDiff=p)},update:h=>{if(this.shouldWrite(u,r))h.writeQuery({query:n,data:u.data,variables:r,overwrite:o===1,extensions:u.extensions}),this.lastWrite={result:u,variables:r,dmCount:bs.get(this.cache)};else if(c&&c.complete){u={...u,data:c.result};return}const p=h.diff(a);p.complete&&(u={...u,data:p.result})}}):this.lastWrite=void 0),u}markMutationResult(t,n,r=this.cache){const i=[],o=n.cacheWriteBehavior===0;let a=this.maybeHandleIncrementalResult(o?void 0:r.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(n.document).asQuery,variables:n.variables,optimistic:!1,returnPartialData:!0}).result,t,n.document);if(n.errorPolicy==="ignore"&&(a={...a,errors:[]}),us(a)&&n.errorPolicy==="none")return Promise.resolve(a);const s=()=>({...a,dataState:this.hasNext?"streaming":"complete"});if(!o&&Jp(a,n.errorPolicy)){i.push({result:a.data,dataId:"ROOT_MUTATION",query:n.document,variables:n.variables,extensions:a.extensions});const{updateQueries:u}=n;u&&this.queryManager.getObservableQueries("all").forEach(d=>{const h=d&&d.queryName;if(!h||!Object.hasOwnProperty.call(u,h))return;const p=u[h],{query:m,variables:y}=d,{result:b,complete:v}=d.getCacheDiff({optimistic:!1});if(v&&b){const S=p(b,{mutationResult:s(),queryName:m&&ls(m)||void 0,queryVariables:y});S&&i.push({result:S,dataId:"ROOT_QUERY",query:m,variables:y})}})}let c=n.refetchQueries;if(typeof c=="function"&&(c=c(s())),i.length>0||(c||"").length>0||n.update||n.onQueryUpdated||n.removeOptimistic){const u=[];if(this.queryManager.refetchQueries({updateCache:d=>{o||i.forEach(p=>d.write(p));const{update:h}=n;if(h){if(!o){const p=d.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(n.document).asQuery,variables:n.variables,optimistic:!1,returnPartialData:!0});p.complete&&(a={...a,data:p.result})}this.hasNext||h(d,a,{context:n.context,variables:n.variables})}!o&&!n.keepRootFields&&!this.hasNext&&d.modify({id:"ROOT_MUTATION",fields(p,{fieldName:m,DELETE:y}){return m==="__typename"?p:y}})},include:c,optimistic:!1,removeOptimistic:n.removeOptimistic,onQueryUpdated:n.onQueryUpdated||null}).forEach(d=>u.push(d)),n.awaitRefetchQueries||n.onQueryUpdated)return Promise.all(u).then(()=>a)}return Promise.resolve(a)}markMutationOptimistic(t,n){const r=typeof t=="function"?t(n.variables,{IGNORE:Z6}):t;return r===Z6?!1:(this.cache.recordOptimisticTransaction(i=>{try{this.markMutationResult({data:r},n,i)}catch(o){at.error(o)}},this.id),!0)}markSubscriptionResult(t,{document:n,variables:r,errorPolicy:i,cacheWriteBehavior:o}){o!==0&&(Jp(t,i)&&this.cache.write({query:n,result:t.data,dataId:"ROOT_SUBSCRIPTION",variables:r,extensions:t.extensions}),this.queryManager.broadcastQueries())}}function Jp(e,t="none"){const n=t==="ignore"||t==="all";let r=!us(e);return!r&&n&&e.data&&(r=!0),r}class Xk{constructor(t){se(this,"defaultOptions");se(this,"client");se(this,"clientOptions");se(this,"assumeImmutableResults");se(this,"documentTransform");se(this,"ssrMode");se(this,"defaultContext");se(this,"dataMasking");se(this,"incrementalHandler");se(this,"localState");se(this,"queryDeduplication");se(this,"prioritizeCacheValues",!1);se(this,"onBroadcast");se(this,"mutationStore");se(this,"obsQueries",new Set);se(this,"fetchCancelFns",new Map);se(this,"transformCache",new bp(po["queryManager.getDocumentInfo"]||2e3));se(this,"requestIdCounter",1);se(this,"inFlightLinkObservables",new Qi(!1));se(this,"noCacheWarningsByCause",new WeakSet);const n=new vo(i=>this.cache.transformDocument(i),{cache:!1});this.client=t.client,this.defaultOptions=t.defaultOptions,this.queryDeduplication=t.queryDeduplication,this.clientOptions=t.clientOptions,this.ssrMode=t.ssrMode,this.assumeImmutableResults=t.assumeImmutableResults,this.dataMasking=t.dataMasking,this.localState=t.localState,this.incrementalHandler=t.incrementalHandler;const r=t.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=t.defaultContext||{},(this.onBroadcast=t.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(t=>t.stop()),this.cancelPendingFetches(si(89))}cancelPendingFetches(t){this.fetchCancelFns.forEach(n=>n(t)),this.fetchCancelFns.clear()}async mutate({mutation:t,variables:n,optimisticResponse:r,updateQueries:i,refetchQueries:o=[],awaitRefetchQueries:a=!1,update:s,onQueryUpdated:c,fetchPolicy:u,errorPolicy:d,keepRootFields:h,context:p}){const m=new Qp(this);t=this.cache.transformForLink(this.transform(t));const{hasClientExports:y}=this.getDocumentInfo(t);n=this.getVariables(t,n),y&&(n=await this.localState.getExportedVariables({client:this.client,document:t,variables:n,context:p}));const b=this.mutationStore&&(this.mutationStore[m.id]={mutation:t,variables:n,loading:!0,error:null}),v=r&&m.markMutationOptimistic(r,{document:t,variables:n,cacheWriteBehavior:u==="no-cache"?0:2,errorPolicy:d,context:p,updateQueries:i,update:s,keepRootFields:h});return this.broadcastQueries(),new Promise((S,w)=>{const A={};return this.getObservableFromLink(t,{...p,optimisticResponse:v?r:void 0},n,u,{},!1).observable.pipe(Q6(),as(_=>{const C={..._};return ya(m.markMutationResult(C,{document:t,variables:n,cacheWriteBehavior:u==="no-cache"?0:2,errorPolicy:d,context:p,update:s,updateQueries:i,awaitRefetchQueries:a,refetchQueries:o,removeOptimistic:v?m.id:void 0,onQueryUpdated:c,keepRootFields:h}))})).pipe(Fo(_=>{if(us(_)&&d==="none")throw new yo(qp(_));return b&&(b.loading=!1,b.error=null),_})).subscribe({next:_=>{if(this.broadcastQueries(),!m.hasNext){const C={data:this.maskOperation({document:t,data:_.data,fetchPolicy:u,cause:A})};us(_)&&(C.error=new yo(_)),Object.keys(_.extensions||{}).length&&(C.extensions=_.extensions),S(C)}},error:_=>{if(b&&(b.loading=!1,b.error=_),v&&this.cache.removeOptimistic(m.id),this.broadcastQueries(),d==="ignore")return S({data:void 0});if(d==="all")return S({data:void 0,error:_});w(_)}})})}fetchQuery(t,n){return jo(t.query,ga.QUERY),(async()=>bA(this.fetchObservableWithInfo(t,{networkStatus:n}).observable.pipe(_p(r=>{switch(r.kind){case"E":throw r.error;case"N":if(r.source!=="newNetworkStatus")return Bl(r.value)}})),{defaultValue:{data:void 0}}))()}transform(t){return this.documentTransform.transformDocument(t)}getDocumentInfo(t){const{transformCache:n}=this;if(!n.has(t)){const i=mo(t),o={hasClientExports:ds(["client","export"],t,!0),hasForcedResolvers:JA(t),hasNonreactiveDirective:ds(["nonreactive"],t),hasIncrementalDirective:ds(["defer"],t),nonReactiveQuery:$k(t),clientQuery:ds(["client"],t)?t:null,serverQuery:$A([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],t),operationType:i==null?void 0:i.operation,defaultVars:Ep(i),asQuery:{...t,definitions:t.definitions.map(a=>a.kind==="OperationDefinition"&&a.operation!=="query"?{...a,operation:"query"}:a)}};n.set(t,o)}const r=n.get(t);if(r.violation)throw r.violation;return r}getVariables(t,n){const r=this.getDocumentInfo(t).defaultVars,i=Object.entries(n??{}).map(([o,a])=>[o,a===void 0?r[o]:a]);return{...r,...Object.fromEntries(i)}}watchQuery(t){jo(t.query,ga.QUERY);const n=this.transform(t.query);return t={...t,variables:this.getVariables(n,t.variables)},typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!0),new Zp({queryManager:this,options:t,transformedQuery:n})}query(t){const n=this.transform(t.query);return this.fetchQuery({...t,query:n}).then(r=>({...r,data:this.maskOperation({document:n,data:r==null?void 0:r.data,fetchPolicy:t.fetchPolicy})}))}generateRequestId(){return this.requestIdCounter++}clearStore(t={discardWatches:!0}){return this.cancelPendingFetches(si(91)),this.obsQueries.forEach(n=>{n.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(t)}getObservableQueries(t="active"){const n=new Set,r=new Map,i=new Map,o=new Set;return Array.isArray(t)&&t.forEach(a=>{if(typeof a=="string")r.set(a,a),i.set(a,!1);else if(qA(a)){const s=Sa(this.transform(a));r.set(s,ls(a)),i.set(s,!1)}else rr(a)&&a.query&&o.add(a)}),this.obsQueries.forEach(a=>{const s=Sa(this.transform(a.options.query));if(t==="all"){n.add(a);return}const{queryName:c,options:{fetchPolicy:u}}=a;t==="active"&&u==="standby"||(t==="active"||c&&i.has(c)||s&&i.has(s))&&(n.add(a),c&&i.set(c,!0),s&&i.set(s,!0))}),o.size&&o.forEach(a=>{const s=new Zp({queryManager:this,options:{...Ea(this.defaultOptions.watchQuery,a),fetchPolicy:"network-only"}});n.add(s)}),n}refetchObservableQueries(t=!1){const n=[];return this.getObservableQueries(t?"all":"active").forEach(r=>{const{fetchPolicy:i}=r.options;(t||i!=="standby")&&i!=="cache-only"&&n.push(r.refetch())}),this.broadcastQueries(),Promise.all(n)}startGraphQLSubscription(t){let{query:n,variables:r}=t;const{fetchPolicy:i="cache-first",errorPolicy:o="none",context:a={},extensions:s={}}=t;jo(n,ga.SUBSCRIPTION),n=this.transform(n),r=this.getVariables(n,r);let c;const u=(this.getDocumentInfo(n).hasClientExports?ya(this.localState.getExportedVariables({client:this.client,document:n,variables:r,context:a})):ba(r)).pipe(as(d=>{const{observable:h,restart:p}=this.getObservableFromLink(n,a,d,i,s),m=new Qp(this);return c=p,h.pipe(Fo(y=>{m.markSubscriptionResult(y,{document:n,variables:d,errorPolicy:o,cacheWriteBehavior:i==="no-cache"?0:2});const b={data:y.data??void 0};return us(y)?b.error=new yo(y):W6(y)&&(b.error=y.extensions[Ql],delete y.extensions[Ql]),y.extensions&&Object.keys(y.extensions).length&&(b.extensions=y.extensions),b.error&&o==="none"&&(b.data=void 0),o==="ignore"&&delete b.error,b}),Ru(y=>ba(o==="ignore"?{data:void 0}:{data:void 0,error:y})),Lb(y=>!!(y.data||y.error)))}));return Object.assign(u,{restart:()=>c==null?void 0:c()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(t=>t.notify())}getObservableFromLink(t,n,r,i,o,a=(n==null?void 0:n.queryDeduplication)??this.queryDeduplication){let s={};const{serverQuery:c,clientQuery:u,operationType:d,hasIncrementalDirective:h}=this.getDocumentInfo(t),p=ls(t),m={client:this.client};if(c){const{inFlightLinkObservables:y,link:b}=this;try{let S=function(w){return new Yt(A=>{function _(){return w.subscribe({next:A.next.bind(A),complete:A.complete.bind(A),error:A.error.bind(A)})}let C=_();return s.restart||(s.restart=()=>{C.unsubscribe(),C=_()}),()=>{C.unsubscribe(),s.restart=void 0}})};const v=this.incrementalHandler.prepareRequest({query:c,variables:r,context:{...this.defaultContext,...n,queryDeduplication:a},extensions:o});if(n=v.context,a){const w=Sa(c),A=go(r);s=y.lookup(w,A),s.observable||(s.observable=Rp(b,v,m).pipe(S,kA(()=>{y.peek(w,A)===s&&y.remove(w,A)}),d===ga.SUBSCRIPTION?Ml():pp({refCount:!0})))}else s.observable=Rp(b,v,m).pipe(S)}catch(v){s.observable=Ib(()=>v)}}else s.observable=ba({data:{}});if(u){const{operation:y}=mo(t);at(!h,96,y[0].toUpperCase()+y.slice(1),p??"(anonymous)"),s.observable=s.observable.pipe(as(b=>ya(this.localState.execute({client:this.client,document:u,remoteResult:b,context:n,variables:r,fetchPolicy:i}))))}return{restart:()=>{var y;return(y=s.restart)==null?void 0:y.call(s)},observable:s.observable.pipe(Ru(y=>{throw y=Gp(y),qk(y),y}))}}getResultsFromLink(t,{queryInfo:n,cacheWriteBehavior:r,observableQuery:i,exposeExtensions:o}){const a=n.lastRequestId=this.generateRequestId(),{errorPolicy:s}=t,c=this.cache.transformForLink(t.query);return this.getObservableFromLink(c,t.context,t.variables,t.fetchPolicy).observable.pipe(Fo(u=>{const d=n.markQueryResult(u,{...t,document:c,cacheWriteBehavior:r}),h=us(d);if(h&&s==="none")throw n.resetLastWrite(),i==null||i.resetNotifications(),new yo(qp(d));const p={data:d.data,...n.hasNext?{loading:!0,networkStatus:Je.streaming,dataState:"streaming",partial:!0}:{dataState:d.data?"complete":"empty",loading:!1,networkStatus:Je.ready,partial:!d.data}};return o&&"extensions"in d&&(p[Yb]=d.extensions),h&&(s==="none"&&(p.data=void 0,p.dataState="empty"),s!=="ignore"&&(p.error=new yo(qp(d)),p.dataState!=="streaming"&&(p.networkStatus=Je.error))),p}),Ru(u=>{if(a>=n.lastRequestId&&s==="none")throw n.resetLastWrite(),i==null||i.resetNotifications(),u;const d={data:void 0,dataState:"empty",loading:!1,networkStatus:Je.ready,partial:!0};return s!=="ignore"&&(d.error=u,d.networkStatus=Je.error),ba(d)}))}fetchObservableWithInfo(t,{networkStatus:n=Je.loading,query:r=t.query,fetchQueryOperator:i=c=>c,onCacheHit:o=()=>{},observableQuery:a,exposeExtensions:s}){const c=this.getVariables(r,t.variables);let{fetchPolicy:u="cache-first",errorPolicy:d="none",returnPartialData:h=!1,notifyOnNetworkStatusChange:p=!0,context:m={}}=t;this.prioritizeCacheValues&&(u==="network-only"||u==="cache-and-network")&&(u="cache-first");const y=Object.assign({},t,{query:r,variables:c,fetchPolicy:u,errorPolicy:d,returnPartialData:h,notifyOnNetworkStatusChange:p,context:m}),b=new Qp(this,a),v=C=>{y.variables=C;const k=u==="no-cache"?0:n===Je.refetch&&y.refetchWritePolicy!=="merge"?1:2,T=this.fetchQueryByPolicy(y,{queryInfo:b,cacheWriteBehavior:k,onCacheHit:o,observableQuery:a,exposeExtensions:s});return T.observable=T.observable.pipe(i),y.fetchPolicy!=="standby"&&(a==null||a.applyNextFetchPolicy("after-fetch",t)),T},S=()=>{this.fetchCancelFns.delete(b.id)};this.fetchCancelFns.set(b.id,C=>{w.next({kind:"E",error:C,source:"network"})});const w=new os;let A,_;if(this.getDocumentInfo(y.query).hasClientExports)A=ya(this.localState.getExportedVariables({client:this.client,document:y.query,variables:y.variables,context:y.context})).pipe(as(C=>v(C).observable)),_=!0;else{const C=v(y.variables);_=C.fromLink,A=C.observable}return{observable:new Yt(C=>{C.add(S),A.subscribe(C),w.subscribe(C)}).pipe(Ml()),fromLink:_}}refetchQueries({updateCache:t,include:n,optimistic:r=!1,removeOptimistic:i=r?H2("refetchQueries"):void 0,onQueryUpdated:o}){const a=new Map;n&&this.getObservableQueries(n).forEach(c=>{if(c.options.fetchPolicy==="cache-only"||c.variablesUnknown)return;const u=c.getCurrentResult();a.set(c,{oq:c,lastDiff:{result:u==null?void 0:u.data,complete:!(u!=null&&u.partial)}})});const s=new Map;if(t){const c=new Set;this.cache.batch({update:t,optimistic:r&&i||!1,removeOptimistic:i,onWatchUpdated(u,d,h){const p=u.watcher;if(p instanceof Zp&&!c.has(p)){if(c.add(p),o){a.delete(p);let m=o(p,d,h);return m===!0&&(m=p.refetch().retain()),m!==!1&&s.set(p,m),m}o!==null&&p.options.fetchPolicy!=="cache-only"&&a.set(p,{oq:p,lastDiff:h,diff:d})}}})}return a.size&&a.forEach(({oq:c,lastDiff:u,diff:d})=>{let h;o&&(d||(d=c.getCacheDiff()),h=o(c,d,u)),(!o||h===!0)&&(h=c.refetch().retain()),h!==!1&&s.set(c,h)}),i&&this.cache.removeOptimistic(i),s}maskOperation(t){const{document:n,data:r}=t;return this.dataMasking?jk(r,n,this.cache):r}maskFragment(t){const{data:n,fragment:r,fragmentName:i}=t;return this.dataMasking?Fk(n,r,this.cache,i):n}fetchQueryByPolicy({query:t,variables:n,fetchPolicy:r,errorPolicy:i,returnPartialData:o,context:a},{cacheWriteBehavior:s,onCacheHit:c,queryInfo:u,observableQuery:d,exposeExtensions:h}){const p=()=>this.cache.diff({query:t,variables:n,returnPartialData:!0,optimistic:!0}),m=(b,v)=>{const S=b.result,w=_=>(!b.complete&&!o&&(_=void 0),{data:_,dataState:b.complete?"complete":_?"partial":"empty",loading:Vu(v),networkStatus:v,partial:!b.complete}),A=_=>ba({kind:"N",value:w(_),source:"cache"});return(b.complete||o)&&this.getDocumentInfo(t).hasForcedResolvers?(c(),ya(this.localState.execute({client:this.client,document:t,remoteResult:S?{data:S}:void 0,context:a,variables:n,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:r}).then(_=>({kind:"N",value:w(_.data||void 0),source:"cache"})))):i==="none"&&v===Je.refetch&&b.missing?A(void 0):A(S||void 0)},y=()=>this.getResultsFromLink({query:t,variables:n,context:a,fetchPolicy:r,errorPolicy:i},{cacheWriteBehavior:s,queryInfo:u,observableQuery:d,exposeExtensions:h}).pipe(Q6(),TA(),Fo(b=>({...b,source:"network"})));switch(r){default:case"cache-first":{const b=p();return b.complete?{fromLink:!1,observable:m(b,Je.ready)}:o?{fromLink:!0,observable:fp(m(b,Je.loading),y())}:{fromLink:!0,observable:y()}}case"cache-and-network":{const b=p();return b.complete||o?{fromLink:!0,observable:fp(m(b,Je.loading),y())}:{fromLink:!0,observable:y()}}case"cache-only":return{fromLink:!1,observable:fp(m(p(),Je.ready))};case"network-only":return{fromLink:!0,observable:y()};case"no-cache":return{fromLink:!0,observable:y()};case"standby":return{fromLink:!1,observable:Il}}}}function Q6(){let e=!1;return Ll({next(){e=!0},complete(){at(e,100)}})}function $k(e){return Ki(e,{FragmentSpread:t=>{var n;if(!((n=t.directives)!=null&&n.some(r=>r.name.value==="unmask")))return{...t,directives:[...t.directives||[],{kind:xt.DIRECTIVE,name:{kind:xt.NAME,value:"nonreactive"}}]}}})}function qp(e){var i;if(((i=e.extensions)==null?void 0:i[Do])==null)return e;const{extensions:{[Do]:t,...n},...r}=e;return Object.keys(n).length>0&&(r.extensions=n),r}class eT{constructor(t){se(this,"link");se(this,"cache");se(this,"disableNetworkFetches");se(this,"version");se(this,"queryDeduplication");se(this,"defaultOptions");se(this,"devtoolsConfig");se(this,"refetchEventManager");se(this,"queryManager");se(this,"devToolsHookCb");se(this,"resetStoreCallbacks",[]);se(this,"clearStoreCallbacks",[]);se(this,"query",t=>(this.defaultOptions.query&&(t=Ea(this.defaultOptions.query,t)),this.queryManager.query(t)));se(this,"mutate",t=>{const n=Ea(zr({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),t);return jo(n.mutation,ga.MUTATION),this.queryManager.mutate(n)});se(this,"reFetchObservableQueries");se(this,"maskedFragmentTransform",new vo(nk));var S;const{cache:n,documentTransform:r,ssrMode:i=!1,ssrForceFetchDelay:o=0,queryDeduplication:a=!0,defaultOptions:s,defaultContext:c,assumeImmutableResults:u=n.assumeImmutableResults,localState:d,devtools:h,dataMasking:p,link:m,incrementalHandler:y=new bk,experiments:b=[],refetchEventManager:v}=t;this.link=m,this.cache=n,this.queryDeduplication=a,this.defaultOptions=s||{},this.devtoolsConfig={...h,enabled:(h==null?void 0:h.enabled)??B2},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=Kh,this.queryManager=new Xk({client:this,defaultOptions:this.defaultOptions,defaultContext:c,documentTransform:r,queryDeduplication:a,ssrMode:i,dataMasking:!!p,clientOptions:t,incrementalHandler:y,assumeImmutableResults:u,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:d}),this.prioritizeCacheValues=i||o>0,o&&setTimeout(()=>{this.prioritizeCacheValues=!1},o),this.devtoolsConfig.enabled&&this.connectToDevTools(),b.forEach(w=>w.call(this,t)),this.refetchEventManager=v,(S=this.refetchEventManager)==null||S.connect(this)}set prioritizeCacheValues(t){this.queryManager.prioritizeCacheValues=t}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}connectToDevTools(){if(typeof window>"u")return;const t=window,n=Symbol.for("apollo.devtools");(t[n]=t[n]||[]).push(this),t.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(t){this.queryManager.localState=t}stop(){var t;this.queryManager.stop(),(t=this.refetchEventManager)==null||t.disconnect(this)}watchQuery(t){const{refetchOn:n}=t;if(this.defaultOptions.watchQuery){const r=this.defaultOptions.watchQuery.refetchOn;let i;n&&typeof n=="object"&&(typeof r=="object"?i={...r,...n}:r!=null&&(i=o=>{const a=n[o.source]??r;return typeof a=="function"?a(o):a})),t=Ea(this.defaultOptions.watchQuery,t),i&&(t.refetchOn=i)}return this.queryManager.watchQuery(t)}subscribe(t){const n={},r=this.queryManager.startGraphQLSubscription(t),i=r.pipe(Fo(o=>({...o,data:this.queryManager.maskOperation({document:t.query,data:o.data,fetchPolicy:t.fetchPolicy,cause:n})})));return Object.assign(i,{restart:r.restart})}readQuery(t,n=!1){return this.cache.readQuery({...t,query:this.transform(t.query)},n)}watchFragment(t){const n=this.queryManager.dataMasking;return this.cache.watchFragment({...t,fragment:this.transform(t.fragment,n)})}readFragment(t,n=!1){return this.cache.readFragment({...t,fragment:this.transform(t.fragment)},n)}writeQuery(t){const n=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),n}writeFragment(t){const n=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),n}__actionHookForDevTools(t){this.devToolsHookCb=t}__requestRaw(t){return Rp(this.link,t,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(t=>t()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(t=>t())))}onResetStore(t){return this.resetStoreCallbacks.push(t),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(n=>n!==t)}}onClearStore(t){return this.clearStoreCallbacks.push(t),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(n=>n!==t)}}refetchObservableQueries(t){return this.queryManager.refetchObservableQueries(t)}refetchQueries(t){const n=this.queryManager.refetchQueries(t),r=[],i=[];n.forEach((a,s)=>{r.push(s),i.push(a)});const o=Promise.all(i);return o.queries=r,o.results=i,o.catch(a=>{}),o}getObservableQueries(t="active"){return this.queryManager.getObservableQueries(t)}extract(t){return this.cache.extract(t)}restore(t){return this.cache.restore(t)}setLink(t){this.link=t}get defaultContext(){return this.queryManager.defaultContext}transform(t,n=!1){const r=this.queryManager.transform(t);return n?this.maskedFragmentTransform.transformDocument(r):r}}const{hasOwnProperty:J6}=Object.prototype;function tT(e){return rr(e)&&"payload"in e}async function*nT(e){var p;const t=new TextDecoder("utf-8"),n=(p=e.headers)==null?void 0:p.get("content-type"),r=n==null?void 0:n.match(/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i),i=`\r
|
|
41
|
+
`)}const iu=class iu extends Error{constructor(n,r=n.errors||[]){super(iu.formatMessage(r,{result:n,defaultFormatMessage:H6}));se(this,"errors");se(this,"data");se(this,"extensions");this.errors=r,this.data=n.data,this.extensions=n.extensions,this.name="CombinedGraphQLErrors",Kl(this),Object.setPrototypeOf(this,iu.prototype)}static is(n){return Zl(n,"CombinedGraphQLErrors")}};se(iu,"formatMessage",H6);let yo=iu;const Jk=new WeakSet;function qk(e){Jk.add(e)}class Wu extends Error{constructor(n,r){super(n);se(this,"response");se(this,"statusCode");se(this,"bodyText");this.name="ServerError",this.response=r.response,this.statusCode=r.response.status,this.bodyText=r.bodyText,Kl(this),Object.setPrototypeOf(this,Wu.prototype)}static is(n){return Zl(n,"ServerError")}}class Gu extends Error{constructor(n,r){super(n instanceof Error?n.message:"Could not parse server response",{cause:n});se(this,"response");se(this,"statusCode");se(this,"bodyText");this.name="ServerParseError",this.response=r.response,this.statusCode=r.response.status,this.bodyText=r.bodyText,Kl(this),Object.setPrototypeOf(this,Gu.prototype)}static is(n){return Zl(n,"ServerParseError")}}const Ql=Symbol();function W6(e){return"extensions"in e?Hu.is(e.extensions[Ql]):!1}function Gp(e){return Qk(e)?e:typeof e=="string"?new Error(e,{cause:e}):new Wp(e)}var Je;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error",e[e.streaming=9]="streaming"})(Je||(Je={}));const{assign:G6}=Object,ys={loading:!0,networkStatus:Je.loading,data:void 0,dataState:"empty",partial:!0},Yp={loading:!1,networkStatus:Je.ready,data:void 0,dataState:"empty",partial:!0};Qx=Symbol.observable;class Zp{constructor({queryManager:t,options:n,transformedQuery:r=t.transform(n.query)}){se(this,"options");se(this,"queryName");se(this,"variablesUnknown",!1);se(this,"_lastWrite");se(this,"unsubscribeFromCache");se(this,"input");se(this,"subject");se(this,"isTornDown");se(this,"queryManager");se(this,"subscriptions",new Set);se(this,"waitForNetworkResult");se(this,"lastQuery");se(this,"linkSubscription");se(this,"pollingInfo");se(this,"subscribe");se(this,"pipe");se(this,Qx);se(this,"@@observable");se(this,"stableLastResult");se(this,"didWarnCacheOnlyPolling",!1);se(this,"dirty",!1);se(this,"notifyTimeout");se(this,"activeOperations",new Set);se(this,"operator",_p(t=>{const{query:n,variables:r,meta:i}=t;if(t.source==="setResult")return{query:n,variables:r,result:t.value,meta:i};if(t.kind==="C"||!Jl(t,this))return;let o;const a=this.subject.getValue();if(t.source==="cache"){if(o=t.value,o.networkStatus===Je.ready&&o.partial&&(!this.options.returnPartialData||a.result.networkStatus===Je.error)&&this.options.fetchPolicy!=="cache-only")return}else if(t.source==="network")this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),o=t.kind==="E"?{...Jl(a,t)?a.result:{data:void 0,dataState:"empty",partial:!0},error:t.error,networkStatus:Je.error,loading:!1}:t.value,t.kind==="E"&&o.dataState==="streaming"&&(o.dataState="complete"),o.error&&(i.shouldEmit=1);else if(t.source==="newNetworkStatus"){const s=Jl(a,t)?a.result:this.getInitialResult(i.fetchPolicy),{resetError:c}=t.value,u=c?void 0:s.error,d=u?Je.error:Je.ready;o={...s,error:u,networkStatus:d}}return at(o),o.error||delete o.error,o.networkStatus=this.calculateNetworkStatus(o.networkStatus),o.loading=Vu(o.networkStatus),o=this.maskResult(o),a.result.data!==void 0&&o.data!==a.result.data&&pt(o.data,a.result.data)&&(o.data=a.result.data),{query:n,variables:r,result:o,meta:i}}));this.queryManager=t,this.waitForNetworkResult=n.fetchPolicy==="network-only",this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:i="cache-first"}={}}=t.defaultOptions,{fetchPolicy:o=i,initialFetchPolicy:a=o==="standby"?i:o}=n;n[xp]&&(at(o==="standby",82),this.variablesUnknown=!0),this.lastQuery=r,this.options={...n,initialFetchPolicy:a,fetchPolicy:o,variables:this.getVariablesWithDefaults(n.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const s=mo(this.query);this.queryName=s&&s.name&&s.name.value}get query(){return this.lastQuery}get variables(){return this.options.variables}get networkStatus(){return this.subject.getValue().result.networkStatus}get cache(){return this.queryManager.cache}initializeObservablesQueue(){this.subject=new Y3({query:this.query,variables:this.variables,result:ys,meta:{}});const t=this.subject.pipe(Ll({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),_p(({query:n,variables:r,result:i,meta:o},a)=>{const{shouldEmit:s}=o;if(i===ys&&(a.previous=void 0,a.previousVariables=void 0),this.options.fetchPolicy==="standby"||s===2)return;if(s===1)return d();const{previous:c,previousVariables:u}=a;if(c){const h=this.queryManager.getDocumentInfo(n),p=this.queryManager.dataMasking,m=p?h.nonReactiveQuery:n;if((p||h.hasNonreactiveDirective?Wb(m,c,i,r):pt(c,i))&&pt(u,r))return}if(s===3&&(!this.options.notifyOnNetworkStatusChange||pt(c,i)))return;return d();function d(){return a.previous=i,a.previousVariables=r,i}},()=>({})));this.pipe=t.pipe.bind(t),this.subscribe=t.subscribe.bind(t),this.input=new os,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}getCacheDiff({optimistic:t=!0}={}){return this.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:t})}getInitialResult(t){let n=t||this.options.fetchPolicy;this.queryManager.prioritizeCacheValues&&(n==="network-only"||n==="cache-and-network")&&(n="cache-first");const r=()=>{const i=this.getCacheDiff(),o=this.options.returnPartialData||i.complete?i.result??void 0:void 0;return this.maskResult({data:o,dataState:i.complete?"complete":o===void 0?"empty":"partial",loading:!i.complete,networkStatus:i.complete?Je.ready:Je.loading,partial:!i.complete})};switch(n){case"cache-only":return{...r(),loading:!1,networkStatus:Je.ready};case"cache-first":return r();case"cache-and-network":return{...r(),loading:!0,networkStatus:Je.loading};case"standby":return Yp;default:return ys}}resubscribeCache(){var c;const{variables:t,fetchPolicy:n}=this.options,r=this.query,i=n==="standby"||n==="no-cache"||this.waitForNetworkResult,o=!Jl({query:r,variables:t},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((i||o)&&((c=this.unsubscribeFromCache)==null||c.call(this)),i||!o)return;const a={query:r,variables:t,optimistic:!0,watcher:this,callback:u=>{const d=this.queryManager.getDocumentInfo(r);if((d.hasClientExports||d.hasForcedResolvers)&&(a.lastDiff=void 0),a.lastOwnDiff===u)return;const{result:h}=this.subject.getValue();!u.complete&&(h.error||h===ys||h===Yp)||pt(h.data,u.result)||this.scheduleNotify()}},s=this.cache.watch(a);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,s()},{query:r,variables:t})}getCurrentResult(){const{result:t}=this.subject.getValue();let n=t.networkStatus===Je.error||this.hasObservers()||this.options.fetchPolicy==="no-cache"?t:this.getInitialResult();return n===ys&&(n=this.getInitialResult()),pt(this.stableLastResult,n)||(this.stableLastResult=n),this.stableLastResult}refetch(t){const{fetchPolicy:n}=this.options,r={pollInterval:0};return n==="no-cache"?r.fetchPolicy="no-cache":r.fetchPolicy="network-only",t&&!pt(this.variables,t)&&(r.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...t})),this._lastWrite=void 0,this._reobserve(r,{newNetworkStatus:Je.refetch})}fetchMore({query:t,variables:n,context:r,errorPolicy:i,updateQuery:o}){at(this.options.fetchPolicy!=="cache-only",84,ls(this.query,"(anonymous)"));const a={...zr(this.options,{errorPolicy:"none"},{query:t,context:r,errorPolicy:i}),variables:t?n:{...this.variables,...n},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};a.query=this.transformDocument(a.query),this.lastQuery=t?this.transformDocument(this.options.query):a.query;let s=!1;const c=this.options.fetchPolicy!=="no-cache";c||at(o,85);const{finalize:u,pushNotification:d}=this.pushOperation(Je.fetchMore);d({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3});const{promise:h,operator:p}=Y6(),{observable:m}=this.queryManager.fetchObservableWithInfo(a,{networkStatus:Je.fetchMore,exposeExtensions:!0}),y=m.pipe(p,Lb(b=>b.kind==="N"&&b.source==="network")).subscribe({next:b=>{s=!1;const v=b.value,S=v[Yb];if(h6(b.value.networkStatus)&&u(),c){const w=this.getCacheDiff();this.cache.batch({update:A=>{o?A.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1,extensions:S},_=>o(_,{fetchMoreResult:v.data,variables:a.variables})):A.writeQuery({query:a.query,variables:a.variables,data:v.data,extensions:S})},onWatchUpdated:(A,_)=>{if(A.watcher===this&&!pt(_.result,w.result)){s=!0;const C=this.getCurrentResult();Vu(v.networkStatus)&&d({kind:"N",source:"network",value:{...C,networkStatus:v.networkStatus===Je.error?Je.ready:v.networkStatus,loading:!1,data:_.result,dataState:v.dataState==="streaming"?"streaming":"complete"}})}}})}else{const w=this.getCurrentResult(),A=o(w.data,{fetchMoreResult:v.data,variables:a.variables});d({kind:"N",value:{...w,networkStatus:Je.ready,loading:!1,data:A,dataState:w.dataState==="streaming"?"streaming":"complete"},source:"network"})}}});return wp(h.then(b=>Bl(this.maskResult(b))).finally(()=>{if(y.unsubscribe(),u(),c&&!s){const b=this.getCurrentResult();b.dataState==="streaming"?d({kind:"N",source:"network",value:{...b,dataState:"complete",networkStatus:Je.ready}}):d({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})}}))}subscribeToMore(t){const n=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:r=>{const{updateQuery:i,onError:o}=t,{error:a}=r;if(a){o?o(a):at.error(86,a);return}i&&this.updateQuery((s,c)=>i(s,{subscriptionData:r,...c}))}});return this.subscriptions.add(n),()=>{this.subscriptions.delete(n)&&n.unsubscribe()}}applyOptions(t){const n=zr(this.options,t||{});G6(this.options,n),this.updatePolling()}async setVariables(t){return t=this.getVariablesWithDefaults(t),pt(this.variables,t)?Bl(this.getCurrentResult()):(this.options.variables=t,this.hasObservers()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},{newNetworkStatus:Je.setVariables}):Bl(this.getCurrentResult()))}updateQuery(t){const{queryManager:n}=this,{result:r,complete:i}=this.getCacheDiff({optimistic:!1}),o=t(r,{variables:this.variables,complete:!!i,previousData:r});o&&(this.cache.writeQuery({query:this.options.query,data:o,variables:this.variables}),n.broadcastQueries())}startPolling(t){this.options.pollInterval=t,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(t,n){if(n.nextFetchPolicy){const{fetchPolicy:r="cache-first",initialFetchPolicy:i=r}=n;r==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy.call(n,r,{reason:t,options:n,observable:this,initialFetchPolicy:i}):t==="variables-changed"?n.fetchPolicy=i:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy}fetch(t,n,r,i){const o=this.options.fetchPolicy;t.context??(t.context={});let a=!1;const s=()=>{a=!0},c=v=>new Yt(S=>{try{return v.subscribe({next(w){a=!0,S.next(w)},error:w=>S.error(w),complete:()=>S.complete()})}finally{a||(m.override=n,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:h,variables:p,meta:{shouldEmit:3,fetchPolicy:o}}))}});let{observable:u,fromLink:d}=this.queryManager.fetchObservableWithInfo(t,{networkStatus:n,query:r,onCacheHit:s,fetchQueryOperator:c,observableQuery:this});const{query:h,variables:p}=this,m={abort:()=>{b.unsubscribe()},query:h,variables:p};this.activeOperations.add(m);let y=n==Je.refetch||n==Je.setVariables;u=u.pipe(i,Ml());const b=u.pipe(Ll({next:v=>{v.source==="newNetworkStatus"||v.kind==="N"&&v.value.loading?m.override=n:delete m.override},finalize:()=>this.activeOperations.delete(m)})).subscribe({next:v=>{const S={};y&&v.kind==="N"&&"loading"in v.value&&!v.value.loading&&(y=!1,S.shouldEmit=1),this.input.next({...v,query:h,variables:p,meta:S})}});return{fromLink:d,subscription:b,observable:u}}updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:t,options:{fetchPolicy:n,pollInterval:r}}=this,i=()=>{const{options:c}=this;return!c.pollInterval||!this.hasObservers()||c.fetchPolicy==="cache-only"||c.fetchPolicy==="standby"};if(i()){this.cancelPolling();return}if((t==null?void 0:t.interval)===r)return;const o=t||(this.pollingInfo={});o.interval=r;const a=()=>{var c,u;if(i())return this.cancelPolling();this.pollingInfo&&(!Vu(this.networkStatus)&&!((u=(c=this.options).skipPollAttempt)!=null&&u.call(c))?this._reobserve({fetchPolicy:this.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},{newNetworkStatus:Je.poll}).then(s,s):s())},s=()=>{const c=this.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(a,c.interval))};s()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(t){return this._reobserve(t)}_reobserve(t,n){this.isTornDown=!1;let{newNetworkStatus:r}=n||{};this.queryManager.obsQueries.add(this);const i=r===Je.refetch||r===Je.poll,o=this.variables,a=this.options.fetchPolicy,s=zr(this.options,t||{});this.variablesUnknown&&(this.variablesUnknown=s.fetchPolicy==="standby");const c=i?s:G6(this.options,s),u=this.transformDocument(c.query);this.lastQuery=u,t&&"variables"in t&&(c.variables=this.getVariablesWithDefaults(t.variables)),i||(this.updatePolling(),t&&t.variables&&!pt(t.variables,o)&&c.fetchPolicy!=="standby"&&(c.fetchPolicy===a||typeof c.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",c),r===void 0&&(r=Je.setVariables)));const d=this.networkStatus;r||(r=Je.loading,d!==Je.loading&&(t!=null&&t.variables)&&!pt(t.variables,o)&&(r=Je.setVariables),c.fetchPolicy==="standby"&&(r=Je.ready)),c.fetchPolicy==="standby"&&this.cancelPolling(),this.resubscribeCache();const{promise:h,operator:p}=Y6(c.fetchPolicy==="standby"?{data:void 0}:void 0),{subscription:m,observable:y,fromLink:b}=this.fetch(c,r,u,p);!i&&(b||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=m);const v=Object.assign(wp(h.then(S=>Bl(this.maskResult(S))).finally(()=>{!this.hasObservers()&&this.activeOperations.size===0&&this.tearDownQuery()})),{retain:()=>{const S=y.subscribe({}),w=()=>S.unsubscribe();return h.then(w,w),v}});return v}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){var t;this.isTornDown||(this.resetNotifications(),(t=this.unsubscribeFromCache)==null||t.call(this),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(n=>n.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(t){return this.queryManager.transform(t)}maskResult(t){const n=this.queryManager.maskOperation({document:this.query,data:t.data,fetchPolicy:this.options.fetchPolicy,cause:this});return n===t.data?t:{...t,data:n}}resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(t=!1){if(!t){const r=this.queryManager.getDocumentInfo(this.query);if(r.hasClientExports||r.hasForcedResolvers)return}const{dirty:n}=this;if(this.resetNotifications(),n&&(this.options.fetchPolicy==="cache-only"||this.options.fetchPolicy==="cache-and-network"||!this.activeOperations.size)){const r=this.getCacheDiff();pt(r.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:r.result,dataState:r.complete?"complete":r.result?"partial":"empty",networkStatus:Je.ready,loading:!1,error:void 0,partial:!r.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}pushOperation(t){let n=!1;const{query:r,variables:i}=this,o=()=>{this.activeOperations.delete(a)},a={override:t,abort:()=>{n=!0,o()},query:r,variables:i};return this.activeOperations.add(a),{finalize:o,pushNotification:(s,c)=>{n||this.input.next({...s,query:r,variables:i,meta:{...c}})}}}calculateNetworkStatus(t){if(t===Je.streaming)return t;const n=Array.from(this.activeOperations.values()).reverse().find(r=>Jl(r,this)&&r.override!==void 0);return(n==null?void 0:n.override)??t}abortActiveOperations(){this.activeOperations.forEach(t=>t.abort())}reset(){const t=this.options.fetchPolicy==="cache-only";this.setResult(t?Yp:ys,{shouldEmit:t?1:2}),this.abortActiveOperations()}setResult(t,n){this.input.next({source:"setResult",kind:"N",value:t,query:this.query,variables:this.variables,meta:{...n}})}reobserveCacheFirst(){const{fetchPolicy:t,nextFetchPolicy:n}=this.options;t==="cache-and-network"||t==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(r,i){return this.nextFetchPolicy=n,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(r,i):t}}):this.reobserve()}getVariablesWithDefaults(t){return this.queryManager.getVariables(this.query,t)}}function Jl(e,t){return!!(e&&t&&e.query===t.query&&pt(e.variables,t.variables))}function Y6(e){let t=e,n,r;const i=new Promise((a,s)=>{n=a,r=s}),o=Ll({next(a){if(a.kind==="E")return r(a.error);a.kind==="N"&&a.source!=="newNetworkStatus"&&!a.value.loading&&(t=a.value)},finalize:()=>{if(t)n(t);else{const a="The operation was aborted.",s="AbortError";r(typeof DOMException<"u"?new DOMException(a,s):Object.assign(new Error(a),{name:s}))}}});return{promise:i,operator:o}}const Z6={},bs=new WeakMap;function Kp(e,t){const n=e[t];typeof n=="function"&&(e[t]=function(){return bs.set(e,(bs.get(e)+1)%1e15),n.apply(this,arguments)})}const K6=new WeakMap;class Qp{constructor(t,n){se(this,"lastRequestId",1);se(this,"cache");se(this,"queryManager");se(this,"id");se(this,"observableQuery");se(this,"incremental");se(this,"_lastWrite");const r=this.cache=t.cache,i=(K6.get(t)||0)+1;K6.set(t,i),this.id=i+"",this.observableQuery=n,this.queryManager=t,bs.has(r)||(bs.set(r,0),Kp(r,"evict"),Kp(r,"modify"),Kp(r,"reset"))}get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(t){(this.observableQuery||this)._lastWrite=t}resetLastWrite(){this.lastWrite=void 0}shouldWrite(t,n){var i,o;const{lastWrite:r}=this;return!(r&&r.dmCount===bs.get(this.cache)&&pt(n,r.variables)&&pt(t.data,r.result.data)&&((i=t.extensions)==null?void 0:i[Do])===((o=r.result.extensions)==null?void 0:o[Do]))}get hasNext(){return this.incremental?this.incremental.hasNext:!1}maybeHandleIncrementalResult(t,n,r){const{incrementalHandler:i}=this.queryManager;return i.isIncrementalResult(n)?(this.incremental||(this.incremental=i.startRequest({query:r})),this.incremental.handle(t,n)):n}markQueryResult(t,{document:n,variables:r,errorPolicy:i,cacheWriteBehavior:o}){var d;const a={query:n,variables:r,returnPartialData:!0,optimistic:!0};(d=this.observableQuery)==null||d.resetNotifications();const s=o===0,c=s?void 0:this.cache.diff(a);let u=this.maybeHandleIncrementalResult(c==null?void 0:c.result,t,n);return s||(Jp(u,i)?this.cache.batch({onWatchUpdated:(h,p)=>{h.watcher===this.observableQuery&&(h.lastOwnDiff=p)},update:h=>{if(this.shouldWrite(u,r))h.writeQuery({query:n,data:u.data,variables:r,overwrite:o===1,extensions:u.extensions}),this.lastWrite={result:u,variables:r,dmCount:bs.get(this.cache)};else if(c&&c.complete){u={...u,data:c.result};return}const p=h.diff(a);p.complete&&(u={...u,data:p.result})}}):this.lastWrite=void 0),u}markMutationResult(t,n,r=this.cache){const i=[],o=n.cacheWriteBehavior===0;let a=this.maybeHandleIncrementalResult(o?void 0:r.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(n.document).asQuery,variables:n.variables,optimistic:!1,returnPartialData:!0}).result,t,n.document);if(n.errorPolicy==="ignore"&&(a={...a,errors:[]}),us(a)&&n.errorPolicy==="none")return Promise.resolve(a);const s=()=>({...a,dataState:this.hasNext?"streaming":"complete"});if(!o&&Jp(a,n.errorPolicy)){i.push({result:a.data,dataId:"ROOT_MUTATION",query:n.document,variables:n.variables,extensions:a.extensions});const{updateQueries:u}=n;u&&this.queryManager.getObservableQueries("all").forEach(d=>{const h=d&&d.queryName;if(!h||!Object.hasOwnProperty.call(u,h))return;const p=u[h],{query:m,variables:y}=d,{result:b,complete:v}=d.getCacheDiff({optimistic:!1});if(v&&b){const S=p(b,{mutationResult:s(),queryName:m&&ls(m)||void 0,queryVariables:y});S&&i.push({result:S,dataId:"ROOT_QUERY",query:m,variables:y})}})}let c=n.refetchQueries;if(typeof c=="function"&&(c=c(s())),i.length>0||(c||"").length>0||n.update||n.onQueryUpdated||n.removeOptimistic){const u=[];if(this.queryManager.refetchQueries({updateCache:d=>{o||i.forEach(p=>d.write(p));const{update:h}=n;if(h){if(!o){const p=d.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(n.document).asQuery,variables:n.variables,optimistic:!1,returnPartialData:!0});p.complete&&(a={...a,data:p.result})}this.hasNext||h(d,a,{context:n.context,variables:n.variables})}!o&&!n.keepRootFields&&!this.hasNext&&d.modify({id:"ROOT_MUTATION",fields(p,{fieldName:m,DELETE:y}){return m==="__typename"?p:y}})},include:c,optimistic:!1,removeOptimistic:n.removeOptimistic,onQueryUpdated:n.onQueryUpdated||null}).forEach(d=>u.push(d)),n.awaitRefetchQueries||n.onQueryUpdated)return Promise.all(u).then(()=>a)}return Promise.resolve(a)}markMutationOptimistic(t,n){const r=typeof t=="function"?t(n.variables,{IGNORE:Z6}):t;return r===Z6?!1:(this.cache.recordOptimisticTransaction(i=>{try{this.markMutationResult({data:r},n,i)}catch(o){at.error(o)}},this.id),!0)}markSubscriptionResult(t,{document:n,variables:r,errorPolicy:i,cacheWriteBehavior:o}){o!==0&&(Jp(t,i)&&this.cache.write({query:n,result:t.data,dataId:"ROOT_SUBSCRIPTION",variables:r,extensions:t.extensions}),this.queryManager.broadcastQueries())}}function Jp(e,t="none"){const n=t==="ignore"||t==="all";let r=!us(e);return!r&&n&&e.data&&(r=!0),r}class Xk{constructor(t){se(this,"defaultOptions");se(this,"client");se(this,"clientOptions");se(this,"assumeImmutableResults");se(this,"documentTransform");se(this,"ssrMode");se(this,"defaultContext");se(this,"dataMasking");se(this,"incrementalHandler");se(this,"localState");se(this,"queryDeduplication");se(this,"prioritizeCacheValues",!1);se(this,"onBroadcast");se(this,"mutationStore");se(this,"obsQueries",new Set);se(this,"fetchCancelFns",new Map);se(this,"transformCache",new bp(po["queryManager.getDocumentInfo"]||2e3));se(this,"requestIdCounter",1);se(this,"inFlightLinkObservables",new Qi(!1));se(this,"noCacheWarningsByCause",new WeakSet);const n=new vo(i=>this.cache.transformDocument(i),{cache:!1});this.client=t.client,this.defaultOptions=t.defaultOptions,this.queryDeduplication=t.queryDeduplication,this.clientOptions=t.clientOptions,this.ssrMode=t.ssrMode,this.assumeImmutableResults=t.assumeImmutableResults,this.dataMasking=t.dataMasking,this.localState=t.localState,this.incrementalHandler=t.incrementalHandler;const r=t.documentTransform;this.documentTransform=r?n.concat(r).concat(n):n,this.defaultContext=t.defaultContext||{},(this.onBroadcast=t.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(t=>t.stop()),this.cancelPendingFetches(si(89))}cancelPendingFetches(t){this.fetchCancelFns.forEach(n=>n(t)),this.fetchCancelFns.clear()}async mutate({mutation:t,variables:n,optimisticResponse:r,updateQueries:i,refetchQueries:o=[],awaitRefetchQueries:a=!1,update:s,onQueryUpdated:c,fetchPolicy:u,errorPolicy:d,keepRootFields:h,context:p}){const m=new Qp(this);t=this.cache.transformForLink(this.transform(t));const{hasClientExports:y}=this.getDocumentInfo(t);n=this.getVariables(t,n),y&&(n=await this.localState.getExportedVariables({client:this.client,document:t,variables:n,context:p}));const b=this.mutationStore&&(this.mutationStore[m.id]={mutation:t,variables:n,loading:!0,error:null}),v=r&&m.markMutationOptimistic(r,{document:t,variables:n,cacheWriteBehavior:u==="no-cache"?0:2,errorPolicy:d,context:p,updateQueries:i,update:s,keepRootFields:h});return this.broadcastQueries(),new Promise((S,w)=>{const A={};return this.getObservableFromLink(t,{...p,optimisticResponse:v?r:void 0},n,u,{},!1).observable.pipe(Q6(),as(_=>{const C={..._};return ya(m.markMutationResult(C,{document:t,variables:n,cacheWriteBehavior:u==="no-cache"?0:2,errorPolicy:d,context:p,update:s,updateQueries:i,awaitRefetchQueries:a,refetchQueries:o,removeOptimistic:v?m.id:void 0,onQueryUpdated:c,keepRootFields:h}))})).pipe(Fo(_=>{if(us(_)&&d==="none")throw new yo(qp(_));return b&&(b.loading=!1,b.error=null),_})).subscribe({next:_=>{if(this.broadcastQueries(),!m.hasNext){const C={data:this.maskOperation({document:t,data:_.data,fetchPolicy:u,cause:A})};us(_)&&(C.error=new yo(_)),Object.keys(_.extensions||{}).length&&(C.extensions=_.extensions),S(C)}},error:_=>{if(b&&(b.loading=!1,b.error=_),v&&this.cache.removeOptimistic(m.id),this.broadcastQueries(),d==="ignore")return S({data:void 0});if(d==="all")return S({data:void 0,error:_});w(_)}})})}fetchQuery(t,n){return jo(t.query,ga.QUERY),(async()=>bA(this.fetchObservableWithInfo(t,{networkStatus:n}).observable.pipe(_p(r=>{switch(r.kind){case"E":throw r.error;case"N":if(r.source!=="newNetworkStatus")return Bl(r.value)}})),{defaultValue:{data:void 0}}))()}transform(t){return this.documentTransform.transformDocument(t)}getDocumentInfo(t){const{transformCache:n}=this;if(!n.has(t)){const i=mo(t),o={hasClientExports:ds(["client","export"],t,!0),hasForcedResolvers:JA(t),hasNonreactiveDirective:ds(["nonreactive"],t),hasIncrementalDirective:ds(["defer"],t),nonReactiveQuery:$k(t),clientQuery:ds(["client"],t)?t:null,serverQuery:$A([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],t),operationType:i==null?void 0:i.operation,defaultVars:Ep(i),asQuery:{...t,definitions:t.definitions.map(a=>a.kind==="OperationDefinition"&&a.operation!=="query"?{...a,operation:"query"}:a)}};n.set(t,o)}const r=n.get(t);if(r.violation)throw r.violation;return r}getVariables(t,n){const r=this.getDocumentInfo(t).defaultVars,i=Object.entries(n??{}).map(([o,a])=>[o,a===void 0?r[o]:a]);return{...r,...Object.fromEntries(i)}}watchQuery(t){jo(t.query,ga.QUERY);const n=this.transform(t.query);return t={...t,variables:this.getVariables(n,t.variables)},typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!0),new Zp({queryManager:this,options:t,transformedQuery:n})}query(t){const n=this.transform(t.query);return this.fetchQuery({...t,query:n}).then(r=>({...r,data:this.maskOperation({document:n,data:r==null?void 0:r.data,fetchPolicy:t.fetchPolicy})}))}generateRequestId(){return this.requestIdCounter++}clearStore(t={discardWatches:!0}){return this.cancelPendingFetches(si(91)),this.obsQueries.forEach(n=>{n.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(t)}getObservableQueries(t="active"){const n=new Set,r=new Map,i=new Map,o=new Set;return Array.isArray(t)&&t.forEach(a=>{if(typeof a=="string")r.set(a,a),i.set(a,!1);else if(qA(a)){const s=Sa(this.transform(a));r.set(s,ls(a)),i.set(s,!1)}else rr(a)&&a.query&&o.add(a)}),this.obsQueries.forEach(a=>{const s=Sa(this.transform(a.options.query));if(t==="all"){n.add(a);return}const{queryName:c,options:{fetchPolicy:u}}=a;t==="active"&&u==="standby"||(t==="active"||c&&i.has(c)||s&&i.has(s))&&(n.add(a),c&&i.set(c,!0),s&&i.set(s,!0))}),o.size&&o.forEach(a=>{const s=new Zp({queryManager:this,options:{...Ea(this.defaultOptions.watchQuery,a),fetchPolicy:"network-only"}});n.add(s)}),n}refetchObservableQueries(t=!1){const n=[];return this.getObservableQueries(t?"all":"active").forEach(r=>{const{fetchPolicy:i}=r.options;(t||i!=="standby")&&i!=="cache-only"&&n.push(r.refetch())}),this.broadcastQueries(),Promise.all(n)}startGraphQLSubscription(t){let{query:n,variables:r}=t;const{fetchPolicy:i="cache-first",errorPolicy:o="none",context:a={},extensions:s={}}=t;jo(n,ga.SUBSCRIPTION),n=this.transform(n),r=this.getVariables(n,r);let c;const u=(this.getDocumentInfo(n).hasClientExports?ya(this.localState.getExportedVariables({client:this.client,document:n,variables:r,context:a})):ba(r)).pipe(as(d=>{const{observable:h,restart:p}=this.getObservableFromLink(n,a,d,i,s),m=new Qp(this);return c=p,h.pipe(Fo(y=>{m.markSubscriptionResult(y,{document:n,variables:d,errorPolicy:o,cacheWriteBehavior:i==="no-cache"?0:2});const b={data:y.data??void 0};return us(y)?b.error=new yo(y):W6(y)&&(b.error=y.extensions[Ql],delete y.extensions[Ql]),y.extensions&&Object.keys(y.extensions).length&&(b.extensions=y.extensions),b.error&&o==="none"&&(b.data=void 0),o==="ignore"&&delete b.error,b}),Ru(y=>ba(o==="ignore"?{data:void 0}:{data:void 0,error:y})),Lb(y=>!!(y.data||y.error)))}));return Object.assign(u,{restart:()=>c==null?void 0:c()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(t=>t.notify())}getObservableFromLink(t,n,r,i,o,a=(n==null?void 0:n.queryDeduplication)??this.queryDeduplication){let s={};const{serverQuery:c,clientQuery:u,operationType:d,hasIncrementalDirective:h}=this.getDocumentInfo(t),p=ls(t),m={client:this.client};if(c){const{inFlightLinkObservables:y,link:b}=this;try{let S=function(w){return new Yt(A=>{function _(){return w.subscribe({next:A.next.bind(A),complete:A.complete.bind(A),error:A.error.bind(A)})}let C=_();return s.restart||(s.restart=()=>{C.unsubscribe(),C=_()}),()=>{C.unsubscribe(),s.restart=void 0}})};const v=this.incrementalHandler.prepareRequest({query:c,variables:r,context:{...this.defaultContext,...n,queryDeduplication:a},extensions:o});if(n=v.context,a){const w=Sa(c),A=go(r);s=y.lookup(w,A),s.observable||(s.observable=Rp(b,v,m).pipe(S,kA(()=>{y.peek(w,A)===s&&y.remove(w,A)}),d===ga.SUBSCRIPTION?Ml():pp({refCount:!0})))}else s.observable=Rp(b,v,m).pipe(S)}catch(v){s.observable=Ib(()=>v)}}else s.observable=ba({data:{}});if(u){const{operation:y}=mo(t);at(!h,96,y[0].toUpperCase()+y.slice(1),p??"(anonymous)"),s.observable=s.observable.pipe(as(b=>ya(this.localState.execute({client:this.client,document:u,remoteResult:b,context:n,variables:r,fetchPolicy:i}))))}return{restart:()=>{var y;return(y=s.restart)==null?void 0:y.call(s)},observable:s.observable.pipe(Ru(y=>{throw y=Gp(y),qk(y),y}))}}getResultsFromLink(t,{queryInfo:n,cacheWriteBehavior:r,observableQuery:i,exposeExtensions:o}){const a=n.lastRequestId=this.generateRequestId(),{errorPolicy:s}=t,c=this.cache.transformForLink(t.query);return this.getObservableFromLink(c,t.context,t.variables,t.fetchPolicy).observable.pipe(Fo(u=>{const d=n.markQueryResult(u,{...t,document:c,cacheWriteBehavior:r}),h=us(d);if(h&&s==="none")throw n.resetLastWrite(),i==null||i.resetNotifications(),new yo(qp(d));const p={data:d.data,...n.hasNext?{loading:!0,networkStatus:Je.streaming,dataState:"streaming",partial:!0}:{dataState:d.data?"complete":"empty",loading:!1,networkStatus:Je.ready,partial:!d.data}};return o&&"extensions"in d&&(p[Yb]=d.extensions),h&&(s==="none"&&(p.data=void 0,p.dataState="empty"),s!=="ignore"&&(p.error=new yo(qp(d)),p.dataState!=="streaming"&&(p.networkStatus=Je.error))),p}),Ru(u=>{if(a>=n.lastRequestId&&s==="none")throw n.resetLastWrite(),i==null||i.resetNotifications(),u;const d={data:void 0,dataState:"empty",loading:!1,networkStatus:Je.ready,partial:!0};return s!=="ignore"&&(d.error=u,d.networkStatus=Je.error),ba(d)}))}fetchObservableWithInfo(t,{networkStatus:n=Je.loading,query:r=t.query,fetchQueryOperator:i=c=>c,onCacheHit:o=()=>{},observableQuery:a,exposeExtensions:s}){const c=this.getVariables(r,t.variables);let{fetchPolicy:u="cache-first",errorPolicy:d="none",returnPartialData:h=!1,notifyOnNetworkStatusChange:p=!0,context:m={}}=t;this.prioritizeCacheValues&&(u==="network-only"||u==="cache-and-network")&&(u="cache-first");const y=Object.assign({},t,{query:r,variables:c,fetchPolicy:u,errorPolicy:d,returnPartialData:h,notifyOnNetworkStatusChange:p,context:m}),b=new Qp(this,a),v=C=>{y.variables=C;const k=u==="no-cache"?0:n===Je.refetch&&y.refetchWritePolicy!=="merge"?1:2,T=this.fetchQueryByPolicy(y,{queryInfo:b,cacheWriteBehavior:k,onCacheHit:o,observableQuery:a,exposeExtensions:s});return T.observable=T.observable.pipe(i),y.fetchPolicy!=="standby"&&(a==null||a.applyNextFetchPolicy("after-fetch",t)),T},S=()=>{this.fetchCancelFns.delete(b.id)};this.fetchCancelFns.set(b.id,C=>{w.next({kind:"E",error:C,source:"network"})});const w=new os;let A,_;if(this.getDocumentInfo(y.query).hasClientExports)A=ya(this.localState.getExportedVariables({client:this.client,document:y.query,variables:y.variables,context:y.context})).pipe(as(C=>v(C).observable)),_=!0;else{const C=v(y.variables);_=C.fromLink,A=C.observable}return{observable:new Yt(C=>{C.add(S),A.subscribe(C),w.subscribe(C)}).pipe(Ml()),fromLink:_}}refetchQueries({updateCache:t,include:n,optimistic:r=!1,removeOptimistic:i=r?H2("refetchQueries"):void 0,onQueryUpdated:o}){const a=new Map;n&&this.getObservableQueries(n).forEach(c=>{if(c.options.fetchPolicy==="cache-only"||c.variablesUnknown)return;const u=c.getCurrentResult();a.set(c,{oq:c,lastDiff:{result:u==null?void 0:u.data,complete:!(u!=null&&u.partial)}})});const s=new Map;if(t){const c=new Set;this.cache.batch({update:t,optimistic:r&&i||!1,removeOptimistic:i,onWatchUpdated(u,d,h){const p=u.watcher;if(p instanceof Zp&&!c.has(p)){if(c.add(p),o){a.delete(p);let m=o(p,d,h);return m===!0&&(m=p.refetch().retain()),m!==!1&&s.set(p,m),m}o!==null&&p.options.fetchPolicy!=="cache-only"&&a.set(p,{oq:p,lastDiff:h,diff:d})}}})}return a.size&&a.forEach(({oq:c,lastDiff:u,diff:d})=>{let h;o&&(d||(d=c.getCacheDiff()),h=o(c,d,u)),(!o||h===!0)&&(h=c.refetch().retain()),h!==!1&&s.set(c,h)}),i&&this.cache.removeOptimistic(i),s}maskOperation(t){const{document:n,data:r}=t;return this.dataMasking?jk(r,n,this.cache):r}maskFragment(t){const{data:n,fragment:r,fragmentName:i}=t;return this.dataMasking?Fk(n,r,this.cache,i):n}fetchQueryByPolicy({query:t,variables:n,fetchPolicy:r,errorPolicy:i,returnPartialData:o,context:a},{cacheWriteBehavior:s,onCacheHit:c,queryInfo:u,observableQuery:d,exposeExtensions:h}){const p=()=>this.cache.diff({query:t,variables:n,returnPartialData:!0,optimistic:!0}),m=(b,v)=>{const S=b.result,w=_=>(!b.complete&&!o&&(_=void 0),{data:_,dataState:b.complete?"complete":_?"partial":"empty",loading:Vu(v),networkStatus:v,partial:!b.complete}),A=_=>ba({kind:"N",value:w(_),source:"cache"});return(b.complete||o)&&this.getDocumentInfo(t).hasForcedResolvers?(c(),ya(this.localState.execute({client:this.client,document:t,remoteResult:S?{data:S}:void 0,context:a,variables:n,onlyRunForcedResolvers:!0,returnPartialData:!0,fetchPolicy:r}).then(_=>({kind:"N",value:w(_.data||void 0),source:"cache"})))):i==="none"&&v===Je.refetch&&b.missing?A(void 0):A(S||void 0)},y=()=>this.getResultsFromLink({query:t,variables:n,context:a,fetchPolicy:r,errorPolicy:i},{cacheWriteBehavior:s,queryInfo:u,observableQuery:d,exposeExtensions:h}).pipe(Q6(),TA(),Fo(b=>({...b,source:"network"})));switch(r){default:case"cache-first":{const b=p();return b.complete?{fromLink:!1,observable:m(b,Je.ready)}:o?{fromLink:!0,observable:fp(m(b,Je.loading),y())}:{fromLink:!0,observable:y()}}case"cache-and-network":{const b=p();return b.complete||o?{fromLink:!0,observable:fp(m(b,Je.loading),y())}:{fromLink:!0,observable:y()}}case"cache-only":return{fromLink:!1,observable:fp(m(p(),Je.ready))};case"network-only":return{fromLink:!0,observable:y()};case"no-cache":return{fromLink:!0,observable:y()};case"standby":return{fromLink:!1,observable:Il}}}}function Q6(){let e=!1;return Ll({next(){e=!0},complete(){at(e,100)}})}function $k(e){return Ki(e,{FragmentSpread:t=>{var n;if(!((n=t.directives)!=null&&n.some(r=>r.name.value==="unmask")))return{...t,directives:[...t.directives||[],{kind:xt.DIRECTIVE,name:{kind:xt.NAME,value:"nonreactive"}}]}}})}function qp(e){var i;if(((i=e.extensions)==null?void 0:i[Do])==null)return e;const{extensions:{[Do]:t,...n},...r}=e;return Object.keys(n).length>0&&(r.extensions=n),r}class eT{constructor(t){se(this,"link");se(this,"cache");se(this,"disableNetworkFetches");se(this,"version");se(this,"queryDeduplication");se(this,"defaultOptions");se(this,"devtoolsConfig");se(this,"refetchEventManager");se(this,"queryManager");se(this,"devToolsHookCb");se(this,"resetStoreCallbacks",[]);se(this,"clearStoreCallbacks",[]);se(this,"query",t=>(this.defaultOptions.query&&(t=Ea(this.defaultOptions.query,t)),this.queryManager.query(t)));se(this,"mutate",t=>{const n=Ea(zr({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),t);return jo(n.mutation,ga.MUTATION),this.queryManager.mutate(n)});se(this,"reFetchObservableQueries");se(this,"maskedFragmentTransform",new vo(nk));var S;const{cache:n,documentTransform:r,ssrMode:i=!1,ssrForceFetchDelay:o=0,queryDeduplication:a=!0,defaultOptions:s,defaultContext:c,assumeImmutableResults:u=n.assumeImmutableResults,localState:d,devtools:h,dataMasking:p,link:m,incrementalHandler:y=new bk,experiments:b=[],refetchEventManager:v}=t;this.link=m,this.cache=n,this.queryDeduplication=a,this.defaultOptions=s||{},this.devtoolsConfig={...h,enabled:(h==null?void 0:h.enabled)??B2},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=Kh,this.queryManager=new Xk({client:this,defaultOptions:this.defaultOptions,defaultContext:c,documentTransform:r,queryDeduplication:a,ssrMode:i,dataMasking:!!p,clientOptions:t,incrementalHandler:y,assumeImmutableResults:u,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:d}),this.prioritizeCacheValues=i||o>0,o&&setTimeout(()=>{this.prioritizeCacheValues=!1},o),this.devtoolsConfig.enabled&&this.connectToDevTools(),b.forEach(w=>w.call(this,t)),this.refetchEventManager=v,(S=this.refetchEventManager)==null||S.connect(this)}set prioritizeCacheValues(t){this.queryManager.prioritizeCacheValues=t}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}connectToDevTools(){if(typeof window>"u")return;const t=window,n=Symbol.for("apollo.devtools");(t[n]=t[n]||[]).push(this),t.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(t){this.queryManager.localState=t}stop(){var t;this.queryManager.stop(),(t=this.refetchEventManager)==null||t.disconnect(this)}watchQuery(t){const{refetchOn:n}=t;if(this.defaultOptions.watchQuery){const r=this.defaultOptions.watchQuery.refetchOn;let i;n&&typeof n=="object"&&(typeof r=="object"?i={...r,...n}:r!=null&&(i=o=>{const a=n[o.source]??r;return typeof a=="function"?a(o):a})),t=Ea(this.defaultOptions.watchQuery,t),i&&(t.refetchOn=i)}return this.queryManager.watchQuery(t)}subscribe(t){const n={},r=this.queryManager.startGraphQLSubscription(t),i=r.pipe(Fo(o=>({...o,data:this.queryManager.maskOperation({document:t.query,data:o.data,fetchPolicy:t.fetchPolicy,cause:n})})));return Object.assign(i,{restart:r.restart})}readQuery(t,n=!!t.optimistic){return this.cache.readQuery({...t,query:this.transform(t.query)},n)}watchFragment(t){const n=this.queryManager.dataMasking;return this.cache.watchFragment({...t,fragment:this.transform(t.fragment,n)})}readFragment(t,n=!!t.optimistic){return this.cache.readFragment({...t,fragment:this.transform(t.fragment)},n)}writeQuery(t){const n=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),n}writeFragment(t){const n=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),n}__actionHookForDevTools(t){this.devToolsHookCb=t}__requestRaw(t){return Rp(this.link,t,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(t=>t()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(t=>t())))}onResetStore(t){return this.resetStoreCallbacks.push(t),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(n=>n!==t)}}onClearStore(t){return this.clearStoreCallbacks.push(t),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(n=>n!==t)}}refetchObservableQueries(t){return this.queryManager.refetchObservableQueries(t)}refetchQueries(t){const n=this.queryManager.refetchQueries(t),r=[],i=[];n.forEach((a,s)=>{r.push(s),i.push(a)});const o=Promise.all(i);return o.queries=r,o.results=i,o.catch(a=>{}),o}getObservableQueries(t="active"){return this.queryManager.getObservableQueries(t)}extract(t){return this.cache.extract(t)}restore(t){return this.cache.restore(t)}setLink(t){this.link=t}get defaultContext(){return this.queryManager.defaultContext}transform(t,n=!1){const r=this.queryManager.transform(t);return n?this.maskedFragmentTransform.transformDocument(r):r}}const{hasOwnProperty:J6}=Object.prototype;function tT(e){return rr(e)&&"payload"in e}async function*nT(e){var p;const t=new TextDecoder("utf-8"),n=(p=e.headers)==null?void 0:p.get("content-type"),r=n==null?void 0:n.match(/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i),i=`\r
|
|
42
42
|
--`+(r?r[1]??r[2]??r[3]??"-":"-");let o="";at(e.body&&typeof e.body.getReader=="function",62);const s=e.body.getReader();let c=!1,u=!1,d;const h=()=>u&&o[0]=="-"&&o[1]=="-";try{for(;!c;){({value:d,done:c}=await s.read());const m=typeof d=="string"?d:t.decode(d),y=o.length-i.length+1;o+=m;let b=o.indexOf(i,y);for(;b>-1&&!h();){u=!0;let v;[v,o]=[o.slice(0,b),o.slice(b+i.length)];const S=v.indexOf(`\r
|
|
43
43
|
\r
|
|
44
44
|
`),A=iT(v.slice(0,S))["content-type"];if(A&&A.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");const _=v.slice(S);_&&(yield _),b=o.indexOf(i)}if(h())return}throw new Error("premature end of multipart body")}finally{s.cancel()}}async function rT(e,t){for await(const n of nT(e)){const r=q6(e,n);if(Object.keys(r).length!=0)if(tT(r)){if(Object.keys(r).length===1&&r.payload===null)return;let i={...r.payload};"errors"in r&&(i.extensions={...i.extensions,[Ql]:new Hu(r.errors??[])}),t(i)}else t(r)}}function iT(e){const t={};return e.split(`
|
|
@@ -892,7 +892,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
892
892
|
`),s=a===-1?-1:o.indexOf(`
|
|
893
893
|
`,a+1),c=s===-1?"":o.slice(s+1);String(r.stack).endsWith(c)||(r.stack+=`
|
|
894
894
|
`+o)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Aa(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&fd.assertOptions(r,{silentJSONParsing:ar.transitional(ar.boolean),forcedJSONParsing:ar.transitional(ar.boolean),clarifyTimeoutError:ar.transitional(ar.boolean),legacyInterceptorReqResOrdering:ar.transitional(ar.boolean),advertiseZstdAcceptEncoding:ar.transitional(ar.boolean),validateStatusUndefinedResolves:ar.transitional(ar.boolean)},!1),i!=null&&(X.isFunction(i)?n.paramsSerializer={serialize:i}:fd.assertOptions(i,{encode:ar.function,serialize:ar.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),fd.assertOptions(n,{baseUrl:ar.spelling("baseURL"),withXsrfToken:ar.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&X.merge(o.common,o[n.method]);o&&X.forEach(["delete","get","head","post","put","patch","query","common"],y=>{delete o[y]}),n.headers=or.concat(a,o);const s=[];let c=!0;this.interceptors.request.forEach(function(b){if(typeof b.runWhen=="function"&&b.runWhen(n)===!1)return;c=c&&b.synchronous;const v=n.transitional||I1;v&&v.legacyInterceptorReqResOrdering?s.unshift(b.fulfilled,b.rejected):s.push(b.fulfilled,b.rejected)});const u=[];this.interceptors.response.forEach(function(b){u.push(b.fulfilled,b.rejected)});let d,h=0,p;if(!c){const y=[L8.bind(this),void 0];for(y.unshift(...s),y.push(...u),p=y.length,d=Promise.resolve(n);h<p;)d=d.then(y[h++],y[h++]);return d}p=s.length;let m=n;for(;h<p;){const y=s[h++],b=s[h++];try{m=y(m)}catch(v){b.call(this,v);break}}try{d=L8.call(this,m)}catch(y){return Promise.reject(y)}for(h=0,p=u.length;h<p;)d=d.then(u[h++],u[h++]);return d}getUri(t){t=Aa(this.defaults,t);const n=x8(t.baseURL,t.url,t.allowAbsoluteUrls,t);return m8(n,t.params,t.paramsSerializer)}};X.forEach(["delete","get","head","options"],function(t){ka.prototype[t]=function(n,r){return this.request(Aa(r||{},{method:t,url:n,data:r&&X.hasOwnProp(r,"data")?r.data:void 0}))}}),X.forEach(["post","put","patch","query"],function(t){function n(r){return function(o,a,s){return this.request(Aa(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}ka.prototype[t]=n(),t!=="query"&&(ka.prototype[t+"Form"]=n(!0))});let oP=class o3{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new uc(o,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new o3(function(i){t=i}),cancel:t}}};function aP(e){return function(n){return e.apply(null,n)}}function sP(e){return X.isObject(e)&&e.isAxiosError===!0}const U1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(U1).forEach(([e,t])=>{U1[t]=e});function j8(e){const t=new ka(e),n=X5(ka.prototype.request,t);return X.extend(n,ka.prototype,t,{allOwnKeys:!0}),X.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return j8(Aa(e,i))},n}const rn=j8(cc);rn.Axios=ka,rn.CanceledError=uc,rn.CancelToken=oP,rn.isCancel=E8,rn.VERSION=j1,rn.toFormData=sd,rn.AxiosError=Pe,rn.Cancel=rn.CanceledError,rn.all=function(t){return Promise.all(t)},rn.spread=aP,rn.isAxiosError=sP,rn.mergeConfig=Aa,rn.AxiosHeaders=or,rn.formToJSON=e=>b8(X.isHTMLForm(e)?new FormData(e):e),rn.getAdapter=M8.getAdapter,rn.HttpStatusCode=U1,rn.default=rn;const{Axios:Z$,AxiosError:K$,CanceledError:Q$,isCancel:J$,CancelToken:q$,VERSION:X$,all:$$,Cancel:eee,isAxiosError:tee,spread:nee,toFormData:ree,AxiosHeaders:iee,HttpStatusCode:oee,formToJSON:aee,getAdapter:see,mergeConfig:lee,create:cee}=rn,lP=()=>rn.create({baseURL:td(),headers:{Authorization:S1()}});function cP(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Ta(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const D8={};function B1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];Ta(t[0])&&D8[t[0]]||(Ta(t[0])&&(D8[t[0]]=new Date),cP(...t))}const V8=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},U8=(e,t,n)=>{e.loadNamespaces(t,V8(e,n))},B8=(e,t,n,r)=>{Ta(n)&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,V8(e,r))},uP=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,c)=>{const u=t.services.backendConnector.state[`${s}|${c}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))},dP=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(B1("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,o)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,e))return!1}}):uP(e,t,n)},Ta=e=>typeof e=="string",fP=e=>typeof e=="object"&&e!==null,hP=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,pP={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},mP=e=>pP[e];let z1={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(hP,mP)};const gP=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};z1={...z1,...e}},vP=()=>z1;let z8;const yP=e=>{z8=e},bP=()=>z8,EP={type:"3rdParty",init(e){gP(e.options.react),yP(e)}},SP=O.createContext();class CP{constructor(){se(this,"getUsedNamespaces",()=>Object.keys(this.usedNamespaces));this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}}const wP=(e,t)=>{const n=O.useRef();return O.useEffect(()=>{n.current=e},[e,t]),n.current},H8=(e,t,n,r)=>e.getFixedT(t,n,r),_P=(e,t,n,r)=>O.useCallback(H8(e,t,n,r),[e,t,n,r]),xP=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:i}=O.useContext(SP)||{},o=n||r||bP();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new CP),!o){B1("You will need to pass in an i18next instance by using initReactI18next");const _=(k,T)=>Ta(T)?T:fP(T)&&Ta(T.defaultValue)?T.defaultValue:Array.isArray(k)?k[k.length-1]:k,C=[_,{},!1];return C.t=_,C.i18n={},C.ready=!1,C}o.options.react&&o.options.react.wait!==void 0&&B1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...vP(),...o.options.react,...t},{useSuspense:s,keyPrefix:c}=a;let u=e||i||o.options&&o.options.defaultNS;u=Ta(u)?[u]:u||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(u);const d=(o.isInitialized||o.initializedStoreOnce)&&u.every(_=>dP(_,o,a)),h=_P(o,t.lng||null,a.nsMode==="fallback"?u:u[0],c),p=()=>h,m=()=>H8(o,t.lng||null,a.nsMode==="fallback"?u:u[0],c),[y,b]=O.useState(p);let v=u.join();t.lng&&(v=`${t.lng}${v}`);const S=wP(v),w=O.useRef(!0);O.useEffect(()=>{const{bindI18n:_,bindI18nStore:C}=a;w.current=!0,!d&&!s&&(t.lng?B8(o,t.lng,u,()=>{w.current&&b(m)}):U8(o,u,()=>{w.current&&b(m)})),d&&S&&S!==v&&w.current&&b(m);const k=()=>{w.current&&b(m)};return _&&o&&o.on(_,k),C&&o&&o.store.on(C,k),()=>{w.current=!1,_&&o&&_.split(" ").forEach(T=>o.off(T,k)),C&&o&&C.split(" ").forEach(T=>o.store.off(T,k))}},[o,v]),O.useEffect(()=>{w.current&&d&&b(p)},[o,c,d]);const A=[y,o,d];if(A.t=y,A.i18n=o,A.ready=d,d||!d&&!s)return A;throw new Promise(_=>{t.lng?B8(o,t.lng,u,()=>_()):U8(o,u,()=>_())})},AP=new yO(e=>({headers:{...e.headers,Authorization:S1()}}));class kP extends Fn{constructor(t){super((n,r)=>new Yt(i=>{let o,a,s;try{o=r(n).subscribe({next:c=>{const u=n.client.queryManager.incrementalHandler,d=u.isIncrementalResult(c)?u.extractErrors(c):c.errors;d?s=t({error:new yo(c,d),result:c,operation:n,forward:r}):W6(c)&&(s=t({error:c.extensions[Ql],result:c,operation:n,forward:r})),a=s==null?void 0:s.subscribe(i),a||i.next(c)},error:c=>{s=t({operation:n,error:Gp(c),forward:r}),a=s==null?void 0:s.subscribe(i),a||i.error(c)},complete:()=>{s||i.complete()}})}catch(c){t({error:Gp(c),operation:n,forward:r}),i.error(c)}return()=>{o&&o.unsubscribe(),a&&a.unsubscribe()}}))}}const TP=new kP(({graphQLErrors:e,networkError:t,forward:n,operation:r})=>(t&&Xt("error","Something went wrong! Please try again.","top-right"),e!=null&&e.length&&e.forEach(({message:i})=>{Xt("error",i||"An error occurred","top-right")}),n(r))),OP=e=>new yT({uri:`${e}/graphql`});function NP(e){return rr(e)&&"code"in e&&"reason"in e}function RP(e){var t;return rr(e)&&((t=e.target)==null?void 0:t.readyState)===WebSocket.CLOSED}class PP extends Fn{constructor(n){super();se(this,"client");this.client=n}request(n){return new Yt(r=>{const{query:i,variables:o,operationName:a,extensions:s}=n;return this.client.subscribe({variables:o,operationName:a,extensions:s,query:Sa(i)},{next:r.next.bind(r),complete:r.complete.bind(r),error:c=>{if(c instanceof Error)return r.error(c);const u=NP(c);return u||RP(c)?r.error(new Error(`Socket closed${u?` with event ${c.code}`:""}${u?` ${c.reason}`:""}`)):r.error(new yo({errors:Array.isArray(c)?c:[c]}))}})})}}function Ar(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Oa(e){return Ar(e)==="object"}function IP(e){return Array.isArray(e)&&e.length>0&&e.every(t=>"message"in t)}function W8(e,t){return e.length<124?e:t}const MP="graphql-transport-ws";var Wr;(function(e){e[e.InternalServerError=4500]="InternalServerError",e[e.InternalClientError=4005]="InternalClientError",e[e.BadRequest=4400]="BadRequest",e[e.BadResponse=4004]="BadResponse",e[e.Unauthorized=4401]="Unauthorized",e[e.Forbidden=4403]="Forbidden",e[e.SubprotocolNotAcceptable=4406]="SubprotocolNotAcceptable",e[e.ConnectionInitialisationTimeout=4408]="ConnectionInitialisationTimeout",e[e.ConnectionAcknowledgementTimeout=4504]="ConnectionAcknowledgementTimeout",e[e.SubscriberAlreadyExists=4409]="SubscriberAlreadyExists",e[e.TooManyInitialisationRequests=4429]="TooManyInitialisationRequests"})(Wr||(Wr={}));var gn;(function(e){e.ConnectionInit="connection_init",e.ConnectionAck="connection_ack",e.Ping="ping",e.Pong="pong",e.Subscribe="subscribe",e.Next="next",e.Error="error",e.Complete="complete"})(gn||(gn={}));function G8(e){if(!Oa(e))throw new Error(`Message is expected to be an object, but got ${Ar(e)}`);if(!e.type)throw new Error("Message is missing the 'type' property");if(typeof e.type!="string")throw new Error(`Message is expects the 'type' property to be a string, but got ${Ar(e.type)}`);switch(e.type){case gn.ConnectionInit:case gn.ConnectionAck:case gn.Ping:case gn.Pong:{if(e.payload!=null&&!Oa(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object or nullish or missing, but got "${e.payload}"`);break}case gn.Subscribe:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Ar(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Oa(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${Ar(e.payload)}`);if(typeof e.payload.query!="string")throw new Error(`"${e.type}" message payload expects the 'query' property to be a string, but got ${Ar(e.payload.query)}`);if(e.payload.variables!=null&&!Oa(e.payload.variables))throw new Error(`"${e.type}" message payload expects the 'variables' property to be a an object or nullish or missing, but got ${Ar(e.payload.variables)}`);if(e.payload.operationName!=null&&Ar(e.payload.operationName)!=="string")throw new Error(`"${e.type}" message payload expects the 'operationName' property to be a string or nullish or missing, but got ${Ar(e.payload.operationName)}`);if(e.payload.extensions!=null&&!Oa(e.payload.extensions))throw new Error(`"${e.type}" message payload expects the 'extensions' property to be a an object or nullish or missing, but got ${Ar(e.payload.extensions)}`);break}case gn.Next:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Ar(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!Oa(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an object, but got ${Ar(e.payload)}`);break}case gn.Error:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Ar(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);if(!IP(e.payload))throw new Error(`"${e.type}" message expects the 'payload' property to be an array of GraphQL errors, but got ${JSON.stringify(e.payload)}`);break}case gn.Complete:{if(typeof e.id!="string")throw new Error(`"${e.type}" message expects the 'id' property to be a string, but got ${Ar(e.id)}`);if(!e.id)throw new Error(`"${e.type}" message requires a non-empty 'id' property`);break}default:throw new Error(`Invalid message 'type' property "${e.type}"`)}return e}function LP(e,t){return G8(typeof e=="string"?JSON.parse(e,t):e)}function dc(e,t){return G8(e),JSON.stringify(e,t)}var Os=function(e){return this instanceof Os?(this.v=e,this):new Os(e)},FP=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(m){return function(y){return Promise.resolve(y).then(m,h)}}function s(m,y){r[m]&&(i[m]=function(b){return new Promise(function(v,S){o.push([m,b,v,S])>1||c(m,b)})},y&&(i[m]=y(i[m])))}function c(m,y){try{u(r[m](y))}catch(b){p(o[0][3],b)}}function u(m){m.value instanceof Os?Promise.resolve(m.value.v).then(d,h):p(o[0][2],m)}function d(m){c("next",m)}function h(m){c("throw",m)}function p(m,y){m(y),o.shift(),o.length&&c(o[0][0],o[0][1])}};function jP(e){const{url:t,connectionParams:n,lazy:r=!0,onNonLazyError:i=console.error,lazyCloseTimeout:o=0,keepAlive:a=0,disablePong:s,connectionAckWaitTimeout:c=0,retryAttempts:u=5,retryWait:d=async function(j){let Y=1e3;for(let B=0;B<j;B++)Y*=2;await new Promise(B=>setTimeout(B,Y+Math.floor(Math.random()*2700+300)))},shouldRetry:h=H1,isFatalConnectionProblem:p,on:m,webSocketImpl:y,generateID:b=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,j=>{const Y=Math.random()*16|0;return(j=="x"?Y:Y&3|8).toString(16)})},jsonMessageReplacer:v,jsonMessageReviver:S}=e;let w;if(y){if(!VP(y))throw new Error("Invalid WebSocket implementation provided");w=y}else typeof WebSocket<"u"?w=WebSocket:typeof global<"u"?w=global.WebSocket||global.MozWebSocket:typeof window<"u"&&(w=window.WebSocket||window.MozWebSocket);if(!w)throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");const A=w,_=(()=>{const L=(()=>{const Y={};return{on(B,J){return Y[B]=J,()=>{delete Y[B]}},emit(B){var J;"id"in B&&((J=Y[B.id])===null||J===void 0||J.call(Y,B))}}})(),j={connecting:m!=null&&m.connecting?[m.connecting]:[],opened:m!=null&&m.opened?[m.opened]:[],connected:m!=null&&m.connected?[m.connected]:[],ping:m!=null&&m.ping?[m.ping]:[],pong:m!=null&&m.pong?[m.pong]:[],message:m!=null&&m.message?[L.emit,m.message]:[L.emit],closed:m!=null&&m.closed?[m.closed]:[],error:m!=null&&m.error?[m.error]:[]};return{onMessage:L.on,on(Y,B){const J=j[Y];return J.push(B),()=>{J.splice(J.indexOf(B),1)}},emit(Y,...B){for(const J of[...j[Y]])J(...B)}}})();function C(L){const j=[_.on("error",Y=>{j.forEach(B=>B()),L(Y)}),_.on("closed",Y=>{j.forEach(B=>B()),L(Y)})]}let k,T=0,R,F=!1,D=0,H=!1;async function z(){clearTimeout(R);const[L,j]=await(k??(k=new Promise((J,W)=>(async()=>{if(F){if(await d(D),!T)return k=void 0,W({code:1e3,reason:"All Subscriptions Gone"});D++}_.emit("connecting",F);const G=new A(typeof t=="function"?await t():t,MP);let $,ie;function ae(){isFinite(a)&&a>0&&(clearTimeout(ie),ie=setTimeout(()=>{G.readyState===A.OPEN&&(G.send(dc({type:gn.Ping})),_.emit("ping",!1,void 0))},a))}C(oe=>{k=void 0,clearTimeout($),clearTimeout(ie),W(oe),oe instanceof Y8&&(G.close(4499,"Terminated"),G.onerror=null,G.onclose=null)}),G.onerror=oe=>_.emit("error",oe),G.onclose=oe=>_.emit("closed",oe),G.onopen=async()=>{try{_.emit("opened",G);const oe=typeof n=="function"?await n():n;if(G.readyState!==A.OPEN)return;G.send(dc(oe?{type:gn.ConnectionInit,payload:oe}:{type:gn.ConnectionInit},v)),isFinite(c)&&c>0&&($=setTimeout(()=>{G.close(Wr.ConnectionAcknowledgementTimeout,"Connection acknowledgement timeout")},c)),ae()}catch(oe){_.emit("error",oe),G.close(Wr.InternalClientError,W8(oe instanceof Error?oe.message:new Error(oe).message,"Internal client error"))}};let ce=!1;G.onmessage=({data:oe})=>{try{const ue=LP(oe,S);if(_.emit("message",ue),ue.type==="ping"||ue.type==="pong"){_.emit(ue.type,!0,ue.payload),ue.type==="pong"?ae():s||(G.send(dc(ue.payload?{type:gn.Pong,payload:ue.payload}:{type:gn.Pong})),_.emit("pong",!1,ue.payload));return}if(ce)return;if(ue.type!==gn.ConnectionAck)throw new Error(`First message cannot be of type ${ue.type}`);clearTimeout($),ce=!0,_.emit("connected",G,ue.payload,F),F=!1,D=0,J([G,new Promise((ye,Ce)=>C(Ce))])}catch(ue){G.onmessage=null,_.emit("error",ue),G.close(Wr.BadResponse,W8(ue instanceof Error?ue.message:new Error(ue).message,"Bad response"))}}})())));L.readyState===A.CLOSING&&await j;let Y=()=>{};const B=new Promise(J=>Y=J);return[L,Y,Promise.race([B.then(()=>{if(!T){const J=()=>L.close(1e3,"Normal Closure");isFinite(o)&&o>0?R=setTimeout(()=>{L.readyState===A.OPEN&&J()},o):J()}}),j])]}function K(L){if(H1(L)&&(DP(L.code)||[Wr.InternalServerError,Wr.InternalClientError,Wr.BadRequest,Wr.BadResponse,Wr.Unauthorized,Wr.SubprotocolNotAcceptable,Wr.SubscriberAlreadyExists,Wr.TooManyInitialisationRequests].includes(L.code)))throw L;if(H)return!1;if(H1(L)&&L.code===1e3)return T>0;if(!u||D>=u||!h(L)||p!=null&&p(L))throw L;return F=!0}r||(async()=>{for(T++;;)try{const[,,L]=await z();await L}catch(L){try{if(!K(L))return}catch(j){return i==null?void 0:i(j)}}})();function V(L,j){const Y=b(L);let B=!1,J=!1,W=()=>{T--,B=!0};return(async()=>{for(T++;;)try{const[G,$,ie]=await z();if(B)return $();const ae=_.onMessage(Y,ce=>{switch(ce.type){case gn.Next:{j.next(ce.payload);return}case gn.Error:{J=!0,B=!0,j.error(ce.payload),W();return}case gn.Complete:{B=!0,W();return}}});G.send(dc({id:Y,type:gn.Subscribe,payload:L},v)),W=()=>{!B&&G.readyState===A.OPEN&&G.send(dc({id:Y,type:gn.Complete},v)),T--,B=!0,$()},await ie.finally(ae);return}catch(G){if(!K(G))return}})().then(()=>{J||j.complete()}).catch(G=>{j.error(G)}),()=>{B||W()}}return{on:_.on,subscribe:V,iterate(L){const j=[],Y={done:!1,error:null,resolve:()=>{}},B=V(L,{next(W){j.push(W),Y.resolve()},error(W){Y.done=!0,Y.error=W,Y.resolve()},complete(){Y.done=!0,Y.resolve()}}),J=(function(){return FP(this,arguments,function*(){for(;;){for(j.length||(yield Os(new Promise($=>Y.resolve=$)));j.length;)yield yield Os(j.shift());if(Y.error)throw Y.error;if(Y.done)return yield Os(void 0)}})})();return J.throw=async W=>(Y.done||(Y.done=!0,Y.error=W,Y.resolve()),{done:!0,value:void 0}),J.return=async()=>(B(),{done:!0,value:void 0}),J},async dispose(){if(H=!0,k){const[L]=await k;L.close(1e3,"Normal Closure")}},terminate(){k&&_.emit("closed",new Y8)}}}class Y8 extends Error{constructor(){super(...arguments),this.name="TerminatedCloseEvent",this.message="4499: Terminated",this.code=4499,this.reason="Terminated",this.wasClean=!1}}function H1(e){return Oa(e)&&"code"in e&&"reason"in e}function DP(e){return[1e3,1001,1006,1005,1012,1013,1014].includes(e)?!1:e>=1e3&&e<=1999}function VP(e){return typeof e=="function"&&"constructor"in e&&"CLOSED"in e&&"CLOSING"in e&&"CONNECTING"in e&&"OPEN"in e}const UP=e=>new PP(jP({connectionParams:()=>({Authorization:S1()}),url:`${e==null?void 0:e.replace("http","ws")}/graphql`,keepAlive:6e4})),W1=e=>new eT({link:Fn.from([AP,TP,Fn.split(({query:t})=>{const n=Sp(t);return n.kind==="OperationDefinition"&&n.operation==="subscription"},UP(e),OP(e))]),cache:new Kk});W1();const BP=e=>{const[t,n]=O.useState(typeof window<"u"&&window.matchMedia(e).matches);return O.useLayoutEffect(()=>{const r=window.matchMedia(e),i=o=>{n(o.matches)};return r.addEventListener("change",i),()=>r.removeEventListener("change",i)},[e]),t},Z8=(e,t)=>{const n=O.useRef(null);return O.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),(...i)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{e(...i)},t)}};var zP=O.useLayoutEffect;function HP(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function WP(){const e=HP();if(e.__xstate__)return e.__xstate__}const GP=e=>{if(typeof window>"u")return;const t=WP();t&&t.register(e)};class K8{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){const n={value:t,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush()}flush(){for(;this._current;){const t=this._current;this._process(t.value),this._current=t.next}this._last=null}}const Q8=".",YP="",J8="",ZP="#",KP="*",q8="xstate.init",QP="xstate.error",hd="xstate.stop";function JP(e,t){return{type:`xstate.after.${e}.${t}`}}function G1(e,t){return{type:`xstate.done.state.${e}`,output:t}}function qP(e,t){return{type:`xstate.done.actor.${e}`,output:t,actorId:e}}function X8(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function $8(e){return{type:q8,input:e}}function Xi(e){setTimeout(()=>{throw e})}const XP=typeof Symbol=="function"&&Symbol.observable||"@@observable";function eE(e,t){const n=tE(e),r=tE(t);return typeof r=="string"?typeof n=="string"?r===n:!1:typeof n=="string"?n in r:Object.keys(n).every(i=>i in r?eE(n[i],r[i]):!1)}function Y1(e){if(iE(e))return e;const t=[];let n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r]}return t.push(n),t}function tE(e){if(LI(e))return e.value;if(typeof e!="string")return e;const t=Y1(e);return $P(t)}function $P(e){if(e.length===1)return e[0];const t={};let n=t;for(let r=0;r<e.length-1;r++)if(r===e.length-2)n[e[r]]=e[r+1];else{const i=n;n={},i[e[r]]=n}return t}function nE(e,t){const n={},r=Object.keys(e);for(let i=0;i<r.length;i++){const o=r[i];n[o]=t(e[o],o,e,i)}return n}function rE(e){return iE(e)?e:[e]}function Bo(e){return e===void 0?[]:rE(e)}function Z1(e,t,n,r){return typeof e=="function"?e({context:t,event:n,self:r}):e}function iE(e){return Array.isArray(e)}function eI(e){return e.type.startsWith("xstate.error.actor")}function Ns(e){return rE(e).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function oE(e){if(!(e===void 0||e===YP))return Bo(e)}function pd(e,t,n){var o,a,s;const r=typeof e=="object",i=r?e:void 0;return{next:(o=r?e.next:e)==null?void 0:o.bind(i),error:(a=r?e.error:t)==null?void 0:a.bind(i),complete:(s=r?e.complete:n)==null?void 0:s.bind(i)}}function aE(e,t){return`${t}.${e}`}function K1(e,t){const n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];const[,r,i]=n,a=e.getStateNodeById(i).config.invoke;return(Array.isArray(a)?a[r]:a).src}function tI(e,t){if(t===e||t===KP)return!0;if(!t.endsWith(".*"))return!1;const n=t.split("."),r=e.split(".");for(let i=0;i<n.length;i++){const o=n[i],a=r[i];if(o==="*")return i===n.length-1;if(o!==a)return!1}return!0}function sE(e,t){return`${e.sessionId}.${t}`}let nI=0;function rI(e,t){const n=new Map,r=new Map,i=new WeakMap,o=new Set,a={},{clock:s,logger:c}=t,u={schedule:(p,m,y,b,v=Math.random().toString(36).slice(2))=>{const S={source:p,target:m,event:y,delay:b,id:v,startedAt:Date.now()},w=sE(p,v);h._snapshot._scheduledEvents[w]=S;const A=s.setTimeout(()=>{delete a[w],delete h._snapshot._scheduledEvents[w],h._relay(p,m,y)},b);a[w]=A},cancel:(p,m)=>{const y=sE(p,m),b=a[y];delete a[y],delete h._snapshot._scheduledEvents[y],b!==void 0&&s.clearTimeout(b)},cancelAll:p=>{for(const m in h._snapshot._scheduledEvents){const y=h._snapshot._scheduledEvents[m];y.source===p&&u.cancel(p,y.id)}}},d=p=>{if(!o.size)return;const m={...p,rootId:e.sessionId};o.forEach(y=>{var b;return(b=y.next)==null?void 0:b.call(y,m)})},h={_snapshot:{_scheduledEvents:((t==null?void 0:t.snapshot)&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${nI++}`,_register:(p,m)=>(n.set(p,m),p),_unregister:p=>{n.delete(p.sessionId);const m=i.get(p);m!==void 0&&(r.delete(m),i.delete(p))},get:p=>r.get(p),getAll:()=>Object.fromEntries(r.entries()),_set:(p,m)=>{const y=r.get(p);if(y&&y!==m)throw new Error(`Actor with system ID '${p}' already exists.`);r.set(p,m),i.set(m,p)},inspect:p=>{const m=pd(p);return o.add(m),{unsubscribe(){o.delete(m)}}},_sendInspectionEvent:d,_relay:(p,m,y)=>{h._sendInspectionEvent({type:"@xstate.event",sourceRef:p,actorRef:m,event:y}),m._send(y)},scheduler:u,getSnapshot:()=>({_scheduledEvents:{...h._snapshot._scheduledEvents}}),start:()=>{const p=h._snapshot._scheduledEvents;h._snapshot._scheduledEvents={};for(const m in p){const{source:y,target:b,event:v,delay:S,id:w}=p[m];u.schedule(y,b,v,S,w)}},_clock:s,_logger:c};return h}let Q1=!1;const J1=1;let kr=(function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e})({});const iI={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class oI{constructor(t,n){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new K8(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=kr.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];const r={...iI,...n},{clock:i,logger:o,parent:a,syncSnapshot:s,id:c,systemId:u,inspect:d}=r;this.system=a?a.system:rI(this,{clock:i,logger:o}),d&&!a&&this.system.inspect(pd(d)),this.sessionId=this.system._bookId(),this.id=c??this.sessionId,this.logger=(n==null?void 0:n.logger)??this.system._logger,this.clock=(n==null?void 0:n.clock)??this.system._clock,this._parent=a,this._syncSnapshot=s,this.options=r,this.src=r.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:h=>{this._deferred.push(h)},system:this.system,stopChild:h=>{if(h._parent!==this)throw new Error(`Cannot stop child actor ${h.id} of ${this.id} because it is not a child`);h._stop()},emit:h=>{const p=this.eventListeners.get(h.type),m=this.eventListeners.get("*");if(!p&&!m)return;const y=[...p?p.values():[],...m?m.values():[]];for(const b of y)try{b(h)}catch(v){Xi(v)}},actionExecutor:h=>{const p=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:h.type,params:h.params}}),!h.exec)return;const m=Q1;try{Q1=!0,h.exec(h.info,h.params)}finally{Q1=m}};this._processingStatus===kr.Running?p():this._deferred.push(p)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),u&&(this.systemId=u,this.system._set(u,this)),this._initState((n==null?void 0:n.snapshot)??(n==null?void 0:n.state)),u&&this._snapshot.status!=="active"&&this.system._unregister(this)}_initState(t){var n;try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,(n=this.options)==null?void 0:n.input)}catch(r){this._snapshot={status:"error",output:void 0,error:r}}}update(t,n){var i,o;this._snapshot=t;let r;for(;r=this._deferred.shift();)try{r()}catch(a){this._deferred.length=0,this._snapshot={...t,status:"error",error:a}}switch(this._snapshot.status){case"active":for(const a of this.observers)try{(i=a.next)==null||i.call(a,t)}catch(s){Xi(s)}break;case"done":for(const a of this.observers)try{(o=a.next)==null||o.call(a,t)}catch(s){Xi(s)}this._stopProcedure(),this._complete(),this._doneEvent=qP(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:t})}subscribe(t,n,r){var o;const i=pd(t,n,r);if(this._processingStatus!==kr.Stopped)this.observers.add(i);else switch(this._snapshot.status){case"done":try{(o=i.complete)==null||o.call(i)}catch(a){Xi(a)}break;case"error":{const a=this._snapshot.error;if(!i.error)Xi(a);else try{i.error(a)}catch(s){Xi(s)}break}}return{unsubscribe:()=>{this.observers.delete(i)}}}on(t,n){let r=this.eventListeners.get(t);r||(r=new Set,this.eventListeners.set(t,r));const i=n.bind(void 0);return r.add(i),{unsubscribe:()=>{r.delete(i)}}}select(t,n=Object.is){return{subscribe:r=>{const i=pd(r),o=this.getSnapshot();let a=t(o);return this.subscribe(s=>{var u;const c=t(s);n(a,c)||(a=c,(u=i.next)==null||u.call(i,c))})},get:()=>t(this.getSnapshot())}}start(){if(this._processingStatus===kr.Running)return this;this._syncSnapshot&&this.subscribe({next:r=>{r.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:r})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=kr.Running;const t=$8(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case"done":return this.update(this._snapshot,t),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(r){return this._snapshot={...this._snapshot,status:"error",error:r},this._error(r),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let n,r;try{n=this.logic.transition(this._snapshot,t,this._actorScope)}catch(i){r={err:i}}if(r){const{err:i}=r;this._snapshot={...this._snapshot,status:"error",error:i},this._error(i);return}this.update(n,t),t.type===hd&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===kr.Stopped?this:(this.mailbox.clear(),this._processingStatus===kr.NotStarted?(this._processingStatus=kr.Stopped,this):(this.mailbox.enqueue({type:hd}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){var t;for(const n of this.observers)try{(t=n.complete)==null||t.call(n)}catch(r){Xi(r)}this.observers.clear(),this.eventListeners.clear()}_reportError(t){if(!this.observers.size){this._parent||Xi(t),this.eventListeners.clear();return}let n=!1;for(const r of this.observers){const i=r.error;n||(n=!i);try{i==null||i(t)}catch(o){Xi(o)}}this.observers.clear(),this.eventListeners.clear(),n&&Xi(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,X8(this.id,t))}_stopProcedure(){return this._processingStatus!==kr.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new K8(this._process.bind(this)),this._processingStatus=kr.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==kr.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){const{devTools:t}=this.options;t&&(typeof t=="function"?t:GP)(this)}toJSON(){return{xstate$$type:J1,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[XP](){return this}getSnapshot(){return this._snapshot}}function Rs(e,...[t]){return new oI(e,t)}function aI(e,t,n,r,{sendId:i}){const o=typeof i=="function"?i(n,r):i;return[t,{sendId:o},void 0]}function sI(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function q1(e){function t(n,r){}return t.type="xstate.cancel",t.sendId=e,t.resolve=aI,t.execute=sI,t}function lI(e,t,n,r,{id:i,systemId:o,src:a,input:s,syncSnapshot:c}){const u=typeof a=="string"?K1(t.machine,a):a,d=typeof i=="function"?i(n):i;let h,p;return u&&(p=typeof s=="function"?s({context:t.context,event:n.event,self:e.self}):s,h=Rs(u,{id:d,src:a,parent:e.self,syncSnapshot:c,systemId:o,input:p})),[Ra(t,{children:{...t.children,[d]:h}}),{id:i,systemId:o,actorRef:h,src:a,input:p},void 0]}function cI(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==kr.Stopped&&t.start()})}function X1(...[e,{id:t,systemId:n,input:r,syncSnapshot:i=!1}={}]){function o(a,s){}return o.type="xstate.spawnChild",o.id=t,o.systemId=n,o.src=e,o.input=r,o.syncSnapshot=i,o.resolve=lI,o.execute=cI,o}function uI(e,t,n,r,{actorRef:i}){const o=typeof i=="function"?i(n,r):i,a=typeof o=="string"?t.children[o]:o;let s=t.children;return a&&(s={...s},delete s[a.id]),[Ra(t,{children:s}),a,void 0]}function lE(e,t){const n=t.getSnapshot();if(n&&"children"in n)for(const r of Object.values(n.children))lE(e,r);e.system._unregister(t)}function dI(e,t){if(t){if(lE(e,t),t._processingStatus!==kr.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t)})}}function md(e){function t(n,r){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=uI,t.execute=dI,t}function fI(e,{context:t,event:n},{guards:r}){return r.every(i=>fc(i,t,n,e))}function hI(e){function t(n,r){return!1}return t.check=fI,t.guards=e,t}function fc(e,t,n,r){const{machine:i}=r,o=typeof e=="function",a=o?e:i.implementations.guards[typeof e=="string"?e:e.type];if(!o&&!a)throw new Error(`Guard '${typeof e=="string"?e:e.type}' is not implemented.'.`);if(typeof a!="function")return fc(a,t,n,r);const s={context:t,event:n},c=o||typeof e=="string"?void 0:"params"in e?typeof e.params=="function"?e.params({context:t,event:n}):e.params:void 0;return"check"in a?a.check(r,s,a):a(s,c)}function $1(e){return e.type==="atomic"||e.type==="final"}function Ps(e){return Object.values(e.states).filter(t=>t.type!=="history")}function hc(e,t){const n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function gd(e){const t=new Set(e),n=uE(t);for(const r of t)if(r.type==="compound"&&(!n.get(r)||!n.get(r).length))hE(r).forEach(i=>t.add(i));else if(r.type==="parallel"){for(const i of Ps(r))if(i.type!=="history"&&!t.has(i)){const o=hE(i);for(const a of o)t.add(a)}}for(const r of t){let i=r.parent;for(;i;)t.add(i),i=i.parent}return t}function cE(e,t){const n=t.get(e);if(!n)return{};if(e.type==="compound"){const i=n[0];if(i){if($1(i))return i.key}else return{}}const r={};for(const i of n)r[i.key]=cE(i,t);return r}function uE(e){const t=new Map;for(const n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function dE(e,t){const n=gd(t);return cE(e,uE(n))}function em(e,t){return t.type==="compound"?Ps(t).some(n=>n.type==="final"&&e.has(n)):t.type==="parallel"?Ps(t).every(n=>em(e,n)):t.type==="final"}const vd=e=>e[0]===ZP;function pI(e,t){const n=e.transitions.get(t),r=[...e.transitions.keys()].filter(i=>i!==t&&tI(t,i)).sort((i,o)=>o.length-i.length).flatMap(i=>e.transitions.get(i));return n?[...n,...r]:r}function mI(e){const t=e.config.after;if(!t)return[];const n=i=>{const o=JP(i,e.id),a=o.type;return e.entry.push(sm(o,{id:a,delay:i})),e.exit.push(q1(a)),a};return Object.keys(t).flatMap(i=>{const o=t[i],a=typeof o=="string"?{target:o}:o,s=Number.isNaN(+i)?i:+i,c=n(s);return Bo(a).map(u=>({...u,event:c,delay:s}))}).map(i=>{const{delay:o}=i;return{...zo(e,i.event,i),delay:o}})}function zo(e,t,n){const r=oE(n.target),i=n.reenter??!1,o=bI(e,r),a={...n,actions:Bo(n.actions),guard:n.guard,target:o,source:e,reenter:i,eventType:t,toJSON:()=>({...a,source:`#${e.id}`,target:o?o.map(s=>`#${s.id}`):void 0})};return a}function gI(e){const t=new Map;if(e.config.on)for(const n of Object.keys(e.config.on)){if(n===J8)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');const r=e.config.on[n];t.set(n,Ns(r).map(i=>zo(e,n,i)))}if(e.config.onDone){const n=`xstate.done.state.${e.id}`;t.set(n,Ns(e.config.onDone).map(r=>zo(e,n,r)))}for(const n of e.invoke){if(n.onDone){const r=`xstate.done.actor.${n.id}`;t.set(r,Ns(n.onDone).map(i=>zo(e,r,i)))}if(n.onError){const r=`xstate.error.actor.${n.id}`;t.set(r,Ns(n.onError).map(i=>zo(e,r,i)))}if(n.onSnapshot){const r=`xstate.snapshot.${n.id}`;t.set(r,Ns(n.onSnapshot).map(i=>zo(e,r,i)))}}for(const n of e.after){let r=t.get(n.eventType);r||(r=[],t.set(n.eventType,r)),r.push(n)}return t}function vI(e){const t=[],n=r=>{Object.values(r).forEach(i=>{if(i.config.route&&i.config.id){const o=i.config.id,a=i.config.route.guard,s=({event:u})=>u.to===`#${o}`,c={...i.config.route,guard:a?hI([s,a]):s,target:`#${o}`};t.push(zo(e,"xstate.route",c))}i.states&&n(i.states)})};n(e.states),t.length>0&&e.transitions.set("xstate.route",t)}function yI(e,t){const n=typeof t=="string"?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);const r={source:e,actions:!t||typeof t=="string"?[]:Bo(t.actions),eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function bI(e,t){if(t!==void 0)return t.map(n=>{if(typeof n!="string")return n;if(vd(n))return e.machine.getStateNodeById(n);const r=n[0]===Q8;if(r&&!e.parent)return yd(e,n.slice(1));const i=r?e.key+n:n;if(e.parent)try{return yd(e.parent,i)}catch(o){throw new Error(`Invalid transition definition for state node '${e.id}':
|
|
895
|
-
${o.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function fE(e){const t=oE(e.config.target);return t?{target:t.map(n=>typeof n=="string"?yd(e.parent,n):n)}:e.parent.initial}function Na(e){return e.type==="history"}function hE(e){const t=pE(e);for(const n of t)for(const r of hc(n,e))t.add(r);return t}function pE(e){const t=new Set;function n(r){if(!t.has(r)){if(t.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(const i of Ps(r))n(i)}}return n(e),t}function Is(e,t){if(vd(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);const n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function yd(e,t){if(typeof t=="string"&&vd(t))try{return e.machine.getStateNodeById(t)}catch{}const n=Y1(t).slice();let r=e;for(;n.length;){const i=n.shift();if(!i.length)break;r=Is(r,i)}return r}function bd(e,t){if(typeof t=="string"){const i=e.states[t];if(!i)throw new Error(`State '${t}' does not exist on '${e.id}'`);return[e,i]}const n=Object.keys(t),r=n.map(i=>Is(e,i)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((i,o)=>{const a=Is(e,o);if(!a)return i;const s=bd(a,t[o]);return i.concat(s)},[]))}function EI(e,t,n,r){const o=Is(e,t).next(n,r);return!o||!o.length?e.next(n,r):o}function SI(e,t,n,r){const i=Object.keys(t),o=Is(e,i[0]),a=tm(o,t[i[0]],n,r);return!a||!a.length?e.next(n,r):a}function CI(e,t,n,r){const i=[];for(const o of Object.keys(t)){const a=t[o];if(!a)continue;const s=Is(e,o),c=tm(s,a,n,r);c&&i.push(...c)}return i.length?i:e.next(n,r)}function tm(e,t,n,r){return typeof t=="string"?EI(e,t,n,r):Object.keys(t).length===1?SI(e,t,n,r):CI(e,t,n,r)}function wI(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function Ho(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function _I(e,t){const n=new Set(e),r=new Set(t);for(const i of n)if(r.has(i))return!0;for(const i of r)if(n.has(i))return!0;return!1}function mE(e,t,n){const r=new Set;for(const i of e){let o=!1;const a=new Set;for(const s of r)if(_I(rm([i],t,n),rm([s],t,n)))if(Ho(i.source,s.source))a.add(s);else{o=!0;break}if(!o){for(const s of a)r.delete(s);r.add(i)}}return Array.from(r)}function xI(e){const[t,...n]=e;for(const r of hc(t,void 0))if(n.every(i=>Ho(i,r)))return r}function nm(e,t){if(!e.target)return[];const n=new Set;for(const r of e.target)if(Na(r))if(t[r.id])for(const i of t[r.id])n.add(i);else for(const i of nm(fE(r),t))n.add(i);else n.add(r);return[...n]}function gE(e,t){const n=nm(e,t);if(!n)return;if(!e.reenter&&n.every(i=>i===e.source||Ho(i,e.source)))return e.source;const r=xI(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function rm(e,t,n){var i;const r=new Set;for(const o of e)if((i=o.target)!=null&&i.length){const a=gE(o,n);o.reenter&&o.source===a&&r.add(a);for(const s of t)Ho(s,a)&&r.add(s)}return[...r]}function AI(e,t){if(e.length!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function kI(e,t,n,r,i){return im([{target:[...pE(e)],source:e,reenter:!0,actions:[],eventType:null,toJSON:null}],t,n,r,!0,i)}function im(e,t,n,r,i,o){const a=[];if(!e.length)return[t,a];const s=n.actionExecutor;n.actionExecutor=c=>{a.push(c),s(c)};try{const c=new Set(t._nodes);let u=t.historyValue;const d=mE(e,c,u);let h=t;i||([h,u]=RI(h,r,n,d,c,u,o,n.actionExecutor)),h=Ls(h,r,n,d.flatMap(m=>m.actions),o,void 0),h=OI(h,r,n,d,c,o,u,i);const p=[...c];h.status==="done"&&(h=Ls(h,r,n,p.sort((m,y)=>y.order-m.order).flatMap(m=>m.exit),o,void 0));try{return u===t.historyValue&&AI(t._nodes,c)?[h,a]:[Ra(h,{_nodes:p,historyValue:u}),a]}catch(m){throw m}}finally{n.actionExecutor=s}}function TI(e,t,n,r,i){if(r.output===void 0)return;const o=G1(i.id,i.output!==void 0&&i.parent?Z1(i.output,e.context,t,n.self):void 0);return Z1(r.output,e.context,o,n.self)}function OI(e,t,n,r,i,o,a,s){let c=e;const u=new Set,d=new Set;NI(r,a,d,u),s&&d.add(e.machine.root);const h=new Set;for(const p of[...u].sort((m,y)=>m.order-y.order)){i.add(p);const m=[];m.push(...p.entry);for(const y of p.invoke)m.push(X1(y.src,{...y,syncSnapshot:!!y.onSnapshot}));if(d.has(p)){const y=p.initial.actions;m.push(...y)}if(c=Ls(c,t,n,m,o,p.invoke.map(y=>y.id)),p.type==="final"){const y=p.parent;let b=(y==null?void 0:y.type)==="parallel"?y:y==null?void 0:y.parent,v=b||p;for((y==null?void 0:y.type)==="compound"&&o.push(G1(y.id,p.output!==void 0?Z1(p.output,c.context,t,n.self):void 0));(b==null?void 0:b.type)==="parallel"&&!h.has(b)&&em(i,b);)h.add(b),o.push(G1(b.id)),v=b,b=b.parent;if(b)continue;c=Ra(c,{status:"done",output:TI(c,t,n,c.machine.root,v)})}}return c}function NI(e,t,n,r){for(const i of e){const o=gE(i,t);for(const s of i.target||[])!Na(s)&&(i.source!==s||i.source!==o||i.reenter)&&(r.add(s),n.add(s)),Ms(s,t,n,r);const a=nm(i,t);for(const s of a){const c=hc(s,o);(o==null?void 0:o.type)==="parallel"&&c.push(o),vE(r,t,n,c,!i.source.parent&&i.reenter?void 0:o)}}}function Ms(e,t,n,r){var i;if(Na(e))if(t[e.id]){const o=t[e.id];for(const a of o)r.add(a),Ms(a,t,n,r);for(const a of o)om(a,e.parent,r,t,n)}else{const o=fE(e);for(const a of o.target)r.add(a),o===((i=e.parent)==null?void 0:i.initial)&&n.add(e.parent),Ms(a,t,n,r);for(const a of o.target)om(a,e.parent,r,t,n)}else if(e.type==="compound"){const[o]=e.initial.target;Na(o)||(r.add(o),n.add(o)),Ms(o,t,n,r),om(o,e,r,t,n)}else if(e.type==="parallel")for(const o of Ps(e).filter(a=>!Na(a)))[...r].some(a=>Ho(a,o))||(Na(o)||(r.add(o),n.add(o)),Ms(o,t,n,r))}function vE(e,t,n,r,i){for(const o of r)if((!i||Ho(o,i))&&e.add(o),o.type==="parallel")for(const a of Ps(o).filter(s=>!Na(s)))[...e].some(s=>Ho(s,a))||(e.add(a),Ms(a,t,n,e))}function om(e,t,n,r,i){vE(n,r,i,hc(e,t))}function RI(e,t,n,r,i,o,a,s){let c=e;const u=rm(r,i,o);u.sort((h,p)=>p.order-h.order);let d;for(const h of u)for(const p of wI(h)){let m;p.history==="deep"?m=y=>$1(y)&&Ho(y,h):m=y=>y.parent===h,d??(d={...o}),d[p.id]=Array.from(i).filter(m)}for(const h of u)c=Ls(c,t,n,[...h.exit,...h.invoke.map(p=>md(p.id))],a,void 0),i.delete(h);return[c,d||o]}function PI(e,t){return e.implementations.actions[t]}function yE(e,t,n,r,i,o){const{machine:a}=e;let s=e;for(const c of r){const u=typeof c=="function",d=u?c:PI(a,typeof c=="string"?c:c.type),h={context:s.context,event:t,self:n.self,system:n.system},p=u||typeof c=="string"?void 0:"params"in c?typeof c.params=="function"?c.params({context:s.context,event:t}):c.params:void 0;if(!d||!("resolve"in d)){n.actionExecutor({type:typeof c=="string"?c:typeof c=="object"?c.type:c.name||"(anonymous)",info:h,params:p,exec:d});continue}const m=d,[y,b,v]=m.resolve(n,s,h,p,d,i);s=y,"retryResolve"in m&&(o==null||o.push([m,b])),"execute"in m&&n.actionExecutor({type:m.type,info:h,params:b,exec:m.execute.bind(null,n,b)}),v&&(s=yE(s,t,n,v,i,o))}return s}function Ls(e,t,n,r,i,o){const a=o?[]:void 0,s=yE(e,t,n,r,{internalQueue:i,deferredActorIds:o},a);return a==null||a.forEach(([c,u])=>{c.retryResolve(n,s,u)}),s}function am(e,t,n,r){var h;let i=e;const o=[];function a(p,m,y){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:m,snapshot:p[0],_transitions:y}),o.push(p)}if(t.type===hd)return i=Ra(bE(i,t,n),{status:"stopped"}),a([i,[]],t,[]),{snapshot:i,microsteps:o};let s=t;if(s.type!==q8){const p=s,m=eI(p),y=EE(p,i);if(m&&!y.length)return i=Ra(e,{status:"error",error:p.error}),a([i,[]],p,[]),{snapshot:i,microsteps:o};const b=im(y,e,n,s,!1,r);i=b[0],a(b,p,y)}let c=!0;const u=((h=e.machine.options)==null?void 0:h.maxIterations)??1/0;let d=0;for(;i.status==="active";){if(d++,d>u)throw new Error(`Infinite loop detected: the machine has processed more than ${u} microsteps without reaching a stable state. This usually happens when there's a cycle of transitions (e.g., eventless transitions or raised events causing state A -> B -> C -> A).`);let p=c?II(i,s):[];const m=p.length?i:void 0;if(!p.length){if(!r.length)break;s=r.shift(),p=EE(s,i)}const y=im(p,i,n,s,!1,r);i=y[0],c=i!==m,a(y,s,p)}return i.status!=="active"&&bE(i,s,n),{snapshot:i,microsteps:o}}function bE(e,t,n){return Ls(e,t,n,Object.values(e.children).map(r=>md(r)),[],void 0)}function EE(e,t){return t.machine.getTransitionData(t,e)}function II(e,t){const n=new Set,r=e._nodes.filter($1);for(const i of r)e:for(const o of[i].concat(hc(i,void 0)))if(o.always){for(const a of o.always)if(a.guard===void 0||fc(a.guard,e.context,t,e)){n.add(a);break e}}return mE(Array.from(n),new Set(e._nodes),e.historyValue)}function MI(e,t){const n=gd(bd(e,t));return dE(e,[...n])}function LI(e){return!!e&&typeof e=="object"&&"machine"in e&&"value"in e}const FI=function(t){return eE(t,this.value)},jI=function(t){return this.tags.has(t)},DI=function(t){const n=this.machine.getTransitionData(this,t);return!!(n!=null&&n.length)&&n.some(r=>r.target!==void 0||r.actions.length)},VI=function(){const{_nodes:t,tags:n,machine:r,getMeta:i,toJSON:o,can:a,hasTag:s,matches:c,...u}=this;return{...u,tags:Array.from(n)}},UI=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function Ed(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:dE(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:FI,hasTag:jI,can:DI,getMeta:UI,toJSON:VI}}function Ra(e,t={}){return Ed({...e,...t},e.machine)}function BI(e){if(typeof e!="object"||e===null)return{};const t={};for(const n in e){const r=e[n];Array.isArray(r)&&(t[n]=r.map(i=>({id:i.id})))}return t}function zI(e,t){const{_nodes:n,tags:r,machine:i,children:o,context:a,can:s,hasTag:c,matches:u,getMeta:d,toJSON:h,...p}=e,m={};for(const b in o){const v=o[b];m[b]={snapshot:v.getPersistedSnapshot(t),src:v.src,systemId:v.systemId,syncSnapshot:v._syncSnapshot}}return{...p,context:SE(a),children:m,historyValue:BI(p.historyValue)}}function SE(e){let t;for(const n in e){const r=e[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)t??(t=Array.isArray(e)?e.slice():{...e}),t[n]={xstate$$type:J1,id:r.id};else{const i=SE(r);i!==r&&(t??(t=Array.isArray(e)?e.slice():{...e}),t[n]=i)}}return t??e}function HI(e,t,n,r,{event:i,id:o,delay:a},{internalQueue:s}){const c=t.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);const u=typeof i=="function"?i(n,r):i;let d;if(typeof a=="string"){const h=c&&c[a];d=typeof h=="function"?h(n,r):h}else d=typeof a=="function"?a(n,r):a;return typeof d!="number"&&s.push(u),[t,{event:u,id:o,delay:d},void 0]}function WI(e,t){const{event:n,delay:r,id:i}=t;if(typeof r=="number"){e.defer(()=>{const o=e.self;e.system.scheduler.schedule(o,o,n,r,i)});return}}function sm(e,t){function n(r,i){}return n.type="xstate.raise",n.event=e,n.id=t==null?void 0:t.id,n.delay=t==null?void 0:t.delay,n.resolve=HI,n.execute=WI,n}const CE="xstate.promise.resolve",wE="xstate.promise.reject",pc=new WeakMap;function mc(e){return{config:e,transition:(n,r,i)=>{var o;if(n.status!=="active")return n;switch(r.type){case CE:{const a=r.data;return{...n,status:"done",output:a,input:void 0}}case wE:return{...n,status:"error",error:r.data,input:void 0};case hd:return(o=pc.get(i.self))==null||o.abort(),pc.delete(i.self),{...n,status:"stopped",input:void 0};default:return n}},start:(n,{self:r,system:i,emit:o})=>{if(n.status!=="active")return;const a=new AbortController;pc.set(r,a),Promise.resolve(e({input:n.input,system:i,self:r,signal:a.signal,emit:o})).then(c=>{r.getSnapshot().status==="active"&&(pc.delete(r),i._relay(r,r,{type:CE,data:c}))},c=>{r.getSnapshot().status==="active"&&(pc.delete(r),i._relay(r,r,{type:wE,data:c}))})},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}function GI(e,{machine:t,context:n},r,i){const o=(a,s)=>{if(typeof a=="string"){const c=K1(t,a);if(!c)throw new Error(`Actor logic '${a}' not implemented in machine '${t.id}'`);const u=Rs(c,{id:s==null?void 0:s.id,parent:e.self,syncSnapshot:s==null?void 0:s.syncSnapshot,input:typeof(s==null?void 0:s.input)=="function"?s.input({context:n,event:r,self:e.self}):s==null?void 0:s.input,src:a,systemId:s==null?void 0:s.systemId});return i[u.id]=u,u}else return Rs(a,{id:s==null?void 0:s.id,parent:e.self,syncSnapshot:s==null?void 0:s.syncSnapshot,input:s==null?void 0:s.input,src:a,systemId:s==null?void 0:s.systemId})};return(a,s)=>{const c=o(a,s);return i[c.id]=c,e.defer(()=>{c._processingStatus!==kr.Stopped&&c.start()}),c}}function YI(e,t,n,r,{assignment:i}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const o={},a={context:t.context,event:n.event,spawn:GI(e,t,n.event,o),self:e.self,system:e.system};let s={};if(typeof i=="function")s=i(a,r);else for(const u of Object.keys(i)){const d=i[u];s[u]=typeof d=="function"?d(a,r):d}const c=Object.assign({},t.context,s);return[Ra(t,{context:c,children:Object.keys(o).length?{...t.children,...o}:t.children}),void 0,void 0]}function Ke(e){function t(n,r){}return t.type="xstate.assign",t.assignment=e,t.resolve=YI,t}const _E=new WeakMap;function Fs(e,t,n){let r=_E.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},_E.set(e,r)),r[t]}const ZI={},gc=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e;class Sd{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(Q8),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?nE(this.config.states,(r,i)=>new Sd(r,{_parent:this,_key:i,_machine:this.machine})):ZI,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=Bo(this.config.entry).slice(),this.exit=Bo(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=Bo(t.tags).slice()}_initialize(){this.transitions=gI(this),this.config.always&&(this.always=Ns(this.config.always).map(t=>zo(this,J8,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(gc),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(gc),eventType:null})}:void 0,history:this.history,states:nE(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(gc)})),entry:this.entry.map(gc),exit:this.exit.map(gc),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return Fs(this,"invoke",()=>Bo(this.config.invoke).map((t,n)=>{const{src:r,systemId:i}=t,o=t.id??aE(this.id,n),a=typeof r=="string"?r:`xstate.invoke.${aE(this.id,n)}`;return{...t,src:a,id:o,systemId:i,toJSON(){const{onDone:s,onError:c,...u}=t;return{...u,type:"xstate.invoke",src:a,id:o}}}}))}get on(){return Fs(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(i=>[n,i])).reduce((n,[r,i])=>(n[r]=n[r]||[],n[r].push(i),n),{}))}get after(){return Fs(this,"delayedTransitions",()=>mI(this))}get initial(){return Fs(this,"initial",()=>yI(this,this.config.initial))}next(t,n){const r=n.type,i=[];let o;const a=Fs(this,`candidates-${r}`,()=>pI(this,r));for(const s of a){const{guard:c}=s,u=t.context;let d=!1;try{d=!c||fc(c,u,n,t)}catch(h){const p=typeof c=="string"?c:typeof c=="object"?c.type:void 0;throw new Error(`Unable to evaluate guard ${p?`'${p}' `:""}in transition for event '${r}' in state node '${this.id}':
|
|
895
|
+
${o.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function fE(e){const t=oE(e.config.target);return t?{target:t.map(n=>typeof n=="string"?yd(e.parent,n):n)}:e.parent.type==="parallel"?{target:[e.parent]}:e.parent.initial}function Na(e){return e.type==="history"}function hE(e){const t=pE(e);for(const n of t)for(const r of hc(n,e))t.add(r);return t}function pE(e){const t=new Set;function n(r){if(!t.has(r)){if(t.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(const i of Ps(r))n(i)}}return n(e),t}function Is(e,t){if(vd(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);const n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function yd(e,t){if(typeof t=="string"&&vd(t))try{return e.machine.getStateNodeById(t)}catch{}const n=Y1(t).slice();let r=e;for(;n.length;){const i=n.shift();if(!i.length)break;r=Is(r,i)}return r}function bd(e,t){if(typeof t=="string"){const i=e.states[t];if(!i)throw new Error(`State '${t}' does not exist on '${e.id}'`);return[e,i]}const n=Object.keys(t),r=n.map(i=>Is(e,i)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((i,o)=>{const a=Is(e,o);if(!a)return i;const s=bd(a,t[o]);return i.concat(s)},[]))}function EI(e,t,n,r){const o=Is(e,t).next(n,r);return!o||!o.length?e.next(n,r):o}function SI(e,t,n,r){const i=Object.keys(t),o=Is(e,i[0]),a=tm(o,t[i[0]],n,r);return!a||!a.length?e.next(n,r):a}function CI(e,t,n,r){const i=[];for(const o of Object.keys(t)){const a=t[o];if(!a)continue;const s=Is(e,o),c=tm(s,a,n,r);c&&i.push(...c)}return i.length?i:e.next(n,r)}function tm(e,t,n,r){return typeof t=="string"?EI(e,t,n,r):Object.keys(t).length===1?SI(e,t,n,r):CI(e,t,n,r)}function wI(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function Ho(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function _I(e,t){const n=new Set(e),r=new Set(t);for(const i of n)if(r.has(i))return!0;for(const i of r)if(n.has(i))return!0;return!1}function mE(e,t,n){const r=new Set;for(const i of e){let o=!1;const a=new Set;for(const s of r)if(_I(rm([i],t,n),rm([s],t,n)))if(Ho(i.source,s.source))a.add(s);else{o=!0;break}if(!o){for(const s of a)r.delete(s);r.add(i)}}return Array.from(r)}function xI(e){const[t,...n]=e;for(const r of hc(t,void 0))if(n.every(i=>Ho(i,r)))return r}function nm(e,t){if(!e.target)return[];const n=new Set;for(const r of e.target)if(Na(r))if(t[r.id])for(const i of t[r.id])n.add(i);else for(const i of nm(fE(r),t))n.add(i);else n.add(r);return[...n]}function gE(e,t){const n=nm(e,t);if(!n)return;if(!e.reenter&&n.every(i=>i===e.source||Ho(i,e.source)))return e.source;const r=xI(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function rm(e,t,n){var i;const r=new Set;for(const o of e)if((i=o.target)!=null&&i.length){const a=gE(o,n);o.reenter&&o.source===a&&r.add(a);for(const s of t)Ho(s,a)&&r.add(s)}return[...r]}function AI(e,t){if(e.length!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function kI(e,t,n,r,i){return im([{target:[...pE(e)],source:e,reenter:!0,actions:[],eventType:null,toJSON:null}],t,n,r,!0,i)}function im(e,t,n,r,i,o){const a=[];if(!e.length)return[t,a];const s=n.actionExecutor;n.actionExecutor=c=>{a.push(c),s(c)};try{const c=new Set(t._nodes);let u=t.historyValue;const d=mE(e,c,u);let h=t;i||([h,u]=RI(h,r,n,d,c,u,o,n.actionExecutor)),h=Ls(h,r,n,d.flatMap(m=>m.actions),o,void 0),h=OI(h,r,n,d,c,o,u,i);const p=[...c];h.status==="done"&&(h=Ls(h,r,n,p.sort((m,y)=>y.order-m.order).flatMap(m=>m.exit),o,void 0));try{return u===t.historyValue&&AI(t._nodes,c)?[h,a]:[Ra(h,{_nodes:p,historyValue:u}),a]}catch(m){throw m}}finally{n.actionExecutor=s}}function TI(e,t,n,r,i){if(r.output===void 0)return;const o=G1(i.id,i.output!==void 0&&i.parent?Z1(i.output,e.context,t,n.self):void 0);return Z1(r.output,e.context,o,n.self)}function OI(e,t,n,r,i,o,a,s){let c=e;const u=new Set,d=new Set;NI(r,a,d,u),s&&d.add(e.machine.root);const h=new Set;for(const p of[...u].sort((m,y)=>m.order-y.order)){i.add(p);const m=[];m.push(...p.entry);for(const y of p.invoke)m.push(X1(y.src,{...y,syncSnapshot:!!y.onSnapshot}));if(d.has(p)){const y=p.initial.actions;m.push(...y)}if(c=Ls(c,t,n,m,o,p.invoke.map(y=>y.id)),p.type==="final"){const y=p.parent;let b=(y==null?void 0:y.type)==="parallel"?y:y==null?void 0:y.parent,v=b||p;for((y==null?void 0:y.type)==="compound"&&o.push(G1(y.id,p.output!==void 0?Z1(p.output,c.context,t,n.self):void 0));(b==null?void 0:b.type)==="parallel"&&!h.has(b)&&em(i,b);)h.add(b),o.push(G1(b.id)),v=b,b=b.parent;if(b)continue;c=Ra(c,{status:"done",output:TI(c,t,n,c.machine.root,v)})}}return c}function NI(e,t,n,r){for(const i of e){const o=gE(i,t);for(const s of i.target||[])!Na(s)&&(i.source!==s||i.source!==o||i.reenter)&&(r.add(s),n.add(s)),Ms(s,t,n,r);const a=nm(i,t);for(const s of a){const c=hc(s,o);(o==null?void 0:o.type)==="parallel"&&c.push(o),vE(r,t,n,c,!i.source.parent&&i.reenter?void 0:o)}}}function Ms(e,t,n,r){var i;if(Na(e))if(t[e.id]){const o=t[e.id];for(const a of o)r.add(a),Ms(a,t,n,r);for(const a of o)om(a,e.parent,r,t,n)}else{const o=fE(e);for(const a of o.target)r.add(a),o===((i=e.parent)==null?void 0:i.initial)&&n.add(e.parent),Ms(a,t,n,r);for(const a of o.target)om(a,e.parent,r,t,n)}else if(e.type==="compound"){const[o]=e.initial.target;Na(o)||(r.add(o),n.add(o)),Ms(o,t,n,r),om(o,e,r,t,n)}else if(e.type==="parallel")for(const o of Ps(e).filter(a=>!Na(a)))[...r].some(a=>Ho(a,o))||(Na(o)||(r.add(o),n.add(o)),Ms(o,t,n,r))}function vE(e,t,n,r,i){for(const o of r)if((!i||Ho(o,i))&&e.add(o),o.type==="parallel")for(const a of Ps(o).filter(s=>!Na(s)))[...e].some(s=>Ho(s,a))||(e.add(a),Ms(a,t,n,e))}function om(e,t,n,r,i){vE(n,r,i,hc(e,t))}function RI(e,t,n,r,i,o,a,s){let c=e;const u=rm(r,i,o);u.sort((h,p)=>p.order-h.order);let d;for(const h of u)for(const p of wI(h)){let m;p.history==="deep"?m=y=>$1(y)&&Ho(y,h):m=y=>y.parent===h,d??(d={...o}),d[p.id]=Array.from(i).filter(m)}for(const h of u)c=Ls(c,t,n,[...h.exit,...h.invoke.map(p=>md(p.id))],a,void 0),i.delete(h);return[c,d||o]}function PI(e,t){return e.implementations.actions[t]}function yE(e,t,n,r,i,o){const{machine:a}=e;let s=e;for(const c of r){const u=typeof c=="function",d=u?c:PI(a,typeof c=="string"?c:c.type),h={context:s.context,event:t,self:n.self,system:n.system},p=u||typeof c=="string"?void 0:"params"in c?typeof c.params=="function"?c.params({context:s.context,event:t}):c.params:void 0;if(!d||!("resolve"in d)){n.actionExecutor({type:typeof c=="string"?c:typeof c=="object"?c.type:c.name||"(anonymous)",info:h,params:p,exec:d});continue}const m=d,[y,b,v]=m.resolve(n,s,h,p,d,i);s=y,"retryResolve"in m&&(o==null||o.push([m,b])),"execute"in m&&n.actionExecutor({type:m.type,info:h,params:b,exec:m.execute.bind(null,n,b)}),v&&(s=yE(s,t,n,v,i,o))}return s}function Ls(e,t,n,r,i,o){const a=o?[]:void 0,s=yE(e,t,n,r,{internalQueue:i,deferredActorIds:o},a);return a==null||a.forEach(([c,u])=>{c.retryResolve(n,s,u)}),s}function am(e,t,n,r){var h;let i=e;const o=[];function a(p,m,y){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:m,snapshot:p[0],_transitions:y}),o.push(p)}if(t.type===hd)return i=Ra(bE(i,t,n),{status:"stopped"}),a([i,[]],t,[]),{snapshot:i,microsteps:o};let s=t;if(s.type!==q8){const p=s,m=eI(p),y=EE(p,i);if(m&&!y.length)return i=Ra(e,{status:"error",error:p.error}),a([i,[]],p,[]),{snapshot:i,microsteps:o};const b=im(y,e,n,s,!1,r);i=b[0],a(b,p,y)}let c=!0;const u=((h=e.machine.options)==null?void 0:h.maxIterations)??1/0;let d=0;for(;i.status==="active";){if(d++,d>u)throw new Error(`Infinite loop detected: the machine has processed more than ${u} microsteps without reaching a stable state. This usually happens when there's a cycle of transitions (e.g., eventless transitions or raised events causing state A -> B -> C -> A).`);let p=c?II(i,s):[];const m=p.length?i:void 0;if(!p.length){if(!r.length)break;s=r.shift(),p=EE(s,i)}const y=im(p,i,n,s,!1,r);i=y[0],c=i!==m,a(y,s,p)}return i.status!=="active"&&bE(i,s,n),{snapshot:i,microsteps:o}}function bE(e,t,n){return Ls(e,t,n,Object.values(e.children).map(r=>md(r)),[],void 0)}function EE(e,t){return t.machine.getTransitionData(t,e)}function II(e,t){const n=new Set,r=e._nodes.filter($1);for(const i of r)e:for(const o of[i].concat(hc(i,void 0)))if(o.always){for(const a of o.always)if(a.guard===void 0||fc(a.guard,e.context,t,e)){n.add(a);break e}}return mE(Array.from(n),new Set(e._nodes),e.historyValue)}function MI(e,t){const n=gd(bd(e,t));return dE(e,[...n])}function LI(e){return!!e&&typeof e=="object"&&"machine"in e&&"value"in e}const FI=function(t){return eE(t,this.value)},jI=function(t){return this.tags.has(t)},DI=function(t){const n=this.machine.getTransitionData(this,t);return!!(n!=null&&n.length)&&n.some(r=>r.target!==void 0||r.actions.length)},VI=function(){const{_nodes:t,tags:n,machine:r,getMeta:i,toJSON:o,can:a,hasTag:s,matches:c,...u}=this;return{...u,tags:Array.from(n)}},UI=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function Ed(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:dE(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:FI,hasTag:jI,can:DI,getMeta:UI,toJSON:VI}}function Ra(e,t={}){return Ed({...e,...t},e.machine)}function BI(e){if(typeof e!="object"||e===null)return{};const t={};for(const n in e){const r=e[n];Array.isArray(r)&&(t[n]=r.map(i=>({id:i.id})))}return t}function zI(e,t){const{_nodes:n,tags:r,machine:i,children:o,context:a,can:s,hasTag:c,matches:u,getMeta:d,toJSON:h,...p}=e,m={};for(const b in o){const v=o[b];m[b]={snapshot:v.getPersistedSnapshot(t),src:v.src,systemId:v.systemId,syncSnapshot:v._syncSnapshot}}return{...p,context:SE(a),children:m,historyValue:BI(p.historyValue)}}function SE(e){let t;for(const n in e){const r=e[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)t??(t=Array.isArray(e)?e.slice():{...e}),t[n]={xstate$$type:J1,id:r.id};else{const i=SE(r);i!==r&&(t??(t=Array.isArray(e)?e.slice():{...e}),t[n]=i)}}return t??e}function HI(e,t,n,r,{event:i,id:o,delay:a},{internalQueue:s}){const c=t.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);const u=typeof i=="function"?i(n,r):i;let d;if(typeof a=="string"){const h=c&&c[a];d=typeof h=="function"?h(n,r):h}else d=typeof a=="function"?a(n,r):a;return typeof d!="number"&&s.push(u),[t,{event:u,id:o,delay:d},void 0]}function WI(e,t){const{event:n,delay:r,id:i}=t;if(typeof r=="number"){e.defer(()=>{const o=e.self;e.system.scheduler.schedule(o,o,n,r,i)});return}}function sm(e,t){function n(r,i){}return n.type="xstate.raise",n.event=e,n.id=t==null?void 0:t.id,n.delay=t==null?void 0:t.delay,n.resolve=HI,n.execute=WI,n}const CE="xstate.promise.resolve",wE="xstate.promise.reject",pc=new WeakMap;function mc(e){return{config:e,transition:(n,r,i)=>{var o;if(n.status!=="active")return n;switch(r.type){case CE:{const a=r.data;return{...n,status:"done",output:a,input:void 0}}case wE:return{...n,status:"error",error:r.data,input:void 0};case hd:return(o=pc.get(i.self))==null||o.abort(),pc.delete(i.self),{...n,status:"stopped",input:void 0};default:return n}},start:(n,{self:r,system:i,emit:o})=>{if(n.status!=="active")return;const a=new AbortController;pc.set(r,a),Promise.resolve(e({input:n.input,system:i,self:r,signal:a.signal,emit:o})).then(c=>{r.getSnapshot().status==="active"&&(pc.delete(r),i._relay(r,r,{type:CE,data:c}))},c=>{r.getSnapshot().status==="active"&&(pc.delete(r),i._relay(r,r,{type:wE,data:c}))})},getInitialSnapshot:(n,r)=>({status:"active",output:void 0,error:void 0,input:r}),getPersistedSnapshot:n=>n,restoreSnapshot:n=>n}}function GI(e,{machine:t,context:n},r,i){const o=(a,s)=>{if(typeof a=="string"){const c=K1(t,a);if(!c)throw new Error(`Actor logic '${a}' not implemented in machine '${t.id}'`);const u=Rs(c,{id:s==null?void 0:s.id,parent:e.self,syncSnapshot:s==null?void 0:s.syncSnapshot,input:typeof(s==null?void 0:s.input)=="function"?s.input({context:n,event:r,self:e.self}):s==null?void 0:s.input,src:a,systemId:s==null?void 0:s.systemId});return i[u.id]=u,u}else return Rs(a,{id:s==null?void 0:s.id,parent:e.self,syncSnapshot:s==null?void 0:s.syncSnapshot,input:s==null?void 0:s.input,src:a,systemId:s==null?void 0:s.systemId})};return(a,s)=>{const c=o(a,s);return i[c.id]=c,e.defer(()=>{c._processingStatus!==kr.Stopped&&c.start()}),c}}function YI(e,t,n,r,{assignment:i}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");const o={},a={context:t.context,event:n.event,spawn:GI(e,t,n.event,o),self:e.self,system:e.system};let s={};if(typeof i=="function")s=i(a,r);else for(const u of Object.keys(i)){const d=i[u];s[u]=typeof d=="function"?d(a,r):d}const c=Object.assign({},t.context,s);return[Ra(t,{context:c,children:Object.keys(o).length?{...t.children,...o}:t.children}),void 0,void 0]}function Ke(e){function t(n,r){}return t.type="xstate.assign",t.assignment=e,t.resolve=YI,t}const _E=new WeakMap;function Fs(e,t,n){let r=_E.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},_E.set(e,r)),r[t]}const ZI={},gc=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e;class Sd{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(Q8),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?nE(this.config.states,(r,i)=>new Sd(r,{_parent:this,_key:i,_machine:this.machine})):ZI,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===!0?"shallow":this.config.history||!1,this.entry=Bo(this.config.entry).slice(),this.exit=Bo(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=Bo(t.tags).slice()}_initialize(){this.transitions=gI(this),this.config.always&&(this.always=Ns(this.config.always).map(t=>zo(this,J8,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(gc),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(gc),eventType:null})}:void 0,history:this.history,states:nE(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(gc)})),entry:this.entry.map(gc),exit:this.exit.map(gc),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return Fs(this,"invoke",()=>Bo(this.config.invoke).map((t,n)=>{const{src:r,systemId:i}=t,o=t.id??aE(this.id,n),a=typeof r=="string"?r:`xstate.invoke.${aE(this.id,n)}`;return{...t,src:a,id:o,systemId:i,toJSON(){const{onDone:s,onError:c,...u}=t;return{...u,type:"xstate.invoke",src:a,id:o}}}}))}get on(){return Fs(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(i=>[n,i])).reduce((n,[r,i])=>(n[r]=n[r]||[],n[r].push(i),n),{}))}get after(){return Fs(this,"delayedTransitions",()=>mI(this))}get initial(){return Fs(this,"initial",()=>yI(this,this.config.initial))}next(t,n){const r=n.type,i=[];let o;const a=Fs(this,`candidates-${r}`,()=>pI(this,r));for(const s of a){const{guard:c}=s,u=t.context;let d=!1;try{d=!c||fc(c,u,n,t)}catch(h){const p=typeof c=="string"?c:typeof c=="object"?c.type:void 0;throw new Error(`Unable to evaluate guard ${p?`'${p}' `:""}in transition for event '${r}' in state node '${this.id}':
|
|
896
896
|
${h.message}`)}if(d){i.push(...s.actions),o=s;break}}return o?[o]:void 0}get events(){return Fs(this,"events",()=>{const{states:t}=this,n=new Set(this.ownEvents);if(t)for(const r of Object.keys(t)){const i=t[r];if(i.states)for(const o of i.events)n.add(`${o}`)}return Array.from(n)})}get ownEvents(){const t=Object.keys(Object.fromEntries(this.transitions)),n=new Set(t.filter(r=>this.transitions.get(r).some(i=>!(!i.target&&!i.actions.length&&!i.reenter))));return Array.from(n)}}const KI="#";class lm{constructor(t,n){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.options=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:(n==null?void 0:n.actors)??{},actions:(n==null?void 0:n.actions)??{},delays:(n==null?void 0:n.delays)??{},guards:(n==null?void 0:n.guards)??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.options={maxIterations:1/0,...this.config.options},this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new Sd(t,{_key:this.id,_machine:this}),this.root._initialize(),vI(this.root),this.states=this.root.states,this.events=this.root.events}provide(t){const{actions:n,guards:r,actors:i,delays:o}=this.implementations;return new lm(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...i,...t.actors},delays:{...o,...t.delays}})}resolveState(t){const n=MI(this.root,t.value),r=gd(bd(this.root,n));return Ed({_nodes:[...r],context:t.context||{},children:{},status:em(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,r){return am(t,n,r,[]).snapshot}microstep(t,n,r){return am(t,n,r,[]).microsteps.map(([i])=>i)}getTransitionData(t,n){return tm(this.root,t.value,t,n)||[]}_getPreInitialState(t,n,r){const{context:i}=this.config,o=Ed({context:typeof i!="function"&&i?i:{},_nodes:[this.root],children:{},status:"active"},this);return typeof i=="function"?Ls(o,n,t,[Ke(({spawn:s,event:c,self:u})=>i({spawn:s,input:c.input,self:u}))],r,void 0):o}getInitialSnapshot(t,n){const r=$8(n),i=[],o=this._getPreInitialState(t,r,i),[a]=kI(this.root,o,t,r,i),{snapshot:s}=am(a,r,t,i);return s}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start()})}getStateNodeById(t){const n=Y1(t),r=n.slice(1),i=vd(n[0])?n[0].slice(KI.length):n[0],o=this.idMap.get(i);if(!o)throw new Error(`Child state node '#${i}' does not exist on machine '${this.id}'`);return yd(o,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return zI(t,n)}restoreSnapshot(t,n){const r={},i=t.children;Object.keys(i).forEach(h=>{const p=i[h],m=p.snapshot,y=p.src,b=typeof y=="string"?K1(this,y):y;if(!b)return;const v=Rs(b,{id:h,parent:n.self,syncSnapshot:p.syncSnapshot,snapshot:m,src:y,systemId:p.systemId});r[h]=v});function o(h,p){if(p instanceof Sd)return p;try{return h.machine.getStateNodeById(p.id)}catch{}}function a(h,p){if(!p||typeof p!="object")return{};const m={};for(const y in p){const b=p[y];for(const v of b){const S=o(h,v);S&&(m[y]??(m[y]=[]),m[y].push(S))}}return m}const s=a(this.root,t.historyValue),c=Ed({...t,children:r,_nodes:Array.from(gd(bd(this.root,t.value))),historyValue:s},this),u=new Set;function d(h,p){if(!u.has(h)){u.add(h);for(const m in h){const y=h[m];if(y&&typeof y=="object"){if("xstate$$type"in y&&y.xstate$$type===J1){h[m]=p[y.id];continue}d(y,p)}}}}return d(c.context,r),c}}function QI(e,t,n,r,{event:i}){const o=typeof i=="function"?i(n,r):i;return[t,{event:o},void 0]}function JI(e,{event:t}){e.defer(()=>e.emit(t))}function xE(e){function t(n,r){}return t.type="xstate.emit",t.event=e,t.resolve=QI,t.execute=JI,t}let cm=(function(e){return e.Parent="#_parent",e.Internal="#_internal",e})({});function qI(e,t,n,r,{to:i,event:o,id:a,delay:s},c){var y;const u=t.machine.implementations.delays;if(typeof o=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${o}" }) instead`);const d=typeof o=="function"?o(n,r):o;let h;if(typeof s=="string"){const b=u&&u[s];h=typeof b=="function"?b(n,r):b}else h=typeof s=="function"?s(n,r):s;const p=typeof i=="function"?i(n,r):i;let m;if(typeof p=="string"){if(p===cm.Parent?m=e.self._parent:p===cm.Internal?m=e.self:p.startsWith("#_")?m=t.children[p.slice(2)]:m=(y=c.deferredActorIds)!=null&&y.includes(p)?p:t.children[p],!m)throw new Error(`Unable to send event to actor '${p}' from machine '${t.machine.id}'.`)}else m=p||e.self;return[t,{to:m,targetId:typeof p=="string"?p:void 0,event:d,id:a,delay:h},void 0]}function XI(e,t,n){typeof n.to=="string"&&(n.to=t.children[n.to])}function $I(e,t){e.defer(()=>{const{to:n,event:r,delay:i,id:o}=t;if(typeof i=="number"){e.system.scheduler.schedule(e.self,n,r,i,o);return}e.system._relay(e.self,n,r.type===QP?X8(e.self.id,r.data):r)})}function um(e,t,n){function r(i,o){}return r.type="xstate.sendTo",r.to=e,r.event=t,r.id=n==null?void 0:n.id,r.delay=n==null?void 0:n.delay,r.resolve=qI,r.retryResolve=XI,r.execute=$I,r}function eM(e,t){return um(cm.Parent,e,t)}function tM(e,t,n,r,{collect:i}){const o=[],a=function(c){o.push(c)};return a.assign=(...s)=>{o.push(Ke(...s))},a.cancel=(...s)=>{o.push(q1(...s))},a.raise=(...s)=>{o.push(sm(...s))},a.sendTo=(...s)=>{o.push(um(...s))},a.sendParent=(...s)=>{o.push(eM(...s))},a.spawnChild=(...s)=>{o.push(X1(...s))},a.stopChild=(...s)=>{o.push(md(...s))},a.emit=(...s)=>{o.push(xE(...s))},i({context:n.context,event:n.event,enqueue:a,check:s=>fc(s,t.context,n.event,t),self:e.self,system:e.system},r),[t,void 0,o]}function nM(e){function t(n,r){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=tM,t}function rM(e,t,n,r,{value:i,label:o}){return[t,{value:typeof i=="function"?i(n,r):i,label:o},void 0]}function iM({logger:e},{value:t,label:n}){n?e(n,t):e(t)}function oM(e=({context:n,event:r})=>({context:n,event:r}),t){function n(r,i){}return n.type="xstate.log",n.value=e,n.label=t,n.resolve=rM,n.execute=iM,n}function aM(e,t){return new lm(e,t)}function dm({schemas:e,actors:t,actions:n,guards:r,delays:i}){return{assign:Ke,sendTo:um,raise:sm,log:oM,cancel:q1,stopChild:md,enqueueActions:nM,emit:xE,spawnChild:X1,createStateConfig:o=>o,createAction:o=>o,createMachine:o=>aM({...o,schemas:e},{actors:t,actions:n,guards:r,delays:i}),extend:o=>dm({schemas:e,actors:t,actions:{...n,...o.actions},guards:{...r,...o.guards},delays:{...i,...o.delays}})}}var fm={exports:{}},hm={exports:{}},pm={},AE;function sM(){if(AE)return pm;AE=1;/**
|
|
897
897
|
* @license React
|
|
898
898
|
* use-sync-external-store-shim.development.js
|
|
@@ -1616,7 +1616,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1616
1616
|
<p className="ed-text-border-regular ed-whitespace-pre-line">${t}</p>
|
|
1617
1617
|
</div>
|
|
1618
1618
|
${r}
|
|
1619
|
-
</div>`},Wx={ANGRY:E.jsx(eD,{}),SAD:E.jsx(rD,{}),NEUTRAL:E.jsx(tD,{}),HAPPY:E.jsx(nD,{}),LOVE:E.jsx(iD,{})},_Y="data:image/png;base64,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",xY=({surveyData:e,onClose:t,onSubmit:n,isSubmitting:r=!1})=>{var H;const[i,o]=O.useState(!1),[a,s]=O.useState(null),[c,u]=O.useState(null),[d,h]=O.useState(""),p=(e==null?void 0:e.title)||"How was your support experience?",m=(e==null?void 0:e.description)||"",y=(e==null?void 0:e.is_description_enabled)||!1,b=(e==null?void 0:e.active_rating_type)||"numeric",v=(e==null?void 0:e.is_optional_question_enabled)||!1,S=(e==null?void 0:e.is_open_ended_question_enabled)||!1,w=(e==null?void 0:e.optional_question_title)||"We're sorry to hear that. Could you share what didn't go well?",A=(e==null?void 0:e.optional_question_options)||[],_=(e==null?void 0:e.open_ended_question_title)||"Share your thoughts on the support you received",C=((H=e==null?void 0:e.rating_types)==null?void 0:H.filter(z=>z.rating_type===b).sort((z,K)=>K.score-z.score))||[],k=z=>{s(z)},T=z=>{u(K=>K===z?null:z)},R=async()=>{if(!a||!n)return;const z={satisfaction_rating_type_id:a.id,optional_question_responses:c?[typeof c=="string"?c:c.label]:null,open_ended_question_response:(d==null?void 0:d.trim())||null};try{if(await n(z)===!1){Xt("error","We could not submit your feedback. Please try again.","top-left");return}o(!0)}catch{Xt("error","We could not submit your feedback. Please try again.","top-left")}},F=()=>{t&&t()},D=()=>b==="numeric"?E.jsx("div",{className:"ed-flex ed-gap-2 ed-flex-wrap ed-justify-between",children:C.map(z=>{const K=(a==null?void 0:a.id)===z.id;return E.jsxs("button",{type:"button",onClick:()=>k(z),className:"ed-flex ed-flex-col ed-items-center ed-gap-2 ed-group ed-flex-1",children:[E.jsx("div",{className:fn("ed-w-10 ed-h-10 ed-flex ed-items-center ed-justify-center ed-rounded ed-text-14 ed-border ed-transition-colors",K?"ed-bg-brand-light ed-text-brand ed-border-brand":"ed-bg-gray ed-text-border-dark ed-border-[#8F99AD]"),children:z.numeric_value}),E.jsx("span",{className:fn("ed-text-10 ed-font-medium group-hover:ed-text-brand ed-transition-colors",K?"ed-text-brand":"ed-text-border-dark"),children:z.label})]},z.id)})}):b==="emoji"?E.jsx("div",{className:"ed-flex ed-justify-between ed-gap-3 ",children:C.map(z=>{const K=(a==null?void 0:a.id)===z.id;return E.jsxs("button",{type:"button",onClick:()=>k(z),className:fn("ed-flex ed-flex-col ed-items-center ed-gap-2 ed-group ed-min-w-[60px]"),children:[E.jsx("div",{className:fn("ed-text-24 ed-flex ed-justify-center ed-items-center hover:ed-scale-110 ed-size-10 ed-transition-transform",K?"ed-border ed-rounded-md ed-bg-brand-light ed-border-brand":"ed-text-border-dark"),children:Wx[z.emoji]&&Wx[z.emoji]}),E.jsx("span",{className:fn("ed-text-12 ed-font-medium group-hover:ed-text-brand ed-transition-colors",K?"ed-text-brand":"ed-text-border-dark"),children:z.label})]},z.id)})}):b==="custom_text"?E.jsx("div",{className:"ed-flex ed-flex-col ed-gap-3 ed-w-full ed-max-w-[280px] ed-mx-auto",children:C.map(z=>{const K=(a==null?void 0:a.id)===z.id;return E.jsx("button",{type:"button",onClick:()=>k(z),className:fn("ed-w-full ed-py-3 ed-px-4 ed-border ed-border-regular hover:ed-border-brand hover:ed-bg-white-light ed-rounded-[20px] ed-text-14 ed-font-medium ed-text-border-dark ed-transition-all",K?"ed-border-brand ed-bg-brand-light":"ed-border-regular ed-bg-white"),children:z.label},z.id)})}):null;return i?E.jsxs("div",{className:"ed-flex ed-flex-col ed-items-center ed-justify-center ed-text-center ed-px-4 ed-py-8 ed-pt-16 ed-relative",children:[E.jsx("button",{type:"button",onClick:F,className:"ed-absolute ed-top-3 ed-right-3 ed-text-border-regular hover:ed-text-border-dark ed-transition-colors ed-z-10",children:E.jsx(ci,{size:20})}),E.jsx("h3",{className:"ed-text-18 ed-font-semibold ed-text-border-dark ed-px-9",children:"Thank you for sharing your experience with us."}),E.jsx("div",{className:"ed-w-40 ed-h-auto ed-my-12",children:E.jsx(Tr,{src:_Y,width:600,height:451,className:"ed-h-[140px] ed-w-fit",alt:"Thank you"})})]}):E.jsxs("div",{className:"ed-border-border-light ed-bg-white ed-relative",children:[E.jsx("button",{type:"button",onClick:F,className:"ed-absolute ed-top-3 ed-right-3 ed-text-border-regular hover:ed-text-border-dark ed-transition-colors ed-z-10",children:E.jsx(ci,{size:20})}),E.jsxs("div",{className:"ed-px-5 ed-py-4 ed-pb-6",children:[E.jsx("h3",{className:"ed-text-16 ed-font-semibold ed-text-border-dark ed-mb-3 ed-text-center ed-pr-6",children:p}),y&&m&&E.jsx("p",{className:"ed-text-14 ed-text-border-regular ed-mb-4 ed-text-center",children:m}),E.jsx("div",{className:"ed-py-2",children:D()}),a&&a.score<=2&&v&&E.jsxs("div",{className:"ed-mt-6 ed-pt-6 ed-border-t ed-border-gray",children:[E.jsx("p",{className:"ed-text-14 ed-font-medium ed-text-border-dark ed-mb-4 ed-text-center",children:w}),E.jsx("div",{className:"ed-flex ed-flex-wrap ed-gap-2 ed-justify-center",children:A.map((z,K)=>E.jsx("button",{type:"button",onClick:()=>T(z),className:fn("ed-py-1.5 ed-px-4 ed-rounded-[7px] ed-text-12 ed-font-semibold ed-border ed-transition-all",c===z?"ed-bg-border-dark ed-text-white ed-border-border-dark":"ed-bg-white ed-text-border-dark ed-border-regular hover:ed-border-border-dark"),children:typeof z=="string"?z:z==null?void 0:z.label},`optional-option-${z.label+K}`))})]}),a&&S&&(!(a.score<=2&&v)||c)&&E.jsxs("div",{className:"ed-mt-6 ed-pt-6 ed-border-t ed-border-gray",children:[E.jsx("p",{className:"ed-text-14 ed-font-semibold ed-text-dark ed-mb-1",children:_}),E.jsx("textarea",{placeholder:"Write here",value:d,onChange:z=>h(z.target.value),rows:4,className:"ed-w-full ed-px-4 ed-py-3 ed-border ed-border-border-light ed-rounded-[5px] ed-text-14 ed-text-border-dark placeholder:ed-text-border-regular focus:ed-outline-none focus:ed-border-brand ed-resize-none"})]}),a&&E.jsx("div",{className:"ed-mt-5 ed-flex ed-justify-center ed-mb-2",children:E.jsx(La,{title:"Submit",callBack:R,loader:r,disabled:r,loaderText:"Submitting..."})})]})]})},AY=({orgBrandSetting:e={},userData:t={},currentConversationID:n,setCurrentConversationID:r})=>{var Te,xe,je,ze,Re;const{conversationData:i,initialStatesData:o,conversationState:a,inputFieldState:s,setInputFieldState:c,isAIThinking:u,setIsAIThinking:d,handleUpdateConversationActivityAnalytics:h,send:p}=js(),{sendMessage:m}=Pm(),{satisfaction_setting:y}=e||{},b=y==null?void 0:y.satisfaction_survey,[v,S]=O.useState(!0),w=O.useRef(null),A=O.useRef(null),_=O.useRef(!1),C=Hr.get("easydesk_chat_widget_conversation_id"),{brand:k}=e,[T,R]=O.useState(null),[F,D]=O.useState(!1),[H,z]=O.useState([]),K=n||C,[V]=Es(Xc,{errorPolicy:"all",fetchPolicy:"no-cache"}),[L,{loading:j}]=bo(SY,{errorPolicy:"all",fetchPolicy:"no-cache"}),Y=async de=>{var be,Ne;try{const Qe=wY({title:de==null?void 0:de.title,message:de==null?void 0:de.message,files:de.conversation_activity_files}),we=await m({is_customer_reply:!0,message:Qe,conversation_id:K});if(we!=null&&we.id){c(gt=>({...gt,ticket_title:de==null?void 0:de.ticket_title,ticket_activity:de==null?void 0:de.ticket_activity,conversation_activity_files:de==null?void 0:de.conversation_activity_files}));const qe=eh(Ft.ticket.success,{ticket_id:(de==null?void 0:de.ticketId)||"N/A",customer_email:((be=i==null?void 0:i.contact)==null?void 0:be.person_email)||(s==null?void 0:s.contact_person_email)||"your email"});await m({is_auto_response:!0,message:qe,conversation_status:"closed",current_stage:"closed"},!0),p({type:ut.UPDATE_CONVERSATION_STATUS,status:"closed"})}}catch(Qe){const{message:we,response:qe}=Qe;Xt("error",((Ne=qe==null?void 0:qe.data)==null?void 0:Ne.message)||we,"top-left")}},B=async()=>{try{await m({conversation_id:K,message:Ft.ai.thanksFeedback,is_auto_response:!0,current_stage:"followup_feedback"})}catch(de){console.error("Error creating follow-up message:",de)}},J=async()=>{var de;try{const{data:be}=await V({variables:{queryData:{is_live_chat_enabled:!0}}}),Ne=De.size((de=be==null?void 0:be.getChannelsForPortal)==null?void 0:de.data)>0&&!(e!=null&&e.is_off_hour);D(Ne),await m({conversation_id:K,message:Ft.ai.needMoreHelp,is_auto_response:!0,current_stage:"need_help"})}catch(be){console.error("Error handling initial no click:",be)}},W=async()=>{var de;try{const{data:be}=await V({variables:{queryData:{is_live_chat_enabled:!0}}}),Ne=De.size((de=be==null?void 0:be.getChannelsForPortal)==null?void 0:de.data)>0&&!(e!=null&&e.is_off_hour);D(Ne),await m({conversation_id:K,message:Ft.ai.needMoreHelp,is_auto_response:!0,current_stage:"need_help"})}catch(be){console.error("Error handling intermediate yes click:",be)}},G=async()=>{var de;try{const be=((de=i==null?void 0:i.contact)==null?void 0:de.person_name)||"there",Ne=eh(Ft.ai.goodbye,{name:be});await m({conversation_id:K,message:Ne,is_auto_response:!0,conversation_status:"resolved",current_stage:"closed"}),p({type:ut.UPDATE_CONVERSATION_STATUS,status:"resolved"}),R("CONVERSATION_ENDED")}catch(be){console.error("Error handling intermediate no click:",be)}},$=async()=>{try{await m({conversation_id:K,message:Ft.followUp.withAainAI,is_auto_response:!0,current_stage:"ai_available"})}catch(de){console.error("Error restarting conversation:",de)}},ie=async()=>{var de;try{const be=((de=i==null?void 0:i.contact)==null?void 0:de.person_name)||"there",Ne=eh(Ft.ai.goodbye,{name:be});await m({conversation_id:K,message:Ne,is_auto_response:!0,conversation_status:"resolved",current_stage:"closed"}),p({type:ut.UPDATE_CONVERSATION_STATUS,status:"resolved"}),R("CONVERSATION_ENDED")}catch(be){console.error("Error handling follow-up no click:",be)}},ae=async de=>{try{await m({conversation_id:K,message:de.message,is_customer_reply:de.is_customer_reply,channel_id:de.channel_id,current_stage:"agent_chat"}),z([]),await m({conversation_id:K,message:Ft.followUp.afterChannelSelection,is_auto_response:!0,is_customer_reply:!1,current_stage:"agent_chat"})}catch(be){console.error("Error selecting channel:",be)}},ce=async de=>{var be;try{const Ne={conversation_id:K,satisfaction_rating_type_id:de.satisfaction_rating_type_id,optional_question_responses:de.optional_question_responses||null,open_ended_question_response:de.open_ended_question_response||null},{data:Qe}=await L({variables:{inputData:Ne}});return!!((be=Qe==null?void 0:Qe.createASatisfactionRating)!=null&&be.id)}catch(Ne){return console.error("Error submitting survey:",Ne),Xt("error","Failed to submit feedback. Please try again.","top-left"),!1}},oe=()=>{p({type:ut.RELOAD_CONVERSATION_DATA}),S(!1)},ue=()=>{p({type:ut.CONVERSATION_CLOSED}),c(o.inputFieldState),R(!1),Hr.remove("easydesk_chat_widget_conversation_id")},ye=((Te=a==null?void 0:a.metaData)==null?void 0:Te.filtered_rows)&&De.size(a==null?void 0:a.messages)<((xe=a==null?void 0:a.metaData)==null?void 0:xe.filtered_rows),{loadMoreMessages:Ce}=Pm(),Se=Ce;O.useEffect(()=>{if(!A.current||_.current)return;const be=setTimeout(()=>{const Ne=A.current;Ne&&requestAnimationFrame(()=>{Ne.scrollTop=Ne.scrollHeight})},100);return()=>clearTimeout(be)},[De.size(a==null?void 0:a.messages)]),O.useEffect(()=>{if(K&&A.current){const de=setTimeout(()=>{A.current&&(A.current.scrollTop=A.current.scrollHeight)},300);return()=>clearTimeout(de)}},[K]),O.useEffect(()=>{K&&(w.current=null)},[K]);const he=(i==null?void 0:i.is_spam)||["closed","resolved"].includes(i==null?void 0:i.status),q=(()=>{if((i==null?void 0:i.status)!=="resolved"||i!=null&&i.has_customer_feedback||!y||!b||!y.is_satisfaction_rating_enabled)return!1;const de=i==null?void 0:i.type;return!(de==="ticket"&&!y.is_ticket_feedback_active||de==="chat"&&!y.is_chat_feedback_active)})(),ke=()=>{var be;if(!(a!=null&&a.messages)||De.size(a.messages)===0)return!1;const de=a.messages[a.messages.length-1];return((be=de==null?void 0:de.metadata)==null?void 0:be.current_stage)==="agent_chat"||(i==null?void 0:i.assignee)},ve=()=>{if(u)return!0;if(!(a!=null&&a.messages)||De.size(a.messages)===0)return!1;const de=a.messages[a.messages.length-1],be=de==null?void 0:de.metadata;return!be||de!=null&&de.is_customer_reply?!1:!!(be.current_stage&&!["agent_chat","ai_available","try_another_question"].includes(be.current_stage)||be.has_results===!0||be.has_results===!1)};return O.useEffect(()=>{let de=[];const be=De.debounce(async()=>{await h({seen_activity_ids:de}),de=[]},1e3),Ne=new IntersectionObserver(we=>{we.forEach(qe=>{if(qe.isIntersecting){const gt=qe.target.getAttribute("data-message-id");gt&&de.push(gt)}}),De.size(de)&&be()},{threshold:1}),Qe=document.querySelectorAll(".ed-message");return Qe.forEach(we=>Ne.observe(we)),()=>{be.cancel(),Qe.forEach(we=>Ne.unobserve(we))}},[a==null?void 0:a.messages]),E.jsxs("div",{children:[E.jsx("div",{ref:A,id:"activities-scroll-target",className:"ed-flex ed-flex-col ed-pb-5 ed-space-y-5 ed-h-[calc(100vh-200px)] ed-overflow-y-auto ed-no-scrollbar",style:{scrollBehavior:"smooth"},children:E.jsx(Qg,{dataLength:De.size(a==null?void 0:a.messages),hasMore:ye,scrollableTarget:"activities-scroll-target",inverse:!0,next:()=>{_.current=!0,Se(),setTimeout(()=>{_.current=!1},500)},children:E.jsxs("div",{className:"ed-flex-1 ed-space-y-3",children:[De.size(a==null?void 0:a.messages)?E.jsxs("div",{children:[(i==null?void 0:i.type)==="ticket"&&E.jsxs("div",{className:"ed-bg-gray-light ed-p-2 ed-rounded",children:[E.jsxs("p",{className:"ed-text-regular ed-font-normal ed-text-14",children:["ID",i==null?void 0:i.serial]}),E.jsx("h5",{className:"ed-text-dark ed-font-normal ed-text-14",children:i==null?void 0:i.title})]}),(je=a==null?void 0:a.messages)==null?void 0:je.map(de=>E.jsx("div",{className:"single-message ed-px-5 ed-pt-3 ed-animate-fadeInUp",children:["reply","file"].includes(de==null?void 0:de.type)?E.jsx(Vx,{activityMessage:de,brand:k,isInitiatedWithAi:i==null?void 0:i.is_initiated_with_ai},de==null?void 0:de.id):E.jsx(gG,{log:de==null?void 0:de.log},de==null?void 0:de.id)},de==null?void 0:de.id))]}):E.jsx(EG,{onSubmit:de=>{c(be=>({...be,contact_person_name:de==null?void 0:de.contact_person_name,contact_person_email:de==null?void 0:de.contact_person_email}))},orgBrandSetting:e,setSelectedConversationId:r,userData:t}),!u&&(a==null?void 0:a.messages)&&De.size(a.messages)>0&&(()=>{const de=a.messages[a.messages.length-1],{metadata:be}=de||{};if(be&&!(de!=null&&de.is_customer_reply)){const{current_stage:Ne}=be;if(!Ne&&be.has_results===!0)return E.jsx(oh,{type:"initial",sendMessage:m,conversationId:K,onYes:B,onNo:J});if(Ne==="initial_feedback")return E.jsx(oh,{type:"initial",sendMessage:m,conversationId:K,onYes:B,onNo:J});if(Ne==="followup_feedback")return E.jsx(oh,{type:"followup",sendMessage:m,conversationId:K,onYes:$,onNo:ie});if(Ne==="intermediate_help")return E.jsx(oh,{type:"intermediate",sendMessage:m,conversationId:K,onYes:W,onNo:G});if(Ne==="need_help")return E.jsx(zx,{type:"need_help",sendMessage:m,conversationId:K,showChatButton:F,setIsAIThinking:d,onChannelSelection:ae});if(!be.has_results&&!Ne&&!(i!=null&&i.assignee))return E.jsx(zx,{type:"no_results",sendMessage:m,conversationId:K,setIsAIThinking:d,onChannelSelection:ae});if(Ne==="select_channel")return E.jsx(bY,{channels:H,onSubmit:ae});if(Ne==="create_a_support_ticket")return E.jsx(cw,{from:"message",isAuthenticated:!0,onSubmit:Y,reqId:null,userData:s,metadata:be})}return null})(),(((ze=a==null?void 0:a.writing_realtime_status)==null?void 0:ze.is_writing_reply)||u)&&E.jsx("div",{className:"single-message ed-px-5",children:E.jsx(Vx,{brand:k,activityMessage:{user:(Re=a==null?void 0:a.writing_realtime_status)==null?void 0:Re.author,is_customer_reply:!1,is_ai_response:u,created_at:Date.now()},isReplying:!0})})]})})}),q&&v&&E.jsx("div",{className:"ed-flex-1 ed-rounded-t-xl ed-overflow-y-auto ed-no-scrollbar ed-max-h-full ed-absolute ed-bottom-0 ed-left-0 ed-bg-white ed-shadow-[0_-4px_50px_rgba(0,0,0,0.2)] ed-z-[999]",children:E.jsx(xY,{surveyData:b,onSubmit:ce,isSubmitting:j,onClose:oe})}),((i==null?void 0:i.type)==="ticket"||!he&&De.size(a==null?void 0:a.messages)>=3&&!T&&!ve()&&T!=="CONVERSATION_ENDED")&&E.jsx("div",{className:"ed-sticky ed-bottom-0 ed-bg-white ed-pt-1 ed--mx-5 ed-px-6",children:E.jsx(yY,{conversationData:i,conversationId:K,handleCreateMessage:m,onAIThinkingChange:d,isAIThinking:u,useAITemplate:!ke()})}),(i==null?void 0:i.type)!=="ticket"&&(T&&T!=="CONVERSATION_ENDED"||he)&&E.jsx("div",{className:"ed-py-2 ed-px-5 ed-bg-white ed-text-gray-500 ed-sticky ed-bottom-0 ed-left-0",children:E.jsxs("p",{className:"ed-text-center ed-text-sm",children:["Your chat has ended. ",E.jsx("br",{}),"To start a new chat, ",E.jsx("button",{type:"button",className:"ed-underline ed-text-blue-600 ed-text-sm",onClick:ue,children:"click here"})]})})]})},kY=({item:e,onSelect:t,userData:n})=>{const{id:r,type:i,status:o,last_conversation_activity:a,organization_brand:s,assignee:c}=e||{},{handleUpdateConversationActivityAnalytics:u}=So(),{message:d,user:h,created_at:p,analytics:m}=a||{},{status:y}=(m==null?void 0:m[0])||{},{setting:b,name:v}=s||{},{first_name:S,last_name:w,email:A,avatar_file:_}=(c==null?void 0:c.user)||{},C=O.useMemo(()=>nd(S,w,A)||v||"Unknown User",[S,w,A,v]),k=_||(b==null?void 0:b.icon),T=(n==null?void 0:n.id)===(h==null?void 0:h.id),R=K=>T?"ed-text-border-dark":K?"ed-text-border-dark ed-font-medium":"ed-text-border-dark ed-font-semibold",F=async()=>{y!=="seen"&&await u({seen_activity_ids:[a==null?void 0:a.id]}),t(r)},D=O.useMemo(()=>cY[o],[o]),H=T&&y==="seen",z=O.useMemo(()=>uY(d),[d]);return E.jsxs("div",{role:"button",tabIndex:0,onClick:F,className:"ed-flex ed-items-center ed-gap-2.5 ed-border-b ed-py-5 ed-px-5 hover:ed-bg-light/40 ed-cursor-pointer ed-custom-wrapper hover:ed-bg-white-light",children:[E.jsx("div",{className:"ed-size-12 ed-flex ed-items-center ed-justify-center",children:E.jsx(Tr,{alt:C,path:k==null?void 0:k.key,defaultImageName:qi(A||v),className:"ed-size-10 ed-object-cover ed-rounded-full",defaultUserNameTextSize:"ed-text-12",defaultImageClasses:"ed-size-10 ed-object-cover ed-rounded-full"})}),E.jsxs("div",{className:"ed-w-full ed-flex ed-justify-between ed-items-center",children:[E.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-0.5",children:[E.jsx("p",{className:`ed-font-medium ed-text-12 ed-line-clamp-1 ed-text-border-dark ${R(H)}`,children:d?z:"[Attachment]"}),E.jsxs("div",{className:"ed-flex ed-items-center ed-gap-1",children:[E.jsx(qf,{content:E.jsx("p",{className:"ed-text-12 ed-text-center ed-font-medium ed-text-regular",children:i==="chat"?"Chat":"Ticket"}),children:i==="chat"?E.jsx(cC,{}):E.jsx(lC,{})}),E.jsx("span",{className:"ed-size-1.5 ed-rounded-full ed-bg-border"}),E.jsx("p",{className:`ed-text-12 ${R(H)}`,children:_1(C,20)}),E.jsx("span",{className:"ed-size-1.5 ed-rounded-full ed-bg-border"}),E.jsx("p",{className:"ed-text-12 ed-text-brand",children:lY(p)})]})]}),E.jsxs("div",{className:"ed-flex ed-gap-2 ed-items-center",children:[(e==null?void 0:e.unread_count)>0?E.jsx("span",{className:"ed-bg-brand ed-px-1 ed-rounded-full ed-text-white ed-text-10 ed-font-semibold ed-min-w-4 ed-text-center",children:e.unread_count}):!T&&y!=="seen"&&E.jsx("div",{className:"ed-size-1 ed-rounded-full ed-bg-red"}),E.jsx("span",{className:"ed-custom-children",children:E.jsx(Co,{className:"ed-size-4 ed-text-regular"})})]}),["open","resolved"].includes(o)&&E.jsx("span",{className:`ed-text-12 ed-px-3 ed-py-1 ${D==null?void 0:D.className}`,children:D==null?void 0:D.label})]})]})},TY="easydesk_chat_widget_conversation_id",OY=({setCurrentConversationID:e,userData:t})=>{const n=O.useRef(null),{setIsChatHistory:r,conversationsData:i,metaData:o,loadingStates:a,setOptionData:s,optionData:c}=So(),{send:u,initialStatesData:d,setConversationState:h}=js(),p=async()=>{u({type:ut.CONVERSATION_CLOSED}),Hr.remove(TY),e(null),h(d.conversationState),r(!1)},m=b=>{b&&(e(b),r(!1))};O.useEffect(()=>{const b=setTimeout(()=>{var w;const v=(w=n.current)==null?void 0:w.querySelectorAll(".single-message-container"),S=v==null?void 0:v[De.size(v)-1];S==null||S.scrollIntoView({behavior:"smooth",block:"nearest"})},200);return()=>clearTimeout(b)},[De.size(i)]);const y=(o==null?void 0:o.total_rows)>De.size(i);return E.jsxs("div",{children:[E.jsx("div",{className:"ed-h-[500px] ed-overflow-y-auto ed-no-scrollbar",id:"conversations-scroll-target",children:E.jsx(Qg,{dataLength:De.size(i),hasMore:y,loader:a!=null&&a.fetchMoreLoading?E.jsx("div",{className:"ed-flex ed-items-center ed-justify-center",children:E.jsx(Zs,{})}):"",scrollableTarget:"conversations-scroll-target",next:()=>{s({...c,offset:c.offset+c.limit})},children:i==null?void 0:i.map(b=>E.jsx(kY,{item:b,onSelect:m,userData:t},b.id))})}),E.jsx("div",{className:"ed-flex ed-items-center ed-justify-center",children:E.jsxs("button",{onClick:p,type:"button",className:"ed-bg-brand ed-flex ed-text-white ed-items-center ed-px-6 ed-py-3 ed-rounded-lg ed-gap-2.5 ed-w-min ed-flex-nowrap ed-mt-5 ed-bottom-28 ed-absolute hover:ed-opacity-90 focus:ed-outline-none",children:[E.jsx("span",{className:"ed-whitespace-nowrap",children:"Send us a message"}),E.jsx(Co,{size:16})]})})]})},NY=()=>{const{setIsChatHistory:e}=So();return E.jsx("div",{className:"ed-flex ed-flex-col ed-items-center ed-justify-center",children:E.jsxs("div",{className:"ed-bottom-32 ed-absolute ed-flex ed-flex-col ed-items-center",children:[E.jsx($j,{}),E.jsxs("button",{onClick:()=>e(t=>!t),type:"button",className:"ed-bg-brand ed-flex ed-text-white ed-items-center ed-px-6 ed-py-3 ed-rounded-lg ed-gap-2.5 ed-w-min ed-flex-nowrap ed-mt-5",children:[E.jsx("span",{className:"ed-whitespace-nowrap",children:"Send us a message"})," ",E.jsx(Co,{})]})]})})},RY=({orgBrandSetting:e,setIsPopupOpen:t,userData:n})=>{const{conversationsData:r,loadingStates:i,getConversationsForPortal:o,isChatHistory:a,setIsChatHistory:s,setCurrentConversationID:c,currentConversationID:u}=So(),d=O.useMemo(()=>a?De.size(r)?E.jsx(OY,{data:r,userData:n,setCurrentConversationID:c}):E.jsx(NY,{}):E.jsx(AY,{orgBrandSetting:e,setIsPopupOpen:t,userData:n,currentConversationID:u,setCurrentConversationID:c,refreshConversations:o}),[r,n,u,a,e,s,t]);return i!=null&&i.initialLoading?E.jsx("div",{className:"ed-flex ed-justify-center ed-items-center ed-my-10",children:E.jsx(Zs,{})}):E.jsx("div",{children:d})};var Oy={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GET_ARTICLES"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"queryData"}},type:{kind:"NamedType",name:{kind:"Name",value:"ArticleQueryInputType"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"optionData"}},type:{kind:"NamedType",name:{kind:"Name",value:"OptionDataType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getArticles"},arguments:[{kind:"Argument",name:{kind:"Name",value:"queryData"},value:{kind:"Variable",name:{kind:"Name",value:"queryData"}}},{kind:"Argument",name:{kind:"Name",value:"optionData"},value:{kind:"Variable",name:{kind:"Name",value:"optionData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:193}};Oy.loc.source={body:`query GET_ARTICLES($queryData: ArticleQueryInputType, $optionData: OptionDataType) {
|
|
1619
|
+
</div>`},Wx={ANGRY:E.jsx(eD,{}),SAD:E.jsx(rD,{}),NEUTRAL:E.jsx(tD,{}),HAPPY:E.jsx(nD,{}),LOVE:E.jsx(iD,{})},_Y="data:image/png;base64,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",xY=({surveyData:e,onClose:t,onSubmit:n,isSubmitting:r=!1})=>{var H;const[i,o]=O.useState(!1),[a,s]=O.useState(null),[c,u]=O.useState(null),[d,h]=O.useState(""),p=(e==null?void 0:e.title)||"How was your support experience?",m=(e==null?void 0:e.description)||"",y=(e==null?void 0:e.is_description_enabled)||!1,b=(e==null?void 0:e.active_rating_type)||"numeric",v=(e==null?void 0:e.is_optional_question_enabled)||!1,S=(e==null?void 0:e.is_open_ended_question_enabled)||!1,w=(e==null?void 0:e.optional_question_title)||"We're sorry to hear that. Could you share what didn't go well?",A=(e==null?void 0:e.optional_question_options)||[],_=(e==null?void 0:e.open_ended_question_title)||"Share your thoughts on the support you received",C=((H=e==null?void 0:e.rating_types)==null?void 0:H.filter(z=>z.rating_type===b).sort((z,K)=>K.score-z.score))||[],k=z=>{s(z)},T=z=>{u(K=>K===z?null:z)},R=async()=>{if(!a||!n)return;const z={satisfaction_rating_type_id:a.id,optional_question_responses:c?[typeof c=="string"?c:c.label]:null,open_ended_question_response:(d==null?void 0:d.trim())||null};try{if(await n(z)===!1){Xt("error","We could not submit your feedback. Please try again.","top-left");return}o(!0)}catch{Xt("error","We could not submit your feedback. Please try again.","top-left")}},F=()=>{t&&t()},D=()=>b==="numeric"?E.jsx("div",{className:"ed-flex ed-gap-2 ed-flex-wrap ed-justify-between",children:C.map(z=>{const K=(a==null?void 0:a.id)===z.id;return E.jsxs("button",{type:"button",onClick:()=>k(z),className:"ed-flex ed-flex-col ed-items-center ed-gap-2 ed-group ed-flex-1",children:[E.jsx("div",{className:fn("ed-w-10 ed-h-10 ed-flex ed-items-center ed-justify-center ed-rounded ed-text-14 ed-border ed-transition-colors",K?"ed-bg-brand-light ed-text-brand ed-border-brand":"ed-bg-gray ed-text-border-dark ed-border-[#8F99AD]"),children:z.numeric_value}),E.jsx("span",{className:fn("ed-text-10 ed-font-medium group-hover:ed-text-brand ed-transition-colors",K?"ed-text-brand":"ed-text-border-dark"),children:z.label})]},z.id)})}):b==="emoji"?E.jsx("div",{className:"ed-flex ed-justify-between ed-gap-3 ",children:C.map(z=>{const K=(a==null?void 0:a.id)===z.id;return E.jsxs("button",{type:"button",onClick:()=>k(z),className:fn("ed-flex ed-flex-col ed-items-center ed-gap-2 ed-group ed-min-w-[60px]"),children:[E.jsx("div",{className:fn("ed-text-24 ed-flex ed-justify-center ed-items-center hover:ed-scale-110 ed-size-10 ed-transition-transform",K?"ed-border ed-rounded-md ed-bg-brand-light ed-border-brand":"ed-text-border-dark"),children:Wx[z.emoji]&&Wx[z.emoji]}),E.jsx("span",{className:fn("ed-text-12 ed-font-medium group-hover:ed-text-brand ed-transition-colors",K?"ed-text-brand":"ed-text-border-dark"),children:z.label})]},z.id)})}):b==="custom_text"?E.jsx("div",{className:"ed-flex ed-flex-col ed-gap-3 ed-w-full ed-max-w-[280px] ed-mx-auto",children:C.map(z=>{const K=(a==null?void 0:a.id)===z.id;return E.jsx("button",{type:"button",onClick:()=>k(z),className:fn("ed-w-full ed-py-3 ed-px-4 ed-border ed-border-regular hover:ed-border-brand hover:ed-bg-white-light ed-rounded-[20px] ed-text-14 ed-font-medium ed-text-border-dark ed-transition-all",K?"ed-border-brand ed-bg-brand-light":"ed-border-regular ed-bg-white"),children:z.label},z.id)})}):null;return i?E.jsxs("div",{className:"ed-flex ed-flex-col ed-items-center ed-justify-center ed-text-center ed-px-4 ed-py-8 ed-pt-16 ed-relative",children:[E.jsx("button",{type:"button",onClick:F,className:"ed-absolute ed-top-3 ed-right-3 ed-text-border-regular hover:ed-text-border-dark ed-transition-colors ed-z-10",children:E.jsx(ci,{size:20})}),E.jsx("h3",{className:"ed-text-18 ed-font-semibold ed-text-border-dark ed-px-9",children:"Thank you for sharing your experience with us."}),E.jsx("div",{className:"ed-w-40 ed-h-auto ed-my-12",children:E.jsx(Tr,{src:_Y,width:600,height:451,className:"ed-h-[140px] ed-w-fit",alt:"Thank you"})})]}):E.jsxs("div",{className:"ed-border-border-light ed-bg-white ed-relative",children:[E.jsx("button",{type:"button",onClick:F,className:"ed-absolute ed-top-3 ed-right-3 ed-text-border-regular hover:ed-text-border-dark ed-transition-colors ed-z-10",children:E.jsx(ci,{size:20})}),E.jsxs("div",{className:"ed-px-5 ed-py-4 ed-pb-6",children:[E.jsx("h3",{className:"ed-text-16 ed-font-semibold ed-text-border-dark ed-mb-3 ed-text-center ed-pr-6",children:p}),y&&m&&E.jsx("p",{className:"ed-text-14 ed-text-border-regular ed-mb-4 ed-text-center",children:m}),E.jsx("div",{className:"ed-py-2",children:D()}),a&&a.score<=2&&v&&E.jsxs("div",{className:"ed-mt-6 ed-pt-6 ed-border-t ed-border-gray",children:[E.jsx("p",{className:"ed-text-14 ed-font-medium ed-text-border-dark ed-mb-4 ed-text-center",children:w}),E.jsx("div",{className:"ed-flex ed-flex-wrap ed-gap-2 ed-justify-center",children:A.map((z,K)=>E.jsx("button",{type:"button",onClick:()=>T(z),className:fn("ed-py-1.5 ed-px-4 ed-rounded-[7px] ed-text-12 ed-font-semibold ed-border ed-transition-all",c===z?"ed-bg-border-dark ed-text-white ed-border-border-dark":"ed-bg-white ed-text-border-dark ed-border-regular hover:ed-border-border-dark"),children:typeof z=="string"?z:z==null?void 0:z.label},`optional-option-${z.label+K}`))})]}),a&&S&&(!(a.score<=2&&v)||c)&&E.jsxs("div",{className:"ed-mt-6 ed-pt-6 ed-border-t ed-border-gray",children:[E.jsx("p",{className:"ed-text-14 ed-font-semibold ed-text-dark ed-mb-1",children:_}),E.jsx("textarea",{placeholder:"Write here",value:d,onChange:z=>h(z.target.value),rows:4,className:"ed-w-full ed-px-4 ed-py-3 ed-border ed-border-border-light ed-rounded-[5px] ed-text-14 ed-text-border-dark placeholder:ed-text-border-regular focus:ed-outline-none focus:ed-border-brand ed-resize-none"})]}),a&&E.jsx("div",{className:"ed-mt-5 ed-flex ed-justify-center ed-mb-2",children:E.jsx(La,{title:"Submit",callBack:R,loader:r,disabled:r,loaderText:"Submitting..."})})]})]})},AY=({orgBrandSetting:e={},userData:t={},currentConversationID:n,setCurrentConversationID:r})=>{var Te,xe,je,ze,Re;const{conversationData:i,initialStatesData:o,conversationState:a,inputFieldState:s,setInputFieldState:c,isAIThinking:u,setIsAIThinking:d,handleUpdateConversationActivityAnalytics:h,send:p}=js(),{sendMessage:m}=Pm(),{satisfaction_setting:y}=e||{},b=y==null?void 0:y.satisfaction_survey,[v,S]=O.useState(!0),w=O.useRef(null),A=O.useRef(null),_=O.useRef(!1),C=Hr.get("easydesk_chat_widget_conversation_id"),{brand:k}=e,[T,R]=O.useState(null),[F,D]=O.useState(!1),[H,z]=O.useState([]),K=n||C,[V]=Es(Xc,{errorPolicy:"all",fetchPolicy:"no-cache"}),[L,{loading:j}]=bo(SY,{errorPolicy:"all",fetchPolicy:"no-cache"}),Y=async de=>{var be,Ne;try{const Qe=wY({title:de==null?void 0:de.title,message:de==null?void 0:de.message,files:de.conversation_activity_files}),we=await m({is_customer_reply:!0,message:Qe,conversation_id:K});if(we!=null&&we.id){c(gt=>({...gt,ticket_title:de==null?void 0:de.ticket_title,ticket_activity:de==null?void 0:de.ticket_activity,conversation_activity_files:de==null?void 0:de.conversation_activity_files}));const qe=eh(Ft.ticket.success,{ticket_id:(de==null?void 0:de.ticketId)||"N/A",customer_email:((be=i==null?void 0:i.contact)==null?void 0:be.person_email)||(s==null?void 0:s.contact_person_email)||"your email"});await m({is_auto_response:!0,message:qe,conversation_status:"closed",current_stage:"closed"},!0),p({type:ut.UPDATE_CONVERSATION_STATUS,status:"closed"})}}catch(Qe){const{message:we,response:qe}=Qe;Xt("error",((Ne=qe==null?void 0:qe.data)==null?void 0:Ne.message)||we,"top-left")}},B=async()=>{try{await m({conversation_id:K,message:Ft.ai.thanksFeedback,is_auto_response:!0,current_stage:"followup_feedback"})}catch(de){console.error("Error creating follow-up message:",de)}},J=async()=>{var de;try{const{data:be}=await V({variables:{queryData:{is_live_chat_enabled:!0}}}),Ne=De.size((de=be==null?void 0:be.getChannelsForPortal)==null?void 0:de.data)>0&&!(e!=null&&e.is_off_hour);D(Ne),await m({conversation_id:K,message:Ft.ai.needMoreHelp,is_auto_response:!0,current_stage:"need_help"})}catch(be){console.error("Error handling initial no click:",be)}},W=async()=>{var de;try{const{data:be}=await V({variables:{queryData:{is_live_chat_enabled:!0}}}),Ne=De.size((de=be==null?void 0:be.getChannelsForPortal)==null?void 0:de.data)>0&&!(e!=null&&e.is_off_hour);D(Ne),await m({conversation_id:K,message:Ft.ai.needMoreHelp,is_auto_response:!0,current_stage:"need_help"})}catch(be){console.error("Error handling intermediate yes click:",be)}},G=async()=>{var de;try{const be=((de=i==null?void 0:i.contact)==null?void 0:de.person_name)||"there",Ne=eh(Ft.ai.goodbye,{name:be});await m({conversation_id:K,message:Ne,is_auto_response:!0,conversation_status:"resolved",current_stage:"closed"}),p({type:ut.UPDATE_CONVERSATION_STATUS,status:"resolved"}),R("CONVERSATION_ENDED")}catch(be){console.error("Error handling intermediate no click:",be)}},$=async()=>{try{await m({conversation_id:K,message:Ft.followUp.withAainAI,is_auto_response:!0,current_stage:"ai_available"})}catch(de){console.error("Error restarting conversation:",de)}},ie=async()=>{var de;try{const be=((de=i==null?void 0:i.contact)==null?void 0:de.person_name)||"there",Ne=eh(Ft.ai.goodbye,{name:be});await m({conversation_id:K,message:Ne,is_auto_response:!0,conversation_status:"resolved",current_stage:"closed"}),p({type:ut.UPDATE_CONVERSATION_STATUS,status:"resolved"}),R("CONVERSATION_ENDED")}catch(be){console.error("Error handling follow-up no click:",be)}},ae=async de=>{try{await m({conversation_id:K,message:de.message,is_customer_reply:de.is_customer_reply,channel_id:de.channel_id,current_stage:"agent_chat"}),z([]),await m({conversation_id:K,message:Ft.followUp.afterChannelSelection,is_auto_response:!0,is_customer_reply:!1,current_stage:"agent_chat"})}catch(be){console.error("Error selecting channel:",be)}},ce=async de=>{var be;try{const Ne={conversation_id:K,satisfaction_rating_type_id:de.satisfaction_rating_type_id,optional_question_responses:de.optional_question_responses||null,open_ended_question_response:de.open_ended_question_response||null},{data:Qe}=await L({variables:{inputData:Ne}});return!!((be=Qe==null?void 0:Qe.createASatisfactionRating)!=null&&be.id)}catch(Ne){return console.error("Error submitting survey:",Ne),Xt("error","Failed to submit feedback. Please try again.","top-left"),!1}},oe=()=>{p({type:ut.RELOAD_CONVERSATION_DATA}),S(!1)},ue=()=>{p({type:ut.CONVERSATION_CLOSED}),c(o.inputFieldState),R(!1),Hr.remove("easydesk_chat_widget_conversation_id")},ye=((Te=a==null?void 0:a.metaData)==null?void 0:Te.filtered_rows)&&De.size(a==null?void 0:a.messages)<((xe=a==null?void 0:a.metaData)==null?void 0:xe.filtered_rows),{loadMoreMessages:Ce}=Pm(),Se=Ce;O.useEffect(()=>{if(!A.current||_.current)return;const be=setTimeout(()=>{const Ne=A.current;Ne&&requestAnimationFrame(()=>{Ne.scrollTop=Ne.scrollHeight})},100);return()=>clearTimeout(be)},[De.size(a==null?void 0:a.messages)]),O.useEffect(()=>{if(K&&A.current){const de=setTimeout(()=>{A.current&&(A.current.scrollTop=A.current.scrollHeight)},300);return()=>clearTimeout(de)}},[K]),O.useEffect(()=>{K&&(w.current=null)},[K]);const he=(i==null?void 0:i.is_spam)||["closed","resolved"].includes(i==null?void 0:i.status),q=(()=>{if((i==null?void 0:i.status)!=="resolved"||i!=null&&i.has_customer_feedback||!y||!b||!y.is_satisfaction_rating_enabled)return!1;const de=i==null?void 0:i.type;return!(de==="ticket"&&!y.is_ticket_feedback_active||de==="chat"&&!y.is_chat_feedback_active)})(),ke=()=>{var be;if(!(a!=null&&a.messages)||De.size(a.messages)===0)return!1;const de=a.messages[a.messages.length-1];return((be=de==null?void 0:de.metadata)==null?void 0:be.current_stage)==="agent_chat"||(i==null?void 0:i.assignee)},ve=()=>{if(u)return!0;if(!(a!=null&&a.messages)||De.size(a.messages)===0)return!1;const de=a.messages[a.messages.length-1],be=de==null?void 0:de.metadata;return!be||de!=null&&de.is_customer_reply?!1:!!(be.current_stage&&!["agent_chat","ai_available","try_another_question"].includes(be.current_stage)||be.has_results===!0||be.has_results===!1)};return O.useEffect(()=>{let de=[];const be=De.debounce(async()=>{await h({seen_activity_ids:de}),de=[]},1e3),Ne=new IntersectionObserver(we=>{we.forEach(qe=>{if(qe.isIntersecting){const gt=qe.target.getAttribute("data-message-id");gt&&de.push(gt)}}),De.size(de)&&be()},{threshold:1}),Qe=document.querySelectorAll(".ed-message");return Qe.forEach(we=>Ne.observe(we)),()=>{be.cancel(),Qe.forEach(we=>Ne.unobserve(we))}},[a==null?void 0:a.messages]),E.jsxs("div",{children:[E.jsx("div",{ref:A,id:"activities-scroll-target",className:"ed-flex ed-flex-col ed-pb-5 ed-space-y-5 ed-h-[calc(100vh-200px)] ed-overflow-y-auto ed-no-scrollbar",style:{scrollBehavior:"smooth"},children:E.jsx(Qg,{dataLength:De.size(a==null?void 0:a.messages),hasMore:ye,scrollableTarget:"activities-scroll-target",inverse:!0,next:()=>{_.current=!0,Se(),setTimeout(()=>{_.current=!1},500)},children:E.jsxs("div",{className:"ed-flex-1 ed-space-y-3",children:[De.size(a==null?void 0:a.messages)?E.jsxs("div",{children:[(i==null?void 0:i.type)==="ticket"&&E.jsxs("div",{className:"ed-bg-gray-light ed-p-2 ed-rounded",children:[E.jsxs("p",{className:"ed-text-regular ed-font-normal ed-text-14",children:["ID",i==null?void 0:i.serial]}),E.jsx("h5",{className:"ed-text-dark ed-font-normal ed-text-14",children:i==null?void 0:i.title})]}),(je=a==null?void 0:a.messages)==null?void 0:je.map(de=>E.jsx("div",{className:"single-message ed-px-5 ed-pt-3 ed-animate-fadeInUp",children:["reply","file"].includes(de==null?void 0:de.type)?E.jsx(Vx,{activityMessage:de,brand:k,isInitiatedWithAi:i==null?void 0:i.is_initiated_with_ai},de==null?void 0:de.id):E.jsx(gG,{log:de==null?void 0:de.log},de==null?void 0:de.id)},de==null?void 0:de.id))]}):E.jsx(EG,{onSubmit:de=>{c(be=>({...be,contact_person_name:de==null?void 0:de.contact_person_name,contact_person_email:de==null?void 0:de.contact_person_email}))},orgBrandSetting:e,setSelectedConversationId:r,userData:t}),!u&&(a==null?void 0:a.messages)&&De.size(a.messages)>0&&(()=>{const de=a.messages[a.messages.length-1],{metadata:be}=de||{};if(be&&!(de!=null&&de.is_customer_reply)){const{current_stage:Ne}=be;if(!Ne&&be.has_results===!0)return E.jsx(oh,{type:"initial",sendMessage:m,conversationId:K,onYes:B,onNo:J});if(Ne==="initial_feedback")return E.jsx(oh,{type:"initial",sendMessage:m,conversationId:K,onYes:B,onNo:J});if(Ne==="followup_feedback")return E.jsx(oh,{type:"followup",sendMessage:m,conversationId:K,onYes:$,onNo:ie});if(Ne==="intermediate_help")return E.jsx(oh,{type:"intermediate",sendMessage:m,conversationId:K,onYes:W,onNo:G});if(Ne==="need_help")return E.jsx(zx,{type:"need_help",sendMessage:m,conversationId:K,showChatButton:F,setIsAIThinking:d,onChannelSelection:ae});if(!be.has_results&&!Ne&&!(i!=null&&i.assignee))return E.jsx(zx,{type:"no_results",sendMessage:m,conversationId:K,setIsAIThinking:d,onChannelSelection:ae});if(Ne==="select_channel")return E.jsx(bY,{channels:H,onSubmit:ae});if(Ne==="create_a_support_ticket")return E.jsx(cw,{from:"message",isAuthenticated:!0,onSubmit:Y,reqId:null,userData:s,metadata:be})}return null})(),(((ze=a==null?void 0:a.writing_realtime_status)==null?void 0:ze.is_writing_reply)||u)&&E.jsx("div",{className:"single-message ed-px-5",children:E.jsx(Vx,{brand:k,activityMessage:{user:(Re=a==null?void 0:a.writing_realtime_status)==null?void 0:Re.author,is_customer_reply:!1,is_ai_response:u,created_at:Date.now()},isReplying:!0})})]})})}),q&&v&&E.jsx("div",{className:"ed-flex-1 ed-rounded-t-xl ed-overflow-y-auto ed-no-scrollbar ed-max-h-full ed-absolute ed-bottom-0 ed-w-full ed-left-0 ed-bg-white ed-shadow-[0_-4px_50px_rgba(0,0,0,0.2)] ed-z-[999]",children:E.jsx(xY,{surveyData:b,onSubmit:ce,isSubmitting:j,onClose:oe})}),((i==null?void 0:i.type)==="ticket"||!he&&De.size(a==null?void 0:a.messages)>=3&&!T&&!ve()&&T!=="CONVERSATION_ENDED")&&E.jsx("div",{className:"ed-sticky ed-bottom-0 ed-bg-white ed-pt-1 ed--mx-5 ed-px-6",children:E.jsx(yY,{conversationData:i,conversationId:K,handleCreateMessage:m,onAIThinkingChange:d,isAIThinking:u,useAITemplate:!ke()})}),(i==null?void 0:i.type)!=="ticket"&&(T&&T!=="CONVERSATION_ENDED"||he)&&E.jsx("div",{className:"ed-py-2 ed-px-5 ed-bg-white ed-text-gray-500 ed-sticky ed-bottom-0 ed-left-0",children:E.jsxs("p",{className:"ed-text-center ed-text-sm",children:["Your chat has ended. ",E.jsx("br",{}),"To start a new chat, ",E.jsx("button",{type:"button",className:"ed-underline ed-text-blue-600 ed-text-sm",onClick:ue,children:"click here"})]})})]})},kY=({item:e,onSelect:t,userData:n})=>{const{id:r,type:i,status:o,last_conversation_activity:a,organization_brand:s,assignee:c}=e||{},{handleUpdateConversationActivityAnalytics:u}=So(),{message:d,user:h,created_at:p,analytics:m}=a||{},{status:y}=(m==null?void 0:m[0])||{},{setting:b,name:v}=s||{},{first_name:S,last_name:w,email:A,avatar_file:_}=(c==null?void 0:c.user)||{},C=O.useMemo(()=>nd(S,w,A)||v||"Unknown User",[S,w,A,v]),k=_||(b==null?void 0:b.icon),T=(n==null?void 0:n.id)===(h==null?void 0:h.id),R=K=>T?"ed-text-border-dark":K?"ed-text-border-dark ed-font-medium":"ed-text-border-dark ed-font-semibold",F=async()=>{y!=="seen"&&await u({seen_activity_ids:[a==null?void 0:a.id]}),t(r)},D=O.useMemo(()=>cY[o],[o]),H=T&&y==="seen",z=O.useMemo(()=>uY(d),[d]);return E.jsxs("div",{role:"button",tabIndex:0,onClick:F,className:"ed-flex ed-items-center ed-gap-2.5 ed-border-b ed-py-5 ed-px-5 hover:ed-bg-light/40 ed-cursor-pointer ed-custom-wrapper hover:ed-bg-white-light",children:[E.jsx("div",{className:"ed-size-12 ed-flex ed-items-center ed-justify-center",children:E.jsx(Tr,{alt:C,path:k==null?void 0:k.key,defaultImageName:qi(A||v),className:"ed-size-10 ed-object-cover ed-rounded-full",defaultUserNameTextSize:"ed-text-12",defaultImageClasses:"ed-size-10 ed-object-cover ed-rounded-full"})}),E.jsxs("div",{className:"ed-w-full ed-flex ed-justify-between ed-items-center",children:[E.jsxs("div",{className:"ed-flex ed-flex-col ed-gap-0.5",children:[E.jsx("p",{className:`ed-font-medium ed-text-12 ed-line-clamp-1 ed-text-border-dark ${R(H)}`,children:d?z:"[Attachment]"}),E.jsxs("div",{className:"ed-flex ed-items-center ed-gap-1",children:[E.jsx(qf,{content:E.jsx("p",{className:"ed-text-12 ed-text-center ed-font-medium ed-text-regular",children:i==="chat"?"Chat":"Ticket"}),children:i==="chat"?E.jsx(cC,{}):E.jsx(lC,{})}),E.jsx("span",{className:"ed-size-1.5 ed-rounded-full ed-bg-border"}),E.jsx("p",{className:`ed-text-12 ${R(H)}`,children:_1(C,20)}),E.jsx("span",{className:"ed-size-1.5 ed-rounded-full ed-bg-border"}),E.jsx("p",{className:"ed-text-12 ed-text-brand",children:lY(p)})]})]}),E.jsxs("div",{className:"ed-flex ed-gap-2 ed-items-center",children:[(e==null?void 0:e.unread_count)>0?E.jsx("span",{className:"ed-bg-brand ed-px-1 ed-rounded-full ed-text-white ed-text-10 ed-font-semibold ed-min-w-4 ed-text-center",children:e.unread_count}):!T&&y!=="seen"&&E.jsx("div",{className:"ed-size-1 ed-rounded-full ed-bg-red"}),E.jsx("span",{className:"ed-custom-children",children:E.jsx(Co,{className:"ed-size-4 ed-text-regular"})})]}),["open","resolved"].includes(o)&&E.jsx("span",{className:`ed-text-12 ed-px-3 ed-py-1 ${D==null?void 0:D.className}`,children:D==null?void 0:D.label})]})]})},TY="easydesk_chat_widget_conversation_id",OY=({setCurrentConversationID:e,userData:t})=>{const n=O.useRef(null),{setIsChatHistory:r,conversationsData:i,metaData:o,loadingStates:a,setOptionData:s,optionData:c}=So(),{send:u,initialStatesData:d,setConversationState:h}=js(),p=async()=>{u({type:ut.CONVERSATION_CLOSED}),Hr.remove(TY),e(null),h(d.conversationState),r(!1)},m=b=>{b&&(e(b),r(!1))};O.useEffect(()=>{const b=setTimeout(()=>{var w;const v=(w=n.current)==null?void 0:w.querySelectorAll(".single-message-container"),S=v==null?void 0:v[De.size(v)-1];S==null||S.scrollIntoView({behavior:"smooth",block:"nearest"})},200);return()=>clearTimeout(b)},[De.size(i)]);const y=(o==null?void 0:o.total_rows)>De.size(i);return E.jsxs("div",{children:[E.jsx("div",{className:"ed-h-[500px] ed-overflow-y-auto ed-no-scrollbar",id:"conversations-scroll-target",children:E.jsx(Qg,{dataLength:De.size(i),hasMore:y,loader:a!=null&&a.fetchMoreLoading?E.jsx("div",{className:"ed-flex ed-items-center ed-justify-center",children:E.jsx(Zs,{})}):"",scrollableTarget:"conversations-scroll-target",next:()=>{s({...c,offset:c.offset+c.limit})},children:i==null?void 0:i.map(b=>E.jsx(kY,{item:b,onSelect:m,userData:t},b.id))})}),E.jsx("div",{className:"ed-flex ed-items-center ed-justify-center",children:E.jsxs("button",{onClick:p,type:"button",className:"ed-bg-brand ed-flex ed-text-white ed-items-center ed-px-6 ed-py-3 ed-rounded-lg ed-gap-2.5 ed-w-min ed-flex-nowrap ed-mt-5 ed-bottom-28 ed-absolute hover:ed-opacity-90 focus:ed-outline-none",children:[E.jsx("span",{className:"ed-whitespace-nowrap",children:"Send us a message"}),E.jsx(Co,{size:16})]})})]})},NY=()=>{const{setIsChatHistory:e}=So();return E.jsx("div",{className:"ed-flex ed-flex-col ed-items-center ed-justify-center",children:E.jsxs("div",{className:"ed-bottom-32 ed-absolute ed-flex ed-flex-col ed-items-center",children:[E.jsx($j,{}),E.jsxs("button",{onClick:()=>e(t=>!t),type:"button",className:"ed-bg-brand ed-flex ed-text-white ed-items-center ed-px-6 ed-py-3 ed-rounded-lg ed-gap-2.5 ed-w-min ed-flex-nowrap ed-mt-5",children:[E.jsx("span",{className:"ed-whitespace-nowrap",children:"Send us a message"})," ",E.jsx(Co,{})]})]})})},RY=({orgBrandSetting:e,setIsPopupOpen:t,userData:n})=>{const{conversationsData:r,loadingStates:i,getConversationsForPortal:o,isChatHistory:a,setIsChatHistory:s,setCurrentConversationID:c,currentConversationID:u}=So(),d=O.useMemo(()=>a?De.size(r)?E.jsx(OY,{data:r,userData:n,setCurrentConversationID:c}):E.jsx(NY,{}):E.jsx(AY,{orgBrandSetting:e,setIsPopupOpen:t,userData:n,currentConversationID:u,setCurrentConversationID:c,refreshConversations:o}),[r,n,u,a,e,s,t]);return i!=null&&i.initialLoading?E.jsx("div",{className:"ed-flex ed-justify-center ed-items-center ed-my-10",children:E.jsx(Zs,{})}):E.jsx("div",{children:d})};var Oy={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GET_ARTICLES"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"queryData"}},type:{kind:"NamedType",name:{kind:"Name",value:"ArticleQueryInputType"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"optionData"}},type:{kind:"NamedType",name:{kind:"Name",value:"OptionDataType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getArticles"},arguments:[{kind:"Argument",name:{kind:"Name",value:"queryData"},value:{kind:"Variable",name:{kind:"Name",value:"queryData"}}},{kind:"Argument",name:{kind:"Name",value:"optionData"},value:{kind:"Variable",name:{kind:"Name",value:"optionData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"title"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:193}};Oy.loc.source={body:`query GET_ARTICLES($queryData: ArticleQueryInputType, $optionData: OptionDataType) {
|
|
1620
1620
|
getArticles(queryData: $queryData, optionData: $optionData) {
|
|
1621
1621
|
data {
|
|
1622
1622
|
id
|
|
@@ -1624,7 +1624,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
1626
|
}
|
|
1627
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function sh(e,t){if(e.kind==="FragmentSpread")t.add(e.name.value);else if(e.kind==="VariableDefinition"){var n=e.type;n.kind==="NamedType"&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(r){sh(r,t)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(r){sh(r,t)}),e.definitions&&e.definitions.forEach(function(r){sh(r,t)})}var Ny={};(function(){Oy.definitions.forEach(function(t){if(t.name){var n=new Set;sh(t,n),Ny[t.name.value]=n}})})();function Gx(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}function PY(e,t){var n={kind:e.kind,definitions:[Gx(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Ny[t]||new Set,i=new Set,o=new Set;for(r.forEach(function(s){o.add(s)});o.size>0;){var a=o;o=new Set,a.forEach(function(s){if(!i.has(s)){i.add(s);var c=Ny[s]||new Set;c.forEach(function(u){o.add(u)})}})}return i.forEach(function(s){var c=Gx(e,s);c&&n.definitions.push(c)}),n}const IY=PY(Oy,"GET_ARTICLES"),MY=e=>{const{userData:t,widgetIntent:n,isPopupOpen:r,setIsPopupOpen:i,isMobileScreen:o,setThemeColor:a}=e||{},{activeTab:s,setActiveTab:c,orgBrandSetting:u,setOrgBrandSetting:d,setCurrentConversationID:h,messageListUnreadCount:p}=So(),{unreadMessages:m}=js(),y=p||De.size(m),[b,v]=O.useState(""),[S,w]=O.useState(null),[A,_]=O.useState(null),[C,k]=O.useState(!1),[T,R]=O.useState([]),[F,D]=O.useState(!1),[H,z]=O.useState(!1),[K,V]=O.useState(!1),[L,j]=O.useState(!1),Y=new URLSearchParams(window.location.search).get("intent");O.useEffect(()=>{const he=Y||n;he?he==="chat"?(V(!0),j(!1),c("messages"),i(!0)):he==="kb"&&(j(!0),V(!1),c("knowledge_base"),i(!0)):(V(!1),j(!1),i(!1))},[n,Y]);const[B,{loading:J}]=Es(IY,{errorPolicy:"all",fetchPolicy:"no-cache"}),{loading:W,data:G}=Ss(Xc,{errorPolicy:"all",fetchPolicy:"no-cache"}),$=async he=>{var ve;const{data:q,error:ke}=await B(he);q!=null&&q.getArticles&&R(((ve=q==null?void 0:q.getArticles)==null?void 0:ve.data)||[]),ke&&console.error(ke)};O.useEffect(()=>{var he;G!=null&&G.getChannelsForPortal&&z(De.size((he=G==null?void 0:G.getChannelsForPortal)==null?void 0:he.data)>0)},[G]);const ie=Z8(he=>{$({variables:{queryData:{search_keyword:he}}})},500),ae=he=>{v(he),ie(he)},ce=async()=>{D(!0);try{const he=await wM();if(he){const{font:q,is_knowledge_base_enabled:ke,theme_color:ve}=he;d(he),a(ve),LM(q),y>0&&H?c("messages"):ke&&!H||ke&&H?c("knowledge_base"):!ke&&H&&c("messages"),D(!1)}}catch(he){console.error(he),D(!1)}},oe=()=>{const he=document.getElementById("ed-widget");i(!r),r&&(t!=null&&t.isAuthenticated)&&h(null),v(""),w(null),_(null),k(!1),ce(),n&&he&&he.removeAttribute("ed-widget-intent"),V(!1),j(!1)};O.useEffect(()=>{ce()},[]),O.useEffect(()=>{if(!u)return;const{is_knowledge_base_enabled:he}=u;H&&K?(c("messages"),i(!0)):he&&L&&(c("knowledge_base"),i(!0))},[u,H,K]);const ue=()=>s==="knowledge_base"?E.jsx(JD,{loading:J,articleId:A,isAuthenticated:t==null?void 0:t.isAuthenticated,selectedCategory:S,setArticleId:_,setSelectedCategory:w,orgBrandSetting:u,isMobileScreen:o}):s==="messages"?E.jsx(RY,{orgBrandSetting:u,setIsPopupOpen:i,userData:t}):null,{brand:ye,is_knowledge_base_enabled:Ce}=u||{},Se=he=>{c(he),v(""),w(null),_(null),k(!1)};return!Ce&&!H?null:E.jsxs("div",{children:[H||Ce?E.jsx(hG,{isPopupOpen:r,handlePopupTrigger:oe,orgBrandSetting:u,isAuthenticated:t==null?void 0:t.isAuthenticated,isMobileScreen:o}):null,E.jsx("div",{className:fn("ed-fixed ed-flex ed-items-center ed-justify-center ed-z-[9999998]",o?"ed-bottom-0":"ed-bottom-16 ed-p-4 -ed-right-4",r?"ed-block":"ed-hidden"),children:E.jsx("div",{className:fn("ed-right-0 ed-bg-white ed-shadow-lg ed-p-1 ed-overflow-hidden ed-transition-all ed-duration-300 ed-ease-in-out ed-flex ed-flex-col",o?"":"ed-rounded-[10px]",r?fn("ed-opacity-100",o?"ed-w-screen ed-h-dvh":"ed-w-[400px] ed-max-h-[704px] ed-h-[calc(90vh-20px)]"):"ed-opacity-0 ed-max-h-0 ed-h-0 ed-w-0 ed-pointer-events-none"),children:r&&E.jsxs(E.Fragment,{children:[E.jsx(mG,{searchedText:b,selectedCategory:S,setSearchedText:v,setArticleId:_,setSelectedCategory:w,setIsPopupOpen:i,handleSearch:ae,setArticlesData:R,brandInfo:ye,activeTab:s,userData:t,isMobileScreen:o}),E.jsx("div",{className:fn("ed-flex-1 ed-overflow-y-auto ed-no-scrollbar ed-root-scrollbar",s==="knowledge_base"?"ed-pb-5":""),children:b?E.jsx("div",{className:"ed-h-full",children:De.size(T)?E.jsx(UF,{articlesData:T,setArticleId:_,setSearchedText:v,setArticlesData:R}):E.jsx(qD,{setIsCreateNewTicketClicked:k})}):E.jsx("div",{className:fn("ed-space-y-4",s==="knowledge_base"?"ed-py-1":""),children:ue()})}),E.jsx(pG,{activeTab:s,handleTabChange:Se,orgBrandSetting:u,hasLiveChat:H,isMobileScreen:o}),C&&E.jsx(Yj,{setIsCreateNewTicketClicked:k,setSearchedText:v,searchedText:b,isAuthenticated:t==null?void 0:t.isAuthenticated})]})})})]})},LY=[".ed-scope",".ed-","--ed-",".ed-tiptap"],FY="ed-widget-bundle-style",jY=()=>{var e;return(e=document.body)==null?void 0:e.classList.contains("ed-scope")},Ry=e=>(e==null?void 0:e.tagName)==="STYLE"&&e.getAttribute("id")===FY,DY=e=>{Ry(e)&&e.getAttribute("data-ed-parent-style-disabled")!=="true"&&(e.setAttribute("media","not all"),e.setAttribute("data-ed-parent-style-disabled","true"))},VY=(e,t)=>{if(!e)return!1;if(Ry(e))return!0;if(e.tagName==="LINK")return t&&e.rel==="stylesheet"&&!!e.href;if(e.tagName!=="STYLE")return!1;if(t)return!0;const n=e.textContent||"";return LY.some(r=>n.includes(r))},Yx=e=>{if(!(e!=null&&e.head))return;const t=jY();e.head.querySelectorAll('[data-ed-iframe-style-clone="true"]').forEach(n=>n.remove()),document.querySelectorAll('style, link[rel="stylesheet"]').forEach(n=>{if(!VY(n,t))return;const r=n.cloneNode(!0);r.setAttribute("data-ed-iframe-style-clone","true"),Ry(n)&&(r.removeAttribute("media"),r.removeAttribute("data-ed-parent-style-disabled"),t||DY(n)),e.head.appendChild(r)})},UY=({children:e,dimensions:t,position:n,themeColor:r})=>{const i=O.useRef(null),[o,a]=O.useState(null),[s,c]=O.useState(null);return O.useEffect(()=>{var b;const u=i.current;if(!u)return()=>{};const d=u.contentDocument||((b=u.contentWindow)==null?void 0:b.document);if(!d)return()=>{};const h=d.createElement("meta");h.name="viewport",h.content=`width=${window.innerWidth}, initial-scale=1.0`,d.head.appendChild(h);const p=()=>{const v=d.querySelector('meta[name="viewport"]');v&&(v.content=`width=${window.innerWidth}, initial-scale=1.0`)};window.addEventListener("resize",p);const m=d.createElement("style");m.textContent=`
|
|
1627
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function sh(e,t){if(e.kind==="FragmentSpread")t.add(e.name.value);else if(e.kind==="VariableDefinition"){var n=e.type;n.kind==="NamedType"&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(r){sh(r,t)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(r){sh(r,t)}),e.definitions&&e.definitions.forEach(function(r){sh(r,t)})}var Ny={};(function(){Oy.definitions.forEach(function(t){if(t.name){var n=new Set;sh(t,n),Ny[t.name.value]=n}})})();function Gx(e,t){for(var n=0;n<e.definitions.length;n++){var r=e.definitions[n];if(r.name&&r.name.value==t)return r}}function PY(e,t){var n={kind:e.kind,definitions:[Gx(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var r=Ny[t]||new Set,i=new Set,o=new Set;for(r.forEach(function(s){o.add(s)});o.size>0;){var a=o;o=new Set,a.forEach(function(s){if(!i.has(s)){i.add(s);var c=Ny[s]||new Set;c.forEach(function(u){o.add(u)})}})}return i.forEach(function(s){var c=Gx(e,s);c&&n.definitions.push(c)}),n}const IY=PY(Oy,"GET_ARTICLES"),MY=e=>{const{userData:t,widgetIntent:n,isPopupOpen:r,setIsPopupOpen:i,isMobileScreen:o,setThemeColor:a}=e||{},{activeTab:s,setActiveTab:c,orgBrandSetting:u,setOrgBrandSetting:d,setCurrentConversationID:h,messageListUnreadCount:p}=So(),{unreadMessages:m}=js(),y=p||De.size(m),[b,v]=O.useState(""),[S,w]=O.useState(null),[A,_]=O.useState(null),[C,k]=O.useState(!1),[T,R]=O.useState([]),[F,D]=O.useState(!1),[H,z]=O.useState(!1),[K,V]=O.useState(!1),[L,j]=O.useState(!1),Y=new URLSearchParams(window.location.search).get("intent");O.useEffect(()=>{const he=Y||n;he?he==="chat"?(V(!0),j(!1),c("messages"),i(!0)):he==="kb"&&(j(!0),V(!1),c("knowledge_base"),i(!0)):(V(!1),j(!1),i(!1))},[n,Y]);const[B,{loading:J}]=Es(IY,{errorPolicy:"all",fetchPolicy:"no-cache"}),{loading:W,data:G}=Ss(Xc,{errorPolicy:"all",fetchPolicy:"no-cache"}),$=async he=>{var ve;const{data:q,error:ke}=await B(he);q!=null&&q.getArticles&&R(((ve=q==null?void 0:q.getArticles)==null?void 0:ve.data)||[]),ke&&console.error(ke)};O.useEffect(()=>{var he;G!=null&&G.getChannelsForPortal&&z(De.size((he=G==null?void 0:G.getChannelsForPortal)==null?void 0:he.data)>0)},[G]);const ie=Z8(he=>{$({variables:{queryData:{search_keyword:he}}})},500),ae=he=>{v(he),ie(he)},ce=async()=>{D(!0);try{const he=await wM();if(he){const{font:q,is_knowledge_base_enabled:ke,theme_color:ve}=he;d(he),a(ve),LM(q),y>0&&H?c("messages"):ke&&!H||ke&&H?c("knowledge_base"):!ke&&H&&c("messages"),D(!1)}}catch(he){console.error(he),D(!1)}},oe=()=>{const he=document.getElementById("ed-widget");i(!r),r&&(t!=null&&t.isAuthenticated)&&h(null),v(""),w(null),_(null),k(!1),ce(),n&&he&&he.removeAttribute("ed-widget-intent"),V(!1),j(!1)};O.useEffect(()=>{ce()},[]),O.useEffect(()=>{if(!u)return;const{is_knowledge_base_enabled:he}=u;H&&K?(c("messages"),i(!0)):he&&L&&(c("knowledge_base"),i(!0))},[u,H,K]);const ue=()=>s==="knowledge_base"?E.jsx(JD,{loading:J,articleId:A,isAuthenticated:t==null?void 0:t.isAuthenticated,selectedCategory:S,setArticleId:_,setSelectedCategory:w,orgBrandSetting:u,isMobileScreen:o}):s==="messages"?E.jsx(RY,{orgBrandSetting:u,setIsPopupOpen:i,userData:t}):null,{brand:ye,is_knowledge_base_enabled:Ce}=u||{},Se=he=>{c(he),v(""),w(null),_(null),k(!1)};return!Ce&&!H?null:E.jsxs("div",{children:[H||Ce?E.jsx(hG,{isPopupOpen:r,handlePopupTrigger:oe,orgBrandSetting:u,isAuthenticated:t==null?void 0:t.isAuthenticated,isMobileScreen:o}):null,E.jsx("div",{className:fn("ed-fixed ed-flex ed-items-center ed-justify-center ed-z-[9999998]",o?"ed-bottom-0":"ed-bottom-16 ed-p-4 -ed-right-4",r?"ed-block":"ed-hidden"),children:E.jsx("div",{className:fn("ed-right-0 ed-bg-white ed-shadow-lg ed-p-1 ed-overflow-hidden ed-transition-all ed-duration-300 ed-ease-in-out ed-flex ed-flex-col ed-relative",o?"":"ed-rounded-[10px]",r?fn("ed-opacity-100",o?"ed-w-screen ed-h-dvh":"ed-w-[400px] ed-max-h-[704px] ed-h-[calc(90vh-20px)]"):"ed-opacity-0 ed-max-h-0 ed-h-0 ed-w-0 ed-pointer-events-none"),children:r&&E.jsxs(E.Fragment,{children:[E.jsx(mG,{searchedText:b,selectedCategory:S,setSearchedText:v,setArticleId:_,setSelectedCategory:w,setIsPopupOpen:i,handleSearch:ae,setArticlesData:R,brandInfo:ye,activeTab:s,userData:t,isMobileScreen:o}),E.jsx("div",{className:fn("ed-flex-1 ed-overflow-y-auto ed-no-scrollbar ed-root-scrollbar",s==="knowledge_base"?"ed-pb-5":""),children:b?E.jsx("div",{className:"ed-h-full",children:De.size(T)?E.jsx(UF,{articlesData:T,setArticleId:_,setSearchedText:v,setArticlesData:R}):E.jsx(qD,{setIsCreateNewTicketClicked:k})}):E.jsx("div",{className:fn("ed-space-y-4",s==="knowledge_base"?"ed-py-1":""),children:ue()})}),E.jsx(pG,{activeTab:s,handleTabChange:Se,orgBrandSetting:u,hasLiveChat:H,isMobileScreen:o}),C&&E.jsx(Yj,{setIsCreateNewTicketClicked:k,setSearchedText:v,searchedText:b,isAuthenticated:t==null?void 0:t.isAuthenticated})]})})})]})},LY=[".ed-scope",".ed-","--ed-",".ed-tiptap"],FY="ed-widget-bundle-style",jY=()=>{var e;return(e=document.body)==null?void 0:e.classList.contains("ed-scope")},Ry=e=>(e==null?void 0:e.tagName)==="STYLE"&&e.getAttribute("id")===FY,DY=e=>{Ry(e)&&e.getAttribute("data-ed-parent-style-disabled")!=="true"&&(e.setAttribute("media","not all"),e.setAttribute("data-ed-parent-style-disabled","true"))},VY=(e,t)=>{if(!e)return!1;if(Ry(e))return!0;if(e.tagName==="LINK")return t&&e.rel==="stylesheet"&&!!e.href;if(e.tagName!=="STYLE")return!1;if(t)return!0;const n=e.textContent||"";return LY.some(r=>n.includes(r))},Yx=e=>{if(!(e!=null&&e.head))return;const t=jY();e.head.querySelectorAll('[data-ed-iframe-style-clone="true"]').forEach(n=>n.remove()),document.querySelectorAll('style, link[rel="stylesheet"]').forEach(n=>{if(!VY(n,t))return;const r=n.cloneNode(!0);r.setAttribute("data-ed-iframe-style-clone","true"),Ry(n)&&(r.removeAttribute("media"),r.removeAttribute("data-ed-parent-style-disabled"),t||DY(n)),e.head.appendChild(r)})},UY=({children:e,dimensions:t,position:n,themeColor:r})=>{const i=O.useRef(null),[o,a]=O.useState(null),[s,c]=O.useState(null);return O.useEffect(()=>{var b;const u=i.current;if(!u)return()=>{};const d=u.contentDocument||((b=u.contentWindow)==null?void 0:b.document);if(!d)return()=>{};const h=d.createElement("meta");h.name="viewport",h.content=`width=${window.innerWidth}, initial-scale=1.0`,d.head.appendChild(h);const p=()=>{const v=d.querySelector('meta[name="viewport"]');v&&(v.content=`width=${window.innerWidth}, initial-scale=1.0`)};window.addEventListener("resize",p);const m=d.createElement("style");m.textContent=`
|
|
1628
1628
|
html, body {
|
|
1629
1629
|
margin: 0;
|
|
1630
1630
|
padding: 0;
|