@moderta/mint-ai-assistant 0.1.5 → 0.1.6
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/README.md +100 -85
- package/dist/index.d.ts +78 -5
- package/dist/mint-ai-assistant.cjs +27 -27
- package/dist/mint-ai-assistant.js +3596 -4458
- package/package.json +61 -61
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`.mint-pointer-events-none{pointer-events:none}.mint-fixed{position:fixed}.mint-absolute{position:absolute}.mint-relative{position:relative}.mint-inset-0{top:0;right:0;bottom:0;left:0}.mint-bottom-0{bottom:0}.mint-bottom-4{bottom:1rem}.mint-bottom-6{bottom:1.5rem}.mint-bottom-8{bottom:2rem}.mint-left-4{left:1rem}.mint-left-\\[66px\\]{left:66px}.mint-right-2{right:.5rem}.mint-right-4{right:1rem}.mint-right-6{right:1.5rem}.mint-right-\\[66px\\]{right:66px}.mint-top-1\\/2{top:50%}.mint-top-4{top:1rem}.mint-z-widget{z-index:2147483000}.mint-col-span-1{grid-column:span 1 / span 1}.mint-m-0{margin:0}.mint-mx-2{margin-left:.5rem;margin-right:.5rem}.mint-mx-6{margin-left:1.5rem;margin-right:1.5rem}.mint-mt-1{margin-top:.25rem}.mint-mt-2{margin-top:.5rem}.mint-mt-3{margin-top:.75rem}.mint-mt-4{margin-top:1rem}.mint-mt-6{margin-top:1.5rem}.mint-inline-block{display:inline-block}.mint-flex{display:flex}.mint-inline-flex{display:inline-flex}.mint-grid{display:grid}.mint-h-10{height:2.5rem}.mint-h-11{height:2.75rem}.mint-h-12{height:3rem}.mint-h-14{height:3.5rem}.mint-h-2{height:.5rem}.mint-h-2\\.5{height:.625rem}.mint-h-3{height:.75rem}.mint-h-4{height:1rem}.mint-h-5{height:1.25rem}.mint-h-6{height:1.5rem}.mint-h-7{height:1.75rem}.mint-h-8{height:2rem}.mint-h-9{height:2.25rem}.mint-h-\\[20px\\]{height:20px}.mint-h-\\[640px\\]{height:640px}.mint-h-\\[72px\\]{height:72px}.mint-h-\\[82px\\]{height:82px}.mint-h-\\[min\\(720px\\,calc\\(100vh-112px\\)\\)\\]{height:min(720px,calc(100vh - 112px))}.mint-h-\\[min\\(92vh\\,614px\\)\\]{height:min(92vh,614px)}.mint-h-px{height:1px}.mint-max-h-20{max-height:5rem}.mint-max-h-\\[85vh\\]{max-height:85vh}.mint-min-h-screen{min-height:100vh}.mint-w-10{width:2.5rem}.mint-w-11{width:2.75rem}.mint-w-12{width:3rem}.mint-w-14{width:3.5rem}.mint-w-2{width:.5rem}.mint-w-2\\.5{width:.625rem}.mint-w-3{width:.75rem}.mint-w-4{width:1rem}.mint-w-7{width:1.75rem}.mint-w-8{width:2rem}.mint-w-\\[20px\\]{width:20px}.mint-w-\\[226px\\]{width:226px}.mint-w-\\[230px\\]{width:230px}.mint-w-\\[420px\\]{width:420px}.mint-w-\\[min\\(1080px\\,calc\\(100vw-32px\\)\\)\\]{width:min(1080px,calc(100vw - 32px))}.mint-w-\\[min\\(1100px\\,calc\\(100vw-32px\\)\\)\\]{width:min(1100px,calc(100vw - 32px))}.mint-w-fit{width:-moz-fit-content;width:fit-content}.mint-w-full{width:100%}.mint-min-w-0{min-width:0px}.mint-min-w-\\[320px\\]{min-width:320px}.mint-max-w-\\[520px\\]{max-width:520px}.mint-max-w-\\[78\\%\\]{max-width:78%}.mint-max-w-\\[calc\\(100vw-32px\\)\\]{max-width:calc(100vw - 32px)}.mint-max-w-full{max-width:100%}.mint-flex-1{flex:1 1 0%}.mint-shrink-0{flex-shrink:0}.mint--translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.mint-translate-y-\\[2px\\]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes mint-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)}}.mint-animate-bounce{animation:mint-bounce 1s infinite}.mint-resize-none{resize:none}.mint-appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.mint-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.mint-flex-row-reverse{flex-direction:row-reverse}.mint-flex-col{flex-direction:column}.mint-flex-wrap{flex-wrap:wrap}.mint-items-start{align-items:flex-start}.mint-items-end{align-items:flex-end}.mint-items-center{align-items:center}.mint-justify-start{justify-content:flex-start}.mint-justify-end{justify-content:flex-end}.mint-justify-center{justify-content:center}.mint-justify-between{justify-content:space-between}.mint-gap-0\\.5{gap:.125rem}.mint-gap-1{gap:.25rem}.mint-gap-1\\.5{gap:.375rem}.mint-gap-2{gap:.5rem}.mint-gap-3{gap:.75rem}.mint-gap-5{gap:1.25rem}.mint-gap-6{gap:1.5rem}.mint-gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.mint-gap-y-3{row-gap:.75rem}.mint-self-end{align-self:flex-end}.mint-overflow-hidden{overflow:hidden}.mint-overflow-y-auto{overflow-y:auto}.mint-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mint-whitespace-nowrap{white-space:nowrap}.mint-whitespace-pre-wrap{white-space:pre-wrap}.mint-break-words{overflow-wrap:break-word}.mint-rounded{border-radius:.25rem}.mint-rounded-2xl{border-radius:1rem}.mint-rounded-\\[7px\\]{border-radius:7px}.mint-rounded-full{border-radius:9999px}.mint-rounded-lg{border-radius:.5rem}.mint-rounded-md{border-radius:.375rem}.mint-rounded-xl{border-radius:.75rem}.mint-rounded-tl-sm{border-top-left-radius:.125rem}.mint-rounded-tr-sm{border-top-right-radius:.125rem}.mint-border{border-width:1px}.mint-border-0{border-width:0px}.mint-border-\\[0\\.125px\\]{border-width:.125px}.mint-border-b{border-bottom-width:1px}.mint-border-solid{border-style:solid}.mint-border-assistant-accent{--tw-border-opacity: 1;border-color:rgb(94 236 176 / var(--tw-border-opacity, 1))}.mint-border-grey-100{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.mint-border-grey-200{--tw-border-opacity: 1;border-color:rgb(244 246 248 / var(--tw-border-opacity, 1))}.mint-border-grey-300{--tw-border-opacity: 1;border-color:rgb(223 227 232 / var(--tw-border-opacity, 1))}.mint-border-primary-light{--tw-border-opacity: 1;border-color:rgb(91 228 155 / var(--tw-border-opacity, 1))}.mint-bg-assistant-accent\\/5{background-color:#5eecb00d}.mint-bg-assistant-action{--tw-bg-opacity: 1;background-color:rgb(94 236 176 / var(--tw-bg-opacity, 1))}.mint-bg-assistant-divider{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.mint-bg-assistant-shell{--tw-bg-opacity: 1;background-color:rgb(223 227 232 / var(--tw-bg-opacity, 1))}.mint-bg-black\\/20{background-color:#0003}.mint-bg-error\\/10{background-color:#ff56301a}.mint-bg-grey-100{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.mint-bg-grey-200{--tw-bg-opacity: 1;background-color:rgb(244 246 248 / var(--tw-bg-opacity, 1))}.mint-bg-grey-300{--tw-bg-opacity: 1;background-color:rgb(223 227 232 / var(--tw-bg-opacity, 1))}.mint-bg-grey-500{--tw-bg-opacity: 1;background-color:rgb(145 158 171 / var(--tw-bg-opacity, 1))}.mint-bg-primary{--tw-bg-opacity: 1;background-color:rgb(0 167 111 / var(--tw-bg-opacity, 1))}.mint-bg-primary-dark{--tw-bg-opacity: 1;background-color:rgb(0 120 103 / var(--tw-bg-opacity, 1))}.mint-bg-primary-light{--tw-bg-opacity: 1;background-color:rgb(91 228 155 / var(--tw-bg-opacity, 1))}.mint-bg-primary-lighter\\/40{background-color:#c8fad666}.mint-bg-transparent{background-color:transparent}.mint-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.mint-bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.mint-from-primary-light{--tw-gradient-from: #5BE49B var(--tw-gradient-from-position);--tw-gradient-to: rgb(91 228 155 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.mint-to-primary{--tw-gradient-to: #00A76F var(--tw-gradient-to-position)}.mint-p-0{padding:0}.mint-p-1{padding:.25rem}.mint-p-2{padding:.5rem}.mint-p-3{padding:.75rem}.mint-p-4{padding:1rem}.mint-p-5{padding:1.25rem}.mint-p-6{padding:1.5rem}.mint-px-1{padding-left:.25rem;padding-right:.25rem}.mint-px-2{padding-left:.5rem;padding-right:.5rem}.mint-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mint-px-3{padding-left:.75rem;padding-right:.75rem}.mint-px-4{padding-left:1rem;padding-right:1rem}.mint-px-5{padding-left:1.25rem;padding-right:1.25rem}.mint-px-6{padding-left:1.5rem;padding-right:1.5rem}.mint-px-\\[66px\\]{padding-left:66px;padding-right:66px}.mint-py-1{padding-top:.25rem;padding-bottom:.25rem}.mint-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.mint-py-2{padding-top:.5rem;padding-bottom:.5rem}.mint-py-3{padding-top:.75rem;padding-bottom:.75rem}.mint-py-4{padding-top:1rem;padding-bottom:1rem}.mint-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.mint-pb-28{padding-bottom:7rem}.mint-pb-5{padding-bottom:1.25rem}.mint-pr-5{padding-right:1.25rem}.mint-pt-3{padding-top:.75rem}.mint-text-center{text-align:center}.mint-text-2xl{font-size:1.5rem;line-height:2rem}.mint-text-3xl{font-size:1.875rem;line-height:2.25rem}.mint-text-\\[22px\\]{font-size:22px}.mint-text-\\[24px\\]{font-size:24px}.mint-text-\\[28px\\]{font-size:28px}.mint-text-\\[6px\\]{font-size:6px}.mint-text-\\[7px\\]{font-size:7px}.mint-text-lg{font-size:1.125rem;line-height:1.75rem}.mint-text-sm{font-size:.875rem;line-height:1.25rem}.mint-text-xs{font-size:.75rem;line-height:1rem}.mint-font-bold{font-weight:700}.mint-font-extrabold{font-weight:800}.mint-font-medium{font-weight:500}.mint-font-normal{font-weight:400}.mint-font-semibold{font-weight:600}.mint-leading-3{line-height:.75rem}.mint-leading-4{line-height:1rem}.mint-leading-5{line-height:1.25rem}.mint-leading-7{line-height:1.75rem}.mint-leading-9{line-height:2.25rem}.mint-leading-none{line-height:1}.mint-leading-relaxed{line-height:1.625}.mint-text-assistant-action{--tw-text-opacity: 1;color:rgb(94 236 176 / var(--tw-text-opacity, 1))}.mint-text-error{--tw-text-opacity: 1;color:rgb(255 86 48 / var(--tw-text-opacity, 1))}.mint-text-grey-500{--tw-text-opacity: 1;color:rgb(145 158 171 / var(--tw-text-opacity, 1))}.mint-text-grey-600{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.mint-text-grey-700{--tw-text-opacity: 1;color:rgb(69 79 91 / var(--tw-text-opacity, 1))}.mint-text-grey-800{--tw-text-opacity: 1;color:rgb(28 37 46 / var(--tw-text-opacity, 1))}.mint-text-grey-900{--tw-text-opacity: 1;color:rgb(20 26 33 / var(--tw-text-opacity, 1))}.mint-text-primary{--tw-text-opacity: 1;color:rgb(0 167 111 / var(--tw-text-opacity, 1))}.mint-text-primary-contrast{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.mint-text-primary-light{--tw-text-opacity: 1;color:rgb(91 228 155 / var(--tw-text-opacity, 1))}.mint-opacity-60{opacity:.6}.mint-shadow-composer{--tw-shadow: 0 1px 2px rgba(145,158,171,.08), 0 8px 24px rgba(145,158,171,.16);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color), 0 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-shadow-widget{--tw-shadow: 0 0 2px 0 rgba(145,158,171,.2), 0 12px 24px -4px rgba(145,158,171,.12);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 12px 24px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-outline-none{outline:2px solid transparent;outline-offset:2px}.mint-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mint-transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.mint-ai-root,.mint-ai-root *{box-sizing:border-box}.mint-ai-root{font-family:'"Public Sans Variable"',system-ui,sans-serif;line-height:1.5;color:#1c252e}.mint-ai-root button,.mint-ai-root textarea{font-family:inherit}.mint-ai-root button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.mint-ai-shell{width:min(440px,calc(100vw - 32px));height:min(560px,calc(100vh - 112px));padding:12px;border-radius:16px;background:#dfe3e8}.mint-ai-panel{width:100%;height:100%;font-family:Roboto,'"Public Sans Variable"',system-ui,sans-serif}.mint-ai-root .mint-svg-asset>svg{display:block;width:100%;height:100%}.mint-ai-root .mint-scroll{scrollbar-width:thin;scrollbar-color:#C4CDD5 transparent}.mint-ai-root .mint-scroll::-webkit-scrollbar{width:6px;height:6px}.mint-ai-root .mint-scroll::-webkit-scrollbar-thumb{background-color:#c4cdd5;border-radius:9999px}.placeholder\\:mint-text-grey-600::-moz-placeholder{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.placeholder\\:mint-text-grey-600::placeholder{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.hover\\:mint-scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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))}.hover\\:mint-border-primary:hover{--tw-border-opacity: 1;border-color:rgb(0 167 111 / var(--tw-border-opacity, 1))}.hover\\:mint-bg-grey-100:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:mint-bg-primary-darker:hover{--tw-bg-opacity: 1;background-color:rgb(0 75 80 / var(--tw-bg-opacity, 1))}.hover\\:mint-bg-primary-lighter:hover{--tw-bg-opacity: 1;background-color:rgb(200 250 214 / var(--tw-bg-opacity, 1))}.hover\\:mint-text-primary:hover{--tw-text-opacity: 1;color:rgb(0 167 111 / var(--tw-text-opacity, 1))}.focus\\:mint-border-primary:focus{--tw-border-opacity: 1;border-color:rgb(0 167 111 / var(--tw-border-opacity, 1))}.disabled\\:mint-opacity-40:disabled{opacity:.4}.disabled\\:hover\\:mint-scale-100:hover:disabled{--tw-scale-x: 1;--tw-scale-y: 1;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))}`)),document.head.appendChild(t)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
|
-
"use strict";var
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`.mint-fixed{position:fixed}.mint-absolute{position:absolute}.mint-relative{position:relative}.mint-inset-0{top:0;right:0;bottom:0;left:0}.mint-bottom-0{bottom:0}.mint-bottom-4{bottom:1rem}.mint-left-0{left:0}.mint-left-4{left:1rem}.mint-right-0{right:0}.mint-right-4{right:1rem}.mint-top-4{top:1rem}.mint-z-widget{z-index:2147483000}.mint-m-0{margin:0}.mint-mx-2{margin-left:.5rem;margin-right:.5rem}.mint-mx-6{margin-left:1.5rem;margin-right:1.5rem}.mint-mt-1{margin-top:.25rem}.mint-mt-2{margin-top:.5rem}.mint-mt-3{margin-top:.75rem}.mint-mt-4{margin-top:1rem}.mint-block{display:block}.mint-inline-block{display:inline-block}.mint-flex{display:flex}.mint-inline-flex{display:inline-flex}.mint-hidden{display:none}.mint-h-1\\.5{height:.375rem}.mint-h-10{height:2.5rem}.mint-h-12{height:3rem}.mint-h-14{height:3.5rem}.mint-h-2{height:.5rem}.mint-h-2\\.5{height:.625rem}.mint-h-3{height:.75rem}.mint-h-4{height:1rem}.mint-h-5{height:1.25rem}.mint-h-6{height:1.5rem}.mint-h-7{height:1.75rem}.mint-h-8{height:2rem}.mint-h-9{height:2.25rem}.mint-h-\\[20px\\]{height:20px}.mint-h-\\[72px\\]{height:72px}.mint-h-\\[82px\\]{height:82px}.mint-h-\\[min\\(720px\\,calc\\(100vh-112px\\)\\)\\]{height:min(720px,calc(100vh - 112px))}.mint-h-full{height:100%}.mint-h-px{height:1px}.mint-max-h-20{max-height:5rem}.mint-min-h-0{min-height:0px}.mint-w-1\\.5{width:.375rem}.mint-w-12{width:3rem}.mint-w-2{width:.5rem}.mint-w-2\\.5{width:.625rem}.mint-w-3{width:.75rem}.mint-w-4{width:1rem}.mint-w-6{width:1.5rem}.mint-w-7{width:1.75rem}.mint-w-8{width:2rem}.mint-w-9{width:2.25rem}.mint-w-\\[20px\\]{width:20px}.mint-w-\\[clamp\\(12rem\\,20vw\\,15\\.5rem\\)\\]{width:clamp(12rem,20vw,15.5rem)}.mint-w-\\[min\\(1100px\\,calc\\(100vw-32px\\)\\)\\]{width:min(1100px,calc(100vw - 32px))}.mint-w-fit{width:-moz-fit-content;width:fit-content}.mint-w-full{width:100%}.mint-min-w-0{min-width:0px}.mint-min-w-\\[320px\\]{min-width:320px}.mint-max-w-\\[520px\\]{max-width:520px}.mint-max-w-\\[78\\%\\]{max-width:78%}.mint-max-w-full{max-width:100%}.mint-flex-1{flex:1 1 0%}.mint-shrink-0{flex-shrink:0}.mint-translate-y-\\[2px\\]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes mint-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)}}.mint-animate-bounce{animation:mint-bounce 1s infinite}.mint-resize-none{resize:none}.mint-flex-row-reverse{flex-direction:row-reverse}.mint-flex-col{flex-direction:column}.mint-flex-wrap{flex-wrap:wrap}.mint-items-start{align-items:flex-start}.mint-items-end{align-items:flex-end}.mint-items-center{align-items:center}.mint-justify-start{justify-content:flex-start}.mint-justify-center{justify-content:center}.mint-justify-between{justify-content:space-between}.mint-gap-0\\.5{gap:.125rem}.mint-gap-1{gap:.25rem}.mint-gap-1\\.5{gap:.375rem}.mint-gap-2{gap:.5rem}.mint-gap-3{gap:.75rem}.mint-gap-4{gap:1rem}.mint-gap-5{gap:1.25rem}.mint-self-end{align-self:flex-end}.mint-overflow-hidden{overflow:hidden}.mint-overflow-y-auto{overflow-y:auto}.mint-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mint-whitespace-nowrap{white-space:nowrap}.mint-whitespace-pre-wrap{white-space:pre-wrap}.mint-break-words{overflow-wrap:break-word}.mint-rounded-2xl{border-radius:1rem}.mint-rounded-full{border-radius:9999px}.mint-rounded-lg{border-radius:.5rem}.mint-rounded-md{border-radius:.375rem}.mint-rounded-xl{border-radius:.75rem}.mint-rounded-tl-sm{border-top-left-radius:.125rem}.mint-rounded-tr-sm{border-top-right-radius:.125rem}.mint-border{border-width:1px}.mint-border-0{border-width:0px}.mint-border-b{border-bottom-width:1px}.mint-border-solid{border-style:solid}.mint-border-assistant-accent,.mint-border-assistant-action{--tw-border-opacity: 1;border-color:rgb(94 236 176 / var(--tw-border-opacity, 1))}.mint-border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))}.mint-border-error\\/40{border-color:#ff563066}.mint-border-grey-200{--tw-border-opacity: 1;border-color:rgb(244 246 248 / var(--tw-border-opacity, 1))}.mint-border-grey-300{--tw-border-opacity: 1;border-color:rgb(223 227 232 / var(--tw-border-opacity, 1))}.mint-bg-assistant-accent\\/5{background-color:#5eecb00d}.mint-bg-assistant-action{--tw-bg-opacity: 1;background-color:rgb(94 236 176 / var(--tw-bg-opacity, 1))}.mint-bg-assistant-divider{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.mint-bg-assistant-shell{--tw-bg-opacity: 1;background-color:rgb(223 227 232 / var(--tw-bg-opacity, 1))}.mint-bg-black\\/20{background-color:#0003}.mint-bg-error\\/10{background-color:#ff56301a}.mint-bg-grey-100{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.mint-bg-grey-200{--tw-bg-opacity: 1;background-color:rgb(244 246 248 / var(--tw-bg-opacity, 1))}.mint-bg-grey-500{--tw-bg-opacity: 1;background-color:rgb(145 158 171 / var(--tw-bg-opacity, 1))}.mint-bg-primary-light{--tw-bg-opacity: 1;background-color:rgb(91 228 155 / var(--tw-bg-opacity, 1))}.mint-bg-primary-lighter\\/40{background-color:#c8fad666}.mint-bg-transparent{background-color:transparent}.mint-bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.mint-bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.mint-from-primary-light{--tw-gradient-from: #5BE49B var(--tw-gradient-from-position);--tw-gradient-to: rgb(91 228 155 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.mint-to-primary{--tw-gradient-to: #00A76F var(--tw-gradient-to-position)}.mint-p-0{padding:0}.mint-p-3{padding:.75rem}.mint-p-4{padding:1rem}.mint-p-5{padding:1.25rem}.mint-px-1{padding-left:.25rem;padding-right:.25rem}.mint-px-2{padding-left:.5rem;padding-right:.5rem}.mint-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.mint-px-3{padding-left:.75rem;padding-right:.75rem}.mint-px-4{padding-left:1rem;padding-right:1rem}.mint-px-5{padding-left:1.25rem;padding-right:1.25rem}.mint-px-6{padding-left:1.5rem;padding-right:1.5rem}.mint-py-1{padding-top:.25rem;padding-bottom:.25rem}.mint-py-2{padding-top:.5rem;padding-bottom:.5rem}.mint-py-3{padding-top:.75rem;padding-bottom:.75rem}.mint-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.mint-pb-28{padding-bottom:7rem}.mint-pb-3{padding-bottom:.75rem}.mint-pt-3{padding-top:.75rem}.mint-text-left{text-align:left}.mint-text-center{text-align:center}.mint-text-\\[10px\\]{font-size:10px}.mint-text-\\[11px\\]{font-size:11px}.mint-text-\\[13px\\]{font-size:13px}.mint-text-\\[22px\\]{font-size:22px}.mint-text-\\[24px\\]{font-size:24px}.mint-text-\\[26px\\]{font-size:26px}.mint-text-\\[28px\\]{font-size:28px}.mint-text-\\[7px\\]{font-size:7px}.mint-text-sm{font-size:.875rem;line-height:1.25rem}.mint-text-xs{font-size:.75rem;line-height:1rem}.mint-font-bold{font-weight:700}.mint-font-extrabold{font-weight:800}.mint-font-medium{font-weight:500}.mint-font-normal{font-weight:400}.mint-font-semibold{font-weight:600}.mint-leading-4{line-height:1rem}.mint-leading-5{line-height:1.25rem}.mint-leading-7{line-height:1.75rem}.mint-leading-8{line-height:2rem}.mint-leading-9{line-height:2.25rem}.mint-leading-none{line-height:1}.mint-leading-relaxed{line-height:1.625}.mint-text-assistant-action{--tw-text-opacity: 1;color:rgb(94 236 176 / var(--tw-text-opacity, 1))}.mint-text-error{--tw-text-opacity: 1;color:rgb(255 86 48 / var(--tw-text-opacity, 1))}.mint-text-grey-500{--tw-text-opacity: 1;color:rgb(145 158 171 / var(--tw-text-opacity, 1))}.mint-text-grey-600{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.mint-text-grey-700{--tw-text-opacity: 1;color:rgb(69 79 91 / var(--tw-text-opacity, 1))}.mint-text-grey-800{--tw-text-opacity: 1;color:rgb(28 37 46 / var(--tw-text-opacity, 1))}.mint-text-grey-900{--tw-text-opacity: 1;color:rgb(20 26 33 / var(--tw-text-opacity, 1))}.mint-text-primary-contrast{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.mint-opacity-60{opacity:.6}.mint-shadow-composer{--tw-shadow: 0 1px 2px rgba(145,158,171,.08), 0 8px 24px rgba(145,158,171,.16);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color), 0 8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-shadow-widget{--tw-shadow: 0 0 2px 0 rgba(145,158,171,.2), 0 12px 24px -4px rgba(145,158,171,.12);--tw-shadow-colored: 0 0 2px 0 var(--tw-shadow-color), 0 12px 24px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.mint-outline-none{outline:2px solid transparent;outline-offset:2px}.mint-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.mint-transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.\\[animation-delay\\:-0\\.15s\\]{animation-delay:-.15s}.\\[animation-delay\\:-0\\.3s\\]{animation-delay:-.3s}.mint-ai-root,.mint-ai-root *{box-sizing:border-box}.mint-ai-root,.mint-ai-root *,.mint-ai-root :before,.mint-ai-root :after{--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: }.mint-ai-root{font-family:'"Public Sans Variable"',system-ui,sans-serif;line-height:1.5;color:#1c252e}.mint-ai-root button,.mint-ai-root textarea{font-family:inherit}.mint-ai-root button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.mint-ai-shell{width:min(440px,calc(100vw - 32px));height:min(560px,calc(100vh - 112px));padding:12px;border-radius:16px;background:#dfe3e8}.mint-ai-panel{width:100%;height:100%;font-family:Roboto,'"Public Sans Variable"',system-ui,sans-serif}.mint-ai-root .mint-svg-asset>svg{display:block;width:100%;height:100%}.mint-ai-root .mint-scroll{scrollbar-width:thin;scrollbar-color:#C4CDD5 transparent}.mint-ai-root .mint-scroll::-webkit-scrollbar{width:6px;height:6px}.mint-ai-root .mint-scroll::-webkit-scrollbar-thumb{background-color:#c4cdd5;border-radius:9999px}.placeholder\\:mint-text-grey-500::-moz-placeholder{--tw-text-opacity: 1;color:rgb(145 158 171 / var(--tw-text-opacity, 1))}.placeholder\\:mint-text-grey-500::placeholder{--tw-text-opacity: 1;color:rgb(145 158 171 / var(--tw-text-opacity, 1))}.placeholder\\:mint-text-grey-600::-moz-placeholder{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.placeholder\\:mint-text-grey-600::placeholder{--tw-text-opacity: 1;color:rgb(99 115 129 / var(--tw-text-opacity, 1))}.hover\\:mint-scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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))}.hover\\:mint-bg-assistant-action\\/10:hover{background-color:#5eecb01a}.hover\\:mint-bg-grey-100:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.disabled\\:mint-opacity-40:disabled{opacity:.4}.disabled\\:hover\\:mint-scale-100:hover:disabled{--tw-scale-x: 1;--tw-scale-y: 1;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))}@media(min-width:640px){.sm\\:mint-left-3{left:.75rem}.sm\\:mint-right-3{right:.75rem}.sm\\:mint-inline{display:inline}.sm\\:mint-px-5{padding-left:1.25rem;padding-right:1.25rem}.sm\\:mint-px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\\:mint-pb-5{padding-bottom:1.25rem}}@media(min-width:1024px){.lg\\:mint-left-\\[66px\\]{left:66px}.lg\\:mint-right-\\[66px\\]{right:66px}.lg\\:mint-flex{display:flex}.lg\\:mint-px-\\[66px\\]{padding-left:66px;padding-right:66px}}`)),document.head.appendChild(t)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
|
+
"use strict";var Di=Object.defineProperty;var Mi=(e,t,n)=>t in e?Di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var re=(e,t,n)=>Mi(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),A=require("react");function Ri(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 se=Ri(A);var vt={exports:{}},Gt={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* use-sync-external-store-with-selector.production.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var
|
|
10
|
+
*/var zn;function Ai(){if(zn)return Gt;zn=1;var e=A;function t(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,s=e.useEffect,o=e.useMemo,a=e.useDebugValue;return Gt.useSyncExternalStoreWithSelector=function(c,l,f,S,C){var x=i(null);if(x.current===null){var p={hasValue:!1,value:null};x.current=p}else p=x.current;x=o(function(){function m(u){if(!O){if(O=!0,P=u,u=S(u),C!==void 0&&p.hasValue){var d=p.value;if(C(d,u))return b=d}return b=u}if(d=b,n(P,u))return d;var E=S(u);return C!==void 0&&C(d,E)?(P=u,d):(P=u,b=E)}var O=!1,P,b,g=f===void 0?null:f;return[function(){return m(l())},g===null?void 0:function(){return m(g())}]},[l,f,S,C]);var N=r(c,x[0],x[1]);return s(function(){p.hasValue=!0,p.value=N},[N]),a(N),N},Gt}var Yt={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* use-sync-external-store-with-selector.development.js
|
|
13
13
|
*
|
|
@@ -15,49 +15,49 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var
|
|
19
|
-
Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:
|
|
20
|
-
Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:v})}l.current&&(l.current=!1)}return h}}[r.name],[r]),N=Mo.useSyncExternalStoreWithSelector(a.addNestedSub,c.getState,u||c.getState,y,o);return re.useDebugValue(N),N};return Object.assign(n,{withTypes:()=>n}),n}var di=Uo(),Wo=ci;let vn=null;function Ho(e){vn=e}function Bo(){if(!vn)throw new Error("[mint-ai-assistant] Config not initialised. Render <MintAIAssistant /> before calling the API.");return vn}const Ko={placement:"bottom-right",title:"ESM Sustainability AI",welcomeMessage:"What can I help with?",defaultOpen:!1,enableExpandMode:!1},pi=j.createContext(null);function Go({config:e,children:t}){const n=j.useMemo(()=>({...Ko,...e}),[e]);return Ho(n),R.jsx(pi.Provider,{value:n,children:t})}function Ae(){const e=j.useContext(pi);if(!e)throw new Error("useConfig must be used within <MintAIAssistant />");return e}function X(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Yo=typeof Symbol=="function"&&Symbol.observable||"@@observable",fr=Yo,an=()=>Math.random().toString(36).substring(7).split("").join("."),Jo={INIT:`@@redux/INIT${an()}`,REPLACE:`@@redux/REPLACE${an()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${an()}`},Me=Jo;function de(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Zo(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(ts(e))return"date";if(es(e))return"error";const n=Xo(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function Xo(e){return typeof e.constructor=="function"?e.constructor.name:null}function es(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function ts(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Ee(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Zo(e)),t}function hi(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?X(2):`Expected the root reducer to be a function. Instead, received: '${Ee(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?X(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?X(1):`Expected the enhancer to be a function. Instead, received: '${Ee(n)}'`);return n(hi)(e,t)}let r=e,i=t,o=new Map,s=o,c=0,a=!1;function u(){s===o&&(s=new Map,o.forEach((p,S)=>{s.set(S,p)}))}function l(){if(a)throw new Error(process.env.NODE_ENV==="production"?X(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function y(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?X(4):`Expected the listener to be a function. Instead, received: '${Ee(p)}'`);if(a)throw new Error(process.env.NODE_ENV==="production"?X(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let S=!0;u();const M=c++;return s.set(M,p),function(){if(S){if(a)throw new Error(process.env.NODE_ENV==="production"?X(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");S=!1,u(),s.delete(M),o=null}}}function N(p){if(!de(p))throw new Error(process.env.NODE_ENV==="production"?X(7):`Actions must be plain objects. Instead, the actual type was: '${Ee(p)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof p.type>"u")throw new Error(process.env.NODE_ENV==="production"?X(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof p.type!="string")throw new Error(process.env.NODE_ENV==="production"?X(17):`Action "type" property must be a string. Instead, the actual type was: '${Ee(p.type)}'. Value was: '${p.type}' (stringified)`);if(a)throw new Error(process.env.NODE_ENV==="production"?X(9):"Reducers may not dispatch actions.");try{a=!0,i=r(i,p)}finally{a=!1}return(o=s).forEach(M=>{M()}),p}function g(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?X(10):`Expected the nextReducer to be a function. Instead, received: '${Ee(p)}`);r=p,N({type:Me.REPLACE})}function h(){const p=y;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(process.env.NODE_ENV==="production"?X(11):`Expected the observer to be an object. Instead, received: '${Ee(S)}'`);function M(){const v=S;v.next&&v.next(l())}return M(),{unsubscribe:p(M)}},[fr](){return this}}}return N({type:Me.INIT}),{dispatch:N,subscribe:y,getState:l,replaceReducer:g,[fr]:h}}function dr(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ns(e,t,n,r){const i=Object.keys(t),o=n&&n.type===Me.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!de(e))return`The ${o} has unexpected type of "${Ee(e)}". Expected argument to be an object with the following keys: "${i.join('", "')}"`;const s=Object.keys(e).filter(c=>!t.hasOwnProperty(c)&&!r[c]);if(s.forEach(c=>{r[c]=!0}),!(n&&n.type===Me.REPLACE)&&s.length>0)return`Unexpected ${s.length>1?"keys":"key"} "${s.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${i.join('", "')}". Unexpected keys will be ignored.`}function rs(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Me.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?X(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Me.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?X(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Me.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function mi(e){const t=Object.keys(e),n={};for(let s=0;s<t.length;s++){const c=t[s];process.env.NODE_ENV!=="production"&&typeof e[c]>"u"&&dr(`No reducer provided for key "${c}"`),typeof e[c]=="function"&&(n[c]=e[c])}const r=Object.keys(n);let i;process.env.NODE_ENV!=="production"&&(i={});let o;try{rs(n)}catch(s){o=s}return function(c={},a){if(o)throw o;if(process.env.NODE_ENV!=="production"){const y=ns(c,n,a,i);y&&dr(y)}let u=!1;const l={};for(let y=0;y<r.length;y++){const N=r[y],g=n[N],h=c[N],_=g(h,a);if(typeof _>"u"){const p=a&&a.type;throw new Error(process.env.NODE_ENV==="production"?X(14):`When called with an action of type ${p?`"${String(p)}"`:"(unknown type)"}, the slice reducer for key "${N}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}l[N]=_,u=u||_!==h}return u=u||r.length!==Object.keys(c).length,u?l:c}}function Tt(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function is(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(process.env.NODE_ENV==="production"?X(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:i.getState,dispatch:(a,...u)=>o(a,...u)},c=e.map(a=>a(s));return o=Tt(...c)(i.dispatch),{...i,dispatch:o}}}function Qn(e){return de(e)&&"type"in e&&typeof e.type=="string"}var zn=Symbol.for("immer-nothing"),Ze=Symbol.for("immer-draftable"),Z=Symbol.for("immer-state"),yi=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function J(e,...t){if(process.env.NODE_ENV!=="production"){const n=yi[e],r=Se(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ie=Object,Pe=ie.getPrototypeOf,nt="constructor",lt="prototype",wn="configurable",jt="enumerable",kt="writable",rt="value",oe=e=>!!e&&!!e[Z];function se(e){var t;return e?gi(e)||dt(e)||!!e[Ze]||!!((t=e[nt])!=null&&t[Ze])||pt(e)||ht(e):!1}var os=ie[lt][nt].toString(),pr=new WeakMap;function gi(e){if(!e||!Fe(e))return!1;const t=Pe(e);if(t===null||t===ie[lt])return!0;const n=ie.hasOwnProperty.call(t,nt)&&t[nt];if(n===Object)return!0;if(!Se(n))return!1;let r=pr.get(n);return r===void 0&&(r=Function.toString.call(n),pr.set(n,r)),r===os}function ss(e){return oe(e)||J(15,e),e[Z].base_}function ft(e,t,n=!0){Re(e)===0?(n?Reflect.ownKeys(e):ie.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Re(e){const t=e[Z];return t?t.type_:dt(e)?1:pt(e)?2:ht(e)?3:0}var Xe=(e,t,n=Re(e))=>n===2?e.has(t):ie[lt].hasOwnProperty.call(e,t),he=(e,t,n=Re(e))=>n===2?e.get(t):e[t],Vt=(e,t,n,r=Re(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function cs(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var dt=Array.isArray,pt=e=>e instanceof Map,ht=e=>e instanceof Set,Fe=e=>typeof e=="object",Se=e=>typeof e=="function",un=e=>typeof e=="boolean";function as(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var us=e=>Fe(e)?e==null?void 0:e[Z]:null,me=e=>e.copy_||e.base_,qn=e=>e.modified_?e.copy_:e.base_;function En(e,t){if(pt(e))return new Map(e);if(ht(e))return new Set(e);if(dt(e))return Array[lt].slice.call(e);const n=gi(e);if(t===!0||t==="class_only"&&!n){const r=ie.getOwnPropertyDescriptors(e);delete r[Z];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],c=r[s];c[kt]===!1&&(c[kt]=!0,c[wn]=!0),(c.get||c.set)&&(r[s]={[wn]:!0,[kt]:!0,[jt]:c[jt],[rt]:e[s]})}return ie.create(Pe(e),r)}else{const r=Pe(e);if(r!==null&&n)return{...e};const i=ie.create(r);return ie.assign(i,e)}}function $n(e,t=!1){return Gt(e)||oe(e)||!se(e)||(Re(e)>1&&ie.defineProperties(e,{set:Et,add:Et,clear:Et,delete:Et}),ie.freeze(e),t&&ft(e,(n,r)=>{$n(r,!0)},!1)),e}function ls(){J(2)}var Et={[rt]:ls};function Gt(e){return e===null||!Fe(e)?!0:ie.isFrozen(e)}var Lt="MapSet",Ft="Patches",hr="ArrayMethods",Qt={};function De(e){const t=Qt[e];return t||J(0,e),t}var mr=e=>!!Qt[e];function fs(e,t){Qt[e]||(Qt[e]=t)}var it,bi=()=>it,ds=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:mr(Lt)?De(Lt):void 0,arrayMethodsPlugin_:mr(hr)?De(hr):void 0});function yr(e,t){t&&(e.patchPlugin_=De(Ft),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Sn(e){xn(e),e.drafts_.forEach(ps),e.drafts_=null}function xn(e){e===it&&(it=e.parent_)}var gr=e=>it=ds(it,e);function ps(e){const t=e[Z];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function br(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Z].modified_&&(Sn(t),J(4)),se(e)&&(e=vr(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Z].base_,e,t)}else e=vr(t,n);return hs(t,e,!0),Sn(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==zn?e:void 0}function vr(e,t){if(Gt(t))return t;const n=t[Z];if(!n)return zt(t,e.handledSet_,e);if(!Yt(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);Ei(n,e)}return n.copy_}function hs(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$n(t,n)}function vi(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Yt=(e,t)=>e.scope_===t,ms=[];function wi(e,t,n,r){const i=me(e),o=e.type_;if(r!==void 0&&he(i,r,o)===t){Vt(i,r,n,o);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;ft(i,(a,u)=>{if(oe(u)){const l=c.get(u)||[];l.push(a),c.set(u,l)}})}const s=e.draftLocations_.get(t)??ms;for(const c of s)Vt(i,c,n,o)}function ys(e,t,n){e.callbacks_.push(function(i){var c;const o=t;if(!o||!Yt(o,i))return;(c=i.mapSetPlugin_)==null||c.fixSetContents(o);const s=qn(o);wi(e,o.draft_??o,s,n),Ei(o,i)})}function Ei(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const o=i.getPath(e);o&&i.generatePatches_(e,o,t)}vi(e)}}function gs(e,t,n){const{scope_:r}=e;if(oe(n)){const i=n[Z];Yt(i,r)&&i.callbacks_.push(function(){Mt(e);const s=qn(i);wi(e,n,s,t)})}else se(n)&&e.callbacks_.push(function(){const o=me(e);e.type_===3?o.has(n)&&zt(n,r.handledSet_,r):he(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&zt(he(e.copy_,t,e.type_),r.handledSet_,r)})}function zt(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||oe(e)||t.has(e)||!se(e)||Gt(e)||(t.add(e),ft(e,(r,i)=>{if(oe(i)){const o=i[Z];if(Yt(o,n)){const s=qn(o);Vt(e,r,s,e.type_),vi(o)}}else se(i)&&zt(i,t,n)})),e}function bs(e,t){const n=dt(e),r={type_:n?1:0,scope_:t?t.scope_:bi(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,o=qt;n&&(i=[r],o=ot);const{revoke:s,proxy:c}=Proxy.revocable(i,o);return r.draft_=c,r.revoke_=s,[c,r]}var qt={get(e,t){if(t===Z)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=me(e);if(!Xe(i,t,e.type_))return vs(e,i,t);const o=i[t];if(e.finalized_||!se(o)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&as(t))return o;if(o===ln(e.base_,t)){Mt(e);const s=e.type_===1?+t:t,c=_n(e.scope_,o,e,s);return e.copy_[s]=c}return o},has(e,t){return t in me(e)},ownKeys(e){return Reflect.ownKeys(me(e))},set(e,t,n){const r=Si(me(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ln(me(e),t),o=i==null?void 0:i[Z];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(cs(n,i)&&(n!==void 0||Xe(e.base_,t,e.type_)))return!0;Mt(e),Cn(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),gs(e,t,n)),!0},deleteProperty(e,t){return Mt(e),ln(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Cn(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=me(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[kt]:!0,[wn]:e.type_!==1||t!=="length",[jt]:r[jt],[rt]:n[t]}},defineProperty(){J(11)},getPrototypeOf(e){return Pe(e.base_)},setPrototypeOf(){J(12)}},ot={};for(let e in qt){let t=qt[e];ot[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ot.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&J(13),ot.set.call(this,e,t,void 0)};ot.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&J(14),qt.set.call(this,e[0],t,n,e[0])};function ln(e,t){const n=e[Z];return(n?me(n):e)[t]}function vs(e,t,n){var i;const r=Si(t,n);return r?rt in r?r[rt]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Si(e,t){if(!(t in e))return;let n=Pe(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Pe(n)}}function Cn(e){e.modified_||(e.modified_=!0,e.parent_&&Cn(e.parent_))}function Mt(e){e.copy_||(e.assigned_=new Map,e.copy_=En(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ws=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Se(t)&&!Se(n)){const o=n;n=t;const s=this;return function(a=o,...u){return s.produce(a,l=>n.call(this,l,...u))}}Se(n)||J(6),r!==void 0&&!Se(r)&&J(7);let i;if(se(t)){const o=gr(this),s=_n(o,t,void 0);let c=!0;try{i=n(s),c=!1}finally{c?Sn(o):xn(o)}return yr(o,r),br(i,o)}else if(!t||!Fe(t)){if(i=n(t),i===void 0&&(i=t),i===zn&&(i=void 0),this.autoFreeze_&&$n(i,!0),r){const o=[],s=[];De(Ft).generateReplacementPatches_(t,i,{patches_:o,inversePatches_:s}),r(o,s)}return i}else J(1,t)},this.produceWithPatches=(t,n)=>{if(Se(t))return(s,...c)=>this.produceWithPatches(s,a=>t(a,...c));let r,i;return[this.produce(t,n,(s,c)=>{r=s,i=c}),r,i]},un(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),un(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),un(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){se(e)||J(8),oe(e)&&(e=xi(e));const t=gr(this),n=_n(t,e,void 0);return n[Z].isManual_=!0,xn(t),n}finishDraft(e,t){const n=e&&e[Z];(!n||!n.isManual_)&&J(9);const{scope_:r}=n;return yr(r,t),br(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=De(Ft).applyPatches_;return oe(e)?r(e,t):this.produce(e,i=>r(i,t))}};function _n(e,t,n,r){const[i,o]=pt(t)?De(Lt).proxyMap_(t,n):ht(t)?De(Lt).proxySet_(t,n):bs(t,n);return((n==null?void 0:n.scope_)??bi()).drafts_.push(i),o.callbacks_=(n==null?void 0:n.callbacks_)??[],o.key_=r,n&&r!==void 0?ys(n,o,r):o.callbacks_.push(function(a){var l;(l=a.mapSetPlugin_)==null||l.fixSetContents(o);const{patchPlugin_:u}=a;o.modified_&&u&&u.generatePatches_(o,[],a)}),i}function xi(e){return oe(e)||J(10,e),Ci(e)}function Ci(e){if(!se(e)||Gt(e))return e;const t=e[Z];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=En(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=En(e,!0);return ft(n,(i,o)=>{Vt(n,i,Ci(o))},r),t&&(t.finalized_=!1),n}function Es(){process.env.NODE_ENV!=="production"&&yi.push('Sets cannot have "replace" patches.',function(h){return"Unsupported patch operation: "+h},function(h){return"Cannot apply patch, path doesn't resolve: "+h},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(h,_=[]){if(h.key_!==void 0){const p=h.parent_.copy_??h.parent_.base_,S=us(he(p,h.key_)),M=he(p,h.key_);if(M===void 0||M!==h.draft_&&M!==h.base_&&M!==h.copy_||S!=null&&S.base_!==h.base_)return null;const b=h.parent_.type_===3;let v;if(b){const d=h.parent_;v=Array.from(d.drafts_.keys()).indexOf(h.key_)}else v=h.key_;if(!(b&&p.size>v||Xe(p,v)))return null;_.push(v)}if(h.parent_)return t(h.parent_,_);_.reverse();try{n(h.copy_,_)}catch{return null}return _}function n(h,_){let p=h;for(let S=0;S<_.length-1;S++){const M=_[S];if(p=he(p,M),!Fe(p)||p===null)throw new Error(`Cannot resolve path at '${_.join("/")}'`)}return p}const r="replace",i="add",o="remove";function s(h,_,p){if(h.scope_.processedForPatches_.has(h))return;h.scope_.processedForPatches_.add(h);const{patches_:S,inversePatches_:M}=p;switch(h.type_){case 0:case 2:return a(h,_,S,M);case 1:return c(h,_,S,M);case 3:return u(h,_,S,M)}}function c(h,_,p,S){let{base_:M,assigned_:b}=h,v=h.copy_;v.length<M.length&&([M,v]=[v,M],[p,S]=[S,p]);const d=h.allIndicesReassigned_===!0;for(let f=0;f<M.length;f++){const x=v[f],O=M[f];if((d||(b==null?void 0:b.get(f.toString())))&&x!==O){const E=x==null?void 0:x[Z];if(E&&E.modified_)continue;const m=_.concat([f]);p.push({op:r,path:m,value:g(x)}),S.push({op:r,path:m,value:g(O)})}}for(let f=M.length;f<v.length;f++){const x=_.concat([f]);p.push({op:i,path:x,value:g(v[f])})}for(let f=v.length-1;M.length<=f;--f){const x=_.concat([f]);S.push({op:o,path:x})}}function a(h,_,p,S){const{base_:M,copy_:b,type_:v}=h;ft(h.assigned_,(d,f)=>{const x=he(M,d,v),O=he(b,d,v),C=f?Xe(M,d)?r:i:o;if(x===O&&C===r)return;const E=_.concat(d);p.push(C===o?{op:C,path:E}:{op:C,path:E,value:g(O)}),S.push(C===i?{op:o,path:E}:C===o?{op:i,path:E,value:g(x)}:{op:r,path:E,value:g(x)})})}function u(h,_,p,S){let{base_:M,copy_:b}=h,v=0;M.forEach(d=>{if(!b.has(d)){const f=_.concat([v]);p.push({op:o,path:f,value:d}),S.unshift({op:i,path:f,value:d})}v++}),v=0,b.forEach(d=>{if(!M.has(d)){const f=_.concat([v]);p.push({op:i,path:f,value:d}),S.unshift({op:o,path:f,value:d})}v++})}function l(h,_,p){const{patches_:S,inversePatches_:M}=p;S.push({op:r,path:[],value:_===zn?void 0:_}),M.push({op:r,path:[],value:h})}function y(h,_){return _.forEach(p=>{const{path:S,op:M}=p;let b=h;for(let x=0;x<S.length-1;x++){const O=Re(b);let C=S[x];typeof C!="string"&&typeof C!="number"&&(C=""+C),(O===0||O===1)&&(C==="__proto__"||C===nt)&&J(19),Se(b)&&C===lt&&J(19),b=he(b,C),Fe(b)||J(18,S.join("/"))}const v=Re(b),d=N(p.value),f=S[S.length-1];switch(M){case r:switch(v){case 2:return b.set(f,d);case 3:J(16);default:return b[f]=d}case i:switch(v){case 1:return f==="-"?b.push(d):b.splice(f,0,d);case 2:return b.set(f,d);case 3:return b.add(d);default:return b[f]=d}case o:switch(v){case 1:return b.splice(f,1);case 2:return b.delete(f);case 3:return b.delete(p.value);default:return delete b[f]}default:J(17,M)}}),h}function N(h){if(!se(h))return h;if(dt(h))return h.map(N);if(pt(h))return new Map(Array.from(h.entries()).map(([p,S])=>[p,N(S)]));if(ht(h))return new Set(Array.from(h).map(N));const _=Object.create(Pe(h));for(const p in h)_[p]=N(h[p]);return Xe(h,Ze)&&(_[Ze]=h[Ze]),_}function g(h){return oe(h)?N(h):h}fs(Ft,{applyPatches_:y,generatePatches_:s,generateReplacementPatches_:l,getPath:t})}var st=new ws,mt=st.produce,_i=st.produceWithPatches.bind(st),wr=st.applyPatches.bind(st),Ss=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const i={};e(i)===i&&(r=!0)}catch{}if(r){let i;try{throw new Error}catch(o){({stack:i}=o)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
18
|
+
*/var qn;function Ti(){return qn||(qn=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,l){return c===l&&(c!==0||1/c===1/l)||c!==c&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=A,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,i=t.useRef,s=t.useEffect,o=t.useMemo,a=t.useDebugValue;Yt.useSyncExternalStoreWithSelector=function(c,l,f,S,C){var x=i(null);if(x.current===null){var p={hasValue:!1,value:null};x.current=p}else p=x.current;x=o(function(){function m(u){if(!O){if(O=!0,P=u,u=S(u),C!==void 0&&p.hasValue){var d=p.value;if(C(d,u))return b=d}return b=u}if(d=b,n(P,u))return d;var E=S(u);return C!==void 0&&C(d,E)?(P=u,d):(P=u,b=E)}var O=!1,P,b,g=f===void 0?null:f;return[function(){return m(l())},g===null?void 0:function(){return m(g())}]},[l,f,S,C]);var N=r(c,x[0],x[1]);return s(function(){p.hasValue=!0,p.value=N},[N]),a(N),N},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Yt}var Un;function Vi(){return Un||(Un=1,process.env.NODE_ENV==="production"?vt.exports=Ai():vt.exports=Ti()),vt.exports}var Li=Vi();function jr(e){e()}function Qi(){let e=null,t=null;return{clear(){e=null,t=null},notify(){jr(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Wn={notify(){},get:()=>[]};function $i(e,t){let n,r=Wn,i=0,s=!1;function o(N){f();const m=r.subscribe(N);let O=!1;return()=>{O||(O=!0,m(),S())}}function a(){r.notify()}function c(){p.onStateChange&&p.onStateChange()}function l(){return s}function f(){i++,n||(n=e.subscribe(c),r=Qi())}function S(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Wn)}function C(){s||(s=!0,f())}function x(){s&&(s=!1,S())}const p={addNestedSub:o,notifyNestedSubs:a,handleChangeWrapper:c,isSubscribed:l,trySubscribe:C,tryUnsubscribe:x,getListeners:()=>r};return p}var Fi=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",zi=Fi(),qi=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Ui=qi(),Wi=()=>zi||Ui?se.useLayoutEffect:se.useEffect,Bi=Wi();function Bn(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Xe(e,t){if(Bn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!Bn(e[n[i]],t[n[i]]))return!1;return!0}var Zt=Symbol.for("react-redux-context"),Jt=typeof globalThis<"u"?globalThis:{};function Hi(){if(!se.createContext)return{};const e=Jt[Zt]??(Jt[Zt]=new Map);let t=e.get(se.createContext);return t||(t=se.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(se.createContext,t)),t}var Oe=Hi();function Ki(e){const{children:t,context:n,serverState:r,store:i}=e,s=se.useMemo(()=>{const c=$i(i),l={store:i,subscription:c,getServerState:r?()=>r:void 0};if(process.env.NODE_ENV==="production")return l;{const{identityFunctionCheck:f="once",stabilityCheck:S="once"}=e;return Object.assign(l,{stabilityCheck:S,identityFunctionCheck:f})}},[i,r]),o=se.useMemo(()=>i.getState(),[i]);Bi(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,o]);const a=n||Oe;return se.createElement(a.Provider,{value:s},t)}var Gi=Ki;function Sn(e=Oe){return function(){const n=se.useContext(e);if(process.env.NODE_ENV!=="production"&&!n)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return n}}var Ir=Sn();function kr(e=Oe){const t=e===Oe?Ir:Sn(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var Pr=kr();function Yi(e=Oe){const t=e===Oe?Pr:kr(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Dr=Yi(),Zi=(e,t)=>e===t;function Ji(e=Oe){const t=e===Oe?Ir:Sn(e),n=(r,i={})=>{const{equalityFn:s=Zi}=typeof i=="function"?{equalityFn:i}:i;if(process.env.NODE_ENV!=="production"){if(!r)throw new Error("You must pass a selector to useSelector");if(typeof r!="function")throw new Error("You must pass a function as a selector to useSelector");if(typeof s!="function")throw new Error("You must pass a function as an equality function to useSelector")}const o=t(),{store:a,subscription:c,getServerState:l}=o,f=se.useRef(!0),S=se.useCallback({[r.name](x){const p=r(x);if(process.env.NODE_ENV!=="production"){const{devModeChecks:N={}}=typeof i=="function"?{}:i,{identityFunctionCheck:m,stabilityCheck:O}=o,{identityFunctionCheck:P,stabilityCheck:b}={stabilityCheck:O,identityFunctionCheck:m,...N};if(b==="always"||b==="once"&&f.current){const g=r(x);if(!s(p,g)){let u;try{throw new Error}catch(d){({stack:u}=d)}console.warn("Selector "+(r.name||"unknown")+` returned a different result when called with the same parameters. This can lead to unnecessary rerenders.
|
|
19
|
+
Selectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization`,{state:x,selected:p,selected2:g,stack:u})}}if((P==="always"||P==="once"&&f.current)&&p===x){let g;try{throw new Error}catch(u){({stack:g}=u)}console.warn("Selector "+(r.name||"unknown")+` returned the root state when called. This can lead to unnecessary rerenders.
|
|
20
|
+
Selectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.`,{stack:g})}f.current&&(f.current=!1)}return p}}[r.name],[r]),C=Li.useSyncExternalStoreWithSelector(c.addNestedSub,a.getState,l||a.getState,S,s);return se.useDebugValue(C),C};return Object.assign(n,{withTypes:()=>n}),n}var Mr=Ji(),Xi=jr;let un=null;function es(e){un=e}function ts(){if(!un)throw new Error("[mint-ai-assistant] Config not initialised. Render <MintAIAssistant /> before calling the API.");return un}const ns={placement:"bottom-right",title:"ESM Sustainability AI",welcomeMessage:"What can I help with?",defaultOpen:!1,enableExpandMode:!1},Rr=A.createContext(null);function rs({config:e,children:t}){const n=A.useMemo(()=>({...ns,...e}),[e]);return es(n),_.jsx(Rr.Provider,{value:n,children:t})}function xe(){const e=A.useContext(Rr);if(!e)throw new Error("useConfig must be used within <MintAIAssistant />");return e}function X(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var is=typeof Symbol=="function"&&Symbol.observable||"@@observable",Hn=is,Xt=()=>Math.random().toString(36).substring(7).split("").join("."),ss={INIT:`@@redux/INIT${Xt()}`,REPLACE:`@@redux/REPLACE${Xt()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Xt()}`},Me=ss;function he(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function os(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(us(e))return"date";if(cs(e))return"error";const n=as(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function as(e){return typeof e.constructor=="function"?e.constructor.name:null}function cs(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function us(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function _e(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=os(e)),t}function Ar(e,t,n){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?X(2):`Expected the root reducer to be a function. Instead, received: '${_e(e)}'`);if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?X(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?X(1):`Expected the enhancer to be a function. Instead, received: '${_e(n)}'`);return n(Ar)(e,t)}let r=e,i=t,s=new Map,o=s,a=0,c=!1;function l(){o===s&&(o=new Map,s.forEach((m,O)=>{o.set(O,m)}))}function f(){if(c)throw new Error(process.env.NODE_ENV==="production"?X(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function S(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?X(4):`Expected the listener to be a function. Instead, received: '${_e(m)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?X(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let O=!0;l();const P=a++;return o.set(P,m),function(){if(O){if(c)throw new Error(process.env.NODE_ENV==="production"?X(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");O=!1,l(),o.delete(P),s=null}}}function C(m){if(!he(m))throw new Error(process.env.NODE_ENV==="production"?X(7):`Actions must be plain objects. Instead, the actual type was: '${_e(m)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof m.type>"u")throw new Error(process.env.NODE_ENV==="production"?X(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof m.type!="string")throw new Error(process.env.NODE_ENV==="production"?X(17):`Action "type" property must be a string. Instead, the actual type was: '${_e(m.type)}'. Value was: '${m.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?X(9):"Reducers may not dispatch actions.");try{c=!0,i=r(i,m)}finally{c=!1}return(s=o).forEach(P=>{P()}),m}function x(m){if(typeof m!="function")throw new Error(process.env.NODE_ENV==="production"?X(10):`Expected the nextReducer to be a function. Instead, received: '${_e(m)}`);r=m,C({type:Me.REPLACE})}function p(){const m=S;return{subscribe(O){if(typeof O!="object"||O===null)throw new Error(process.env.NODE_ENV==="production"?X(11):`Expected the observer to be an object. Instead, received: '${_e(O)}'`);function P(){const g=O;g.next&&g.next(f())}return P(),{unsubscribe:m(P)}},[Hn](){return this}}}return C({type:Me.INIT}),{dispatch:C,subscribe:S,getState:f,replaceReducer:x,[Hn]:p}}function Kn(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function ls(e,t,n,r){const i=Object.keys(t),s=n&&n.type===Me.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!he(e))return`The ${s} has unexpected type of "${_e(e)}". Expected argument to be an object with the following keys: "${i.join('", "')}"`;const o=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!r[a]);if(o.forEach(a=>{r[a]=!0}),!(n&&n.type===Me.REPLACE)&&o.length>0)return`Unexpected ${o.length>1?"keys":"key"} "${o.join('", "')}" found in ${s}. Expected to find one of the known reducer keys instead: "${i.join('", "')}". Unexpected keys will be ignored.`}function ds(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Me.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?X(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Me.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?X(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Me.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function Tr(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const a=t[o];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&Kn(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(n[a]=e[a])}const r=Object.keys(n);let i;process.env.NODE_ENV!=="production"&&(i={});let s;try{ds(n)}catch(o){s=o}return function(a={},c){if(s)throw s;if(process.env.NODE_ENV!=="production"){const S=ls(a,n,c,i);S&&Kn(S)}let l=!1;const f={};for(let S=0;S<r.length;S++){const C=r[S],x=n[C],p=a[C],N=x(p,c);if(typeof N>"u"){const m=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?X(14):`When called with an action of type ${m?`"${String(m)}"`:"(unknown type)"}, the slice reducer for key "${C}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}f[C]=N,l=l||N!==p}return l=l||r.length!==Object.keys(a).length,l?f:a}}function kt(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function fs(...e){return t=>(n,r)=>{const i=t(n,r);let s=()=>{throw new Error(process.env.NODE_ENV==="production"?X(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const o={getState:i.getState,dispatch:(c,...l)=>s(c,...l)},a=e.map(c=>c(o));return s=kt(...a)(i.dispatch),{...i,dispatch:s}}}function Nn(e){return he(e)&&"type"in e&&typeof e.type=="string"}var _n=Symbol.for("immer-nothing"),et=Symbol.for("immer-draftable"),J=Symbol.for("immer-state"),Vr=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Z(e,...t){if(process.env.NODE_ENV!=="production"){const n=Vr[e],r=Ce(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var oe=Object,Re=oe.getPrototypeOf,rt="constructor",lt="prototype",ln="configurable",Pt="enumerable",jt="writable",it="value",ae=e=>!!e&&!!e[J];function ce(e){var t;return e?Lr(e)||ft(e)||!!e[et]||!!((t=e[rt])!=null&&t[et])||mt(e)||pt(e):!1}var ms=oe[lt][rt].toString(),Gn=new WeakMap;function Lr(e){if(!e||!ze(e))return!1;const t=Re(e);if(t===null||t===oe[lt])return!0;const n=oe.hasOwnProperty.call(t,rt)&&t[rt];if(n===Object)return!0;if(!Ce(n))return!1;let r=Gn.get(n);return r===void 0&&(r=Function.toString.call(n),Gn.set(n,r)),r===ms}function ps(e){return ae(e)||Z(15,e),e[J].base_}function dt(e,t,n=!0){Ae(e)===0?(n?Reflect.ownKeys(e):oe.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Ae(e){const t=e[J];return t?t.type_:ft(e)?1:mt(e)?2:pt(e)?3:0}var tt=(e,t,n=Ae(e))=>n===2?e.has(t):oe[lt].hasOwnProperty.call(e,t),ge=(e,t,n=Ae(e))=>n===2?e.get(t):e[t],Dt=(e,t,n,r=Ae(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function hs(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ft=Array.isArray,mt=e=>e instanceof Map,pt=e=>e instanceof Set,ze=e=>typeof e=="object",Ce=e=>typeof e=="function",en=e=>typeof e=="boolean";function ys(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var gs=e=>ze(e)?e==null?void 0:e[J]:null,be=e=>e.copy_||e.base_,Cn=e=>e.modified_?e.copy_:e.base_;function dn(e,t){if(mt(e))return new Map(e);if(pt(e))return new Set(e);if(ft(e))return Array[lt].slice.call(e);const n=Lr(e);if(t===!0||t==="class_only"&&!n){const r=oe.getOwnPropertyDescriptors(e);delete r[J];let i=Reflect.ownKeys(r);for(let s=0;s<i.length;s++){const o=i[s],a=r[o];a[jt]===!1&&(a[jt]=!0,a[ln]=!0),(a.get||a.set)&&(r[o]={[ln]:!0,[jt]:!0,[Pt]:a[Pt],[it]:e[o]})}return oe.create(Re(e),r)}else{const r=Re(e);if(r!==null&&n)return{...e};const i=oe.create(r);return oe.assign(i,e)}}function On(e,t=!1){return zt(e)||ae(e)||!ce(e)||(Ae(e)>1&&oe.defineProperties(e,{set:wt,add:wt,clear:wt,delete:wt}),oe.freeze(e),t&&dt(e,(n,r)=>{On(r,!0)},!1)),e}function bs(){Z(2)}var wt={[it]:bs};function zt(e){return e===null||!ze(e)?!0:oe.isFrozen(e)}var Mt="MapSet",Rt="Patches",Yn="ArrayMethods",At={};function Te(e){const t=At[e];return t||Z(0,e),t}var Zn=e=>!!At[e];function vs(e,t){At[e]||(At[e]=t)}var st,Qr=()=>st,ws=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Zn(Mt)?Te(Mt):void 0,arrayMethodsPlugin_:Zn(Yn)?Te(Yn):void 0});function Jn(e,t){t&&(e.patchPlugin_=Te(Rt),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function fn(e){mn(e),e.drafts_.forEach(xs),e.drafts_=null}function mn(e){e===st&&(st=e.parent_)}var Xn=e=>st=ws(st,e);function xs(e){const t=e[J];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function er(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[J].modified_&&(fn(t),Z(4)),ce(e)&&(e=tr(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[J].base_,e,t)}else e=tr(t,n);return Es(t,e,!0),fn(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_n?e:void 0}function tr(e,t){if(zt(t))return t;const n=t[J];if(!n)return Tt(t,e.handledSet_,e);if(!qt(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);zr(n,e)}return n.copy_}function Es(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&On(t,n)}function $r(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var qt=(e,t)=>e.scope_===t,Ss=[];function Fr(e,t,n,r){const i=be(e),s=e.type_;if(r!==void 0&&ge(i,r,s)===t){Dt(i,r,n,s);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;dt(i,(c,l)=>{if(ae(l)){const f=a.get(l)||[];f.push(c),a.set(l,f)}})}const o=e.draftLocations_.get(t)??Ss;for(const a of o)Dt(i,a,n,s)}function Ns(e,t,n){e.callbacks_.push(function(i){var a;const s=t;if(!s||!qt(s,i))return;(a=i.mapSetPlugin_)==null||a.fixSetContents(s);const o=Cn(s);Fr(e,s.draft_??s,o,n),zr(s,i)})}function zr(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const s=i.getPath(e);s&&i.generatePatches_(e,s,t)}$r(e)}}function _s(e,t,n){const{scope_:r}=e;if(ae(n)){const i=n[J];qt(i,r)&&i.callbacks_.push(function(){It(e);const o=Cn(i);Fr(e,n,o,t)})}else ce(n)&&e.callbacks_.push(function(){const s=be(e);e.type_===3?s.has(n)&&Tt(n,r.handledSet_,r):ge(s,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Tt(ge(e.copy_,t,e.type_),r.handledSet_,r)})}function Tt(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ae(e)||t.has(e)||!ce(e)||zt(e)||(t.add(e),dt(e,(r,i)=>{if(ae(i)){const s=i[J];if(qt(s,n)){const o=Cn(s);Dt(e,r,o,e.type_),$r(s)}}else ce(i)&&Tt(i,t,n)})),e}function Cs(e,t){const n=ft(e),r={type_:n?1:0,scope_:t?t.scope_:Qr(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,s=Vt;n&&(i=[r],s=ot);const{revoke:o,proxy:a}=Proxy.revocable(i,s);return r.draft_=a,r.revoke_=o,[a,r]}var Vt={get(e,t){if(t===J)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=be(e);if(!tt(i,t,e.type_))return Os(e,i,t);const s=i[t];if(e.finalized_||!ce(s)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&ys(t))return s;if(s===tn(e.base_,t)){It(e);const o=e.type_===1?+t:t,a=hn(e.scope_,s,e,o);return e.copy_[o]=a}return s},has(e,t){return t in be(e)},ownKeys(e){return Reflect.ownKeys(be(e))},set(e,t,n){const r=qr(be(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=tn(be(e),t),s=i==null?void 0:i[J];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(hs(n,i)&&(n!==void 0||tt(e.base_,t,e.type_)))return!0;It(e),pn(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),_s(e,t,n)),!0},deleteProperty(e,t){return It(e),tn(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),pn(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=be(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[jt]:!0,[ln]:e.type_!==1||t!=="length",[Pt]:r[Pt],[it]:n[t]}},defineProperty(){Z(11)},getPrototypeOf(e){return Re(e.base_)},setPrototypeOf(){Z(12)}},ot={};for(let e in Vt){let t=Vt[e];ot[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ot.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Z(13),ot.set.call(this,e,t,void 0)};ot.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Z(14),Vt.set.call(this,e[0],t,n,e[0])};function tn(e,t){const n=e[J];return(n?be(n):e)[t]}function Os(e,t,n){var i;const r=qr(t,n);return r?it in r?r[it]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function qr(e,t){if(!(t in e))return;let n=Re(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Re(n)}}function pn(e){e.modified_||(e.modified_=!0,e.parent_&&pn(e.parent_))}function It(e){e.copy_||(e.assigned_=new Map,e.copy_=dn(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var js=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Ce(t)&&!Ce(n)){const s=n;n=t;const o=this;return function(c=s,...l){return o.produce(c,f=>n.call(this,f,...l))}}Ce(n)||Z(6),r!==void 0&&!Ce(r)&&Z(7);let i;if(ce(t)){const s=Xn(this),o=hn(s,t,void 0);let a=!0;try{i=n(o),a=!1}finally{a?fn(s):mn(s)}return Jn(s,r),er(i,s)}else if(!t||!ze(t)){if(i=n(t),i===void 0&&(i=t),i===_n&&(i=void 0),this.autoFreeze_&&On(i,!0),r){const s=[],o=[];Te(Rt).generateReplacementPatches_(t,i,{patches_:s,inversePatches_:o}),r(s,o)}return i}else Z(1,t)},this.produceWithPatches=(t,n)=>{if(Ce(t))return(o,...a)=>this.produceWithPatches(o,c=>t(c,...a));let r,i;return[this.produce(t,n,(o,a)=>{r=o,i=a}),r,i]},en(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),en(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),en(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ce(e)||Z(8),ae(e)&&(e=Ur(e));const t=Xn(this),n=hn(t,e,void 0);return n[J].isManual_=!0,mn(t),n}finishDraft(e,t){const n=e&&e[J];(!n||!n.isManual_)&&Z(9);const{scope_:r}=n;return Jn(r,t),er(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Te(Rt).applyPatches_;return ae(e)?r(e,t):this.produce(e,i=>r(i,t))}};function hn(e,t,n,r){const[i,s]=mt(t)?Te(Mt).proxyMap_(t,n):pt(t)?Te(Mt).proxySet_(t,n):Cs(t,n);return((n==null?void 0:n.scope_)??Qr()).drafts_.push(i),s.callbacks_=(n==null?void 0:n.callbacks_)??[],s.key_=r,n&&r!==void 0?Ns(n,s,r):s.callbacks_.push(function(c){var f;(f=c.mapSetPlugin_)==null||f.fixSetContents(s);const{patchPlugin_:l}=c;s.modified_&&l&&l.generatePatches_(s,[],c)}),i}function Ur(e){return ae(e)||Z(10,e),Wr(e)}function Wr(e){if(!ce(e)||zt(e))return e;const t=e[J];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=dn(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=dn(e,!0);return dt(n,(i,s)=>{Dt(n,i,Wr(s))},r),t&&(t.finalized_=!1),n}function Is(){process.env.NODE_ENV!=="production"&&Vr.push('Sets cannot have "replace" patches.',function(p){return"Unsupported patch operation: "+p},function(p){return"Cannot apply patch, path doesn't resolve: "+p},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(p,N=[]){if(p.key_!==void 0){const m=p.parent_.copy_??p.parent_.base_,O=gs(ge(m,p.key_)),P=ge(m,p.key_);if(P===void 0||P!==p.draft_&&P!==p.base_&&P!==p.copy_||O!=null&&O.base_!==p.base_)return null;const b=p.parent_.type_===3;let g;if(b){const u=p.parent_;g=Array.from(u.drafts_.keys()).indexOf(p.key_)}else g=p.key_;if(!(b&&m.size>g||tt(m,g)))return null;N.push(g)}if(p.parent_)return t(p.parent_,N);N.reverse();try{n(p.copy_,N)}catch{return null}return N}function n(p,N){let m=p;for(let O=0;O<N.length-1;O++){const P=N[O];if(m=ge(m,P),!ze(m)||m===null)throw new Error(`Cannot resolve path at '${N.join("/")}'`)}return m}const r="replace",i="add",s="remove";function o(p,N,m){if(p.scope_.processedForPatches_.has(p))return;p.scope_.processedForPatches_.add(p);const{patches_:O,inversePatches_:P}=m;switch(p.type_){case 0:case 2:return c(p,N,O,P);case 1:return a(p,N,O,P);case 3:return l(p,N,O,P)}}function a(p,N,m,O){let{base_:P,assigned_:b}=p,g=p.copy_;g.length<P.length&&([P,g]=[g,P],[m,O]=[O,m]);const u=p.allIndicesReassigned_===!0;for(let d=0;d<P.length;d++){const E=g[d],j=P[d];if((u||(b==null?void 0:b.get(d.toString())))&&E!==j){const w=E==null?void 0:E[J];if(w&&w.modified_)continue;const h=N.concat([d]);m.push({op:r,path:h,value:x(E)}),O.push({op:r,path:h,value:x(j)})}}for(let d=P.length;d<g.length;d++){const E=N.concat([d]);m.push({op:i,path:E,value:x(g[d])})}for(let d=g.length-1;P.length<=d;--d){const E=N.concat([d]);O.push({op:s,path:E})}}function c(p,N,m,O){const{base_:P,copy_:b,type_:g}=p;dt(p.assigned_,(u,d)=>{const E=ge(P,u,g),j=ge(b,u,g),v=d?tt(P,u)?r:i:s;if(E===j&&v===r)return;const w=N.concat(u);m.push(v===s?{op:v,path:w}:{op:v,path:w,value:x(j)}),O.push(v===i?{op:s,path:w}:v===s?{op:i,path:w,value:x(E)}:{op:r,path:w,value:x(E)})})}function l(p,N,m,O){let{base_:P,copy_:b}=p,g=0;P.forEach(u=>{if(!b.has(u)){const d=N.concat([g]);m.push({op:s,path:d,value:u}),O.unshift({op:i,path:d,value:u})}g++}),g=0,b.forEach(u=>{if(!P.has(u)){const d=N.concat([g]);m.push({op:i,path:d,value:u}),O.unshift({op:s,path:d,value:u})}g++})}function f(p,N,m){const{patches_:O,inversePatches_:P}=m;O.push({op:r,path:[],value:N===_n?void 0:N}),P.push({op:r,path:[],value:p})}function S(p,N){return N.forEach(m=>{const{path:O,op:P}=m;let b=p;for(let E=0;E<O.length-1;E++){const j=Ae(b);let v=O[E];typeof v!="string"&&typeof v!="number"&&(v=""+v),(j===0||j===1)&&(v==="__proto__"||v===rt)&&Z(19),Ce(b)&&v===lt&&Z(19),b=ge(b,v),ze(b)||Z(18,O.join("/"))}const g=Ae(b),u=C(m.value),d=O[O.length-1];switch(P){case r:switch(g){case 2:return b.set(d,u);case 3:Z(16);default:return b[d]=u}case i:switch(g){case 1:return d==="-"?b.push(u):b.splice(d,0,u);case 2:return b.set(d,u);case 3:return b.add(u);default:return b[d]=u}case s:switch(g){case 1:return b.splice(d,1);case 2:return b.delete(d);case 3:return b.delete(m.value);default:return delete b[d]}default:Z(17,P)}}),p}function C(p){if(!ce(p))return p;if(ft(p))return p.map(C);if(mt(p))return new Map(Array.from(p.entries()).map(([m,O])=>[m,C(O)]));if(pt(p))return new Set(Array.from(p).map(C));const N=Object.create(Re(p));for(const m in p)N[m]=C(p[m]);return tt(p,et)&&(N[et]=p[et]),N}function x(p){return ae(p)?C(p):p}vs(Rt,{applyPatches_:S,generatePatches_:o,generateReplacementPatches_:f,getPath:t})}var at=new js,ht=at.produce,Br=at.produceWithPatches.bind(at),nr=at.applyPatches.bind(at),ks=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const i={};e(i)===i&&(r=!0)}catch{}if(r){let i;try{throw new Error}catch(s){({stack:i}=s)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
21
21
|
\`createSelector([state => state.todos], todos => todos)\`
|
|
22
22
|
This could lead to inefficient memoization and unnecessary re-renders.
|
|
23
|
-
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:i})}}},
|
|
23
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:i})}}},Ps=(e,t,n)=>{const{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:s,inputSelectorResultsCopy:o}=e,a=r(()=>({}),...i);if(!(a.apply(null,s)===a.apply(null,o))){let l;try{throw new Error}catch(f){({stack:l}=f)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
24
24
|
This means your output selector will likely run more frequently than intended.
|
|
25
25
|
Avoid returning a new reference inside your input selector, e.g.
|
|
26
|
-
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:
|
|
27
|
-
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function
|
|
26
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:o,stack:l})}},Ds={inputStabilityCheck:"once",identityFunctionCheck:"once"};function Ms(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Rs(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var rr=e=>Array.isArray(e)?e:[e];function As(e){const t=Array.isArray(e[0])?e[0]:e;return Rs(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function ir(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Ts=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...Ds,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:ks},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:Ps}}},Vs=class{constructor(e){this.value=e}deref(){return this.value}},Ls=()=>typeof WeakRef>"u"?Vs:WeakRef,Hr=Ls(),Qs=0,sr=1;function xt(){return{s:Qs,v:void 0,o:null,p:null}}function $s(e){return e instanceof Hr?e.deref():e}function Lt(e,t={}){let n=xt();const{resultEqualityCheck:r}=t;let i,s=0;function o(){let a=n;const{length:c}=arguments;for(let S=0,C=c;S<C;S++){const x=arguments[S];if(typeof x=="function"||typeof x=="object"&&x!==null){let p=a.o;p===null&&(a.o=p=new WeakMap);const N=p.get(x);N===void 0?(a=xt(),p.set(x,a)):a=N}else{let p=a.p;p===null&&(a.p=p=new Map);const N=p.get(x);N===void 0?(a=xt(),p.set(x,a)):a=N}}const l=a;let f;if(a.s===sr)f=a.v;else if(f=e.apply(null,arguments),s++,r){const S=$s(i);S!=null&&r(S,f)&&(f=S,s!==0&&s--),i=typeof f=="object"&&f!==null||typeof f=="function"?new Hr(f):f}return l.s=sr,l.v=f,f}return o.clearCache=()=>{n=xt(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function Fs(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let s=0,o=0,a,c={},l=i.pop();typeof l=="object"&&(c=l,l=i.pop()),Ms(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const f={...n,...c},{memoize:S,memoizeOptions:C=[],argsMemoize:x=Lt,argsMemoizeOptions:p=[]}=f,N=rr(C),m=rr(p),O=As(i),P=S(function(){return s++,l.apply(null,arguments)},...N);let b=!0;const g=x(function(){o++;const d=ir(O,arguments);if(a=P.apply(null,d),process.env.NODE_ENV!=="production"){const{devModeChecks:E={}}=f,{identityFunctionCheck:j,inputStabilityCheck:v}=Ts(b,E);if(j.shouldRun&&j.run(l,d,a),v.shouldRun){const w=ir(O,arguments);v.run({inputSelectorResults:d,inputSelectorResultsCopy:w},{memoize:S,memoizeOptions:N},arguments)}b&&(b=!1)}return a},...m);return Object.assign(g,{resultFunc:l,memoizedResultFunc:P,dependencies:O,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:S,argsMemoize:x})};return Object.assign(r,{withTypes:()=>r}),r}var Kr=Fs(Lt);function Gr(e){return({dispatch:n,getState:r})=>i=>s=>typeof s=="function"?s(n,r,e):i(s)}var zs=Gr(),qs=Gr,Us=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?kt:kt.apply(null,arguments)},Yr=e=>e&&typeof e.match=="function";function me(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(process.env.NODE_ENV==="production"?q(0):"prepareAction did not return an object");return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Nn(r)&&r.type===e,n}function Ws(e){return typeof e=="function"&&"type"in e&&Yr(e)}function Bs(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched.
|
|
27
|
+
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}function Hs(e={}){if(process.env.NODE_ENV==="production")return()=>n=>r=>n(r);const{isActionCreator:t=Ws}=e;return()=>n=>r=>(t(r)&&console.warn(Bs(r.type)),n(r))}function Zr(e,t){let n=0;return{measureTime(r){const i=Date.now();try{return r()}finally{const s=Date.now();n+=s-i}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms.
|
|
28
28
|
If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
|
|
29
|
-
It is disabled in production builds, so you don't need to worry about that.`)}}}var
|
|
30
|
-
Take a look at the logic that dispatched this action: `,
|
|
29
|
+
It is disabled in production builds, so you don't need to worry about that.`)}}}var Jr=class Ye extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ye.prototype)}static get[Symbol.species](){return Ye}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ye(...t[0].concat(this)):new Ye(...t.concat(this))}};function or(e){return ce(e)?ht(e,()=>{}):e}function Et(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Ks(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function Gs(e,t,n){const r=Xr(e,t,n);return{detectMutations(){return ei(e,t,r,n)}}}function Xr(e,t=[],n,r="",i=new Set){const s={value:n};if(!e(n)&&!i.has(n)){i.add(n),s.children={};const o=t.length>0;for(const a in n){const c=r?r+"."+a:a;o&&t.some(f=>f instanceof RegExp?f.test(c):c===f)||(s.children[a]=Xr(e,t,n[a],c))}}return s}function ei(e,t=[],n,r,i=!1,s=""){const o=n?n.value:void 0,a=o===r;if(i&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:s};if(e(o)||e(r))return{wasMutated:!1};const c={};for(let f in n.children)c[f]=!0;for(let f in r)c[f]=!0;const l=t.length>0;for(let f in c){const S=s?s+"."+f:f;if(l&&t.some(p=>p instanceof RegExp?p.test(S):S===p))continue;const C=ei(e,t,n.children[f],r[f],a,S);if(C.wasMutated)return C}return{wasMutated:!1}}function Ys(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{let t=function(a,c,l,f){return JSON.stringify(a,n(c,f),l)},n=function(a,c){let l=[],f=[];return c||(c=function(S,C){return l[0]===C?"[Circular ~]":"[Circular ~."+f.slice(0,l.indexOf(C)).join(".")+"]"}),function(S,C){if(l.length>0){var x=l.indexOf(this);~x?l.splice(x+1):l.push(this),~x?f.splice(x,1/0,S):f.push(S),~l.indexOf(C)&&(C=c.call(this,S,C))}else l.push(C);return a==null?C:a.call(this,S,C)}},{isImmutable:r=Ks,ignoredPaths:i,warnAfter:s=32}=e;const o=Gs.bind(null,r,i);return({getState:a})=>{let c=a(),l=o(c),f;return S=>C=>{const x=Zr(s,"ImmutableStateInvariantMiddleware");x.measureTime(()=>{if(c=a(),f=l.detectMutations(),l=o(c),f.wasMutated)throw new Error(process.env.NODE_ENV==="production"?q(19):`A state mutation was detected between dispatches, in the path '${f.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)});const p=S(C);return x.measureTime(()=>{if(c=a(),f=l.detectMutations(),l=o(c),f.wasMutated)throw new Error(process.env.NODE_ENV==="production"?q(20):`A state mutation was detected inside a dispatch, in the path: ${f.path||""}. Take a look at the reducer(s) handling the action ${t(C)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),x.warnIfExceeded(),p}}}}function ti(e){const t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||he(e)}function yn(e,t="",n=ti,r,i=[],s){let o;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||s!=null&&s.has(e))return!1;const a=r!=null?r(e):Object.entries(e),c=i.length>0;for(const[l,f]of a){const S=t?t+"."+l:l;if(!(c&&i.some(x=>x instanceof RegExp?x.test(S):S===x))){if(!n(f))return{keyPath:S,value:f};if(typeof f=="object"&&(o=yn(f,S,n,r,i,s),o))return o}}return s&&ni(e)&&s.add(e),!1}function ni(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if(!(typeof t!="object"||t===null)&&!ni(t))return!1;return!0}function Zs(e={}){if(process.env.NODE_ENV==="production")return()=>t=>n=>t(n);{const{isSerializable:t=ti,getEntries:n,ignoredActions:r=[],ignoredActionPaths:i=["meta.arg","meta.baseQueryMeta"],ignoredPaths:s=[],warnAfter:o=32,ignoreState:a=!1,ignoreActions:c=!1,disableCache:l=!1}=e,f=!l&&WeakSet?new WeakSet:void 0;return S=>C=>x=>{if(!Nn(x))return C(x);const p=C(x),N=Zr(o,"SerializableStateInvariantMiddleware");return!c&&!(r.length&&r.indexOf(x.type)!==-1)&&N.measureTime(()=>{const m=yn(x,"",t,n,i,f);if(m){const{keyPath:O,value:P}=m;console.error(`A non-serializable value was detected in an action, in the path: \`${O}\`. Value:`,P,`
|
|
30
|
+
Take a look at the logic that dispatched this action: `,x,`
|
|
31
31
|
(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
|
|
32
|
-
(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),
|
|
33
|
-
Take a look at the reducer(s) handling this action type: ${
|
|
34
|
-
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),_.warnIfExceeded()),h}}}function Ct(e){return typeof e=="boolean"}var Us=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let s=new Pi;if(n&&(Ct(n)?s.push(As):s.push(Ts(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let c={};Ct(r)||(c=r),s.unshift(qs(c))}if(i){let c={};Ct(i)||(c=i),s.push($s(c))}if(o){let c={};Ct(o)||(c=o),s.unshift(Fs(c))}}return s},Jt="RTK_autoBatch",$e=()=>e=>({payload:e,meta:{[Jt]:!0}}),_r=e=>t=>{setTimeout(t,e)},Ws=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(o),clearTimeout(s),n())},o=e(i),s=setTimeout(i,t)},Hs=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,s=!1;const c=new Set,a=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Ws(window.requestAnimationFrame,100):_r(10):e.type==="callback"?e.queueNotification:_r(e.timeout),u=()=>{s=!1,o&&(o=!1,c.forEach(l=>l()))};return Object.assign({},r,{subscribe(l){const y=()=>i&&l(),N=r.subscribe(y);return c.add(l),()=>{N(),c.delete(l)}},dispatch(l){var y;try{return i=!((y=l==null?void 0:l.meta)!=null&&y[Jt]),o=!i,o&&(s||(s=!0,a(u))),r.dispatch(l)}finally{i=!0}}})},Bs=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Pi(e);return r&&i.push(Hs(typeof r=="object"?r:void 0)),i};function Ks(e){const t=Us(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:o=!0,preloadedState:s=void 0,enhancers:c=void 0}=e||{};let a;if(typeof n=="function")a=n;else if(de(n))a=mi(n);else throw new Error(process.env.NODE_ENV==="production"?$(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?$(2):"`middleware` field must be a callback");let u;if(typeof r=="function"){if(u=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(u))throw new Error(process.env.NODE_ENV==="production"?$(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if(process.env.NODE_ENV!=="production"&&u.some(_=>typeof _!="function"))throw new Error(process.env.NODE_ENV==="production"?$(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&o){let _=new Set;u.forEach(p=>{if(_.has(p))throw new Error(process.env.NODE_ENV==="production"?$(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");_.add(p)})}let l=Tt;i&&(l=js({trace:process.env.NODE_ENV!=="production",...typeof i=="object"&&i}));const y=is(...u),N=Bs(y);if(process.env.NODE_ENV!=="production"&&c&&typeof c!="function")throw new Error(process.env.NODE_ENV==="production"?$(5):"`enhancers` field must be a callback");let g=typeof c=="function"?c(N):N();if(process.env.NODE_ENV!=="production"&&!Array.isArray(g))throw new Error(process.env.NODE_ENV==="production"?$(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&g.some(_=>typeof _!="function"))throw new Error(process.env.NODE_ENV==="production"?$(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&u.length&&!g.includes(y)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const h=l(...g);return hi(a,s,h)}function ji(e){const t={},n=[];let r;const i={addCase(o,s){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?$(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?$(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const c=typeof o=="string"?o:o.type;if(!c)throw new Error(process.env.NODE_ENV==="production"?$(28):"`builder.addCase` cannot be called with an empty action type");if(c in t)throw new Error(process.env.NODE_ENV==="production"?$(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${c}'`);return t[c]=s,i},addAsyncThunk(o,s){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?$(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return s.pending&&(t[o.pending.type]=s.pending),s.rejected&&(t[o.rejected.type]=s.rejected),s.fulfilled&&(t[o.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:o.settled,reducer:s.settled}),i},addMatcher(o,s){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?$(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:o,reducer:s}),i},addDefaultCase(o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?$(31):"`builder.addDefaultCase` can only be called once");return r=o,i}};return e(i),[t,n,r]}function Gs(e){return typeof e=="function"}function Ys(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?$(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,i]=ji(t),o;if(Gs(e))o=()=>Cr(e());else{const c=Cr(e);o=()=>c}function s(c=o(),a){let u=[n[a.type],...r.filter(({matcher:l})=>l(a)).map(({reducer:l})=>l)];return u.filter(l=>!!l).length===0&&(u=[i]),u.reduce((l,y)=>{if(y)if(oe(l)){const g=y(l,a);return g===void 0?l:g}else{if(se(l))return mt(l,N=>y(N,a));{const N=y(l,a);if(N===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return N}}return l},c)}return s.getInitialState=o,s}var Vi=(e,t)=>ki(e)?e.match(t):e(t);function ye(...e){return t=>e.some(n=>Vi(n,t))}function et(...e){return t=>e.every(n=>Vi(n,t))}function Zt(e,t){if(!e||!e.meta)return!1;const n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function yt(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function Un(...e){return e.length===0?t=>Zt(t,["pending"]):yt(e)?ye(...e.map(t=>t.pending)):Un()(e[0])}function Qe(...e){return e.length===0?t=>Zt(t,["rejected"]):yt(e)?ye(...e.map(t=>t.rejected)):Qe()(e[0])}function Xt(...e){const t=n=>n&&n.meta&&n.meta.rejectedWithValue;return e.length===0?et(Qe(...e),t):yt(e)?et(Qe(...e),t):Xt()(e[0])}function Ce(...e){return e.length===0?t=>Zt(t,["fulfilled"]):yt(e)?ye(...e.map(t=>t.fulfilled)):Ce()(e[0])}function On(...e){return e.length===0?t=>Zt(t,["pending","fulfilled","rejected"]):yt(e)?ye(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):On()(e[0])}var Js="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Wn=(e=21)=>{let t="",n=e;for(;n--;)t+=Js[Math.random()*64|0];return t},Zs=["name","message","stack","code"],fn=class{constructor(e,t){ne(this,"payload");ne(this,"meta");ne(this,"_type");this.payload=e,this.meta=t}},Nr=class{constructor(e,t){ne(this,"payload");ne(this,"meta");ne(this,"_type");this.payload=e,this.meta=t}},Xs=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of Zs)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Or="External signal was aborted",Ir=(()=>{function e(t,n,r){const i=fe(t+"/fulfilled",(a,u,l,y)=>({payload:a,meta:{...y||{},arg:l,requestId:u,requestStatus:"fulfilled"}})),o=fe(t+"/pending",(a,u,l)=>({payload:void 0,meta:{...l||{},arg:u,requestId:a,requestStatus:"pending"}})),s=fe(t+"/rejected",(a,u,l,y,N)=>({payload:y,error:(r&&r.serializeError||Xs)(a||"Rejected"),meta:{...N||{},arg:l,requestId:u,rejectedWithValue:!!y,requestStatus:"rejected",aborted:(a==null?void 0:a.name)==="AbortError",condition:(a==null?void 0:a.name)==="ConditionError"}}));function c(a,{signal:u}={}){return(l,y,N)=>{const g=r!=null&&r.idGenerator?r.idGenerator(a):Wn(),h=new AbortController;let _,p;function S(b){p=b,h.abort()}u&&(u.aborted?S(Or):u.addEventListener("abort",()=>S(Or),{once:!0}));const M=(async function(){var d,f;let b;try{let x=(d=r==null?void 0:r.condition)==null?void 0:d.call(r,a,{getState:y,extra:N});if(tc(x)&&(x=await x),x===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const O=new Promise((C,E)=>{_=()=>{E({name:"AbortError",message:p||"Aborted"})},h.signal.addEventListener("abort",_,{once:!0})});l(o(g,a,(f=r==null?void 0:r.getPendingMeta)==null?void 0:f.call(r,{requestId:g,arg:a},{getState:y,extra:N}))),b=await Promise.race([O,Promise.resolve(n(a,{dispatch:l,getState:y,extra:N,requestId:g,signal:h.signal,abort:S,rejectWithValue:((C,E)=>new fn(C,E)),fulfillWithValue:((C,E)=>new Nr(C,E))})).then(C=>{if(C instanceof fn)throw C;return C instanceof Nr?i(C.payload,g,a,C.meta):i(C,g,a)})])}catch(x){b=x instanceof fn?s(null,g,a,x.payload,x.meta):s(x,g,a)}finally{_&&h.signal.removeEventListener("abort",_)}return r&&!r.dispatchConditionRejection&&s.match(b)&&b.meta.condition||l(b),b})();return Object.assign(M,{abort:S,requestId:g,arg:a,unwrap(){return M.then(ec)}})}}return Object.assign(c,{pending:o,rejected:s,fulfilled:i,settled:ye(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function ec(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function tc(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var nc=Symbol.for("rtk-slice-createasyncthunk");function rc(e,t){return`${e}/${t}`}function ic({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[nc];return function(i){const{name:o,reducerPath:s=o}=i;if(!o)throw new Error(process.env.NODE_ENV==="production"?$(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&i.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const c=(typeof i.reducers=="function"?i.reducers(sc()):i.reducers)||{},a=Object.keys(c),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(v,d){const f=typeof v=="string"?v:v.type;if(!f)throw new Error(process.env.NODE_ENV==="production"?$(12):"`context.addCase` cannot be called with an empty action type");if(f in u.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?$(13):"`context.addCase` cannot be called with two reducers for the same action type: "+f);return u.sliceCaseReducersByType[f]=d,l},addMatcher(v,d){return u.sliceMatchers.push({matcher:v,reducer:d}),l},exposeAction(v,d){return u.actionCreators[v]=d,l},exposeCaseReducer(v,d){return u.sliceCaseReducersByName[v]=d,l}};a.forEach(v=>{const d=c[v],f={reducerName:v,type:rc(o,v),createNotation:typeof i.reducers=="function"};ac(d)?lc(f,d,l,t):cc(f,d,l)});function y(){if(process.env.NODE_ENV!=="production"&&typeof i.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?$(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[v={},d=[],f=void 0]=typeof i.extraReducers=="function"?ji(i.extraReducers):[i.extraReducers],x={...v,...u.sliceCaseReducersByType};return Ys(i.initialState,O=>{for(let C in x)O.addCase(C,x[C]);for(let C of u.sliceMatchers)O.addMatcher(C.matcher,C.reducer);for(let C of d)O.addMatcher(C.matcher,C.reducer);f&&O.addDefaultCase(f)})}const N=v=>v,g=new Map,h=new WeakMap;let _;function p(v,d){return _||(_=y()),_(v,d)}function S(){return _||(_=y()),_.getInitialState()}function M(v,d=!1){function f(O){let C=O[v];if(typeof C>"u"){if(d)C=xt(h,f,S);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?$(15):"selectSlice returned undefined for an uninjected slice reducer")}return C}function x(O=N){const C=xt(g,d,()=>new WeakMap);return xt(C,O,()=>{const E={};for(const[m,w]of Object.entries(i.selectors??{}))E[m]=oc(w,O,()=>xt(h,O,S),d);return E})}return{reducerPath:v,getSelectors:x,get selectors(){return x(f)},selectSlice:f}}const b={name:o,reducer:p,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:S,...M(s),injectInto(v,{reducerPath:d,...f}={}){const x=d??s;return v.inject({reducerPath:x,reducer:p},f),{...b,...M(x,!0)}}};return b}}function oc(e,t,n,r){function i(o,...s){let c=t(o);if(typeof c>"u"){if(r)c=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?$(16):"selectState returned undefined for an uninjected slice reducer")}return e(c,...s)}return i.unwrapped=e,i}var ke=ic();function sc(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function cc({type:e,reducerName:t,createNotation:n},r,i){let o,s;if("reducer"in r){if(n&&!uc(r))throw new Error(process.env.NODE_ENV==="production"?$(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");o=r.reducer,s=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,s?fe(e,s):fe(e))}function ac(e){return e._reducerDefinitionType==="asyncThunk"}function uc(e){return e._reducerDefinitionType==="reducerWithPrepare"}function lc({type:e,reducerName:t},n,r,i){if(!i)throw new Error(process.env.NODE_ENV==="production"?$(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:o,fulfilled:s,pending:c,rejected:a,settled:u,options:l}=n,y=i(e,o,l);r.exposeAction(t,y),s&&r.addCase(y.fulfilled,s),c&&r.addCase(y.pending,c),a&&r.addCase(y.rejected,a),u&&r.addMatcher(y.settled,u),r.exposeCaseReducer(t,{fulfilled:s||_t,pending:c||_t,rejected:a||_t,settled:u||_t})}function _t(){}function $(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var fc=class extends Error{constructor(t){super(t[0].message);ne(this,"issues");this.name="SchemaError",this.issues=t}},Li=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Li||{}),ge="uninitialized",In="pending",Ge="fulfilled",Ye="rejected";function kr(e){return{status:e,isUninitialized:e===ge,isLoading:e===In,isSuccess:e===Ge,isError:e===Ye}}var Mr=de;function Hn(e,t){if(e===t||!(Mr(e)&&Mr(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const o=Array.isArray(t)?[]:{};for(const s of n)o[s]=Hn(e[s],t[s]),i&&(i=e[s]===o[s]);return i?e:o}function kn(e,t,n){return e.reduce((r,i,o)=>(t(i,o)&&r.push(n(i,o)),r),[]).flat()}function dc(e){return new RegExp("(^|:)//").test(e)}function pc(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Bn(e){return e!=null}function Pr(e){return[...(e==null?void 0:e.values())??[]].filter(Bn)}function hc(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var mc=e=>e.replace(/\/$/,""),yc=e=>e.replace(/^\//,"");function gc(e,t){if(!e)return t;if(!t)return e;if(dc(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=mc(e),t=yc(t),`${e}${n}${t}`}function Ut(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var Mn=()=>new Map,bc=e=>{const t=new AbortController;return setTimeout(()=>{const n="signal timed out",r="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(n,r):Object.assign(new Error(n),{name:r}))},e),t.signal},vc=(...e)=>{for(const n of e)if(n.aborted)return AbortSignal.abort(n.reason);const t=new AbortController;for(const n of e)n.addEventListener("abort",()=>t.abort(n.reason),{signal:t.signal,once:!0});return t.signal},Rr=(...e)=>fetch(...e),wc=e=>e.status>=200&&e.status<=299,Ec=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Dr(e){if(!de(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}var Sc=e=>typeof e=="object"&&(de(e)||Array.isArray(e)||typeof e.toJSON=="function");function xc({baseUrl:e,prepareHeaders:t=y=>y,fetchFn:n=Rr,paramsSerializer:r,isJsonContentType:i=Ec,jsonContentType:o="application/json",jsonReplacer:s,timeout:c,responseHandler:a,validateStatus:u,...l}={}){return typeof fetch>"u"&&n===Rr&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(N,g,h)=>{const{getState:_,extra:p,endpoint:S,forced:M,type:b}=g;let v,{url:d,headers:f=new Headers(l.headers),params:x=void 0,responseHandler:O=a??"json",validateStatus:C=u??wc,timeout:E=c,...m}=typeof N=="string"?{url:N}:N,w={...l,signal:E?vc(g.signal,bc(E)):g.signal,...m};f=new Headers(Dr(f)),w.headers=await t(f,{getState:_,arg:N,extra:p,endpoint:S,forced:M,type:b,extraOptions:h})||f;const I=Sc(w.body);if(w.body!=null&&!I&&typeof w.body!="string"&&w.headers.delete("content-type"),!w.headers.has("content-type")&&I&&w.headers.set("content-type",o),I&&i(w.headers)&&(w.body=JSON.stringify(w.body,s)),w.headers.has("accept")||(O==="json"?w.headers.set("accept","application/json"):O==="text"&&w.headers.set("accept","text/plain, text/html, */*")),x){const V=~d.indexOf("?")?"&":"?",L=r?r(x):new URLSearchParams(Dr(x));d+=V+L}d=gc(e,d);const k=new Request(d,w);v={request:new Request(d,w)};let A;try{A=await n(k)}catch(V){return{error:{status:(V instanceof Error||typeof DOMException<"u"&&V instanceof DOMException)&&V.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(V)},meta:v}}const F=A.clone();v.response=F;let T,P="";try{let V;if(await Promise.all([y(A,O).then(L=>T=L,L=>V=L),F.text().then(L=>P=L,()=>{})]),V)throw V}catch(V){return{error:{status:"PARSING_ERROR",originalStatus:A.status,data:P,error:String(V)},meta:v}}return C(A,T)?{data:T,meta:v}:{error:{status:A.status,data:T},meta:v}};async function y(N,g){if(typeof g=="function")return g(N);if(g==="content-type"&&(g=i(N.headers)?"json":"text"),g==="json"){const h=await N.text();return h.length?JSON.parse(h):null}return N.text()}}var Ar=class{constructor(e,t=void 0){ne(this,"value");ne(this,"meta");this.value=e,this.meta=t}},en="__rtkq/",Cc="online",_c="offline",Fi="focused",Kn=fe(`${en}${Fi}`),Qi=fe(`${en}un${Fi}`),Gn=fe(`${en}${Cc}`),zi=fe(`${en}${_c}`),gt="query",qi="mutation",$i="infinitequery";function tn(e){return e.type===gt}function Nc(e){return e.type===qi}function bt(e){return e.type===$i}function Wt(e){return tn(e)||bt(e)}function Yn(e,t,n,r,i,o){const s=Oc(e)?e(t,n,r,i):e;return s?kn(s,Bn,c=>o(Ui(c))):[]}function Oc(e){return typeof e=="function"}function Ui(e){return typeof e=="string"?{type:e}:e}function Ic(e,t){return e.catch(t)}var ze=(e,t)=>e.endpointDefinitions[t],ct=Symbol("forceQueryFn"),Pn=e=>typeof e[ct]=="function";function kc({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:i,context:o,getInternalState:s}){const c=d=>{var f;return(f=s(d))==null?void 0:f.runningQueries},a=d=>{var f;return(f=s(d))==null?void 0:f.runningMutations},{unsubscribeQueryResult:u,removeMutationResult:l,updateSubscriptionOptions:y}=i.internalActions;return{buildInitiateQuery:M,buildInitiateInfiniteQuery:b,buildInitiateMutation:v,getRunningQueryThunk:N,getRunningMutationThunk:g,getRunningQueriesThunk:h,getRunningMutationsThunk:_};function N(d,f){return x=>{var E;const O=ze(o,d),C=e({queryArgs:f,endpointDefinition:O,endpointName:d});return(E=c(x))==null?void 0:E.get(C)}}function g(d,f){return x=>{var O;return(O=a(x))==null?void 0:O.get(f)}}function h(){return d=>Pr(c(d))}function _(){return d=>Pr(a(d))}function p(d){if(process.env.NODE_ENV!=="production"){if(p.triggered)return;const f=d(i.internalActions.internal_getRTKQSubscriptions());if(p.triggered=!0,typeof f!="object"||typeof(f==null?void 0:f.type)=="string")throw new Error(process.env.NODE_ENV==="production"?$(34):`Warning: Middleware for RTK-Query API at reducerPath "${i.reducerPath}" has not been added to the store.
|
|
35
|
-
You must add the middleware for RTK-Query to function correctly!`)}}function
|
|
36
|
-
${
|
|
32
|
+
(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),a||(N.measureTime(()=>{const m=S.getState(),O=yn(m,"",t,n,s,f);if(O){const{keyPath:P,value:b}=O;console.error(`A non-serializable value was detected in the state, in the path: \`${P}\`. Value:`,b,`
|
|
33
|
+
Take a look at the reducer(s) handling this action type: ${x.type}.
|
|
34
|
+
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),N.warnIfExceeded()),p}}}function St(e){return typeof e=="boolean"}var Js=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let o=new Jr;if(n&&(St(n)?o.push(zs):o.push(qs(n.extraArgument))),process.env.NODE_ENV!=="production"){if(r){let a={};St(r)||(a=r),o.unshift(Ys(a))}if(i){let a={};St(i)||(a=i),o.push(Zs(a))}if(s){let a={};St(s)||(a=s),o.unshift(Hs(a))}}return o},Ut="RTK_autoBatch",He=()=>e=>({payload:e,meta:{[Ut]:!0}}),ar=e=>t=>{setTimeout(t,e)},Xs=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(s),clearTimeout(o),n())},s=e(i),o=setTimeout(i,t)},eo=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,s=!1,o=!1;const a=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Xs(window.requestAnimationFrame,100):ar(10):e.type==="callback"?e.queueNotification:ar(e.timeout),l=()=>{o=!1,s&&(s=!1,a.forEach(f=>f()))};return Object.assign({},r,{subscribe(f){const S=()=>i&&f(),C=r.subscribe(S);return a.add(f),()=>{C(),a.delete(f)}},dispatch(f){var S;try{return i=!((S=f==null?void 0:f.meta)!=null&&S[Ut]),s=!i,s&&(o||(o=!0,c(l))),r.dispatch(f)}finally{i=!0}}})},to=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Jr(e);return r&&i.push(eo(typeof r=="object"?r:void 0)),i};function no(e){const t=Js(),{reducer:n=void 0,middleware:r,devTools:i=!0,duplicateMiddlewareCheck:s=!0,preloadedState:o=void 0,enhancers:a=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(he(n))c=Tr(n);else throw new Error(process.env.NODE_ENV==="production"?q(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&r&&typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?q(2):"`middleware` field must be a callback");let l;if(typeof r=="function"){if(l=r(t),process.env.NODE_ENV!=="production"&&!Array.isArray(l))throw new Error(process.env.NODE_ENV==="production"?q(3):"when using a middleware builder function, an array of middleware must be returned")}else l=t();if(process.env.NODE_ENV!=="production"&&l.some(N=>typeof N!="function"))throw new Error(process.env.NODE_ENV==="production"?q(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&s){let N=new Set;l.forEach(m=>{if(N.has(m))throw new Error(process.env.NODE_ENV==="production"?q(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");N.add(m)})}let f=kt;i&&(f=Us({trace:process.env.NODE_ENV!=="production",...typeof i=="object"&&i}));const S=fs(...l),C=to(S);if(process.env.NODE_ENV!=="production"&&a&&typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?q(5):"`enhancers` field must be a callback");let x=typeof a=="function"?a(C):C();if(process.env.NODE_ENV!=="production"&&!Array.isArray(x))throw new Error(process.env.NODE_ENV==="production"?q(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&x.some(N=>typeof N!="function"))throw new Error(process.env.NODE_ENV==="production"?q(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&l.length&&!x.includes(S)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const p=f(...x);return Ar(c,o,p)}function ri(e){const t={},n=[];let r;const i={addCase(s,o){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?q(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error(process.env.NODE_ENV==="production"?q(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const a=typeof s=="string"?s:s.type;if(!a)throw new Error(process.env.NODE_ENV==="production"?q(28):"`builder.addCase` cannot be called with an empty action type");if(a in t)throw new Error(process.env.NODE_ENV==="production"?q(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${a}'`);return t[a]=o,i},addAsyncThunk(s,o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?q(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return o.pending&&(t[s.pending.type]=o.pending),o.rejected&&(t[s.rejected.type]=o.rejected),o.fulfilled&&(t[s.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:s.settled,reducer:o.settled}),i},addMatcher(s,o){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?q(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:s,reducer:o}),i},addDefaultCase(s){if(process.env.NODE_ENV!=="production"&&r)throw new Error(process.env.NODE_ENV==="production"?q(31):"`builder.addDefaultCase` can only be called once");return r=s,i}};return e(i),[t,n,r]}function ro(e){return typeof e=="function"}function io(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?q(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,r,i]=ri(t),s;if(ro(e))s=()=>or(e());else{const a=or(e);s=()=>a}function o(a=s(),c){let l=[n[c.type],...r.filter(({matcher:f})=>f(c)).map(({reducer:f})=>f)];return l.filter(f=>!!f).length===0&&(l=[i]),l.reduce((f,S)=>{if(S)if(ae(f)){const x=S(f,c);return x===void 0?f:x}else{if(ce(f))return ht(f,C=>S(C,c));{const C=S(f,c);if(C===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}}return f},a)}return o.getInitialState=s,o}var ii=(e,t)=>Yr(e)?e.match(t):e(t);function ve(...e){return t=>e.some(n=>ii(n,t))}function nt(...e){return t=>e.every(n=>ii(n,t))}function Wt(e,t){if(!e||!e.meta)return!1;const n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function yt(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function jn(...e){return e.length===0?t=>Wt(t,["pending"]):yt(e)?ve(...e.map(t=>t.pending)):jn()(e[0])}function qe(...e){return e.length===0?t=>Wt(t,["rejected"]):yt(e)?ve(...e.map(t=>t.rejected)):qe()(e[0])}function Bt(...e){const t=n=>n&&n.meta&&n.meta.rejectedWithValue;return e.length===0?nt(qe(...e),t):yt(e)?nt(qe(...e),t):Bt()(e[0])}function je(...e){return e.length===0?t=>Wt(t,["fulfilled"]):yt(e)?ve(...e.map(t=>t.fulfilled)):je()(e[0])}function gn(...e){return e.length===0?t=>Wt(t,["pending","fulfilled","rejected"]):yt(e)?ve(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):gn()(e[0])}var so="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",In=(e=21)=>{let t="",n=e;for(;n--;)t+=so[Math.random()*64|0];return t},oo=["name","message","stack","code"],nn=class{constructor(e,t){re(this,"payload");re(this,"meta");re(this,"_type");this.payload=e,this.meta=t}},cr=class{constructor(e,t){re(this,"payload");re(this,"meta");re(this,"_type");this.payload=e,this.meta=t}},ao=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of oo)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},ur="External signal was aborted",lr=(()=>{function e(t,n,r){const i=me(t+"/fulfilled",(c,l,f,S)=>({payload:c,meta:{...S||{},arg:f,requestId:l,requestStatus:"fulfilled"}})),s=me(t+"/pending",(c,l,f)=>({payload:void 0,meta:{...f||{},arg:l,requestId:c,requestStatus:"pending"}})),o=me(t+"/rejected",(c,l,f,S,C)=>({payload:S,error:(r&&r.serializeError||ao)(c||"Rejected"),meta:{...C||{},arg:f,requestId:l,rejectedWithValue:!!S,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"}}));function a(c,{signal:l}={}){return(f,S,C)=>{const x=r!=null&&r.idGenerator?r.idGenerator(c):In(),p=new AbortController;let N,m;function O(b){m=b,p.abort()}l&&(l.aborted?O(ur):l.addEventListener("abort",()=>O(ur),{once:!0}));const P=(async function(){var u,d;let b;try{let E=(u=r==null?void 0:r.condition)==null?void 0:u.call(r,c,{getState:S,extra:C});if(uo(E)&&(E=await E),E===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const j=new Promise((v,w)=>{N=()=>{w({name:"AbortError",message:m||"Aborted"})},p.signal.addEventListener("abort",N,{once:!0})});f(s(x,c,(d=r==null?void 0:r.getPendingMeta)==null?void 0:d.call(r,{requestId:x,arg:c},{getState:S,extra:C}))),b=await Promise.race([j,Promise.resolve(n(c,{dispatch:f,getState:S,extra:C,requestId:x,signal:p.signal,abort:O,rejectWithValue:((v,w)=>new nn(v,w)),fulfillWithValue:((v,w)=>new cr(v,w))})).then(v=>{if(v instanceof nn)throw v;return v instanceof cr?i(v.payload,x,c,v.meta):i(v,x,c)})])}catch(E){b=E instanceof nn?o(null,x,c,E.payload,E.meta):o(E,x,c)}finally{N&&p.signal.removeEventListener("abort",N)}return r&&!r.dispatchConditionRejection&&o.match(b)&&b.meta.condition||f(b),b})();return Object.assign(P,{abort:O,requestId:x,arg:c,unwrap(){return P.then(co)}})}}return Object.assign(a,{pending:s,rejected:o,fulfilled:i,settled:ve(o,i),typePrefix:t})}return e.withTypes=()=>e,e})();function co(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function uo(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var lo=Symbol.for("rtk-slice-createasyncthunk");function fo(e,t){return`${e}/${t}`}function mo({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[lo];return function(i){const{name:s,reducerPath:o=s}=i;if(!s)throw new Error(process.env.NODE_ENV==="production"?q(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&i.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const a=(typeof i.reducers=="function"?i.reducers(ho()):i.reducers)||{},c=Object.keys(a),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(g,u){const d=typeof g=="string"?g:g.type;if(!d)throw new Error(process.env.NODE_ENV==="production"?q(12):"`context.addCase` cannot be called with an empty action type");if(d in l.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?q(13):"`context.addCase` cannot be called with two reducers for the same action type: "+d);return l.sliceCaseReducersByType[d]=u,f},addMatcher(g,u){return l.sliceMatchers.push({matcher:g,reducer:u}),f},exposeAction(g,u){return l.actionCreators[g]=u,f},exposeCaseReducer(g,u){return l.sliceCaseReducersByName[g]=u,f}};c.forEach(g=>{const u=a[g],d={reducerName:g,type:fo(s,g),createNotation:typeof i.reducers=="function"};go(u)?vo(d,u,f,t):yo(d,u,f)});function S(){if(process.env.NODE_ENV!=="production"&&typeof i.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?q(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[g={},u=[],d=void 0]=typeof i.extraReducers=="function"?ri(i.extraReducers):[i.extraReducers],E={...g,...l.sliceCaseReducersByType};return io(i.initialState,j=>{for(let v in E)j.addCase(v,E[v]);for(let v of l.sliceMatchers)j.addMatcher(v.matcher,v.reducer);for(let v of u)j.addMatcher(v.matcher,v.reducer);d&&j.addDefaultCase(d)})}const C=g=>g,x=new Map,p=new WeakMap;let N;function m(g,u){return N||(N=S()),N(g,u)}function O(){return N||(N=S()),N.getInitialState()}function P(g,u=!1){function d(j){let v=j[g];if(typeof v>"u"){if(u)v=Et(p,d,O);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?q(15):"selectSlice returned undefined for an uninjected slice reducer")}return v}function E(j=C){const v=Et(x,u,()=>new WeakMap);return Et(v,j,()=>{const w={};for(const[h,y]of Object.entries(i.selectors??{}))w[h]=po(y,j,()=>Et(p,j,O),u);return w})}return{reducerPath:g,getSelectors:E,get selectors(){return E(d)},selectSlice:d}}const b={name:s,reducer:m,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:O,...P(o),injectInto(g,{reducerPath:u,...d}={}){const E=u??o;return g.inject({reducerPath:E,reducer:m},d),{...b,...P(E,!0)}}};return b}}function po(e,t,n,r){function i(s,...o){let a=t(s);if(typeof a>"u"){if(r)a=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?q(16):"selectState returned undefined for an uninjected slice reducer")}return e(a,...o)}return i.unwrapped=e,i}var De=mo();function ho(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function yo({type:e,reducerName:t,createNotation:n},r,i){let s,o;if("reducer"in r){if(n&&!bo(r))throw new Error(process.env.NODE_ENV==="production"?q(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");s=r.reducer,o=r.prepare}else s=r;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,o?me(e,o):me(e))}function go(e){return e._reducerDefinitionType==="asyncThunk"}function bo(e){return e._reducerDefinitionType==="reducerWithPrepare"}function vo({type:e,reducerName:t},n,r,i){if(!i)throw new Error(process.env.NODE_ENV==="production"?q(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:s,fulfilled:o,pending:a,rejected:c,settled:l,options:f}=n,S=i(e,s,f);r.exposeAction(t,S),o&&r.addCase(S.fulfilled,o),a&&r.addCase(S.pending,a),c&&r.addCase(S.rejected,c),l&&r.addMatcher(S.settled,l),r.exposeCaseReducer(t,{fulfilled:o||Nt,pending:a||Nt,rejected:c||Nt,settled:l||Nt})}function Nt(){}function q(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var wo=class extends Error{constructor(t){super(t[0].message);re(this,"issues");this.name="SchemaError",this.issues=t}},si=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(si||{}),we="uninitialized",bn="pending",Ze="fulfilled",Je="rejected";function dr(e){return{status:e,isUninitialized:e===we,isLoading:e===bn,isSuccess:e===Ze,isError:e===Je}}var fr=he;function kn(e,t){if(e===t||!(fr(e)&&fr(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let i=n.length===r.length;const s=Array.isArray(t)?[]:{};for(const o of n)s[o]=kn(e[o],t[o]),i&&(i=e[o]===s[o]);return i?e:s}function vn(e,t,n){return e.reduce((r,i,s)=>(t(i,s)&&r.push(n(i,s)),r),[]).flat()}function xo(e){return new RegExp("(^|:)//").test(e)}function Eo(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Pn(e){return e!=null}function mr(e){return[...(e==null?void 0:e.values())??[]].filter(Pn)}function So(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var No=e=>e.replace(/\/$/,""),_o=e=>e.replace(/^\//,"");function Co(e,t){if(!e)return t;if(!t)return e;if(xo(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=No(e),t=_o(t),`${e}${n}${t}`}function Qt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var wn=()=>new Map,Oo=e=>{const t=new AbortController;return setTimeout(()=>{const n="signal timed out",r="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(n,r):Object.assign(new Error(n),{name:r}))},e),t.signal},jo=(...e)=>{for(const n of e)if(n.aborted)return AbortSignal.abort(n.reason);const t=new AbortController;for(const n of e)n.addEventListener("abort",()=>t.abort(n.reason),{signal:t.signal,once:!0});return t.signal},pr=(...e)=>fetch(...e),Io=e=>e.status>=200&&e.status<=299,ko=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function hr(e){if(!he(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}var Po=e=>typeof e=="object"&&(he(e)||Array.isArray(e)||typeof e.toJSON=="function");function Do({baseUrl:e,prepareHeaders:t=S=>S,fetchFn:n=pr,paramsSerializer:r,isJsonContentType:i=ko,jsonContentType:s="application/json",jsonReplacer:o,timeout:a,responseHandler:c,validateStatus:l,...f}={}){return typeof fetch>"u"&&n===pr&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(C,x,p)=>{const{getState:N,extra:m,endpoint:O,forced:P,type:b}=x;let g,{url:u,headers:d=new Headers(f.headers),params:E=void 0,responseHandler:j=c??"json",validateStatus:v=l??Io,timeout:w=a,...h}=typeof C=="string"?{url:C}:C,y={...f,signal:w?jo(x.signal,Oo(w)):x.signal,...h};d=new Headers(hr(d)),y.headers=await t(d,{getState:N,arg:C,extra:m,endpoint:O,forced:P,type:b,extraOptions:p})||d;const I=Po(y.body);if(y.body!=null&&!I&&typeof y.body!="string"&&y.headers.delete("content-type"),!y.headers.has("content-type")&&I&&y.headers.set("content-type",s),I&&i(y.headers)&&(y.body=JSON.stringify(y.body,o)),y.headers.has("accept")||(j==="json"?y.headers.set("accept","application/json"):j==="text"&&y.headers.set("accept","text/plain, text/html, */*")),E){const V=~u.indexOf("?")?"&":"?",L=r?r(E):new URLSearchParams(hr(E));u+=V+L}u=Co(e,u);const k=new Request(u,y);g={request:new Request(u,y)};let R;try{R=await n(k)}catch(V){return{error:{status:(V instanceof Error||typeof DOMException<"u"&&V instanceof DOMException)&&V.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(V)},meta:g}}const Q=R.clone();g.response=Q;let T,D="";try{let V;if(await Promise.all([S(R,j).then(L=>T=L,L=>V=L),Q.text().then(L=>D=L,()=>{})]),V)throw V}catch(V){return{error:{status:"PARSING_ERROR",originalStatus:R.status,data:D,error:String(V)},meta:g}}return v(R,T)?{data:T,meta:g}:{error:{status:R.status,data:T},meta:g}};async function S(C,x){if(typeof x=="function")return x(C);if(x==="content-type"&&(x=i(C.headers)?"json":"text"),x==="json"){const p=await C.text();return p.length?JSON.parse(p):null}return C.text()}}var yr=class{constructor(e,t=void 0){re(this,"value");re(this,"meta");this.value=e,this.meta=t}},Ht="__rtkq/",Mo="online",Ro="offline",oi="focused",Dn=me(`${Ht}${oi}`),ai=me(`${Ht}un${oi}`),Mn=me(`${Ht}${Mo}`),ci=me(`${Ht}${Ro}`),gt="query",ui="mutation",li="infinitequery";function Kt(e){return e.type===gt}function Ao(e){return e.type===ui}function bt(e){return e.type===li}function $t(e){return Kt(e)||bt(e)}function Rn(e,t,n,r,i,s){const o=To(e)?e(t,n,r,i):e;return o?vn(o,Pn,a=>s(di(a))):[]}function To(e){return typeof e=="function"}function di(e){return typeof e=="string"?{type:e}:e}function Vo(e,t){return e.catch(t)}var Ue=(e,t)=>e.endpointDefinitions[t],ct=Symbol("forceQueryFn"),xn=e=>typeof e[ct]=="function";function Lo({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:i,context:s,getInternalState:o}){const a=u=>{var d;return(d=o(u))==null?void 0:d.runningQueries},c=u=>{var d;return(d=o(u))==null?void 0:d.runningMutations},{unsubscribeQueryResult:l,removeMutationResult:f,updateSubscriptionOptions:S}=i.internalActions;return{buildInitiateQuery:P,buildInitiateInfiniteQuery:b,buildInitiateMutation:g,getRunningQueryThunk:C,getRunningMutationThunk:x,getRunningQueriesThunk:p,getRunningMutationsThunk:N};function C(u,d){return E=>{var w;const j=Ue(s,u),v=e({queryArgs:d,endpointDefinition:j,endpointName:u});return(w=a(E))==null?void 0:w.get(v)}}function x(u,d){return E=>{var j;return(j=c(E))==null?void 0:j.get(d)}}function p(){return u=>mr(a(u))}function N(){return u=>mr(c(u))}function m(u){if(process.env.NODE_ENV!=="production"){if(m.triggered)return;const d=u(i.internalActions.internal_getRTKQSubscriptions());if(m.triggered=!0,typeof d!="object"||typeof(d==null?void 0:d.type)=="string")throw new Error(process.env.NODE_ENV==="production"?q(34):`Warning: Middleware for RTK-Query API at reducerPath "${i.reducerPath}" has not been added to the store.
|
|
35
|
+
You must add the middleware for RTK-Query to function correctly!`)}}function O(u,d){const E=(j,{subscribe:v=!0,forceRefetch:w,subscriptionOptions:h,[ct]:y,...I}={})=>(k,M)=>{var W;const R=e({queryArgs:j,endpointDefinition:d,endpointName:u});let Q;const T={...I,type:gt,subscribe:v,forceRefetch:w,subscriptionOptions:h,endpointName:u,originalArgs:j,queryCacheKey:R,[ct]:y};if(Kt(d))Q=t(T);else{const{direction:F,initialPageParam:ee,refetchCachedPages:U}=I;Q=n({...T,direction:F,initialPageParam:ee,refetchCachedPages:U})}const D=i.endpoints[u].select(j),V=k(Q),L=D(M());m(k);const{requestId:B,abort:K}=V,H=L.requestId!==B,Y=(W=a(k))==null?void 0:W.get(R),G=()=>D(M()),$=Object.assign(y?V.then(G):H&&!Y?Promise.resolve(L):Promise.all([Y,V]).then(G),{arg:j,requestId:B,subscriptionOptions:h,queryCacheKey:R,abort:K,async unwrap(){const F=await $;if(F.isError)throw F.error;return F.data},refetch:F=>k(E(j,{subscribe:!1,forceRefetch:!0,...F})),unsubscribe(){v&&k(l({queryCacheKey:R,requestId:B}))},updateSubscriptionOptions(F){$.subscriptionOptions=F,k(S({endpointName:u,requestId:B,queryCacheKey:R,options:F}))}});if(!Y&&!H&&!y){const F=a(k);F.set(R,$),$.then(()=>{F.delete(R)})}return $};return E}function P(u,d){return O(u,d)}function b(u,d){return O(u,d)}function g(u){return(d,{track:E=!0,fixedCacheKey:j}={})=>(v,w)=>{const h=r({type:"mutation",endpointName:u,originalArgs:d,track:E,fixedCacheKey:j}),y=v(h);m(v);const{requestId:I,abort:k,unwrap:M}=y,R=Vo(y.unwrap().then(V=>({data:V})),V=>({error:V})),Q=()=>{v(f({requestId:I,fixedCacheKey:j}))},T=Object.assign(R,{arg:y.arg,requestId:I,abort:k,unwrap:M,reset:Q}),D=c(v);return D.set(I,T),T.then(()=>{D.delete(I)}),j&&(D.set(j,T),T.then(()=>{D.get(j)===T&&D.delete(j)})),T}}}var fi=class extends wo{constructor(t,n,r,i){super(t);re(this,"value");re(this,"schemaName");re(this,"_bqMeta");this.value=n,this.schemaName=r,this._bqMeta=i}},ke=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function Pe(e,t,n,r){const i=await e["~standard"].validate(t);if(i.issues)throw new fi(i.issues,t,n,r);return i.value}function gr(e){return e}var Ke=(e={})=>({...e,[Ut]:!0});function Qo({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:i,assertTagType:s,selectors:o,onSchemaFailure:a,catchSchemaFailure:c,skipSchemaValidation:l}){const f=(h,y,I,k)=>(M,R)=>{const Q=n[h],T=r({queryArgs:y,endpointDefinition:Q,endpointName:h});if(M(i.internalActions.queryResultPatched({queryCacheKey:T,patches:I})),!k)return;const D=i.endpoints[h].select(y)(R()),V=Rn(Q.providesTags,D.data,void 0,y,{},s);M(i.internalActions.updateProvidedBy([{queryCacheKey:T,providedTags:V}]))};function S(h,y,I=0){const k=[y,...h];return I&&k.length>I?k.slice(0,-1):k}function C(h,y,I=0){const k=[...h,y];return I&&k.length>I?k.slice(1):k}const x=(h,y,I,k=!0)=>(M,R)=>{const T=i.endpoints[h].select(y)(R()),D={patches:[],inversePatches:[],undo:()=>M(i.util.patchQueryData(h,y,D.inversePatches,k))};if(T.status===we)return D;let V;if("data"in T)if(ce(T.data)){const[L,B,K]=Br(T.data,I);D.patches.push(...B),D.inversePatches.push(...K),V=L}else V=I(T.data),D.patches.push({op:"replace",path:[],value:V}),D.inversePatches.push({op:"replace",path:[],value:T.data});return D.patches.length===0||M(i.util.patchQueryData(h,y,D.patches,k)),D},p=(h,y,I)=>k=>k(i.endpoints[h].initiate(y,{subscribe:!1,forceRefetch:!0,[ct]:()=>({data:I})})),N=(h,y)=>h.query&&h[y]?h[y]:gr,m=async(h,{signal:y,abort:I,rejectWithValue:k,fulfillWithValue:M,dispatch:R,getState:Q,extra:T})=>{var K,H;const D=n[h.endpointName],{metaSchema:V,skipSchemaValidation:L=l}=D,B=h.type===gt;try{let Y=gr;const G={signal:y,abort:I,dispatch:R,getState:Q,extra:T,endpoint:h.endpointName,type:h.type,forced:B?O(h,Q()):void 0,queryCacheKey:B?h.queryCacheKey:void 0},$=B?h[ct]:void 0;let W;const F=async(U,z,Ee,ne)=>{if(z==null&&U.pages.length)return Promise.resolve({data:U});const Le={queryArg:h.originalArgs,pageParam:z},de=await ee(Le),Qe=ne?S:C;return{data:{pages:Qe(U.pages,de.data,Ee),pageParams:Qe(U.pageParams,z,Ee)},meta:de.meta}};async function ee(U){let z;const{extraOptions:Ee,argSchema:ne,rawResponseSchema:Le,responseSchema:de}=D;if(ne&&!ke(L,"arg")&&(U=await Pe(ne,U,"argSchema",{})),$?z=$():D.query?(Y=N(D,"transformResponse"),z=await t(D.query(U),G,Ee)):z=await D.queryFn(U,G,Ee,ue=>t(ue,G,Ee)),typeof process<"u"&&process.env.NODE_ENV==="development"){const ue=D.query?"`baseQuery`":"`queryFn`";let fe;if(!z)fe=`${ue} did not return anything.`;else if(typeof z!="object")fe=`${ue} did not return an object.`;else if(z.error&&z.data)fe=`${ue} returned an object containing both \`error\` and \`result\`.`;else if(z.error===void 0&&z.data===void 0)fe=`${ue} returned an object containing neither a valid \`error\` and \`result\`. At least one of them should not be \`undefined\``;else for(const Ne of Object.keys(z))if(Ne!=="error"&&Ne!=="data"&&Ne!=="meta"){fe=`The object returned by ${ue} has the unknown property ${Ne}.`;break}fe&&console.error(`Error encountered handling the endpoint ${h.endpointName}.
|
|
36
|
+
${fe}
|
|
37
37
|
It needs to return an object with either the shape \`{ data: <value> }\` or \`{ error: <value> }\` that may contain an optional \`meta\` property.
|
|
38
|
-
Object returned was:`,
|
|
39
|
-
In the case of an unhandled error, no tags will be "provided" or "invalidated".`,G):console.error(G),G}};function S(m,w){const I=s.selectQueryEntry(w,m.queryCacheKey),k=s.selectConfig(w).refetchOnMountOrArgChange,D=I==null?void 0:I.fulfilledTimeStamp,A=m.forceRefetch??(m.subscribe&&k);return A?A===!0||(Number(new Date)-Number(D))/1e3>=A:!1}const M=()=>Ir(`${e}/executeQuery`,p,{getPendingMeta({arg:w}){const I=n[w.endpointName];return Ue({startedTimeStamp:Date.now(),...bt(I)?{direction:w.direction}:{}})},condition(w,{getState:I}){var L;const k=I(),D=s.selectQueryEntry(k,w.queryCacheKey),A=D==null?void 0:D.fulfilledTimeStamp,F=w.originalArgs,T=D==null?void 0:D.originalArgs,P=n[w.endpointName],V=w.direction;return Pn(w)?!0:(D==null?void 0:D.status)==="pending"?!1:S(w,k)||tn(P)&&((L=P==null?void 0:P.forceRefetch)!=null&&L.call(P,{currentArg:F,previousArg:T,endpointState:D,state:k}))?!0:!(A&&!V)},dispatchConditionRejection:!0}),b=M(),v=M(),d=Ir(`${e}/executeMutation`,p,{getPendingMeta(){return Ue({startedTimeStamp:Date.now()})}}),f=m=>"force"in m,x=m=>"ifOlderThan"in m,O=(m,w,I={})=>(k,D)=>{const A=f(I)&&I.force,F=x(I)&&I.ifOlderThan,T=(V=!0)=>{const L={forceRefetch:V,subscribe:!1};return i.endpoints[m].initiate(w,L)},P=i.endpoints[m].select(w)(D());if(A)k(T());else if(F){const V=P==null?void 0:P.fulfilledTimeStamp;if(!V){k(T());return}(Number(new Date)-Number(new Date(V)))/1e3>=F&&k(T())}else k(T(!1))};function C(m){return w=>{var I,k;return((k=(I=w==null?void 0:w.meta)==null?void 0:I.arg)==null?void 0:k.endpointName)===m}}function E(m,w){return{matchPending:et(Un(m),C(w)),matchFulfilled:et(Ce(m),C(w)),matchRejected:et(Qe(m),C(w))}}return{queryThunk:b,mutationThunk:d,infiniteQueryThunk:v,prefetch:O,updateQueryData:g,upsertQueryData:h,patchQueryData:l,buildMatchThunkActions:E}}function Rn(e,{pages:t,pageParams:n},r){const i=t.length-1;return e.getNextPageParam(t[i],t,n[i],n,r)}function Hi(e,{pages:t,pageParams:n},r){var i;return(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n,r)}function Bi(e,t,n,r){return Yn(n[e.meta.arg.endpointName][t],Ce(e)?e.payload:void 0,Xt(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function jr(e){return oe(e)?xi(e):e}function Nt(e,t,n){const r=e[t];r&&n(r)}function at(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Vr(e,t,n){const r=e[at(t)];r&&n(r)}var Ot={};function Pc({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:i,apiUid:o,extractRehydrationInfo:s,hasRehydrationInfo:c},assertTagType:a,config:u}){const l=fe(`${e}/resetApiState`);function y(C,E,m,w){var I;C[I=E.queryCacheKey]??(C[I]={status:ge,endpointName:E.endpointName}),Nt(C,E.queryCacheKey,k=>{k.status=In,k.requestId=m&&k.requestId?k.requestId:w.requestId,E.originalArgs!==void 0&&(k.originalArgs=E.originalArgs),k.startedTimeStamp=w.startedTimeStamp;const D=i[w.arg.endpointName];bt(D)&&"direction"in E&&(k.direction=E.direction)})}function N(C,E,m,w){Nt(C,E.arg.queryCacheKey,I=>{if(I.requestId!==E.requestId&&!w)return;const{merge:k}=i[E.arg.endpointName];if(I.status=Ge,k)if(I.data!==void 0){const{fulfilledTimeStamp:D,arg:A,baseQueryMeta:F,requestId:T}=E;let P=mt(I.data,V=>k(V,m,{arg:A.originalArgs,baseQueryMeta:F,fulfilledTimeStamp:D,requestId:T}));I.data=P}else I.data=m;else I.data=i[E.arg.endpointName].structuralSharing??!0?Hn(oe(I.data)?ss(I.data):I.data,m):m;delete I.error,I.fulfilledTimeStamp=E.fulfilledTimeStamp})}const g=ke({name:`${e}/queries`,initialState:Ot,reducers:{removeQueryResult:{reducer(C,{payload:{queryCacheKey:E}}){delete C[E]},prepare:$e()},cacheEntriesUpserted:{reducer(C,E){for(const m of E.payload){const{queryDescription:w,value:I}=m;y(C,w,!0,{arg:w,requestId:E.meta.requestId,startedTimeStamp:E.meta.timestamp}),N(C,{arg:w,requestId:E.meta.requestId,fulfilledTimeStamp:E.meta.timestamp,baseQueryMeta:{}},I,!0)}},prepare:C=>({payload:C.map(w=>{const{endpointName:I,arg:k,value:D}=w,A=i[I];return{queryDescription:{type:gt,endpointName:I,originalArgs:w.arg,queryCacheKey:r({queryArgs:k,endpointDefinition:A,endpointName:I})},value:D}}),meta:{[Jt]:!0,requestId:Wn(),timestamp:Date.now()}})},queryResultPatched:{reducer(C,{payload:{queryCacheKey:E,patches:m}}){Nt(C,E,w=>{w.data=wr(w.data,m.concat())})},prepare:$e()}},extraReducers(C){C.addCase(t.pending,(E,{meta:m,meta:{arg:w}})=>{const I=Pn(w);y(E,w,I,m)}).addCase(t.fulfilled,(E,{meta:m,payload:w})=>{const I=Pn(m.arg);N(E,m,w,I)}).addCase(t.rejected,(E,{meta:{condition:m,arg:w,requestId:I},error:k,payload:D})=>{Nt(E,w.queryCacheKey,A=>{if(!m){if(A.requestId!==I)return;A.status=Ye,A.error=D??k}})}).addMatcher(c,(E,m)=>{const{queries:w}=s(m);for(const[I,k]of Object.entries(w))((k==null?void 0:k.status)===Ge||(k==null?void 0:k.status)===Ye)&&(E[I]=k)})}}),h=ke({name:`${e}/mutations`,initialState:Ot,reducers:{removeMutationResult:{reducer(C,{payload:E}){const m=at(E);m in C&&delete C[m]},prepare:$e()}},extraReducers(C){C.addCase(n.pending,(E,{meta:m,meta:{requestId:w,arg:I,startedTimeStamp:k}})=>{I.track&&(E[at(m)]={requestId:w,status:In,endpointName:I.endpointName,startedTimeStamp:k})}).addCase(n.fulfilled,(E,{payload:m,meta:w})=>{w.arg.track&&Vr(E,w,I=>{I.requestId===w.requestId&&(I.status=Ge,I.data=m,I.fulfilledTimeStamp=w.fulfilledTimeStamp)})}).addCase(n.rejected,(E,{payload:m,error:w,meta:I})=>{I.arg.track&&Vr(E,I,k=>{k.requestId===I.requestId&&(k.status=Ye,k.error=m??w)})}).addMatcher(c,(E,m)=>{const{mutations:w}=s(m);for(const[I,k]of Object.entries(w))((k==null?void 0:k.status)===Ge||(k==null?void 0:k.status)===Ye)&&I!==(k==null?void 0:k.requestId)&&(E[I]=k)})}}),_={tags:{},keys:{}},p=ke({name:`${e}/invalidation`,initialState:_,reducers:{updateProvidedBy:{reducer(C,E){var m,w,I;for(const{queryCacheKey:k,providedTags:D}of E.payload){S(C,k);for(const{type:A,id:F}of D){const T=(w=(m=C.tags)[A]??(m[A]={}))[I=F||"__internal_without_id"]??(w[I]=[]);T.includes(k)||T.push(k)}C.keys[k]=D}},prepare:$e()}},extraReducers(C){C.addCase(g.actions.removeQueryResult,(E,{payload:{queryCacheKey:m}})=>{S(E,m)}).addMatcher(c,(E,m)=>{var I,k,D;const{provided:w}=s(m);for(const[A,F]of Object.entries(w.tags??{}))for(const[T,P]of Object.entries(F)){const V=(k=(I=E.tags)[A]??(I[A]={}))[D=T||"__internal_without_id"]??(k[D]=[]);for(const L of P)V.includes(L)||V.push(L),E.keys[L]=w.keys[L]}}).addMatcher(ye(Ce(t),Xt(t)),(E,m)=>{M(E,[m])}).addMatcher(g.actions.cacheEntriesUpserted.match,(E,m)=>{const w=m.payload.map(({queryDescription:I,value:k})=>({type:"UNKNOWN",payload:k,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:I}}));M(E,w)})}});function S(C,E){var w;const m=jr(C.keys[E]??[]);for(const I of m){const k=I.type,D=I.id??"__internal_without_id",A=(w=C.tags[k])==null?void 0:w[D];A&&(C.tags[k][D]=jr(A).filter(F=>F!==E))}delete C.keys[E]}function M(C,E){const m=E.map(w=>{const I=Bi(w,"providesTags",i,a),{queryCacheKey:k}=w.meta.arg;return{queryCacheKey:k,providedTags:I}});p.caseReducers.updateProvidedBy(C,p.actions.updateProvidedBy(m))}const b=ke({name:`${e}/subscriptions`,initialState:Ot,reducers:{updateSubscriptionOptions(C,E){},unsubscribeQueryResult(C,E){},internal_getRTKQSubscriptions(){}}}),v=ke({name:`${e}/internalSubscriptions`,initialState:Ot,reducers:{subscriptionsUpdated:{reducer(C,E){return wr(C,E.payload)},prepare:$e()}}}),d=ke({name:`${e}/config`,initialState:{online:hc(),focused:pc(),middlewareRegistered:!1,...u},reducers:{middlewareRegistered(C,{payload:E}){C.middlewareRegistered=C.middlewareRegistered==="conflict"||o!==E?"conflict":!0}},extraReducers:C=>{C.addCase(Gn,E=>{E.online=!0}).addCase(zi,E=>{E.online=!1}).addCase(Kn,E=>{E.focused=!0}).addCase(Qi,E=>{E.focused=!1}).addMatcher(c,E=>({...E}))}}),f=mi({queries:g.reducer,mutations:h.reducer,provided:p.reducer,subscriptions:v.reducer,config:d.reducer}),x=(C,E)=>f(l.match(E)?void 0:C,E),O={...d.actions,...g.actions,...b.actions,...v.actions,...h.actions,...p.actions,resetApiState:l};return{reducer:x,actions:O}}var le=Symbol.for("RTKQ/skipToken"),Ki={status:ge},Lr=mt(Ki,()=>{}),Fr=mt(Ki,()=>{});function Rc({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=b=>Lr,i=b=>Fr;return{buildQuerySelector:N,buildInfiniteQuerySelector:g,buildMutationSelector:h,selectInvalidatedBy:_,selectCachedArgsForQuery:p,selectApiState:s,selectQueries:c,selectMutations:u,selectQueryEntry:a,selectConfig:l};function o(b){return{...b,...kr(b.status)}}function s(b){const v=b[t];if(process.env.NODE_ENV!=="production"&&!v){if(s.triggered)return v;s.triggered=!0,console.error(`Error: No data found at \`state.${t}\`. Did you forget to add the reducer to the store?`)}return v}function c(b){var v;return(v=s(b))==null?void 0:v.queries}function a(b,v){var d;return(d=c(b))==null?void 0:d[v]}function u(b){var v;return(v=s(b))==null?void 0:v.mutations}function l(b){var v;return(v=s(b))==null?void 0:v.config}function y(b,v,d){return f=>{if(f===le)return n(r,d);const x=e({queryArgs:f,endpointDefinition:v,endpointName:b});return n(C=>a(C,x)??Lr,d)}}function N(b,v){return y(b,v,o)}function g(b,v){const{infiniteQueryOptions:d}=v;function f(x){const O={...x,...kr(x.status)},{isLoading:C,isError:E,direction:m}=O,w=m==="forward",I=m==="backward";return{...O,hasNextPage:S(d,O.data,O.originalArgs),hasPreviousPage:M(d,O.data,O.originalArgs),isFetchingNextPage:C&&w,isFetchingPreviousPage:C&&I,isFetchNextPageError:E&&w,isFetchPreviousPageError:E&&I}}return y(b,v,f)}function h(){return(b=>{let v;return typeof b=="object"?v=at(b)??le:v=b,n(v===le?i:x=>{var O,C;return((C=(O=s(x))==null?void 0:O.mutations)==null?void 0:C[v])??Fr},o)})}function _(b,v){const d=b[t],f=new Set,x=kn(v,Bn,Ui);for(const O of x){const C=d.provided.tags[O.type];if(!C)continue;let E=(O.id!==void 0?C[O.id]:Object.values(C).flat())??[];for(const m of E)f.add(m)}return Array.from(f.values()).flatMap(O=>{const C=d.queries[O];return C?{queryCacheKey:O,endpointName:C.endpointName,originalArgs:C.originalArgs}:[]})}function p(b,v){return kn(Object.values(c(b)),d=>(d==null?void 0:d.endpointName)===v&&d.status!==ge,d=>d.originalArgs)}function S(b,v,d){return v?Rn(b,v,d)!=null:!1}function M(b,v,d){return!v||!b.getPreviousPageParam?!1:Hi(b,v,d)!=null}}var Ve=WeakMap?new WeakMap:void 0,Qr=({endpointName:e,queryArgs:t})=>{let n="";const r=Ve==null?void 0:Ve.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(o,s)=>(s=typeof s=="bigint"?{$bigint:s.toString()}:s,s=de(s)?Object.keys(s).sort().reduce((c,a)=>(c[a]=s[a],c),{}):s,s));de(t)&&(Ve==null||Ve.set(t,i)),n=i}return`${e}(${n})`};function Gi(...e){return function(n){const r=$t(u=>{var l;return(l=n.extractRehydrationInfo)==null?void 0:l.call(n,u,{reducerPath:n.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(u){let l=Qr;if("serializeQueryArgs"in u.endpointDefinition){const y=u.endpointDefinition.serializeQueryArgs;l=N=>{const g=y(N);return typeof g=="string"?g:Qr({...N,queryArgs:g})}}else n.serializeQueryArgs&&(l=n.serializeQueryArgs);return l(u)},tagTypes:[...n.tagTypes||[]]},o={endpointDefinitions:{},batch(u){u()},apiUid:Wn(),extractRehydrationInfo:r,hasRehydrationInfo:$t(u=>r(u)!=null)},s={injectEndpoints:a,enhanceEndpoints({addTagTypes:u,endpoints:l}){if(u)for(const y of u)i.tagTypes.includes(y)||i.tagTypes.push(y);if(l)for(const[y,N]of Object.entries(l))typeof N=="function"?N(ze(o,y)):Object.assign(ze(o,y)||{},N);return s}},c=e.map(u=>u.init(s,i,o));function a(u){const l=u.endpoints({query:y=>({...y,type:gt}),mutation:y=>({...y,type:qi}),infiniteQuery:y=>({...y,type:$i})});for(const[y,N]of Object.entries(l)){if(u.overrideExisting!==!0&&y in o.endpointDefinitions){if(u.overrideExisting==="throw")throw new Error(process.env.NODE_ENV==="production"?$(39):`called \`injectEndpoints\` to override already-existing endpointName ${y} without specifying \`overrideExisting: true\``);typeof process<"u"&&process.env.NODE_ENV==="development"&&console.error(`called \`injectEndpoints\` to override already-existing endpointName ${y} without specifying \`overrideExisting: true\``);continue}if(typeof process<"u"&&process.env.NODE_ENV==="development"&&bt(N)){const{infiniteQueryOptions:g}=N,{maxPages:h,getPreviousPageParam:_}=g;if(typeof h=="number"){if(h<1)throw new Error(process.env.NODE_ENV==="production"?$(40):`maxPages for endpoint '${y}' must be a number greater than 0`);if(typeof _!="function")throw new Error(process.env.NODE_ENV==="production"?$(41):`getPreviousPageParam for endpoint '${y}' must be a function if maxPages is used`)}}o.endpointDefinitions[y]=N;for(const g of c)g.injectEndpoint(y,N)}return s}return s.injectEndpoints({endpoints:n.endpoints})}}function pe(e,...t){return Object.assign(e,...t)}var Dc=({api:e,queryThunk:t,internalState:n,mwApi:r})=>{const i=`${e.reducerPath}/subscriptions`;let o=null,s=null;const{updateSubscriptionOptions:c,unsubscribeQueryResult:a}=e.internalActions,u=(_,p)=>{if(c.match(p)){const{queryCacheKey:M,requestId:b,options:v}=p.payload,d=_.get(M);return d!=null&&d.has(b)&&d.set(b,v),!0}if(a.match(p)){const{queryCacheKey:M,requestId:b}=p.payload,v=_.get(M);return v&&v.delete(b),!0}if(e.internalActions.removeQueryResult.match(p))return _.delete(p.payload.queryCacheKey),!0;if(t.pending.match(p)){const{meta:{arg:M,requestId:b}}=p,v=Ut(_,M.queryCacheKey,Mn);return M.subscribe&&v.set(b,M.subscriptionOptions??v.get(b)??{}),!0}let S=!1;if(t.rejected.match(p)){const{meta:{condition:M,arg:b,requestId:v}}=p;if(M&&b.subscribe){const d=Ut(_,b.queryCacheKey,Mn);d.set(v,b.subscriptionOptions??d.get(v)??{}),S=!0}}return S},l=()=>n.currentSubscriptions,g={getSubscriptions:l,getSubscriptionCount:_=>{const S=l().get(_);return(S==null?void 0:S.size)??0},isRequestSubscribed:(_,p)=>{var M;const S=l();return!!((M=S==null?void 0:S.get(_))!=null&&M.get(p))}};function h(_){return JSON.parse(JSON.stringify(Object.fromEntries([..._].map(([p,S])=>[p,Object.fromEntries(S)]))))}return(_,p)=>{if(o||(o=h(n.currentSubscriptions)),e.util.resetApiState.match(_))return o={},n.currentSubscriptions.clear(),s=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(_))return[!1,g];const S=u(n.currentSubscriptions,_);let M=!0;if(process.env.NODE_ENV==="test"&&typeof _.type=="string"&&_.type===`${e.reducerPath}/getPolling`)return[!1,n.currentPolls];if(S){s||(s=setTimeout(()=>{const d=h(n.currentSubscriptions),[,f]=_i(o,()=>d);p.next(e.internalActions.subscriptionsUpdated(f)),o=d,s=null},500));const b=typeof _.type=="string"&&!!_.type.startsWith(i),v=t.rejected.match(_)&&_.meta.condition&&!!_.meta.arg.subscribe;M=!b&&!v}return[M,!1]}},Ac=2147483647/1e3-1,Tc=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:i,selectors:{selectQueryEntry:o,selectConfig:s},getRunningQueryThunk:c,mwApi:a})=>{const{removeQueryResult:u,unsubscribeQueryResult:l,cacheEntriesUpserted:y}=t.internalActions,N=ye(l.match,n.fulfilled,n.rejected,y.match);function g(b){const v=i.currentSubscriptions.get(b);return v?v.size>0:!1}const h={};function _(b){var v;for(const d of b.values())(v=d==null?void 0:d.abort)==null||v.call(d)}const p=(b,v)=>{const d=v.getState(),f=s(d);if(N(b)){let x;if(y.match(b))x=b.payload.map(O=>O.queryDescription.queryCacheKey);else{const{queryCacheKey:O}=l.match(b)?b.payload:b.meta.arg;x=[O]}S(x,v,f)}if(t.util.resetApiState.match(b)){for(const[x,O]of Object.entries(h))O&&clearTimeout(O),delete h[x];_(i.runningQueries),_(i.runningMutations)}if(r.hasRehydrationInfo(b)){const{queries:x}=r.extractRehydrationInfo(b);S(Object.keys(x),v,f)}};function S(b,v,d){const f=v.getState();for(const x of b){const O=o(f,x);O!=null&&O.endpointName&&M(x,O.endpointName,v,d)}}function M(b,v,d,f){const x=ze(r,v),O=(x==null?void 0:x.keepUnusedDataFor)??f.keepUnusedDataFor;if(O===1/0)return;const C=Math.max(0,Math.min(O,Ac));if(!g(b)){const E=h[b];E&&clearTimeout(E),h[b]=setTimeout(()=>{if(!g(b)){const m=o(d.getState(),b);if(m!=null&&m.endpointName){const w=d.dispatch(c(m.endpointName,m.originalArgs));w==null||w.abort()}d.dispatch(u({queryCacheKey:b}))}delete h[b]},C*1e3)}}return p},zr=new Error("Promise never resolved before cacheEntryRemoved."),jc=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:o,selectors:{selectQueryEntry:s,selectApiState:c}})=>{const a=On(r),u=On(i),l=Ce(r,i),y={},{removeQueryResult:N,removeMutationResult:g,cacheEntriesUpserted:h}=e.internalActions;function _(d,f,x){const O=y[d];O!=null&&O.valueResolved&&(O.valueResolved({data:f,meta:x}),delete O.valueResolved)}function p(d){const f=y[d];f&&(delete y[d],f.cacheEntryRemoved())}function S(d){const{arg:f,requestId:x}=d.meta,{endpointName:O,originalArgs:C}=f;return[O,C,x]}const M=(d,f,x)=>{const O=b(d);function C(E,m,w,I){const k=s(x,m),D=s(f.getState(),m);!k&&D&&v(E,I,m,f,w)}if(r.pending.match(d)){const[E,m,w]=S(d);C(E,O,w,m)}else if(h.match(d))for(const{queryDescription:E,value:m}of d.payload){const{endpointName:w,originalArgs:I,queryCacheKey:k}=E;C(w,k,d.meta.requestId,I),_(k,m,{})}else if(i.pending.match(d)){if(f.getState()[t].mutations[O]){const[m,w,I]=S(d);v(m,w,O,f,I)}}else if(l(d))_(O,d.payload,d.meta.baseQueryMeta);else if(N.match(d)||g.match(d))p(O);else if(e.util.resetApiState.match(d))for(const E of Object.keys(y))p(E)};function b(d){return a(d)?d.meta.arg.queryCacheKey:u(d)?d.meta.arg.fixedCacheKey??d.meta.requestId:N.match(d)?d.payload.queryCacheKey:g.match(d)?at(d.payload):""}function v(d,f,x,O,C){const E=ze(n,d),m=E==null?void 0:E.onCacheEntryAdded;if(!m)return;const w={},I=new Promise(P=>{w.cacheEntryRemoved=P}),k=Promise.race([new Promise(P=>{w.valueResolved=P}),I.then(()=>{throw zr})]);k.catch(()=>{}),y[x]=w;const D=e.endpoints[d].select(Wt(E)?f:x),A=O.dispatch((P,V,L)=>L),F={...O,getCacheEntry:()=>D(O.getState()),requestId:C,extra:A,updateCachedData:Wt(E)?P=>O.dispatch(e.util.updateQueryData(d,f,P)):void 0,cacheDataLoaded:k,cacheEntryRemoved:I},T=m(f,F);Promise.resolve(T).catch(P=>{if(P!==zr)throw P})}return M},Vc=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{var o,s;e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"&&process.env.NODE_ENV==="development"&&e.internalActions.middlewareRegistered.match(r)&&r.payload===t&&((s=(o=i.getState()[n])==null?void 0:o.config)==null?void 0:s.middlewareRegistered)==="conflict"&&console.warn(`There is a mismatch between slice and middleware for the reducerPath "${n}".
|
|
38
|
+
Object returned was:`,z)}if(z.error)throw new yr(z.error,z.meta);let{data:Qe}=z;Le&&!ke(L,"rawResponse")&&(Qe=await Pe(Le,z.data,"rawResponseSchema",z.meta));let Se=await Y(Qe,z.meta,U);return de&&!ke(L,"response")&&(Se=await Pe(de,Se,"responseSchema",z.meta)),{...z,data:Se}}if(B&&"infiniteQueryOptions"in D){const{infiniteQueryOptions:U}=D,{maxPages:z=1/0}=U,Ee=h.refetchCachedPages??U.refetchCachedPages??!0;let ne;const Le={pages:[],pageParams:[]},de=(K=o.selectQueryEntry(Q(),h.queryCacheKey))==null?void 0:K.data,Se=O(h,Q())&&!h.direction||!de?Le:de;if("direction"in h&&h.direction&&Se.pages.length){const ue=h.direction==="backward",Ne=(ue?mi:En)(U,Se,h.originalArgs);ne=await F(Se,Ne,z,ue)}else{const{initialPageParam:ue=U.initialPageParam}=h,fe=(de==null?void 0:de.pageParams)??[],Ne=fe[0]??ue,ki=fe.length;if(ne=await F(Se,Ne,z),$&&(ne={data:ne.data.pages[0]}),Ee)for(let Fn=1;Fn<ki;Fn++){const Pi=En(U,ne.data,h.originalArgs);ne=await F(ne.data,Pi,z)}}W=ne}else W=await ee(h.originalArgs);return V&&!ke(L,"meta")&&W.meta&&(W.meta=await Pe(V,W.meta,"metaSchema",W.meta)),M(W.data,Ke({fulfilledTimeStamp:Date.now(),baseQueryMeta:W.meta}))}catch(Y){let G=Y;if(G instanceof yr){let $=N(D,"transformErrorResponse");const{rawErrorResponseSchema:W,errorResponseSchema:F}=D;let{value:ee,meta:U}=G;try{W&&!ke(L,"rawErrorResponse")&&(ee=await Pe(W,ee,"rawErrorResponseSchema",U)),V&&!ke(L,"meta")&&(U=await Pe(V,U,"metaSchema",U));let z=await $(ee,U,h.originalArgs);return F&&!ke(L,"errorResponse")&&(z=await Pe(F,z,"errorResponseSchema",U)),k(z,Ke({baseQueryMeta:U}))}catch(z){G=z}}try{if(G instanceof fi){const $={endpoint:h.endpointName,arg:h.originalArgs,type:h.type,queryCacheKey:B?h.queryCacheKey:void 0};(H=D.onSchemaFailure)==null||H.call(D,G,$),a==null||a(G,$);const{catchSchemaFailure:W=c}=D;if(W)return k(W(G,$),Ke({baseQueryMeta:G._bqMeta}))}}catch($){G=$}throw typeof process<"u"&&process.env.NODE_ENV!=="production"?console.error(`An unhandled error occurred processing a request for the endpoint "${h.endpointName}".
|
|
39
|
+
In the case of an unhandled error, no tags will be "provided" or "invalidated".`,G):console.error(G),G}};function O(h,y){const I=o.selectQueryEntry(y,h.queryCacheKey),k=o.selectConfig(y).refetchOnMountOrArgChange,M=I==null?void 0:I.fulfilledTimeStamp,R=h.forceRefetch??(h.subscribe&&k);return R?R===!0||(Number(new Date)-Number(M))/1e3>=R:!1}const P=()=>lr(`${e}/executeQuery`,m,{getPendingMeta({arg:y}){const I=n[y.endpointName];return Ke({startedTimeStamp:Date.now(),...bt(I)?{direction:y.direction}:{}})},condition(y,{getState:I}){var L;const k=I(),M=o.selectQueryEntry(k,y.queryCacheKey),R=M==null?void 0:M.fulfilledTimeStamp,Q=y.originalArgs,T=M==null?void 0:M.originalArgs,D=n[y.endpointName],V=y.direction;return xn(y)?!0:(M==null?void 0:M.status)==="pending"?!1:O(y,k)||Kt(D)&&((L=D==null?void 0:D.forceRefetch)!=null&&L.call(D,{currentArg:Q,previousArg:T,endpointState:M,state:k}))?!0:!(R&&!V)},dispatchConditionRejection:!0}),b=P(),g=P(),u=lr(`${e}/executeMutation`,m,{getPendingMeta(){return Ke({startedTimeStamp:Date.now()})}}),d=h=>"force"in h,E=h=>"ifOlderThan"in h,j=(h,y,I={})=>(k,M)=>{const R=d(I)&&I.force,Q=E(I)&&I.ifOlderThan,T=(V=!0)=>{const L={forceRefetch:V,subscribe:!1};return i.endpoints[h].initiate(y,L)},D=i.endpoints[h].select(y)(M());if(R)k(T());else if(Q){const V=D==null?void 0:D.fulfilledTimeStamp;if(!V){k(T());return}(Number(new Date)-Number(new Date(V)))/1e3>=Q&&k(T())}else k(T(!1))};function v(h){return y=>{var I,k;return((k=(I=y==null?void 0:y.meta)==null?void 0:I.arg)==null?void 0:k.endpointName)===h}}function w(h,y){return{matchPending:nt(jn(h),v(y)),matchFulfilled:nt(je(h),v(y)),matchRejected:nt(qe(h),v(y))}}return{queryThunk:b,mutationThunk:u,infiniteQueryThunk:g,prefetch:j,updateQueryData:x,upsertQueryData:p,patchQueryData:f,buildMatchThunkActions:w}}function En(e,{pages:t,pageParams:n},r){const i=t.length-1;return e.getNextPageParam(t[i],t,n[i],n,r)}function mi(e,{pages:t,pageParams:n},r){var i;return(i=e.getPreviousPageParam)==null?void 0:i.call(e,t[0],t,n[0],n,r)}function pi(e,t,n,r){return Rn(n[e.meta.arg.endpointName][t],je(e)?e.payload:void 0,Bt(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function br(e){return ae(e)?Ur(e):e}function _t(e,t,n){const r=e[t];r&&n(r)}function ut(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function vr(e,t,n){const r=e[ut(t)];r&&n(r)}var Ct={};function $o({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:i,apiUid:s,extractRehydrationInfo:o,hasRehydrationInfo:a},assertTagType:c,config:l}){const f=me(`${e}/resetApiState`);function S(v,w,h,y){var I;v[I=w.queryCacheKey]??(v[I]={status:we,endpointName:w.endpointName}),_t(v,w.queryCacheKey,k=>{k.status=bn,k.requestId=h&&k.requestId?k.requestId:y.requestId,w.originalArgs!==void 0&&(k.originalArgs=w.originalArgs),k.startedTimeStamp=y.startedTimeStamp;const M=i[y.arg.endpointName];bt(M)&&"direction"in w&&(k.direction=w.direction)})}function C(v,w,h,y){_t(v,w.arg.queryCacheKey,I=>{if(I.requestId!==w.requestId&&!y)return;const{merge:k}=i[w.arg.endpointName];if(I.status=Ze,k)if(I.data!==void 0){const{fulfilledTimeStamp:M,arg:R,baseQueryMeta:Q,requestId:T}=w;let D=ht(I.data,V=>k(V,h,{arg:R.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:M,requestId:T}));I.data=D}else I.data=h;else I.data=i[w.arg.endpointName].structuralSharing??!0?kn(ae(I.data)?ps(I.data):I.data,h):h;delete I.error,I.fulfilledTimeStamp=w.fulfilledTimeStamp})}const x=De({name:`${e}/queries`,initialState:Ct,reducers:{removeQueryResult:{reducer(v,{payload:{queryCacheKey:w}}){delete v[w]},prepare:He()},cacheEntriesUpserted:{reducer(v,w){for(const h of w.payload){const{queryDescription:y,value:I}=h;S(v,y,!0,{arg:y,requestId:w.meta.requestId,startedTimeStamp:w.meta.timestamp}),C(v,{arg:y,requestId:w.meta.requestId,fulfilledTimeStamp:w.meta.timestamp,baseQueryMeta:{}},I,!0)}},prepare:v=>({payload:v.map(y=>{const{endpointName:I,arg:k,value:M}=y,R=i[I];return{queryDescription:{type:gt,endpointName:I,originalArgs:y.arg,queryCacheKey:r({queryArgs:k,endpointDefinition:R,endpointName:I})},value:M}}),meta:{[Ut]:!0,requestId:In(),timestamp:Date.now()}})},queryResultPatched:{reducer(v,{payload:{queryCacheKey:w,patches:h}}){_t(v,w,y=>{y.data=nr(y.data,h.concat())})},prepare:He()}},extraReducers(v){v.addCase(t.pending,(w,{meta:h,meta:{arg:y}})=>{const I=xn(y);S(w,y,I,h)}).addCase(t.fulfilled,(w,{meta:h,payload:y})=>{const I=xn(h.arg);C(w,h,y,I)}).addCase(t.rejected,(w,{meta:{condition:h,arg:y,requestId:I},error:k,payload:M})=>{_t(w,y.queryCacheKey,R=>{if(!h){if(R.requestId!==I)return;R.status=Je,R.error=M??k}})}).addMatcher(a,(w,h)=>{const{queries:y}=o(h);for(const[I,k]of Object.entries(y))((k==null?void 0:k.status)===Ze||(k==null?void 0:k.status)===Je)&&(w[I]=k)})}}),p=De({name:`${e}/mutations`,initialState:Ct,reducers:{removeMutationResult:{reducer(v,{payload:w}){const h=ut(w);h in v&&delete v[h]},prepare:He()}},extraReducers(v){v.addCase(n.pending,(w,{meta:h,meta:{requestId:y,arg:I,startedTimeStamp:k}})=>{I.track&&(w[ut(h)]={requestId:y,status:bn,endpointName:I.endpointName,startedTimeStamp:k})}).addCase(n.fulfilled,(w,{payload:h,meta:y})=>{y.arg.track&&vr(w,y,I=>{I.requestId===y.requestId&&(I.status=Ze,I.data=h,I.fulfilledTimeStamp=y.fulfilledTimeStamp)})}).addCase(n.rejected,(w,{payload:h,error:y,meta:I})=>{I.arg.track&&vr(w,I,k=>{k.requestId===I.requestId&&(k.status=Je,k.error=h??y)})}).addMatcher(a,(w,h)=>{const{mutations:y}=o(h);for(const[I,k]of Object.entries(y))((k==null?void 0:k.status)===Ze||(k==null?void 0:k.status)===Je)&&I!==(k==null?void 0:k.requestId)&&(w[I]=k)})}}),N={tags:{},keys:{}},m=De({name:`${e}/invalidation`,initialState:N,reducers:{updateProvidedBy:{reducer(v,w){var h,y,I;for(const{queryCacheKey:k,providedTags:M}of w.payload){O(v,k);for(const{type:R,id:Q}of M){const T=(y=(h=v.tags)[R]??(h[R]={}))[I=Q||"__internal_without_id"]??(y[I]=[]);T.includes(k)||T.push(k)}v.keys[k]=M}},prepare:He()}},extraReducers(v){v.addCase(x.actions.removeQueryResult,(w,{payload:{queryCacheKey:h}})=>{O(w,h)}).addMatcher(a,(w,h)=>{var I,k,M;const{provided:y}=o(h);for(const[R,Q]of Object.entries(y.tags??{}))for(const[T,D]of Object.entries(Q)){const V=(k=(I=w.tags)[R]??(I[R]={}))[M=T||"__internal_without_id"]??(k[M]=[]);for(const L of D)V.includes(L)||V.push(L),w.keys[L]=y.keys[L]}}).addMatcher(ve(je(t),Bt(t)),(w,h)=>{P(w,[h])}).addMatcher(x.actions.cacheEntriesUpserted.match,(w,h)=>{const y=h.payload.map(({queryDescription:I,value:k})=>({type:"UNKNOWN",payload:k,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:I}}));P(w,y)})}});function O(v,w){var y;const h=br(v.keys[w]??[]);for(const I of h){const k=I.type,M=I.id??"__internal_without_id",R=(y=v.tags[k])==null?void 0:y[M];R&&(v.tags[k][M]=br(R).filter(Q=>Q!==w))}delete v.keys[w]}function P(v,w){const h=w.map(y=>{const I=pi(y,"providesTags",i,c),{queryCacheKey:k}=y.meta.arg;return{queryCacheKey:k,providedTags:I}});m.caseReducers.updateProvidedBy(v,m.actions.updateProvidedBy(h))}const b=De({name:`${e}/subscriptions`,initialState:Ct,reducers:{updateSubscriptionOptions(v,w){},unsubscribeQueryResult(v,w){},internal_getRTKQSubscriptions(){}}}),g=De({name:`${e}/internalSubscriptions`,initialState:Ct,reducers:{subscriptionsUpdated:{reducer(v,w){return nr(v,w.payload)},prepare:He()}}}),u=De({name:`${e}/config`,initialState:{online:So(),focused:Eo(),middlewareRegistered:!1,...l},reducers:{middlewareRegistered(v,{payload:w}){v.middlewareRegistered=v.middlewareRegistered==="conflict"||s!==w?"conflict":!0}},extraReducers:v=>{v.addCase(Mn,w=>{w.online=!0}).addCase(ci,w=>{w.online=!1}).addCase(Dn,w=>{w.focused=!0}).addCase(ai,w=>{w.focused=!1}).addMatcher(a,w=>({...w}))}}),d=Tr({queries:x.reducer,mutations:p.reducer,provided:m.reducer,subscriptions:g.reducer,config:u.reducer}),E=(v,w)=>d(f.match(w)?void 0:v,w),j={...u.actions,...x.actions,...b.actions,...g.actions,...p.actions,...m.actions,resetApiState:f};return{reducer:E,actions:j}}var le=Symbol.for("RTKQ/skipToken"),hi={status:we},wr=ht(hi,()=>{}),xr=ht(hi,()=>{});function Fo({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=b=>wr,i=b=>xr;return{buildQuerySelector:C,buildInfiniteQuerySelector:x,buildMutationSelector:p,selectInvalidatedBy:N,selectCachedArgsForQuery:m,selectApiState:o,selectQueries:a,selectMutations:l,selectQueryEntry:c,selectConfig:f};function s(b){return{...b,...dr(b.status)}}function o(b){const g=b[t];if(process.env.NODE_ENV!=="production"&&!g){if(o.triggered)return g;o.triggered=!0,console.error(`Error: No data found at \`state.${t}\`. Did you forget to add the reducer to the store?`)}return g}function a(b){var g;return(g=o(b))==null?void 0:g.queries}function c(b,g){var u;return(u=a(b))==null?void 0:u[g]}function l(b){var g;return(g=o(b))==null?void 0:g.mutations}function f(b){var g;return(g=o(b))==null?void 0:g.config}function S(b,g,u){return d=>{if(d===le)return n(r,u);const E=e({queryArgs:d,endpointDefinition:g,endpointName:b});return n(v=>c(v,E)??wr,u)}}function C(b,g){return S(b,g,s)}function x(b,g){const{infiniteQueryOptions:u}=g;function d(E){const j={...E,...dr(E.status)},{isLoading:v,isError:w,direction:h}=j,y=h==="forward",I=h==="backward";return{...j,hasNextPage:O(u,j.data,j.originalArgs),hasPreviousPage:P(u,j.data,j.originalArgs),isFetchingNextPage:v&&y,isFetchingPreviousPage:v&&I,isFetchNextPageError:w&&y,isFetchPreviousPageError:w&&I}}return S(b,g,d)}function p(){return(b=>{let g;return typeof b=="object"?g=ut(b)??le:g=b,n(g===le?i:E=>{var j,v;return((v=(j=o(E))==null?void 0:j.mutations)==null?void 0:v[g])??xr},s)})}function N(b,g){const u=b[t],d=new Set,E=vn(g,Pn,di);for(const j of E){const v=u.provided.tags[j.type];if(!v)continue;let w=(j.id!==void 0?v[j.id]:Object.values(v).flat())??[];for(const h of w)d.add(h)}return Array.from(d.values()).flatMap(j=>{const v=u.queries[j];return v?{queryCacheKey:j,endpointName:v.endpointName,originalArgs:v.originalArgs}:[]})}function m(b,g){return vn(Object.values(a(b)),u=>(u==null?void 0:u.endpointName)===g&&u.status!==we,u=>u.originalArgs)}function O(b,g,u){return g?En(b,g,u)!=null:!1}function P(b,g,u){return!g||!b.getPreviousPageParam?!1:mi(b,g,u)!=null}}var $e=WeakMap?new WeakMap:void 0,Er=({endpointName:e,queryArgs:t})=>{let n="";const r=$e==null?void 0:$e.get(t);if(typeof r=="string")n=r;else{const i=JSON.stringify(t,(s,o)=>(o=typeof o=="bigint"?{$bigint:o.toString()}:o,o=he(o)?Object.keys(o).sort().reduce((a,c)=>(a[c]=o[c],a),{}):o,o));he(t)&&($e==null||$e.set(t,i)),n=i}return`${e}(${n})`};function yi(...e){return function(n){const r=Lt(l=>{var f;return(f=n.extractRehydrationInfo)==null?void 0:f.call(n,l,{reducerPath:n.reducerPath??"api"})}),i={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(l){let f=Er;if("serializeQueryArgs"in l.endpointDefinition){const S=l.endpointDefinition.serializeQueryArgs;f=C=>{const x=S(C);return typeof x=="string"?x:Er({...C,queryArgs:x})}}else n.serializeQueryArgs&&(f=n.serializeQueryArgs);return f(l)},tagTypes:[...n.tagTypes||[]]},s={endpointDefinitions:{},batch(l){l()},apiUid:In(),extractRehydrationInfo:r,hasRehydrationInfo:Lt(l=>r(l)!=null)},o={injectEndpoints:c,enhanceEndpoints({addTagTypes:l,endpoints:f}){if(l)for(const S of l)i.tagTypes.includes(S)||i.tagTypes.push(S);if(f)for(const[S,C]of Object.entries(f))typeof C=="function"?C(Ue(s,S)):Object.assign(Ue(s,S)||{},C);return o}},a=e.map(l=>l.init(o,i,s));function c(l){const f=l.endpoints({query:S=>({...S,type:gt}),mutation:S=>({...S,type:ui}),infiniteQuery:S=>({...S,type:li})});for(const[S,C]of Object.entries(f)){if(l.overrideExisting!==!0&&S in s.endpointDefinitions){if(l.overrideExisting==="throw")throw new Error(process.env.NODE_ENV==="production"?q(39):`called \`injectEndpoints\` to override already-existing endpointName ${S} without specifying \`overrideExisting: true\``);typeof process<"u"&&process.env.NODE_ENV==="development"&&console.error(`called \`injectEndpoints\` to override already-existing endpointName ${S} without specifying \`overrideExisting: true\``);continue}if(typeof process<"u"&&process.env.NODE_ENV==="development"&&bt(C)){const{infiniteQueryOptions:x}=C,{maxPages:p,getPreviousPageParam:N}=x;if(typeof p=="number"){if(p<1)throw new Error(process.env.NODE_ENV==="production"?q(40):`maxPages for endpoint '${S}' must be a number greater than 0`);if(typeof N!="function")throw new Error(process.env.NODE_ENV==="production"?q(41):`getPreviousPageParam for endpoint '${S}' must be a function if maxPages is used`)}}s.endpointDefinitions[S]=C;for(const x of a)x.injectEndpoint(S,C)}return o}return o.injectEndpoints({endpoints:n.endpoints})}}function ye(e,...t){return Object.assign(e,...t)}var zo=({api:e,queryThunk:t,internalState:n,mwApi:r})=>{const i=`${e.reducerPath}/subscriptions`;let s=null,o=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:c}=e.internalActions,l=(N,m)=>{if(a.match(m)){const{queryCacheKey:P,requestId:b,options:g}=m.payload,u=N.get(P);return u!=null&&u.has(b)&&u.set(b,g),!0}if(c.match(m)){const{queryCacheKey:P,requestId:b}=m.payload,g=N.get(P);return g&&g.delete(b),!0}if(e.internalActions.removeQueryResult.match(m))return N.delete(m.payload.queryCacheKey),!0;if(t.pending.match(m)){const{meta:{arg:P,requestId:b}}=m,g=Qt(N,P.queryCacheKey,wn);return P.subscribe&&g.set(b,P.subscriptionOptions??g.get(b)??{}),!0}let O=!1;if(t.rejected.match(m)){const{meta:{condition:P,arg:b,requestId:g}}=m;if(P&&b.subscribe){const u=Qt(N,b.queryCacheKey,wn);u.set(g,b.subscriptionOptions??u.get(g)??{}),O=!0}}return O},f=()=>n.currentSubscriptions,x={getSubscriptions:f,getSubscriptionCount:N=>{const O=f().get(N);return(O==null?void 0:O.size)??0},isRequestSubscribed:(N,m)=>{var P;const O=f();return!!((P=O==null?void 0:O.get(N))!=null&&P.get(m))}};function p(N){return JSON.parse(JSON.stringify(Object.fromEntries([...N].map(([m,O])=>[m,Object.fromEntries(O)]))))}return(N,m)=>{if(s||(s=p(n.currentSubscriptions)),e.util.resetApiState.match(N))return s={},n.currentSubscriptions.clear(),o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(N))return[!1,x];const O=l(n.currentSubscriptions,N);let P=!0;if(process.env.NODE_ENV==="test"&&typeof N.type=="string"&&N.type===`${e.reducerPath}/getPolling`)return[!1,n.currentPolls];if(O){o||(o=setTimeout(()=>{const u=p(n.currentSubscriptions),[,d]=Br(s,()=>u);m.next(e.internalActions.subscriptionsUpdated(d)),s=u,o=null},500));const b=typeof N.type=="string"&&!!N.type.startsWith(i),g=t.rejected.match(N)&&N.meta.condition&&!!N.meta.arg.subscribe;P=!b&&!g}return[P,!1]}},qo=2147483647/1e3-1,Uo=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:i,selectors:{selectQueryEntry:s,selectConfig:o},getRunningQueryThunk:a,mwApi:c})=>{const{removeQueryResult:l,unsubscribeQueryResult:f,cacheEntriesUpserted:S}=t.internalActions,C=ve(f.match,n.fulfilled,n.rejected,S.match);function x(b){const g=i.currentSubscriptions.get(b);return g?g.size>0:!1}const p={};function N(b){var g;for(const u of b.values())(g=u==null?void 0:u.abort)==null||g.call(u)}const m=(b,g)=>{const u=g.getState(),d=o(u);if(C(b)){let E;if(S.match(b))E=b.payload.map(j=>j.queryDescription.queryCacheKey);else{const{queryCacheKey:j}=f.match(b)?b.payload:b.meta.arg;E=[j]}O(E,g,d)}if(t.util.resetApiState.match(b)){for(const[E,j]of Object.entries(p))j&&clearTimeout(j),delete p[E];N(i.runningQueries),N(i.runningMutations)}if(r.hasRehydrationInfo(b)){const{queries:E}=r.extractRehydrationInfo(b);O(Object.keys(E),g,d)}};function O(b,g,u){const d=g.getState();for(const E of b){const j=s(d,E);j!=null&&j.endpointName&&P(E,j.endpointName,g,u)}}function P(b,g,u,d){const E=Ue(r,g),j=(E==null?void 0:E.keepUnusedDataFor)??d.keepUnusedDataFor;if(j===1/0)return;const v=Math.max(0,Math.min(j,qo));if(!x(b)){const w=p[b];w&&clearTimeout(w),p[b]=setTimeout(()=>{if(!x(b)){const h=s(u.getState(),b);if(h!=null&&h.endpointName){const y=u.dispatch(a(h.endpointName,h.originalArgs));y==null||y.abort()}u.dispatch(l({queryCacheKey:b}))}delete p[b]},v*1e3)}}return m},Sr=new Error("Promise never resolved before cacheEntryRemoved."),Wo=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:i,internalState:s,selectors:{selectQueryEntry:o,selectApiState:a}})=>{const c=gn(r),l=gn(i),f=je(r,i),S={},{removeQueryResult:C,removeMutationResult:x,cacheEntriesUpserted:p}=e.internalActions;function N(u,d,E){const j=S[u];j!=null&&j.valueResolved&&(j.valueResolved({data:d,meta:E}),delete j.valueResolved)}function m(u){const d=S[u];d&&(delete S[u],d.cacheEntryRemoved())}function O(u){const{arg:d,requestId:E}=u.meta,{endpointName:j,originalArgs:v}=d;return[j,v,E]}const P=(u,d,E)=>{const j=b(u);function v(w,h,y,I){const k=o(E,h),M=o(d.getState(),h);!k&&M&&g(w,I,h,d,y)}if(r.pending.match(u)){const[w,h,y]=O(u);v(w,j,y,h)}else if(p.match(u))for(const{queryDescription:w,value:h}of u.payload){const{endpointName:y,originalArgs:I,queryCacheKey:k}=w;v(y,k,u.meta.requestId,I),N(k,h,{})}else if(i.pending.match(u)){if(d.getState()[t].mutations[j]){const[h,y,I]=O(u);g(h,y,j,d,I)}}else if(f(u))N(j,u.payload,u.meta.baseQueryMeta);else if(C.match(u)||x.match(u))m(j);else if(e.util.resetApiState.match(u))for(const w of Object.keys(S))m(w)};function b(u){return c(u)?u.meta.arg.queryCacheKey:l(u)?u.meta.arg.fixedCacheKey??u.meta.requestId:C.match(u)?u.payload.queryCacheKey:x.match(u)?ut(u.payload):""}function g(u,d,E,j,v){const w=Ue(n,u),h=w==null?void 0:w.onCacheEntryAdded;if(!h)return;const y={},I=new Promise(D=>{y.cacheEntryRemoved=D}),k=Promise.race([new Promise(D=>{y.valueResolved=D}),I.then(()=>{throw Sr})]);k.catch(()=>{}),S[E]=y;const M=e.endpoints[u].select($t(w)?d:E),R=j.dispatch((D,V,L)=>L),Q={...j,getCacheEntry:()=>M(j.getState()),requestId:v,extra:R,updateCachedData:$t(w)?D=>j.dispatch(e.util.updateQueryData(u,d,D)):void 0,cacheDataLoaded:k,cacheEntryRemoved:I},T=h(d,Q);Promise.resolve(T).catch(D=>{if(D!==Sr)throw D})}return P},Bo=({api:e,context:{apiUid:t},reducerPath:n})=>(r,i)=>{var s,o;e.util.resetApiState.match(r)&&i.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"&&process.env.NODE_ENV==="development"&&e.internalActions.middlewareRegistered.match(r)&&r.payload===t&&((o=(s=i.getState()[n])==null?void 0:s.config)==null?void 0:o.middlewareRegistered)==="conflict"&&console.warn(`There is a mismatch between slice and middleware for the reducerPath "${n}".
|
|
40
40
|
You can only have one api per reducer path, this will lead to crashes in various situations!${n==="api"?`
|
|
41
|
-
If you have multiple apis, you *have* to specify the reducerPath option when using createApi!`:""}`)},Lc=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:o,assertTagType:s,refetchQuery:c,internalState:a})=>{const{removeQueryResult:u}=o.internalActions,l=ye(Ce(r),Xt(r)),y=ye(Ce(i,r),Qe(i,r));let N=[],g=0;const h=(S,M)=>{(i.pending.match(S)||r.pending.match(S))&&g++,y(S)&&(g=Math.max(0,g-1)),l(S)?p(Bi(S,"invalidatesTags",n,s),M):y(S)?p([],M):o.util.invalidateTags.match(S)&&p(Yn(S.payload,void 0,void 0,void 0,void 0,s),M)};function _(){return g>0}function p(S,M){const b=M.getState(),v=b[e];if(N.push(...S),v.config.invalidationBehavior==="delayed"&&_())return;const d=N;if(N=[],d.length===0)return;const f=o.util.selectInvalidatedBy(b,d);t.batch(()=>{const x=Array.from(f.values());for(const{queryCacheKey:O}of x){const C=v.queries[O],E=Ut(a.currentSubscriptions,O,Mn);C&&(E.size===0?M.dispatch(u({queryCacheKey:O})):C.status!==ge&&M.dispatch(c(C)))}})}return h},Fc=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const{currentPolls:o,currentSubscriptions:s}=i,c=new Set;let a=null;const u=(p,S)=>{(n.internalActions.updateSubscriptionOptions.match(p)||n.internalActions.unsubscribeQueryResult.match(p))&&l(p.payload.queryCacheKey,S),(t.pending.match(p)||t.rejected.match(p)&&p.meta.condition)&&l(p.meta.arg.queryCacheKey,S),(t.fulfilled.match(p)||t.rejected.match(p)&&!p.meta.condition)&&y(p.meta.arg,S),n.util.resetApiState.match(p)&&(h(),a&&(clearTimeout(a),a=null),c.clear())};function l(p,S){c.add(p),a||(a=setTimeout(()=>{for(const M of c)N({queryCacheKey:M},S);c.clear(),a=null},0))}function y({queryCacheKey:p},S){const M=S.getState()[e],b=M.queries[p],v=s.get(p);if(!b||b.status===ge)return;const{lowestPollingInterval:d,skipPollingIfUnfocused:f}=_(v);if(!Number.isFinite(d))return;const x=o.get(p);x!=null&&x.timeout&&(clearTimeout(x.timeout),x.timeout=void 0);const O=Date.now()+d;o.set(p,{nextPollTimestamp:O,pollingInterval:d,timeout:setTimeout(()=>{(M.config.focused||!f)&&S.dispatch(r(b)),y({queryCacheKey:p},S)},d)})}function N({queryCacheKey:p},S){const b=S.getState()[e].queries[p],v=s.get(p);if(!b||b.status===ge)return;const{lowestPollingInterval:d}=_(v);if(process.env.NODE_ENV==="test"){const O=o.pollUpdateCounters??(o.pollUpdateCounters={});O[p]??(O[p]=0),O[p]++}if(!Number.isFinite(d)){g(p);return}const f=o.get(p),x=Date.now()+d;(!f||x<f.nextPollTimestamp)&&y({queryCacheKey:p},S)}function g(p){const S=o.get(p);S!=null&&S.timeout&&clearTimeout(S.timeout),o.delete(p)}function h(){for(const p of o.keys())g(p)}function _(p=new Map){let S=!1,M=Number.POSITIVE_INFINITY;for(const b of p.values())b.pollingInterval&&(M=Math.min(b.pollingInterval,M),S=b.skipPollingIfUnfocused||S);return{lowestPollingInterval:M,skipPollingIfUnfocused:S}}return u},Qc=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=Un(n,r),o=Qe(n,r),s=Ce(n,r),c={};return(u,l)=>{var y,N;if(i(u)){const{requestId:g,arg:{endpointName:h,originalArgs:_}}=u.meta,p=ze(t,h),S=p==null?void 0:p.onQueryStarted;if(S){const M={},b=new Promise((x,O)=>{M.resolve=x,M.reject=O});b.catch(()=>{}),c[g]=M;const v=e.endpoints[h].select(Wt(p)?_:g),d=l.dispatch((x,O,C)=>C),f={...l,getCacheEntry:()=>v(l.getState()),requestId:g,extra:d,updateCachedData:Wt(p)?x=>l.dispatch(e.util.updateQueryData(h,_,x)):void 0,queryFulfilled:b};S(_,f)}}else if(s(u)){const{requestId:g,baseQueryMeta:h}=u.meta;(y=c[g])==null||y.resolve({data:u.payload,meta:h}),delete c[g]}else if(o(u)){const{requestId:g,rejectedWithValue:h,baseQueryMeta:_}=u.meta;(N=c[g])==null||N.reject({error:u.payload??u.error,isUnhandledError:!h,meta:_}),delete c[g]}}},zc=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:o}=n.internalActions,s=(a,u)=>{Kn.match(a)&&c(u,"refetchOnFocus"),Gn.match(a)&&c(u,"refetchOnReconnect")};function c(a,u){const l=a.getState()[e],y=l.queries,N=i.currentSubscriptions;t.batch(()=>{for(const g of N.keys()){const h=y[g],_=N.get(g);if(!_||!h)continue;const p=[..._.values()];(p.some(M=>M[u]===!0)||p.every(M=>M[u]===void 0)&&l.config[u])&&(_.size===0?a.dispatch(o({queryCacheKey:g})):h.status!==ge&&a.dispatch(r(h)))}})}return s};function qc(e){const{reducerPath:t,queryThunk:n,api:r,context:i,getInternalState:o}=e,{apiUid:s}=i,c={invalidateTags:fe(`${t}/invalidateTags`)},a=N=>N.type.startsWith(`${t}/`),u=[Vc,Tc,Lc,Fc,jc,Qc];return{middleware:N=>{let g=!1;const h=o(N.dispatch),_={...e,internalState:h,refetchQuery:y,isThisApiSliceAction:a,mwApi:N},p=u.map(b=>b(_)),S=Dc(_),M=zc(_);return b=>v=>{if(!Qn(v))return b(v);g||(g=!0,N.dispatch(r.internalActions.middlewareRegistered(s)));const d={...N,next:b},f=N.getState(),[x,O]=S(v,d,f);let C;if(x?C=b(v):C=O,N.getState()[t]&&(M(v,d,f),a(v)||i.hasRehydrationInfo(v)))for(const E of p)E(v,d,f);return C}},actions:c};function y(N){return e.api.endpoints[N.endpointName].initiate(N.originalArgs,{subscribe:!1,forceRefetch:!0})}}var qr=Symbol(),Yi=({createSelector:e=Oi}={})=>({name:qr,init(t,{baseQuery:n,tagTypes:r,reducerPath:i,serializeQueryArgs:o,keepUnusedDataFor:s,refetchOnMountOrArgChange:c,refetchOnFocus:a,refetchOnReconnect:u,invalidationBehavior:l,onSchemaFailure:y,catchSchemaFailure:N,skipSchemaValidation:g},h){Es();const _=Q=>(typeof process<"u"&&process.env.NODE_ENV==="development"&&(r.includes(Q.type)||console.error(`Tag type '${Q.type}' was used, but not specified in \`tagTypes\`!`)),Q);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Gn,onOffline:zi,onFocus:Kn,onFocusLost:Qi},util:{}});const p=Rc({serializeQueryArgs:o,reducerPath:i,createSelector:e}),{selectInvalidatedBy:S,selectCachedArgsForQuery:M,buildQuerySelector:b,buildInfiniteQuerySelector:v,buildMutationSelector:d}=p;pe(t.util,{selectInvalidatedBy:S,selectCachedArgsForQuery:M});const{queryThunk:f,infiniteQueryThunk:x,mutationThunk:O,patchQueryData:C,updateQueryData:E,upsertQueryData:m,prefetch:w,buildMatchThunkActions:I}=Mc({baseQuery:n,reducerPath:i,context:h,api:t,serializeQueryArgs:o,assertTagType:_,selectors:p,onSchemaFailure:y,catchSchemaFailure:N,skipSchemaValidation:g}),{reducer:k,actions:D}=Pc({context:h,queryThunk:f,mutationThunk:O,serializeQueryArgs:o,reducerPath:i,assertTagType:_,config:{refetchOnFocus:a,refetchOnReconnect:u,refetchOnMountOrArgChange:c,keepUnusedDataFor:s,reducerPath:i,invalidationBehavior:l}});pe(t.util,{patchQueryData:C,updateQueryData:E,upsertQueryData:m,prefetch:w,resetApiState:D.resetApiState,upsertQueryEntries:D.cacheEntriesUpserted}),pe(t.internalActions,D);const A=new WeakMap,F=Q=>Ut(A,Q,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:T,buildInitiateInfiniteQuery:P,buildInitiateMutation:V,getRunningMutationThunk:L,getRunningMutationsThunk:H,getRunningQueriesThunk:K,getRunningQueryThunk:B}=kc({queryThunk:f,mutationThunk:O,infiniteQueryThunk:x,api:t,serializeQueryArgs:o,context:h,getInternalState:F});pe(t.util,{getRunningMutationThunk:L,getRunningMutationsThunk:H,getRunningQueryThunk:B,getRunningQueriesThunk:K});const{middleware:Y,actions:G}=qc({reducerPath:i,context:h,queryThunk:f,mutationThunk:O,infiniteQueryThunk:x,api:t,assertTagType:_,selectors:p,getRunningQueryThunk:B,getInternalState:F});return pe(t.util,G),pe(t,{reducer:k,middleware:Y}),{name:qr,injectEndpoint(Q,W){var U;const ee=(U=t.endpoints)[Q]??(U[Q]={});tn(W)&&pe(ee,{name:Q,select:b(Q,W),initiate:T(Q,W)},I(f,Q)),Nc(W)&&pe(ee,{name:Q,select:d(),initiate:V(Q)},I(O,Q)),bt(W)&&pe(ee,{name:Q,select:v(Q,W),initiate:P(Q,W)},I(f,Q))}}}});Yi();function It(e){return e.replace(e[0],e[0].toUpperCase())}function $c(e){let t=0;for(const n in e)t++;return t}var Uc="query",Wc="mutation",Hc="infinitequery";function Bc(e){return e.type===Uc}function Kc(e){return e.type===Wc}function Ji(e){return e.type===Hc}function We(e,...t){return Object.assign(e,...t)}var dn=Symbol();function pn(e){const t=j.useRef(e),n=j.useMemo(()=>Hn(t.current,e),[e]);return j.useEffect(()=>{t.current!==n&&(t.current=n)},[n]),n}function Le(e){const t=j.useRef(e);return j.useEffect(()=>{Je(t.current,e)||(t.current=e)},[e]),Je(t.current,e)?t.current:e}var Gc=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Yc=Gc(),Jc=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Zc=Jc(),Xc=()=>Yc||Zc?j.useLayoutEffect:j.useEffect,ea=Xc(),$r=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Li.pending}:e;function hn(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var mn=["data","status","isLoading","isSuccess","isError","error"];function ta({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:o,createSelector:s},serializeQueryArgs:c,context:a}){const u=o?f=>f():j.useEffect,l=f=>{var x,O;return(O=(x=f.current)==null?void 0:x.unsubscribe)==null?void 0:O.call(x)},y=a.endpointDefinitions;return{buildQueryHooks:b,buildInfiniteQueryHooks:v,buildMutationHook:d,usePrefetch:h};function N(f,x,O){if(x!=null&&x.endpointName&&f.isUninitialized){const{endpointName:k}=x,D=y[k];O!==le&&c({queryArgs:x.originalArgs,endpointDefinition:D,endpointName:k})===c({queryArgs:O,endpointDefinition:D,endpointName:k})&&(x=void 0)}let C=f.isSuccess?f.data:x==null?void 0:x.data;C===void 0&&(C=f.data);const E=C!==void 0,m=f.isLoading,w=(!x||x.isLoading||x.isUninitialized)&&!E&&m,I=f.isSuccess||E&&(m&&!(x!=null&&x.isError)||f.isUninitialized);return{...f,data:C,currentData:f.data,isFetching:m,isLoading:w,isSuccess:I}}function g(f,x,O){if(x!=null&&x.endpointName&&f.isUninitialized){const{endpointName:k}=x,D=y[k];O!==le&&c({queryArgs:x.originalArgs,endpointDefinition:D,endpointName:k})===c({queryArgs:O,endpointDefinition:D,endpointName:k})&&(x=void 0)}let C=f.isSuccess?f.data:x==null?void 0:x.data;C===void 0&&(C=f.data);const E=C!==void 0,m=f.isLoading,w=(!x||x.isLoading||x.isUninitialized)&&!E&&m,I=f.isSuccess||E&&(m&&!(x!=null&&x.isError)||f.isUninitialized);return{...f,data:C,currentData:f.data,isFetching:m,isLoading:w,isSuccess:I}}function h(f,x){const O=n(),C=Le(x);return j.useCallback((E,m)=>O(e.util.prefetch(f,E,{...C,...m})),[f,O,C])}function _(f,x,{refetchOnReconnect:O,refetchOnFocus:C,refetchOnMountOrArgChange:E,skip:m=!1,pollingInterval:w=0,skipPollingIfUnfocused:I=!1,...k}={}){const{initiate:D}=e.endpoints[f],A=n(),F=j.useRef(void 0);if(!F.current){const z=A(e.internalActions.internal_getRTKQSubscriptions());if(process.env.NODE_ENV!=="production"&&(typeof z!="object"||typeof(z==null?void 0:z.type)=="string"))throw new Error(process.env.NODE_ENV==="production"?$(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
|
|
42
|
-
You must add the middleware for RTK-Query to function correctly!`);
|
|
43
|
-
Hook ${c} was either not provided or not a function.`)}return{name:na,init(o,{serializeQueryArgs:s},c){const a=o,{buildQueryHooks:u,buildInfiniteQueryHooks:l,buildMutationHook:y,usePrefetch:N}=ta({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:s,context:c});return We(a,{usePrefetch:N}),We(c,{batch:e}),{injectEndpoint(g,h){if(Bc(h)){const{useQuery:_,useLazyQuery:p,useLazyQuerySubscription:S,useQueryState:M,useQuerySubscription:b}=u(g);We(a.endpoints[g],{useQuery:_,useLazyQuery:p,useLazyQuerySubscription:S,useQueryState:M,useQuerySubscription:b}),o[`use${It(g)}Query`]=_,o[`useLazy${It(g)}Query`]=p}if(Kc(h)){const _=y(g);We(a.endpoints[g],{useMutation:_}),o[`use${It(g)}Mutation`]=_}else if(Ji(h)){const{useInfiniteQuery:_,useInfiniteQuerySubscription:p,useInfiniteQueryState:S}=l(g);We(a.endpoints[g],{useInfiniteQuery:_,useInfiniteQuerySubscription:p,useInfiniteQueryState:S}),o[`use${It(g)}InfiniteQuery`]=_}}}}}},ia=Gi(Yi(),ra());const Zi="/webhook/api/v1/chat";function oa(e){return(typeof e=="string"?e:e.url)===Zi}function sa(e){return e.split(/[?#]/)[0].replace(/\/+$/,"").endsWith(Zi)}function ca(e,t){return!oa(e)||!sa(t)?e:typeof e=="string"?"":{...e,url:""}}const aa=async(e,t,n)=>{const{baseUrl:r,getToken:i}=Bo(),o=ca(e,r);return xc({baseUrl:r,prepareHeaders:async c=>{const a=await(i==null?void 0:i());return a&&c.set("Authorization",`Bearer ${a}`),c}})(o,t,n)},ua=["ChatHistory"],Xi={ChatHistory:"ChatHistory"},Ur=e=>{var t,n;return{status:e==null?void 0:e.status,message:((t=e==null?void 0:e.data)==null?void 0:t.message)??((n=e==null?void 0:e.data)==null?void 0:n.error)??(e==null?void 0:e.error)??"Something went wrong. Please try again."}},la=["answer","message","text","content"],fa=["data","response","output","result","reply"];function da(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function pa(e){if(!e||typeof e!="object"){const n=typeof e=="string"?e:"";return n.trim()?{answer:n.trim()}:{}}const t=e;for(const n of la){const r=t[n];if(typeof r=="string"&&r.trim())return{...t,answer:r.trim()}}for(const n of fa){const r=t[n];if(r){const i=eo(r);if(i.answer||i.chat_session_id)return{...t,...i,chat_session_id:i.chat_session_id??t.chat_session_id}}}return t}function eo(e){const t=da(e),n=Array.isArray(t)?t:[t];for(const r of n){const i=pa(r);if(i.answer||i.chat_session_id)return i}return{}}const ha={sendMessage:{getUrl:()=>"/webhook/api/v1/chat",method:"POST",transformResponse:e=>eo(e),invalidatesTags:[Xi.ChatHistory]}},ma={getChatHistory:{getUrl:({conversationId:e})=>`/chat/conversations/${e}`,method:"GET",transformResponse:e=>e,providesTags:[Xi.ChatHistory]}},ya={submitFeedback:{getUrl:()=>"/chat/feedback",method:"POST",transformResponse:e=>e}},Wr={...ha,...ya},Hr={...ma},Pt=ia({reducerPath:"mintAiApi",baseQuery:aa,tagTypes:ua,endpoints:e=>{const t={};return Object.keys(Wr).forEach(n=>{const r=Wr[n];t[n]=e.mutation({query:i=>({url:r.getUrl(i),method:r.method,body:i}),transformResponse:i=>r.transformResponse(i),transformErrorResponse:i=>{var o;return((o=r.transformErrorResponse)==null?void 0:o.call(r,i))??Ur(i)},invalidatesTags:r.invalidatesTags??[]})}),Object.keys(Hr).forEach(n=>{const r=Hr[n];t[n]=e.query({query:i=>({url:r.getUrl(i),method:r.method}),transformResponse:i=>r.transformResponse(i),transformErrorResponse:i=>Ur(i),providesTags:r.providesTags??[]})}),t}}),{useSendMessageMutation:ga}=Pt,Br={open:!1,expanded:!1,conversationId:void 0,messages:[],draft:""},to=ke({name:"chatUi",initialState:Br,reducers:{setOpen(e,t){e.open=t.payload,t.payload||(e.expanded=!1)},setExpanded(e,t){e.expanded=t.payload,t.payload&&(e.open=!0)},toggleOpen(e){e.open=!e.open,e.open||(e.expanded=!1)},setConversationId(e,t){e.conversationId=t.payload},setDraft(e,t){e.draft=t.payload},addMessage(e,t){e.messages.push(t.payload)},updateMessage(e,t){const n=e.messages.find(r=>r.id===t.payload.id);n&&Object.assign(n,t.payload.changes)},setMessages(e,t){e.messages=t.payload},resetChat(){return Br}}}),{setOpen:Jn,setExpanded:no,toggleOpen:ba,setConversationId:Kr,setDraft:ro,addMessage:yn,updateMessage:Gr,setMessages:Hu,resetChat:Bu}=to.actions,va=to.reducer,wa=Ks({reducer:{[Pt.reducerPath]:Pt.reducer,chatUi:va},middleware:e=>e().concat(Pt.middleware)});function Ea({config:e,children:t}){return R.jsx(zo,{store:wa,children:R.jsx(Go,{config:e,children:R.jsx("div",{className:"mint-ai-root",children:t})})})}const vt=()=>fi(),Ht=di;function io(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=io(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Sa(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=io(e))&&(r&&(r+=" "),r+=t);return r}function _e(...e){return Sa(e)}const oo=Object.freeze({left:0,top:0,width:16,height:16}),Bt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Zn=Object.freeze({...oo,...Bt}),Dn=Object.freeze({...Zn,body:"",hidden:!1});function xa(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function Yr(e,t){const n=xa(e,t);for(const r in Dn)r in Bt?r in e&&!(r in n)&&(n[r]=Bt[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function Ca(e,t){const n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function o(s){if(n[s])return i[s]=[];if(!(s in i)){i[s]=null;const c=r[s]&&r[s].parent,a=c&&o(c);a&&(i[s]=[c].concat(a))}return i[s]}return Object.keys(n).concat(Object.keys(r)).forEach(o),i}function _a(e,t,n){const r=e.icons,i=e.aliases||Object.create(null);let o={};function s(c){o=Yr(r[c]||i[c],o)}return s(t),n.forEach(s),Yr(e,o)}function so(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(i=>{t(i,null),n.push(i)});const r=Ca(e);for(const i in r){const o=r[i];o&&(t(i,_a(e,i,o)),n.push(i))}return n}const Na={provider:"",aliases:{},not_found:{},...oo};function gn(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function co(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!gn(e,Na))return null;const n=t.icons;for(const i in n){const o=n[i];if(!i||typeof o.body!="string"||!gn(o,Dn))return null}const r=t.aliases||Object.create(null);for(const i in r){const o=r[i],s=o.parent;if(!i||typeof s!="string"||!n[s]&&!r[s]||!gn(o,Dn))return null}return t}const ao=/^[a-z0-9]+(-[a-z0-9]+)*$/,nn=(e,t,n,r="")=>{const i=e.split(":");if(e.slice(0,1)==="@"){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){const c=i.pop(),a=i.pop(),u={provider:i.length>0?i[0]:r,prefix:a,name:c};return t&&!Rt(u)?null:u}const o=i[0],s=o.split("-");if(s.length>1){const c={provider:r,prefix:s.shift(),name:s.join("-")};return t&&!Rt(c)?null:c}if(n&&r===""){const c={provider:r,prefix:"",name:o};return t&&!Rt(c,n)?null:c}return null},Rt=(e,t)=>e?!!((t&&e.prefix===""||e.prefix)&&e.name):!1,Jr=Object.create(null);function Oa(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function qe(e,t){const n=Jr[e]||(Jr[e]=Object.create(null));return n[t]||(n[t]=Oa(e,t))}function uo(e,t){return co(t)?so(t,(n,r)=>{r?e.icons[n]=r:e.missing.add(n)}):[]}function Ia(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let ut=!1;function lo(e){return typeof e=="boolean"&&(ut=e),ut}function Zr(e){const t=typeof e=="string"?nn(e,!0,ut):e;if(t){const n=qe(t.provider,t.prefix),r=t.name;return n.icons[r]||(n.missing.has(r)?null:void 0)}}function ka(e,t){const n=nn(e,!0,ut);if(!n)return!1;const r=qe(n.provider,n.prefix);return t?Ia(r,n.name,t):(r.missing.add(n.name),!0)}function Xn(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ut&&!t&&!e.prefix){let i=!1;return co(e)&&(e.prefix="",so(e,(o,s)=>{ka(o,s)&&(i=!0)})),i}const n=e.prefix;if(!Rt({prefix:n,name:"a"}))return!1;const r=qe(t,n);return!!uo(r,e)}const fo=Object.freeze({width:null,height:null}),po=Object.freeze({...fo,...Bt}),Ma=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Pa=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Xr(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const r=e.split(Ma);if(r===null||!r.length)return e;const i=[];let o=r.shift(),s=Pa.test(o);for(;;){if(s){const c=parseFloat(o);isNaN(c)?i.push(o):i.push(Math.ceil(c*t*n)/n)}else i.push(o);if(o=r.shift(),o===void 0)return i.join("");s=!s}}function Ra(e,t="defs"){let n="";const r=e.indexOf("<"+t);for(;r>=0;){const i=e.indexOf(">",r),o=e.indexOf("</"+t);if(i===-1||o===-1)break;const s=e.indexOf(">",o);if(s===-1)break;n+=e.slice(i+1,o).trim(),e=e.slice(0,r).trim()+e.slice(s+1)}return{defs:n,content:e}}function Da(e,t){return e?"<defs>"+e+"</defs>"+t:t}function Aa(e,t,n){const r=Ra(e);return Da(r.defs,t+r.content+n)}const Ta=e=>e==="unset"||e==="undefined"||e==="none";function ja(e,t){const n={...Zn,...e},r={...po,...t},i={left:n.left,top:n.top,width:n.width,height:n.height};let o=n.body;[n,r].forEach(_=>{const p=[],S=_.hFlip,M=_.vFlip;let b=_.rotate;S?M?b+=2:(p.push("translate("+(i.width+i.left).toString()+" "+(0-i.top).toString()+")"),p.push("scale(-1 1)"),i.top=i.left=0):M&&(p.push("translate("+(0-i.left).toString()+" "+(i.height+i.top).toString()+")"),p.push("scale(1 -1)"),i.top=i.left=0);let v;switch(b<0&&(b-=Math.floor(b/4)*4),b=b%4,b){case 1:v=i.height/2+i.top,p.unshift("rotate(90 "+v.toString()+" "+v.toString()+")");break;case 2:p.unshift("rotate(180 "+(i.width/2+i.left).toString()+" "+(i.height/2+i.top).toString()+")");break;case 3:v=i.width/2+i.left,p.unshift("rotate(-90 "+v.toString()+" "+v.toString()+")");break}b%2===1&&(i.left!==i.top&&(v=i.left,i.left=i.top,i.top=v),i.width!==i.height&&(v=i.width,i.width=i.height,i.height=v)),p.length&&(o=Aa(o,'<g transform="'+p.join(" ")+'">',"</g>"))});const s=r.width,c=r.height,a=i.width,u=i.height;let l,y;s===null?(y=c===null?"1em":c==="auto"?u:c,l=Xr(y,a/u)):(l=s==="auto"?a:s,y=c===null?Xr(l,u/a):c==="auto"?u:c);const N={},g=(_,p)=>{Ta(p)||(N[_]=p.toString())};g("width",l),g("height",y);const h=[i.left,i.top,a,u];return N.viewBox=h.join(" "),{attributes:N,viewBox:h,body:o}}const Va=/\sid="(\S+)"/g,La="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let Fa=0;function Qa(e,t=La){const n=[];let r;for(;r=Va.exec(e);)n.push(r[1]);if(!n.length)return e;const i="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(o=>{const s=typeof t=="function"?t(o):t+(Fa++).toString(),c=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+c+')([")]|\\.[a-z])',"g"),"$1"+s+i+"$3")}),e=e.replace(new RegExp(i,"g"),""),e}const An=Object.create(null);function za(e,t){An[e]=t}function Tn(e){return An[e]||An[""]}function er(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const tr=Object.create(null),He=["https://api.simplesvg.com","https://api.unisvg.com"],Dt=[];for(;He.length>0;)He.length===1||Math.random()>.5?Dt.push(He.shift()):Dt.push(He.pop());tr[""]=er({resources:["https://api.iconify.design"].concat(Dt)});function qa(e,t){const n=er(t);return n===null?!1:(tr[e]=n,!0)}function nr(e){return tr[e]}const $a=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ei=$a();function Ua(e,t){const n=nr(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let i=0;n.resources.forEach(s=>{i=Math.max(i,s.length)});const o=t+".json?icons=";r=n.maxURL-i-n.path.length-o.length}return r}function Wa(e){return e===404}const Ha=(e,t,n)=>{const r=[],i=Ua(e,t),o="icons";let s={type:o,provider:e,prefix:t,icons:[]},c=0;return n.forEach((a,u)=>{c+=a.length+1,c>=i&&u>0&&(r.push(s),s={type:o,provider:e,prefix:t,icons:[]},c=a.length),s.icons.push(a)}),r.push(s),r};function Ba(e){if(typeof e=="string"){const t=nr(e);if(t)return t.path}return"/"}const Ka=(e,t,n)=>{if(!ei){n("abort",424);return}let r=Ba(t.provider);switch(t.type){case"icons":{const o=t.prefix,c=t.icons.join(","),a=new URLSearchParams({icons:c});r+=o+".json?"+a.toString();break}case"custom":{const o=t.uri;r+=o.slice(0,1)==="/"?o.slice(1):o;break}default:n("abort",400);return}let i=503;ei(e+r).then(o=>{const s=o.status;if(s!==200){setTimeout(()=>{n(Wa(s)?"abort":"next",s)});return}return i=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?n("abort",o):n("next",i)});return}setTimeout(()=>{n("success",o)})}).catch(()=>{n("next",i)})},Ga={prepare:Ha,send:Ka};function Ya(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((i,o)=>i.provider!==o.provider?i.provider.localeCompare(o.provider):i.prefix!==o.prefix?i.prefix.localeCompare(o.prefix):i.name.localeCompare(o.name));let r={provider:"",prefix:"",name:""};return e.forEach(i=>{if(r.name===i.name&&r.prefix===i.prefix&&r.provider===i.provider)return;r=i;const o=i.provider,s=i.prefix,c=i.name,a=n[o]||(n[o]=Object.create(null)),u=a[s]||(a[s]=qe(o,s));let l;c in u.icons?l=t.loaded:s===""||u.missing.has(c)?l=t.missing:l=t.pending;const y={provider:o,prefix:s,name:c};l.push(y)}),t}function ho(e,t){e.forEach(n=>{const r=n.loaderCallbacks;r&&(n.loaderCallbacks=r.filter(i=>i.id!==t))})}function Ja(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const r=e.provider,i=e.prefix;t.forEach(o=>{const s=o.icons,c=s.pending.length;s.pending=s.pending.filter(a=>{if(a.prefix!==i)return!0;const u=a.name;if(e.icons[u])s.loaded.push({provider:r,prefix:i,name:u});else if(e.missing.has(u))s.missing.push({provider:r,prefix:i,name:u});else return n=!0,!0;return!1}),s.pending.length!==c&&(n||ho([e],o.id),o.callback(s.loaded.slice(0),s.missing.slice(0),s.pending.slice(0),o.abort))})}))}let Za=0;function Xa(e,t,n){const r=Za++,i=ho.bind(null,n,r);if(!t.pending.length)return i;const o={id:r,icons:t,callback:e,abort:i};return n.forEach(s=>{(s.loaderCallbacks||(s.loaderCallbacks=[])).push(o)}),i}function eu(e,t=!0,n=!1){const r=[];return e.forEach(i=>{const o=typeof i=="string"?nn(i,t,n):i;o&&r.push(o)}),r}var tu={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function nu(e,t,n,r){const i=e.resources.length,o=e.random?Math.floor(Math.random()*i):e.index;let s;if(e.random){let f=e.resources.slice(0);for(s=[];f.length>1;){const x=Math.floor(Math.random()*f.length);s.push(f[x]),f=f.slice(0,x).concat(f.slice(x+1))}s=s.concat(f)}else s=e.resources.slice(o).concat(e.resources.slice(0,o));const c=Date.now();let a="pending",u=0,l,y=null,N=[],g=[];typeof r=="function"&&g.push(r);function h(){y&&(clearTimeout(y),y=null)}function _(){a==="pending"&&(a="aborted"),h(),N.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),N=[]}function p(f,x){x&&(g=[]),typeof f=="function"&&g.push(f)}function S(){return{startTime:c,payload:t,status:a,queriesSent:u,queriesPending:N.length,subscribe:p,abort:_}}function M(){a="failed",g.forEach(f=>{f(void 0,l)})}function b(){N.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),N=[]}function v(f,x,O){const C=x!=="success";switch(N=N.filter(E=>E!==f),a){case"pending":break;case"failed":if(C||!e.dataAfterTimeout)return;break;default:return}if(x==="abort"){l=O,M();return}if(C){l=O,N.length||(s.length?d():M());return}if(h(),b(),!e.random){const E=e.resources.indexOf(f.resource);E!==-1&&E!==e.index&&(e.index=E)}a="completed",g.forEach(E=>{E(O)})}function d(){if(a!=="pending")return;h();const f=s.shift();if(f===void 0){if(N.length){y=setTimeout(()=>{h(),a==="pending"&&(b(),M())},e.timeout);return}M();return}const x={status:"pending",resource:f,callback:(O,C)=>{v(x,O,C)}};N.push(x),u++,y=setTimeout(d,e.rotate),n(f,t,x.callback)}return setTimeout(d),S}function mo(e){const t={...tu,...e};let n=[];function r(){n=n.filter(c=>c().status==="pending")}function i(c,a,u){const l=nu(t,c,a,(y,N)=>{r(),u&&u(y,N)});return n.push(l),l}function o(c){return n.find(a=>c(a))||null}return{query:i,find:o,setIndex:c=>{t.index=c},getIndex:()=>t.index,cleanup:r}}function ti(){}const bn=Object.create(null);function ru(e){if(!bn[e]){const t=nr(e);if(!t)return;const n=mo(t),r={config:t,redundancy:n};bn[e]=r}return bn[e]}function iu(e,t,n){let r,i;if(typeof e=="string"){const o=Tn(e);if(!o)return n(void 0,424),ti;i=o.send;const s=ru(e);s&&(r=s.redundancy)}else{const o=er(e);if(o){r=mo(o);const s=e.resources?e.resources[0]:"",c=Tn(s);c&&(i=c.send)}}return!r||!i?(n(void 0,424),ti):r.query(t,i,n)().abort}function ni(){}function ou(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Ja(e)}))}function su(e){const t=[],n=[];return e.forEach(r=>{(r.match(ao)?t:n).push(r)}),{valid:t,invalid:n}}function Be(e,t,n){function r(){const i=e.pendingIcons;t.forEach(o=>{i&&i.delete(o),e.icons[o]||e.missing.add(o)})}if(n&&typeof n=="object")try{if(!uo(e,n).length){r();return}}catch(i){console.error(i)}r(),ou(e)}function ri(e,t){e instanceof Promise?e.then(n=>{t(n)}).catch(()=>{t(null)}):t(e)}function cu(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:r}=e,i=e.iconsToLoad;if(delete e.iconsToLoad,!i||!i.length)return;const o=e.loadIcon;if(e.loadIcons&&(i.length>1||!o)){ri(e.loadIcons(i,r,n),l=>{Be(e,i,l)});return}if(o){i.forEach(l=>{const y=o(l,r,n);ri(y,N=>{const g=N?{prefix:r,icons:{[l]:N}}:null;Be(e,[l],g)})});return}const{valid:s,invalid:c}=su(i);if(c.length&&Be(e,c,null),!s.length)return;const a=r.match(ao)?Tn(n):null;if(!a){Be(e,s,null);return}a.prepare(n,r,s).forEach(l=>{iu(n,l,y=>{Be(e,l.icons,y)})})}))}const au=(e,t)=>{const n=eu(e,!0,lo()),r=Ya(n);if(!r.pending.length){let a=!0;return t&&setTimeout(()=>{a&&t(r.loaded,r.missing,r.pending,ni)}),()=>{a=!1}}const i=Object.create(null),o=[];let s,c;return r.pending.forEach(a=>{const{provider:u,prefix:l}=a;if(l===c&&u===s)return;s=u,c=l,o.push(qe(u,l));const y=i[u]||(i[u]=Object.create(null));y[l]||(y[l]=[])}),r.pending.forEach(a=>{const{provider:u,prefix:l,name:y}=a,N=qe(u,l),g=N.pendingIcons||(N.pendingIcons=new Set);g.has(y)||(g.add(y),i[u][l].push(y))}),o.forEach(a=>{const u=i[a.provider][a.prefix];u.length&&cu(a,u)}),t?Xa(t,r,o):ni};function uu(e,t){const n={...e};for(const r in t){const i=t[r],o=typeof i;r in fo?(i===null||i&&(o==="string"||o==="number"))&&(n[r]=i):o===typeof n[r]&&(n[r]=r==="rotate"?i%4:i)}return n}const lu=/[\s,]+/;function fu(e,t){t.split(lu).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function du(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function r(i){for(;i<0;)i+=4;return i%4}if(n===""){const i=parseInt(e);return isNaN(i)?0:r(i)}else if(n!==e){let i=0;switch(n){case"%":i=25;break;case"deg":i=90}if(i){let o=parseFloat(e.slice(0,e.length-n.length));return isNaN(o)?0:(o=o/i,o%1===0?r(o):0)}}return t}function pu(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in t)n+=" "+r+'="'+t[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}function hu(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function mu(e){return"data:image/svg+xml,"+hu(e)}function yu(e){return'url("'+mu(e)+'")'}let tt;function gu(){try{tt=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{tt=null}}function bu(e){return tt===void 0&&gu(),tt?tt.createHTML(e):e}const yo={...po,inline:!1},vu={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},wu={display:"inline-block"},jn={backgroundColor:"currentColor"},go={backgroundColor:"transparent"},ii={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},oi={WebkitMask:jn,mask:jn,background:go};for(const e in oi){const t=oi[e];for(const n in ii)t[e+n]=ii[n]}const Eu={...yo,inline:!0};function si(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}const Su=(e,t,n)=>{const r=t.inline?Eu:yo,i=uu(r,t),o=t.mode||"svg",s={},c=t.style||{},a={...o==="svg"?vu:{}};if(n){const p=nn(n,!1,!0);if(p){const S=["iconify"],M=["provider","prefix"];for(const b of M)p[b]&&S.push("iconify--"+p[b]);a.className=S.join(" ")}}for(let p in t){const S=t[p];if(S!==void 0)switch(p){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":break;case"_ref":a.ref=S;break;case"className":a[p]=(a[p]?a[p]+" ":"")+S;break;case"inline":case"hFlip":case"vFlip":i[p]=S===!0||S==="true"||S===1;break;case"flip":typeof S=="string"&&fu(i,S);break;case"color":s.color=S;break;case"rotate":typeof S=="string"?i[p]=du(S):typeof S=="number"&&(i[p]=S);break;case"ariaHidden":case"aria-hidden":S!==!0&&S!=="true"&&delete a["aria-hidden"];break;default:r[p]===void 0&&(a[p]=S)}}const u=ja(e,i),l=u.attributes;if(i.inline&&(s.verticalAlign="-0.125em"),o==="svg"){a.style={...s,...c},Object.assign(a,l);let p=0,S=t.id;return typeof S=="string"&&(S=S.replace(/-/g,"_")),a.dangerouslySetInnerHTML={__html:bu(Qa(u.body,S?()=>S+"ID"+p++:"iconifyReact"))},j.createElement("svg",a)}const{body:y,width:N,height:g}=e,h=o==="mask"||(o==="bg"?!1:y.indexOf("currentColor")!==-1),_=pu(y,{...l,width:N+"",height:g+""});return a.style={...s,"--svg":yu(_),width:si(l.width),height:si(l.height),...wu,...h?jn:go,...c},j.createElement("span",a)};lo(!0);za("",Ga);if(typeof document<"u"&&typeof window<"u"){const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(r=>{try{(typeof r!="object"||r===null||r instanceof Array||typeof r.icons!="object"||typeof r.prefix!="string"||!Xn(r))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const r="IconifyProviders["+n+"] is invalid.";try{const i=t[n];if(typeof i!="object"||!i||i.resources===void 0)continue;qa(n,i)||console.error(r)}catch{console.error(r)}}}}function bo(e){const[t,n]=j.useState(!!e.ssr),[r,i]=j.useState({});function o(g){if(g){const h=e.icon;if(typeof h=="object")return{name:"",data:h};const _=Zr(h);if(_)return{name:h,data:_}}return{name:""}}const[s,c]=j.useState(o(!!e.ssr));function a(){const g=r.callback;g&&(g(),i({}))}function u(g){if(JSON.stringify(s)!==JSON.stringify(g))return a(),c(g),!0}function l(){var g;const h=e.icon;if(typeof h=="object"){u({name:"",data:h});return}const _=Zr(h);if(u({name:h,data:_}))if(_===void 0){const p=au([h],l);i({callback:p})}else _&&((g=e.onLoad)===null||g===void 0||g.call(e,h))}j.useEffect(()=>(n(!0),a),[]),j.useEffect(()=>{t&&l()},[e.icon,t]);const{name:y,data:N}=s;return N?Su({...Zn,...N},e,y):e.children?e.children:e.fallback?e.fallback:j.createElement("span",{})}const xu=j.forwardRef((e,t)=>bo({...e,_ref:t}));j.forwardRef((e,t)=>bo({inline:!0,...e,_ref:t}));const Vn={prefix:"solar",width:24,height:24,icons:{"chat-round-dots-bold":{body:'<defs><mask id="SVG4jZNKdNp"><g fill="none"><path fill="#fff" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12c0 1.6.376 3.112 1.043 4.453c.178.356.237.763.134 1.148l-.595 2.226a1.3 1.3 0 0 0 1.591 1.592l2.226-.596a1.63 1.63 0 0 1 1.149.133A9.96 9.96 0 0 0 12 22"/><path fill="#000" d="M15 12a1 1 0 1 0 2 0a1 1 0 0 0-2 0m-4 0a1 1 0 1 0 2 0a1 1 0 0 0-2 0m-4 0a1 1 0 1 0 2 0a1 1 0 0 0-2 0"/></g></mask></defs><path fill="currentColor" d="M0 0h24v24H0z" mask="url(#SVG4jZNKdNp)"/>'},"plain-2-bold":{body:'<path fill="currentColor" d="m17.498 18.485l3.13-9.391c.791-2.373 1.331-3.994 1.37-5.115c.013-.377-.414-.503-.68-.236l-14.46 14.46c-.233.233-.177.626.14.716q.047.013.095.024c.5.123 1.153.034 2.46-.143l.07-.01c.369-.05.553-.075.73-.064c.32.02.63.124.898.303c.147.098.279.23.541.492l.252.252c1.51 1.51 2.265 2.265 3.066 2.226c.22-.011.438-.062.64-.151c.734-.324 1.072-1.337 1.747-3.363M14.906 3.372l-9.331 3.11c-2.082.694-3.123 1.041-3.439 1.804q-.112.271-.133.564c-.059.824.717 1.6 2.269 3.151l.283.283c.254.255.382.382.478.524c.19.28.297.606.31.944c.008.171-.019.35-.072.705c-.196 1.304-.294 1.956-.179 2.458l.013.052c.081.325.48.387.717.15L20.257 2.683c.267-.267.141-.694-.236-.68c-1.121.038-2.742.578-5.115 1.369"/>'},"magnifer-linear":{body:'<g fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="11.5" cy="11.5" r="9.5"/><path stroke-linecap="round" d="M18.5 18.5L22 22"/></g>'},"magic-stick-bold":{body:'<path fill="currentColor" d="M16.714 2.127c-.836-.43-1.922.263-4.095 1.65l-.562.36c-.618.394-.927.591-1.273.648c-.347.056-.692-.034-1.382-.215l-.628-.164C6.345 3.769 5.13 3.45 4.436 4.13s-.412 1.908.157 4.363l.147.635c.161.697.242 1.046.177 1.393c-.066.346-.27.65-.68 1.26l-.372.555c-1.439 2.145-2.158 3.217-1.753 4.067c.406.85 1.668.915 4.192 1.045l.654.033c.717.037 1.076.056 1.382.213c.306.158.524.436.962.994l.398.507c1.539 1.962 2.309 2.943 3.255 2.788c.945-.154 1.441-1.342 2.433-3.717l.257-.614c.282-.675.422-1.012.677-1.261c.255-.25.595-.382 1.274-.647l.618-.24c2.39-.933 3.586-1.4 3.765-2.345s-.777-1.744-2.688-3.342l-.495-.413c-.543-.454-.815-.68-.963-.992s-.158-.672-.175-1.393l-.016-.657c-.062-2.538-.093-3.806-.928-4.236M19.53 18.47a.75.75 0 1 0-1.06 1.06l2 2a.75.75 0 1 0 1.06-1.06z"/>'},"history-linear":{body:'<g fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 8v4l2.5 2.5"/><path fill="currentColor" d="m5.604 5.604l-.53-.53zM4.338 6.871l-.75.003a.75.75 0 0 0 .746.747zm2.542.762a.75.75 0 1 0 .007-1.5zM5.075 4.321a.75.75 0 1 0-1.5.008zm-1.248 6.464a.75.75 0 1 0-1.486-.204zm15.035-5.647c-3.82-3.82-9.993-3.86-13.788-.064l1.06 1.06c3.2-3.199 8.423-3.18 11.668.064zM5.138 18.862c3.82 3.82 9.993 3.86 13.788.064l-1.06-1.06c-3.2 3.199-8.423 3.18-11.668-.064zm13.788.064c3.795-3.795 3.756-9.968-.064-13.788l-1.06 1.06c3.244 3.245 3.263 8.468.064 11.668zM5.074 5.074L3.807 6.34L4.868 7.4l1.266-1.266zm-.74 2.547l2.546.012l.007-1.5l-2.545-.012zm.754-.754L5.075 4.32l-1.5.008l.013 2.545zM2.34 10.58a9.81 9.81 0 0 0 2.797 8.281l1.06-1.06a8.31 8.31 0 0 1-2.371-7.017z"/></g>'},"earth-linear":{body:'<g fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="10"/><path d="M6 4.71c.78.711 2.388 2.653 2.575 4.737C8.75 11.396 10.035 12.98 12 13c.755.008 1.518-.537 1.516-1.292c0-.233-.039-.472-.099-.692A1.4 1.4 0 0 1 13.5 10c.61-1.257 1.81-1.595 2.76-2.278c.421-.303.806-.623.975-.88c.469-.71.937-2.131.703-2.842M22 13c-.33.931-.562 3.375-4.282 3.414c0 0-3.293 0-4.281 1.862c-.791 1.49-.33 3.103 0 3.724"/></g>'},"bolt-bold":{body:'<path fill="currentColor" d="m5.67 9.914l3.062-4.143c1.979-2.678 2.969-4.017 3.892-3.734s.923 1.925.923 5.21v.31c0 1.185 0 1.777.379 2.148l.02.02c.387.363 1.003.363 2.236.363c2.22 0 3.329 0 3.704.673l.018.034c.354.683-.289 1.553-1.574 3.29l-3.062 4.144c-1.98 2.678-2.969 4.017-3.892 3.734s-.923-1.925-.923-5.21v-.31c0-1.185 0-1.777-.379-2.148l-.02-.02c-.387-.363-1.003-.363-2.236-.363c-2.22 0-3.329 0-3.703-.673l-.019-.034c-.354-.683.289-1.552 1.574-3.29"/>'},"waterdrop-linear":{body:'<g fill="none" stroke="currentColor" stroke-width="1.5"><path d="M3 13.193C3 18.057 6.855 22 11.612 22h.777C17.145 22 21 18.057 21 13.193v-.265c0-4.611-2.729-8.765-6.903-10.507a5.43 5.43 0 0 0-4.194 0C5.73 4.163 3 8.317 3 12.928z"/><path stroke-linecap="round" d="M7.615 10.724c.634-2.006 2.016-3.636 3.77-4.448"/></g>'},"paperclip-linear":{body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="m7.918 17.807l7.89-7.553a2.253 2.253 0 0 0 0-3.284a2.503 2.503 0 0 0-3.43 0l-7.834 7.498a4.28 4.28 0 0 0 0 6.24c1.8 1.723 4.718 1.723 6.518 0l7.949-7.608c2.652-2.54 2.652-6.656 0-9.196s-6.954-2.539-9.607 0L3 10.034"/>'},"arrow-up-linear":{body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 20V4m0 0l6 6m-6-6l-6 6"/>'}}},Ln={prefix:"mingcute",width:24,height:24,icons:{"down-line":{body:'<g fill="none" fill-rule="evenodd"><path d="M24 0v24H0V0zM12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M12.707 15.707a1 1 0 0 1-1.414 0L5.636 10.05A1 1 0 1 1 7.05 8.636l4.95 4.95l4.95-4.95a1 1 0 0 1 1.414 1.414z"/></g>'},"code-line":{body:'<g fill="none"><path d="M0 0h24v24H0z"/><path fill="currentColor" d="M14.486 3.143a1 1 0 0 1 .692 1.233l-4.43 15.788a1 1 0 0 1-1.926-.54l4.43-15.788a1 1 0 0 1 1.234-.693M7.207 7.05a1 1 0 0 1 0 1.414L3.672 12l3.535 3.535a1 1 0 1 1-1.414 1.415L1.55 12.707a1 1 0 0 1 0-1.414L5.793 7.05a1 1 0 0 1 1.414 0m9.586 1.414a1 1 0 1 1 1.414-1.414l4.243 4.243a1 1 0 0 1 0 1.414l-4.243 4.243a1 1 0 0 1-1.414-1.415L20.328 12z"/></g>'},"close-line":{body:'<g fill="none" fill-rule="evenodd"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="m12 13.414l5.657 5.657a1 1 0 0 0 1.414-1.414L13.414 12l5.657-5.657a1 1 0 0 0-1.414-1.414L12 10.586L6.343 4.929A1 1 0 0 0 4.93 6.343L10.586 12l-5.657 5.657a1 1 0 1 0 1.414 1.414z"/></g>'},"add-line":{body:'<g fill="none"><path d="m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"/><path fill="currentColor" d="M11 20a1 1 0 1 0 2 0v-7h7a1 1 0 1 0 0-2h-7V4a1 1 0 1 0-2 0v7H4a1 1 0 1 0 0 2h7z"/></g>'}}};Xn(Vn);Xn(Ln);const Cu={[Vn.prefix]:Vn,[Ln.prefix]:Ln};function _u(e){var r;if(typeof e!="string")return null;const[t,n]=e.split(":");return!t||!n?null:((r=Cu[t])==null?void 0:r.icons[n])??null}function Kt({className:e,icon:t,width:n=20,height:r=n,...i}){const o=_u(t);return o?R.jsx("svg",{"aria-hidden":"true",className:_e("mint-inline-block mint-shrink-0",e),width:n,height:r,viewBox:"0 0 24 24",dangerouslySetInnerHTML:{__html:o.body},...i}):R.jsx(xu,{className:_e("mint-inline-block mint-shrink-0",e),icon:t,width:n,height:r,...i})}const rr=`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
41
|
+
If you have multiple apis, you *have* to specify the reducerPath option when using createApi!`:""}`)},Ho=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:i,api:s,assertTagType:o,refetchQuery:a,internalState:c})=>{const{removeQueryResult:l}=s.internalActions,f=ve(je(r),Bt(r)),S=ve(je(i,r),qe(i,r));let C=[],x=0;const p=(O,P)=>{(i.pending.match(O)||r.pending.match(O))&&x++,S(O)&&(x=Math.max(0,x-1)),f(O)?m(pi(O,"invalidatesTags",n,o),P):S(O)?m([],P):s.util.invalidateTags.match(O)&&m(Rn(O.payload,void 0,void 0,void 0,void 0,o),P)};function N(){return x>0}function m(O,P){const b=P.getState(),g=b[e];if(C.push(...O),g.config.invalidationBehavior==="delayed"&&N())return;const u=C;if(C=[],u.length===0)return;const d=s.util.selectInvalidatedBy(b,u);t.batch(()=>{const E=Array.from(d.values());for(const{queryCacheKey:j}of E){const v=g.queries[j],w=Qt(c.currentSubscriptions,j,wn);v&&(w.size===0?P.dispatch(l({queryCacheKey:j})):v.status!==we&&P.dispatch(a(v)))}})}return p},Ko=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:i})=>{const{currentPolls:s,currentSubscriptions:o}=i,a=new Set;let c=null;const l=(m,O)=>{(n.internalActions.updateSubscriptionOptions.match(m)||n.internalActions.unsubscribeQueryResult.match(m))&&f(m.payload.queryCacheKey,O),(t.pending.match(m)||t.rejected.match(m)&&m.meta.condition)&&f(m.meta.arg.queryCacheKey,O),(t.fulfilled.match(m)||t.rejected.match(m)&&!m.meta.condition)&&S(m.meta.arg,O),n.util.resetApiState.match(m)&&(p(),c&&(clearTimeout(c),c=null),a.clear())};function f(m,O){a.add(m),c||(c=setTimeout(()=>{for(const P of a)C({queryCacheKey:P},O);a.clear(),c=null},0))}function S({queryCacheKey:m},O){const P=O.getState()[e],b=P.queries[m],g=o.get(m);if(!b||b.status===we)return;const{lowestPollingInterval:u,skipPollingIfUnfocused:d}=N(g);if(!Number.isFinite(u))return;const E=s.get(m);E!=null&&E.timeout&&(clearTimeout(E.timeout),E.timeout=void 0);const j=Date.now()+u;s.set(m,{nextPollTimestamp:j,pollingInterval:u,timeout:setTimeout(()=>{(P.config.focused||!d)&&O.dispatch(r(b)),S({queryCacheKey:m},O)},u)})}function C({queryCacheKey:m},O){const b=O.getState()[e].queries[m],g=o.get(m);if(!b||b.status===we)return;const{lowestPollingInterval:u}=N(g);if(process.env.NODE_ENV==="test"){const j=s.pollUpdateCounters??(s.pollUpdateCounters={});j[m]??(j[m]=0),j[m]++}if(!Number.isFinite(u)){x(m);return}const d=s.get(m),E=Date.now()+u;(!d||E<d.nextPollTimestamp)&&S({queryCacheKey:m},O)}function x(m){const O=s.get(m);O!=null&&O.timeout&&clearTimeout(O.timeout),s.delete(m)}function p(){for(const m of s.keys())x(m)}function N(m=new Map){let O=!1,P=Number.POSITIVE_INFINITY;for(const b of m.values())b.pollingInterval&&(P=Math.min(b.pollingInterval,P),O=b.skipPollingIfUnfocused||O);return{lowestPollingInterval:P,skipPollingIfUnfocused:O}}return l},Go=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const i=jn(n,r),s=qe(n,r),o=je(n,r),a={};return(l,f)=>{var S,C;if(i(l)){const{requestId:x,arg:{endpointName:p,originalArgs:N}}=l.meta,m=Ue(t,p),O=m==null?void 0:m.onQueryStarted;if(O){const P={},b=new Promise((E,j)=>{P.resolve=E,P.reject=j});b.catch(()=>{}),a[x]=P;const g=e.endpoints[p].select($t(m)?N:x),u=f.dispatch((E,j,v)=>v),d={...f,getCacheEntry:()=>g(f.getState()),requestId:x,extra:u,updateCachedData:$t(m)?E=>f.dispatch(e.util.updateQueryData(p,N,E)):void 0,queryFulfilled:b};O(N,d)}}else if(o(l)){const{requestId:x,baseQueryMeta:p}=l.meta;(S=a[x])==null||S.resolve({data:l.payload,meta:p}),delete a[x]}else if(s(l)){const{requestId:x,rejectedWithValue:p,baseQueryMeta:N}=l.meta;(C=a[x])==null||C.reject({error:l.payload??l.error,isUnhandledError:!p,meta:N}),delete a[x]}}},Yo=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:i})=>{const{removeQueryResult:s}=n.internalActions,o=(c,l)=>{Dn.match(c)&&a(l,"refetchOnFocus"),Mn.match(c)&&a(l,"refetchOnReconnect")};function a(c,l){const f=c.getState()[e],S=f.queries,C=i.currentSubscriptions;t.batch(()=>{for(const x of C.keys()){const p=S[x],N=C.get(x);if(!N||!p)continue;const m=[...N.values()];(m.some(P=>P[l]===!0)||m.every(P=>P[l]===void 0)&&f.config[l])&&(N.size===0?c.dispatch(s({queryCacheKey:x})):p.status!==we&&c.dispatch(r(p)))}})}return o};function Zo(e){const{reducerPath:t,queryThunk:n,api:r,context:i,getInternalState:s}=e,{apiUid:o}=i,a={invalidateTags:me(`${t}/invalidateTags`)},c=C=>C.type.startsWith(`${t}/`),l=[Bo,Uo,Ho,Ko,Wo,Go];return{middleware:C=>{let x=!1;const p=s(C.dispatch),N={...e,internalState:p,refetchQuery:S,isThisApiSliceAction:c,mwApi:C},m=l.map(b=>b(N)),O=zo(N),P=Yo(N);return b=>g=>{if(!Nn(g))return b(g);x||(x=!0,C.dispatch(r.internalActions.middlewareRegistered(o)));const u={...C,next:b},d=C.getState(),[E,j]=O(g,u,d);let v;if(E?v=b(g):v=j,C.getState()[t]&&(P(g,u,d),c(g)||i.hasRehydrationInfo(g)))for(const w of m)w(g,u,d);return v}},actions:a};function S(C){return e.api.endpoints[C.endpointName].initiate(C.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Nr=Symbol(),gi=({createSelector:e=Kr}={})=>({name:Nr,init(t,{baseQuery:n,tagTypes:r,reducerPath:i,serializeQueryArgs:s,keepUnusedDataFor:o,refetchOnMountOrArgChange:a,refetchOnFocus:c,refetchOnReconnect:l,invalidationBehavior:f,onSchemaFailure:S,catchSchemaFailure:C,skipSchemaValidation:x},p){Is();const N=$=>(typeof process<"u"&&process.env.NODE_ENV==="development"&&(r.includes($.type)||console.error(`Tag type '${$.type}' was used, but not specified in \`tagTypes\`!`)),$);Object.assign(t,{reducerPath:i,endpoints:{},internalActions:{onOnline:Mn,onOffline:ci,onFocus:Dn,onFocusLost:ai},util:{}});const m=Fo({serializeQueryArgs:s,reducerPath:i,createSelector:e}),{selectInvalidatedBy:O,selectCachedArgsForQuery:P,buildQuerySelector:b,buildInfiniteQuerySelector:g,buildMutationSelector:u}=m;ye(t.util,{selectInvalidatedBy:O,selectCachedArgsForQuery:P});const{queryThunk:d,infiniteQueryThunk:E,mutationThunk:j,patchQueryData:v,updateQueryData:w,upsertQueryData:h,prefetch:y,buildMatchThunkActions:I}=Qo({baseQuery:n,reducerPath:i,context:p,api:t,serializeQueryArgs:s,assertTagType:N,selectors:m,onSchemaFailure:S,catchSchemaFailure:C,skipSchemaValidation:x}),{reducer:k,actions:M}=$o({context:p,queryThunk:d,mutationThunk:j,serializeQueryArgs:s,reducerPath:i,assertTagType:N,config:{refetchOnFocus:c,refetchOnReconnect:l,refetchOnMountOrArgChange:a,keepUnusedDataFor:o,reducerPath:i,invalidationBehavior:f}});ye(t.util,{patchQueryData:v,updateQueryData:w,upsertQueryData:h,prefetch:y,resetApiState:M.resetApiState,upsertQueryEntries:M.cacheEntriesUpserted}),ye(t.internalActions,M);const R=new WeakMap,Q=$=>Qt(R,$,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:T,buildInitiateInfiniteQuery:D,buildInitiateMutation:V,getRunningMutationThunk:L,getRunningMutationsThunk:B,getRunningQueriesThunk:K,getRunningQueryThunk:H}=Lo({queryThunk:d,mutationThunk:j,infiniteQueryThunk:E,api:t,serializeQueryArgs:s,context:p,getInternalState:Q});ye(t.util,{getRunningMutationThunk:L,getRunningMutationsThunk:B,getRunningQueryThunk:H,getRunningQueriesThunk:K});const{middleware:Y,actions:G}=Zo({reducerPath:i,context:p,queryThunk:d,mutationThunk:j,infiniteQueryThunk:E,api:t,assertTagType:N,selectors:m,getRunningQueryThunk:H,getInternalState:Q});return ye(t.util,G),ye(t,{reducer:k,middleware:Y}),{name:Nr,injectEndpoint($,W){var U;const ee=(U=t.endpoints)[$]??(U[$]={});Kt(W)&&ye(ee,{name:$,select:b($,W),initiate:T($,W)},I(d,$)),Ao(W)&&ye(ee,{name:$,select:u(),initiate:V($)},I(j,$)),bt(W)&&ye(ee,{name:$,select:g($,W),initiate:D($,W)},I(d,$))}}}});gi();function Ot(e){return e.replace(e[0],e[0].toUpperCase())}function Jo(e){let t=0;for(const n in e)t++;return t}var Xo="query",ea="mutation",ta="infinitequery";function na(e){return e.type===Xo}function ra(e){return e.type===ea}function bi(e){return e.type===ta}function Ge(e,...t){return Object.assign(e,...t)}var rn=Symbol();function sn(e){const t=A.useRef(e),n=A.useMemo(()=>kn(t.current,e),[e]);return A.useEffect(()=>{t.current!==n&&(t.current=n)},[n]),n}function Fe(e){const t=A.useRef(e);return A.useEffect(()=>{Xe(t.current,e)||(t.current=e)},[e]),Xe(t.current,e)?t.current:e}var ia=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",sa=ia(),oa=()=>typeof navigator<"u"&&navigator.product==="ReactNative",aa=oa(),ca=()=>sa||aa?A.useLayoutEffect:A.useEffect,ua=ca(),_r=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:si.pending}:e;function on(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var an=["data","status","isLoading","isSuccess","isError","error"];function la({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:i},unstable__sideEffectsInRender:s,createSelector:o},serializeQueryArgs:a,context:c}){const l=s?d=>d():A.useEffect,f=d=>{var E,j;return(j=(E=d.current)==null?void 0:E.unsubscribe)==null?void 0:j.call(E)},S=c.endpointDefinitions;return{buildQueryHooks:b,buildInfiniteQueryHooks:g,buildMutationHook:u,usePrefetch:p};function C(d,E,j){if(E!=null&&E.endpointName&&d.isUninitialized){const{endpointName:k}=E,M=S[k];j!==le&&a({queryArgs:E.originalArgs,endpointDefinition:M,endpointName:k})===a({queryArgs:j,endpointDefinition:M,endpointName:k})&&(E=void 0)}let v=d.isSuccess?d.data:E==null?void 0:E.data;v===void 0&&(v=d.data);const w=v!==void 0,h=d.isLoading,y=(!E||E.isLoading||E.isUninitialized)&&!w&&h,I=d.isSuccess||w&&(h&&!(E!=null&&E.isError)||d.isUninitialized);return{...d,data:v,currentData:d.data,isFetching:h,isLoading:y,isSuccess:I}}function x(d,E,j){if(E!=null&&E.endpointName&&d.isUninitialized){const{endpointName:k}=E,M=S[k];j!==le&&a({queryArgs:E.originalArgs,endpointDefinition:M,endpointName:k})===a({queryArgs:j,endpointDefinition:M,endpointName:k})&&(E=void 0)}let v=d.isSuccess?d.data:E==null?void 0:E.data;v===void 0&&(v=d.data);const w=v!==void 0,h=d.isLoading,y=(!E||E.isLoading||E.isUninitialized)&&!w&&h,I=d.isSuccess||w&&(h&&!(E!=null&&E.isError)||d.isUninitialized);return{...d,data:v,currentData:d.data,isFetching:h,isLoading:y,isSuccess:I}}function p(d,E){const j=n(),v=Fe(E);return A.useCallback((w,h)=>j(e.util.prefetch(d,w,{...v,...h})),[d,j,v])}function N(d,E,{refetchOnReconnect:j,refetchOnFocus:v,refetchOnMountOrArgChange:w,skip:h=!1,pollingInterval:y=0,skipPollingIfUnfocused:I=!1,...k}={}){const{initiate:M}=e.endpoints[d],R=n(),Q=A.useRef(void 0);if(!Q.current){const F=R(e.internalActions.internal_getRTKQSubscriptions());if(process.env.NODE_ENV!=="production"&&(typeof F!="object"||typeof(F==null?void 0:F.type)=="string"))throw new Error(process.env.NODE_ENV==="production"?q(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
|
|
42
|
+
You must add the middleware for RTK-Query to function correctly!`);Q.current=F}const T=sn(h?le:E),D=Fe({refetchOnReconnect:j,refetchOnFocus:v,pollingInterval:y,skipPollingIfUnfocused:I}),V=k.initialPageParam,L=Fe(V),B=k.refetchCachedPages,K=Fe(B),H=A.useRef(void 0);let{queryCacheKey:Y,requestId:G}=H.current||{},$=!1;Y&&G&&($=Q.current.isRequestSubscribed(Y,G));const W=!$&&H.current!==void 0;return l(()=>{W&&(H.current=void 0)},[W]),l(()=>{var U;const F=H.current;if(typeof process<"u"&&process.env.NODE_ENV==="removeMeOnCompilation"&&console.log(W),T===le){F==null||F.unsubscribe(),H.current=void 0;return}const ee=(U=H.current)==null?void 0:U.subscriptionOptions;if(!F||F.arg!==T){F==null||F.unsubscribe();const z=R(M(T,{subscriptionOptions:D,forceRefetch:w,...bi(S[d])?{initialPageParam:L,refetchCachedPages:K}:{}}));H.current=z}else D!==ee&&F.updateSubscriptionOptions(D)},[R,M,w,T,D,W,L,K,d]),[H,R,M,D]}function m(d,E){return(v,{skip:w=!1,selectFromResult:h}={})=>{const{select:y}=e.endpoints[d],I=sn(w?le:v),k=A.useRef(void 0),M=A.useMemo(()=>o([y(I),(V,L)=>L,V=>I],E,{memoizeOptions:{resultEqualityCheck:Xe}}),[y,I]),R=A.useMemo(()=>h?o([M],h,{devModeChecks:{identityFunctionCheck:"never"}}):M,[M,h]),Q=r(V=>R(V,k.current),Xe),T=i(),D=M(T.getState(),k.current);return ua(()=>{k.current=D},[D]),Q}}function O(d){A.useEffect(()=>()=>{f(d),d.current=void 0},[d])}function P(d){if(!d.current)throw new Error(process.env.NODE_ENV==="production"?q(38):"Cannot refetch a query that has not been started yet.");return d.current.refetch()}function b(d){const E=(w,h={})=>{const[y]=N(d,w,h);return O(y),A.useMemo(()=>({refetch:()=>P(y)}),[y])},j=({refetchOnReconnect:w,refetchOnFocus:h,pollingInterval:y=0,skipPollingIfUnfocused:I=!1}={})=>{const{initiate:k}=e.endpoints[d],M=n(),[R,Q]=A.useState(rn),T=A.useRef(void 0),D=Fe({refetchOnReconnect:w,refetchOnFocus:h,pollingInterval:y,skipPollingIfUnfocused:I});l(()=>{var H,Y;const K=(H=T.current)==null?void 0:H.subscriptionOptions;D!==K&&((Y=T.current)==null||Y.updateSubscriptionOptions(D))},[D]);const V=A.useRef(D);l(()=>{V.current=D},[D]);const L=A.useCallback(function(K,H=!1){let Y;return t(()=>{f(T),T.current=Y=M(k(K,{subscriptionOptions:V.current,forceRefetch:!H})),Q(K)}),Y},[M,k]),B=A.useCallback(()=>{var K,H;(K=T.current)!=null&&K.queryCacheKey&&M(e.internalActions.removeQueryResult({queryCacheKey:(H=T.current)==null?void 0:H.queryCacheKey}))},[M]);return A.useEffect(()=>()=>{f(T)},[]),A.useEffect(()=>{R!==rn&&!T.current&&L(R,!0)},[R,L]),A.useMemo(()=>[L,R,{reset:B}],[L,R,B])},v=m(d,C);return{useQueryState:v,useQuerySubscription:E,useLazyQuerySubscription:j,useLazyQuery(w){const[h,y,{reset:I}]=j(w),k=v(y,{...w,skip:y===rn}),M=A.useMemo(()=>({lastArg:y}),[y]);return A.useMemo(()=>[h,{...k,reset:I},M],[h,k,I,M])},useQuery(w,h){const y=E(w,h),I=v(w,{selectFromResult:w===le||h!=null&&h.skip?void 0:_r,...h}),k=on(I,...an);return A.useDebugValue(k),A.useMemo(()=>({...I,...y}),[I,y])}}}function g(d){const E=(v,w={})=>{const[h,y,I,k]=N(d,v,w),M=A.useRef(k);l(()=>{M.current=k},[k]);const R=w.refetchCachedPages,Q=Fe(R),T=A.useCallback(function(L,B){let K;return t(()=>{f(h),h.current=K=y(I(L,{subscriptionOptions:M.current,direction:B}))}),K},[h,y,I]);O(h);const D=sn(w.skip?le:v),V=A.useCallback(L=>{if(!h.current)throw new Error(process.env.NODE_ENV==="production"?q(38):"Cannot refetch a query that has not been started yet.");const B={refetchCachedPages:(L==null?void 0:L.refetchCachedPages)??Q};return h.current.refetch(B)},[h,Q]);return A.useMemo(()=>({trigger:T,refetch:V,fetchNextPage:()=>T(D,"forward"),fetchPreviousPage:()=>T(D,"backward")}),[V,T,D])},j=m(d,x);return{useInfiniteQueryState:j,useInfiniteQuerySubscription:E,useInfiniteQuery(v,w){const{refetch:h,fetchNextPage:y,fetchPreviousPage:I}=E(v,w),k=j(v,{selectFromResult:v===le||w!=null&&w.skip?void 0:_r,...w}),M=on(k,...an,"hasNextPage","hasPreviousPage");return A.useDebugValue(M),A.useMemo(()=>({...k,fetchNextPage:y,fetchPreviousPage:I,refetch:h}),[k,y,I,h])}}}function u(d){return({selectFromResult:E,fixedCacheKey:j}={})=>{const{select:v,initiate:w}=e.endpoints[d],h=n(),[y,I]=A.useState();A.useEffect(()=>()=>{y!=null&&y.arg.fixedCacheKey||y==null||y.reset()},[y]);const k=A.useCallback(function(K){const H=h(w(K,{fixedCacheKey:j}));return I(H),H},[h,w,j]),{requestId:M}=y||{},R=A.useMemo(()=>v({fixedCacheKey:j,requestId:y==null?void 0:y.requestId}),[j,y,v]),Q=A.useMemo(()=>E?o([R],E):R,[E,R]),T=r(Q,Xe),D=j==null?y==null?void 0:y.arg.originalArgs:void 0,V=A.useCallback(()=>{t(()=>{y&&I(void 0),j&&h(e.internalActions.removeMutationResult({requestId:M,fixedCacheKey:j}))})},[h,j,y,M]),L=on(T,...an,"endpointName");A.useDebugValue(L);const B=A.useMemo(()=>({...T,originalArgs:D,reset:V}),[T,D,V]);return A.useMemo(()=>[k,B],[k,B])}}}var da=Symbol(),fa=({batch:e=Xi,hooks:t={useDispatch:Dr,useSelector:Mr,useStore:Pr},createSelector:n=Kr,unstable__sideEffectsInRender:r=!1,...i}={})=>{if(process.env.NODE_ENV!=="production"){const s=["useDispatch","useSelector","useStore"];let o=!1;for(const a of s)if(Jo(i)>0&&(i[a]&&(o||(console.warn("As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`"),o=!0)),t[a]=i[a]),typeof t[a]!="function")throw new Error(process.env.NODE_ENV==="production"?q(36):`When using custom hooks for context, all ${s.length} hooks need to be provided: ${s.join(", ")}.
|
|
43
|
+
Hook ${a} was either not provided or not a function.`)}return{name:da,init(s,{serializeQueryArgs:o},a){const c=s,{buildQueryHooks:l,buildInfiniteQueryHooks:f,buildMutationHook:S,usePrefetch:C}=la({api:s,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:o,context:a});return Ge(c,{usePrefetch:C}),Ge(a,{batch:e}),{injectEndpoint(x,p){if(na(p)){const{useQuery:N,useLazyQuery:m,useLazyQuerySubscription:O,useQueryState:P,useQuerySubscription:b}=l(x);Ge(c.endpoints[x],{useQuery:N,useLazyQuery:m,useLazyQuerySubscription:O,useQueryState:P,useQuerySubscription:b}),s[`use${Ot(x)}Query`]=N,s[`useLazy${Ot(x)}Query`]=m}if(ra(p)){const N=S(x);Ge(c.endpoints[x],{useMutation:N}),s[`use${Ot(x)}Mutation`]=N}else if(bi(p)){const{useInfiniteQuery:N,useInfiniteQuerySubscription:m,useInfiniteQueryState:O}=f(x);Ge(c.endpoints[x],{useInfiniteQuery:N,useInfiniteQuerySubscription:m,useInfiniteQueryState:O}),s[`use${Ot(x)}InfiniteQuery`]=N}}}}}},ma=yi(gi(),fa()),pa=20,ha="x-company-id";function Ft(e="tmp"){return`${e}_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}const ya=async(e,t,n)=>{const{baseUrl:r,getToken:i,tenantId:s}=ts();return Do({baseUrl:r,prepareHeaders:async a=>{const c=await(i==null?void 0:i());return c&&a.set("Authorization",`Bearer ${c}`),s&&a.set(ha,s),a}})(e,t,n)},ga=pa,Cr=5,ba=e=>[...e].reverse().map(t=>({id:t.messageId,role:t.role,content:t.content,createdAt:t.createdAt,status:"sent"})),pe=ma({reducerPath:"chatApi",baseQuery:ya,tagTypes:["SessionList"],endpoints:e=>({getSessions:e.infiniteQuery({infiniteQueryOptions:{initialPageParam:void 0,getNextPageParam:t=>t.nextCursor??void 0},query:({queryArg:t,pageParam:n})=>({url:"/chat/sessions",method:"GET",params:{limit:ga,...t?{search:t}:{},...n?{cursor:n}:{}}}),providesTags:["SessionList"]}),getSessionMessages:e.infiniteQuery({infiniteQueryOptions:{initialPageParam:void 0,getNextPageParam:()=>{},getPreviousPageParam:t=>{var n;if(!(t.length<Cr))return(n=t[0])==null?void 0:n.createdAt}},query:({queryArg:t,pageParam:n})=>({url:`/chat/sessions/${encodeURIComponent(t)}/messages`,method:"GET",params:{limit:Cr,...n?{before:n}:{}}}),transformResponse:t=>ba(t),keepUnusedDataFor:300}),sendMessage:e.mutation({query:t=>({url:"/chat/messages",method:"POST",body:t}),async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){if(!t.sessionId)return;const i=Ft("u"),s=new Date().toISOString();n(pe.util.updateQueryData("getSessionMessages",t.sessionId,o=>{var a;(a=o.pages[o.pages.length-1])==null||a.push({id:i,role:"user",content:t.message,createdAt:s,status:"sending"})}));try{const{data:o}=await r;n(pe.util.updateQueryData("getSessionMessages",t.sessionId,a=>{const c=a.pages[a.pages.length-1];if(!c)return;const l=c.find(f=>f.id===i);l&&(l.status="sent"),c.push({id:Ft("a"),role:"assistant",content:o.answer,createdAt:new Date().toISOString(),status:"sent"})})),n(pe.util.invalidateTags(["SessionList"]))}catch{n(pe.util.updateQueryData("getSessionMessages",t.sessionId,o=>{const a=o.pages[o.pages.length-1],c=a==null?void 0:a.find(l=>l.id===i);c&&(c.status="error")}))}}})})}),{useGetSessionsInfiniteQuery:va,useGetSessionMessagesInfiniteQuery:wa,useSendMessageMutation:xa}=pe,Ea={open:!1,expanded:!1,activeSessionId:null,draft:"",pendingSend:null,notice:null},vi=De({name:"chatUi",initialState:Ea,reducers:{setOpen(e,t){e.open=t.payload,t.payload||(e.expanded=!1)},setExpanded(e,t){e.expanded=t.payload,t.payload&&(e.open=!0)},toggleOpen(e){e.open=!e.open,e.open||(e.expanded=!1)},setDraft(e,t){e.draft=t.payload},setActiveSessionId(e,t){e.activeSessionId=t.payload,e.notice=null,e.pendingSend=null},startNewChat(e){e.activeSessionId=null,e.draft="",e.pendingSend=null,e.notice=null},setPendingSend(e,t){e.pendingSend=t.payload},clearPendingSend(e){e.pendingSend=null},setNotice(e,t){e.notice=t.payload},clearNotice(e){e.notice=null}}}),{setOpen:An,setExpanded:Tn,toggleOpen:Sa,setDraft:wi,setActiveSessionId:xi,startNewChat:Ei,setPendingSend:Na,clearPendingSend:_a,setNotice:cn,clearNotice:Ca}=vi.actions,Oa=vi.reducer,ja=no({reducer:{[pe.reducerPath]:pe.reducer,chatUi:Oa},middleware:e=>e().concat(pe.middleware)});function Ia({config:e,children:t}){return _.jsx(Gi,{store:ja,children:_.jsx(rs,{config:e,children:_.jsx("div",{className:"mint-ai-root",children:t})})})}const Ve=()=>Dr(),We=Mr;function Si(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Si(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ka(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Si(e))&&(r&&(r+=" "),r+=t);return r}function te(...e){return ka(e)}const Pa={"solar:chat-round-dots-bold":_.jsx("path",{fillRule:"evenodd",d:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12c0 1.6.376 3.112 1.043 4.453.178.356.237.763.134 1.148l-.595 2.226a1.3 1.3 0 0 0 1.591 1.592l2.226-.596a1.63 1.63 0 0 1 1.149.133A9.96 9.96 0 0 0 12 22m4-9a1 1 0 1 0 0-2 1 1 0 0 0 0 2m-4 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2m-4 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2",clipRule:"evenodd"}),"solar:magnifer-linear":_.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[_.jsx("circle",{cx:"11.5",cy:"11.5",r:"9.5"}),_.jsx("path",{strokeLinecap:"round",d:"M18.5 18.5 22 22"})]}),"solar:history-linear":_.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",children:[_.jsx("path",{d:"M12 8v4l2.5 2.5"}),_.jsx("path",{d:"M4.338 6.871 4.325 4.325m.013 2.546 2.546.012M3.084 10.683a9.06 9.06 0 1 0 2.52-5.079L4.338 6.87"})]}),"solar:paperclip-linear":_.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",d:"m7.918 17.807 7.89-7.553a2.253 2.253 0 0 0 0-3.284 2.503 2.503 0 0 0-3.43 0l-7.834 7.498a4.28 4.28 0 0 0 0 6.24c1.8 1.723 4.718 1.723 6.518 0l7.949-7.608c2.652-2.54 2.652-6.656 0-9.196s-6.954-2.539-9.607 0L3 10.034"}),"solar:arrow-up-linear":_.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M12 20V4m0 0 6 6m-6-6-6 6"}),"mingcute:down-line":_.jsx("path",{d:"M12.707 15.707a1 1 0 0 1-1.414 0L5.636 10.05A1 1 0 1 1 7.05 8.636l4.95 4.95 4.95-4.95a1 1 0 0 1 1.414 1.414z"}),"mingcute:code-line":_.jsx("path",{d:"M14.486 3.143a1 1 0 0 1 .692 1.233l-4.43 15.788a1 1 0 0 1-1.926-.54l4.43-15.788a1 1 0 0 1 1.234-.693M7.207 7.05a1 1 0 0 1 0 1.414L3.672 12l3.535 3.535a1 1 0 1 1-1.414 1.415L1.55 12.707a1 1 0 0 1 0-1.414L5.793 7.05a1 1 0 0 1 1.414 0m9.586 1.414a1 1 0 1 1 1.414-1.414l4.243 4.243a1 1 0 0 1 0 1.414l-4.243 4.243a1 1 0 0 1-1.414-1.415L20.328 12z"}),"mingcute:add-line":_.jsx("path",{d:"M11 20a1 1 0 1 0 2 0v-7h7a1 1 0 1 0 0-2h-7V4a1 1 0 1 0-2 0v7H4a1 1 0 1 0 0 2h7z"}),"solar:user-bold":_.jsxs(_.Fragment,{children:[_.jsx("path",{d:"M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10"}),_.jsx("path",{fillRule:"evenodd",d:"M20 17.5c0 2.485 0 4.5-8 4.5s-8-2.015-8-4.5S7.582 13 12 13s8 2.015 8 4.5",clipRule:"evenodd"})]})};function ie({className:e,icon:t,width:n=20,height:r=n,...i}){const s=Pa[t];return _.jsx("svg",{"aria-hidden":"true",className:te("mint-inline-block mint-shrink-0",e),fill:"currentColor",width:n,height:r,viewBox:"0 0 24 24",...i,children:s})}const Vn=`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
44
44
|
<path d="M1.95261 0.335011C1.50592 -0.11167 0.781703 -0.11167 0.335011 0.335011C-0.11167 0.781703 -0.11167 1.50592 0.335011 1.95261L2.95767 4.57524L0.335011 7.19789C-0.11167 7.64454 -0.11167 8.3688 0.335011 8.81546C0.781703 9.26212 1.50592 9.26212 1.95261 8.81546L4.57524 6.19282L7.19789 8.81546C7.64454 9.26212 8.3688 9.26212 8.81546 8.81546C9.26212 8.3688 9.26212 7.64454 8.81546 7.19789L6.19282 4.57524L8.81546 1.95261C9.26212 1.50592 9.26212 0.781703 8.81546 0.335011C8.3688 -0.11167 7.64454 -0.11167 7.19789 0.335011L4.57524 2.95767L1.95261 0.335011Z" fill="currentColor"/>
|
|
45
45
|
</svg>
|
|
46
|
-
`;function
|
|
46
|
+
`;function Ie({source:e,className:t}){return _.jsx("span",{"aria-hidden":"true",className:te("mint-svg-asset mint-inline-block mint-shrink-0",t),dangerouslySetInnerHTML:{__html:e}})}function Da({open:e,onClick:t}){return _.jsx("button",{type:"button","aria-label":e?"Close assistant":"Open assistant",onClick:t,className:"mint-flex mint-h-12 mint-w-12 mint-items-center mint-justify-center mint-self-end mint-rounded-full mint-border-0 mint-bg-primary-light mint-p-0 mint-text-grey-800 mint-shadow-widget mint-transition-transform hover:mint-scale-105",children:e?_.jsx(Ie,{source:Vn,className:"mint-h-4 mint-w-4"}):_.jsx(ie,{icon:"solar:chat-round-dots-bold",width:22})})}const Ni=`<svg width="14" height="9" viewBox="0 0 14 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
47
47
|
<path d="M8.67742 0.814748L12.3467 4.48402L8.67742 8.15329M4.48397 8.15329L0.814697 4.48402L4.48397 0.814749" stroke="currentColor" stroke-width="1.6295" stroke-linecap="round" stroke-linejoin="round"/>
|
|
48
48
|
</svg>
|
|
49
|
-
|
|
49
|
+
`,Ma="Sign in to use the assistant.",Or="Failed to send. Please try again.";function Ln(){const e=Ve(),{tenantId:t}=xe(),{draft:n,activeSessionId:r,pendingSend:i,notice:s}=We(g=>g.chatUi),[o,{isLoading:a}]=xa(),{data:c,isFetching:l,isUninitialized:f,hasPreviousPage:S,isFetchingPreviousPage:C,fetchPreviousPage:x}=wa(r??le),p=A.useMemo(()=>(c==null?void 0:c.pages.flat())??[],[c]),N=A.useMemo(()=>r?p:i?[{id:"pending-user",role:"user",content:i,createdAt:new Date().toISOString(),status:"sending"}]:[],[r,p,i]),m=A.useCallback(()=>{S&&!C&&x()},[S,C,x]),O=A.useCallback(async g=>{const u=(g??n).trim();if(!(!u||a||i)){if(e(Ca()),!t){e(cn(Ma));return}if(e(wi("")),r){try{await o({message:u,sessionId:r}).unwrap()}catch{e(cn(Or))}return}e(Na(u));try{const d=await o({message:u}).unwrap(),E=new Date().toISOString();e(pe.util.upsertQueryData("getSessionMessages",d.sessionId,{pages:[[{id:Ft("u"),role:"user",content:u,createdAt:E,status:"sent"},{id:Ft("a"),role:"assistant",content:d.answer,createdAt:E,status:"sent"}]],pageParams:[void 0]})),e(xi(d.sessionId)),e(pe.util.invalidateTags(["SessionList"]))}catch{e(cn(Or))}finally{e(_a())}}},[n,a,i,t,r,e,o]),P=!!r&&l&&!f&&p.length===0;return{messages:N,notice:s,isLoading:a||!!i||P,send:O,loadOlder:m,hasOlder:!!S,isLoadingOlder:C}}const _i=`<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
50
50
|
<path d="M2.64672 11.1835C4.49248 10.3977 6.17077 9.26593 7.59099 7.84916C9.56882 5.86738 10.9799 3.3921 11.6775 0.680538C11.7081 0.560106 11.778 0.453311 11.8761 0.377031C11.9742 0.300751 12.0949 0.259338 12.2192 0.259338C12.3434 0.259338 12.4641 0.300751 12.5622 0.377031C12.6603 0.453311 12.7302 0.560106 12.7608 0.680538C13.4599 3.39175 14.8712 5.86675 16.8484 7.84916C18.2688 9.26576 19.947 10.3975 21.7927 11.1835C22.5149 11.4946 23.2571 11.7446 24.0171 11.9368C24.1382 11.9666 24.2459 12.0361 24.3229 12.1343C24.3999 12.2325 24.4417 12.3537 24.4417 12.4784C24.4417 12.6032 24.3999 12.7244 24.3229 12.8226C24.2459 12.9208 24.1382 12.9903 24.0171 13.0201C23.2571 13.2112 22.5171 13.4612 21.7927 13.7723C19.9469 14.558 18.2686 15.6898 16.8484 17.1066C14.8701 19.0886 13.4586 21.5643 12.7608 24.2763C12.731 24.3975 12.6615 24.5052 12.5633 24.5822C12.4651 24.6592 12.3439 24.701 12.2192 24.701C12.0944 24.701 11.9732 24.6592 11.875 24.5822C11.7768 24.5052 11.7073 24.3975 11.6775 24.2763C11.4864 23.5153 11.2364 22.7753 10.9253 22.0509C10.1396 20.2051 9.00779 18.5268 7.59099 17.1066C5.60883 15.1287 3.13317 13.7176 0.421247 13.0201C0.300816 12.9895 0.194021 12.9196 0.117743 12.8215C0.0414619 12.7234 4.76837e-05 12.6027 4.76837e-05 12.4784C4.76837e-05 12.3542 0.0414619 12.2335 0.117743 12.1354C0.194021 12.0373 0.300816 11.9674 0.421247 11.9368C1.18196 11.7454 1.92616 11.4935 2.64672 11.1835Z" fill="currentColor"/>
|
|
51
51
|
<path d="M1.32299 21.3266C1.78379 21.1304 2.20277 20.8479 2.55733 20.4942C3.05109 19.9994 3.40336 19.3815 3.57752 18.7045C3.58517 18.6745 3.60261 18.6478 3.6271 18.6287C3.65159 18.6097 3.68173 18.5994 3.71275 18.5994C3.74377 18.5994 3.77391 18.6097 3.79839 18.6287C3.82288 18.6478 3.84033 18.6745 3.84797 18.7045C4.0225 19.3814 4.37483 19.9993 4.86844 20.4942C5.22304 20.8478 5.64201 21.1304 6.10278 21.3266C6.28308 21.4042 6.46836 21.4667 6.65809 21.5146C6.68834 21.5221 6.71523 21.5394 6.73445 21.5639C6.75367 21.5885 6.76411 21.6187 6.76411 21.6499C6.76411 21.681 6.75367 21.7113 6.73445 21.7358C6.71523 21.7603 6.68834 21.7777 6.65809 21.7851C6.46836 21.8328 6.28363 21.8952 6.10278 21.9729C5.64199 22.169 5.223 22.4516 4.86844 22.8053C4.37455 23.3001 4.02218 23.9181 3.84797 24.5952C3.84054 24.6255 3.82318 24.6523 3.79866 24.6716C3.77415 24.6908 3.7439 24.7012 3.71275 24.7012C3.6816 24.7012 3.65135 24.6908 3.62683 24.6716C3.60232 24.6523 3.58496 24.6255 3.57752 24.5952C3.52982 24.4052 3.46741 24.2205 3.38974 24.0396C3.19359 23.5788 2.91103 23.1598 2.55733 22.8053C2.06248 22.3115 1.44443 21.9592 0.767403 21.7851C0.737337 21.7774 0.710676 21.76 0.691632 21.7355C0.672589 21.711 0.66225 21.6809 0.66225 21.6499C0.66225 21.6188 0.672589 21.5887 0.691632 21.5642C0.710676 21.5397 0.737337 21.5223 0.767403 21.5146C0.957315 21.4669 1.1431 21.404 1.32299 21.3266Z" fill="currentColor"/>
|
|
52
52
|
<path d="M19.1215 2.95604C19.5735 2.74047 19.9801 2.44036 20.3193 2.07191C20.7916 1.55662 21.1173 0.924249 21.2625 0.240516C21.2688 0.210152 21.2851 0.182773 21.3088 0.162706C21.3325 0.142639 21.3621 0.131029 21.3931 0.12971C21.4241 0.128391 21.4547 0.13744 21.4799 0.155425C21.5052 0.17341 21.5238 0.199305 21.5327 0.229019C21.7358 0.897842 22.1141 1.50019 22.6283 1.97367C22.9976 2.31193 23.4282 2.57641 23.8969 2.75286C24.0804 2.82279 24.2681 2.87727 24.4597 2.91715C24.4903 2.92329 24.5179 2.93949 24.5381 2.96316C24.5584 2.98684 24.5701 3.01662 24.5714 3.04774C24.5727 3.07886 24.5636 3.10953 24.5454 3.13484C24.5272 3.16015 24.5011 3.17863 24.4712 3.18735C24.2837 3.24308 24.1018 3.31328 23.9244 3.39857C23.4724 3.61414 23.0658 3.91425 22.7266 4.2827C22.2541 4.79805 21.9284 5.43052 21.7831 6.11438C21.777 6.14492 21.7608 6.17252 21.7371 6.19277C21.7134 6.21301 21.6836 6.22473 21.6525 6.22605C21.6214 6.22738 21.5907 6.21823 21.5654 6.20007C21.5401 6.18191 21.5216 6.15579 21.5129 6.12588C21.4572 5.93807 21.3869 5.75616 21.3017 5.57878C21.0861 5.12673 20.786 4.72013 20.4175 4.38094C19.9021 3.90864 19.2697 3.58296 18.5859 3.43775C18.5555 3.4314 18.5281 3.4151 18.508 3.39144C18.488 3.36779 18.4764 3.33812 18.4751 3.30712C18.4737 3.27613 18.4828 3.24558 18.5008 3.2203C18.5188 3.19503 18.5446 3.17647 18.5744 3.16755C18.7621 3.11174 18.945 3.04101 19.1215 2.95604Z" fill="currentColor"/>
|
|
53
53
|
</svg>
|
|
54
|
-
`;function
|
|
54
|
+
`;function Ci({onSend:e,disabled:t,expanded:n}){const r=Ve(),i=We(a=>a.chatUi.draft),s=A.useRef(null),o=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),e())};return _.jsx("div",{className:"mint-px-3 mint-pb-3 sm:mint-px-5 sm:mint-pb-5",children:_.jsxs("div",{className:"mint-rounded-2xl mint-border mint-border-grey-200 mint-bg-white mint-px-4 mint-py-3 mint-shadow-composer",children:[_.jsxs("div",{className:"mint-flex mint-items-center mint-gap-3",children:[_.jsx(Ie,{source:_i,className:"mint-h-[20px] mint-w-[20px] mint-shrink-0 mint-text-assistant-action"}),_.jsx("textarea",{ref:s,rows:1,value:i,placeholder:"Ask the AI",onChange:a=>r(wi(a.target.value)),onKeyDown:o,className:"mint-scroll mint-h-5 mint-max-h-20 mint-flex-1 mint-resize-none mint-border-0 mint-bg-transparent mint-p-0 mint-text-xs mint-leading-5 mint-text-grey-800 mint-outline-none placeholder:mint-text-grey-600"})]}),_.jsxs("div",{className:"mint-mt-3 mint-flex mint-items-end mint-justify-between mint-gap-2",children:[n?_.jsxs("div",{className:"mint-flex mint-min-w-0 mint-items-center mint-gap-2",children:[_.jsx("button",{type:"button","aria-label":"Add",className:"mint-flex mint-h-9 mint-w-9 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-primary-contrast mint-transition-transform hover:mint-scale-105",children:_.jsx(ie,{icon:"mingcute:add-line",width:18})}),_.jsxs("button",{type:"button","aria-label":"Add photos and files",className:"mint-flex mint-items-center mint-gap-1.5 mint-rounded-full mint-border mint-border-assistant-action mint-bg-transparent mint-px-3 mint-py-2 mint-text-xs mint-font-medium mint-text-assistant-action mint-transition-colors hover:mint-bg-assistant-action/10",children:[_.jsx(ie,{icon:"solar:paperclip-linear",width:15}),_.jsx("span",{className:"mint-hidden sm:mint-inline",children:"Add photos & files"})]}),_.jsxs("button",{type:"button","aria-label":"Auto Fill Form",className:"mint-flex mint-items-center mint-gap-1.5 mint-rounded-full mint-border mint-border-assistant-action mint-bg-transparent mint-px-3 mint-py-2 mint-text-xs mint-font-medium mint-text-assistant-action mint-transition-colors hover:mint-bg-assistant-action/10",children:[_.jsx(ie,{icon:"mingcute:code-line",width:15}),_.jsx("span",{className:"mint-hidden sm:mint-inline",children:"Auto Fill Form"})]})]}):_.jsx("button",{type:"button","aria-label":"Attach file",className:"mint-flex mint-h-9 mint-w-9 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border mint-border-assistant-action mint-bg-transparent mint-p-0 mint-text-assistant-action mint-transition-colors hover:mint-bg-assistant-action/10",children:_.jsx(ie,{icon:"solar:paperclip-linear",width:18})}),_.jsx("button",{type:"button","aria-label":"Send message",disabled:t||!i.trim(),onClick:e,className:"mint-flex mint-h-9 mint-w-9 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-xl mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-primary-contrast mint-transition-transform hover:mint-scale-105 disabled:mint-opacity-40 disabled:hover:mint-scale-100",children:_.jsx(ie,{icon:"solar:arrow-up-linear",width:20})})]})]})})}const Ra=120;function Oi(e,{messages:t,canLoadOlder:n,isLoadingOlder:r,loadOlder:i}){const s=A.useRef(null),o=A.useRef(0),a=A.useRef(void 0);A.useLayoutEffect(()=>{const c=e.current;if(!c)return;const l=()=>{c.scrollTop<Ra&&n&&!r&&!s.current&&(s.current={scrollHeight:c.scrollHeight,scrollTop:c.scrollTop},i())};return c.addEventListener("scroll",l,{passive:!0}),()=>c.removeEventListener("scroll",l)},[e,n,r,i]),A.useLayoutEffect(()=>{var C;const c=e.current;if(!c)return;const l=t.length,f=(C=t[l-1])==null?void 0:C.id,S=l>o.current;if(s.current&&S){const{scrollHeight:x,scrollTop:p}=s.current;c.scrollTop=c.scrollHeight-x+p,s.current=null}else f!==a.current&&(c.scrollTop=c.scrollHeight);o.current=l,a.current=f},[e,t])}const Aa=`<svg width="13" height="14" viewBox="0 0 13 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
55
55
|
<path d="M4.55012 1.53112C5.27634 1.09946 5.63936 0.883636 6.0381 0.883636C6.43683 0.883636 6.79986 1.09946 7.52605 1.53112L9.70463 2.82608C10.4308 3.25774 10.7939 3.47357 10.9933 3.82906C11.1926 4.18455 11.1926 4.61621 11.1926 5.47953V8.06944C11.1926 8.93274 11.1926 9.36439 10.9933 9.71991C10.7939 10.0754 10.4308 10.2912 9.70463 10.7229L7.52605 12.0179C6.79986 12.4495 6.43683 12.6653 6.0381 12.6653C5.63936 12.6653 5.27634 12.4495 4.55012 12.0179L2.37158 10.7229C1.6454 10.2912 1.28231 10.0754 1.08296 9.71991C0.883606 9.36439 0.883606 8.93274 0.883606 8.06944V5.47953C0.883606 4.61621 0.883606 4.18455 1.08296 3.82906C1.28231 3.47357 1.6454 3.25774 2.37158 2.82608L4.55012 1.53112Z" stroke="currentColor" stroke-opacity="0.9" stroke-width="1.76725"/>
|
|
56
56
|
</svg>
|
|
57
|
-
`,
|
|
57
|
+
`,Ta=`<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
58
58
|
<path d="M13.9908 5.89076H10.8422L13.1573 1.8408C13.2219 1.72876 13.256 1.60164 13.2559 1.47226C13.2558 1.34288 13.2217 1.2158 13.1569 1.10382C13.0921 0.991833 12.9989 0.8989 12.8868 0.834375C12.7746 0.769851 12.6475 0.736013 12.5181 0.736269H7.36361C7.22677 0.736205 7.09262 0.774272 6.97621 0.846199C6.8598 0.918126 6.76574 1.02107 6.70457 1.14347L3.02279 8.50703C2.96668 8.61932 2.9402 8.7441 2.94588 8.8695C2.95156 8.9949 2.98921 9.11677 3.05524 9.22353C3.12127 9.33029 3.2135 9.41839 3.32317 9.47948C3.43284 9.54056 3.5563 9.5726 3.68183 9.57254H7.1103L5.18547 15.9884C5.13663 16.1506 5.1452 16.3247 5.20973 16.4813C5.27427 16.6379 5.39083 16.7675 5.53976 16.8482C5.68869 16.9289 5.86089 16.9557 6.02733 16.9243C6.19377 16.8928 6.34428 16.8049 6.45347 16.6754L14.5534 7.1028C14.6441 6.99557 14.7023 6.86462 14.7211 6.72541C14.7398 6.58619 14.7184 6.44452 14.6592 6.3171C14.6001 6.18968 14.5057 6.08184 14.3873 6.0063C14.2689 5.93076 14.1313 5.89067 13.9908 5.89076ZM7.61176 13.0253L8.80539 9.04899C8.83861 8.93895 8.84561 8.82267 8.82582 8.70944C8.80604 8.59622 8.76003 8.48919 8.69146 8.39694C8.6229 8.30469 8.53369 8.22977 8.43098 8.17817C8.32827 8.12658 8.21491 8.09975 8.09996 8.09983H4.87325L7.81868 2.20898H11.2486L8.93352 6.25894C8.86883 6.37098 8.8348 6.4981 8.83487 6.62748C8.83493 6.75686 8.86908 6.88394 8.93388 6.99592C8.99868 7.10791 9.09185 7.20084 9.20399 7.26536C9.31613 7.32989 9.4433 7.36373 9.57268 7.36347H12.4032L7.61176 13.0253Z" fill="currentColor" fill-opacity="0.9"/>
|
|
59
59
|
</svg>
|
|
60
|
-
`,
|
|
60
|
+
`,Va=`<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
61
61
|
<path d="M8.83631 1.47263C8.83631 1.47263 13.9908 5.23937 13.9908 10.0823C13.9908 11.5094 13.4477 12.878 12.4811 13.8871C11.5144 14.8962 10.2034 15.4629 8.83639 15.4629C7.46934 15.4629 6.1582 14.8965 5.19154 13.8874C4.22489 12.8783 3.68182 11.5094 3.68182 10.0823C3.68182 5.23937 8.83631 1.47263 8.83631 1.47263Z" stroke="currentColor" stroke-opacity="0.9" stroke-width="1.76725" stroke-linecap="round" stroke-linejoin="round"/>
|
|
62
62
|
</svg>
|
|
63
|
-
`;function Du({message:e}){const t=e.role==="user";return e.role==="system"?R.jsx("div",{className:"mint-flex mint-justify-center mint-py-1",children:R.jsx("span",{className:"mint-rounded-full mint-bg-error/10 mint-px-3 mint-py-1 mint-text-xs mint-text-error",children:e.content})}):R.jsx("div",{className:_e("mint-flex mint-w-full",t?"mint-justify-end":"mint-justify-start"),children:R.jsx("div",{className:_e("mint-max-w-[78%] mint-whitespace-pre-wrap mint-break-words mint-rounded-2xl mint-px-4 mint-py-3 mint-text-sm mint-leading-relaxed",t?"mint-rounded-tr-sm mint-bg-grey-100 mint-text-grey-800":"mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-text-grey-800",e.status==="sending"&&"mint-opacity-60"),children:e.content})})}const Au=[{label:"Organization Carbon",icon:Mu},{label:"Organization Energy",icon:Pu},{label:"Water Footprint",icon:Ru}];function Tu({messages:e,isLoading:t}){const{welcomeMessage:n}=Ae(),r=j.useRef(null);return j.useEffect(()=>{var i;(i=r.current)==null||i.scrollIntoView({behavior:"smooth"})},[e.length,t]),R.jsxs("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-6 mint-py-5",children:[e.length===0&&R.jsxs("div",{className:"mint-flex mint-flex-1 mint-flex-col mint-items-center mint-justify-center mint-px-1",children:[R.jsx("h3",{className:"mint-m-0 mint-text-center mint-text-[24px] mint-font-bold mint-leading-7 mint-text-grey-900",children:n}),R.jsx("div",{className:"mint-mt-4 mint-flex mint-w-fit mint-max-w-full mint-flex-wrap mint-items-center mint-justify-center mint-gap-3",children:Au.map(i=>R.jsxs("button",{type:"button",className:"mint-inline-flex mint-max-w-full mint-items-center mint-justify-center mint-gap-0.5 mint-whitespace-nowrap mint-rounded-[7px] mint-border-[0.125px] mint-border-solid mint-border-assistant-accent mint-bg-assistant-accent/5 mint-px-2.5 mint-py-1 mint-text-[7px] mint-font-normal mint-leading-none mint-text-grey-900",children:[R.jsx(Ne,{source:i.icon,className:"mint-h-3 mint-w-3"}),i.label]},i.label))})]}),e.map(i=>R.jsx(Du,{message:i},i.id)),t&&R.jsx("div",{className:"mint-flex mint-justify-start",children:R.jsxs("div",{className:"mint-flex mint-gap-1 mint-rounded-2xl mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-px-4 mint-py-3",children:[R.jsx("span",{className:"mint-h-2 mint-w-2 mint-animate-bounce mint-rounded-full mint-bg-grey-500 [animation-delay:-0.3s]"}),R.jsx("span",{className:"mint-h-2 mint-w-2 mint-animate-bounce mint-rounded-full mint-bg-grey-500 [animation-delay:-0.15s]"}),R.jsx("span",{className:"mint-h-2 mint-w-2 mint-animate-bounce mint-rounded-full mint-bg-grey-500"})]})}),R.jsx("div",{ref:r})]})}function ju(){const e=vt(),{title:t,enableExpandMode:n,formContent:r,renderForm:i}=Ae(),{messages:o,isLoading:s,send:c}=ir(),a=n||!!(i||r);return R.jsx("div",{className:"mint-ai-shell",children:R.jsxs("div",{className:"mint-ai-panel mint-flex mint-flex-col mint-overflow-hidden mint-rounded-xl mint-bg-white",children:[R.jsxs("div",{className:"mint-mx-2 mint-flex mint-h-[72px] mint-shrink-0 mint-items-center mint-justify-between mint-gap-3 mint-px-3 mint-py-2",children:[R.jsxs("div",{className:"mint-min-w-0",children:[R.jsx("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:t}),R.jsx("p",{className:"mint-m-0 mint-mt-2 mint-text-xs mint-leading-4 mint-text-grey-500",children:"AI assisted disclosure and operational data capture"})]}),R.jsxs("div",{className:"mint-flex mint-shrink-0 mint-items-center mint-gap-2",children:[a&&R.jsx("button",{type:"button","aria-label":"Open expand mode",onClick:()=>e(no(!0)),className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:R.jsx(Ne,{source:vo,className:"mint-h-2.5 mint-w-3"})}),R.jsx("button",{type:"button","aria-label":"Close assistant",onClick:()=>e(Jn(!1)),className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:R.jsx(Ne,{source:rr,className:"mint-h-2 mint-w-2 mint-translate-y-[2px]"})})]})]}),R.jsx("div",{className:"mint-mx-2 mint-h-px mint-shrink-0 mint-bg-assistant-divider"}),R.jsx(Tu,{messages:o,isLoading:s}),R.jsx(Eo,{onSend:()=>c(),disabled:s})]})})}function Vu(){const{formContent:e,renderForm:t}=Ae(),n=t?t():e;return n?R.jsxs("aside",{className:"mint-flex mint-min-w-[320px] mint-flex-1 mint-flex-col mint-overflow-hidden mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-shadow-sm",children:[R.jsx("div",{className:"mint-flex mint-h-14 mint-shrink-0 mint-items-center mint-border-b mint-border-grey-200 mint-px-5",children:R.jsx("h3",{className:"mint-m-0 mint-text-sm mint-font-semibold mint-text-grey-900",children:"Form"})}),R.jsx("div",{className:"mint-scroll mint-flex-1 mint-overflow-y-auto mint-p-5",children:n})]}):null}function Lu(){return R.jsxs("aside",{className:"mint-flex mint-w-[230px] mint-shrink-0 mint-flex-col mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-p-4 mint-shadow-sm",children:[R.jsx("h1",{className:"mint-m-0 mint-text-[28px] mint-font-extrabold mint-leading-9 mint-text-grey-900",children:"MINT AI"}),R.jsxs("div",{className:"mint-mt-6 mint-flex mint-h-9 mint-items-center mint-gap-2 mint-rounded-lg mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-shadow-sm",children:[R.jsx(Kt,{icon:"solar:magnifer-linear",width:17,className:"mint-text-grey-500"}),R.jsx("span",{className:"mint-flex-1 mint-text-xs mint-text-grey-500",children:"Search"}),R.jsx(Ne,{source:wo,className:"mint-h-4 mint-w-4 mint-text-assistant-action"})]}),R.jsxs("button",{type:"button",className:"mint-mt-4 mint-flex mint-items-center mint-gap-2 mint-border-0 mint-bg-transparent mint-px-2 mint-py-1 mint-text-xs mint-font-semibold mint-text-grey-800",children:[R.jsx(Kt,{icon:"solar:history-linear",width:17}),"History"]})]})}function Fu({message:e}){const t=e.role==="user";return R.jsx("div",{className:_e("mint-flex mint-w-full mint-items-start mint-gap-3",t?"mint-justify-end":"mint-justify-start"),children:R.jsx("div",{className:_e("mint-max-w-[520px] mint-whitespace-pre-wrap mint-break-words mint-rounded-md mint-px-5 mint-py-3 mint-text-xs mint-leading-5 mint-text-grey-800",t?"mint-bg-grey-100":"mint-bg-primary-lighter/40"),children:e.content})})}function Qu(){const e=vt(),{title:t,welcomeMessage:n}=Ae(),{messages:r,isLoading:i,send:o}=ir();return R.jsxs("div",{className:"mint-flex mint-h-[min(720px,calc(100vh-112px))] mint-w-[min(1100px,calc(100vw-32px))] mint-gap-3 mint-rounded-2xl mint-bg-assistant-shell mint-p-3",children:[R.jsx(Lu,{}),R.jsxs("section",{className:"mint-relative mint-flex mint-min-w-0 mint-flex-1 mint-flex-col mint-overflow-hidden mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-shadow-sm",children:[R.jsxs("div",{className:"mint-flex mint-h-[82px] mint-shrink-0 mint-items-center mint-justify-between mint-gap-3 mint-px-6 mint-py-3",children:[R.jsxs("div",{className:"mint-min-w-0",children:[R.jsxs("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:[t," Expanded mode"]}),R.jsx("p",{className:"mint-m-0 mint-mt-2 mint-text-xs mint-leading-4 mint-text-grey-500",children:"AI conversation with live form filling"})]}),R.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2",children:[R.jsx("button",{type:"button","aria-label":"Back to normal mode",onClick:()=>e(no(!1)),className:"mint-flex mint-h-8 mint-w-8 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:R.jsx(Ne,{source:vo,className:"mint-h-3 mint-w-4"})}),R.jsx("button",{type:"button","aria-label":"Close assistant",onClick:()=>e(Jn(!1)),className:"mint-flex mint-h-8 mint-w-8 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:R.jsx(Ne,{source:rr,className:"mint-h-2.5 mint-w-2.5"})})]})]}),R.jsx("div",{className:"mint-mx-6 mint-h-px mint-shrink-0 mint-bg-assistant-divider"}),R.jsxs("div",{className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-[66px] mint-pb-28 mint-pt-3",children:[r.length===0&&R.jsx("div",{className:"mint-flex mint-flex-1 mint-items-center mint-justify-center mint-text-center mint-text-sm mint-font-semibold mint-text-grey-500",children:n}),r.map(s=>R.jsx(Fu,{message:s},s.id))]}),R.jsx("div",{className:"mint-absolute mint-bottom-0 mint-left-[66px] mint-right-[66px]",children:R.jsx(Eo,{onSend:()=>o(),disabled:i})})]}),R.jsx(Vu,{})]})}const zu={"bottom-right":"mint-bottom-4 mint-right-4 mint-items-end","bottom-left":"mint-bottom-4 mint-left-4 mint-items-start","top-right":"mint-top-4 mint-right-4 mint-items-end","top-left":"mint-top-4 mint-left-4 mint-items-start"},qu={"bottom-right":"mint-items-end mint-justify-start","bottom-left":"mint-items-start mint-justify-start","top-right":"mint-items-end mint-justify-start","top-left":"mint-items-start mint-justify-start"};function $u(){const e=vt(),{placement:t,defaultOpen:n}=Ae(),r=Ht(o=>o.chatUi.open),i=Ht(o=>o.chatUi.expanded);return j.useEffect(()=>{n&&e(Jn(!0))},[n,e]),R.jsxs("div",{className:_e("mint-fixed mint-z-widget mint-flex mint-gap-3",i?`mint-inset-0 mint-flex-col mint-bg-black/20 mint-p-4 ${qu[t]}`:`mint-flex-col ${zu[t]}`),children:[r&&(i?R.jsx(Qu,{}):R.jsx(ju,{})),R.jsx("div",{className:i?"mint-absolute mint-bottom-4 mint-right-4":void 0,children:R.jsx(Nu,{open:r,onClick:()=>e(ba())})})]})}function Uu({children:e,...t}){return R.jsxs(Ea,{config:t,children:[R.jsx($u,{}),e]})}exports.MintAIAssistant=Uu;exports.useChat=ir;exports.useConfig=Ae;
|
|
63
|
+
`,La=[{label:"Organization Carbon",icon:Aa},{label:"Organization Energy",icon:Ta},{label:"Water Footprint",icon:Va}];function ji({size:e="compact"}){const{welcomeMessage:t}=xe(),n=e==="expanded";return _.jsxs("div",{className:"mint-flex mint-flex-1 mint-flex-col mint-items-center mint-justify-center mint-px-1",children:[_.jsx("h3",{className:te("mint-m-0 mint-text-center mint-font-bold mint-text-grey-900",n?"mint-text-[28px] mint-leading-9":"mint-text-[24px] mint-leading-7"),children:t}),_.jsx("div",{className:"mint-mt-4 mint-flex mint-w-fit mint-max-w-full mint-flex-wrap mint-items-center mint-justify-center mint-gap-3",children:La.map(r=>_.jsxs("button",{type:"button",className:te("mint-inline-flex mint-max-w-full mint-items-center mint-justify-center mint-gap-1 mint-whitespace-nowrap mint-rounded-lg mint-border mint-border-solid mint-border-assistant-accent mint-bg-assistant-accent/5 mint-font-normal mint-leading-none mint-text-grey-900",n?"mint-px-3 mint-py-2 mint-text-xs":"mint-px-2.5 mint-py-1 mint-text-[7px]"),children:[_.jsx(Ie,{source:r.icon,className:n?"mint-h-4 mint-w-4":"mint-h-3 mint-w-3"}),r.label]},r.label))})]})}function Be({className:e,size:t="md"}){const n=te("mint-animate-bounce mint-rounded-full mint-bg-grey-500",t==="sm"?"mint-h-1.5 mint-w-1.5":"mint-h-2 mint-w-2");return _.jsxs("div",{className:te("mint-flex mint-gap-1",e),children:[_.jsx("span",{className:te(n,"[animation-delay:-0.3s]")}),_.jsx("span",{className:te(n,"[animation-delay:-0.15s]")}),_.jsx("span",{className:n})]})}function Qn(){return _.jsx("span",{className:"mint-flex mint-h-9 mint-w-9 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-bg-gradient-to-br mint-from-primary-light mint-to-primary mint-text-sm mint-font-semibold mint-text-primary-contrast",children:"M"})}function $n(){return _.jsx("span",{className:"mint-flex mint-h-9 mint-w-9 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-bg-grey-200 mint-text-grey-500",children:_.jsx(ie,{icon:"solar:user-bold",width:20})})}function Qa({message:e}){const t=e.role==="user";return _.jsxs("div",{className:te("mint-flex mint-w-full mint-items-start mint-gap-3",t?"mint-flex-row-reverse":"mint-justify-start"),children:[t?_.jsx($n,{}):_.jsx(Qn,{}),_.jsx("div",{className:te("mint-max-w-[78%] mint-whitespace-pre-wrap mint-break-words mint-rounded-2xl mint-px-4 mint-py-3 mint-text-sm mint-leading-relaxed",t?"mint-rounded-tr-sm mint-bg-grey-100 mint-text-grey-800":"mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-text-grey-800",e.status==="sending"&&"mint-opacity-60",e.status==="error"&&"mint-border mint-border-error/40"),children:e.content})]})}function $a({messages:e,isLoading:t,notice:n,hasOlder:r=!1,isLoadingOlder:i=!1,loadOlder:s}){const{enableExpandMode:o,formContent:a,renderForm:c}=xe(),l=Ve(),f=A.useRef(null),S=o||!!(c||a);return Oi(f,{messages:e,canLoadOlder:r,isLoadingOlder:i,loadOlder:s??(()=>{})}),_.jsxs("div",{ref:f,className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-6 mint-py-5",children:[e.length===0&&!n&&_.jsx(ji,{}),(i||r)&&e.length>0&&_.jsx("div",{className:"mint-flex mint-shrink-0 mint-justify-center mint-py-1",children:i?_.jsx(Be,{size:"sm",className:"mint-py-1"}):_.jsx("button",{type:"button",onClick:s,className:"mint-rounded-full mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-py-1 mint-text-[11px] mint-text-grey-600 hover:mint-bg-grey-100",children:"Load earlier messages"})}),e.map(C=>_.jsx(Qa,{message:C},C.id)),S&&e.length>0&&!t&&_.jsxs("div",{className:"mint-flex mint-items-start mint-gap-3",children:[_.jsx(Qn,{}),_.jsxs("div",{className:"mint-max-w-[78%] mint-rounded-2xl mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-px-4 mint-py-3",children:[_.jsx("p",{className:"mint-m-0 mint-text-sm mint-font-semibold mint-text-grey-900",children:"AI conversation with live form filling"}),_.jsx("p",{className:"mint-mt-1 mint-text-sm mint-text-grey-700",children:"Expand to open the AI conversation and live form filling experience."}),_.jsxs("button",{type:"button",onClick:()=>l(Tn(!0)),className:"mint-mt-3 mint-flex mint-items-center mint-gap-1.5 mint-rounded-lg mint-bg-gradient-to-br mint-from-primary-light mint-to-primary mint-px-3 mint-py-2 mint-text-xs mint-font-semibold mint-text-primary-contrast mint-transition-transform hover:mint-scale-105",children:[_.jsx(ie,{icon:"mingcute:code-line",width:14}),"Open Expand mode"]})]})]}),t&&_.jsx("div",{className:"mint-flex mint-justify-start",children:_.jsx("div",{className:"mint-rounded-2xl mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-px-4 mint-py-3",children:_.jsx(Be,{})})}),n&&_.jsx("div",{className:"mint-flex mint-justify-center mint-py-1",children:_.jsx("span",{className:"mint-rounded-full mint-bg-error/10 mint-px-3 mint-py-1 mint-text-xs mint-text-error",children:n})})]})}function Fa(){const e=Ve(),{title:t,enableExpandMode:n,formContent:r,renderForm:i}=xe(),{messages:s,notice:o,isLoading:a,send:c,loadOlder:l,hasOlder:f,isLoadingOlder:S}=Ln(),C=We(p=>p.chatUi.activeSessionId!==null||p.chatUi.pendingSend!==null),x=n||!!(i||r);return _.jsx("div",{className:"mint-ai-shell",children:_.jsxs("div",{className:"mint-ai-panel mint-flex mint-flex-col mint-overflow-hidden mint-rounded-xl mint-bg-white",children:[_.jsxs("div",{className:"mint-mx-2 mint-flex mint-h-[72px] mint-shrink-0 mint-items-center mint-justify-between mint-gap-3 mint-px-3 mint-py-2",children:[_.jsxs("div",{className:"mint-min-w-0",children:[_.jsx("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:t}),_.jsx("p",{className:"mint-m-0 mint-mt-2 mint-text-xs mint-leading-4 mint-text-grey-500",children:"AI assisted disclosure and operational data capture"})]}),_.jsxs("div",{className:"mint-flex mint-shrink-0 mint-items-center mint-gap-2",children:[C&&_.jsx("button",{type:"button","aria-label":"New chat",onClick:()=>e(Ei()),className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:_.jsx(ie,{icon:"mingcute:add-line",width:16})}),x&&_.jsx("button",{type:"button","aria-label":"Open expand mode",onClick:()=>e(Tn(!0)),className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:_.jsx(Ie,{source:Ni,className:"mint-h-2.5 mint-w-3"})}),_.jsx("button",{type:"button","aria-label":"Close assistant",onClick:()=>e(An(!1)),className:"mint-flex mint-h-7 mint-w-7 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:_.jsx(Ie,{source:Vn,className:"mint-h-2 mint-w-2 mint-translate-y-[2px]"})})]})]}),_.jsx("div",{className:"mint-mx-2 mint-h-px mint-shrink-0 mint-bg-assistant-divider"}),_.jsx($a,{messages:s,isLoading:a,notice:o,hasOlder:f,isLoadingOlder:S,loadOlder:l}),_.jsx(Ci,{onSend:()=>c(),disabled:a})]})})}function za(e,{hasMore:t,isLoading:n,onLoadMore:r,root:i}){A.useEffect(()=>{const s=e.current;if(!s||!t)return;const o=new IntersectionObserver(a=>{var c;(c=a[0])!=null&&c.isIntersecting&&t&&!n&&r()},{root:(i==null?void 0:i.current)??null,rootMargin:"160px"});return o.observe(s),()=>o.disconnect()},[e,t,n,r,i])}function qa(e,t=300){const[n,r]=A.useState(e);return A.useEffect(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}function Ii(e){const t=Ve(),n=We(m=>m.chatUi.activeSessionId),r=qa(e.trim(),300),{data:i,isLoading:s,isFetching:o,isError:a,hasNextPage:c,isFetchingNextPage:l,fetchNextPage:f,refetch:S}=va(r),C=(i==null?void 0:i.pages.flatMap(m=>m.items))??[],x=A.useCallback(m=>t(xi(m)),[t]),p=A.useCallback(()=>t(Ei()),[t]),N=A.useCallback(()=>{c&&!l&&f()},[c,l,f]);return{sessions:C,activeSessionId:n,isLoading:s,isReloading:o&&!l,isError:a,hasNextPage:!!c,isFetchingNextPage:l,loadMore:N,openSession:x,newChat:p,refetch:S}}function Ua(){var P,b;const{user:e}=xe(),[t,n]=A.useState(""),{sessions:r,activeSessionId:i,isLoading:s,isReloading:o,hasNextPage:a,isFetchingNextPage:c,loadMore:l,openSession:f,newChat:S}=Ii(t),C=A.useRef(null),x=A.useRef(null);za(x,{hasMore:a,isLoading:c,onLoadMore:l,root:C});const p=((P=e==null?void 0:e.name)==null?void 0:P.trim())||"Guest User",N=((b=e==null?void 0:e.email)==null?void 0:b.trim())||"",m=(s||o)&&r.length===0,O=!m&&r.length===0;return _.jsxs("aside",{className:"mint-hidden mint-w-[clamp(12rem,20vw,15.5rem)] mint-shrink-0 mint-flex-col mint-gap-4 mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-p-4 mint-shadow-sm lg:mint-flex",children:[_.jsx("h1",{className:"mint-m-0 mint-text-[26px] mint-font-extrabold mint-leading-8 mint-text-grey-900",children:"MINT AI"}),_.jsxs("div",{className:"mint-flex mint-h-10 mint-items-center mint-gap-2 mint-rounded-xl mint-border mint-border-grey-300 mint-bg-white mint-px-3 mint-shadow-composer",children:[_.jsx(ie,{icon:"solar:magnifer-linear",width:16,className:"mint-shrink-0 mint-text-grey-500"}),_.jsx("input",{type:"text",value:t,onChange:g=>n(g.target.value),placeholder:"Search","aria-label":"Search chats",className:"mint-h-full mint-min-w-0 mint-flex-1 mint-border-0 mint-bg-transparent mint-p-0 mint-text-xs mint-text-grey-800 mint-outline-none placeholder:mint-text-grey-500"}),_.jsx(Ie,{source:_i,className:"mint-h-4 mint-w-4 mint-shrink-0 mint-text-assistant-action"})]}),_.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2 mint-px-1 mint-text-xs mint-font-semibold mint-text-grey-800",children:[_.jsx(ie,{icon:"solar:history-linear",width:16}),"History"]}),_.jsxs("div",{className:"mint-flex mint-min-h-0 mint-flex-1 mint-flex-col mint-gap-1",children:[_.jsxs("div",{className:"mint-flex mint-items-center mint-justify-between mint-px-2 mint-py-1",children:[_.jsxs("span",{className:"mint-flex mint-items-center mint-gap-1 mint-text-xs mint-font-semibold mint-text-grey-700",children:["Recents",_.jsx(ie,{icon:"mingcute:down-line",width:13,className:"mint-text-grey-500"})]}),_.jsx("button",{type:"button","aria-label":"New chat",onClick:S,className:"mint-flex mint-h-6 mint-w-6 mint-items-center mint-justify-center mint-rounded-md mint-border-0 mint-bg-transparent mint-p-0 mint-text-grey-600 mint-transition-colors hover:mint-bg-grey-100",children:_.jsx(ie,{icon:"mingcute:add-line",width:15})})]}),_.jsxs("div",{ref:C,className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-0.5 mint-overflow-y-auto",children:[m&&_.jsx("div",{className:"mint-flex mint-justify-center mint-py-3",children:_.jsx(Be,{size:"sm"})}),O&&_.jsx("div",{className:"mint-px-3 mint-py-2 mint-text-[11px] mint-text-grey-500",children:t.trim()?"No matching chats":"No conversations yet"}),r.map(g=>_.jsx("button",{type:"button",onClick:()=>f(g.sessionId),title:g.title??void 0,className:te("mint-block mint-w-full mint-truncate mint-border-0 mint-bg-transparent mint-rounded-lg mint-px-3 mint-py-2 mint-text-left mint-text-[13px] mint-leading-5 mint-text-grey-600 mint-transition-colors hover:mint-bg-grey-100",g.sessionId===i&&"mint-bg-grey-100 mint-text-grey-900"),children:g.title||"Untitled chat"},g.sessionId)),a&&_.jsx("div",{ref:x,className:"mint-flex mint-shrink-0 mint-justify-center mint-py-2",children:c&&_.jsx(Be,{size:"sm"})})]})]}),_.jsxs("div",{style:{border:"1px solid rgba(0, 0, 0, 0.1)"},className:"mint-flex mint-items-center mint-gap-3 mint-rounded-xl mint-border mint-border-black mint-bg-white mint-p-3",children:[_.jsx($n,{}),_.jsxs("div",{className:"mint-min-w-0",children:[_.jsx("p",{className:"mint-m-0 mint-truncate mint-text-xs mint-font-semibold mint-text-grey-800",children:p}),N&&_.jsx("p",{className:"mint-m-0 mint-truncate mint-text-[10px] mint-text-grey-500",children:N})]})]})]})}function Wa(){const{formContent:e,renderForm:t}=xe(),n=t?t():e;return n?_.jsxs("aside",{className:"mint-flex mint-min-w-[320px] mint-flex-1 mint-flex-col mint-overflow-hidden mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-shadow-sm",children:[_.jsx("div",{className:"mint-flex mint-h-14 mint-shrink-0 mint-items-center mint-border-b mint-border-grey-200 mint-px-5",children:_.jsx("h3",{className:"mint-m-0 mint-text-sm mint-font-semibold mint-text-grey-900",children:"Form"})}),_.jsx("div",{className:"mint-scroll mint-flex-1 mint-overflow-y-auto mint-p-5",children:n})]}):null}function Ba({message:e}){const t=e.role==="user";return _.jsxs("div",{className:te("mint-flex mint-w-full mint-items-start mint-gap-3",t&&"mint-flex-row-reverse"),children:[t?_.jsx($n,{}):_.jsx(Qn,{}),_.jsx("div",{className:te("mint-max-w-[520px] mint-whitespace-pre-wrap mint-break-words mint-rounded-md mint-px-5 mint-py-3 mint-text-xs mint-leading-5 mint-text-grey-800",t?"mint-bg-grey-100":"mint-bg-primary-lighter/40",e.status==="sending"&&"mint-opacity-60",e.status==="error"&&"mint-border mint-border-error/40"),children:e.content})]})}function Ha(){const e=Ve(),{title:t}=xe(),{messages:n,notice:r,isLoading:i,send:s,loadOlder:o,hasOlder:a,isLoadingOlder:c}=Ln(),l=A.useRef(null);return Oi(l,{messages:n,canLoadOlder:a,isLoadingOlder:c,loadOlder:o}),_.jsxs("div",{className:"mint-flex mint-h-[min(720px,calc(100vh-112px))] mint-w-[min(1100px,calc(100vw-32px))] mint-gap-3 mint-rounded-2xl mint-bg-assistant-shell mint-p-3",children:[_.jsx(Ua,{}),_.jsxs("section",{className:"mint-relative mint-flex mint-min-w-0 mint-flex-1 mint-flex-col mint-overflow-hidden mint-rounded-xl mint-border mint-border-grey-200 mint-bg-white mint-shadow-sm",children:[_.jsxs("div",{className:"mint-flex mint-h-[82px] mint-shrink-0 mint-items-center mint-justify-between mint-gap-3 mint-px-6 mint-py-3",children:[_.jsxs("div",{className:"mint-min-w-0",children:[_.jsxs("h2",{className:"mint-m-0 mint-truncate mint-text-[22px] mint-font-bold mint-leading-7 mint-text-grey-900",children:[t," Expanded mode"]}),_.jsx("p",{className:"mint-m-0 mint-mt-2 mint-text-xs mint-leading-4 mint-text-grey-500",children:"AI conversation with live form filling"})]}),_.jsxs("div",{className:"mint-flex mint-items-center mint-gap-2",children:[_.jsx("button",{type:"button","aria-label":"Back to normal mode",onClick:()=>e(Tn(!1)),className:"mint-flex mint-h-8 mint-w-8 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:_.jsx(Ie,{source:Ni,className:"mint-h-3 mint-w-4"})}),_.jsx("button",{type:"button","aria-label":"Close assistant",onClick:()=>e(An(!1)),className:"mint-flex mint-h-8 mint-w-8 mint-shrink-0 mint-items-center mint-justify-center mint-rounded-full mint-border-0 mint-bg-assistant-action mint-p-0 mint-text-grey-800 mint-transition-transform hover:mint-scale-105",children:_.jsx(Ie,{source:Vn,className:"mint-h-2.5 mint-w-2.5"})})]})]}),_.jsx("div",{className:"mint-mx-6 mint-h-px mint-shrink-0 mint-bg-assistant-divider"}),_.jsxs("div",{ref:l,className:"mint-scroll mint-flex mint-flex-1 mint-flex-col mint-gap-5 mint-overflow-y-auto mint-px-3 mint-pb-28 mint-pt-3 sm:mint-px-6 lg:mint-px-[66px]",children:[n.length===0&&!r&&_.jsx(ji,{size:"expanded"}),(c||a)&&n.length>0&&_.jsx("div",{className:"mint-flex mint-shrink-0 mint-justify-center mint-py-1",children:c?_.jsx(Be,{size:"sm",className:"mint-py-1"}):_.jsx("button",{type:"button",onClick:o,className:"mint-rounded-full mint-border mint-border-grey-200 mint-bg-white mint-px-3 mint-py-1 mint-text-[11px] mint-text-grey-600 hover:mint-bg-grey-100",children:"Load earlier messages"})}),n.map(f=>_.jsx(Ba,{message:f},f.id)),i&&_.jsx("div",{className:"mint-flex mint-justify-start",children:_.jsx("div",{className:"mint-rounded-2xl mint-rounded-tl-sm mint-bg-primary-lighter/40 mint-px-4 mint-py-3",children:_.jsx(Be,{})})}),r&&_.jsx("div",{className:"mint-flex mint-justify-center mint-py-1",children:_.jsx("span",{className:"mint-rounded-full mint-bg-error/10 mint-px-3 mint-py-1 mint-text-xs mint-text-error",children:r})})]}),_.jsx("div",{className:"mint-absolute mint-bottom-0 mint-left-0 mint-right-0 sm:mint-left-3 sm:mint-right-3 lg:mint-left-[66px] lg:mint-right-[66px]",children:_.jsx(Ci,{onSend:()=>s(),disabled:i,expanded:!0})})]}),_.jsx(Wa,{})]})}const Ka={"bottom-right":"mint-bottom-4 mint-right-4 mint-items-end","bottom-left":"mint-bottom-4 mint-left-4 mint-items-start","top-right":"mint-top-4 mint-right-4 mint-items-end","top-left":"mint-top-4 mint-left-4 mint-items-start"},Ga={"bottom-right":"mint-items-end mint-justify-start","bottom-left":"mint-items-start mint-justify-start","top-right":"mint-items-end mint-justify-start","top-left":"mint-items-start mint-justify-start"};function Ya(){const e=Ve(),{placement:t,defaultOpen:n}=xe(),r=We(s=>s.chatUi.open),i=We(s=>s.chatUi.expanded);return A.useEffect(()=>{n&&e(An(!0))},[n,e]),_.jsxs("div",{className:te("mint-fixed mint-z-widget mint-flex mint-gap-3",i?`mint-inset-0 mint-flex-col mint-bg-black/20 mint-p-4 ${Ga[t]}`:`mint-flex-col ${Ka[t]}`),children:[r&&(i?_.jsx(Ha,{}):_.jsx(Fa,{})),_.jsx("div",{className:i?"mint-absolute mint-bottom-4 mint-right-4":void 0,children:_.jsx(Da,{open:r,onClick:()=>e(Sa())})})]})}function Za({children:e,...t}){return _.jsxs(Ia,{config:t,children:[_.jsx(Ya,{}),e]})}exports.MintAIAssistant=Za;exports.useChat=Ln;exports.useConfig=xe;exports.useSessions=Ii;
|