tanya-chatbot 0.6.1 → 0.6.3
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.es.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { useEffect as
|
|
1
|
+
import { useEffect as H, useState as L, useRef as xt } 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 ir, ApolloClient as sr, InMemoryCache as lr, ApolloProvider as cr } from "@apollo/client";
|
|
4
|
+
import { Provider as dr, useDispatch as Ae, useSelector as Rt } from "react-redux";
|
|
5
|
+
import { createSlice as je, configureStore as ur } from "@reduxjs/toolkit";
|
|
6
|
+
import * as De from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
|
-
import
|
|
9
|
+
import $ from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
|
-
import { Icon as
|
|
12
|
-
import { toast as
|
|
13
|
-
const mr = '*,: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}}';
|
|
11
|
+
import { Icon as pr } from "@iconify/react";
|
|
12
|
+
import { toast as R } from "react-toastify";
|
|
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
14
|
function ko() {
|
|
15
|
-
return
|
|
15
|
+
return H(() => {
|
|
16
16
|
if (typeof document < "u") {
|
|
17
17
|
const t = document.createElement("style");
|
|
18
|
-
return t.textContent =
|
|
18
|
+
return t.textContent = fr, 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
|
+
}, Le = je({
|
|
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: So } =
|
|
66
|
+
}), { setStore: So } = Le.actions, hr = Le.reducer, wr = {
|
|
67
67
|
product: null
|
|
68
|
-
},
|
|
68
|
+
}, Be = je({
|
|
69
69
|
name: "product",
|
|
70
|
-
initialState:
|
|
70
|
+
initialState: wr,
|
|
71
71
|
reducers: {
|
|
72
72
|
setProduct: (t, e) => {
|
|
73
73
|
t.product = e.payload;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
}), { setProduct: oe } =
|
|
76
|
+
}), { setProduct: oe } = Be.actions, gr = Be.reducer, br = ur({
|
|
77
77
|
reducer: {
|
|
78
|
-
store:
|
|
79
|
-
product:
|
|
78
|
+
store: hr,
|
|
79
|
+
product: gr
|
|
80
80
|
}
|
|
81
|
-
}),
|
|
81
|
+
}), xr = ({ children: t }) => /* @__PURE__ */ a(dr, { store: br, 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 yr({
|
|
91
91
|
...t
|
|
92
92
|
}) {
|
|
93
|
-
return /* @__PURE__ */ a(
|
|
93
|
+
return /* @__PURE__ */ a(De.Root, { "data-slot": "popover", ...t });
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function vr({
|
|
96
96
|
...t
|
|
97
97
|
}) {
|
|
98
|
-
return /* @__PURE__ */ a(
|
|
98
|
+
return /* @__PURE__ */ a(De.Trigger, { "data-slot": "popover-trigger", ...t });
|
|
99
99
|
}
|
|
100
|
-
const St = () => ({ 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 St = () => ({ 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" }), Ue = async () => {
|
|
101
101
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
102
102
|
try {
|
|
103
|
-
const e = await
|
|
104
|
-
`${t}api/auth/token-bm-grant?baseUrl=${
|
|
103
|
+
const e = await $.post(
|
|
104
|
+
`${t}api/auth/token-bm-grant?baseUrl=${ot()}&siteId=${G()}`
|
|
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
|
-
return
|
|
108
|
+
return $.isAxiosError(e) ? console.error("Error fetching token:", e.response || e.message) : console.error("Unexpected error:", e), null;
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, qe = async (t) => {
|
|
111
111
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
112
112
|
try {
|
|
113
|
-
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await
|
|
114
|
-
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${
|
|
113
|
+
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await $.post(
|
|
114
|
+
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${ot()}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
115
115
|
{},
|
|
116
116
|
{
|
|
117
117
|
headers: {
|
|
@@ -122,26 +122,26 @@ const St = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
122
122
|
);
|
|
123
123
|
return o.status === 200 && o.data ? o.data : null;
|
|
124
124
|
} catch (r) {
|
|
125
|
-
return
|
|
125
|
+
return $.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 = G(), 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 ot = () => sessionStorage.getItem("Host"), G = () => sessionStorage.getItem("SiteId"), st = () => sessionStorage.getItem("pubCfg"), lt = () => sessionStorage.getItem("envRef"), ct = () => sessionStorage.getItem("orgRef"), kr = async (t) => {
|
|
134
134
|
console.log("fetching results");
|
|
135
135
|
const { serverUrl: e, basePath: r } = St();
|
|
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 =
|
|
143
|
-
return (await
|
|
144
|
-
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${
|
|
142
|
+
const n = ot();
|
|
143
|
+
return (await $.get(
|
|
144
|
+
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
145
145
|
{
|
|
146
146
|
headers: {
|
|
147
147
|
"Content-Type": "application/json",
|
|
@@ -152,13 +152,13 @@ const tt = () => sessionStorage.getItem("Host"), J = () => sessionStorage.getIte
|
|
|
152
152
|
} catch (n) {
|
|
153
153
|
throw console.error("Error fetching search results:", n), n;
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, Me = async (t) => {
|
|
156
156
|
if (!t) throw new Error("Product ID is required");
|
|
157
|
-
const { serverUrl: e, basePath: r } = St(), o =
|
|
157
|
+
const { serverUrl: e, basePath: r } = St(), o = ot();
|
|
158
158
|
console.log("calling access");
|
|
159
|
-
const { access_token: n } = await
|
|
160
|
-
return (await
|
|
161
|
-
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${
|
|
159
|
+
const { access_token: n } = await Pt();
|
|
160
|
+
return (await $.get(
|
|
161
|
+
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
162
162
|
{
|
|
163
163
|
headers: {
|
|
164
164
|
"Content-Type": "application/json",
|
|
@@ -168,11 +168,11 @@ const tt = () => sessionStorage.getItem("Host"), J = () => sessionStorage.getIte
|
|
|
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 Ue(), { customer_token: r } = await qe(
|
|
172
172
|
e
|
|
173
|
-
), { serverUrl: o, basePath: n } = St(), l = (await
|
|
174
|
-
return (await
|
|
175
|
-
`${o}${n}/get-interest?baseUrl=${
|
|
173
|
+
), { serverUrl: o, basePath: n } = St(), l = (await Pt()).access_token;
|
|
174
|
+
return (await $.get(
|
|
175
|
+
`${o}${n}/get-interest?baseUrl=${ot()}&customerId=${t}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
176
176
|
{
|
|
177
177
|
headers: {
|
|
178
178
|
"Content-Type": "application/json",
|
|
@@ -180,10 +180,10 @@ const tt = () => sessionStorage.getItem("Host"), J = () => sessionStorage.getIte
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
)).data;
|
|
183
|
-
},
|
|
183
|
+
}, be = (t) => String(typeof t == "string" ? t : t["en-US"] || t), xe = (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
|
+
}), ye = (t) => {
|
|
187
187
|
var e, r, o;
|
|
188
188
|
return "variants" in t ? {
|
|
189
189
|
centAmount: (e = t.variants[0]) == null ? void 0 : e.prices.EUR.max,
|
|
@@ -192,13 +192,13 @@ const tt = () => sessionStorage.getItem("Host"), J = () => sessionStorage.getIte
|
|
|
192
192
|
centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
193
193
|
currencyCode: (o = t.masterVariant) == null ? void 0 : o.prices[0].value.currencyCode
|
|
194
194
|
};
|
|
195
|
-
}, Cr = (t) => t.charAt(0).toUpperCase() + t.slice(1),
|
|
195
|
+
}, Cr = (t) => t.charAt(0).toUpperCase() + t.slice(1), ve = (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
199
|
function Ir() {
|
|
200
|
-
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] =
|
|
201
|
-
return
|
|
200
|
+
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = L(t);
|
|
201
|
+
return H(() => {
|
|
202
202
|
const o = () => r(t());
|
|
203
203
|
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
204
204
|
}, []), e;
|
|
@@ -206,7 +206,7 @@ function Ir() {
|
|
|
206
206
|
const Fr = ({
|
|
207
207
|
product: t
|
|
208
208
|
}) => {
|
|
209
|
-
const e =
|
|
209
|
+
const e = Ae(), r = Ir(), [o, n] = L(0), c = () => {
|
|
210
210
|
n(
|
|
211
211
|
(s) => s + r >= t.length ? 0 : s + r
|
|
212
212
|
);
|
|
@@ -215,8 +215,8 @@ const Fr = ({
|
|
|
215
215
|
(s) => s - r < 0 ? t.length - (t.length % r || r) : s - r
|
|
216
216
|
);
|
|
217
217
|
}, d = async (s) => {
|
|
218
|
-
const
|
|
219
|
-
e(oe(
|
|
218
|
+
const m = await Me(s);
|
|
219
|
+
e(oe(m));
|
|
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: [
|
|
222
222
|
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
|
|
@@ -233,7 +233,7 @@ const Fr = ({
|
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
235
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((s) => {
|
|
236
|
-
var
|
|
236
|
+
var m, h, I, v;
|
|
237
237
|
return /* @__PURE__ */ u(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
@@ -245,7 +245,7 @@ const Fr = ({
|
|
|
245
245
|
/* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
|
|
246
246
|
"img",
|
|
247
247
|
{
|
|
248
|
-
src: ((
|
|
248
|
+
src: ((m = xe(s)[0]) == null ? void 0 : m.link) || xe(s)[0] || // fallback if it's a string
|
|
249
249
|
"https://via.placeholder.com/120",
|
|
250
250
|
alt: s != null && s.productName ? s.productName : "Product",
|
|
251
251
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
@@ -257,8 +257,8 @@ const Fr = ({
|
|
|
257
257
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
258
258
|
children: [
|
|
259
259
|
/* @__PURE__ */ u("div", { className: "relative inline-block group", children: [
|
|
260
|
-
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name :
|
|
261
|
-
|
|
260
|
+
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name : ve(
|
|
261
|
+
be((h = s == null ? void 0 : s.name) == null ? void 0 : h["en-US"]),
|
|
262
262
|
60
|
|
263
263
|
) || "Product" }),
|
|
264
264
|
/* @__PURE__ */ a(
|
|
@@ -272,8 +272,8 @@ const Fr = ({
|
|
|
272
272
|
marginBottom: "5px",
|
|
273
273
|
zIndex: 50
|
|
274
274
|
},
|
|
275
|
-
children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name :
|
|
276
|
-
|
|
275
|
+
children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name : ve(
|
|
276
|
+
be((I = s == null ? void 0 : s.name) == null ? void 0 : I["en-US"]),
|
|
277
277
|
60
|
|
278
278
|
) || "Product"
|
|
279
279
|
}
|
|
@@ -281,8 +281,8 @@ const Fr = ({
|
|
|
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
283
|
/* @__PURE__ */ a("p", { children: _r(
|
|
284
|
-
s != null && s.price ? Number(s == null ? void 0 : s.price) :
|
|
285
|
-
(
|
|
284
|
+
s != null && s.price ? Number(s == null ? void 0 : s.price) : ye(s).centAmount || 0,
|
|
285
|
+
(v = ye(s)) == null ? void 0 : v.currencyCode
|
|
286
286
|
) }),
|
|
287
287
|
/* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
288
288
|
"$",
|
|
@@ -337,12 +337,12 @@ const Fr = ({
|
|
|
337
337
|
]
|
|
338
338
|
},
|
|
339
339
|
o
|
|
340
|
-
)) }),
|
|
340
|
+
)) }), He = async (t, e) => {
|
|
341
341
|
var c, l;
|
|
342
342
|
const { serverUrl: r, basePath: o } = St(), n = `${r}`;
|
|
343
343
|
try {
|
|
344
|
-
const d = await
|
|
345
|
-
`${n}${o}/basket/create?baseUrl=${
|
|
344
|
+
const d = await $.post(
|
|
345
|
+
`${n}${o}/basket/create?baseUrl=${ot()}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
346
346
|
e,
|
|
347
347
|
{
|
|
348
348
|
headers: {
|
|
@@ -359,13 +359,13 @@ const Fr = ({
|
|
|
359
359
|
"*"
|
|
360
360
|
), d.data;
|
|
361
361
|
} catch (d) {
|
|
362
|
-
return
|
|
362
|
+
return $.isAxiosError(d) ? console.error("Error creating basket:", d.response || d.message) : console.error("Unexpected error:", d), null;
|
|
363
363
|
}
|
|
364
364
|
}, ne = async (t, e, r) => {
|
|
365
365
|
const { serverUrl: o, basePath: n } = St(), c = `${o}`;
|
|
366
366
|
try {
|
|
367
|
-
const l = await
|
|
368
|
-
`${c}${n}/basket/add-product/${t}?baseUrl=${
|
|
367
|
+
const l = await $.post(
|
|
368
|
+
`${c}${n}/basket/add-product/${t}?baseUrl=${ot()}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
369
369
|
e,
|
|
370
370
|
{
|
|
371
371
|
headers: {
|
|
@@ -376,20 +376,20 @@ const Fr = ({
|
|
|
376
376
|
);
|
|
377
377
|
return l.status === 200 && l.data ? l.data : null;
|
|
378
378
|
} catch (l) {
|
|
379
|
-
return
|
|
379
|
+
return $.isAxiosError(l) ? console.error(
|
|
380
380
|
"Error adding products to basket:",
|
|
381
381
|
l.response || l.message
|
|
382
382
|
) : console.error("Unexpected error:", l), null;
|
|
383
383
|
}
|
|
384
|
-
},
|
|
384
|
+
}, Re = async ({
|
|
385
385
|
basketId: t,
|
|
386
386
|
customer_token: e
|
|
387
387
|
}) => {
|
|
388
388
|
var c;
|
|
389
389
|
const { serverUrl: r, basePath: o } = St(), n = `${r}`;
|
|
390
390
|
try {
|
|
391
|
-
const l = await
|
|
392
|
-
`${n}${o}/basket/${t}?baseUrl=${
|
|
391
|
+
const l = await $.get(
|
|
392
|
+
`${n}${o}/basket/${t}?baseUrl=${ot()}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
393
393
|
{
|
|
394
394
|
headers: {
|
|
395
395
|
"Content-Type": "application/json",
|
|
@@ -399,10 +399,10 @@ const Fr = ({
|
|
|
399
399
|
);
|
|
400
400
|
return { status: l.status, data: l.data };
|
|
401
401
|
} catch (l) {
|
|
402
|
-
return
|
|
402
|
+
return $.isAxiosError(l) ? { status: (c = l.response) == null ? void 0 : c.status, data: null } : { status: null, data: null };
|
|
403
403
|
}
|
|
404
|
-
}, Yt = "sfcc_basket_id",
|
|
405
|
-
const
|
|
404
|
+
}, Yt = "sfcc_basket_id", ke = "sfcc_customer_token", Tt = "sfcc_token_expiry", Er = 300 * 1e3, Bt = "1.0.0";
|
|
405
|
+
const it = (t) => {
|
|
406
406
|
try {
|
|
407
407
|
t ? localStorage.setItem(Yt, t) : localStorage.removeItem(Yt);
|
|
408
408
|
} catch (e) {
|
|
@@ -411,102 +411,102 @@ const nt = (t) => {
|
|
|
411
411
|
}, Kt = (t) => {
|
|
412
412
|
try {
|
|
413
413
|
if (t) {
|
|
414
|
-
localStorage.setItem(
|
|
414
|
+
localStorage.setItem(ke, t);
|
|
415
415
|
const e = Date.now() + Er;
|
|
416
|
-
localStorage.setItem(
|
|
416
|
+
localStorage.setItem(Tt, e.toString());
|
|
417
417
|
} else
|
|
418
|
-
localStorage.removeItem(
|
|
418
|
+
localStorage.removeItem(ke);
|
|
419
419
|
} catch (e) {
|
|
420
420
|
console.error("Error storing token:", e);
|
|
421
421
|
}
|
|
422
|
-
},
|
|
423
|
-
var s,
|
|
424
|
-
const e =
|
|
425
|
-
if (
|
|
422
|
+
}, Se = 300, Tr = ({ addToCartPwa: t }) => {
|
|
423
|
+
var s, m, h, I, v, V;
|
|
424
|
+
const e = Ae(), r = Rt((E) => E.product.product), o = Rt((E) => E.store.store), [n, c] = L(!!r);
|
|
425
|
+
if (H(() => {
|
|
426
426
|
c(!!r);
|
|
427
427
|
}, [r]), !r) return null;
|
|
428
428
|
const l = async () => {
|
|
429
|
-
var
|
|
429
|
+
var E, z, X, dt, Y, ut, _t, Ot, pt, Ct, It, ft, $t, zt, nt, B;
|
|
430
430
|
try {
|
|
431
|
-
if (!((
|
|
432
|
-
|
|
431
|
+
if (!((z = (E = r == null ? void 0 : r.variants) == null ? void 0 : E[0]) != null && z.product_id) && !(r.type.item || r.type.bundle) && !((dt = (X = r == null ? void 0 : r.variants) == null ? void 0 : X[0]) != null && dt.productId)) {
|
|
432
|
+
R.error("Variants not available", {
|
|
433
433
|
position: "bottom-right",
|
|
434
434
|
autoClose: 1e3
|
|
435
435
|
}), console.error("No product variant found");
|
|
436
436
|
return;
|
|
437
437
|
}
|
|
438
|
-
const
|
|
438
|
+
const k = [
|
|
439
439
|
{
|
|
440
|
-
product_id: ((
|
|
440
|
+
product_id: ((Y = r.variants) == null ? void 0 : Y[0].product_id) || ((ut = r.variants) == null ? void 0 : ut[0].productId) || (r == null ? void 0 : r.id),
|
|
441
441
|
quantity: 1
|
|
442
442
|
}
|
|
443
|
-
],
|
|
443
|
+
], b = JSON.parse(
|
|
444
444
|
sessionStorage.getItem("customerData") || "{}"
|
|
445
|
-
),
|
|
446
|
-
if (!Wt || !
|
|
447
|
-
let
|
|
448
|
-
if (
|
|
445
|
+
), mt = (b == null ? void 0 : b.basketId) || localStorage.getItem(Yt), Wt = !1, At = localStorage.getItem(Tt), jt = Date.now();
|
|
446
|
+
if (!Wt || !At || jt >= parseInt(At)) {
|
|
447
|
+
let j = "";
|
|
448
|
+
if (j = "Bearer " + (await Pt()).access_token, !j) {
|
|
449
449
|
console.error("Failed to get customer_token");
|
|
450
450
|
return;
|
|
451
451
|
}
|
|
452
|
-
const
|
|
453
|
-
if (Kt(
|
|
454
|
-
const Ft = await
|
|
455
|
-
basketId:
|
|
456
|
-
customer_token:
|
|
452
|
+
const ht = jt + 300 * 1e3;
|
|
453
|
+
if (Kt(j), localStorage.setItem(Tt, ht.toString()), mt) {
|
|
454
|
+
const Ft = await Re({
|
|
455
|
+
basketId: mt,
|
|
456
|
+
customer_token: j
|
|
457
457
|
});
|
|
458
458
|
if (Ft.status === 200 && Ft) {
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
459
|
+
const U = await ne(
|
|
460
|
+
mt,
|
|
461
|
+
k,
|
|
462
|
+
j
|
|
463
463
|
);
|
|
464
|
-
(((_t =
|
|
464
|
+
(((_t = U == null ? void 0 : U.product_items) == null ? void 0 : _t.length) > 0 || ((Ot = U == null ? void 0 : U.productItems) == null ? void 0 : Ot.length) > 0) && (R.success("Added to cart", {
|
|
465
465
|
position: "bottom-right",
|
|
466
466
|
autoClose: 3e3,
|
|
467
467
|
hideProgressBar: !1,
|
|
468
468
|
closeOnClick: !0,
|
|
469
469
|
pauseOnHover: !0,
|
|
470
470
|
draggable: !0
|
|
471
|
-
}), Vt(
|
|
471
|
+
}), Vt(mt));
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
const
|
|
475
|
+
const Dt = {
|
|
476
476
|
productItems: [
|
|
477
477
|
{
|
|
478
|
-
productId: ((
|
|
478
|
+
productId: ((pt = r.variants) == null ? void 0 : pt[0].product_id) || ((Ct = r.variants) == null ? void 0 : Ct[0].productId) || (r == null ? void 0 : r.id),
|
|
479
479
|
quantity: 1
|
|
480
480
|
}
|
|
481
481
|
]
|
|
482
|
-
},
|
|
483
|
-
if (!(
|
|
482
|
+
}, y = await He(j, Dt);
|
|
483
|
+
if (!(y != null && y.basket_id) && !(y != null && y.basketId)) {
|
|
484
484
|
console.error("Failed to create basket");
|
|
485
485
|
return;
|
|
486
486
|
}
|
|
487
|
-
|
|
488
|
-
(
|
|
487
|
+
it(
|
|
488
|
+
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId)
|
|
489
489
|
), console.log("adding product to basket");
|
|
490
|
-
const
|
|
491
|
-
(
|
|
492
|
-
|
|
493
|
-
|
|
490
|
+
const Q = await ne(
|
|
491
|
+
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId),
|
|
492
|
+
k,
|
|
493
|
+
j
|
|
494
494
|
);
|
|
495
|
-
console.log("object added to basket"), (((It =
|
|
495
|
+
console.log("object added to basket"), (((It = Q == null ? void 0 : Q.product_items) == null ? void 0 : It.length) > 0 || ((ft = Q == null ? void 0 : Q.productItems) == null ? void 0 : ft.length) > 0) && R.success("Added to cart", {
|
|
496
496
|
position: "bottom-right",
|
|
497
497
|
autoClose: 3e3,
|
|
498
498
|
hideProgressBar: !1,
|
|
499
499
|
closeOnClick: !0,
|
|
500
500
|
pauseOnHover: !0,
|
|
501
501
|
draggable: !0
|
|
502
|
-
}), Vt(
|
|
502
|
+
}), Vt(y.basket_id || (y == null ? void 0 : y.basketId));
|
|
503
503
|
}
|
|
504
|
-
} catch (
|
|
505
|
-
console.error("Error adding to cart:",
|
|
504
|
+
} catch (k) {
|
|
505
|
+
console.error("Error adding to cart:", k), R.error("Failed to add product to cart", {
|
|
506
506
|
position: "bottom-right",
|
|
507
507
|
autoClose: 3e3
|
|
508
|
-
}), ((
|
|
509
|
-
((
|
|
508
|
+
}), (($t = k == null ? void 0 : k.response) == null ? void 0 : $t.status) === 404 || // Basket not found
|
|
509
|
+
((zt = k == null ? void 0 : k.response) == null ? void 0 : zt.status) === 401 ? (((nt = k == null ? void 0 : k.response) == null ? void 0 : nt.status) === 404 && it(null), ((B = k == null ? void 0 : k.response) == null ? void 0 : B.status) === 401 && (it(null), Kt(null))) : (console.error("Failed to add product to basket:", k.message), R.error("Failed to add product to cart", {
|
|
510
510
|
position: "bottom-right",
|
|
511
511
|
autoClose: 3e3
|
|
512
512
|
}));
|
|
@@ -520,7 +520,7 @@ const nt = (t) => {
|
|
|
520
520
|
{
|
|
521
521
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
522
522
|
onClick: () => {
|
|
523
|
-
c(!1), setTimeout(() => e(oe(null)),
|
|
523
|
+
c(!1), setTimeout(() => e(oe(null)), Se);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
526
|
),
|
|
@@ -533,21 +533,21 @@ const nt = (t) => {
|
|
|
533
533
|
${n ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
|
|
534
534
|
`,
|
|
535
535
|
style: { willChange: "transform, opacity" },
|
|
536
|
-
onClick: (
|
|
536
|
+
onClick: (E) => E.stopPropagation(),
|
|
537
537
|
children: [
|
|
538
538
|
/* @__PURE__ */ u("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
539
539
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: r.name }) }),
|
|
540
540
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
541
|
-
|
|
541
|
+
"div",
|
|
542
542
|
{
|
|
543
|
-
icon: "mdi:close",
|
|
544
543
|
className: "text-[#555555] w-6 h-6 cursor-pointer",
|
|
545
544
|
onClick: () => {
|
|
546
545
|
c(!1), setTimeout(
|
|
547
546
|
() => e(oe(null)),
|
|
548
|
-
|
|
547
|
+
Se
|
|
549
548
|
);
|
|
550
|
-
}
|
|
549
|
+
},
|
|
550
|
+
children: "✕"
|
|
551
551
|
}
|
|
552
552
|
) })
|
|
553
553
|
] }),
|
|
@@ -555,20 +555,20 @@ const nt = (t) => {
|
|
|
555
555
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
|
|
556
556
|
"img",
|
|
557
557
|
{
|
|
558
|
-
src: (
|
|
558
|
+
src: (I = (h = (m = (s = r.imageGroups) == null ? void 0 : s[0]) == null ? void 0 : m.images) == null ? void 0 : h[0]) == null ? void 0 : I.link,
|
|
559
559
|
alt: r.name,
|
|
560
560
|
className: "rounded-[10px]"
|
|
561
561
|
}
|
|
562
562
|
) }),
|
|
563
563
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: r.imageGroups.slice(1, 2).map(
|
|
564
|
-
(
|
|
564
|
+
(E) => E.images.slice(1, 2).map((z) => /* @__PURE__ */ a(
|
|
565
565
|
"img",
|
|
566
566
|
{
|
|
567
|
-
src:
|
|
567
|
+
src: z.link,
|
|
568
568
|
alt: r.name,
|
|
569
569
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
570
570
|
},
|
|
571
|
-
|
|
571
|
+
z.link
|
|
572
572
|
))
|
|
573
573
|
) })
|
|
574
574
|
] }),
|
|
@@ -604,30 +604,30 @@ const nt = (t) => {
|
|
|
604
604
|
/* @__PURE__ */ u("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
605
605
|
/* @__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: [
|
|
606
606
|
/* @__PURE__ */ u("div", { className: "text-[#323135] font-bold", children: [
|
|
607
|
-
((
|
|
607
|
+
((v = r == null ? void 0 : r.rating) == null ? void 0 : v.rate) || 0,
|
|
608
608
|
" /",
|
|
609
609
|
" ",
|
|
610
610
|
/* @__PURE__ */ a("span", { className: "text-[#68656E]", children: "5" })
|
|
611
611
|
] }),
|
|
612
612
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
613
613
|
/* @__PURE__ */ u("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
614
|
-
((
|
|
614
|
+
((V = r == null ? void 0 : r.rating) == null ? void 0 : V.count) || 0,
|
|
615
615
|
" ratings"
|
|
616
616
|
] })
|
|
617
617
|
] }) }),
|
|
618
|
-
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((
|
|
619
|
-
var
|
|
618
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((E, z) => {
|
|
619
|
+
var X;
|
|
620
620
|
return /* @__PURE__ */ a(
|
|
621
|
-
|
|
621
|
+
pr,
|
|
622
622
|
{
|
|
623
623
|
icon: "mdi:star",
|
|
624
624
|
width: "20",
|
|
625
625
|
height: "20",
|
|
626
626
|
className: `text-yellow-500
|
|
627
|
-
${((
|
|
627
|
+
${((X = r == null ? void 0 : r.rating) == null ? void 0 : X.rate) > z ? "text-yellow-500" : "text-gray-300"}
|
|
628
628
|
`
|
|
629
629
|
},
|
|
630
|
-
|
|
630
|
+
z
|
|
631
631
|
);
|
|
632
632
|
}) })
|
|
633
633
|
] }),
|
|
@@ -681,174 +681,174 @@ const nt = (t) => {
|
|
|
681
681
|
"Niece/Nephew": "his/her niece/nephew",
|
|
682
682
|
"My Friends": "his/her friends",
|
|
683
683
|
Others: "others"
|
|
684
|
-
}, c = xt(null), l = xt(null), d = xt(null), s = xt(null), [
|
|
684
|
+
}, c = xt(null), l = xt(null), d = xt(null), s = xt(null), [m, h] = L(null);
|
|
685
685
|
xt(null);
|
|
686
|
-
const [
|
|
686
|
+
const [I, v] = L(!1), [V, E] = L(!1), [z, X] = L(!1), [dt, Y] = L(!1), [ut, _t] = L(!1), [Ot, pt] = L(!1), [Ct, It] = L(""), [ft, $t] = L(""), zt = (i) => ({
|
|
687
687
|
id: i.id,
|
|
688
688
|
title: i.name,
|
|
689
689
|
image: i.image ?? "",
|
|
690
690
|
price: i.price ?? 0
|
|
691
|
-
}), [
|
|
692
|
-
|
|
691
|
+
}), [nt, B] = L([]), k = xt(null), b = Rt((i) => i.store.store), mt = Rt((i) => i.product.product);
|
|
692
|
+
H(() => {
|
|
693
693
|
const i = localStorage.getItem(
|
|
694
694
|
`access_token_${t.siteId}`
|
|
695
|
-
),
|
|
695
|
+
), x = localStorage.getItem(
|
|
696
696
|
`chat-token-${t.siteId}`
|
|
697
697
|
);
|
|
698
|
-
if (i &&
|
|
699
|
-
const
|
|
700
|
-
|
|
698
|
+
if (i && x === i) {
|
|
699
|
+
const w = localStorage.getItem("chatHistory");
|
|
700
|
+
w && B(JSON.parse(w));
|
|
701
701
|
} else
|
|
702
702
|
localStorage.setItem("chatHistory", JSON.stringify([])), localStorage.setItem(
|
|
703
703
|
`chat-token-${t.siteId}`,
|
|
704
704
|
i || ""
|
|
705
705
|
);
|
|
706
|
-
}, []),
|
|
707
|
-
localStorage.setItem("chatHistory", JSON.stringify(
|
|
706
|
+
}, []), H(() => {
|
|
707
|
+
localStorage.setItem("chatHistory", JSON.stringify(nt));
|
|
708
708
|
const i = localStorage.getItem(
|
|
709
709
|
`access_token_${t.siteId}`
|
|
710
710
|
);
|
|
711
711
|
i && localStorage.setItem(`chat-token-${t.siteId}`, i);
|
|
712
|
-
}, [
|
|
712
|
+
}, [nt]);
|
|
713
713
|
const Wt = () => {
|
|
714
|
-
|
|
715
|
-
},
|
|
716
|
-
|
|
714
|
+
X(!0), setTimeout(() => E(!0), 10);
|
|
715
|
+
}, At = () => {
|
|
716
|
+
E(!1), setTimeout(() => X(!1), 300);
|
|
717
717
|
};
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}, [
|
|
721
|
-
const
|
|
722
|
-
|
|
718
|
+
H(() => {
|
|
719
|
+
I ? Wt() : At();
|
|
720
|
+
}, [I]);
|
|
721
|
+
const jt = (i) => {
|
|
722
|
+
$t(n[i]);
|
|
723
723
|
};
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
top:
|
|
724
|
+
H(() => {
|
|
725
|
+
z && k.current && k.current.scrollTo({
|
|
726
|
+
top: k.current.scrollHeight,
|
|
727
727
|
behavior: "smooth"
|
|
728
728
|
});
|
|
729
|
-
}, [
|
|
730
|
-
let
|
|
731
|
-
const
|
|
732
|
-
if (
|
|
733
|
-
return
|
|
729
|
+
}, [nt, z]);
|
|
730
|
+
let j = null, ht = null;
|
|
731
|
+
const Dt = async () => {
|
|
732
|
+
if (j && ht && Date.now() < ht)
|
|
733
|
+
return j;
|
|
734
734
|
try {
|
|
735
|
-
const i = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token",
|
|
735
|
+
const i = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", x = new URLSearchParams({
|
|
736
736
|
grant_type: "client_credentials",
|
|
737
737
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
738
738
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
739
739
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
740
|
-
}),
|
|
740
|
+
}), w = await fetch(i, {
|
|
741
741
|
method: "POST",
|
|
742
742
|
headers: {
|
|
743
743
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
744
744
|
},
|
|
745
|
-
body:
|
|
745
|
+
body: x
|
|
746
746
|
});
|
|
747
|
-
if (!
|
|
747
|
+
if (!w.ok)
|
|
748
748
|
throw new Error(
|
|
749
|
-
`Token request failed! status: ${
|
|
749
|
+
`Token request failed! status: ${w.status}`
|
|
750
750
|
);
|
|
751
|
-
const
|
|
752
|
-
|
|
753
|
-
const
|
|
754
|
-
return
|
|
751
|
+
const _ = await w.json();
|
|
752
|
+
j = _.access_token;
|
|
753
|
+
const S = _.expires_in || 3600;
|
|
754
|
+
return ht = Date.now() + (S - 60) * 1e3, j;
|
|
755
755
|
} catch (i) {
|
|
756
|
-
return console.error("Error obtaining JWT token:", i),
|
|
756
|
+
return console.error("Error obtaining JWT token:", i), j = null, ht = null, null;
|
|
757
757
|
}
|
|
758
|
-
},
|
|
759
|
-
const i = await
|
|
760
|
-
i != null &&
|
|
758
|
+
}, y = async () => {
|
|
759
|
+
const i = await Pt();
|
|
760
|
+
i != null && h(i);
|
|
761
761
|
};
|
|
762
|
-
|
|
762
|
+
H(() => {
|
|
763
763
|
if (t != null && t.siteId) {
|
|
764
|
-
const { clientID: i, host:
|
|
765
|
-
sessionStorage.setItem("Host",
|
|
764
|
+
const { clientID: i, host: x, organizationID: w, shortCode: _, siteId: S } = t;
|
|
765
|
+
sessionStorage.setItem("Host", x), sessionStorage.setItem("SiteId", S), sessionStorage.setItem("pubCfg", btoa(i)), sessionStorage.setItem("envRef", _), sessionStorage.setItem("orgRef", w);
|
|
766
766
|
}
|
|
767
|
-
|
|
768
|
-
}, []),
|
|
769
|
-
e && (console.log("setting the basket id", e),
|
|
767
|
+
y(), console.log("scapi environment v1");
|
|
768
|
+
}, []), H(() => {
|
|
769
|
+
e && (console.log("setting the basket id", e), it(e));
|
|
770
770
|
}, [e]);
|
|
771
|
-
const
|
|
771
|
+
const Q = async () => {
|
|
772
772
|
const i = JSON.parse(
|
|
773
773
|
sessionStorage.getItem("customerData") || "{}"
|
|
774
774
|
).customerId;
|
|
775
775
|
return (await Sr(i || "")).c_interests;
|
|
776
|
-
}, Ft = async (i,
|
|
777
|
-
console.log("in secondary flow",
|
|
778
|
-
const
|
|
779
|
-
if (console.log(
|
|
776
|
+
}, Ft = async (i, x) => {
|
|
777
|
+
console.log("in secondary flow", Bt);
|
|
778
|
+
const w = await Q();
|
|
779
|
+
if (console.log(w, "interests of customer", Bt), !!w)
|
|
780
780
|
try {
|
|
781
|
-
|
|
782
|
-
(
|
|
783
|
-
(
|
|
781
|
+
B(
|
|
782
|
+
(M) => M.map(
|
|
783
|
+
(K, J) => J === M.length - 1 ? { ...K, secondaryLoading: !0 } : K
|
|
784
784
|
)
|
|
785
785
|
);
|
|
786
|
-
const
|
|
787
|
-
if (!
|
|
788
|
-
const
|
|
789
|
-
registered: String(
|
|
790
|
-
userId: String(
|
|
791
|
-
}).toString()}`,
|
|
786
|
+
const _ = await Dt();
|
|
787
|
+
if (!_) throw new Error("Failed to fetch token");
|
|
788
|
+
const S = localStorage.getItem("customerNumber"), g = localStorage.getItem("isLoggedIn"), O = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
789
|
+
registered: String(g || !1),
|
|
790
|
+
userId: String(S || (/* @__PURE__ */ new Date()).getTime())
|
|
791
|
+
}).toString()}`, C = JSON.stringify({
|
|
792
792
|
flowId: "Q166PR519W",
|
|
793
793
|
flowAliasId: "HKFUVLWVH2",
|
|
794
794
|
input: {
|
|
795
795
|
loyaltyPoints: "",
|
|
796
796
|
productName: i,
|
|
797
|
-
productPoints: String(
|
|
798
|
-
interests:
|
|
797
|
+
productPoints: String(x || 0),
|
|
798
|
+
interests: w
|
|
799
799
|
}
|
|
800
|
-
}),
|
|
800
|
+
}), T = await fetch(O, {
|
|
801
801
|
signal: AbortSignal.timeout(3e4),
|
|
802
802
|
method: "POST",
|
|
803
803
|
headers: {
|
|
804
804
|
"Content-Type": "application/json",
|
|
805
|
-
Authorization: `Bearer ${
|
|
805
|
+
Authorization: `Bearer ${_}`
|
|
806
806
|
},
|
|
807
|
-
body:
|
|
807
|
+
body: C
|
|
808
808
|
});
|
|
809
|
-
if (!
|
|
810
|
-
const
|
|
811
|
-
let
|
|
809
|
+
if (!T.body) throw new Error("Readable stream not supported");
|
|
810
|
+
const Z = T.body.getReader(), wt = new TextDecoder();
|
|
811
|
+
let q = "";
|
|
812
812
|
for (; ; ) {
|
|
813
|
-
const { done:
|
|
814
|
-
if (
|
|
815
|
-
|
|
816
|
-
const
|
|
813
|
+
const { done: M, value: K } = await Z.read();
|
|
814
|
+
if (M) break;
|
|
815
|
+
q += wt.decode(K, { stream: !0 });
|
|
816
|
+
const J = q.split(`
|
|
817
817
|
`);
|
|
818
|
-
|
|
819
|
-
for (const
|
|
820
|
-
if (
|
|
821
|
-
const
|
|
818
|
+
q = J.pop() || "";
|
|
819
|
+
for (const tt of J)
|
|
820
|
+
if (tt.startsWith("data:")) {
|
|
821
|
+
const p = tt.slice(5).trim();
|
|
822
822
|
try {
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
(
|
|
826
|
-
(
|
|
827
|
-
|
|
828
|
-
secondaryResponse:
|
|
823
|
+
const W = JSON.parse(p);
|
|
824
|
+
W.index === 0 && B(
|
|
825
|
+
(F) => F.map(
|
|
826
|
+
(A, et) => et === F.length - 1 ? {
|
|
827
|
+
...A,
|
|
828
|
+
secondaryResponse: W.data,
|
|
829
829
|
secondaryLoading: !1
|
|
830
|
-
} :
|
|
830
|
+
} : A
|
|
831
831
|
)
|
|
832
832
|
);
|
|
833
|
-
} catch (
|
|
834
|
-
|
|
835
|
-
(
|
|
836
|
-
(
|
|
833
|
+
} catch (W) {
|
|
834
|
+
B(
|
|
835
|
+
(F) => F.map(
|
|
836
|
+
(A, et) => et === F.length - 1 ? { ...A, secondaryLoading: !1 } : A
|
|
837
837
|
)
|
|
838
|
-
), console.error("Secondary flow JSON parse error:",
|
|
838
|
+
), console.error("Secondary flow JSON parse error:", W);
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
} catch (
|
|
843
|
-
console.error("Secondary flow error:",
|
|
842
|
+
} catch (_) {
|
|
843
|
+
console.error("Secondary flow error:", _);
|
|
844
844
|
}
|
|
845
|
-
},
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
-
_t(!0), It(""), c.current = null, l.current = null, d.current = null, s.current = null,
|
|
849
|
-
...
|
|
845
|
+
}, U = async (i) => {
|
|
846
|
+
const x = i || Ct.trim();
|
|
847
|
+
if (x) {
|
|
848
|
+
_t(!0), It(""), c.current = null, l.current = null, d.current = null, s.current = null, B((w) => [
|
|
849
|
+
...w,
|
|
850
850
|
{
|
|
851
|
-
query:
|
|
851
|
+
query: x,
|
|
852
852
|
response: "Thinking for what suits you best...",
|
|
853
853
|
potentialQuestions: "",
|
|
854
854
|
products: [],
|
|
@@ -856,240 +856,224 @@ const nt = (t) => {
|
|
|
856
856
|
}
|
|
857
857
|
]);
|
|
858
858
|
try {
|
|
859
|
-
const
|
|
860
|
-
if (!
|
|
859
|
+
const w = ft, _ = localStorage.getItem("customerNumber"), S = localStorage.getItem("isLoggedIn"), g = await Dt();
|
|
860
|
+
if (!g)
|
|
861
861
|
throw new Error("Failed to obtain access token");
|
|
862
|
-
const
|
|
863
|
-
registered: String(
|
|
864
|
-
userId: String(
|
|
865
|
-
}).toString()}`,
|
|
862
|
+
const O = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
863
|
+
registered: String(S || !1),
|
|
864
|
+
userId: String(_ || (/* @__PURE__ */ new Date()).getTime())
|
|
865
|
+
}).toString()}`, C = JSON.stringify({
|
|
866
866
|
flowId: "MMHQKYI1NE",
|
|
867
867
|
flowAliasId: "SZF9ZK1ATE",
|
|
868
868
|
input: {
|
|
869
|
-
userPrompt:
|
|
870
|
-
whom:
|
|
869
|
+
userPrompt: x,
|
|
870
|
+
whom: w
|
|
871
871
|
}
|
|
872
|
-
}),
|
|
872
|
+
}), T = await fetch(O, {
|
|
873
873
|
signal: AbortSignal.timeout(3e4),
|
|
874
874
|
method: "POST",
|
|
875
875
|
headers: {
|
|
876
876
|
"Content-Type": "application/json",
|
|
877
|
-
Authorization: `Bearer ${
|
|
877
|
+
Authorization: `Bearer ${g}`
|
|
878
878
|
},
|
|
879
|
-
body:
|
|
879
|
+
body: C
|
|
880
880
|
});
|
|
881
|
-
if (!
|
|
882
|
-
throw new Error(`HTTP error! status: ${
|
|
883
|
-
if (!
|
|
884
|
-
const
|
|
885
|
-
let
|
|
881
|
+
if (!T.ok)
|
|
882
|
+
throw new Error(`HTTP error! status: ${T.status}`);
|
|
883
|
+
if (!T.body) throw new Error("Readable stream not supported");
|
|
884
|
+
const Z = T.body.getReader(), wt = new TextDecoder();
|
|
885
|
+
let q = "", M = "";
|
|
886
886
|
for (; ; ) {
|
|
887
|
-
|
|
888
|
-
const { done:
|
|
889
|
-
if (
|
|
890
|
-
|
|
891
|
-
const
|
|
887
|
+
pt(!0);
|
|
888
|
+
const { done: K, value: J } = await Z.read();
|
|
889
|
+
if (K) break;
|
|
890
|
+
q += wt.decode(J, { stream: !0 });
|
|
891
|
+
const tt = q.split(`
|
|
892
892
|
`);
|
|
893
|
-
|
|
894
|
-
for (const
|
|
895
|
-
if (
|
|
896
|
-
const
|
|
893
|
+
q = tt.pop() || "";
|
|
894
|
+
for (const p of tt)
|
|
895
|
+
if (p.startsWith("data:")) {
|
|
896
|
+
const W = p.slice(5).trim();
|
|
897
897
|
try {
|
|
898
|
-
const
|
|
899
|
-
|
|
900
|
-
(
|
|
901
|
-
(
|
|
902
|
-
...
|
|
903
|
-
[
|
|
904
|
-
} :
|
|
898
|
+
const F = JSON.parse(W);
|
|
899
|
+
F.index == 1 && (M = F.data), B(
|
|
900
|
+
(A) => A.map(
|
|
901
|
+
(et, Lt) => Lt === A.length - 1 ? {
|
|
902
|
+
...et,
|
|
903
|
+
[F.index == 0 ? "response" : F.index == 1 ? "keywords" : F.index == 2 ? "potentialQuestions" : "end"]: F.data
|
|
904
|
+
} : et
|
|
905
905
|
)
|
|
906
906
|
);
|
|
907
|
-
} catch (
|
|
908
|
-
console.error("Error parsing JSON:",
|
|
907
|
+
} catch (F) {
|
|
908
|
+
console.error("Error parsing JSON:", F);
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
|
-
|
|
913
|
-
} catch (
|
|
914
|
-
console.error("Error sending message to Tanya:",
|
|
912
|
+
er(tr(M));
|
|
913
|
+
} catch (w) {
|
|
914
|
+
console.error("Error sending message to Tanya:", w);
|
|
915
915
|
} finally {
|
|
916
916
|
_t(!1);
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
|
-
},
|
|
920
|
-
const
|
|
919
|
+
}, tr = (i) => {
|
|
920
|
+
const x = i.match(
|
|
921
921
|
/top five relevant product or category names are: (.*)/i
|
|
922
|
-
),
|
|
923
|
-
return [...new Set(
|
|
924
|
-
},
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
const p = g[0];
|
|
942
|
-
c.current = String((p == null ? void 0 : p.product_name) ?? ""), d.current = p.image.link, l.current = p.product_id;
|
|
943
|
-
const h = typeof (p == null ? void 0 : p.price) == "number" ? p.price : void 0;
|
|
944
|
-
s.current = typeof h == "number" && Number.isFinite(h) ? h : null;
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
} else
|
|
948
|
-
for (const w of i) {
|
|
949
|
-
const m = await xe(w);
|
|
950
|
-
et(!1), (m == null ? void 0 : m.length) > 0 && O(
|
|
951
|
-
(g) => g.map(
|
|
952
|
-
(p, h) => h === g.length - 1 ? {
|
|
953
|
-
...p,
|
|
954
|
-
products: [
|
|
955
|
-
...p.products || [],
|
|
956
|
-
{ keyword: w, items: m, loading: !1 }
|
|
957
|
-
]
|
|
958
|
-
} : p
|
|
959
|
-
)
|
|
960
|
-
);
|
|
922
|
+
), S = (x ? x[1] : i).split(", ").map((D) => D.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
923
|
+
return [...new Set(S)].filter(Boolean).join(",");
|
|
924
|
+
}, er = async (i) => {
|
|
925
|
+
var w, _, S;
|
|
926
|
+
const x = typeof i == "string" ? i.split(",") : i;
|
|
927
|
+
pt(!0);
|
|
928
|
+
try {
|
|
929
|
+
const g = await Promise.all(
|
|
930
|
+
x.map((C) => kr(C).catch(() => []))
|
|
931
|
+
// prevent Promise.all crash
|
|
932
|
+
), D = x.map((C, T) => ({
|
|
933
|
+
keyword: C,
|
|
934
|
+
items: g[T] ?? [],
|
|
935
|
+
loading: !1
|
|
936
|
+
})).filter((C) => C.items.length > 0), O = (_ = (w = D[0]) == null ? void 0 : w.items) == null ? void 0 : _[0];
|
|
937
|
+
if (O) {
|
|
938
|
+
l.current = O.product_id, c.current = O.product_name, d.current = (S = O.image) == null ? void 0 : S.link;
|
|
939
|
+
const C = typeof O.price == "number" ? O.price : null;
|
|
940
|
+
s.current = C;
|
|
961
941
|
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
productSnapshot: {
|
|
942
|
+
if (B(
|
|
943
|
+
(C) => C.map(
|
|
944
|
+
(T, Z) => Z === C.length - 1 ? {
|
|
945
|
+
...T,
|
|
946
|
+
products: D,
|
|
947
|
+
productSnapshot: O ? {
|
|
968
948
|
id: l.current,
|
|
969
949
|
name: c.current,
|
|
970
950
|
image: d.current,
|
|
971
|
-
price: s.current
|
|
951
|
+
price: s.current,
|
|
972
952
|
points: 0,
|
|
973
953
|
quantity: 1
|
|
974
|
-
}
|
|
975
|
-
} :
|
|
954
|
+
} : T.productSnapshot
|
|
955
|
+
} : T
|
|
976
956
|
)
|
|
977
|
-
)
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
957
|
+
), O) {
|
|
958
|
+
const C = JSON.parse(
|
|
959
|
+
sessionStorage.getItem("customerData") || "{}"
|
|
960
|
+
);
|
|
961
|
+
C != null && C.isGuest || (console.log("running secondary flow", Bt), Ft(c.current, 0));
|
|
962
|
+
}
|
|
963
|
+
} catch (g) {
|
|
964
|
+
console.error("error in keyword search", g);
|
|
965
|
+
} finally {
|
|
966
|
+
pt(!1);
|
|
982
967
|
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
R(!0);
|
|
968
|
+
}, rr = async (i, x) => {
|
|
969
|
+
var w, _, S, g, D, O, C, T, Z, wt, q, M, K, J, tt;
|
|
970
|
+
Y(!0);
|
|
987
971
|
try {
|
|
988
|
-
const
|
|
989
|
-
if (!((
|
|
990
|
-
|
|
972
|
+
const p = await Me(i.id);
|
|
973
|
+
if (!((_ = (w = p == null ? void 0 : p.variants) == null ? void 0 : w[0]) != null && _.product_id || (g = (S = p == null ? void 0 : p.variants) == null ? void 0 : S[0]) != null && g.productId) && !(p.type.item || p.type.bundle)) {
|
|
974
|
+
Y(!1), R.error("Variants not found", {
|
|
991
975
|
position: "bottom-right",
|
|
992
976
|
autoClose: 1e3
|
|
993
977
|
}), console.error("No product variant found");
|
|
994
978
|
return;
|
|
995
979
|
}
|
|
996
|
-
const
|
|
980
|
+
const W = [
|
|
997
981
|
{
|
|
998
|
-
product_id: ((
|
|
999
|
-
quantity:
|
|
982
|
+
product_id: ((D = p.variants) == null ? void 0 : D[0].product_id) || ((O = p.variants) == null ? void 0 : O[0].productId) || (p == null ? void 0 : p.id),
|
|
983
|
+
quantity: x
|
|
1000
984
|
}
|
|
1001
985
|
];
|
|
1002
|
-
console.log(
|
|
1003
|
-
const
|
|
986
|
+
console.log(W, "product data", "app version", Bt);
|
|
987
|
+
const F = JSON.parse(
|
|
1004
988
|
sessionStorage.getItem("customerData") || "{}"
|
|
1005
|
-
),
|
|
1006
|
-
if (!
|
|
1007
|
-
const
|
|
1008
|
-
let { customer_token: gt } = await
|
|
1009
|
-
|
|
989
|
+
), A = (F == null ? void 0 : F.basketId) || localStorage.getItem(Yt), et = !1, Lt = localStorage.getItem(Tt), we = Date.now();
|
|
990
|
+
if (!et || !Lt || we >= parseInt(Lt)) {
|
|
991
|
+
const or = await Ue();
|
|
992
|
+
let { customer_token: gt } = await qe(
|
|
993
|
+
or
|
|
1010
994
|
);
|
|
1011
|
-
if (gt = "Bearer " +
|
|
995
|
+
if (gt = "Bearer " + m.access_token, !gt) {
|
|
1012
996
|
console.error("Failed to get customer_token");
|
|
1013
997
|
return;
|
|
1014
998
|
}
|
|
1015
|
-
const
|
|
1016
|
-
if (Kt(gt), localStorage.setItem(
|
|
1017
|
-
const ge = await
|
|
1018
|
-
basketId:
|
|
999
|
+
const nr = we + 300 * 1e3;
|
|
1000
|
+
if (Kt(gt), localStorage.setItem(Tt, nr.toString()), console.log(A, "basketIdFromCustomer"), A) {
|
|
1001
|
+
const ge = await Re({
|
|
1002
|
+
basketId: A,
|
|
1019
1003
|
customer_token: gt
|
|
1020
1004
|
});
|
|
1021
1005
|
if (ge.status === 200 && ge) {
|
|
1022
1006
|
const Gt = await ne(
|
|
1023
|
-
|
|
1024
|
-
|
|
1007
|
+
A,
|
|
1008
|
+
W,
|
|
1025
1009
|
gt
|
|
1026
1010
|
);
|
|
1027
|
-
((
|
|
1011
|
+
((C = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : C.length) > 0 && (R.success("Added to cart", {
|
|
1028
1012
|
position: "bottom-right",
|
|
1029
1013
|
autoClose: 3e3,
|
|
1030
1014
|
hideProgressBar: !1,
|
|
1031
1015
|
closeOnClick: !0,
|
|
1032
1016
|
pauseOnHover: !0,
|
|
1033
1017
|
draggable: !0
|
|
1034
|
-
}), Vt(
|
|
1018
|
+
}), Vt(A), Y(!1));
|
|
1035
1019
|
return;
|
|
1036
1020
|
}
|
|
1037
1021
|
}
|
|
1038
|
-
const
|
|
1022
|
+
const ar = {
|
|
1039
1023
|
productItems: [
|
|
1040
1024
|
{
|
|
1041
|
-
productId: ((
|
|
1025
|
+
productId: ((T = p.variants) == null ? void 0 : T[0].product_id) || ((Z = p.variants) == null ? void 0 : Z[0].productId) || (p == null ? void 0 : p.id),
|
|
1042
1026
|
quantity: 1
|
|
1043
1027
|
}
|
|
1044
1028
|
]
|
|
1045
|
-
},
|
|
1029
|
+
}, f = await He(gt, ar);
|
|
1046
1030
|
if (console.log(
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1031
|
+
f,
|
|
1032
|
+
f == null ? void 0 : f.basket_id,
|
|
1033
|
+
f == null ? void 0 : f.basketId,
|
|
1050
1034
|
"the basket response"
|
|
1051
|
-
), !(
|
|
1052
|
-
|
|
1035
|
+
), !(f != null && f.basket_id || !(f != null && f.basketId))) {
|
|
1036
|
+
Y(!1), console.error("Failed to create basket");
|
|
1053
1037
|
return;
|
|
1054
1038
|
}
|
|
1055
|
-
|
|
1056
|
-
(
|
|
1039
|
+
it(
|
|
1040
|
+
(f == null ? void 0 : f.basket_id) || (f == null ? void 0 : f.basketId)
|
|
1057
1041
|
);
|
|
1058
1042
|
const bt = await r(
|
|
1059
1043
|
{
|
|
1060
1044
|
productId: l,
|
|
1061
|
-
quantity:
|
|
1045
|
+
quantity: x
|
|
1062
1046
|
},
|
|
1063
|
-
(
|
|
1047
|
+
(f == null ? void 0 : f.basket_id) || (f == null ? void 0 : f.basketId)
|
|
1064
1048
|
);
|
|
1065
|
-
(((wt = bt == null ? void 0 : bt.product_items) == null ? void 0 : wt.length) > 0 || ((
|
|
1049
|
+
(((wt = bt == null ? void 0 : bt.product_items) == null ? void 0 : wt.length) > 0 || ((q = bt == null ? void 0 : bt.productItems) == null ? void 0 : q.length) > 0) && R.success("Added to cart", {
|
|
1066
1050
|
position: "bottom-right",
|
|
1067
1051
|
autoClose: 3e3,
|
|
1068
1052
|
hideProgressBar: !1,
|
|
1069
1053
|
closeOnClick: !0,
|
|
1070
1054
|
pauseOnHover: !0,
|
|
1071
1055
|
draggable: !0
|
|
1072
|
-
}), Vt(
|
|
1056
|
+
}), Vt(f.basket_id || (f == null ? void 0 : f.basketId));
|
|
1073
1057
|
}
|
|
1074
|
-
} catch (
|
|
1075
|
-
|
|
1058
|
+
} catch (p) {
|
|
1059
|
+
Y(!1), console.error("Error adding to cart:", p), R.error("Failed to add product to cart", {
|
|
1076
1060
|
position: "bottom-right",
|
|
1077
1061
|
autoClose: 3e3
|
|
1078
|
-
}), ((
|
|
1079
|
-
((
|
|
1062
|
+
}), ((M = p == null ? void 0 : p.response) == null ? void 0 : M.status) === 404 || // Basket not found
|
|
1063
|
+
((K = p == null ? void 0 : p.response) == null ? void 0 : K.status) === 401 ? (((J = p == null ? void 0 : p.response) == null ? void 0 : J.status) === 404 && it(null), ((tt = p == null ? void 0 : p.response) == null ? void 0 : tt.status) === 401 && (it(null), Kt(null))) : (console.error("Failed to add product to basket:", p.message), R.error("Failed to add product to cart", {
|
|
1080
1064
|
position: "bottom-right",
|
|
1081
1065
|
autoClose: 3e3
|
|
1082
1066
|
}));
|
|
1083
1067
|
}
|
|
1084
|
-
|
|
1068
|
+
Y(!1);
|
|
1085
1069
|
};
|
|
1086
|
-
return
|
|
1087
|
-
|
|
1088
|
-
}, [
|
|
1070
|
+
return H(() => {
|
|
1071
|
+
z ? setTimeout(() => E(!0), 10) : E(!1);
|
|
1072
|
+
}, [z]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(yr, { open: I, onOpenChange: v, children: [
|
|
1089
1073
|
/* @__PURE__ */ a(
|
|
1090
|
-
|
|
1074
|
+
vr,
|
|
1091
1075
|
{
|
|
1092
|
-
onClick: () =>
|
|
1076
|
+
onClick: () => v(!0),
|
|
1093
1077
|
style: {
|
|
1094
1078
|
// background: storeDetails.tanyaThemeColor,
|
|
1095
1079
|
},
|
|
@@ -1149,12 +1133,12 @@ const nt = (t) => {
|
|
|
1149
1133
|
) })
|
|
1150
1134
|
}
|
|
1151
1135
|
),
|
|
1152
|
-
|
|
1136
|
+
z && /* @__PURE__ */ u(re, { children: [
|
|
1153
1137
|
/* @__PURE__ */ a(
|
|
1154
1138
|
"div",
|
|
1155
1139
|
{
|
|
1156
1140
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1157
|
-
onClick: () =>
|
|
1141
|
+
onClick: () => v(!1)
|
|
1158
1142
|
}
|
|
1159
1143
|
),
|
|
1160
1144
|
/* @__PURE__ */ u(
|
|
@@ -1241,7 +1225,7 @@ const nt = (t) => {
|
|
|
1241
1225
|
gap: "1.25rem",
|
|
1242
1226
|
margin: "0.75rem"
|
|
1243
1227
|
},
|
|
1244
|
-
children: /* @__PURE__ */ a("button", { onClick: () =>
|
|
1228
|
+
children: /* @__PURE__ */ a("button", { onClick: () => v(!1), children: /* @__PURE__ */ u(
|
|
1245
1229
|
"svg",
|
|
1246
1230
|
{
|
|
1247
1231
|
width: "24",
|
|
@@ -1293,15 +1277,15 @@ const nt = (t) => {
|
|
|
1293
1277
|
/* @__PURE__ */ u(
|
|
1294
1278
|
"div",
|
|
1295
1279
|
{
|
|
1296
|
-
className: `flex flex-col h-full ${
|
|
1280
|
+
className: `flex flex-col h-full ${mt ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1297
1281
|
children: [
|
|
1298
1282
|
/* @__PURE__ */ u(
|
|
1299
1283
|
"div",
|
|
1300
1284
|
{
|
|
1301
|
-
ref:
|
|
1285
|
+
ref: k,
|
|
1302
1286
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
1303
1287
|
children: [
|
|
1304
|
-
(
|
|
1288
|
+
(b == null ? void 0 : b.whomRequired) && /* @__PURE__ */ u(
|
|
1305
1289
|
"div",
|
|
1306
1290
|
{
|
|
1307
1291
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
@@ -1310,11 +1294,11 @@ const nt = (t) => {
|
|
|
1310
1294
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: o.map((i) => /* @__PURE__ */ a(
|
|
1311
1295
|
"button",
|
|
1312
1296
|
{
|
|
1313
|
-
onClick: () =>
|
|
1297
|
+
onClick: () => jt(i),
|
|
1314
1298
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1315
1299
|
style: {
|
|
1316
|
-
backgroundColor:
|
|
1317
|
-
borderColor:
|
|
1300
|
+
backgroundColor: ft === n[i] ? "#FFFFFF" : "#F3F3F3",
|
|
1301
|
+
borderColor: ft === n[i] ? "#BBB3DD" : ""
|
|
1318
1302
|
},
|
|
1319
1303
|
children: i
|
|
1320
1304
|
},
|
|
@@ -1323,8 +1307,8 @@ const nt = (t) => {
|
|
|
1323
1307
|
]
|
|
1324
1308
|
}
|
|
1325
1309
|
),
|
|
1326
|
-
|
|
1327
|
-
var
|
|
1310
|
+
nt.map((i, x) => {
|
|
1311
|
+
var w, _;
|
|
1328
1312
|
return /* @__PURE__ */ u("div", { children: [
|
|
1329
1313
|
/* @__PURE__ */ a(
|
|
1330
1314
|
"div",
|
|
@@ -1350,12 +1334,12 @@ const nt = (t) => {
|
|
|
1350
1334
|
}
|
|
1351
1335
|
}
|
|
1352
1336
|
) }),
|
|
1353
|
-
|
|
1354
|
-
(i == null ? void 0 : i.products) && ((
|
|
1337
|
+
Ot && !i.response.includes("Thinking") && ((w = i.products) == null ? void 0 : w.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" }) }),
|
|
1338
|
+
(i == null ? void 0 : i.products) && ((_ = i == null ? void 0 : i.products) == null ? void 0 : _.length) > 0 && /* @__PURE__ */ a(
|
|
1355
1339
|
Nr,
|
|
1356
1340
|
{
|
|
1357
1341
|
chat: i.products,
|
|
1358
|
-
storeDetails:
|
|
1342
|
+
storeDetails: b
|
|
1359
1343
|
}
|
|
1360
1344
|
),
|
|
1361
1345
|
(i == null ? void 0 : i.potentialQuestions.length) > 0 && /* @__PURE__ */ u("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
@@ -1363,21 +1347,21 @@ const nt = (t) => {
|
|
|
1363
1347
|
"p",
|
|
1364
1348
|
{
|
|
1365
1349
|
className: "font-nunitoSans font-bold text-sm text-[#494949]",
|
|
1366
|
-
style: { color:
|
|
1350
|
+
style: { color: b.themeDarkColor },
|
|
1367
1351
|
children: "Why not explore these inquiries..."
|
|
1368
1352
|
}
|
|
1369
1353
|
),
|
|
1370
|
-
i.potentialQuestions.split(",").map((
|
|
1354
|
+
i.potentialQuestions.split(",").map((S, g) => /* @__PURE__ */ a(
|
|
1371
1355
|
"button",
|
|
1372
1356
|
{
|
|
1373
|
-
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${
|
|
1374
|
-
onClick: () =>
|
|
1357
|
+
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${b.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
1358
|
+
onClick: () => U(S),
|
|
1375
1359
|
style: {
|
|
1376
|
-
backgroundColor:
|
|
1360
|
+
backgroundColor: b.tanyaThemeColorLight
|
|
1377
1361
|
},
|
|
1378
|
-
children:
|
|
1362
|
+
children: S
|
|
1379
1363
|
},
|
|
1380
|
-
|
|
1364
|
+
g
|
|
1381
1365
|
))
|
|
1382
1366
|
] }),
|
|
1383
1367
|
(i == null ? void 0 : i.secondaryLoading) && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ u(
|
|
@@ -1398,7 +1382,7 @@ const nt = (t) => {
|
|
|
1398
1382
|
"p",
|
|
1399
1383
|
{
|
|
1400
1384
|
className: "font-semibold tanya-pulse",
|
|
1401
|
-
style: { color:
|
|
1385
|
+
style: { color: b.themeDarkColor },
|
|
1402
1386
|
children: "I’ve found a special surprise crafted just for you… hang on a sec!"
|
|
1403
1387
|
}
|
|
1404
1388
|
),
|
|
@@ -1406,7 +1390,7 @@ const nt = (t) => {
|
|
|
1406
1390
|
"p",
|
|
1407
1391
|
{
|
|
1408
1392
|
className: "tanya-dots mt-1",
|
|
1409
|
-
style: { color:
|
|
1393
|
+
style: { color: b.themeDarkColor },
|
|
1410
1394
|
children: "• • •"
|
|
1411
1395
|
}
|
|
1412
1396
|
)
|
|
@@ -1419,7 +1403,7 @@ const nt = (t) => {
|
|
|
1419
1403
|
{
|
|
1420
1404
|
className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
|
|
1421
1405
|
style: {
|
|
1422
|
-
backgroundColor:
|
|
1406
|
+
backgroundColor: b.tanyaThemeColorLight
|
|
1423
1407
|
},
|
|
1424
1408
|
dangerouslySetInnerHTML: {
|
|
1425
1409
|
__html: Xt(
|
|
@@ -1434,7 +1418,7 @@ const nt = (t) => {
|
|
|
1434
1418
|
{
|
|
1435
1419
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
1436
1420
|
style: {
|
|
1437
|
-
backgroundColor:
|
|
1421
|
+
backgroundColor: b.tanyaThemeColorLight
|
|
1438
1422
|
},
|
|
1439
1423
|
children: [
|
|
1440
1424
|
/* @__PURE__ */ a(
|
|
@@ -1461,7 +1445,7 @@ const nt = (t) => {
|
|
|
1461
1445
|
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: i.productSnapshot.name }),
|
|
1462
1446
|
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: i.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1463
1447
|
style: "currency",
|
|
1464
|
-
currency: (
|
|
1448
|
+
currency: (b == null ? void 0 : b.currency) || "USD"
|
|
1465
1449
|
}).format(
|
|
1466
1450
|
i.productSnapshot.price
|
|
1467
1451
|
) : "" }),
|
|
@@ -1481,23 +1465,23 @@ const nt = (t) => {
|
|
|
1481
1465
|
"button",
|
|
1482
1466
|
{
|
|
1483
1467
|
className: "px-3 py-1 text-sm",
|
|
1484
|
-
onClick: () =>
|
|
1485
|
-
(
|
|
1486
|
-
(
|
|
1487
|
-
...
|
|
1468
|
+
onClick: () => B(
|
|
1469
|
+
(S) => S.map(
|
|
1470
|
+
(g, D) => D === x && g.productSnapshot ? {
|
|
1471
|
+
...g,
|
|
1488
1472
|
productSnapshot: {
|
|
1489
|
-
...
|
|
1473
|
+
...g.productSnapshot,
|
|
1490
1474
|
quantity: Math.max(
|
|
1491
1475
|
1,
|
|
1492
|
-
|
|
1476
|
+
g.productSnapshot.quantity - 1
|
|
1493
1477
|
)
|
|
1494
1478
|
}
|
|
1495
|
-
} :
|
|
1479
|
+
} : g
|
|
1496
1480
|
)
|
|
1497
1481
|
),
|
|
1498
1482
|
style: {
|
|
1499
1483
|
background: "transparent",
|
|
1500
|
-
color:
|
|
1484
|
+
color: b.themeDarkColor
|
|
1501
1485
|
},
|
|
1502
1486
|
children: "−"
|
|
1503
1487
|
}
|
|
@@ -1507,20 +1491,20 @@ const nt = (t) => {
|
|
|
1507
1491
|
"button",
|
|
1508
1492
|
{
|
|
1509
1493
|
className: "px-3 py-1 text-sm",
|
|
1510
|
-
onClick: () =>
|
|
1511
|
-
(
|
|
1512
|
-
(
|
|
1513
|
-
...
|
|
1494
|
+
onClick: () => B(
|
|
1495
|
+
(S) => S.map(
|
|
1496
|
+
(g, D) => D === x && g.productSnapshot ? {
|
|
1497
|
+
...g,
|
|
1514
1498
|
productSnapshot: {
|
|
1515
|
-
...
|
|
1516
|
-
quantity:
|
|
1499
|
+
...g.productSnapshot,
|
|
1500
|
+
quantity: g.productSnapshot.quantity + 1
|
|
1517
1501
|
}
|
|
1518
|
-
} :
|
|
1502
|
+
} : g
|
|
1519
1503
|
)
|
|
1520
1504
|
),
|
|
1521
1505
|
style: {
|
|
1522
1506
|
background: "transparent",
|
|
1523
|
-
color:
|
|
1507
|
+
color: b.themeDarkColor
|
|
1524
1508
|
},
|
|
1525
1509
|
children: "+"
|
|
1526
1510
|
}
|
|
@@ -1530,21 +1514,21 @@ const nt = (t) => {
|
|
|
1530
1514
|
"button",
|
|
1531
1515
|
{
|
|
1532
1516
|
onClick: () => {
|
|
1533
|
-
|
|
1534
|
-
|
|
1517
|
+
rr(
|
|
1518
|
+
zt(
|
|
1535
1519
|
i.productSnapshot
|
|
1536
1520
|
),
|
|
1537
1521
|
i.productSnapshot.quantity
|
|
1538
1522
|
);
|
|
1539
1523
|
},
|
|
1540
|
-
disabled:
|
|
1524
|
+
disabled: dt,
|
|
1541
1525
|
className: "px-4 py-2 rounded-full font-medium",
|
|
1542
1526
|
style: {
|
|
1543
|
-
background:
|
|
1544
|
-
color: (
|
|
1545
|
-
opacity:
|
|
1527
|
+
background: b.tanyaThemeColor,
|
|
1528
|
+
color: (b == null ? void 0 : b.tanyaThemeContrastColor) || "#fff",
|
|
1529
|
+
opacity: dt ? 0.8 : 1
|
|
1546
1530
|
},
|
|
1547
|
-
children:
|
|
1531
|
+
children: dt ? "Adding..." : "Add to cart"
|
|
1548
1532
|
}
|
|
1549
1533
|
)
|
|
1550
1534
|
] })
|
|
@@ -1554,7 +1538,7 @@ const nt = (t) => {
|
|
|
1554
1538
|
) })
|
|
1555
1539
|
] }) }),
|
|
1556
1540
|
/* @__PURE__ */ a("div", { className: "mb-20" })
|
|
1557
|
-
] },
|
|
1541
|
+
] }, x);
|
|
1558
1542
|
})
|
|
1559
1543
|
]
|
|
1560
1544
|
}
|
|
@@ -1576,7 +1560,7 @@ const nt = (t) => {
|
|
|
1576
1560
|
autoFocus: !0,
|
|
1577
1561
|
onChange: (i) => It(i.target.value),
|
|
1578
1562
|
onKeyDown: (i) => {
|
|
1579
|
-
i.key === "Enter" && !
|
|
1563
|
+
i.key === "Enter" && !ut && U();
|
|
1580
1564
|
}
|
|
1581
1565
|
}
|
|
1582
1566
|
),
|
|
@@ -1584,16 +1568,16 @@ const nt = (t) => {
|
|
|
1584
1568
|
"button",
|
|
1585
1569
|
{
|
|
1586
1570
|
type: "submit",
|
|
1587
|
-
disabled:
|
|
1571
|
+
disabled: ut,
|
|
1588
1572
|
className: "p-3",
|
|
1589
|
-
onClick: () =>
|
|
1590
|
-
children:
|
|
1573
|
+
onClick: () => U(),
|
|
1574
|
+
children: ut ? /* @__PURE__ */ a(
|
|
1591
1575
|
"div",
|
|
1592
1576
|
{
|
|
1593
1577
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
1594
1578
|
style: {
|
|
1595
1579
|
borderBottom: "2px solid",
|
|
1596
|
-
color:
|
|
1580
|
+
color: b.tanyaThemeColor
|
|
1597
1581
|
}
|
|
1598
1582
|
}
|
|
1599
1583
|
) : /* @__PURE__ */ a(
|
|
@@ -1645,14 +1629,14 @@ function Or(t, e) {
|
|
|
1645
1629
|
}
|
|
1646
1630
|
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
1647
1631
|
}
|
|
1648
|
-
var
|
|
1649
|
-
return
|
|
1632
|
+
var rt = function() {
|
|
1633
|
+
return rt = Object.assign || function(e) {
|
|
1650
1634
|
for (var r, o = 1, n = arguments.length; o < n; o++) {
|
|
1651
1635
|
r = arguments[o];
|
|
1652
1636
|
for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (e[c] = r[c]);
|
|
1653
1637
|
}
|
|
1654
1638
|
return e;
|
|
1655
|
-
},
|
|
1639
|
+
}, rt.apply(this, arguments);
|
|
1656
1640
|
};
|
|
1657
1641
|
function $r(t, e) {
|
|
1658
1642
|
var r = {};
|
|
@@ -1662,9 +1646,9 @@ function $r(t, e) {
|
|
|
1662
1646
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1663
1647
|
return r;
|
|
1664
1648
|
}
|
|
1665
|
-
var Qt = "Invariant Violation",
|
|
1649
|
+
var Qt = "Invariant Violation", _e = Object.setPrototypeOf, zr = _e === void 0 ? function(t, e) {
|
|
1666
1650
|
return t.__proto__ = e, t;
|
|
1667
|
-
} :
|
|
1651
|
+
} : _e, Ve = (
|
|
1668
1652
|
/** @class */
|
|
1669
1653
|
(function(t) {
|
|
1670
1654
|
Or(e, t);
|
|
@@ -1676,14 +1660,14 @@ var Qt = "Invariant Violation", Ie = Object.setPrototypeOf, zr = Ie === void 0 ?
|
|
|
1676
1660
|
return e;
|
|
1677
1661
|
})(Error)
|
|
1678
1662
|
);
|
|
1679
|
-
function
|
|
1663
|
+
function at(t, e) {
|
|
1680
1664
|
if (!t)
|
|
1681
|
-
throw new
|
|
1665
|
+
throw new Ve(e);
|
|
1682
1666
|
}
|
|
1683
|
-
var
|
|
1667
|
+
var Ye = ["debug", "log", "warn", "error", "silent"], Ar = Ye.indexOf("log");
|
|
1684
1668
|
function Ut(t) {
|
|
1685
1669
|
return function() {
|
|
1686
|
-
if (
|
|
1670
|
+
if (Ye.indexOf(t) >= Ar) {
|
|
1687
1671
|
var e = console[t] || console.log;
|
|
1688
1672
|
return e.apply(console, arguments);
|
|
1689
1673
|
}
|
|
@@ -1691,8 +1675,8 @@ function Ut(t) {
|
|
|
1691
1675
|
}
|
|
1692
1676
|
(function(t) {
|
|
1693
1677
|
t.debug = Ut("debug"), t.log = Ut("log"), t.warn = Ut("warn"), t.error = Ut("error");
|
|
1694
|
-
})(
|
|
1695
|
-
var
|
|
1678
|
+
})(at || (at = {}));
|
|
1679
|
+
var Ke = "3.14.0";
|
|
1696
1680
|
function yt(t) {
|
|
1697
1681
|
try {
|
|
1698
1682
|
return t();
|
|
@@ -1716,10 +1700,10 @@ const ie = yt(function() {
|
|
|
1716
1700
|
yt(function() {
|
|
1717
1701
|
return yt.constructor("return this")();
|
|
1718
1702
|
});
|
|
1719
|
-
var
|
|
1703
|
+
var Ce = /* @__PURE__ */ new Map();
|
|
1720
1704
|
function jr(t) {
|
|
1721
|
-
var e =
|
|
1722
|
-
return
|
|
1705
|
+
var e = Ce.get(t) || 1;
|
|
1706
|
+
return Ce.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
1723
1707
|
}
|
|
1724
1708
|
function Dr(t, e) {
|
|
1725
1709
|
var r = jr("stringifyForDisplay");
|
|
@@ -1741,20 +1725,20 @@ function qt(t) {
|
|
|
1741
1725
|
var Zt = Object.assign(function(e, r) {
|
|
1742
1726
|
for (var o = [], n = 2; n < arguments.length; n++)
|
|
1743
1727
|
o[n - 2] = arguments[n];
|
|
1744
|
-
e ||
|
|
1728
|
+
e || at(e, ce(r, o) || de(r, o));
|
|
1745
1729
|
}, {
|
|
1746
|
-
debug: qt(
|
|
1747
|
-
log: qt(
|
|
1748
|
-
warn: qt(
|
|
1749
|
-
error: qt(
|
|
1730
|
+
debug: qt(at.debug),
|
|
1731
|
+
log: qt(at.log),
|
|
1732
|
+
warn: qt(at.warn),
|
|
1733
|
+
error: qt(at.error)
|
|
1750
1734
|
});
|
|
1751
|
-
function
|
|
1735
|
+
function Je(t) {
|
|
1752
1736
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
1753
1737
|
e[r - 1] = arguments[r];
|
|
1754
|
-
return new
|
|
1738
|
+
return new Ve(ce(t, e) || de(t, e));
|
|
1755
1739
|
}
|
|
1756
|
-
var
|
|
1757
|
-
function
|
|
1740
|
+
var Ie = Symbol.for("ApolloErrorMessageHandler_" + Ke);
|
|
1741
|
+
function We(t) {
|
|
1758
1742
|
if (typeof t == "string")
|
|
1759
1743
|
return t;
|
|
1760
1744
|
try {
|
|
@@ -1765,14 +1749,14 @@ function Xe(t) {
|
|
|
1765
1749
|
}
|
|
1766
1750
|
function ce(t, e) {
|
|
1767
1751
|
if (e === void 0 && (e = []), !!t)
|
|
1768
|
-
return ie[
|
|
1752
|
+
return ie[Ie] && ie[Ie](t, e.map(We));
|
|
1769
1753
|
}
|
|
1770
1754
|
function de(t, e) {
|
|
1771
1755
|
if (e === void 0 && (e = []), !!t)
|
|
1772
1756
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
1773
|
-
version:
|
|
1757
|
+
version: Ke,
|
|
1774
1758
|
message: t,
|
|
1775
|
-
args: e.map(
|
|
1759
|
+
args: e.map(We)
|
|
1776
1760
|
})));
|
|
1777
1761
|
}
|
|
1778
1762
|
function Lr(t) {
|
|
@@ -1782,8 +1766,8 @@ function Lr(t) {
|
|
|
1782
1766
|
return e.name.value;
|
|
1783
1767
|
})[0] || null;
|
|
1784
1768
|
}
|
|
1785
|
-
let
|
|
1786
|
-
const
|
|
1769
|
+
let N = null;
|
|
1770
|
+
const Fe = {};
|
|
1787
1771
|
let Br = 1;
|
|
1788
1772
|
const Ur = () => class {
|
|
1789
1773
|
constructor() {
|
|
@@ -1795,58 +1779,58 @@ const Ur = () => class {
|
|
|
1795
1779
|
].join(":");
|
|
1796
1780
|
}
|
|
1797
1781
|
hasValue() {
|
|
1798
|
-
for (let e =
|
|
1782
|
+
for (let e = N; e; e = e.parent)
|
|
1799
1783
|
if (this.id in e.slots) {
|
|
1800
1784
|
const r = e.slots[this.id];
|
|
1801
|
-
if (r ===
|
|
1785
|
+
if (r === Fe)
|
|
1802
1786
|
break;
|
|
1803
|
-
return e !==
|
|
1787
|
+
return e !== N && (N.slots[this.id] = r), !0;
|
|
1804
1788
|
}
|
|
1805
|
-
return
|
|
1789
|
+
return N && (N.slots[this.id] = Fe), !1;
|
|
1806
1790
|
}
|
|
1807
1791
|
getValue() {
|
|
1808
1792
|
if (this.hasValue())
|
|
1809
|
-
return
|
|
1793
|
+
return N.slots[this.id];
|
|
1810
1794
|
}
|
|
1811
1795
|
withValue(e, r, o, n) {
|
|
1812
1796
|
const c = {
|
|
1813
1797
|
__proto__: null,
|
|
1814
1798
|
[this.id]: e
|
|
1815
|
-
}, l =
|
|
1816
|
-
|
|
1799
|
+
}, l = N;
|
|
1800
|
+
N = { parent: l, slots: c };
|
|
1817
1801
|
try {
|
|
1818
1802
|
return r.apply(n, o);
|
|
1819
1803
|
} finally {
|
|
1820
|
-
|
|
1804
|
+
N = l;
|
|
1821
1805
|
}
|
|
1822
1806
|
}
|
|
1823
1807
|
// Capture the current context and wrap a callback function so that it
|
|
1824
1808
|
// reestablishes the captured context when called.
|
|
1825
1809
|
static bind(e) {
|
|
1826
|
-
const r =
|
|
1810
|
+
const r = N;
|
|
1827
1811
|
return function() {
|
|
1828
|
-
const o =
|
|
1812
|
+
const o = N;
|
|
1829
1813
|
try {
|
|
1830
|
-
return
|
|
1814
|
+
return N = r, e.apply(this, arguments);
|
|
1831
1815
|
} finally {
|
|
1832
|
-
|
|
1816
|
+
N = o;
|
|
1833
1817
|
}
|
|
1834
1818
|
};
|
|
1835
1819
|
}
|
|
1836
1820
|
// Immediately run a callback function without any captured context.
|
|
1837
1821
|
static noContext(e, r, o) {
|
|
1838
|
-
if (
|
|
1839
|
-
const n =
|
|
1822
|
+
if (N) {
|
|
1823
|
+
const n = N;
|
|
1840
1824
|
try {
|
|
1841
|
-
return
|
|
1825
|
+
return N = null, e.apply(o, r);
|
|
1842
1826
|
} finally {
|
|
1843
|
-
|
|
1827
|
+
N = n;
|
|
1844
1828
|
}
|
|
1845
1829
|
} else
|
|
1846
1830
|
return e.apply(o, r);
|
|
1847
1831
|
}
|
|
1848
1832
|
};
|
|
1849
|
-
function
|
|
1833
|
+
function Ne(t) {
|
|
1850
1834
|
try {
|
|
1851
1835
|
return t();
|
|
1852
1836
|
} catch {
|
|
@@ -1855,18 +1839,18 @@ function Te(t) {
|
|
|
1855
1839
|
const te = "@wry/context:Slot", qr = (
|
|
1856
1840
|
// Prefer globalThis when available.
|
|
1857
1841
|
// https://github.com/benjamn/wryware/issues/347
|
|
1858
|
-
|
|
1842
|
+
Ne(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
1859
1843
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
1860
1844
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
1861
|
-
|
|
1845
|
+
Ne(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
1862
1846
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1863
1847
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1864
1848
|
/* @__PURE__ */ Object.create(null)
|
|
1865
|
-
),
|
|
1849
|
+
), Ee = qr, ue = Ee[te] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1866
1850
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1867
1851
|
Array[te] || (function(t) {
|
|
1868
1852
|
try {
|
|
1869
|
-
Object.defineProperty(
|
|
1853
|
+
Object.defineProperty(Ee, te, {
|
|
1870
1854
|
value: t,
|
|
1871
1855
|
enumerable: !1,
|
|
1872
1856
|
writable: !1,
|
|
@@ -1898,26 +1882,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1898
1882
|
}
|
|
1899
1883
|
function Hr(t, e) {
|
|
1900
1884
|
if (t) {
|
|
1901
|
-
if (typeof t == "string") return
|
|
1885
|
+
if (typeof t == "string") return Te(t, e);
|
|
1902
1886
|
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
1903
1887
|
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
|
|
1904
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
1888
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Te(t, e);
|
|
1905
1889
|
}
|
|
1906
1890
|
}
|
|
1907
|
-
function
|
|
1891
|
+
function Te(t, e) {
|
|
1908
1892
|
(e == null || e > t.length) && (e = t.length);
|
|
1909
1893
|
for (var r = 0, o = new Array(e); r < e; r++)
|
|
1910
1894
|
o[r] = t[r];
|
|
1911
1895
|
return o;
|
|
1912
1896
|
}
|
|
1913
|
-
function
|
|
1897
|
+
function Pe(t, e) {
|
|
1914
1898
|
for (var r = 0; r < e.length; r++) {
|
|
1915
1899
|
var o = e[r];
|
|
1916
1900
|
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
|
|
1917
1901
|
}
|
|
1918
1902
|
}
|
|
1919
1903
|
function pe(t, e, r) {
|
|
1920
|
-
return e &&
|
|
1904
|
+
return e && Pe(t.prototype, e), r && Pe(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
1921
1905
|
}
|
|
1922
1906
|
var fe = function() {
|
|
1923
1907
|
return typeof Symbol == "function";
|
|
@@ -1927,7 +1911,7 @@ var fe = function() {
|
|
|
1927
1911
|
return me(t) ? Symbol[t] : "@@" + t;
|
|
1928
1912
|
};
|
|
1929
1913
|
fe() && !me("observable") && (Symbol.observable = Symbol("observable"));
|
|
1930
|
-
var Rr = he("iterator"), se = he("observable"),
|
|
1914
|
+
var Rr = he("iterator"), se = he("observable"), Ge = he("species");
|
|
1931
1915
|
function Jt(t, e) {
|
|
1932
1916
|
var r = t[e];
|
|
1933
1917
|
if (r != null) {
|
|
@@ -1935,12 +1919,12 @@ function Jt(t, e) {
|
|
|
1935
1919
|
return r;
|
|
1936
1920
|
}
|
|
1937
1921
|
}
|
|
1938
|
-
function
|
|
1922
|
+
function Nt(t) {
|
|
1939
1923
|
var e = t.constructor;
|
|
1940
|
-
return e !== void 0 && (e = e[
|
|
1924
|
+
return e !== void 0 && (e = e[Ge], e === null && (e = void 0)), e !== void 0 ? e : P;
|
|
1941
1925
|
}
|
|
1942
1926
|
function Vr(t) {
|
|
1943
|
-
return t instanceof
|
|
1927
|
+
return t instanceof P;
|
|
1944
1928
|
}
|
|
1945
1929
|
function kt(t) {
|
|
1946
1930
|
kt.log ? kt.log(t) : setTimeout(function() {
|
|
@@ -1956,7 +1940,7 @@ function Ht(t) {
|
|
|
1956
1940
|
}
|
|
1957
1941
|
});
|
|
1958
1942
|
}
|
|
1959
|
-
function
|
|
1943
|
+
function Xe(t) {
|
|
1960
1944
|
var e = t._cleanup;
|
|
1961
1945
|
if (e !== void 0 && (t._cleanup = void 0, !!e))
|
|
1962
1946
|
try {
|
|
@@ -1977,11 +1961,11 @@ function Yr(t) {
|
|
|
1977
1961
|
var e = t._queue;
|
|
1978
1962
|
if (e) {
|
|
1979
1963
|
t._queue = void 0, t._state = "ready";
|
|
1980
|
-
for (var r = 0; r < e.length && (
|
|
1964
|
+
for (var r = 0; r < e.length && (Qe(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
|
|
1981
1965
|
;
|
|
1982
1966
|
}
|
|
1983
1967
|
}
|
|
1984
|
-
function
|
|
1968
|
+
function Qe(t, e, r) {
|
|
1985
1969
|
t._state = "running";
|
|
1986
1970
|
var o = t._observer;
|
|
1987
1971
|
try {
|
|
@@ -2001,7 +1985,7 @@ function tr(t, e, r) {
|
|
|
2001
1985
|
} catch (c) {
|
|
2002
1986
|
kt(c);
|
|
2003
1987
|
}
|
|
2004
|
-
t._state === "closed" ?
|
|
1988
|
+
t._state === "closed" ? Xe(t) : t._state === "running" && (t._state = "ready");
|
|
2005
1989
|
}
|
|
2006
1990
|
function ee(t, e, r) {
|
|
2007
1991
|
if (t._state !== "closed") {
|
|
@@ -2021,7 +2005,7 @@ function ee(t, e, r) {
|
|
|
2021
2005
|
});
|
|
2022
2006
|
return;
|
|
2023
2007
|
}
|
|
2024
|
-
|
|
2008
|
+
Qe(t, e, r);
|
|
2025
2009
|
}
|
|
2026
2010
|
}
|
|
2027
2011
|
var Kr = /* @__PURE__ */ (function() {
|
|
@@ -2037,7 +2021,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2037
2021
|
}
|
|
2038
2022
|
var e = t.prototype;
|
|
2039
2023
|
return e.unsubscribe = function() {
|
|
2040
|
-
this._state !== "closed" && (le(this),
|
|
2024
|
+
this._state !== "closed" && (le(this), Xe(this));
|
|
2041
2025
|
}, pe(t, [{
|
|
2042
2026
|
key: "closed",
|
|
2043
2027
|
get: function() {
|
|
@@ -2061,7 +2045,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2061
2045
|
return this._subscription._state === "closed";
|
|
2062
2046
|
}
|
|
2063
2047
|
}]), t;
|
|
2064
|
-
})(),
|
|
2048
|
+
})(), P = /* @__PURE__ */ (function() {
|
|
2065
2049
|
function t(r) {
|
|
2066
2050
|
if (!(this instanceof t)) throw new TypeError("Observable cannot be called as a function");
|
|
2067
2051
|
if (typeof r != "function") throw new TypeError("Observable initializer must be a function");
|
|
@@ -2085,11 +2069,11 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2085
2069
|
s.unsubscribe(), c();
|
|
2086
2070
|
}
|
|
2087
2071
|
var s = n.subscribe({
|
|
2088
|
-
next: function(
|
|
2072
|
+
next: function(m) {
|
|
2089
2073
|
try {
|
|
2090
|
-
o(
|
|
2091
|
-
} catch (
|
|
2092
|
-
l(
|
|
2074
|
+
o(m, d);
|
|
2075
|
+
} catch (h) {
|
|
2076
|
+
l(h), s.unsubscribe();
|
|
2093
2077
|
}
|
|
2094
2078
|
},
|
|
2095
2079
|
error: l,
|
|
@@ -2099,7 +2083,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2099
2083
|
}, e.map = function(o) {
|
|
2100
2084
|
var n = this;
|
|
2101
2085
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2102
|
-
var c =
|
|
2086
|
+
var c = Nt(this);
|
|
2103
2087
|
return new c(function(l) {
|
|
2104
2088
|
return n.subscribe({
|
|
2105
2089
|
next: function(d) {
|
|
@@ -2121,7 +2105,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2121
2105
|
}, e.filter = function(o) {
|
|
2122
2106
|
var n = this;
|
|
2123
2107
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2124
|
-
var c =
|
|
2108
|
+
var c = Nt(this);
|
|
2125
2109
|
return new c(function(l) {
|
|
2126
2110
|
return n.subscribe({
|
|
2127
2111
|
next: function(d) {
|
|
@@ -2143,92 +2127,92 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2143
2127
|
}, e.reduce = function(o) {
|
|
2144
2128
|
var n = this;
|
|
2145
2129
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2146
|
-
var c =
|
|
2147
|
-
return new c(function(
|
|
2130
|
+
var c = Nt(this), l = arguments.length > 1, d = !1, s = arguments[1], m = s;
|
|
2131
|
+
return new c(function(h) {
|
|
2148
2132
|
return n.subscribe({
|
|
2149
|
-
next: function(
|
|
2150
|
-
var
|
|
2151
|
-
if (d = !0, !
|
|
2133
|
+
next: function(I) {
|
|
2134
|
+
var v = !d;
|
|
2135
|
+
if (d = !0, !v || l)
|
|
2152
2136
|
try {
|
|
2153
|
-
|
|
2154
|
-
} catch (
|
|
2155
|
-
return
|
|
2137
|
+
m = o(m, I);
|
|
2138
|
+
} catch (V) {
|
|
2139
|
+
return h.error(V);
|
|
2156
2140
|
}
|
|
2157
2141
|
else
|
|
2158
|
-
|
|
2142
|
+
m = I;
|
|
2159
2143
|
},
|
|
2160
|
-
error: function(
|
|
2161
|
-
|
|
2144
|
+
error: function(I) {
|
|
2145
|
+
h.error(I);
|
|
2162
2146
|
},
|
|
2163
2147
|
complete: function() {
|
|
2164
|
-
if (!d && !l) return
|
|
2165
|
-
|
|
2148
|
+
if (!d && !l) return h.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2149
|
+
h.next(m), h.complete();
|
|
2166
2150
|
}
|
|
2167
2151
|
});
|
|
2168
2152
|
});
|
|
2169
2153
|
}, e.concat = function() {
|
|
2170
2154
|
for (var o = this, n = arguments.length, c = new Array(n), l = 0; l < n; l++)
|
|
2171
2155
|
c[l] = arguments[l];
|
|
2172
|
-
var d =
|
|
2156
|
+
var d = Nt(this);
|
|
2173
2157
|
return new d(function(s) {
|
|
2174
|
-
var
|
|
2175
|
-
function
|
|
2176
|
-
|
|
2177
|
-
next: function(
|
|
2178
|
-
s.next(
|
|
2158
|
+
var m, h = 0;
|
|
2159
|
+
function I(v) {
|
|
2160
|
+
m = v.subscribe({
|
|
2161
|
+
next: function(V) {
|
|
2162
|
+
s.next(V);
|
|
2179
2163
|
},
|
|
2180
|
-
error: function(
|
|
2181
|
-
s.error(
|
|
2164
|
+
error: function(V) {
|
|
2165
|
+
s.error(V);
|
|
2182
2166
|
},
|
|
2183
2167
|
complete: function() {
|
|
2184
|
-
|
|
2168
|
+
h === c.length ? (m = void 0, s.complete()) : I(d.from(c[h++]));
|
|
2185
2169
|
}
|
|
2186
2170
|
});
|
|
2187
2171
|
}
|
|
2188
|
-
return
|
|
2189
|
-
|
|
2172
|
+
return I(o), function() {
|
|
2173
|
+
m && (m.unsubscribe(), m = void 0);
|
|
2190
2174
|
};
|
|
2191
2175
|
});
|
|
2192
2176
|
}, e.flatMap = function(o) {
|
|
2193
2177
|
var n = this;
|
|
2194
2178
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2195
|
-
var c =
|
|
2179
|
+
var c = Nt(this);
|
|
2196
2180
|
return new c(function(l) {
|
|
2197
2181
|
var d = [], s = n.subscribe({
|
|
2198
|
-
next: function(
|
|
2182
|
+
next: function(h) {
|
|
2199
2183
|
if (o)
|
|
2200
2184
|
try {
|
|
2201
|
-
|
|
2202
|
-
} catch (
|
|
2203
|
-
return l.error(
|
|
2185
|
+
h = o(h);
|
|
2186
|
+
} catch (v) {
|
|
2187
|
+
return l.error(v);
|
|
2204
2188
|
}
|
|
2205
|
-
var
|
|
2206
|
-
next: function(
|
|
2207
|
-
l.next(
|
|
2189
|
+
var I = c.from(h).subscribe({
|
|
2190
|
+
next: function(v) {
|
|
2191
|
+
l.next(v);
|
|
2208
2192
|
},
|
|
2209
|
-
error: function(
|
|
2210
|
-
l.error(
|
|
2193
|
+
error: function(v) {
|
|
2194
|
+
l.error(v);
|
|
2211
2195
|
},
|
|
2212
2196
|
complete: function() {
|
|
2213
|
-
var
|
|
2214
|
-
|
|
2197
|
+
var v = d.indexOf(I);
|
|
2198
|
+
v >= 0 && d.splice(v, 1), m();
|
|
2215
2199
|
}
|
|
2216
2200
|
});
|
|
2217
|
-
d.push(
|
|
2201
|
+
d.push(I);
|
|
2218
2202
|
},
|
|
2219
|
-
error: function(
|
|
2220
|
-
l.error(
|
|
2203
|
+
error: function(h) {
|
|
2204
|
+
l.error(h);
|
|
2221
2205
|
},
|
|
2222
2206
|
complete: function() {
|
|
2223
|
-
|
|
2207
|
+
m();
|
|
2224
2208
|
}
|
|
2225
2209
|
});
|
|
2226
|
-
function
|
|
2210
|
+
function m() {
|
|
2227
2211
|
s.closed && d.length === 0 && l.complete();
|
|
2228
2212
|
}
|
|
2229
2213
|
return function() {
|
|
2230
|
-
d.forEach(function(
|
|
2231
|
-
return
|
|
2214
|
+
d.forEach(function(h) {
|
|
2215
|
+
return h.unsubscribe();
|
|
2232
2216
|
}), s.unsubscribe();
|
|
2233
2217
|
};
|
|
2234
2218
|
});
|
|
@@ -2249,9 +2233,9 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2249
2233
|
return new n(function(d) {
|
|
2250
2234
|
Ht(function() {
|
|
2251
2235
|
if (!d.closed) {
|
|
2252
|
-
for (var s = Mr(c.call(o)),
|
|
2253
|
-
var
|
|
2254
|
-
if (d.next(
|
|
2236
|
+
for (var s = Mr(c.call(o)), m; !(m = s()).done; ) {
|
|
2237
|
+
var h = m.value;
|
|
2238
|
+
if (d.next(h), d.closed) return;
|
|
2255
2239
|
}
|
|
2256
2240
|
d.complete();
|
|
2257
2241
|
}
|
|
@@ -2282,13 +2266,13 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2282
2266
|
});
|
|
2283
2267
|
});
|
|
2284
2268
|
}, pe(t, null, [{
|
|
2285
|
-
key:
|
|
2269
|
+
key: Ge,
|
|
2286
2270
|
get: function() {
|
|
2287
2271
|
return this;
|
|
2288
2272
|
}
|
|
2289
2273
|
}]), t;
|
|
2290
2274
|
})();
|
|
2291
|
-
fe() && Object.defineProperty(
|
|
2275
|
+
fe() && Object.defineProperty(P, Symbol("extensions"), {
|
|
2292
2276
|
value: {
|
|
2293
2277
|
symbol: se,
|
|
2294
2278
|
hostReportError: kt
|
|
@@ -2314,8 +2298,8 @@ function Wr(t) {
|
|
|
2314
2298
|
var vt;
|
|
2315
2299
|
typeof self < "u" ? vt = self : typeof window < "u" ? vt = window : typeof global < "u" ? vt = global : typeof module < "u" ? vt = module : vt = Function("return this")();
|
|
2316
2300
|
Wr(vt);
|
|
2317
|
-
var
|
|
2318
|
-
|
|
2301
|
+
var Oe = P.prototype, $e = "@@observable";
|
|
2302
|
+
Oe[$e] || (Oe[$e] = function() {
|
|
2319
2303
|
return this;
|
|
2320
2304
|
});
|
|
2321
2305
|
function Gr(t) {
|
|
@@ -2328,15 +2312,15 @@ function Gr(t) {
|
|
|
2328
2312
|
], r = 0, o = Object.keys(t); r < o.length; r++) {
|
|
2329
2313
|
var n = o[r];
|
|
2330
2314
|
if (e.indexOf(n) < 0)
|
|
2331
|
-
throw
|
|
2315
|
+
throw Je(58, n);
|
|
2332
2316
|
}
|
|
2333
2317
|
return t;
|
|
2334
2318
|
}
|
|
2335
2319
|
function Xr(t, e) {
|
|
2336
|
-
var r =
|
|
2337
|
-
typeof c == "function" ? r =
|
|
2320
|
+
var r = rt({}, t), o = function(c) {
|
|
2321
|
+
typeof c == "function" ? r = rt(rt({}, r), c(r)) : r = rt(rt({}, r), c);
|
|
2338
2322
|
}, n = function() {
|
|
2339
|
-
return
|
|
2323
|
+
return rt({}, r);
|
|
2340
2324
|
};
|
|
2341
2325
|
return Object.defineProperty(e, "setContext", {
|
|
2342
2326
|
enumerable: !1,
|
|
@@ -2362,16 +2346,16 @@ function ro(t) {
|
|
|
2362
2346
|
function oo(t, e) {
|
|
2363
2347
|
ro(t) || e();
|
|
2364
2348
|
}
|
|
2365
|
-
function
|
|
2366
|
-
return e ? e(t) :
|
|
2349
|
+
function ze(t, e) {
|
|
2350
|
+
return e ? e(t) : P.of();
|
|
2367
2351
|
}
|
|
2368
|
-
function
|
|
2369
|
-
return typeof t == "function" ? new
|
|
2352
|
+
function Et(t) {
|
|
2353
|
+
return typeof t == "function" ? new Ze(t) : t;
|
|
2370
2354
|
}
|
|
2371
2355
|
function Mt(t) {
|
|
2372
2356
|
return t.request.length <= 1;
|
|
2373
2357
|
}
|
|
2374
|
-
var
|
|
2358
|
+
var Ze = (
|
|
2375
2359
|
/** @class */
|
|
2376
2360
|
(function() {
|
|
2377
2361
|
function t(e) {
|
|
@@ -2379,41 +2363,41 @@ var er = (
|
|
|
2379
2363
|
}
|
|
2380
2364
|
return t.empty = function() {
|
|
2381
2365
|
return new t(function() {
|
|
2382
|
-
return
|
|
2366
|
+
return P.of();
|
|
2383
2367
|
});
|
|
2384
2368
|
}, t.from = function(e) {
|
|
2385
|
-
return e.length === 0 ? t.empty() : e.map(
|
|
2369
|
+
return e.length === 0 ? t.empty() : e.map(Et).reduce(function(r, o) {
|
|
2386
2370
|
return r.concat(o);
|
|
2387
2371
|
});
|
|
2388
2372
|
}, t.split = function(e, r, o) {
|
|
2389
|
-
var n =
|
|
2373
|
+
var n = Et(r), c = Et(o || new t(ze)), l;
|
|
2390
2374
|
return Mt(n) && Mt(c) ? l = new t(function(d) {
|
|
2391
|
-
return e(d) ? n.request(d) ||
|
|
2375
|
+
return e(d) ? n.request(d) || P.of() : c.request(d) || P.of();
|
|
2392
2376
|
}) : l = new t(function(d, s) {
|
|
2393
|
-
return e(d) ? n.request(d, s) ||
|
|
2377
|
+
return e(d) ? n.request(d, s) || P.of() : c.request(d, s) || P.of();
|
|
2394
2378
|
}), Object.assign(l, { left: n, right: c });
|
|
2395
2379
|
}, t.execute = function(e, r) {
|
|
2396
|
-
return e.request(Xr(r.context, Qr(Gr(r)))) ||
|
|
2380
|
+
return e.request(Xr(r.context, Qr(Gr(r)))) || P.of();
|
|
2397
2381
|
}, t.concat = function(e, r) {
|
|
2398
|
-
var o =
|
|
2382
|
+
var o = Et(e);
|
|
2399
2383
|
if (Mt(o))
|
|
2400
2384
|
return globalThis.__DEV__ !== !1 && Zt.warn(47, o), o;
|
|
2401
|
-
var n =
|
|
2385
|
+
var n = Et(r), c;
|
|
2402
2386
|
return Mt(n) ? c = new t(function(l) {
|
|
2403
2387
|
return o.request(l, function(d) {
|
|
2404
|
-
return n.request(d) ||
|
|
2405
|
-
}) ||
|
|
2388
|
+
return n.request(d) || P.of();
|
|
2389
|
+
}) || P.of();
|
|
2406
2390
|
}) : c = new t(function(l, d) {
|
|
2407
2391
|
return o.request(l, function(s) {
|
|
2408
|
-
return n.request(s, d) ||
|
|
2409
|
-
}) ||
|
|
2392
|
+
return n.request(s, d) || P.of();
|
|
2393
|
+
}) || P.of();
|
|
2410
2394
|
}), Object.assign(c, { left: o, right: n });
|
|
2411
2395
|
}, t.prototype.split = function(e, r, o) {
|
|
2412
|
-
return this.concat(t.split(e, r, o || new t(
|
|
2396
|
+
return this.concat(t.split(e, r, o || new t(ze)));
|
|
2413
2397
|
}, t.prototype.concat = function(e) {
|
|
2414
2398
|
return t.concat(this, e);
|
|
2415
2399
|
}, t.prototype.request = function(e, r) {
|
|
2416
|
-
throw
|
|
2400
|
+
throw Je(48);
|
|
2417
2401
|
}, t.prototype.onError = function(e, r) {
|
|
2418
2402
|
if (globalThis.__DEV__ !== !1 && oo("onError", function() {
|
|
2419
2403
|
globalThis.__DEV__ !== !1 && Zt.warn(49);
|
|
@@ -2426,9 +2410,9 @@ var er = (
|
|
|
2426
2410
|
})()
|
|
2427
2411
|
);
|
|
2428
2412
|
function no(t) {
|
|
2429
|
-
return new
|
|
2413
|
+
return new Ze(function(e, r) {
|
|
2430
2414
|
var o = $r(e, []);
|
|
2431
|
-
return new
|
|
2415
|
+
return new P(function(n) {
|
|
2432
2416
|
var c, l = !1;
|
|
2433
2417
|
return Promise.resolve(o).then(function(d) {
|
|
2434
2418
|
return t(d, e.getContext());
|
|
@@ -2447,7 +2431,7 @@ function no(t) {
|
|
|
2447
2431
|
const ao = async () => {
|
|
2448
2432
|
const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", o = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
2449
2433
|
try {
|
|
2450
|
-
const n = await
|
|
2434
|
+
const n = await $.post(
|
|
2451
2435
|
t,
|
|
2452
2436
|
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
2453
2437
|
// Only grant_type in body
|
|
@@ -2460,9 +2444,9 @@ const ao = async () => {
|
|
|
2460
2444
|
);
|
|
2461
2445
|
return n.status === 200 && n.data.access_token ? n.data.access_token : (console.error("Failed to fetch token:", n.data), null);
|
|
2462
2446
|
} catch (n) {
|
|
2463
|
-
return
|
|
2447
|
+
return $.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
2464
2448
|
}
|
|
2465
|
-
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so =
|
|
2449
|
+
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so = ir({
|
|
2466
2450
|
uri: `${io}`
|
|
2467
2451
|
}), lo = no(async (t, { headers: e }) => {
|
|
2468
2452
|
const r = await ao();
|
|
@@ -2472,9 +2456,9 @@ const ao = async () => {
|
|
|
2472
2456
|
authorization: `Bearer ${r}`
|
|
2473
2457
|
}
|
|
2474
2458
|
};
|
|
2475
|
-
}), co = new
|
|
2459
|
+
}), co = new sr({
|
|
2476
2460
|
link: lo.concat(so),
|
|
2477
|
-
cache: new
|
|
2461
|
+
cache: new lr(),
|
|
2478
2462
|
defaultOptions: {
|
|
2479
2463
|
watchQuery: {
|
|
2480
2464
|
fetchPolicy: "cache-and-network"
|
|
@@ -2482,7 +2466,7 @@ const ao = async () => {
|
|
|
2482
2466
|
}
|
|
2483
2467
|
}), Fo = (t) => {
|
|
2484
2468
|
const { tanyaConfig: e } = t;
|
|
2485
|
-
return /* @__PURE__ */ a(
|
|
2469
|
+
return /* @__PURE__ */ a(cr, { client: co, children: /* @__PURE__ */ a(xr, { children: /* @__PURE__ */ a(Pr, { tanyaConfig: e }) }) });
|
|
2486
2470
|
};
|
|
2487
2471
|
export {
|
|
2488
2472
|
Fo as TanyaChatbot,
|