tanya-chatbot 0.4.7 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tanya-chatbot.cjs.js +11 -11
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +579 -557
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +1 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { useEffect as
|
|
1
|
+
import { useEffect as L, useState as P, useRef as Ft } from "react";
|
|
2
2
|
import { jsx as a, jsxs as u, Fragment as re } from "react/jsx-runtime";
|
|
3
|
-
import { createHttpLink as
|
|
4
|
-
import { Provider as
|
|
5
|
-
import { createSlice as
|
|
6
|
-
import * as
|
|
3
|
+
import { createHttpLink as lr, ApolloClient as cr, InMemoryCache as dr, ApolloProvider as ur } from "@apollo/client";
|
|
4
|
+
import { Provider as pr, useDispatch as De, useSelector as Ht } from "react-redux";
|
|
5
|
+
import { createSlice as Le, configureStore as fr } from "@reduxjs/toolkit";
|
|
6
|
+
import * as Be from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
9
|
import T from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
|
-
import { Icon as
|
|
12
|
-
import { toast as
|
|
13
|
-
const fr = '*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-12{height:3rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[60px\\]{height:60px}.h-\\[90vh\\]{height:90vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.w-28{width:7rem}.w-3{width:.75rem}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[75\\%\\]{max-width:75%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-y-0{--tw-translate-y: 0px;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))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[5px\\]{border-radius:5px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-l-\\[20px\\]{border-top-left-radius:20px;border-bottom-left-radius:20px}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-bl-2xl{border-bottom-left-radius:1rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tr-\\[20px\\]{border-top-right-radius:20px}.rounded-tr-\\[5px\\]{border-top-right-radius:5px}.border{border-width:1px}.border-0{border-width:0px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\\[\\#C9C2DE\\]{--tw-border-opacity: 1;border-color:rgb(201 194 222 / var(--tw-border-opacity, 1))}.border-\\[\\#E5E5E5\\]{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bg-\\[\\#553D94\\]{--tw-bg-opacity: 1;background-color:rgb(85 61 148 / var(--tw-bg-opacity, 1))}.bg-\\[\\#6851C6\\]{--tw-bg-opacity: 1;background-color:rgb(104 81 198 / var(--tw-bg-opacity, 1))}.bg-\\[\\#804C9E0D\\]{background-color:#804c9e0d}.bg-\\[\\#A21CAF\\]{--tw-bg-opacity: 1;background-color:rgb(162 28 175 / var(--tw-bg-opacity, 1))}.bg-\\[\\#AB192D\\]{--tw-bg-opacity: 1;background-color:rgb(171 25 45 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E2DBFF\\]{--tw-bg-opacity: 1;background-color:rgb(226 219 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E3DEEF\\]{--tw-bg-opacity: 1;background-color:rgb(227 222 239 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F3F3F3\\]{--tw-bg-opacity: 1;background-color:rgb(243 243 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FFFFFF\\],.bg-\\[\\#ffffff\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-black\\/30{background-color:#0000004d}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-\\[\\#000000\\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-\\[\\#14121F\\]{--tw-text-opacity: 1;color:rgb(20 18 31 / var(--tw-text-opacity, 1))}.text-\\[\\#18181B\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.text-\\[\\#232323\\]{--tw-text-opacity: 1;color:rgb(35 35 35 / var(--tw-text-opacity, 1))}.text-\\[\\#323135\\]{--tw-text-opacity: 1;color:rgb(50 49 53 / var(--tw-text-opacity, 1))}.text-\\[\\#494949\\]{--tw-text-opacity: 1;color:rgb(73 73 73 / var(--tw-text-opacity, 1))}.text-\\[\\#555555\\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\\[\\#5B5B5B\\]{--tw-text-opacity: 1;color:rgb(91 91 91 / var(--tw-text-opacity, 1))}.text-\\[\\#68656E\\]{--tw-text-opacity: 1;color:rgb(104 101 110 / var(--tw-text-opacity, 1))}.text-\\[\\#959595\\]{--tw-text-opacity: 1;color:rgb(149 149 149 / var(--tw-text-opacity, 1))}.text-\\[\\#EC5050\\]{--tw-text-opacity: 1;color:rgb(236 80 80 / var(--tw-text-opacity, 1))}.text-\\[\\#FBFBFC\\]{--tw-text-opacity: 1;color:rgb(251 251 252 / var(--tw-text-opacity, 1))}.text-\\[\\#FFFFFF\\]{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-80{opacity:.8}.shadow-\\[0px_2px_2px_0px_\\#9292BC40\\]{--tw-shadow: 0px 2px 2px 0px #9292BC40;--tw-shadow-colored: 0px 2px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_4px_10px_0px_\\#5F499840\\]{--tw-shadow: 0px 4px 10px 0px #5F499840;--tw-shadow-colored: 0px 4px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;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\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media(min-width:640px){.sm\\:w-\\[80vw\\]{width:80vw}}@media(min-width:768px){.md\\:h-\\[100vh\\]{height:100vh}.md\\:w-1\\/2{width:50%}.md\\:w-\\[770px\\]{width:770px}.md\\:translate-x-0{--tw-translate-x: 0px;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))}.md\\:translate-x-full{--tw-translate-x: 100%;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))}.md\\:translate-y-0{--tw-translate-y: 0px;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))}.md\\:flex-row{flex-direction:row}}@media(min-width:1024px){.lg\\:h-\\[100vh\\]{height:100vh}.lg\\:w-1\\/2{width:50%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:translate-x-0{--tw-translate-x: 0px;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))}.lg\\:translate-x-full{--tw-translate-x: 100%;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))}.lg\\:translate-y-0{--tw-translate-y: 0px;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))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:flex-row{flex-direction:row}.lg\\:rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.lg\\:rounded-bl-xl{border-bottom-left-radius:.75rem}}';
|
|
14
|
-
function
|
|
15
|
-
return
|
|
11
|
+
import { Icon as be } from "@iconify/react";
|
|
12
|
+
import { toast as B } from "react-toastify";
|
|
13
|
+
const hr = '*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-12{height:3rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[60px\\]{height:60px}.h-\\[90vh\\]{height:90vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.w-28{width:7rem}.w-3{width:.75rem}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[75\\%\\]{max-width:75%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-y-0{--tw-translate-y: 0px;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))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[5px\\]{border-radius:5px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-l-\\[20px\\]{border-top-left-radius:20px;border-bottom-left-radius:20px}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-bl-2xl{border-bottom-left-radius:1rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tr-\\[20px\\]{border-top-right-radius:20px}.rounded-tr-\\[5px\\]{border-top-right-radius:5px}.border{border-width:1px}.border-0{border-width:0px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\\[\\#C9C2DE\\]{--tw-border-opacity: 1;border-color:rgb(201 194 222 / var(--tw-border-opacity, 1))}.border-\\[\\#E5E5E5\\]{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bg-\\[\\#553D94\\]{--tw-bg-opacity: 1;background-color:rgb(85 61 148 / var(--tw-bg-opacity, 1))}.bg-\\[\\#6851C6\\]{--tw-bg-opacity: 1;background-color:rgb(104 81 198 / var(--tw-bg-opacity, 1))}.bg-\\[\\#804C9E0D\\]{background-color:#804c9e0d}.bg-\\[\\#A21CAF\\]{--tw-bg-opacity: 1;background-color:rgb(162 28 175 / var(--tw-bg-opacity, 1))}.bg-\\[\\#AB192D\\]{--tw-bg-opacity: 1;background-color:rgb(171 25 45 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E2DBFF\\]{--tw-bg-opacity: 1;background-color:rgb(226 219 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E3DEEF\\]{--tw-bg-opacity: 1;background-color:rgb(227 222 239 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F3F3F3\\]{--tw-bg-opacity: 1;background-color:rgb(243 243 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FFFFFF\\],.bg-\\[\\#ffffff\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-black\\/30{background-color:#0000004d}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-\\[\\#000000\\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-\\[\\#14121F\\]{--tw-text-opacity: 1;color:rgb(20 18 31 / var(--tw-text-opacity, 1))}.text-\\[\\#18181B\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.text-\\[\\#232323\\]{--tw-text-opacity: 1;color:rgb(35 35 35 / var(--tw-text-opacity, 1))}.text-\\[\\#323135\\]{--tw-text-opacity: 1;color:rgb(50 49 53 / var(--tw-text-opacity, 1))}.text-\\[\\#494949\\]{--tw-text-opacity: 1;color:rgb(73 73 73 / var(--tw-text-opacity, 1))}.text-\\[\\#555555\\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\\[\\#5B5B5B\\]{--tw-text-opacity: 1;color:rgb(91 91 91 / var(--tw-text-opacity, 1))}.text-\\[\\#68656E\\]{--tw-text-opacity: 1;color:rgb(104 101 110 / var(--tw-text-opacity, 1))}.text-\\[\\#959595\\]{--tw-text-opacity: 1;color:rgb(149 149 149 / var(--tw-text-opacity, 1))}.text-\\[\\#EC5050\\]{--tw-text-opacity: 1;color:rgb(236 80 80 / var(--tw-text-opacity, 1))}.text-\\[\\#FBFBFC\\]{--tw-text-opacity: 1;color:rgb(251 251 252 / var(--tw-text-opacity, 1))}.text-\\[\\#FFFFFF\\]{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-80{opacity:.8}.shadow-\\[0px_2px_2px_0px_\\#9292BC40\\]{--tw-shadow: 0px 2px 2px 0px #9292BC40;--tw-shadow-colored: 0px 2px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_4px_10px_0px_\\#5F499840\\]{--tw-shadow: 0px 4px 10px 0px #5F499840;--tw-shadow-colored: 0px 4px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;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\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media(min-width:640px){.sm\\:w-\\[80vw\\]{width:80vw}}@media(min-width:768px){.md\\:h-\\[100vh\\]{height:100vh}.md\\:w-1\\/2{width:50%}.md\\:w-\\[770px\\]{width:770px}.md\\:translate-x-0{--tw-translate-x: 0px;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))}.md\\:translate-x-full{--tw-translate-x: 100%;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))}.md\\:translate-y-0{--tw-translate-y: 0px;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))}.md\\:flex-row{flex-direction:row}}@media(min-width:1024px){.lg\\:h-\\[100vh\\]{height:100vh}.lg\\:w-1\\/2{width:50%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:translate-x-0{--tw-translate-x: 0px;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))}.lg\\:translate-x-full{--tw-translate-x: 100%;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))}.lg\\:translate-y-0{--tw-translate-y: 0px;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))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:flex-row{flex-direction:row}.lg\\:rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.lg\\:rounded-bl-xl{border-bottom-left-radius:.75rem}}';
|
|
14
|
+
function ko() {
|
|
15
|
+
return L(() => {
|
|
16
16
|
if (typeof document < "u") {
|
|
17
17
|
const t = document.createElement("style");
|
|
18
|
-
return t.textContent =
|
|
18
|
+
return t.textContent = hr, document.head.appendChild(t), () => {
|
|
19
19
|
document.head.removeChild(t);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
}, []), null;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const mr = {
|
|
25
25
|
store: {
|
|
26
26
|
storeCode: "",
|
|
27
27
|
storeName: "",
|
|
@@ -55,30 +55,30 @@ const hr = {
|
|
|
55
55
|
mobile: []
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, Ue = Le({
|
|
59
59
|
name: "store",
|
|
60
|
-
initialState:
|
|
60
|
+
initialState: mr,
|
|
61
61
|
reducers: {
|
|
62
62
|
setStore: (t, e) => {
|
|
63
63
|
t.store = e.payload;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
}), { setStore:
|
|
66
|
+
}), { setStore: So } = Ue.actions, wr = Ue.reducer, gr = {
|
|
67
67
|
product: null
|
|
68
|
-
},
|
|
68
|
+
}, qe = Le({
|
|
69
69
|
name: "product",
|
|
70
|
-
initialState:
|
|
70
|
+
initialState: gr,
|
|
71
71
|
reducers: {
|
|
72
72
|
setProduct: (t, e) => {
|
|
73
73
|
t.product = e.payload;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
}), { setProduct: oe } =
|
|
76
|
+
}), { setProduct: oe } = qe.actions, br = qe.reducer, xr = fr({
|
|
77
77
|
reducer: {
|
|
78
|
-
store:
|
|
79
|
-
product:
|
|
78
|
+
store: wr,
|
|
79
|
+
product: br
|
|
80
80
|
}
|
|
81
|
-
}),
|
|
81
|
+
}), yr = ({ children: t }) => /* @__PURE__ */ a(pr, { store: xr, children: t }), Rt = (t) => {
|
|
82
82
|
const e = new CustomEvent("reactCartUpdated", {
|
|
83
83
|
detail: {
|
|
84
84
|
cartUpdated: !0,
|
|
@@ -87,31 +87,31 @@ const hr = {
|
|
|
87
87
|
});
|
|
88
88
|
window.dispatchEvent(e);
|
|
89
89
|
};
|
|
90
|
-
function
|
|
90
|
+
function vr({
|
|
91
91
|
...t
|
|
92
92
|
}) {
|
|
93
|
-
return /* @__PURE__ */ a(
|
|
93
|
+
return /* @__PURE__ */ a(Be.Root, { "data-slot": "popover", ...t });
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function kr({
|
|
96
96
|
...t
|
|
97
97
|
}) {
|
|
98
|
-
return /* @__PURE__ */ a(
|
|
98
|
+
return /* @__PURE__ */ a(Be.Trigger, { "data-slot": "popover-trigger", ...t });
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const kt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }), Me = async () => {
|
|
101
101
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
102
102
|
try {
|
|
103
103
|
const e = await T.post(
|
|
104
|
-
`${t}api/auth/token-bm-grant?baseUrl=${
|
|
104
|
+
`${t}api/auth/token-bm-grant?baseUrl=${X()}&siteId=${V()}`
|
|
105
105
|
);
|
|
106
106
|
return e.status === 200 && e.data.access_token ? e.data.access_token : (console.error("Failed to fetch token:", e.data), null);
|
|
107
107
|
} catch (e) {
|
|
108
108
|
return T.isAxiosError(e) ? console.error("Error fetching token:", e.response || e.message) : console.error("Unexpected error:", e), null;
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, He = async (t) => {
|
|
111
111
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
112
112
|
try {
|
|
113
113
|
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await T.post(
|
|
114
|
-
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${
|
|
114
|
+
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${X()}&siteId=${V()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
115
115
|
{},
|
|
116
116
|
{
|
|
117
117
|
headers: {
|
|
@@ -127,21 +127,21 @@ const vt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
127
127
|
};
|
|
128
128
|
async function Pt() {
|
|
129
129
|
var c;
|
|
130
|
-
const t =
|
|
130
|
+
const t = V(), e = "access_token_" + t, r = "expires_in_" + t, o = localStorage.getItem(r), n = localStorage.getItem(e);
|
|
131
131
|
return console.log(n), (c = JSON.parse(sessionStorage.getItem("customerData") || "{}")) != null && c.isGuest, console.log("access token found in local storage"), { access_token: n, expires_in: o };
|
|
132
132
|
}
|
|
133
|
-
const
|
|
133
|
+
const X = () => sessionStorage.getItem("Host"), V = () => sessionStorage.getItem("SiteId"), at = () => sessionStorage.getItem("pubCfg"), it = () => sessionStorage.getItem("envRef"), st = () => sessionStorage.getItem("orgRef"), xe = async (t) => {
|
|
134
134
|
console.log("fetching results");
|
|
135
|
-
const { serverUrl: e, basePath: r } =
|
|
135
|
+
const { serverUrl: e, basePath: r } = kt();
|
|
136
136
|
let o = "";
|
|
137
137
|
{
|
|
138
138
|
const n = await Pt();
|
|
139
139
|
console.log("the token from getSearchResults", n), o = n.access_token;
|
|
140
140
|
}
|
|
141
141
|
try {
|
|
142
|
-
const n =
|
|
142
|
+
const n = X();
|
|
143
143
|
return (await T.get(
|
|
144
|
-
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${
|
|
144
|
+
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${V()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
145
145
|
{
|
|
146
146
|
headers: {
|
|
147
147
|
"Content-Type": "application/json",
|
|
@@ -152,13 +152,13 @@ const Z = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
152
152
|
} catch (n) {
|
|
153
153
|
throw console.error("Error fetching search results:", n), n;
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, Re = async (t) => {
|
|
156
156
|
if (!t) throw new Error("Product ID is required");
|
|
157
|
-
const { serverUrl: e, basePath: r } =
|
|
157
|
+
const { serverUrl: e, basePath: r } = kt(), o = X();
|
|
158
158
|
console.log("calling access");
|
|
159
159
|
const { access_token: n } = await Pt();
|
|
160
160
|
return console.log(n), (await T.get(
|
|
161
|
-
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${
|
|
161
|
+
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${V()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
162
162
|
{
|
|
163
163
|
headers: {
|
|
164
164
|
"Content-Type": "application/json",
|
|
@@ -166,13 +166,13 @@ const Z = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
)).data;
|
|
169
|
-
},
|
|
169
|
+
}, Sr = async (t) => {
|
|
170
170
|
if (!t) throw new Error("customerId is required");
|
|
171
|
-
const e = await
|
|
171
|
+
const e = await Me(), { customer_token: r } = await He(
|
|
172
172
|
e
|
|
173
|
-
), { serverUrl: o, basePath: n } =
|
|
173
|
+
), { serverUrl: o, basePath: n } = kt(), l = (await Pt()).access_token;
|
|
174
174
|
return (await T.get(
|
|
175
|
-
`${o}${n}/get-interest?baseUrl=${
|
|
175
|
+
`${o}${n}/get-interest?baseUrl=${X()}&customerId=${t}&siteId=${V()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
176
176
|
{
|
|
177
177
|
headers: {
|
|
178
178
|
"Content-Type": "application/json",
|
|
@@ -180,10 +180,10 @@ const Z = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
)).data;
|
|
183
|
-
},
|
|
183
|
+
}, ye = (t) => String(typeof t == "string" ? t : t["en-US"] || t), ve = (t) => t != null && t.image ? [t.image] : "variants" in t ? t.variants[0].images : t.masterVariant.images.map((e) => e.url), _r = (t, e) => t.toLocaleString("en-US", {
|
|
184
184
|
style: "currency",
|
|
185
185
|
currency: e || "USD"
|
|
186
|
-
}),
|
|
186
|
+
}), ke = (t) => {
|
|
187
187
|
var e, r, o;
|
|
188
188
|
return "variants" in t ? {
|
|
189
189
|
centAmount: (e = t.variants[0]) == null ? void 0 : e.prices.EUR.max,
|
|
@@ -192,13 +192,13 @@ const Z = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
192
192
|
centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
193
193
|
currencyCode: (o = t.masterVariant) == null ? void 0 : o.prices[0].value.currencyCode
|
|
194
194
|
};
|
|
195
|
-
}, Cr = (t) => t.charAt(0).toUpperCase() + t.slice(1),
|
|
195
|
+
}, Cr = (t) => t.charAt(0).toUpperCase() + t.slice(1), Se = (t, e) => t.length < e ? t : t.slice(0, e) + "...", Xt = (t) => t.split("\\n").map((e, r) => {
|
|
196
196
|
const o = e.match(/^(\d+)\.\s(.+)/);
|
|
197
197
|
return o ? `<p key=${r} class="mb-2"><strong>${o[1]}.</strong> ${o[2]}</p>` : e.trim() ? `<p key=${r} class="mb-2">${e}</p>` : "<br/>";
|
|
198
198
|
}).join("");
|
|
199
|
-
function
|
|
200
|
-
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] =
|
|
201
|
-
return
|
|
199
|
+
function Ir() {
|
|
200
|
+
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = P(t);
|
|
201
|
+
return L(() => {
|
|
202
202
|
const o = () => r(t());
|
|
203
203
|
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
204
204
|
}, []), e;
|
|
@@ -206,7 +206,7 @@ function _r() {
|
|
|
206
206
|
const Fr = ({
|
|
207
207
|
product: t
|
|
208
208
|
}) => {
|
|
209
|
-
const e =
|
|
209
|
+
const e = De(), r = Ir(), [o, n] = P(0), c = () => {
|
|
210
210
|
n(
|
|
211
211
|
(i) => i + r >= t.length ? 0 : i + r
|
|
212
212
|
);
|
|
@@ -215,7 +215,7 @@ const Fr = ({
|
|
|
215
215
|
(i) => i - r < 0 ? t.length - (t.length % r || r) : i - r
|
|
216
216
|
);
|
|
217
217
|
}, d = async (i) => {
|
|
218
|
-
const y = await
|
|
218
|
+
const y = await Re(i);
|
|
219
219
|
e(oe(y));
|
|
220
220
|
};
|
|
221
221
|
return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
@@ -233,7 +233,7 @@ const Fr = ({
|
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
235
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((i) => {
|
|
236
|
-
var y,
|
|
236
|
+
var y, v, C, S;
|
|
237
237
|
return /* @__PURE__ */ u(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
@@ -245,7 +245,7 @@ const Fr = ({
|
|
|
245
245
|
/* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
|
|
246
246
|
"img",
|
|
247
247
|
{
|
|
248
|
-
src: ((y =
|
|
248
|
+
src: ((y = ve(i)[0]) == null ? void 0 : y.link) || ve(i)[0] || // fallback if it's a string
|
|
249
249
|
"https://via.placeholder.com/120",
|
|
250
250
|
alt: i != null && i.productName ? i.productName : "Product",
|
|
251
251
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
@@ -257,8 +257,8 @@ const Fr = ({
|
|
|
257
257
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
258
258
|
children: [
|
|
259
259
|
/* @__PURE__ */ u("div", { className: "relative inline-block group", children: [
|
|
260
|
-
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name :
|
|
261
|
-
|
|
260
|
+
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name : Se(
|
|
261
|
+
ye((v = i == null ? void 0 : i.name) == null ? void 0 : v["en-US"]),
|
|
262
262
|
60
|
|
263
263
|
) || "Product" }),
|
|
264
264
|
/* @__PURE__ */ a(
|
|
@@ -272,17 +272,17 @@ const Fr = ({
|
|
|
272
272
|
marginBottom: "5px",
|
|
273
273
|
zIndex: 50
|
|
274
274
|
},
|
|
275
|
-
children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name :
|
|
276
|
-
|
|
275
|
+
children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name : Se(
|
|
276
|
+
ye((C = i == null ? void 0 : i.name) == null ? void 0 : C["en-US"]),
|
|
277
277
|
60
|
|
278
278
|
) || "Product"
|
|
279
279
|
}
|
|
280
280
|
)
|
|
281
281
|
] }),
|
|
282
282
|
/* @__PURE__ */ u("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
283
|
-
/* @__PURE__ */ a("p", { children:
|
|
284
|
-
i != null && i.price ? Number(i == null ? void 0 : i.price) :
|
|
285
|
-
(
|
|
283
|
+
/* @__PURE__ */ a("p", { children: _r(
|
|
284
|
+
i != null && i.price ? Number(i == null ? void 0 : i.price) : ke(i).centAmount || 0,
|
|
285
|
+
(S = ke(i)) == null ? void 0 : S.currencyCode
|
|
286
286
|
) }),
|
|
287
287
|
/* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
288
288
|
"$",
|
|
@@ -311,7 +311,7 @@ const Fr = ({
|
|
|
311
311
|
}
|
|
312
312
|
)
|
|
313
313
|
] }) });
|
|
314
|
-
},
|
|
314
|
+
}, Nr = ({ chat: t, storeDetails: e }) => /* @__PURE__ */ a("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: t.map((r, o) => /* @__PURE__ */ u(
|
|
315
315
|
"div",
|
|
316
316
|
{
|
|
317
317
|
className: "mb-4 p-3 rounded-xl",
|
|
@@ -339,12 +339,12 @@ const Fr = ({
|
|
|
339
339
|
o
|
|
340
340
|
)) }), Ve = async (t, e) => {
|
|
341
341
|
var c, l;
|
|
342
|
-
const { serverUrl: r, basePath: o } =
|
|
342
|
+
const { serverUrl: r, basePath: o } = kt(), n = `${r}`;
|
|
343
343
|
console.log(`customer_token
|
|
344
344
|
`, t);
|
|
345
345
|
try {
|
|
346
346
|
const d = await T.post(
|
|
347
|
-
`${n}${o}/basket/create?baseUrl=${
|
|
347
|
+
`${n}${o}/basket/create?baseUrl=${X()}&siteId=${V()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
348
348
|
e,
|
|
349
349
|
{
|
|
350
350
|
headers: {
|
|
@@ -363,11 +363,11 @@ const Fr = ({
|
|
|
363
363
|
} catch (d) {
|
|
364
364
|
return T.isAxiosError(d) ? console.error("Error creating basket:", d.response || d.message) : console.error("Unexpected error:", d), null;
|
|
365
365
|
}
|
|
366
|
-
},
|
|
367
|
-
const { serverUrl: o, basePath: n } =
|
|
366
|
+
}, ne = async (t, e, r) => {
|
|
367
|
+
const { serverUrl: o, basePath: n } = kt(), c = `${o}`;
|
|
368
368
|
try {
|
|
369
369
|
const l = await T.post(
|
|
370
|
-
`${c}${n}/basket/add-product/${t}?baseUrl=${
|
|
370
|
+
`${c}${n}/basket/add-product/${t}?baseUrl=${X()}&siteId=${V()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
371
371
|
e,
|
|
372
372
|
{
|
|
373
373
|
headers: {
|
|
@@ -383,15 +383,15 @@ const Fr = ({
|
|
|
383
383
|
l.response || l.message
|
|
384
384
|
) : console.error("Unexpected error:", l), null;
|
|
385
385
|
}
|
|
386
|
-
},
|
|
386
|
+
}, Ye = async ({
|
|
387
387
|
basketId: t,
|
|
388
388
|
customer_token: e
|
|
389
389
|
}) => {
|
|
390
390
|
var c;
|
|
391
|
-
const { serverUrl: r, basePath: o } =
|
|
391
|
+
const { serverUrl: r, basePath: o } = kt(), n = `${r}`;
|
|
392
392
|
try {
|
|
393
393
|
const l = await T.get(
|
|
394
|
-
`${n}${o}/basket/${t}?baseUrl=${
|
|
394
|
+
`${n}${o}/basket/${t}?baseUrl=${X()}&siteId=${V()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
395
395
|
{
|
|
396
396
|
headers: {
|
|
397
397
|
"Content-Type": "application/json",
|
|
@@ -403,129 +403,129 @@ const Fr = ({
|
|
|
403
403
|
} catch (l) {
|
|
404
404
|
return T.isAxiosError(l) ? { status: (c = l.response) == null ? void 0 : c.status, data: null } : { status: null, data: null };
|
|
405
405
|
}
|
|
406
|
-
},
|
|
406
|
+
}, Vt = "sfcc_basket_id", _e = "sfcc_customer_token", Ot = "sfcc_token_expiry", Er = 300 * 1e3, Nt = "1.0.0";
|
|
407
407
|
const nt = (t) => {
|
|
408
408
|
try {
|
|
409
|
-
t ? localStorage.setItem(
|
|
409
|
+
t ? localStorage.setItem(Vt, t) : localStorage.removeItem(Vt);
|
|
410
410
|
} catch (e) {
|
|
411
411
|
console.error("Error saving basket ID to storage:", e);
|
|
412
412
|
}
|
|
413
|
-
},
|
|
413
|
+
}, Yt = (t) => {
|
|
414
414
|
try {
|
|
415
415
|
if (t) {
|
|
416
|
-
localStorage.setItem(
|
|
417
|
-
const e = Date.now() +
|
|
418
|
-
localStorage.setItem(
|
|
416
|
+
localStorage.setItem(_e, t);
|
|
417
|
+
const e = Date.now() + Er;
|
|
418
|
+
localStorage.setItem(Ot, e.toString());
|
|
419
419
|
} else
|
|
420
|
-
localStorage.removeItem(
|
|
420
|
+
localStorage.removeItem(_e);
|
|
421
421
|
} catch (e) {
|
|
422
422
|
console.error("Error storing token:", e);
|
|
423
423
|
}
|
|
424
|
-
}, Ce = 300,
|
|
425
|
-
var d, i, y,
|
|
426
|
-
const t =
|
|
427
|
-
if (
|
|
424
|
+
}, Ce = 300, Tr = () => {
|
|
425
|
+
var d, i, y, v, C, S;
|
|
426
|
+
const t = De(), e = Ht((I) => I.product.product), r = Ht((I) => I.store.store), [o, n] = P(!!e);
|
|
427
|
+
if (L(() => {
|
|
428
428
|
n(!!e);
|
|
429
429
|
}, [e]), !e) return null;
|
|
430
430
|
const c = async () => {
|
|
431
|
-
var
|
|
431
|
+
var I, z, Q, St, lt, U, ct, _t, $t, Z, Ct, It, dt, zt, At, tt;
|
|
432
432
|
console.log(e, "the prod");
|
|
433
433
|
try {
|
|
434
|
-
if (!((
|
|
435
|
-
|
|
434
|
+
if (!((z = (I = e == null ? void 0 : e.variants) == null ? void 0 : I[0]) != null && z.product_id) && !(e.type.item || e.type.bundle) && !((St = (Q = e == null ? void 0 : e.variants) == null ? void 0 : Q[0]) != null && St.productId)) {
|
|
435
|
+
B.error("Variants not available", {
|
|
436
436
|
position: "bottom-right",
|
|
437
437
|
autoClose: 1e3
|
|
438
438
|
}), console.error("No product variant found");
|
|
439
439
|
return;
|
|
440
440
|
}
|
|
441
|
-
const
|
|
441
|
+
const b = [
|
|
442
442
|
{
|
|
443
|
-
product_id: ((
|
|
443
|
+
product_id: ((lt = e.variants) == null ? void 0 : lt[0].product_id) || ((U = e.variants) == null ? void 0 : U[0].productId) || (e == null ? void 0 : e.id),
|
|
444
444
|
quantity: 1
|
|
445
445
|
}
|
|
446
446
|
];
|
|
447
|
-
console.log(
|
|
448
|
-
const
|
|
447
|
+
console.log(b, "the product data");
|
|
448
|
+
const et = JSON.parse(
|
|
449
449
|
sessionStorage.getItem("customerData") || "{}"
|
|
450
|
-
),
|
|
451
|
-
if (!
|
|
452
|
-
let
|
|
450
|
+
), k = (et == null ? void 0 : et.basketId) || localStorage.getItem(Vt), Jt = !1, jt = localStorage.getItem(Ot), Dt = Date.now();
|
|
451
|
+
if (!Jt || !jt || Dt >= parseInt(jt)) {
|
|
452
|
+
let q = "";
|
|
453
453
|
{
|
|
454
454
|
const pt = await Pt();
|
|
455
|
-
console.log("token from auth data"),
|
|
455
|
+
console.log("token from auth data"), q = "Bearer " + pt.access_token;
|
|
456
456
|
}
|
|
457
|
-
if (
|
|
457
|
+
if (!q) {
|
|
458
458
|
console.error("Failed to get customer_token");
|
|
459
459
|
return;
|
|
460
460
|
}
|
|
461
|
-
const
|
|
462
|
-
if (
|
|
463
|
-
const pt = await
|
|
464
|
-
basketId:
|
|
465
|
-
customer_token:
|
|
461
|
+
const rt = Dt + 300 * 1e3;
|
|
462
|
+
if (Yt(q), localStorage.setItem(Ot, rt.toString()), k) {
|
|
463
|
+
const pt = await Ye({
|
|
464
|
+
basketId: k,
|
|
465
|
+
customer_token: q
|
|
466
466
|
});
|
|
467
|
-
if (console.log(
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
467
|
+
if (console.log(k, "basket id from customer"), pt.status === 200 && pt) {
|
|
468
|
+
const K = await ne(
|
|
469
|
+
k,
|
|
470
|
+
b,
|
|
471
|
+
q
|
|
472
472
|
);
|
|
473
|
-
(((
|
|
473
|
+
(((ct = K == null ? void 0 : K.product_items) == null ? void 0 : ct.length) > 0 || ((_t = K == null ? void 0 : K.productItems) == null ? void 0 : _t.length) > 0) && (B.success("Added to cart", {
|
|
474
474
|
position: "bottom-right",
|
|
475
475
|
autoClose: 3e3,
|
|
476
476
|
hideProgressBar: !1,
|
|
477
477
|
closeOnClick: !0,
|
|
478
478
|
pauseOnHover: !0,
|
|
479
479
|
draggable: !0
|
|
480
|
-
}),
|
|
480
|
+
}), Rt(k));
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const ut = {
|
|
485
485
|
productItems: [
|
|
486
486
|
{
|
|
487
|
-
productId: ((
|
|
487
|
+
productId: (($t = e.variants) == null ? void 0 : $t[0].product_id) || ((Z = e.variants) == null ? void 0 : Z[0].productId) || (e == null ? void 0 : e.id),
|
|
488
488
|
quantity: 1
|
|
489
489
|
}
|
|
490
490
|
]
|
|
491
491
|
};
|
|
492
492
|
console.log("before create basket");
|
|
493
|
-
const
|
|
493
|
+
const p = await Ve(q, ut);
|
|
494
494
|
if (console.log(
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
495
|
+
p,
|
|
496
|
+
p == null ? void 0 : p.basket_id,
|
|
497
|
+
p == null ? void 0 : p.basketId,
|
|
498
498
|
"the basket response"
|
|
499
|
-
), !(
|
|
499
|
+
), !(p != null && p.basket_id) && !(p != null && p.basketId)) {
|
|
500
500
|
console.error("Failed to create basket");
|
|
501
501
|
return;
|
|
502
502
|
}
|
|
503
503
|
console.log(
|
|
504
504
|
"setting stored id",
|
|
505
|
-
(
|
|
505
|
+
(p == null ? void 0 : p.basket_id) || (p == null ? void 0 : p.basketId)
|
|
506
506
|
), nt(
|
|
507
|
-
(
|
|
507
|
+
(p == null ? void 0 : p.basket_id) || (p == null ? void 0 : p.basketId)
|
|
508
508
|
), console.log("adding product to basket");
|
|
509
|
-
const
|
|
510
|
-
(
|
|
511
|
-
|
|
512
|
-
|
|
509
|
+
const Y = await ne(
|
|
510
|
+
(p == null ? void 0 : p.basket_id) || (p == null ? void 0 : p.basketId),
|
|
511
|
+
b,
|
|
512
|
+
q
|
|
513
513
|
);
|
|
514
|
-
console.log("object added to basket"), (((Ct =
|
|
514
|
+
console.log("object added to basket"), (((Ct = Y == null ? void 0 : Y.product_items) == null ? void 0 : Ct.length) > 0 || ((It = Y == null ? void 0 : Y.productItems) == null ? void 0 : It.length) > 0) && B.success("Added to cart", {
|
|
515
515
|
position: "bottom-right",
|
|
516
516
|
autoClose: 3e3,
|
|
517
517
|
hideProgressBar: !1,
|
|
518
518
|
closeOnClick: !0,
|
|
519
519
|
pauseOnHover: !0,
|
|
520
520
|
draggable: !0
|
|
521
|
-
}),
|
|
521
|
+
}), Rt(p.basket_id || (p == null ? void 0 : p.basketId));
|
|
522
522
|
}
|
|
523
|
-
} catch (
|
|
524
|
-
console.error("Error adding to cart:",
|
|
523
|
+
} catch (b) {
|
|
524
|
+
console.error("Error adding to cart:", b), B.error("Failed to add product to cart", {
|
|
525
525
|
position: "bottom-right",
|
|
526
526
|
autoClose: 3e3
|
|
527
|
-
}), ((
|
|
528
|
-
((zt =
|
|
527
|
+
}), ((dt = b == null ? void 0 : b.response) == null ? void 0 : dt.status) === 404 || // Basket not found
|
|
528
|
+
((zt = b == null ? void 0 : b.response) == null ? void 0 : zt.status) === 401 ? (((At = b == null ? void 0 : b.response) == null ? void 0 : At.status) === 404 && nt(null), ((tt = b == null ? void 0 : b.response) == null ? void 0 : tt.status) === 401 && (nt(null), Yt(null))) : (console.error("Failed to add product to basket:", b.message), B.error("Failed to add product to cart", {
|
|
529
529
|
position: "bottom-right",
|
|
530
530
|
autoClose: 3e3
|
|
531
531
|
}));
|
|
@@ -552,12 +552,12 @@ const nt = (t) => {
|
|
|
552
552
|
${o ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
|
|
553
553
|
`,
|
|
554
554
|
style: { willChange: "transform, opacity" },
|
|
555
|
-
onClick: (
|
|
555
|
+
onClick: (I) => I.stopPropagation(),
|
|
556
556
|
children: [
|
|
557
557
|
/* @__PURE__ */ u("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
558
558
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: e.name }) }),
|
|
559
559
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
560
|
-
|
|
560
|
+
be,
|
|
561
561
|
{
|
|
562
562
|
icon: "mdi:close",
|
|
563
563
|
className: "text-[#555555] w-6 h-6 cursor-pointer",
|
|
@@ -574,20 +574,20 @@ const nt = (t) => {
|
|
|
574
574
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
|
|
575
575
|
"img",
|
|
576
576
|
{
|
|
577
|
-
src: (
|
|
577
|
+
src: (v = (y = (i = (d = e.imageGroups) == null ? void 0 : d[0]) == null ? void 0 : i.images) == null ? void 0 : y[0]) == null ? void 0 : v.link,
|
|
578
578
|
alt: e.name,
|
|
579
579
|
className: "rounded-[10px]"
|
|
580
580
|
}
|
|
581
581
|
) }),
|
|
582
582
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: e.imageGroups.slice(1, 2).map(
|
|
583
|
-
(
|
|
583
|
+
(I) => I.images.slice(1, 2).map((z) => /* @__PURE__ */ a(
|
|
584
584
|
"img",
|
|
585
585
|
{
|
|
586
|
-
src:
|
|
586
|
+
src: z.link,
|
|
587
587
|
alt: e.name,
|
|
588
588
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
589
589
|
},
|
|
590
|
-
|
|
590
|
+
z.link
|
|
591
591
|
))
|
|
592
592
|
) })
|
|
593
593
|
] }),
|
|
@@ -623,30 +623,30 @@ const nt = (t) => {
|
|
|
623
623
|
/* @__PURE__ */ u("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
624
624
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
|
|
625
625
|
/* @__PURE__ */ u("div", { className: "text-[#323135] font-bold", children: [
|
|
626
|
-
((
|
|
626
|
+
((C = e == null ? void 0 : e.rating) == null ? void 0 : C.rate) || 0,
|
|
627
627
|
" /",
|
|
628
628
|
" ",
|
|
629
629
|
/* @__PURE__ */ a("span", { className: "text-[#68656E]", children: "5" })
|
|
630
630
|
] }),
|
|
631
631
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
632
632
|
/* @__PURE__ */ u("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
633
|
-
((
|
|
633
|
+
((S = e == null ? void 0 : e.rating) == null ? void 0 : S.count) || 0,
|
|
634
634
|
" ratings"
|
|
635
635
|
] })
|
|
636
636
|
] }) }),
|
|
637
|
-
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((
|
|
638
|
-
var
|
|
637
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((I, z) => {
|
|
638
|
+
var Q;
|
|
639
639
|
return /* @__PURE__ */ a(
|
|
640
|
-
|
|
640
|
+
be,
|
|
641
641
|
{
|
|
642
642
|
icon: "mdi:star",
|
|
643
643
|
width: "20",
|
|
644
644
|
height: "20",
|
|
645
645
|
className: `text-yellow-500
|
|
646
|
-
${((
|
|
646
|
+
${((Q = e == null ? void 0 : e.rating) == null ? void 0 : Q.rate) > z ? "text-yellow-500" : "text-gray-300"}
|
|
647
647
|
`
|
|
648
648
|
},
|
|
649
|
-
|
|
649
|
+
z
|
|
650
650
|
);
|
|
651
651
|
}) })
|
|
652
652
|
] }),
|
|
@@ -681,49 +681,72 @@ const nt = (t) => {
|
|
|
681
681
|
}
|
|
682
682
|
)
|
|
683
683
|
] });
|
|
684
|
-
},
|
|
684
|
+
}, Or = ({
|
|
685
685
|
tanyaConfig: t,
|
|
686
|
-
basketId: e
|
|
686
|
+
basketId: e,
|
|
687
|
+
addToCart: r
|
|
687
688
|
}) => {
|
|
688
|
-
const
|
|
689
|
+
const o = [
|
|
689
690
|
"Myself",
|
|
690
691
|
"My Child",
|
|
691
692
|
"My Grandchild",
|
|
692
693
|
"Niece/Nephew",
|
|
693
694
|
"My Friends",
|
|
694
695
|
"Others"
|
|
695
|
-
],
|
|
696
|
+
], n = {
|
|
696
697
|
Myself: "himself/herself",
|
|
697
698
|
"My Child": "his/her child",
|
|
698
699
|
"My Grandchild": "his/her grandchild",
|
|
699
700
|
"Niece/Nephew": "his/her niece/nephew",
|
|
700
701
|
"My Friends": "his/her friends",
|
|
701
702
|
Others: "others"
|
|
702
|
-
},
|
|
703
|
+
}, c = Ft(null), l = Ft(null), d = Ft(null), i = Ft(null), [y, v] = P(null), [C, S] = P(!1), [I, z] = P(!1), [Q, St] = P(!1), [lt, U] = P(!1), [ct, _t] = P(!1), [$t, Z] = P(!1), [Ct, It] = P(""), [dt, zt] = P(""), At = (s) => ({
|
|
703
704
|
id: s.id,
|
|
704
705
|
title: s.name,
|
|
705
706
|
image: s.image ?? "",
|
|
706
707
|
price: s.price ?? 0
|
|
707
|
-
}), [
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
708
|
+
}), [tt, b] = P([]), et = Ft(null), k = Ht((s) => s.store.store), Jt = Ht((s) => s.product.product);
|
|
709
|
+
L(() => {
|
|
710
|
+
const s = localStorage.getItem(
|
|
711
|
+
`access_token_${t.siteId}`
|
|
712
|
+
), g = localStorage.getItem(
|
|
713
|
+
`chat-token-${t.siteId}`
|
|
714
|
+
);
|
|
715
|
+
if (s && g === s) {
|
|
716
|
+
const m = localStorage.getItem("chatHistory");
|
|
717
|
+
m && b(JSON.parse(m));
|
|
718
|
+
} else
|
|
719
|
+
localStorage.setItem("chatHistory", JSON.stringify([])), localStorage.setItem(
|
|
720
|
+
`chat-token-${t.siteId}`,
|
|
721
|
+
s || ""
|
|
722
|
+
);
|
|
723
|
+
}, []), L(() => {
|
|
724
|
+
localStorage.setItem("chatHistory", JSON.stringify(tt));
|
|
725
|
+
const s = localStorage.getItem(
|
|
726
|
+
`access_token_${t.siteId}`
|
|
727
|
+
);
|
|
728
|
+
s && localStorage.setItem(`chat-token-${t.siteId}`, s);
|
|
729
|
+
}, [tt]);
|
|
730
|
+
const jt = () => {
|
|
731
|
+
St(!0), setTimeout(() => z(!0), 10);
|
|
732
|
+
}, Dt = () => {
|
|
733
|
+
z(!1), setTimeout(() => St(!1), 300);
|
|
711
734
|
};
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
}, [
|
|
715
|
-
const
|
|
716
|
-
|
|
735
|
+
L(() => {
|
|
736
|
+
C ? jt() : Dt();
|
|
737
|
+
}, [C]);
|
|
738
|
+
const q = (s) => {
|
|
739
|
+
zt(n[s]);
|
|
717
740
|
};
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}, [
|
|
721
|
-
let
|
|
722
|
-
const
|
|
723
|
-
if (
|
|
724
|
-
return
|
|
741
|
+
L(() => {
|
|
742
|
+
et.current && (et.current.scrollTop += 150);
|
|
743
|
+
}, [tt]);
|
|
744
|
+
let rt = null, ut = null;
|
|
745
|
+
const p = async () => {
|
|
746
|
+
if (rt && ut && Date.now() < ut)
|
|
747
|
+
return rt;
|
|
725
748
|
try {
|
|
726
|
-
const s = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token",
|
|
749
|
+
const s = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", g = new URLSearchParams({
|
|
727
750
|
grant_type: "client_credentials",
|
|
728
751
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
729
752
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
@@ -733,118 +756,118 @@ const nt = (t) => {
|
|
|
733
756
|
headers: {
|
|
734
757
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
735
758
|
},
|
|
736
|
-
body:
|
|
759
|
+
body: g
|
|
737
760
|
});
|
|
738
761
|
if (!m.ok)
|
|
739
762
|
throw new Error(
|
|
740
763
|
`Token request failed! status: ${m.status}`
|
|
741
764
|
);
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
const
|
|
745
|
-
return ut = Date.now() + (
|
|
765
|
+
const x = await m.json();
|
|
766
|
+
rt = x.access_token;
|
|
767
|
+
const f = x.expires_in || 3600;
|
|
768
|
+
return ut = Date.now() + (f - 60) * 1e3, rt;
|
|
746
769
|
} catch (s) {
|
|
747
|
-
return console.error("Error obtaining JWT token:", s),
|
|
770
|
+
return console.error("Error obtaining JWT token:", s), rt = null, ut = null, null;
|
|
748
771
|
}
|
|
749
|
-
},
|
|
772
|
+
}, Y = async () => {
|
|
750
773
|
const s = await Pt();
|
|
751
|
-
s != null &&
|
|
774
|
+
s != null && v(s);
|
|
752
775
|
};
|
|
753
|
-
|
|
776
|
+
L(() => {
|
|
754
777
|
if (t != null && t.siteId) {
|
|
755
|
-
const { clientID: s, host:
|
|
756
|
-
sessionStorage.setItem("Host",
|
|
778
|
+
const { clientID: s, host: g, organizationID: m, shortCode: x, siteId: f } = t;
|
|
779
|
+
sessionStorage.setItem("Host", g), sessionStorage.setItem("SiteId", f), sessionStorage.setItem("pubCfg", btoa(s)), sessionStorage.setItem("envRef", x), sessionStorage.setItem("orgRef", m);
|
|
757
780
|
}
|
|
758
|
-
|
|
759
|
-
}, []),
|
|
781
|
+
Y(), console.log("scapi environment v1");
|
|
782
|
+
}, []), L(() => {
|
|
760
783
|
e && (console.log("setting the basket id", e), nt(e));
|
|
761
|
-
}, [e]),
|
|
784
|
+
}, [e]), L(() => {
|
|
762
785
|
const s = async () => {
|
|
763
786
|
S(!1);
|
|
764
787
|
};
|
|
765
788
|
return window.addEventListener("reactCartUpdated", s), () => window.removeEventListener("reactCartUpdated", s);
|
|
766
789
|
}, []);
|
|
767
|
-
const
|
|
790
|
+
const pt = async () => {
|
|
768
791
|
const s = JSON.parse(
|
|
769
792
|
sessionStorage.getItem("customerData") || "{}"
|
|
770
793
|
).customerId;
|
|
771
|
-
return (await
|
|
772
|
-
},
|
|
773
|
-
console.log("in secondary flow",
|
|
774
|
-
const m = await
|
|
775
|
-
if (console.log(m, "interests of customer",
|
|
794
|
+
return (await Sr(s || "")).c_interests;
|
|
795
|
+
}, K = async (s, g) => {
|
|
796
|
+
console.log("in secondary flow", Nt);
|
|
797
|
+
const m = await pt();
|
|
798
|
+
if (console.log(m, "interests of customer", Nt), !!m)
|
|
776
799
|
try {
|
|
777
|
-
|
|
778
|
-
(
|
|
779
|
-
(
|
|
800
|
+
b(
|
|
801
|
+
(D) => D.map(
|
|
802
|
+
(M, H) => H === D.length - 1 ? { ...M, secondaryLoading: !0 } : M
|
|
780
803
|
)
|
|
781
804
|
);
|
|
782
|
-
const
|
|
783
|
-
if (!
|
|
784
|
-
const
|
|
805
|
+
const x = await p();
|
|
806
|
+
if (!x) throw new Error("Failed to fetch token");
|
|
807
|
+
const f = localStorage.getItem("customerNumber"), w = localStorage.getItem("isLoggedIn"), ft = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
785
808
|
registered: String(w || !1),
|
|
786
|
-
userId: String(
|
|
809
|
+
userId: String(f || (/* @__PURE__ */ new Date()).getTime())
|
|
787
810
|
}).toString()}`, ht = JSON.stringify({
|
|
788
811
|
flowId: "Q166PR519W",
|
|
789
812
|
flowAliasId: "HKFUVLWVH2",
|
|
790
813
|
input: {
|
|
791
814
|
loyaltyPoints: "",
|
|
792
815
|
productName: s,
|
|
793
|
-
productPoints: String(
|
|
816
|
+
productPoints: String(g || 0),
|
|
794
817
|
interests: m
|
|
795
818
|
}
|
|
796
|
-
}),
|
|
819
|
+
}), A = await fetch(ft, {
|
|
797
820
|
signal: AbortSignal.timeout(3e4),
|
|
798
821
|
method: "POST",
|
|
799
822
|
headers: {
|
|
800
823
|
"Content-Type": "application/json",
|
|
801
|
-
Authorization: `Bearer ${
|
|
824
|
+
Authorization: `Bearer ${x}`
|
|
802
825
|
},
|
|
803
826
|
body: ht
|
|
804
827
|
});
|
|
805
|
-
if (!
|
|
806
|
-
const mt =
|
|
807
|
-
let
|
|
828
|
+
if (!A.body) throw new Error("Readable stream not supported");
|
|
829
|
+
const mt = A.body.getReader(), wt = new TextDecoder();
|
|
830
|
+
let j = "";
|
|
808
831
|
for (; ; ) {
|
|
809
|
-
const { done:
|
|
810
|
-
if (
|
|
811
|
-
|
|
812
|
-
const
|
|
832
|
+
const { done: D, value: M } = await mt.read();
|
|
833
|
+
if (D) break;
|
|
834
|
+
j += wt.decode(M, { stream: !0 });
|
|
835
|
+
const H = j.split(`
|
|
813
836
|
`);
|
|
814
|
-
|
|
815
|
-
for (const
|
|
816
|
-
if (
|
|
817
|
-
const
|
|
837
|
+
j = H.pop() || "";
|
|
838
|
+
for (const J of H)
|
|
839
|
+
if (J.startsWith("data:")) {
|
|
840
|
+
const h = J.slice(5).trim();
|
|
818
841
|
try {
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
(
|
|
822
|
-
(
|
|
823
|
-
...
|
|
824
|
-
secondaryResponse:
|
|
842
|
+
const R = JSON.parse(h);
|
|
843
|
+
R.index === 0 && b(
|
|
844
|
+
(F) => F.map(
|
|
845
|
+
(O, W) => W === F.length - 1 ? {
|
|
846
|
+
...O,
|
|
847
|
+
secondaryResponse: R.data,
|
|
825
848
|
secondaryLoading: !1
|
|
826
|
-
} :
|
|
849
|
+
} : O
|
|
827
850
|
)
|
|
828
851
|
);
|
|
829
|
-
} catch (
|
|
830
|
-
|
|
831
|
-
(
|
|
832
|
-
(
|
|
852
|
+
} catch (R) {
|
|
853
|
+
b(
|
|
854
|
+
(F) => F.map(
|
|
855
|
+
(O, W) => W === F.length - 1 ? { ...O, secondaryLoading: !1 } : O
|
|
833
856
|
)
|
|
834
|
-
), console.error("Secondary flow JSON parse error:",
|
|
857
|
+
), console.error("Secondary flow JSON parse error:", R);
|
|
835
858
|
}
|
|
836
859
|
}
|
|
837
860
|
}
|
|
838
|
-
} catch (
|
|
839
|
-
console.error("Secondary flow error:",
|
|
861
|
+
} catch (x) {
|
|
862
|
+
console.error("Secondary flow error:", x);
|
|
840
863
|
}
|
|
841
|
-
},
|
|
842
|
-
const
|
|
843
|
-
if (
|
|
844
|
-
|
|
864
|
+
}, Wt = async (s) => {
|
|
865
|
+
const g = s || Ct.trim();
|
|
866
|
+
if (g) {
|
|
867
|
+
_t(!0), It(""), c.current = null, l.current = null, d.current = null, i.current = null, b((m) => [
|
|
845
868
|
...m,
|
|
846
869
|
{
|
|
847
|
-
query:
|
|
870
|
+
query: g,
|
|
848
871
|
response: "Thinking for what suits you best...",
|
|
849
872
|
potentialQuestions: "",
|
|
850
873
|
products: [],
|
|
@@ -852,20 +875,20 @@ const nt = (t) => {
|
|
|
852
875
|
}
|
|
853
876
|
]);
|
|
854
877
|
try {
|
|
855
|
-
const m = dt,
|
|
878
|
+
const m = dt, x = localStorage.getItem("customerNumber"), f = localStorage.getItem("isLoggedIn"), w = await p();
|
|
856
879
|
if (!w)
|
|
857
880
|
throw new Error("Failed to obtain access token");
|
|
858
881
|
const ft = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
859
|
-
registered: String(
|
|
860
|
-
userId: String(
|
|
882
|
+
registered: String(f || !1),
|
|
883
|
+
userId: String(x || (/* @__PURE__ */ new Date()).getTime())
|
|
861
884
|
}).toString()}`, ht = JSON.stringify({
|
|
862
885
|
flowId: "MMHQKYI1NE",
|
|
863
886
|
flowAliasId: "SZF9ZK1ATE",
|
|
864
887
|
input: {
|
|
865
|
-
userPrompt:
|
|
888
|
+
userPrompt: g,
|
|
866
889
|
whom: m
|
|
867
890
|
}
|
|
868
|
-
}),
|
|
891
|
+
}), A = await fetch(ft, {
|
|
869
892
|
signal: AbortSignal.timeout(3e4),
|
|
870
893
|
method: "POST",
|
|
871
894
|
headers: {
|
|
@@ -874,212 +897,211 @@ const nt = (t) => {
|
|
|
874
897
|
},
|
|
875
898
|
body: ht
|
|
876
899
|
});
|
|
877
|
-
if (!
|
|
878
|
-
throw new Error(`HTTP error! status: ${
|
|
879
|
-
if (!
|
|
880
|
-
const mt =
|
|
881
|
-
let
|
|
900
|
+
if (!A.ok)
|
|
901
|
+
throw new Error(`HTTP error! status: ${A.status}`);
|
|
902
|
+
if (!A.body) throw new Error("Readable stream not supported");
|
|
903
|
+
const mt = A.body.getReader(), wt = new TextDecoder();
|
|
904
|
+
let j = "", D = "";
|
|
882
905
|
for (; ; ) {
|
|
883
|
-
|
|
884
|
-
const { done:
|
|
885
|
-
if (
|
|
886
|
-
|
|
887
|
-
const
|
|
906
|
+
Z(!0);
|
|
907
|
+
const { done: M, value: H } = await mt.read();
|
|
908
|
+
if (M) break;
|
|
909
|
+
j += wt.decode(H, { stream: !0 });
|
|
910
|
+
const J = j.split(`
|
|
888
911
|
`);
|
|
889
|
-
|
|
890
|
-
for (const
|
|
891
|
-
if (
|
|
892
|
-
const
|
|
912
|
+
j = J.pop() || "";
|
|
913
|
+
for (const h of J)
|
|
914
|
+
if (h.startsWith("data:")) {
|
|
915
|
+
const R = h.slice(5).trim();
|
|
893
916
|
try {
|
|
894
|
-
const
|
|
895
|
-
|
|
896
|
-
(
|
|
897
|
-
(
|
|
898
|
-
...
|
|
899
|
-
[
|
|
900
|
-
} :
|
|
917
|
+
const F = JSON.parse(R);
|
|
918
|
+
F.index == 1 && (D = F.data), b(
|
|
919
|
+
(O) => O.map(
|
|
920
|
+
(W, Lt) => Lt === O.length - 1 ? {
|
|
921
|
+
...W,
|
|
922
|
+
[F.index == 0 ? "response" : F.index == 1 ? "keywords" : F.index == 2 ? "potentialQuestions" : "end"]: F.data
|
|
923
|
+
} : W
|
|
901
924
|
)
|
|
902
925
|
);
|
|
903
|
-
} catch (
|
|
904
|
-
console.error("Error parsing JSON:",
|
|
926
|
+
} catch (F) {
|
|
927
|
+
console.error("Error parsing JSON:", F);
|
|
905
928
|
}
|
|
906
929
|
}
|
|
907
930
|
}
|
|
908
|
-
rr(
|
|
931
|
+
or(rr(D));
|
|
909
932
|
} catch (m) {
|
|
910
933
|
console.error("Error sending message to Tanya:", m);
|
|
911
934
|
} finally {
|
|
912
|
-
|
|
935
|
+
_t(!1);
|
|
913
936
|
}
|
|
914
937
|
}
|
|
915
|
-
},
|
|
916
|
-
const
|
|
938
|
+
}, rr = (s) => {
|
|
939
|
+
const g = s.match(
|
|
917
940
|
/top five relevant product or category names are: (.*)/i
|
|
918
|
-
),
|
|
919
|
-
return [...new Set(
|
|
920
|
-
},
|
|
941
|
+
), f = (g ? g[1] : s).split(", ").map(($) => $.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
942
|
+
return [...new Set(f)].filter(Boolean).join(",");
|
|
943
|
+
}, or = async (s) => {
|
|
921
944
|
if (typeof s == "string") {
|
|
922
945
|
console.log(s, "keywords");
|
|
923
|
-
const
|
|
924
|
-
for (const m of
|
|
925
|
-
const
|
|
926
|
-
if (
|
|
927
|
-
(
|
|
928
|
-
(w,
|
|
946
|
+
const g = s.split(",");
|
|
947
|
+
for (const m of g) {
|
|
948
|
+
const x = await xe(m);
|
|
949
|
+
if (Z(!1), (x == null ? void 0 : x.length) > 0 && (b(
|
|
950
|
+
(f) => f.map(
|
|
951
|
+
(w, $) => $ === f.length - 1 ? {
|
|
929
952
|
...w,
|
|
930
953
|
products: [
|
|
931
954
|
...w.products || [],
|
|
932
|
-
{ keyword: m, items:
|
|
955
|
+
{ keyword: m, items: x, loading: !1 }
|
|
933
956
|
]
|
|
934
957
|
} : w
|
|
935
958
|
)
|
|
936
|
-
), !
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
const w = typeof (
|
|
940
|
-
|
|
959
|
+
), !c.current || l.current == null)) {
|
|
960
|
+
const f = x[0];
|
|
961
|
+
c.current = String((f == null ? void 0 : f.product_name) ?? ""), d.current = f.image.link, l.current = f.product_id;
|
|
962
|
+
const w = typeof (f == null ? void 0 : f.price) == "number" ? f.price : void 0;
|
|
963
|
+
i.current = typeof w == "number" && Number.isFinite(w) ? w : null;
|
|
941
964
|
}
|
|
942
965
|
}
|
|
943
966
|
} else
|
|
944
|
-
for (const
|
|
945
|
-
const m = await
|
|
946
|
-
|
|
947
|
-
(
|
|
948
|
-
(
|
|
949
|
-
...
|
|
967
|
+
for (const g of s) {
|
|
968
|
+
const m = await xe(g);
|
|
969
|
+
Z(!1), (m == null ? void 0 : m.length) > 0 && b(
|
|
970
|
+
(x) => x.map(
|
|
971
|
+
(f, w) => w === x.length - 1 ? {
|
|
972
|
+
...f,
|
|
950
973
|
products: [
|
|
951
|
-
...
|
|
952
|
-
{ keyword:
|
|
974
|
+
...f.products || [],
|
|
975
|
+
{ keyword: g, items: m, loading: !1 }
|
|
953
976
|
]
|
|
954
|
-
} :
|
|
977
|
+
} : f
|
|
955
978
|
)
|
|
956
979
|
);
|
|
957
980
|
}
|
|
958
|
-
if (
|
|
959
|
-
|
|
981
|
+
if (c.current) {
|
|
982
|
+
b(
|
|
960
983
|
(m) => m.map(
|
|
961
|
-
(
|
|
962
|
-
...
|
|
984
|
+
(x, f) => f === m.length - 1 ? {
|
|
985
|
+
...x,
|
|
963
986
|
productSnapshot: {
|
|
964
|
-
id:
|
|
965
|
-
name:
|
|
966
|
-
image:
|
|
967
|
-
price:
|
|
987
|
+
id: l.current,
|
|
988
|
+
name: c.current,
|
|
989
|
+
image: d.current,
|
|
990
|
+
price: i.current ?? null,
|
|
968
991
|
points: 0,
|
|
969
992
|
quantity: 1
|
|
970
993
|
}
|
|
971
|
-
} :
|
|
994
|
+
} : x
|
|
972
995
|
)
|
|
973
996
|
);
|
|
974
|
-
const
|
|
997
|
+
const g = JSON.parse(
|
|
975
998
|
sessionStorage.getItem("customerData") || "{}"
|
|
976
999
|
);
|
|
977
|
-
(
|
|
1000
|
+
(g == null ? void 0 : g.isGuest) == !1 ? (console.log("running secondary flow", Nt), K(c.current, 0)) : console.log("not running secondary flow", Nt);
|
|
978
1001
|
}
|
|
979
|
-
|
|
980
|
-
},
|
|
981
|
-
var m,
|
|
982
|
-
|
|
1002
|
+
Z(!1);
|
|
1003
|
+
}, nr = async (s, g) => {
|
|
1004
|
+
var m, x, f, w, $, ft, ht, A, mt, wt, j, D, M, H, J;
|
|
1005
|
+
U(!0);
|
|
983
1006
|
try {
|
|
984
|
-
const
|
|
985
|
-
if (!((
|
|
986
|
-
|
|
1007
|
+
const h = await Re(s.id);
|
|
1008
|
+
if (!((x = (m = h == null ? void 0 : h.variants) == null ? void 0 : m[0]) != null && x.product_id || (w = (f = h == null ? void 0 : h.variants) == null ? void 0 : f[0]) != null && w.productId) && !(h.type.item || h.type.bundle)) {
|
|
1009
|
+
U(!1), B.error("Variants not found", {
|
|
987
1010
|
position: "bottom-right",
|
|
988
1011
|
autoClose: 1e3
|
|
989
1012
|
}), console.error("No product variant found");
|
|
990
1013
|
return;
|
|
991
1014
|
}
|
|
992
|
-
const
|
|
1015
|
+
const R = [
|
|
993
1016
|
{
|
|
994
|
-
product_id: ((
|
|
995
|
-
quantity:
|
|
1017
|
+
product_id: (($ = h.variants) == null ? void 0 : $[0].product_id) || ((ft = h.variants) == null ? void 0 : ft[0].productId) || (h == null ? void 0 : h.id),
|
|
1018
|
+
quantity: g
|
|
996
1019
|
}
|
|
997
1020
|
];
|
|
998
|
-
console.log(
|
|
999
|
-
const
|
|
1021
|
+
console.log(R, "product data", "app version", Nt);
|
|
1022
|
+
const F = JSON.parse(
|
|
1000
1023
|
sessionStorage.getItem("customerData") || "{}"
|
|
1001
|
-
),
|
|
1002
|
-
if (!
|
|
1003
|
-
const
|
|
1004
|
-
let { customer_token:
|
|
1005
|
-
|
|
1024
|
+
), O = (F == null ? void 0 : F.basketId) || localStorage.getItem(Vt), W = !1, Lt = localStorage.getItem(Ot), we = Date.now();
|
|
1025
|
+
if (!W || !Lt || we >= parseInt(Lt)) {
|
|
1026
|
+
const ar = await Me();
|
|
1027
|
+
let { customer_token: gt } = await He(
|
|
1028
|
+
ar
|
|
1006
1029
|
);
|
|
1007
|
-
if (
|
|
1030
|
+
if (gt = "Bearer " + y.access_token, !gt) {
|
|
1008
1031
|
console.error("Failed to get customer_token");
|
|
1009
1032
|
return;
|
|
1010
1033
|
}
|
|
1011
|
-
const
|
|
1012
|
-
if (
|
|
1013
|
-
const
|
|
1014
|
-
basketId:
|
|
1015
|
-
customer_token:
|
|
1034
|
+
const ir = we + 300 * 1e3;
|
|
1035
|
+
if (Yt(gt), localStorage.setItem(Ot, ir.toString()), console.log(O, "basketIdFromCustomer"), O) {
|
|
1036
|
+
const ge = await Ye({
|
|
1037
|
+
basketId: O,
|
|
1038
|
+
customer_token: gt
|
|
1016
1039
|
});
|
|
1017
|
-
if (
|
|
1018
|
-
const Gt = await
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1040
|
+
if (ge.status === 200 && ge) {
|
|
1041
|
+
const Gt = await ne(
|
|
1042
|
+
O,
|
|
1043
|
+
R,
|
|
1044
|
+
gt
|
|
1022
1045
|
);
|
|
1023
|
-
((ht = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : ht.length) > 0 && (
|
|
1046
|
+
((ht = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : ht.length) > 0 && (B.success("Added to cart", {
|
|
1024
1047
|
position: "bottom-right",
|
|
1025
1048
|
autoClose: 3e3,
|
|
1026
1049
|
hideProgressBar: !1,
|
|
1027
1050
|
closeOnClick: !0,
|
|
1028
1051
|
pauseOnHover: !0,
|
|
1029
1052
|
draggable: !0
|
|
1030
|
-
}),
|
|
1053
|
+
}), Rt(O), U(!1));
|
|
1031
1054
|
return;
|
|
1032
1055
|
}
|
|
1033
1056
|
}
|
|
1034
|
-
const
|
|
1057
|
+
const sr = {
|
|
1035
1058
|
productItems: [
|
|
1036
1059
|
{
|
|
1037
|
-
productId: ((
|
|
1060
|
+
productId: ((A = h.variants) == null ? void 0 : A[0].product_id) || ((mt = h.variants) == null ? void 0 : mt[0].productId) || (h == null ? void 0 : h.id),
|
|
1038
1061
|
quantity: 1
|
|
1039
1062
|
}
|
|
1040
1063
|
]
|
|
1041
|
-
},
|
|
1064
|
+
}, _ = await Ve(gt, sr);
|
|
1042
1065
|
if (console.log(
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1066
|
+
_,
|
|
1067
|
+
_ == null ? void 0 : _.basket_id,
|
|
1068
|
+
_ == null ? void 0 : _.basketId,
|
|
1046
1069
|
"the basket response"
|
|
1047
|
-
), !(
|
|
1048
|
-
|
|
1070
|
+
), !(_ != null && _.basket_id || !(_ != null && _.basketId))) {
|
|
1071
|
+
U(!1), console.error("Failed to create basket");
|
|
1049
1072
|
return;
|
|
1050
1073
|
}
|
|
1051
1074
|
nt(
|
|
1052
|
-
(
|
|
1075
|
+
(_ == null ? void 0 : _.basket_id) || (_ == null ? void 0 : _.basketId)
|
|
1053
1076
|
);
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
)
|
|
1059
|
-
(((wt = gt == null ? void 0 : gt.product_items) == null ? void 0 : wt.length) > 0 || ((B = gt == null ? void 0 : gt.productItems) == null ? void 0 : B.length) > 0) && M.success("Added to cart", {
|
|
1077
|
+
const bt = await r({
|
|
1078
|
+
productId: l,
|
|
1079
|
+
quantity: g
|
|
1080
|
+
});
|
|
1081
|
+
(((wt = bt == null ? void 0 : bt.product_items) == null ? void 0 : wt.length) > 0 || ((j = bt == null ? void 0 : bt.productItems) == null ? void 0 : j.length) > 0) && B.success("Added to cart", {
|
|
1060
1082
|
position: "bottom-right",
|
|
1061
1083
|
autoClose: 3e3,
|
|
1062
1084
|
hideProgressBar: !1,
|
|
1063
1085
|
closeOnClick: !0,
|
|
1064
1086
|
pauseOnHover: !0,
|
|
1065
1087
|
draggable: !0
|
|
1066
|
-
}),
|
|
1088
|
+
}), Rt(_.basket_id || (_ == null ? void 0 : _.basketId));
|
|
1067
1089
|
}
|
|
1068
|
-
} catch (
|
|
1069
|
-
|
|
1090
|
+
} catch (h) {
|
|
1091
|
+
U(!1), console.error("Error adding to cart:", h), B.error("Failed to add product to cart", {
|
|
1070
1092
|
position: "bottom-right",
|
|
1071
1093
|
autoClose: 3e3
|
|
1072
|
-
}), ((
|
|
1073
|
-
((
|
|
1094
|
+
}), ((D = h == null ? void 0 : h.response) == null ? void 0 : D.status) === 404 || // Basket not found
|
|
1095
|
+
((M = h == null ? void 0 : h.response) == null ? void 0 : M.status) === 401 ? (((H = h == null ? void 0 : h.response) == null ? void 0 : H.status) === 404 && nt(null), ((J = h == null ? void 0 : h.response) == null ? void 0 : J.status) === 401 && (nt(null), Yt(null))) : (console.error("Failed to add product to basket:", h.message), B.error("Failed to add product to cart", {
|
|
1074
1096
|
position: "bottom-right",
|
|
1075
1097
|
autoClose: 3e3
|
|
1076
1098
|
}));
|
|
1077
1099
|
}
|
|
1078
|
-
|
|
1100
|
+
U(!1);
|
|
1079
1101
|
};
|
|
1080
|
-
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(
|
|
1102
|
+
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(vr, { open: C, onOpenChange: S, children: [
|
|
1081
1103
|
/* @__PURE__ */ a(
|
|
1082
|
-
|
|
1104
|
+
kr,
|
|
1083
1105
|
{
|
|
1084
1106
|
onClick: () => S(!0),
|
|
1085
1107
|
style: {
|
|
@@ -1141,7 +1163,7 @@ const nt = (t) => {
|
|
|
1141
1163
|
) })
|
|
1142
1164
|
}
|
|
1143
1165
|
),
|
|
1144
|
-
|
|
1166
|
+
Q && /* @__PURE__ */ u(re, { children: [
|
|
1145
1167
|
/* @__PURE__ */ a(
|
|
1146
1168
|
"div",
|
|
1147
1169
|
{
|
|
@@ -1157,9 +1179,9 @@ const nt = (t) => {
|
|
|
1157
1179
|
top-0 right-0
|
|
1158
1180
|
transition-transform duration-300 ease-in-out
|
|
1159
1181
|
lg:transform
|
|
1160
|
-
${
|
|
1182
|
+
${I ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
1161
1183
|
// For mobile: animate from bottom
|
|
1162
|
-
${
|
|
1184
|
+
${I ? "translate-y-0" : "translate-y-full"}
|
|
1163
1185
|
lg:translate-y-0
|
|
1164
1186
|
`,
|
|
1165
1187
|
style: {
|
|
@@ -1289,12 +1311,12 @@ const nt = (t) => {
|
|
|
1289
1311
|
/* @__PURE__ */ u(
|
|
1290
1312
|
"div",
|
|
1291
1313
|
{
|
|
1292
|
-
className: `flex flex-col h-full ${
|
|
1314
|
+
className: `flex flex-col h-full ${Jt ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1293
1315
|
children: [
|
|
1294
1316
|
/* @__PURE__ */ u(
|
|
1295
1317
|
"div",
|
|
1296
1318
|
{
|
|
1297
|
-
ref:
|
|
1319
|
+
ref: et,
|
|
1298
1320
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
1299
1321
|
children: [
|
|
1300
1322
|
(k == null ? void 0 : k.whomRequired) && /* @__PURE__ */ u(
|
|
@@ -1303,14 +1325,14 @@ const nt = (t) => {
|
|
|
1303
1325
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
1304
1326
|
children: [
|
|
1305
1327
|
/* @__PURE__ */ a("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ a("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
|
|
1306
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children:
|
|
1328
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: o.map((s) => /* @__PURE__ */ a(
|
|
1307
1329
|
"button",
|
|
1308
1330
|
{
|
|
1309
|
-
onClick: () =>
|
|
1331
|
+
onClick: () => q(s),
|
|
1310
1332
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1311
1333
|
style: {
|
|
1312
|
-
backgroundColor: dt ===
|
|
1313
|
-
borderColor: dt ===
|
|
1334
|
+
backgroundColor: dt === n[s] ? "#FFFFFF" : "#F3F3F3",
|
|
1335
|
+
borderColor: dt === n[s] ? "#BBB3DD" : ""
|
|
1314
1336
|
},
|
|
1315
1337
|
children: s
|
|
1316
1338
|
},
|
|
@@ -1319,8 +1341,8 @@ const nt = (t) => {
|
|
|
1319
1341
|
]
|
|
1320
1342
|
}
|
|
1321
1343
|
),
|
|
1322
|
-
|
|
1323
|
-
var m,
|
|
1344
|
+
tt.map((s, g) => {
|
|
1345
|
+
var m, x;
|
|
1324
1346
|
return /* @__PURE__ */ u("div", { children: [
|
|
1325
1347
|
/* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: s.query }) }),
|
|
1326
1348
|
s.response && s.response.includes("Thinking") ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
@@ -1340,9 +1362,9 @@ const nt = (t) => {
|
|
|
1340
1362
|
}
|
|
1341
1363
|
}
|
|
1342
1364
|
) }),
|
|
1343
|
-
|
|
1344
|
-
(s == null ? void 0 : s.products) && ((
|
|
1345
|
-
|
|
1365
|
+
$t && !s.response.includes("Thinking") && ((m = s.products) == null ? void 0 : m.length) == 0 && /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: "Finding best products for you" }) }),
|
|
1366
|
+
(s == null ? void 0 : s.products) && ((x = s == null ? void 0 : s.products) == null ? void 0 : x.length) > 0 && /* @__PURE__ */ a(
|
|
1367
|
+
Nr,
|
|
1346
1368
|
{
|
|
1347
1369
|
chat: s.products,
|
|
1348
1370
|
storeDetails: k
|
|
@@ -1357,15 +1379,15 @@ const nt = (t) => {
|
|
|
1357
1379
|
children: "Why not explore these inquiries..."
|
|
1358
1380
|
}
|
|
1359
1381
|
),
|
|
1360
|
-
s.potentialQuestions.split(",").map((
|
|
1382
|
+
s.potentialQuestions.split(",").map((f, w) => /* @__PURE__ */ a(
|
|
1361
1383
|
"button",
|
|
1362
1384
|
{
|
|
1363
1385
|
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${k.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
1364
|
-
onClick: () =>
|
|
1386
|
+
onClick: () => Wt(f),
|
|
1365
1387
|
style: {
|
|
1366
1388
|
backgroundColor: k.tanyaThemeColorLight
|
|
1367
1389
|
},
|
|
1368
|
-
children:
|
|
1390
|
+
children: f
|
|
1369
1391
|
},
|
|
1370
1392
|
w
|
|
1371
1393
|
))
|
|
@@ -1471,9 +1493,9 @@ const nt = (t) => {
|
|
|
1471
1493
|
"button",
|
|
1472
1494
|
{
|
|
1473
1495
|
className: "px-3 py-1 text-sm",
|
|
1474
|
-
onClick: () =>
|
|
1475
|
-
(
|
|
1476
|
-
(w,
|
|
1496
|
+
onClick: () => b(
|
|
1497
|
+
(f) => f.map(
|
|
1498
|
+
(w, $) => $ === g && w.productSnapshot ? {
|
|
1477
1499
|
...w,
|
|
1478
1500
|
productSnapshot: {
|
|
1479
1501
|
...w.productSnapshot,
|
|
@@ -1497,9 +1519,9 @@ const nt = (t) => {
|
|
|
1497
1519
|
"button",
|
|
1498
1520
|
{
|
|
1499
1521
|
className: "px-3 py-1 text-sm",
|
|
1500
|
-
onClick: () =>
|
|
1501
|
-
(
|
|
1502
|
-
(w,
|
|
1522
|
+
onClick: () => b(
|
|
1523
|
+
(f) => f.map(
|
|
1524
|
+
(w, $) => $ === g && w.productSnapshot ? {
|
|
1503
1525
|
...w,
|
|
1504
1526
|
productSnapshot: {
|
|
1505
1527
|
...w.productSnapshot,
|
|
@@ -1520,8 +1542,8 @@ const nt = (t) => {
|
|
|
1520
1542
|
"button",
|
|
1521
1543
|
{
|
|
1522
1544
|
onClick: () => {
|
|
1523
|
-
|
|
1524
|
-
|
|
1545
|
+
nr(
|
|
1546
|
+
At(
|
|
1525
1547
|
s.productSnapshot
|
|
1526
1548
|
),
|
|
1527
1549
|
s.productSnapshot.quantity
|
|
@@ -1544,7 +1566,7 @@ const nt = (t) => {
|
|
|
1544
1566
|
) })
|
|
1545
1567
|
] }) }),
|
|
1546
1568
|
/* @__PURE__ */ a("div", { className: "mb-20" })
|
|
1547
|
-
] },
|
|
1569
|
+
] }, g);
|
|
1548
1570
|
})
|
|
1549
1571
|
]
|
|
1550
1572
|
}
|
|
@@ -1562,11 +1584,11 @@ const nt = (t) => {
|
|
|
1562
1584
|
{
|
|
1563
1585
|
className: "flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",
|
|
1564
1586
|
placeholder: "How can I help you...",
|
|
1565
|
-
value:
|
|
1587
|
+
value: Ct,
|
|
1566
1588
|
autoFocus: !0,
|
|
1567
|
-
onChange: (s) =>
|
|
1589
|
+
onChange: (s) => It(s.target.value),
|
|
1568
1590
|
onKeyDown: (s) => {
|
|
1569
|
-
s.key === "Enter" && !ct &&
|
|
1591
|
+
s.key === "Enter" && !ct && Wt();
|
|
1570
1592
|
}
|
|
1571
1593
|
}
|
|
1572
1594
|
),
|
|
@@ -1576,7 +1598,7 @@ const nt = (t) => {
|
|
|
1576
1598
|
type: "submit",
|
|
1577
1599
|
disabled: ct,
|
|
1578
1600
|
className: "p-3",
|
|
1579
|
-
onClick: () =>
|
|
1601
|
+
onClick: () => Wt(),
|
|
1580
1602
|
children: ct ? /* @__PURE__ */ a(
|
|
1581
1603
|
"div",
|
|
1582
1604
|
{
|
|
@@ -1611,7 +1633,7 @@ const nt = (t) => {
|
|
|
1611
1633
|
]
|
|
1612
1634
|
}
|
|
1613
1635
|
),
|
|
1614
|
-
/* @__PURE__ */ a(
|
|
1636
|
+
/* @__PURE__ */ a(Tr, {})
|
|
1615
1637
|
] })
|
|
1616
1638
|
]
|
|
1617
1639
|
}
|
|
@@ -1619,32 +1641,32 @@ const nt = (t) => {
|
|
|
1619
1641
|
] })
|
|
1620
1642
|
] }) });
|
|
1621
1643
|
};
|
|
1622
|
-
var
|
|
1623
|
-
return
|
|
1644
|
+
var ae = function(t, e) {
|
|
1645
|
+
return ae = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, o) {
|
|
1624
1646
|
r.__proto__ = o;
|
|
1625
1647
|
} || function(r, o) {
|
|
1626
1648
|
for (var n in o) Object.prototype.hasOwnProperty.call(o, n) && (r[n] = o[n]);
|
|
1627
|
-
},
|
|
1649
|
+
}, ae(t, e);
|
|
1628
1650
|
};
|
|
1629
1651
|
function Pr(t, e) {
|
|
1630
1652
|
if (typeof e != "function" && e !== null)
|
|
1631
1653
|
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
1632
|
-
|
|
1654
|
+
ae(t, e);
|
|
1633
1655
|
function r() {
|
|
1634
1656
|
this.constructor = t;
|
|
1635
1657
|
}
|
|
1636
1658
|
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
1637
1659
|
}
|
|
1638
|
-
var
|
|
1639
|
-
return
|
|
1660
|
+
var G = function() {
|
|
1661
|
+
return G = Object.assign || function(e) {
|
|
1640
1662
|
for (var r, o = 1, n = arguments.length; o < n; o++) {
|
|
1641
1663
|
r = arguments[o];
|
|
1642
1664
|
for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (e[c] = r[c]);
|
|
1643
1665
|
}
|
|
1644
1666
|
return e;
|
|
1645
|
-
},
|
|
1667
|
+
}, G.apply(this, arguments);
|
|
1646
1668
|
};
|
|
1647
|
-
function
|
|
1669
|
+
function $r(t, e) {
|
|
1648
1670
|
var r = {};
|
|
1649
1671
|
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (r[o] = t[o]);
|
|
1650
1672
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -1652,28 +1674,28 @@ function Or(t, e) {
|
|
|
1652
1674
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1653
1675
|
return r;
|
|
1654
1676
|
}
|
|
1655
|
-
var Qt = "Invariant Violation",
|
|
1677
|
+
var Qt = "Invariant Violation", Ie = Object.setPrototypeOf, zr = Ie === void 0 ? function(t, e) {
|
|
1656
1678
|
return t.__proto__ = e, t;
|
|
1657
|
-
} :
|
|
1679
|
+
} : Ie, Ke = (
|
|
1658
1680
|
/** @class */
|
|
1659
1681
|
(function(t) {
|
|
1660
1682
|
Pr(e, t);
|
|
1661
1683
|
function e(r) {
|
|
1662
1684
|
r === void 0 && (r = Qt);
|
|
1663
1685
|
var o = t.call(this, typeof r == "number" ? Qt + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
|
|
1664
|
-
return o.framesToPop = 1, o.name = Qt,
|
|
1686
|
+
return o.framesToPop = 1, o.name = Qt, zr(o, e.prototype), o;
|
|
1665
1687
|
}
|
|
1666
1688
|
return e;
|
|
1667
1689
|
})(Error)
|
|
1668
1690
|
);
|
|
1669
1691
|
function ot(t, e) {
|
|
1670
1692
|
if (!t)
|
|
1671
|
-
throw new
|
|
1693
|
+
throw new Ke(e);
|
|
1672
1694
|
}
|
|
1673
|
-
var
|
|
1695
|
+
var Je = ["debug", "log", "warn", "error", "silent"], Ar = Je.indexOf("log");
|
|
1674
1696
|
function Bt(t) {
|
|
1675
1697
|
return function() {
|
|
1676
|
-
if (
|
|
1698
|
+
if (Je.indexOf(t) >= Ar) {
|
|
1677
1699
|
var e = console[t] || console.log;
|
|
1678
1700
|
return e.apply(console, arguments);
|
|
1679
1701
|
}
|
|
@@ -1682,20 +1704,20 @@ function Bt(t) {
|
|
|
1682
1704
|
(function(t) {
|
|
1683
1705
|
t.debug = Bt("debug"), t.log = Bt("log"), t.warn = Bt("warn"), t.error = Bt("error");
|
|
1684
1706
|
})(ot || (ot = {}));
|
|
1685
|
-
var
|
|
1686
|
-
function
|
|
1707
|
+
var We = "3.14.0";
|
|
1708
|
+
function xt(t) {
|
|
1687
1709
|
try {
|
|
1688
1710
|
return t();
|
|
1689
1711
|
} catch {
|
|
1690
1712
|
}
|
|
1691
1713
|
}
|
|
1692
|
-
const
|
|
1714
|
+
const ie = xt(function() {
|
|
1693
1715
|
return globalThis;
|
|
1694
|
-
}) ||
|
|
1716
|
+
}) || xt(function() {
|
|
1695
1717
|
return window;
|
|
1696
|
-
}) ||
|
|
1718
|
+
}) || xt(function() {
|
|
1697
1719
|
return self;
|
|
1698
|
-
}) ||
|
|
1720
|
+
}) || xt(function() {
|
|
1699
1721
|
return global;
|
|
1700
1722
|
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
1701
1723
|
// long as at least one of globalThis, window, self, or global is defined, so
|
|
@@ -1703,16 +1725,16 @@ const ae = bt(function() {
|
|
|
1703
1725
|
// detect syntactic usage of the Function constructor. If you think you can
|
|
1704
1726
|
// improve your static analysis to detect this obfuscation, think again. This
|
|
1705
1727
|
// is an arms race you cannot win, at least not in JavaScript.
|
|
1706
|
-
|
|
1707
|
-
return
|
|
1728
|
+
xt(function() {
|
|
1729
|
+
return xt.constructor("return this")();
|
|
1708
1730
|
});
|
|
1709
1731
|
var Fe = /* @__PURE__ */ new Map();
|
|
1710
|
-
function
|
|
1732
|
+
function jr(t) {
|
|
1711
1733
|
var e = Fe.get(t) || 1;
|
|
1712
1734
|
return Fe.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
1713
1735
|
}
|
|
1714
|
-
function
|
|
1715
|
-
var r =
|
|
1736
|
+
function Dr(t, e) {
|
|
1737
|
+
var r = jr("stringifyForDisplay");
|
|
1716
1738
|
return JSON.stringify(t, function(o, n) {
|
|
1717
1739
|
return n === void 0 ? r : n;
|
|
1718
1740
|
}, e).split(JSON.stringify(r)).join("<undefined>");
|
|
@@ -1723,7 +1745,7 @@ function Ut(t) {
|
|
|
1723
1745
|
r[o - 1] = arguments[o];
|
|
1724
1746
|
if (typeof e == "number") {
|
|
1725
1747
|
var n = e;
|
|
1726
|
-
e =
|
|
1748
|
+
e = ce(n), e || (e = de(n, r), r = []);
|
|
1727
1749
|
}
|
|
1728
1750
|
t.apply(void 0, [e].concat(r));
|
|
1729
1751
|
};
|
|
@@ -1731,41 +1753,41 @@ function Ut(t) {
|
|
|
1731
1753
|
var Zt = Object.assign(function(e, r) {
|
|
1732
1754
|
for (var o = [], n = 2; n < arguments.length; n++)
|
|
1733
1755
|
o[n - 2] = arguments[n];
|
|
1734
|
-
e || ot(e,
|
|
1756
|
+
e || ot(e, ce(r, o) || de(r, o));
|
|
1735
1757
|
}, {
|
|
1736
1758
|
debug: Ut(ot.debug),
|
|
1737
1759
|
log: Ut(ot.log),
|
|
1738
1760
|
warn: Ut(ot.warn),
|
|
1739
1761
|
error: Ut(ot.error)
|
|
1740
1762
|
});
|
|
1741
|
-
function
|
|
1763
|
+
function Ge(t) {
|
|
1742
1764
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
1743
1765
|
e[r - 1] = arguments[r];
|
|
1744
|
-
return new
|
|
1766
|
+
return new Ke(ce(t, e) || de(t, e));
|
|
1745
1767
|
}
|
|
1746
|
-
var
|
|
1747
|
-
function
|
|
1768
|
+
var Ne = Symbol.for("ApolloErrorMessageHandler_" + We);
|
|
1769
|
+
function Xe(t) {
|
|
1748
1770
|
if (typeof t == "string")
|
|
1749
1771
|
return t;
|
|
1750
1772
|
try {
|
|
1751
|
-
return
|
|
1773
|
+
return Dr(t, 2).slice(0, 1e3);
|
|
1752
1774
|
} catch {
|
|
1753
1775
|
return "<non-serializable>";
|
|
1754
1776
|
}
|
|
1755
1777
|
}
|
|
1756
|
-
function
|
|
1778
|
+
function ce(t, e) {
|
|
1757
1779
|
if (e === void 0 && (e = []), !!t)
|
|
1758
|
-
return
|
|
1780
|
+
return ie[Ne] && ie[Ne](t, e.map(Xe));
|
|
1759
1781
|
}
|
|
1760
|
-
function
|
|
1782
|
+
function de(t, e) {
|
|
1761
1783
|
if (e === void 0 && (e = []), !!t)
|
|
1762
1784
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
1763
|
-
version:
|
|
1785
|
+
version: We,
|
|
1764
1786
|
message: t,
|
|
1765
|
-
args: e.map(
|
|
1787
|
+
args: e.map(Xe)
|
|
1766
1788
|
})));
|
|
1767
1789
|
}
|
|
1768
|
-
function
|
|
1790
|
+
function Lr(t) {
|
|
1769
1791
|
return t.definitions.filter(function(e) {
|
|
1770
1792
|
return e.kind === "OperationDefinition" && !!e.name;
|
|
1771
1793
|
}).map(function(e) {
|
|
@@ -1773,13 +1795,13 @@ function Dr(t) {
|
|
|
1773
1795
|
})[0] || null;
|
|
1774
1796
|
}
|
|
1775
1797
|
let N = null;
|
|
1776
|
-
const
|
|
1777
|
-
let
|
|
1778
|
-
const
|
|
1798
|
+
const Ee = {};
|
|
1799
|
+
let Br = 1;
|
|
1800
|
+
const Ur = () => class {
|
|
1779
1801
|
constructor() {
|
|
1780
1802
|
this.id = [
|
|
1781
1803
|
"slot",
|
|
1782
|
-
|
|
1804
|
+
Br++,
|
|
1783
1805
|
Date.now(),
|
|
1784
1806
|
Math.random().toString(36).slice(2)
|
|
1785
1807
|
].join(":");
|
|
@@ -1788,11 +1810,11 @@ const Br = () => class {
|
|
|
1788
1810
|
for (let e = N; e; e = e.parent)
|
|
1789
1811
|
if (this.id in e.slots) {
|
|
1790
1812
|
const r = e.slots[this.id];
|
|
1791
|
-
if (r ===
|
|
1813
|
+
if (r === Ee)
|
|
1792
1814
|
break;
|
|
1793
1815
|
return e !== N && (N.slots[this.id] = r), !0;
|
|
1794
1816
|
}
|
|
1795
|
-
return N && (N.slots[this.id] =
|
|
1817
|
+
return N && (N.slots[this.id] = Ee), !1;
|
|
1796
1818
|
}
|
|
1797
1819
|
getValue() {
|
|
1798
1820
|
if (this.hasValue())
|
|
@@ -1836,27 +1858,27 @@ const Br = () => class {
|
|
|
1836
1858
|
return e.apply(o, r);
|
|
1837
1859
|
}
|
|
1838
1860
|
};
|
|
1839
|
-
function
|
|
1861
|
+
function Te(t) {
|
|
1840
1862
|
try {
|
|
1841
1863
|
return t();
|
|
1842
1864
|
} catch {
|
|
1843
1865
|
}
|
|
1844
1866
|
}
|
|
1845
|
-
const te = "@wry/context:Slot",
|
|
1867
|
+
const te = "@wry/context:Slot", qr = (
|
|
1846
1868
|
// Prefer globalThis when available.
|
|
1847
1869
|
// https://github.com/benjamn/wryware/issues/347
|
|
1848
|
-
|
|
1870
|
+
Te(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
1849
1871
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
1850
1872
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
1851
|
-
|
|
1873
|
+
Te(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
1852
1874
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1853
1875
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1854
1876
|
/* @__PURE__ */ Object.create(null)
|
|
1855
|
-
),
|
|
1877
|
+
), Oe = qr, ue = Oe[te] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1856
1878
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1857
1879
|
Array[te] || (function(t) {
|
|
1858
1880
|
try {
|
|
1859
|
-
Object.defineProperty(
|
|
1881
|
+
Object.defineProperty(Oe, te, {
|
|
1860
1882
|
value: t,
|
|
1861
1883
|
enumerable: !1,
|
|
1862
1884
|
writable: !1,
|
|
@@ -1871,12 +1893,12 @@ Array[te] || (function(t) {
|
|
|
1871
1893
|
} finally {
|
|
1872
1894
|
return t;
|
|
1873
1895
|
}
|
|
1874
|
-
})(
|
|
1875
|
-
new
|
|
1876
|
-
function
|
|
1896
|
+
})(Ur()), { bind: Co, noContext: Io } = ue;
|
|
1897
|
+
new ue();
|
|
1898
|
+
function Mr(t, e) {
|
|
1877
1899
|
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
1878
1900
|
if (r) return (r = r.call(t)).next.bind(r);
|
|
1879
|
-
if (Array.isArray(t) || (r =
|
|
1901
|
+
if (Array.isArray(t) || (r = Hr(t)) || e) {
|
|
1880
1902
|
r && (t = r);
|
|
1881
1903
|
var o = 0;
|
|
1882
1904
|
return function() {
|
|
@@ -1886,7 +1908,7 @@ function qr(t, e) {
|
|
|
1886
1908
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1887
1909
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1888
1910
|
}
|
|
1889
|
-
function
|
|
1911
|
+
function Hr(t, e) {
|
|
1890
1912
|
if (t) {
|
|
1891
1913
|
if (typeof t == "string") return Pe(t, e);
|
|
1892
1914
|
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
@@ -1900,40 +1922,40 @@ function Pe(t, e) {
|
|
|
1900
1922
|
o[r] = t[r];
|
|
1901
1923
|
return o;
|
|
1902
1924
|
}
|
|
1903
|
-
function
|
|
1925
|
+
function $e(t, e) {
|
|
1904
1926
|
for (var r = 0; r < e.length; r++) {
|
|
1905
1927
|
var o = e[r];
|
|
1906
1928
|
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
|
|
1907
1929
|
}
|
|
1908
1930
|
}
|
|
1909
|
-
function
|
|
1910
|
-
return e &&
|
|
1931
|
+
function pe(t, e, r) {
|
|
1932
|
+
return e && $e(t.prototype, e), r && $e(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
1911
1933
|
}
|
|
1912
|
-
var
|
|
1934
|
+
var fe = function() {
|
|
1913
1935
|
return typeof Symbol == "function";
|
|
1914
|
-
}, fe = function(t) {
|
|
1915
|
-
return pe() && !!Symbol[t];
|
|
1916
1936
|
}, he = function(t) {
|
|
1917
|
-
return fe(
|
|
1937
|
+
return fe() && !!Symbol[t];
|
|
1938
|
+
}, me = function(t) {
|
|
1939
|
+
return he(t) ? Symbol[t] : "@@" + t;
|
|
1918
1940
|
};
|
|
1919
|
-
|
|
1920
|
-
var
|
|
1921
|
-
function
|
|
1941
|
+
fe() && !he("observable") && (Symbol.observable = Symbol("observable"));
|
|
1942
|
+
var Rr = me("iterator"), se = me("observable"), Qe = me("species");
|
|
1943
|
+
function Kt(t, e) {
|
|
1922
1944
|
var r = t[e];
|
|
1923
1945
|
if (r != null) {
|
|
1924
1946
|
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
1925
1947
|
return r;
|
|
1926
1948
|
}
|
|
1927
1949
|
}
|
|
1928
|
-
function
|
|
1950
|
+
function Et(t) {
|
|
1929
1951
|
var e = t.constructor;
|
|
1930
|
-
return e !== void 0 && (e = e[
|
|
1952
|
+
return e !== void 0 && (e = e[Qe], e === null && (e = void 0)), e !== void 0 ? e : E;
|
|
1931
1953
|
}
|
|
1932
1954
|
function Vr(t) {
|
|
1933
1955
|
return t instanceof E;
|
|
1934
1956
|
}
|
|
1935
|
-
function
|
|
1936
|
-
|
|
1957
|
+
function vt(t) {
|
|
1958
|
+
vt.log ? vt.log(t) : setTimeout(function() {
|
|
1937
1959
|
throw t;
|
|
1938
1960
|
});
|
|
1939
1961
|
}
|
|
@@ -1942,56 +1964,56 @@ function Mt(t) {
|
|
|
1942
1964
|
try {
|
|
1943
1965
|
t();
|
|
1944
1966
|
} catch (e) {
|
|
1945
|
-
|
|
1967
|
+
vt(e);
|
|
1946
1968
|
}
|
|
1947
1969
|
});
|
|
1948
1970
|
}
|
|
1949
|
-
function
|
|
1971
|
+
function Ze(t) {
|
|
1950
1972
|
var e = t._cleanup;
|
|
1951
1973
|
if (e !== void 0 && (t._cleanup = void 0, !!e))
|
|
1952
1974
|
try {
|
|
1953
1975
|
if (typeof e == "function")
|
|
1954
1976
|
e();
|
|
1955
1977
|
else {
|
|
1956
|
-
var r =
|
|
1978
|
+
var r = Kt(e, "unsubscribe");
|
|
1957
1979
|
r && r.call(e);
|
|
1958
1980
|
}
|
|
1959
1981
|
} catch (o) {
|
|
1960
|
-
|
|
1982
|
+
vt(o);
|
|
1961
1983
|
}
|
|
1962
1984
|
}
|
|
1963
|
-
function
|
|
1985
|
+
function le(t) {
|
|
1964
1986
|
t._observer = void 0, t._queue = void 0, t._state = "closed";
|
|
1965
1987
|
}
|
|
1966
|
-
function
|
|
1988
|
+
function Yr(t) {
|
|
1967
1989
|
var e = t._queue;
|
|
1968
1990
|
if (e) {
|
|
1969
1991
|
t._queue = void 0, t._state = "ready";
|
|
1970
|
-
for (var r = 0; r < e.length && (
|
|
1992
|
+
for (var r = 0; r < e.length && (tr(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
|
|
1971
1993
|
;
|
|
1972
1994
|
}
|
|
1973
1995
|
}
|
|
1974
|
-
function
|
|
1996
|
+
function tr(t, e, r) {
|
|
1975
1997
|
t._state = "running";
|
|
1976
1998
|
var o = t._observer;
|
|
1977
1999
|
try {
|
|
1978
|
-
var n =
|
|
2000
|
+
var n = Kt(o, e);
|
|
1979
2001
|
switch (e) {
|
|
1980
2002
|
case "next":
|
|
1981
2003
|
n && n.call(o, r);
|
|
1982
2004
|
break;
|
|
1983
2005
|
case "error":
|
|
1984
|
-
if (
|
|
2006
|
+
if (le(t), n) n.call(o, r);
|
|
1985
2007
|
else throw r;
|
|
1986
2008
|
break;
|
|
1987
2009
|
case "complete":
|
|
1988
|
-
|
|
2010
|
+
le(t), n && n.call(o);
|
|
1989
2011
|
break;
|
|
1990
2012
|
}
|
|
1991
2013
|
} catch (c) {
|
|
1992
|
-
|
|
2014
|
+
vt(c);
|
|
1993
2015
|
}
|
|
1994
|
-
t._state === "closed" ?
|
|
2016
|
+
t._state === "closed" ? Ze(t) : t._state === "running" && (t._state = "ready");
|
|
1995
2017
|
}
|
|
1996
2018
|
function ee(t, e, r) {
|
|
1997
2019
|
if (t._state !== "closed") {
|
|
@@ -2007,17 +2029,17 @@ function ee(t, e, r) {
|
|
|
2007
2029
|
type: e,
|
|
2008
2030
|
value: r
|
|
2009
2031
|
}], Mt(function() {
|
|
2010
|
-
return
|
|
2032
|
+
return Yr(t);
|
|
2011
2033
|
});
|
|
2012
2034
|
return;
|
|
2013
2035
|
}
|
|
2014
|
-
|
|
2036
|
+
tr(t, e, r);
|
|
2015
2037
|
}
|
|
2016
2038
|
}
|
|
2017
|
-
var
|
|
2039
|
+
var Kr = /* @__PURE__ */ (function() {
|
|
2018
2040
|
function t(r, o) {
|
|
2019
2041
|
this._cleanup = void 0, this._observer = r, this._queue = void 0, this._state = "initializing";
|
|
2020
|
-
var n = new
|
|
2042
|
+
var n = new Jr(this);
|
|
2021
2043
|
try {
|
|
2022
2044
|
this._cleanup = o.call(void 0, n);
|
|
2023
2045
|
} catch (c) {
|
|
@@ -2027,14 +2049,14 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2027
2049
|
}
|
|
2028
2050
|
var e = t.prototype;
|
|
2029
2051
|
return e.unsubscribe = function() {
|
|
2030
|
-
this._state !== "closed" && (
|
|
2031
|
-
},
|
|
2052
|
+
this._state !== "closed" && (le(this), Ze(this));
|
|
2053
|
+
}, pe(t, [{
|
|
2032
2054
|
key: "closed",
|
|
2033
2055
|
get: function() {
|
|
2034
2056
|
return this._state === "closed";
|
|
2035
2057
|
}
|
|
2036
2058
|
}]), t;
|
|
2037
|
-
})(),
|
|
2059
|
+
})(), Jr = /* @__PURE__ */ (function() {
|
|
2038
2060
|
function t(r) {
|
|
2039
2061
|
this._subscription = r;
|
|
2040
2062
|
}
|
|
@@ -2045,7 +2067,7 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2045
2067
|
ee(this._subscription, "error", o);
|
|
2046
2068
|
}, e.complete = function() {
|
|
2047
2069
|
ee(this._subscription, "complete");
|
|
2048
|
-
},
|
|
2070
|
+
}, pe(t, [{
|
|
2049
2071
|
key: "closed",
|
|
2050
2072
|
get: function() {
|
|
2051
2073
|
return this._subscription._state === "closed";
|
|
@@ -2063,7 +2085,7 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2063
2085
|
next: o,
|
|
2064
2086
|
error: arguments[1],
|
|
2065
2087
|
complete: arguments[2]
|
|
2066
|
-
}), new
|
|
2088
|
+
}), new Kr(o, this._subscriber);
|
|
2067
2089
|
}, e.forEach = function(o) {
|
|
2068
2090
|
var n = this;
|
|
2069
2091
|
return new Promise(function(c, l) {
|
|
@@ -2078,8 +2100,8 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2078
2100
|
next: function(y) {
|
|
2079
2101
|
try {
|
|
2080
2102
|
o(y, d);
|
|
2081
|
-
} catch (
|
|
2082
|
-
l(
|
|
2103
|
+
} catch (v) {
|
|
2104
|
+
l(v), i.unsubscribe();
|
|
2083
2105
|
}
|
|
2084
2106
|
},
|
|
2085
2107
|
error: l,
|
|
@@ -2089,7 +2111,7 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2089
2111
|
}, e.map = function(o) {
|
|
2090
2112
|
var n = this;
|
|
2091
2113
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2092
|
-
var c =
|
|
2114
|
+
var c = Et(this);
|
|
2093
2115
|
return new c(function(l) {
|
|
2094
2116
|
return n.subscribe({
|
|
2095
2117
|
next: function(d) {
|
|
@@ -2111,7 +2133,7 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2111
2133
|
}, e.filter = function(o) {
|
|
2112
2134
|
var n = this;
|
|
2113
2135
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2114
|
-
var c =
|
|
2136
|
+
var c = Et(this);
|
|
2115
2137
|
return new c(function(l) {
|
|
2116
2138
|
return n.subscribe({
|
|
2117
2139
|
next: function(d) {
|
|
@@ -2133,81 +2155,81 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2133
2155
|
}, e.reduce = function(o) {
|
|
2134
2156
|
var n = this;
|
|
2135
2157
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2136
|
-
var c =
|
|
2137
|
-
return new c(function(
|
|
2158
|
+
var c = Et(this), l = arguments.length > 1, d = !1, i = arguments[1], y = i;
|
|
2159
|
+
return new c(function(v) {
|
|
2138
2160
|
return n.subscribe({
|
|
2139
|
-
next: function(
|
|
2140
|
-
var
|
|
2141
|
-
if (d = !0, !
|
|
2161
|
+
next: function(C) {
|
|
2162
|
+
var S = !d;
|
|
2163
|
+
if (d = !0, !S || l)
|
|
2142
2164
|
try {
|
|
2143
|
-
y = o(y,
|
|
2144
|
-
} catch (
|
|
2145
|
-
return
|
|
2165
|
+
y = o(y, C);
|
|
2166
|
+
} catch (I) {
|
|
2167
|
+
return v.error(I);
|
|
2146
2168
|
}
|
|
2147
2169
|
else
|
|
2148
|
-
y =
|
|
2170
|
+
y = C;
|
|
2149
2171
|
},
|
|
2150
|
-
error: function(
|
|
2151
|
-
|
|
2172
|
+
error: function(C) {
|
|
2173
|
+
v.error(C);
|
|
2152
2174
|
},
|
|
2153
2175
|
complete: function() {
|
|
2154
|
-
if (!d && !l) return
|
|
2155
|
-
|
|
2176
|
+
if (!d && !l) return v.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2177
|
+
v.next(y), v.complete();
|
|
2156
2178
|
}
|
|
2157
2179
|
});
|
|
2158
2180
|
});
|
|
2159
2181
|
}, e.concat = function() {
|
|
2160
2182
|
for (var o = this, n = arguments.length, c = new Array(n), l = 0; l < n; l++)
|
|
2161
2183
|
c[l] = arguments[l];
|
|
2162
|
-
var d =
|
|
2184
|
+
var d = Et(this);
|
|
2163
2185
|
return new d(function(i) {
|
|
2164
|
-
var y,
|
|
2165
|
-
function S
|
|
2166
|
-
y =
|
|
2167
|
-
next: function(
|
|
2168
|
-
i.next(
|
|
2186
|
+
var y, v = 0;
|
|
2187
|
+
function C(S) {
|
|
2188
|
+
y = S.subscribe({
|
|
2189
|
+
next: function(I) {
|
|
2190
|
+
i.next(I);
|
|
2169
2191
|
},
|
|
2170
|
-
error: function(
|
|
2171
|
-
i.error(
|
|
2192
|
+
error: function(I) {
|
|
2193
|
+
i.error(I);
|
|
2172
2194
|
},
|
|
2173
2195
|
complete: function() {
|
|
2174
|
-
|
|
2196
|
+
v === c.length ? (y = void 0, i.complete()) : C(d.from(c[v++]));
|
|
2175
2197
|
}
|
|
2176
2198
|
});
|
|
2177
2199
|
}
|
|
2178
|
-
return
|
|
2200
|
+
return C(o), function() {
|
|
2179
2201
|
y && (y.unsubscribe(), y = void 0);
|
|
2180
2202
|
};
|
|
2181
2203
|
});
|
|
2182
2204
|
}, e.flatMap = function(o) {
|
|
2183
2205
|
var n = this;
|
|
2184
2206
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2185
|
-
var c =
|
|
2207
|
+
var c = Et(this);
|
|
2186
2208
|
return new c(function(l) {
|
|
2187
2209
|
var d = [], i = n.subscribe({
|
|
2188
|
-
next: function(
|
|
2210
|
+
next: function(v) {
|
|
2189
2211
|
if (o)
|
|
2190
2212
|
try {
|
|
2191
|
-
|
|
2192
|
-
} catch (
|
|
2193
|
-
return l.error(
|
|
2213
|
+
v = o(v);
|
|
2214
|
+
} catch (S) {
|
|
2215
|
+
return l.error(S);
|
|
2194
2216
|
}
|
|
2195
|
-
var
|
|
2196
|
-
next: function(
|
|
2197
|
-
l.next(
|
|
2217
|
+
var C = c.from(v).subscribe({
|
|
2218
|
+
next: function(S) {
|
|
2219
|
+
l.next(S);
|
|
2198
2220
|
},
|
|
2199
|
-
error: function(
|
|
2200
|
-
l.error(
|
|
2221
|
+
error: function(S) {
|
|
2222
|
+
l.error(S);
|
|
2201
2223
|
},
|
|
2202
2224
|
complete: function() {
|
|
2203
|
-
var
|
|
2204
|
-
|
|
2225
|
+
var S = d.indexOf(C);
|
|
2226
|
+
S >= 0 && d.splice(S, 1), y();
|
|
2205
2227
|
}
|
|
2206
2228
|
});
|
|
2207
|
-
d.push(
|
|
2229
|
+
d.push(C);
|
|
2208
2230
|
},
|
|
2209
|
-
error: function(
|
|
2210
|
-
l.error(
|
|
2231
|
+
error: function(v) {
|
|
2232
|
+
l.error(v);
|
|
2211
2233
|
},
|
|
2212
2234
|
complete: function() {
|
|
2213
2235
|
y();
|
|
@@ -2217,17 +2239,17 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2217
2239
|
i.closed && d.length === 0 && l.complete();
|
|
2218
2240
|
}
|
|
2219
2241
|
return function() {
|
|
2220
|
-
d.forEach(function(
|
|
2221
|
-
return
|
|
2242
|
+
d.forEach(function(v) {
|
|
2243
|
+
return v.unsubscribe();
|
|
2222
2244
|
}), i.unsubscribe();
|
|
2223
2245
|
};
|
|
2224
2246
|
});
|
|
2225
|
-
}, e[
|
|
2247
|
+
}, e[se] = function() {
|
|
2226
2248
|
return this;
|
|
2227
2249
|
}, t.from = function(o) {
|
|
2228
2250
|
var n = typeof this == "function" ? this : t;
|
|
2229
2251
|
if (o == null) throw new TypeError(o + " is not an object");
|
|
2230
|
-
var c =
|
|
2252
|
+
var c = Kt(o, se);
|
|
2231
2253
|
if (c) {
|
|
2232
2254
|
var l = c.call(o);
|
|
2233
2255
|
if (Object(l) !== l) throw new TypeError(l + " is not an object");
|
|
@@ -2235,13 +2257,13 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2235
2257
|
return l.subscribe(d);
|
|
2236
2258
|
});
|
|
2237
2259
|
}
|
|
2238
|
-
if (
|
|
2260
|
+
if (he("iterator") && (c = Kt(o, Rr), c))
|
|
2239
2261
|
return new n(function(d) {
|
|
2240
2262
|
Mt(function() {
|
|
2241
2263
|
if (!d.closed) {
|
|
2242
|
-
for (var i =
|
|
2243
|
-
var
|
|
2244
|
-
if (d.next(
|
|
2264
|
+
for (var i = Mr(c.call(o)), y; !(y = i()).done; ) {
|
|
2265
|
+
var v = y.value;
|
|
2266
|
+
if (d.next(v), d.closed) return;
|
|
2245
2267
|
}
|
|
2246
2268
|
d.complete();
|
|
2247
2269
|
}
|
|
@@ -2271,21 +2293,21 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2271
2293
|
}
|
|
2272
2294
|
});
|
|
2273
2295
|
});
|
|
2274
|
-
},
|
|
2275
|
-
key:
|
|
2296
|
+
}, pe(t, null, [{
|
|
2297
|
+
key: Qe,
|
|
2276
2298
|
get: function() {
|
|
2277
2299
|
return this;
|
|
2278
2300
|
}
|
|
2279
2301
|
}]), t;
|
|
2280
2302
|
})();
|
|
2281
|
-
|
|
2303
|
+
fe() && Object.defineProperty(E, Symbol("extensions"), {
|
|
2282
2304
|
value: {
|
|
2283
|
-
symbol:
|
|
2284
|
-
hostReportError:
|
|
2305
|
+
symbol: se,
|
|
2306
|
+
hostReportError: vt
|
|
2285
2307
|
},
|
|
2286
2308
|
configurable: !0
|
|
2287
2309
|
});
|
|
2288
|
-
function
|
|
2310
|
+
function Wr(t) {
|
|
2289
2311
|
var e, r = t.Symbol;
|
|
2290
2312
|
if (typeof r == "function")
|
|
2291
2313
|
if (r.observable)
|
|
@@ -2301,14 +2323,14 @@ function Jr(t) {
|
|
|
2301
2323
|
e = "@@observable";
|
|
2302
2324
|
return e;
|
|
2303
2325
|
}
|
|
2304
|
-
var
|
|
2305
|
-
typeof self < "u" ?
|
|
2306
|
-
|
|
2307
|
-
var
|
|
2308
|
-
|
|
2326
|
+
var yt;
|
|
2327
|
+
typeof self < "u" ? yt = self : typeof window < "u" ? yt = window : typeof global < "u" ? yt = global : typeof module < "u" ? yt = module : yt = Function("return this")();
|
|
2328
|
+
Wr(yt);
|
|
2329
|
+
var ze = E.prototype, Ae = "@@observable";
|
|
2330
|
+
ze[Ae] || (ze[Ae] = function() {
|
|
2309
2331
|
return this;
|
|
2310
2332
|
});
|
|
2311
|
-
function
|
|
2333
|
+
function Gr(t) {
|
|
2312
2334
|
for (var e = [
|
|
2313
2335
|
"query",
|
|
2314
2336
|
"operationName",
|
|
@@ -2318,15 +2340,15 @@ function Wr(t) {
|
|
|
2318
2340
|
], r = 0, o = Object.keys(t); r < o.length; r++) {
|
|
2319
2341
|
var n = o[r];
|
|
2320
2342
|
if (e.indexOf(n) < 0)
|
|
2321
|
-
throw
|
|
2343
|
+
throw Ge(58, n);
|
|
2322
2344
|
}
|
|
2323
2345
|
return t;
|
|
2324
2346
|
}
|
|
2325
|
-
function
|
|
2326
|
-
var r =
|
|
2327
|
-
typeof c == "function" ? r =
|
|
2347
|
+
function Xr(t, e) {
|
|
2348
|
+
var r = G({}, t), o = function(c) {
|
|
2349
|
+
typeof c == "function" ? r = G(G({}, r), c(r)) : r = G(G({}, r), c);
|
|
2328
2350
|
}, n = function() {
|
|
2329
|
-
return
|
|
2351
|
+
return G({}, r);
|
|
2330
2352
|
};
|
|
2331
2353
|
return Object.defineProperty(e, "setContext", {
|
|
2332
2354
|
enumerable: !1,
|
|
@@ -2336,32 +2358,32 @@ function Gr(t, e) {
|
|
|
2336
2358
|
value: n
|
|
2337
2359
|
}), e;
|
|
2338
2360
|
}
|
|
2339
|
-
function
|
|
2361
|
+
function Qr(t) {
|
|
2340
2362
|
var e = {
|
|
2341
2363
|
variables: t.variables || {},
|
|
2342
2364
|
extensions: t.extensions || {},
|
|
2343
2365
|
operationName: t.operationName,
|
|
2344
2366
|
query: t.query
|
|
2345
2367
|
};
|
|
2346
|
-
return e.operationName || (e.operationName = typeof e.query != "string" ?
|
|
2368
|
+
return e.operationName || (e.operationName = typeof e.query != "string" ? Lr(e.query) || void 0 : ""), e;
|
|
2347
2369
|
}
|
|
2348
|
-
var
|
|
2349
|
-
function
|
|
2350
|
-
return Zr
|
|
2370
|
+
var Zr = Symbol.for("apollo.deprecations"), to = ie, eo = new ue();
|
|
2371
|
+
function ro(t) {
|
|
2372
|
+
return to[Zr] || (eo.getValue() || []).includes(t);
|
|
2351
2373
|
}
|
|
2352
|
-
function
|
|
2353
|
-
|
|
2374
|
+
function oo(t, e) {
|
|
2375
|
+
ro(t) || e();
|
|
2354
2376
|
}
|
|
2355
|
-
function
|
|
2377
|
+
function je(t, e) {
|
|
2356
2378
|
return e ? e(t) : E.of();
|
|
2357
2379
|
}
|
|
2358
|
-
function
|
|
2359
|
-
return typeof t == "function" ? new
|
|
2380
|
+
function Tt(t) {
|
|
2381
|
+
return typeof t == "function" ? new er(t) : t;
|
|
2360
2382
|
}
|
|
2361
2383
|
function qt(t) {
|
|
2362
2384
|
return t.request.length <= 1;
|
|
2363
2385
|
}
|
|
2364
|
-
var
|
|
2386
|
+
var er = (
|
|
2365
2387
|
/** @class */
|
|
2366
2388
|
(function() {
|
|
2367
2389
|
function t(e) {
|
|
@@ -2372,23 +2394,23 @@ var tr = (
|
|
|
2372
2394
|
return E.of();
|
|
2373
2395
|
});
|
|
2374
2396
|
}, t.from = function(e) {
|
|
2375
|
-
return e.length === 0 ? t.empty() : e.map(
|
|
2397
|
+
return e.length === 0 ? t.empty() : e.map(Tt).reduce(function(r, o) {
|
|
2376
2398
|
return r.concat(o);
|
|
2377
2399
|
});
|
|
2378
2400
|
}, t.split = function(e, r, o) {
|
|
2379
|
-
var n =
|
|
2401
|
+
var n = Tt(r), c = Tt(o || new t(je)), l;
|
|
2380
2402
|
return qt(n) && qt(c) ? l = new t(function(d) {
|
|
2381
2403
|
return e(d) ? n.request(d) || E.of() : c.request(d) || E.of();
|
|
2382
2404
|
}) : l = new t(function(d, i) {
|
|
2383
2405
|
return e(d) ? n.request(d, i) || E.of() : c.request(d, i) || E.of();
|
|
2384
2406
|
}), Object.assign(l, { left: n, right: c });
|
|
2385
2407
|
}, t.execute = function(e, r) {
|
|
2386
|
-
return e.request(
|
|
2408
|
+
return e.request(Xr(r.context, Qr(Gr(r)))) || E.of();
|
|
2387
2409
|
}, t.concat = function(e, r) {
|
|
2388
|
-
var o =
|
|
2410
|
+
var o = Tt(e);
|
|
2389
2411
|
if (qt(o))
|
|
2390
2412
|
return globalThis.__DEV__ !== !1 && Zt.warn(47, o), o;
|
|
2391
|
-
var n =
|
|
2413
|
+
var n = Tt(r), c;
|
|
2392
2414
|
return qt(n) ? c = new t(function(l) {
|
|
2393
2415
|
return o.request(l, function(d) {
|
|
2394
2416
|
return n.request(d) || E.of();
|
|
@@ -2399,13 +2421,13 @@ var tr = (
|
|
|
2399
2421
|
}) || E.of();
|
|
2400
2422
|
}), Object.assign(c, { left: o, right: n });
|
|
2401
2423
|
}, t.prototype.split = function(e, r, o) {
|
|
2402
|
-
return this.concat(t.split(e, r, o || new t(
|
|
2424
|
+
return this.concat(t.split(e, r, o || new t(je)));
|
|
2403
2425
|
}, t.prototype.concat = function(e) {
|
|
2404
2426
|
return t.concat(this, e);
|
|
2405
2427
|
}, t.prototype.request = function(e, r) {
|
|
2406
|
-
throw
|
|
2428
|
+
throw Ge(48);
|
|
2407
2429
|
}, t.prototype.onError = function(e, r) {
|
|
2408
|
-
if (globalThis.__DEV__ !== !1 &&
|
|
2430
|
+
if (globalThis.__DEV__ !== !1 && oo("onError", function() {
|
|
2409
2431
|
globalThis.__DEV__ !== !1 && Zt.warn(49);
|
|
2410
2432
|
}), r && r.error)
|
|
2411
2433
|
return r.error(e), !1;
|
|
@@ -2415,9 +2437,9 @@ var tr = (
|
|
|
2415
2437
|
}, t;
|
|
2416
2438
|
})()
|
|
2417
2439
|
);
|
|
2418
|
-
function
|
|
2419
|
-
return new
|
|
2420
|
-
var o =
|
|
2440
|
+
function no(t) {
|
|
2441
|
+
return new er(function(e, r) {
|
|
2442
|
+
var o = $r(e, []);
|
|
2421
2443
|
return new E(function(n) {
|
|
2422
2444
|
var c, l = !1;
|
|
2423
2445
|
return Promise.resolve(o).then(function(d) {
|
|
@@ -2434,7 +2456,7 @@ function oo(t) {
|
|
|
2434
2456
|
});
|
|
2435
2457
|
});
|
|
2436
2458
|
}
|
|
2437
|
-
const
|
|
2459
|
+
const ao = async () => {
|
|
2438
2460
|
const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", o = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
2439
2461
|
try {
|
|
2440
2462
|
const n = await T.post(
|
|
@@ -2452,19 +2474,19 @@ const no = async () => {
|
|
|
2452
2474
|
} catch (n) {
|
|
2453
2475
|
return T.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
2454
2476
|
}
|
|
2455
|
-
},
|
|
2456
|
-
uri: `${
|
|
2457
|
-
}),
|
|
2458
|
-
const r = await
|
|
2477
|
+
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so = lr({
|
|
2478
|
+
uri: `${io}`
|
|
2479
|
+
}), lo = no(async (t, { headers: e }) => {
|
|
2480
|
+
const r = await ao();
|
|
2459
2481
|
return {
|
|
2460
2482
|
headers: {
|
|
2461
2483
|
...e,
|
|
2462
2484
|
authorization: `Bearer ${r}`
|
|
2463
2485
|
}
|
|
2464
2486
|
};
|
|
2465
|
-
}),
|
|
2466
|
-
link:
|
|
2467
|
-
cache: new
|
|
2487
|
+
}), co = new cr({
|
|
2488
|
+
link: lo.concat(so),
|
|
2489
|
+
cache: new dr(),
|
|
2468
2490
|
defaultOptions: {
|
|
2469
2491
|
watchQuery: {
|
|
2470
2492
|
fetchPolicy: "cache-and-network"
|
|
@@ -2472,10 +2494,10 @@ const no = async () => {
|
|
|
2472
2494
|
}
|
|
2473
2495
|
}), Fo = (t) => {
|
|
2474
2496
|
const { tanyaConfig: e } = t;
|
|
2475
|
-
return /* @__PURE__ */ a(
|
|
2497
|
+
return /* @__PURE__ */ a(ur, { client: co, children: /* @__PURE__ */ a(yr, { children: /* @__PURE__ */ a(Or, { tanyaConfig: e }) }) });
|
|
2476
2498
|
};
|
|
2477
2499
|
export {
|
|
2478
2500
|
Fo as TanyaChatbot,
|
|
2479
|
-
|
|
2501
|
+
ko as TanyaChatbotProvider
|
|
2480
2502
|
};
|
|
2481
2503
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|