tanya-chatbot 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tanya-chatbot.cjs.js +12 -12
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +1635 -1633
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +2 -3
- package/dist/tanya-chatbot.css +0 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as l, jsxs as p, Fragment as
|
|
2
|
-
import { createHttpLink as
|
|
3
|
-
import { Provider as
|
|
4
|
-
import { createSlice as
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import * as
|
|
1
|
+
import { jsx as l, jsxs as p, Fragment as fe } from "react/jsx-runtime";
|
|
2
|
+
import { createHttpLink as Xr, ApolloClient as Zr, InMemoryCache as tn, ApolloProvider as en } from "@apollo/client";
|
|
3
|
+
import { Provider as rn, useDispatch as hr, useSelector as Kt } from "react-redux";
|
|
4
|
+
import { createSlice as mr, configureStore as nn } from "@reduxjs/toolkit";
|
|
5
|
+
import { forwardRef as gr, useState as D, useEffect as gt, createElement as pe, useRef as Ot } from "react";
|
|
6
|
+
import * as wr from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
|
-
import
|
|
9
|
+
import U from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
|
-
import { Icon as
|
|
12
|
-
import { toast as
|
|
13
|
-
const or = {
|
|
11
|
+
import { Icon as Le } from "@iconify/react";
|
|
12
|
+
import { toast as X } from "react-toastify";
|
|
13
|
+
const on = '*,: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-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.p-\\[5px\\]{padding:5px}.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;background-color:#1a1a1a;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}}', an = {
|
|
14
14
|
store: {
|
|
15
15
|
storeCode: "",
|
|
16
16
|
storeName: "",
|
|
@@ -44,123 +44,123 @@ const or = {
|
|
|
44
44
|
mobile: []
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
},
|
|
47
|
+
}, yr = mr({
|
|
48
48
|
name: "store",
|
|
49
|
-
initialState:
|
|
49
|
+
initialState: an,
|
|
50
50
|
reducers: {
|
|
51
|
-
setStore: (
|
|
52
|
-
|
|
51
|
+
setStore: (t, e) => {
|
|
52
|
+
t.store = e.payload;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
}), { setStore:
|
|
55
|
+
}), { setStore: ha } = yr.actions, sn = yr.reducer, cn = {
|
|
56
56
|
product: null
|
|
57
|
-
},
|
|
57
|
+
}, br = mr({
|
|
58
58
|
name: "product",
|
|
59
|
-
initialState:
|
|
59
|
+
initialState: cn,
|
|
60
60
|
reducers: {
|
|
61
|
-
setProduct: (
|
|
62
|
-
|
|
61
|
+
setProduct: (t, e) => {
|
|
62
|
+
t.product = e.payload;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
}), { setProduct:
|
|
65
|
+
}), { setProduct: he } = br.actions, ln = br.reducer, un = nn({
|
|
66
66
|
reducer: {
|
|
67
|
-
store:
|
|
68
|
-
product:
|
|
67
|
+
store: sn,
|
|
68
|
+
product: ln
|
|
69
69
|
}
|
|
70
|
-
}),
|
|
71
|
-
const
|
|
70
|
+
}), dn = ({ children: t }) => /* @__PURE__ */ l(rn, { store: un, children: t }), Ft = (t) => {
|
|
71
|
+
const e = new CustomEvent("reactCartUpdated", {
|
|
72
72
|
detail: {
|
|
73
73
|
cartUpdated: !0,
|
|
74
|
-
basketId:
|
|
74
|
+
basketId: t
|
|
75
75
|
// any other data SFCC needs
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
-
window.dispatchEvent(
|
|
78
|
+
window.dispatchEvent(e);
|
|
79
79
|
};
|
|
80
|
-
function
|
|
81
|
-
...
|
|
80
|
+
function fn({
|
|
81
|
+
...t
|
|
82
82
|
}) {
|
|
83
|
-
return /* @__PURE__ */ l(
|
|
83
|
+
return /* @__PURE__ */ l(wr.Root, { "data-slot": "popover", ...t });
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
...
|
|
85
|
+
function pn({
|
|
86
|
+
...t
|
|
87
87
|
}) {
|
|
88
|
-
return /* @__PURE__ */ l(
|
|
88
|
+
return /* @__PURE__ */ l(wr.Trigger, { "data-slot": "popover-trigger", ...t });
|
|
89
89
|
}
|
|
90
|
-
const
|
|
91
|
-
const
|
|
90
|
+
const wt = () => ({ 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" }), xr = async () => {
|
|
91
|
+
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
92
92
|
try {
|
|
93
|
-
const
|
|
94
|
-
`${
|
|
93
|
+
const e = await U.post(
|
|
94
|
+
`${t}api/auth/token-bm-grant?baseUrl=${ct()}&siteId=${rt()}`
|
|
95
95
|
);
|
|
96
|
-
return
|
|
97
|
-
} catch (
|
|
98
|
-
return
|
|
96
|
+
return e.status === 200 && e.data.access_token ? e.data.access_token : (console.error("Failed to fetch token:", e.data), null);
|
|
97
|
+
} catch (e) {
|
|
98
|
+
return U.isAxiosError(e) ? console.error("Error fetching token:", e.response || e.message) : console.error("Unexpected error:", e), null;
|
|
99
99
|
}
|
|
100
|
-
},
|
|
101
|
-
const
|
|
100
|
+
}, vr = async (t) => {
|
|
101
|
+
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
102
102
|
try {
|
|
103
|
-
const
|
|
104
|
-
`${
|
|
103
|
+
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, n = await U.post(
|
|
104
|
+
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${ct()}&siteId=${rt()}&pubCfg=${lt()}&envRef=${ut()}&orgRef=${dt()}`,
|
|
105
105
|
{},
|
|
106
106
|
{
|
|
107
107
|
headers: {
|
|
108
108
|
"Content-Type": "application/json",
|
|
109
|
-
Authorization: `Bearer ${
|
|
109
|
+
Authorization: `Bearer ${t}`
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
);
|
|
113
|
-
return
|
|
114
|
-
} catch (
|
|
115
|
-
return
|
|
113
|
+
return n.status === 200 && n.data ? n.data : null;
|
|
114
|
+
} catch (r) {
|
|
115
|
+
return U.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
async function
|
|
119
|
-
const
|
|
118
|
+
async function Zt() {
|
|
119
|
+
const t = localStorage.getItem("expires_in"), e = localStorage.getItem("access_token"), r = JSON.parse(
|
|
120
120
|
sessionStorage.getItem("customerData") || "{}"
|
|
121
121
|
).isGuest;
|
|
122
|
-
if (
|
|
123
|
-
return console.log("access token found in local storage"), { access_token:
|
|
124
|
-
const { serverUrl:
|
|
122
|
+
if (t && e && (/* @__PURE__ */ new Date()).getTime() < parseInt(t) && r === JSON.parse(localStorage.getItem("isGuest") || "false"))
|
|
123
|
+
return console.log("access token found in local storage"), { access_token: e, expires_in: t };
|
|
124
|
+
const { serverUrl: n } = wt(), o = JSON.parse(
|
|
125
125
|
sessionStorage.getItem("customerData") || "{}"
|
|
126
|
-
).dwsid,
|
|
126
|
+
).dwsid, a = JSON.parse(
|
|
127
127
|
sessionStorage.getItem("customerData") || "{}"
|
|
128
128
|
).usrRef;
|
|
129
129
|
try {
|
|
130
|
-
const i =
|
|
131
|
-
`${
|
|
130
|
+
const i = r ? "unregister-auth" : "register-auth", c = await U.get(
|
|
131
|
+
`${n}sc-api/${i}?dwsid=${o}&email=${a}&pubCfg=${lt()}&envRef=${ut()}&orgRef=${dt()}&siteId=${rt()}`
|
|
132
132
|
);
|
|
133
133
|
return localStorage.setItem("access_token", c.data.access_token), localStorage.setItem(
|
|
134
134
|
"expires_in",
|
|
135
135
|
String((/* @__PURE__ */ new Date()).getTime() + c.data.expires_in * 1e3)
|
|
136
|
-
), localStorage.setItem("isGuest",
|
|
136
|
+
), localStorage.setItem("isGuest", r.toString()), console.log(c.data), c.data;
|
|
137
137
|
} catch (i) {
|
|
138
138
|
console.log(i);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
const { serverUrl:
|
|
141
|
+
const ct = () => sessionStorage.getItem("Host"), rt = () => sessionStorage.getItem("SiteId"), lt = () => sessionStorage.getItem("pubCfg"), ut = () => sessionStorage.getItem("envRef"), dt = () => sessionStorage.getItem("orgRef"), ze = async (t, e) => {
|
|
142
|
+
const { serverUrl: r, basePath: n } = wt();
|
|
143
143
|
try {
|
|
144
|
-
const o =
|
|
145
|
-
return (await
|
|
146
|
-
`${
|
|
144
|
+
const o = ct();
|
|
145
|
+
return (await U.get(
|
|
146
|
+
`${r}${n}/search-sfcc?baseUrl=${o}&query=${t}&siteId=${rt()}&pubCfg=${lt()}&envRef=${ut()}&orgRef=${dt()}`,
|
|
147
147
|
{
|
|
148
148
|
headers: {
|
|
149
149
|
"Content-Type": "application/json",
|
|
150
|
-
Authorization: `Bearer ${
|
|
150
|
+
Authorization: `Bearer ${e}`
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
)).data.hits;
|
|
154
154
|
} catch (o) {
|
|
155
155
|
throw console.error("Error fetching search results:", o), o;
|
|
156
156
|
}
|
|
157
|
-
},
|
|
158
|
-
if (!
|
|
159
|
-
const { serverUrl:
|
|
157
|
+
}, kr = async (t) => {
|
|
158
|
+
if (!t) throw new Error("Product ID is required");
|
|
159
|
+
const { serverUrl: e, basePath: r } = wt(), n = ct();
|
|
160
160
|
console.log("calling access");
|
|
161
|
-
const { access_token: o } = await
|
|
162
|
-
return console.log(o), (await
|
|
163
|
-
`${
|
|
161
|
+
const { access_token: o } = await Zt();
|
|
162
|
+
return console.log(o), (await U.get(
|
|
163
|
+
`${e}${r}/product-sfcc/${t}?baseUrl=${n}&siteId=${rt()}&pubCfg=${lt()}&envRef=${ut()}&orgRef=${dt()}`,
|
|
164
164
|
{
|
|
165
165
|
headers: {
|
|
166
166
|
"Content-Type": "application/json",
|
|
@@ -168,13 +168,13 @@ const ce = () => sessionStorage.getItem("Host"), ne = () => sessionStorage.getIt
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
)).data;
|
|
171
|
-
},
|
|
172
|
-
if (!
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
), { serverUrl:
|
|
176
|
-
return (await
|
|
177
|
-
`${
|
|
171
|
+
}, hn = async (t) => {
|
|
172
|
+
if (!t) throw new Error("customerId is required");
|
|
173
|
+
const e = await xr(), { customer_token: r } = await vr(
|
|
174
|
+
e
|
|
175
|
+
), { serverUrl: n, basePath: o } = wt(), i = (await Zt()).access_token;
|
|
176
|
+
return (await U.get(
|
|
177
|
+
`${n}${o}/get-interest?baseUrl=${ct()}&customerId=${t}&siteId=${rt()}&pubCfg=${lt()}&envRef=${ut()}&orgRef=${dt()}`,
|
|
178
178
|
{
|
|
179
179
|
headers: {
|
|
180
180
|
"Content-Type": "application/json",
|
|
@@ -182,527 +182,527 @@ const ce = () => sessionStorage.getItem("Host"), ne = () => sessionStorage.getIt
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
)).data;
|
|
185
|
-
},
|
|
185
|
+
}, De = (t) => String(typeof t == "string" ? t : t["en-US"] || t), Me = (t) => t != null && t.image ? [t.image] : "variants" in t ? t.variants[0].images : t.masterVariant.images.map((e) => e.url), mn = (t, e) => t.toLocaleString("en-US", {
|
|
186
186
|
style: "currency",
|
|
187
|
-
currency:
|
|
188
|
-
}),
|
|
189
|
-
var
|
|
190
|
-
return "variants" in
|
|
191
|
-
centAmount: (
|
|
187
|
+
currency: e || "USD"
|
|
188
|
+
}), Ue = (t) => {
|
|
189
|
+
var e, r, n;
|
|
190
|
+
return "variants" in t ? {
|
|
191
|
+
centAmount: (e = t.variants[0]) == null ? void 0 : e.prices.EUR.max,
|
|
192
192
|
currencyCode: "DOL"
|
|
193
193
|
} : {
|
|
194
|
-
centAmount: (
|
|
195
|
-
currencyCode: (
|
|
194
|
+
centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
195
|
+
currencyCode: (n = t.masterVariant) == null ? void 0 : n.prices[0].value.currencyCode
|
|
196
196
|
};
|
|
197
|
-
},
|
|
198
|
-
const
|
|
199
|
-
return
|
|
197
|
+
}, gn = (t) => t.charAt(0).toUpperCase() + t.slice(1), Be = (t, e) => t.length < e ? t : t.slice(0, e) + "...", ae = (t) => t.split("\\n").map((e, r) => {
|
|
198
|
+
const n = e.match(/^(\d+)\.\s(.+)/);
|
|
199
|
+
return n ? `<p key=${r} class="mb-2"><strong>${n[1]}.</strong> ${n[2]}</p>` : e.trim() ? `<p key=${r} class="mb-2">${e}</p>` : "<br/>";
|
|
200
200
|
}).join("");
|
|
201
|
-
function
|
|
202
|
-
const
|
|
203
|
-
function
|
|
204
|
-
if (
|
|
201
|
+
function wn(t, e) {
|
|
202
|
+
const r = t.icons, n = t.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
|
|
203
|
+
function a(i) {
|
|
204
|
+
if (r[i]) return o[i] = [];
|
|
205
205
|
if (!(i in o)) {
|
|
206
206
|
o[i] = null;
|
|
207
|
-
const c =
|
|
208
|
-
|
|
207
|
+
const c = n[i] && n[i].parent, s = c && a(c);
|
|
208
|
+
s && (o[i] = [c].concat(s));
|
|
209
209
|
}
|
|
210
210
|
return o[i];
|
|
211
211
|
}
|
|
212
|
-
return Object.keys(
|
|
212
|
+
return Object.keys(r).concat(Object.keys(n)).forEach(a), o;
|
|
213
213
|
}
|
|
214
|
-
const
|
|
214
|
+
const Sr = Object.freeze({
|
|
215
215
|
left: 0,
|
|
216
216
|
top: 0,
|
|
217
217
|
width: 16,
|
|
218
218
|
height: 16
|
|
219
|
-
}),
|
|
219
|
+
}), Gt = Object.freeze({
|
|
220
220
|
rotate: 0,
|
|
221
221
|
vFlip: !1,
|
|
222
222
|
hFlip: !1
|
|
223
|
-
}),
|
|
224
|
-
...
|
|
225
|
-
...
|
|
226
|
-
}),
|
|
227
|
-
...
|
|
223
|
+
}), Se = Object.freeze({
|
|
224
|
+
...Sr,
|
|
225
|
+
...Gt
|
|
226
|
+
}), me = Object.freeze({
|
|
227
|
+
...Se,
|
|
228
228
|
body: "",
|
|
229
229
|
hidden: !1
|
|
230
230
|
});
|
|
231
|
-
function
|
|
232
|
-
const
|
|
233
|
-
!
|
|
234
|
-
const
|
|
235
|
-
return
|
|
236
|
-
}
|
|
237
|
-
function
|
|
238
|
-
const
|
|
239
|
-
for (const
|
|
240
|
-
return
|
|
231
|
+
function yn(t, e) {
|
|
232
|
+
const r = {};
|
|
233
|
+
!t.hFlip != !e.hFlip && (r.hFlip = !0), !t.vFlip != !e.vFlip && (r.vFlip = !0);
|
|
234
|
+
const n = ((t.rotate || 0) + (e.rotate || 0)) % 4;
|
|
235
|
+
return n && (r.rotate = n), r;
|
|
236
|
+
}
|
|
237
|
+
function qe(t, e) {
|
|
238
|
+
const r = yn(t, e);
|
|
239
|
+
for (const n in me) n in Gt ? n in t && !(n in r) && (r[n] = Gt[n]) : n in e ? r[n] = e[n] : n in t && (r[n] = t[n]);
|
|
240
|
+
return r;
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
const
|
|
244
|
-
let
|
|
242
|
+
function bn(t, e, r) {
|
|
243
|
+
const n = t.icons, o = t.aliases || /* @__PURE__ */ Object.create(null);
|
|
244
|
+
let a = {};
|
|
245
245
|
function i(c) {
|
|
246
|
-
|
|
246
|
+
a = qe(n[c] || o[c], a);
|
|
247
247
|
}
|
|
248
|
-
return i(
|
|
248
|
+
return i(e), r.forEach(i), qe(t, a);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
const
|
|
252
|
-
if (typeof
|
|
253
|
-
|
|
254
|
-
|
|
250
|
+
function Cr(t, e) {
|
|
251
|
+
const r = [];
|
|
252
|
+
if (typeof t != "object" || typeof t.icons != "object") return r;
|
|
253
|
+
t.not_found instanceof Array && t.not_found.forEach((o) => {
|
|
254
|
+
e(o, null), r.push(o);
|
|
255
255
|
});
|
|
256
|
-
const
|
|
257
|
-
for (const o in
|
|
258
|
-
const
|
|
259
|
-
|
|
256
|
+
const n = wn(t);
|
|
257
|
+
for (const o in n) {
|
|
258
|
+
const a = n[o];
|
|
259
|
+
a && (e(o, bn(t, o, a)), r.push(o));
|
|
260
260
|
}
|
|
261
|
-
return
|
|
261
|
+
return r;
|
|
262
262
|
}
|
|
263
|
-
const
|
|
263
|
+
const xn = {
|
|
264
264
|
provider: "",
|
|
265
265
|
aliases: {},
|
|
266
266
|
not_found: {},
|
|
267
|
-
...
|
|
267
|
+
...Sr
|
|
268
268
|
};
|
|
269
|
-
function
|
|
270
|
-
for (const
|
|
269
|
+
function ie(t, e) {
|
|
270
|
+
for (const r in e) if (r in t && typeof t[r] != typeof e[r]) return !1;
|
|
271
271
|
return !0;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
if (typeof
|
|
275
|
-
const
|
|
276
|
-
if (typeof
|
|
277
|
-
const
|
|
278
|
-
for (const o in n) {
|
|
279
|
-
const s = n[o];
|
|
280
|
-
if (!o || typeof s.body != "string" || !it(s, mt)) return null;
|
|
281
|
-
}
|
|
282
|
-
const r = t.aliases || /* @__PURE__ */ Object.create(null);
|
|
273
|
+
function Ir(t) {
|
|
274
|
+
if (typeof t != "object" || t === null) return null;
|
|
275
|
+
const e = t;
|
|
276
|
+
if (typeof e.prefix != "string" || !t.icons || typeof t.icons != "object" || !ie(t, xn)) return null;
|
|
277
|
+
const r = e.icons;
|
|
283
278
|
for (const o in r) {
|
|
284
|
-
const
|
|
285
|
-
if (!o || typeof
|
|
279
|
+
const a = r[o];
|
|
280
|
+
if (!o || typeof a.body != "string" || !ie(a, me)) return null;
|
|
286
281
|
}
|
|
287
|
-
|
|
282
|
+
const n = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
283
|
+
for (const o in n) {
|
|
284
|
+
const a = n[o], i = a.parent;
|
|
285
|
+
if (!o || typeof i != "string" || !r[i] && !n[i] || !ie(a, me)) return null;
|
|
286
|
+
}
|
|
287
|
+
return e;
|
|
288
288
|
}
|
|
289
|
-
const
|
|
290
|
-
function
|
|
289
|
+
const Re = /* @__PURE__ */ Object.create(null);
|
|
290
|
+
function vn(t, e) {
|
|
291
291
|
return {
|
|
292
|
-
provider:
|
|
293
|
-
prefix:
|
|
292
|
+
provider: t,
|
|
293
|
+
prefix: e,
|
|
294
294
|
icons: /* @__PURE__ */ Object.create(null),
|
|
295
295
|
missing: /* @__PURE__ */ new Set()
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
const
|
|
300
|
-
return
|
|
298
|
+
function Et(t, e) {
|
|
299
|
+
const r = Re[t] || (Re[t] = /* @__PURE__ */ Object.create(null));
|
|
300
|
+
return r[e] || (r[e] = vn(t, e));
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
return
|
|
304
|
-
|
|
302
|
+
function _r(t, e) {
|
|
303
|
+
return Ir(e) ? Cr(e, (r, n) => {
|
|
304
|
+
n ? t.icons[r] = n : t.missing.add(r);
|
|
305
305
|
}) : [];
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function kn(t, e, r) {
|
|
308
308
|
try {
|
|
309
|
-
if (typeof
|
|
310
|
-
return
|
|
309
|
+
if (typeof r.body == "string")
|
|
310
|
+
return t.icons[e] = { ...r }, !0;
|
|
311
311
|
} catch {
|
|
312
312
|
}
|
|
313
313
|
return !1;
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
const o =
|
|
317
|
-
if (
|
|
315
|
+
const Fr = /^[a-z0-9]+(-[a-z0-9]+)*$/, te = (t, e, r, n = "") => {
|
|
316
|
+
const o = t.split(":");
|
|
317
|
+
if (t.slice(0, 1) === "@") {
|
|
318
318
|
if (o.length < 2 || o.length > 3) return null;
|
|
319
|
-
|
|
319
|
+
n = o.shift().slice(1);
|
|
320
320
|
}
|
|
321
321
|
if (o.length > 3 || !o.length) return null;
|
|
322
322
|
if (o.length > 1) {
|
|
323
|
-
const c = o.pop(),
|
|
324
|
-
provider: o.length > 0 ? o[0] :
|
|
325
|
-
prefix:
|
|
323
|
+
const c = o.pop(), s = o.pop(), u = {
|
|
324
|
+
provider: o.length > 0 ? o[0] : n,
|
|
325
|
+
prefix: s,
|
|
326
326
|
name: c
|
|
327
327
|
};
|
|
328
|
-
return
|
|
328
|
+
return e && !Vt(u) ? null : u;
|
|
329
329
|
}
|
|
330
|
-
const
|
|
330
|
+
const a = o[0], i = a.split("-");
|
|
331
331
|
if (i.length > 1) {
|
|
332
332
|
const c = {
|
|
333
|
-
provider:
|
|
333
|
+
provider: n,
|
|
334
334
|
prefix: i.shift(),
|
|
335
335
|
name: i.join("-")
|
|
336
336
|
};
|
|
337
|
-
return
|
|
337
|
+
return e && !Vt(c) ? null : c;
|
|
338
338
|
}
|
|
339
|
-
if (
|
|
339
|
+
if (r && n === "") {
|
|
340
340
|
const c = {
|
|
341
|
-
provider:
|
|
341
|
+
provider: n,
|
|
342
342
|
prefix: "",
|
|
343
|
-
name:
|
|
343
|
+
name: a
|
|
344
344
|
};
|
|
345
|
-
return
|
|
345
|
+
return e && !Vt(c, r) ? null : c;
|
|
346
346
|
}
|
|
347
347
|
return null;
|
|
348
|
-
},
|
|
349
|
-
let
|
|
350
|
-
function
|
|
351
|
-
return typeof
|
|
348
|
+
}, Vt = (t, e) => t ? !!((e && t.prefix === "" || t.prefix) && t.name) : !1;
|
|
349
|
+
let Mt = !1;
|
|
350
|
+
function Nr(t) {
|
|
351
|
+
return typeof t == "boolean" && (Mt = t), Mt;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
356
|
-
const
|
|
357
|
-
return
|
|
353
|
+
function He(t) {
|
|
354
|
+
const e = typeof t == "string" ? te(t, !0, Mt) : t;
|
|
355
|
+
if (e) {
|
|
356
|
+
const r = Et(e.provider, e.prefix), n = e.name;
|
|
357
|
+
return r.icons[n] || (r.missing.has(n) ? null : void 0);
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
const
|
|
362
|
-
if (!
|
|
363
|
-
const
|
|
364
|
-
return
|
|
360
|
+
function Sn(t, e) {
|
|
361
|
+
const r = te(t, !0, Mt);
|
|
362
|
+
if (!r) return !1;
|
|
363
|
+
const n = Et(r.provider, r.prefix);
|
|
364
|
+
return e ? kn(n, r.name, e) : (n.missing.add(r.name), !0);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
if (typeof
|
|
368
|
-
if (typeof
|
|
366
|
+
function Cn(t, e) {
|
|
367
|
+
if (typeof t != "object") return !1;
|
|
368
|
+
if (typeof e != "string" && (e = t.provider || ""), Mt && !e && !t.prefix) {
|
|
369
369
|
let o = !1;
|
|
370
|
-
return
|
|
371
|
-
|
|
370
|
+
return Ir(t) && (t.prefix = "", Cr(t, (a, i) => {
|
|
371
|
+
Sn(a, i) && (o = !0);
|
|
372
372
|
})), o;
|
|
373
373
|
}
|
|
374
|
-
const
|
|
375
|
-
if (!
|
|
376
|
-
prefix:
|
|
374
|
+
const r = t.prefix;
|
|
375
|
+
if (!Vt({
|
|
376
|
+
prefix: r,
|
|
377
377
|
name: "a"
|
|
378
378
|
})) return !1;
|
|
379
|
-
const
|
|
380
|
-
return !!
|
|
379
|
+
const n = Et(e, r);
|
|
380
|
+
return !!_r(n, t);
|
|
381
381
|
}
|
|
382
|
-
const
|
|
382
|
+
const Er = Object.freeze({
|
|
383
383
|
width: null,
|
|
384
384
|
height: null
|
|
385
|
-
}),
|
|
386
|
-
...
|
|
387
|
-
...
|
|
388
|
-
}),
|
|
389
|
-
function
|
|
390
|
-
if (
|
|
391
|
-
if (
|
|
392
|
-
if (typeof
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
385
|
+
}), Tr = Object.freeze({
|
|
386
|
+
...Er,
|
|
387
|
+
...Gt
|
|
388
|
+
}), In = /(-?[0-9.]*[0-9]+[0-9.]*)/g, _n = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
389
|
+
function Ve(t, e, r) {
|
|
390
|
+
if (e === 1) return t;
|
|
391
|
+
if (r = r || 100, typeof t == "number") return Math.ceil(t * e * r) / r;
|
|
392
|
+
if (typeof t != "string") return t;
|
|
393
|
+
const n = t.split(In);
|
|
394
|
+
if (n === null || !n.length) return t;
|
|
395
395
|
const o = [];
|
|
396
|
-
let
|
|
396
|
+
let a = n.shift(), i = _n.test(a);
|
|
397
397
|
for (; ; ) {
|
|
398
398
|
if (i) {
|
|
399
|
-
const c = parseFloat(
|
|
400
|
-
isNaN(c) ? o.push(
|
|
401
|
-
} else o.push(
|
|
402
|
-
if (
|
|
399
|
+
const c = parseFloat(a);
|
|
400
|
+
isNaN(c) ? o.push(a) : o.push(Math.ceil(c * e * r) / r);
|
|
401
|
+
} else o.push(a);
|
|
402
|
+
if (a = n.shift(), a === void 0) return o.join("");
|
|
403
403
|
i = !i;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
function
|
|
407
|
-
let
|
|
408
|
-
const
|
|
409
|
-
for (;
|
|
410
|
-
const o =
|
|
411
|
-
if (o === -1 ||
|
|
412
|
-
const i =
|
|
406
|
+
function Fn(t, e = "defs") {
|
|
407
|
+
let r = "";
|
|
408
|
+
const n = t.indexOf("<" + e);
|
|
409
|
+
for (; n >= 0; ) {
|
|
410
|
+
const o = t.indexOf(">", n), a = t.indexOf("</" + e);
|
|
411
|
+
if (o === -1 || a === -1) break;
|
|
412
|
+
const i = t.indexOf(">", a);
|
|
413
413
|
if (i === -1) break;
|
|
414
|
-
|
|
414
|
+
r += t.slice(o + 1, a).trim(), t = t.slice(0, n).trim() + t.slice(i + 1);
|
|
415
415
|
}
|
|
416
416
|
return {
|
|
417
|
-
defs:
|
|
418
|
-
content:
|
|
417
|
+
defs: r,
|
|
418
|
+
content: t
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
return
|
|
421
|
+
function Nn(t, e) {
|
|
422
|
+
return t ? "<defs>" + t + "</defs>" + e : e;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
const
|
|
426
|
-
return
|
|
424
|
+
function En(t, e, r) {
|
|
425
|
+
const n = Fn(t);
|
|
426
|
+
return Nn(n.defs, e + n.content + r);
|
|
427
427
|
}
|
|
428
|
-
const
|
|
429
|
-
function
|
|
430
|
-
const
|
|
431
|
-
...
|
|
432
|
-
...e
|
|
433
|
-
}, r = {
|
|
434
|
-
...Pn,
|
|
428
|
+
const Tn = (t) => t === "unset" || t === "undefined" || t === "none";
|
|
429
|
+
function Pn(t, e) {
|
|
430
|
+
const r = {
|
|
431
|
+
...Se,
|
|
435
432
|
...t
|
|
433
|
+
}, n = {
|
|
434
|
+
...Tr,
|
|
435
|
+
...e
|
|
436
436
|
}, o = {
|
|
437
|
-
left:
|
|
438
|
-
top:
|
|
439
|
-
width:
|
|
440
|
-
height:
|
|
437
|
+
left: r.left,
|
|
438
|
+
top: r.top,
|
|
439
|
+
width: r.width,
|
|
440
|
+
height: r.height
|
|
441
441
|
};
|
|
442
|
-
let
|
|
443
|
-
[
|
|
444
|
-
const
|
|
442
|
+
let a = r.body;
|
|
443
|
+
[r, n].forEach((_) => {
|
|
444
|
+
const w = [], v = _.hFlip, B = _.vFlip;
|
|
445
445
|
let P = _.rotate;
|
|
446
|
-
v ? B ? P += 2 : (
|
|
447
|
-
let
|
|
446
|
+
v ? B ? P += 2 : (w.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), w.push("scale(-1 1)"), o.top = o.left = 0) : B && (w.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), w.push("scale(1 -1)"), o.top = o.left = 0);
|
|
447
|
+
let $;
|
|
448
448
|
switch (P < 0 && (P -= Math.floor(P / 4) * 4), P = P % 4, P) {
|
|
449
449
|
case 1:
|
|
450
|
-
|
|
450
|
+
$ = o.height / 2 + o.top, w.unshift("rotate(90 " + $.toString() + " " + $.toString() + ")");
|
|
451
451
|
break;
|
|
452
452
|
case 2:
|
|
453
|
-
|
|
453
|
+
w.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
|
|
454
454
|
break;
|
|
455
455
|
case 3:
|
|
456
|
-
|
|
456
|
+
$ = o.width / 2 + o.left, w.unshift("rotate(-90 " + $.toString() + " " + $.toString() + ")");
|
|
457
457
|
break;
|
|
458
458
|
}
|
|
459
|
-
P % 2 === 1 && (o.left !== o.top && (
|
|
459
|
+
P % 2 === 1 && (o.left !== o.top && ($ = o.left, o.left = o.top, o.top = $), o.width !== o.height && ($ = o.width, o.width = o.height, o.height = $)), w.length && (a = En(a, '<g transform="' + w.join(" ") + '">', "</g>"));
|
|
460
460
|
});
|
|
461
|
-
const i =
|
|
462
|
-
let
|
|
463
|
-
i === null ? (h = c === null ? "1em" : c === "auto" ? u : c,
|
|
464
|
-
const m = {}, g = (_,
|
|
465
|
-
|
|
461
|
+
const i = n.width, c = n.height, s = o.width, u = o.height;
|
|
462
|
+
let f, h;
|
|
463
|
+
i === null ? (h = c === null ? "1em" : c === "auto" ? u : c, f = Ve(h, s / u)) : (f = i === "auto" ? s : i, h = c === null ? Ve(f, u / s) : c === "auto" ? u : c);
|
|
464
|
+
const m = {}, g = (_, w) => {
|
|
465
|
+
Tn(w) || (m[_] = w.toString());
|
|
466
466
|
};
|
|
467
|
-
g("width",
|
|
468
|
-
const
|
|
467
|
+
g("width", f), g("height", h);
|
|
468
|
+
const k = [
|
|
469
469
|
o.left,
|
|
470
470
|
o.top,
|
|
471
|
-
|
|
471
|
+
s,
|
|
472
472
|
u
|
|
473
473
|
];
|
|
474
|
-
return m.viewBox =
|
|
474
|
+
return m.viewBox = k.join(" "), {
|
|
475
475
|
attributes: m,
|
|
476
|
-
viewBox:
|
|
477
|
-
body:
|
|
476
|
+
viewBox: k,
|
|
477
|
+
body: a
|
|
478
478
|
};
|
|
479
479
|
}
|
|
480
|
-
const
|
|
481
|
-
let
|
|
482
|
-
function
|
|
483
|
-
const
|
|
484
|
-
let
|
|
485
|
-
for (;
|
|
486
|
-
if (!
|
|
480
|
+
const On = /\sid="(\S+)"/g, jn = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
481
|
+
let $n = 0;
|
|
482
|
+
function An(t, e = jn) {
|
|
483
|
+
const r = [];
|
|
484
|
+
let n;
|
|
485
|
+
for (; n = On.exec(t); ) r.push(n[1]);
|
|
486
|
+
if (!r.length) return t;
|
|
487
487
|
const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
488
|
-
return
|
|
489
|
-
const i = typeof
|
|
490
|
-
|
|
491
|
-
}),
|
|
488
|
+
return r.forEach((a) => {
|
|
489
|
+
const i = typeof e == "function" ? e(a) : e + ($n++).toString(), c = a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
490
|
+
t = t.replace(new RegExp('([#;"])(' + c + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
491
|
+
}), t = t.replace(new RegExp(o, "g"), ""), t;
|
|
492
492
|
}
|
|
493
|
-
const
|
|
494
|
-
function
|
|
495
|
-
|
|
493
|
+
const ge = /* @__PURE__ */ Object.create(null);
|
|
494
|
+
function Ln(t, e) {
|
|
495
|
+
ge[t] = e;
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
return
|
|
497
|
+
function we(t) {
|
|
498
|
+
return ge[t] || ge[""];
|
|
499
499
|
}
|
|
500
|
-
function
|
|
501
|
-
let
|
|
502
|
-
if (typeof
|
|
503
|
-
else if (
|
|
500
|
+
function Ce(t) {
|
|
501
|
+
let e;
|
|
502
|
+
if (typeof t.resources == "string") e = [t.resources];
|
|
503
|
+
else if (e = t.resources, !(e instanceof Array) || !e.length) return null;
|
|
504
504
|
return {
|
|
505
|
-
resources:
|
|
506
|
-
path:
|
|
507
|
-
maxURL:
|
|
508
|
-
rotate:
|
|
509
|
-
timeout:
|
|
510
|
-
random:
|
|
511
|
-
index:
|
|
512
|
-
dataAfterTimeout:
|
|
505
|
+
resources: e,
|
|
506
|
+
path: t.path || "/",
|
|
507
|
+
maxURL: t.maxURL || 500,
|
|
508
|
+
rotate: t.rotate || 750,
|
|
509
|
+
timeout: t.timeout || 5e3,
|
|
510
|
+
random: t.random === !0,
|
|
511
|
+
index: t.index || 0,
|
|
512
|
+
dataAfterTimeout: t.dataAfterTimeout !== !1
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
|
-
const
|
|
516
|
-
for (;
|
|
517
|
-
|
|
518
|
-
function
|
|
519
|
-
const
|
|
520
|
-
return
|
|
515
|
+
const Ie = /* @__PURE__ */ Object.create(null), jt = ["https://api.simplesvg.com", "https://api.unisvg.com"], Yt = [];
|
|
516
|
+
for (; jt.length > 0; ) jt.length === 1 || Math.random() > 0.5 ? Yt.push(jt.shift()) : Yt.push(jt.pop());
|
|
517
|
+
Ie[""] = Ce({ resources: ["https://api.iconify.design"].concat(Yt) });
|
|
518
|
+
function zn(t, e) {
|
|
519
|
+
const r = Ce(e);
|
|
520
|
+
return r === null ? !1 : (Ie[t] = r, !0);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
return
|
|
522
|
+
function _e(t) {
|
|
523
|
+
return Ie[t];
|
|
524
524
|
}
|
|
525
|
-
const
|
|
526
|
-
let
|
|
525
|
+
const Dn = () => {
|
|
526
|
+
let t;
|
|
527
527
|
try {
|
|
528
|
-
if (
|
|
528
|
+
if (t = fetch, typeof t == "function") return t;
|
|
529
529
|
} catch {
|
|
530
530
|
}
|
|
531
531
|
};
|
|
532
|
-
let
|
|
533
|
-
function
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
let
|
|
537
|
-
if (!
|
|
532
|
+
let Ye = Dn();
|
|
533
|
+
function Mn(t, e) {
|
|
534
|
+
const r = _e(t);
|
|
535
|
+
if (!r) return 0;
|
|
536
|
+
let n;
|
|
537
|
+
if (!r.maxURL) n = 0;
|
|
538
538
|
else {
|
|
539
539
|
let o = 0;
|
|
540
|
-
|
|
540
|
+
r.resources.forEach((i) => {
|
|
541
541
|
o = Math.max(o, i.length);
|
|
542
542
|
});
|
|
543
|
-
const
|
|
544
|
-
|
|
543
|
+
const a = e + ".json?icons=";
|
|
544
|
+
n = r.maxURL - o - r.path.length - a.length;
|
|
545
545
|
}
|
|
546
|
-
return
|
|
546
|
+
return n;
|
|
547
547
|
}
|
|
548
|
-
function
|
|
549
|
-
return
|
|
548
|
+
function Un(t) {
|
|
549
|
+
return t === 404;
|
|
550
550
|
}
|
|
551
|
-
const
|
|
552
|
-
const
|
|
551
|
+
const Bn = (t, e, r) => {
|
|
552
|
+
const n = [], o = Mn(t, e), a = "icons";
|
|
553
553
|
let i = {
|
|
554
|
-
type:
|
|
555
|
-
provider:
|
|
556
|
-
prefix:
|
|
554
|
+
type: a,
|
|
555
|
+
provider: t,
|
|
556
|
+
prefix: e,
|
|
557
557
|
icons: []
|
|
558
558
|
}, c = 0;
|
|
559
|
-
return
|
|
560
|
-
c +=
|
|
561
|
-
type:
|
|
562
|
-
provider:
|
|
563
|
-
prefix:
|
|
559
|
+
return r.forEach((s, u) => {
|
|
560
|
+
c += s.length + 1, c >= o && u > 0 && (n.push(i), i = {
|
|
561
|
+
type: a,
|
|
562
|
+
provider: t,
|
|
563
|
+
prefix: e,
|
|
564
564
|
icons: []
|
|
565
|
-
}, c =
|
|
566
|
-
}),
|
|
565
|
+
}, c = s.length), i.icons.push(s);
|
|
566
|
+
}), n.push(i), n;
|
|
567
567
|
};
|
|
568
|
-
function
|
|
569
|
-
if (typeof
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
568
|
+
function qn(t) {
|
|
569
|
+
if (typeof t == "string") {
|
|
570
|
+
const e = _e(t);
|
|
571
|
+
if (e) return e.path;
|
|
572
572
|
}
|
|
573
573
|
return "/";
|
|
574
574
|
}
|
|
575
|
-
const
|
|
576
|
-
if (!
|
|
577
|
-
|
|
575
|
+
const Rn = (t, e, r) => {
|
|
576
|
+
if (!Ye) {
|
|
577
|
+
r("abort", 424);
|
|
578
578
|
return;
|
|
579
579
|
}
|
|
580
|
-
let
|
|
581
|
-
switch (
|
|
580
|
+
let n = qn(e.provider);
|
|
581
|
+
switch (e.type) {
|
|
582
582
|
case "icons": {
|
|
583
|
-
const
|
|
584
|
-
|
|
583
|
+
const a = e.prefix, c = e.icons.join(","), s = new URLSearchParams({ icons: c });
|
|
584
|
+
n += a + ".json?" + s.toString();
|
|
585
585
|
break;
|
|
586
586
|
}
|
|
587
587
|
case "custom": {
|
|
588
|
-
const
|
|
589
|
-
|
|
588
|
+
const a = e.uri;
|
|
589
|
+
n += a.slice(0, 1) === "/" ? a.slice(1) : a;
|
|
590
590
|
break;
|
|
591
591
|
}
|
|
592
592
|
default:
|
|
593
|
-
|
|
593
|
+
r("abort", 400);
|
|
594
594
|
return;
|
|
595
595
|
}
|
|
596
596
|
let o = 503;
|
|
597
|
-
|
|
598
|
-
const i =
|
|
597
|
+
Ye(t + n).then((a) => {
|
|
598
|
+
const i = a.status;
|
|
599
599
|
if (i !== 200) {
|
|
600
600
|
setTimeout(() => {
|
|
601
|
-
|
|
601
|
+
r(Un(i) ? "abort" : "next", i);
|
|
602
602
|
});
|
|
603
603
|
return;
|
|
604
604
|
}
|
|
605
|
-
return o = 501,
|
|
606
|
-
}).then((
|
|
607
|
-
if (typeof
|
|
605
|
+
return o = 501, a.json();
|
|
606
|
+
}).then((a) => {
|
|
607
|
+
if (typeof a != "object" || a === null) {
|
|
608
608
|
setTimeout(() => {
|
|
609
|
-
|
|
609
|
+
a === 404 ? r("abort", a) : r("next", o);
|
|
610
610
|
});
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
613
|
setTimeout(() => {
|
|
614
|
-
|
|
614
|
+
r("success", a);
|
|
615
615
|
});
|
|
616
616
|
}).catch(() => {
|
|
617
|
-
|
|
617
|
+
r("next", o);
|
|
618
618
|
});
|
|
619
|
-
},
|
|
620
|
-
prepare:
|
|
621
|
-
send:
|
|
619
|
+
}, Hn = {
|
|
620
|
+
prepare: Bn,
|
|
621
|
+
send: Rn
|
|
622
622
|
};
|
|
623
|
-
function
|
|
624
|
-
|
|
625
|
-
const
|
|
626
|
-
|
|
623
|
+
function Pr(t, e) {
|
|
624
|
+
t.forEach((r) => {
|
|
625
|
+
const n = r.loaderCallbacks;
|
|
626
|
+
n && (r.loaderCallbacks = n.filter((o) => o.id !== e));
|
|
627
627
|
});
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
const
|
|
633
|
-
if (!
|
|
634
|
-
let
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
const i =
|
|
638
|
-
i.pending = i.pending.filter((
|
|
639
|
-
if (
|
|
640
|
-
const u =
|
|
641
|
-
if (
|
|
642
|
-
provider:
|
|
629
|
+
function Vn(t) {
|
|
630
|
+
t.pendingCallbacksFlag || (t.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
631
|
+
t.pendingCallbacksFlag = !1;
|
|
632
|
+
const e = t.loaderCallbacks ? t.loaderCallbacks.slice(0) : [];
|
|
633
|
+
if (!e.length) return;
|
|
634
|
+
let r = !1;
|
|
635
|
+
const n = t.provider, o = t.prefix;
|
|
636
|
+
e.forEach((a) => {
|
|
637
|
+
const i = a.icons, c = i.pending.length;
|
|
638
|
+
i.pending = i.pending.filter((s) => {
|
|
639
|
+
if (s.prefix !== o) return !0;
|
|
640
|
+
const u = s.name;
|
|
641
|
+
if (t.icons[u]) i.loaded.push({
|
|
642
|
+
provider: n,
|
|
643
643
|
prefix: o,
|
|
644
644
|
name: u
|
|
645
645
|
});
|
|
646
|
-
else if (
|
|
647
|
-
provider:
|
|
646
|
+
else if (t.missing.has(u)) i.missing.push({
|
|
647
|
+
provider: n,
|
|
648
648
|
prefix: o,
|
|
649
649
|
name: u
|
|
650
650
|
});
|
|
651
651
|
else
|
|
652
|
-
return
|
|
652
|
+
return r = !0, !0;
|
|
653
653
|
return !1;
|
|
654
|
-
}), i.pending.length !== c && (
|
|
654
|
+
}), i.pending.length !== c && (r || Pr([t], a.id), a.callback(i.loaded.slice(0), i.missing.slice(0), i.pending.slice(0), a.abort));
|
|
655
655
|
});
|
|
656
656
|
}));
|
|
657
657
|
}
|
|
658
|
-
let
|
|
659
|
-
function
|
|
660
|
-
const
|
|
661
|
-
if (!
|
|
662
|
-
const
|
|
663
|
-
id:
|
|
664
|
-
icons:
|
|
665
|
-
callback:
|
|
658
|
+
let Yn = 0;
|
|
659
|
+
function Jn(t, e, r) {
|
|
660
|
+
const n = Yn++, o = Pr.bind(null, r, n);
|
|
661
|
+
if (!e.pending.length) return o;
|
|
662
|
+
const a = {
|
|
663
|
+
id: n,
|
|
664
|
+
icons: e,
|
|
665
|
+
callback: t,
|
|
666
666
|
abort: o
|
|
667
667
|
};
|
|
668
|
-
return
|
|
669
|
-
(i.loaderCallbacks || (i.loaderCallbacks = [])).push(
|
|
668
|
+
return r.forEach((i) => {
|
|
669
|
+
(i.loaderCallbacks || (i.loaderCallbacks = [])).push(a);
|
|
670
670
|
}), o;
|
|
671
671
|
}
|
|
672
|
-
function
|
|
673
|
-
const
|
|
672
|
+
function Kn(t) {
|
|
673
|
+
const e = {
|
|
674
674
|
loaded: [],
|
|
675
675
|
missing: [],
|
|
676
676
|
pending: []
|
|
677
|
-
},
|
|
678
|
-
|
|
679
|
-
let
|
|
677
|
+
}, r = /* @__PURE__ */ Object.create(null);
|
|
678
|
+
t.sort((o, a) => o.provider !== a.provider ? o.provider.localeCompare(a.provider) : o.prefix !== a.prefix ? o.prefix.localeCompare(a.prefix) : o.name.localeCompare(a.name));
|
|
679
|
+
let n = {
|
|
680
680
|
provider: "",
|
|
681
681
|
prefix: "",
|
|
682
682
|
name: ""
|
|
683
683
|
};
|
|
684
|
-
return
|
|
685
|
-
if (
|
|
686
|
-
|
|
687
|
-
const
|
|
688
|
-
let
|
|
689
|
-
c in u.icons ?
|
|
684
|
+
return t.forEach((o) => {
|
|
685
|
+
if (n.name === o.name && n.prefix === o.prefix && n.provider === o.provider) return;
|
|
686
|
+
n = o;
|
|
687
|
+
const a = o.provider, i = o.prefix, c = o.name, s = r[a] || (r[a] = /* @__PURE__ */ Object.create(null)), u = s[i] || (s[i] = Et(a, i));
|
|
688
|
+
let f;
|
|
689
|
+
c in u.icons ? f = e.loaded : i === "" || u.missing.has(c) ? f = e.missing : f = e.pending;
|
|
690
690
|
const h = {
|
|
691
|
-
provider:
|
|
691
|
+
provider: a,
|
|
692
692
|
prefix: i,
|
|
693
693
|
name: c
|
|
694
694
|
};
|
|
695
|
-
|
|
696
|
-
}),
|
|
695
|
+
f.push(h);
|
|
696
|
+
}), e;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
699
|
-
const
|
|
700
|
-
return
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
}),
|
|
698
|
+
function Gn(t, e = !0, r = !1) {
|
|
699
|
+
const n = [];
|
|
700
|
+
return t.forEach((o) => {
|
|
701
|
+
const a = typeof o == "string" ? te(o, e, r) : o;
|
|
702
|
+
a && n.push(a);
|
|
703
|
+
}), n;
|
|
704
704
|
}
|
|
705
|
-
const
|
|
705
|
+
const Wn = {
|
|
706
706
|
resources: [],
|
|
707
707
|
index: 0,
|
|
708
708
|
timeout: 2e3,
|
|
@@ -710,88 +710,88 @@ const Gr = {
|
|
|
710
710
|
random: !1,
|
|
711
711
|
dataAfterTimeout: !1
|
|
712
712
|
};
|
|
713
|
-
function
|
|
714
|
-
const o =
|
|
713
|
+
function Qn(t, e, r, n) {
|
|
714
|
+
const o = t.resources.length, a = t.random ? Math.floor(Math.random() * o) : t.index;
|
|
715
715
|
let i;
|
|
716
|
-
if (
|
|
717
|
-
let
|
|
718
|
-
for (i = [];
|
|
719
|
-
const L = Math.floor(Math.random() *
|
|
720
|
-
i.push(
|
|
716
|
+
if (t.random) {
|
|
717
|
+
let S = t.resources.slice(0);
|
|
718
|
+
for (i = []; S.length > 1; ) {
|
|
719
|
+
const L = Math.floor(Math.random() * S.length);
|
|
720
|
+
i.push(S[L]), S = S.slice(0, L).concat(S.slice(L + 1));
|
|
721
721
|
}
|
|
722
|
-
i = i.concat(
|
|
723
|
-
} else i =
|
|
722
|
+
i = i.concat(S);
|
|
723
|
+
} else i = t.resources.slice(a).concat(t.resources.slice(0, a));
|
|
724
724
|
const c = Date.now();
|
|
725
|
-
let
|
|
726
|
-
typeof
|
|
727
|
-
function
|
|
725
|
+
let s = "pending", u = 0, f, h = null, m = [], g = [];
|
|
726
|
+
typeof n == "function" && g.push(n);
|
|
727
|
+
function k() {
|
|
728
728
|
h && (clearTimeout(h), h = null);
|
|
729
729
|
}
|
|
730
730
|
function _() {
|
|
731
|
-
|
|
732
|
-
|
|
731
|
+
s === "pending" && (s = "aborted"), k(), m.forEach((S) => {
|
|
732
|
+
S.status === "pending" && (S.status = "aborted");
|
|
733
733
|
}), m = [];
|
|
734
734
|
}
|
|
735
|
-
function
|
|
736
|
-
L && (g = []), typeof
|
|
735
|
+
function w(S, L) {
|
|
736
|
+
L && (g = []), typeof S == "function" && g.push(S);
|
|
737
737
|
}
|
|
738
738
|
function v() {
|
|
739
739
|
return {
|
|
740
740
|
startTime: c,
|
|
741
|
-
payload:
|
|
742
|
-
status:
|
|
741
|
+
payload: e,
|
|
742
|
+
status: s,
|
|
743
743
|
queriesSent: u,
|
|
744
744
|
queriesPending: m.length,
|
|
745
|
-
subscribe:
|
|
745
|
+
subscribe: w,
|
|
746
746
|
abort: _
|
|
747
747
|
};
|
|
748
748
|
}
|
|
749
749
|
function B() {
|
|
750
|
-
|
|
751
|
-
|
|
750
|
+
s = "failed", g.forEach((S) => {
|
|
751
|
+
S(void 0, f);
|
|
752
752
|
});
|
|
753
753
|
}
|
|
754
754
|
function P() {
|
|
755
|
-
m.forEach((
|
|
756
|
-
|
|
755
|
+
m.forEach((S) => {
|
|
756
|
+
S.status === "pending" && (S.status = "aborted");
|
|
757
757
|
}), m = [];
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function $(S, L, H) {
|
|
760
760
|
const V = L !== "success";
|
|
761
|
-
switch (m = m.filter((O) => O !==
|
|
761
|
+
switch (m = m.filter((O) => O !== S), s) {
|
|
762
762
|
case "pending":
|
|
763
763
|
break;
|
|
764
764
|
case "failed":
|
|
765
|
-
if (V || !
|
|
765
|
+
if (V || !t.dataAfterTimeout) return;
|
|
766
766
|
break;
|
|
767
767
|
default:
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
770
|
if (L === "abort") {
|
|
771
|
-
|
|
771
|
+
f = H, B();
|
|
772
772
|
return;
|
|
773
773
|
}
|
|
774
774
|
if (V) {
|
|
775
|
-
|
|
775
|
+
f = H, m.length || (i.length ? Z() : B());
|
|
776
776
|
return;
|
|
777
777
|
}
|
|
778
|
-
if (
|
|
779
|
-
const O =
|
|
780
|
-
O !== -1 && O !==
|
|
778
|
+
if (k(), P(), !t.random) {
|
|
779
|
+
const O = t.resources.indexOf(S.resource);
|
|
780
|
+
O !== -1 && O !== t.index && (t.index = O);
|
|
781
781
|
}
|
|
782
|
-
|
|
783
|
-
O(
|
|
782
|
+
s = "completed", g.forEach((O) => {
|
|
783
|
+
O(H);
|
|
784
784
|
});
|
|
785
785
|
}
|
|
786
|
-
function
|
|
787
|
-
if (
|
|
788
|
-
|
|
789
|
-
const
|
|
790
|
-
if (
|
|
786
|
+
function Z() {
|
|
787
|
+
if (s !== "pending") return;
|
|
788
|
+
k();
|
|
789
|
+
const S = i.shift();
|
|
790
|
+
if (S === void 0) {
|
|
791
791
|
if (m.length) {
|
|
792
792
|
h = setTimeout(() => {
|
|
793
|
-
|
|
794
|
-
},
|
|
793
|
+
k(), s === "pending" && (P(), B());
|
|
794
|
+
}, t.timeout);
|
|
795
795
|
return;
|
|
796
796
|
}
|
|
797
797
|
B();
|
|
@@ -799,215 +799,215 @@ function Wr(e, t, n, r) {
|
|
|
799
799
|
}
|
|
800
800
|
const L = {
|
|
801
801
|
status: "pending",
|
|
802
|
-
resource:
|
|
803
|
-
callback: (
|
|
804
|
-
|
|
802
|
+
resource: S,
|
|
803
|
+
callback: (H, V) => {
|
|
804
|
+
$(L, H, V);
|
|
805
805
|
}
|
|
806
806
|
};
|
|
807
|
-
m.push(L), u++, h = setTimeout(
|
|
807
|
+
m.push(L), u++, h = setTimeout(Z, t.rotate), r(S, e, L.callback);
|
|
808
808
|
}
|
|
809
|
-
return setTimeout(
|
|
809
|
+
return setTimeout(Z), v;
|
|
810
810
|
}
|
|
811
|
-
function
|
|
812
|
-
const
|
|
813
|
-
...
|
|
814
|
-
...
|
|
811
|
+
function Or(t) {
|
|
812
|
+
const e = {
|
|
813
|
+
...Wn,
|
|
814
|
+
...t
|
|
815
815
|
};
|
|
816
|
-
let
|
|
817
|
-
function
|
|
818
|
-
|
|
816
|
+
let r = [];
|
|
817
|
+
function n() {
|
|
818
|
+
r = r.filter((c) => c().status === "pending");
|
|
819
819
|
}
|
|
820
|
-
function o(c,
|
|
821
|
-
const
|
|
822
|
-
|
|
820
|
+
function o(c, s, u) {
|
|
821
|
+
const f = Qn(e, c, s, (h, m) => {
|
|
822
|
+
n(), u && u(h, m);
|
|
823
823
|
});
|
|
824
|
-
return
|
|
824
|
+
return r.push(f), f;
|
|
825
825
|
}
|
|
826
|
-
function
|
|
827
|
-
return
|
|
826
|
+
function a(c) {
|
|
827
|
+
return r.find((s) => c(s)) || null;
|
|
828
828
|
}
|
|
829
829
|
return {
|
|
830
830
|
query: o,
|
|
831
|
-
find:
|
|
831
|
+
find: a,
|
|
832
832
|
setIndex: (c) => {
|
|
833
|
-
|
|
833
|
+
e.index = c;
|
|
834
834
|
},
|
|
835
|
-
getIndex: () =>
|
|
836
|
-
cleanup:
|
|
835
|
+
getIndex: () => e.index,
|
|
836
|
+
cleanup: n
|
|
837
837
|
};
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function Je() {
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
843
|
-
if (!
|
|
844
|
-
const
|
|
845
|
-
if (!
|
|
846
|
-
const
|
|
847
|
-
config:
|
|
848
|
-
redundancy:
|
|
841
|
+
const se = /* @__PURE__ */ Object.create(null);
|
|
842
|
+
function Xn(t) {
|
|
843
|
+
if (!se[t]) {
|
|
844
|
+
const e = _e(t);
|
|
845
|
+
if (!e) return;
|
|
846
|
+
const r = Or(e), n = {
|
|
847
|
+
config: e,
|
|
848
|
+
redundancy: r
|
|
849
849
|
};
|
|
850
|
-
|
|
851
|
-
}
|
|
852
|
-
return
|
|
853
|
-
}
|
|
854
|
-
function
|
|
855
|
-
let
|
|
856
|
-
if (typeof
|
|
857
|
-
const
|
|
858
|
-
if (!
|
|
859
|
-
return
|
|
860
|
-
o =
|
|
861
|
-
const i =
|
|
862
|
-
i && (
|
|
850
|
+
se[t] = n;
|
|
851
|
+
}
|
|
852
|
+
return se[t];
|
|
853
|
+
}
|
|
854
|
+
function Zn(t, e, r) {
|
|
855
|
+
let n, o;
|
|
856
|
+
if (typeof t == "string") {
|
|
857
|
+
const a = we(t);
|
|
858
|
+
if (!a)
|
|
859
|
+
return r(void 0, 424), Je;
|
|
860
|
+
o = a.send;
|
|
861
|
+
const i = Xn(t);
|
|
862
|
+
i && (n = i.redundancy);
|
|
863
863
|
} else {
|
|
864
|
-
const
|
|
865
|
-
if (
|
|
866
|
-
|
|
867
|
-
const i =
|
|
864
|
+
const a = Ce(t);
|
|
865
|
+
if (a) {
|
|
866
|
+
n = Or(a);
|
|
867
|
+
const i = t.resources ? t.resources[0] : "", c = we(i);
|
|
868
868
|
c && (o = c.send);
|
|
869
869
|
}
|
|
870
870
|
}
|
|
871
|
-
return !
|
|
871
|
+
return !n || !o ? (r(void 0, 424), Je) : n.query(e, o, r)().abort;
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function Ke() {
|
|
874
874
|
}
|
|
875
|
-
function
|
|
876
|
-
|
|
877
|
-
|
|
875
|
+
function to(t) {
|
|
876
|
+
t.iconsLoaderFlag || (t.iconsLoaderFlag = !0, setTimeout(() => {
|
|
877
|
+
t.iconsLoaderFlag = !1, Vn(t);
|
|
878
878
|
}));
|
|
879
879
|
}
|
|
880
|
-
function
|
|
881
|
-
const
|
|
882
|
-
return
|
|
883
|
-
(
|
|
880
|
+
function eo(t) {
|
|
881
|
+
const e = [], r = [];
|
|
882
|
+
return t.forEach((n) => {
|
|
883
|
+
(n.match(Fr) ? e : r).push(n);
|
|
884
884
|
}), {
|
|
885
|
-
valid:
|
|
886
|
-
invalid:
|
|
885
|
+
valid: e,
|
|
886
|
+
invalid: r
|
|
887
887
|
};
|
|
888
888
|
}
|
|
889
|
-
function
|
|
890
|
-
function
|
|
891
|
-
const o =
|
|
892
|
-
|
|
893
|
-
o && o.delete(
|
|
889
|
+
function $t(t, e, r) {
|
|
890
|
+
function n() {
|
|
891
|
+
const o = t.pendingIcons;
|
|
892
|
+
e.forEach((a) => {
|
|
893
|
+
o && o.delete(a), t.icons[a] || t.missing.add(a);
|
|
894
894
|
});
|
|
895
895
|
}
|
|
896
|
-
if (
|
|
897
|
-
if (!
|
|
898
|
-
|
|
896
|
+
if (r && typeof r == "object") try {
|
|
897
|
+
if (!_r(t, r).length) {
|
|
898
|
+
n();
|
|
899
899
|
return;
|
|
900
900
|
}
|
|
901
901
|
} catch (o) {
|
|
902
902
|
console.error(o);
|
|
903
903
|
}
|
|
904
|
-
|
|
904
|
+
n(), to(t);
|
|
905
905
|
}
|
|
906
|
-
function
|
|
907
|
-
|
|
908
|
-
|
|
906
|
+
function Ge(t, e) {
|
|
907
|
+
t instanceof Promise ? t.then((r) => {
|
|
908
|
+
e(r);
|
|
909
909
|
}).catch(() => {
|
|
910
|
-
|
|
911
|
-
}) : t
|
|
912
|
-
}
|
|
913
|
-
function
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
const { provider:
|
|
917
|
-
if (delete
|
|
918
|
-
const
|
|
919
|
-
if (
|
|
920
|
-
|
|
921
|
-
|
|
910
|
+
e(null);
|
|
911
|
+
}) : e(t);
|
|
912
|
+
}
|
|
913
|
+
function ro(t, e) {
|
|
914
|
+
t.iconsToLoad ? t.iconsToLoad = t.iconsToLoad.concat(e).sort() : t.iconsToLoad = e, t.iconsQueueFlag || (t.iconsQueueFlag = !0, setTimeout(() => {
|
|
915
|
+
t.iconsQueueFlag = !1;
|
|
916
|
+
const { provider: r, prefix: n } = t, o = t.iconsToLoad;
|
|
917
|
+
if (delete t.iconsToLoad, !o || !o.length) return;
|
|
918
|
+
const a = t.loadIcon;
|
|
919
|
+
if (t.loadIcons && (o.length > 1 || !a)) {
|
|
920
|
+
Ge(t.loadIcons(o, n, r), (f) => {
|
|
921
|
+
$t(t, o, f);
|
|
922
922
|
});
|
|
923
923
|
return;
|
|
924
924
|
}
|
|
925
|
-
if (
|
|
926
|
-
o.forEach((
|
|
927
|
-
const h =
|
|
928
|
-
|
|
925
|
+
if (a) {
|
|
926
|
+
o.forEach((f) => {
|
|
927
|
+
const h = a(f, n, r);
|
|
928
|
+
Ge(h, (m) => {
|
|
929
929
|
const g = m ? {
|
|
930
|
-
prefix:
|
|
931
|
-
icons: { [
|
|
930
|
+
prefix: n,
|
|
931
|
+
icons: { [f]: m }
|
|
932
932
|
} : null;
|
|
933
|
-
|
|
933
|
+
$t(t, [f], g);
|
|
934
934
|
});
|
|
935
935
|
});
|
|
936
936
|
return;
|
|
937
937
|
}
|
|
938
|
-
const { valid: i, invalid: c } =
|
|
939
|
-
if (c.length &&
|
|
940
|
-
const
|
|
941
|
-
if (!
|
|
942
|
-
|
|
938
|
+
const { valid: i, invalid: c } = eo(o);
|
|
939
|
+
if (c.length && $t(t, c, null), !i.length) return;
|
|
940
|
+
const s = n.match(Fr) ? we(r) : null;
|
|
941
|
+
if (!s) {
|
|
942
|
+
$t(t, i, null);
|
|
943
943
|
return;
|
|
944
944
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
945
|
+
s.prepare(r, n, i).forEach((f) => {
|
|
946
|
+
Zn(r, f, (h) => {
|
|
947
|
+
$t(t, f.icons, h);
|
|
948
948
|
});
|
|
949
949
|
});
|
|
950
950
|
}));
|
|
951
951
|
}
|
|
952
|
-
const
|
|
953
|
-
const
|
|
954
|
-
if (!
|
|
955
|
-
let
|
|
956
|
-
return
|
|
957
|
-
|
|
952
|
+
const no = (t, e) => {
|
|
953
|
+
const r = Gn(t, !0, Nr()), n = Kn(r);
|
|
954
|
+
if (!n.pending.length) {
|
|
955
|
+
let s = !0;
|
|
956
|
+
return e && setTimeout(() => {
|
|
957
|
+
s && e(n.loaded, n.missing, n.pending, Ke);
|
|
958
958
|
}), () => {
|
|
959
|
-
|
|
959
|
+
s = !1;
|
|
960
960
|
};
|
|
961
961
|
}
|
|
962
|
-
const o = /* @__PURE__ */ Object.create(null),
|
|
962
|
+
const o = /* @__PURE__ */ Object.create(null), a = [];
|
|
963
963
|
let i, c;
|
|
964
|
-
return
|
|
965
|
-
const { provider: u, prefix:
|
|
966
|
-
if (
|
|
967
|
-
i = u, c =
|
|
964
|
+
return n.pending.forEach((s) => {
|
|
965
|
+
const { provider: u, prefix: f } = s;
|
|
966
|
+
if (f === c && u === i) return;
|
|
967
|
+
i = u, c = f, a.push(Et(u, f));
|
|
968
968
|
const h = o[u] || (o[u] = /* @__PURE__ */ Object.create(null));
|
|
969
|
-
h[
|
|
970
|
-
}),
|
|
971
|
-
const { provider: u, prefix:
|
|
972
|
-
g.has(h) || (g.add(h), o[u][
|
|
973
|
-
}),
|
|
974
|
-
const u = o[
|
|
975
|
-
u.length &&
|
|
976
|
-
}),
|
|
969
|
+
h[f] || (h[f] = []);
|
|
970
|
+
}), n.pending.forEach((s) => {
|
|
971
|
+
const { provider: u, prefix: f, name: h } = s, m = Et(u, f), g = m.pendingIcons || (m.pendingIcons = /* @__PURE__ */ new Set());
|
|
972
|
+
g.has(h) || (g.add(h), o[u][f].push(h));
|
|
973
|
+
}), a.forEach((s) => {
|
|
974
|
+
const u = o[s.provider][s.prefix];
|
|
975
|
+
u.length && ro(s, u);
|
|
976
|
+
}), e ? Jn(e, n, a) : Ke;
|
|
977
977
|
};
|
|
978
|
-
function
|
|
979
|
-
const
|
|
980
|
-
for (const
|
|
981
|
-
const o =
|
|
982
|
-
|
|
978
|
+
function oo(t, e) {
|
|
979
|
+
const r = { ...t };
|
|
980
|
+
for (const n in e) {
|
|
981
|
+
const o = e[n], a = typeof o;
|
|
982
|
+
n in Er ? (o === null || o && (a === "string" || a === "number")) && (r[n] = o) : a === typeof r[n] && (r[n] = n === "rotate" ? o % 4 : o);
|
|
983
983
|
}
|
|
984
|
-
return
|
|
984
|
+
return r;
|
|
985
985
|
}
|
|
986
|
-
const
|
|
987
|
-
function
|
|
988
|
-
|
|
989
|
-
switch (
|
|
986
|
+
const ao = /[\s,]+/;
|
|
987
|
+
function io(t, e) {
|
|
988
|
+
e.split(ao).forEach((r) => {
|
|
989
|
+
switch (r.trim()) {
|
|
990
990
|
case "horizontal":
|
|
991
|
-
|
|
991
|
+
t.hFlip = !0;
|
|
992
992
|
break;
|
|
993
993
|
case "vertical":
|
|
994
|
-
|
|
994
|
+
t.vFlip = !0;
|
|
995
995
|
break;
|
|
996
996
|
}
|
|
997
997
|
});
|
|
998
998
|
}
|
|
999
|
-
function so(
|
|
1000
|
-
const
|
|
1001
|
-
function
|
|
999
|
+
function so(t, e = 0) {
|
|
1000
|
+
const r = t.replace(/^-?[0-9.]*/, "");
|
|
1001
|
+
function n(o) {
|
|
1002
1002
|
for (; o < 0; ) o += 4;
|
|
1003
1003
|
return o % 4;
|
|
1004
1004
|
}
|
|
1005
|
-
if (
|
|
1006
|
-
const o = parseInt(
|
|
1007
|
-
return isNaN(o) ? 0 :
|
|
1008
|
-
} else if (
|
|
1005
|
+
if (r === "") {
|
|
1006
|
+
const o = parseInt(t);
|
|
1007
|
+
return isNaN(o) ? 0 : n(o);
|
|
1008
|
+
} else if (r !== t) {
|
|
1009
1009
|
let o = 0;
|
|
1010
|
-
switch (
|
|
1010
|
+
switch (r) {
|
|
1011
1011
|
case "%":
|
|
1012
1012
|
o = 25;
|
|
1013
1013
|
break;
|
|
@@ -1015,92 +1015,92 @@ function so(e, t = 0) {
|
|
|
1015
1015
|
o = 90;
|
|
1016
1016
|
}
|
|
1017
1017
|
if (o) {
|
|
1018
|
-
let
|
|
1019
|
-
return isNaN(
|
|
1018
|
+
let a = parseFloat(t.slice(0, t.length - r.length));
|
|
1019
|
+
return isNaN(a) ? 0 : (a = a / o, a % 1 === 0 ? n(a) : 0);
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
|
-
return
|
|
1022
|
+
return e;
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1025
|
-
let
|
|
1026
|
-
for (const
|
|
1027
|
-
return '<svg xmlns="http://www.w3.org/2000/svg"' +
|
|
1024
|
+
function co(t, e) {
|
|
1025
|
+
let r = t.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
1026
|
+
for (const n in e) r += " " + n + '="' + e[n] + '"';
|
|
1027
|
+
return '<svg xmlns="http://www.w3.org/2000/svg"' + r + ">" + t + "</svg>";
|
|
1028
1028
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return
|
|
1029
|
+
function lo(t) {
|
|
1030
|
+
return t.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1033
|
-
return "data:image/svg+xml," +
|
|
1032
|
+
function uo(t) {
|
|
1033
|
+
return "data:image/svg+xml," + lo(t);
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return 'url("' +
|
|
1035
|
+
function fo(t) {
|
|
1036
|
+
return 'url("' + uo(t) + '")';
|
|
1037
1037
|
}
|
|
1038
|
-
let
|
|
1039
|
-
function
|
|
1038
|
+
let Dt;
|
|
1039
|
+
function po() {
|
|
1040
1040
|
try {
|
|
1041
|
-
|
|
1041
|
+
Dt = window.trustedTypes.createPolicy("iconify", { createHTML: (t) => t });
|
|
1042
1042
|
} catch {
|
|
1043
|
-
|
|
1043
|
+
Dt = null;
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1047
|
-
return
|
|
1046
|
+
function ho(t) {
|
|
1047
|
+
return Dt === void 0 && po(), Dt ? Dt.createHTML(t) : t;
|
|
1048
1048
|
}
|
|
1049
|
-
const
|
|
1050
|
-
...
|
|
1049
|
+
const jr = {
|
|
1050
|
+
...Tr,
|
|
1051
1051
|
inline: !1
|
|
1052
|
-
},
|
|
1052
|
+
}, mo = {
|
|
1053
1053
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1054
1054
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
1055
1055
|
"aria-hidden": !0,
|
|
1056
1056
|
role: "img"
|
|
1057
|
-
},
|
|
1057
|
+
}, go = {
|
|
1058
1058
|
display: "inline-block"
|
|
1059
|
-
},
|
|
1059
|
+
}, ye = {
|
|
1060
1060
|
backgroundColor: "currentColor"
|
|
1061
|
-
},
|
|
1061
|
+
}, $r = {
|
|
1062
1062
|
backgroundColor: "transparent"
|
|
1063
|
-
},
|
|
1063
|
+
}, We = {
|
|
1064
1064
|
Image: "var(--svg)",
|
|
1065
1065
|
Repeat: "no-repeat",
|
|
1066
1066
|
Size: "100% 100%"
|
|
1067
|
-
},
|
|
1068
|
-
WebkitMask:
|
|
1069
|
-
mask:
|
|
1070
|
-
background:
|
|
1067
|
+
}, Qe = {
|
|
1068
|
+
WebkitMask: ye,
|
|
1069
|
+
mask: ye,
|
|
1070
|
+
background: $r
|
|
1071
1071
|
};
|
|
1072
|
-
for (const
|
|
1073
|
-
const
|
|
1074
|
-
for (const
|
|
1075
|
-
t
|
|
1072
|
+
for (const t in Qe) {
|
|
1073
|
+
const e = Qe[t];
|
|
1074
|
+
for (const r in We)
|
|
1075
|
+
e[t + r] = We[r];
|
|
1076
1076
|
}
|
|
1077
|
-
const
|
|
1078
|
-
...
|
|
1077
|
+
const wo = {
|
|
1078
|
+
...jr,
|
|
1079
1079
|
inline: !0
|
|
1080
1080
|
};
|
|
1081
|
-
function
|
|
1082
|
-
return
|
|
1081
|
+
function Xe(t) {
|
|
1082
|
+
return t + (t.match(/^[-0-9.]+$/) ? "px" : "");
|
|
1083
1083
|
}
|
|
1084
|
-
const
|
|
1085
|
-
const
|
|
1086
|
-
...
|
|
1084
|
+
const yo = (t, e, r) => {
|
|
1085
|
+
const n = e.inline ? wo : jr, o = oo(n, e), a = e.mode || "svg", i = {}, c = e.style || {}, s = {
|
|
1086
|
+
...a === "svg" ? mo : {}
|
|
1087
1087
|
};
|
|
1088
|
-
if (
|
|
1089
|
-
const
|
|
1090
|
-
if (
|
|
1088
|
+
if (r) {
|
|
1089
|
+
const w = te(r, !1, !0);
|
|
1090
|
+
if (w) {
|
|
1091
1091
|
const v = ["iconify"], B = [
|
|
1092
1092
|
"provider",
|
|
1093
1093
|
"prefix"
|
|
1094
1094
|
];
|
|
1095
1095
|
for (const P of B)
|
|
1096
|
-
|
|
1097
|
-
|
|
1096
|
+
w[P] && v.push("iconify--" + w[P]);
|
|
1097
|
+
s.className = v.join(" ");
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
|
-
for (let
|
|
1101
|
-
const v =
|
|
1100
|
+
for (let w in e) {
|
|
1101
|
+
const v = e[w];
|
|
1102
1102
|
if (v !== void 0)
|
|
1103
|
-
switch (
|
|
1103
|
+
switch (w) {
|
|
1104
1104
|
// Properties to ignore
|
|
1105
1105
|
case "icon":
|
|
1106
1106
|
case "style":
|
|
@@ -1112,21 +1112,21 @@ const go = (e, t, n) => {
|
|
|
1112
1112
|
break;
|
|
1113
1113
|
// Forward ref
|
|
1114
1114
|
case "_ref":
|
|
1115
|
-
|
|
1115
|
+
s.ref = v;
|
|
1116
1116
|
break;
|
|
1117
1117
|
// Merge class names
|
|
1118
1118
|
case "className":
|
|
1119
|
-
|
|
1119
|
+
s[w] = (s[w] ? s[w] + " " : "") + v;
|
|
1120
1120
|
break;
|
|
1121
1121
|
// Boolean attributes
|
|
1122
1122
|
case "inline":
|
|
1123
1123
|
case "hFlip":
|
|
1124
1124
|
case "vFlip":
|
|
1125
|
-
o[
|
|
1125
|
+
o[w] = v === !0 || v === "true" || v === 1;
|
|
1126
1126
|
break;
|
|
1127
1127
|
// Flip as string: 'horizontal,vertical'
|
|
1128
1128
|
case "flip":
|
|
1129
|
-
typeof v == "string" &&
|
|
1129
|
+
typeof v == "string" && io(o, v);
|
|
1130
1130
|
break;
|
|
1131
1131
|
// Color: copy to style
|
|
1132
1132
|
case "color":
|
|
@@ -1134,91 +1134,91 @@ const go = (e, t, n) => {
|
|
|
1134
1134
|
break;
|
|
1135
1135
|
// Rotation as string
|
|
1136
1136
|
case "rotate":
|
|
1137
|
-
typeof v == "string" ? o[
|
|
1137
|
+
typeof v == "string" ? o[w] = so(v) : typeof v == "number" && (o[w] = v);
|
|
1138
1138
|
break;
|
|
1139
1139
|
// Remove aria-hidden
|
|
1140
1140
|
case "ariaHidden":
|
|
1141
1141
|
case "aria-hidden":
|
|
1142
|
-
v !== !0 && v !== "true" && delete
|
|
1142
|
+
v !== !0 && v !== "true" && delete s["aria-hidden"];
|
|
1143
1143
|
break;
|
|
1144
1144
|
// Copy missing property if it does not exist in customisations
|
|
1145
1145
|
default:
|
|
1146
|
-
|
|
1146
|
+
n[w] === void 0 && (s[w] = v);
|
|
1147
1147
|
}
|
|
1148
1148
|
}
|
|
1149
|
-
const u =
|
|
1150
|
-
if (o.inline && (i.verticalAlign = "-0.125em"),
|
|
1151
|
-
|
|
1149
|
+
const u = Pn(t, o), f = u.attributes;
|
|
1150
|
+
if (o.inline && (i.verticalAlign = "-0.125em"), a === "svg") {
|
|
1151
|
+
s.style = {
|
|
1152
1152
|
...i,
|
|
1153
1153
|
...c
|
|
1154
|
-
}, Object.assign(
|
|
1155
|
-
let
|
|
1156
|
-
return typeof v == "string" && (v = v.replace(/-/g, "_")),
|
|
1157
|
-
__html:
|
|
1158
|
-
},
|
|
1159
|
-
}
|
|
1160
|
-
const { body: h, width: m, height: g } =
|
|
1161
|
-
...
|
|
1154
|
+
}, Object.assign(s, f);
|
|
1155
|
+
let w = 0, v = e.id;
|
|
1156
|
+
return typeof v == "string" && (v = v.replace(/-/g, "_")), s.dangerouslySetInnerHTML = {
|
|
1157
|
+
__html: ho(An(u.body, v ? () => v + "ID" + w++ : "iconifyReact"))
|
|
1158
|
+
}, pe("svg", s);
|
|
1159
|
+
}
|
|
1160
|
+
const { body: h, width: m, height: g } = t, k = a === "mask" || (a === "bg" ? !1 : h.indexOf("currentColor") !== -1), _ = co(h, {
|
|
1161
|
+
...f,
|
|
1162
1162
|
width: m + "",
|
|
1163
1163
|
height: g + ""
|
|
1164
1164
|
});
|
|
1165
|
-
return
|
|
1165
|
+
return s.style = {
|
|
1166
1166
|
...i,
|
|
1167
|
-
"--svg":
|
|
1168
|
-
width:
|
|
1169
|
-
height:
|
|
1170
|
-
...
|
|
1171
|
-
...
|
|
1167
|
+
"--svg": fo(_),
|
|
1168
|
+
width: Xe(f.width),
|
|
1169
|
+
height: Xe(f.height),
|
|
1170
|
+
...go,
|
|
1171
|
+
...k ? ye : $r,
|
|
1172
1172
|
...c
|
|
1173
|
-
},
|
|
1173
|
+
}, pe("span", s);
|
|
1174
1174
|
};
|
|
1175
|
-
|
|
1176
|
-
|
|
1175
|
+
Nr(!0);
|
|
1176
|
+
Ln("", Hn);
|
|
1177
1177
|
if (typeof document < "u" && typeof window < "u") {
|
|
1178
|
-
const
|
|
1179
|
-
if (
|
|
1180
|
-
const
|
|
1181
|
-
typeof
|
|
1178
|
+
const t = window;
|
|
1179
|
+
if (t.IconifyPreload !== void 0) {
|
|
1180
|
+
const e = t.IconifyPreload, r = "Invalid IconifyPreload syntax.";
|
|
1181
|
+
typeof e == "object" && e !== null && (e instanceof Array ? e : [e]).forEach((n) => {
|
|
1182
1182
|
try {
|
|
1183
1183
|
// Check if item is an object and not null/array
|
|
1184
|
-
(typeof
|
|
1185
|
-
typeof
|
|
1186
|
-
!
|
|
1184
|
+
(typeof n != "object" || n === null || n instanceof Array || // Check for 'icons' and 'prefix'
|
|
1185
|
+
typeof n.icons != "object" || typeof n.prefix != "string" || // Add icon set
|
|
1186
|
+
!Cn(n)) && console.error(r);
|
|
1187
1187
|
} catch {
|
|
1188
|
-
console.error(
|
|
1188
|
+
console.error(r);
|
|
1189
1189
|
}
|
|
1190
1190
|
});
|
|
1191
1191
|
}
|
|
1192
|
-
if (
|
|
1193
|
-
const
|
|
1194
|
-
if (typeof
|
|
1195
|
-
for (let
|
|
1196
|
-
const
|
|
1192
|
+
if (t.IconifyProviders !== void 0) {
|
|
1193
|
+
const e = t.IconifyProviders;
|
|
1194
|
+
if (typeof e == "object" && e !== null)
|
|
1195
|
+
for (let r in e) {
|
|
1196
|
+
const n = "IconifyProviders[" + r + "] is invalid.";
|
|
1197
1197
|
try {
|
|
1198
|
-
const o =
|
|
1198
|
+
const o = e[r];
|
|
1199
1199
|
if (typeof o != "object" || !o || o.resources === void 0)
|
|
1200
1200
|
continue;
|
|
1201
|
-
|
|
1201
|
+
zn(r, o) || console.error(n);
|
|
1202
1202
|
} catch {
|
|
1203
|
-
console.error(
|
|
1203
|
+
console.error(n);
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1209
|
-
const [
|
|
1210
|
-
function
|
|
1208
|
+
function Ar(t) {
|
|
1209
|
+
const [e, r] = D(!!t.ssr), [n, o] = D({});
|
|
1210
|
+
function a(g) {
|
|
1211
1211
|
if (g) {
|
|
1212
|
-
const
|
|
1213
|
-
if (typeof
|
|
1212
|
+
const k = t.icon;
|
|
1213
|
+
if (typeof k == "object")
|
|
1214
1214
|
return {
|
|
1215
1215
|
name: "",
|
|
1216
|
-
data:
|
|
1216
|
+
data: k
|
|
1217
1217
|
};
|
|
1218
|
-
const _ =
|
|
1218
|
+
const _ = He(k);
|
|
1219
1219
|
if (_)
|
|
1220
1220
|
return {
|
|
1221
|
-
name:
|
|
1221
|
+
name: k,
|
|
1222
1222
|
data: _
|
|
1223
1223
|
};
|
|
1224
1224
|
}
|
|
@@ -1226,102 +1226,102 @@ function Ln(e) {
|
|
|
1226
1226
|
name: ""
|
|
1227
1227
|
};
|
|
1228
1228
|
}
|
|
1229
|
-
const [i, c] =
|
|
1230
|
-
function
|
|
1231
|
-
const g =
|
|
1229
|
+
const [i, c] = D(a(!!t.ssr));
|
|
1230
|
+
function s() {
|
|
1231
|
+
const g = n.callback;
|
|
1232
1232
|
g && (g(), o({}));
|
|
1233
1233
|
}
|
|
1234
1234
|
function u(g) {
|
|
1235
1235
|
if (JSON.stringify(i) !== JSON.stringify(g))
|
|
1236
|
-
return
|
|
1236
|
+
return s(), c(g), !0;
|
|
1237
1237
|
}
|
|
1238
|
-
function
|
|
1238
|
+
function f() {
|
|
1239
1239
|
var g;
|
|
1240
|
-
const
|
|
1241
|
-
if (typeof
|
|
1240
|
+
const k = t.icon;
|
|
1241
|
+
if (typeof k == "object") {
|
|
1242
1242
|
u({
|
|
1243
1243
|
name: "",
|
|
1244
|
-
data:
|
|
1244
|
+
data: k
|
|
1245
1245
|
});
|
|
1246
1246
|
return;
|
|
1247
1247
|
}
|
|
1248
|
-
const _ =
|
|
1248
|
+
const _ = He(k);
|
|
1249
1249
|
if (u({
|
|
1250
|
-
name:
|
|
1250
|
+
name: k,
|
|
1251
1251
|
data: _
|
|
1252
1252
|
}))
|
|
1253
1253
|
if (_ === void 0) {
|
|
1254
|
-
const
|
|
1254
|
+
const w = no([k], f);
|
|
1255
1255
|
o({
|
|
1256
|
-
callback:
|
|
1256
|
+
callback: w
|
|
1257
1257
|
});
|
|
1258
|
-
} else _ && ((g =
|
|
1258
|
+
} else _ && ((g = t.onLoad) === null || g === void 0 || g.call(t, k));
|
|
1259
1259
|
}
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
}, [
|
|
1260
|
+
gt(() => (r(!0), s), []), gt(() => {
|
|
1261
|
+
e && f();
|
|
1262
|
+
}, [t.icon, e]);
|
|
1263
1263
|
const { name: h, data: m } = i;
|
|
1264
|
-
return m ?
|
|
1265
|
-
...
|
|
1264
|
+
return m ? yo({
|
|
1265
|
+
...Se,
|
|
1266
1266
|
...m
|
|
1267
|
-
},
|
|
1267
|
+
}, t, h) : t.children ? t.children : t.fallback ? t.fallback : pe("span", {});
|
|
1268
1268
|
}
|
|
1269
|
-
const
|
|
1270
|
-
...
|
|
1271
|
-
_ref:
|
|
1269
|
+
const Ze = gr((t, e) => Ar({
|
|
1270
|
+
...t,
|
|
1271
|
+
_ref: e
|
|
1272
1272
|
}));
|
|
1273
|
-
|
|
1273
|
+
gr((t, e) => Ar({
|
|
1274
1274
|
inline: !0,
|
|
1275
|
-
...
|
|
1276
|
-
_ref:
|
|
1275
|
+
...t,
|
|
1276
|
+
_ref: e
|
|
1277
1277
|
}));
|
|
1278
|
-
function
|
|
1279
|
-
const
|
|
1280
|
-
return
|
|
1281
|
-
const
|
|
1282
|
-
return window.addEventListener("resize",
|
|
1283
|
-
}, []),
|
|
1284
|
-
}
|
|
1285
|
-
const
|
|
1286
|
-
product:
|
|
1278
|
+
function bo() {
|
|
1279
|
+
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = D(t);
|
|
1280
|
+
return gt(() => {
|
|
1281
|
+
const n = () => r(t());
|
|
1282
|
+
return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
1283
|
+
}, []), e;
|
|
1284
|
+
}
|
|
1285
|
+
const xo = ({
|
|
1286
|
+
product: t
|
|
1287
1287
|
}) => {
|
|
1288
|
-
const
|
|
1288
|
+
const e = hr(), r = bo(), [n, o] = D(0), a = () => {
|
|
1289
1289
|
o(
|
|
1290
|
-
(
|
|
1290
|
+
(s) => s + r >= t.length ? 0 : s + r
|
|
1291
1291
|
);
|
|
1292
1292
|
}, i = () => {
|
|
1293
1293
|
o(
|
|
1294
|
-
(
|
|
1294
|
+
(s) => s - r < 0 ? t.length - (t.length % r || r) : s - r
|
|
1295
1295
|
);
|
|
1296
|
-
}, c = async (
|
|
1297
|
-
const u = await
|
|
1298
|
-
|
|
1296
|
+
}, c = async (s) => {
|
|
1297
|
+
const u = await kr(s);
|
|
1298
|
+
e(he(u));
|
|
1299
1299
|
};
|
|
1300
1300
|
return /* @__PURE__ */ l("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ p("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
1301
|
-
(
|
|
1301
|
+
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ l(
|
|
1302
1302
|
"button",
|
|
1303
1303
|
{
|
|
1304
1304
|
onClick: i,
|
|
1305
1305
|
className: "absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
1306
|
-
children: /* @__PURE__ */ l(
|
|
1306
|
+
children: /* @__PURE__ */ l(Ze, { icon: "mdi:chevron-left", width: "25" })
|
|
1307
1307
|
}
|
|
1308
1308
|
),
|
|
1309
|
-
/* @__PURE__ */ l("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children:
|
|
1310
|
-
var u,
|
|
1309
|
+
/* @__PURE__ */ l("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(n, n + r).map((s) => {
|
|
1310
|
+
var u, f, h, m;
|
|
1311
1311
|
return /* @__PURE__ */ p(
|
|
1312
1312
|
"div",
|
|
1313
1313
|
{
|
|
1314
1314
|
className: "flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",
|
|
1315
1315
|
onClick: () => {
|
|
1316
|
-
c(
|
|
1316
|
+
c(s.product_id ?? s.productId);
|
|
1317
1317
|
},
|
|
1318
1318
|
children: [
|
|
1319
1319
|
/* @__PURE__ */ l("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ l(
|
|
1320
1320
|
"img",
|
|
1321
1321
|
{
|
|
1322
|
-
src: ((u =
|
|
1322
|
+
src: ((u = Me(s)[0]) == null ? void 0 : u.link) || Me(s)[0] || // fallback if it's a string
|
|
1323
1323
|
"https://via.placeholder.com/120",
|
|
1324
|
-
alt:
|
|
1324
|
+
alt: s != null && s.productName ? s.productName : "Product",
|
|
1325
1325
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
1326
1326
|
}
|
|
1327
1327
|
) }),
|
|
@@ -1331,8 +1331,8 @@ const bo = ({
|
|
|
1331
1331
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
1332
1332
|
children: [
|
|
1333
1333
|
/* @__PURE__ */ p("div", { className: "relative inline-block group", children: [
|
|
1334
|
-
/* @__PURE__ */ l("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children:
|
|
1335
|
-
|
|
1334
|
+
/* @__PURE__ */ l("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 : Be(
|
|
1335
|
+
De((f = s == null ? void 0 : s.name) == null ? void 0 : f["en-US"]),
|
|
1336
1336
|
60
|
|
1337
1337
|
) || "Product" }),
|
|
1338
1338
|
/* @__PURE__ */ l(
|
|
@@ -1346,21 +1346,21 @@ const bo = ({
|
|
|
1346
1346
|
marginBottom: "5px",
|
|
1347
1347
|
zIndex: 50
|
|
1348
1348
|
},
|
|
1349
|
-
children:
|
|
1350
|
-
|
|
1349
|
+
children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name : Be(
|
|
1350
|
+
De((h = s == null ? void 0 : s.name) == null ? void 0 : h["en-US"]),
|
|
1351
1351
|
60
|
|
1352
1352
|
) || "Product"
|
|
1353
1353
|
}
|
|
1354
1354
|
)
|
|
1355
1355
|
] }),
|
|
1356
1356
|
/* @__PURE__ */ p("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
1357
|
-
/* @__PURE__ */ l("p", { children:
|
|
1358
|
-
|
|
1359
|
-
(m =
|
|
1357
|
+
/* @__PURE__ */ l("p", { children: mn(
|
|
1358
|
+
s != null && s.price ? Number(s == null ? void 0 : s.price) : Ue(s).centAmount || 0,
|
|
1359
|
+
(m = Ue(s)) == null ? void 0 : m.currencyCode
|
|
1360
1360
|
) }),
|
|
1361
1361
|
/* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
1362
1362
|
"$",
|
|
1363
|
-
Number(
|
|
1363
|
+
Number(s == null ? void 0 : s.price).toFixed(2) ?? 5
|
|
1364
1364
|
] })
|
|
1365
1365
|
] })
|
|
1366
1366
|
]
|
|
@@ -1368,19 +1368,19 @@ const bo = ({
|
|
|
1368
1368
|
)
|
|
1369
1369
|
]
|
|
1370
1370
|
},
|
|
1371
|
-
|
|
1371
|
+
s.productId
|
|
1372
1372
|
);
|
|
1373
1373
|
}) }),
|
|
1374
|
-
(
|
|
1374
|
+
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ l(
|
|
1375
1375
|
"button",
|
|
1376
1376
|
{
|
|
1377
|
-
onClick:
|
|
1377
|
+
onClick: a,
|
|
1378
1378
|
className: "absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
1379
|
-
children: /* @__PURE__ */ l(
|
|
1379
|
+
children: /* @__PURE__ */ l(Ze, { icon: "mdi:chevron-right", width: "25" })
|
|
1380
1380
|
}
|
|
1381
1381
|
)
|
|
1382
1382
|
] }) });
|
|
1383
|
-
},
|
|
1383
|
+
}, vo = ({ chat: t, storeDetails: e }) => /* @__PURE__ */ l("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: t.map((r, n) => /* @__PURE__ */ p(
|
|
1384
1384
|
"div",
|
|
1385
1385
|
{
|
|
1386
1386
|
className: "mb-4 p-3 rounded-xl",
|
|
@@ -1393,216 +1393,216 @@ const bo = ({
|
|
|
1393
1393
|
"div",
|
|
1394
1394
|
{
|
|
1395
1395
|
className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
|
|
1396
|
-
children:
|
|
1396
|
+
children: gn(r.keyword) || "No keyword"
|
|
1397
1397
|
}
|
|
1398
1398
|
),
|
|
1399
1399
|
/* @__PURE__ */ l(
|
|
1400
|
-
|
|
1400
|
+
xo,
|
|
1401
1401
|
{
|
|
1402
|
-
product:
|
|
1403
|
-
storeDetails:
|
|
1402
|
+
product: r.items,
|
|
1403
|
+
storeDetails: e
|
|
1404
1404
|
}
|
|
1405
1405
|
)
|
|
1406
1406
|
]
|
|
1407
1407
|
},
|
|
1408
|
-
|
|
1409
|
-
)) }),
|
|
1410
|
-
const { serverUrl:
|
|
1408
|
+
n
|
|
1409
|
+
)) }), Lr = async (t, e) => {
|
|
1410
|
+
const { serverUrl: r, basePath: n } = wt(), o = `${r}`;
|
|
1411
1411
|
console.log(`customer_token
|
|
1412
|
-
`,
|
|
1412
|
+
`, t);
|
|
1413
1413
|
try {
|
|
1414
|
-
return (await
|
|
1415
|
-
`${o}${
|
|
1416
|
-
|
|
1414
|
+
return (await U.post(
|
|
1415
|
+
`${o}${n}/basket/create?baseUrl=${ct()}&siteId=${rt()}&pubCfg=${lt()}&envRef=${ut()}&orgRef=${dt()}`,
|
|
1416
|
+
e,
|
|
1417
1417
|
{
|
|
1418
1418
|
headers: {
|
|
1419
1419
|
"Content-Type": "application/json",
|
|
1420
|
-
Authorization:
|
|
1420
|
+
Authorization: t
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
1423
|
)).data;
|
|
1424
|
-
} catch (
|
|
1425
|
-
return
|
|
1424
|
+
} catch (a) {
|
|
1425
|
+
return U.isAxiosError(a) ? console.error("Error creating basket:", a.response || a.message) : console.error("Unexpected error:", a), null;
|
|
1426
1426
|
}
|
|
1427
|
-
},
|
|
1428
|
-
const { serverUrl:
|
|
1427
|
+
}, Wt = async (t, e, r) => {
|
|
1428
|
+
const { serverUrl: n, basePath: o } = wt(), a = `${n}`;
|
|
1429
1429
|
try {
|
|
1430
|
-
const i = await
|
|
1431
|
-
`${
|
|
1432
|
-
|
|
1430
|
+
const i = await U.post(
|
|
1431
|
+
`${a}${o}/basket/add-product/${t}?baseUrl=${ct()}&siteId=${rt()}&pubCfg=${lt()}&envRef=${ut()}&orgRef=${dt()}`,
|
|
1432
|
+
e,
|
|
1433
1433
|
{
|
|
1434
1434
|
headers: {
|
|
1435
1435
|
"Content-Type": "application/json",
|
|
1436
|
-
Authorization:
|
|
1436
|
+
Authorization: r
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
1439
|
);
|
|
1440
1440
|
return i.status === 200 && i.data ? i.data : null;
|
|
1441
1441
|
} catch (i) {
|
|
1442
|
-
return
|
|
1442
|
+
return U.isAxiosError(i) ? console.error(
|
|
1443
1443
|
"Error adding products to basket:",
|
|
1444
1444
|
i.response || i.message
|
|
1445
1445
|
) : console.error("Unexpected error:", i), null;
|
|
1446
1446
|
}
|
|
1447
|
-
},
|
|
1448
|
-
basketId:
|
|
1449
|
-
customer_token:
|
|
1447
|
+
}, zr = async ({
|
|
1448
|
+
basketId: t,
|
|
1449
|
+
customer_token: e
|
|
1450
1450
|
}) => {
|
|
1451
|
-
var
|
|
1452
|
-
const { serverUrl:
|
|
1451
|
+
var a;
|
|
1452
|
+
const { serverUrl: r, basePath: n } = wt(), o = `${r}`;
|
|
1453
1453
|
try {
|
|
1454
|
-
const i = await
|
|
1455
|
-
`${o}${
|
|
1454
|
+
const i = await U.get(
|
|
1455
|
+
`${o}${n}/basket/${t}?baseUrl=${ct()}&siteId=${rt()}&pubCfg=${lt()}&envRef=${ut()}&orgRef=${dt()}`,
|
|
1456
1456
|
{
|
|
1457
1457
|
headers: {
|
|
1458
1458
|
"Content-Type": "application/json",
|
|
1459
|
-
Authorization:
|
|
1459
|
+
Authorization: e
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
1462
|
);
|
|
1463
1463
|
return { status: i.status, data: i.data };
|
|
1464
1464
|
} catch (i) {
|
|
1465
|
-
return
|
|
1465
|
+
return U.isAxiosError(i) ? { status: (a = i.response) == null ? void 0 : a.status, data: null } : { status: null, data: null };
|
|
1466
1466
|
}
|
|
1467
|
-
},
|
|
1468
|
-
const
|
|
1467
|
+
}, tr = "sfcc_basket_id", er = "sfcc_customer_token", Ut = "sfcc_token_expiry", ko = 300 * 1e3, At = "1.0.0";
|
|
1468
|
+
const Nt = (t) => {
|
|
1469
1469
|
try {
|
|
1470
|
-
|
|
1471
|
-
} catch (
|
|
1472
|
-
console.error("Error saving basket ID to storage:",
|
|
1470
|
+
t ? localStorage.setItem(tr, t) : localStorage.removeItem(tr);
|
|
1471
|
+
} catch (e) {
|
|
1472
|
+
console.error("Error saving basket ID to storage:", e);
|
|
1473
1473
|
}
|
|
1474
|
-
},
|
|
1474
|
+
}, Qt = (t) => {
|
|
1475
1475
|
try {
|
|
1476
|
-
if (
|
|
1477
|
-
localStorage.setItem(
|
|
1478
|
-
const
|
|
1479
|
-
localStorage.setItem(
|
|
1476
|
+
if (t) {
|
|
1477
|
+
localStorage.setItem(er, t);
|
|
1478
|
+
const e = Date.now() + ko;
|
|
1479
|
+
localStorage.setItem(Ut, e.toString());
|
|
1480
1480
|
} else
|
|
1481
|
-
localStorage.removeItem(
|
|
1482
|
-
} catch (
|
|
1483
|
-
console.error("Error storing token:",
|
|
1484
|
-
}
|
|
1485
|
-
},
|
|
1486
|
-
var c,
|
|
1487
|
-
const
|
|
1488
|
-
if (
|
|
1489
|
-
o(!!
|
|
1490
|
-
}, [
|
|
1491
|
-
const
|
|
1492
|
-
var g,
|
|
1493
|
-
console.log(
|
|
1481
|
+
localStorage.removeItem(er);
|
|
1482
|
+
} catch (e) {
|
|
1483
|
+
console.error("Error storing token:", e);
|
|
1484
|
+
}
|
|
1485
|
+
}, rr = 300, So = () => {
|
|
1486
|
+
var c, s, u, f, h, m;
|
|
1487
|
+
const t = hr(), e = Kt((g) => g.product.product), r = Kt((g) => g.store.store), [n, o] = D(!!e);
|
|
1488
|
+
if (gt(() => {
|
|
1489
|
+
o(!!e);
|
|
1490
|
+
}, [e]), !e) return null;
|
|
1491
|
+
const a = async () => {
|
|
1492
|
+
var g, k, _, w, v, B, P, $, Z, S, L, H, V, O, yt, T;
|
|
1493
|
+
console.log(e, "the prod");
|
|
1494
1494
|
try {
|
|
1495
|
-
if (!((
|
|
1496
|
-
|
|
1495
|
+
if (!((k = (g = e == null ? void 0 : e.variants) == null ? void 0 : g[0]) != null && k.product_id) && !(e.type.item || e.type.bundle) && !((w = (_ = e == null ? void 0 : e.variants) == null ? void 0 : _[0]) != null && w.productId)) {
|
|
1496
|
+
X.error("Variants not available", {
|
|
1497
1497
|
position: "bottom-right",
|
|
1498
1498
|
autoClose: 1e3
|
|
1499
1499
|
}), console.error("No product variant found");
|
|
1500
1500
|
return;
|
|
1501
1501
|
}
|
|
1502
|
-
const
|
|
1502
|
+
const j = [
|
|
1503
1503
|
{
|
|
1504
|
-
product_id: ((v =
|
|
1504
|
+
product_id: ((v = e.variants) == null ? void 0 : v[0].product_id) || ((B = e.variants) == null ? void 0 : B[0].productId) || (e == null ? void 0 : e.id),
|
|
1505
1505
|
quantity: 1
|
|
1506
1506
|
}
|
|
1507
1507
|
];
|
|
1508
|
-
console.log(
|
|
1509
|
-
const
|
|
1508
|
+
console.log(j, "the product data");
|
|
1509
|
+
const Pt = JSON.parse(
|
|
1510
1510
|
sessionStorage.getItem("customerData") || "{}"
|
|
1511
|
-
),
|
|
1512
|
-
if (!
|
|
1513
|
-
let
|
|
1511
|
+
), ft = Pt == null ? void 0 : Pt.basketId, ee = !1, nt = localStorage.getItem(Ut), pt = Date.now();
|
|
1512
|
+
if (!ee || !nt || pt >= parseInt(nt)) {
|
|
1513
|
+
let Y = "";
|
|
1514
1514
|
{
|
|
1515
|
-
const
|
|
1516
|
-
console.log("token from auth data"),
|
|
1515
|
+
const bt = await Zt();
|
|
1516
|
+
console.log("token from auth data"), Y = "Bearer " + bt.access_token;
|
|
1517
1517
|
}
|
|
1518
|
-
if (!
|
|
1518
|
+
if (!Y) {
|
|
1519
1519
|
console.error("Failed to get customer_token");
|
|
1520
1520
|
return;
|
|
1521
1521
|
}
|
|
1522
|
-
const
|
|
1523
|
-
if (
|
|
1524
|
-
const
|
|
1525
|
-
basketId:
|
|
1526
|
-
customer_token:
|
|
1522
|
+
const re = pt + 300 * 1e3;
|
|
1523
|
+
if (Qt(Y), localStorage.setItem(Ut, re.toString()), ft) {
|
|
1524
|
+
const bt = await zr({
|
|
1525
|
+
basketId: ft,
|
|
1526
|
+
customer_token: Y
|
|
1527
1527
|
});
|
|
1528
|
-
if (console.log(
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1528
|
+
if (console.log(ft, "basket id from customer"), bt.status === 200 && bt) {
|
|
1529
|
+
const ot = await Wt(
|
|
1530
|
+
ft,
|
|
1531
|
+
j,
|
|
1532
|
+
Y
|
|
1533
1533
|
);
|
|
1534
|
-
(((P =
|
|
1534
|
+
(((P = ot == null ? void 0 : ot.product_items) == null ? void 0 : P.length) > 0 || (($ = ot == null ? void 0 : ot.productItems) == null ? void 0 : $.length) > 0) && (X.success("Added to cart", {
|
|
1535
1535
|
position: "bottom-right",
|
|
1536
1536
|
autoClose: 3e3,
|
|
1537
1537
|
hideProgressBar: !1,
|
|
1538
1538
|
closeOnClick: !0,
|
|
1539
1539
|
pauseOnHover: !0,
|
|
1540
1540
|
draggable: !0
|
|
1541
|
-
}),
|
|
1541
|
+
}), Ft(ft));
|
|
1542
1542
|
return;
|
|
1543
1543
|
}
|
|
1544
1544
|
}
|
|
1545
|
-
const
|
|
1545
|
+
const ne = {
|
|
1546
1546
|
productItems: [
|
|
1547
1547
|
{
|
|
1548
|
-
productId: ((
|
|
1548
|
+
productId: ((Z = e.variants) == null ? void 0 : Z[0].product_id) || ((S = e.variants) == null ? void 0 : S[0].productId) || (e == null ? void 0 : e.id),
|
|
1549
1549
|
quantity: 1
|
|
1550
1550
|
}
|
|
1551
1551
|
]
|
|
1552
1552
|
};
|
|
1553
1553
|
console.log("before create basket");
|
|
1554
|
-
const
|
|
1554
|
+
const b = await Lr(Y, ne);
|
|
1555
1555
|
if (console.log(
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1556
|
+
b,
|
|
1557
|
+
b == null ? void 0 : b.basket_id,
|
|
1558
|
+
b == null ? void 0 : b.basketId,
|
|
1559
1559
|
"the basket response"
|
|
1560
|
-
), !(
|
|
1560
|
+
), !(b != null && b.basket_id) && !(b != null && b.basketId)) {
|
|
1561
1561
|
console.error("Failed to create basket");
|
|
1562
1562
|
return;
|
|
1563
1563
|
}
|
|
1564
1564
|
console.log(
|
|
1565
1565
|
"setting stored id",
|
|
1566
|
-
(
|
|
1567
|
-
),
|
|
1568
|
-
(
|
|
1566
|
+
(b == null ? void 0 : b.basket_id) || (b == null ? void 0 : b.basketId)
|
|
1567
|
+
), Nt(
|
|
1568
|
+
(b == null ? void 0 : b.basket_id) || (b == null ? void 0 : b.basketId)
|
|
1569
1569
|
), console.log("adding product to basket");
|
|
1570
|
-
const
|
|
1571
|
-
(
|
|
1572
|
-
|
|
1573
|
-
|
|
1570
|
+
const J = await Wt(
|
|
1571
|
+
(b == null ? void 0 : b.basket_id) || (b == null ? void 0 : b.basketId),
|
|
1572
|
+
j,
|
|
1573
|
+
Y
|
|
1574
1574
|
);
|
|
1575
|
-
console.log("object added to basket"), (((L =
|
|
1575
|
+
console.log("object added to basket"), (((L = J == null ? void 0 : J.product_items) == null ? void 0 : L.length) > 0 || ((H = J == null ? void 0 : J.productItems) == null ? void 0 : H.length) > 0) && X.success("Added to cart", {
|
|
1576
1576
|
position: "bottom-right",
|
|
1577
1577
|
autoClose: 3e3,
|
|
1578
1578
|
hideProgressBar: !1,
|
|
1579
1579
|
closeOnClick: !0,
|
|
1580
1580
|
pauseOnHover: !0,
|
|
1581
1581
|
draggable: !0
|
|
1582
|
-
}),
|
|
1582
|
+
}), Ft(b.basket_id || (b == null ? void 0 : b.basketId));
|
|
1583
1583
|
}
|
|
1584
|
-
} catch (
|
|
1585
|
-
console.error("Error adding to cart:",
|
|
1584
|
+
} catch (j) {
|
|
1585
|
+
console.error("Error adding to cart:", j), X.error("Failed to add product to cart", {
|
|
1586
1586
|
position: "bottom-right",
|
|
1587
1587
|
autoClose: 3e3
|
|
1588
|
-
}), ((V =
|
|
1589
|
-
((O =
|
|
1588
|
+
}), ((V = j == null ? void 0 : j.response) == null ? void 0 : V.status) === 404 || // Basket not found
|
|
1589
|
+
((O = j == null ? void 0 : j.response) == null ? void 0 : O.status) === 401 ? (((yt = j == null ? void 0 : j.response) == null ? void 0 : yt.status) === 404 && Nt(null), ((T = j == null ? void 0 : j.response) == null ? void 0 : T.status) === 401 && (Nt(null), Qt(null))) : (console.error("Failed to add product to basket:", j.message), X.error("Failed to add product to cart", {
|
|
1590
1590
|
position: "bottom-right",
|
|
1591
1591
|
autoClose: 3e3
|
|
1592
1592
|
}));
|
|
1593
1593
|
} finally {
|
|
1594
|
-
|
|
1594
|
+
Ft();
|
|
1595
1595
|
}
|
|
1596
1596
|
}, i = () => {
|
|
1597
|
-
|
|
1597
|
+
e && (window.location.href = e.c_pdpUrl);
|
|
1598
1598
|
};
|
|
1599
|
-
return console.log(
|
|
1599
|
+
return console.log(e, "the prod"), /* @__PURE__ */ p(fe, { children: [
|
|
1600
1600
|
/* @__PURE__ */ l(
|
|
1601
1601
|
"div",
|
|
1602
1602
|
{
|
|
1603
1603
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1604
1604
|
onClick: () => {
|
|
1605
|
-
o(!1), setTimeout(() =>
|
|
1605
|
+
o(!1), setTimeout(() => t(he(null)), rr);
|
|
1606
1606
|
}
|
|
1607
1607
|
}
|
|
1608
1608
|
),
|
|
@@ -1612,22 +1612,22 @@ const Fe = (e) => {
|
|
|
1612
1612
|
className: `
|
|
1613
1613
|
flex flex-col gap-2 items-center h-[90vh] absolute right-0 bottom-0 z-50 w-full md:w-1/2 md:h-[100vh] lg:w-1/2 lg:h-[100vh] shadow-xl p-2 border-l-2 bg-white border-gray-200 overflow-y-scroll
|
|
1614
1614
|
transition-all duration-300
|
|
1615
|
-
${
|
|
1615
|
+
${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"}
|
|
1616
1616
|
`,
|
|
1617
1617
|
style: { willChange: "transform, opacity" },
|
|
1618
1618
|
onClick: (g) => g.stopPropagation(),
|
|
1619
1619
|
children: [
|
|
1620
1620
|
/* @__PURE__ */ p("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
1621
|
-
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#000000] font-bold font-nunitoSans", children:
|
|
1621
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#000000] font-bold font-nunitoSans", children: e.name }) }),
|
|
1622
1622
|
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
1623
|
-
|
|
1623
|
+
Le,
|
|
1624
1624
|
{
|
|
1625
1625
|
icon: "mdi:close",
|
|
1626
1626
|
className: "text-[#555555] w-6 h-6 cursor-pointer",
|
|
1627
1627
|
onClick: () => {
|
|
1628
1628
|
o(!1), setTimeout(
|
|
1629
|
-
() =>
|
|
1630
|
-
|
|
1629
|
+
() => t(he(null)),
|
|
1630
|
+
rr
|
|
1631
1631
|
);
|
|
1632
1632
|
}
|
|
1633
1633
|
}
|
|
@@ -1637,20 +1637,20 @@ const Fe = (e) => {
|
|
|
1637
1637
|
/* @__PURE__ */ l("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ l(
|
|
1638
1638
|
"img",
|
|
1639
1639
|
{
|
|
1640
|
-
src: (
|
|
1641
|
-
alt:
|
|
1640
|
+
src: (f = (u = (s = (c = e.imageGroups) == null ? void 0 : c[0]) == null ? void 0 : s.images) == null ? void 0 : u[0]) == null ? void 0 : f.link,
|
|
1641
|
+
alt: e.name,
|
|
1642
1642
|
className: "rounded-[10px]"
|
|
1643
1643
|
}
|
|
1644
1644
|
) }),
|
|
1645
|
-
/* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2", children:
|
|
1646
|
-
(g) => g.images.slice(1, 2).map((
|
|
1645
|
+
/* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2", children: e.imageGroups.slice(1, 2).map(
|
|
1646
|
+
(g) => g.images.slice(1, 2).map((k) => /* @__PURE__ */ l(
|
|
1647
1647
|
"img",
|
|
1648
1648
|
{
|
|
1649
|
-
src:
|
|
1650
|
-
alt:
|
|
1649
|
+
src: k.link,
|
|
1650
|
+
alt: e.name,
|
|
1651
1651
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
1652
1652
|
},
|
|
1653
|
-
|
|
1653
|
+
k.link
|
|
1654
1654
|
))
|
|
1655
1655
|
) })
|
|
1656
1656
|
] }),
|
|
@@ -1659,16 +1659,16 @@ const Fe = (e) => {
|
|
|
1659
1659
|
/* @__PURE__ */ p("p", { className: "text-[#14121F] font-bold font-nunitoSans", children: [
|
|
1660
1660
|
" ",
|
|
1661
1661
|
"$",
|
|
1662
|
-
|
|
1662
|
+
e.price.toFixed(2)
|
|
1663
1663
|
] }),
|
|
1664
1664
|
" ",
|
|
1665
1665
|
/* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans", children: [
|
|
1666
1666
|
" ",
|
|
1667
1667
|
"$",
|
|
1668
|
-
(
|
|
1668
|
+
(e.price + 5).toFixed(2)
|
|
1669
1669
|
] })
|
|
1670
1670
|
] }),
|
|
1671
|
-
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children:
|
|
1671
|
+
/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: e.discount }) })
|
|
1672
1672
|
] }),
|
|
1673
1673
|
/* @__PURE__ */ l("div", { className: "mt-2 w-full border-t-2 border-gray-200" }),
|
|
1674
1674
|
/* @__PURE__ */ p("div", { className: "w-full text-left", children: [
|
|
@@ -1677,37 +1677,37 @@ const Fe = (e) => {
|
|
|
1677
1677
|
"div",
|
|
1678
1678
|
{
|
|
1679
1679
|
className: "text-[#68656E] font-normal font-nunitoSans text-xs pl-2 mt-3",
|
|
1680
|
-
dangerouslySetInnerHTML: { __html:
|
|
1680
|
+
dangerouslySetInnerHTML: { __html: e.short_description || e.longDescription }
|
|
1681
1681
|
}
|
|
1682
1682
|
)
|
|
1683
1683
|
] }),
|
|
1684
1684
|
/* @__PURE__ */ p("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
1685
1685
|
/* @__PURE__ */ l("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ p("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
|
|
1686
1686
|
/* @__PURE__ */ p("div", { className: "text-[#323135] font-bold", children: [
|
|
1687
|
-
((h =
|
|
1687
|
+
((h = e == null ? void 0 : e.rating) == null ? void 0 : h.rate) || 0,
|
|
1688
1688
|
" /",
|
|
1689
1689
|
" ",
|
|
1690
1690
|
/* @__PURE__ */ l("span", { className: "text-[#68656E]", children: "5" })
|
|
1691
1691
|
] }),
|
|
1692
1692
|
/* @__PURE__ */ l("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
1693
1693
|
/* @__PURE__ */ p("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
1694
|
-
((m =
|
|
1694
|
+
((m = e == null ? void 0 : e.rating) == null ? void 0 : m.count) || 0,
|
|
1695
1695
|
" ratings"
|
|
1696
1696
|
] })
|
|
1697
1697
|
] }) }),
|
|
1698
|
-
/* @__PURE__ */ l("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((g,
|
|
1698
|
+
/* @__PURE__ */ l("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((g, k) => {
|
|
1699
1699
|
var _;
|
|
1700
1700
|
return /* @__PURE__ */ l(
|
|
1701
|
-
|
|
1701
|
+
Le,
|
|
1702
1702
|
{
|
|
1703
1703
|
icon: "mdi:star",
|
|
1704
1704
|
width: "20",
|
|
1705
1705
|
height: "20",
|
|
1706
1706
|
className: `text-yellow-500
|
|
1707
|
-
${((_ =
|
|
1707
|
+
${((_ = e == null ? void 0 : e.rating) == null ? void 0 : _.rate) > k ? "text-yellow-500" : "text-gray-300"}
|
|
1708
1708
|
`
|
|
1709
1709
|
},
|
|
1710
|
-
|
|
1710
|
+
k
|
|
1711
1711
|
);
|
|
1712
1712
|
}) })
|
|
1713
1713
|
] }),
|
|
@@ -1721,8 +1721,8 @@ const Fe = (e) => {
|
|
|
1721
1721
|
"button",
|
|
1722
1722
|
{
|
|
1723
1723
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",
|
|
1724
|
-
style: { backgroundColor:
|
|
1725
|
-
onClick:
|
|
1724
|
+
style: { backgroundColor: r.tanyaThemeColor },
|
|
1725
|
+
onClick: a,
|
|
1726
1726
|
children: "Add to Cart"
|
|
1727
1727
|
}
|
|
1728
1728
|
),
|
|
@@ -1730,7 +1730,7 @@ const Fe = (e) => {
|
|
|
1730
1730
|
"button",
|
|
1731
1731
|
{
|
|
1732
1732
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
|
|
1733
|
-
style: { backgroundColor:
|
|
1733
|
+
style: { backgroundColor: r.tanyaThemeColor },
|
|
1734
1734
|
onClick: i,
|
|
1735
1735
|
children: "View more"
|
|
1736
1736
|
}
|
|
@@ -1742,158 +1742,158 @@ const Fe = (e) => {
|
|
|
1742
1742
|
}
|
|
1743
1743
|
)
|
|
1744
1744
|
] });
|
|
1745
|
-
},
|
|
1746
|
-
const
|
|
1745
|
+
}, Co = () => {
|
|
1746
|
+
const t = [
|
|
1747
1747
|
"Myself",
|
|
1748
1748
|
"My Child",
|
|
1749
1749
|
"My Grandchild",
|
|
1750
1750
|
"Niece/Nephew",
|
|
1751
1751
|
"My Friends",
|
|
1752
1752
|
"Others"
|
|
1753
|
-
],
|
|
1753
|
+
], e = {
|
|
1754
1754
|
Myself: "himself/herself",
|
|
1755
1755
|
"My Child": "his/her child",
|
|
1756
1756
|
"My Grandchild": "his/her grandchild",
|
|
1757
1757
|
"Niece/Nephew": "his/her niece/nephew",
|
|
1758
1758
|
"My Friends": "his/her friends",
|
|
1759
1759
|
Others: "others"
|
|
1760
|
-
},
|
|
1760
|
+
}, r = Ot(null), n = Ot(null), o = Ot(null), a = Ot(null), [i, c] = D(null), [s, u] = D(
|
|
1761
1761
|
!1
|
|
1762
|
-
), [
|
|
1763
|
-
id:
|
|
1764
|
-
title:
|
|
1765
|
-
image:
|
|
1766
|
-
price:
|
|
1767
|
-
}), [V, O] =
|
|
1762
|
+
), [f, h] = D(!1), [m, g] = D(!1), [k, _] = D(!1), [w, v] = D(!1), [B, P] = D(!1), [$, Z] = D(""), [S, L] = D(""), H = (d) => ({
|
|
1763
|
+
id: d.id,
|
|
1764
|
+
title: d.name,
|
|
1765
|
+
image: d.image ?? "",
|
|
1766
|
+
price: d.price ?? 0
|
|
1767
|
+
}), [V, O] = D([]), yt = Ot(null), T = Kt((d) => d.store.store), j = Kt((d) => d.product.product), Pt = () => {
|
|
1768
1768
|
g(!0), setTimeout(() => h(!0), 10);
|
|
1769
|
-
},
|
|
1769
|
+
}, ft = () => {
|
|
1770
1770
|
h(!1), setTimeout(() => g(!1), 300);
|
|
1771
1771
|
};
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
}, [
|
|
1775
|
-
const
|
|
1776
|
-
L(
|
|
1772
|
+
gt(() => {
|
|
1773
|
+
s ? Pt() : ft();
|
|
1774
|
+
}, [s]);
|
|
1775
|
+
const ee = (d) => {
|
|
1776
|
+
L(e[d]);
|
|
1777
1777
|
};
|
|
1778
|
-
|
|
1779
|
-
|
|
1778
|
+
gt(() => {
|
|
1779
|
+
yt.current && (yt.current.scrollTop += 150);
|
|
1780
1780
|
}, [V]);
|
|
1781
|
-
let
|
|
1782
|
-
const
|
|
1783
|
-
if (
|
|
1784
|
-
return
|
|
1781
|
+
let nt = null, pt = null;
|
|
1782
|
+
const Y = async () => {
|
|
1783
|
+
if (nt && pt && Date.now() < pt)
|
|
1784
|
+
return nt;
|
|
1785
1785
|
try {
|
|
1786
|
-
const
|
|
1786
|
+
const d = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", E = new URLSearchParams({
|
|
1787
1787
|
grant_type: "client_credentials",
|
|
1788
1788
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
1789
1789
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
1790
1790
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
1791
|
-
}),
|
|
1791
|
+
}), I = await fetch(d, {
|
|
1792
1792
|
method: "POST",
|
|
1793
1793
|
headers: {
|
|
1794
1794
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
1795
1795
|
},
|
|
1796
|
-
body:
|
|
1796
|
+
body: E
|
|
1797
1797
|
});
|
|
1798
|
-
if (!
|
|
1798
|
+
if (!I.ok)
|
|
1799
1799
|
throw new Error(
|
|
1800
|
-
`Token request failed! status: ${
|
|
1800
|
+
`Token request failed! status: ${I.status}`
|
|
1801
1801
|
);
|
|
1802
|
-
const
|
|
1803
|
-
|
|
1804
|
-
const x =
|
|
1805
|
-
return
|
|
1806
|
-
} catch (
|
|
1807
|
-
return console.error("Error obtaining JWT token:",
|
|
1802
|
+
const N = await I.json();
|
|
1803
|
+
nt = N.access_token;
|
|
1804
|
+
const x = N.expires_in || 3600;
|
|
1805
|
+
return pt = Date.now() + (x - 60) * 1e3, nt;
|
|
1806
|
+
} catch (d) {
|
|
1807
|
+
return console.error("Error obtaining JWT token:", d), nt = null, pt = null, null;
|
|
1808
1808
|
}
|
|
1809
|
-
},
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1809
|
+
}, re = async () => {
|
|
1810
|
+
const d = await Zt();
|
|
1811
|
+
d != null && c(d);
|
|
1812
1812
|
};
|
|
1813
|
-
|
|
1814
|
-
|
|
1813
|
+
gt(() => {
|
|
1814
|
+
re(), console.log("scapi environment v1");
|
|
1815
1815
|
}, []);
|
|
1816
|
-
const
|
|
1817
|
-
const
|
|
1816
|
+
const ne = async () => {
|
|
1817
|
+
const d = JSON.parse(
|
|
1818
1818
|
sessionStorage.getItem("customerData") || "{}"
|
|
1819
1819
|
).customerId;
|
|
1820
|
-
return (await
|
|
1821
|
-
},
|
|
1822
|
-
console.log("in secondary flow",
|
|
1823
|
-
const
|
|
1824
|
-
if (console.log(
|
|
1820
|
+
return (await hn(d || "")).c_interests;
|
|
1821
|
+
}, b = async (d, E) => {
|
|
1822
|
+
console.log("in secondary flow", At);
|
|
1823
|
+
const I = await ne();
|
|
1824
|
+
if (console.log(I, "interests of customer", At), !!I)
|
|
1825
1825
|
try {
|
|
1826
1826
|
O(
|
|
1827
|
-
(
|
|
1828
|
-
(
|
|
1827
|
+
(W) => W.map(
|
|
1828
|
+
(tt, et) => et === W.length - 1 ? { ...tt, secondaryLoading: !0 } : tt
|
|
1829
1829
|
)
|
|
1830
1830
|
);
|
|
1831
|
-
const
|
|
1832
|
-
if (!
|
|
1833
|
-
const x = localStorage.getItem("customerNumber"),
|
|
1834
|
-
registered: String(
|
|
1831
|
+
const N = await Y();
|
|
1832
|
+
if (!N) throw new Error("Failed to fetch token");
|
|
1833
|
+
const x = localStorage.getItem("customerNumber"), C = localStorage.getItem("isLoggedIn"), xt = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
1834
|
+
registered: String(C || !1),
|
|
1835
1835
|
userId: String(x || (/* @__PURE__ */ new Date()).getTime())
|
|
1836
|
-
}).toString()}`,
|
|
1836
|
+
}).toString()}`, vt = JSON.stringify({
|
|
1837
1837
|
flowId: "Q166PR519W",
|
|
1838
1838
|
flowAliasId: "HKFUVLWVH2",
|
|
1839
1839
|
input: {
|
|
1840
1840
|
loyaltyPoints: "",
|
|
1841
|
-
productName:
|
|
1842
|
-
productPoints: String(
|
|
1843
|
-
interests:
|
|
1841
|
+
productName: d,
|
|
1842
|
+
productPoints: String(E || 0),
|
|
1843
|
+
interests: I
|
|
1844
1844
|
}
|
|
1845
|
-
}),
|
|
1845
|
+
}), K = await fetch(xt, {
|
|
1846
1846
|
signal: AbortSignal.timeout(3e4),
|
|
1847
1847
|
method: "POST",
|
|
1848
1848
|
headers: {
|
|
1849
1849
|
"Content-Type": "application/json",
|
|
1850
|
-
Authorization: `Bearer ${
|
|
1850
|
+
Authorization: `Bearer ${N}`
|
|
1851
1851
|
},
|
|
1852
|
-
body:
|
|
1852
|
+
body: vt
|
|
1853
1853
|
});
|
|
1854
|
-
if (!
|
|
1855
|
-
const
|
|
1856
|
-
let
|
|
1854
|
+
if (!K.body) throw new Error("Readable stream not supported");
|
|
1855
|
+
const kt = K.body.getReader(), St = new TextDecoder();
|
|
1856
|
+
let G = "";
|
|
1857
1857
|
for (; ; ) {
|
|
1858
|
-
const { done:
|
|
1859
|
-
if (
|
|
1860
|
-
|
|
1861
|
-
const
|
|
1858
|
+
const { done: W, value: tt } = await kt.read();
|
|
1859
|
+
if (W) break;
|
|
1860
|
+
G += St.decode(tt, { stream: !0 });
|
|
1861
|
+
const et = G.split(`
|
|
1862
1862
|
`);
|
|
1863
|
-
|
|
1864
|
-
for (const
|
|
1865
|
-
if (
|
|
1866
|
-
const
|
|
1863
|
+
G = et.pop() || "";
|
|
1864
|
+
for (const at of et)
|
|
1865
|
+
if (at.startsWith("data:")) {
|
|
1866
|
+
const y = at.slice(5).trim();
|
|
1867
1867
|
try {
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1868
|
+
const Q = JSON.parse(y);
|
|
1869
|
+
Q.index === 0 && O(
|
|
1870
1870
|
(A) => A.map(
|
|
1871
|
-
(
|
|
1872
|
-
...
|
|
1873
|
-
secondaryResponse:
|
|
1871
|
+
(q, it) => it === A.length - 1 ? {
|
|
1872
|
+
...q,
|
|
1873
|
+
secondaryResponse: Q.data,
|
|
1874
1874
|
secondaryLoading: !1
|
|
1875
|
-
} :
|
|
1875
|
+
} : q
|
|
1876
1876
|
)
|
|
1877
1877
|
);
|
|
1878
|
-
} catch (
|
|
1878
|
+
} catch (Q) {
|
|
1879
1879
|
O(
|
|
1880
1880
|
(A) => A.map(
|
|
1881
|
-
(
|
|
1881
|
+
(q, it) => it === A.length - 1 ? { ...q, secondaryLoading: !1 } : q
|
|
1882
1882
|
)
|
|
1883
|
-
), console.error("Secondary flow JSON parse error:",
|
|
1883
|
+
), console.error("Secondary flow JSON parse error:", Q);
|
|
1884
1884
|
}
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
|
-
} catch (
|
|
1888
|
-
console.error("Secondary flow error:",
|
|
1887
|
+
} catch (N) {
|
|
1888
|
+
console.error("Secondary flow error:", N);
|
|
1889
1889
|
}
|
|
1890
|
-
},
|
|
1891
|
-
const
|
|
1892
|
-
if (
|
|
1893
|
-
v(!0),
|
|
1894
|
-
...
|
|
1890
|
+
}, J = async (d) => {
|
|
1891
|
+
const E = d || $.trim();
|
|
1892
|
+
if (E) {
|
|
1893
|
+
v(!0), Z(""), r.current = null, n.current = null, o.current = null, a.current = null, O((I) => [
|
|
1894
|
+
...I,
|
|
1895
1895
|
{
|
|
1896
|
-
query:
|
|
1896
|
+
query: E,
|
|
1897
1897
|
response: "Thinking for what suits you best...",
|
|
1898
1898
|
potentialQuestions: "",
|
|
1899
1899
|
products: [],
|
|
@@ -1901,52 +1901,52 @@ const Fe = (e) => {
|
|
|
1901
1901
|
}
|
|
1902
1902
|
]);
|
|
1903
1903
|
try {
|
|
1904
|
-
const
|
|
1905
|
-
if (!
|
|
1904
|
+
const I = S, N = localStorage.getItem("customerNumber"), x = localStorage.getItem("isLoggedIn"), C = await Y();
|
|
1905
|
+
if (!C)
|
|
1906
1906
|
throw new Error("Failed to obtain access token");
|
|
1907
|
-
const
|
|
1907
|
+
const xt = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
1908
1908
|
registered: String(x || !1),
|
|
1909
|
-
userId: String(
|
|
1910
|
-
}).toString()}`,
|
|
1909
|
+
userId: String(N || (/* @__PURE__ */ new Date()).getTime())
|
|
1910
|
+
}).toString()}`, vt = JSON.stringify({
|
|
1911
1911
|
flowId: "MMHQKYI1NE",
|
|
1912
1912
|
flowAliasId: "SZF9ZK1ATE",
|
|
1913
1913
|
input: {
|
|
1914
|
-
userPrompt:
|
|
1915
|
-
whom:
|
|
1914
|
+
userPrompt: E,
|
|
1915
|
+
whom: I
|
|
1916
1916
|
}
|
|
1917
|
-
}),
|
|
1917
|
+
}), K = await fetch(xt, {
|
|
1918
1918
|
signal: AbortSignal.timeout(3e4),
|
|
1919
1919
|
method: "POST",
|
|
1920
1920
|
headers: {
|
|
1921
1921
|
"Content-Type": "application/json",
|
|
1922
|
-
Authorization: `Bearer ${
|
|
1922
|
+
Authorization: `Bearer ${C}`
|
|
1923
1923
|
},
|
|
1924
|
-
body:
|
|
1924
|
+
body: vt
|
|
1925
1925
|
});
|
|
1926
|
-
if (!
|
|
1927
|
-
throw new Error(`HTTP error! status: ${
|
|
1928
|
-
if (!
|
|
1929
|
-
const
|
|
1930
|
-
let
|
|
1926
|
+
if (!K.ok)
|
|
1927
|
+
throw new Error(`HTTP error! status: ${K.status}`);
|
|
1928
|
+
if (!K.body) throw new Error("Readable stream not supported");
|
|
1929
|
+
const kt = K.body.getReader(), St = new TextDecoder();
|
|
1930
|
+
let G = "", W = "";
|
|
1931
1931
|
for (; ; ) {
|
|
1932
1932
|
P(!0);
|
|
1933
|
-
const { done:
|
|
1934
|
-
if (
|
|
1935
|
-
|
|
1936
|
-
const
|
|
1933
|
+
const { done: tt, value: et } = await kt.read();
|
|
1934
|
+
if (tt) break;
|
|
1935
|
+
G += St.decode(et, { stream: !0 });
|
|
1936
|
+
const at = G.split(`
|
|
1937
1937
|
`);
|
|
1938
|
-
|
|
1939
|
-
for (const
|
|
1940
|
-
if (
|
|
1941
|
-
const
|
|
1938
|
+
G = at.pop() || "";
|
|
1939
|
+
for (const y of at)
|
|
1940
|
+
if (y.startsWith("data:")) {
|
|
1941
|
+
const Q = y.slice(5).trim();
|
|
1942
1942
|
try {
|
|
1943
|
-
const A = JSON.parse(
|
|
1944
|
-
A.index == 1 && (
|
|
1945
|
-
(
|
|
1946
|
-
(
|
|
1947
|
-
...
|
|
1943
|
+
const A = JSON.parse(Q);
|
|
1944
|
+
A.index == 1 && (W = A.data), O(
|
|
1945
|
+
(q) => q.map(
|
|
1946
|
+
(it, Bt) => Bt === q.length - 1 ? {
|
|
1947
|
+
...it,
|
|
1948
1948
|
[A.index == 0 ? "response" : A.index == 1 ? "keywords" : A.index == 2 ? "potentialQuestions" : "end"]: A.data
|
|
1949
|
-
} :
|
|
1949
|
+
} : it
|
|
1950
1950
|
)
|
|
1951
1951
|
);
|
|
1952
1952
|
} catch (A) {
|
|
@@ -1954,189 +1954,189 @@ const Fe = (e) => {
|
|
|
1954
1954
|
}
|
|
1955
1955
|
}
|
|
1956
1956
|
}
|
|
1957
|
-
|
|
1958
|
-
} catch (
|
|
1959
|
-
console.error("Error sending message to Tanya:",
|
|
1957
|
+
ot(bt(W));
|
|
1958
|
+
} catch (I) {
|
|
1959
|
+
console.error("Error sending message to Tanya:", I);
|
|
1960
1960
|
} finally {
|
|
1961
1961
|
v(!1);
|
|
1962
1962
|
}
|
|
1963
1963
|
}
|
|
1964
|
-
},
|
|
1965
|
-
const
|
|
1964
|
+
}, bt = (d) => {
|
|
1965
|
+
const E = d.match(
|
|
1966
1966
|
/top five relevant product or category names are: (.*)/i
|
|
1967
|
-
), x = (
|
|
1967
|
+
), x = (E ? E[1] : d).split(", ").map((R) => R.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
1968
1968
|
return [...new Set(x)].filter(Boolean).join(",");
|
|
1969
|
-
},
|
|
1970
|
-
if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof
|
|
1971
|
-
console.log(
|
|
1972
|
-
const
|
|
1973
|
-
for (const
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1969
|
+
}, ot = async (d) => {
|
|
1970
|
+
if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof d == "string") {
|
|
1971
|
+
console.log(d, "keywords");
|
|
1972
|
+
const E = d.split(",");
|
|
1973
|
+
for (const I of E) {
|
|
1974
|
+
const N = await ze(
|
|
1975
|
+
I,
|
|
1976
1976
|
i == null ? void 0 : i.access_token
|
|
1977
1977
|
);
|
|
1978
|
-
if (P(!1), (
|
|
1978
|
+
if (P(!1), (N == null ? void 0 : N.length) > 0 && (O(
|
|
1979
1979
|
(x) => x.map(
|
|
1980
|
-
(
|
|
1981
|
-
...
|
|
1980
|
+
(C, R) => R === x.length - 1 ? {
|
|
1981
|
+
...C,
|
|
1982
1982
|
products: [
|
|
1983
|
-
...
|
|
1984
|
-
{ keyword:
|
|
1983
|
+
...C.products || [],
|
|
1984
|
+
{ keyword: I, items: N, loading: !1 }
|
|
1985
1985
|
]
|
|
1986
|
-
} :
|
|
1986
|
+
} : C
|
|
1987
1987
|
)
|
|
1988
|
-
), !
|
|
1989
|
-
const x =
|
|
1990
|
-
|
|
1991
|
-
const
|
|
1992
|
-
|
|
1988
|
+
), !r.current || n.current == null)) {
|
|
1989
|
+
const x = N[0];
|
|
1990
|
+
r.current = String((x == null ? void 0 : x.product_name) ?? ""), o.current = x.image.link, n.current = x.product_id;
|
|
1991
|
+
const C = typeof (x == null ? void 0 : x.price) == "number" ? x.price : void 0;
|
|
1992
|
+
a.current = typeof C == "number" && Number.isFinite(C) ? C : null;
|
|
1993
1993
|
}
|
|
1994
1994
|
}
|
|
1995
1995
|
} else
|
|
1996
|
-
for (const
|
|
1997
|
-
const
|
|
1998
|
-
|
|
1996
|
+
for (const E of d) {
|
|
1997
|
+
const I = await ze(
|
|
1998
|
+
E,
|
|
1999
1999
|
i == null ? void 0 : i.access_token
|
|
2000
2000
|
);
|
|
2001
|
-
P(!1), (
|
|
2002
|
-
(
|
|
2003
|
-
(x,
|
|
2001
|
+
P(!1), (I == null ? void 0 : I.length) > 0 && O(
|
|
2002
|
+
(N) => N.map(
|
|
2003
|
+
(x, C) => C === N.length - 1 ? {
|
|
2004
2004
|
...x,
|
|
2005
2005
|
products: [
|
|
2006
2006
|
...x.products || [],
|
|
2007
|
-
{ keyword:
|
|
2007
|
+
{ keyword: E, items: I, loading: !1 }
|
|
2008
2008
|
]
|
|
2009
2009
|
} : x
|
|
2010
2010
|
)
|
|
2011
2011
|
);
|
|
2012
2012
|
}
|
|
2013
|
-
if (
|
|
2013
|
+
if (r.current) {
|
|
2014
2014
|
O(
|
|
2015
|
-
(
|
|
2016
|
-
(
|
|
2017
|
-
...
|
|
2015
|
+
(I) => I.map(
|
|
2016
|
+
(N, x) => x === I.length - 1 ? {
|
|
2017
|
+
...N,
|
|
2018
2018
|
productSnapshot: {
|
|
2019
|
-
id:
|
|
2020
|
-
name:
|
|
2019
|
+
id: n.current,
|
|
2020
|
+
name: r.current,
|
|
2021
2021
|
image: o.current,
|
|
2022
|
-
price:
|
|
2022
|
+
price: a.current ?? null,
|
|
2023
2023
|
points: 0,
|
|
2024
2024
|
quantity: 1
|
|
2025
2025
|
}
|
|
2026
|
-
} :
|
|
2026
|
+
} : N
|
|
2027
2027
|
)
|
|
2028
2028
|
);
|
|
2029
|
-
const
|
|
2029
|
+
const E = JSON.parse(
|
|
2030
2030
|
sessionStorage.getItem("customerData") || "{}"
|
|
2031
2031
|
);
|
|
2032
|
-
(
|
|
2032
|
+
(E == null ? void 0 : E.isGuest) == !1 ? (console.log("running secondary flow", At), b(r.current, 0)) : console.log("not running secondary flow", At);
|
|
2033
2033
|
}
|
|
2034
2034
|
P(!1);
|
|
2035
|
-
},
|
|
2036
|
-
var
|
|
2035
|
+
}, Kr = async (d, E) => {
|
|
2036
|
+
var I, N, x, C, R, xt, vt, K, kt, St, G, W, tt, et, at;
|
|
2037
2037
|
_(!0);
|
|
2038
2038
|
try {
|
|
2039
|
-
const
|
|
2040
|
-
if (!((
|
|
2041
|
-
_(!1),
|
|
2039
|
+
const y = await kr(d.id);
|
|
2040
|
+
if (!((N = (I = y == null ? void 0 : y.variants) == null ? void 0 : I[0]) != null && N.product_id || (C = (x = y == null ? void 0 : y.variants) == null ? void 0 : x[0]) != null && C.productId) && !(y.type.item || y.type.bundle)) {
|
|
2041
|
+
_(!1), X.error("Variants not found", {
|
|
2042
2042
|
position: "bottom-right",
|
|
2043
2043
|
autoClose: 1e3
|
|
2044
2044
|
}), console.error("No product variant found");
|
|
2045
2045
|
return;
|
|
2046
2046
|
}
|
|
2047
|
-
const
|
|
2047
|
+
const Q = [
|
|
2048
2048
|
{
|
|
2049
|
-
product_id: ((R =
|
|
2050
|
-
quantity:
|
|
2049
|
+
product_id: ((R = y.variants) == null ? void 0 : R[0].product_id) || ((xt = y.variants) == null ? void 0 : xt[0].productId) || (y == null ? void 0 : y.id),
|
|
2050
|
+
quantity: E
|
|
2051
2051
|
}
|
|
2052
2052
|
];
|
|
2053
|
-
console.log(
|
|
2053
|
+
console.log(Q, "product data", "app version", At);
|
|
2054
2054
|
const A = JSON.parse(
|
|
2055
2055
|
sessionStorage.getItem("customerData") || "{}"
|
|
2056
|
-
),
|
|
2057
|
-
if (!
|
|
2058
|
-
const
|
|
2059
|
-
let { customer_token:
|
|
2060
|
-
|
|
2056
|
+
), q = A == null ? void 0 : A.basketId, it = !1, Bt = localStorage.getItem(Ut), $e = Date.now();
|
|
2057
|
+
if (!it || !Bt || $e >= parseInt(Bt)) {
|
|
2058
|
+
const Gr = await xr();
|
|
2059
|
+
let { customer_token: ht } = await vr(
|
|
2060
|
+
Gr
|
|
2061
2061
|
);
|
|
2062
|
-
if (
|
|
2062
|
+
if (ht = "Bearer " + i.access_token, !ht) {
|
|
2063
2063
|
console.error("Failed to get customer_token");
|
|
2064
2064
|
return;
|
|
2065
2065
|
}
|
|
2066
|
-
const
|
|
2067
|
-
if (
|
|
2068
|
-
const
|
|
2069
|
-
basketId:
|
|
2070
|
-
customer_token:
|
|
2066
|
+
const Wr = $e + 300 * 1e3;
|
|
2067
|
+
if (Qt(ht), localStorage.setItem(Ut, Wr.toString()), q) {
|
|
2068
|
+
const Ae = await zr({
|
|
2069
|
+
basketId: q,
|
|
2070
|
+
customer_token: ht
|
|
2071
2071
|
});
|
|
2072
|
-
if (
|
|
2073
|
-
const
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2072
|
+
if (Ae.status === 200 && Ae) {
|
|
2073
|
+
const oe = await Wt(
|
|
2074
|
+
q,
|
|
2075
|
+
Q,
|
|
2076
|
+
ht
|
|
2077
2077
|
);
|
|
2078
|
-
((
|
|
2078
|
+
((vt = oe == null ? void 0 : oe.product_items) == null ? void 0 : vt.length) > 0 && (X.success("Added to cart", {
|
|
2079
2079
|
position: "bottom-right",
|
|
2080
2080
|
autoClose: 3e3,
|
|
2081
2081
|
hideProgressBar: !1,
|
|
2082
2082
|
closeOnClick: !0,
|
|
2083
2083
|
pauseOnHover: !0,
|
|
2084
2084
|
draggable: !0
|
|
2085
|
-
}),
|
|
2085
|
+
}), Ft(q), _(!1));
|
|
2086
2086
|
return;
|
|
2087
2087
|
}
|
|
2088
2088
|
}
|
|
2089
|
-
const
|
|
2089
|
+
const Qr = {
|
|
2090
2090
|
productItems: [
|
|
2091
2091
|
{
|
|
2092
|
-
productId: ((
|
|
2092
|
+
productId: ((K = y.variants) == null ? void 0 : K[0].product_id) || ((kt = y.variants) == null ? void 0 : kt[0].productId) || (y == null ? void 0 : y.id),
|
|
2093
2093
|
quantity: 1
|
|
2094
2094
|
}
|
|
2095
2095
|
]
|
|
2096
|
-
},
|
|
2096
|
+
}, F = await Lr(ht, Qr);
|
|
2097
2097
|
if (console.log(
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2098
|
+
F,
|
|
2099
|
+
F == null ? void 0 : F.basket_id,
|
|
2100
|
+
F == null ? void 0 : F.basketId,
|
|
2101
2101
|
"the basket response"
|
|
2102
|
-
), !(
|
|
2102
|
+
), !(F != null && F.basket_id || !(F != null && F.basketId))) {
|
|
2103
2103
|
_(!1), console.error("Failed to create basket");
|
|
2104
2104
|
return;
|
|
2105
2105
|
}
|
|
2106
|
-
|
|
2107
|
-
(
|
|
2106
|
+
Nt(
|
|
2107
|
+
(F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId)
|
|
2108
2108
|
);
|
|
2109
|
-
const
|
|
2110
|
-
(
|
|
2111
|
-
|
|
2112
|
-
|
|
2109
|
+
const Ct = await Wt(
|
|
2110
|
+
(F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId),
|
|
2111
|
+
Q,
|
|
2112
|
+
ht
|
|
2113
2113
|
);
|
|
2114
|
-
(((
|
|
2114
|
+
(((St = Ct == null ? void 0 : Ct.product_items) == null ? void 0 : St.length) > 0 || ((G = Ct == null ? void 0 : Ct.productItems) == null ? void 0 : G.length) > 0) && X.success("Added to cart", {
|
|
2115
2115
|
position: "bottom-right",
|
|
2116
2116
|
autoClose: 3e3,
|
|
2117
2117
|
hideProgressBar: !1,
|
|
2118
2118
|
closeOnClick: !0,
|
|
2119
2119
|
pauseOnHover: !0,
|
|
2120
2120
|
draggable: !0
|
|
2121
|
-
}),
|
|
2121
|
+
}), Ft(F.basket_id || (F == null ? void 0 : F.basketId));
|
|
2122
2122
|
}
|
|
2123
|
-
} catch (
|
|
2124
|
-
_(!1), console.error("Error adding to cart:",
|
|
2123
|
+
} catch (y) {
|
|
2124
|
+
_(!1), console.error("Error adding to cart:", y), X.error("Failed to add product to cart", {
|
|
2125
2125
|
position: "bottom-right",
|
|
2126
2126
|
autoClose: 3e3
|
|
2127
|
-
}), ((
|
|
2128
|
-
((
|
|
2127
|
+
}), ((W = y == null ? void 0 : y.response) == null ? void 0 : W.status) === 404 || // Basket not found
|
|
2128
|
+
((tt = y == null ? void 0 : y.response) == null ? void 0 : tt.status) === 401 ? (((et = y == null ? void 0 : y.response) == null ? void 0 : et.status) === 404 && Nt(null), ((at = y == null ? void 0 : y.response) == null ? void 0 : at.status) === 401 && (Nt(null), Qt(null))) : (console.error("Failed to add product to basket:", y.message), X.error("Failed to add product to cart", {
|
|
2129
2129
|
position: "bottom-right",
|
|
2130
2130
|
autoClose: 3e3
|
|
2131
2131
|
}));
|
|
2132
2132
|
} finally {
|
|
2133
|
-
|
|
2133
|
+
Ft();
|
|
2134
2134
|
}
|
|
2135
2135
|
_(!1);
|
|
2136
2136
|
};
|
|
2137
|
-
return /* @__PURE__ */ l("div", { className: "relative flex justify-center", children: /* @__PURE__ */ p(
|
|
2137
|
+
return /* @__PURE__ */ l("div", { className: "relative flex justify-center", children: /* @__PURE__ */ p(fn, { open: s, onOpenChange: u, children: [
|
|
2138
2138
|
/* @__PURE__ */ l(
|
|
2139
|
-
|
|
2139
|
+
pn,
|
|
2140
2140
|
{
|
|
2141
2141
|
onClick: () => u(!0),
|
|
2142
2142
|
style: {
|
|
@@ -2198,7 +2198,7 @@ const Fe = (e) => {
|
|
|
2198
2198
|
) })
|
|
2199
2199
|
}
|
|
2200
2200
|
),
|
|
2201
|
-
m && /* @__PURE__ */ p(
|
|
2201
|
+
m && /* @__PURE__ */ p(fe, { children: [
|
|
2202
2202
|
/* @__PURE__ */ l(
|
|
2203
2203
|
"div",
|
|
2204
2204
|
{
|
|
@@ -2214,9 +2214,9 @@ const Fe = (e) => {
|
|
|
2214
2214
|
top-0 right-0
|
|
2215
2215
|
transition-transform duration-300 ease-in-out
|
|
2216
2216
|
lg:transform
|
|
2217
|
-
${
|
|
2217
|
+
${f ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
2218
2218
|
// For mobile: animate from bottom
|
|
2219
|
-
${
|
|
2219
|
+
${f ? "translate-y-0" : "translate-y-full"}
|
|
2220
2220
|
lg:translate-y-0
|
|
2221
2221
|
`,
|
|
2222
2222
|
style: {
|
|
@@ -2233,7 +2233,7 @@ const Fe = (e) => {
|
|
|
2233
2233
|
{
|
|
2234
2234
|
style: {
|
|
2235
2235
|
display: "flex",
|
|
2236
|
-
color:
|
|
2236
|
+
color: T.tanyaThemeContrastColor,
|
|
2237
2237
|
alignItems: "center",
|
|
2238
2238
|
gap: "0.5rem"
|
|
2239
2239
|
},
|
|
@@ -2346,46 +2346,46 @@ const Fe = (e) => {
|
|
|
2346
2346
|
/* @__PURE__ */ p(
|
|
2347
2347
|
"div",
|
|
2348
2348
|
{
|
|
2349
|
-
className: `flex flex-col h-full ${
|
|
2349
|
+
className: `flex flex-col h-full ${j ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
2350
2350
|
children: [
|
|
2351
2351
|
/* @__PURE__ */ p(
|
|
2352
2352
|
"div",
|
|
2353
2353
|
{
|
|
2354
|
-
ref:
|
|
2354
|
+
ref: yt,
|
|
2355
2355
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
2356
2356
|
children: [
|
|
2357
|
-
(
|
|
2357
|
+
(T == null ? void 0 : T.whomRequired) && /* @__PURE__ */ p(
|
|
2358
2358
|
"div",
|
|
2359
2359
|
{
|
|
2360
2360
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
2361
2361
|
children: [
|
|
2362
2362
|
/* @__PURE__ */ l("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ l("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
|
|
2363
|
-
/* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2 mt-2", children:
|
|
2363
|
+
/* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2 mt-2", children: t.map((d) => /* @__PURE__ */ l(
|
|
2364
2364
|
"button",
|
|
2365
2365
|
{
|
|
2366
|
-
onClick: () =>
|
|
2366
|
+
onClick: () => ee(d),
|
|
2367
2367
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
2368
2368
|
style: {
|
|
2369
|
-
backgroundColor:
|
|
2370
|
-
borderColor:
|
|
2369
|
+
backgroundColor: S === e[d] ? "#FFFFFF" : "#F3F3F3",
|
|
2370
|
+
borderColor: S === e[d] ? "#BBB3DD" : ""
|
|
2371
2371
|
},
|
|
2372
|
-
children:
|
|
2372
|
+
children: d
|
|
2373
2373
|
},
|
|
2374
|
-
|
|
2374
|
+
d
|
|
2375
2375
|
)) })
|
|
2376
2376
|
]
|
|
2377
2377
|
}
|
|
2378
2378
|
),
|
|
2379
|
-
V.map((
|
|
2380
|
-
var
|
|
2379
|
+
V.map((d, E) => {
|
|
2380
|
+
var I, N;
|
|
2381
2381
|
return /* @__PURE__ */ p("div", { children: [
|
|
2382
|
-
/* @__PURE__ */ l("div", { className: "flex justify-end", children: /* @__PURE__ */ l("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children:
|
|
2383
|
-
|
|
2382
|
+
/* @__PURE__ */ l("div", { className: "flex justify-end", children: /* @__PURE__ */ l("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: d.query }) }),
|
|
2383
|
+
d.response && d.response.includes("Thinking") ? /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
2384
2384
|
"div",
|
|
2385
2385
|
{
|
|
2386
2386
|
className: "font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
2387
2387
|
dangerouslySetInnerHTML: {
|
|
2388
|
-
__html:
|
|
2388
|
+
__html: ae(d.response)
|
|
2389
2389
|
}
|
|
2390
2390
|
}
|
|
2391
2391
|
) }) : /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
@@ -2393,41 +2393,41 @@ const Fe = (e) => {
|
|
|
2393
2393
|
{
|
|
2394
2394
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
2395
2395
|
dangerouslySetInnerHTML: {
|
|
2396
|
-
__html:
|
|
2396
|
+
__html: ae(d.response)
|
|
2397
2397
|
}
|
|
2398
2398
|
}
|
|
2399
2399
|
) }),
|
|
2400
|
-
B && !
|
|
2401
|
-
(
|
|
2402
|
-
|
|
2400
|
+
B && !d.response.includes("Thinking") && ((I = d.products) == null ? void 0 : I.length) == 0 && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("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" }) }),
|
|
2401
|
+
(d == null ? void 0 : d.products) && ((N = d == null ? void 0 : d.products) == null ? void 0 : N.length) > 0 && /* @__PURE__ */ l(
|
|
2402
|
+
vo,
|
|
2403
2403
|
{
|
|
2404
|
-
chat:
|
|
2405
|
-
storeDetails:
|
|
2404
|
+
chat: d.products,
|
|
2405
|
+
storeDetails: T
|
|
2406
2406
|
}
|
|
2407
2407
|
),
|
|
2408
|
-
|
|
2408
|
+
d.potentialQuestions.length > 0 && /* @__PURE__ */ p("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
2409
2409
|
/* @__PURE__ */ l(
|
|
2410
2410
|
"p",
|
|
2411
2411
|
{
|
|
2412
2412
|
className: "font-nunitoSans font-bold text-sm text-[#494949]",
|
|
2413
|
-
style: { color:
|
|
2413
|
+
style: { color: T.themeDarkColor },
|
|
2414
2414
|
children: "Why not explore these inquiries..."
|
|
2415
2415
|
}
|
|
2416
2416
|
),
|
|
2417
|
-
|
|
2417
|
+
d.potentialQuestions.split(",").map((x, C) => /* @__PURE__ */ l(
|
|
2418
2418
|
"button",
|
|
2419
2419
|
{
|
|
2420
|
-
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${
|
|
2421
|
-
onClick: () =>
|
|
2420
|
+
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${T.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
2421
|
+
onClick: () => J(x),
|
|
2422
2422
|
style: {
|
|
2423
|
-
backgroundColor:
|
|
2423
|
+
backgroundColor: T.tanyaThemeColorLight
|
|
2424
2424
|
},
|
|
2425
2425
|
children: x
|
|
2426
2426
|
},
|
|
2427
|
-
|
|
2427
|
+
C
|
|
2428
2428
|
))
|
|
2429
2429
|
] }),
|
|
2430
|
-
|
|
2430
|
+
d.secondaryLoading && /* @__PURE__ */ l("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ p(
|
|
2431
2431
|
"div",
|
|
2432
2432
|
{
|
|
2433
2433
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -2445,7 +2445,7 @@ const Fe = (e) => {
|
|
|
2445
2445
|
"p",
|
|
2446
2446
|
{
|
|
2447
2447
|
className: "font-semibold tanya-pulse",
|
|
2448
|
-
style: { color:
|
|
2448
|
+
style: { color: T.themeDarkColor },
|
|
2449
2449
|
children: "I’ve found a special surprise crafted just for you… hang on a sec!"
|
|
2450
2450
|
}
|
|
2451
2451
|
),
|
|
@@ -2453,35 +2453,35 @@ const Fe = (e) => {
|
|
|
2453
2453
|
"p",
|
|
2454
2454
|
{
|
|
2455
2455
|
className: "tanya-dots mt-1",
|
|
2456
|
-
style: { color:
|
|
2456
|
+
style: { color: T.themeDarkColor },
|
|
2457
2457
|
children: "• • •"
|
|
2458
2458
|
}
|
|
2459
2459
|
)
|
|
2460
2460
|
]
|
|
2461
2461
|
}
|
|
2462
2462
|
) }),
|
|
2463
|
-
|
|
2463
|
+
d.secondaryResponse && /* @__PURE__ */ l(fe, { children: /* @__PURE__ */ p("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
2464
2464
|
/* @__PURE__ */ l(
|
|
2465
2465
|
"div",
|
|
2466
2466
|
{
|
|
2467
2467
|
className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
|
|
2468
2468
|
style: {
|
|
2469
|
-
backgroundColor:
|
|
2469
|
+
backgroundColor: T.tanyaThemeColorLight
|
|
2470
2470
|
},
|
|
2471
2471
|
dangerouslySetInnerHTML: {
|
|
2472
|
-
__html:
|
|
2473
|
-
|
|
2472
|
+
__html: ae(
|
|
2473
|
+
d.secondaryResponse
|
|
2474
2474
|
)
|
|
2475
2475
|
}
|
|
2476
2476
|
}
|
|
2477
2477
|
),
|
|
2478
|
-
|
|
2478
|
+
d.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
2479
2479
|
/* @__PURE__ */ l("div", { className: "mt-4 w-full", children: /* @__PURE__ */ p(
|
|
2480
2480
|
"div",
|
|
2481
2481
|
{
|
|
2482
2482
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
2483
2483
|
style: {
|
|
2484
|
-
backgroundColor:
|
|
2484
|
+
backgroundColor: T.tanyaThemeColorLight
|
|
2485
2485
|
},
|
|
2486
2486
|
children: [
|
|
2487
2487
|
/* @__PURE__ */ l(
|
|
@@ -2493,11 +2493,11 @@ const Fe = (e) => {
|
|
|
2493
2493
|
height: 112,
|
|
2494
2494
|
borderColor: "#eee"
|
|
2495
2495
|
},
|
|
2496
|
-
children:
|
|
2496
|
+
children: d.productSnapshot.image ? /* @__PURE__ */ l(
|
|
2497
2497
|
"img",
|
|
2498
2498
|
{
|
|
2499
|
-
src:
|
|
2500
|
-
alt:
|
|
2499
|
+
src: d.productSnapshot.image,
|
|
2500
|
+
alt: d.productSnapshot.name,
|
|
2501
2501
|
className: "w-full h-full object-cover"
|
|
2502
2502
|
}
|
|
2503
2503
|
) : /* @__PURE__ */ l("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
@@ -2505,18 +2505,18 @@ const Fe = (e) => {
|
|
|
2505
2505
|
),
|
|
2506
2506
|
/* @__PURE__ */ p("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
2507
2507
|
/* @__PURE__ */ p("div", { children: [
|
|
2508
|
-
/* @__PURE__ */ l("p", { className: "font-semibold text-[15px] leading-snug", children:
|
|
2509
|
-
/* @__PURE__ */ l("p", { className: "mt-1 text-[14px] font-medium", children:
|
|
2508
|
+
/* @__PURE__ */ l("p", { className: "font-semibold text-[15px] leading-snug", children: d.productSnapshot.name }),
|
|
2509
|
+
/* @__PURE__ */ l("p", { className: "mt-1 text-[14px] font-medium", children: d.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
2510
2510
|
style: "currency",
|
|
2511
|
-
currency: (
|
|
2511
|
+
currency: (T == null ? void 0 : T.currency) || "USD"
|
|
2512
2512
|
}).format(
|
|
2513
|
-
|
|
2513
|
+
d.productSnapshot.price
|
|
2514
2514
|
) : "" }),
|
|
2515
|
-
|
|
2515
|
+
d.productSnapshot.points > 0 && /* @__PURE__ */ p("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
2516
2516
|
"You will earn",
|
|
2517
2517
|
" ",
|
|
2518
2518
|
/* @__PURE__ */ p("strong", { children: [
|
|
2519
|
-
|
|
2519
|
+
d.productSnapshot.points,
|
|
2520
2520
|
" ",
|
|
2521
2521
|
"points"
|
|
2522
2522
|
] })
|
|
@@ -2530,44 +2530,44 @@ const Fe = (e) => {
|
|
|
2530
2530
|
className: "px-3 py-1 text-sm",
|
|
2531
2531
|
onClick: () => O(
|
|
2532
2532
|
(x) => x.map(
|
|
2533
|
-
(
|
|
2534
|
-
...
|
|
2533
|
+
(C, R) => R === E && C.productSnapshot ? {
|
|
2534
|
+
...C,
|
|
2535
2535
|
productSnapshot: {
|
|
2536
|
-
...
|
|
2536
|
+
...C.productSnapshot,
|
|
2537
2537
|
quantity: Math.max(
|
|
2538
2538
|
1,
|
|
2539
|
-
|
|
2539
|
+
C.productSnapshot.quantity - 1
|
|
2540
2540
|
)
|
|
2541
2541
|
}
|
|
2542
|
-
} :
|
|
2542
|
+
} : C
|
|
2543
2543
|
)
|
|
2544
2544
|
),
|
|
2545
2545
|
style: {
|
|
2546
2546
|
background: "transparent",
|
|
2547
|
-
color:
|
|
2547
|
+
color: T.themeDarkColor
|
|
2548
2548
|
},
|
|
2549
2549
|
children: "−"
|
|
2550
2550
|
}
|
|
2551
2551
|
),
|
|
2552
|
-
/* @__PURE__ */ l("div", { className: "px-3 py-1 text-sm select-none", children:
|
|
2552
|
+
/* @__PURE__ */ l("div", { className: "px-3 py-1 text-sm select-none", children: d.productSnapshot.quantity }),
|
|
2553
2553
|
/* @__PURE__ */ l(
|
|
2554
2554
|
"button",
|
|
2555
2555
|
{
|
|
2556
2556
|
className: "px-3 py-1 text-sm",
|
|
2557
2557
|
onClick: () => O(
|
|
2558
2558
|
(x) => x.map(
|
|
2559
|
-
(
|
|
2560
|
-
...
|
|
2559
|
+
(C, R) => R === E && C.productSnapshot ? {
|
|
2560
|
+
...C,
|
|
2561
2561
|
productSnapshot: {
|
|
2562
|
-
...
|
|
2563
|
-
quantity:
|
|
2562
|
+
...C.productSnapshot,
|
|
2563
|
+
quantity: C.productSnapshot.quantity + 1
|
|
2564
2564
|
}
|
|
2565
|
-
} :
|
|
2565
|
+
} : C
|
|
2566
2566
|
)
|
|
2567
2567
|
),
|
|
2568
2568
|
style: {
|
|
2569
2569
|
background: "transparent",
|
|
2570
|
-
color:
|
|
2570
|
+
color: T.themeDarkColor
|
|
2571
2571
|
},
|
|
2572
2572
|
children: "+"
|
|
2573
2573
|
}
|
|
@@ -2577,21 +2577,21 @@ const Fe = (e) => {
|
|
|
2577
2577
|
"button",
|
|
2578
2578
|
{
|
|
2579
2579
|
onClick: () => {
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2580
|
+
Kr(
|
|
2581
|
+
H(
|
|
2582
|
+
d.productSnapshot
|
|
2583
2583
|
),
|
|
2584
|
-
|
|
2584
|
+
d.productSnapshot.quantity
|
|
2585
2585
|
);
|
|
2586
2586
|
},
|
|
2587
|
-
disabled:
|
|
2587
|
+
disabled: k,
|
|
2588
2588
|
className: "px-4 py-2 rounded-full font-medium",
|
|
2589
2589
|
style: {
|
|
2590
|
-
background:
|
|
2591
|
-
color: (
|
|
2592
|
-
opacity:
|
|
2590
|
+
background: T.tanyaThemeColor,
|
|
2591
|
+
color: (T == null ? void 0 : T.tanyaThemeContrastColor) || "#fff",
|
|
2592
|
+
opacity: k ? 0.8 : 1
|
|
2593
2593
|
},
|
|
2594
|
-
children:
|
|
2594
|
+
children: k ? "Adding..." : "Add to cart"
|
|
2595
2595
|
}
|
|
2596
2596
|
)
|
|
2597
2597
|
] })
|
|
@@ -2601,7 +2601,7 @@ const Fe = (e) => {
|
|
|
2601
2601
|
) })
|
|
2602
2602
|
] }) }),
|
|
2603
2603
|
/* @__PURE__ */ l("div", { className: "mb-20" })
|
|
2604
|
-
] },
|
|
2604
|
+
] }, E);
|
|
2605
2605
|
})
|
|
2606
2606
|
]
|
|
2607
2607
|
}
|
|
@@ -2619,11 +2619,11 @@ const Fe = (e) => {
|
|
|
2619
2619
|
{
|
|
2620
2620
|
className: "flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",
|
|
2621
2621
|
placeholder: "How can I help you...",
|
|
2622
|
-
value:
|
|
2622
|
+
value: $,
|
|
2623
2623
|
autoFocus: !0,
|
|
2624
|
-
onChange: (
|
|
2625
|
-
onKeyDown: (
|
|
2626
|
-
|
|
2624
|
+
onChange: (d) => Z(d.target.value),
|
|
2625
|
+
onKeyDown: (d) => {
|
|
2626
|
+
d.key === "Enter" && !w && J();
|
|
2627
2627
|
}
|
|
2628
2628
|
}
|
|
2629
2629
|
),
|
|
@@ -2631,16 +2631,16 @@ const Fe = (e) => {
|
|
|
2631
2631
|
"button",
|
|
2632
2632
|
{
|
|
2633
2633
|
type: "submit",
|
|
2634
|
-
disabled:
|
|
2634
|
+
disabled: w,
|
|
2635
2635
|
className: "p-3",
|
|
2636
|
-
onClick: () =>
|
|
2637
|
-
children:
|
|
2636
|
+
onClick: () => J(),
|
|
2637
|
+
children: w ? /* @__PURE__ */ l(
|
|
2638
2638
|
"div",
|
|
2639
2639
|
{
|
|
2640
2640
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
2641
2641
|
style: {
|
|
2642
2642
|
borderBottom: "2px solid",
|
|
2643
|
-
color:
|
|
2643
|
+
color: T.tanyaThemeColor
|
|
2644
2644
|
}
|
|
2645
2645
|
}
|
|
2646
2646
|
) : /* @__PURE__ */ l(
|
|
@@ -2668,7 +2668,7 @@ const Fe = (e) => {
|
|
|
2668
2668
|
]
|
|
2669
2669
|
}
|
|
2670
2670
|
),
|
|
2671
|
-
/* @__PURE__ */ l(
|
|
2671
|
+
/* @__PURE__ */ l(So, {})
|
|
2672
2672
|
] })
|
|
2673
2673
|
]
|
|
2674
2674
|
}
|
|
@@ -2676,83 +2676,83 @@ const Fe = (e) => {
|
|
|
2676
2676
|
] })
|
|
2677
2677
|
] }) });
|
|
2678
2678
|
};
|
|
2679
|
-
var
|
|
2680
|
-
return
|
|
2681
|
-
|
|
2682
|
-
} || function(
|
|
2683
|
-
for (var o in
|
|
2684
|
-
},
|
|
2679
|
+
var be = function(t, e) {
|
|
2680
|
+
return be = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
2681
|
+
r.__proto__ = n;
|
|
2682
|
+
} || function(r, n) {
|
|
2683
|
+
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
|
|
2684
|
+
}, be(t, e);
|
|
2685
2685
|
};
|
|
2686
|
-
function
|
|
2687
|
-
if (typeof
|
|
2688
|
-
throw new TypeError("Class extends value " + String(
|
|
2689
|
-
|
|
2690
|
-
function
|
|
2691
|
-
this.constructor =
|
|
2686
|
+
function Io(t, e) {
|
|
2687
|
+
if (typeof e != "function" && e !== null)
|
|
2688
|
+
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
2689
|
+
be(t, e);
|
|
2690
|
+
function r() {
|
|
2691
|
+
this.constructor = t;
|
|
2692
2692
|
}
|
|
2693
|
-
|
|
2693
|
+
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
2694
2694
|
}
|
|
2695
|
-
var
|
|
2696
|
-
return
|
|
2697
|
-
for (var
|
|
2698
|
-
|
|
2699
|
-
for (var
|
|
2695
|
+
var st = function() {
|
|
2696
|
+
return st = Object.assign || function(e) {
|
|
2697
|
+
for (var r, n = 1, o = arguments.length; n < o; n++) {
|
|
2698
|
+
r = arguments[n];
|
|
2699
|
+
for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
|
|
2700
2700
|
}
|
|
2701
|
-
return
|
|
2702
|
-
},
|
|
2701
|
+
return e;
|
|
2702
|
+
}, st.apply(this, arguments);
|
|
2703
2703
|
};
|
|
2704
|
-
function
|
|
2705
|
-
var
|
|
2706
|
-
for (var
|
|
2707
|
-
if (
|
|
2708
|
-
for (var o = 0,
|
|
2709
|
-
|
|
2710
|
-
return
|
|
2704
|
+
function _o(t, e) {
|
|
2705
|
+
var r = {};
|
|
2706
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
|
|
2707
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
2708
|
+
for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
2709
|
+
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (r[n[o]] = t[n[o]]);
|
|
2710
|
+
return r;
|
|
2711
2711
|
}
|
|
2712
|
-
var
|
|
2713
|
-
return
|
|
2714
|
-
} :
|
|
2712
|
+
var ce = "Invariant Violation", nr = Object.setPrototypeOf, Fo = nr === void 0 ? function(t, e) {
|
|
2713
|
+
return t.__proto__ = e, t;
|
|
2714
|
+
} : nr, Dr = (
|
|
2715
2715
|
/** @class */
|
|
2716
|
-
(function(
|
|
2717
|
-
|
|
2718
|
-
function
|
|
2719
|
-
|
|
2720
|
-
var
|
|
2721
|
-
return
|
|
2716
|
+
(function(t) {
|
|
2717
|
+
Io(e, t);
|
|
2718
|
+
function e(r) {
|
|
2719
|
+
r === void 0 && (r = ce);
|
|
2720
|
+
var n = t.call(this, typeof r == "number" ? ce + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
|
|
2721
|
+
return n.framesToPop = 1, n.name = ce, Fo(n, e.prototype), n;
|
|
2722
2722
|
}
|
|
2723
|
-
return
|
|
2723
|
+
return e;
|
|
2724
2724
|
})(Error)
|
|
2725
2725
|
);
|
|
2726
|
-
function
|
|
2727
|
-
if (!
|
|
2728
|
-
throw new
|
|
2726
|
+
function mt(t, e) {
|
|
2727
|
+
if (!t)
|
|
2728
|
+
throw new Dr(e);
|
|
2729
2729
|
}
|
|
2730
|
-
var
|
|
2731
|
-
function
|
|
2730
|
+
var Mr = ["debug", "log", "warn", "error", "silent"], No = Mr.indexOf("log");
|
|
2731
|
+
function qt(t) {
|
|
2732
2732
|
return function() {
|
|
2733
|
-
if (
|
|
2734
|
-
var
|
|
2735
|
-
return
|
|
2733
|
+
if (Mr.indexOf(t) >= No) {
|
|
2734
|
+
var e = console[t] || console.log;
|
|
2735
|
+
return e.apply(console, arguments);
|
|
2736
2736
|
}
|
|
2737
2737
|
};
|
|
2738
2738
|
}
|
|
2739
|
-
(function(
|
|
2740
|
-
|
|
2741
|
-
})(
|
|
2742
|
-
var
|
|
2743
|
-
function
|
|
2739
|
+
(function(t) {
|
|
2740
|
+
t.debug = qt("debug"), t.log = qt("log"), t.warn = qt("warn"), t.error = qt("error");
|
|
2741
|
+
})(mt || (mt = {}));
|
|
2742
|
+
var Ur = "3.14.0";
|
|
2743
|
+
function It(t) {
|
|
2744
2744
|
try {
|
|
2745
|
-
return
|
|
2745
|
+
return t();
|
|
2746
2746
|
} catch {
|
|
2747
2747
|
}
|
|
2748
2748
|
}
|
|
2749
|
-
const
|
|
2749
|
+
const xe = It(function() {
|
|
2750
2750
|
return globalThis;
|
|
2751
|
-
}) ||
|
|
2751
|
+
}) || It(function() {
|
|
2752
2752
|
return window;
|
|
2753
|
-
}) ||
|
|
2753
|
+
}) || It(function() {
|
|
2754
2754
|
return self;
|
|
2755
|
-
}) ||
|
|
2755
|
+
}) || It(function() {
|
|
2756
2756
|
return global;
|
|
2757
2757
|
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
2758
2758
|
// long as at least one of globalThis, window, self, or global is defined, so
|
|
@@ -2760,161 +2760,161 @@ const xt = Ce(function() {
|
|
|
2760
2760
|
// detect syntactic usage of the Function constructor. If you think you can
|
|
2761
2761
|
// improve your static analysis to detect this obfuscation, think again. This
|
|
2762
2762
|
// is an arms race you cannot win, at least not in JavaScript.
|
|
2763
|
-
|
|
2764
|
-
return
|
|
2763
|
+
It(function() {
|
|
2764
|
+
return It.constructor("return this")();
|
|
2765
2765
|
});
|
|
2766
|
-
var
|
|
2767
|
-
function
|
|
2768
|
-
var
|
|
2769
|
-
return
|
|
2770
|
-
}
|
|
2771
|
-
function
|
|
2772
|
-
var
|
|
2773
|
-
return JSON.stringify(
|
|
2774
|
-
return o === void 0 ?
|
|
2775
|
-
},
|
|
2776
|
-
}
|
|
2777
|
-
function
|
|
2778
|
-
return function(
|
|
2779
|
-
for (var
|
|
2780
|
-
n
|
|
2781
|
-
if (typeof
|
|
2782
|
-
var o =
|
|
2783
|
-
|
|
2766
|
+
var or = /* @__PURE__ */ new Map();
|
|
2767
|
+
function Eo(t) {
|
|
2768
|
+
var e = or.get(t) || 1;
|
|
2769
|
+
return or.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
2770
|
+
}
|
|
2771
|
+
function To(t, e) {
|
|
2772
|
+
var r = Eo("stringifyForDisplay");
|
|
2773
|
+
return JSON.stringify(t, function(n, o) {
|
|
2774
|
+
return o === void 0 ? r : o;
|
|
2775
|
+
}, e).split(JSON.stringify(r)).join("<undefined>");
|
|
2776
|
+
}
|
|
2777
|
+
function Rt(t) {
|
|
2778
|
+
return function(e) {
|
|
2779
|
+
for (var r = [], n = 1; n < arguments.length; n++)
|
|
2780
|
+
r[n - 1] = arguments[n];
|
|
2781
|
+
if (typeof e == "number") {
|
|
2782
|
+
var o = e;
|
|
2783
|
+
e = Fe(o), e || (e = Ne(o, r), r = []);
|
|
2784
2784
|
}
|
|
2785
|
-
|
|
2785
|
+
t.apply(void 0, [e].concat(r));
|
|
2786
2786
|
};
|
|
2787
2787
|
}
|
|
2788
|
-
var
|
|
2789
|
-
for (var
|
|
2790
|
-
|
|
2791
|
-
|
|
2788
|
+
var le = Object.assign(function(e, r) {
|
|
2789
|
+
for (var n = [], o = 2; o < arguments.length; o++)
|
|
2790
|
+
n[o - 2] = arguments[o];
|
|
2791
|
+
e || mt(e, Fe(r, n) || Ne(r, n));
|
|
2792
2792
|
}, {
|
|
2793
|
-
debug:
|
|
2794
|
-
log:
|
|
2795
|
-
warn:
|
|
2796
|
-
error:
|
|
2793
|
+
debug: Rt(mt.debug),
|
|
2794
|
+
log: Rt(mt.log),
|
|
2795
|
+
warn: Rt(mt.warn),
|
|
2796
|
+
error: Rt(mt.error)
|
|
2797
2797
|
});
|
|
2798
|
-
function
|
|
2799
|
-
for (var
|
|
2800
|
-
|
|
2801
|
-
return new
|
|
2802
|
-
}
|
|
2803
|
-
var
|
|
2804
|
-
function
|
|
2805
|
-
if (typeof
|
|
2806
|
-
return
|
|
2798
|
+
function Br(t) {
|
|
2799
|
+
for (var e = [], r = 1; r < arguments.length; r++)
|
|
2800
|
+
e[r - 1] = arguments[r];
|
|
2801
|
+
return new Dr(Fe(t, e) || Ne(t, e));
|
|
2802
|
+
}
|
|
2803
|
+
var ar = Symbol.for("ApolloErrorMessageHandler_" + Ur);
|
|
2804
|
+
function qr(t) {
|
|
2805
|
+
if (typeof t == "string")
|
|
2806
|
+
return t;
|
|
2807
2807
|
try {
|
|
2808
|
-
return
|
|
2808
|
+
return To(t, 2).slice(0, 1e3);
|
|
2809
2809
|
} catch {
|
|
2810
2810
|
return "<non-serializable>";
|
|
2811
2811
|
}
|
|
2812
2812
|
}
|
|
2813
|
-
function
|
|
2814
|
-
if (
|
|
2815
|
-
return
|
|
2813
|
+
function Fe(t, e) {
|
|
2814
|
+
if (e === void 0 && (e = []), !!t)
|
|
2815
|
+
return xe[ar] && xe[ar](t, e.map(qr));
|
|
2816
2816
|
}
|
|
2817
|
-
function
|
|
2818
|
-
if (
|
|
2817
|
+
function Ne(t, e) {
|
|
2818
|
+
if (e === void 0 && (e = []), !!t)
|
|
2819
2819
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
2820
|
-
version:
|
|
2821
|
-
message:
|
|
2822
|
-
args:
|
|
2820
|
+
version: Ur,
|
|
2821
|
+
message: t,
|
|
2822
|
+
args: e.map(qr)
|
|
2823
2823
|
})));
|
|
2824
2824
|
}
|
|
2825
|
-
function
|
|
2826
|
-
return
|
|
2827
|
-
return
|
|
2828
|
-
}).map(function(
|
|
2829
|
-
return
|
|
2825
|
+
function Po(t) {
|
|
2826
|
+
return t.definitions.filter(function(e) {
|
|
2827
|
+
return e.kind === "OperationDefinition" && !!e.name;
|
|
2828
|
+
}).map(function(e) {
|
|
2829
|
+
return e.name.value;
|
|
2830
2830
|
})[0] || null;
|
|
2831
2831
|
}
|
|
2832
|
-
let
|
|
2833
|
-
const
|
|
2834
|
-
let
|
|
2835
|
-
const
|
|
2832
|
+
let z = null;
|
|
2833
|
+
const ir = {};
|
|
2834
|
+
let Oo = 1;
|
|
2835
|
+
const jo = () => class {
|
|
2836
2836
|
constructor() {
|
|
2837
2837
|
this.id = [
|
|
2838
2838
|
"slot",
|
|
2839
|
-
|
|
2839
|
+
Oo++,
|
|
2840
2840
|
Date.now(),
|
|
2841
2841
|
Math.random().toString(36).slice(2)
|
|
2842
2842
|
].join(":");
|
|
2843
2843
|
}
|
|
2844
2844
|
hasValue() {
|
|
2845
|
-
for (let
|
|
2846
|
-
if (this.id in
|
|
2847
|
-
const
|
|
2848
|
-
if (
|
|
2845
|
+
for (let e = z; e; e = e.parent)
|
|
2846
|
+
if (this.id in e.slots) {
|
|
2847
|
+
const r = e.slots[this.id];
|
|
2848
|
+
if (r === ir)
|
|
2849
2849
|
break;
|
|
2850
|
-
return
|
|
2850
|
+
return e !== z && (z.slots[this.id] = r), !0;
|
|
2851
2851
|
}
|
|
2852
|
-
return
|
|
2852
|
+
return z && (z.slots[this.id] = ir), !1;
|
|
2853
2853
|
}
|
|
2854
2854
|
getValue() {
|
|
2855
2855
|
if (this.hasValue())
|
|
2856
|
-
return
|
|
2856
|
+
return z.slots[this.id];
|
|
2857
2857
|
}
|
|
2858
|
-
withValue(
|
|
2859
|
-
const
|
|
2858
|
+
withValue(e, r, n, o) {
|
|
2859
|
+
const a = {
|
|
2860
2860
|
__proto__: null,
|
|
2861
|
-
[this.id]:
|
|
2862
|
-
}, i =
|
|
2863
|
-
|
|
2861
|
+
[this.id]: e
|
|
2862
|
+
}, i = z;
|
|
2863
|
+
z = { parent: i, slots: a };
|
|
2864
2864
|
try {
|
|
2865
|
-
return
|
|
2865
|
+
return r.apply(o, n);
|
|
2866
2866
|
} finally {
|
|
2867
|
-
|
|
2867
|
+
z = i;
|
|
2868
2868
|
}
|
|
2869
2869
|
}
|
|
2870
2870
|
// Capture the current context and wrap a callback function so that it
|
|
2871
2871
|
// reestablishes the captured context when called.
|
|
2872
|
-
static bind(
|
|
2873
|
-
const
|
|
2872
|
+
static bind(e) {
|
|
2873
|
+
const r = z;
|
|
2874
2874
|
return function() {
|
|
2875
|
-
const
|
|
2875
|
+
const n = z;
|
|
2876
2876
|
try {
|
|
2877
|
-
return
|
|
2877
|
+
return z = r, e.apply(this, arguments);
|
|
2878
2878
|
} finally {
|
|
2879
|
-
|
|
2879
|
+
z = n;
|
|
2880
2880
|
}
|
|
2881
2881
|
};
|
|
2882
2882
|
}
|
|
2883
2883
|
// Immediately run a callback function without any captured context.
|
|
2884
|
-
static noContext(
|
|
2885
|
-
if (
|
|
2886
|
-
const o =
|
|
2884
|
+
static noContext(e, r, n) {
|
|
2885
|
+
if (z) {
|
|
2886
|
+
const o = z;
|
|
2887
2887
|
try {
|
|
2888
|
-
return
|
|
2888
|
+
return z = null, e.apply(n, r);
|
|
2889
2889
|
} finally {
|
|
2890
|
-
|
|
2890
|
+
z = o;
|
|
2891
2891
|
}
|
|
2892
2892
|
} else
|
|
2893
|
-
return
|
|
2893
|
+
return e.apply(n, r);
|
|
2894
2894
|
}
|
|
2895
2895
|
};
|
|
2896
|
-
function
|
|
2896
|
+
function sr(t) {
|
|
2897
2897
|
try {
|
|
2898
|
-
return
|
|
2898
|
+
return t();
|
|
2899
2899
|
} catch {
|
|
2900
2900
|
}
|
|
2901
2901
|
}
|
|
2902
|
-
const
|
|
2902
|
+
const ue = "@wry/context:Slot", $o = (
|
|
2903
2903
|
// Prefer globalThis when available.
|
|
2904
2904
|
// https://github.com/benjamn/wryware/issues/347
|
|
2905
|
-
|
|
2905
|
+
sr(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
2906
2906
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
2907
2907
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
2908
|
-
|
|
2908
|
+
sr(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
2909
2909
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
2910
2910
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
2911
2911
|
/* @__PURE__ */ Object.create(null)
|
|
2912
|
-
),
|
|
2912
|
+
), cr = $o, Ee = cr[ue] || // Earlier versions of this package stored the globalKey property on the Array
|
|
2913
2913
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
2914
|
-
Array[
|
|
2914
|
+
Array[ue] || (function(t) {
|
|
2915
2915
|
try {
|
|
2916
|
-
Object.defineProperty(
|
|
2917
|
-
value:
|
|
2916
|
+
Object.defineProperty(cr, ue, {
|
|
2917
|
+
value: t,
|
|
2918
2918
|
enumerable: !1,
|
|
2919
2919
|
writable: !1,
|
|
2920
2920
|
// When it was possible for globalHost to be the Array constructor (a
|
|
@@ -2926,234 +2926,234 @@ Array[ut] || (function(e) {
|
|
|
2926
2926
|
configurable: !0
|
|
2927
2927
|
});
|
|
2928
2928
|
} finally {
|
|
2929
|
-
return
|
|
2929
|
+
return t;
|
|
2930
2930
|
}
|
|
2931
|
-
})(
|
|
2932
|
-
new
|
|
2933
|
-
function
|
|
2934
|
-
var
|
|
2935
|
-
if (
|
|
2936
|
-
if (Array.isArray(
|
|
2937
|
-
|
|
2938
|
-
var
|
|
2931
|
+
})(jo()), { bind: ga, noContext: wa } = Ee;
|
|
2932
|
+
new Ee();
|
|
2933
|
+
function Ao(t, e) {
|
|
2934
|
+
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
2935
|
+
if (r) return (r = r.call(t)).next.bind(r);
|
|
2936
|
+
if (Array.isArray(t) || (r = Lo(t)) || e) {
|
|
2937
|
+
r && (t = r);
|
|
2938
|
+
var n = 0;
|
|
2939
2939
|
return function() {
|
|
2940
|
-
return
|
|
2940
|
+
return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] };
|
|
2941
2941
|
};
|
|
2942
2942
|
}
|
|
2943
2943
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2944
2944
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
2945
2945
|
}
|
|
2946
|
-
function
|
|
2947
|
-
if (
|
|
2948
|
-
if (typeof
|
|
2949
|
-
var
|
|
2950
|
-
if (
|
|
2951
|
-
if (
|
|
2946
|
+
function Lo(t, e) {
|
|
2947
|
+
if (t) {
|
|
2948
|
+
if (typeof t == "string") return lr(t, e);
|
|
2949
|
+
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
2950
|
+
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
|
|
2951
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return lr(t, e);
|
|
2952
2952
|
}
|
|
2953
2953
|
}
|
|
2954
|
-
function
|
|
2955
|
-
(
|
|
2956
|
-
for (var
|
|
2957
|
-
r
|
|
2958
|
-
return
|
|
2954
|
+
function lr(t, e) {
|
|
2955
|
+
(e == null || e > t.length) && (e = t.length);
|
|
2956
|
+
for (var r = 0, n = new Array(e); r < e; r++)
|
|
2957
|
+
n[r] = t[r];
|
|
2958
|
+
return n;
|
|
2959
2959
|
}
|
|
2960
|
-
function
|
|
2961
|
-
for (var
|
|
2962
|
-
var
|
|
2963
|
-
|
|
2960
|
+
function ur(t, e) {
|
|
2961
|
+
for (var r = 0; r < e.length; r++) {
|
|
2962
|
+
var n = e[r];
|
|
2963
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
|
|
2964
2964
|
}
|
|
2965
2965
|
}
|
|
2966
|
-
function
|
|
2967
|
-
return
|
|
2966
|
+
function Te(t, e, r) {
|
|
2967
|
+
return e && ur(t.prototype, e), r && ur(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
2968
2968
|
}
|
|
2969
|
-
var
|
|
2969
|
+
var Pe = function() {
|
|
2970
2970
|
return typeof Symbol == "function";
|
|
2971
|
-
},
|
|
2972
|
-
return
|
|
2973
|
-
},
|
|
2974
|
-
return
|
|
2971
|
+
}, Oe = function(t) {
|
|
2972
|
+
return Pe() && !!Symbol[t];
|
|
2973
|
+
}, je = function(t) {
|
|
2974
|
+
return Oe(t) ? Symbol[t] : "@@" + t;
|
|
2975
2975
|
};
|
|
2976
|
-
|
|
2977
|
-
var
|
|
2978
|
-
function
|
|
2979
|
-
var
|
|
2980
|
-
if (
|
|
2981
|
-
if (typeof
|
|
2982
|
-
return
|
|
2976
|
+
Pe() && !Oe("observable") && (Symbol.observable = Symbol("observable"));
|
|
2977
|
+
var zo = je("iterator"), ve = je("observable"), Rr = je("species");
|
|
2978
|
+
function Xt(t, e) {
|
|
2979
|
+
var r = t[e];
|
|
2980
|
+
if (r != null) {
|
|
2981
|
+
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
2982
|
+
return r;
|
|
2983
2983
|
}
|
|
2984
2984
|
}
|
|
2985
|
-
function
|
|
2986
|
-
var
|
|
2987
|
-
return
|
|
2985
|
+
function Lt(t) {
|
|
2986
|
+
var e = t.constructor;
|
|
2987
|
+
return e !== void 0 && (e = e[Rr], e === null && (e = void 0)), e !== void 0 ? e : M;
|
|
2988
2988
|
}
|
|
2989
|
-
function
|
|
2990
|
-
return
|
|
2989
|
+
function Do(t) {
|
|
2990
|
+
return t instanceof M;
|
|
2991
2991
|
}
|
|
2992
|
-
function
|
|
2993
|
-
|
|
2994
|
-
throw
|
|
2992
|
+
function Tt(t) {
|
|
2993
|
+
Tt.log ? Tt.log(t) : setTimeout(function() {
|
|
2994
|
+
throw t;
|
|
2995
2995
|
});
|
|
2996
2996
|
}
|
|
2997
|
-
function
|
|
2997
|
+
function Jt(t) {
|
|
2998
2998
|
Promise.resolve().then(function() {
|
|
2999
2999
|
try {
|
|
3000
|
-
|
|
3001
|
-
} catch (
|
|
3002
|
-
|
|
3000
|
+
t();
|
|
3001
|
+
} catch (e) {
|
|
3002
|
+
Tt(e);
|
|
3003
3003
|
}
|
|
3004
3004
|
});
|
|
3005
3005
|
}
|
|
3006
|
-
function
|
|
3007
|
-
var
|
|
3008
|
-
if (
|
|
3006
|
+
function Hr(t) {
|
|
3007
|
+
var e = t._cleanup;
|
|
3008
|
+
if (e !== void 0 && (t._cleanup = void 0, !!e))
|
|
3009
3009
|
try {
|
|
3010
|
-
if (typeof
|
|
3011
|
-
|
|
3010
|
+
if (typeof e == "function")
|
|
3011
|
+
e();
|
|
3012
3012
|
else {
|
|
3013
|
-
var
|
|
3014
|
-
|
|
3013
|
+
var r = Xt(e, "unsubscribe");
|
|
3014
|
+
r && r.call(e);
|
|
3015
3015
|
}
|
|
3016
|
-
} catch (
|
|
3017
|
-
|
|
3016
|
+
} catch (n) {
|
|
3017
|
+
Tt(n);
|
|
3018
3018
|
}
|
|
3019
3019
|
}
|
|
3020
|
-
function
|
|
3021
|
-
|
|
3020
|
+
function ke(t) {
|
|
3021
|
+
t._observer = void 0, t._queue = void 0, t._state = "closed";
|
|
3022
3022
|
}
|
|
3023
|
-
function
|
|
3024
|
-
var
|
|
3025
|
-
if (
|
|
3026
|
-
|
|
3027
|
-
for (var
|
|
3023
|
+
function Mo(t) {
|
|
3024
|
+
var e = t._queue;
|
|
3025
|
+
if (e) {
|
|
3026
|
+
t._queue = void 0, t._state = "ready";
|
|
3027
|
+
for (var r = 0; r < e.length && (Vr(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
|
|
3028
3028
|
;
|
|
3029
3029
|
}
|
|
3030
3030
|
}
|
|
3031
|
-
function
|
|
3032
|
-
|
|
3033
|
-
var
|
|
3031
|
+
function Vr(t, e, r) {
|
|
3032
|
+
t._state = "running";
|
|
3033
|
+
var n = t._observer;
|
|
3034
3034
|
try {
|
|
3035
|
-
var o =
|
|
3036
|
-
switch (
|
|
3035
|
+
var o = Xt(n, e);
|
|
3036
|
+
switch (e) {
|
|
3037
3037
|
case "next":
|
|
3038
|
-
o && o.call(
|
|
3038
|
+
o && o.call(n, r);
|
|
3039
3039
|
break;
|
|
3040
3040
|
case "error":
|
|
3041
|
-
if (
|
|
3042
|
-
else throw
|
|
3041
|
+
if (ke(t), o) o.call(n, r);
|
|
3042
|
+
else throw r;
|
|
3043
3043
|
break;
|
|
3044
3044
|
case "complete":
|
|
3045
|
-
|
|
3045
|
+
ke(t), o && o.call(n);
|
|
3046
3046
|
break;
|
|
3047
3047
|
}
|
|
3048
|
-
} catch (
|
|
3049
|
-
|
|
3048
|
+
} catch (a) {
|
|
3049
|
+
Tt(a);
|
|
3050
3050
|
}
|
|
3051
|
-
|
|
3051
|
+
t._state === "closed" ? Hr(t) : t._state === "running" && (t._state = "ready");
|
|
3052
3052
|
}
|
|
3053
|
-
function
|
|
3054
|
-
if (
|
|
3055
|
-
if (
|
|
3056
|
-
|
|
3057
|
-
type:
|
|
3058
|
-
value:
|
|
3053
|
+
function de(t, e, r) {
|
|
3054
|
+
if (t._state !== "closed") {
|
|
3055
|
+
if (t._state === "buffering") {
|
|
3056
|
+
t._queue.push({
|
|
3057
|
+
type: e,
|
|
3058
|
+
value: r
|
|
3059
3059
|
});
|
|
3060
3060
|
return;
|
|
3061
3061
|
}
|
|
3062
|
-
if (
|
|
3063
|
-
|
|
3064
|
-
type:
|
|
3065
|
-
value:
|
|
3066
|
-
}],
|
|
3067
|
-
return
|
|
3062
|
+
if (t._state !== "ready") {
|
|
3063
|
+
t._state = "buffering", t._queue = [{
|
|
3064
|
+
type: e,
|
|
3065
|
+
value: r
|
|
3066
|
+
}], Jt(function() {
|
|
3067
|
+
return Mo(t);
|
|
3068
3068
|
});
|
|
3069
3069
|
return;
|
|
3070
3070
|
}
|
|
3071
|
-
|
|
3071
|
+
Vr(t, e, r);
|
|
3072
3072
|
}
|
|
3073
3073
|
}
|
|
3074
|
-
var
|
|
3075
|
-
function
|
|
3076
|
-
this._cleanup = void 0, this._observer =
|
|
3077
|
-
var o = new
|
|
3074
|
+
var Uo = /* @__PURE__ */ (function() {
|
|
3075
|
+
function t(r, n) {
|
|
3076
|
+
this._cleanup = void 0, this._observer = r, this._queue = void 0, this._state = "initializing";
|
|
3077
|
+
var o = new Bo(this);
|
|
3078
3078
|
try {
|
|
3079
|
-
this._cleanup =
|
|
3080
|
-
} catch (
|
|
3081
|
-
o.error(
|
|
3079
|
+
this._cleanup = n.call(void 0, o);
|
|
3080
|
+
} catch (a) {
|
|
3081
|
+
o.error(a);
|
|
3082
3082
|
}
|
|
3083
3083
|
this._state === "initializing" && (this._state = "ready");
|
|
3084
3084
|
}
|
|
3085
|
-
var
|
|
3086
|
-
return
|
|
3087
|
-
this._state !== "closed" && (
|
|
3088
|
-
},
|
|
3085
|
+
var e = t.prototype;
|
|
3086
|
+
return e.unsubscribe = function() {
|
|
3087
|
+
this._state !== "closed" && (ke(this), Hr(this));
|
|
3088
|
+
}, Te(t, [{
|
|
3089
3089
|
key: "closed",
|
|
3090
3090
|
get: function() {
|
|
3091
3091
|
return this._state === "closed";
|
|
3092
3092
|
}
|
|
3093
|
-
}]),
|
|
3094
|
-
})(),
|
|
3095
|
-
function
|
|
3096
|
-
this._subscription =
|
|
3097
|
-
}
|
|
3098
|
-
var
|
|
3099
|
-
return
|
|
3100
|
-
|
|
3101
|
-
},
|
|
3102
|
-
|
|
3103
|
-
},
|
|
3104
|
-
|
|
3105
|
-
},
|
|
3093
|
+
}]), t;
|
|
3094
|
+
})(), Bo = /* @__PURE__ */ (function() {
|
|
3095
|
+
function t(r) {
|
|
3096
|
+
this._subscription = r;
|
|
3097
|
+
}
|
|
3098
|
+
var e = t.prototype;
|
|
3099
|
+
return e.next = function(n) {
|
|
3100
|
+
de(this._subscription, "next", n);
|
|
3101
|
+
}, e.error = function(n) {
|
|
3102
|
+
de(this._subscription, "error", n);
|
|
3103
|
+
}, e.complete = function() {
|
|
3104
|
+
de(this._subscription, "complete");
|
|
3105
|
+
}, Te(t, [{
|
|
3106
3106
|
key: "closed",
|
|
3107
3107
|
get: function() {
|
|
3108
3108
|
return this._subscription._state === "closed";
|
|
3109
3109
|
}
|
|
3110
|
-
}]),
|
|
3111
|
-
})(),
|
|
3112
|
-
function
|
|
3113
|
-
if (!(this instanceof
|
|
3114
|
-
if (typeof
|
|
3115
|
-
this._subscriber =
|
|
3116
|
-
}
|
|
3117
|
-
var
|
|
3118
|
-
return
|
|
3119
|
-
return (typeof
|
|
3120
|
-
next:
|
|
3110
|
+
}]), t;
|
|
3111
|
+
})(), M = /* @__PURE__ */ (function() {
|
|
3112
|
+
function t(r) {
|
|
3113
|
+
if (!(this instanceof t)) throw new TypeError("Observable cannot be called as a function");
|
|
3114
|
+
if (typeof r != "function") throw new TypeError("Observable initializer must be a function");
|
|
3115
|
+
this._subscriber = r;
|
|
3116
|
+
}
|
|
3117
|
+
var e = t.prototype;
|
|
3118
|
+
return e.subscribe = function(n) {
|
|
3119
|
+
return (typeof n != "object" || n === null) && (n = {
|
|
3120
|
+
next: n,
|
|
3121
3121
|
error: arguments[1],
|
|
3122
3122
|
complete: arguments[2]
|
|
3123
|
-
}), new
|
|
3124
|
-
},
|
|
3123
|
+
}), new Uo(n, this._subscriber);
|
|
3124
|
+
}, e.forEach = function(n) {
|
|
3125
3125
|
var o = this;
|
|
3126
|
-
return new Promise(function(
|
|
3127
|
-
if (typeof
|
|
3128
|
-
i(new TypeError(
|
|
3126
|
+
return new Promise(function(a, i) {
|
|
3127
|
+
if (typeof n != "function") {
|
|
3128
|
+
i(new TypeError(n + " is not a function"));
|
|
3129
3129
|
return;
|
|
3130
3130
|
}
|
|
3131
3131
|
function c() {
|
|
3132
|
-
|
|
3132
|
+
s.unsubscribe(), a();
|
|
3133
3133
|
}
|
|
3134
|
-
var
|
|
3134
|
+
var s = o.subscribe({
|
|
3135
3135
|
next: function(u) {
|
|
3136
3136
|
try {
|
|
3137
|
-
|
|
3138
|
-
} catch (
|
|
3139
|
-
i(
|
|
3137
|
+
n(u, c);
|
|
3138
|
+
} catch (f) {
|
|
3139
|
+
i(f), s.unsubscribe();
|
|
3140
3140
|
}
|
|
3141
3141
|
},
|
|
3142
3142
|
error: i,
|
|
3143
|
-
complete:
|
|
3143
|
+
complete: a
|
|
3144
3144
|
});
|
|
3145
3145
|
});
|
|
3146
|
-
},
|
|
3146
|
+
}, e.map = function(n) {
|
|
3147
3147
|
var o = this;
|
|
3148
|
-
if (typeof
|
|
3149
|
-
var
|
|
3150
|
-
return new
|
|
3148
|
+
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
3149
|
+
var a = Lt(this);
|
|
3150
|
+
return new a(function(i) {
|
|
3151
3151
|
return o.subscribe({
|
|
3152
3152
|
next: function(c) {
|
|
3153
3153
|
try {
|
|
3154
|
-
c =
|
|
3155
|
-
} catch (
|
|
3156
|
-
return i.error(
|
|
3154
|
+
c = n(c);
|
|
3155
|
+
} catch (s) {
|
|
3156
|
+
return i.error(s);
|
|
3157
3157
|
}
|
|
3158
3158
|
i.next(c);
|
|
3159
3159
|
},
|
|
@@ -3165,17 +3165,17 @@ var Mo = /* @__PURE__ */ (function() {
|
|
|
3165
3165
|
}
|
|
3166
3166
|
});
|
|
3167
3167
|
});
|
|
3168
|
-
},
|
|
3168
|
+
}, e.filter = function(n) {
|
|
3169
3169
|
var o = this;
|
|
3170
|
-
if (typeof
|
|
3171
|
-
var
|
|
3172
|
-
return new
|
|
3170
|
+
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
3171
|
+
var a = Lt(this);
|
|
3172
|
+
return new a(function(i) {
|
|
3173
3173
|
return o.subscribe({
|
|
3174
3174
|
next: function(c) {
|
|
3175
3175
|
try {
|
|
3176
|
-
if (!
|
|
3177
|
-
} catch (
|
|
3178
|
-
return i.error(
|
|
3176
|
+
if (!n(c)) return;
|
|
3177
|
+
} catch (s) {
|
|
3178
|
+
return i.error(s);
|
|
3179
3179
|
}
|
|
3180
3180
|
i.next(c);
|
|
3181
3181
|
},
|
|
@@ -3187,69 +3187,69 @@ var Mo = /* @__PURE__ */ (function() {
|
|
|
3187
3187
|
}
|
|
3188
3188
|
});
|
|
3189
3189
|
});
|
|
3190
|
-
},
|
|
3190
|
+
}, e.reduce = function(n) {
|
|
3191
3191
|
var o = this;
|
|
3192
|
-
if (typeof
|
|
3193
|
-
var
|
|
3194
|
-
return new
|
|
3192
|
+
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
3193
|
+
var a = Lt(this), i = arguments.length > 1, c = !1, s = arguments[1], u = s;
|
|
3194
|
+
return new a(function(f) {
|
|
3195
3195
|
return o.subscribe({
|
|
3196
3196
|
next: function(h) {
|
|
3197
3197
|
var m = !c;
|
|
3198
3198
|
if (c = !0, !m || i)
|
|
3199
3199
|
try {
|
|
3200
|
-
u =
|
|
3200
|
+
u = n(u, h);
|
|
3201
3201
|
} catch (g) {
|
|
3202
|
-
return
|
|
3202
|
+
return f.error(g);
|
|
3203
3203
|
}
|
|
3204
3204
|
else
|
|
3205
3205
|
u = h;
|
|
3206
3206
|
},
|
|
3207
3207
|
error: function(h) {
|
|
3208
|
-
|
|
3208
|
+
f.error(h);
|
|
3209
3209
|
},
|
|
3210
3210
|
complete: function() {
|
|
3211
|
-
if (!c && !i) return
|
|
3212
|
-
|
|
3211
|
+
if (!c && !i) return f.error(new TypeError("Cannot reduce an empty sequence"));
|
|
3212
|
+
f.next(u), f.complete();
|
|
3213
3213
|
}
|
|
3214
3214
|
});
|
|
3215
3215
|
});
|
|
3216
|
-
},
|
|
3217
|
-
for (var
|
|
3218
|
-
|
|
3219
|
-
var c =
|
|
3220
|
-
return new c(function(
|
|
3221
|
-
var u,
|
|
3216
|
+
}, e.concat = function() {
|
|
3217
|
+
for (var n = this, o = arguments.length, a = new Array(o), i = 0; i < o; i++)
|
|
3218
|
+
a[i] = arguments[i];
|
|
3219
|
+
var c = Lt(this);
|
|
3220
|
+
return new c(function(s) {
|
|
3221
|
+
var u, f = 0;
|
|
3222
3222
|
function h(m) {
|
|
3223
3223
|
u = m.subscribe({
|
|
3224
3224
|
next: function(g) {
|
|
3225
|
-
|
|
3225
|
+
s.next(g);
|
|
3226
3226
|
},
|
|
3227
3227
|
error: function(g) {
|
|
3228
|
-
|
|
3228
|
+
s.error(g);
|
|
3229
3229
|
},
|
|
3230
3230
|
complete: function() {
|
|
3231
|
-
|
|
3231
|
+
f === a.length ? (u = void 0, s.complete()) : h(c.from(a[f++]));
|
|
3232
3232
|
}
|
|
3233
3233
|
});
|
|
3234
3234
|
}
|
|
3235
|
-
return h(
|
|
3235
|
+
return h(n), function() {
|
|
3236
3236
|
u && (u.unsubscribe(), u = void 0);
|
|
3237
3237
|
};
|
|
3238
3238
|
});
|
|
3239
|
-
},
|
|
3239
|
+
}, e.flatMap = function(n) {
|
|
3240
3240
|
var o = this;
|
|
3241
|
-
if (typeof
|
|
3242
|
-
var
|
|
3243
|
-
return new
|
|
3244
|
-
var c = [],
|
|
3245
|
-
next: function(
|
|
3246
|
-
if (
|
|
3241
|
+
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
3242
|
+
var a = Lt(this);
|
|
3243
|
+
return new a(function(i) {
|
|
3244
|
+
var c = [], s = o.subscribe({
|
|
3245
|
+
next: function(f) {
|
|
3246
|
+
if (n)
|
|
3247
3247
|
try {
|
|
3248
|
-
|
|
3248
|
+
f = n(f);
|
|
3249
3249
|
} catch (m) {
|
|
3250
3250
|
return i.error(m);
|
|
3251
3251
|
}
|
|
3252
|
-
var h =
|
|
3252
|
+
var h = a.from(f).subscribe({
|
|
3253
3253
|
next: function(m) {
|
|
3254
3254
|
i.next(m);
|
|
3255
3255
|
},
|
|
@@ -3263,272 +3263,274 @@ var Mo = /* @__PURE__ */ (function() {
|
|
|
3263
3263
|
});
|
|
3264
3264
|
c.push(h);
|
|
3265
3265
|
},
|
|
3266
|
-
error: function(
|
|
3267
|
-
i.error(
|
|
3266
|
+
error: function(f) {
|
|
3267
|
+
i.error(f);
|
|
3268
3268
|
},
|
|
3269
3269
|
complete: function() {
|
|
3270
3270
|
u();
|
|
3271
3271
|
}
|
|
3272
3272
|
});
|
|
3273
3273
|
function u() {
|
|
3274
|
-
|
|
3274
|
+
s.closed && c.length === 0 && i.complete();
|
|
3275
3275
|
}
|
|
3276
3276
|
return function() {
|
|
3277
|
-
c.forEach(function(
|
|
3278
|
-
return
|
|
3279
|
-
}),
|
|
3277
|
+
c.forEach(function(f) {
|
|
3278
|
+
return f.unsubscribe();
|
|
3279
|
+
}), s.unsubscribe();
|
|
3280
3280
|
};
|
|
3281
3281
|
});
|
|
3282
|
-
},
|
|
3282
|
+
}, e[ve] = function() {
|
|
3283
3283
|
return this;
|
|
3284
|
-
},
|
|
3285
|
-
var o = typeof this == "function" ? this :
|
|
3286
|
-
if (
|
|
3287
|
-
var
|
|
3288
|
-
if (
|
|
3289
|
-
var i =
|
|
3284
|
+
}, t.from = function(n) {
|
|
3285
|
+
var o = typeof this == "function" ? this : t;
|
|
3286
|
+
if (n == null) throw new TypeError(n + " is not an object");
|
|
3287
|
+
var a = Xt(n, ve);
|
|
3288
|
+
if (a) {
|
|
3289
|
+
var i = a.call(n);
|
|
3290
3290
|
if (Object(i) !== i) throw new TypeError(i + " is not an object");
|
|
3291
|
-
return
|
|
3291
|
+
return Do(i) && i.constructor === o ? i : new o(function(c) {
|
|
3292
3292
|
return i.subscribe(c);
|
|
3293
3293
|
});
|
|
3294
3294
|
}
|
|
3295
|
-
if (
|
|
3295
|
+
if (Oe("iterator") && (a = Xt(n, zo), a))
|
|
3296
3296
|
return new o(function(c) {
|
|
3297
|
-
|
|
3297
|
+
Jt(function() {
|
|
3298
3298
|
if (!c.closed) {
|
|
3299
|
-
for (var
|
|
3300
|
-
var
|
|
3301
|
-
if (c.next(
|
|
3299
|
+
for (var s = Ao(a.call(n)), u; !(u = s()).done; ) {
|
|
3300
|
+
var f = u.value;
|
|
3301
|
+
if (c.next(f), c.closed) return;
|
|
3302
3302
|
}
|
|
3303
3303
|
c.complete();
|
|
3304
3304
|
}
|
|
3305
3305
|
});
|
|
3306
3306
|
});
|
|
3307
|
-
if (Array.isArray(
|
|
3307
|
+
if (Array.isArray(n))
|
|
3308
3308
|
return new o(function(c) {
|
|
3309
|
-
|
|
3309
|
+
Jt(function() {
|
|
3310
3310
|
if (!c.closed) {
|
|
3311
|
-
for (var
|
|
3312
|
-
if (c.next(
|
|
3311
|
+
for (var s = 0; s < n.length; ++s)
|
|
3312
|
+
if (c.next(n[s]), c.closed) return;
|
|
3313
3313
|
c.complete();
|
|
3314
3314
|
}
|
|
3315
3315
|
});
|
|
3316
3316
|
});
|
|
3317
|
-
throw new TypeError(
|
|
3318
|
-
},
|
|
3319
|
-
for (var
|
|
3320
|
-
o[
|
|
3321
|
-
var i = typeof this == "function" ? this :
|
|
3317
|
+
throw new TypeError(n + " is not observable");
|
|
3318
|
+
}, t.of = function() {
|
|
3319
|
+
for (var n = arguments.length, o = new Array(n), a = 0; a < n; a++)
|
|
3320
|
+
o[a] = arguments[a];
|
|
3321
|
+
var i = typeof this == "function" ? this : t;
|
|
3322
3322
|
return new i(function(c) {
|
|
3323
|
-
|
|
3323
|
+
Jt(function() {
|
|
3324
3324
|
if (!c.closed) {
|
|
3325
|
-
for (var
|
|
3326
|
-
if (c.next(o[
|
|
3325
|
+
for (var s = 0; s < o.length; ++s)
|
|
3326
|
+
if (c.next(o[s]), c.closed) return;
|
|
3327
3327
|
c.complete();
|
|
3328
3328
|
}
|
|
3329
3329
|
});
|
|
3330
3330
|
});
|
|
3331
|
-
},
|
|
3332
|
-
key:
|
|
3331
|
+
}, Te(t, null, [{
|
|
3332
|
+
key: Rr,
|
|
3333
3333
|
get: function() {
|
|
3334
3334
|
return this;
|
|
3335
3335
|
}
|
|
3336
|
-
}]),
|
|
3336
|
+
}]), t;
|
|
3337
3337
|
})();
|
|
3338
|
-
|
|
3338
|
+
Pe() && Object.defineProperty(M, Symbol("extensions"), {
|
|
3339
3339
|
value: {
|
|
3340
|
-
symbol:
|
|
3341
|
-
hostReportError:
|
|
3340
|
+
symbol: ve,
|
|
3341
|
+
hostReportError: Tt
|
|
3342
3342
|
},
|
|
3343
3343
|
configurable: !0
|
|
3344
3344
|
});
|
|
3345
|
-
function qo(
|
|
3346
|
-
var
|
|
3347
|
-
if (typeof
|
|
3348
|
-
if (
|
|
3349
|
-
|
|
3345
|
+
function qo(t) {
|
|
3346
|
+
var e, r = t.Symbol;
|
|
3347
|
+
if (typeof r == "function")
|
|
3348
|
+
if (r.observable)
|
|
3349
|
+
e = r.observable;
|
|
3350
3350
|
else {
|
|
3351
|
-
typeof
|
|
3351
|
+
typeof r.for == "function" ? e = r.for("https://github.com/benlesh/symbol-observable") : e = r("https://github.com/benlesh/symbol-observable");
|
|
3352
3352
|
try {
|
|
3353
|
-
|
|
3353
|
+
r.observable = e;
|
|
3354
3354
|
} catch {
|
|
3355
3355
|
}
|
|
3356
3356
|
}
|
|
3357
3357
|
else
|
|
3358
|
-
|
|
3359
|
-
return
|
|
3358
|
+
e = "@@observable";
|
|
3359
|
+
return e;
|
|
3360
3360
|
}
|
|
3361
|
-
var
|
|
3362
|
-
typeof self < "u" ?
|
|
3363
|
-
qo(
|
|
3364
|
-
var
|
|
3365
|
-
|
|
3361
|
+
var _t;
|
|
3362
|
+
typeof self < "u" ? _t = self : typeof window < "u" ? _t = window : typeof global < "u" ? _t = global : typeof module < "u" ? _t = module : _t = Function("return this")();
|
|
3363
|
+
qo(_t);
|
|
3364
|
+
var dr = M.prototype, fr = "@@observable";
|
|
3365
|
+
dr[fr] || (dr[fr] = function() {
|
|
3366
3366
|
return this;
|
|
3367
3367
|
});
|
|
3368
|
-
function
|
|
3369
|
-
for (var
|
|
3368
|
+
function Ro(t) {
|
|
3369
|
+
for (var e = [
|
|
3370
3370
|
"query",
|
|
3371
3371
|
"operationName",
|
|
3372
3372
|
"variables",
|
|
3373
3373
|
"extensions",
|
|
3374
3374
|
"context"
|
|
3375
|
-
],
|
|
3376
|
-
var o = r
|
|
3377
|
-
if (
|
|
3378
|
-
throw
|
|
3375
|
+
], r = 0, n = Object.keys(t); r < n.length; r++) {
|
|
3376
|
+
var o = n[r];
|
|
3377
|
+
if (e.indexOf(o) < 0)
|
|
3378
|
+
throw Br(58, o);
|
|
3379
3379
|
}
|
|
3380
|
-
return
|
|
3380
|
+
return t;
|
|
3381
3381
|
}
|
|
3382
|
-
function Ho(
|
|
3383
|
-
var
|
|
3384
|
-
typeof
|
|
3382
|
+
function Ho(t, e) {
|
|
3383
|
+
var r = st({}, t), n = function(a) {
|
|
3384
|
+
typeof a == "function" ? r = st(st({}, r), a(r)) : r = st(st({}, r), a);
|
|
3385
3385
|
}, o = function() {
|
|
3386
|
-
return
|
|
3386
|
+
return st({}, r);
|
|
3387
3387
|
};
|
|
3388
|
-
return Object.defineProperty(
|
|
3388
|
+
return Object.defineProperty(e, "setContext", {
|
|
3389
3389
|
enumerable: !1,
|
|
3390
|
-
value:
|
|
3391
|
-
}), Object.defineProperty(
|
|
3390
|
+
value: n
|
|
3391
|
+
}), Object.defineProperty(e, "getContext", {
|
|
3392
3392
|
enumerable: !1,
|
|
3393
3393
|
value: o
|
|
3394
|
-
}),
|
|
3395
|
-
}
|
|
3396
|
-
function
|
|
3397
|
-
var
|
|
3398
|
-
variables:
|
|
3399
|
-
extensions:
|
|
3400
|
-
operationName:
|
|
3401
|
-
query:
|
|
3394
|
+
}), e;
|
|
3395
|
+
}
|
|
3396
|
+
function Vo(t) {
|
|
3397
|
+
var e = {
|
|
3398
|
+
variables: t.variables || {},
|
|
3399
|
+
extensions: t.extensions || {},
|
|
3400
|
+
operationName: t.operationName,
|
|
3401
|
+
query: t.query
|
|
3402
3402
|
};
|
|
3403
|
-
return
|
|
3403
|
+
return e.operationName || (e.operationName = typeof e.query != "string" ? Po(e.query) || void 0 : ""), e;
|
|
3404
3404
|
}
|
|
3405
|
-
var
|
|
3406
|
-
function
|
|
3407
|
-
return
|
|
3405
|
+
var Yo = Symbol.for("apollo.deprecations"), Jo = xe, Ko = new Ee();
|
|
3406
|
+
function Go(t) {
|
|
3407
|
+
return Jo[Yo] || (Ko.getValue() || []).includes(t);
|
|
3408
3408
|
}
|
|
3409
|
-
function
|
|
3410
|
-
|
|
3409
|
+
function Wo(t, e) {
|
|
3410
|
+
Go(t) || e();
|
|
3411
3411
|
}
|
|
3412
|
-
function
|
|
3413
|
-
return
|
|
3412
|
+
function pr(t, e) {
|
|
3413
|
+
return e ? e(t) : M.of();
|
|
3414
3414
|
}
|
|
3415
|
-
function
|
|
3416
|
-
return typeof
|
|
3415
|
+
function zt(t) {
|
|
3416
|
+
return typeof t == "function" ? new Yr(t) : t;
|
|
3417
3417
|
}
|
|
3418
|
-
function
|
|
3419
|
-
return
|
|
3418
|
+
function Ht(t) {
|
|
3419
|
+
return t.request.length <= 1;
|
|
3420
3420
|
}
|
|
3421
|
-
var
|
|
3421
|
+
var Yr = (
|
|
3422
3422
|
/** @class */
|
|
3423
3423
|
(function() {
|
|
3424
|
-
function e
|
|
3425
|
-
|
|
3424
|
+
function t(e) {
|
|
3425
|
+
e && (this.request = e);
|
|
3426
3426
|
}
|
|
3427
|
-
return
|
|
3428
|
-
return new
|
|
3429
|
-
return
|
|
3427
|
+
return t.empty = function() {
|
|
3428
|
+
return new t(function() {
|
|
3429
|
+
return M.of();
|
|
3430
3430
|
});
|
|
3431
|
-
},
|
|
3432
|
-
return
|
|
3433
|
-
return
|
|
3431
|
+
}, t.from = function(e) {
|
|
3432
|
+
return e.length === 0 ? t.empty() : e.map(zt).reduce(function(r, n) {
|
|
3433
|
+
return r.concat(n);
|
|
3434
3434
|
});
|
|
3435
|
-
},
|
|
3436
|
-
var o =
|
|
3437
|
-
return
|
|
3438
|
-
return
|
|
3439
|
-
}) : i = new
|
|
3440
|
-
return
|
|
3441
|
-
}), Object.assign(i, { left: o, right:
|
|
3442
|
-
},
|
|
3443
|
-
return
|
|
3444
|
-
},
|
|
3445
|
-
var
|
|
3446
|
-
if (
|
|
3447
|
-
return globalThis.__DEV__ !== !1 &&
|
|
3448
|
-
var o =
|
|
3449
|
-
return
|
|
3450
|
-
return
|
|
3451
|
-
return o.request(c) ||
|
|
3452
|
-
}) ||
|
|
3453
|
-
}) :
|
|
3454
|
-
return
|
|
3455
|
-
return o.request(
|
|
3456
|
-
}) ||
|
|
3457
|
-
}), Object.assign(
|
|
3458
|
-
},
|
|
3459
|
-
return this.concat(
|
|
3460
|
-
},
|
|
3461
|
-
return
|
|
3462
|
-
},
|
|
3463
|
-
throw
|
|
3464
|
-
},
|
|
3465
|
-
if (globalThis.__DEV__ !== !1 &&
|
|
3466
|
-
globalThis.__DEV__ !== !1 &&
|
|
3467
|
-
}),
|
|
3468
|
-
return
|
|
3469
|
-
throw
|
|
3470
|
-
},
|
|
3471
|
-
return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 &&
|
|
3472
|
-
},
|
|
3435
|
+
}, t.split = function(e, r, n) {
|
|
3436
|
+
var o = zt(r), a = zt(n || new t(pr)), i;
|
|
3437
|
+
return Ht(o) && Ht(a) ? i = new t(function(c) {
|
|
3438
|
+
return e(c) ? o.request(c) || M.of() : a.request(c) || M.of();
|
|
3439
|
+
}) : i = new t(function(c, s) {
|
|
3440
|
+
return e(c) ? o.request(c, s) || M.of() : a.request(c, s) || M.of();
|
|
3441
|
+
}), Object.assign(i, { left: o, right: a });
|
|
3442
|
+
}, t.execute = function(e, r) {
|
|
3443
|
+
return e.request(Ho(r.context, Vo(Ro(r)))) || M.of();
|
|
3444
|
+
}, t.concat = function(e, r) {
|
|
3445
|
+
var n = zt(e);
|
|
3446
|
+
if (Ht(n))
|
|
3447
|
+
return globalThis.__DEV__ !== !1 && le.warn(47, n), n;
|
|
3448
|
+
var o = zt(r), a;
|
|
3449
|
+
return Ht(o) ? a = new t(function(i) {
|
|
3450
|
+
return n.request(i, function(c) {
|
|
3451
|
+
return o.request(c) || M.of();
|
|
3452
|
+
}) || M.of();
|
|
3453
|
+
}) : a = new t(function(i, c) {
|
|
3454
|
+
return n.request(i, function(s) {
|
|
3455
|
+
return o.request(s, c) || M.of();
|
|
3456
|
+
}) || M.of();
|
|
3457
|
+
}), Object.assign(a, { left: n, right: o });
|
|
3458
|
+
}, t.prototype.split = function(e, r, n) {
|
|
3459
|
+
return this.concat(t.split(e, r, n || new t(pr)));
|
|
3460
|
+
}, t.prototype.concat = function(e) {
|
|
3461
|
+
return t.concat(this, e);
|
|
3462
|
+
}, t.prototype.request = function(e, r) {
|
|
3463
|
+
throw Br(48);
|
|
3464
|
+
}, t.prototype.onError = function(e, r) {
|
|
3465
|
+
if (globalThis.__DEV__ !== !1 && Wo("onError", function() {
|
|
3466
|
+
globalThis.__DEV__ !== !1 && le.warn(49);
|
|
3467
|
+
}), r && r.error)
|
|
3468
|
+
return r.error(e), !1;
|
|
3469
|
+
throw e;
|
|
3470
|
+
}, t.prototype.setOnError = function(e) {
|
|
3471
|
+
return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 && le.warn(50), this.onError = e, this;
|
|
3472
|
+
}, t;
|
|
3473
3473
|
})()
|
|
3474
3474
|
);
|
|
3475
|
-
function
|
|
3476
|
-
return new
|
|
3477
|
-
var
|
|
3478
|
-
return new
|
|
3479
|
-
var
|
|
3480
|
-
return Promise.resolve(
|
|
3481
|
-
return
|
|
3482
|
-
}).then(
|
|
3483
|
-
i || (
|
|
3475
|
+
function Qo(t) {
|
|
3476
|
+
return new Yr(function(e, r) {
|
|
3477
|
+
var n = _o(e, []);
|
|
3478
|
+
return new M(function(o) {
|
|
3479
|
+
var a, i = !1;
|
|
3480
|
+
return Promise.resolve(n).then(function(c) {
|
|
3481
|
+
return t(c, e.getContext());
|
|
3482
|
+
}).then(e.setContext).then(function() {
|
|
3483
|
+
i || (a = r(e).subscribe({
|
|
3484
3484
|
next: o.next.bind(o),
|
|
3485
3485
|
error: o.error.bind(o),
|
|
3486
3486
|
complete: o.complete.bind(o)
|
|
3487
3487
|
}));
|
|
3488
3488
|
}).catch(o.error.bind(o)), function() {
|
|
3489
|
-
i = !0,
|
|
3489
|
+
i = !0, a && a.unsubscribe();
|
|
3490
3490
|
};
|
|
3491
3491
|
});
|
|
3492
3492
|
});
|
|
3493
3493
|
}
|
|
3494
|
-
const
|
|
3495
|
-
const
|
|
3494
|
+
const Xo = async () => {
|
|
3495
|
+
const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", n = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
3496
3496
|
try {
|
|
3497
|
-
const o = await
|
|
3498
|
-
|
|
3497
|
+
const o = await U.post(
|
|
3498
|
+
t,
|
|
3499
3499
|
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
3500
3500
|
// Only grant_type in body
|
|
3501
3501
|
{
|
|
3502
3502
|
headers: {
|
|
3503
3503
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
3504
|
-
Authorization:
|
|
3504
|
+
Authorization: n
|
|
3505
3505
|
}
|
|
3506
3506
|
}
|
|
3507
3507
|
);
|
|
3508
3508
|
return o.status === 200 && o.data.access_token ? o.data.access_token : (console.error("Failed to fetch token:", o.data), null);
|
|
3509
3509
|
} catch (o) {
|
|
3510
|
-
return
|
|
3510
|
+
return U.isAxiosError(o) ? console.error("Error fetching token:", o.response || o.message) : console.error("Unexpected error:", o), null;
|
|
3511
3511
|
}
|
|
3512
|
-
},
|
|
3513
|
-
uri: `${
|
|
3514
|
-
}),
|
|
3515
|
-
const
|
|
3512
|
+
}, Zo = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", ta = Xr({
|
|
3513
|
+
uri: `${Zo}`
|
|
3514
|
+
}), ea = Qo(async (t, { headers: e }) => {
|
|
3515
|
+
const r = await Xo();
|
|
3516
3516
|
return {
|
|
3517
3517
|
headers: {
|
|
3518
|
-
...
|
|
3519
|
-
authorization: `Bearer ${
|
|
3518
|
+
...e,
|
|
3519
|
+
authorization: `Bearer ${r}`
|
|
3520
3520
|
}
|
|
3521
3521
|
};
|
|
3522
|
-
}),
|
|
3523
|
-
link:
|
|
3524
|
-
cache: new
|
|
3522
|
+
}), ra = new Zr({
|
|
3523
|
+
link: ea.concat(ta),
|
|
3524
|
+
cache: new tn(),
|
|
3525
3525
|
defaultOptions: {
|
|
3526
3526
|
watchQuery: {
|
|
3527
3527
|
fetchPolicy: "cache-and-network"
|
|
3528
3528
|
}
|
|
3529
3529
|
}
|
|
3530
|
-
}),
|
|
3530
|
+
}), ya = () => /* @__PURE__ */ l(en, { client: ra, children: /* @__PURE__ */ l(dn, { children: /* @__PURE__ */ l(Co, {}) }) }), Jr = document.createElement("style");
|
|
3531
|
+
Jr.textContent = on;
|
|
3532
|
+
document.head.appendChild(Jr);
|
|
3531
3533
|
export {
|
|
3532
|
-
|
|
3534
|
+
ya as TanyaChatbot
|
|
3533
3535
|
};
|
|
3534
3536
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|