tanya-chatbot 0.4.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tanya-chatbot.cjs.js +11 -11
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +651 -648
- 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 }), Vt = (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 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" }),
|
|
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=${R()}`
|
|
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=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
115
115
|
{},
|
|
116
116
|
{
|
|
117
117
|
headers: {
|
|
@@ -125,23 +125,23 @@ const kt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
125
125
|
return T.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
async function
|
|
128
|
+
async function Pt() {
|
|
129
129
|
var c;
|
|
130
|
-
const t =
|
|
130
|
+
const t = R(), 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"), R = () => 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
135
|
const { serverUrl: e, basePath: r } = kt();
|
|
136
136
|
let o = "";
|
|
137
137
|
{
|
|
138
|
-
const n = await
|
|
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=${R()}&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"), K = () => sessionStorage.getItem
|
|
|
152
152
|
} catch (n) {
|
|
153
153
|
throw console.error("Error fetching search results:", n), n;
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, Ve = async (t) => {
|
|
156
156
|
if (!t) throw new Error("Product ID is required");
|
|
157
|
-
const { serverUrl: e, basePath: r } = kt(), o =
|
|
157
|
+
const { serverUrl: e, basePath: r } = kt(), o = X();
|
|
158
158
|
console.log("calling access");
|
|
159
|
-
const { access_token: n } = await
|
|
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=${R()}&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"), K = () => 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 } = kt(), l = (await
|
|
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=${R()}&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"), K = () => 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,30 +192,30 @@ const Z = () => sessionStorage.getItem("Host"), K = () => 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
|
-
},
|
|
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;
|
|
205
205
|
}
|
|
206
|
-
const
|
|
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
|
);
|
|
213
213
|
}, l = () => {
|
|
214
214
|
n(
|
|
215
|
-
(
|
|
215
|
+
(i) => i - r < 0 ? t.length - (t.length % r || r) : i - r
|
|
216
216
|
);
|
|
217
|
-
}, d = async (
|
|
218
|
-
const v = await
|
|
217
|
+
}, d = async (i) => {
|
|
218
|
+
const v = await Ve(i);
|
|
219
219
|
e(oe(v));
|
|
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: [
|
|
@@ -232,22 +232,22 @@ const Ir = ({
|
|
|
232
232
|
children: "<"
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
|
-
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((
|
|
236
|
-
var v,
|
|
235
|
+
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((i) => {
|
|
236
|
+
var v, k, C, _;
|
|
237
237
|
return /* @__PURE__ */ u(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
240
240
|
className: "flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",
|
|
241
241
|
onClick: () => {
|
|
242
|
-
d(
|
|
242
|
+
d(i.product_id ?? i.productId);
|
|
243
243
|
},
|
|
244
244
|
children: [
|
|
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: ((v =
|
|
248
|
+
src: ((v = ve(i)[0]) == null ? void 0 : v.link) || ve(i)[0] || // fallback if it's a string
|
|
249
249
|
"https://via.placeholder.com/120",
|
|
250
|
-
alt:
|
|
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"
|
|
252
252
|
}
|
|
253
253
|
) }),
|
|
@@ -257,8 +257,8 @@ const Ir = ({
|
|
|
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:
|
|
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((k = i == null ? void 0 : i.name) == null ? void 0 : k["en-US"]),
|
|
262
262
|
60
|
|
263
263
|
) || "Product" }),
|
|
264
264
|
/* @__PURE__ */ a(
|
|
@@ -272,21 +272,21 @@ const Ir = ({
|
|
|
272
272
|
marginBottom: "5px",
|
|
273
273
|
zIndex: 50
|
|
274
274
|
},
|
|
275
|
-
children:
|
|
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
|
-
|
|
285
|
-
(
|
|
283
|
+
/* @__PURE__ */ a("p", { children: _r(
|
|
284
|
+
i != null && i.price ? Number(i == null ? void 0 : i.price) : ke(i).centAmount || 0,
|
|
285
|
+
(_ = ke(i)) == null ? void 0 : _.currencyCode
|
|
286
286
|
) }),
|
|
287
287
|
/* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
288
288
|
"$",
|
|
289
|
-
Number(
|
|
289
|
+
Number(i == null ? void 0 : i.price).toFixed(2) ?? 5
|
|
290
290
|
] })
|
|
291
291
|
] })
|
|
292
292
|
]
|
|
@@ -294,7 +294,7 @@ const Ir = ({
|
|
|
294
294
|
)
|
|
295
295
|
]
|
|
296
296
|
},
|
|
297
|
-
|
|
297
|
+
i.productId
|
|
298
298
|
);
|
|
299
299
|
}) }),
|
|
300
300
|
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
|
|
@@ -311,7 +311,7 @@ const Ir = ({
|
|
|
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",
|
|
@@ -324,11 +324,11 @@ const Ir = ({
|
|
|
324
324
|
"div",
|
|
325
325
|
{
|
|
326
326
|
className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
|
|
327
|
-
children:
|
|
327
|
+
children: Cr(r.keyword) || "No keyword"
|
|
328
328
|
}
|
|
329
329
|
),
|
|
330
330
|
/* @__PURE__ */ a(
|
|
331
|
-
|
|
331
|
+
Fr,
|
|
332
332
|
{
|
|
333
333
|
product: r.items,
|
|
334
334
|
storeDetails: e
|
|
@@ -337,14 +337,14 @@ const Ir = ({
|
|
|
337
337
|
]
|
|
338
338
|
},
|
|
339
339
|
o
|
|
340
|
-
)) }),
|
|
340
|
+
)) }), Re = async (t, e) => {
|
|
341
341
|
var c, l;
|
|
342
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=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
348
348
|
e,
|
|
349
349
|
{
|
|
350
350
|
headers: {
|
|
@@ -363,11 +363,11 @@ const Ir = ({
|
|
|
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
|
-
},
|
|
366
|
+
}, ne = async (t, e, r) => {
|
|
367
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=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
371
371
|
e,
|
|
372
372
|
{
|
|
373
373
|
headers: {
|
|
@@ -383,7 +383,7 @@ const Ir = ({
|
|
|
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
|
}) => {
|
|
@@ -391,7 +391,7 @@ const Ir = ({
|
|
|
391
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=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
395
395
|
{
|
|
396
396
|
headers: {
|
|
397
397
|
"Content-Type": "application/json",
|
|
@@ -403,129 +403,129 @@ const Ir = ({
|
|
|
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
|
-
},
|
|
407
|
-
const
|
|
406
|
+
}, Rt = "sfcc_basket_id", _e = "sfcc_customer_token", Ot = "sfcc_token_expiry", Er = 300 * 1e3, Nt = "1.0.0";
|
|
407
|
+
const nt = (t) => {
|
|
408
408
|
try {
|
|
409
|
-
t ? localStorage.setItem(
|
|
409
|
+
t ? localStorage.setItem(Rt, t) : localStorage.removeItem(Rt);
|
|
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
|
-
},
|
|
425
|
-
var d,
|
|
426
|
-
const t =
|
|
427
|
-
if (
|
|
424
|
+
}, Ce = 300, Tr = () => {
|
|
425
|
+
var d, i, v, k, C, _;
|
|
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 I,
|
|
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
|
+
), S = (et == null ? void 0 : et.basketId) || localStorage.getItem(Rt), Jt = !1, jt = localStorage.getItem(Ot), Dt = Date.now();
|
|
451
|
+
if (!Jt || !jt || Dt >= parseInt(jt)) {
|
|
452
|
+
let q = "";
|
|
453
453
|
{
|
|
454
|
-
const
|
|
455
|
-
console.log("token from auth data"),
|
|
454
|
+
const pt = await Pt();
|
|
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
|
|
464
|
-
basketId:
|
|
465
|
-
customer_token:
|
|
461
|
+
const rt = Dt + 300 * 1e3;
|
|
462
|
+
if (Yt(q), localStorage.setItem(Ot, rt.toString()), S) {
|
|
463
|
+
const pt = await Ye({
|
|
464
|
+
basketId: S,
|
|
465
|
+
customer_token: q
|
|
466
466
|
});
|
|
467
|
-
if (console.log(
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
467
|
+
if (console.log(S, "basket id from customer"), pt.status === 200 && pt) {
|
|
468
|
+
const K = await ne(
|
|
469
|
+
S,
|
|
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
|
-
}), Vt(
|
|
480
|
+
}), Vt(S));
|
|
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 Re(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
|
-
(
|
|
506
|
-
),
|
|
507
|
-
(
|
|
505
|
+
(p == null ? void 0 : p.basket_id) || (p == null ? void 0 : p.basketId)
|
|
506
|
+
), nt(
|
|
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
|
-
}), Vt(
|
|
521
|
+
}), Vt(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
|
}));
|
|
@@ -539,7 +539,7 @@ const at = (t) => {
|
|
|
539
539
|
{
|
|
540
540
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
541
541
|
onClick: () => {
|
|
542
|
-
n(!1), setTimeout(() => t(oe(null)),
|
|
542
|
+
n(!1), setTimeout(() => t(oe(null)), Ce);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
),
|
|
@@ -557,14 +557,14 @@ const at = (t) => {
|
|
|
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",
|
|
564
564
|
onClick: () => {
|
|
565
565
|
n(!1), setTimeout(
|
|
566
566
|
() => t(oe(null)),
|
|
567
|
-
|
|
567
|
+
Ce
|
|
568
568
|
);
|
|
569
569
|
}
|
|
570
570
|
}
|
|
@@ -574,20 +574,20 @@ const at = (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: (k = (v = (i = (d = e.imageGroups) == null ? void 0 : d[0]) == null ? void 0 : i.images) == null ? void 0 : v[0]) == null ? void 0 : k.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
|
-
(I) => I.images.slice(1, 2).map((
|
|
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 at = (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
|
+
((_ = e == null ? void 0 : e.rating) == null ? void 0 : _.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((I,
|
|
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,192 +681,193 @@ const at = (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
|
-
id:
|
|
704
|
-
title:
|
|
705
|
-
image:
|
|
706
|
-
price:
|
|
707
|
-
}), [
|
|
708
|
-
|
|
709
|
-
const
|
|
703
|
+
}, c = Ft(null), l = Ft(null), d = Ft(null), i = Ft(null), [v, k] = P(null), [C, _] = 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) => ({
|
|
704
|
+
id: s.id,
|
|
705
|
+
title: s.name,
|
|
706
|
+
image: s.image ?? "",
|
|
707
|
+
price: s.price ?? 0
|
|
708
|
+
}), [tt, b] = P([]), et = Ft(null), S = Ht((s) => s.store.store), Jt = Ht((s) => s.product.product);
|
|
709
|
+
L(() => {
|
|
710
|
+
const s = localStorage.getItem(
|
|
710
711
|
`access_token_${t.siteId}`
|
|
711
|
-
),
|
|
712
|
+
), g = localStorage.getItem(
|
|
712
713
|
`chat-token-${t.siteId}`
|
|
713
714
|
);
|
|
714
|
-
if (
|
|
715
|
+
if (s && g === s) {
|
|
715
716
|
const m = localStorage.getItem("chatHistory");
|
|
716
|
-
m &&
|
|
717
|
+
m && b(JSON.parse(m));
|
|
717
718
|
} else
|
|
718
719
|
localStorage.setItem("chatHistory", JSON.stringify([])), localStorage.setItem(
|
|
719
720
|
`chat-token-${t.siteId}`,
|
|
720
|
-
|
|
721
|
+
s || ""
|
|
721
722
|
);
|
|
722
|
-
}, []),
|
|
723
|
-
localStorage.setItem("chatHistory", JSON.stringify(
|
|
724
|
-
const
|
|
723
|
+
}, []), L(() => {
|
|
724
|
+
localStorage.setItem("chatHistory", JSON.stringify(tt));
|
|
725
|
+
const s = localStorage.getItem(
|
|
725
726
|
`access_token_${t.siteId}`
|
|
726
727
|
);
|
|
727
|
-
|
|
728
|
-
}, [
|
|
729
|
-
const
|
|
730
|
-
|
|
731
|
-
},
|
|
732
|
-
|
|
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);
|
|
733
734
|
};
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
}, [
|
|
737
|
-
const
|
|
738
|
-
|
|
735
|
+
L(() => {
|
|
736
|
+
C ? jt() : Dt();
|
|
737
|
+
}, [C]);
|
|
738
|
+
const q = (s) => {
|
|
739
|
+
zt(n[s]);
|
|
739
740
|
};
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
}, [
|
|
743
|
-
let
|
|
744
|
-
const
|
|
745
|
-
if (
|
|
746
|
-
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;
|
|
747
748
|
try {
|
|
748
|
-
const
|
|
749
|
+
const s = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", g = new URLSearchParams({
|
|
749
750
|
grant_type: "client_credentials",
|
|
750
751
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
751
752
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
752
753
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
753
|
-
}), m = await fetch(
|
|
754
|
+
}), m = await fetch(s, {
|
|
754
755
|
method: "POST",
|
|
755
756
|
headers: {
|
|
756
757
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
757
758
|
},
|
|
758
|
-
body:
|
|
759
|
+
body: g
|
|
759
760
|
});
|
|
760
761
|
if (!m.ok)
|
|
761
762
|
throw new Error(
|
|
762
763
|
`Token request failed! status: ${m.status}`
|
|
763
764
|
);
|
|
764
765
|
const x = await m.json();
|
|
765
|
-
|
|
766
|
-
const
|
|
767
|
-
return
|
|
768
|
-
} catch (
|
|
769
|
-
return console.error("Error obtaining JWT token:",
|
|
766
|
+
rt = x.access_token;
|
|
767
|
+
const f = x.expires_in || 3600;
|
|
768
|
+
return ut = Date.now() + (f - 60) * 1e3, rt;
|
|
769
|
+
} catch (s) {
|
|
770
|
+
return console.error("Error obtaining JWT token:", s), rt = null, ut = null, null;
|
|
770
771
|
}
|
|
771
|
-
},
|
|
772
|
-
const
|
|
773
|
-
|
|
772
|
+
}, Y = async () => {
|
|
773
|
+
const s = await Pt();
|
|
774
|
+
s != null && k(s);
|
|
774
775
|
};
|
|
775
|
-
|
|
776
|
+
L(() => {
|
|
776
777
|
if (t != null && t.siteId) {
|
|
777
|
-
const { clientID:
|
|
778
|
-
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);
|
|
779
780
|
}
|
|
780
|
-
|
|
781
|
-
}, []),
|
|
782
|
-
e && (console.log("setting the basket id", e),
|
|
783
|
-
}, [e]),
|
|
784
|
-
const
|
|
785
|
-
|
|
781
|
+
Y(), console.log("scapi environment v1");
|
|
782
|
+
}, []), L(() => {
|
|
783
|
+
e && (console.log("setting the basket id", e), nt(e));
|
|
784
|
+
}, [e]), L(() => {
|
|
785
|
+
const s = async () => {
|
|
786
|
+
_(!1);
|
|
786
787
|
};
|
|
787
|
-
return window.addEventListener("reactCartUpdated",
|
|
788
|
+
return window.addEventListener("reactCartUpdated", s), () => window.removeEventListener("reactCartUpdated", s);
|
|
788
789
|
}, []);
|
|
789
|
-
const
|
|
790
|
-
const
|
|
790
|
+
const pt = async () => {
|
|
791
|
+
const s = JSON.parse(
|
|
791
792
|
sessionStorage.getItem("customerData") || "{}"
|
|
792
793
|
).customerId;
|
|
793
|
-
return (await
|
|
794
|
-
},
|
|
795
|
-
console.log("in secondary flow",
|
|
796
|
-
const m = await
|
|
797
|
-
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)
|
|
798
799
|
try {
|
|
799
|
-
|
|
800
|
-
(
|
|
801
|
-
(
|
|
800
|
+
b(
|
|
801
|
+
(D) => D.map(
|
|
802
|
+
(M, H) => H === D.length - 1 ? { ...M, secondaryLoading: !0 } : M
|
|
802
803
|
)
|
|
803
804
|
);
|
|
804
|
-
const x = await
|
|
805
|
+
const x = await p();
|
|
805
806
|
if (!x) throw new Error("Failed to fetch token");
|
|
806
|
-
const
|
|
807
|
+
const f = localStorage.getItem("customerNumber"), w = localStorage.getItem("isLoggedIn"), ft = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
807
808
|
registered: String(w || !1),
|
|
808
|
-
userId: String(
|
|
809
|
-
}).toString()}`,
|
|
809
|
+
userId: String(f || (/* @__PURE__ */ new Date()).getTime())
|
|
810
|
+
}).toString()}`, ht = JSON.stringify({
|
|
810
811
|
flowId: "Q166PR519W",
|
|
811
812
|
flowAliasId: "HKFUVLWVH2",
|
|
812
813
|
input: {
|
|
813
814
|
loyaltyPoints: "",
|
|
814
|
-
productName:
|
|
815
|
-
productPoints: String(
|
|
815
|
+
productName: s,
|
|
816
|
+
productPoints: String(g || 0),
|
|
816
817
|
interests: m
|
|
817
818
|
}
|
|
818
|
-
}),
|
|
819
|
+
}), A = await fetch(ft, {
|
|
819
820
|
signal: AbortSignal.timeout(3e4),
|
|
820
821
|
method: "POST",
|
|
821
822
|
headers: {
|
|
822
823
|
"Content-Type": "application/json",
|
|
823
824
|
Authorization: `Bearer ${x}`
|
|
824
825
|
},
|
|
825
|
-
body:
|
|
826
|
+
body: ht
|
|
826
827
|
});
|
|
827
|
-
if (!
|
|
828
|
-
const
|
|
829
|
-
let
|
|
828
|
+
if (!A.body) throw new Error("Readable stream not supported");
|
|
829
|
+
const mt = A.body.getReader(), wt = new TextDecoder();
|
|
830
|
+
let j = "";
|
|
830
831
|
for (; ; ) {
|
|
831
|
-
const { done:
|
|
832
|
-
if (
|
|
833
|
-
|
|
834
|
-
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(`
|
|
835
836
|
`);
|
|
836
|
-
|
|
837
|
-
for (const
|
|
838
|
-
if (
|
|
839
|
-
const
|
|
837
|
+
j = H.pop() || "";
|
|
838
|
+
for (const J of H)
|
|
839
|
+
if (J.startsWith("data:")) {
|
|
840
|
+
const h = J.slice(5).trim();
|
|
840
841
|
try {
|
|
841
|
-
const
|
|
842
|
-
|
|
842
|
+
const V = JSON.parse(h);
|
|
843
|
+
V.index === 0 && b(
|
|
843
844
|
(F) => F.map(
|
|
844
|
-
(
|
|
845
|
-
...
|
|
846
|
-
secondaryResponse:
|
|
845
|
+
(O, W) => W === F.length - 1 ? {
|
|
846
|
+
...O,
|
|
847
|
+
secondaryResponse: V.data,
|
|
847
848
|
secondaryLoading: !1
|
|
848
|
-
} :
|
|
849
|
+
} : O
|
|
849
850
|
)
|
|
850
851
|
);
|
|
851
|
-
} catch (
|
|
852
|
-
|
|
852
|
+
} catch (V) {
|
|
853
|
+
b(
|
|
853
854
|
(F) => F.map(
|
|
854
|
-
(
|
|
855
|
+
(O, W) => W === F.length - 1 ? { ...O, secondaryLoading: !1 } : O
|
|
855
856
|
)
|
|
856
|
-
), console.error("Secondary flow JSON parse error:",
|
|
857
|
+
), console.error("Secondary flow JSON parse error:", V);
|
|
857
858
|
}
|
|
858
859
|
}
|
|
859
860
|
}
|
|
860
861
|
} catch (x) {
|
|
861
862
|
console.error("Secondary flow error:", x);
|
|
862
863
|
}
|
|
863
|
-
},
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
866
|
-
|
|
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) => [
|
|
867
868
|
...m,
|
|
868
869
|
{
|
|
869
|
-
query:
|
|
870
|
+
query: g,
|
|
870
871
|
response: "Thinking for what suits you best...",
|
|
871
872
|
potentialQuestions: "",
|
|
872
873
|
products: [],
|
|
@@ -874,52 +875,52 @@ const at = (t) => {
|
|
|
874
875
|
}
|
|
875
876
|
]);
|
|
876
877
|
try {
|
|
877
|
-
const m =
|
|
878
|
+
const m = dt, x = localStorage.getItem("customerNumber"), f = localStorage.getItem("isLoggedIn"), w = await p();
|
|
878
879
|
if (!w)
|
|
879
880
|
throw new Error("Failed to obtain access token");
|
|
880
|
-
const
|
|
881
|
-
registered: String(
|
|
881
|
+
const ft = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
882
|
+
registered: String(f || !1),
|
|
882
883
|
userId: String(x || (/* @__PURE__ */ new Date()).getTime())
|
|
883
|
-
}).toString()}`,
|
|
884
|
+
}).toString()}`, ht = JSON.stringify({
|
|
884
885
|
flowId: "MMHQKYI1NE",
|
|
885
886
|
flowAliasId: "SZF9ZK1ATE",
|
|
886
887
|
input: {
|
|
887
|
-
userPrompt:
|
|
888
|
+
userPrompt: g,
|
|
888
889
|
whom: m
|
|
889
890
|
}
|
|
890
|
-
}),
|
|
891
|
+
}), A = await fetch(ft, {
|
|
891
892
|
signal: AbortSignal.timeout(3e4),
|
|
892
893
|
method: "POST",
|
|
893
894
|
headers: {
|
|
894
895
|
"Content-Type": "application/json",
|
|
895
896
|
Authorization: `Bearer ${w}`
|
|
896
897
|
},
|
|
897
|
-
body:
|
|
898
|
+
body: ht
|
|
898
899
|
});
|
|
899
|
-
if (!
|
|
900
|
-
throw new Error(`HTTP error! status: ${
|
|
901
|
-
if (!
|
|
902
|
-
const
|
|
903
|
-
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 = "";
|
|
904
905
|
for (; ; ) {
|
|
905
|
-
|
|
906
|
-
const { done:
|
|
907
|
-
if (
|
|
908
|
-
|
|
909
|
-
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(`
|
|
910
911
|
`);
|
|
911
|
-
|
|
912
|
-
for (const
|
|
913
|
-
if (
|
|
914
|
-
const
|
|
912
|
+
j = J.pop() || "";
|
|
913
|
+
for (const h of J)
|
|
914
|
+
if (h.startsWith("data:")) {
|
|
915
|
+
const V = h.slice(5).trim();
|
|
915
916
|
try {
|
|
916
|
-
const F = JSON.parse(
|
|
917
|
-
F.index == 1 && (
|
|
918
|
-
(
|
|
919
|
-
(
|
|
920
|
-
...
|
|
917
|
+
const F = JSON.parse(V);
|
|
918
|
+
F.index == 1 && (D = F.data), b(
|
|
919
|
+
(O) => O.map(
|
|
920
|
+
(W, Lt) => Lt === O.length - 1 ? {
|
|
921
|
+
...W,
|
|
921
922
|
[F.index == 0 ? "response" : F.index == 1 ? "keywords" : F.index == 2 ? "potentialQuestions" : "end"]: F.data
|
|
922
|
-
} :
|
|
923
|
+
} : W
|
|
923
924
|
)
|
|
924
925
|
);
|
|
925
926
|
} catch (F) {
|
|
@@ -927,27 +928,27 @@ const at = (t) => {
|
|
|
927
928
|
}
|
|
928
929
|
}
|
|
929
930
|
}
|
|
930
|
-
rr(
|
|
931
|
+
or(rr(D));
|
|
931
932
|
} catch (m) {
|
|
932
933
|
console.error("Error sending message to Tanya:", m);
|
|
933
934
|
} finally {
|
|
934
|
-
|
|
935
|
+
_t(!1);
|
|
935
936
|
}
|
|
936
937
|
}
|
|
937
|
-
},
|
|
938
|
-
const
|
|
938
|
+
}, rr = (s) => {
|
|
939
|
+
const g = s.match(
|
|
939
940
|
/top five relevant product or category names are: (.*)/i
|
|
940
|
-
),
|
|
941
|
-
return [...new Set(
|
|
942
|
-
},
|
|
943
|
-
if (typeof
|
|
944
|
-
console.log(
|
|
945
|
-
const
|
|
946
|
-
for (const m of
|
|
947
|
-
const x = await
|
|
948
|
-
if (
|
|
949
|
-
(
|
|
950
|
-
(w,
|
|
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) => {
|
|
944
|
+
if (typeof s == "string") {
|
|
945
|
+
console.log(s, "keywords");
|
|
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 ? {
|
|
951
952
|
...w,
|
|
952
953
|
products: [
|
|
953
954
|
...w.products || [],
|
|
@@ -955,130 +956,132 @@ const at = (t) => {
|
|
|
955
956
|
]
|
|
956
957
|
} : w
|
|
957
958
|
)
|
|
958
|
-
), !
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
const w = typeof (
|
|
962
|
-
|
|
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;
|
|
963
964
|
}
|
|
964
965
|
}
|
|
965
966
|
} else
|
|
966
|
-
for (const
|
|
967
|
-
const m = await
|
|
968
|
-
|
|
967
|
+
for (const g of s) {
|
|
968
|
+
const m = await xe(g);
|
|
969
|
+
Z(!1), (m == null ? void 0 : m.length) > 0 && b(
|
|
969
970
|
(x) => x.map(
|
|
970
|
-
(
|
|
971
|
-
...
|
|
971
|
+
(f, w) => w === x.length - 1 ? {
|
|
972
|
+
...f,
|
|
972
973
|
products: [
|
|
973
|
-
...
|
|
974
|
-
{ keyword:
|
|
974
|
+
...f.products || [],
|
|
975
|
+
{ keyword: g, items: m, loading: !1 }
|
|
975
976
|
]
|
|
976
|
-
} :
|
|
977
|
+
} : f
|
|
977
978
|
)
|
|
978
979
|
);
|
|
979
980
|
}
|
|
980
|
-
if (
|
|
981
|
-
|
|
981
|
+
if (c.current) {
|
|
982
|
+
b(
|
|
982
983
|
(m) => m.map(
|
|
983
|
-
(x,
|
|
984
|
+
(x, f) => f === m.length - 1 ? {
|
|
984
985
|
...x,
|
|
985
986
|
productSnapshot: {
|
|
986
|
-
id:
|
|
987
|
-
name:
|
|
988
|
-
image:
|
|
989
|
-
price:
|
|
987
|
+
id: l.current,
|
|
988
|
+
name: c.current,
|
|
989
|
+
image: d.current,
|
|
990
|
+
price: i.current ?? null,
|
|
990
991
|
points: 0,
|
|
991
992
|
quantity: 1
|
|
992
993
|
}
|
|
993
994
|
} : x
|
|
994
995
|
)
|
|
995
996
|
);
|
|
996
|
-
const
|
|
997
|
+
const g = JSON.parse(
|
|
997
998
|
sessionStorage.getItem("customerData") || "{}"
|
|
998
999
|
);
|
|
999
|
-
(
|
|
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);
|
|
1000
1001
|
}
|
|
1001
|
-
|
|
1002
|
-
},
|
|
1003
|
-
var m, x,
|
|
1004
|
-
|
|
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);
|
|
1005
1006
|
try {
|
|
1006
|
-
const
|
|
1007
|
-
if (!((x = (m =
|
|
1008
|
-
|
|
1007
|
+
const h = await Ve(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", {
|
|
1009
1010
|
position: "bottom-right",
|
|
1010
1011
|
autoClose: 1e3
|
|
1011
1012
|
}), console.error("No product variant found");
|
|
1012
1013
|
return;
|
|
1013
1014
|
}
|
|
1014
|
-
const
|
|
1015
|
+
const V = [
|
|
1015
1016
|
{
|
|
1016
|
-
product_id: ((
|
|
1017
|
-
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
|
|
1018
1019
|
}
|
|
1019
1020
|
];
|
|
1020
|
-
console.log(
|
|
1021
|
+
console.log(V, "product data", "app version", Nt);
|
|
1021
1022
|
const F = JSON.parse(
|
|
1022
1023
|
sessionStorage.getItem("customerData") || "{}"
|
|
1023
|
-
),
|
|
1024
|
-
if (!
|
|
1025
|
-
const
|
|
1026
|
-
let { customer_token:
|
|
1027
|
-
|
|
1024
|
+
), O = (F == null ? void 0 : F.basketId) || localStorage.getItem(Rt), 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
|
|
1028
1029
|
);
|
|
1029
|
-
if (
|
|
1030
|
+
if (gt = "Bearer " + v.access_token, !gt) {
|
|
1030
1031
|
console.error("Failed to get customer_token");
|
|
1031
1032
|
return;
|
|
1032
1033
|
}
|
|
1033
|
-
const
|
|
1034
|
-
if (
|
|
1035
|
-
const
|
|
1036
|
-
basketId:
|
|
1037
|
-
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
|
|
1038
1039
|
});
|
|
1039
|
-
if (
|
|
1040
|
-
const Gt = await
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1040
|
+
if (ge.status === 200 && ge) {
|
|
1041
|
+
const Gt = await ne(
|
|
1042
|
+
O,
|
|
1043
|
+
V,
|
|
1044
|
+
gt
|
|
1044
1045
|
);
|
|
1045
|
-
((
|
|
1046
|
+
((ht = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : ht.length) > 0 && (B.success("Added to cart", {
|
|
1046
1047
|
position: "bottom-right",
|
|
1047
1048
|
autoClose: 3e3,
|
|
1048
1049
|
hideProgressBar: !1,
|
|
1049
1050
|
closeOnClick: !0,
|
|
1050
1051
|
pauseOnHover: !0,
|
|
1051
1052
|
draggable: !0
|
|
1052
|
-
}), Vt(
|
|
1053
|
+
}), Vt(O), U(!1));
|
|
1053
1054
|
return;
|
|
1054
1055
|
}
|
|
1055
1056
|
}
|
|
1056
|
-
const
|
|
1057
|
+
const sr = {
|
|
1057
1058
|
productItems: [
|
|
1058
1059
|
{
|
|
1059
|
-
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),
|
|
1060
1061
|
quantity: 1
|
|
1061
1062
|
}
|
|
1062
1063
|
]
|
|
1063
|
-
}, y = await
|
|
1064
|
+
}, y = await Re(gt, sr);
|
|
1064
1065
|
if (console.log(
|
|
1065
1066
|
y,
|
|
1066
1067
|
y == null ? void 0 : y.basket_id,
|
|
1067
1068
|
y == null ? void 0 : y.basketId,
|
|
1068
1069
|
"the basket response"
|
|
1069
1070
|
), !(y != null && y.basket_id || !(y != null && y.basketId))) {
|
|
1070
|
-
|
|
1071
|
+
U(!1), console.error("Failed to create basket");
|
|
1071
1072
|
return;
|
|
1072
1073
|
}
|
|
1073
|
-
|
|
1074
|
+
nt(
|
|
1074
1075
|
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId)
|
|
1075
1076
|
);
|
|
1076
|
-
const bt = await
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1077
|
+
const bt = await r(
|
|
1078
|
+
{
|
|
1079
|
+
productId: l,
|
|
1080
|
+
quantity: g
|
|
1081
|
+
},
|
|
1082
|
+
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId)
|
|
1080
1083
|
);
|
|
1081
|
-
(((
|
|
1084
|
+
(((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", {
|
|
1082
1085
|
position: "bottom-right",
|
|
1083
1086
|
autoClose: 3e3,
|
|
1084
1087
|
hideProgressBar: !1,
|
|
@@ -1087,23 +1090,23 @@ const at = (t) => {
|
|
|
1087
1090
|
draggable: !0
|
|
1088
1091
|
}), Vt(y.basket_id || (y == null ? void 0 : y.basketId));
|
|
1089
1092
|
}
|
|
1090
|
-
} catch (
|
|
1091
|
-
|
|
1093
|
+
} catch (h) {
|
|
1094
|
+
U(!1), console.error("Error adding to cart:", h), B.error("Failed to add product to cart", {
|
|
1092
1095
|
position: "bottom-right",
|
|
1093
1096
|
autoClose: 3e3
|
|
1094
|
-
}), ((
|
|
1095
|
-
((
|
|
1097
|
+
}), ((D = h == null ? void 0 : h.response) == null ? void 0 : D.status) === 404 || // Basket not found
|
|
1098
|
+
((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", {
|
|
1096
1099
|
position: "bottom-right",
|
|
1097
1100
|
autoClose: 3e3
|
|
1098
1101
|
}));
|
|
1099
1102
|
}
|
|
1100
|
-
|
|
1103
|
+
U(!1);
|
|
1101
1104
|
};
|
|
1102
|
-
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(
|
|
1105
|
+
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(vr, { open: C, onOpenChange: _, children: [
|
|
1103
1106
|
/* @__PURE__ */ a(
|
|
1104
|
-
|
|
1107
|
+
kr,
|
|
1105
1108
|
{
|
|
1106
|
-
onClick: () =>
|
|
1109
|
+
onClick: () => _(!0),
|
|
1107
1110
|
style: {
|
|
1108
1111
|
// background: storeDetails.tanyaThemeColor,
|
|
1109
1112
|
},
|
|
@@ -1163,12 +1166,12 @@ const at = (t) => {
|
|
|
1163
1166
|
) })
|
|
1164
1167
|
}
|
|
1165
1168
|
),
|
|
1166
|
-
|
|
1169
|
+
Q && /* @__PURE__ */ u(re, { children: [
|
|
1167
1170
|
/* @__PURE__ */ a(
|
|
1168
1171
|
"div",
|
|
1169
1172
|
{
|
|
1170
1173
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1171
|
-
onClick: () =>
|
|
1174
|
+
onClick: () => _(!1)
|
|
1172
1175
|
}
|
|
1173
1176
|
),
|
|
1174
1177
|
/* @__PURE__ */ u(
|
|
@@ -1179,9 +1182,9 @@ const at = (t) => {
|
|
|
1179
1182
|
top-0 right-0
|
|
1180
1183
|
transition-transform duration-300 ease-in-out
|
|
1181
1184
|
lg:transform
|
|
1182
|
-
${
|
|
1185
|
+
${I ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
1183
1186
|
// For mobile: animate from bottom
|
|
1184
|
-
${
|
|
1187
|
+
${I ? "translate-y-0" : "translate-y-full"}
|
|
1185
1188
|
lg:translate-y-0
|
|
1186
1189
|
`,
|
|
1187
1190
|
style: {
|
|
@@ -1198,7 +1201,7 @@ const at = (t) => {
|
|
|
1198
1201
|
{
|
|
1199
1202
|
style: {
|
|
1200
1203
|
display: "flex",
|
|
1201
|
-
color:
|
|
1204
|
+
color: S.tanyaThemeContrastColor,
|
|
1202
1205
|
alignItems: "center",
|
|
1203
1206
|
gap: "0.5rem"
|
|
1204
1207
|
},
|
|
@@ -1259,7 +1262,7 @@ const at = (t) => {
|
|
|
1259
1262
|
gap: "1.25rem",
|
|
1260
1263
|
margin: "0.75rem"
|
|
1261
1264
|
},
|
|
1262
|
-
children: /* @__PURE__ */ a("button", { onClick: () =>
|
|
1265
|
+
children: /* @__PURE__ */ a("button", { onClick: () => _(!1), children: /* @__PURE__ */ u(
|
|
1263
1266
|
"svg",
|
|
1264
1267
|
{
|
|
1265
1268
|
width: "24",
|
|
@@ -1311,46 +1314,46 @@ const at = (t) => {
|
|
|
1311
1314
|
/* @__PURE__ */ u(
|
|
1312
1315
|
"div",
|
|
1313
1316
|
{
|
|
1314
|
-
className: `flex flex-col h-full ${
|
|
1317
|
+
className: `flex flex-col h-full ${Jt ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1315
1318
|
children: [
|
|
1316
1319
|
/* @__PURE__ */ u(
|
|
1317
1320
|
"div",
|
|
1318
1321
|
{
|
|
1319
|
-
ref:
|
|
1322
|
+
ref: et,
|
|
1320
1323
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
1321
1324
|
children: [
|
|
1322
|
-
(
|
|
1325
|
+
(S == null ? void 0 : S.whomRequired) && /* @__PURE__ */ u(
|
|
1323
1326
|
"div",
|
|
1324
1327
|
{
|
|
1325
1328
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
1326
1329
|
children: [
|
|
1327
1330
|
/* @__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?" }) }),
|
|
1328
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children:
|
|
1331
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: o.map((s) => /* @__PURE__ */ a(
|
|
1329
1332
|
"button",
|
|
1330
1333
|
{
|
|
1331
|
-
onClick: () =>
|
|
1334
|
+
onClick: () => q(s),
|
|
1332
1335
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1333
1336
|
style: {
|
|
1334
|
-
backgroundColor:
|
|
1335
|
-
borderColor:
|
|
1337
|
+
backgroundColor: dt === n[s] ? "#FFFFFF" : "#F3F3F3",
|
|
1338
|
+
borderColor: dt === n[s] ? "#BBB3DD" : ""
|
|
1336
1339
|
},
|
|
1337
|
-
children:
|
|
1340
|
+
children: s
|
|
1338
1341
|
},
|
|
1339
|
-
|
|
1342
|
+
s
|
|
1340
1343
|
)) })
|
|
1341
1344
|
]
|
|
1342
1345
|
}
|
|
1343
1346
|
),
|
|
1344
|
-
|
|
1347
|
+
tt.map((s, g) => {
|
|
1345
1348
|
var m, x;
|
|
1346
1349
|
return /* @__PURE__ */ u("div", { children: [
|
|
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:
|
|
1348
|
-
|
|
1350
|
+
/* @__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 }) }),
|
|
1351
|
+
s.response && s.response.includes("Thinking") ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
1349
1352
|
"div",
|
|
1350
1353
|
{
|
|
1351
1354
|
className: "font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
1352
1355
|
dangerouslySetInnerHTML: {
|
|
1353
|
-
__html: Xt(
|
|
1356
|
+
__html: Xt(s.response)
|
|
1354
1357
|
}
|
|
1355
1358
|
}
|
|
1356
1359
|
) }) : /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
@@ -1358,41 +1361,41 @@ const at = (t) => {
|
|
|
1358
1361
|
{
|
|
1359
1362
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
1360
1363
|
dangerouslySetInnerHTML: {
|
|
1361
|
-
__html: Xt(
|
|
1364
|
+
__html: Xt(s.response)
|
|
1362
1365
|
}
|
|
1363
1366
|
}
|
|
1364
1367
|
) }),
|
|
1365
|
-
|
|
1366
|
-
(
|
|
1367
|
-
|
|
1368
|
+
$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" }) }),
|
|
1369
|
+
(s == null ? void 0 : s.products) && ((x = s == null ? void 0 : s.products) == null ? void 0 : x.length) > 0 && /* @__PURE__ */ a(
|
|
1370
|
+
Nr,
|
|
1368
1371
|
{
|
|
1369
|
-
chat:
|
|
1370
|
-
storeDetails:
|
|
1372
|
+
chat: s.products,
|
|
1373
|
+
storeDetails: S
|
|
1371
1374
|
}
|
|
1372
1375
|
),
|
|
1373
|
-
|
|
1376
|
+
s.potentialQuestions.length > 0 && /* @__PURE__ */ u("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
1374
1377
|
/* @__PURE__ */ a(
|
|
1375
1378
|
"p",
|
|
1376
1379
|
{
|
|
1377
1380
|
className: "font-nunitoSans font-bold text-sm text-[#494949]",
|
|
1378
|
-
style: { color:
|
|
1381
|
+
style: { color: S.themeDarkColor },
|
|
1379
1382
|
children: "Why not explore these inquiries..."
|
|
1380
1383
|
}
|
|
1381
1384
|
),
|
|
1382
|
-
|
|
1385
|
+
s.potentialQuestions.split(",").map((f, w) => /* @__PURE__ */ a(
|
|
1383
1386
|
"button",
|
|
1384
1387
|
{
|
|
1385
|
-
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${
|
|
1386
|
-
onClick: () =>
|
|
1388
|
+
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${S.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
1389
|
+
onClick: () => Wt(f),
|
|
1387
1390
|
style: {
|
|
1388
|
-
backgroundColor:
|
|
1391
|
+
backgroundColor: S.tanyaThemeColorLight
|
|
1389
1392
|
},
|
|
1390
|
-
children:
|
|
1393
|
+
children: f
|
|
1391
1394
|
},
|
|
1392
1395
|
w
|
|
1393
1396
|
))
|
|
1394
1397
|
] }),
|
|
1395
|
-
|
|
1398
|
+
s.secondaryLoading && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ u(
|
|
1396
1399
|
"div",
|
|
1397
1400
|
{
|
|
1398
1401
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -1410,7 +1413,7 @@ const at = (t) => {
|
|
|
1410
1413
|
"p",
|
|
1411
1414
|
{
|
|
1412
1415
|
className: "font-semibold tanya-pulse",
|
|
1413
|
-
style: { color:
|
|
1416
|
+
style: { color: S.themeDarkColor },
|
|
1414
1417
|
children: "I’ve found a special surprise crafted just for you… hang on a sec!"
|
|
1415
1418
|
}
|
|
1416
1419
|
),
|
|
@@ -1418,35 +1421,35 @@ const at = (t) => {
|
|
|
1418
1421
|
"p",
|
|
1419
1422
|
{
|
|
1420
1423
|
className: "tanya-dots mt-1",
|
|
1421
|
-
style: { color:
|
|
1424
|
+
style: { color: S.themeDarkColor },
|
|
1422
1425
|
children: "• • •"
|
|
1423
1426
|
}
|
|
1424
1427
|
)
|
|
1425
1428
|
]
|
|
1426
1429
|
}
|
|
1427
1430
|
) }),
|
|
1428
|
-
|
|
1431
|
+
s.secondaryResponse && /* @__PURE__ */ a(re, { children: /* @__PURE__ */ u("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
1429
1432
|
/* @__PURE__ */ a(
|
|
1430
1433
|
"div",
|
|
1431
1434
|
{
|
|
1432
1435
|
className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
|
|
1433
1436
|
style: {
|
|
1434
|
-
backgroundColor:
|
|
1437
|
+
backgroundColor: S.tanyaThemeColorLight
|
|
1435
1438
|
},
|
|
1436
1439
|
dangerouslySetInnerHTML: {
|
|
1437
1440
|
__html: Xt(
|
|
1438
|
-
|
|
1441
|
+
s.secondaryResponse
|
|
1439
1442
|
)
|
|
1440
1443
|
}
|
|
1441
1444
|
}
|
|
1442
1445
|
),
|
|
1443
|
-
|
|
1446
|
+
s.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
1444
1447
|
/* @__PURE__ */ a("div", { className: "mt-4 w-full", children: /* @__PURE__ */ u(
|
|
1445
1448
|
"div",
|
|
1446
1449
|
{
|
|
1447
1450
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
1448
1451
|
style: {
|
|
1449
|
-
backgroundColor:
|
|
1452
|
+
backgroundColor: S.tanyaThemeColorLight
|
|
1450
1453
|
},
|
|
1451
1454
|
children: [
|
|
1452
1455
|
/* @__PURE__ */ a(
|
|
@@ -1458,11 +1461,11 @@ const at = (t) => {
|
|
|
1458
1461
|
height: 112,
|
|
1459
1462
|
borderColor: "#eee"
|
|
1460
1463
|
},
|
|
1461
|
-
children:
|
|
1464
|
+
children: s.productSnapshot.image ? /* @__PURE__ */ a(
|
|
1462
1465
|
"img",
|
|
1463
1466
|
{
|
|
1464
|
-
src:
|
|
1465
|
-
alt:
|
|
1467
|
+
src: s.productSnapshot.image,
|
|
1468
|
+
alt: s.productSnapshot.name,
|
|
1466
1469
|
className: "w-full h-full object-cover"
|
|
1467
1470
|
}
|
|
1468
1471
|
) : /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
@@ -1470,18 +1473,18 @@ const at = (t) => {
|
|
|
1470
1473
|
),
|
|
1471
1474
|
/* @__PURE__ */ u("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
1472
1475
|
/* @__PURE__ */ u("div", { children: [
|
|
1473
|
-
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children:
|
|
1474
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children:
|
|
1476
|
+
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: s.productSnapshot.name }),
|
|
1477
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: s.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1475
1478
|
style: "currency",
|
|
1476
|
-
currency: (
|
|
1479
|
+
currency: (S == null ? void 0 : S.currency) || "USD"
|
|
1477
1480
|
}).format(
|
|
1478
|
-
|
|
1481
|
+
s.productSnapshot.price
|
|
1479
1482
|
) : "" }),
|
|
1480
|
-
|
|
1483
|
+
s.productSnapshot.points > 0 && /* @__PURE__ */ u("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
1481
1484
|
"You will earn",
|
|
1482
1485
|
" ",
|
|
1483
1486
|
/* @__PURE__ */ u("strong", { children: [
|
|
1484
|
-
|
|
1487
|
+
s.productSnapshot.points,
|
|
1485
1488
|
" ",
|
|
1486
1489
|
"points"
|
|
1487
1490
|
] })
|
|
@@ -1493,9 +1496,9 @@ const at = (t) => {
|
|
|
1493
1496
|
"button",
|
|
1494
1497
|
{
|
|
1495
1498
|
className: "px-3 py-1 text-sm",
|
|
1496
|
-
onClick: () =>
|
|
1497
|
-
(
|
|
1498
|
-
(w,
|
|
1499
|
+
onClick: () => b(
|
|
1500
|
+
(f) => f.map(
|
|
1501
|
+
(w, $) => $ === g && w.productSnapshot ? {
|
|
1499
1502
|
...w,
|
|
1500
1503
|
productSnapshot: {
|
|
1501
1504
|
...w.productSnapshot,
|
|
@@ -1509,19 +1512,19 @@ const at = (t) => {
|
|
|
1509
1512
|
),
|
|
1510
1513
|
style: {
|
|
1511
1514
|
background: "transparent",
|
|
1512
|
-
color:
|
|
1515
|
+
color: S.themeDarkColor
|
|
1513
1516
|
},
|
|
1514
1517
|
children: "−"
|
|
1515
1518
|
}
|
|
1516
1519
|
),
|
|
1517
|
-
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children:
|
|
1520
|
+
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children: s.productSnapshot.quantity }),
|
|
1518
1521
|
/* @__PURE__ */ a(
|
|
1519
1522
|
"button",
|
|
1520
1523
|
{
|
|
1521
1524
|
className: "px-3 py-1 text-sm",
|
|
1522
|
-
onClick: () =>
|
|
1523
|
-
(
|
|
1524
|
-
(w,
|
|
1525
|
+
onClick: () => b(
|
|
1526
|
+
(f) => f.map(
|
|
1527
|
+
(w, $) => $ === g && w.productSnapshot ? {
|
|
1525
1528
|
...w,
|
|
1526
1529
|
productSnapshot: {
|
|
1527
1530
|
...w.productSnapshot,
|
|
@@ -1532,7 +1535,7 @@ const at = (t) => {
|
|
|
1532
1535
|
),
|
|
1533
1536
|
style: {
|
|
1534
1537
|
background: "transparent",
|
|
1535
|
-
color:
|
|
1538
|
+
color: S.themeDarkColor
|
|
1536
1539
|
},
|
|
1537
1540
|
children: "+"
|
|
1538
1541
|
}
|
|
@@ -1542,21 +1545,21 @@ const at = (t) => {
|
|
|
1542
1545
|
"button",
|
|
1543
1546
|
{
|
|
1544
1547
|
onClick: () => {
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
+
nr(
|
|
1549
|
+
At(
|
|
1550
|
+
s.productSnapshot
|
|
1548
1551
|
),
|
|
1549
|
-
|
|
1552
|
+
s.productSnapshot.quantity
|
|
1550
1553
|
);
|
|
1551
1554
|
},
|
|
1552
|
-
disabled:
|
|
1555
|
+
disabled: lt,
|
|
1553
1556
|
className: "px-4 py-2 rounded-full font-medium",
|
|
1554
1557
|
style: {
|
|
1555
|
-
background:
|
|
1556
|
-
color: (
|
|
1557
|
-
opacity:
|
|
1558
|
+
background: S.tanyaThemeColor,
|
|
1559
|
+
color: (S == null ? void 0 : S.tanyaThemeContrastColor) || "#fff",
|
|
1560
|
+
opacity: lt ? 0.8 : 1
|
|
1558
1561
|
},
|
|
1559
|
-
children:
|
|
1562
|
+
children: lt ? "Adding..." : "Add to cart"
|
|
1560
1563
|
}
|
|
1561
1564
|
)
|
|
1562
1565
|
] })
|
|
@@ -1566,7 +1569,7 @@ const at = (t) => {
|
|
|
1566
1569
|
) })
|
|
1567
1570
|
] }) }),
|
|
1568
1571
|
/* @__PURE__ */ a("div", { className: "mb-20" })
|
|
1569
|
-
] },
|
|
1572
|
+
] }, g);
|
|
1570
1573
|
})
|
|
1571
1574
|
]
|
|
1572
1575
|
}
|
|
@@ -1584,11 +1587,11 @@ const at = (t) => {
|
|
|
1584
1587
|
{
|
|
1585
1588
|
className: "flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",
|
|
1586
1589
|
placeholder: "How can I help you...",
|
|
1587
|
-
value:
|
|
1590
|
+
value: Ct,
|
|
1588
1591
|
autoFocus: !0,
|
|
1589
|
-
onChange: (
|
|
1590
|
-
onKeyDown: (
|
|
1591
|
-
|
|
1592
|
+
onChange: (s) => It(s.target.value),
|
|
1593
|
+
onKeyDown: (s) => {
|
|
1594
|
+
s.key === "Enter" && !ct && Wt();
|
|
1592
1595
|
}
|
|
1593
1596
|
}
|
|
1594
1597
|
),
|
|
@@ -1596,16 +1599,16 @@ const at = (t) => {
|
|
|
1596
1599
|
"button",
|
|
1597
1600
|
{
|
|
1598
1601
|
type: "submit",
|
|
1599
|
-
disabled:
|
|
1602
|
+
disabled: ct,
|
|
1600
1603
|
className: "p-3",
|
|
1601
|
-
onClick: () =>
|
|
1602
|
-
children:
|
|
1604
|
+
onClick: () => Wt(),
|
|
1605
|
+
children: ct ? /* @__PURE__ */ a(
|
|
1603
1606
|
"div",
|
|
1604
1607
|
{
|
|
1605
1608
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
1606
1609
|
style: {
|
|
1607
1610
|
borderBottom: "2px solid",
|
|
1608
|
-
color:
|
|
1611
|
+
color: S.tanyaThemeColor
|
|
1609
1612
|
}
|
|
1610
1613
|
}
|
|
1611
1614
|
) : /* @__PURE__ */ a(
|
|
@@ -1633,7 +1636,7 @@ const at = (t) => {
|
|
|
1633
1636
|
]
|
|
1634
1637
|
}
|
|
1635
1638
|
),
|
|
1636
|
-
/* @__PURE__ */ a(
|
|
1639
|
+
/* @__PURE__ */ a(Tr, {})
|
|
1637
1640
|
] })
|
|
1638
1641
|
]
|
|
1639
1642
|
}
|
|
@@ -1641,32 +1644,32 @@ const at = (t) => {
|
|
|
1641
1644
|
] })
|
|
1642
1645
|
] }) });
|
|
1643
1646
|
};
|
|
1644
|
-
var
|
|
1645
|
-
return
|
|
1647
|
+
var ae = function(t, e) {
|
|
1648
|
+
return ae = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, o) {
|
|
1646
1649
|
r.__proto__ = o;
|
|
1647
1650
|
} || function(r, o) {
|
|
1648
1651
|
for (var n in o) Object.prototype.hasOwnProperty.call(o, n) && (r[n] = o[n]);
|
|
1649
|
-
},
|
|
1652
|
+
}, ae(t, e);
|
|
1650
1653
|
};
|
|
1651
|
-
function
|
|
1654
|
+
function Pr(t, e) {
|
|
1652
1655
|
if (typeof e != "function" && e !== null)
|
|
1653
1656
|
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
1654
|
-
|
|
1657
|
+
ae(t, e);
|
|
1655
1658
|
function r() {
|
|
1656
1659
|
this.constructor = t;
|
|
1657
1660
|
}
|
|
1658
1661
|
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
1659
1662
|
}
|
|
1660
|
-
var
|
|
1661
|
-
return
|
|
1663
|
+
var G = function() {
|
|
1664
|
+
return G = Object.assign || function(e) {
|
|
1662
1665
|
for (var r, o = 1, n = arguments.length; o < n; o++) {
|
|
1663
1666
|
r = arguments[o];
|
|
1664
1667
|
for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (e[c] = r[c]);
|
|
1665
1668
|
}
|
|
1666
1669
|
return e;
|
|
1667
|
-
},
|
|
1670
|
+
}, G.apply(this, arguments);
|
|
1668
1671
|
};
|
|
1669
|
-
function
|
|
1672
|
+
function $r(t, e) {
|
|
1670
1673
|
var r = {};
|
|
1671
1674
|
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (r[o] = t[o]);
|
|
1672
1675
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -1674,28 +1677,28 @@ function Pr(t, e) {
|
|
|
1674
1677
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1675
1678
|
return r;
|
|
1676
1679
|
}
|
|
1677
|
-
var Qt = "Invariant Violation",
|
|
1680
|
+
var Qt = "Invariant Violation", Ie = Object.setPrototypeOf, zr = Ie === void 0 ? function(t, e) {
|
|
1678
1681
|
return t.__proto__ = e, t;
|
|
1679
|
-
} :
|
|
1682
|
+
} : Ie, Ke = (
|
|
1680
1683
|
/** @class */
|
|
1681
1684
|
(function(t) {
|
|
1682
|
-
|
|
1685
|
+
Pr(e, t);
|
|
1683
1686
|
function e(r) {
|
|
1684
1687
|
r === void 0 && (r = Qt);
|
|
1685
1688
|
var o = t.call(this, typeof r == "number" ? Qt + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
|
|
1686
|
-
return o.framesToPop = 1, o.name = Qt,
|
|
1689
|
+
return o.framesToPop = 1, o.name = Qt, zr(o, e.prototype), o;
|
|
1687
1690
|
}
|
|
1688
1691
|
return e;
|
|
1689
1692
|
})(Error)
|
|
1690
1693
|
);
|
|
1691
|
-
function
|
|
1694
|
+
function ot(t, e) {
|
|
1692
1695
|
if (!t)
|
|
1693
|
-
throw new
|
|
1696
|
+
throw new Ke(e);
|
|
1694
1697
|
}
|
|
1695
|
-
var
|
|
1698
|
+
var Je = ["debug", "log", "warn", "error", "silent"], Ar = Je.indexOf("log");
|
|
1696
1699
|
function Bt(t) {
|
|
1697
1700
|
return function() {
|
|
1698
|
-
if (
|
|
1701
|
+
if (Je.indexOf(t) >= Ar) {
|
|
1699
1702
|
var e = console[t] || console.log;
|
|
1700
1703
|
return e.apply(console, arguments);
|
|
1701
1704
|
}
|
|
@@ -1703,15 +1706,15 @@ function Bt(t) {
|
|
|
1703
1706
|
}
|
|
1704
1707
|
(function(t) {
|
|
1705
1708
|
t.debug = Bt("debug"), t.log = Bt("log"), t.warn = Bt("warn"), t.error = Bt("error");
|
|
1706
|
-
})(
|
|
1707
|
-
var
|
|
1709
|
+
})(ot || (ot = {}));
|
|
1710
|
+
var We = "3.14.0";
|
|
1708
1711
|
function xt(t) {
|
|
1709
1712
|
try {
|
|
1710
1713
|
return t();
|
|
1711
1714
|
} catch {
|
|
1712
1715
|
}
|
|
1713
1716
|
}
|
|
1714
|
-
const
|
|
1717
|
+
const ie = xt(function() {
|
|
1715
1718
|
return globalThis;
|
|
1716
1719
|
}) || xt(function() {
|
|
1717
1720
|
return window;
|
|
@@ -1728,13 +1731,13 @@ const ae = xt(function() {
|
|
|
1728
1731
|
xt(function() {
|
|
1729
1732
|
return xt.constructor("return this")();
|
|
1730
1733
|
});
|
|
1731
|
-
var
|
|
1732
|
-
function
|
|
1733
|
-
var e =
|
|
1734
|
-
return
|
|
1734
|
+
var Fe = /* @__PURE__ */ new Map();
|
|
1735
|
+
function jr(t) {
|
|
1736
|
+
var e = Fe.get(t) || 1;
|
|
1737
|
+
return Fe.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
1735
1738
|
}
|
|
1736
|
-
function
|
|
1737
|
-
var r =
|
|
1739
|
+
function Dr(t, e) {
|
|
1740
|
+
var r = jr("stringifyForDisplay");
|
|
1738
1741
|
return JSON.stringify(t, function(o, n) {
|
|
1739
1742
|
return n === void 0 ? r : n;
|
|
1740
1743
|
}, e).split(JSON.stringify(r)).join("<undefined>");
|
|
@@ -1745,7 +1748,7 @@ function Ut(t) {
|
|
|
1745
1748
|
r[o - 1] = arguments[o];
|
|
1746
1749
|
if (typeof e == "number") {
|
|
1747
1750
|
var n = e;
|
|
1748
|
-
e =
|
|
1751
|
+
e = ce(n), e || (e = de(n, r), r = []);
|
|
1749
1752
|
}
|
|
1750
1753
|
t.apply(void 0, [e].concat(r));
|
|
1751
1754
|
};
|
|
@@ -1753,41 +1756,41 @@ function Ut(t) {
|
|
|
1753
1756
|
var Zt = Object.assign(function(e, r) {
|
|
1754
1757
|
for (var o = [], n = 2; n < arguments.length; n++)
|
|
1755
1758
|
o[n - 2] = arguments[n];
|
|
1756
|
-
e ||
|
|
1759
|
+
e || ot(e, ce(r, o) || de(r, o));
|
|
1757
1760
|
}, {
|
|
1758
|
-
debug: Ut(
|
|
1759
|
-
log: Ut(
|
|
1760
|
-
warn: Ut(
|
|
1761
|
-
error: Ut(
|
|
1761
|
+
debug: Ut(ot.debug),
|
|
1762
|
+
log: Ut(ot.log),
|
|
1763
|
+
warn: Ut(ot.warn),
|
|
1764
|
+
error: Ut(ot.error)
|
|
1762
1765
|
});
|
|
1763
|
-
function
|
|
1766
|
+
function Ge(t) {
|
|
1764
1767
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
1765
1768
|
e[r - 1] = arguments[r];
|
|
1766
|
-
return new
|
|
1769
|
+
return new Ke(ce(t, e) || de(t, e));
|
|
1767
1770
|
}
|
|
1768
|
-
var
|
|
1769
|
-
function
|
|
1771
|
+
var Ne = Symbol.for("ApolloErrorMessageHandler_" + We);
|
|
1772
|
+
function Xe(t) {
|
|
1770
1773
|
if (typeof t == "string")
|
|
1771
1774
|
return t;
|
|
1772
1775
|
try {
|
|
1773
|
-
return
|
|
1776
|
+
return Dr(t, 2).slice(0, 1e3);
|
|
1774
1777
|
} catch {
|
|
1775
1778
|
return "<non-serializable>";
|
|
1776
1779
|
}
|
|
1777
1780
|
}
|
|
1778
|
-
function
|
|
1781
|
+
function ce(t, e) {
|
|
1779
1782
|
if (e === void 0 && (e = []), !!t)
|
|
1780
|
-
return
|
|
1783
|
+
return ie[Ne] && ie[Ne](t, e.map(Xe));
|
|
1781
1784
|
}
|
|
1782
|
-
function
|
|
1785
|
+
function de(t, e) {
|
|
1783
1786
|
if (e === void 0 && (e = []), !!t)
|
|
1784
1787
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
1785
|
-
version:
|
|
1788
|
+
version: We,
|
|
1786
1789
|
message: t,
|
|
1787
|
-
args: e.map(
|
|
1790
|
+
args: e.map(Xe)
|
|
1788
1791
|
})));
|
|
1789
1792
|
}
|
|
1790
|
-
function
|
|
1793
|
+
function Lr(t) {
|
|
1791
1794
|
return t.definitions.filter(function(e) {
|
|
1792
1795
|
return e.kind === "OperationDefinition" && !!e.name;
|
|
1793
1796
|
}).map(function(e) {
|
|
@@ -1795,13 +1798,13 @@ function Dr(t) {
|
|
|
1795
1798
|
})[0] || null;
|
|
1796
1799
|
}
|
|
1797
1800
|
let N = null;
|
|
1798
|
-
const
|
|
1799
|
-
let
|
|
1800
|
-
const
|
|
1801
|
+
const Ee = {};
|
|
1802
|
+
let Br = 1;
|
|
1803
|
+
const Ur = () => class {
|
|
1801
1804
|
constructor() {
|
|
1802
1805
|
this.id = [
|
|
1803
1806
|
"slot",
|
|
1804
|
-
|
|
1807
|
+
Br++,
|
|
1805
1808
|
Date.now(),
|
|
1806
1809
|
Math.random().toString(36).slice(2)
|
|
1807
1810
|
].join(":");
|
|
@@ -1810,11 +1813,11 @@ const Br = () => class {
|
|
|
1810
1813
|
for (let e = N; e; e = e.parent)
|
|
1811
1814
|
if (this.id in e.slots) {
|
|
1812
1815
|
const r = e.slots[this.id];
|
|
1813
|
-
if (r ===
|
|
1816
|
+
if (r === Ee)
|
|
1814
1817
|
break;
|
|
1815
1818
|
return e !== N && (N.slots[this.id] = r), !0;
|
|
1816
1819
|
}
|
|
1817
|
-
return N && (N.slots[this.id] =
|
|
1820
|
+
return N && (N.slots[this.id] = Ee), !1;
|
|
1818
1821
|
}
|
|
1819
1822
|
getValue() {
|
|
1820
1823
|
if (this.hasValue())
|
|
@@ -1858,27 +1861,27 @@ const Br = () => class {
|
|
|
1858
1861
|
return e.apply(o, r);
|
|
1859
1862
|
}
|
|
1860
1863
|
};
|
|
1861
|
-
function
|
|
1864
|
+
function Te(t) {
|
|
1862
1865
|
try {
|
|
1863
1866
|
return t();
|
|
1864
1867
|
} catch {
|
|
1865
1868
|
}
|
|
1866
1869
|
}
|
|
1867
|
-
const te = "@wry/context:Slot",
|
|
1870
|
+
const te = "@wry/context:Slot", qr = (
|
|
1868
1871
|
// Prefer globalThis when available.
|
|
1869
1872
|
// https://github.com/benjamn/wryware/issues/347
|
|
1870
|
-
|
|
1873
|
+
Te(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
1871
1874
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
1872
1875
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
1873
|
-
|
|
1876
|
+
Te(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
1874
1877
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1875
1878
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1876
1879
|
/* @__PURE__ */ Object.create(null)
|
|
1877
|
-
),
|
|
1880
|
+
), Oe = qr, ue = Oe[te] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1878
1881
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1879
1882
|
Array[te] || (function(t) {
|
|
1880
1883
|
try {
|
|
1881
|
-
Object.defineProperty(
|
|
1884
|
+
Object.defineProperty(Oe, te, {
|
|
1882
1885
|
value: t,
|
|
1883
1886
|
enumerable: !1,
|
|
1884
1887
|
writable: !1,
|
|
@@ -1893,12 +1896,12 @@ Array[te] || (function(t) {
|
|
|
1893
1896
|
} finally {
|
|
1894
1897
|
return t;
|
|
1895
1898
|
}
|
|
1896
|
-
})(
|
|
1897
|
-
new
|
|
1898
|
-
function
|
|
1899
|
+
})(Ur()), { bind: Co, noContext: Io } = ue;
|
|
1900
|
+
new ue();
|
|
1901
|
+
function Mr(t, e) {
|
|
1899
1902
|
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
1900
1903
|
if (r) return (r = r.call(t)).next.bind(r);
|
|
1901
|
-
if (Array.isArray(t) || (r =
|
|
1904
|
+
if (Array.isArray(t) || (r = Hr(t)) || e) {
|
|
1902
1905
|
r && (t = r);
|
|
1903
1906
|
var o = 0;
|
|
1904
1907
|
return function() {
|
|
@@ -1908,50 +1911,50 @@ function qr(t, e) {
|
|
|
1908
1911
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1909
1912
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1910
1913
|
}
|
|
1911
|
-
function
|
|
1914
|
+
function Hr(t, e) {
|
|
1912
1915
|
if (t) {
|
|
1913
|
-
if (typeof t == "string") return
|
|
1916
|
+
if (typeof t == "string") return Pe(t, e);
|
|
1914
1917
|
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
1915
1918
|
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
|
|
1916
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
1919
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Pe(t, e);
|
|
1917
1920
|
}
|
|
1918
1921
|
}
|
|
1919
|
-
function
|
|
1922
|
+
function Pe(t, e) {
|
|
1920
1923
|
(e == null || e > t.length) && (e = t.length);
|
|
1921
1924
|
for (var r = 0, o = new Array(e); r < e; r++)
|
|
1922
1925
|
o[r] = t[r];
|
|
1923
1926
|
return o;
|
|
1924
1927
|
}
|
|
1925
|
-
function
|
|
1928
|
+
function $e(t, e) {
|
|
1926
1929
|
for (var r = 0; r < e.length; r++) {
|
|
1927
1930
|
var o = e[r];
|
|
1928
1931
|
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
|
|
1929
1932
|
}
|
|
1930
1933
|
}
|
|
1931
|
-
function
|
|
1932
|
-
return e &&
|
|
1934
|
+
function pe(t, e, r) {
|
|
1935
|
+
return e && $e(t.prototype, e), r && $e(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
1933
1936
|
}
|
|
1934
|
-
var
|
|
1937
|
+
var fe = function() {
|
|
1935
1938
|
return typeof Symbol == "function";
|
|
1936
|
-
}, fe = function(t) {
|
|
1937
|
-
return pe() && !!Symbol[t];
|
|
1938
1939
|
}, he = function(t) {
|
|
1939
|
-
return fe(
|
|
1940
|
+
return fe() && !!Symbol[t];
|
|
1941
|
+
}, me = function(t) {
|
|
1942
|
+
return he(t) ? Symbol[t] : "@@" + t;
|
|
1940
1943
|
};
|
|
1941
|
-
|
|
1942
|
-
var
|
|
1943
|
-
function
|
|
1944
|
+
fe() && !he("observable") && (Symbol.observable = Symbol("observable"));
|
|
1945
|
+
var Vr = me("iterator"), se = me("observable"), Qe = me("species");
|
|
1946
|
+
function Kt(t, e) {
|
|
1944
1947
|
var r = t[e];
|
|
1945
1948
|
if (r != null) {
|
|
1946
1949
|
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
1947
1950
|
return r;
|
|
1948
1951
|
}
|
|
1949
1952
|
}
|
|
1950
|
-
function
|
|
1953
|
+
function Et(t) {
|
|
1951
1954
|
var e = t.constructor;
|
|
1952
|
-
return e !== void 0 && (e = e[
|
|
1955
|
+
return e !== void 0 && (e = e[Qe], e === null && (e = void 0)), e !== void 0 ? e : E;
|
|
1953
1956
|
}
|
|
1954
|
-
function
|
|
1957
|
+
function Rr(t) {
|
|
1955
1958
|
return t instanceof E;
|
|
1956
1959
|
}
|
|
1957
1960
|
function vt(t) {
|
|
@@ -1968,52 +1971,52 @@ function Mt(t) {
|
|
|
1968
1971
|
}
|
|
1969
1972
|
});
|
|
1970
1973
|
}
|
|
1971
|
-
function
|
|
1974
|
+
function Ze(t) {
|
|
1972
1975
|
var e = t._cleanup;
|
|
1973
1976
|
if (e !== void 0 && (t._cleanup = void 0, !!e))
|
|
1974
1977
|
try {
|
|
1975
1978
|
if (typeof e == "function")
|
|
1976
1979
|
e();
|
|
1977
1980
|
else {
|
|
1978
|
-
var r =
|
|
1981
|
+
var r = Kt(e, "unsubscribe");
|
|
1979
1982
|
r && r.call(e);
|
|
1980
1983
|
}
|
|
1981
1984
|
} catch (o) {
|
|
1982
1985
|
vt(o);
|
|
1983
1986
|
}
|
|
1984
1987
|
}
|
|
1985
|
-
function
|
|
1988
|
+
function le(t) {
|
|
1986
1989
|
t._observer = void 0, t._queue = void 0, t._state = "closed";
|
|
1987
1990
|
}
|
|
1988
|
-
function
|
|
1991
|
+
function Yr(t) {
|
|
1989
1992
|
var e = t._queue;
|
|
1990
1993
|
if (e) {
|
|
1991
1994
|
t._queue = void 0, t._state = "ready";
|
|
1992
|
-
for (var r = 0; r < e.length && (
|
|
1995
|
+
for (var r = 0; r < e.length && (tr(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
|
|
1993
1996
|
;
|
|
1994
1997
|
}
|
|
1995
1998
|
}
|
|
1996
|
-
function
|
|
1999
|
+
function tr(t, e, r) {
|
|
1997
2000
|
t._state = "running";
|
|
1998
2001
|
var o = t._observer;
|
|
1999
2002
|
try {
|
|
2000
|
-
var n =
|
|
2003
|
+
var n = Kt(o, e);
|
|
2001
2004
|
switch (e) {
|
|
2002
2005
|
case "next":
|
|
2003
2006
|
n && n.call(o, r);
|
|
2004
2007
|
break;
|
|
2005
2008
|
case "error":
|
|
2006
|
-
if (
|
|
2009
|
+
if (le(t), n) n.call(o, r);
|
|
2007
2010
|
else throw r;
|
|
2008
2011
|
break;
|
|
2009
2012
|
case "complete":
|
|
2010
|
-
|
|
2013
|
+
le(t), n && n.call(o);
|
|
2011
2014
|
break;
|
|
2012
2015
|
}
|
|
2013
2016
|
} catch (c) {
|
|
2014
2017
|
vt(c);
|
|
2015
2018
|
}
|
|
2016
|
-
t._state === "closed" ?
|
|
2019
|
+
t._state === "closed" ? Ze(t) : t._state === "running" && (t._state = "ready");
|
|
2017
2020
|
}
|
|
2018
2021
|
function ee(t, e, r) {
|
|
2019
2022
|
if (t._state !== "closed") {
|
|
@@ -2029,17 +2032,17 @@ function ee(t, e, r) {
|
|
|
2029
2032
|
type: e,
|
|
2030
2033
|
value: r
|
|
2031
2034
|
}], Mt(function() {
|
|
2032
|
-
return
|
|
2035
|
+
return Yr(t);
|
|
2033
2036
|
});
|
|
2034
2037
|
return;
|
|
2035
2038
|
}
|
|
2036
|
-
|
|
2039
|
+
tr(t, e, r);
|
|
2037
2040
|
}
|
|
2038
2041
|
}
|
|
2039
|
-
var
|
|
2042
|
+
var Kr = /* @__PURE__ */ (function() {
|
|
2040
2043
|
function t(r, o) {
|
|
2041
2044
|
this._cleanup = void 0, this._observer = r, this._queue = void 0, this._state = "initializing";
|
|
2042
|
-
var n = new
|
|
2045
|
+
var n = new Jr(this);
|
|
2043
2046
|
try {
|
|
2044
2047
|
this._cleanup = o.call(void 0, n);
|
|
2045
2048
|
} catch (c) {
|
|
@@ -2049,14 +2052,14 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2049
2052
|
}
|
|
2050
2053
|
var e = t.prototype;
|
|
2051
2054
|
return e.unsubscribe = function() {
|
|
2052
|
-
this._state !== "closed" && (
|
|
2053
|
-
},
|
|
2055
|
+
this._state !== "closed" && (le(this), Ze(this));
|
|
2056
|
+
}, pe(t, [{
|
|
2054
2057
|
key: "closed",
|
|
2055
2058
|
get: function() {
|
|
2056
2059
|
return this._state === "closed";
|
|
2057
2060
|
}
|
|
2058
2061
|
}]), t;
|
|
2059
|
-
})(),
|
|
2062
|
+
})(), Jr = /* @__PURE__ */ (function() {
|
|
2060
2063
|
function t(r) {
|
|
2061
2064
|
this._subscription = r;
|
|
2062
2065
|
}
|
|
@@ -2067,7 +2070,7 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2067
2070
|
ee(this._subscription, "error", o);
|
|
2068
2071
|
}, e.complete = function() {
|
|
2069
2072
|
ee(this._subscription, "complete");
|
|
2070
|
-
},
|
|
2073
|
+
}, pe(t, [{
|
|
2071
2074
|
key: "closed",
|
|
2072
2075
|
get: function() {
|
|
2073
2076
|
return this._subscription._state === "closed";
|
|
@@ -2085,7 +2088,7 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2085
2088
|
next: o,
|
|
2086
2089
|
error: arguments[1],
|
|
2087
2090
|
complete: arguments[2]
|
|
2088
|
-
}), new
|
|
2091
|
+
}), new Kr(o, this._subscriber);
|
|
2089
2092
|
}, e.forEach = function(o) {
|
|
2090
2093
|
var n = this;
|
|
2091
2094
|
return new Promise(function(c, l) {
|
|
@@ -2094,14 +2097,14 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2094
2097
|
return;
|
|
2095
2098
|
}
|
|
2096
2099
|
function d() {
|
|
2097
|
-
|
|
2100
|
+
i.unsubscribe(), c();
|
|
2098
2101
|
}
|
|
2099
|
-
var
|
|
2102
|
+
var i = n.subscribe({
|
|
2100
2103
|
next: function(v) {
|
|
2101
2104
|
try {
|
|
2102
2105
|
o(v, d);
|
|
2103
|
-
} catch (
|
|
2104
|
-
l(
|
|
2106
|
+
} catch (k) {
|
|
2107
|
+
l(k), i.unsubscribe();
|
|
2105
2108
|
}
|
|
2106
2109
|
},
|
|
2107
2110
|
error: l,
|
|
@@ -2111,14 +2114,14 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2111
2114
|
}, e.map = function(o) {
|
|
2112
2115
|
var n = this;
|
|
2113
2116
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2114
|
-
var c =
|
|
2117
|
+
var c = Et(this);
|
|
2115
2118
|
return new c(function(l) {
|
|
2116
2119
|
return n.subscribe({
|
|
2117
2120
|
next: function(d) {
|
|
2118
2121
|
try {
|
|
2119
2122
|
d = o(d);
|
|
2120
|
-
} catch (
|
|
2121
|
-
return l.error(
|
|
2123
|
+
} catch (i) {
|
|
2124
|
+
return l.error(i);
|
|
2122
2125
|
}
|
|
2123
2126
|
l.next(d);
|
|
2124
2127
|
},
|
|
@@ -2133,14 +2136,14 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2133
2136
|
}, e.filter = function(o) {
|
|
2134
2137
|
var n = this;
|
|
2135
2138
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2136
|
-
var c =
|
|
2139
|
+
var c = Et(this);
|
|
2137
2140
|
return new c(function(l) {
|
|
2138
2141
|
return n.subscribe({
|
|
2139
2142
|
next: function(d) {
|
|
2140
2143
|
try {
|
|
2141
2144
|
if (!o(d)) return;
|
|
2142
|
-
} catch (
|
|
2143
|
-
return l.error(
|
|
2145
|
+
} catch (i) {
|
|
2146
|
+
return l.error(i);
|
|
2144
2147
|
}
|
|
2145
2148
|
l.next(d);
|
|
2146
2149
|
},
|
|
@@ -2155,115 +2158,115 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2155
2158
|
}, e.reduce = function(o) {
|
|
2156
2159
|
var n = this;
|
|
2157
2160
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2158
|
-
var c =
|
|
2159
|
-
return new c(function(
|
|
2161
|
+
var c = Et(this), l = arguments.length > 1, d = !1, i = arguments[1], v = i;
|
|
2162
|
+
return new c(function(k) {
|
|
2160
2163
|
return n.subscribe({
|
|
2161
|
-
next: function(
|
|
2162
|
-
var
|
|
2163
|
-
if (d = !0, !
|
|
2164
|
+
next: function(C) {
|
|
2165
|
+
var _ = !d;
|
|
2166
|
+
if (d = !0, !_ || l)
|
|
2164
2167
|
try {
|
|
2165
|
-
v = o(v,
|
|
2168
|
+
v = o(v, C);
|
|
2166
2169
|
} catch (I) {
|
|
2167
|
-
return
|
|
2170
|
+
return k.error(I);
|
|
2168
2171
|
}
|
|
2169
2172
|
else
|
|
2170
|
-
v =
|
|
2173
|
+
v = C;
|
|
2171
2174
|
},
|
|
2172
|
-
error: function(
|
|
2173
|
-
|
|
2175
|
+
error: function(C) {
|
|
2176
|
+
k.error(C);
|
|
2174
2177
|
},
|
|
2175
2178
|
complete: function() {
|
|
2176
|
-
if (!d && !l) return
|
|
2177
|
-
|
|
2179
|
+
if (!d && !l) return k.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2180
|
+
k.next(v), k.complete();
|
|
2178
2181
|
}
|
|
2179
2182
|
});
|
|
2180
2183
|
});
|
|
2181
2184
|
}, e.concat = function() {
|
|
2182
2185
|
for (var o = this, n = arguments.length, c = new Array(n), l = 0; l < n; l++)
|
|
2183
2186
|
c[l] = arguments[l];
|
|
2184
|
-
var d =
|
|
2185
|
-
return new d(function(
|
|
2186
|
-
var v,
|
|
2187
|
-
function
|
|
2188
|
-
v =
|
|
2187
|
+
var d = Et(this);
|
|
2188
|
+
return new d(function(i) {
|
|
2189
|
+
var v, k = 0;
|
|
2190
|
+
function C(_) {
|
|
2191
|
+
v = _.subscribe({
|
|
2189
2192
|
next: function(I) {
|
|
2190
|
-
|
|
2193
|
+
i.next(I);
|
|
2191
2194
|
},
|
|
2192
2195
|
error: function(I) {
|
|
2193
|
-
|
|
2196
|
+
i.error(I);
|
|
2194
2197
|
},
|
|
2195
2198
|
complete: function() {
|
|
2196
|
-
|
|
2199
|
+
k === c.length ? (v = void 0, i.complete()) : C(d.from(c[k++]));
|
|
2197
2200
|
}
|
|
2198
2201
|
});
|
|
2199
2202
|
}
|
|
2200
|
-
return
|
|
2203
|
+
return C(o), function() {
|
|
2201
2204
|
v && (v.unsubscribe(), v = void 0);
|
|
2202
2205
|
};
|
|
2203
2206
|
});
|
|
2204
2207
|
}, e.flatMap = function(o) {
|
|
2205
2208
|
var n = this;
|
|
2206
2209
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2207
|
-
var c =
|
|
2210
|
+
var c = Et(this);
|
|
2208
2211
|
return new c(function(l) {
|
|
2209
|
-
var d = [],
|
|
2210
|
-
next: function(
|
|
2212
|
+
var d = [], i = n.subscribe({
|
|
2213
|
+
next: function(k) {
|
|
2211
2214
|
if (o)
|
|
2212
2215
|
try {
|
|
2213
|
-
|
|
2214
|
-
} catch (
|
|
2215
|
-
return l.error(
|
|
2216
|
+
k = o(k);
|
|
2217
|
+
} catch (_) {
|
|
2218
|
+
return l.error(_);
|
|
2216
2219
|
}
|
|
2217
|
-
var
|
|
2218
|
-
next: function(
|
|
2219
|
-
l.next(
|
|
2220
|
+
var C = c.from(k).subscribe({
|
|
2221
|
+
next: function(_) {
|
|
2222
|
+
l.next(_);
|
|
2220
2223
|
},
|
|
2221
|
-
error: function(
|
|
2222
|
-
l.error(
|
|
2224
|
+
error: function(_) {
|
|
2225
|
+
l.error(_);
|
|
2223
2226
|
},
|
|
2224
2227
|
complete: function() {
|
|
2225
|
-
var
|
|
2226
|
-
|
|
2228
|
+
var _ = d.indexOf(C);
|
|
2229
|
+
_ >= 0 && d.splice(_, 1), v();
|
|
2227
2230
|
}
|
|
2228
2231
|
});
|
|
2229
|
-
d.push(
|
|
2232
|
+
d.push(C);
|
|
2230
2233
|
},
|
|
2231
|
-
error: function(
|
|
2232
|
-
l.error(
|
|
2234
|
+
error: function(k) {
|
|
2235
|
+
l.error(k);
|
|
2233
2236
|
},
|
|
2234
2237
|
complete: function() {
|
|
2235
2238
|
v();
|
|
2236
2239
|
}
|
|
2237
2240
|
});
|
|
2238
2241
|
function v() {
|
|
2239
|
-
|
|
2242
|
+
i.closed && d.length === 0 && l.complete();
|
|
2240
2243
|
}
|
|
2241
2244
|
return function() {
|
|
2242
|
-
d.forEach(function(
|
|
2243
|
-
return
|
|
2244
|
-
}),
|
|
2245
|
+
d.forEach(function(k) {
|
|
2246
|
+
return k.unsubscribe();
|
|
2247
|
+
}), i.unsubscribe();
|
|
2245
2248
|
};
|
|
2246
2249
|
});
|
|
2247
|
-
}, e[
|
|
2250
|
+
}, e[se] = function() {
|
|
2248
2251
|
return this;
|
|
2249
2252
|
}, t.from = function(o) {
|
|
2250
2253
|
var n = typeof this == "function" ? this : t;
|
|
2251
2254
|
if (o == null) throw new TypeError(o + " is not an object");
|
|
2252
|
-
var c =
|
|
2255
|
+
var c = Kt(o, se);
|
|
2253
2256
|
if (c) {
|
|
2254
2257
|
var l = c.call(o);
|
|
2255
2258
|
if (Object(l) !== l) throw new TypeError(l + " is not an object");
|
|
2256
|
-
return
|
|
2259
|
+
return Rr(l) && l.constructor === n ? l : new n(function(d) {
|
|
2257
2260
|
return l.subscribe(d);
|
|
2258
2261
|
});
|
|
2259
2262
|
}
|
|
2260
|
-
if (
|
|
2263
|
+
if (he("iterator") && (c = Kt(o, Vr), c))
|
|
2261
2264
|
return new n(function(d) {
|
|
2262
2265
|
Mt(function() {
|
|
2263
2266
|
if (!d.closed) {
|
|
2264
|
-
for (var
|
|
2265
|
-
var
|
|
2266
|
-
if (d.next(
|
|
2267
|
+
for (var i = Mr(c.call(o)), v; !(v = i()).done; ) {
|
|
2268
|
+
var k = v.value;
|
|
2269
|
+
if (d.next(k), d.closed) return;
|
|
2267
2270
|
}
|
|
2268
2271
|
d.complete();
|
|
2269
2272
|
}
|
|
@@ -2273,8 +2276,8 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2273
2276
|
return new n(function(d) {
|
|
2274
2277
|
Mt(function() {
|
|
2275
2278
|
if (!d.closed) {
|
|
2276
|
-
for (var
|
|
2277
|
-
if (d.next(o[
|
|
2279
|
+
for (var i = 0; i < o.length; ++i)
|
|
2280
|
+
if (d.next(o[i]), d.closed) return;
|
|
2278
2281
|
d.complete();
|
|
2279
2282
|
}
|
|
2280
2283
|
});
|
|
@@ -2287,27 +2290,27 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2287
2290
|
return new l(function(d) {
|
|
2288
2291
|
Mt(function() {
|
|
2289
2292
|
if (!d.closed) {
|
|
2290
|
-
for (var
|
|
2291
|
-
if (d.next(n[
|
|
2293
|
+
for (var i = 0; i < n.length; ++i)
|
|
2294
|
+
if (d.next(n[i]), d.closed) return;
|
|
2292
2295
|
d.complete();
|
|
2293
2296
|
}
|
|
2294
2297
|
});
|
|
2295
2298
|
});
|
|
2296
|
-
},
|
|
2297
|
-
key:
|
|
2299
|
+
}, pe(t, null, [{
|
|
2300
|
+
key: Qe,
|
|
2298
2301
|
get: function() {
|
|
2299
2302
|
return this;
|
|
2300
2303
|
}
|
|
2301
2304
|
}]), t;
|
|
2302
2305
|
})();
|
|
2303
|
-
|
|
2306
|
+
fe() && Object.defineProperty(E, Symbol("extensions"), {
|
|
2304
2307
|
value: {
|
|
2305
|
-
symbol:
|
|
2308
|
+
symbol: se,
|
|
2306
2309
|
hostReportError: vt
|
|
2307
2310
|
},
|
|
2308
2311
|
configurable: !0
|
|
2309
2312
|
});
|
|
2310
|
-
function
|
|
2313
|
+
function Wr(t) {
|
|
2311
2314
|
var e, r = t.Symbol;
|
|
2312
2315
|
if (typeof r == "function")
|
|
2313
2316
|
if (r.observable)
|
|
@@ -2325,12 +2328,12 @@ function Jr(t) {
|
|
|
2325
2328
|
}
|
|
2326
2329
|
var yt;
|
|
2327
2330
|
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
|
-
|
|
2329
|
-
var
|
|
2330
|
-
|
|
2331
|
+
Wr(yt);
|
|
2332
|
+
var ze = E.prototype, Ae = "@@observable";
|
|
2333
|
+
ze[Ae] || (ze[Ae] = function() {
|
|
2331
2334
|
return this;
|
|
2332
2335
|
});
|
|
2333
|
-
function
|
|
2336
|
+
function Gr(t) {
|
|
2334
2337
|
for (var e = [
|
|
2335
2338
|
"query",
|
|
2336
2339
|
"operationName",
|
|
@@ -2340,15 +2343,15 @@ function Wr(t) {
|
|
|
2340
2343
|
], r = 0, o = Object.keys(t); r < o.length; r++) {
|
|
2341
2344
|
var n = o[r];
|
|
2342
2345
|
if (e.indexOf(n) < 0)
|
|
2343
|
-
throw
|
|
2346
|
+
throw Ge(58, n);
|
|
2344
2347
|
}
|
|
2345
2348
|
return t;
|
|
2346
2349
|
}
|
|
2347
|
-
function
|
|
2348
|
-
var r =
|
|
2349
|
-
typeof c == "function" ? r =
|
|
2350
|
+
function Xr(t, e) {
|
|
2351
|
+
var r = G({}, t), o = function(c) {
|
|
2352
|
+
typeof c == "function" ? r = G(G({}, r), c(r)) : r = G(G({}, r), c);
|
|
2350
2353
|
}, n = function() {
|
|
2351
|
-
return
|
|
2354
|
+
return G({}, r);
|
|
2352
2355
|
};
|
|
2353
2356
|
return Object.defineProperty(e, "setContext", {
|
|
2354
2357
|
enumerable: !1,
|
|
@@ -2358,32 +2361,32 @@ function Gr(t, e) {
|
|
|
2358
2361
|
value: n
|
|
2359
2362
|
}), e;
|
|
2360
2363
|
}
|
|
2361
|
-
function
|
|
2364
|
+
function Qr(t) {
|
|
2362
2365
|
var e = {
|
|
2363
2366
|
variables: t.variables || {},
|
|
2364
2367
|
extensions: t.extensions || {},
|
|
2365
2368
|
operationName: t.operationName,
|
|
2366
2369
|
query: t.query
|
|
2367
2370
|
};
|
|
2368
|
-
return e.operationName || (e.operationName = typeof e.query != "string" ?
|
|
2371
|
+
return e.operationName || (e.operationName = typeof e.query != "string" ? Lr(e.query) || void 0 : ""), e;
|
|
2369
2372
|
}
|
|
2370
|
-
var
|
|
2371
|
-
function
|
|
2372
|
-
return Zr
|
|
2373
|
+
var Zr = Symbol.for("apollo.deprecations"), to = ie, eo = new ue();
|
|
2374
|
+
function ro(t) {
|
|
2375
|
+
return to[Zr] || (eo.getValue() || []).includes(t);
|
|
2373
2376
|
}
|
|
2374
|
-
function
|
|
2375
|
-
|
|
2377
|
+
function oo(t, e) {
|
|
2378
|
+
ro(t) || e();
|
|
2376
2379
|
}
|
|
2377
|
-
function
|
|
2380
|
+
function je(t, e) {
|
|
2378
2381
|
return e ? e(t) : E.of();
|
|
2379
2382
|
}
|
|
2380
|
-
function
|
|
2381
|
-
return typeof t == "function" ? new
|
|
2383
|
+
function Tt(t) {
|
|
2384
|
+
return typeof t == "function" ? new er(t) : t;
|
|
2382
2385
|
}
|
|
2383
2386
|
function qt(t) {
|
|
2384
2387
|
return t.request.length <= 1;
|
|
2385
2388
|
}
|
|
2386
|
-
var
|
|
2389
|
+
var er = (
|
|
2387
2390
|
/** @class */
|
|
2388
2391
|
(function() {
|
|
2389
2392
|
function t(e) {
|
|
@@ -2394,40 +2397,40 @@ var tr = (
|
|
|
2394
2397
|
return E.of();
|
|
2395
2398
|
});
|
|
2396
2399
|
}, t.from = function(e) {
|
|
2397
|
-
return e.length === 0 ? t.empty() : e.map(
|
|
2400
|
+
return e.length === 0 ? t.empty() : e.map(Tt).reduce(function(r, o) {
|
|
2398
2401
|
return r.concat(o);
|
|
2399
2402
|
});
|
|
2400
2403
|
}, t.split = function(e, r, o) {
|
|
2401
|
-
var n =
|
|
2404
|
+
var n = Tt(r), c = Tt(o || new t(je)), l;
|
|
2402
2405
|
return qt(n) && qt(c) ? l = new t(function(d) {
|
|
2403
2406
|
return e(d) ? n.request(d) || E.of() : c.request(d) || E.of();
|
|
2404
|
-
}) : l = new t(function(d,
|
|
2405
|
-
return e(d) ? n.request(d,
|
|
2407
|
+
}) : l = new t(function(d, i) {
|
|
2408
|
+
return e(d) ? n.request(d, i) || E.of() : c.request(d, i) || E.of();
|
|
2406
2409
|
}), Object.assign(l, { left: n, right: c });
|
|
2407
2410
|
}, t.execute = function(e, r) {
|
|
2408
|
-
return e.request(
|
|
2411
|
+
return e.request(Xr(r.context, Qr(Gr(r)))) || E.of();
|
|
2409
2412
|
}, t.concat = function(e, r) {
|
|
2410
|
-
var o =
|
|
2413
|
+
var o = Tt(e);
|
|
2411
2414
|
if (qt(o))
|
|
2412
2415
|
return globalThis.__DEV__ !== !1 && Zt.warn(47, o), o;
|
|
2413
|
-
var n =
|
|
2416
|
+
var n = Tt(r), c;
|
|
2414
2417
|
return qt(n) ? c = new t(function(l) {
|
|
2415
2418
|
return o.request(l, function(d) {
|
|
2416
2419
|
return n.request(d) || E.of();
|
|
2417
2420
|
}) || E.of();
|
|
2418
2421
|
}) : c = new t(function(l, d) {
|
|
2419
|
-
return o.request(l, function(
|
|
2420
|
-
return n.request(
|
|
2422
|
+
return o.request(l, function(i) {
|
|
2423
|
+
return n.request(i, d) || E.of();
|
|
2421
2424
|
}) || E.of();
|
|
2422
2425
|
}), Object.assign(c, { left: o, right: n });
|
|
2423
2426
|
}, t.prototype.split = function(e, r, o) {
|
|
2424
|
-
return this.concat(t.split(e, r, o || new t(
|
|
2427
|
+
return this.concat(t.split(e, r, o || new t(je)));
|
|
2425
2428
|
}, t.prototype.concat = function(e) {
|
|
2426
2429
|
return t.concat(this, e);
|
|
2427
2430
|
}, t.prototype.request = function(e, r) {
|
|
2428
|
-
throw
|
|
2431
|
+
throw Ge(48);
|
|
2429
2432
|
}, t.prototype.onError = function(e, r) {
|
|
2430
|
-
if (globalThis.__DEV__ !== !1 &&
|
|
2433
|
+
if (globalThis.__DEV__ !== !1 && oo("onError", function() {
|
|
2431
2434
|
globalThis.__DEV__ !== !1 && Zt.warn(49);
|
|
2432
2435
|
}), r && r.error)
|
|
2433
2436
|
return r.error(e), !1;
|
|
@@ -2437,9 +2440,9 @@ var tr = (
|
|
|
2437
2440
|
}, t;
|
|
2438
2441
|
})()
|
|
2439
2442
|
);
|
|
2440
|
-
function
|
|
2441
|
-
return new
|
|
2442
|
-
var o =
|
|
2443
|
+
function no(t) {
|
|
2444
|
+
return new er(function(e, r) {
|
|
2445
|
+
var o = $r(e, []);
|
|
2443
2446
|
return new E(function(n) {
|
|
2444
2447
|
var c, l = !1;
|
|
2445
2448
|
return Promise.resolve(o).then(function(d) {
|
|
@@ -2456,7 +2459,7 @@ function oo(t) {
|
|
|
2456
2459
|
});
|
|
2457
2460
|
});
|
|
2458
2461
|
}
|
|
2459
|
-
const
|
|
2462
|
+
const ao = async () => {
|
|
2460
2463
|
const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", o = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
2461
2464
|
try {
|
|
2462
2465
|
const n = await T.post(
|
|
@@ -2474,30 +2477,30 @@ const no = async () => {
|
|
|
2474
2477
|
} catch (n) {
|
|
2475
2478
|
return T.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
2476
2479
|
}
|
|
2477
|
-
},
|
|
2478
|
-
uri: `${
|
|
2479
|
-
}),
|
|
2480
|
-
const r = await
|
|
2480
|
+
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so = lr({
|
|
2481
|
+
uri: `${io}`
|
|
2482
|
+
}), lo = no(async (t, { headers: e }) => {
|
|
2483
|
+
const r = await ao();
|
|
2481
2484
|
return {
|
|
2482
2485
|
headers: {
|
|
2483
2486
|
...e,
|
|
2484
2487
|
authorization: `Bearer ${r}`
|
|
2485
2488
|
}
|
|
2486
2489
|
};
|
|
2487
|
-
}),
|
|
2488
|
-
link:
|
|
2489
|
-
cache: new
|
|
2490
|
+
}), co = new cr({
|
|
2491
|
+
link: lo.concat(so),
|
|
2492
|
+
cache: new dr(),
|
|
2490
2493
|
defaultOptions: {
|
|
2491
2494
|
watchQuery: {
|
|
2492
2495
|
fetchPolicy: "cache-and-network"
|
|
2493
2496
|
}
|
|
2494
2497
|
}
|
|
2495
|
-
}),
|
|
2498
|
+
}), Fo = (t) => {
|
|
2496
2499
|
const { tanyaConfig: e } = t;
|
|
2497
|
-
return /* @__PURE__ */ a(
|
|
2500
|
+
return /* @__PURE__ */ a(ur, { client: co, children: /* @__PURE__ */ a(yr, { children: /* @__PURE__ */ a(Or, { tanyaConfig: e }) }) });
|
|
2498
2501
|
};
|
|
2499
2502
|
export {
|
|
2500
|
-
|
|
2501
|
-
|
|
2503
|
+
Fo as TanyaChatbot,
|
|
2504
|
+
ko as TanyaChatbotProvider
|
|
2502
2505
|
};
|
|
2503
2506
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|