@aizu-chat/react 0.0.10 → 0.1.1
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/index.d.mts +127 -4
- package/dist/index.d.ts +127 -4
- package/dist/index.js +900 -280
- package/dist/index.mjs +2039 -8
- package/package.json +12 -28
- package/dist/chunk-2TI7IWH7.mjs +0 -67
- package/dist/chunk-33CPD3DF.mjs +0 -59
- package/dist/chunk-HDOMF6SD.mjs +0 -1370
- package/dist/chunk-KLPKNMIP.mjs +0 -15
- package/dist/chunk-TXBCCMO7.mjs +0 -1186
- package/dist/components.d.mts +0 -59
- package/dist/components.d.ts +0 -59
- package/dist/components.js +0 -1441
- package/dist/components.mjs +0 -14
- package/dist/hooks.d.mts +0 -6
- package/dist/hooks.d.ts +0 -6
- package/dist/hooks.js +0 -40
- package/dist/hooks.mjs +0 -8
- package/dist/sdk.d.mts +0 -38
- package/dist/sdk.d.ts +0 -38
- package/dist/sdk.js +0 -136
- package/dist/sdk.mjs +0 -10
package/dist/index.js
CHANGED
|
@@ -71,9 +71,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
71
71
|
var src_exports = {};
|
|
72
72
|
__export(src_exports, {
|
|
73
73
|
AizuChat: () => AizuChat,
|
|
74
|
+
AizuClient: () => AizuClient,
|
|
74
75
|
Button: () => Button,
|
|
75
76
|
Loading: () => Loading,
|
|
76
77
|
QuickMenus: () => QuickMenus,
|
|
78
|
+
TestComponent: () => TestComponent,
|
|
79
|
+
TypeResponse: () => TypeResponse,
|
|
80
|
+
createAizuClient: () => createAizuClient,
|
|
77
81
|
useCustom: () => useCustom
|
|
78
82
|
});
|
|
79
83
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -101,7 +105,7 @@ function styleInject(css, { insertAt } = {}) {
|
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
// src/global.css
|
|
104
|
-
styleInject('/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root,\n :host {\n --font-sans:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n --font-mono:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n --color-red-500: oklch(63.7% 0.237 25.331);\n --color-orange-200: oklch(90.1% 0.076 70.697);\n --color-orange-300: oklch(83.7% 0.128 66.29);\n --color-orange-400: oklch(75% 0.183 55.934);\n --color-orange-500: oklch(70.5% 0.213 47.604);\n --color-gray-100: oklch(96.7% 0.003 264.542);\n --color-gray-200: oklch(92.8% 0.006 264.531);\n --color-gray-300: oklch(87.2% 0.01 258.338);\n --color-gray-500: oklch(55.1% 0.027 264.364);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --radius-sm: 0.25rem;\n --radius-2xl: 1rem;\n --radius-3xl: 1.5rem;\n --radius-4xl: 2rem;\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n --font-sukhumvit:\n "Sukhumvit Set",\n ui-sans-serif,\n system-ui,\n sans-serif;\n --animate-circle-keys: circle-keys 2s ease-in-out infinite;\n }\n}\n@layer base {\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit,\n ::-webkit-datetime-edit-year-field,\n ::-webkit-datetime-edit-month-field,\n ::-webkit-datetime-edit-day-field,\n ::-webkit-datetime-edit-hour-field,\n ::-webkit-datetime-edit-minute-field,\n ::-webkit-datetime-edit-second-field,\n ::-webkit-datetime-edit-millisecond-field,\n ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type=button], [type=reset], [type=submit]),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=until-found])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-auto {\n pointer-events: auto;\n }\n .pointer-events-none {\n pointer-events: none;\n }\n .invisible {\n visibility: hidden;\n }\n .absolute {\n position: absolute;\n }\n .fixed {\n position: fixed;\n }\n .relative {\n position: relative;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%);\n }\n .right-0 {\n right: calc(var(--spacing) * 0);\n }\n .right-2 {\n right: calc(var(--spacing) * 2);\n }\n .right-5 {\n right: calc(var(--spacing) * 5);\n }\n .bottom-0 {\n bottom: calc(var(--spacing) * 0);\n }\n .bottom-5 {\n bottom: calc(var(--spacing) * 5);\n }\n .z-10 {\n z-index: 10;\n }\n .z-3000 {\n z-index: 3000;\n }\n .z-9998 {\n z-index: 9998;\n }\n .z-9999 {\n z-index: 9999;\n }\n .-mx-4 {\n margin-inline: calc(var(--spacing) * -4);\n }\n .mt-1 {\n margin-top: calc(var(--spacing) * 1);\n }\n .mt-auto {\n margin-top: auto;\n }\n .mr-3 {\n margin-right: calc(var(--spacing) * 3);\n }\n .mr-auto {\n margin-right: auto;\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .mb-3 {\n margin-bottom: calc(var(--spacing) * 3);\n }\n .mb-4 {\n margin-bottom: calc(var(--spacing) * 4);\n }\n .mb-6 {\n margin-bottom: calc(var(--spacing) * 6);\n }\n .ml-auto {\n margin-left: auto;\n }\n .line-clamp-2 {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .aspect-square {\n aspect-ratio: 1 / 1;\n }\n .h-2 {\n height: calc(var(--spacing) * 2);\n }\n .h-8 {\n height: calc(var(--spacing) * 8);\n }\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n .h-16 {\n height: calc(var(--spacing) * 16);\n }\n .h-29\\.5 {\n height: calc(var(--spacing) * 29.5);\n }\n .h-42\\.5 {\n height: calc(var(--spacing) * 42.5);\n }\n .h-full {\n height: 100%;\n }\n .min-h-full {\n min-height: 100%;\n }\n .w-2 {\n width: calc(var(--spacing) * 2);\n }\n .w-8 {\n width: calc(var(--spacing) * 8);\n }\n .w-10 {\n width: calc(var(--spacing) * 10);\n }\n .w-16 {\n width: calc(var(--spacing) * 16);\n }\n .w-75\\.5 {\n width: calc(var(--spacing) * 75.5);\n }\n .w-\\[calc\\(100\\%\\/2\\)\\] {\n width: calc(100% / 2);\n }\n .w-full {\n width: 100%;\n }\n .max-w-69\\.5 {\n max-width: calc(var(--spacing) * 69.5);\n }\n .max-w-75\\.5 {\n max-width: calc(var(--spacing) * 75.5);\n }\n .max-w-\\[calc\\(100\\%\\/2\\)\\] {\n max-width: calc(100% / 2);\n }\n .max-w-max {\n max-width: max-content;\n }\n .min-w-full {\n min-width: 100%;\n }\n .min-w-max {\n min-width: max-content;\n }\n .flex-1 {\n flex: 1;\n }\n .shrink-0 {\n flex-shrink: 0;\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .translate-y-0 {\n --tw-translate-y: calc(var(--spacing) * 0);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .translate-y-4 {\n --tw-translate-y: calc(var(--spacing) * 4);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .transform {\n transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);\n }\n .animate-circle-keys {\n animation: var(--animate-circle-keys);\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .snap-x {\n scroll-snap-type: x var(--tw-scroll-snap-strictness);\n }\n .snap-mandatory {\n --tw-scroll-snap-strictness: mandatory;\n }\n .snap-start {\n scroll-snap-align: start;\n }\n .flex-col {\n flex-direction: column;\n }\n .flex-wrap {\n flex-wrap: wrap;\n }\n .items-center {\n align-items: center;\n }\n .items-start {\n align-items: flex-start;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .justify-end {\n justify-content: flex-end;\n }\n .gap-1 {\n gap: calc(var(--spacing) * 1);\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3);\n }\n .gap-x-1 {\n column-gap: calc(var(--spacing) * 1);\n }\n .gap-x-2 {\n column-gap: calc(var(--spacing) * 2);\n }\n .gap-y-3 {\n row-gap: calc(var(--spacing) * 3);\n }\n .overflow-hidden {\n overflow: hidden;\n }\n .overflow-x-auto {\n overflow-x: auto;\n }\n .overflow-x-scroll {\n overflow-x: scroll;\n }\n .overflow-y-auto {\n overflow-y: auto;\n }\n .rounded-2xl {\n border-radius: var(--radius-2xl);\n }\n .rounded-3xl {\n border-radius: var(--radius-3xl);\n }\n .rounded-full {\n border-radius: calc(infinity * 1px);\n }\n .rounded-sm {\n border-radius: var(--radius-sm);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n }\n .border-none {\n --tw-border-style: none;\n border-style: none;\n }\n .border-black\\/50 {\n border-color: color-mix(in srgb, #000 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n border-color: color-mix(in oklab, var(--color-black) 50%, transparent);\n }\n }\n .border-gray-200 {\n border-color: var(--color-gray-200);\n }\n .border-orange-300 {\n border-color: var(--color-orange-300);\n }\n .border-orange-400 {\n border-color: var(--color-orange-400);\n }\n .bg-\\[\\#3D3D3D\\] {\n background-color: #3D3D3D;\n }\n .bg-\\[\\#F8F8FA\\] {\n background-color: #F8F8FA;\n }\n .bg-\\[\\#FFF0D3\\] {\n background-color: #FFF0D3;\n }\n .bg-black\\/50 {\n background-color: color-mix(in srgb, #000 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 50%, transparent);\n }\n }\n .bg-gray-100 {\n background-color: var(--color-gray-100);\n }\n .bg-gray-200 {\n background-color: var(--color-gray-200);\n }\n .bg-orange-200 {\n background-color: var(--color-orange-200);\n }\n .bg-orange-400 {\n background-color: var(--color-orange-400);\n }\n .bg-orange-500 {\n background-color: var(--color-orange-500);\n }\n .bg-white {\n background-color: var(--color-white);\n }\n .bg-linear-to-l {\n --tw-gradient-position: to left;\n @supports (background-image: linear-gradient(in lab, red, red)) {\n --tw-gradient-position: to left in oklab;\n }\n background-image: linear-gradient(var(--tw-gradient-stops));\n }\n .from-white {\n --tw-gradient-from: var(--color-white);\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .to-transparent {\n --tw-gradient-to: transparent;\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-2\\.5 {\n padding: calc(var(--spacing) * 2.5);\n }\n .p-3 {\n padding: calc(var(--spacing) * 3);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3);\n }\n .py-px {\n padding-block: 1px;\n }\n .pt-4 {\n padding-top: calc(var(--spacing) * 4);\n }\n .pr-10 {\n padding-right: calc(var(--spacing) * 10);\n }\n .pr-12 {\n padding-right: calc(var(--spacing) * 12);\n }\n .pb-2 {\n padding-bottom: calc(var(--spacing) * 2);\n }\n .pl-4 {\n padding-left: calc(var(--spacing) * 4);\n }\n .text-center {\n text-align: center;\n }\n .text-left {\n text-align: left;\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .text-\\[10px\\] {\n font-size: 10px;\n }\n .text-\\[12px\\] {\n font-size: 12px;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .text-nowrap {\n text-wrap: nowrap;\n }\n .text-\\[\\#3D3D3D\\] {\n color: #3D3D3D;\n }\n .text-\\[\\#7C7C7C\\] {\n color: #7C7C7C;\n }\n .text-\\[\\#525252\\] {\n color: #525252;\n }\n .text-\\[\\#656565\\] {\n color: #656565;\n }\n .text-\\[\\#FF6B00\\] {\n color: #FF6B00;\n }\n .text-\\[\\#FFF8EC\\] {\n color: #FFF8EC;\n }\n .text-black {\n color: var(--color-black);\n }\n .text-black\\/85 {\n color: color-mix(in srgb, #000 85%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, var(--color-black) 85%, transparent);\n }\n }\n .text-gray-500 {\n color: var(--color-gray-500);\n }\n .text-orange-500 {\n color: var(--color-orange-500);\n }\n .text-red-500 {\n color: var(--color-red-500);\n }\n .text-white\\/80 {\n color: color-mix(in srgb, #fff 80%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, var(--color-white) 80%, transparent);\n }\n }\n .opacity-0 {\n opacity: 0%;\n }\n .opacity-100 {\n opacity: 100%;\n }\n .shadow {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n .shadow-orange-blur {\n --tw-shadow: 0 4px 20px 0 var(--tw-shadow-color, #a1440299);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n .shadow-orange-400 {\n --tw-shadow-color: oklch(75% 0.183 55.934);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-shadow-color: color-mix(in oklab, var(--color-orange-400) var(--tw-shadow-alpha), transparent);\n }\n }\n .filter {\n 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,);\n }\n .transition {\n transition-property:\n color,\n background-color,\n border-color,\n outline-color,\n text-decoration-color,\n fill,\n stroke,\n --tw-gradient-from,\n --tw-gradient-via,\n --tw-gradient-to,\n opacity,\n box-shadow,\n transform,\n translate,\n scale,\n rotate,\n filter,\n -webkit-backdrop-filter,\n backdrop-filter,\n display,\n content-visibility,\n overlay,\n pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-all {\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-colors {\n transition-property:\n color,\n background-color,\n border-color,\n outline-color,\n text-decoration-color,\n fill,\n stroke,\n --tw-gradient-from,\n --tw-gradient-via,\n --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-opacity {\n transition-property: opacity;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .duration-300 {\n --tw-duration: 300ms;\n transition-duration: 300ms;\n }\n .duration-500 {\n --tw-duration: 500ms;\n transition-duration: 500ms;\n }\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n .outline-none {\n --tw-outline-style: none;\n outline-style: none;\n }\n .focus-within\\:ring-2 {\n &:focus-within {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n }\n .focus-within\\:ring-orange-300 {\n &:focus-within {\n --tw-ring-color: var(--color-orange-300);\n }\n }\n .hover\\:bg-gray-200 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-gray-200);\n }\n }\n }\n .hover\\:text-orange-500 {\n &:hover {\n @media (hover: hover) {\n color: var(--color-orange-500);\n }\n }\n }\n .hover\\:opacity-70 {\n &:hover {\n @media (hover: hover) {\n opacity: 70%;\n }\n }\n }\n .hover\\:shadow-orange-blur-40 {\n &:hover {\n @media (hover: hover) {\n --tw-shadow: 0 4px 40px 0 var(--tw-shadow-color, #a14402);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed;\n }\n }\n .disabled\\:bg-gray-300 {\n &:disabled {\n background-color: var(--color-gray-300);\n }\n }\n .mobile-360\\:w-\\[calc\\(100\\%\\/1\\.7\\)\\] {\n @media (width >= 360px) {\n width: calc(100% / 1.7);\n }\n }\n .mobile-360\\:max-w-\\[calc\\(100\\%\\/1\\.7\\)\\] {\n @media (width >= 360px) {\n max-width: calc(100% / 1.7);\n }\n }\n .mobile-430\\:w-\\[calc\\(100\\%\\/2\\.2\\)\\] {\n @media (width >= 430px) {\n width: calc(100% / 2.2);\n }\n }\n .mobile-430\\:max-w-\\[calc\\(100\\%\\/2\\.2\\)\\] {\n @media (width >= 430px) {\n max-width: calc(100% / 2.2);\n }\n }\n .sm\\:w-\\[calc\\(100\\%\\/2\\.5\\)\\] {\n @media (width >= 40rem) {\n width: calc(100% / 2.5);\n }\n }\n .sm\\:max-w-\\[calc\\(100\\%\\/2\\.5\\)\\] {\n @media (width >= 40rem) {\n max-width: calc(100% / 2.5);\n }\n }\n .md\\:w-\\[calc\\(100\\%\\/3\\)\\] {\n @media (width >= 48rem) {\n width: calc(100% / 3);\n }\n }\n .md\\:max-w-\\[calc\\(100\\%\\/3\\)\\] {\n @media (width >= 48rem) {\n max-width: calc(100% / 3);\n }\n }\n .lg\\:invisible {\n @media (width >= 64rem) {\n visibility: hidden;\n }\n }\n .lg\\:visible {\n @media (width >= 64rem) {\n visibility: visible;\n }\n }\n .lg\\:top-auto {\n @media (width >= 64rem) {\n top: auto;\n }\n }\n .lg\\:right-1\\/2 {\n @media (width >= 64rem) {\n right: calc(1/2 * 100%);\n }\n }\n .lg\\:right-5 {\n @media (width >= 64rem) {\n right: calc(var(--spacing) * 5);\n }\n }\n .lg\\:bottom-25 {\n @media (width >= 64rem) {\n bottom: calc(var(--spacing) * 25);\n }\n }\n .lg\\:hidden {\n @media (width >= 64rem) {\n display: none;\n }\n }\n .lg\\:h-46 {\n @media (width >= 64rem) {\n height: calc(var(--spacing) * 46);\n }\n }\n .lg\\:h-\\[calc\\(100vh-100px\\)\\] {\n @media (width >= 64rem) {\n height: calc(100vh - 100px);\n }\n }\n .lg\\:max-h-201 {\n @media (width >= 64rem) {\n max-height: calc(var(--spacing) * 201);\n }\n }\n .lg\\:w-115 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 115);\n }\n }\n .lg\\:w-\\[calc\\(100\\%\\/2\\.2\\)\\] {\n @media (width >= 64rem) {\n width: calc(100% / 2.2);\n }\n }\n .lg\\:w-\\[calc\\(100vw-100px\\)\\] {\n @media (width >= 64rem) {\n width: calc(100vw - 100px);\n }\n }\n .lg\\:max-w-80 {\n @media (width >= 64rem) {\n max-width: calc(var(--spacing) * 80);\n }\n }\n .lg\\:max-w-289 {\n @media (width >= 64rem) {\n max-width: calc(var(--spacing) * 289);\n }\n }\n .lg\\:max-w-\\[calc\\(100\\%\\/2\\.2\\)\\] {\n @media (width >= 64rem) {\n max-width: calc(100% / 2.2);\n }\n }\n .lg\\:translate-x-1\\/2 {\n @media (width >= 64rem) {\n --tw-translate-x: calc(1/2 * 100%);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n }\n .lg\\:flex-wrap {\n @media (width >= 64rem) {\n flex-wrap: wrap;\n }\n }\n .lg\\:gap-x-2 {\n @media (width >= 64rem) {\n column-gap: calc(var(--spacing) * 2);\n }\n }\n .lg\\:rounded-4xl {\n @media (width >= 64rem) {\n border-radius: var(--radius-4xl);\n }\n }\n .lg\\:hover\\:shadow {\n @media (width >= 64rem) {\n &:hover {\n @media (hover: hover) {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n }\n }\n }\n}\n@layer base {\n * {\n font-family: var(--font-sukhumvit);\n }\n}\n@layer utilities {\n .scrollbar-hide::-webkit-scrollbar {\n display: none;\n }\n .scrollbar-hide {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n .animation-delay-0 {\n animation-delay: 0s;\n }\n .animation-delay-300 {\n animation-delay: 0.3s;\n }\n .animation-delay-600 {\n animation-delay: 0.6s;\n }\n .animation-delay-900 {\n animation-delay: 0.9s;\n }\n .animation-delay-1200 {\n animation-delay: 1.2s;\n }\n}\n@property --tw-translate-x { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-y { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-z { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-rotate-x { syntax: "*"; inherits: false; }\n@property --tw-rotate-y { syntax: "*"; inherits: false; }\n@property --tw-rotate-z { syntax: "*"; inherits: false; }\n@property --tw-skew-x { syntax: "*"; inherits: false; }\n@property --tw-skew-y { syntax: "*"; inherits: false; }\n@property --tw-scroll-snap-strictness { syntax: "*"; inherits: false; initial-value: proximity; }\n@property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }\n@property --tw-gradient-position { syntax: "*"; inherits: false; }\n@property --tw-gradient-from { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-via { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-to { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-via-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-from-position { syntax: "<length-percentage>"; inherits: false; initial-value: 0%; }\n@property --tw-gradient-via-position { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; }\n@property --tw-gradient-to-position { syntax: "<length-percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-font-weight { syntax: "*"; inherits: false; }\n@property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-ring-color { syntax: "*"; inherits: false; }\n@property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-ring-color { syntax: "*"; inherits: false; }\n@property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-ring-inset { syntax: "*"; inherits: false; }\n@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }\n@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }\n@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-blur { syntax: "*"; inherits: false; }\n@property --tw-brightness { syntax: "*"; inherits: false; }\n@property --tw-contrast { syntax: "*"; inherits: false; }\n@property --tw-grayscale { syntax: "*"; inherits: false; }\n@property --tw-hue-rotate { syntax: "*"; inherits: false; }\n@property --tw-invert { syntax: "*"; inherits: false; }\n@property --tw-opacity { syntax: "*"; inherits: false; }\n@property --tw-saturate { syntax: "*"; inherits: false; }\n@property --tw-sepia { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-drop-shadow-size { syntax: "*"; inherits: false; }\n@property --tw-duration { syntax: "*"; inherits: false; }\n@property --tw-ease { syntax: "*"; inherits: false; }\n@keyframes circle-keys {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 50% {\n transform: scale(0.7);\n opacity: 1;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *,\n ::before,\n ::after,\n ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-rotate-x: initial;\n --tw-rotate-y: initial;\n --tw-rotate-z: initial;\n --tw-skew-x: initial;\n --tw-skew-y: initial;\n --tw-scroll-snap-strictness: proximity;\n --tw-border-style: solid;\n --tw-gradient-position: initial;\n --tw-gradient-from: #0000;\n --tw-gradient-via: #0000;\n --tw-gradient-to: #0000;\n --tw-gradient-stops: initial;\n --tw-gradient-via-stops: initial;\n --tw-gradient-from-position: 0%;\n --tw-gradient-via-position: 50%;\n --tw-gradient-to-position: 100%;\n --tw-font-weight: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-blur: initial;\n --tw-brightness: initial;\n --tw-contrast: initial;\n --tw-grayscale: initial;\n --tw-hue-rotate: initial;\n --tw-invert: initial;\n --tw-opacity: initial;\n --tw-saturate: initial;\n --tw-sepia: initial;\n --tw-drop-shadow: initial;\n --tw-drop-shadow-color: initial;\n --tw-drop-shadow-alpha: 100%;\n --tw-drop-shadow-size: initial;\n --tw-duration: initial;\n --tw-ease: initial;\n }\n }\n}\n');
|
|
108
|
+
styleInject('/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root,\n :host {\n --font-sans:\n ui-sans-serif,\n system-ui,\n sans-serif,\n "Apple Color Emoji",\n "Segoe UI Emoji",\n "Segoe UI Symbol",\n "Noto Color Emoji";\n --font-mono:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n --color-red-500: oklch(63.7% 0.237 25.331);\n --color-red-600: oklch(57.7% 0.245 27.325);\n --color-orange-200: oklch(90.1% 0.076 70.697);\n --color-orange-300: oklch(83.7% 0.128 66.29);\n --color-orange-400: oklch(75% 0.183 55.934);\n --color-orange-500: oklch(70.5% 0.213 47.604);\n --color-green-600: oklch(62.7% 0.194 149.214);\n --color-blue-500: oklch(62.3% 0.214 259.815);\n --color-blue-600: oklch(54.6% 0.245 262.881);\n --color-gray-100: oklch(96.7% 0.003 264.542);\n --color-gray-200: oklch(92.8% 0.006 264.531);\n --color-gray-300: oklch(87.2% 0.01 258.338);\n --color-gray-400: oklch(70.7% 0.022 261.325);\n --color-gray-500: oklch(55.1% 0.027 264.364);\n --color-gray-700: oklch(37.3% 0.034 259.733);\n --color-gray-900: oklch(21% 0.034 264.665);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-xl: 1.25rem;\n --text-xl--line-height: calc(1.75 / 1.25);\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --radius-sm: 0.25rem;\n --radius-2xl: 1rem;\n --radius-3xl: 1.5rem;\n --radius-4xl: 2rem;\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans);\n --default-mono-font-family: var(--font-mono);\n --font-sukhumvit:\n "Sukhumvit Set",\n ui-sans-serif,\n system-ui,\n sans-serif;\n --animate-circle-keys: circle-keys 2s ease-in-out infinite;\n }\n}\n@layer base {\n *,\n ::after,\n ::before,\n ::backdrop,\n ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html,\n :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b,\n strong {\n font-weight: bolder;\n }\n code,\n kbd,\n samp,\n pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol,\n ul,\n menu {\n list-style: none;\n }\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n vertical-align: middle;\n }\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n button,\n input,\n select,\n optgroup,\n textarea,\n ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit,\n ::-webkit-datetime-edit-year-field,\n ::-webkit-datetime-edit-month-field,\n ::-webkit-datetime-edit-day-field,\n ::-webkit-datetime-edit-hour-field,\n ::-webkit-datetime-edit-minute-field,\n ::-webkit-datetime-edit-second-field,\n ::-webkit-datetime-edit-millisecond-field,\n ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n ::-webkit-calendar-picker-indicator {\n line-height: 1;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button,\n input:where([type=button], [type=reset], [type=submit]),\n ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=until-found])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-auto {\n pointer-events: auto;\n }\n .pointer-events-none {\n pointer-events: none;\n }\n .invisible {\n visibility: hidden;\n }\n .absolute {\n position: absolute;\n }\n .fixed {\n position: fixed;\n }\n .relative {\n position: relative;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .right-0 {\n right: calc(var(--spacing) * 0);\n }\n .right-5 {\n right: calc(var(--spacing) * 5);\n }\n .bottom-0 {\n bottom: calc(var(--spacing) * 0);\n }\n .bottom-5 {\n bottom: calc(var(--spacing) * 5);\n }\n .z-10 {\n z-index: 10;\n }\n .z-3000 {\n z-index: 3000;\n }\n .z-9998 {\n z-index: 9998;\n }\n .z-9999 {\n z-index: 9999;\n }\n .-mx-4 {\n margin-inline: calc(var(--spacing) * -4);\n }\n .mt-1 {\n margin-top: calc(var(--spacing) * 1);\n }\n .mt-2 {\n margin-top: calc(var(--spacing) * 2);\n }\n .mt-auto {\n margin-top: auto;\n }\n .mr-3 {\n margin-right: calc(var(--spacing) * 3);\n }\n .mr-auto {\n margin-right: auto;\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .mb-3 {\n margin-bottom: calc(var(--spacing) * 3);\n }\n .mb-4 {\n margin-bottom: calc(var(--spacing) * 4);\n }\n .mb-6 {\n margin-bottom: calc(var(--spacing) * 6);\n }\n .ml-auto {\n margin-left: auto;\n }\n .line-clamp-2 {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .aspect-square {\n aspect-ratio: 1 / 1;\n }\n .h-2 {\n height: calc(var(--spacing) * 2);\n }\n .h-4 {\n height: calc(var(--spacing) * 4);\n }\n .h-8 {\n height: calc(var(--spacing) * 8);\n }\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n .h-14 {\n height: calc(var(--spacing) * 14);\n }\n .h-16 {\n height: calc(var(--spacing) * 16);\n }\n .h-29\\.5 {\n height: calc(var(--spacing) * 29.5);\n }\n .h-full {\n height: 100%;\n }\n .max-h-25 {\n max-height: calc(var(--spacing) * 25);\n }\n .min-h-12 {\n min-height: calc(var(--spacing) * 12);\n }\n .min-h-full {\n min-height: 100%;\n }\n .w-2 {\n width: calc(var(--spacing) * 2);\n }\n .w-4 {\n width: calc(var(--spacing) * 4);\n }\n .w-8 {\n width: calc(var(--spacing) * 8);\n }\n .w-10 {\n width: calc(var(--spacing) * 10);\n }\n .w-16 {\n width: calc(var(--spacing) * 16);\n }\n .w-75\\.5 {\n width: calc(var(--spacing) * 75.5);\n }\n .w-\\[calc\\(100\\%\\/1\\.3\\)\\] {\n width: calc(100% / 1.3);\n }\n .w-full {\n width: 100%;\n }\n .max-w-2\\/3 {\n max-width: calc(2/3 * 100%);\n }\n .max-w-69\\.5 {\n max-width: calc(var(--spacing) * 69.5);\n }\n .max-w-80 {\n max-width: calc(var(--spacing) * 80);\n }\n .max-w-\\[calc\\(100\\%\\/1\\.3\\)\\] {\n max-width: calc(100% / 1.3);\n }\n .max-w-max {\n max-width: max-content;\n }\n .min-w-\\[100px\\] {\n min-width: 100px;\n }\n .min-w-full {\n min-width: 100%;\n }\n .min-w-max {\n min-width: max-content;\n }\n .flex-1 {\n flex: 1;\n }\n .shrink-0 {\n flex-shrink: 0;\n }\n .translate-y-0 {\n --tw-translate-y: calc(var(--spacing) * 0);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .translate-y-4 {\n --tw-translate-y: calc(var(--spacing) * 4);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .transform {\n transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);\n }\n .animate-circle-keys {\n animation: var(--animate-circle-keys);\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .resize {\n resize: both;\n }\n .resize-none {\n resize: none;\n }\n .snap-x {\n scroll-snap-type: x var(--tw-scroll-snap-strictness);\n }\n .snap-mandatory {\n --tw-scroll-snap-strictness: mandatory;\n }\n .snap-start {\n scroll-snap-align: start;\n }\n .flex-col {\n flex-direction: column;\n }\n .flex-wrap {\n flex-wrap: wrap;\n }\n .items-center {\n align-items: center;\n }\n .items-end {\n align-items: flex-end;\n }\n .items-start {\n align-items: flex-start;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .justify-end {\n justify-content: flex-end;\n }\n .gap-1 {\n gap: calc(var(--spacing) * 1);\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3);\n }\n .space-y-1 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .space-y-4 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .gap-x-1 {\n column-gap: calc(var(--spacing) * 1);\n }\n .gap-x-2 {\n column-gap: calc(var(--spacing) * 2);\n }\n .gap-y-3 {\n row-gap: calc(var(--spacing) * 3);\n }\n .overflow-hidden {\n overflow: hidden;\n }\n .overflow-x-auto {\n overflow-x: auto;\n }\n .overflow-x-scroll {\n overflow-x: scroll;\n }\n .overflow-y-auto {\n overflow-y: auto;\n }\n .rounded {\n border-radius: 0.25rem;\n }\n .rounded-2xl {\n border-radius: var(--radius-2xl);\n }\n .rounded-3xl {\n border-radius: var(--radius-3xl);\n }\n .rounded-full {\n border-radius: calc(infinity * 1px);\n }\n .rounded-sm {\n border-radius: var(--radius-sm);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-2 {\n border-style: var(--tw-border-style);\n border-width: 2px;\n }\n .border-t {\n border-top-style: var(--tw-border-style);\n border-top-width: 1px;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n }\n .border-none {\n --tw-border-style: none;\n border-style: none;\n }\n .border-black\\/50 {\n border-color: color-mix(in srgb, #000 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n border-color: color-mix(in oklab, var(--color-black) 50%, transparent);\n }\n }\n .border-blue-500 {\n border-color: var(--color-blue-500);\n }\n .border-gray-200 {\n border-color: var(--color-gray-200);\n }\n .border-orange-300 {\n border-color: var(--color-orange-300);\n }\n .border-orange-400 {\n border-color: var(--color-orange-400);\n }\n .bg-\\[\\#3D3D3D\\] {\n background-color: #3D3D3D;\n }\n .bg-\\[\\#F8F8FA\\] {\n background-color: #F8F8FA;\n }\n .bg-\\[\\#FFF0D3\\] {\n background-color: #FFF0D3;\n }\n .bg-black {\n background-color: var(--color-black);\n }\n .bg-black\\/50 {\n background-color: color-mix(in srgb, #000 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 50%, transparent);\n }\n }\n .bg-blue-500 {\n background-color: var(--color-blue-500);\n }\n .bg-gray-100 {\n background-color: var(--color-gray-100);\n }\n .bg-gray-200 {\n background-color: var(--color-gray-200);\n }\n .bg-orange-200 {\n background-color: var(--color-orange-200);\n }\n .bg-orange-400 {\n background-color: var(--color-orange-400);\n }\n .bg-orange-500 {\n background-color: var(--color-orange-500);\n }\n .bg-red-500 {\n background-color: var(--color-red-500);\n }\n .bg-white {\n background-color: var(--color-white);\n }\n .bg-linear-to-l {\n --tw-gradient-position: to left;\n @supports (background-image: linear-gradient(in lab, red, red)) {\n --tw-gradient-position: to left in oklab;\n }\n background-image: linear-gradient(var(--tw-gradient-stops));\n }\n .from-white {\n --tw-gradient-from: var(--color-white);\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .to-transparent {\n --tw-gradient-to: transparent;\n --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n }\n .p-2 {\n padding: calc(var(--spacing) * 2);\n }\n .p-2\\.5 {\n padding: calc(var(--spacing) * 2.5);\n }\n .p-3 {\n padding: calc(var(--spacing) * 3);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3);\n }\n .py-px {\n padding-block: 1px;\n }\n .pt-2 {\n padding-top: calc(var(--spacing) * 2);\n }\n .pt-4 {\n padding-top: calc(var(--spacing) * 4);\n }\n .pr-1 {\n padding-right: calc(var(--spacing) * 1);\n }\n .pr-10 {\n padding-right: calc(var(--spacing) * 10);\n }\n .pb-2 {\n padding-bottom: calc(var(--spacing) * 2);\n }\n .pl-4 {\n padding-left: calc(var(--spacing) * 4);\n }\n .text-center {\n text-align: center;\n }\n .text-left {\n text-align: left;\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .text-xl {\n font-size: var(--text-xl);\n line-height: var(--tw-leading, var(--text-xl--line-height));\n }\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n .text-\\[10px\\] {\n font-size: 10px;\n }\n .text-\\[12px\\] {\n font-size: 12px;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .text-nowrap {\n text-wrap: nowrap;\n }\n .wrap-break-word {\n overflow-wrap: break-word;\n }\n .whitespace-pre-wrap {\n white-space: pre-wrap;\n }\n .text-\\[\\#3D3D3D\\] {\n color: #3D3D3D;\n }\n .text-\\[\\#7C7C7C\\] {\n color: #7C7C7C;\n }\n .text-\\[\\#525252\\] {\n color: #525252;\n }\n .text-\\[\\#656565\\] {\n color: #656565;\n }\n .text-\\[\\#FF6B00\\] {\n color: #FF6B00;\n }\n .text-\\[\\#FFF8EC\\] {\n color: #FFF8EC;\n }\n .text-black {\n color: var(--color-black);\n }\n .text-black\\/85 {\n color: color-mix(in srgb, #000 85%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, var(--color-black) 85%, transparent);\n }\n }\n .text-gray-400 {\n color: var(--color-gray-400);\n }\n .text-gray-500 {\n color: var(--color-gray-500);\n }\n .text-gray-700 {\n color: var(--color-gray-700);\n }\n .text-gray-900 {\n color: var(--color-gray-900);\n }\n .text-green-600 {\n color: var(--color-green-600);\n }\n .text-orange-500 {\n color: var(--color-orange-500);\n }\n .text-red-500 {\n color: var(--color-red-500);\n }\n .text-white {\n color: var(--color-white);\n }\n .text-white\\/80 {\n color: color-mix(in srgb, #fff 80%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, var(--color-white) 80%, transparent);\n }\n }\n .opacity-0 {\n opacity: 0%;\n }\n .opacity-100 {\n opacity: 100%;\n }\n .shadow {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n .shadow-orange-blur {\n --tw-shadow: 0 4px 20px 0 var(--tw-shadow-color, #a1440299);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n .shadow-orange-blur-16 {\n --tw-shadow: 0 0px 16px 4px var(--tw-shadow-color, #fff0d3);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n .shadow-orange-400 {\n --tw-shadow-color: oklch(75% 0.183 55.934);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-shadow-color: color-mix(in oklab, var(--color-orange-400) var(--tw-shadow-alpha), transparent);\n }\n }\n .filter {\n 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,);\n }\n .transition {\n transition-property:\n color,\n background-color,\n border-color,\n outline-color,\n text-decoration-color,\n fill,\n stroke,\n --tw-gradient-from,\n --tw-gradient-via,\n --tw-gradient-to,\n opacity,\n box-shadow,\n transform,\n translate,\n scale,\n rotate,\n filter,\n -webkit-backdrop-filter,\n backdrop-filter,\n display,\n content-visibility,\n overlay,\n pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-all {\n transition-property: all;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-colors {\n transition-property:\n color,\n background-color,\n border-color,\n outline-color,\n text-decoration-color,\n fill,\n stroke,\n --tw-gradient-from,\n --tw-gradient-via,\n --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-opacity {\n transition-property: opacity;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .duration-300 {\n --tw-duration: 300ms;\n transition-duration: 300ms;\n }\n .duration-500 {\n --tw-duration: 500ms;\n transition-duration: 500ms;\n }\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n .focus-within\\:ring-2 {\n &:focus-within {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n }\n .focus-within\\:ring-orange-300 {\n &:focus-within {\n --tw-ring-color: var(--color-orange-300);\n }\n }\n .hover\\:bg-blue-600 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-blue-600);\n }\n }\n }\n .hover\\:bg-gray-200 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-gray-200);\n }\n }\n }\n .hover\\:bg-gray-300 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-gray-300);\n }\n }\n }\n .hover\\:bg-red-600 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--color-red-600);\n }\n }\n }\n .hover\\:text-orange-500 {\n &:hover {\n @media (hover: hover) {\n color: var(--color-orange-500);\n }\n }\n }\n .hover\\:opacity-70 {\n &:hover {\n @media (hover: hover) {\n opacity: 70%;\n }\n }\n }\n .hover\\:shadow-orange-blur-40 {\n &:hover {\n @media (hover: hover) {\n --tw-shadow: 0 4px 40px 0 var(--tw-shadow-color, #a14402);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n }\n .focus\\:ring-blue-500 {\n &:focus {\n --tw-ring-color: var(--color-blue-500);\n }\n }\n .focus\\:outline-none {\n &:focus {\n --tw-outline-style: none;\n outline-style: none;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed;\n }\n }\n .disabled\\:bg-gray-300 {\n &:disabled {\n background-color: var(--color-gray-300);\n }\n }\n .disabled\\:bg-gray-400 {\n &:disabled {\n background-color: var(--color-gray-400);\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50%;\n }\n }\n .mobile-360\\:w-\\[calc\\(100\\%\\/1\\.7\\)\\] {\n @media (width >= 360px) {\n width: calc(100% / 1.7);\n }\n }\n .mobile-360\\:max-w-\\[calc\\(100\\%\\/1\\.7\\)\\] {\n @media (width >= 360px) {\n max-width: calc(100% / 1.7);\n }\n }\n .mobile-430\\:w-\\[calc\\(100\\%\\/2\\.2\\)\\] {\n @media (width >= 430px) {\n width: calc(100% / 2.2);\n }\n }\n .mobile-430\\:max-w-\\[calc\\(100\\%\\/2\\.2\\)\\] {\n @media (width >= 430px) {\n max-width: calc(100% / 2.2);\n }\n }\n .sm\\:w-\\[calc\\(100\\%\\/2\\.5\\)\\] {\n @media (width >= 40rem) {\n width: calc(100% / 2.5);\n }\n }\n .sm\\:max-w-\\[calc\\(100\\%\\/2\\.5\\)\\] {\n @media (width >= 40rem) {\n max-width: calc(100% / 2.5);\n }\n }\n .md\\:w-\\[calc\\(100\\%\\/3\\)\\] {\n @media (width >= 48rem) {\n width: calc(100% / 3);\n }\n }\n .md\\:max-w-\\[calc\\(100\\%\\/3\\)\\] {\n @media (width >= 48rem) {\n max-width: calc(100% / 3);\n }\n }\n .lg\\:invisible {\n @media (width >= 64rem) {\n visibility: hidden;\n }\n }\n .lg\\:visible {\n @media (width >= 64rem) {\n visibility: visible;\n }\n }\n .lg\\:top-auto {\n @media (width >= 64rem) {\n top: auto;\n }\n }\n .lg\\:right-1\\/2 {\n @media (width >= 64rem) {\n right: calc(1/2 * 100%);\n }\n }\n .lg\\:right-5 {\n @media (width >= 64rem) {\n right: calc(var(--spacing) * 5);\n }\n }\n .lg\\:bottom-25 {\n @media (width >= 64rem) {\n bottom: calc(var(--spacing) * 25);\n }\n }\n .lg\\:hidden {\n @media (width >= 64rem) {\n display: none;\n }\n }\n .lg\\:h-\\[calc\\(100vh-100px\\)\\] {\n @media (width >= 64rem) {\n height: calc(100vh - 100px);\n }\n }\n .lg\\:h-auto {\n @media (width >= 64rem) {\n height: auto;\n }\n }\n .lg\\:max-h-28 {\n @media (width >= 64rem) {\n max-height: calc(var(--spacing) * 28);\n }\n }\n .lg\\:max-h-201 {\n @media (width >= 64rem) {\n max-height: calc(var(--spacing) * 201);\n }\n }\n .lg\\:w-115 {\n @media (width >= 64rem) {\n width: calc(var(--spacing) * 115);\n }\n }\n .lg\\:w-\\[calc\\(100\\%\\/2\\.2\\)\\] {\n @media (width >= 64rem) {\n width: calc(100% / 2.2);\n }\n }\n .lg\\:w-\\[calc\\(100\\%\\/4\\.6\\)\\] {\n @media (width >= 64rem) {\n width: calc(100% / 4.6);\n }\n }\n .lg\\:w-\\[calc\\(100vw-100px\\)\\] {\n @media (width >= 64rem) {\n width: calc(100vw - 100px);\n }\n }\n .lg\\:max-w-289 {\n @media (width >= 64rem) {\n max-width: calc(var(--spacing) * 289);\n }\n }\n .lg\\:max-w-\\[calc\\(100\\%\\/2\\.2\\)\\] {\n @media (width >= 64rem) {\n max-width: calc(100% / 2.2);\n }\n }\n .lg\\:max-w-\\[calc\\(100\\%\\/4\\.6\\)\\] {\n @media (width >= 64rem) {\n max-width: calc(100% / 4.6);\n }\n }\n .lg\\:translate-x-1\\/2 {\n @media (width >= 64rem) {\n --tw-translate-x: calc(1/2 * 100%);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n }\n .lg\\:flex-wrap {\n @media (width >= 64rem) {\n flex-wrap: wrap;\n }\n }\n .lg\\:gap-x-2 {\n @media (width >= 64rem) {\n column-gap: calc(var(--spacing) * 2);\n }\n }\n .lg\\:rounded-4xl {\n @media (width >= 64rem) {\n border-radius: var(--radius-4xl);\n }\n }\n .lg\\:hover\\:shadow {\n @media (width >= 64rem) {\n &:hover {\n @media (hover: hover) {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow:\n var(--tw-inset-shadow),\n var(--tw-inset-ring-shadow),\n var(--tw-ring-offset-shadow),\n var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n }\n }\n }\n}\n@layer base {\n * {\n font-family: var(--font-sukhumvit);\n }\n}\n@layer utilities {\n .scrollbar-hide::-webkit-scrollbar {\n display: none;\n }\n .scrollbar-hide {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n .custom-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: #cbd5e1 #f1f5f9;\n scrollbar-gutter: stable;\n }\n .custom-scrollbar::-webkit-scrollbar {\n width: 10px;\n height: 10px;\n }\n .custom-scrollbar::-webkit-scrollbar-track {\n background: #f1f5f9;\n border-radius: 9999px;\n }\n .custom-scrollbar::-webkit-scrollbar-thumb {\n background: #cbd5e1;\n border-radius: 9999px;\n border: 2px solid #f1f5f9;\n }\n .custom-scrollbar::-webkit-scrollbar-thumb:hover {\n background: #9ca3af;\n }\n .animation-delay-0 {\n animation-delay: 0s;\n }\n .animation-delay-300 {\n animation-delay: 0.3s;\n }\n .animation-delay-600 {\n animation-delay: 0.6s;\n }\n .animation-delay-900 {\n animation-delay: 0.9s;\n }\n .animation-delay-1200 {\n animation-delay: 1.2s;\n }\n}\n@property --tw-translate-x { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-y { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-translate-z { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-rotate-x { syntax: "*"; inherits: false; }\n@property --tw-rotate-y { syntax: "*"; inherits: false; }\n@property --tw-rotate-z { syntax: "*"; inherits: false; }\n@property --tw-skew-x { syntax: "*"; inherits: false; }\n@property --tw-skew-y { syntax: "*"; inherits: false; }\n@property --tw-scroll-snap-strictness { syntax: "*"; inherits: false; initial-value: proximity; }\n@property --tw-space-y-reverse { syntax: "*"; inherits: false; initial-value: 0; }\n@property --tw-border-style { syntax: "*"; inherits: false; initial-value: solid; }\n@property --tw-gradient-position { syntax: "*"; inherits: false; }\n@property --tw-gradient-from { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-via { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-to { syntax: "<color>"; inherits: false; initial-value: #0000; }\n@property --tw-gradient-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-via-stops { syntax: "*"; inherits: false; }\n@property --tw-gradient-from-position { syntax: "<length-percentage>"; inherits: false; initial-value: 0%; }\n@property --tw-gradient-via-position { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; }\n@property --tw-gradient-to-position { syntax: "<length-percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-font-weight { syntax: "*"; inherits: false; }\n@property --tw-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-inset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-inset-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-ring-color { syntax: "*"; inherits: false; }\n@property --tw-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-inset-ring-color { syntax: "*"; inherits: false; }\n@property --tw-inset-ring-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-ring-inset { syntax: "*"; inherits: false; }\n@property --tw-ring-offset-width { syntax: "<length>"; inherits: false; initial-value: 0px; }\n@property --tw-ring-offset-color { syntax: "*"; inherits: false; initial-value: #fff; }\n@property --tw-ring-offset-shadow { syntax: "*"; inherits: false; initial-value: 0 0 #0000; }\n@property --tw-blur { syntax: "*"; inherits: false; }\n@property --tw-brightness { syntax: "*"; inherits: false; }\n@property --tw-contrast { syntax: "*"; inherits: false; }\n@property --tw-grayscale { syntax: "*"; inherits: false; }\n@property --tw-hue-rotate { syntax: "*"; inherits: false; }\n@property --tw-invert { syntax: "*"; inherits: false; }\n@property --tw-opacity { syntax: "*"; inherits: false; }\n@property --tw-saturate { syntax: "*"; inherits: false; }\n@property --tw-sepia { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-color { syntax: "*"; inherits: false; }\n@property --tw-drop-shadow-alpha { syntax: "<percentage>"; inherits: false; initial-value: 100%; }\n@property --tw-drop-shadow-size { syntax: "*"; inherits: false; }\n@property --tw-duration { syntax: "*"; inherits: false; }\n@property --tw-ease { syntax: "*"; inherits: false; }\n@keyframes circle-keys {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 50% {\n transform: scale(0.7);\n opacity: 1;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *,\n ::before,\n ::after,\n ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-rotate-x: initial;\n --tw-rotate-y: initial;\n --tw-rotate-z: initial;\n --tw-skew-x: initial;\n --tw-skew-y: initial;\n --tw-scroll-snap-strictness: proximity;\n --tw-space-y-reverse: 0;\n --tw-border-style: solid;\n --tw-gradient-position: initial;\n --tw-gradient-from: #0000;\n --tw-gradient-via: #0000;\n --tw-gradient-to: #0000;\n --tw-gradient-stops: initial;\n --tw-gradient-via-stops: initial;\n --tw-gradient-from-position: 0%;\n --tw-gradient-via-position: 50%;\n --tw-gradient-to-position: 100%;\n --tw-font-weight: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-blur: initial;\n --tw-brightness: initial;\n --tw-contrast: initial;\n --tw-grayscale: initial;\n --tw-hue-rotate: initial;\n --tw-invert: initial;\n --tw-opacity: initial;\n --tw-saturate: initial;\n --tw-sepia: initial;\n --tw-drop-shadow: initial;\n --tw-drop-shadow-color: initial;\n --tw-drop-shadow-alpha: 100%;\n --tw-drop-shadow-size: initial;\n --tw-duration: initial;\n --tw-ease: initial;\n }\n }\n}\n');
|
|
105
109
|
|
|
106
110
|
// src/utils/cn.ts
|
|
107
111
|
var import_clsx = require("clsx");
|
|
@@ -568,8 +572,7 @@ var defaultFailMenu = [
|
|
|
568
572
|
var defaultQuickMenuChips = [
|
|
569
573
|
{ id: "1", title: "\u0E0B\u0E37\u0E49\u0E2D\u0E02\u0E2D\u0E07/\u0E0A\u0E33\u0E23\u0E30\u0E40\u0E07\u0E34\u0E19\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", value: "\u0E0B\u0E37\u0E49\u0E2D\u0E02\u0E2D\u0E07/\u0E0A\u0E33\u0E23\u0E30\u0E40\u0E07\u0E34\u0E19\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", mockResponse: "QUICK_MENU_PAYMENT_FAILED" /* QUICK_MENU_PAYMENT_FAILED */ },
|
|
570
574
|
{ id: "2", title: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", value: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", mockResponse: "CODE_CANT_USE" /* CODE_CANT_USE */ },
|
|
571
|
-
{ id: "3", title: "\
|
|
572
|
-
{ id: "4", title: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", value: "\u0E43\u0E0A\u0E49\u0E42\u0E04\u0E49\u0E14\u0E2A\u0E48\u0E27\u0E19\u0E25\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49", mockResponse: "CODE_CANT_USE" /* CODE_CANT_USE */ }
|
|
575
|
+
{ id: "3", title: "\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32", value: "\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32", mockResponse: "CODE_CANT_USE" /* CODE_CANT_USE */ }
|
|
573
576
|
];
|
|
574
577
|
var budgetRanges = [
|
|
575
578
|
{ id: "1", title: "\u0E15\u0E48\u0E33\u0E01\u0E27\u0E48\u0E32 10,000 \u0E1A\u0E32\u0E17", value: "\u0E15\u0E48\u0E33\u0E01\u0E27\u0E48\u0E32 10,000 \u0E1A\u0E32\u0E17", mockResponse: "NOTFOUND_PRODUCT" /* NOTFOUND_PRODUCT */ },
|
|
@@ -771,15 +774,169 @@ var mockMessages = [
|
|
|
771
774
|
__spreadValues({}, mockResponse["PRODUCT_PHONE_ALL" /* PRODUCT_PHONE_ALL */])
|
|
772
775
|
];
|
|
773
776
|
|
|
774
|
-
// src/
|
|
777
|
+
// src/contexts/aizu-client-context.tsx
|
|
778
|
+
var import_react3 = require("react");
|
|
779
|
+
|
|
780
|
+
// src/hooks/use-aizu-chat.ts
|
|
781
|
+
var import_react2 = require("react");
|
|
782
|
+
|
|
783
|
+
// src/hooks/use-local-storage.ts
|
|
775
784
|
var import_react = require("react");
|
|
785
|
+
function useLocalStorage(key, initialValue) {
|
|
786
|
+
const [storedValue, setStoredValue] = (0, import_react.useState)(() => {
|
|
787
|
+
if (typeof window === "undefined") return initialValue;
|
|
788
|
+
try {
|
|
789
|
+
const item = window.localStorage.getItem(key);
|
|
790
|
+
return item ? JSON.parse(item) : initialValue;
|
|
791
|
+
} catch (error) {
|
|
792
|
+
console.error(`Error reading localStorage key "${key}":`, error);
|
|
793
|
+
return initialValue;
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
const setValue = (0, import_react.useCallback)(
|
|
797
|
+
(value) => {
|
|
798
|
+
try {
|
|
799
|
+
setStoredValue(value);
|
|
800
|
+
if (typeof window !== "undefined") {
|
|
801
|
+
window.localStorage.setItem(key, JSON.stringify(value));
|
|
802
|
+
}
|
|
803
|
+
} catch (error) {
|
|
804
|
+
console.error(`Error setting localStorage key "${key}":`, error);
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
[key]
|
|
808
|
+
);
|
|
809
|
+
const clearValue = (0, import_react.useCallback)(() => {
|
|
810
|
+
try {
|
|
811
|
+
setStoredValue(initialValue);
|
|
812
|
+
if (typeof window !== "undefined") {
|
|
813
|
+
window.localStorage.removeItem(key);
|
|
814
|
+
}
|
|
815
|
+
} catch (error) {
|
|
816
|
+
console.error(`Error clearing localStorage key "${key}":`, error);
|
|
817
|
+
}
|
|
818
|
+
}, [key, initialValue]);
|
|
819
|
+
return [storedValue, setValue, clearValue];
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// src/hooks/use-aizu-chat.ts
|
|
823
|
+
var useAizuChat = (client) => {
|
|
824
|
+
const [threadId, setThreadId, clearThreadId] = useLocalStorage(
|
|
825
|
+
"aizu_thread_id",
|
|
826
|
+
null
|
|
827
|
+
);
|
|
828
|
+
const [resourceId, setResourceId, clearResourceId] = useLocalStorage("aizu_resource_id", null);
|
|
829
|
+
const abortControllerRef = (0, import_react2.useRef)(null);
|
|
830
|
+
const sendMessage = (0, import_react2.useCallback)(
|
|
831
|
+
(query) => __async(null, null, function* () {
|
|
832
|
+
var _a;
|
|
833
|
+
if (!query || !query.trim()) {
|
|
834
|
+
return { success: false, message: "Query cannot be empty" };
|
|
835
|
+
}
|
|
836
|
+
(_a = abortControllerRef.current) == null ? void 0 : _a.abort();
|
|
837
|
+
const controller = new AbortController();
|
|
838
|
+
abortControllerRef.current = controller;
|
|
839
|
+
const params = __spreadValues(__spreadValues({
|
|
840
|
+
query
|
|
841
|
+
}, threadId && { thread_id: threadId }), resourceId && { resource_id: resourceId });
|
|
842
|
+
try {
|
|
843
|
+
const response = yield client.chat(params, {
|
|
844
|
+
signal: controller.signal
|
|
845
|
+
});
|
|
846
|
+
if (response.thread_id && response.thread_id !== threadId) {
|
|
847
|
+
setThreadId(response.thread_id);
|
|
848
|
+
}
|
|
849
|
+
if (response.resource_id && response.resource_id !== resourceId) {
|
|
850
|
+
setResourceId(response.resource_id);
|
|
851
|
+
}
|
|
852
|
+
return { success: true, data: response };
|
|
853
|
+
} catch (error) {
|
|
854
|
+
if (error instanceof Error && error.message === "Request cancelled by user") {
|
|
855
|
+
return { success: false, message: "Cancelled by user" };
|
|
856
|
+
}
|
|
857
|
+
return {
|
|
858
|
+
success: false,
|
|
859
|
+
message: "Failed to send message"
|
|
860
|
+
};
|
|
861
|
+
} finally {
|
|
862
|
+
if (abortControllerRef.current === controller) {
|
|
863
|
+
abortControllerRef.current = null;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}),
|
|
867
|
+
[client, threadId, resourceId, setThreadId, setResourceId]
|
|
868
|
+
);
|
|
869
|
+
const clearConversation = (0, import_react2.useCallback)(() => {
|
|
870
|
+
clearThreadId();
|
|
871
|
+
clearResourceId();
|
|
872
|
+
}, [clearThreadId, clearResourceId]);
|
|
873
|
+
const cancelRequest = (0, import_react2.useCallback)(() => {
|
|
874
|
+
var _a;
|
|
875
|
+
(_a = abortControllerRef.current) == null ? void 0 : _a.abort();
|
|
876
|
+
abortControllerRef.current = null;
|
|
877
|
+
}, []);
|
|
878
|
+
return {
|
|
879
|
+
sendMessage,
|
|
880
|
+
clearConversation,
|
|
881
|
+
cancelRequest,
|
|
882
|
+
threadId,
|
|
883
|
+
resourceId
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
|
|
887
|
+
// src/contexts/aizu-client-context.tsx
|
|
888
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
889
|
+
var AizuClientContext = (0, import_react3.createContext)(
|
|
890
|
+
void 0
|
|
891
|
+
);
|
|
892
|
+
var AizuClientProvider = ({
|
|
893
|
+
children,
|
|
894
|
+
client
|
|
895
|
+
}) => {
|
|
896
|
+
const {
|
|
897
|
+
sendMessage,
|
|
898
|
+
clearConversation,
|
|
899
|
+
threadId,
|
|
900
|
+
resourceId,
|
|
901
|
+
cancelRequest
|
|
902
|
+
} = useAizuChat(client);
|
|
903
|
+
const value = (0, import_react3.useMemo)(
|
|
904
|
+
() => ({
|
|
905
|
+
aizuClient: client,
|
|
906
|
+
threadId,
|
|
907
|
+
resourceId,
|
|
908
|
+
sendMessage,
|
|
909
|
+
clearConversation,
|
|
910
|
+
cancelRequest
|
|
911
|
+
}),
|
|
912
|
+
[
|
|
913
|
+
client,
|
|
914
|
+
threadId,
|
|
915
|
+
resourceId,
|
|
916
|
+
sendMessage,
|
|
917
|
+
clearConversation,
|
|
918
|
+
cancelRequest
|
|
919
|
+
]
|
|
920
|
+
);
|
|
921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(AizuClientContext.Provider, { value, children });
|
|
922
|
+
};
|
|
923
|
+
var useAizuClient = () => {
|
|
924
|
+
const context = (0, import_react3.useContext)(AizuClientContext);
|
|
925
|
+
if (!context) {
|
|
926
|
+
throw new Error("useAizuClient must be used within AizuClientProvider");
|
|
927
|
+
}
|
|
928
|
+
return context;
|
|
929
|
+
};
|
|
930
|
+
|
|
931
|
+
// src/hooks/use-openchat.tsx
|
|
932
|
+
var import_react4 = require("react");
|
|
776
933
|
var COLLAPSE_DELAY = 300;
|
|
777
934
|
var useOpenChat = () => {
|
|
778
|
-
const [isOpen, setIsOpen] = (0,
|
|
779
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
780
|
-
const timerRef = (0,
|
|
781
|
-
const openChat = (0,
|
|
782
|
-
const closeChat = (0,
|
|
935
|
+
const [isOpen, setIsOpen] = (0, import_react4.useState)(false);
|
|
936
|
+
const [isExpanded, setIsExpanded] = (0, import_react4.useState)(false);
|
|
937
|
+
const timerRef = (0, import_react4.useRef)(null);
|
|
938
|
+
const openChat = (0, import_react4.useCallback)(() => setIsOpen(true), []);
|
|
939
|
+
const closeChat = (0, import_react4.useCallback)(() => {
|
|
783
940
|
setIsOpen(false);
|
|
784
941
|
if (isExpanded) {
|
|
785
942
|
if (timerRef.current) {
|
|
@@ -791,9 +948,9 @@ var useOpenChat = () => {
|
|
|
791
948
|
}, COLLAPSE_DELAY);
|
|
792
949
|
}
|
|
793
950
|
}, [isExpanded]);
|
|
794
|
-
const toggleChat = (0,
|
|
795
|
-
const toggleExpand = (0,
|
|
796
|
-
(0,
|
|
951
|
+
const toggleChat = (0, import_react4.useCallback)(() => setIsOpen((prev) => !prev), []);
|
|
952
|
+
const toggleExpand = (0, import_react4.useCallback)(() => setIsExpanded((prev) => !prev), []);
|
|
953
|
+
(0, import_react4.useEffect)(() => {
|
|
797
954
|
return () => {
|
|
798
955
|
if (timerRef.current) {
|
|
799
956
|
clearTimeout(timerRef.current);
|
|
@@ -812,15 +969,16 @@ var useOpenChat = () => {
|
|
|
812
969
|
};
|
|
813
970
|
|
|
814
971
|
// src/contexts/chat-context.tsx
|
|
815
|
-
var
|
|
816
|
-
var
|
|
817
|
-
var ChatContext = (0,
|
|
972
|
+
var import_react5 = require("react");
|
|
973
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
974
|
+
var ChatContext = (0, import_react5.createContext)(void 0);
|
|
818
975
|
var ChatProvider = ({ children }) => {
|
|
819
|
-
const [messages, setMessages] = (0,
|
|
820
|
-
const [
|
|
976
|
+
const [messages, setMessages] = (0, import_react5.useState)([]);
|
|
977
|
+
const [userMessages, setUserMessages] = (0, import_react5.useState)([]);
|
|
978
|
+
const [latestMessage, setLatestMessage] = (0, import_react5.useState)();
|
|
821
979
|
const chatControls = useOpenChat();
|
|
822
|
-
const [isLoading, setIsLoading] = (0,
|
|
823
|
-
const addUserMessage = (0,
|
|
980
|
+
const [isLoading, setIsLoading] = (0, import_react5.useState)(false);
|
|
981
|
+
const addUserMessage = (0, import_react5.useCallback)((text) => {
|
|
824
982
|
const newText = text.includes(tryAgain) ? (latestMessage == null ? void 0 : latestMessage.text) || "" : text;
|
|
825
983
|
const newMessage = {
|
|
826
984
|
id: Date.now().toString() + Math.random().toString(),
|
|
@@ -829,20 +987,21 @@ var ChatProvider = ({ children }) => {
|
|
|
829
987
|
};
|
|
830
988
|
setLatestMessage(newMessage);
|
|
831
989
|
setMessages((prev) => [...prev, newMessage]);
|
|
990
|
+
setUserMessages((prev) => [...prev, newMessage]);
|
|
832
991
|
setIsLoading(true);
|
|
833
992
|
}, [latestMessage == null ? void 0 : latestMessage.text]);
|
|
834
|
-
const addBotMessage = (0,
|
|
835
|
-
yield new Promise((resolve) => setTimeout(resolve, Math.random() * 2e3 + 1e3));
|
|
993
|
+
const addBotMessage = (0, import_react5.useCallback)((message) => __async(null, null, function* () {
|
|
836
994
|
setIsLoading(false);
|
|
837
995
|
const newMessage = __spreadProps(__spreadValues({}, message), {
|
|
838
996
|
id: Date.now().toString() + Math.random().toString()
|
|
839
997
|
});
|
|
840
998
|
setMessages((prev) => [...prev, newMessage]);
|
|
841
999
|
}), []);
|
|
842
|
-
const clearMessages = (0,
|
|
843
|
-
const value = (0,
|
|
1000
|
+
const clearMessages = (0, import_react5.useCallback)(() => setMessages([]), []);
|
|
1001
|
+
const value = (0, import_react5.useMemo)(
|
|
844
1002
|
() => ({
|
|
845
1003
|
messages,
|
|
1004
|
+
userMessages,
|
|
846
1005
|
latestMessage,
|
|
847
1006
|
isLoading,
|
|
848
1007
|
setIsLoading,
|
|
@@ -851,43 +1010,311 @@ var ChatProvider = ({ children }) => {
|
|
|
851
1010
|
clearMessages,
|
|
852
1011
|
chatControls
|
|
853
1012
|
}),
|
|
854
|
-
[messages, latestMessage, isLoading, chatControls, addUserMessage, addBotMessage, clearMessages]
|
|
1013
|
+
[messages, userMessages, latestMessage, isLoading, chatControls, addUserMessage, addBotMessage, clearMessages]
|
|
855
1014
|
);
|
|
856
|
-
return /* @__PURE__ */ (0,
|
|
1015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChatContext.Provider, { value, children });
|
|
857
1016
|
};
|
|
858
1017
|
var useChatContext = () => {
|
|
859
|
-
const context = (0,
|
|
1018
|
+
const context = (0, import_react5.useContext)(ChatContext);
|
|
860
1019
|
if (!context) {
|
|
861
1020
|
throw new Error("useChatContext must be used within ChatProvider");
|
|
862
1021
|
}
|
|
863
1022
|
return context;
|
|
864
1023
|
};
|
|
865
1024
|
|
|
866
|
-
// src/
|
|
867
|
-
var
|
|
868
|
-
|
|
869
|
-
|
|
1025
|
+
// src/sdk/client.ts
|
|
1026
|
+
var AizuClient = class {
|
|
1027
|
+
constructor(config) {
|
|
1028
|
+
const { hostUrl, apiKey, timeout } = config;
|
|
1029
|
+
if (typeof hostUrl !== "string" || hostUrl.trim().length === 0) {
|
|
1030
|
+
throw new Error(
|
|
1031
|
+
"Invalid AizuClient configuration: 'hostUrl' must be a non-empty string."
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
1034
|
+
if (typeof apiKey !== "string" || apiKey.trim().length === 0) {
|
|
1035
|
+
throw new Error(
|
|
1036
|
+
"Invalid AizuClient configuration: 'apiKey' must be a non-empty string."
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
this.hostUrl = hostUrl;
|
|
1040
|
+
this.apiKey = apiKey;
|
|
1041
|
+
this.timeout = timeout != null ? timeout : 3e4;
|
|
1042
|
+
}
|
|
1043
|
+
request(_0) {
|
|
1044
|
+
return __async(this, arguments, function* (path, options = {}) {
|
|
1045
|
+
const url = `${this.hostUrl}${path}`;
|
|
1046
|
+
const _a = options, { body, signal: externalSignal } = _a, restOptions = __objRest(_a, ["body", "signal"]);
|
|
1047
|
+
const timeoutController = new AbortController();
|
|
1048
|
+
const timeoutId = setTimeout(() => timeoutController.abort(), this.timeout);
|
|
1049
|
+
let abortController = null;
|
|
1050
|
+
let abortHandler = null;
|
|
1051
|
+
let abortReason = null;
|
|
1052
|
+
const combinedSignal = externalSignal ? (() => {
|
|
1053
|
+
abortController = new AbortController();
|
|
1054
|
+
const userAbortHandler = () => {
|
|
1055
|
+
if (!abortReason) abortReason = "user";
|
|
1056
|
+
abortController == null ? void 0 : abortController.abort();
|
|
1057
|
+
clearTimeout(timeoutId);
|
|
1058
|
+
};
|
|
1059
|
+
const timeoutAbortHandler = () => {
|
|
1060
|
+
if (!abortReason) abortReason = "timeout";
|
|
1061
|
+
abortController == null ? void 0 : abortController.abort();
|
|
1062
|
+
};
|
|
1063
|
+
const listeners = [
|
|
1064
|
+
{ signal: externalSignal, handler: userAbortHandler },
|
|
1065
|
+
{ signal: timeoutController.signal, handler: timeoutAbortHandler }
|
|
1066
|
+
];
|
|
1067
|
+
listeners.forEach(({ signal, handler }) => {
|
|
1068
|
+
signal.addEventListener("abort", handler);
|
|
1069
|
+
});
|
|
1070
|
+
abortHandler = () => {
|
|
1071
|
+
listeners.forEach(({ signal, handler }) => {
|
|
1072
|
+
signal.removeEventListener("abort", handler);
|
|
1073
|
+
});
|
|
1074
|
+
};
|
|
1075
|
+
return abortController.signal;
|
|
1076
|
+
})() : timeoutController.signal;
|
|
1077
|
+
try {
|
|
1078
|
+
const response = yield fetch(url, __spreadProps(__spreadValues({}, restOptions), {
|
|
1079
|
+
signal: combinedSignal,
|
|
1080
|
+
headers: __spreadValues({
|
|
1081
|
+
"Content-Type": "application/json",
|
|
1082
|
+
"x-api-key": this.apiKey
|
|
1083
|
+
}, options.headers),
|
|
1084
|
+
body: body ? JSON.stringify(body) : void 0
|
|
1085
|
+
}));
|
|
1086
|
+
if (!response.ok) {
|
|
1087
|
+
const errorBody = yield response.text().catch(() => "");
|
|
1088
|
+
const errorMessage = `API Error: ${response.status} ${response.statusText}${errorBody ? ` - ${errorBody}` : ""}`;
|
|
1089
|
+
throw new Error(errorMessage);
|
|
1090
|
+
}
|
|
1091
|
+
return yield response.json();
|
|
1092
|
+
} catch (error) {
|
|
1093
|
+
if (error instanceof Error && error.name === "AbortError") {
|
|
1094
|
+
if (abortReason === "user") {
|
|
1095
|
+
throw new Error("Request cancelled by user");
|
|
1096
|
+
}
|
|
1097
|
+
if (abortReason === "timeout") {
|
|
1098
|
+
throw new Error(
|
|
1099
|
+
"Request timeout: The server took too long to respond"
|
|
1100
|
+
);
|
|
1101
|
+
}
|
|
1102
|
+
throw new Error("Request was aborted");
|
|
1103
|
+
}
|
|
1104
|
+
throw error;
|
|
1105
|
+
} finally {
|
|
1106
|
+
clearTimeout(timeoutId);
|
|
1107
|
+
if (abortHandler) {
|
|
1108
|
+
abortHandler();
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
chat(params, options) {
|
|
1114
|
+
return __async(this, null, function* () {
|
|
1115
|
+
if (!params.query.trim()) {
|
|
1116
|
+
throw new Error("Query is required");
|
|
1117
|
+
}
|
|
1118
|
+
return this.request("/chat/query", {
|
|
1119
|
+
method: "POST",
|
|
1120
|
+
body: params,
|
|
1121
|
+
signal: options == null ? void 0 : options.signal
|
|
1122
|
+
});
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
};
|
|
1126
|
+
var createAizuClient = ({
|
|
1127
|
+
hostUrl,
|
|
1128
|
+
apiKey,
|
|
1129
|
+
timeout
|
|
1130
|
+
}) => {
|
|
1131
|
+
return new AizuClient({ hostUrl, apiKey, timeout });
|
|
870
1132
|
};
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
1133
|
+
|
|
1134
|
+
// src/sdk/types.ts
|
|
1135
|
+
var TypeResponse = /* @__PURE__ */ ((TypeResponse2) => {
|
|
1136
|
+
TypeResponse2["SUGGEST_PRODUCTS"] = "suggest_products";
|
|
1137
|
+
TypeResponse2["REQUEST_CLARIFICATION"] = "request_clarification";
|
|
1138
|
+
TypeResponse2["START_SHOPPING"] = "start_shopping";
|
|
1139
|
+
return TypeResponse2;
|
|
1140
|
+
})(TypeResponse || {});
|
|
1141
|
+
|
|
1142
|
+
// src/utils/message.ts
|
|
1143
|
+
var getMessage = (result) => {
|
|
1144
|
+
var _a, _b;
|
|
1145
|
+
if (!result.success) return mockResponse["ERROR" /* ERROR */];
|
|
1146
|
+
const products = ((_a = result.data) == null ? void 0 : _a.products) || [];
|
|
1147
|
+
if (((_b = result.data) == null ? void 0 : _b.type) && result.data.type === "start_shopping" /* START_SHOPPING */) {
|
|
1148
|
+
return mockResponse["QUICK_MENU_SHOP" /* QUICK_MENU_SHOP */];
|
|
875
1149
|
}
|
|
876
|
-
if (!
|
|
1150
|
+
if (!result.data.response && products.length === 0) {
|
|
877
1151
|
return mockResponse["ERROR" /* ERROR */];
|
|
878
1152
|
}
|
|
879
|
-
const newMessage =
|
|
880
|
-
|
|
1153
|
+
const newMessage = {
|
|
1154
|
+
id: Date.now().toString() + Math.random().toString(),
|
|
1155
|
+
text: result.data.response,
|
|
1156
|
+
type: "BOT_TEXT" /* BOT_TEXT */
|
|
1157
|
+
};
|
|
1158
|
+
if (products.length > 0) {
|
|
1159
|
+
newMessage.type = "BOT_TEXT_WITH_PRODUCTS" /* BOT_TEXT_WITH_PRODUCTS */;
|
|
1160
|
+
newMessage.products = products;
|
|
1161
|
+
}
|
|
1162
|
+
return newMessage;
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
// src/hooks/use-send-chat.ts
|
|
1166
|
+
var import_react6 = require("react");
|
|
1167
|
+
var DEBOUNCE_TIMEOUT = 300;
|
|
1168
|
+
var useSendChat = ({ addBotMessage, addUserMessage, sendMessage, setIsLoading, isLoading, latestMessage }) => {
|
|
1169
|
+
const clickTimeoutRef = (0, import_react6.useRef)(null);
|
|
1170
|
+
const handleSendMessage = (0, import_react6.useCallback)(
|
|
1171
|
+
(message) => __async(null, null, function* () {
|
|
1172
|
+
addUserMessage(message);
|
|
1173
|
+
const result = yield sendMessage(message);
|
|
1174
|
+
if (result.success) {
|
|
1175
|
+
const message2 = getMessage(result);
|
|
1176
|
+
addBotMessage(message2);
|
|
1177
|
+
} else {
|
|
1178
|
+
if (result.message.includes("Cancelled by user")) return setIsLoading(false);
|
|
1179
|
+
const botMessage = __spreadProps(__spreadValues({}, mockResponse["ERROR" /* ERROR */]), {
|
|
1180
|
+
id: Date.now().toString(),
|
|
1181
|
+
type: "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */
|
|
1182
|
+
});
|
|
1183
|
+
addBotMessage(botMessage);
|
|
1184
|
+
}
|
|
1185
|
+
}),
|
|
1186
|
+
[addUserMessage, addBotMessage, sendMessage, setIsLoading]
|
|
1187
|
+
);
|
|
1188
|
+
const handleClickMenuRaw = (0, import_react6.useCallback)(
|
|
1189
|
+
(menu) => __async(null, null, function* () {
|
|
1190
|
+
if (isLoading) return;
|
|
1191
|
+
if (menu.title.includes(tryAgain) && !!(latestMessage == null ? void 0 : latestMessage.text)) {
|
|
1192
|
+
return handleSendMessage(latestMessage == null ? void 0 : latestMessage.text);
|
|
1193
|
+
}
|
|
1194
|
+
yield handleSendMessage(menu.title);
|
|
1195
|
+
}),
|
|
1196
|
+
[handleSendMessage, latestMessage == null ? void 0 : latestMessage.text, isLoading]
|
|
1197
|
+
);
|
|
1198
|
+
const handleClickMenu = (0, import_react6.useCallback)(
|
|
1199
|
+
(menu) => __async(null, null, function* () {
|
|
1200
|
+
if (clickTimeoutRef.current) {
|
|
1201
|
+
clearTimeout(clickTimeoutRef.current);
|
|
1202
|
+
}
|
|
1203
|
+
clickTimeoutRef.current = setTimeout(() => {
|
|
1204
|
+
handleClickMenuRaw(menu);
|
|
1205
|
+
}, DEBOUNCE_TIMEOUT);
|
|
1206
|
+
}),
|
|
1207
|
+
[handleClickMenuRaw]
|
|
1208
|
+
);
|
|
1209
|
+
(0, import_react6.useEffect)(() => {
|
|
1210
|
+
return () => {
|
|
1211
|
+
if (clickTimeoutRef.current) {
|
|
1212
|
+
clearTimeout(clickTimeoutRef.current);
|
|
1213
|
+
}
|
|
1214
|
+
};
|
|
1215
|
+
}, []);
|
|
1216
|
+
return {
|
|
1217
|
+
handleSendMessage,
|
|
1218
|
+
handleClickMenu
|
|
1219
|
+
};
|
|
881
1220
|
};
|
|
882
1221
|
|
|
883
1222
|
// src/components/aizu-chat.tsx
|
|
884
|
-
var
|
|
1223
|
+
var import_react9 = require("react");
|
|
1224
|
+
|
|
1225
|
+
// src/hooks/use-keyboard.ts
|
|
1226
|
+
var import_react7 = require("react");
|
|
1227
|
+
var useKeyboard = ({ userMessages, isLoading, onSend }) => {
|
|
1228
|
+
const [value, setValue] = (0, import_react7.useState)("");
|
|
1229
|
+
const [historyIndex, setHistoryIndex] = (0, import_react7.useState)((userMessages == null ? void 0 : userMessages.length) || 0);
|
|
1230
|
+
const textareaRef = (0, import_react7.useRef)(null);
|
|
1231
|
+
const handleChange = (e) => {
|
|
1232
|
+
setValue(e.target.value);
|
|
1233
|
+
};
|
|
1234
|
+
const handleSubmit = (e) => {
|
|
1235
|
+
e.preventDefault();
|
|
1236
|
+
if (isLoading) return;
|
|
1237
|
+
const message = value;
|
|
1238
|
+
if ((message == null ? void 0 : message.trim()) && onSend) {
|
|
1239
|
+
onSend(message);
|
|
1240
|
+
setValue("");
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
const handleKeyDown = (e) => {
|
|
1244
|
+
var _a, _b, _c, _d;
|
|
1245
|
+
const key = e.key;
|
|
1246
|
+
if (key === "Enter" && !e.shiftKey) {
|
|
1247
|
+
e.preventDefault();
|
|
1248
|
+
handleSubmit(e);
|
|
1249
|
+
}
|
|
1250
|
+
const matchIndex = userMessages.findIndex((m) => m.text === value);
|
|
1251
|
+
const canNavigate = !value || matchIndex !== -1;
|
|
1252
|
+
if (!canNavigate) return;
|
|
1253
|
+
if (key === "ArrowUp") {
|
|
1254
|
+
e.preventDefault();
|
|
1255
|
+
if (userMessages.length === 0) return;
|
|
1256
|
+
const next = historyIndex === userMessages.length ? userMessages.length - 1 : Math.max(0, historyIndex - 1);
|
|
1257
|
+
setHistoryIndex(next);
|
|
1258
|
+
setValue((_b = (_a = userMessages[next]) == null ? void 0 : _a.text) != null ? _b : "");
|
|
1259
|
+
return;
|
|
1260
|
+
}
|
|
1261
|
+
if (key === "ArrowDown") {
|
|
1262
|
+
e.preventDefault();
|
|
1263
|
+
if (userMessages.length === 0) return;
|
|
1264
|
+
const next = historyIndex >= userMessages.length - 1 ? userMessages.length : historyIndex + 1;
|
|
1265
|
+
setHistoryIndex(next);
|
|
1266
|
+
setValue(next === userMessages.length ? "" : (_d = (_c = userMessages[next]) == null ? void 0 : _c.text) != null ? _d : "");
|
|
1267
|
+
}
|
|
1268
|
+
};
|
|
1269
|
+
const adjustTextareaHeight = (0, import_react7.useCallback)(() => {
|
|
1270
|
+
const textarea = textareaRef.current;
|
|
1271
|
+
if (!textarea) return;
|
|
1272
|
+
textarea.style.height = "auto";
|
|
1273
|
+
const newHeight = Math.min(textarea.scrollHeight, 100);
|
|
1274
|
+
textarea.style.height = `${newHeight}px`;
|
|
1275
|
+
}, []);
|
|
1276
|
+
(0, import_react7.useEffect)(() => {
|
|
1277
|
+
setHistoryIndex(userMessages.length);
|
|
1278
|
+
}, [userMessages.length]);
|
|
1279
|
+
(0, import_react7.useEffect)(() => {
|
|
1280
|
+
adjustTextareaHeight();
|
|
1281
|
+
}, [value, adjustTextareaHeight]);
|
|
1282
|
+
(0, import_react7.useEffect)(() => {
|
|
1283
|
+
var _a, _b;
|
|
1284
|
+
let rafId = 0;
|
|
1285
|
+
const resizeHandler = () => {
|
|
1286
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
1287
|
+
rafId = requestAnimationFrame(() => {
|
|
1288
|
+
adjustTextareaHeight();
|
|
1289
|
+
});
|
|
1290
|
+
};
|
|
1291
|
+
window.addEventListener("resize", resizeHandler);
|
|
1292
|
+
let ro = null;
|
|
1293
|
+
const target = (_b = (_a = textareaRef.current) == null ? void 0 : _a.parentElement) != null ? _b : textareaRef.current;
|
|
1294
|
+
if (target && typeof ResizeObserver !== "undefined") {
|
|
1295
|
+
ro = new ResizeObserver(resizeHandler);
|
|
1296
|
+
ro.observe(target);
|
|
1297
|
+
}
|
|
1298
|
+
return () => {
|
|
1299
|
+
window.removeEventListener("resize", resizeHandler);
|
|
1300
|
+
if (ro) ro.disconnect();
|
|
1301
|
+
if (rafId) cancelAnimationFrame(rafId);
|
|
1302
|
+
};
|
|
1303
|
+
}, [adjustTextareaHeight]);
|
|
1304
|
+
return {
|
|
1305
|
+
value,
|
|
1306
|
+
handleChange,
|
|
1307
|
+
handleSubmit,
|
|
1308
|
+
handleKeyDown,
|
|
1309
|
+
textareaRef
|
|
1310
|
+
};
|
|
1311
|
+
};
|
|
885
1312
|
|
|
886
1313
|
// src/components/input-bar/index.tsx
|
|
887
|
-
var
|
|
1314
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
888
1315
|
var ButtonSelectImage = (_a) => {
|
|
889
1316
|
var _b = _a, { onClick, className } = _b, props = __objRest(_b, ["onClick", "className"]);
|
|
890
|
-
return /* @__PURE__ */ (0,
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
891
1318
|
"button",
|
|
892
1319
|
__spreadProps(__spreadValues({
|
|
893
1320
|
type: "button",
|
|
@@ -898,50 +1325,24 @@ var ButtonSelectImage = (_a) => {
|
|
|
898
1325
|
),
|
|
899
1326
|
"aria-label": "Upload image"
|
|
900
1327
|
}, props), {
|
|
901
|
-
children: /* @__PURE__ */ (0,
|
|
1328
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconImagePlus, {})
|
|
902
1329
|
})
|
|
903
1330
|
);
|
|
904
1331
|
};
|
|
905
|
-
var
|
|
1332
|
+
var InputTextArea = (_a) => {
|
|
906
1333
|
var _b = _a, { onMagicClick, placeholder, className } = _b, props = __objRest(_b, ["onMagicClick", "placeholder", "className"]);
|
|
907
|
-
return /* @__PURE__ */ (0,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
"w-full pr-12 bg-gray-100 outline-none ",
|
|
916
|
-
className
|
|
917
|
-
),
|
|
918
|
-
onKeyDown: (e) => {
|
|
919
|
-
var _a2;
|
|
920
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
921
|
-
e.preventDefault();
|
|
922
|
-
(_a2 = e.currentTarget.form) == null ? void 0 : _a2.requestSubmit();
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
}, props)
|
|
926
|
-
),
|
|
927
|
-
onMagicClick && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
928
|
-
"button",
|
|
929
|
-
{
|
|
930
|
-
type: "button",
|
|
931
|
-
onClick: onMagicClick,
|
|
932
|
-
className: "absolute right-2 top-1/2 -translate-y-1/2 w-8 h-8 flex items-center justify-center hover:bg-gray-200 rounded-full transition-colors",
|
|
933
|
-
"aria-label": "AI assist",
|
|
934
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
935
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("title", { children: "Magic/AI Icon" }),
|
|
936
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 2L15 8.5L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L9 8.5L12 2Z" })
|
|
937
|
-
] })
|
|
938
|
-
}
|
|
939
|
-
)
|
|
940
|
-
] });
|
|
1334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-1 relative", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1335
|
+
"textarea",
|
|
1336
|
+
__spreadValues({
|
|
1337
|
+
placeholder,
|
|
1338
|
+
rows: 1,
|
|
1339
|
+
className: "flex-1 pr-1 resize-none max-h-25 w-full text-sm custom-scrollbar focus:outline-none overflow-y-auto"
|
|
1340
|
+
}, props)
|
|
1341
|
+
) });
|
|
941
1342
|
};
|
|
942
1343
|
var ButtonConfirm = (_a) => {
|
|
943
1344
|
var _b = _a, { className, disabled } = _b, props = __objRest(_b, ["className", "disabled"]);
|
|
944
|
-
return /* @__PURE__ */ (0,
|
|
1345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
945
1346
|
"button",
|
|
946
1347
|
__spreadProps(__spreadValues({
|
|
947
1348
|
type: "submit",
|
|
@@ -956,73 +1357,100 @@ var ButtonConfirm = (_a) => {
|
|
|
956
1357
|
"aria-label": "Send message",
|
|
957
1358
|
disabled
|
|
958
1359
|
}, props), {
|
|
959
|
-
children: /* @__PURE__ */ (0,
|
|
1360
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconArrowNarrowUp, { className: "text-black" })
|
|
960
1361
|
})
|
|
961
1362
|
);
|
|
962
1363
|
};
|
|
1364
|
+
var ButtonCancel = () => {
|
|
1365
|
+
const { cancelRequest } = useAizuClient();
|
|
1366
|
+
const { setIsLoading } = useChatContext();
|
|
1367
|
+
const handleClick = () => {
|
|
1368
|
+
cancelRequest();
|
|
1369
|
+
setIsLoading(false);
|
|
1370
|
+
};
|
|
1371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1372
|
+
"button",
|
|
1373
|
+
{
|
|
1374
|
+
type: "button",
|
|
1375
|
+
onClick: handleClick,
|
|
1376
|
+
className: cn(
|
|
1377
|
+
"shrink-0 w-10 h-10 rounded-full ",
|
|
1378
|
+
"bg-gray-100 hover:bg-gray-200 transition-colors",
|
|
1379
|
+
"flex items-center justify-center",
|
|
1380
|
+
"cursor-pointer"
|
|
1381
|
+
),
|
|
1382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "bg-black w-4 h-4" })
|
|
1383
|
+
}
|
|
1384
|
+
);
|
|
1385
|
+
};
|
|
963
1386
|
var InputBar = (_a) => {
|
|
964
1387
|
var _b = _a, {
|
|
965
|
-
|
|
1388
|
+
userMessages,
|
|
966
1389
|
onSend,
|
|
1390
|
+
isLoading,
|
|
967
1391
|
onImageClick,
|
|
968
1392
|
onMagicClick,
|
|
969
1393
|
placeholder = "\u0E16\u0E32\u0E21\u0E04\u0E33\u0E16\u0E32\u0E21\u0E44\u0E14\u0E49\u0E40\u0E25\u0E22...",
|
|
970
1394
|
className
|
|
971
1395
|
} = _b, props = __objRest(_b, [
|
|
972
|
-
"
|
|
1396
|
+
"userMessages",
|
|
973
1397
|
"onSend",
|
|
1398
|
+
"isLoading",
|
|
974
1399
|
"onImageClick",
|
|
975
1400
|
"onMagicClick",
|
|
976
1401
|
"placeholder",
|
|
977
1402
|
"className"
|
|
978
1403
|
]);
|
|
979
|
-
const handleSubmit = (
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
const message = formData.get("message");
|
|
983
|
-
if ((message == null ? void 0 : message.trim()) && onSend) {
|
|
984
|
-
onSend(message);
|
|
985
|
-
e.currentTarget.reset();
|
|
986
|
-
}
|
|
987
|
-
};
|
|
988
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("section", __spreadProps(__spreadValues({ className: cn("bg-white p-4", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("form", { onSubmit: handleSubmit, className: "flex items-center gap-3", children: [
|
|
989
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1404
|
+
const { value, textareaRef, handleChange, handleSubmit, handleKeyDown } = useKeyboard({ userMessages, isLoading, onSend });
|
|
1405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("section", __spreadProps(__spreadValues({ className: cn("bg-white p-4", className) }, props), { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { onSubmit: handleSubmit, className: "flex items-end gap-3", children: [
|
|
1406
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
990
1407
|
"label",
|
|
991
1408
|
{
|
|
992
1409
|
htmlFor: "chat-input-text",
|
|
993
|
-
className: "flex items-
|
|
1410
|
+
className: "flex items-end rounded-3xl bg-gray-100 flex-1 p-2 focus-within:ring-2 focus-within:ring-orange-300",
|
|
994
1411
|
children: [
|
|
995
|
-
/* @__PURE__ */ (0,
|
|
996
|
-
/* @__PURE__ */ (0,
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ButtonSelectImage, { onClick: onImageClick, className: "mr-3" }),
|
|
1413
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1414
|
+
InputTextArea,
|
|
1415
|
+
{
|
|
1416
|
+
ref: textareaRef,
|
|
1417
|
+
id: "chat-input-text",
|
|
1418
|
+
placeholder,
|
|
1419
|
+
onMagicClick,
|
|
1420
|
+
value,
|
|
1421
|
+
onChange: handleChange,
|
|
1422
|
+
onKeyDown: handleKeyDown
|
|
1423
|
+
}
|
|
1424
|
+
)
|
|
997
1425
|
]
|
|
998
1426
|
}
|
|
999
1427
|
),
|
|
1000
|
-
/* @__PURE__ */ (0,
|
|
1428
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ButtonCancel, {}) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ButtonConfirm, { disabled: isLoading })
|
|
1001
1429
|
] }) }));
|
|
1002
1430
|
};
|
|
1003
1431
|
InputBar.ButtonSelectImage = ButtonSelectImage;
|
|
1004
|
-
InputBar.
|
|
1432
|
+
InputBar.InputTextArea = InputTextArea;
|
|
1005
1433
|
InputBar.ButtonConfirm = ButtonConfirm;
|
|
1006
1434
|
|
|
1007
1435
|
// src/components/loading.tsx
|
|
1008
|
-
var
|
|
1436
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1009
1437
|
var Loading = ({ message }) => {
|
|
1010
|
-
return /* @__PURE__ */ (0,
|
|
1011
|
-
/* @__PURE__ */ (0,
|
|
1012
|
-
/* @__PURE__ */ (0,
|
|
1013
|
-
/* @__PURE__ */ (0,
|
|
1014
|
-
/* @__PURE__ */ (0,
|
|
1438
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: cn("flex flex-col justify-center items-center border border-orange-400 shadow shadow-orange-400 h-10 max-w-69.5 rounded-3xl", { "h-16": !!message }), children: [
|
|
1439
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex justify-center items-center gap-x-1 ", children: [
|
|
1440
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-circle-keys animation-delay-300" }),
|
|
1441
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-circle-keys animation-delay-600" }),
|
|
1442
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "w-2 h-2 rounded-full bg-orange-400 animate-circle-keys animation-delay-900" })
|
|
1015
1443
|
] }),
|
|
1016
|
-
message && /* @__PURE__ */ (0,
|
|
1444
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-center text-[12px] text-gray-500 mt-1", children: message })
|
|
1017
1445
|
] });
|
|
1018
1446
|
};
|
|
1019
1447
|
|
|
1020
1448
|
// src/components/button.tsx
|
|
1021
|
-
var
|
|
1022
|
-
var
|
|
1449
|
+
var import_react8 = require("react");
|
|
1450
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1023
1451
|
var ButtonInner = (props, ref) => {
|
|
1024
1452
|
const _a = props, { children, className, onClick } = _a, rest = __objRest(_a, ["children", "className", "onClick"]);
|
|
1025
|
-
return /* @__PURE__ */ (0,
|
|
1453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1026
1454
|
"button",
|
|
1027
1455
|
__spreadProps(__spreadValues({
|
|
1028
1456
|
ref,
|
|
@@ -1040,37 +1468,37 @@ var ButtonInner = (props, ref) => {
|
|
|
1040
1468
|
})
|
|
1041
1469
|
);
|
|
1042
1470
|
};
|
|
1043
|
-
var Button = (0,
|
|
1471
|
+
var Button = (0, import_react8.memo)((0, import_react8.forwardRef)(ButtonInner));
|
|
1044
1472
|
Button.displayName = "Button";
|
|
1045
1473
|
|
|
1046
1474
|
// src/components/container.tsx
|
|
1047
|
-
var
|
|
1475
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1048
1476
|
var Container = (_a) => {
|
|
1049
1477
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
1050
|
-
return /* @__PURE__ */ (0,
|
|
1478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("p-3 rounded-3xl border border-orange-300", className), children });
|
|
1051
1479
|
};
|
|
1052
1480
|
|
|
1053
1481
|
// src/components/product-preview-card/index.tsx
|
|
1054
|
-
var
|
|
1482
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1055
1483
|
var ProductPreviewCard = ({ product, className }) => {
|
|
1056
|
-
return /* @__PURE__ */ (0,
|
|
1057
|
-
/* @__PURE__ */ (0,
|
|
1058
|
-
/* @__PURE__ */ (0,
|
|
1059
|
-
/* @__PURE__ */ (0,
|
|
1060
|
-
/* @__PURE__ */ (0,
|
|
1061
|
-
/* @__PURE__ */ (0,
|
|
1062
|
-
/* @__PURE__ */ (0,
|
|
1063
|
-
/* @__PURE__ */ (0,
|
|
1484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: cn("bg-white overflow-hidden rounded-2xl h-full p-3 lg:hover:shadow", className), children: [
|
|
1485
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProductThumbnail, __spreadValues({}, product)),
|
|
1486
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProductSuggest, __spreadValues({}, product)),
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProductTitle, __spreadValues({}, product)),
|
|
1488
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProductDescription, __spreadValues({}, product)),
|
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProductPrice, __spreadValues({}, product)),
|
|
1490
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProductBadges, {}),
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ProductMenus, __spreadValues({}, product))
|
|
1064
1492
|
] });
|
|
1065
1493
|
};
|
|
1066
1494
|
var ProductThumbnail = (product) => {
|
|
1067
1495
|
if (!product.thumbnail) {
|
|
1068
|
-
return /* @__PURE__ */ (0,
|
|
1496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "border aspect-square flex justify-center items-center", children: "No Image" });
|
|
1069
1497
|
}
|
|
1070
|
-
return /* @__PURE__ */ (0,
|
|
1498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w-full aspect-square flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: product.thumbnail, alt: product.title, className: "w-full" }) });
|
|
1071
1499
|
};
|
|
1072
1500
|
var ProductSuggest = (product) => {
|
|
1073
|
-
return /* @__PURE__ */ (0,
|
|
1501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1074
1502
|
"div",
|
|
1075
1503
|
{
|
|
1076
1504
|
className: "text-[10px] text-[#FF6B00] font-bold bg-[#FFF0D3] max-w-max rounded-sm px-2\n py-px mb-2",
|
|
@@ -1082,16 +1510,16 @@ var ProductSuggest = (product) => {
|
|
|
1082
1510
|
);
|
|
1083
1511
|
};
|
|
1084
1512
|
var ProductTitle = (product) => {
|
|
1085
|
-
return /* @__PURE__ */ (0,
|
|
1513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1086
1514
|
"div",
|
|
1087
1515
|
{
|
|
1088
|
-
className: "font-semibold line-clamp-2 mb-2",
|
|
1516
|
+
className: "font-semibold line-clamp-2 mb-2 min-h-12",
|
|
1089
1517
|
children: product.title
|
|
1090
1518
|
}
|
|
1091
1519
|
);
|
|
1092
1520
|
};
|
|
1093
1521
|
var ProductDescription = (product) => {
|
|
1094
|
-
return /* @__PURE__ */ (0,
|
|
1522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1095
1523
|
"div",
|
|
1096
1524
|
{
|
|
1097
1525
|
className: "text-sm text-[#525252] line-clamp-2 mb-3",
|
|
@@ -1100,7 +1528,7 @@ var ProductDescription = (product) => {
|
|
|
1100
1528
|
);
|
|
1101
1529
|
};
|
|
1102
1530
|
var ProductPrice = (product) => {
|
|
1103
|
-
return /* @__PURE__ */ (0,
|
|
1531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1104
1532
|
"div",
|
|
1105
1533
|
{
|
|
1106
1534
|
className: "text-lg text-red-500 font-semibold mb-3",
|
|
@@ -1117,7 +1545,7 @@ var ProductBadges = () => {
|
|
|
1117
1545
|
{ id: "badge2", text: "\u0E2A\u0E48\u0E07\u0E1F\u0E23\u0E35" },
|
|
1118
1546
|
{ id: "badge3", text: "Cashback 500" }
|
|
1119
1547
|
];
|
|
1120
|
-
return /* @__PURE__ */ (0,
|
|
1548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "flex flex-wrap gap-1 mb-6", children: badges == null ? void 0 : badges.map((badge) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: "text-[10px] text-[#656565] font-bold bg-gray-200 px-2 py-px rounded-sm", children: badge.text }, badge.id)) });
|
|
1121
1549
|
};
|
|
1122
1550
|
var ProductMenus = (product) => {
|
|
1123
1551
|
const menus = [
|
|
@@ -1125,79 +1553,133 @@ var ProductMenus = (product) => {
|
|
|
1125
1553
|
{ id: "product-menu2", text: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E25\u0E07\u0E43\u0E19\u0E23\u0E16\u0E40\u0E02\u0E47\u0E19 \u{1F6D2} " },
|
|
1126
1554
|
{ id: "product-menu3", text: "\u0E2A\u0E2D\u0E1A\u0E16\u0E32\u0E21\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21 \u{1F4AC}" }
|
|
1127
1555
|
];
|
|
1128
|
-
return /* @__PURE__ */ (0,
|
|
1129
|
-
if (menu.text.includes("\
|
|
1130
|
-
return /* @__PURE__ */ (0,
|
|
1556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "flex flex-col gap-y-3", children: menus == null ? void 0 : menus.map((menu) => {
|
|
1557
|
+
if (menu.text.includes("\u0E09\u0E31\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32")) {
|
|
1558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { href: `/products/${product.handle}`, target: "_blank", rel: "noreferrer", className: "border border-orange-300 rounded-3xl px-3 py-2 text-orange-500 text-sm text-center block", children: menu.text }) }, menu.id);
|
|
1131
1559
|
}
|
|
1132
|
-
return /* @__PURE__ */ (0,
|
|
1560
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { className: cn("text-nowrap w-full", { "bg-orange-500 text-white/80": menu.text.includes("\u0E09\u0E31\u0E19\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E0B\u0E37\u0E49\u0E2D\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32") }), children: menu.text }) }, menu.id);
|
|
1133
1561
|
}) });
|
|
1134
1562
|
};
|
|
1135
1563
|
|
|
1136
1564
|
// src/components/message/index.tsx
|
|
1137
|
-
var
|
|
1138
|
-
var MessageBubble = ({ message, handleClick }) => {
|
|
1565
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1566
|
+
var MessageBubble = ({ message, handleClick, focus }) => {
|
|
1139
1567
|
if (message.type === "USER_TEXT" /* USER_TEXT */) {
|
|
1140
|
-
return /* @__PURE__ */ (0,
|
|
1568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MessageText, { message: message.text, role: "user" /* USER */ });
|
|
1141
1569
|
}
|
|
1142
1570
|
if (message.type === "BOT_TEXT" /* BOT_TEXT */) {
|
|
1143
|
-
return /* @__PURE__ */ (0,
|
|
1571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(BotMessageWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MessageText, { message: message.text, role: "bot" /* BOT */, focus }) });
|
|
1144
1572
|
}
|
|
1145
1573
|
if (message.type === "BOT_TEXT_WITH_MENUS" /* BOT_TEXT_WITH_MENUS */ || message.type === "BOT_QUICK_MENUS" /* BOT_QUICK_MENUS */ || message.type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ || message.type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */) {
|
|
1146
|
-
return /* @__PURE__ */ (0,
|
|
1574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(BotMessageWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1575
|
+
MessageWithMenus,
|
|
1576
|
+
{
|
|
1577
|
+
type: message.type,
|
|
1578
|
+
message: message.text || "",
|
|
1579
|
+
menus: message.menus || [],
|
|
1580
|
+
handleClick,
|
|
1581
|
+
focus
|
|
1582
|
+
}
|
|
1583
|
+
) });
|
|
1147
1584
|
}
|
|
1148
1585
|
if (message.type === "BOT_TEXT_WITH_PRODUCTS" /* BOT_TEXT_WITH_PRODUCTS */) {
|
|
1149
|
-
return /* @__PURE__ */ (0,
|
|
1586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(BotMessageWrapper, { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1587
|
+
MessageWithProducts,
|
|
1588
|
+
{
|
|
1589
|
+
type: message.type,
|
|
1590
|
+
message: message.text || "",
|
|
1591
|
+
products: message.products || [],
|
|
1592
|
+
handleClick,
|
|
1593
|
+
focus
|
|
1594
|
+
}
|
|
1595
|
+
) });
|
|
1150
1596
|
}
|
|
1151
|
-
return /* @__PURE__ */ (0,
|
|
1597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(BotMessageWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MessageText, { message: message.text, role: "bot" /* BOT */, focus }) });
|
|
1152
1598
|
};
|
|
1153
|
-
var
|
|
1154
|
-
return /* @__PURE__ */ (0,
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
"a",
|
|
1160
|
-
{
|
|
1161
|
-
href: `tel:+${menu == null ? void 0 : menu.phoneNumber}`,
|
|
1162
|
-
className: "border border-orange-300 rounded-3xl px-4 py-2 text-orange-500 text-sm text-center block",
|
|
1163
|
-
children: menu.title
|
|
1164
|
-
}
|
|
1165
|
-
) }, menu.id);
|
|
1166
|
-
}
|
|
1167
|
-
if (menu == null ? void 0 : menu.url) {
|
|
1168
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: "w-full min-w-max", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { href: menu.url, target: "_blank", rel: "noreferrer", className: "border border-orange-300 rounded-3xl px-4 py-2 text-orange-500 text-sm text-center block", children: menu.title }) }, menu.id);
|
|
1169
|
-
}
|
|
1170
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { className: cn("min-w-max ", { "min-w-full": type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */ }), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1171
|
-
Button,
|
|
1599
|
+
var MessageText = ({ role, message, focus, className }) => {
|
|
1600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1601
|
+
Container,
|
|
1602
|
+
{
|
|
1603
|
+
className: cn(
|
|
1604
|
+
"max-w-2/3 text-sm wrap-break-word",
|
|
1172
1605
|
{
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1606
|
+
"ml-auto border-none bg-orange-200": role === "user" /* USER */,
|
|
1607
|
+
"mr-auto border-none bg-white": role === "bot" /* BOT */ && !focus,
|
|
1608
|
+
"border border-orange-400 shadow-orange-blur-16": role === "bot" /* BOT */ && focus
|
|
1609
|
+
},
|
|
1610
|
+
className
|
|
1611
|
+
),
|
|
1612
|
+
children: message
|
|
1613
|
+
}
|
|
1614
|
+
);
|
|
1615
|
+
};
|
|
1616
|
+
var MessageWithMenus = ({ type, message, menus, className, handleClick, focus }) => {
|
|
1617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1618
|
+
Container,
|
|
1619
|
+
{
|
|
1620
|
+
className: cn(
|
|
1621
|
+
"mr-auto max-w-80 text-sm bg-white",
|
|
1622
|
+
{
|
|
1623
|
+
"border-orange-400 shadow-orange-blur-16": focus,
|
|
1624
|
+
"border-none": !focus
|
|
1625
|
+
},
|
|
1626
|
+
className
|
|
1627
|
+
),
|
|
1628
|
+
children: [
|
|
1629
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-sm mb-4", children: message }),
|
|
1630
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: cn("flex flex-wrap gap-x-1 gap-y-3", { "flex-col": type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ }), children: menus == null ? void 0 : menus.map((menu) => {
|
|
1631
|
+
if (menu == null ? void 0 : menu.phoneNumber) {
|
|
1632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { className: "w-full ", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1633
|
+
"a",
|
|
1634
|
+
{
|
|
1635
|
+
href: `tel:+${menu == null ? void 0 : menu.phoneNumber}`,
|
|
1636
|
+
className: "border border-orange-300 rounded-3xl px-4 py-2 text-orange-500 text-sm text-center block",
|
|
1637
|
+
children: menu.title
|
|
1638
|
+
}
|
|
1639
|
+
) }, menu.id);
|
|
1640
|
+
}
|
|
1641
|
+
if (menu == null ? void 0 : menu.url) {
|
|
1642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { className: "w-full min-w-max", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("a", { href: menu.url, target: "_blank", rel: "noreferrer", className: "border border-orange-300 rounded-3xl px-4 py-2 text-orange-500 text-sm text-center block", children: menu.title }) }, menu.id);
|
|
1643
|
+
}
|
|
1644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { className: cn("min-w-max ", { "min-w-full": type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */ }), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1645
|
+
Button,
|
|
1646
|
+
{
|
|
1647
|
+
className: cn({ "w-full": type === "BOT_ERROR_WITH_MENUS" /* BOT_ERROR_WITH_MENUS */ || type === "BOT_TEXT_WITH_MENUS_COL" /* BOT_TEXT_WITH_MENUS_COL */ }),
|
|
1648
|
+
onClick: () => {
|
|
1649
|
+
handleClick(menu);
|
|
1650
|
+
},
|
|
1651
|
+
children: menu.title
|
|
1652
|
+
}
|
|
1653
|
+
) }, menu.id);
|
|
1654
|
+
}) })
|
|
1655
|
+
]
|
|
1656
|
+
}
|
|
1657
|
+
);
|
|
1182
1658
|
};
|
|
1183
|
-
var MessageWithProducts = ({ message, className, products, handleClick }) => {
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
/* @__PURE__ */ (0,
|
|
1659
|
+
var MessageWithProducts = ({ message, className, products, focus, handleClick }) => {
|
|
1660
|
+
const { chatControls } = useChatContext();
|
|
1661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("w-full", className), children: [
|
|
1662
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MessageText, { message, role: "bot" /* BOT */, className: "mb-4", focus }),
|
|
1663
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "pl-4", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1187
1664
|
"ul",
|
|
1188
1665
|
{
|
|
1189
1666
|
className: "flex gap-3 lg:gap-x-2 overflow-x-auto scrollbar-hide -mx-4 snap-x snap-mandatory",
|
|
1190
|
-
children: products == null ? void 0 : products.map((product) => /* @__PURE__ */ (0,
|
|
1667
|
+
children: products == null ? void 0 : products.map((product) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1191
1668
|
"li",
|
|
1192
1669
|
{
|
|
1193
1670
|
className: cn(
|
|
1194
1671
|
"mb-4 snap-start shrink-0 ",
|
|
1195
|
-
"w-[calc(100%/
|
|
1672
|
+
"w-[calc(100%/1.3)] max-w-[calc(100%/1.3)]",
|
|
1673
|
+
"mobile-360:w-[calc(100%/1.7)] mobile-360:max-w-[calc(100%/1.7)] ",
|
|
1674
|
+
"mobile-430:w-[calc(100%/2.2)] mobile-430:max-w-[calc(100%/2.2)] ",
|
|
1675
|
+
"sm:w-[calc(100%/2.5)] sm:max-w-[calc(100%/2.5)]",
|
|
1676
|
+
"md:w-[calc(100%/3)] md:max-w-[calc(100%/3)]",
|
|
1196
1677
|
{
|
|
1197
|
-
"
|
|
1678
|
+
"lg:w-[calc(100%/2.2)] lg:max-w-[calc(100%/2.2)]": !chatControls.isExpanded,
|
|
1679
|
+
"lg:w-[calc(100%/4.6)] lg:max-w-[calc(100%/4.6)]": chatControls.isExpanded
|
|
1198
1680
|
}
|
|
1199
1681
|
),
|
|
1200
|
-
children: /* @__PURE__ */ (0,
|
|
1682
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ProductPreviewCard, { product })
|
|
1201
1683
|
},
|
|
1202
1684
|
product.product_id
|
|
1203
1685
|
))
|
|
@@ -1205,22 +1687,19 @@ var MessageWithProducts = ({ message, className, products, handleClick }) => {
|
|
|
1205
1687
|
) })
|
|
1206
1688
|
] });
|
|
1207
1689
|
};
|
|
1208
|
-
var
|
|
1209
|
-
|
|
1210
|
-
};
|
|
1211
|
-
var BotMessageWrapper = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: cn("flex flex-col items-start", className), children: [
|
|
1212
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(IconAI, { className: "mb-2" }),
|
|
1690
|
+
var BotMessageWrapper = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: cn("flex flex-col items-start w-full", className), children: [
|
|
1691
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(IconAI, { className: "mb-2" }),
|
|
1213
1692
|
children
|
|
1214
1693
|
] });
|
|
1215
1694
|
|
|
1216
1695
|
// src/components/quick-menus.tsx
|
|
1217
|
-
var
|
|
1696
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1218
1697
|
var QuickMenus = ({ bannerSrc, message = "welcome message", menus, handleClick }) => {
|
|
1219
|
-
return /* @__PURE__ */ (0,
|
|
1220
|
-
bannerSrc ? /* @__PURE__ */ (0,
|
|
1221
|
-
/* @__PURE__ */ (0,
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1223
|
-
/* @__PURE__ */ (0,
|
|
1698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("section", { className: "w-75.5 bg-white shadow rounded-3xl overflow-hidden", children: [
|
|
1699
|
+
bannerSrc ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: bannerSrc, alt: "banner" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-75.5 h-29.5 border-b border-gray-200" }),
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "p-3 flex flex-col gap-y-3", children: [
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm ", children: message }),
|
|
1702
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("ul", { className: "flex gap-3 flex-wrap", children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Button, { onClick: () => {
|
|
1224
1703
|
handleClick(menu);
|
|
1225
1704
|
}, children: menu.title }) }, menu.id)) })
|
|
1226
1705
|
] })
|
|
@@ -1228,11 +1707,19 @@ var QuickMenus = ({ bannerSrc, message = "welcome message", menus, handleClick }
|
|
|
1228
1707
|
};
|
|
1229
1708
|
|
|
1230
1709
|
// src/components/quick-menus-chip.tsx
|
|
1231
|
-
var
|
|
1710
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1232
1711
|
var QuickMenuChips = ({ menus, handleClick, className }) => {
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
/* @__PURE__ */ (0,
|
|
1712
|
+
const { chatControls } = useChatContext();
|
|
1713
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative", children: [
|
|
1714
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute lg:hidden right-0 top-0 bottom-0 w-8 bg-linear-to-l from-white to-transparent pointer-events-none z-10" }),
|
|
1715
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ul", { className: cn(
|
|
1716
|
+
"flex gap-3 overflow-x-scroll scrollbar-hide pr-10",
|
|
1717
|
+
{
|
|
1718
|
+
"lg:flex-wrap lg:max-h-28": !chatControls.isExpanded,
|
|
1719
|
+
"h-14": chatControls.isExpanded
|
|
1720
|
+
},
|
|
1721
|
+
className
|
|
1722
|
+
), children: menus == null ? void 0 : menus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1236
1723
|
Button,
|
|
1237
1724
|
{
|
|
1238
1725
|
onClick: () => {
|
|
@@ -1247,20 +1734,21 @@ var QuickMenuChips = ({ menus, handleClick, className }) => {
|
|
|
1247
1734
|
var quick_menus_chip_default = QuickMenuChips;
|
|
1248
1735
|
|
|
1249
1736
|
// src/components/aizu-chat.tsx
|
|
1250
|
-
var
|
|
1251
|
-
var
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
/* @__PURE__ */ (0,
|
|
1255
|
-
|
|
1256
|
-
/* @__PURE__ */ (0,
|
|
1257
|
-
/* @__PURE__ */ (0,
|
|
1737
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1738
|
+
var LOADING_TIMEOUT = 15e3;
|
|
1739
|
+
var AizuChat = ({ aizuClient }) => {
|
|
1740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(AizuClientProvider, { client: aizuClient, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChatProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
1741
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FloatingButton, {}),
|
|
1742
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(ChatWindow, { children: [
|
|
1743
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChatHeader, {}),
|
|
1744
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChatBody, {}),
|
|
1745
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChatFooter, {})
|
|
1258
1746
|
] })
|
|
1259
|
-
] }) });
|
|
1747
|
+
] }) }) });
|
|
1260
1748
|
};
|
|
1261
1749
|
var FloatingButton = () => {
|
|
1262
1750
|
const { chatControls } = useChatContext();
|
|
1263
|
-
return /* @__PURE__ */ (0,
|
|
1751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1264
1752
|
"button",
|
|
1265
1753
|
{
|
|
1266
1754
|
type: "button",
|
|
@@ -1272,111 +1760,113 @@ var FloatingButton = () => {
|
|
|
1272
1760
|
}
|
|
1273
1761
|
),
|
|
1274
1762
|
"aria-label": "Toggle chat",
|
|
1275
|
-
children: /* @__PURE__ */ (0,
|
|
1763
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconAI, { className: "w-full h-full" })
|
|
1276
1764
|
}
|
|
1277
1765
|
);
|
|
1278
1766
|
};
|
|
1279
1767
|
var ChatWindow = ({ children }) => {
|
|
1280
1768
|
const { chatControls } = useChatContext();
|
|
1281
|
-
return /* @__PURE__ */ (0,
|
|
1282
|
-
chatControls.isExpanded && /* @__PURE__ */ (0,
|
|
1769
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
1770
|
+
chatControls.isExpanded && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1283
1771
|
"div",
|
|
1284
1772
|
{
|
|
1285
1773
|
className: "fixed inset-0 bg-black/50 z-9998 transition-opacity duration-300",
|
|
1286
1774
|
onClick: chatControls.toggleExpand,
|
|
1287
1775
|
onKeyDown: void 0,
|
|
1288
|
-
"aria-hidden": "true"
|
|
1289
|
-
"aria-label": "Close expanded chat"
|
|
1776
|
+
"aria-hidden": "true"
|
|
1290
1777
|
}
|
|
1291
1778
|
),
|
|
1292
|
-
/* @__PURE__ */ (0,
|
|
1293
|
-
"
|
|
1294
|
-
"z-9999 fixed top-0 right-0 lg:right-5 lg:bottom-25 lg:top-auto bg-[#F8F8FA]",
|
|
1295
|
-
"lg:rounded-4xl shadow-orange-blur overflow-hidden",
|
|
1296
|
-
"flex flex-col",
|
|
1297
|
-
"transition-all duration-300 ease-in-out",
|
|
1298
|
-
{
|
|
1299
|
-
"opacity-0 pointer-events-none translate-y-4": !chatControls.isOpen,
|
|
1300
|
-
"opacity-100 pointer-events-auto translate-y-0": chatControls.isOpen
|
|
1301
|
-
},
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1780
|
+
"div",
|
|
1302
1781
|
{
|
|
1303
|
-
|
|
1782
|
+
className: cn(
|
|
1783
|
+
"w-full lg:w-115 h-full lg:h-[calc(100vh-100px)] lg:max-h-201",
|
|
1784
|
+
"z-9999 fixed top-0 right-0 lg:right-5 lg:bottom-25 lg:top-auto bg-[#F8F8FA]",
|
|
1785
|
+
"lg:rounded-4xl shadow-orange-blur overflow-hidden",
|
|
1786
|
+
"flex flex-col",
|
|
1787
|
+
"transition-all duration-300 ease-in-out",
|
|
1788
|
+
{
|
|
1789
|
+
"opacity-0 pointer-events-none translate-y-4": !chatControls.isOpen,
|
|
1790
|
+
"opacity-100 pointer-events-auto translate-y-0": chatControls.isOpen
|
|
1791
|
+
},
|
|
1792
|
+
{
|
|
1793
|
+
"lg:right-1/2 lg:translate-x-1/2 lg:w-[calc(100vw-100px)] lg:max-w-289 ": chatControls.isExpanded
|
|
1794
|
+
}
|
|
1795
|
+
),
|
|
1796
|
+
children
|
|
1304
1797
|
}
|
|
1305
|
-
)
|
|
1798
|
+
)
|
|
1306
1799
|
] });
|
|
1307
1800
|
};
|
|
1308
1801
|
var ChatHeader = () => {
|
|
1309
1802
|
const { chatControls } = useChatContext();
|
|
1310
|
-
return /* @__PURE__ */ (0,
|
|
1311
|
-
/* @__PURE__ */ (0,
|
|
1803
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("section", { className: "flex justify-between items-center bg-white py-3 px-4", children: [
|
|
1804
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1312
1805
|
"button",
|
|
1313
1806
|
{
|
|
1314
1807
|
type: "button",
|
|
1315
1808
|
onClick: chatControls.closeChat,
|
|
1316
1809
|
className: "text-sm text-left cursor-pointer flex flex-1 lg:invisible",
|
|
1317
1810
|
children: [
|
|
1318
|
-
/* @__PURE__ */ (0,
|
|
1319
|
-
/* @__PURE__ */ (0,
|
|
1811
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconChevronLeft, {}),
|
|
1812
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: "\u0E22\u0E49\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A" })
|
|
1320
1813
|
]
|
|
1321
1814
|
}
|
|
1322
1815
|
),
|
|
1323
|
-
/* @__PURE__ */ (0,
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
1816
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col items-center flex-1 ", children: [
|
|
1817
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-nowrap", children: "ZIMCRAFT STORE" }),
|
|
1818
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-[10px] text-[#7C7C7C]", children: "Powered by Zimpligital" })
|
|
1326
1819
|
] }),
|
|
1327
|
-
/* @__PURE__ */ (0,
|
|
1328
|
-
/* @__PURE__ */ (0,
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1 flex items-center justify-end gap-2 invisible lg:visible", children: [
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1329
1822
|
"button",
|
|
1330
1823
|
{
|
|
1331
1824
|
type: "button",
|
|
1332
1825
|
"aria-label": "Expand chat",
|
|
1333
1826
|
onClick: chatControls.toggleExpand,
|
|
1334
1827
|
className: "text-sm p-2.5 cursor-pointer",
|
|
1335
|
-
children: chatControls.isExpanded ? /* @__PURE__ */ (0,
|
|
1828
|
+
children: chatControls.isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconMinimize, { className: "hover:text-orange-500" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconExpand, { className: "hover:text-orange-500" })
|
|
1336
1829
|
}
|
|
1337
1830
|
),
|
|
1338
|
-
/* @__PURE__ */ (0,
|
|
1831
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1339
1832
|
"button",
|
|
1340
1833
|
{
|
|
1341
1834
|
type: "button",
|
|
1342
1835
|
"aria-label": "Close chat",
|
|
1343
1836
|
onClick: chatControls.closeChat,
|
|
1344
1837
|
className: "text-sm p-2.5 cursor-pointer",
|
|
1345
|
-
children: /* @__PURE__ */ (0,
|
|
1838
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconXClose, { className: "hover:text-orange-500" })
|
|
1346
1839
|
}
|
|
1347
1840
|
)
|
|
1348
1841
|
] })
|
|
1349
1842
|
] });
|
|
1350
1843
|
};
|
|
1351
1844
|
var ChatBody = () => {
|
|
1352
|
-
const { isLoading, addUserMessage, addBotMessage, messages, latestMessage } = useChatContext();
|
|
1353
|
-
const
|
|
1354
|
-
const
|
|
1355
|
-
|
|
1845
|
+
const { isLoading, setIsLoading, addUserMessage, addBotMessage, messages, latestMessage } = useChatContext();
|
|
1846
|
+
const { sendMessage } = useAizuClient();
|
|
1847
|
+
const { handleClickMenu } = useSendChat({
|
|
1848
|
+
addBotMessage,
|
|
1849
|
+
addUserMessage,
|
|
1850
|
+
sendMessage,
|
|
1851
|
+
latestMessage,
|
|
1852
|
+
isLoading,
|
|
1853
|
+
setIsLoading
|
|
1854
|
+
});
|
|
1855
|
+
const [showWaitMessage, setShowWaitMessage] = (0, import_react9.useState)(false);
|
|
1856
|
+
const messagesEndRef = (0, import_react9.useRef)(null);
|
|
1857
|
+
const loadingMessage = showWaitMessage ? "\u0E23\u0E2D\u0E2A\u0E31\u0E01\u0E04\u0E23\u0E39\u0E48\u0E19\u0E30\u0E04\u0E23\u0E31\u0E1A... \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2B\u0E32\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E21\u0E32\u0E43\u0E2B\u0E49" : void 0;
|
|
1356
1858
|
const messagesDisplay = messages || [];
|
|
1357
1859
|
const displayWelcomeMessage = messagesDisplay.length === 0 && !isLoading;
|
|
1358
|
-
|
|
1359
|
-
if (menu.title.includes(tryAgain) && !!(latestMessage == null ? void 0 : latestMessage.text)) {
|
|
1360
|
-
addUserMessage(latestMessage == null ? void 0 : latestMessage.text);
|
|
1361
|
-
if (latestMessage == null ? void 0 : latestMessage.text) {
|
|
1362
|
-
return addBotMessage(getMockBotMessageByText(latestMessage == null ? void 0 : latestMessage.text));
|
|
1363
|
-
}
|
|
1364
|
-
} else {
|
|
1365
|
-
addUserMessage(menu.title);
|
|
1366
|
-
}
|
|
1367
|
-
const mockResponse2 = getMockBotMessage(menu);
|
|
1368
|
-
addBotMessage(mockResponse2);
|
|
1369
|
-
}), [addUserMessage, addBotMessage, latestMessage]);
|
|
1370
|
-
(0, import_react4.useEffect)(() => {
|
|
1860
|
+
(0, import_react9.useEffect)(() => {
|
|
1371
1861
|
var _a;
|
|
1372
1862
|
(_a = messagesEndRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
|
|
1373
1863
|
}, [isLoading, messagesDisplay.length]);
|
|
1374
|
-
(0,
|
|
1864
|
+
(0, import_react9.useEffect)(() => {
|
|
1375
1865
|
let timer;
|
|
1376
1866
|
if (isLoading) {
|
|
1377
1867
|
timer = setTimeout(() => {
|
|
1378
1868
|
setShowWaitMessage(true);
|
|
1379
|
-
},
|
|
1869
|
+
}, LOADING_TIMEOUT);
|
|
1380
1870
|
} else {
|
|
1381
1871
|
setShowWaitMessage(false);
|
|
1382
1872
|
}
|
|
@@ -1384,49 +1874,60 @@ var ChatBody = () => {
|
|
|
1384
1874
|
if (timer) clearTimeout(timer);
|
|
1385
1875
|
};
|
|
1386
1876
|
}, [isLoading]);
|
|
1387
|
-
return /* @__PURE__ */ (0,
|
|
1388
|
-
/* @__PURE__ */ (0,
|
|
1389
|
-
/* @__PURE__ */ (0,
|
|
1390
|
-
/* @__PURE__ */ (0,
|
|
1877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("section", { className: "flex-1 overflow-y-auto relative scrollbar-hide", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("section", { className: " p-4 flex flex-col gap-y-3 overflow-y-auto min-h-full", children: [
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
1879
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconAI, { className: "mb-2" }),
|
|
1880
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1881
|
+
QuickMenus,
|
|
1882
|
+
{
|
|
1883
|
+
bannerSrc: defaultBanner,
|
|
1884
|
+
menus: defaultQuickMenus,
|
|
1885
|
+
message: defaultQuickMenuMessage,
|
|
1886
|
+
handleClick: handleClickMenu
|
|
1887
|
+
}
|
|
1888
|
+
)
|
|
1391
1889
|
] }),
|
|
1392
|
-
messagesDisplay == null ? void 0 : messagesDisplay.map((message) => {
|
|
1393
|
-
return /* @__PURE__ */ (0,
|
|
1890
|
+
messagesDisplay == null ? void 0 : messagesDisplay.map((message, index) => {
|
|
1891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w-full flex flex-col items-start", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MessageBubble, { message, handleClick: handleClickMenu, focus: messagesDisplay.length - 1 === index }) }, message.id);
|
|
1394
1892
|
}),
|
|
1395
|
-
isLoading && /* @__PURE__ */ (0,
|
|
1396
|
-
/* @__PURE__ */ (0,
|
|
1397
|
-
/* @__PURE__ */ (0,
|
|
1893
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
1894
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(IconAI, { className: "mb-2" }),
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Loading, { message: loadingMessage })
|
|
1398
1896
|
] }),
|
|
1399
|
-
/* @__PURE__ */ (0,
|
|
1400
|
-
displayWelcomeMessage && /* @__PURE__ */ (0,
|
|
1897
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref: messagesEndRef }),
|
|
1898
|
+
displayWelcomeMessage && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "mt-auto text-center text-sm text-gray-500", children: "\u0E04\u0E38\u0E13\u0E01\u0E33\u0E25\u0E31\u0E07\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19\u0E2A\u0E19\u0E17\u0E19\u0E32\u0E01\u0E31\u0E1A ZIMCRAFT AI" })
|
|
1401
1899
|
] }) });
|
|
1402
1900
|
};
|
|
1403
1901
|
var ChatFooter = () => {
|
|
1404
|
-
const { addUserMessage, addBotMessage, latestMessage, isLoading } = useChatContext();
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1902
|
+
const { addUserMessage, addBotMessage, userMessages, latestMessage, isLoading, setIsLoading, chatControls } = useChatContext();
|
|
1903
|
+
const { sendMessage } = useAizuClient();
|
|
1904
|
+
const { handleSendMessage, handleClickMenu } = useSendChat({
|
|
1905
|
+
addBotMessage,
|
|
1906
|
+
addUserMessage,
|
|
1907
|
+
sendMessage,
|
|
1908
|
+
latestMessage,
|
|
1909
|
+
isLoading,
|
|
1910
|
+
setIsLoading
|
|
1911
|
+
});
|
|
1912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("section", { className: cn(
|
|
1913
|
+
"bg-white min:h-42.5 lg:h-auto",
|
|
1914
|
+
{ "lg:h-auto": chatControls.isExpanded }
|
|
1915
|
+
), children: [
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1917
|
+
quick_menus_chip_default,
|
|
1918
|
+
{
|
|
1919
|
+
handleClick: handleClickMenu,
|
|
1920
|
+
menus: defaultQuickMenuChips,
|
|
1921
|
+
className: "pl-4 pt-4 pb-2"
|
|
1410
1922
|
}
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
}
|
|
1414
|
-
const mockResponse2 = getMockBotMessage(menu);
|
|
1415
|
-
addBotMessage(mockResponse2);
|
|
1416
|
-
}), [addUserMessage, addBotMessage, latestMessage]);
|
|
1417
|
-
const handleSend = (0, import_react4.useCallback)((message) => {
|
|
1418
|
-
addUserMessage(message);
|
|
1419
|
-
const mockResponse2 = getMockBotMessageByText(message);
|
|
1420
|
-
addBotMessage(mockResponse2);
|
|
1421
|
-
}, [addUserMessage, addBotMessage]);
|
|
1422
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "bg-white h-42.5 lg:h-46", children: [
|
|
1423
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(quick_menus_chip_default, { handleClick, menus: defaultQuickMenuChips, className: "pl-4 pt-4 pb-2" }),
|
|
1424
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1923
|
+
),
|
|
1924
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1425
1925
|
InputBar,
|
|
1426
1926
|
{
|
|
1427
1927
|
placeholder: "\u0E16\u0E32\u0E21\u0E04\u0E33\u0E16\u0E32\u0E21\u0E44\u0E14\u0E49\u0E40\u0E25\u0E22...",
|
|
1928
|
+
userMessages,
|
|
1428
1929
|
isLoading,
|
|
1429
|
-
onSend:
|
|
1930
|
+
onSend: handleSendMessage,
|
|
1430
1931
|
onImageClick: () => console.log("Image upload"),
|
|
1431
1932
|
onMagicClick: () => console.log("AI assist")
|
|
1432
1933
|
}
|
|
@@ -1434,10 +1935,125 @@ var ChatFooter = () => {
|
|
|
1434
1935
|
] });
|
|
1435
1936
|
};
|
|
1436
1937
|
|
|
1938
|
+
// src/components/test-component.tsx
|
|
1939
|
+
var import_react10 = require("react");
|
|
1940
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1941
|
+
var TestComponent = ({ client }) => {
|
|
1942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AizuClientProvider, { client, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TestComponentContent, {}) });
|
|
1943
|
+
};
|
|
1944
|
+
var TestComponentContent = () => {
|
|
1945
|
+
const {
|
|
1946
|
+
sendMessage,
|
|
1947
|
+
resourceId,
|
|
1948
|
+
threadId,
|
|
1949
|
+
clearConversation,
|
|
1950
|
+
cancelRequest
|
|
1951
|
+
} = useAizuClient();
|
|
1952
|
+
const [query, setQuery] = (0, import_react10.useState)("");
|
|
1953
|
+
const [response, setResponse] = (0, import_react10.useState)("");
|
|
1954
|
+
const [loading, setLoading] = (0, import_react10.useState)(false);
|
|
1955
|
+
const handleSend = () => __async(null, null, function* () {
|
|
1956
|
+
if (!query.trim()) return;
|
|
1957
|
+
setLoading(true);
|
|
1958
|
+
setResponse("");
|
|
1959
|
+
console.log("\u{1F4E4} Sending query:", query);
|
|
1960
|
+
const result = yield sendMessage(query);
|
|
1961
|
+
if (result.success) {
|
|
1962
|
+
console.log("\u2705 Got response:", result.data);
|
|
1963
|
+
setResponse(result.data.response);
|
|
1964
|
+
setQuery("");
|
|
1965
|
+
} else {
|
|
1966
|
+
console.error("\u274C Error:", result.message);
|
|
1967
|
+
setResponse(`\u274C Error: ${result.message}`);
|
|
1968
|
+
}
|
|
1969
|
+
setLoading(false);
|
|
1970
|
+
});
|
|
1971
|
+
const handleClear = () => {
|
|
1972
|
+
if (confirm("Start new conversation? This will clear your chat history.")) {
|
|
1973
|
+
clearConversation();
|
|
1974
|
+
setResponse("");
|
|
1975
|
+
setQuery("");
|
|
1976
|
+
console.log("\u{1F504} Conversation cleared!");
|
|
1977
|
+
}
|
|
1978
|
+
};
|
|
1979
|
+
const handleCancel = () => {
|
|
1980
|
+
cancelRequest();
|
|
1981
|
+
setLoading(false);
|
|
1982
|
+
setResponse("\u26A0\uFE0F Request cancelled by user");
|
|
1983
|
+
console.log("\u{1F6D1} Request cancelled");
|
|
1984
|
+
};
|
|
1985
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "border-2 border-blue-500 p-4 rounded space-y-4", children: [
|
|
1986
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex justify-between items-center", children: [
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h2", { className: "font-bold text-xl", children: "Test API Call" }),
|
|
1988
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1989
|
+
"button",
|
|
1990
|
+
{
|
|
1991
|
+
type: "button",
|
|
1992
|
+
onClick: handleClear,
|
|
1993
|
+
className: "text-sm bg-gray-200 px-3 py-1 rounded hover:bg-gray-300 disabled:opacity-50",
|
|
1994
|
+
disabled: loading,
|
|
1995
|
+
children: "\u{1F504} New Chat"
|
|
1996
|
+
}
|
|
1997
|
+
)
|
|
1998
|
+
] }),
|
|
1999
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "text-sm space-y-1", children: [
|
|
2000
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: threadId ? "text-green-600" : "text-gray-400", children: [
|
|
2001
|
+
"\u{1F517} Thread ID: ",
|
|
2002
|
+
threadId || "(waiting for first message)"
|
|
2003
|
+
] }),
|
|
2004
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: resourceId ? "text-green-600" : "text-gray-400", children: [
|
|
2005
|
+
"\u{1F4E6} Resource ID: ",
|
|
2006
|
+
resourceId || "(waiting for first message)"
|
|
2007
|
+
] })
|
|
2008
|
+
] }),
|
|
2009
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex gap-2", children: [
|
|
2010
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2011
|
+
"input",
|
|
2012
|
+
{
|
|
2013
|
+
type: "text",
|
|
2014
|
+
value: query,
|
|
2015
|
+
onChange: (e) => setQuery(e.target.value),
|
|
2016
|
+
onKeyDown: (e) => e.key === "Enter" && !loading && handleSend(),
|
|
2017
|
+
placeholder: "Type your question...",
|
|
2018
|
+
className: "flex-1 border p-2 rounded focus:outline-none focus:ring-2 focus:ring-blue-500",
|
|
2019
|
+
disabled: loading
|
|
2020
|
+
}
|
|
2021
|
+
),
|
|
2022
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2023
|
+
"button",
|
|
2024
|
+
{
|
|
2025
|
+
type: "button",
|
|
2026
|
+
onClick: handleCancel,
|
|
2027
|
+
className: "bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600 min-w-[100px]",
|
|
2028
|
+
children: "\u23F9 Cancel"
|
|
2029
|
+
}
|
|
2030
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2031
|
+
"button",
|
|
2032
|
+
{
|
|
2033
|
+
type: "button",
|
|
2034
|
+
onClick: handleSend,
|
|
2035
|
+
disabled: !query.trim(),
|
|
2036
|
+
className: "bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600 disabled:bg-gray-400 disabled:cursor-not-allowed min-w-[100px]",
|
|
2037
|
+
children: "\u{1F4E4} Send"
|
|
2038
|
+
}
|
|
2039
|
+
)
|
|
2040
|
+
] }),
|
|
2041
|
+
response && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "p-3 bg-gray-100 rounded", children: [
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { className: "text-gray-700", children: "Response:" }),
|
|
2043
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "mt-1 whitespace-pre-wrap text-gray-900", children: response })
|
|
2044
|
+
] }),
|
|
2045
|
+
!threadId && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "text-xs text-gray-500 border-t pt-2 mt-2", children: [
|
|
2046
|
+
"\u{1F4A1} ",
|
|
2047
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("strong", { children: "Tip:" }),
|
|
2048
|
+
" Send your first message to start a conversation. The thread ID will be saved and persist across page refreshes."
|
|
2049
|
+
] })
|
|
2050
|
+
] });
|
|
2051
|
+
};
|
|
2052
|
+
|
|
1437
2053
|
// src/hooks/use-custom.ts
|
|
1438
|
-
var
|
|
2054
|
+
var import_react11 = require("react");
|
|
1439
2055
|
var useCustom = () => {
|
|
1440
|
-
const [count, setCount] = (0,
|
|
2056
|
+
const [count, setCount] = (0, import_react11.useState)(0);
|
|
1441
2057
|
const increment = () => {
|
|
1442
2058
|
setCount(count + 1);
|
|
1443
2059
|
};
|
|
@@ -1446,8 +2062,12 @@ var useCustom = () => {
|
|
|
1446
2062
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1447
2063
|
0 && (module.exports = {
|
|
1448
2064
|
AizuChat,
|
|
2065
|
+
AizuClient,
|
|
1449
2066
|
Button,
|
|
1450
2067
|
Loading,
|
|
1451
2068
|
QuickMenus,
|
|
2069
|
+
TestComponent,
|
|
2070
|
+
TypeResponse,
|
|
2071
|
+
createAizuClient,
|
|
1452
2072
|
useCustom
|
|
1453
2073
|
});
|