tanya-chatbot 0.7.3 → 0.7.4
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 +10 -10
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +824 -825
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +1 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { useEffect as
|
|
2
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { useEffect as be, useState as C, useRef as Re, forwardRef as _n, createElement as cr, useMemo as Rr } from "react";
|
|
2
|
+
import { jsx as a, jsxs as d, Fragment as xe } from "react/jsx-runtime";
|
|
3
3
|
import { createHttpLink as Eo, ApolloClient as Oo, InMemoryCache as Ao, ApolloProvider as jo } from "@apollo/client";
|
|
4
4
|
import { Provider as $o, useDispatch as In, useSelector as Yt } from "react-redux";
|
|
5
5
|
import { createSlice as Fn, configureStore as Do } from "@reduxjs/toolkit";
|
|
6
6
|
import * as Pn from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
|
-
import
|
|
9
|
+
import ge from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
11
|
import { Icon as Lo } from "@iconify/react";
|
|
12
12
|
import { toast as Me } from "react-toastify";
|
|
13
13
|
import { createPortal as zo } from "react-dom";
|
|
14
14
|
const Mo = '*,: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}.visible{visibility:visible}.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}.m-\\[15px\\]{margin:15px}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.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-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-2{margin-right:.5rem}.mr-6{margin-right:1.5rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-12{height:3rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-\\[120px\\]{height:120px}.h-\\[150px\\]{height:150px}.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-3\\/4{width:75%}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-8{width:2rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-\\[64\\.7vw\\]{width:64.7vw}.w-\\[96\\%\\]{width:96%}.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%}.max-w-\\[90\\%\\]{max-width:90%}.max-w-md{max-width:28rem}.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-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.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}.gap-y-2{row-gap:.5rem}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.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-bl-xl{border-bottom-left-radius:.75rem}.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-2{border-width:2px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t{border-top-width:1px}.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))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / 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-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.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))}.bg-white\\/70{background-color:#ffffffb3}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\\[1px\\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.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-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.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-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm,.text-sm\\/5{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.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-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / 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-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.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))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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_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-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 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-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}.drop-shadow-xl{--tw-drop-shadow: drop-shadow(0 20px 13px rgb(0 0 0 / .03)) drop-shadow(0 8px 5px rgb(0 0 0 / .08));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)}.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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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-150{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-150{animation-duration:.15s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.placeholder\\:text-red-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.placeholder\\:text-red-400::placeholder{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\\:-translate-y-0\\.5:hover{--tw-translate-y: -.125rem;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\\: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\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.hover\\:shadow-lg:hover{--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)}.hover\\:shadow-sm:hover{--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)}.focus\\:border-transparent:focus{border-color:transparent}.focus\\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity, 1))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.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\\:col-span-10{grid-column:span 10 / span 10}.sm\\:col-span-2{grid-column:span 2 / span 2}.sm\\:mx-0{margin-left:0;margin-right:0}.sm\\:w-\\[80vw\\]{width:80vw}.sm\\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:justify-start{justify-content:flex-start}}@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\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.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}}';
|
|
15
15
|
function ri() {
|
|
16
|
-
return
|
|
16
|
+
return be(() => {
|
|
17
17
|
if (typeof document < "u") {
|
|
18
18
|
const e = document.createElement("style");
|
|
19
19
|
return e.textContent = Mo, document.head.appendChild(e), () => {
|
|
@@ -101,17 +101,17 @@ function Jo({
|
|
|
101
101
|
const lt = () => ({ 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" }), On = async () => {
|
|
102
102
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
103
103
|
try {
|
|
104
|
-
const t = await
|
|
104
|
+
const t = await ge.post(
|
|
105
105
|
`${e}api/auth/token-bm-grant?baseUrl=${Qe()}&siteId=${Ve()}`
|
|
106
106
|
);
|
|
107
107
|
return t.status === 200 && t.data.access_token ? t.data.access_token : (console.error("Failed to fetch token:", t.data), null);
|
|
108
108
|
} catch (t) {
|
|
109
|
-
return
|
|
109
|
+
return ge.isAxiosError(t) ? console.error("Error fetching token:", t.response || t.message) : console.error("Unexpected error:", t), null;
|
|
110
110
|
}
|
|
111
111
|
}, An = async (e) => {
|
|
112
112
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
113
113
|
try {
|
|
114
|
-
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, n = await
|
|
114
|
+
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, n = await ge.post(
|
|
115
115
|
`${t}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${Qe()}&siteId=${Ve()}&pubCfg=${ct()}&envRef=${dt()}&orgRef=${ut()}`,
|
|
116
116
|
{},
|
|
117
117
|
{
|
|
@@ -123,7 +123,7 @@ const lt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
123
123
|
);
|
|
124
124
|
return n.status === 200 && n.data ? n.data : null;
|
|
125
125
|
} catch (r) {
|
|
126
|
-
return
|
|
126
|
+
return ge.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
async function vt() {
|
|
@@ -166,7 +166,7 @@ const ur = async (e, t) => {
|
|
|
166
166
|
}
|
|
167
167
|
try {
|
|
168
168
|
const o = Qe();
|
|
169
|
-
return (await
|
|
169
|
+
return (await ge.get(
|
|
170
170
|
`${t}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${Ve()}&pubCfg=${ct()}&envRef=${dt()}&orgRef=${ut()}`,
|
|
171
171
|
{
|
|
172
172
|
headers: {
|
|
@@ -183,7 +183,7 @@ const ur = async (e, t) => {
|
|
|
183
183
|
const { serverUrl: t, basePath: r } = lt(), n = Qe();
|
|
184
184
|
console.log("calling access");
|
|
185
185
|
const { access_token: o } = await vt();
|
|
186
|
-
return (await
|
|
186
|
+
return (await ge.get(
|
|
187
187
|
`${t}${r}/product-sfcc/${e}?baseUrl=${n}&siteId=${Ve()}&pubCfg=${ct()}&envRef=${dt()}&orgRef=${ut()}`,
|
|
188
188
|
{
|
|
189
189
|
headers: {
|
|
@@ -197,7 +197,7 @@ const ur = async (e, t) => {
|
|
|
197
197
|
const t = await On(), { customer_token: r } = await An(
|
|
198
198
|
t
|
|
199
199
|
), { serverUrl: n, basePath: o } = lt(), i = (await vt()).access_token;
|
|
200
|
-
return (await
|
|
200
|
+
return (await ge.get(
|
|
201
201
|
`${n}${o}/get-interest?baseUrl=${Qe()}&customerId=${e}&siteId=${Ve()}&pubCfg=${ct()}&envRef=${dt()}&orgRef=${ut()}`,
|
|
202
202
|
{
|
|
203
203
|
headers: {
|
|
@@ -224,7 +224,7 @@ const ur = async (e, t) => {
|
|
|
224
224
|
}).join("");
|
|
225
225
|
function Xo() {
|
|
226
226
|
const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, r] = C(e);
|
|
227
|
-
return
|
|
227
|
+
return be(() => {
|
|
228
228
|
const n = () => r(e());
|
|
229
229
|
return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
230
230
|
}, []), t;
|
|
@@ -240,11 +240,11 @@ const Zo = ({
|
|
|
240
240
|
o(
|
|
241
241
|
(l) => l - r < 0 ? e.length - (e.length % r || r) : l - r
|
|
242
242
|
);
|
|
243
|
-
},
|
|
244
|
-
const
|
|
245
|
-
t(dr(
|
|
243
|
+
}, c = async (l) => {
|
|
244
|
+
const h = await jn(l);
|
|
245
|
+
t(dr(h));
|
|
246
246
|
};
|
|
247
|
-
return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
248
248
|
(e == null ? void 0 : e.length) > r && /* @__PURE__ */ a(
|
|
249
249
|
"button",
|
|
250
250
|
{
|
|
@@ -259,32 +259,32 @@ const Zo = ({
|
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
261
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: e.slice(n, n + r).map((l) => {
|
|
262
|
-
var
|
|
263
|
-
return /* @__PURE__ */
|
|
262
|
+
var h, g, y, x;
|
|
263
|
+
return /* @__PURE__ */ d(
|
|
264
264
|
"div",
|
|
265
265
|
{
|
|
266
266
|
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]",
|
|
267
267
|
onClick: () => {
|
|
268
|
-
|
|
268
|
+
c(l.product_id ?? l.productId);
|
|
269
269
|
},
|
|
270
270
|
children: [
|
|
271
271
|
/* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
|
|
272
272
|
"img",
|
|
273
273
|
{
|
|
274
|
-
src: ((
|
|
274
|
+
src: ((h = Vr(l)[0]) == null ? void 0 : h.link) || Vr(l)[0] || // fallback if it's a string
|
|
275
275
|
"https://via.placeholder.com/120",
|
|
276
276
|
alt: l != null && l.productName ? l.productName : "Product",
|
|
277
277
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
278
278
|
}
|
|
279
279
|
) }),
|
|
280
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ d(
|
|
281
281
|
"div",
|
|
282
282
|
{
|
|
283
283
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
284
284
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ d("div", { className: "relative inline-block group", children: [
|
|
286
286
|
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name : Jr(
|
|
287
|
-
Hr((
|
|
287
|
+
Hr((g = l == null ? void 0 : l.name) == null ? void 0 : g["en-US"]),
|
|
288
288
|
60
|
|
289
289
|
) || "Product" }),
|
|
290
290
|
/* @__PURE__ */ a(
|
|
@@ -305,12 +305,12 @@ const Zo = ({
|
|
|
305
305
|
}
|
|
306
306
|
)
|
|
307
307
|
] }),
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ d("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
309
309
|
/* @__PURE__ */ a("p", { children: Go(
|
|
310
310
|
l != null && l.price ? Number(l == null ? void 0 : l.price) : Yr(l).centAmount || 0,
|
|
311
311
|
(x = Yr(l)) == null ? void 0 : x.currencyCode
|
|
312
312
|
) }),
|
|
313
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ d("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
314
314
|
"$",
|
|
315
315
|
Number(l == null ? void 0 : l.price).toFixed(2) ?? 5
|
|
316
316
|
] })
|
|
@@ -337,7 +337,7 @@ const Zo = ({
|
|
|
337
337
|
}
|
|
338
338
|
)
|
|
339
339
|
] }) });
|
|
340
|
-
}, ea = ({ chat: e, storeDetails: t }) => /* @__PURE__ */ a("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: e.map((r, n) => /* @__PURE__ */
|
|
340
|
+
}, ea = ({ chat: e, storeDetails: t }) => /* @__PURE__ */ a("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: e.map((r, n) => /* @__PURE__ */ d(
|
|
341
341
|
"div",
|
|
342
342
|
{
|
|
343
343
|
className: "mb-4 p-3 rounded-xl",
|
|
@@ -367,7 +367,7 @@ const Zo = ({
|
|
|
367
367
|
var s, i;
|
|
368
368
|
const { serverUrl: r, basePath: n } = lt(), o = `${r}`;
|
|
369
369
|
try {
|
|
370
|
-
const
|
|
370
|
+
const c = await ge.post(
|
|
371
371
|
`${o}${n}/basket/create?baseUrl=${Qe()}&siteId=${Ve()}&pubCfg=${ct()}&envRef=${dt()}&orgRef=${ut()}`,
|
|
372
372
|
t,
|
|
373
373
|
{
|
|
@@ -380,17 +380,17 @@ const Zo = ({
|
|
|
380
380
|
return window.postMessage(
|
|
381
381
|
{
|
|
382
382
|
type: "WIDGET_CREATED_BASKET",
|
|
383
|
-
basketId: ((s =
|
|
383
|
+
basketId: ((s = c.data) == null ? void 0 : s.basket_id) || ((i = c.data) == null ? void 0 : i.basketId)
|
|
384
384
|
},
|
|
385
385
|
"*"
|
|
386
|
-
),
|
|
387
|
-
} catch (
|
|
388
|
-
return
|
|
386
|
+
), c.data;
|
|
387
|
+
} catch (c) {
|
|
388
|
+
return ge.isAxiosError(c) ? console.error("Error creating basket:", c.response || c.message) : console.error("Unexpected error:", c), null;
|
|
389
389
|
}
|
|
390
390
|
}, fr = async (e, t, r) => {
|
|
391
391
|
const { serverUrl: n, basePath: o } = lt(), s = `${n}`;
|
|
392
392
|
try {
|
|
393
|
-
const i = await
|
|
393
|
+
const i = await ge.post(
|
|
394
394
|
`${s}${o}/basket/add-product/${e}?baseUrl=${Qe()}&siteId=${Ve()}&pubCfg=${ct()}&envRef=${dt()}&orgRef=${ut()}`,
|
|
395
395
|
t,
|
|
396
396
|
{
|
|
@@ -402,7 +402,7 @@ const Zo = ({
|
|
|
402
402
|
);
|
|
403
403
|
return i.status === 200 && i.data ? i.data : null;
|
|
404
404
|
} catch (i) {
|
|
405
|
-
return
|
|
405
|
+
return ge.isAxiosError(i) ? console.error(
|
|
406
406
|
"Error adding products to basket:",
|
|
407
407
|
i.response || i.message
|
|
408
408
|
) : console.error("Unexpected error:", i), null;
|
|
@@ -414,7 +414,7 @@ const Zo = ({
|
|
|
414
414
|
var s;
|
|
415
415
|
const { serverUrl: r, basePath: n } = lt(), o = `${r}`;
|
|
416
416
|
try {
|
|
417
|
-
const i = await
|
|
417
|
+
const i = await ge.get(
|
|
418
418
|
`${o}${n}/basket/${e}?baseUrl=${Qe()}&siteId=${Ve()}&pubCfg=${ct()}&envRef=${dt()}&orgRef=${ut()}`,
|
|
419
419
|
{
|
|
420
420
|
headers: {
|
|
@@ -425,7 +425,7 @@ const Zo = ({
|
|
|
425
425
|
);
|
|
426
426
|
return { status: i.status, data: i.data };
|
|
427
427
|
} catch (i) {
|
|
428
|
-
return
|
|
428
|
+
return ge.isAxiosError(i) ? { status: (s = i.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
|
|
429
429
|
}
|
|
430
430
|
}, Kt = "sfcc_basket_id", Kr = "sfcc_customer_token", Et = "sfcc_token_expiry", ta = 300 * 1e3, Lt = "1.0.0";
|
|
431
431
|
const it = (e) => {
|
|
@@ -446,13 +446,13 @@ const it = (e) => {
|
|
|
446
446
|
console.error("Error storing token:", t);
|
|
447
447
|
}
|
|
448
448
|
}, Wr = 300, ra = ({ addToCartPwa: e }) => {
|
|
449
|
-
var l,
|
|
449
|
+
var l, h, g, y, x, S;
|
|
450
450
|
const t = In(), r = Yt((_) => _.product.product), n = Yt((_) => _.store.store), [o, s] = C(!!r);
|
|
451
|
-
if (
|
|
451
|
+
if (be(() => {
|
|
452
452
|
s(!!r);
|
|
453
453
|
}, [r]), !r) return null;
|
|
454
454
|
const i = async () => {
|
|
455
|
-
var _, F, N, P, R, w,
|
|
455
|
+
var _, F, N, P, R, w, V, je, E, H, we, ae, Q, Pe, $e, pe;
|
|
456
456
|
try {
|
|
457
457
|
if (!((F = (_ = r == null ? void 0 : r.variants) == null ? void 0 : _[0]) != null && F.product_id) && !(r.type.item || r.type.bundle) && !((P = (N = r == null ? void 0 : r.variants) == null ? void 0 : N[0]) != null && P.productId)) {
|
|
458
458
|
Me.error("Variants not available", {
|
|
@@ -468,33 +468,33 @@ const it = (e) => {
|
|
|
468
468
|
}
|
|
469
469
|
], O = JSON.parse(
|
|
470
470
|
sessionStorage.getItem("customerData") || "{}"
|
|
471
|
-
),
|
|
472
|
-
if (!Xe || !Ye ||
|
|
473
|
-
let
|
|
474
|
-
if (
|
|
471
|
+
), q = (O == null ? void 0 : O.basketId) || localStorage.getItem(Kt), Xe = !1, Ye = localStorage.getItem(Et), ve = Date.now();
|
|
472
|
+
if (!Xe || !Ye || ve >= parseInt(Ye)) {
|
|
473
|
+
let _e = "";
|
|
474
|
+
if (_e = "Bearer " + (await vt()).access_token, !_e) {
|
|
475
475
|
console.error("Failed to get customer_token");
|
|
476
476
|
return;
|
|
477
477
|
}
|
|
478
|
-
const ft =
|
|
479
|
-
if (Wt(
|
|
480
|
-
const
|
|
481
|
-
basketId:
|
|
482
|
-
customer_token:
|
|
478
|
+
const ft = ve + 300 * 1e3;
|
|
479
|
+
if (Wt(_e), localStorage.setItem(Et, ft.toString()), q) {
|
|
480
|
+
const Te = await Dn({
|
|
481
|
+
basketId: q,
|
|
482
|
+
customer_token: _e
|
|
483
483
|
});
|
|
484
|
-
if (
|
|
485
|
-
const
|
|
486
|
-
|
|
484
|
+
if (Te.status === 200 && Te) {
|
|
485
|
+
const Ie = await fr(
|
|
486
|
+
q,
|
|
487
487
|
L,
|
|
488
|
-
|
|
488
|
+
_e
|
|
489
489
|
);
|
|
490
|
-
(((
|
|
490
|
+
(((V = Ie == null ? void 0 : Ie.product_items) == null ? void 0 : V.length) > 0 || ((je = Ie == null ? void 0 : Ie.productItems) == null ? void 0 : je.length) > 0) && (Me.success("Added to cart", {
|
|
491
491
|
position: "bottom-right",
|
|
492
492
|
autoClose: 3e3,
|
|
493
493
|
hideProgressBar: !1,
|
|
494
494
|
closeOnClick: !0,
|
|
495
495
|
pauseOnHover: !0,
|
|
496
496
|
draggable: !0
|
|
497
|
-
}), Jt(
|
|
497
|
+
}), Jt(q));
|
|
498
498
|
return;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
@@ -505,7 +505,7 @@ const it = (e) => {
|
|
|
505
505
|
quantity: 1
|
|
506
506
|
}
|
|
507
507
|
]
|
|
508
|
-
}, M = await $n(
|
|
508
|
+
}, M = await $n(_e, Ze);
|
|
509
509
|
if (!(M != null && M.basket_id) && !(M != null && M.basketId)) {
|
|
510
510
|
console.error("Failed to create basket");
|
|
511
511
|
return;
|
|
@@ -513,12 +513,12 @@ const it = (e) => {
|
|
|
513
513
|
it(
|
|
514
514
|
(M == null ? void 0 : M.basket_id) || (M == null ? void 0 : M.basketId)
|
|
515
515
|
), console.log("adding product to basket");
|
|
516
|
-
const
|
|
516
|
+
const le = await fr(
|
|
517
517
|
(M == null ? void 0 : M.basket_id) || (M == null ? void 0 : M.basketId),
|
|
518
518
|
L,
|
|
519
|
-
|
|
519
|
+
_e
|
|
520
520
|
);
|
|
521
|
-
console.log("object added to basket"), (((
|
|
521
|
+
console.log("object added to basket"), (((we = le == null ? void 0 : le.product_items) == null ? void 0 : we.length) > 0 || ((ae = le == null ? void 0 : le.productItems) == null ? void 0 : ae.length) > 0) && Me.success("Added to cart", {
|
|
522
522
|
position: "bottom-right",
|
|
523
523
|
autoClose: 3e3,
|
|
524
524
|
hideProgressBar: !1,
|
|
@@ -531,18 +531,18 @@ const it = (e) => {
|
|
|
531
531
|
console.error("Error adding to cart:", L), Me.error("Failed to add product to cart", {
|
|
532
532
|
position: "bottom-right",
|
|
533
533
|
autoClose: 3e3
|
|
534
|
-
}), ((
|
|
535
|
-
((
|
|
534
|
+
}), ((Q = L == null ? void 0 : L.response) == null ? void 0 : Q.status) === 404 || // Basket not found
|
|
535
|
+
((Pe = L == null ? void 0 : L.response) == null ? void 0 : Pe.status) === 401 ? ((($e = L == null ? void 0 : L.response) == null ? void 0 : $e.status) === 404 && it(null), ((pe = L == null ? void 0 : L.response) == null ? void 0 : pe.status) === 401 && (it(null), Wt(null))) : (console.error("Failed to add product to basket:", L.message), Me.error("Failed to add product to cart", {
|
|
536
536
|
position: "bottom-right",
|
|
537
537
|
autoClose: 3e3
|
|
538
538
|
}));
|
|
539
539
|
}
|
|
540
|
-
},
|
|
540
|
+
}, c = () => {
|
|
541
541
|
if (!r) return;
|
|
542
542
|
const _ = window.location.origin + "/product/" + r.id;
|
|
543
543
|
console.log("path", _), window.location.href = _;
|
|
544
544
|
};
|
|
545
|
-
return console.log(r, "the prod"), /* @__PURE__ */
|
|
545
|
+
return console.log(r, "the prod"), /* @__PURE__ */ d(xe, { children: [
|
|
546
546
|
/* @__PURE__ */ a(
|
|
547
547
|
"div",
|
|
548
548
|
{
|
|
@@ -552,7 +552,7 @@ const it = (e) => {
|
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
),
|
|
555
|
-
/* @__PURE__ */
|
|
555
|
+
/* @__PURE__ */ d(
|
|
556
556
|
"div",
|
|
557
557
|
{
|
|
558
558
|
className: `
|
|
@@ -563,7 +563,7 @@ const it = (e) => {
|
|
|
563
563
|
style: { willChange: "transform, opacity" },
|
|
564
564
|
onClick: (_) => _.stopPropagation(),
|
|
565
565
|
children: [
|
|
566
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ d("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
567
567
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: r.name }) }),
|
|
568
568
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
569
569
|
"div",
|
|
@@ -579,11 +579,11 @@ const it = (e) => {
|
|
|
579
579
|
}
|
|
580
580
|
) })
|
|
581
581
|
] }),
|
|
582
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ d("div", { className: "flex flex-row gap-2 items-center flex-wrap", children: [
|
|
583
583
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
|
|
584
584
|
"img",
|
|
585
585
|
{
|
|
586
|
-
src: (y = (
|
|
586
|
+
src: (y = (g = (h = (l = r.imageGroups) == null ? void 0 : l[0]) == null ? void 0 : h.images) == null ? void 0 : g[0]) == null ? void 0 : y.link,
|
|
587
587
|
alt: r.name,
|
|
588
588
|
className: "rounded-[10px]"
|
|
589
589
|
}
|
|
@@ -600,15 +600,15 @@ const it = (e) => {
|
|
|
600
600
|
))
|
|
601
601
|
) })
|
|
602
602
|
] }),
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
/* @__PURE__ */
|
|
605
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ d("div", { className: "flex flex-row items-center justify-between w-full", children: [
|
|
604
|
+
/* @__PURE__ */ d("div", { className: "flex flex-row items-center gap-2", children: [
|
|
605
|
+
/* @__PURE__ */ d("p", { className: "text-[#14121F] font-bold font-nunitoSans", children: [
|
|
606
606
|
" ",
|
|
607
607
|
"$",
|
|
608
608
|
r.price.toFixed(2)
|
|
609
609
|
] }),
|
|
610
610
|
" ",
|
|
611
|
-
/* @__PURE__ */
|
|
611
|
+
/* @__PURE__ */ d("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans", children: [
|
|
612
612
|
" ",
|
|
613
613
|
"$",
|
|
614
614
|
(r.price + 5).toFixed(2)
|
|
@@ -617,7 +617,7 @@ const it = (e) => {
|
|
|
617
617
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: r.discount }) })
|
|
618
618
|
] }),
|
|
619
619
|
/* @__PURE__ */ a("div", { className: "mt-2 w-full border-t-2 border-gray-200" }),
|
|
620
|
-
/* @__PURE__ */
|
|
620
|
+
/* @__PURE__ */ d("div", { className: "w-full text-left", children: [
|
|
621
621
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-bold font-nunitoSans mt-3 text-[14px]", children: "Product Details" }),
|
|
622
622
|
/* @__PURE__ */ a(
|
|
623
623
|
"div",
|
|
@@ -629,16 +629,16 @@ const it = (e) => {
|
|
|
629
629
|
}
|
|
630
630
|
)
|
|
631
631
|
] }),
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */ a("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */
|
|
634
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ d("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
633
|
+
/* @__PURE__ */ a("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
|
|
634
|
+
/* @__PURE__ */ d("div", { className: "text-[#323135] font-bold", children: [
|
|
635
635
|
((x = r == null ? void 0 : r.rating) == null ? void 0 : x.rate) || 0,
|
|
636
636
|
" /",
|
|
637
637
|
" ",
|
|
638
638
|
/* @__PURE__ */ a("span", { className: "text-[#68656E]", children: "5" })
|
|
639
639
|
] }),
|
|
640
640
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
641
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ d("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
642
642
|
((S = r == null ? void 0 : r.rating) == null ? void 0 : S.count) || 0,
|
|
643
643
|
" ratings"
|
|
644
644
|
] })
|
|
@@ -659,7 +659,7 @@ const it = (e) => {
|
|
|
659
659
|
);
|
|
660
660
|
}) })
|
|
661
661
|
] }),
|
|
662
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ d(
|
|
663
663
|
"div",
|
|
664
664
|
{
|
|
665
665
|
className: "flex flex-col items-center justify-between font-nunitoSans font-semibold w-5/6 text-black gap-2",
|
|
@@ -679,7 +679,7 @@ const it = (e) => {
|
|
|
679
679
|
{
|
|
680
680
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
|
|
681
681
|
style: { backgroundColor: n.tanyaThemeColor },
|
|
682
|
-
onClick:
|
|
682
|
+
onClick: c,
|
|
683
683
|
children: "View more"
|
|
684
684
|
}
|
|
685
685
|
)
|
|
@@ -709,15 +709,15 @@ const it = (e) => {
|
|
|
709
709
|
"Niece/Nephew": "his/her niece/nephew",
|
|
710
710
|
"My Friends": "his/her friends",
|
|
711
711
|
Others: "others"
|
|
712
|
-
}, s = Re(null), i = Re(null),
|
|
712
|
+
}, s = Re(null), i = Re(null), c = Re(null), l = Re(null), [h, g] = C(null);
|
|
713
713
|
Re(null);
|
|
714
|
-
const [y, x] = C(!1), [S, _] = C(!1), [F, N] = C(!1), [P, R] = C(!1), [w,
|
|
714
|
+
const [y, x] = C(!1), [S, _] = C(!1), [F, N] = C(!1), [P, R] = C(!1), [w, V] = C(!1), [je, E] = C(!1), [H, we] = C(""), [ae, Q] = C(""), Pe = (m) => ({
|
|
715
715
|
id: m.id,
|
|
716
716
|
title: m.name,
|
|
717
717
|
image: m.image ?? "",
|
|
718
718
|
price: m.price ?? 0
|
|
719
|
-
}), [
|
|
720
|
-
|
|
719
|
+
}), [$e, pe] = C([]), L = Re(null), O = Yt((m) => m.store.store), q = Yt((m) => m.product.product);
|
|
720
|
+
be(() => {
|
|
721
721
|
const m = localStorage.getItem(
|
|
722
722
|
`access_token_${e.siteId}`
|
|
723
723
|
), j = localStorage.getItem(
|
|
@@ -731,41 +731,41 @@ const it = (e) => {
|
|
|
731
731
|
`chat-token-${e.siteId}`,
|
|
732
732
|
m || ""
|
|
733
733
|
);
|
|
734
|
-
}, []),
|
|
735
|
-
localStorage.setItem("chatHistory", JSON.stringify(
|
|
734
|
+
}, []), be(() => {
|
|
735
|
+
localStorage.setItem("chatHistory", JSON.stringify($e));
|
|
736
736
|
const m = localStorage.getItem(
|
|
737
737
|
`access_token_${e.siteId}`
|
|
738
738
|
);
|
|
739
739
|
m && localStorage.setItem(`chat-token-${e.siteId}`, m);
|
|
740
|
-
}, [
|
|
740
|
+
}, [$e]);
|
|
741
741
|
const Xe = () => {
|
|
742
742
|
N(!0), setTimeout(() => _(!0), 10);
|
|
743
743
|
}, Ye = () => {
|
|
744
744
|
_(!1), setTimeout(() => N(!1), 300);
|
|
745
745
|
};
|
|
746
|
-
|
|
746
|
+
be(() => {
|
|
747
747
|
y ? Xe() : Ye();
|
|
748
748
|
}, [y]);
|
|
749
|
-
const
|
|
750
|
-
|
|
749
|
+
const ve = (m) => {
|
|
750
|
+
Q(o[m]);
|
|
751
751
|
};
|
|
752
|
-
|
|
752
|
+
be(() => {
|
|
753
753
|
F && L.current && L.current.scrollTo({
|
|
754
754
|
top: L.current.scrollHeight,
|
|
755
755
|
behavior: "smooth"
|
|
756
756
|
});
|
|
757
|
-
}, [
|
|
758
|
-
const
|
|
757
|
+
}, [$e, F]);
|
|
758
|
+
const _e = null, ft = null, Ze = async () => {
|
|
759
759
|
const m = await vt();
|
|
760
|
-
m != null &&
|
|
760
|
+
m != null && g(m);
|
|
761
761
|
};
|
|
762
|
-
|
|
762
|
+
be(() => {
|
|
763
763
|
if (e != null && e.siteId) {
|
|
764
|
-
const { clientID: m, host: j, organizationID: $, shortCode:
|
|
765
|
-
sessionStorage.setItem("Host", j), sessionStorage.setItem("SiteId", z), sessionStorage.setItem("pubCfg", btoa(m)), sessionStorage.setItem("envRef",
|
|
764
|
+
const { clientID: m, host: j, organizationID: $, shortCode: Y, siteId: z } = e;
|
|
765
|
+
sessionStorage.setItem("Host", j), sessionStorage.setItem("SiteId", z), sessionStorage.setItem("pubCfg", btoa(m)), sessionStorage.setItem("envRef", Y), sessionStorage.setItem("orgRef", $);
|
|
766
766
|
}
|
|
767
767
|
Ze(), console.log("scapi environment v1");
|
|
768
|
-
}, []),
|
|
768
|
+
}, []), be(() => {
|
|
769
769
|
t && (console.log("setting the basket id", t), it(t));
|
|
770
770
|
}, [t]);
|
|
771
771
|
const M = async () => {
|
|
@@ -773,18 +773,18 @@ const it = (e) => {
|
|
|
773
773
|
sessionStorage.getItem("customerData") || "{}"
|
|
774
774
|
).customerId;
|
|
775
775
|
return (await Wo(m || "")).c_interests;
|
|
776
|
-
},
|
|
776
|
+
}, le = async (m, j) => {
|
|
777
777
|
console.log("in secondary flow", Lt);
|
|
778
778
|
const $ = await M();
|
|
779
779
|
if (console.log($, "interests of customer", Lt), !!$)
|
|
780
780
|
try {
|
|
781
781
|
pe(
|
|
782
|
-
(
|
|
783
|
-
(W,
|
|
782
|
+
(Z) => Z.map(
|
|
783
|
+
(W, Ne) => Ne === Z.length - 1 ? { ...W, secondaryLoading: !0 } : W
|
|
784
784
|
)
|
|
785
785
|
);
|
|
786
|
-
const
|
|
787
|
-
if (!
|
|
786
|
+
const Y = await ur(_e, ft);
|
|
787
|
+
if (!Y) throw new Error("Failed to fetch token");
|
|
788
788
|
const z = localStorage.getItem("customerNumber"), A = localStorage.getItem("isLoggedIn"), B = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
789
789
|
registered: String(A || !1),
|
|
790
790
|
userId: String(z || (/* @__PURE__ */ new Date()).getTime())
|
|
@@ -797,55 +797,55 @@ const it = (e) => {
|
|
|
797
797
|
productPoints: String(j || 0),
|
|
798
798
|
interests: $
|
|
799
799
|
}
|
|
800
|
-
}),
|
|
800
|
+
}), X = await fetch(B, {
|
|
801
801
|
signal: AbortSignal.timeout(3e4),
|
|
802
802
|
method: "POST",
|
|
803
803
|
headers: {
|
|
804
804
|
"Content-Type": "application/json",
|
|
805
|
-
Authorization: `Bearer ${
|
|
805
|
+
Authorization: `Bearer ${Y}`
|
|
806
806
|
},
|
|
807
807
|
body: D
|
|
808
808
|
});
|
|
809
|
-
if (!
|
|
810
|
-
const
|
|
811
|
-
let
|
|
809
|
+
if (!X.body) throw new Error("Readable stream not supported");
|
|
810
|
+
const ne = X.body.getReader(), ke = new TextDecoder();
|
|
811
|
+
let Se = "";
|
|
812
812
|
for (; ; ) {
|
|
813
|
-
const { done:
|
|
814
|
-
if (
|
|
815
|
-
|
|
816
|
-
const
|
|
813
|
+
const { done: Z, value: W } = await ne.read();
|
|
814
|
+
if (Z) break;
|
|
815
|
+
Se += ke.decode(W, { stream: !0 });
|
|
816
|
+
const Ne = Se.split(`
|
|
817
817
|
`);
|
|
818
|
-
|
|
819
|
-
for (const
|
|
820
|
-
if (
|
|
821
|
-
const k =
|
|
818
|
+
Se = Ne.pop() || "";
|
|
819
|
+
for (const ee of Ne)
|
|
820
|
+
if (ee.startsWith("data:")) {
|
|
821
|
+
const k = ee.slice(5).trim();
|
|
822
822
|
try {
|
|
823
|
-
const
|
|
824
|
-
|
|
823
|
+
const J = JSON.parse(k);
|
|
824
|
+
J.index === 0 && pe(
|
|
825
825
|
(G) => G.map(
|
|
826
|
-
(
|
|
827
|
-
...
|
|
828
|
-
secondaryResponse:
|
|
826
|
+
(de, Ce) => Ce === G.length - 1 ? {
|
|
827
|
+
...de,
|
|
828
|
+
secondaryResponse: J.data,
|
|
829
829
|
secondaryLoading: !1
|
|
830
|
-
} :
|
|
830
|
+
} : de
|
|
831
831
|
)
|
|
832
832
|
);
|
|
833
|
-
} catch (
|
|
833
|
+
} catch (J) {
|
|
834
834
|
pe(
|
|
835
835
|
(G) => G.map(
|
|
836
|
-
(
|
|
836
|
+
(de, Ce) => Ce === G.length - 1 ? { ...de, secondaryLoading: !1 } : de
|
|
837
837
|
)
|
|
838
|
-
), console.error("Secondary flow JSON parse error:",
|
|
838
|
+
), console.error("Secondary flow JSON parse error:", J);
|
|
839
839
|
}
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
} catch (
|
|
843
|
-
console.error("Secondary flow error:",
|
|
842
|
+
} catch (Y) {
|
|
843
|
+
console.error("Secondary flow error:", Y);
|
|
844
844
|
}
|
|
845
|
-
},
|
|
845
|
+
}, Te = async (m) => {
|
|
846
846
|
const j = m || H.trim();
|
|
847
847
|
if (j) {
|
|
848
|
-
|
|
848
|
+
V(!0), we(""), s.current = null, i.current = null, c.current = null, l.current = null, pe(($) => [
|
|
849
849
|
...$,
|
|
850
850
|
{
|
|
851
851
|
query: j,
|
|
@@ -856,12 +856,12 @@ const it = (e) => {
|
|
|
856
856
|
}
|
|
857
857
|
]);
|
|
858
858
|
try {
|
|
859
|
-
const $ =
|
|
859
|
+
const $ = ae, Y = localStorage.getItem("customerNumber"), z = localStorage.getItem("isLoggedIn"), A = await ur(_e, ft);
|
|
860
860
|
if (!A)
|
|
861
861
|
throw new Error("Failed to obtain access token");
|
|
862
862
|
const B = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
863
863
|
registered: String(z || !1),
|
|
864
|
-
userId: String(
|
|
864
|
+
userId: String(Y || (/* @__PURE__ */ new Date()).getTime())
|
|
865
865
|
}).toString()}`, D = JSON.stringify({
|
|
866
866
|
flowId: "MMHQKYI1NE",
|
|
867
867
|
flowAliasId: "SZF9ZK1ATE",
|
|
@@ -869,7 +869,7 @@ const it = (e) => {
|
|
|
869
869
|
userPrompt: j,
|
|
870
870
|
whom: $
|
|
871
871
|
}
|
|
872
|
-
}),
|
|
872
|
+
}), X = await fetch(B, {
|
|
873
873
|
signal: AbortSignal.timeout(3e4),
|
|
874
874
|
method: "POST",
|
|
875
875
|
headers: {
|
|
@@ -878,30 +878,30 @@ const it = (e) => {
|
|
|
878
878
|
},
|
|
879
879
|
body: D
|
|
880
880
|
});
|
|
881
|
-
if (!
|
|
882
|
-
throw new Error(`HTTP error! status: ${
|
|
883
|
-
if (!
|
|
884
|
-
const
|
|
885
|
-
let
|
|
881
|
+
if (!X.ok)
|
|
882
|
+
throw new Error(`HTTP error! status: ${X.status}`);
|
|
883
|
+
if (!X.body) throw new Error("Readable stream not supported");
|
|
884
|
+
const ne = X.body.getReader(), ke = new TextDecoder();
|
|
885
|
+
let Se = "", Z = "";
|
|
886
886
|
for (; ; ) {
|
|
887
887
|
E(!0);
|
|
888
|
-
const { done: W, value:
|
|
888
|
+
const { done: W, value: Ne } = await ne.read();
|
|
889
889
|
if (W) break;
|
|
890
|
-
|
|
891
|
-
const
|
|
890
|
+
Se += ke.decode(Ne, { stream: !0 });
|
|
891
|
+
const ee = Se.split(`
|
|
892
892
|
`);
|
|
893
|
-
|
|
894
|
-
for (const k of
|
|
893
|
+
Se = ee.pop() || "";
|
|
894
|
+
for (const k of ee)
|
|
895
895
|
if (k.startsWith("data:")) {
|
|
896
|
-
const
|
|
896
|
+
const J = k.slice(5).trim();
|
|
897
897
|
try {
|
|
898
|
-
const G = JSON.parse(
|
|
899
|
-
G.index == 1 && (
|
|
900
|
-
(
|
|
901
|
-
(
|
|
902
|
-
...
|
|
898
|
+
const G = JSON.parse(J);
|
|
899
|
+
G.index == 1 && (Z = G.data), pe(
|
|
900
|
+
(de) => de.map(
|
|
901
|
+
(Ce, et) => et === de.length - 1 ? {
|
|
902
|
+
...Ce,
|
|
903
903
|
[G.index == 0 ? "response" : G.index == 1 ? "keywords" : G.index == 2 ? "potentialQuestions" : "end"]: G.data
|
|
904
|
-
} :
|
|
904
|
+
} : Ce
|
|
905
905
|
)
|
|
906
906
|
);
|
|
907
907
|
} catch (G) {
|
|
@@ -909,56 +909,56 @@ const it = (e) => {
|
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
|
-
Zt(
|
|
912
|
+
Zt(Ie(Z));
|
|
913
913
|
} catch ($) {
|
|
914
914
|
console.error("Error sending message to Tanya:", $);
|
|
915
915
|
} finally {
|
|
916
|
-
|
|
916
|
+
V(!1);
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
|
-
},
|
|
919
|
+
}, Ie = (m) => {
|
|
920
920
|
const j = m.match(
|
|
921
921
|
/top five relevant product or category names are: (.*)/i
|
|
922
|
-
), z = (j ? j[1] : m).split(", ").map((
|
|
922
|
+
), z = (j ? j[1] : m).split(", ").map((ce) => ce.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
923
923
|
return [...new Set(z)].filter(Boolean).join(",");
|
|
924
924
|
}, Zt = async (m) => {
|
|
925
|
-
var $,
|
|
925
|
+
var $, Y, z;
|
|
926
926
|
const j = typeof m == "string" ? m.split(",") : m;
|
|
927
927
|
E(!0);
|
|
928
928
|
try {
|
|
929
929
|
const A = await Promise.all(
|
|
930
930
|
j.map((D) => Ko(D).catch(() => []))
|
|
931
931
|
// prevent Promise.all crash
|
|
932
|
-
),
|
|
932
|
+
), ce = j.map((D, X) => ({
|
|
933
933
|
keyword: D,
|
|
934
|
-
items: A[
|
|
934
|
+
items: A[X] ?? [],
|
|
935
935
|
loading: !1
|
|
936
|
-
})).filter((D) => D.items.length > 0), B = (
|
|
936
|
+
})).filter((D) => D.items.length > 0), B = (Y = ($ = ce[0]) == null ? void 0 : $.items) == null ? void 0 : Y[0];
|
|
937
937
|
if (B) {
|
|
938
|
-
i.current = B.product_id, s.current = B.product_name,
|
|
938
|
+
i.current = B.product_id, s.current = B.product_name, c.current = (z = B.image) == null ? void 0 : z.link;
|
|
939
939
|
const D = typeof B.price == "number" ? B.price : null;
|
|
940
940
|
l.current = D;
|
|
941
941
|
}
|
|
942
942
|
if (pe(
|
|
943
943
|
(D) => D.map(
|
|
944
|
-
(
|
|
945
|
-
...
|
|
946
|
-
products:
|
|
944
|
+
(X, ne) => ne === D.length - 1 ? {
|
|
945
|
+
...X,
|
|
946
|
+
products: ce,
|
|
947
947
|
productSnapshot: B ? {
|
|
948
948
|
id: i.current,
|
|
949
949
|
name: s.current,
|
|
950
|
-
image:
|
|
950
|
+
image: c.current,
|
|
951
951
|
price: l.current,
|
|
952
952
|
points: 0,
|
|
953
953
|
quantity: 1
|
|
954
|
-
} :
|
|
955
|
-
} :
|
|
954
|
+
} : X.productSnapshot
|
|
955
|
+
} : X
|
|
956
956
|
)
|
|
957
957
|
), B) {
|
|
958
958
|
const D = JSON.parse(
|
|
959
959
|
sessionStorage.getItem("customerData") || "{}"
|
|
960
960
|
);
|
|
961
|
-
D != null && D.isGuest || (console.log("running secondary flow", Lt),
|
|
961
|
+
D != null && D.isGuest || (console.log("running secondary flow", Lt), le(s.current, 0));
|
|
962
962
|
}
|
|
963
963
|
} catch (A) {
|
|
964
964
|
console.error("error in keyword search", A);
|
|
@@ -966,46 +966,46 @@ const it = (e) => {
|
|
|
966
966
|
E(!1);
|
|
967
967
|
}
|
|
968
968
|
}, er = async (m, j) => {
|
|
969
|
-
var $,
|
|
969
|
+
var $, Y, z, A, ce, B, D, X, ne, ke, Se, Z, W, Ne, ee;
|
|
970
970
|
R(!0);
|
|
971
971
|
try {
|
|
972
972
|
const k = await jn(m.id);
|
|
973
|
-
if (!((
|
|
973
|
+
if (!((Y = ($ = k == null ? void 0 : k.variants) == null ? void 0 : $[0]) != null && Y.product_id || (A = (z = k == null ? void 0 : k.variants) == null ? void 0 : z[0]) != null && A.productId) && !(k.type.item || k.type.bundle)) {
|
|
974
974
|
R(!1), Me.error("Variants not found", {
|
|
975
975
|
position: "bottom-right",
|
|
976
976
|
autoClose: 1e3
|
|
977
977
|
}), console.error("No product variant found");
|
|
978
978
|
return;
|
|
979
979
|
}
|
|
980
|
-
const
|
|
980
|
+
const J = [
|
|
981
981
|
{
|
|
982
|
-
product_id: ((
|
|
982
|
+
product_id: ((ce = k.variants) == null ? void 0 : ce[0].product_id) || ((B = k.variants) == null ? void 0 : B[0].productId) || (k == null ? void 0 : k.id),
|
|
983
983
|
quantity: j
|
|
984
984
|
}
|
|
985
985
|
];
|
|
986
|
-
console.log(
|
|
986
|
+
console.log(J, "product data", "app version", Lt);
|
|
987
987
|
const G = JSON.parse(
|
|
988
988
|
sessionStorage.getItem("customerData") || "{}"
|
|
989
|
-
),
|
|
990
|
-
if (!
|
|
989
|
+
), de = (G == null ? void 0 : G.basketId) || localStorage.getItem(Kt), Ce = !1, et = localStorage.getItem(Et), mt = Date.now();
|
|
990
|
+
if (!Ce || !et || mt >= parseInt(et)) {
|
|
991
991
|
const At = await On();
|
|
992
992
|
let { customer_token: Be } = await An(
|
|
993
993
|
At
|
|
994
994
|
);
|
|
995
|
-
if (Be = "Bearer " +
|
|
995
|
+
if (Be = "Bearer " + h.access_token, !Be) {
|
|
996
996
|
console.error("Failed to get customer_token");
|
|
997
997
|
return;
|
|
998
998
|
}
|
|
999
999
|
const jt = mt + 300 * 1e3;
|
|
1000
|
-
if (Wt(Be), localStorage.setItem(Et, jt.toString()), console.log(
|
|
1000
|
+
if (Wt(Be), localStorage.setItem(Et, jt.toString()), console.log(de, "basketIdFromCustomer"), de) {
|
|
1001
1001
|
const tt = await Dn({
|
|
1002
|
-
basketId:
|
|
1002
|
+
basketId: de,
|
|
1003
1003
|
customer_token: Be
|
|
1004
1004
|
});
|
|
1005
1005
|
if (tt.status === 200 && tt) {
|
|
1006
1006
|
const kt = await fr(
|
|
1007
|
-
|
|
1008
|
-
|
|
1007
|
+
de,
|
|
1008
|
+
J,
|
|
1009
1009
|
Be
|
|
1010
1010
|
);
|
|
1011
1011
|
((D = kt == null ? void 0 : kt.product_items) == null ? void 0 : D.length) > 0 && (Me.success("Added to cart", {
|
|
@@ -1015,18 +1015,18 @@ const it = (e) => {
|
|
|
1015
1015
|
closeOnClick: !0,
|
|
1016
1016
|
pauseOnHover: !0,
|
|
1017
1017
|
draggable: !0
|
|
1018
|
-
}), Jt(
|
|
1018
|
+
}), Jt(de), R(!1));
|
|
1019
1019
|
return;
|
|
1020
1020
|
}
|
|
1021
1021
|
}
|
|
1022
|
-
const
|
|
1022
|
+
const pt = {
|
|
1023
1023
|
productItems: [
|
|
1024
1024
|
{
|
|
1025
|
-
productId: ((
|
|
1025
|
+
productId: ((X = k.variants) == null ? void 0 : X[0].product_id) || ((ne = k.variants) == null ? void 0 : ne[0].productId) || (k == null ? void 0 : k.id),
|
|
1026
1026
|
quantity: 1
|
|
1027
1027
|
}
|
|
1028
1028
|
]
|
|
1029
|
-
}, I = await $n(Be,
|
|
1029
|
+
}, I = await $n(Be, pt);
|
|
1030
1030
|
if (console.log(
|
|
1031
1031
|
I,
|
|
1032
1032
|
I == null ? void 0 : I.basket_id,
|
|
@@ -1039,14 +1039,14 @@ const it = (e) => {
|
|
|
1039
1039
|
it(
|
|
1040
1040
|
(I == null ? void 0 : I.basket_id) || (I == null ? void 0 : I.basketId)
|
|
1041
1041
|
);
|
|
1042
|
-
const
|
|
1042
|
+
const De = await r(
|
|
1043
1043
|
{
|
|
1044
1044
|
productId: i,
|
|
1045
1045
|
quantity: j
|
|
1046
1046
|
},
|
|
1047
1047
|
(I == null ? void 0 : I.basket_id) || (I == null ? void 0 : I.basketId)
|
|
1048
1048
|
);
|
|
1049
|
-
(((
|
|
1049
|
+
(((ke = De == null ? void 0 : De.product_items) == null ? void 0 : ke.length) > 0 || ((Se = De == null ? void 0 : De.productItems) == null ? void 0 : Se.length) > 0) && Me.success("Added to cart", {
|
|
1050
1050
|
position: "bottom-right",
|
|
1051
1051
|
autoClose: 3e3,
|
|
1052
1052
|
hideProgressBar: !1,
|
|
@@ -1059,17 +1059,17 @@ const it = (e) => {
|
|
|
1059
1059
|
R(!1), console.error("Error adding to cart:", k), Me.error("Failed to add product to cart", {
|
|
1060
1060
|
position: "bottom-right",
|
|
1061
1061
|
autoClose: 3e3
|
|
1062
|
-
}), ((
|
|
1063
|
-
((W = k == null ? void 0 : k.response) == null ? void 0 : W.status) === 401 ? (((
|
|
1062
|
+
}), ((Z = k == null ? void 0 : k.response) == null ? void 0 : Z.status) === 404 || // Basket not found
|
|
1063
|
+
((W = k == null ? void 0 : k.response) == null ? void 0 : W.status) === 401 ? (((Ne = k == null ? void 0 : k.response) == null ? void 0 : Ne.status) === 404 && it(null), ((ee = k == null ? void 0 : k.response) == null ? void 0 : ee.status) === 401 && (it(null), Wt(null))) : (console.error("Failed to add product to basket:", k.message), Me.error("Failed to add product to cart", {
|
|
1064
1064
|
position: "bottom-right",
|
|
1065
1065
|
autoClose: 3e3
|
|
1066
1066
|
}));
|
|
1067
1067
|
}
|
|
1068
1068
|
R(!1);
|
|
1069
1069
|
};
|
|
1070
|
-
return
|
|
1070
|
+
return be(() => {
|
|
1071
1071
|
F ? setTimeout(() => _(!0), 10) : _(!1);
|
|
1072
|
-
}, [F]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */
|
|
1072
|
+
}, [F]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ d(Yo, { open: y, onOpenChange: x, children: [
|
|
1073
1073
|
/* @__PURE__ */ a(
|
|
1074
1074
|
Jo,
|
|
1075
1075
|
{
|
|
@@ -1078,7 +1078,7 @@ const it = (e) => {
|
|
|
1078
1078
|
// background: storeDetails.tanyaThemeColor,
|
|
1079
1079
|
},
|
|
1080
1080
|
className: "flex items-center rounded-lg cursor-pointer hover:opacity-90 transition-opacity p-0",
|
|
1081
|
-
children: /* @__PURE__ */ a("div", { className: "flex flex-col", children: /* @__PURE__ */
|
|
1081
|
+
children: /* @__PURE__ */ a("div", { className: "flex flex-col", children: /* @__PURE__ */ d(
|
|
1082
1082
|
"svg",
|
|
1083
1083
|
{
|
|
1084
1084
|
width: "40",
|
|
@@ -1087,7 +1087,7 @@ const it = (e) => {
|
|
|
1087
1087
|
fill: "none",
|
|
1088
1088
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1089
1089
|
children: [
|
|
1090
|
-
/* @__PURE__ */
|
|
1090
|
+
/* @__PURE__ */ d("g", { clipPath: "url(#clip0_958_585)", children: [
|
|
1091
1091
|
/* @__PURE__ */ a(
|
|
1092
1092
|
"path",
|
|
1093
1093
|
{
|
|
@@ -1110,8 +1110,8 @@ const it = (e) => {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
)
|
|
1112
1112
|
] }),
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ d("defs", { children: [
|
|
1114
|
+
/* @__PURE__ */ d(
|
|
1115
1115
|
"linearGradient",
|
|
1116
1116
|
{
|
|
1117
1117
|
id: "paint0_linear_958_585",
|
|
@@ -1133,7 +1133,7 @@ const it = (e) => {
|
|
|
1133
1133
|
) })
|
|
1134
1134
|
}
|
|
1135
1135
|
),
|
|
1136
|
-
F && /* @__PURE__ */
|
|
1136
|
+
F && /* @__PURE__ */ d(xe, { children: [
|
|
1137
1137
|
/* @__PURE__ */ a(
|
|
1138
1138
|
"div",
|
|
1139
1139
|
{
|
|
@@ -1141,7 +1141,7 @@ const it = (e) => {
|
|
|
1141
1141
|
onClick: () => x(!1)
|
|
1142
1142
|
}
|
|
1143
1143
|
),
|
|
1144
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ d(
|
|
1145
1145
|
"div",
|
|
1146
1146
|
{
|
|
1147
1147
|
className: `
|
|
@@ -1155,7 +1155,7 @@ const it = (e) => {
|
|
|
1155
1155
|
background: "linear-gradient(170.1deg, #FFFFFF 60.03%, #E3DEEF 99.59%)"
|
|
1156
1156
|
},
|
|
1157
1157
|
children: [
|
|
1158
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ d(
|
|
1159
1159
|
"div",
|
|
1160
1160
|
{
|
|
1161
1161
|
className: "flex justify-between p-3 bg-[#FFFFFF] border border-b-1 border-[#E5E5E5] ",
|
|
@@ -1168,8 +1168,8 @@ const it = (e) => {
|
|
|
1168
1168
|
alignItems: "center",
|
|
1169
1169
|
gap: "0.5rem"
|
|
1170
1170
|
},
|
|
1171
|
-
children: /* @__PURE__ */
|
|
1172
|
-
/* @__PURE__ */
|
|
1171
|
+
children: /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
|
|
1172
|
+
/* @__PURE__ */ d(
|
|
1173
1173
|
"div",
|
|
1174
1174
|
{
|
|
1175
1175
|
className: "flex gap-2 w-28 h-12 text-center items-center p-2 border rounded-l-[20px] rounded-tr-[20px]",
|
|
@@ -1177,7 +1177,7 @@ const it = (e) => {
|
|
|
1177
1177
|
background: "linear-gradient(265.62deg, #6851C6 5.24%, #8668FF 98.49%)"
|
|
1178
1178
|
},
|
|
1179
1179
|
children: [
|
|
1180
|
-
/* @__PURE__ */
|
|
1180
|
+
/* @__PURE__ */ d(
|
|
1181
1181
|
"svg",
|
|
1182
1182
|
{
|
|
1183
1183
|
width: "20",
|
|
@@ -1201,7 +1201,7 @@ const it = (e) => {
|
|
|
1201
1201
|
]
|
|
1202
1202
|
}
|
|
1203
1203
|
),
|
|
1204
|
-
/* @__PURE__ */
|
|
1204
|
+
/* @__PURE__ */ d(
|
|
1205
1205
|
"p",
|
|
1206
1206
|
{
|
|
1207
1207
|
className: "text-[#5B5B5B] font-nunitoSans font-semibold",
|
|
@@ -1225,7 +1225,7 @@ const it = (e) => {
|
|
|
1225
1225
|
gap: "1.25rem",
|
|
1226
1226
|
margin: "0.75rem"
|
|
1227
1227
|
},
|
|
1228
|
-
children: /* @__PURE__ */ a("button", { onClick: () => x(!1), children: /* @__PURE__ */
|
|
1228
|
+
children: /* @__PURE__ */ a("button", { onClick: () => x(!1), children: /* @__PURE__ */ d(
|
|
1229
1229
|
"svg",
|
|
1230
1230
|
{
|
|
1231
1231
|
width: "24",
|
|
@@ -1234,7 +1234,7 @@ const it = (e) => {
|
|
|
1234
1234
|
fill: "none",
|
|
1235
1235
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1236
1236
|
children: [
|
|
1237
|
-
/* @__PURE__ */
|
|
1237
|
+
/* @__PURE__ */ d("g", { clipPath: "url(#clip0_501_6036)", children: [
|
|
1238
1238
|
/* @__PURE__ */ a(
|
|
1239
1239
|
"path",
|
|
1240
1240
|
{
|
|
@@ -1273,19 +1273,19 @@ const it = (e) => {
|
|
|
1273
1273
|
]
|
|
1274
1274
|
}
|
|
1275
1275
|
),
|
|
1276
|
-
/* @__PURE__ */
|
|
1277
|
-
/* @__PURE__ */
|
|
1276
|
+
/* @__PURE__ */ d("div", { className: "flex h-full md:flex-row lg:flex-row", children: [
|
|
1277
|
+
/* @__PURE__ */ d(
|
|
1278
1278
|
"div",
|
|
1279
1279
|
{
|
|
1280
|
-
className: `flex flex-col h-full ${
|
|
1280
|
+
className: `flex flex-col h-full ${q ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1281
1281
|
children: [
|
|
1282
|
-
/* @__PURE__ */
|
|
1282
|
+
/* @__PURE__ */ d(
|
|
1283
1283
|
"div",
|
|
1284
1284
|
{
|
|
1285
1285
|
ref: L,
|
|
1286
1286
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
1287
1287
|
children: [
|
|
1288
|
-
(O == null ? void 0 : O.whomRequired) && /* @__PURE__ */
|
|
1288
|
+
(O == null ? void 0 : O.whomRequired) && /* @__PURE__ */ d(
|
|
1289
1289
|
"div",
|
|
1290
1290
|
{
|
|
1291
1291
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
@@ -1294,11 +1294,11 @@ const it = (e) => {
|
|
|
1294
1294
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: n.map((m) => /* @__PURE__ */ a(
|
|
1295
1295
|
"button",
|
|
1296
1296
|
{
|
|
1297
|
-
onClick: () =>
|
|
1297
|
+
onClick: () => ve(m),
|
|
1298
1298
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1299
1299
|
style: {
|
|
1300
|
-
backgroundColor:
|
|
1301
|
-
borderColor:
|
|
1300
|
+
backgroundColor: ae === o[m] ? "#FFFFFF" : "#F3F3F3",
|
|
1301
|
+
borderColor: ae === o[m] ? "#BBB3DD" : ""
|
|
1302
1302
|
},
|
|
1303
1303
|
children: m
|
|
1304
1304
|
},
|
|
@@ -1307,9 +1307,9 @@ const it = (e) => {
|
|
|
1307
1307
|
]
|
|
1308
1308
|
}
|
|
1309
1309
|
),
|
|
1310
|
-
|
|
1311
|
-
var $,
|
|
1312
|
-
return /* @__PURE__ */
|
|
1310
|
+
$e.map((m, j) => {
|
|
1311
|
+
var $, Y;
|
|
1312
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
1313
1313
|
/* @__PURE__ */ a(
|
|
1314
1314
|
"div",
|
|
1315
1315
|
{
|
|
@@ -1334,15 +1334,15 @@ const it = (e) => {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
1336
|
) }),
|
|
1337
|
-
|
|
1338
|
-
(m == null ? void 0 : m.products) && ((
|
|
1337
|
+
je && !m.response.includes("Thinking") && (($ = m.products) == null ? void 0 : $.length) == 0 && /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: "Finding best products for you" }) }),
|
|
1338
|
+
(m == null ? void 0 : m.products) && ((Y = m == null ? void 0 : m.products) == null ? void 0 : Y.length) > 0 && /* @__PURE__ */ a(
|
|
1339
1339
|
ea,
|
|
1340
1340
|
{
|
|
1341
1341
|
chat: m.products,
|
|
1342
1342
|
storeDetails: O
|
|
1343
1343
|
}
|
|
1344
1344
|
),
|
|
1345
|
-
(m == null ? void 0 : m.potentialQuestions.length) > 0 && /* @__PURE__ */
|
|
1345
|
+
(m == null ? void 0 : m.potentialQuestions.length) > 0 && /* @__PURE__ */ d("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
1346
1346
|
/* @__PURE__ */ a(
|
|
1347
1347
|
"p",
|
|
1348
1348
|
{
|
|
@@ -1355,7 +1355,7 @@ const it = (e) => {
|
|
|
1355
1355
|
"button",
|
|
1356
1356
|
{
|
|
1357
1357
|
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${O.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
1358
|
-
onClick: () =>
|
|
1358
|
+
onClick: () => Te(z),
|
|
1359
1359
|
style: {
|
|
1360
1360
|
backgroundColor: O.tanyaThemeColorLight
|
|
1361
1361
|
},
|
|
@@ -1364,7 +1364,7 @@ const it = (e) => {
|
|
|
1364
1364
|
A
|
|
1365
1365
|
))
|
|
1366
1366
|
] }),
|
|
1367
|
-
(m == null ? void 0 : m.secondaryLoading) && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */
|
|
1367
|
+
(m == null ? void 0 : m.secondaryLoading) && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ d(
|
|
1368
1368
|
"div",
|
|
1369
1369
|
{
|
|
1370
1370
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -1372,7 +1372,7 @@ const it = (e) => {
|
|
|
1372
1372
|
margin: "0.75rem"
|
|
1373
1373
|
},
|
|
1374
1374
|
children: [
|
|
1375
|
-
/* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ d("div", { className: "flex gap-1", children: [
|
|
1376
1376
|
/* @__PURE__ */ a("div", { className: "tanya-sparkle tanya-sparkle-1", children: "✨" }),
|
|
1377
1377
|
/* @__PURE__ */ a("div", { className: "tanya-sparkle tanya-sparkle-2", children: "✨" }),
|
|
1378
1378
|
/* @__PURE__ */ a("div", { className: "tanya-sparkle tanya-sparkle-3", children: "✨" })
|
|
@@ -1397,7 +1397,7 @@ const it = (e) => {
|
|
|
1397
1397
|
]
|
|
1398
1398
|
}
|
|
1399
1399
|
) }),
|
|
1400
|
-
(m == null ? void 0 : m.secondaryResponse) && /* @__PURE__ */ a(
|
|
1400
|
+
(m == null ? void 0 : m.secondaryResponse) && /* @__PURE__ */ a(xe, { children: /* @__PURE__ */ d("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
1401
1401
|
/* @__PURE__ */ a(
|
|
1402
1402
|
"div",
|
|
1403
1403
|
{
|
|
@@ -1413,7 +1413,7 @@ const it = (e) => {
|
|
|
1413
1413
|
}
|
|
1414
1414
|
),
|
|
1415
1415
|
m.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
1416
|
-
/* @__PURE__ */ a("div", { className: "mt-4 w-full", children: /* @__PURE__ */
|
|
1416
|
+
/* @__PURE__ */ a("div", { className: "mt-4 w-full", children: /* @__PURE__ */ d(
|
|
1417
1417
|
"div",
|
|
1418
1418
|
{
|
|
1419
1419
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
@@ -1440,8 +1440,8 @@ const it = (e) => {
|
|
|
1440
1440
|
) : /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
1441
1441
|
}
|
|
1442
1442
|
),
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */
|
|
1443
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
1444
|
+
/* @__PURE__ */ d("div", { children: [
|
|
1445
1445
|
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: m.productSnapshot.name }),
|
|
1446
1446
|
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: m.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1447
1447
|
style: "currency",
|
|
@@ -1449,25 +1449,25 @@ const it = (e) => {
|
|
|
1449
1449
|
}).format(
|
|
1450
1450
|
m.productSnapshot.price
|
|
1451
1451
|
) : "" }),
|
|
1452
|
-
m.productSnapshot.points > 0 && /* @__PURE__ */
|
|
1452
|
+
m.productSnapshot.points > 0 && /* @__PURE__ */ d("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
1453
1453
|
"You will earn",
|
|
1454
1454
|
" ",
|
|
1455
|
-
/* @__PURE__ */
|
|
1455
|
+
/* @__PURE__ */ d("strong", { children: [
|
|
1456
1456
|
m.productSnapshot.points,
|
|
1457
1457
|
" ",
|
|
1458
1458
|
"points"
|
|
1459
1459
|
] })
|
|
1460
1460
|
] })
|
|
1461
1461
|
] }),
|
|
1462
|
-
/* @__PURE__ */
|
|
1463
|
-
/* @__PURE__ */
|
|
1462
|
+
/* @__PURE__ */ d("div", { className: "mt-3 flex items-center gap-3", children: [
|
|
1463
|
+
/* @__PURE__ */ d("div", { className: "flex items-center border rounded-full overflow-hidden", children: [
|
|
1464
1464
|
/* @__PURE__ */ a(
|
|
1465
1465
|
"button",
|
|
1466
1466
|
{
|
|
1467
1467
|
className: "px-3 py-1 text-sm",
|
|
1468
1468
|
onClick: () => pe(
|
|
1469
1469
|
(z) => z.map(
|
|
1470
|
-
(A,
|
|
1470
|
+
(A, ce) => ce === j && A.productSnapshot ? {
|
|
1471
1471
|
...A,
|
|
1472
1472
|
productSnapshot: {
|
|
1473
1473
|
...A.productSnapshot,
|
|
@@ -1493,7 +1493,7 @@ const it = (e) => {
|
|
|
1493
1493
|
className: "px-3 py-1 text-sm",
|
|
1494
1494
|
onClick: () => pe(
|
|
1495
1495
|
(z) => z.map(
|
|
1496
|
-
(A,
|
|
1496
|
+
(A, ce) => ce === j && A.productSnapshot ? {
|
|
1497
1497
|
...A,
|
|
1498
1498
|
productSnapshot: {
|
|
1499
1499
|
...A.productSnapshot,
|
|
@@ -1515,7 +1515,7 @@ const it = (e) => {
|
|
|
1515
1515
|
{
|
|
1516
1516
|
onClick: () => {
|
|
1517
1517
|
er(
|
|
1518
|
-
|
|
1518
|
+
Pe(
|
|
1519
1519
|
m.productSnapshot
|
|
1520
1520
|
),
|
|
1521
1521
|
m.productSnapshot.quantity
|
|
@@ -1550,7 +1550,7 @@ const it = (e) => {
|
|
|
1550
1550
|
style: {
|
|
1551
1551
|
background: "linear-gradient(180deg, #B09FFF 0%, #8D79F6 100%)"
|
|
1552
1552
|
},
|
|
1553
|
-
children: /* @__PURE__ */
|
|
1553
|
+
children: /* @__PURE__ */ d("div", { className: "flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1", children: [
|
|
1554
1554
|
/* @__PURE__ */ a(
|
|
1555
1555
|
"input",
|
|
1556
1556
|
{
|
|
@@ -1558,9 +1558,9 @@ const it = (e) => {
|
|
|
1558
1558
|
placeholder: "How can I help you...",
|
|
1559
1559
|
value: H,
|
|
1560
1560
|
autoFocus: !0,
|
|
1561
|
-
onChange: (m) =>
|
|
1561
|
+
onChange: (m) => we(m.target.value),
|
|
1562
1562
|
onKeyDown: (m) => {
|
|
1563
|
-
m.key === "Enter" && !w &&
|
|
1563
|
+
m.key === "Enter" && !w && Te();
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
1566
|
),
|
|
@@ -1570,7 +1570,7 @@ const it = (e) => {
|
|
|
1570
1570
|
type: "submit",
|
|
1571
1571
|
disabled: w,
|
|
1572
1572
|
className: "p-3",
|
|
1573
|
-
onClick: () =>
|
|
1573
|
+
onClick: () => Te(),
|
|
1574
1574
|
children: w ? /* @__PURE__ */ a(
|
|
1575
1575
|
"div",
|
|
1576
1576
|
{
|
|
@@ -1683,7 +1683,7 @@ function wt(e) {
|
|
|
1683
1683
|
} catch {
|
|
1684
1684
|
}
|
|
1685
1685
|
}
|
|
1686
|
-
const
|
|
1686
|
+
const pr = wt(function() {
|
|
1687
1687
|
return globalThis;
|
|
1688
1688
|
}) || wt(function() {
|
|
1689
1689
|
return window;
|
|
@@ -1749,7 +1749,7 @@ function Un(e) {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
function kr(e, t) {
|
|
1751
1751
|
if (t === void 0 && (t = []), !!e)
|
|
1752
|
-
return
|
|
1752
|
+
return pr[Xr] && pr[Xr](e, t.map(Un));
|
|
1753
1753
|
}
|
|
1754
1754
|
function Sr(e, t) {
|
|
1755
1755
|
if (t === void 0 && (t = []), !!e)
|
|
@@ -1766,7 +1766,7 @@ function da(e) {
|
|
|
1766
1766
|
return t.name.value;
|
|
1767
1767
|
})[0] || null;
|
|
1768
1768
|
}
|
|
1769
|
-
let
|
|
1769
|
+
let ie = null;
|
|
1770
1770
|
const Zr = {};
|
|
1771
1771
|
let ua = 1;
|
|
1772
1772
|
const fa = () => class {
|
|
@@ -1779,52 +1779,52 @@ const fa = () => class {
|
|
|
1779
1779
|
].join(":");
|
|
1780
1780
|
}
|
|
1781
1781
|
hasValue() {
|
|
1782
|
-
for (let t =
|
|
1782
|
+
for (let t = ie; t; t = t.parent)
|
|
1783
1783
|
if (this.id in t.slots) {
|
|
1784
1784
|
const r = t.slots[this.id];
|
|
1785
1785
|
if (r === Zr)
|
|
1786
1786
|
break;
|
|
1787
|
-
return t !==
|
|
1787
|
+
return t !== ie && (ie.slots[this.id] = r), !0;
|
|
1788
1788
|
}
|
|
1789
|
-
return
|
|
1789
|
+
return ie && (ie.slots[this.id] = Zr), !1;
|
|
1790
1790
|
}
|
|
1791
1791
|
getValue() {
|
|
1792
1792
|
if (this.hasValue())
|
|
1793
|
-
return
|
|
1793
|
+
return ie.slots[this.id];
|
|
1794
1794
|
}
|
|
1795
1795
|
withValue(t, r, n, o) {
|
|
1796
1796
|
const s = {
|
|
1797
1797
|
__proto__: null,
|
|
1798
1798
|
[this.id]: t
|
|
1799
|
-
}, i =
|
|
1800
|
-
|
|
1799
|
+
}, i = ie;
|
|
1800
|
+
ie = { parent: i, slots: s };
|
|
1801
1801
|
try {
|
|
1802
1802
|
return r.apply(o, n);
|
|
1803
1803
|
} finally {
|
|
1804
|
-
|
|
1804
|
+
ie = i;
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
1807
|
// Capture the current context and wrap a callback function so that it
|
|
1808
1808
|
// reestablishes the captured context when called.
|
|
1809
1809
|
static bind(t) {
|
|
1810
|
-
const r =
|
|
1810
|
+
const r = ie;
|
|
1811
1811
|
return function() {
|
|
1812
|
-
const n =
|
|
1812
|
+
const n = ie;
|
|
1813
1813
|
try {
|
|
1814
|
-
return
|
|
1814
|
+
return ie = r, t.apply(this, arguments);
|
|
1815
1815
|
} finally {
|
|
1816
|
-
|
|
1816
|
+
ie = n;
|
|
1817
1817
|
}
|
|
1818
1818
|
};
|
|
1819
1819
|
}
|
|
1820
1820
|
// Immediately run a callback function without any captured context.
|
|
1821
1821
|
static noContext(t, r, n) {
|
|
1822
|
-
if (
|
|
1823
|
-
const o =
|
|
1822
|
+
if (ie) {
|
|
1823
|
+
const o = ie;
|
|
1824
1824
|
try {
|
|
1825
|
-
return
|
|
1825
|
+
return ie = null, t.apply(n, r);
|
|
1826
1826
|
} finally {
|
|
1827
|
-
|
|
1827
|
+
ie = o;
|
|
1828
1828
|
}
|
|
1829
1829
|
} else
|
|
1830
1830
|
return t.apply(n, r);
|
|
@@ -1867,10 +1867,10 @@ Array[ar] || (function(e) {
|
|
|
1867
1867
|
}
|
|
1868
1868
|
})(fa()), { bind: ai, noContext: si } = Nr;
|
|
1869
1869
|
new Nr();
|
|
1870
|
-
function
|
|
1870
|
+
function pa(e, t) {
|
|
1871
1871
|
var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
1872
1872
|
if (r) return (r = r.call(e)).next.bind(r);
|
|
1873
|
-
if (Array.isArray(e) || (r =
|
|
1873
|
+
if (Array.isArray(e) || (r = ha(e)) || t) {
|
|
1874
1874
|
r && (e = r);
|
|
1875
1875
|
var n = 0;
|
|
1876
1876
|
return function() {
|
|
@@ -1880,7 +1880,7 @@ function ha(e, t) {
|
|
|
1880
1880
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1881
1881
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1882
1882
|
}
|
|
1883
|
-
function
|
|
1883
|
+
function ha(e, t) {
|
|
1884
1884
|
if (e) {
|
|
1885
1885
|
if (typeof e == "string") return rn(e, t);
|
|
1886
1886
|
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
@@ -1911,7 +1911,7 @@ var _r = function() {
|
|
|
1911
1911
|
return Ir(e) ? Symbol[e] : "@@" + e;
|
|
1912
1912
|
};
|
|
1913
1913
|
_r() && !Ir("observable") && (Symbol.observable = Symbol("observable"));
|
|
1914
|
-
var ga = Fr("iterator"),
|
|
1914
|
+
var ga = Fr("iterator"), hr = Fr("observable"), qn = Fr("species");
|
|
1915
1915
|
function Gt(e, t) {
|
|
1916
1916
|
var r = e[t];
|
|
1917
1917
|
if (r != null) {
|
|
@@ -1921,10 +1921,10 @@ function Gt(e, t) {
|
|
|
1921
1921
|
}
|
|
1922
1922
|
function _t(e) {
|
|
1923
1923
|
var t = e.constructor;
|
|
1924
|
-
return t !== void 0 && (t = t[qn], t === null && (t = void 0)), t !== void 0 ? t :
|
|
1924
|
+
return t !== void 0 && (t = t[qn], t === null && (t = void 0)), t !== void 0 ? t : me;
|
|
1925
1925
|
}
|
|
1926
1926
|
function wa(e) {
|
|
1927
|
-
return e instanceof
|
|
1927
|
+
return e instanceof me;
|
|
1928
1928
|
}
|
|
1929
1929
|
function xt(e) {
|
|
1930
1930
|
xt.log ? xt.log(e) : setTimeout(function() {
|
|
@@ -2045,7 +2045,7 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2045
2045
|
return this._subscription._state === "closed";
|
|
2046
2046
|
}
|
|
2047
2047
|
}]), e;
|
|
2048
|
-
})(),
|
|
2048
|
+
})(), me = /* @__PURE__ */ (function() {
|
|
2049
2049
|
function e(r) {
|
|
2050
2050
|
if (!(this instanceof e)) throw new TypeError("Observable cannot be called as a function");
|
|
2051
2051
|
if (typeof r != "function") throw new TypeError("Observable initializer must be a function");
|
|
@@ -2065,15 +2065,15 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2065
2065
|
i(new TypeError(n + " is not a function"));
|
|
2066
2066
|
return;
|
|
2067
2067
|
}
|
|
2068
|
-
function
|
|
2068
|
+
function c() {
|
|
2069
2069
|
l.unsubscribe(), s();
|
|
2070
2070
|
}
|
|
2071
2071
|
var l = o.subscribe({
|
|
2072
|
-
next: function(
|
|
2072
|
+
next: function(h) {
|
|
2073
2073
|
try {
|
|
2074
|
-
n(
|
|
2075
|
-
} catch (
|
|
2076
|
-
i(
|
|
2074
|
+
n(h, c);
|
|
2075
|
+
} catch (g) {
|
|
2076
|
+
i(g), l.unsubscribe();
|
|
2077
2077
|
}
|
|
2078
2078
|
},
|
|
2079
2079
|
error: i,
|
|
@@ -2086,16 +2086,16 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2086
2086
|
var s = _t(this);
|
|
2087
2087
|
return new s(function(i) {
|
|
2088
2088
|
return o.subscribe({
|
|
2089
|
-
next: function(
|
|
2089
|
+
next: function(c) {
|
|
2090
2090
|
try {
|
|
2091
|
-
|
|
2091
|
+
c = n(c);
|
|
2092
2092
|
} catch (l) {
|
|
2093
2093
|
return i.error(l);
|
|
2094
2094
|
}
|
|
2095
|
-
i.next(
|
|
2095
|
+
i.next(c);
|
|
2096
2096
|
},
|
|
2097
|
-
error: function(
|
|
2098
|
-
i.error(
|
|
2097
|
+
error: function(c) {
|
|
2098
|
+
i.error(c);
|
|
2099
2099
|
},
|
|
2100
2100
|
complete: function() {
|
|
2101
2101
|
i.complete();
|
|
@@ -2108,16 +2108,16 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2108
2108
|
var s = _t(this);
|
|
2109
2109
|
return new s(function(i) {
|
|
2110
2110
|
return o.subscribe({
|
|
2111
|
-
next: function(
|
|
2111
|
+
next: function(c) {
|
|
2112
2112
|
try {
|
|
2113
|
-
if (!n(
|
|
2113
|
+
if (!n(c)) return;
|
|
2114
2114
|
} catch (l) {
|
|
2115
2115
|
return i.error(l);
|
|
2116
2116
|
}
|
|
2117
|
-
i.next(
|
|
2117
|
+
i.next(c);
|
|
2118
2118
|
},
|
|
2119
|
-
error: function(
|
|
2120
|
-
i.error(
|
|
2119
|
+
error: function(c) {
|
|
2120
|
+
i.error(c);
|
|
2121
2121
|
},
|
|
2122
2122
|
complete: function() {
|
|
2123
2123
|
i.complete();
|
|
@@ -2127,37 +2127,37 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2127
2127
|
}, t.reduce = function(n) {
|
|
2128
2128
|
var o = this;
|
|
2129
2129
|
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
2130
|
-
var s = _t(this), i = arguments.length > 1,
|
|
2131
|
-
return new s(function(
|
|
2130
|
+
var s = _t(this), i = arguments.length > 1, c = !1, l = arguments[1], h = l;
|
|
2131
|
+
return new s(function(g) {
|
|
2132
2132
|
return o.subscribe({
|
|
2133
2133
|
next: function(y) {
|
|
2134
|
-
var x = !
|
|
2135
|
-
if (
|
|
2134
|
+
var x = !c;
|
|
2135
|
+
if (c = !0, !x || i)
|
|
2136
2136
|
try {
|
|
2137
|
-
|
|
2137
|
+
h = n(h, y);
|
|
2138
2138
|
} catch (S) {
|
|
2139
|
-
return
|
|
2139
|
+
return g.error(S);
|
|
2140
2140
|
}
|
|
2141
2141
|
else
|
|
2142
|
-
|
|
2142
|
+
h = y;
|
|
2143
2143
|
},
|
|
2144
2144
|
error: function(y) {
|
|
2145
|
-
|
|
2145
|
+
g.error(y);
|
|
2146
2146
|
},
|
|
2147
2147
|
complete: function() {
|
|
2148
|
-
if (!
|
|
2149
|
-
|
|
2148
|
+
if (!c && !i) return g.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2149
|
+
g.next(h), g.complete();
|
|
2150
2150
|
}
|
|
2151
2151
|
});
|
|
2152
2152
|
});
|
|
2153
2153
|
}, t.concat = function() {
|
|
2154
2154
|
for (var n = this, o = arguments.length, s = new Array(o), i = 0; i < o; i++)
|
|
2155
2155
|
s[i] = arguments[i];
|
|
2156
|
-
var
|
|
2157
|
-
return new
|
|
2158
|
-
var
|
|
2156
|
+
var c = _t(this);
|
|
2157
|
+
return new c(function(l) {
|
|
2158
|
+
var h, g = 0;
|
|
2159
2159
|
function y(x) {
|
|
2160
|
-
|
|
2160
|
+
h = x.subscribe({
|
|
2161
2161
|
next: function(S) {
|
|
2162
2162
|
l.next(S);
|
|
2163
2163
|
},
|
|
@@ -2165,12 +2165,12 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2165
2165
|
l.error(S);
|
|
2166
2166
|
},
|
|
2167
2167
|
complete: function() {
|
|
2168
|
-
|
|
2168
|
+
g === s.length ? (h = void 0, l.complete()) : y(c.from(s[g++]));
|
|
2169
2169
|
}
|
|
2170
2170
|
});
|
|
2171
2171
|
}
|
|
2172
2172
|
return y(n), function() {
|
|
2173
|
-
|
|
2173
|
+
h && (h.unsubscribe(), h = void 0);
|
|
2174
2174
|
};
|
|
2175
2175
|
});
|
|
2176
2176
|
}, t.flatMap = function(n) {
|
|
@@ -2178,15 +2178,15 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2178
2178
|
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
2179
2179
|
var s = _t(this);
|
|
2180
2180
|
return new s(function(i) {
|
|
2181
|
-
var
|
|
2182
|
-
next: function(
|
|
2181
|
+
var c = [], l = o.subscribe({
|
|
2182
|
+
next: function(g) {
|
|
2183
2183
|
if (n)
|
|
2184
2184
|
try {
|
|
2185
|
-
|
|
2185
|
+
g = n(g);
|
|
2186
2186
|
} catch (x) {
|
|
2187
2187
|
return i.error(x);
|
|
2188
2188
|
}
|
|
2189
|
-
var y = s.from(
|
|
2189
|
+
var y = s.from(g).subscribe({
|
|
2190
2190
|
next: function(x) {
|
|
2191
2191
|
i.next(x);
|
|
2192
2192
|
},
|
|
@@ -2194,60 +2194,60 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2194
2194
|
i.error(x);
|
|
2195
2195
|
},
|
|
2196
2196
|
complete: function() {
|
|
2197
|
-
var x =
|
|
2198
|
-
x >= 0 &&
|
|
2197
|
+
var x = c.indexOf(y);
|
|
2198
|
+
x >= 0 && c.splice(x, 1), h();
|
|
2199
2199
|
}
|
|
2200
2200
|
});
|
|
2201
|
-
|
|
2201
|
+
c.push(y);
|
|
2202
2202
|
},
|
|
2203
|
-
error: function(
|
|
2204
|
-
i.error(
|
|
2203
|
+
error: function(g) {
|
|
2204
|
+
i.error(g);
|
|
2205
2205
|
},
|
|
2206
2206
|
complete: function() {
|
|
2207
|
-
|
|
2207
|
+
h();
|
|
2208
2208
|
}
|
|
2209
2209
|
});
|
|
2210
|
-
function
|
|
2211
|
-
l.closed &&
|
|
2210
|
+
function h() {
|
|
2211
|
+
l.closed && c.length === 0 && i.complete();
|
|
2212
2212
|
}
|
|
2213
2213
|
return function() {
|
|
2214
|
-
|
|
2215
|
-
return
|
|
2214
|
+
c.forEach(function(g) {
|
|
2215
|
+
return g.unsubscribe();
|
|
2216
2216
|
}), l.unsubscribe();
|
|
2217
2217
|
};
|
|
2218
2218
|
});
|
|
2219
|
-
}, t[
|
|
2219
|
+
}, t[hr] = function() {
|
|
2220
2220
|
return this;
|
|
2221
2221
|
}, e.from = function(n) {
|
|
2222
2222
|
var o = typeof this == "function" ? this : e;
|
|
2223
2223
|
if (n == null) throw new TypeError(n + " is not an object");
|
|
2224
|
-
var s = Gt(n,
|
|
2224
|
+
var s = Gt(n, hr);
|
|
2225
2225
|
if (s) {
|
|
2226
2226
|
var i = s.call(n);
|
|
2227
2227
|
if (Object(i) !== i) throw new TypeError(i + " is not an object");
|
|
2228
|
-
return wa(i) && i.constructor === o ? i : new o(function(
|
|
2229
|
-
return i.subscribe(
|
|
2228
|
+
return wa(i) && i.constructor === o ? i : new o(function(c) {
|
|
2229
|
+
return i.subscribe(c);
|
|
2230
2230
|
});
|
|
2231
2231
|
}
|
|
2232
2232
|
if (Ir("iterator") && (s = Gt(n, ga), s))
|
|
2233
|
-
return new o(function(
|
|
2233
|
+
return new o(function(c) {
|
|
2234
2234
|
Ut(function() {
|
|
2235
|
-
if (!
|
|
2236
|
-
for (var l =
|
|
2237
|
-
var
|
|
2238
|
-
if (
|
|
2235
|
+
if (!c.closed) {
|
|
2236
|
+
for (var l = pa(s.call(n)), h; !(h = l()).done; ) {
|
|
2237
|
+
var g = h.value;
|
|
2238
|
+
if (c.next(g), c.closed) return;
|
|
2239
2239
|
}
|
|
2240
|
-
|
|
2240
|
+
c.complete();
|
|
2241
2241
|
}
|
|
2242
2242
|
});
|
|
2243
2243
|
});
|
|
2244
2244
|
if (Array.isArray(n))
|
|
2245
|
-
return new o(function(
|
|
2245
|
+
return new o(function(c) {
|
|
2246
2246
|
Ut(function() {
|
|
2247
|
-
if (!
|
|
2247
|
+
if (!c.closed) {
|
|
2248
2248
|
for (var l = 0; l < n.length; ++l)
|
|
2249
|
-
if (
|
|
2250
|
-
|
|
2249
|
+
if (c.next(n[l]), c.closed) return;
|
|
2250
|
+
c.complete();
|
|
2251
2251
|
}
|
|
2252
2252
|
});
|
|
2253
2253
|
});
|
|
@@ -2256,12 +2256,12 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2256
2256
|
for (var n = arguments.length, o = new Array(n), s = 0; s < n; s++)
|
|
2257
2257
|
o[s] = arguments[s];
|
|
2258
2258
|
var i = typeof this == "function" ? this : e;
|
|
2259
|
-
return new i(function(
|
|
2259
|
+
return new i(function(c) {
|
|
2260
2260
|
Ut(function() {
|
|
2261
|
-
if (!
|
|
2261
|
+
if (!c.closed) {
|
|
2262
2262
|
for (var l = 0; l < o.length; ++l)
|
|
2263
|
-
if (
|
|
2264
|
-
|
|
2263
|
+
if (c.next(o[l]), c.closed) return;
|
|
2264
|
+
c.complete();
|
|
2265
2265
|
}
|
|
2266
2266
|
});
|
|
2267
2267
|
});
|
|
@@ -2272,9 +2272,9 @@ var xa = /* @__PURE__ */ (function() {
|
|
|
2272
2272
|
}
|
|
2273
2273
|
}]), e;
|
|
2274
2274
|
})();
|
|
2275
|
-
_r() && Object.defineProperty(
|
|
2275
|
+
_r() && Object.defineProperty(me, Symbol("extensions"), {
|
|
2276
2276
|
value: {
|
|
2277
|
-
symbol:
|
|
2277
|
+
symbol: hr,
|
|
2278
2278
|
hostReportError: xt
|
|
2279
2279
|
},
|
|
2280
2280
|
configurable: !0
|
|
@@ -2298,7 +2298,7 @@ function va(e) {
|
|
|
2298
2298
|
var yt;
|
|
2299
2299
|
typeof self < "u" ? yt = self : typeof window < "u" ? yt = window : typeof global < "u" ? yt = global : typeof module < "u" ? yt = module : yt = Function("return this")();
|
|
2300
2300
|
va(yt);
|
|
2301
|
-
var on =
|
|
2301
|
+
var on = me.prototype, an = "@@observable";
|
|
2302
2302
|
on[an] || (on[an] = function() {
|
|
2303
2303
|
return this;
|
|
2304
2304
|
});
|
|
@@ -2339,7 +2339,7 @@ function Na(e) {
|
|
|
2339
2339
|
};
|
|
2340
2340
|
return t.operationName || (t.operationName = typeof t.query != "string" ? da(t.query) || void 0 : ""), t;
|
|
2341
2341
|
}
|
|
2342
|
-
var Ca = Symbol.for("apollo.deprecations"), _a =
|
|
2342
|
+
var Ca = Symbol.for("apollo.deprecations"), _a = pr, Ia = new Nr();
|
|
2343
2343
|
function Fa(e) {
|
|
2344
2344
|
return _a[Ca] || (Ia.getValue() || []).includes(e);
|
|
2345
2345
|
}
|
|
@@ -2347,7 +2347,7 @@ function Pa(e, t) {
|
|
|
2347
2347
|
Fa(e) || t();
|
|
2348
2348
|
}
|
|
2349
2349
|
function sn(e, t) {
|
|
2350
|
-
return t ? t(e) :
|
|
2350
|
+
return t ? t(e) : me.of();
|
|
2351
2351
|
}
|
|
2352
2352
|
function It(e) {
|
|
2353
2353
|
return typeof e == "function" ? new Vn(e) : e;
|
|
@@ -2363,7 +2363,7 @@ var Vn = (
|
|
|
2363
2363
|
}
|
|
2364
2364
|
return e.empty = function() {
|
|
2365
2365
|
return new e(function() {
|
|
2366
|
-
return
|
|
2366
|
+
return me.of();
|
|
2367
2367
|
});
|
|
2368
2368
|
}, e.from = function(t) {
|
|
2369
2369
|
return t.length === 0 ? e.empty() : t.map(It).reduce(function(r, n) {
|
|
@@ -2371,26 +2371,26 @@ var Vn = (
|
|
|
2371
2371
|
});
|
|
2372
2372
|
}, e.split = function(t, r, n) {
|
|
2373
2373
|
var o = It(r), s = It(n || new e(sn)), i;
|
|
2374
|
-
return Bt(o) && Bt(s) ? i = new e(function(
|
|
2375
|
-
return t(
|
|
2376
|
-
}) : i = new e(function(
|
|
2377
|
-
return t(
|
|
2374
|
+
return Bt(o) && Bt(s) ? i = new e(function(c) {
|
|
2375
|
+
return t(c) ? o.request(c) || me.of() : s.request(c) || me.of();
|
|
2376
|
+
}) : i = new e(function(c, l) {
|
|
2377
|
+
return t(c) ? o.request(c, l) || me.of() : s.request(c, l) || me.of();
|
|
2378
2378
|
}), Object.assign(i, { left: o, right: s });
|
|
2379
2379
|
}, e.execute = function(t, r) {
|
|
2380
|
-
return t.request(Sa(r.context, Na(ka(r)))) ||
|
|
2380
|
+
return t.request(Sa(r.context, Na(ka(r)))) || me.of();
|
|
2381
2381
|
}, e.concat = function(t, r) {
|
|
2382
2382
|
var n = It(t);
|
|
2383
2383
|
if (Bt(n))
|
|
2384
2384
|
return globalThis.__DEV__ !== !1 && or.warn(47, n), n;
|
|
2385
2385
|
var o = It(r), s;
|
|
2386
2386
|
return Bt(o) ? s = new e(function(i) {
|
|
2387
|
-
return n.request(i, function(
|
|
2388
|
-
return o.request(
|
|
2389
|
-
}) ||
|
|
2390
|
-
}) : s = new e(function(i,
|
|
2387
|
+
return n.request(i, function(c) {
|
|
2388
|
+
return o.request(c) || me.of();
|
|
2389
|
+
}) || me.of();
|
|
2390
|
+
}) : s = new e(function(i, c) {
|
|
2391
2391
|
return n.request(i, function(l) {
|
|
2392
|
-
return o.request(l,
|
|
2393
|
-
}) ||
|
|
2392
|
+
return o.request(l, c) || me.of();
|
|
2393
|
+
}) || me.of();
|
|
2394
2394
|
}), Object.assign(s, { left: n, right: o });
|
|
2395
2395
|
}, e.prototype.split = function(t, r, n) {
|
|
2396
2396
|
return this.concat(e.split(t, r, n || new e(sn)));
|
|
@@ -2412,10 +2412,10 @@ var Vn = (
|
|
|
2412
2412
|
function Ta(e) {
|
|
2413
2413
|
return new Vn(function(t, r) {
|
|
2414
2414
|
var n = aa(t, []);
|
|
2415
|
-
return new
|
|
2415
|
+
return new me(function(o) {
|
|
2416
2416
|
var s, i = !1;
|
|
2417
|
-
return Promise.resolve(n).then(function(
|
|
2418
|
-
return e(
|
|
2417
|
+
return Promise.resolve(n).then(function(c) {
|
|
2418
|
+
return e(c, t.getContext());
|
|
2419
2419
|
}).then(t.setContext).then(function() {
|
|
2420
2420
|
i || (s = r(t).subscribe({
|
|
2421
2421
|
next: o.next.bind(o),
|
|
@@ -2431,7 +2431,7 @@ function Ta(e) {
|
|
|
2431
2431
|
const Ea = async () => {
|
|
2432
2432
|
const e = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", n = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
2433
2433
|
try {
|
|
2434
|
-
const o = await
|
|
2434
|
+
const o = await ge.post(
|
|
2435
2435
|
e,
|
|
2436
2436
|
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
2437
2437
|
// Only grant_type in body
|
|
@@ -2444,7 +2444,7 @@ const Ea = async () => {
|
|
|
2444
2444
|
);
|
|
2445
2445
|
return o.status === 200 && o.data.access_token ? o.data.access_token : (console.error("Failed to fetch token:", o.data), null);
|
|
2446
2446
|
} catch (o) {
|
|
2447
|
-
return
|
|
2447
|
+
return ge.isAxiosError(o) ? console.error("Error fetching token:", o.response || o.message) : console.error("Unexpected error:", o), null;
|
|
2448
2448
|
}
|
|
2449
2449
|
}, Oa = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", Aa = Eo({
|
|
2450
2450
|
uri: `${Oa}`
|
|
@@ -2474,8 +2474,8 @@ function Da(e, t) {
|
|
|
2474
2474
|
if (r[i]) return o[i] = [];
|
|
2475
2475
|
if (!(i in o)) {
|
|
2476
2476
|
o[i] = null;
|
|
2477
|
-
const
|
|
2478
|
-
l && (o[i] = [
|
|
2477
|
+
const c = n[i] && n[i].parent, l = c && s(c);
|
|
2478
|
+
l && (o[i] = [c].concat(l));
|
|
2479
2479
|
}
|
|
2480
2480
|
return o[i];
|
|
2481
2481
|
}
|
|
@@ -2512,8 +2512,8 @@ function ln(e, t) {
|
|
|
2512
2512
|
function za(e, t, r) {
|
|
2513
2513
|
const n = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
2514
2514
|
let s = {};
|
|
2515
|
-
function i(
|
|
2516
|
-
s = ln(n[
|
|
2515
|
+
function i(c) {
|
|
2516
|
+
s = ln(n[c] || o[c], s);
|
|
2517
2517
|
}
|
|
2518
2518
|
return i(t), r.forEach(i), ln(e, s);
|
|
2519
2519
|
}
|
|
@@ -2590,29 +2590,29 @@ const Gn = /^[a-z0-9]+(-[a-z0-9]+)*$/, Xt = (e, t, r, n = "") => {
|
|
|
2590
2590
|
}
|
|
2591
2591
|
if (o.length > 3 || !o.length) return null;
|
|
2592
2592
|
if (o.length > 1) {
|
|
2593
|
-
const
|
|
2593
|
+
const c = o.pop(), l = o.pop(), h = {
|
|
2594
2594
|
provider: o.length > 0 ? o[0] : n,
|
|
2595
2595
|
prefix: l,
|
|
2596
|
-
name:
|
|
2596
|
+
name: c
|
|
2597
2597
|
};
|
|
2598
|
-
return t && !qt(
|
|
2598
|
+
return t && !qt(h) ? null : h;
|
|
2599
2599
|
}
|
|
2600
2600
|
const s = o[0], i = s.split("-");
|
|
2601
2601
|
if (i.length > 1) {
|
|
2602
|
-
const
|
|
2602
|
+
const c = {
|
|
2603
2603
|
provider: n,
|
|
2604
2604
|
prefix: i.shift(),
|
|
2605
2605
|
name: i.join("-")
|
|
2606
2606
|
};
|
|
2607
|
-
return t && !qt(
|
|
2607
|
+
return t && !qt(c) ? null : c;
|
|
2608
2608
|
}
|
|
2609
2609
|
if (r && n === "") {
|
|
2610
|
-
const
|
|
2610
|
+
const c = {
|
|
2611
2611
|
provider: n,
|
|
2612
2612
|
prefix: "",
|
|
2613
2613
|
name: s
|
|
2614
2614
|
};
|
|
2615
|
-
return t && !qt(
|
|
2615
|
+
return t && !qt(c, r) ? null : c;
|
|
2616
2616
|
}
|
|
2617
2617
|
return null;
|
|
2618
2618
|
}, qt = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
|
|
@@ -2666,8 +2666,8 @@ function un(e, t, r) {
|
|
|
2666
2666
|
let s = n.shift(), i = Va.test(s);
|
|
2667
2667
|
for (; ; ) {
|
|
2668
2668
|
if (i) {
|
|
2669
|
-
const
|
|
2670
|
-
isNaN(
|
|
2669
|
+
const c = parseFloat(s);
|
|
2670
|
+
isNaN(c) ? o.push(s) : o.push(Math.ceil(c * t * r) / r);
|
|
2671
2671
|
} else o.push(s);
|
|
2672
2672
|
if (s = n.shift(), s === void 0) return o.join("");
|
|
2673
2673
|
i = !i;
|
|
@@ -2714,32 +2714,32 @@ function Ga(e, t) {
|
|
|
2714
2714
|
const N = [], P = F.hFlip, R = F.vFlip;
|
|
2715
2715
|
let w = F.rotate;
|
|
2716
2716
|
P ? R ? w += 2 : (N.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), N.push("scale(-1 1)"), o.top = o.left = 0) : R && (N.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), N.push("scale(1 -1)"), o.top = o.left = 0);
|
|
2717
|
-
let
|
|
2717
|
+
let V;
|
|
2718
2718
|
switch (w < 0 && (w -= Math.floor(w / 4) * 4), w = w % 4, w) {
|
|
2719
2719
|
case 1:
|
|
2720
|
-
|
|
2720
|
+
V = o.height / 2 + o.top, N.unshift("rotate(90 " + V.toString() + " " + V.toString() + ")");
|
|
2721
2721
|
break;
|
|
2722
2722
|
case 2:
|
|
2723
2723
|
N.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
|
|
2724
2724
|
break;
|
|
2725
2725
|
case 3:
|
|
2726
|
-
|
|
2726
|
+
V = o.width / 2 + o.left, N.unshift("rotate(-90 " + V.toString() + " " + V.toString() + ")");
|
|
2727
2727
|
break;
|
|
2728
2728
|
}
|
|
2729
|
-
w % 2 === 1 && (o.left !== o.top && (
|
|
2729
|
+
w % 2 === 1 && (o.left !== o.top && (V = o.left, o.left = o.top, o.top = V), o.width !== o.height && (V = o.width, o.width = o.height, o.height = V)), N.length && (s = Ka(s, '<g transform="' + N.join(" ") + '">', "</g>"));
|
|
2730
2730
|
});
|
|
2731
|
-
const i = n.width,
|
|
2732
|
-
let
|
|
2733
|
-
i === null ? (y =
|
|
2731
|
+
const i = n.width, c = n.height, l = o.width, h = o.height;
|
|
2732
|
+
let g, y;
|
|
2733
|
+
i === null ? (y = c === null ? "1em" : c === "auto" ? h : c, g = un(y, l / h)) : (g = i === "auto" ? l : i, y = c === null ? un(g, h / l) : c === "auto" ? h : c);
|
|
2734
2734
|
const x = {}, S = (F, N) => {
|
|
2735
2735
|
Wa(N) || (x[F] = N.toString());
|
|
2736
2736
|
};
|
|
2737
|
-
S("width",
|
|
2737
|
+
S("width", g), S("height", y);
|
|
2738
2738
|
const _ = [
|
|
2739
2739
|
o.left,
|
|
2740
2740
|
o.top,
|
|
2741
2741
|
l,
|
|
2742
|
-
|
|
2742
|
+
h
|
|
2743
2743
|
];
|
|
2744
2744
|
return x.viewBox = _.join(" "), {
|
|
2745
2745
|
attributes: x,
|
|
@@ -2756,8 +2756,8 @@ function es(e, t = Xa) {
|
|
|
2756
2756
|
if (!r.length) return e;
|
|
2757
2757
|
const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
2758
2758
|
return r.forEach((s) => {
|
|
2759
|
-
const i = typeof t == "function" ? t(s) : t + (Za++).toString(),
|
|
2760
|
-
e = e.replace(new RegExp('([#;"])(' +
|
|
2759
|
+
const i = typeof t == "function" ? t(s) : t + (Za++).toString(), c = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2760
|
+
e = e.replace(new RegExp('([#;"])(' + c + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
2761
2761
|
}), e = e.replace(new RegExp(o, "g"), ""), e;
|
|
2762
2762
|
}
|
|
2763
2763
|
const yr = /* @__PURE__ */ Object.create(null);
|
|
@@ -2825,14 +2825,14 @@ const ss = (e, t, r) => {
|
|
|
2825
2825
|
provider: e,
|
|
2826
2826
|
prefix: t,
|
|
2827
2827
|
icons: []
|
|
2828
|
-
},
|
|
2829
|
-
return r.forEach((l,
|
|
2830
|
-
|
|
2828
|
+
}, c = 0;
|
|
2829
|
+
return r.forEach((l, h) => {
|
|
2830
|
+
c += l.length + 1, c >= o && h > 0 && (n.push(i), i = {
|
|
2831
2831
|
type: s,
|
|
2832
2832
|
provider: e,
|
|
2833
2833
|
prefix: t,
|
|
2834
2834
|
icons: []
|
|
2835
|
-
},
|
|
2835
|
+
}, c = l.length), i.icons.push(l);
|
|
2836
2836
|
}), n.push(i), n;
|
|
2837
2837
|
};
|
|
2838
2838
|
function is(e) {
|
|
@@ -2850,7 +2850,7 @@ const ls = (e, t, r) => {
|
|
|
2850
2850
|
let n = is(t.provider);
|
|
2851
2851
|
switch (t.type) {
|
|
2852
2852
|
case "icons": {
|
|
2853
|
-
const s = t.prefix,
|
|
2853
|
+
const s = t.prefix, c = t.icons.join(","), l = new URLSearchParams({ icons: c });
|
|
2854
2854
|
n += s + ".json?" + l.toString();
|
|
2855
2855
|
break;
|
|
2856
2856
|
}
|
|
@@ -2904,24 +2904,24 @@ function ds(e) {
|
|
|
2904
2904
|
let r = !1;
|
|
2905
2905
|
const n = e.provider, o = e.prefix;
|
|
2906
2906
|
t.forEach((s) => {
|
|
2907
|
-
const i = s.icons,
|
|
2907
|
+
const i = s.icons, c = i.pending.length;
|
|
2908
2908
|
i.pending = i.pending.filter((l) => {
|
|
2909
2909
|
if (l.prefix !== o) return !0;
|
|
2910
|
-
const
|
|
2911
|
-
if (e.icons[
|
|
2910
|
+
const h = l.name;
|
|
2911
|
+
if (e.icons[h]) i.loaded.push({
|
|
2912
2912
|
provider: n,
|
|
2913
2913
|
prefix: o,
|
|
2914
|
-
name:
|
|
2914
|
+
name: h
|
|
2915
2915
|
});
|
|
2916
|
-
else if (e.missing.has(
|
|
2916
|
+
else if (e.missing.has(h)) i.missing.push({
|
|
2917
2917
|
provider: n,
|
|
2918
2918
|
prefix: o,
|
|
2919
|
-
name:
|
|
2919
|
+
name: h
|
|
2920
2920
|
});
|
|
2921
2921
|
else
|
|
2922
2922
|
return r = !0, !0;
|
|
2923
2923
|
return !1;
|
|
2924
|
-
}), i.pending.length !==
|
|
2924
|
+
}), i.pending.length !== c && (r || eo([e], s.id), s.callback(i.loaded.slice(0), i.missing.slice(0), i.pending.slice(0), s.abort));
|
|
2925
2925
|
});
|
|
2926
2926
|
}));
|
|
2927
2927
|
}
|
|
@@ -2954,25 +2954,25 @@ function ms(e) {
|
|
|
2954
2954
|
return e.forEach((o) => {
|
|
2955
2955
|
if (n.name === o.name && n.prefix === o.prefix && n.provider === o.provider) return;
|
|
2956
2956
|
n = o;
|
|
2957
|
-
const s = o.provider, i = o.prefix,
|
|
2958
|
-
let
|
|
2959
|
-
|
|
2957
|
+
const s = o.provider, i = o.prefix, c = o.name, l = r[s] || (r[s] = /* @__PURE__ */ Object.create(null)), h = l[i] || (l[i] = bt(s, i));
|
|
2958
|
+
let g;
|
|
2959
|
+
c in h.icons ? g = t.loaded : i === "" || h.missing.has(c) ? g = t.missing : g = t.pending;
|
|
2960
2960
|
const y = {
|
|
2961
2961
|
provider: s,
|
|
2962
2962
|
prefix: i,
|
|
2963
|
-
name:
|
|
2963
|
+
name: c
|
|
2964
2964
|
};
|
|
2965
|
-
|
|
2965
|
+
g.push(y);
|
|
2966
2966
|
}), t;
|
|
2967
2967
|
}
|
|
2968
|
-
function
|
|
2968
|
+
function ps(e, t = !0, r = !1) {
|
|
2969
2969
|
const n = [];
|
|
2970
2970
|
return e.forEach((o) => {
|
|
2971
2971
|
const s = typeof o == "string" ? Xt(o, t, r) : o;
|
|
2972
2972
|
s && n.push(s);
|
|
2973
2973
|
}), n;
|
|
2974
2974
|
}
|
|
2975
|
-
const
|
|
2975
|
+
const hs = {
|
|
2976
2976
|
resources: [],
|
|
2977
2977
|
index: 0,
|
|
2978
2978
|
timeout: 2e3,
|
|
@@ -2991,8 +2991,8 @@ function gs(e, t, r, n) {
|
|
|
2991
2991
|
}
|
|
2992
2992
|
i = i.concat(E);
|
|
2993
2993
|
} else i = e.resources.slice(s).concat(e.resources.slice(0, s));
|
|
2994
|
-
const
|
|
2995
|
-
let l = "pending",
|
|
2994
|
+
const c = Date.now();
|
|
2995
|
+
let l = "pending", h = 0, g, y = null, x = [], S = [];
|
|
2996
2996
|
typeof n == "function" && S.push(n);
|
|
2997
2997
|
function _() {
|
|
2998
2998
|
y && (clearTimeout(y), y = null);
|
|
@@ -3007,10 +3007,10 @@ function gs(e, t, r, n) {
|
|
|
3007
3007
|
}
|
|
3008
3008
|
function P() {
|
|
3009
3009
|
return {
|
|
3010
|
-
startTime:
|
|
3010
|
+
startTime: c,
|
|
3011
3011
|
payload: t,
|
|
3012
3012
|
status: l,
|
|
3013
|
-
queriesSent:
|
|
3013
|
+
queriesSent: h,
|
|
3014
3014
|
queriesPending: x.length,
|
|
3015
3015
|
subscribe: N,
|
|
3016
3016
|
abort: F
|
|
@@ -3018,7 +3018,7 @@ function gs(e, t, r, n) {
|
|
|
3018
3018
|
}
|
|
3019
3019
|
function R() {
|
|
3020
3020
|
l = "failed", S.forEach((E) => {
|
|
3021
|
-
E(void 0,
|
|
3021
|
+
E(void 0, g);
|
|
3022
3022
|
});
|
|
3023
3023
|
}
|
|
3024
3024
|
function w() {
|
|
@@ -3026,34 +3026,34 @@ function gs(e, t, r, n) {
|
|
|
3026
3026
|
E.status === "pending" && (E.status = "aborted");
|
|
3027
3027
|
}), x = [];
|
|
3028
3028
|
}
|
|
3029
|
-
function
|
|
3030
|
-
const
|
|
3031
|
-
switch (x = x.filter((
|
|
3029
|
+
function V(E, H, we) {
|
|
3030
|
+
const ae = H !== "success";
|
|
3031
|
+
switch (x = x.filter((Q) => Q !== E), l) {
|
|
3032
3032
|
case "pending":
|
|
3033
3033
|
break;
|
|
3034
3034
|
case "failed":
|
|
3035
|
-
if (
|
|
3035
|
+
if (ae || !e.dataAfterTimeout) return;
|
|
3036
3036
|
break;
|
|
3037
3037
|
default:
|
|
3038
3038
|
return;
|
|
3039
3039
|
}
|
|
3040
3040
|
if (H === "abort") {
|
|
3041
|
-
|
|
3041
|
+
g = we, R();
|
|
3042
3042
|
return;
|
|
3043
3043
|
}
|
|
3044
|
-
if (
|
|
3045
|
-
|
|
3044
|
+
if (ae) {
|
|
3045
|
+
g = we, x.length || (i.length ? je() : R());
|
|
3046
3046
|
return;
|
|
3047
3047
|
}
|
|
3048
3048
|
if (_(), w(), !e.random) {
|
|
3049
|
-
const
|
|
3050
|
-
|
|
3049
|
+
const Q = e.resources.indexOf(E.resource);
|
|
3050
|
+
Q !== -1 && Q !== e.index && (e.index = Q);
|
|
3051
3051
|
}
|
|
3052
|
-
l = "completed", S.forEach((
|
|
3053
|
-
|
|
3052
|
+
l = "completed", S.forEach((Q) => {
|
|
3053
|
+
Q(we);
|
|
3054
3054
|
});
|
|
3055
3055
|
}
|
|
3056
|
-
function
|
|
3056
|
+
function je() {
|
|
3057
3057
|
if (l !== "pending") return;
|
|
3058
3058
|
_();
|
|
3059
3059
|
const E = i.shift();
|
|
@@ -3070,37 +3070,37 @@ function gs(e, t, r, n) {
|
|
|
3070
3070
|
const H = {
|
|
3071
3071
|
status: "pending",
|
|
3072
3072
|
resource: E,
|
|
3073
|
-
callback: (
|
|
3074
|
-
|
|
3073
|
+
callback: (we, ae) => {
|
|
3074
|
+
V(H, we, ae);
|
|
3075
3075
|
}
|
|
3076
3076
|
};
|
|
3077
|
-
x.push(H),
|
|
3077
|
+
x.push(H), h++, y = setTimeout(je, e.rotate), r(E, t, H.callback);
|
|
3078
3078
|
}
|
|
3079
|
-
return setTimeout(
|
|
3079
|
+
return setTimeout(je), P;
|
|
3080
3080
|
}
|
|
3081
3081
|
function to(e) {
|
|
3082
3082
|
const t = {
|
|
3083
|
-
...
|
|
3083
|
+
...hs,
|
|
3084
3084
|
...e
|
|
3085
3085
|
};
|
|
3086
3086
|
let r = [];
|
|
3087
3087
|
function n() {
|
|
3088
|
-
r = r.filter((
|
|
3088
|
+
r = r.filter((c) => c().status === "pending");
|
|
3089
3089
|
}
|
|
3090
|
-
function o(
|
|
3091
|
-
const
|
|
3092
|
-
n(),
|
|
3090
|
+
function o(c, l, h) {
|
|
3091
|
+
const g = gs(t, c, l, (y, x) => {
|
|
3092
|
+
n(), h && h(y, x);
|
|
3093
3093
|
});
|
|
3094
|
-
return r.push(
|
|
3094
|
+
return r.push(g), g;
|
|
3095
3095
|
}
|
|
3096
|
-
function s(
|
|
3097
|
-
return r.find((l) =>
|
|
3096
|
+
function s(c) {
|
|
3097
|
+
return r.find((l) => c(l)) || null;
|
|
3098
3098
|
}
|
|
3099
3099
|
return {
|
|
3100
3100
|
query: o,
|
|
3101
3101
|
find: s,
|
|
3102
|
-
setIndex: (
|
|
3103
|
-
t.index =
|
|
3102
|
+
setIndex: (c) => {
|
|
3103
|
+
t.index = c;
|
|
3104
3104
|
},
|
|
3105
3105
|
getIndex: () => t.index,
|
|
3106
3106
|
cleanup: n
|
|
@@ -3134,13 +3134,13 @@ function ys(e, t, r) {
|
|
|
3134
3134
|
const s = Tr(e);
|
|
3135
3135
|
if (s) {
|
|
3136
3136
|
n = to(s);
|
|
3137
|
-
const i = e.resources ? e.resources[0] : "",
|
|
3138
|
-
|
|
3137
|
+
const i = e.resources ? e.resources[0] : "", c = xr(i);
|
|
3138
|
+
c && (o = c.send);
|
|
3139
3139
|
}
|
|
3140
3140
|
}
|
|
3141
3141
|
return !n || !o ? (r(void 0, 424), mn) : n.query(t, o, r)().abort;
|
|
3142
3142
|
}
|
|
3143
|
-
function
|
|
3143
|
+
function pn() {
|
|
3144
3144
|
}
|
|
3145
3145
|
function xs(e) {
|
|
3146
3146
|
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
@@ -3173,7 +3173,7 @@ function Pt(e, t, r) {
|
|
|
3173
3173
|
}
|
|
3174
3174
|
n(), xs(e);
|
|
3175
3175
|
}
|
|
3176
|
-
function
|
|
3176
|
+
function hn(e, t) {
|
|
3177
3177
|
e instanceof Promise ? e.then((r) => {
|
|
3178
3178
|
t(r);
|
|
3179
3179
|
}).catch(() => {
|
|
@@ -3187,63 +3187,63 @@ function vs(e, t) {
|
|
|
3187
3187
|
if (delete e.iconsToLoad, !o || !o.length) return;
|
|
3188
3188
|
const s = e.loadIcon;
|
|
3189
3189
|
if (e.loadIcons && (o.length > 1 || !s)) {
|
|
3190
|
-
|
|
3191
|
-
Pt(e, o,
|
|
3190
|
+
hn(e.loadIcons(o, n, r), (g) => {
|
|
3191
|
+
Pt(e, o, g);
|
|
3192
3192
|
});
|
|
3193
3193
|
return;
|
|
3194
3194
|
}
|
|
3195
3195
|
if (s) {
|
|
3196
|
-
o.forEach((
|
|
3197
|
-
const y = s(
|
|
3198
|
-
|
|
3196
|
+
o.forEach((g) => {
|
|
3197
|
+
const y = s(g, n, r);
|
|
3198
|
+
hn(y, (x) => {
|
|
3199
3199
|
const S = x ? {
|
|
3200
3200
|
prefix: n,
|
|
3201
|
-
icons: { [
|
|
3201
|
+
icons: { [g]: x }
|
|
3202
3202
|
} : null;
|
|
3203
|
-
Pt(e, [
|
|
3203
|
+
Pt(e, [g], S);
|
|
3204
3204
|
});
|
|
3205
3205
|
});
|
|
3206
3206
|
return;
|
|
3207
3207
|
}
|
|
3208
|
-
const { valid: i, invalid:
|
|
3209
|
-
if (
|
|
3208
|
+
const { valid: i, invalid: c } = bs(o);
|
|
3209
|
+
if (c.length && Pt(e, c, null), !i.length) return;
|
|
3210
3210
|
const l = n.match(Gn) ? xr(r) : null;
|
|
3211
3211
|
if (!l) {
|
|
3212
3212
|
Pt(e, i, null);
|
|
3213
3213
|
return;
|
|
3214
3214
|
}
|
|
3215
|
-
l.prepare(r, n, i).forEach((
|
|
3216
|
-
ys(r,
|
|
3217
|
-
Pt(e,
|
|
3215
|
+
l.prepare(r, n, i).forEach((g) => {
|
|
3216
|
+
ys(r, g, (y) => {
|
|
3217
|
+
Pt(e, g.icons, y);
|
|
3218
3218
|
});
|
|
3219
3219
|
});
|
|
3220
3220
|
}));
|
|
3221
3221
|
}
|
|
3222
3222
|
const ks = (e, t) => {
|
|
3223
|
-
const r =
|
|
3223
|
+
const r = ps(e, !0, Qn()), n = ms(r);
|
|
3224
3224
|
if (!n.pending.length) {
|
|
3225
3225
|
let l = !0;
|
|
3226
3226
|
return t && setTimeout(() => {
|
|
3227
|
-
l && t(n.loaded, n.missing, n.pending,
|
|
3227
|
+
l && t(n.loaded, n.missing, n.pending, pn);
|
|
3228
3228
|
}), () => {
|
|
3229
3229
|
l = !1;
|
|
3230
3230
|
};
|
|
3231
3231
|
}
|
|
3232
3232
|
const o = /* @__PURE__ */ Object.create(null), s = [];
|
|
3233
|
-
let i,
|
|
3233
|
+
let i, c;
|
|
3234
3234
|
return n.pending.forEach((l) => {
|
|
3235
|
-
const { provider:
|
|
3236
|
-
if (
|
|
3237
|
-
i =
|
|
3238
|
-
const y = o[
|
|
3239
|
-
y[
|
|
3235
|
+
const { provider: h, prefix: g } = l;
|
|
3236
|
+
if (g === c && h === i) return;
|
|
3237
|
+
i = h, c = g, s.push(bt(h, g));
|
|
3238
|
+
const y = o[h] || (o[h] = /* @__PURE__ */ Object.create(null));
|
|
3239
|
+
y[g] || (y[g] = []);
|
|
3240
3240
|
}), n.pending.forEach((l) => {
|
|
3241
|
-
const { provider:
|
|
3242
|
-
S.has(y) || (S.add(y), o[
|
|
3241
|
+
const { provider: h, prefix: g, name: y } = l, x = bt(h, g), S = x.pendingIcons || (x.pendingIcons = /* @__PURE__ */ new Set());
|
|
3242
|
+
S.has(y) || (S.add(y), o[h][g].push(y));
|
|
3243
3243
|
}), s.forEach((l) => {
|
|
3244
|
-
const
|
|
3245
|
-
|
|
3246
|
-
}), t ? fs(t, n, s) :
|
|
3244
|
+
const h = o[l.provider][l.prefix];
|
|
3245
|
+
h.length && vs(l, h);
|
|
3246
|
+
}), t ? fs(t, n, s) : pn;
|
|
3247
3247
|
};
|
|
3248
3248
|
function Ss(e, t) {
|
|
3249
3249
|
const r = { ...e };
|
|
@@ -3352,7 +3352,7 @@ function yn(e) {
|
|
|
3352
3352
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
3353
3353
|
}
|
|
3354
3354
|
const Ds = (e, t, r) => {
|
|
3355
|
-
const n = t.inline ? $s : ro, o = Ss(n, t), s = t.mode || "svg", i = {},
|
|
3355
|
+
const n = t.inline ? $s : ro, o = Ss(n, t), s = t.mode || "svg", i = {}, c = t.style || {}, l = {
|
|
3356
3356
|
...s === "svg" ? As : {}
|
|
3357
3357
|
};
|
|
3358
3358
|
if (r) {
|
|
@@ -3416,30 +3416,30 @@ const Ds = (e, t, r) => {
|
|
|
3416
3416
|
n[N] === void 0 && (l[N] = P);
|
|
3417
3417
|
}
|
|
3418
3418
|
}
|
|
3419
|
-
const
|
|
3419
|
+
const h = Ga(e, o), g = h.attributes;
|
|
3420
3420
|
if (o.inline && (i.verticalAlign = "-0.125em"), s === "svg") {
|
|
3421
3421
|
l.style = {
|
|
3422
3422
|
...i,
|
|
3423
|
-
...
|
|
3424
|
-
}, Object.assign(l,
|
|
3423
|
+
...c
|
|
3424
|
+
}, Object.assign(l, g);
|
|
3425
3425
|
let N = 0, P = t.id;
|
|
3426
3426
|
return typeof P == "string" && (P = P.replace(/-/g, "_")), l.dangerouslySetInnerHTML = {
|
|
3427
|
-
__html: Os(es(
|
|
3427
|
+
__html: Os(es(h.body, P ? () => P + "ID" + N++ : "iconifyReact"))
|
|
3428
3428
|
}, cr("svg", l);
|
|
3429
3429
|
}
|
|
3430
3430
|
const { body: y, width: x, height: S } = e, _ = s === "mask" || (s === "bg" ? !1 : y.indexOf("currentColor") !== -1), F = Is(y, {
|
|
3431
|
-
...
|
|
3431
|
+
...g,
|
|
3432
3432
|
width: x + "",
|
|
3433
3433
|
height: S + ""
|
|
3434
3434
|
});
|
|
3435
3435
|
return l.style = {
|
|
3436
3436
|
...i,
|
|
3437
3437
|
"--svg": Ts(F),
|
|
3438
|
-
width: yn(
|
|
3439
|
-
height: yn(
|
|
3438
|
+
width: yn(g.width),
|
|
3439
|
+
height: yn(g.height),
|
|
3440
3440
|
...js,
|
|
3441
3441
|
..._ ? br : no,
|
|
3442
|
-
...
|
|
3442
|
+
...c
|
|
3443
3443
|
}, cr("span", l);
|
|
3444
3444
|
};
|
|
3445
3445
|
Qn(!0);
|
|
@@ -3496,39 +3496,39 @@ function oo(e) {
|
|
|
3496
3496
|
name: ""
|
|
3497
3497
|
};
|
|
3498
3498
|
}
|
|
3499
|
-
const [i,
|
|
3499
|
+
const [i, c] = C(s(!!e.ssr));
|
|
3500
3500
|
function l() {
|
|
3501
3501
|
const S = n.callback;
|
|
3502
3502
|
S && (S(), o({}));
|
|
3503
3503
|
}
|
|
3504
|
-
function
|
|
3504
|
+
function h(S) {
|
|
3505
3505
|
if (JSON.stringify(i) !== JSON.stringify(S))
|
|
3506
|
-
return l(),
|
|
3506
|
+
return l(), c(S), !0;
|
|
3507
3507
|
}
|
|
3508
|
-
function
|
|
3508
|
+
function g() {
|
|
3509
3509
|
var S;
|
|
3510
3510
|
const _ = e.icon;
|
|
3511
3511
|
if (typeof _ == "object") {
|
|
3512
|
-
|
|
3512
|
+
h({
|
|
3513
3513
|
name: "",
|
|
3514
3514
|
data: _
|
|
3515
3515
|
});
|
|
3516
3516
|
return;
|
|
3517
3517
|
}
|
|
3518
3518
|
const F = dn(_);
|
|
3519
|
-
if (
|
|
3519
|
+
if (h({
|
|
3520
3520
|
name: _,
|
|
3521
3521
|
data: F
|
|
3522
3522
|
}))
|
|
3523
3523
|
if (F === void 0) {
|
|
3524
|
-
const N = ks([_],
|
|
3524
|
+
const N = ks([_], g);
|
|
3525
3525
|
o({
|
|
3526
3526
|
callback: N
|
|
3527
3527
|
});
|
|
3528
3528
|
} else F && ((S = e.onLoad) === null || S === void 0 || S.call(e, _));
|
|
3529
3529
|
}
|
|
3530
|
-
|
|
3531
|
-
t &&
|
|
3530
|
+
be(() => (r(!0), l), []), be(() => {
|
|
3531
|
+
t && g();
|
|
3532
3532
|
}, [e.icon, t]);
|
|
3533
3533
|
const { name: y, data: x } = i;
|
|
3534
3534
|
return x ? Ds({
|
|
@@ -3536,7 +3536,7 @@ function oo(e) {
|
|
|
3536
3536
|
...x
|
|
3537
3537
|
}, e, y) : e.children ? e.children : e.fallback ? e.fallback : cr("span", {});
|
|
3538
3538
|
}
|
|
3539
|
-
const
|
|
3539
|
+
const re = _n((e, t) => oo({
|
|
3540
3540
|
...e,
|
|
3541
3541
|
_ref: t
|
|
3542
3542
|
}));
|
|
@@ -3555,23 +3555,23 @@ const He = "USD", xn = (e) => {
|
|
|
3555
3555
|
const r = (e == null ? void 0 : e.prices) ?? [];
|
|
3556
3556
|
if (!r.length) return null;
|
|
3557
3557
|
const n = (i) => {
|
|
3558
|
-
var
|
|
3559
|
-
const
|
|
3558
|
+
var h, g;
|
|
3559
|
+
const c = i.find((y) => {
|
|
3560
3560
|
var x;
|
|
3561
3561
|
return !!((x = y.discounted) != null && x.value);
|
|
3562
3562
|
});
|
|
3563
|
-
if (
|
|
3563
|
+
if (c)
|
|
3564
3564
|
return {
|
|
3565
|
-
cent:
|
|
3566
|
-
cur:
|
|
3567
|
-
regularCent: (
|
|
3565
|
+
cent: c.discounted.value.centAmount,
|
|
3566
|
+
cur: c.discounted.value.currencyCode,
|
|
3567
|
+
regularCent: (h = c.value) == null ? void 0 : h.centAmount
|
|
3568
3568
|
};
|
|
3569
|
-
const l = (
|
|
3569
|
+
const l = (g = i[0]) == null ? void 0 : g.value;
|
|
3570
3570
|
return l ? { cent: l.centAmount, cur: l.currencyCode } : null;
|
|
3571
3571
|
}, o = r.filter(
|
|
3572
3572
|
(i) => {
|
|
3573
|
-
var
|
|
3574
|
-
return ((l = ((
|
|
3573
|
+
var c, l;
|
|
3574
|
+
return ((l = ((c = i.discounted) == null ? void 0 : c.value) || i.value) == null ? void 0 : l.currencyCode) === t;
|
|
3575
3575
|
}
|
|
3576
3576
|
), s = n(o);
|
|
3577
3577
|
return s || n(r) || null;
|
|
@@ -3618,7 +3618,7 @@ const He = "USD", xn = (e) => {
|
|
|
3618
3618
|
standard: "GROUND",
|
|
3619
3619
|
express: "2-DAY SHIPPING",
|
|
3620
3620
|
sameday: "OVERNIGHT"
|
|
3621
|
-
},
|
|
3621
|
+
}, Ae = (e, t) => {
|
|
3622
3622
|
try {
|
|
3623
3623
|
return e.toLocaleString("en-US", {
|
|
3624
3624
|
style: "currency",
|
|
@@ -3634,10 +3634,10 @@ const He = "USD", xn = (e) => {
|
|
|
3634
3634
|
var t, r;
|
|
3635
3635
|
return ((r = (t = e == null ? void 0 : e.images) == null ? void 0 : t[0]) == null ? void 0 : r.url) ?? "";
|
|
3636
3636
|
}, vn = (e, t) => {
|
|
3637
|
-
var r, n, o, s;
|
|
3638
|
-
return Us(t) || (
|
|
3637
|
+
var r, n, o, s, i, c, l, h;
|
|
3638
|
+
return Us(t) || ((s = (o = (n = (r = e.imageGroups) == null ? void 0 : r[0]) == null ? void 0 : n.images) == null ? void 0 : o[0]) == null ? void 0 : s.link) || ((h = (l = (c = (i = e.image_groups) == null ? void 0 : i[0]) == null ? void 0 : c.images) == null ? void 0 : l[0]) == null ? void 0 : h.link) || "";
|
|
3639
3639
|
}, kn = (e) => (e == null ? void 0 : e.name) || (e == null ? void 0 : e.title) || (e == null ? void 0 : e.productName) || "any", Vt = (e) => {
|
|
3640
|
-
var s, i,
|
|
3640
|
+
var s, i, c, l, h, g;
|
|
3641
3641
|
const t = e ? vr(e, He) : null;
|
|
3642
3642
|
if (t != null && t.cent && (t != null && t.cur))
|
|
3643
3643
|
return {
|
|
@@ -3645,7 +3645,7 @@ const He = "USD", xn = (e) => {
|
|
|
3645
3645
|
currency: t.cur,
|
|
3646
3646
|
regularAmount: t.regularCent ? t.regularCent / 100 : void 0
|
|
3647
3647
|
};
|
|
3648
|
-
const r = (
|
|
3648
|
+
const r = (c = (i = (s = e == null ? void 0 : e.prices) == null ? void 0 : s[0]) == null ? void 0 : i.value) == null ? void 0 : c.centAmount, n = ((g = (h = (l = e == null ? void 0 : e.prices) == null ? void 0 : l[0]) == null ? void 0 : h.value) == null ? void 0 : g.currencyCode) ?? He;
|
|
3649
3649
|
return { amount: Number.isFinite(r) ? +(Number(r) / 100) : 0, currency: n };
|
|
3650
3650
|
}, Sn = (e, t) => {
|
|
3651
3651
|
const { amount: r } = Vt(t);
|
|
@@ -3670,48 +3670,48 @@ const He = "USD", xn = (e) => {
|
|
|
3670
3670
|
addressLoading: s
|
|
3671
3671
|
}) => {
|
|
3672
3672
|
console.log(r, "the product for ai shopping");
|
|
3673
|
-
const i = null,
|
|
3673
|
+
const i = null, c = null, l = Ht(r), h = Math.min(
|
|
3674
3674
|
Math.max(0, n || 0),
|
|
3675
3675
|
Math.max(0, l.length - 1)
|
|
3676
|
-
),
|
|
3677
|
-
|
|
3678
|
-
const u = Ht(r),
|
|
3676
|
+
), g = l.length, [y, x] = C(h), [S, _] = C(null), [F, N] = C(null), P = Re(null), R = Re(null), w = Bs(r, y), [V, je] = C(""), [E, H] = C(!1), [we, ae] = C(!1), [Q, Pe] = C(!1), [$e, pe] = C(""), [L, O] = C(!1), [q, Xe] = C(null), [Ye, ve] = C([]), [_e, ft] = C([]), [Ze, M] = C([]), [le, Te] = C(!1), [Ie, Zt] = C(), [er, m] = C(!0), [j, $] = C(!1), [Y, z] = C(!1), [A, ce] = C("standard"), [B, D] = C(!1), [X, ne] = C(!1), [ke, Se] = C("card"), [Z, W] = C(!1), [Ne, ee] = C(!1), [k, J] = C(!1), [G, de] = C(null), [Ce, et] = C(null), [mt, At] = C(""), [Be, jt] = C(!1), pt = Re(null);
|
|
3677
|
+
be(() => {
|
|
3678
|
+
const u = Ht(r), p = Math.min(
|
|
3679
3679
|
Math.max(0, n || 0),
|
|
3680
3680
|
Math.max(0, u.length - 1)
|
|
3681
3681
|
);
|
|
3682
|
-
x(
|
|
3682
|
+
x(p);
|
|
3683
3683
|
const f = ao(r), v = qe(f), T = We(f);
|
|
3684
3684
|
P.current = v || null, R.current = T || null, _(v || null), N(T || null);
|
|
3685
|
-
}, [n, r]),
|
|
3686
|
-
|
|
3685
|
+
}, [n, r]), be(() => {
|
|
3686
|
+
pt.current && (pt.current.scrollTop = pt.current.scrollHeight);
|
|
3687
3687
|
}, [
|
|
3688
3688
|
Ye,
|
|
3689
|
-
|
|
3689
|
+
le,
|
|
3690
3690
|
j,
|
|
3691
|
-
|
|
3691
|
+
Y,
|
|
3692
3692
|
B,
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3693
|
+
X,
|
|
3694
|
+
Z,
|
|
3695
|
+
Ne,
|
|
3696
3696
|
k,
|
|
3697
3697
|
E,
|
|
3698
|
-
|
|
3698
|
+
we
|
|
3699
3699
|
]);
|
|
3700
|
-
const I = "var(--tanya)",
|
|
3700
|
+
const I = "var(--tanya)", De = "var(--tanya-contrast)", tt = I, kt = "#804c9e", so = () => {
|
|
3701
3701
|
console.log("AgenticShopping feedback:", {
|
|
3702
|
-
rating:
|
|
3702
|
+
rating: Ce,
|
|
3703
3703
|
comment: mt
|
|
3704
3704
|
}), jt(!0);
|
|
3705
3705
|
}, io = () => {
|
|
3706
3706
|
et(null), At(""), jt(!0);
|
|
3707
3707
|
}, Ar = (u) => {
|
|
3708
3708
|
const f = ((u == null ? void 0 : u.intentMandateId) || (u == null ? void 0 : u.intent_mandate_id) || (u == null ? void 0 : u.id) || null) ?? G;
|
|
3709
|
-
return e ? /* @__PURE__ */
|
|
3710
|
-
/* @__PURE__ */ a("div", { className: "success-tick-animation", children: /* @__PURE__ */ a(
|
|
3711
|
-
/* @__PURE__ */
|
|
3709
|
+
return e ? /* @__PURE__ */ d("div", { className: "mt-3 flex items-start gap-3 rounded-lg border border-green-200 bg-green-50 p-4 text-green-800", children: [
|
|
3710
|
+
/* @__PURE__ */ a("div", { className: "success-tick-animation", children: /* @__PURE__ */ a(re, { icon: "mdi:check-circle", width: "28", color: "#16a34a" }) }),
|
|
3711
|
+
/* @__PURE__ */ d("div", { className: "text-sm w-full", children: [
|
|
3712
3712
|
/* @__PURE__ */ a("div", { className: "font-semibold", children: "Success!" }),
|
|
3713
3713
|
/* @__PURE__ */ a("div", { children: "Your smart order has been saved. I’ll watch the price and auto-purchase when the conditions are met." }),
|
|
3714
|
-
f && /* @__PURE__ */
|
|
3714
|
+
f && /* @__PURE__ */ d("div", { className: "mt-2 text-xs font-medium", children: [
|
|
3715
3715
|
"Your Smart Order ID: ",
|
|
3716
3716
|
/* @__PURE__ */ a(
|
|
3717
3717
|
"span",
|
|
@@ -3721,7 +3721,7 @@ const He = "USD", xn = (e) => {
|
|
|
3721
3721
|
}
|
|
3722
3722
|
)
|
|
3723
3723
|
] }),
|
|
3724
|
-
!Be && /* @__PURE__ */
|
|
3724
|
+
!Be && /* @__PURE__ */ d("div", { className: "mt-4 rounded-lg bg-white/70 p-3 text-gray-900", children: [
|
|
3725
3725
|
/* @__PURE__ */ a("h4", { className: "font-semibold mb-1", children: "Please post your feedback here" }),
|
|
3726
3726
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-700 mb-3", children: "Rate us on how much our response was helpful" }),
|
|
3727
3727
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 mb-3", children: [1, 2, 3, 4, 5].map((v) => /* @__PURE__ */ a(
|
|
@@ -3731,9 +3731,9 @@ const He = "USD", xn = (e) => {
|
|
|
3731
3731
|
onClick: () => et(v),
|
|
3732
3732
|
className: "p-0.5",
|
|
3733
3733
|
children: /* @__PURE__ */ a(
|
|
3734
|
-
|
|
3734
|
+
re,
|
|
3735
3735
|
{
|
|
3736
|
-
icon:
|
|
3736
|
+
icon: Ce && Ce >= v ? "mdi:star" : "mdi:star-outline",
|
|
3737
3737
|
width: "20",
|
|
3738
3738
|
className: "text-yellow-500"
|
|
3739
3739
|
}
|
|
@@ -3752,7 +3752,7 @@ const He = "USD", xn = (e) => {
|
|
|
3752
3752
|
placeholder: "Your feedback helps us improve..."
|
|
3753
3753
|
}
|
|
3754
3754
|
),
|
|
3755
|
-
/* @__PURE__ */
|
|
3755
|
+
/* @__PURE__ */ d("div", { className: "mt-3 flex justify-end gap-2", children: [
|
|
3756
3756
|
/* @__PURE__ */ a(
|
|
3757
3757
|
"button",
|
|
3758
3758
|
{
|
|
@@ -3769,7 +3769,7 @@ const He = "USD", xn = (e) => {
|
|
|
3769
3769
|
onClick: so,
|
|
3770
3770
|
className: "px-4 py-2 rounded-full text-sm font-semibold text-white shadow",
|
|
3771
3771
|
style: { background: I },
|
|
3772
|
-
disabled: !
|
|
3772
|
+
disabled: !Ce && !mt.trim(),
|
|
3773
3773
|
children: "Submit"
|
|
3774
3774
|
}
|
|
3775
3775
|
)
|
|
@@ -3784,73 +3784,73 @@ const He = "USD", xn = (e) => {
|
|
|
3784
3784
|
} catch (u) {
|
|
3785
3785
|
console.error("Error fetching addresses:", u);
|
|
3786
3786
|
}
|
|
3787
|
-
}, St = (u,
|
|
3788
|
-
|
|
3787
|
+
}, St = (u, p) => {
|
|
3788
|
+
ve((f) => [
|
|
3789
3789
|
...f,
|
|
3790
3790
|
{
|
|
3791
3791
|
query: "",
|
|
3792
3792
|
response: "__SNAPSHOT__",
|
|
3793
3793
|
snapshotStage: u,
|
|
3794
|
-
snapshotPayload:
|
|
3794
|
+
snapshotPayload: p
|
|
3795
3795
|
}
|
|
3796
3796
|
]);
|
|
3797
|
-
}, jr = (u,
|
|
3798
|
-
|
|
3797
|
+
}, jr = (u, p) => {
|
|
3798
|
+
ve(
|
|
3799
3799
|
(f) => f.map(
|
|
3800
3800
|
(v) => v.response === "__CARD__" ? {
|
|
3801
3801
|
...v,
|
|
3802
3802
|
response: "__SNAPSHOT__",
|
|
3803
3803
|
snapshotStage: u ?? v.snapshotStage,
|
|
3804
|
-
snapshotPayload:
|
|
3804
|
+
snapshotPayload: p ?? v.snapshotPayload
|
|
3805
3805
|
} : v
|
|
3806
3806
|
)
|
|
3807
3807
|
);
|
|
3808
3808
|
}, co = () => {
|
|
3809
|
-
|
|
3809
|
+
ve(
|
|
3810
3810
|
(u) => u.filter(
|
|
3811
|
-
(
|
|
3811
|
+
(p) => !(p.query === "" && p.response !== "__SNAPSHOT__" && p.response !== "__TEXT__")
|
|
3812
3812
|
)
|
|
3813
3813
|
);
|
|
3814
3814
|
}, $t = () => {
|
|
3815
|
-
|
|
3815
|
+
ee(!1), Te(!1), z(!1), ne(!1), $(!1), D(!1), W(!1), J(!1), O(!1), Xe(null), co(), H(!1), ae(!1);
|
|
3816
3816
|
}, uo = () => {
|
|
3817
|
-
|
|
3818
|
-
},
|
|
3817
|
+
Te(!1), $(!1), z(!1), ce("standard"), D(!1), ne(!1), Se("card"), W(!1), ee(!1), J(!1), m(!0), Xe(null), localStorage.removeItem("agentic_order"), localStorage.removeItem("agentic_order_address"), localStorage.removeItem("agentic_order_delivery"), localStorage.removeItem("agentic_order_payment"), localStorage.removeItem("agentic_order_final");
|
|
3818
|
+
}, Fe = Rr(() => Ht(r).map((p, f) => ({
|
|
3819
3819
|
index: f,
|
|
3820
|
-
variant:
|
|
3821
|
-
images: ((
|
|
3820
|
+
variant: p,
|
|
3821
|
+
images: ((p == null ? void 0 : p.images) || []).map((v) => (v == null ? void 0 : v.url) || "").filter(Boolean)
|
|
3822
3822
|
})), [r]), Nt = Rr(() => {
|
|
3823
|
-
if (!
|
|
3824
|
-
const u = S || void 0,
|
|
3825
|
-
var
|
|
3823
|
+
if (!Fe.length) return !1;
|
|
3824
|
+
const u = S || void 0, p = F || void 0, f = (v, T) => {
|
|
3825
|
+
var U;
|
|
3826
3826
|
const b = ot(
|
|
3827
|
-
|
|
3827
|
+
Fe,
|
|
3828
3828
|
v || void 0,
|
|
3829
3829
|
T || void 0
|
|
3830
3830
|
);
|
|
3831
|
-
return !!(b && ((
|
|
3831
|
+
return !!(b && ((U = b.variant) != null && U.sku));
|
|
3832
3832
|
};
|
|
3833
|
-
return u &&
|
|
3834
|
-
}, [
|
|
3835
|
-
const
|
|
3836
|
-
return Number.isFinite(
|
|
3833
|
+
return u && p ? f(u, p) : u && !p ? f(u, null) : !u && p ? f(void 0, p) : !!(w && w.sku);
|
|
3834
|
+
}, [Fe, S, F, w]), fo = Q || L || !Nt, Ct = (u) => {
|
|
3835
|
+
const p = Number((u == null ? void 0 : u.quantity) ?? 1);
|
|
3836
|
+
return Number.isFinite(p) && p > 0 ? p : 1;
|
|
3837
3837
|
}, $r = (u) => {
|
|
3838
|
-
const
|
|
3839
|
-
return Number.isFinite(f) && f > 0 ? +(f / 100) : +(Sn(r, w) *
|
|
3838
|
+
const p = Ct(u), f = Number((u == null ? void 0 : u.max_price_minor) ?? 0);
|
|
3839
|
+
return Number.isFinite(f) && f > 0 ? +(f / 100) : +(Sn(r, w) * p);
|
|
3840
3840
|
}, Dr = (u) => {
|
|
3841
|
-
var
|
|
3842
|
-
const
|
|
3843
|
-
return { product_total: T, tax: b, shipping_fee:
|
|
3844
|
-
}, tr = async (u,
|
|
3845
|
-
jr(), uo(),
|
|
3846
|
-
const v =
|
|
3841
|
+
var K;
|
|
3842
|
+
const p = q, f = Vt(w), v = u || (p == null ? void 0 : p.currency) || f.currency || He, T = $r(p), b = +(T * 0.08).toFixed(2), U = ((K = at[A]) == null ? void 0 : K.fee) || 0;
|
|
3843
|
+
return { product_total: T, tax: b, shipping_fee: U, currency: v };
|
|
3844
|
+
}, tr = async (u, p, f) => {
|
|
3845
|
+
jr(), uo(), Pe(!0), O(!0), H(!1), ae(!1);
|
|
3846
|
+
const v = _e.slice(-Cn);
|
|
3847
3847
|
try {
|
|
3848
|
-
const T = await ur(i,
|
|
3848
|
+
const T = await ur(i, c);
|
|
3849
3849
|
if (!T) throw new Error("Failed to fetch token");
|
|
3850
|
-
const b = localStorage.getItem("customerNumber"),
|
|
3851
|
-
registered: String(
|
|
3850
|
+
const b = localStorage.getItem("customerNumber"), U = localStorage.getItem("isLoggedIn"), ue = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
3851
|
+
registered: String(U || !1),
|
|
3852
3852
|
userId: String(b || (/* @__PURE__ */ new Date()).getTime())
|
|
3853
|
-
}).toString()}`,
|
|
3853
|
+
}).toString()}`, te = await fetch(`${ue}`, {
|
|
3854
3854
|
method: "POST",
|
|
3855
3855
|
headers: {
|
|
3856
3856
|
"Content-Type": "application/json",
|
|
@@ -3860,110 +3860,110 @@ const He = "USD", xn = (e) => {
|
|
|
3860
3860
|
flowId: "MTMI0P4LC6",
|
|
3861
3861
|
flowAliasId: "BCUA138F2Q",
|
|
3862
3862
|
input: {
|
|
3863
|
-
instruction: `Use SKU ${
|
|
3863
|
+
instruction: `Use SKU ${p}. Currency is USD. ${u}`,
|
|
3864
3864
|
metadata: {
|
|
3865
3865
|
productId: (r == null ? void 0 : r.id) ?? null,
|
|
3866
|
-
skuId:
|
|
3866
|
+
skuId: p ?? null,
|
|
3867
3867
|
variantIndex: f
|
|
3868
3868
|
},
|
|
3869
3869
|
context: v
|
|
3870
3870
|
}
|
|
3871
3871
|
})
|
|
3872
3872
|
});
|
|
3873
|
-
if (!
|
|
3874
|
-
const
|
|
3875
|
-
let
|
|
3873
|
+
if (!te.body) throw new Error("Readable stream not supported");
|
|
3874
|
+
const ye = te.body.getReader(), oe = new TextDecoder();
|
|
3875
|
+
let Ee = "", Oe = "", Le = "";
|
|
3876
3876
|
for (; ; ) {
|
|
3877
|
-
const { done:
|
|
3878
|
-
if (
|
|
3879
|
-
|
|
3880
|
-
const
|
|
3877
|
+
const { done: he, value: Je } = await ye.read();
|
|
3878
|
+
if (he) break;
|
|
3879
|
+
Ee += oe.decode(Je, { stream: !0 });
|
|
3880
|
+
const ht = Ee.split(`
|
|
3881
3881
|
`);
|
|
3882
|
-
|
|
3883
|
-
for (const gt of
|
|
3882
|
+
Ee = ht.pop() || "";
|
|
3883
|
+
for (const gt of ht) {
|
|
3884
3884
|
if (!gt.startsWith("data:")) continue;
|
|
3885
3885
|
const rt = gt.slice(5).trim();
|
|
3886
3886
|
try {
|
|
3887
|
-
const Ue = JSON.parse(rt), ze = Ue.index,
|
|
3888
|
-
ze === 0 ?
|
|
3887
|
+
const Ue = JSON.parse(rt), ze = Ue.index, fe = Ue.data;
|
|
3888
|
+
ze === 0 ? Oe = String(fe ?? "") : ze === 1 && (Le = String(fe ?? ""));
|
|
3889
3889
|
} catch (Ue) {
|
|
3890
3890
|
console.error("Error parsing JSON chunk:", Ue);
|
|
3891
3891
|
}
|
|
3892
3892
|
}
|
|
3893
3893
|
}
|
|
3894
|
-
let
|
|
3895
|
-
if (
|
|
3896
|
-
const
|
|
3897
|
-
if (
|
|
3894
|
+
let se = null;
|
|
3895
|
+
if (Oe) {
|
|
3896
|
+
const he = String(Oe).replace(/\\n/g, "").trim();
|
|
3897
|
+
if (he.startsWith("{") && he.endsWith("}"))
|
|
3898
3898
|
try {
|
|
3899
|
-
|
|
3899
|
+
se = JSON.parse(he), se.product_id = p, se.sku_id = p, localStorage.setItem("agentic_order", JSON.stringify(se));
|
|
3900
3900
|
} catch (Je) {
|
|
3901
3901
|
console.log(Je);
|
|
3902
3902
|
}
|
|
3903
3903
|
}
|
|
3904
|
-
Xe(
|
|
3905
|
-
...
|
|
3904
|
+
Xe(se), se && ve((he) => [
|
|
3905
|
+
...he,
|
|
3906
3906
|
{
|
|
3907
3907
|
query: "",
|
|
3908
3908
|
response: "__CARD__",
|
|
3909
|
-
snapshotPayload: { extractedDetails:
|
|
3909
|
+
snapshotPayload: { extractedDetails: se }
|
|
3910
3910
|
}
|
|
3911
|
-
]), ft((
|
|
3912
|
-
...
|
|
3911
|
+
]), ft((he) => [
|
|
3912
|
+
...he,
|
|
3913
3913
|
{
|
|
3914
3914
|
userQuery: u,
|
|
3915
|
-
mainResponse:
|
|
3916
|
-
keywords:
|
|
3915
|
+
mainResponse: Oe || "",
|
|
3916
|
+
keywords: Le || ""
|
|
3917
3917
|
}
|
|
3918
3918
|
].slice(-Cn));
|
|
3919
3919
|
} catch (T) {
|
|
3920
3920
|
console.error("Error sending message to Tanya:", T), O(!1);
|
|
3921
3921
|
} finally {
|
|
3922
|
-
|
|
3922
|
+
Pe(!1);
|
|
3923
3923
|
}
|
|
3924
3924
|
}, Lr = async (u) => {
|
|
3925
|
-
if (L ||
|
|
3926
|
-
const
|
|
3927
|
-
if (!
|
|
3928
|
-
|
|
3925
|
+
if (L || Q || !Nt) return;
|
|
3926
|
+
const p = $e.trim();
|
|
3927
|
+
if (!p) return;
|
|
3928
|
+
ve((b) => [...b, { query: p, response: "" }]), pe(""), je(p);
|
|
3929
3929
|
const f = w == null ? void 0 : w.sku, v = Nn(r), T = f || v || "";
|
|
3930
|
-
if (
|
|
3930
|
+
if (g <= 1) {
|
|
3931
3931
|
if (T) {
|
|
3932
|
-
tr(
|
|
3932
|
+
tr(p, T, y);
|
|
3933
3933
|
return;
|
|
3934
3934
|
}
|
|
3935
|
-
|
|
3935
|
+
ae(!0), O(!0);
|
|
3936
3936
|
return;
|
|
3937
3937
|
}
|
|
3938
|
-
T ? (H(!0), O(!0)) : (
|
|
3938
|
+
T ? (H(!0), O(!0)) : (ae(!0), O(!0));
|
|
3939
3939
|
}, mo = () => {
|
|
3940
3940
|
const u = w == null ? void 0 : w.sku;
|
|
3941
|
-
u && tr(
|
|
3942
|
-
}, ho = () => {
|
|
3943
|
-
H(!1), ie(!0), O(!0);
|
|
3941
|
+
u && tr(V, u, y);
|
|
3944
3942
|
}, po = () => {
|
|
3943
|
+
H(!1), ae(!0), O(!0);
|
|
3944
|
+
}, ho = () => {
|
|
3945
3945
|
if (!w || !w.sku) return;
|
|
3946
3946
|
const u = w.sku;
|
|
3947
|
-
tr(
|
|
3947
|
+
tr(V, u, y);
|
|
3948
3948
|
}, go = async () => {
|
|
3949
|
-
|
|
3950
|
-
extractedDetails:
|
|
3949
|
+
Te(!0), z(!1), ne(!1), ee(!1), $(!1), D(!1), W(!1), J(!1), await lo(), jr("initial", {
|
|
3950
|
+
extractedDetails: q ?? void 0
|
|
3951
3951
|
});
|
|
3952
3952
|
}, wo = () => {
|
|
3953
|
-
if (!
|
|
3953
|
+
if (!Ie) return;
|
|
3954
3954
|
const u = Ze.find(
|
|
3955
|
-
(
|
|
3955
|
+
(p) => String(p.addressId ?? p.id) === Ie
|
|
3956
3956
|
) || null;
|
|
3957
|
-
u && (localStorage.setItem("agentic_order_address", JSON.stringify(u)), $(!0), z(!0), D(!1),
|
|
3957
|
+
u && (localStorage.setItem("agentic_order_address", JSON.stringify(u)), $(!0), z(!0), D(!1), ne(!1), W(!1), ee(!1), J(!1), St("address", u));
|
|
3958
3958
|
}, yo = () => {
|
|
3959
|
-
$(!1), z(!1), D(!1),
|
|
3959
|
+
$(!1), z(!1), D(!1), ne(!1), W(!1), ee(!1), J(!1), localStorage.removeItem("agentic_order_address");
|
|
3960
3960
|
}, xo = () => {
|
|
3961
|
-
A && (localStorage.setItem("agentic_order_delivery", A), D(!0),
|
|
3961
|
+
A && (localStorage.setItem("agentic_order_delivery", A), D(!0), ne(!0), W(!1), ee(!1), J(!1), St("delivery", {
|
|
3962
3962
|
method: A,
|
|
3963
3963
|
...at[A]
|
|
3964
3964
|
}));
|
|
3965
3965
|
}, zr = () => {
|
|
3966
|
-
z(!1), D(!1),
|
|
3966
|
+
z(!1), D(!1), ne(!1), W(!1), ee(!1), J(!1), O(!1), $t(), ve((u) => [
|
|
3967
3967
|
...u,
|
|
3968
3968
|
{
|
|
3969
3969
|
query: "",
|
|
@@ -3974,11 +3974,11 @@ const He = "USD", xn = (e) => {
|
|
|
3974
3974
|
}
|
|
3975
3975
|
]);
|
|
3976
3976
|
}, bo = () => {
|
|
3977
|
-
D(!1),
|
|
3977
|
+
D(!1), ne(!1), W(!1), ee(!1), J(!1), localStorage.removeItem("agentic_order_delivery");
|
|
3978
3978
|
}, vo = () => {
|
|
3979
|
-
|
|
3979
|
+
ke && (localStorage.setItem("agentic_order_payment", ke), W(!0), ee(!0), J(!1), St("payment", { method: ke }));
|
|
3980
3980
|
}, ko = () => {
|
|
3981
|
-
|
|
3981
|
+
ne(!1), W(!1), ee(!1), J(!1), O(!1), $t(), ve((u) => [
|
|
3982
3982
|
...u,
|
|
3983
3983
|
{
|
|
3984
3984
|
query: "",
|
|
@@ -3989,38 +3989,38 @@ const He = "USD", xn = (e) => {
|
|
|
3989
3989
|
}
|
|
3990
3990
|
]);
|
|
3991
3991
|
}, So = () => {
|
|
3992
|
-
W(!1),
|
|
3992
|
+
W(!1), ee(!1), J(!1), localStorage.removeItem("agentic_order_payment");
|
|
3993
3993
|
}, No = async () => {
|
|
3994
3994
|
try {
|
|
3995
|
-
|
|
3996
|
-
const u =
|
|
3995
|
+
Pe(!0);
|
|
3996
|
+
const u = q || {}, p = JSON.parse(
|
|
3997
3997
|
localStorage.getItem("agentic_order_address") || "null"
|
|
3998
3998
|
), f = localStorage.getItem(
|
|
3999
3999
|
"agentic_order_delivery"
|
|
4000
|
-
), v = localStorage.getItem("agentic_order_payment") || "card", { product_total: T, tax: b, shipping_fee:
|
|
4001
|
-
shopper_id:
|
|
4002
|
-
shipping_address_id:
|
|
4003
|
-
shipping_method_id:
|
|
4004
|
-
payment_method_id:
|
|
4005
|
-
sku:
|
|
4000
|
+
), v = localStorage.getItem("agentic_order_payment") || "card", { product_total: T, tax: b, shipping_fee: U, currency: K } = Dr(), ue = u.shopper_id || localStorage.getItem("customerId") || void 0, te = (p == null ? void 0 : p.addressId) || (p == null ? void 0 : p.id) || void 0, ye = f ? Ms[f] : "GROUND", oe = "card-visa", Ee = w == null ? void 0 : w.sku, Oe = (r == null ? void 0 : r.id) || "", Le = Ct(u), se = typeof u.max_price_minor == "number" ? u.max_price_minor : Math.round(T * 100), ht = {
|
|
4001
|
+
shopper_id: ue,
|
|
4002
|
+
shipping_address_id: te,
|
|
4003
|
+
shipping_method_id: ye,
|
|
4004
|
+
payment_method_id: oe,
|
|
4005
|
+
sku: Ee,
|
|
4006
4006
|
platform: "SFCC",
|
|
4007
4007
|
storeCode: "Sites-SiteGenesis-Site",
|
|
4008
|
-
product_id:
|
|
4009
|
-
quantity:
|
|
4010
|
-
max_price_minor:
|
|
4011
|
-
currency:
|
|
4012
|
-
instruction_text:
|
|
4008
|
+
product_id: Oe,
|
|
4009
|
+
quantity: Le,
|
|
4010
|
+
max_price_minor: se,
|
|
4011
|
+
currency: K,
|
|
4012
|
+
instruction_text: V
|
|
4013
4013
|
};
|
|
4014
|
-
if (!
|
|
4014
|
+
if (!ue || !te) {
|
|
4015
4015
|
console.error(
|
|
4016
4016
|
"Missing shopper_id or shipping_address_id for intent-mandate",
|
|
4017
4017
|
{
|
|
4018
|
-
shopperId:
|
|
4019
|
-
shippingAddressId:
|
|
4018
|
+
shopperId: ue,
|
|
4019
|
+
shippingAddressId: te
|
|
4020
4020
|
}
|
|
4021
4021
|
), alert(
|
|
4022
4022
|
"Missing customer or address information. Please re-select address and try again."
|
|
4023
|
-
),
|
|
4023
|
+
), Pe(!1);
|
|
4024
4024
|
return;
|
|
4025
4025
|
}
|
|
4026
4026
|
const rt = (await vt()).access_token;
|
|
@@ -4032,37 +4032,37 @@ const He = "USD", xn = (e) => {
|
|
|
4032
4032
|
"Content-Type": "application/json",
|
|
4033
4033
|
Authorization: `Bearer ${rt}`
|
|
4034
4034
|
},
|
|
4035
|
-
body: JSON.stringify(
|
|
4035
|
+
body: JSON.stringify(ht)
|
|
4036
4036
|
});
|
|
4037
4037
|
if (!ze.ok) {
|
|
4038
4038
|
const To = await ze.text().catch(() => "");
|
|
4039
4039
|
console.error("intent-mandate failed", ze.status, To), alert(
|
|
4040
4040
|
"Something went wrong while saving your smart order. Please try again."
|
|
4041
|
-
),
|
|
4041
|
+
), Pe(!1);
|
|
4042
4042
|
return;
|
|
4043
4043
|
}
|
|
4044
|
-
const
|
|
4045
|
-
console.log("intent-mandate success:",
|
|
4046
|
-
const nt = (
|
|
4047
|
-
nt &&
|
|
4044
|
+
const fe = await ze.json().catch(() => null);
|
|
4045
|
+
console.log("intent-mandate success:", fe);
|
|
4046
|
+
const nt = (fe == null ? void 0 : fe.intent_mandate_id) || (fe == null ? void 0 : fe.intent_mandateId) || (fe == null ? void 0 : fe.key) || null;
|
|
4047
|
+
nt && de(nt);
|
|
4048
4048
|
const Dt = {
|
|
4049
4049
|
...u,
|
|
4050
|
-
address:
|
|
4050
|
+
address: p,
|
|
4051
4051
|
delivery: f,
|
|
4052
4052
|
payment: v,
|
|
4053
|
-
summary: { product_total: T, tax: b, shipping_fee:
|
|
4053
|
+
summary: { product_total: T, tax: b, shipping_fee: U, currency: K },
|
|
4054
4054
|
intent_mandate_id: nt
|
|
4055
4055
|
};
|
|
4056
|
-
localStorage.setItem("agentic_order_final", JSON.stringify(Dt)),
|
|
4056
|
+
localStorage.setItem("agentic_order_final", JSON.stringify(Dt)), J(!0), m(!1), St("final", Dt), St("success", { intentMandateId: nt }), $t();
|
|
4057
4057
|
} catch (u) {
|
|
4058
4058
|
console.error("Error in handleConfirmWatch / intent-mandate:", u), alert(
|
|
4059
4059
|
"Unable to complete your smart order right now. Please try again in a moment."
|
|
4060
4060
|
);
|
|
4061
4061
|
} finally {
|
|
4062
|
-
|
|
4062
|
+
Pe(!1);
|
|
4063
4063
|
}
|
|
4064
4064
|
}, Mr = () => {
|
|
4065
|
-
$t(),
|
|
4065
|
+
$t(), ve((u) => [
|
|
4066
4066
|
...u,
|
|
4067
4067
|
{
|
|
4068
4068
|
query: "",
|
|
@@ -4073,72 +4073,71 @@ const He = "USD", xn = (e) => {
|
|
|
4073
4073
|
}
|
|
4074
4074
|
]);
|
|
4075
4075
|
}, Co = () => {
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
return /* @__PURE__ */ a("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4", children: /* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row items-center sm:items-center gap-4", children: [
|
|
4076
|
+
const u = vn(r, w), p = kn(r), f = (w == null ? void 0 : w.id) || "", v = qe(w) || "", T = We(w) || "", { amount: b } = Vt(w), U = !!(w != null && w.id), K = w && U ? xn(w) : !1;
|
|
4077
|
+
return console.log(u, p, f, v, T, b, U, K, "base product"), /* @__PURE__ */ a("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4", children: /* @__PURE__ */ d("div", { className: "flex flex-col sm:flex-row items-center sm:items-center gap-4", children: [
|
|
4079
4078
|
/* @__PURE__ */ a("div", { className: "flex-shrink-0 flex justify-center sm:justify-start", children: /* @__PURE__ */ a("div", { className: "w-[150px] h-[150px] rounded-lg bg-gray-50 border border-gray-200 flex items-center justify-center overflow-hidden", children: u ? /* @__PURE__ */ a(
|
|
4080
4079
|
"img",
|
|
4081
4080
|
{
|
|
4082
|
-
src:
|
|
4083
|
-
alt:
|
|
4081
|
+
src: u,
|
|
4082
|
+
alt: p,
|
|
4084
4083
|
className: "object-contain w-full h-full"
|
|
4085
4084
|
}
|
|
4086
4085
|
) : /* @__PURE__ */ a(
|
|
4087
|
-
|
|
4086
|
+
re,
|
|
4088
4087
|
{
|
|
4089
4088
|
icon: "mdi:image-outline",
|
|
4090
4089
|
width: "28",
|
|
4091
4090
|
className: "opacity-60"
|
|
4092
4091
|
}
|
|
4093
4092
|
) }) }),
|
|
4094
|
-
/* @__PURE__ */
|
|
4095
|
-
/* @__PURE__ */ a("div", { className: "text-2xl font-bold text-gray-900 mb-1", children:
|
|
4093
|
+
/* @__PURE__ */ d("div", { className: "flex-grow flex flex-col justify-center text-center", children: [
|
|
4094
|
+
/* @__PURE__ */ a("div", { className: "text-2xl font-bold text-gray-900 mb-1", children: p }),
|
|
4096
4095
|
/* @__PURE__ */ a("div", { className: "text-sm text-gray-700 mb-1", children: [
|
|
4097
4096
|
f && `SKU: ${f}`,
|
|
4098
4097
|
v && `Color: ${v}`,
|
|
4099
4098
|
T && `Size: ${T}`
|
|
4100
4099
|
].filter(Boolean).join(" • ") || "—" }),
|
|
4101
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-xl font-semibold text-gray-900", children:
|
|
4102
|
-
|
|
4100
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-xl font-semibold text-gray-900", children: U ? Ae(Number(b) || 0, He) : "Currently unavailable" }),
|
|
4101
|
+
U && !K && /* @__PURE__ */ a("div", { className: "mt-1 text-xs font-medium text-red-600", children: "Currently out of stock" })
|
|
4103
4102
|
] })
|
|
4104
4103
|
] }) });
|
|
4105
4104
|
}, Br = ({
|
|
4106
4105
|
showSubmit: u = !0
|
|
4107
4106
|
}) => {
|
|
4108
|
-
const
|
|
4109
|
-
return /* @__PURE__ */
|
|
4107
|
+
const p = {}, f = Fe.map((b) => qe(b.variant)).filter((b) => !!b && !p[b] && (p[b] = !0)), v = {}, T = Fe.map((b) => We(b.variant)).filter((b) => !!b && !v[b] && (v[b] = !0));
|
|
4108
|
+
return /* @__PURE__ */ d("div", { className: "mx-4 mt-4 mb-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in", children: [
|
|
4110
4109
|
/* @__PURE__ */ a("h3", { className: "font-semibold text-gray-800", children: "Choose a variant" }),
|
|
4111
|
-
f.length > 0 && /* @__PURE__ */
|
|
4112
|
-
/* @__PURE__ */
|
|
4110
|
+
f.length > 0 && /* @__PURE__ */ d("div", { className: "mt-4", children: [
|
|
4111
|
+
/* @__PURE__ */ d("div", { className: "flex items-baseline gap-2", children: [
|
|
4113
4112
|
/* @__PURE__ */ a("div", { className: "text-sm font-bold", children: "Color :" }),
|
|
4114
4113
|
S && /* @__PURE__ */ a("div", { className: "text-sm text-gray-600", children: S })
|
|
4115
4114
|
] }),
|
|
4116
4115
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4 mt-2", children: f.map((b) => {
|
|
4117
|
-
var
|
|
4118
|
-
const
|
|
4119
|
-
(
|
|
4120
|
-
),
|
|
4121
|
-
return /* @__PURE__ */
|
|
4116
|
+
var Le;
|
|
4117
|
+
const U = S === b, K = F || R.current || null, ue = K ? ot(Fe, b, K) : ot(Fe, b, null), te = !!ue, ye = te && xn(ue.variant), oe = te && ye ? vr(ue.variant, He) || vr(ue.variant) : null, Ee = Fe.find(
|
|
4118
|
+
(se) => qe(se.variant) === b
|
|
4119
|
+
), Oe = (Le = Ee == null ? void 0 : Ee.images) == null ? void 0 : Le[0];
|
|
4120
|
+
return /* @__PURE__ */ d(
|
|
4122
4121
|
"div",
|
|
4123
4122
|
{
|
|
4124
4123
|
className: `flex flex-col items-center w-28 border rounded-md p-2
|
|
4125
|
-
${
|
|
4126
|
-
${!
|
|
4124
|
+
${U ? "border-2 border-tanya-light" : "border-gray-300"}
|
|
4125
|
+
${!te || !ye ? "opacity-60" : ""}`,
|
|
4127
4126
|
children: [
|
|
4128
4127
|
/* @__PURE__ */ a(
|
|
4129
4128
|
"button",
|
|
4130
4129
|
{
|
|
4131
4130
|
onClick: () => {
|
|
4132
4131
|
_(b);
|
|
4133
|
-
const
|
|
4134
|
-
|
|
4132
|
+
const se = F || R.current || null, he = se && ot(Fe, b, se) || ot(Fe, b, null);
|
|
4133
|
+
he && x(he.index);
|
|
4135
4134
|
},
|
|
4136
4135
|
className: "w-full h-20 flex items-center justify-center overflow-hidden",
|
|
4137
4136
|
title: b,
|
|
4138
|
-
children:
|
|
4137
|
+
children: Oe ? /* @__PURE__ */ a(
|
|
4139
4138
|
"img",
|
|
4140
4139
|
{
|
|
4141
|
-
src:
|
|
4140
|
+
src: Oe,
|
|
4142
4141
|
alt: b,
|
|
4143
4142
|
className: "w/full h-full object-contain"
|
|
4144
4143
|
}
|
|
@@ -4146,13 +4145,13 @@ const He = "USD", xn = (e) => {
|
|
|
4146
4145
|
}
|
|
4147
4146
|
),
|
|
4148
4147
|
/* @__PURE__ */ a("div", { className: "w-full border-t my-2" }),
|
|
4149
|
-
|
|
4150
|
-
!
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4148
|
+
te && !ye && /* @__PURE__ */ a("div", { className: "text-[11px] text-red-600 text-center", children: "Out of stock" }),
|
|
4149
|
+
!te && /* @__PURE__ */ a("div", { className: "text-[11px] text-red-600 text-center", children: "any not offered" }),
|
|
4150
|
+
te && ye && oe && /* @__PURE__ */ d("div", { className: "text-xs text-gray-800 font-medium text-center", children: [
|
|
4151
|
+
Ae(oe.cent / 100, oe.cur),
|
|
4152
|
+
oe.regularCent && oe.regularCent > oe.cent && /* @__PURE__ */ a("span", { className: "ml-1 line-through text-gray-500", children: Ae(
|
|
4153
|
+
oe.regularCent / 100,
|
|
4154
|
+
oe.cur
|
|
4156
4155
|
) })
|
|
4157
4156
|
] })
|
|
4158
4157
|
]
|
|
@@ -4161,8 +4160,8 @@ const He = "USD", xn = (e) => {
|
|
|
4161
4160
|
);
|
|
4162
4161
|
}) })
|
|
4163
4162
|
] }),
|
|
4164
|
-
T.length > 0 && /* @__PURE__ */
|
|
4165
|
-
/* @__PURE__ */
|
|
4163
|
+
T.length > 0 && /* @__PURE__ */ d("div", { className: "mt-4", children: [
|
|
4164
|
+
/* @__PURE__ */ d("div", { className: "flex items-baseline gap-2", children: [
|
|
4166
4165
|
/* @__PURE__ */ a("div", { className: "text-sm font-bold", children: "Size :" }),
|
|
4167
4166
|
F && /* @__PURE__ */ a("div", { className: "text-sm text-gray-600", children: F })
|
|
4168
4167
|
] }),
|
|
@@ -4171,8 +4170,8 @@ const He = "USD", xn = (e) => {
|
|
|
4171
4170
|
{
|
|
4172
4171
|
onClick: () => {
|
|
4173
4172
|
N(b);
|
|
4174
|
-
const
|
|
4175
|
-
|
|
4173
|
+
const K = S && ot(Fe, S, b) || ot(Fe, void 0, b);
|
|
4174
|
+
K && x(K.index);
|
|
4176
4175
|
},
|
|
4177
4176
|
className: `px-4 py-2 rounded-md border text-sm ${F === b ? "border-2 border-tanya-light font-semibold" : "border-gray-300"}`,
|
|
4178
4177
|
title: b,
|
|
@@ -4184,7 +4183,7 @@ const He = "USD", xn = (e) => {
|
|
|
4184
4183
|
u && /* @__PURE__ */ a("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ a(
|
|
4185
4184
|
"button",
|
|
4186
4185
|
{
|
|
4187
|
-
onClick:
|
|
4186
|
+
onClick: ho,
|
|
4188
4187
|
className: "px-6 py-2.5 rounded-full font-semibold text-white shadow-md",
|
|
4189
4188
|
style: { background: I },
|
|
4190
4189
|
disabled: !Nt,
|
|
@@ -4192,12 +4191,12 @@ const He = "USD", xn = (e) => {
|
|
|
4192
4191
|
}
|
|
4193
4192
|
) })
|
|
4194
4193
|
] });
|
|
4195
|
-
}, Ur = (u,
|
|
4194
|
+
}, Ur = (u, p = !0) => {
|
|
4196
4195
|
!(u != null && u.extractedDetails) && u && (u = { extractedDetails: u });
|
|
4197
|
-
const f = (u == null ? void 0 : u.extractedDetails) ||
|
|
4196
|
+
const f = (u == null ? void 0 : u.extractedDetails) || q;
|
|
4198
4197
|
if (!f) return null;
|
|
4199
|
-
const v = Ct(f), { currency: T } = Vt(w), b = Sn(r, w),
|
|
4200
|
-
return /* @__PURE__ */
|
|
4198
|
+
const v = Ct(f), { currency: T } = Vt(w), b = Sn(r, w), U = Number((f == null ? void 0 : f.max_price_minor) ?? 0), ue = Number.isFinite(U) && U > 0 ? +(U / 100) : +(b * v), te = (f == null ? void 0 : f.currency) || T || He, ye = w != null && w.sku ? w.sku : f.product_id;
|
|
4199
|
+
return /* @__PURE__ */ d(
|
|
4201
4200
|
"div",
|
|
4202
4201
|
{
|
|
4203
4202
|
className: "px-6 pb-6 flex flex-col items-center space-y-4",
|
|
@@ -4207,42 +4206,42 @@ const He = "USD", xn = (e) => {
|
|
|
4207
4206
|
"p",
|
|
4208
4207
|
{
|
|
4209
4208
|
className: "text-base font-semibold text-center mt-2",
|
|
4210
|
-
style: { color:
|
|
4209
|
+
style: { color: De },
|
|
4211
4210
|
children: "Here’s what I found from your instruction:"
|
|
4212
4211
|
}
|
|
4213
4212
|
),
|
|
4214
|
-
/* @__PURE__ */
|
|
4215
|
-
/* @__PURE__ */
|
|
4213
|
+
/* @__PURE__ */ d("div", { className: "w-full max-w-md bg-white rounded-xl shadow-inner p-4", children: [
|
|
4214
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-y-2 text-sm", children: [
|
|
4216
4215
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "SKU:" }),
|
|
4217
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4216
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: ye }),
|
|
4218
4217
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Quantity:" }),
|
|
4219
4218
|
/* @__PURE__ */ a("p", { className: "text-gray-800", children: Ct(f) }),
|
|
4220
4219
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Currency:" }),
|
|
4221
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4220
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: te }),
|
|
4222
4221
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Maximum Total Price:" }),
|
|
4223
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4222
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: Ae(ue, te) })
|
|
4224
4223
|
] }),
|
|
4225
|
-
/* @__PURE__ */
|
|
4226
|
-
qe(w) && /* @__PURE__ */
|
|
4224
|
+
/* @__PURE__ */ d("div", { className: "mt-3 flex flex-wrap gap-2 text-xs", children: [
|
|
4225
|
+
qe(w) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4227
4226
|
"Color: ",
|
|
4228
4227
|
qe(w)
|
|
4229
4228
|
] }),
|
|
4230
|
-
We(w) && /* @__PURE__ */
|
|
4229
|
+
We(w) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4231
4230
|
"Size: ",
|
|
4232
4231
|
We(w)
|
|
4233
4232
|
] }),
|
|
4234
|
-
(w == null ? void 0 : w.sku) && /* @__PURE__ */
|
|
4233
|
+
(w == null ? void 0 : w.sku) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4235
4234
|
"SKU: ",
|
|
4236
4235
|
w.sku
|
|
4237
4236
|
] })
|
|
4238
4237
|
] })
|
|
4239
4238
|
] }),
|
|
4240
|
-
!
|
|
4241
|
-
/* @__PURE__ */
|
|
4239
|
+
!p && /* @__PURE__ */ d(xe, { children: [
|
|
4240
|
+
/* @__PURE__ */ d(
|
|
4242
4241
|
"p",
|
|
4243
4242
|
{
|
|
4244
4243
|
className: "text-sm font-medium text-gray-700 text-center max-w-[90%] leading-relaxed",
|
|
4245
|
-
style: { color:
|
|
4244
|
+
style: { color: De },
|
|
4246
4245
|
children: [
|
|
4247
4246
|
"Would you like me to ",
|
|
4248
4247
|
/* @__PURE__ */ a("strong", { children: "lock this in" }),
|
|
@@ -4250,17 +4249,17 @@ const He = "USD", xn = (e) => {
|
|
|
4250
4249
|
]
|
|
4251
4250
|
}
|
|
4252
4251
|
),
|
|
4253
|
-
/* @__PURE__ */
|
|
4254
|
-
/* @__PURE__ */
|
|
4252
|
+
/* @__PURE__ */ d("div", { className: "flex flex-wrap justify-center gap-4", children: [
|
|
4253
|
+
/* @__PURE__ */ d(
|
|
4255
4254
|
"button",
|
|
4256
4255
|
{
|
|
4257
4256
|
onClick: go,
|
|
4258
|
-
disabled:
|
|
4259
|
-
className: `relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${
|
|
4257
|
+
disabled: le,
|
|
4258
|
+
className: `relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${le ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
|
|
4260
4259
|
style: { background: `${I}` },
|
|
4261
4260
|
children: [
|
|
4262
4261
|
/* @__PURE__ */ a(
|
|
4263
|
-
|
|
4262
|
+
re,
|
|
4264
4263
|
{
|
|
4265
4264
|
icon: "fluent:checkmark-circle-24-filled",
|
|
4266
4265
|
className: "mr-2",
|
|
@@ -4272,16 +4271,16 @@ const He = "USD", xn = (e) => {
|
|
|
4272
4271
|
]
|
|
4273
4272
|
}
|
|
4274
4273
|
),
|
|
4275
|
-
/* @__PURE__ */
|
|
4274
|
+
/* @__PURE__ */ d(
|
|
4276
4275
|
"button",
|
|
4277
4276
|
{
|
|
4278
4277
|
onClick: Mr,
|
|
4279
|
-
disabled:
|
|
4280
|
-
className: `relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold border transition-all duration-300 ${
|
|
4281
|
-
style: { borderColor: I, color:
|
|
4278
|
+
disabled: le,
|
|
4279
|
+
className: `relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold border transition-all duration-300 ${le ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
|
|
4280
|
+
style: { borderColor: I, color: De },
|
|
4282
4281
|
children: [
|
|
4283
4282
|
/* @__PURE__ */ a(
|
|
4284
|
-
|
|
4283
|
+
re,
|
|
4285
4284
|
{
|
|
4286
4285
|
icon: "fluent:dismiss-circle-24-filled",
|
|
4287
4286
|
className: "mr-2",
|
|
@@ -4298,23 +4297,23 @@ const He = "USD", xn = (e) => {
|
|
|
4298
4297
|
]
|
|
4299
4298
|
}
|
|
4300
4299
|
);
|
|
4301
|
-
}, qr = (u,
|
|
4302
|
-
var gt, rt, Ue, ze,
|
|
4303
|
-
const f = u || {}, v = ((gt = f == null ? void 0 : f.summary) == null ? void 0 : gt.currency) || (
|
|
4300
|
+
}, qr = (u, p = !0) => {
|
|
4301
|
+
var gt, rt, Ue, ze, fe, nt;
|
|
4302
|
+
const f = u || {}, v = ((gt = f == null ? void 0 : f.summary) == null ? void 0 : gt.currency) || (q == null ? void 0 : q.currency) || He, T = vn(r, w), b = kn(r), U = w != null && w.sku ? w.sku : (r == null ? void 0 : r.id) ?? (q == null ? void 0 : q.product_id), K = (w == null ? void 0 : w.sku) ?? Nn(r), ue = qe(w) || qs(r), te = We(w) || Rs(r), ye = Ct(f), oe = ((rt = f == null ? void 0 : f.summary) == null ? void 0 : rt.product_total) != null ? +f.summary.product_total : $r(f), Ee = ye > 0 ? +(oe / ye).toFixed(2) : 0, Oe = oe, Le = ((Ue = f == null ? void 0 : f.summary) == null ? void 0 : Ue.tax) ?? +(oe * 0.08).toFixed(2), se = ((ze = f == null ? void 0 : f.summary) == null ? void 0 : ze.shipping_fee) ?? (((fe = at[A]) == null ? void 0 : fe.fee) || 0), he = f != null && f.address ? [
|
|
4304
4303
|
f.address.addressLine1,
|
|
4305
4304
|
f.address.addressLine2,
|
|
4306
4305
|
f.address.street,
|
|
4307
4306
|
[f.address.city, f.address.state, f.address.postalCode].filter(Boolean).join(", "),
|
|
4308
4307
|
f.address.country
|
|
4309
|
-
].filter(Boolean).map((Dt) => Ke(String(Dt))).join(", ") : "—", Je = (f == null ? void 0 : f.payment) || "card",
|
|
4308
|
+
].filter(Boolean).map((Dt) => Ke(String(Dt))).join(", ") : "—", Je = (f == null ? void 0 : f.payment) || "card", ht = Je === "card" ? /* @__PURE__ */ d(xe, { children: [
|
|
4310
4309
|
"Credit Card — Mastercard",
|
|
4311
4310
|
/* @__PURE__ */ a("br", {}),
|
|
4312
4311
|
"•••• 7820 Exp: 12/26"
|
|
4313
|
-
] }) : /* @__PURE__ */ a(
|
|
4314
|
-
return /* @__PURE__ */
|
|
4315
|
-
/* @__PURE__ */ a("div", { className: "px-6 pt-5 pb-3", children: /* @__PURE__ */
|
|
4312
|
+
] }) : /* @__PURE__ */ a(xe, { children: Ke(Je) });
|
|
4313
|
+
return /* @__PURE__ */ d("div", { className: "mx-auto mt-3 mb-3 rounded-2xl bg-white", children: [
|
|
4314
|
+
/* @__PURE__ */ a("div", { className: "px-6 pt-5 pb-3", children: /* @__PURE__ */ d("h3", { className: "font-semibold text-lg mb-2 text-gray-800 flex items-center gap-2", children: [
|
|
4316
4315
|
/* @__PURE__ */ a(
|
|
4317
|
-
|
|
4316
|
+
re,
|
|
4318
4317
|
{
|
|
4319
4318
|
icon: "mdi:receipt-text-check-outline",
|
|
4320
4319
|
width: "24",
|
|
@@ -4323,7 +4322,7 @@ const He = "USD", xn = (e) => {
|
|
|
4323
4322
|
),
|
|
4324
4323
|
"All set! Here’s what your smart order looks like 🧾"
|
|
4325
4324
|
] }) }),
|
|
4326
|
-
/* @__PURE__ */ a("div", { className: "px-6 pb-4", children: /* @__PURE__ */
|
|
4325
|
+
/* @__PURE__ */ a("div", { className: "px-6 pb-4", children: /* @__PURE__ */ d("div", { className: "grid grid-cols-1 sm:grid-cols-12 gap-4 rounded-xl border border-gray-200 bg-gray-50 p-3", children: [
|
|
4327
4326
|
/* @__PURE__ */ a("div", { className: "sm:col-span-2 flex", children: /* @__PURE__ */ a("div", { className: "w-30 h-26 sm:w-30 sm:h-26 overflow-hidden rounded-lg bg-white border border-gray-200 flex items-center justify-center mx-auto sm:mx-0", children: T ? /* @__PURE__ */ a(
|
|
4328
4327
|
"img",
|
|
4329
4328
|
{
|
|
@@ -4332,102 +4331,102 @@ const He = "USD", xn = (e) => {
|
|
|
4332
4331
|
className: "w-full h-full object-contain"
|
|
4333
4332
|
}
|
|
4334
4333
|
) : /* @__PURE__ */ a(
|
|
4335
|
-
|
|
4334
|
+
re,
|
|
4336
4335
|
{
|
|
4337
4336
|
icon: "mdi:image-outline",
|
|
4338
4337
|
width: "24",
|
|
4339
4338
|
className: "opacity-50"
|
|
4340
4339
|
}
|
|
4341
4340
|
) }) }),
|
|
4342
|
-
/* @__PURE__ */
|
|
4343
|
-
/* @__PURE__ */
|
|
4341
|
+
/* @__PURE__ */ d("div", { className: "sm:col-span-10", children: [
|
|
4342
|
+
/* @__PURE__ */ d("div", { className: "mb-3", children: [
|
|
4344
4343
|
/* @__PURE__ */ a("div", { className: "text-lg text-center font-bold text-gray-900", children: b }),
|
|
4345
|
-
/* @__PURE__ */
|
|
4344
|
+
/* @__PURE__ */ d("div", { className: "text-xs text-center font-bold text-gray-600", children: [
|
|
4346
4345
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "SKU:" }),
|
|
4347
4346
|
" ",
|
|
4348
|
-
|
|
4347
|
+
U ?? "—"
|
|
4349
4348
|
] }),
|
|
4350
|
-
(
|
|
4351
|
-
|
|
4349
|
+
(K || ue || te) && /* @__PURE__ */ d("div", { className: "text-xs text-gray-600 mt-0.5 text-center", children: [
|
|
4350
|
+
K && /* @__PURE__ */ d(xe, { children: [
|
|
4352
4351
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "SKU:" }),
|
|
4353
4352
|
" ",
|
|
4354
|
-
|
|
4353
|
+
K,
|
|
4355
4354
|
" "
|
|
4356
4355
|
] }),
|
|
4357
|
-
|
|
4356
|
+
ue && /* @__PURE__ */ d(xe, { children: [
|
|
4358
4357
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "Color:" }),
|
|
4359
4358
|
" ",
|
|
4360
|
-
|
|
4359
|
+
ue,
|
|
4361
4360
|
" "
|
|
4362
4361
|
] }),
|
|
4363
|
-
|
|
4362
|
+
te && /* @__PURE__ */ d(xe, { children: [
|
|
4364
4363
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "Size:" }),
|
|
4365
4364
|
" ",
|
|
4366
|
-
|
|
4365
|
+
te
|
|
4367
4366
|
] })
|
|
4368
4367
|
] })
|
|
4369
4368
|
] }),
|
|
4370
|
-
/* @__PURE__ */
|
|
4371
|
-
/* @__PURE__ */
|
|
4369
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-1 md-grid-cols-3 md:grid-cols-3 gap-3", children: [
|
|
4370
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4372
4371
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Unit Price" }),
|
|
4373
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4372
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: Ae(Ee, v) })
|
|
4374
4373
|
] }),
|
|
4375
|
-
/* @__PURE__ */
|
|
4374
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4376
4375
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Quantity" }),
|
|
4377
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4376
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: ye })
|
|
4378
4377
|
] }),
|
|
4379
|
-
/* @__PURE__ */
|
|
4378
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4380
4379
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Subtotal" }),
|
|
4381
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4380
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: Ae(Oe, v) })
|
|
4382
4381
|
] })
|
|
4383
4382
|
] })
|
|
4384
4383
|
] })
|
|
4385
4384
|
] }) }),
|
|
4386
|
-
/* @__PURE__ */
|
|
4387
|
-
/* @__PURE__ */
|
|
4388
|
-
/* @__PURE__ */
|
|
4385
|
+
/* @__PURE__ */ d("div", { className: "px-6 pb-2", children: [
|
|
4386
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-3 mb-3", children: [
|
|
4387
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3", children: [
|
|
4389
4388
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🏠 Address" }),
|
|
4390
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children:
|
|
4389
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: he })
|
|
4391
4390
|
] }),
|
|
4392
|
-
/* @__PURE__ */
|
|
4391
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3", children: [
|
|
4393
4392
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "💳 Payment" }),
|
|
4394
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children:
|
|
4393
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: ht })
|
|
4395
4394
|
] }),
|
|
4396
|
-
/* @__PURE__ */
|
|
4395
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3", children: [
|
|
4397
4396
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🚚 Delivery" }),
|
|
4398
4397
|
/* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: f != null && f.delivery && ((nt = at[f.delivery]) == null ? void 0 : nt.label) || "—" })
|
|
4399
4398
|
] })
|
|
4400
4399
|
] }),
|
|
4401
|
-
/* @__PURE__ */
|
|
4402
|
-
/* @__PURE__ */
|
|
4400
|
+
/* @__PURE__ */ d("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-3", children: [
|
|
4401
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center", children: [
|
|
4403
4402
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "💰 any(s)" }),
|
|
4404
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children:
|
|
4403
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: Ae(oe, v) })
|
|
4405
4404
|
] }),
|
|
4406
|
-
/* @__PURE__ */
|
|
4405
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center", children: [
|
|
4407
4406
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🏛️ Taxes" }),
|
|
4408
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children:
|
|
4407
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: Ae(Le, v) })
|
|
4409
4408
|
] }),
|
|
4410
|
-
/* @__PURE__ */
|
|
4409
|
+
/* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center", children: [
|
|
4411
4410
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🚚 Shipping" }),
|
|
4412
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children:
|
|
4411
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: Ae(se, v) })
|
|
4413
4412
|
] })
|
|
4414
4413
|
] }),
|
|
4415
|
-
/* @__PURE__ */
|
|
4414
|
+
/* @__PURE__ */ d(
|
|
4416
4415
|
"div",
|
|
4417
4416
|
{
|
|
4418
4417
|
className: "mt-4 rounded-xl p-4 text-center text-white shadow-sm",
|
|
4419
4418
|
style: { background: tt },
|
|
4420
4419
|
children: [
|
|
4421
4420
|
/* @__PURE__ */ a("div", { className: "text-sm/5 opacity-95", children: "🔹 Total Payable" }),
|
|
4422
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-3xl font-extrabold tracking-tight", children:
|
|
4421
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-3xl font-extrabold tracking-tight", children: Ae(oe + Le + se, v) })
|
|
4423
4422
|
]
|
|
4424
4423
|
}
|
|
4425
4424
|
)
|
|
4426
4425
|
] }),
|
|
4427
|
-
!
|
|
4426
|
+
!p && /* @__PURE__ */ d("div", { className: "px-6 pb-5", children: [
|
|
4428
4427
|
!k && /* @__PURE__ */ a("p", { className: "mt-3 text-center text-sm text-gray-700", children: "Everything looks good! Do you want me to watch this product and buy it automatically when it meets your condition?" }),
|
|
4429
4428
|
k && Ar({ intentMandateId: G }),
|
|
4430
|
-
er && !k && /* @__PURE__ */
|
|
4429
|
+
er && !k && /* @__PURE__ */ d("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-3", children: [
|
|
4431
4430
|
/* @__PURE__ */ a(
|
|
4432
4431
|
"button",
|
|
4433
4432
|
{
|
|
@@ -4451,7 +4450,7 @@ const He = "USD", xn = (e) => {
|
|
|
4451
4450
|
] });
|
|
4452
4451
|
}, _o = (u) => {
|
|
4453
4452
|
if (!u) return null;
|
|
4454
|
-
const
|
|
4453
|
+
const p = [
|
|
4455
4454
|
u.addressLine1,
|
|
4456
4455
|
u.addressLine2,
|
|
4457
4456
|
u.street,
|
|
@@ -4463,30 +4462,30 @@ const He = "USD", xn = (e) => {
|
|
|
4463
4462
|
{
|
|
4464
4463
|
className: "px-6 py-4",
|
|
4465
4464
|
style: { backgroundColor: "var(--tanya-light)" },
|
|
4466
|
-
children: /* @__PURE__ */
|
|
4467
|
-
/* @__PURE__ */
|
|
4468
|
-
/* @__PURE__ */ a(
|
|
4465
|
+
children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
|
|
4466
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
4467
|
+
/* @__PURE__ */ a(re, { icon: "mdi:home-map-marker", width: "20", color: I }),
|
|
4469
4468
|
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Delivery Address" })
|
|
4470
4469
|
] }),
|
|
4471
|
-
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children:
|
|
4470
|
+
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: p })
|
|
4472
4471
|
] })
|
|
4473
4472
|
}
|
|
4474
4473
|
);
|
|
4475
4474
|
}, Io = (u) => {
|
|
4476
|
-
const
|
|
4475
|
+
const p = u == null ? void 0 : u.method, f = p ? at[p] : void 0;
|
|
4477
4476
|
return /* @__PURE__ */ a(
|
|
4478
4477
|
"div",
|
|
4479
4478
|
{
|
|
4480
4479
|
className: "px-6 py-4",
|
|
4481
4480
|
style: { backgroundColor: "var(--tanya-light)" },
|
|
4482
|
-
children: /* @__PURE__ */
|
|
4483
|
-
/* @__PURE__ */
|
|
4484
|
-
/* @__PURE__ */ a(
|
|
4481
|
+
children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
|
|
4482
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
4483
|
+
/* @__PURE__ */ a(re, { icon: "mdi:truck-delivery", width: "20", color: I }),
|
|
4485
4484
|
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Delivery Method" })
|
|
4486
4485
|
] }),
|
|
4487
|
-
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: f ? /* @__PURE__ */
|
|
4488
|
-
/* @__PURE__ */
|
|
4489
|
-
/* @__PURE__ */ a(
|
|
4486
|
+
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: f ? /* @__PURE__ */ d(xe, { children: [
|
|
4487
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4488
|
+
/* @__PURE__ */ a(re, { icon: f.icon, width: "18" }),
|
|
4490
4489
|
/* @__PURE__ */ a("span", { className: "font-medium", children: f.label })
|
|
4491
4490
|
] }),
|
|
4492
4491
|
/* @__PURE__ */ a("div", { className: "text-gray-600", children: f.subtitle })
|
|
@@ -4495,16 +4494,16 @@ const He = "USD", xn = (e) => {
|
|
|
4495
4494
|
}
|
|
4496
4495
|
);
|
|
4497
4496
|
}, Fo = (u) => {
|
|
4498
|
-
const
|
|
4497
|
+
const p = (u == null ? void 0 : u.method) || "card";
|
|
4499
4498
|
return /* @__PURE__ */ a(
|
|
4500
4499
|
"div",
|
|
4501
4500
|
{
|
|
4502
4501
|
className: "px-6 py-4",
|
|
4503
4502
|
style: { backgroundColor: "var(--tanya-light)" },
|
|
4504
|
-
children: /* @__PURE__ */
|
|
4505
|
-
/* @__PURE__ */
|
|
4503
|
+
children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
|
|
4504
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
4506
4505
|
/* @__PURE__ */ a(
|
|
4507
|
-
|
|
4506
|
+
re,
|
|
4508
4507
|
{
|
|
4509
4508
|
icon: "mdi:credit-card-outline",
|
|
4510
4509
|
width: "20",
|
|
@@ -4513,21 +4512,21 @@ const He = "USD", xn = (e) => {
|
|
|
4513
4512
|
),
|
|
4514
4513
|
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Payment Method" })
|
|
4515
4514
|
] }),
|
|
4516
|
-
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children:
|
|
4515
|
+
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: p === "card" ? /* @__PURE__ */ d(xe, { children: [
|
|
4517
4516
|
"Credit Card — Mastercard",
|
|
4518
4517
|
/* @__PURE__ */ a("br", {}),
|
|
4519
4518
|
"•••• 7820 Exp: 12/26"
|
|
4520
|
-
] }) : Ke(
|
|
4519
|
+
] }) : Ke(p) })
|
|
4521
4520
|
] })
|
|
4522
4521
|
}
|
|
4523
4522
|
);
|
|
4524
|
-
}, Po = (u,
|
|
4523
|
+
}, Po = (u, p) => {
|
|
4525
4524
|
const f = u.snapshotStage;
|
|
4526
|
-
if (!f || f === "address" &&
|
|
4525
|
+
if (!f || f === "address" && le || f === "delivery" && Y || f === "payment" && X || f === "final" && Ne)
|
|
4527
4526
|
return null;
|
|
4528
4527
|
switch (f) {
|
|
4529
4528
|
case "initial":
|
|
4530
|
-
return Ur(u.snapshotPayload, !
|
|
4529
|
+
return Ur(u.snapshotPayload, !p);
|
|
4531
4530
|
case "address":
|
|
4532
4531
|
return _o(u.snapshotPayload);
|
|
4533
4532
|
case "delivery":
|
|
@@ -4535,7 +4534,7 @@ const He = "USD", xn = (e) => {
|
|
|
4535
4534
|
case "payment":
|
|
4536
4535
|
return Fo(u.snapshotPayload);
|
|
4537
4536
|
case "final":
|
|
4538
|
-
return qr(u.snapshotPayload, !
|
|
4537
|
+
return qr(u.snapshotPayload, !p);
|
|
4539
4538
|
case "success":
|
|
4540
4539
|
return Ar(u.snapshotPayload);
|
|
4541
4540
|
default:
|
|
@@ -4543,7 +4542,7 @@ const He = "USD", xn = (e) => {
|
|
|
4543
4542
|
}
|
|
4544
4543
|
};
|
|
4545
4544
|
return zo(
|
|
4546
|
-
/* @__PURE__ */
|
|
4545
|
+
/* @__PURE__ */ d(
|
|
4547
4546
|
"div",
|
|
4548
4547
|
{
|
|
4549
4548
|
className: "fixed inset-0",
|
|
@@ -4559,8 +4558,8 @@ const He = "USD", xn = (e) => {
|
|
|
4559
4558
|
onClick: t
|
|
4560
4559
|
}
|
|
4561
4560
|
),
|
|
4562
|
-
/* @__PURE__ */ a("div", { className: "absolute right-0 ", children: /* @__PURE__ */
|
|
4563
|
-
/* @__PURE__ */
|
|
4561
|
+
/* @__PURE__ */ a("div", { className: "absolute right-0 ", children: /* @__PURE__ */ d("div", { className: "w-[64.7vw] h-screen bg-white rounded-xl overflow-hidden flex flex-col shadow-xl", children: [
|
|
4562
|
+
/* @__PURE__ */ d(
|
|
4564
4563
|
"div",
|
|
4565
4564
|
{
|
|
4566
4565
|
style: {
|
|
@@ -4572,7 +4571,7 @@ const He = "USD", xn = (e) => {
|
|
|
4572
4571
|
background: kt
|
|
4573
4572
|
},
|
|
4574
4573
|
children: [
|
|
4575
|
-
/* @__PURE__ */
|
|
4574
|
+
/* @__PURE__ */ d(
|
|
4576
4575
|
"div",
|
|
4577
4576
|
{
|
|
4578
4577
|
style: {
|
|
@@ -4582,7 +4581,7 @@ const He = "USD", xn = (e) => {
|
|
|
4582
4581
|
gap: "0.5rem"
|
|
4583
4582
|
},
|
|
4584
4583
|
children: [
|
|
4585
|
-
/* @__PURE__ */ a(
|
|
4584
|
+
/* @__PURE__ */ a(re, { icon: "ph:sparkle-duotone", width: "25", height: "25" }),
|
|
4586
4585
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "font-bold", children: "Agentic Shopping with TANYA" }) })
|
|
4587
4586
|
]
|
|
4588
4587
|
}
|
|
@@ -4597,7 +4596,7 @@ const He = "USD", xn = (e) => {
|
|
|
4597
4596
|
margin: "0.75rem"
|
|
4598
4597
|
},
|
|
4599
4598
|
children: /* @__PURE__ */ a(
|
|
4600
|
-
|
|
4599
|
+
re,
|
|
4601
4600
|
{
|
|
4602
4601
|
icon: "fluent:dismiss-24-filled",
|
|
4603
4602
|
color: "#ffffff",
|
|
@@ -4612,20 +4611,20 @@ const He = "USD", xn = (e) => {
|
|
|
4612
4611
|
]
|
|
4613
4612
|
}
|
|
4614
4613
|
),
|
|
4615
|
-
/* @__PURE__ */
|
|
4614
|
+
/* @__PURE__ */ d(
|
|
4616
4615
|
"div",
|
|
4617
4616
|
{
|
|
4618
|
-
ref:
|
|
4617
|
+
ref: pt,
|
|
4619
4618
|
className: "overflow-y-auto pr-5 pb-4 space-y-4 hide-scrollbar flex-grow",
|
|
4620
4619
|
children: [
|
|
4621
|
-
/* @__PURE__ */
|
|
4620
|
+
/* @__PURE__ */ d(
|
|
4622
4621
|
"div",
|
|
4623
4622
|
{
|
|
4624
4623
|
className: "text-sm text-[16px] rounded-r-xl p-3 m-3 rounded-bl-xl w-3/4 text-tanya-contrast",
|
|
4625
4624
|
style: { backgroundColor: "#e5dbeb" },
|
|
4626
4625
|
children: [
|
|
4627
4626
|
"Welcome to your smart shopping companion!",
|
|
4628
|
-
/* @__PURE__ */
|
|
4627
|
+
/* @__PURE__ */ d("p", { children: [
|
|
4629
4628
|
"Simply share your instruction — like “If this product goes below $",
|
|
4630
4629
|
parseInt(r.price) - 5,
|
|
4631
4630
|
" grab it for me.”"
|
|
@@ -4635,11 +4634,11 @@ const He = "USD", xn = (e) => {
|
|
|
4635
4634
|
}
|
|
4636
4635
|
),
|
|
4637
4636
|
/* @__PURE__ */ a(Co, {}),
|
|
4638
|
-
|
|
4639
|
-
Ye.map((u,
|
|
4637
|
+
g > 1 && /* @__PURE__ */ a(Br, { showSubmit: !1 }),
|
|
4638
|
+
Ye.map((u, p) => {
|
|
4640
4639
|
var T;
|
|
4641
|
-
const f =
|
|
4642
|
-
return /* @__PURE__ */
|
|
4640
|
+
const f = p === Ye.length - 1, v = !!u.snapshotStage;
|
|
4641
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
4643
4642
|
u.query && /* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a(
|
|
4644
4643
|
"p",
|
|
4645
4644
|
{
|
|
@@ -4662,8 +4661,8 @@ const He = "USD", xn = (e) => {
|
|
|
4662
4661
|
children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a("p", { children: u.snapshotPayload.text }) })
|
|
4663
4662
|
}
|
|
4664
4663
|
) }),
|
|
4665
|
-
f && E &&
|
|
4666
|
-
/* @__PURE__ */
|
|
4664
|
+
f && E && g > 1 && /* @__PURE__ */ d("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in", children: [
|
|
4665
|
+
/* @__PURE__ */ d("div", { className: "text-sm text-gray-800", children: [
|
|
4667
4666
|
"Proceed with color:",
|
|
4668
4667
|
" ",
|
|
4669
4668
|
/* @__PURE__ */ a("span", { className: "font-semibold", children: qe(w) || "—" }),
|
|
@@ -4672,7 +4671,7 @@ const He = "USD", xn = (e) => {
|
|
|
4672
4671
|
/* @__PURE__ */ a("span", { className: "font-semibold", children: We(w) || "—" }),
|
|
4673
4672
|
"?"
|
|
4674
4673
|
] }),
|
|
4675
|
-
/* @__PURE__ */
|
|
4674
|
+
/* @__PURE__ */ d("div", { className: "mt-3 flex gap-3", children: [
|
|
4676
4675
|
/* @__PURE__ */ a(
|
|
4677
4676
|
"button",
|
|
4678
4677
|
{
|
|
@@ -4685,7 +4684,7 @@ const He = "USD", xn = (e) => {
|
|
|
4685
4684
|
/* @__PURE__ */ a(
|
|
4686
4685
|
"button",
|
|
4687
4686
|
{
|
|
4688
|
-
onClick:
|
|
4687
|
+
onClick: po,
|
|
4689
4688
|
className: "px-5 py-2 rounded-full font-semibold border",
|
|
4690
4689
|
style: {
|
|
4691
4690
|
borderColor: I,
|
|
@@ -4696,8 +4695,8 @@ const He = "USD", xn = (e) => {
|
|
|
4696
4695
|
)
|
|
4697
4696
|
] })
|
|
4698
4697
|
] }),
|
|
4699
|
-
f &&
|
|
4700
|
-
f &&
|
|
4698
|
+
f && we && /* @__PURE__ */ a(Br, { showSubmit: !0 }),
|
|
4699
|
+
f && Q && /* @__PURE__ */ a("div", { className: "mt-4", children: /* @__PURE__ */ a(
|
|
4701
4700
|
"div",
|
|
4702
4701
|
{
|
|
4703
4702
|
className: "text-sm text-tanya-contrast px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",
|
|
@@ -4708,7 +4707,7 @@ const He = "USD", xn = (e) => {
|
|
|
4708
4707
|
children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2 tanya-pulse-text", children: /* @__PURE__ */ a("p", { children: "Reading your instruction and setting things up…" }) })
|
|
4709
4708
|
}
|
|
4710
4709
|
) }),
|
|
4711
|
-
(v || u.response === "__CARD__") && (!
|
|
4710
|
+
(v || u.response === "__CARD__") && (!Q || !f) && /* @__PURE__ */ a(
|
|
4712
4711
|
"div",
|
|
4713
4712
|
{
|
|
4714
4713
|
className: "mt-6 mb-4 mx-4 animate-fade-in",
|
|
@@ -4724,13 +4723,13 @@ const He = "USD", xn = (e) => {
|
|
|
4724
4723
|
)
|
|
4725
4724
|
}
|
|
4726
4725
|
)
|
|
4727
|
-
] },
|
|
4726
|
+
] }, p);
|
|
4728
4727
|
}),
|
|
4729
|
-
|
|
4730
|
-
/* @__PURE__ */
|
|
4731
|
-
/* @__PURE__ */
|
|
4728
|
+
le && /* @__PURE__ */ d("div", { className: "mt-6 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in", children: [
|
|
4729
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4730
|
+
/* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
|
|
4732
4731
|
/* @__PURE__ */ a(
|
|
4733
|
-
|
|
4732
|
+
re,
|
|
4734
4733
|
{
|
|
4735
4734
|
icon: "mdi:home-map-marker",
|
|
4736
4735
|
width: "24",
|
|
@@ -4739,7 +4738,7 @@ const He = "USD", xn = (e) => {
|
|
|
4739
4738
|
),
|
|
4740
4739
|
"Select a Delivery Address"
|
|
4741
4740
|
] }),
|
|
4742
|
-
j && /* @__PURE__ */
|
|
4741
|
+
j && /* @__PURE__ */ d(xe, { children: [
|
|
4743
4742
|
/* @__PURE__ */ a("span", { className: "ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold", children: "Selected" }),
|
|
4744
4743
|
!k && /* @__PURE__ */ a(
|
|
4745
4744
|
"button",
|
|
@@ -4757,7 +4756,7 @@ const He = "USD", xn = (e) => {
|
|
|
4757
4756
|
] })
|
|
4758
4757
|
] }),
|
|
4759
4758
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-600 mb-4", children: "Choose where you’d like us to deliver this item." }),
|
|
4760
|
-
s ? /* @__PURE__ */
|
|
4759
|
+
s ? /* @__PURE__ */ d("div", { className: "flex items-center py-6", children: [
|
|
4761
4760
|
/* @__PURE__ */ a(
|
|
4762
4761
|
"div",
|
|
4763
4762
|
{
|
|
@@ -4766,17 +4765,17 @@ const He = "USD", xn = (e) => {
|
|
|
4766
4765
|
}
|
|
4767
4766
|
),
|
|
4768
4767
|
/* @__PURE__ */ a("p", { className: "ml-3 text-gray-600", children: "Fetching your addresses..." })
|
|
4769
|
-
] }) : Ze.length > 0 ? /* @__PURE__ */
|
|
4768
|
+
] }) : Ze.length > 0 ? /* @__PURE__ */ d(
|
|
4770
4769
|
"div",
|
|
4771
4770
|
{
|
|
4772
4771
|
className: `space-y-3 ${j ? "opacity-70" : ""}`,
|
|
4773
4772
|
children: [
|
|
4774
4773
|
Ze.map((u) => {
|
|
4775
|
-
const
|
|
4776
|
-
return /* @__PURE__ */
|
|
4774
|
+
const p = [u.addressLine1, u.addressLine2].filter(Boolean).map((K) => Ke(K || "")).join(" "), f = Ke(u.city || ""), v = `${Ke(u.state || "")}${u.state && u.postalCode ? ", " : ""}${u.postalCode || ""}`, T = Ke(u.country || ""), b = String(u.addressId ?? u.id), U = Ie === b;
|
|
4775
|
+
return /* @__PURE__ */ d(
|
|
4777
4776
|
"label",
|
|
4778
4777
|
{
|
|
4779
|
-
className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${
|
|
4778
|
+
className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${U ? "border-tanya-light" : "border-gray-300"} ${j ? "pointer-events-none" : ""}`,
|
|
4780
4779
|
title: j ? "Address already submitted" : "",
|
|
4781
4780
|
children: [
|
|
4782
4781
|
/* @__PURE__ */ a(
|
|
@@ -4785,15 +4784,15 @@ const He = "USD", xn = (e) => {
|
|
|
4785
4784
|
type: "radio",
|
|
4786
4785
|
name: "address",
|
|
4787
4786
|
className: "mt-1 accent-tanya-light",
|
|
4788
|
-
checked:
|
|
4787
|
+
checked: U,
|
|
4789
4788
|
disabled: j,
|
|
4790
4789
|
onChange: () => Zt(b),
|
|
4791
4790
|
value: b
|
|
4792
4791
|
}
|
|
4793
4792
|
),
|
|
4794
|
-
/* @__PURE__ */
|
|
4795
|
-
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children:
|
|
4796
|
-
/* @__PURE__ */
|
|
4793
|
+
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
4794
|
+
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: p || "Address" }),
|
|
4795
|
+
/* @__PURE__ */ d("div", { className: "text-sm text-gray-700", children: [
|
|
4797
4796
|
f,
|
|
4798
4797
|
/* @__PURE__ */ a("br", {}),
|
|
4799
4798
|
v,
|
|
@@ -4806,7 +4805,7 @@ const He = "USD", xn = (e) => {
|
|
|
4806
4805
|
b
|
|
4807
4806
|
);
|
|
4808
4807
|
}),
|
|
4809
|
-
/* @__PURE__ */
|
|
4808
|
+
/* @__PURE__ */ d("div", { className: "flex justify-between pt-2", children: [
|
|
4810
4809
|
/* @__PURE__ */ a(
|
|
4811
4810
|
"button",
|
|
4812
4811
|
{
|
|
@@ -4834,11 +4833,11 @@ const He = "USD", xn = (e) => {
|
|
|
4834
4833
|
}
|
|
4835
4834
|
) : /* @__PURE__ */ a("div", { className: "text-center py-8 text-gray-600", children: "No addresses found. Please add a new one in your profile." })
|
|
4836
4835
|
] }),
|
|
4837
|
-
|
|
4838
|
-
/* @__PURE__ */
|
|
4839
|
-
/* @__PURE__ */
|
|
4836
|
+
Y && /* @__PURE__ */ d("div", { className: "mt-2 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in", children: [
|
|
4837
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4838
|
+
/* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
|
|
4840
4839
|
/* @__PURE__ */ a(
|
|
4841
|
-
|
|
4840
|
+
re,
|
|
4842
4841
|
{
|
|
4843
4842
|
icon: "mdi:truck-delivery",
|
|
4844
4843
|
width: "24",
|
|
@@ -4847,7 +4846,7 @@ const He = "USD", xn = (e) => {
|
|
|
4847
4846
|
),
|
|
4848
4847
|
"Great! Now choose how fast you want it delivered 🚚"
|
|
4849
4848
|
] }),
|
|
4850
|
-
B && /* @__PURE__ */
|
|
4849
|
+
B && /* @__PURE__ */ d(xe, { children: [
|
|
4851
4850
|
/* @__PURE__ */ a("span", { className: "ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold", children: "Selected" }),
|
|
4852
4851
|
!k && /* @__PURE__ */ a(
|
|
4853
4852
|
"button",
|
|
@@ -4871,8 +4870,8 @@ const He = "USD", xn = (e) => {
|
|
|
4871
4870
|
className: `space-y-3 ${B ? "opacity-70" : ""}`,
|
|
4872
4871
|
children: Object.keys(at).map(
|
|
4873
4872
|
(u) => {
|
|
4874
|
-
const
|
|
4875
|
-
return /* @__PURE__ */
|
|
4873
|
+
const p = at[u], f = A === u;
|
|
4874
|
+
return /* @__PURE__ */ d(
|
|
4876
4875
|
"label",
|
|
4877
4876
|
{
|
|
4878
4877
|
className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${f ? "border-tanya-light" : "border-gray-300"} ${B ? "pointer-events-none" : ""}`,
|
|
@@ -4886,20 +4885,20 @@ const He = "USD", xn = (e) => {
|
|
|
4886
4885
|
className: "mt-1 accent-tanya-light",
|
|
4887
4886
|
checked: f,
|
|
4888
4887
|
disabled: B,
|
|
4889
|
-
onChange: () =>
|
|
4888
|
+
onChange: () => ce(u)
|
|
4890
4889
|
}
|
|
4891
4890
|
),
|
|
4892
|
-
/* @__PURE__ */
|
|
4893
|
-
/* @__PURE__ */
|
|
4894
|
-
/* @__PURE__ */ a(
|
|
4891
|
+
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
4892
|
+
/* @__PURE__ */ d("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children: [
|
|
4893
|
+
/* @__PURE__ */ a(re, { icon: p.icon, width: "18" }),
|
|
4895
4894
|
" ",
|
|
4896
|
-
|
|
4895
|
+
p.label
|
|
4897
4896
|
] }),
|
|
4898
|
-
/* @__PURE__ */ a("div", { className: "text-sm text-gray-700", children:
|
|
4897
|
+
/* @__PURE__ */ a("div", { className: "text-sm text-gray-700", children: p.subtitle })
|
|
4899
4898
|
] }),
|
|
4900
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold text-gray-800", children:
|
|
4901
|
-
|
|
4902
|
-
(
|
|
4899
|
+
/* @__PURE__ */ a("div", { className: "text-sm font-semibold text-gray-800", children: p.fee === 0 ? "Free" : Ae(
|
|
4900
|
+
p.fee,
|
|
4901
|
+
(q == null ? void 0 : q.currency) || He
|
|
4903
4902
|
) })
|
|
4904
4903
|
]
|
|
4905
4904
|
},
|
|
@@ -4909,7 +4908,7 @@ const He = "USD", xn = (e) => {
|
|
|
4909
4908
|
)
|
|
4910
4909
|
}
|
|
4911
4910
|
),
|
|
4912
|
-
/* @__PURE__ */
|
|
4911
|
+
/* @__PURE__ */ d("div", { className: "flex justify-between pt-4", children: [
|
|
4913
4912
|
/* @__PURE__ */ a(
|
|
4914
4913
|
"button",
|
|
4915
4914
|
{
|
|
@@ -4934,11 +4933,11 @@ const He = "USD", xn = (e) => {
|
|
|
4934
4933
|
)
|
|
4935
4934
|
] })
|
|
4936
4935
|
] }),
|
|
4937
|
-
|
|
4938
|
-
/* @__PURE__ */
|
|
4939
|
-
/* @__PURE__ */
|
|
4936
|
+
X && /* @__PURE__ */ d("div", { className: "mt-2 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in", children: [
|
|
4937
|
+
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4938
|
+
/* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
|
|
4940
4939
|
/* @__PURE__ */ a(
|
|
4941
|
-
|
|
4940
|
+
re,
|
|
4942
4941
|
{
|
|
4943
4942
|
icon: "mdi:credit-card-outline",
|
|
4944
4943
|
width: "24",
|
|
@@ -4947,7 +4946,7 @@ const He = "USD", xn = (e) => {
|
|
|
4947
4946
|
),
|
|
4948
4947
|
"Almost done! 💳"
|
|
4949
4948
|
] }),
|
|
4950
|
-
|
|
4949
|
+
Z && /* @__PURE__ */ d(xe, { children: [
|
|
4951
4950
|
/* @__PURE__ */ a("span", { className: "ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold", children: "Selected" }),
|
|
4952
4951
|
!k && /* @__PURE__ */ a(
|
|
4953
4952
|
"button",
|
|
@@ -4968,12 +4967,12 @@ const He = "USD", xn = (e) => {
|
|
|
4968
4967
|
/* @__PURE__ */ a(
|
|
4969
4968
|
"div",
|
|
4970
4969
|
{
|
|
4971
|
-
className: `space-y-3 ${
|
|
4972
|
-
children: /* @__PURE__ */
|
|
4970
|
+
className: `space-y-3 ${Z ? "opacity-70" : ""}`,
|
|
4971
|
+
children: /* @__PURE__ */ d(
|
|
4973
4972
|
"label",
|
|
4974
4973
|
{
|
|
4975
|
-
className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${
|
|
4976
|
-
title:
|
|
4974
|
+
className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${ke === "card" ? "border-tanya-light" : "border-gray-300"} ${Z ? "pointer-events-none" : ""}`,
|
|
4975
|
+
title: Z ? "Payment already submitted" : "",
|
|
4977
4976
|
children: [
|
|
4978
4977
|
/* @__PURE__ */ a(
|
|
4979
4978
|
"input",
|
|
@@ -4981,18 +4980,18 @@ const He = "USD", xn = (e) => {
|
|
|
4981
4980
|
type: "radio",
|
|
4982
4981
|
name: "payment",
|
|
4983
4982
|
className: "mt-1 accent-tanya-light",
|
|
4984
|
-
checked:
|
|
4985
|
-
disabled:
|
|
4986
|
-
onChange: () =>
|
|
4983
|
+
checked: ke === "card",
|
|
4984
|
+
disabled: Z,
|
|
4985
|
+
onChange: () => Se("card")
|
|
4987
4986
|
}
|
|
4988
4987
|
),
|
|
4989
|
-
/* @__PURE__ */
|
|
4990
|
-
/* @__PURE__ */
|
|
4991
|
-
/* @__PURE__ */ a(
|
|
4988
|
+
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
4989
|
+
/* @__PURE__ */ d("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children: [
|
|
4990
|
+
/* @__PURE__ */ a(re, { icon: "mdi:credit-card-chip-outline", width: "18" }),
|
|
4992
4991
|
" ",
|
|
4993
4992
|
"Credit Card"
|
|
4994
4993
|
] }),
|
|
4995
|
-
|
|
4994
|
+
ke === "card" && /* @__PURE__ */ d("div", { className: "text-sm text-gray-700 mt-1", children: [
|
|
4996
4995
|
"Mastercard •••• 7820",
|
|
4997
4996
|
/* @__PURE__ */ a("br", {}),
|
|
4998
4997
|
"Expiry: 12/26"
|
|
@@ -5003,7 +5002,7 @@ const He = "USD", xn = (e) => {
|
|
|
5003
5002
|
)
|
|
5004
5003
|
}
|
|
5005
5004
|
),
|
|
5006
|
-
/* @__PURE__ */
|
|
5005
|
+
/* @__PURE__ */ d("div", { className: "flex justify-between pt-4", children: [
|
|
5007
5006
|
/* @__PURE__ */ a(
|
|
5008
5007
|
"button",
|
|
5009
5008
|
{
|
|
@@ -5020,30 +5019,30 @@ const He = "USD", xn = (e) => {
|
|
|
5020
5019
|
"button",
|
|
5021
5020
|
{
|
|
5022
5021
|
onClick: vo,
|
|
5023
|
-
disabled:
|
|
5024
|
-
className: `px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${
|
|
5022
|
+
disabled: Z,
|
|
5023
|
+
className: `px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${Z ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
|
|
5025
5024
|
style: { background: "var(--tanya)" },
|
|
5026
|
-
children:
|
|
5025
|
+
children: Z ? "Payment Submitted" : "Submit Payment Method"
|
|
5027
5026
|
}
|
|
5028
5027
|
)
|
|
5029
5028
|
] })
|
|
5030
5029
|
] }),
|
|
5031
|
-
|
|
5030
|
+
Ne && qr(
|
|
5032
5031
|
{
|
|
5033
|
-
...
|
|
5032
|
+
...q,
|
|
5034
5033
|
address: JSON.parse(
|
|
5035
5034
|
localStorage.getItem("agentic_order_address") || "null"
|
|
5036
5035
|
),
|
|
5037
5036
|
delivery: localStorage.getItem("agentic_order_delivery"),
|
|
5038
5037
|
payment: localStorage.getItem("agentic_order_payment"),
|
|
5039
|
-
summary: Dr(
|
|
5038
|
+
summary: Dr(q == null ? void 0 : q.currency)
|
|
5040
5039
|
},
|
|
5041
5040
|
!1
|
|
5042
5041
|
)
|
|
5043
5042
|
]
|
|
5044
5043
|
}
|
|
5045
5044
|
),
|
|
5046
|
-
/* @__PURE__ */
|
|
5045
|
+
/* @__PURE__ */ d("div", { className: "sticky bottom-0 w-[96%] drop-shadow-xl flex items-center rounded-full bg-white border border-gray-300 m-[15px]", children: [
|
|
5047
5046
|
/* @__PURE__ */ a(
|
|
5048
5047
|
"input",
|
|
5049
5048
|
{
|
|
@@ -5051,9 +5050,9 @@ const He = "USD", xn = (e) => {
|
|
|
5051
5050
|
disabled: fo,
|
|
5052
5051
|
className: `w-full rounded-full p-4 outline-none border-none focus:ring-0 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed
|
|
5053
5052
|
${Nt ? "" : "placeholder:text-red-400 text-red-500"}`,
|
|
5054
|
-
value:
|
|
5053
|
+
value: $e,
|
|
5055
5054
|
onKeyDown: (u) => {
|
|
5056
|
-
u.key === "Enter" && !
|
|
5055
|
+
u.key === "Enter" && !Q && !L && Lr();
|
|
5057
5056
|
},
|
|
5058
5057
|
onChange: (u) => pe(u.target.value)
|
|
5059
5058
|
}
|
|
@@ -5062,18 +5061,18 @@ const He = "USD", xn = (e) => {
|
|
|
5062
5061
|
"button",
|
|
5063
5062
|
{
|
|
5064
5063
|
type: "submit",
|
|
5065
|
-
disabled:
|
|
5064
|
+
disabled: Q || L,
|
|
5066
5065
|
className: "mr-6 font-medium",
|
|
5067
5066
|
style: { color: "var(--tanya-light)" },
|
|
5068
5067
|
onClick: () => Lr(),
|
|
5069
|
-
children:
|
|
5068
|
+
children: Q ? /* @__PURE__ */ a(
|
|
5070
5069
|
"div",
|
|
5071
5070
|
{
|
|
5072
5071
|
className: "m-3 animate-spin rounded-full h-6 w-6 border-b-2",
|
|
5073
5072
|
style: { borderBottom: "2px solid" }
|
|
5074
5073
|
}
|
|
5075
5074
|
) : /* @__PURE__ */ a(
|
|
5076
|
-
|
|
5075
|
+
re,
|
|
5077
5076
|
{
|
|
5078
5077
|
icon: "fluent:send-48-filled",
|
|
5079
5078
|
color: "var(--tanya-light)",
|