@cossistant/react 0.0.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/_virtual/rolldown_runtime.js +13 -0
- package/conversation.d.ts +312 -0
- package/conversation.d.ts.map +1 -0
- package/hooks/index.d.ts +23 -0
- package/hooks/index.js +24 -0
- package/hooks/private/store/use-conversations-store.d.ts +13 -0
- package/hooks/private/store/use-conversations-store.d.ts.map +1 -0
- package/hooks/private/store/use-conversations-store.js +34 -0
- package/hooks/private/store/use-conversations-store.js.map +1 -0
- package/hooks/private/store/use-store-selector.d.ts +10 -0
- package/hooks/private/store/use-store-selector.d.ts.map +1 -0
- package/hooks/private/store/use-store-selector.js +17 -0
- package/hooks/private/store/use-store-selector.js.map +1 -0
- package/hooks/private/store/use-website-store.d.ts +18 -0
- package/hooks/private/store/use-website-store.d.ts.map +1 -0
- package/hooks/private/store/use-website-store.js +39 -0
- package/hooks/private/store/use-website-store.js.map +1 -0
- package/hooks/private/use-client-query.d.ts +25 -0
- package/hooks/private/use-client-query.d.ts.map +1 -0
- package/hooks/private/use-client-query.js +122 -0
- package/hooks/private/use-client-query.js.map +1 -0
- package/hooks/private/use-default-messages.d.ts +18 -0
- package/hooks/private/use-default-messages.d.ts.map +1 -0
- package/hooks/private/use-default-messages.js +45 -0
- package/hooks/private/use-default-messages.js.map +1 -0
- package/hooks/private/use-grouped-messages.d.ts +54 -0
- package/hooks/private/use-grouped-messages.d.ts.map +1 -0
- package/hooks/private/use-grouped-messages.js +157 -0
- package/hooks/private/use-grouped-messages.js.map +1 -0
- package/hooks/private/use-multimodal-input.d.ts +40 -0
- package/hooks/private/use-multimodal-input.d.ts.map +1 -0
- package/hooks/private/use-multimodal-input.js +129 -0
- package/hooks/private/use-multimodal-input.js.map +1 -0
- package/hooks/private/use-rest-client.d.ts +17 -0
- package/hooks/private/use-rest-client.d.ts.map +1 -0
- package/hooks/private/use-rest-client.js +41 -0
- package/hooks/private/use-rest-client.js.map +1 -0
- package/hooks/private/use-visitor-typing-reporter.d.ts +19 -0
- package/hooks/private/use-visitor-typing-reporter.d.ts.map +1 -0
- package/hooks/private/use-visitor-typing-reporter.js +140 -0
- package/hooks/private/use-visitor-typing-reporter.js.map +1 -0
- package/hooks/use-composer-refocus.d.ts +20 -0
- package/hooks/use-composer-refocus.d.ts.map +1 -0
- package/hooks/use-composer-refocus.js +32 -0
- package/hooks/use-composer-refocus.js.map +1 -0
- package/hooks/use-conversation-auto-seen.d.ts +54 -0
- package/hooks/use-conversation-auto-seen.d.ts.map +1 -0
- package/hooks/use-conversation-auto-seen.js +106 -0
- package/hooks/use-conversation-auto-seen.js.map +1 -0
- package/hooks/use-conversation-history-page.d.ts +86 -0
- package/hooks/use-conversation-history-page.d.ts.map +1 -0
- package/hooks/use-conversation-history-page.js +97 -0
- package/hooks/use-conversation-history-page.js.map +1 -0
- package/hooks/use-conversation-lifecycle.d.ts +80 -0
- package/hooks/use-conversation-lifecycle.d.ts.map +1 -0
- package/hooks/use-conversation-lifecycle.js +54 -0
- package/hooks/use-conversation-lifecycle.js.map +1 -0
- package/hooks/use-conversation-page.d.ts +82 -0
- package/hooks/use-conversation-page.d.ts.map +1 -0
- package/hooks/use-conversation-page.js +138 -0
- package/hooks/use-conversation-page.js.map +1 -0
- package/hooks/use-conversation-seen.d.ts +17 -0
- package/hooks/use-conversation-seen.d.ts.map +1 -0
- package/hooks/use-conversation-seen.js +58 -0
- package/hooks/use-conversation-seen.js.map +1 -0
- package/hooks/use-conversation-timeline-items.d.ts +21 -0
- package/hooks/use-conversation-timeline-items.d.ts.map +1 -0
- package/hooks/use-conversation-timeline-items.js +87 -0
- package/hooks/use-conversation-timeline-items.js.map +1 -0
- package/hooks/use-conversation-typing.d.ts +13 -0
- package/hooks/use-conversation-typing.d.ts.map +1 -0
- package/hooks/use-conversation-typing.js +34 -0
- package/hooks/use-conversation-typing.js.map +1 -0
- package/hooks/use-conversation.d.ts +18 -0
- package/hooks/use-conversation.d.ts.map +1 -0
- package/hooks/use-conversation.js +44 -0
- package/hooks/use-conversation.js.map +1 -0
- package/hooks/use-conversations.d.ts +20 -0
- package/hooks/use-conversations.d.ts.map +1 -0
- package/hooks/use-conversations.js +68 -0
- package/hooks/use-conversations.js.map +1 -0
- package/hooks/use-create-conversation.d.ts +30 -0
- package/hooks/use-create-conversation.d.ts.map +1 -0
- package/hooks/use-create-conversation.js +67 -0
- package/hooks/use-create-conversation.js.map +1 -0
- package/hooks/use-home-page.d.ts +82 -0
- package/hooks/use-home-page.d.ts.map +1 -0
- package/hooks/use-home-page.js +89 -0
- package/hooks/use-home-page.js.map +1 -0
- package/hooks/use-message-composer.d.ts +88 -0
- package/hooks/use-message-composer.d.ts.map +1 -0
- package/hooks/use-message-composer.js +94 -0
- package/hooks/use-message-composer.js.map +1 -0
- package/hooks/use-realtime-support.d.ts +25 -0
- package/hooks/use-realtime-support.d.ts.map +1 -0
- package/hooks/use-realtime-support.js +29 -0
- package/hooks/use-realtime-support.js.map +1 -0
- package/hooks/use-send-message.d.ts +34 -0
- package/hooks/use-send-message.d.ts.map +1 -0
- package/hooks/use-send-message.js +118 -0
- package/hooks/use-send-message.js.map +1 -0
- package/hooks/use-visitor.d.ts +28 -0
- package/hooks/use-visitor.d.ts.map +1 -0
- package/hooks/use-visitor.js +59 -0
- package/hooks/use-visitor.js.map +1 -0
- package/hooks/use-window-visibility-focus.d.ts +9 -0
- package/hooks/use-window-visibility-focus.d.ts.map +1 -0
- package/hooks/use-window-visibility-focus.js +53 -0
- package/hooks/use-window-visibility-focus.js.map +1 -0
- package/identify-visitor.d.ts +18 -0
- package/identify-visitor.d.ts.map +1 -0
- package/identify-visitor.js +26 -0
- package/identify-visitor.js.map +1 -0
- package/index.d.ts +38 -0
- package/index.js +38 -0
- package/package.json +121 -0
- package/primitives/avatar/avatar.d.ts +31 -0
- package/primitives/avatar/avatar.d.ts.map +1 -0
- package/primitives/avatar/avatar.js +49 -0
- package/primitives/avatar/avatar.js.map +1 -0
- package/primitives/avatar/fallback.d.ts +24 -0
- package/primitives/avatar/fallback.d.ts.map +1 -0
- package/primitives/avatar/fallback.js +57 -0
- package/primitives/avatar/fallback.js.map +1 -0
- package/primitives/avatar/image.d.ts +27 -0
- package/primitives/avatar/image.d.ts.map +1 -0
- package/primitives/avatar/image.js +58 -0
- package/primitives/avatar/image.js.map +1 -0
- package/primitives/avatar/index.d.ts +4 -0
- package/primitives/avatar/index.js +5 -0
- package/primitives/avatar/index.parts.d.ts +4 -0
- package/primitives/avatar/index.parts.js +5 -0
- package/primitives/bubble.d.ts +28 -0
- package/primitives/bubble.d.ts.map +1 -0
- package/primitives/bubble.js +43 -0
- package/primitives/bubble.js.map +1 -0
- package/primitives/button.d.ts +19 -0
- package/primitives/button.d.ts.map +1 -0
- package/primitives/button.js +27 -0
- package/primitives/button.js.map +1 -0
- package/primitives/conversation-timeline.d.ts +86 -0
- package/primitives/conversation-timeline.d.ts.map +1 -0
- package/primitives/conversation-timeline.js +119 -0
- package/primitives/conversation-timeline.js.map +1 -0
- package/primitives/index.d.ts +20 -0
- package/primitives/index.d.ts.map +1 -0
- package/primitives/index.js +45 -0
- package/primitives/index.js.map +1 -0
- package/primitives/index.parts.d.ts +13 -0
- package/primitives/index.parts.js +14 -0
- package/primitives/multimodal-input.d.ts +53 -0
- package/primitives/multimodal-input.d.ts.map +1 -0
- package/primitives/multimodal-input.js +106 -0
- package/primitives/multimodal-input.js.map +1 -0
- package/primitives/timeline-item-group.d.ts +166 -0
- package/primitives/timeline-item-group.d.ts.map +1 -0
- package/primitives/timeline-item-group.js +204 -0
- package/primitives/timeline-item-group.js.map +1 -0
- package/primitives/timeline-item.d.ts +75 -0
- package/primitives/timeline-item.d.ts.map +1 -0
- package/primitives/timeline-item.js +145 -0
- package/primitives/timeline-item.js.map +1 -0
- package/primitives/window.d.ts +31 -0
- package/primitives/window.d.ts.map +1 -0
- package/primitives/window.js +58 -0
- package/primitives/window.js.map +1 -0
- package/provider.d.ts +95 -0
- package/provider.d.ts.map +1 -0
- package/provider.js +124 -0
- package/provider.js.map +1 -0
- package/realtime/event-filter.d.ts +8 -0
- package/realtime/event-filter.d.ts.map +1 -0
- package/realtime/event-filter.js +21 -0
- package/realtime/event-filter.js.map +1 -0
- package/realtime/index.d.ts +6 -0
- package/realtime/index.js +7 -0
- package/realtime/provider.d.ts +57 -0
- package/realtime/provider.d.ts.map +1 -0
- package/realtime/provider.js +351 -0
- package/realtime/provider.js.map +1 -0
- package/realtime/seen-store.d.ts +23 -0
- package/realtime/seen-store.d.ts.map +1 -0
- package/realtime/seen-store.js +34 -0
- package/realtime/seen-store.js.map +1 -0
- package/realtime/support-provider.d.ts +17 -0
- package/realtime/support-provider.d.ts.map +1 -0
- package/realtime/support-provider.js +54 -0
- package/realtime/support-provider.js.map +1 -0
- package/realtime/typing-store.d.ts +30 -0
- package/realtime/typing-store.d.ts.map +1 -0
- package/realtime/typing-store.js +34 -0
- package/realtime/typing-store.js.map +1 -0
- package/realtime/use-realtime.d.ts +29 -0
- package/realtime/use-realtime.d.ts.map +1 -0
- package/realtime/use-realtime.js +47 -0
- package/realtime/use-realtime.js.map +1 -0
- package/realtime-events.d.ts +344 -0
- package/realtime-events.d.ts.map +1 -0
- package/schemas.d.ts +90 -0
- package/schemas.d.ts.map +1 -0
- package/support/components/avatar-stack.d.ts +45 -0
- package/support/components/avatar-stack.d.ts.map +1 -0
- package/support/components/avatar-stack.js +72 -0
- package/support/components/avatar-stack.js.map +1 -0
- package/support/components/avatar.d.ts +15 -0
- package/support/components/avatar.d.ts.map +1 -0
- package/support/components/avatar.js +23 -0
- package/support/components/avatar.js.map +1 -0
- package/support/components/bubble.d.ts +10 -0
- package/support/components/bubble.d.ts.map +1 -0
- package/support/components/bubble.js +95 -0
- package/support/components/bubble.js.map +1 -0
- package/support/components/button.d.ts +20 -0
- package/support/components/button.d.ts.map +1 -0
- package/support/components/button.js +41 -0
- package/support/components/button.js.map +1 -0
- package/support/components/container.d.ts +14 -0
- package/support/components/container.d.ts.map +1 -0
- package/support/components/container.js +115 -0
- package/support/components/container.js.map +1 -0
- package/support/components/conversation-button-link.d.ts +34 -0
- package/support/components/conversation-button-link.d.ts.map +1 -0
- package/support/components/conversation-button-link.js +195 -0
- package/support/components/conversation-button-link.js.map +1 -0
- package/support/components/conversation-event.d.ts +14 -0
- package/support/components/conversation-event.d.ts.map +1 -0
- package/support/components/conversation-event.js +76 -0
- package/support/components/conversation-event.js.map +1 -0
- package/support/components/conversation-timeline.d.ts +17 -0
- package/support/components/conversation-timeline.d.ts.map +1 -0
- package/support/components/conversation-timeline.js +95 -0
- package/support/components/conversation-timeline.js.map +1 -0
- package/support/components/cossistant-branding.d.ts +12 -0
- package/support/components/cossistant-branding.d.ts.map +1 -0
- package/support/components/cossistant-branding.js +22 -0
- package/support/components/cossistant-branding.js.map +1 -0
- package/support/components/header.d.ts +11 -0
- package/support/components/header.d.ts.map +1 -0
- package/support/components/header.js +43 -0
- package/support/components/header.js.map +1 -0
- package/support/components/icons.d.ts +21 -0
- package/support/components/icons.d.ts.map +1 -0
- package/support/components/icons.js +131 -0
- package/support/components/icons.js.map +1 -0
- package/support/components/index.d.ts +11 -0
- package/support/components/index.js +12 -0
- package/support/components/multimodal-input.d.ts +28 -0
- package/support/components/multimodal-input.d.ts.map +1 -0
- package/support/components/multimodal-input.js +138 -0
- package/support/components/multimodal-input.js.map +1 -0
- package/support/components/navigation-tab.d.ts +7 -0
- package/support/components/navigation-tab.d.ts.map +1 -0
- package/support/components/navigation-tab.js +40 -0
- package/support/components/navigation-tab.js.map +1 -0
- package/support/components/support-content.d.ts +22 -0
- package/support/components/support-content.d.ts.map +1 -0
- package/support/components/support-content.js +50 -0
- package/support/components/support-content.js.map +1 -0
- package/support/components/text-effect.d.ts +49 -0
- package/support/components/text-effect.d.ts.map +1 -0
- package/support/components/text-effect.js +221 -0
- package/support/components/text-effect.js.map +1 -0
- package/support/components/timeline-message-group.d.ts +16 -0
- package/support/components/timeline-message-group.d.ts.map +1 -0
- package/support/components/timeline-message-group.js +117 -0
- package/support/components/timeline-message-group.js.map +1 -0
- package/support/components/timeline-message-item.d.ts +17 -0
- package/support/components/timeline-message-item.d.ts.map +1 -0
- package/support/components/timeline-message-item.js +42 -0
- package/support/components/timeline-message-item.js.map +1 -0
- package/support/components/typing-indicator.d.ts +26 -0
- package/support/components/typing-indicator.d.ts.map +1 -0
- package/support/components/typing-indicator.js +37 -0
- package/support/components/typing-indicator.js.map +1 -0
- package/support/components/watermark.d.ts +8 -0
- package/support/components/watermark.d.ts.map +1 -0
- package/support/components/watermark.js +34 -0
- package/support/components/watermark.js.map +1 -0
- package/support/context/config.d.ts +32 -0
- package/support/context/config.d.ts.map +1 -0
- package/support/context/config.js +27 -0
- package/support/context/config.js.map +1 -0
- package/support/context/websocket.d.ts +22 -0
- package/support/context/websocket.d.ts.map +1 -0
- package/support/context/websocket.js +113 -0
- package/support/context/websocket.js.map +1 -0
- package/support/index.d.ts +39 -0
- package/support/index.d.ts.map +1 -0
- package/support/index.js +43 -0
- package/support/index.js.map +1 -0
- package/support/pages/articles.d.ts +7 -0
- package/support/pages/articles.d.ts.map +1 -0
- package/support/pages/articles.js +39 -0
- package/support/pages/articles.js.map +1 -0
- package/support/pages/conversation-history.d.ts +18 -0
- package/support/pages/conversation-history.d.ts.map +1 -0
- package/support/pages/conversation-history.js +120 -0
- package/support/pages/conversation-history.js.map +1 -0
- package/support/pages/conversation.d.ts +32 -0
- package/support/pages/conversation.d.ts.map +1 -0
- package/support/pages/conversation.js +92 -0
- package/support/pages/conversation.js.map +1 -0
- package/support/pages/home.d.ts +20 -0
- package/support/pages/home.d.ts.map +1 -0
- package/support/pages/home.js +184 -0
- package/support/pages/home.js.map +1 -0
- package/support/router.d.ts +14 -0
- package/support/router.d.ts.map +1 -0
- package/support/router.js +31 -0
- package/support/router.js.map +1 -0
- package/support/store/index.d.ts +2 -0
- package/support/store/index.js +3 -0
- package/support/store/support-store.d.ts +42 -0
- package/support/store/support-store.d.ts.map +1 -0
- package/support/store/support-store.js +66 -0
- package/support/store/support-store.js.map +1 -0
- package/support/support-CMoDLQoC.css +408 -0
- package/support/support-CMoDLQoC.css.map +1 -0
- package/support/support.js +1 -0
- package/support/text/index.d.ts +35 -0
- package/support/text/index.d.ts.map +1 -0
- package/support/text/index.js +71 -0
- package/support/text/index.js.map +1 -0
- package/support/text/locales/en.d.ts +7 -0
- package/support/text/locales/en.d.ts.map +1 -0
- package/support/text/locales/en.js +65 -0
- package/support/text/locales/en.js.map +1 -0
- package/support/text/locales/es.d.ts +7 -0
- package/support/text/locales/es.d.ts.map +1 -0
- package/support/text/locales/es.js +64 -0
- package/support/text/locales/es.js.map +1 -0
- package/support/text/locales/fr.d.ts +7 -0
- package/support/text/locales/fr.d.ts.map +1 -0
- package/support/text/locales/fr.js +64 -0
- package/support/text/locales/fr.js.map +1 -0
- package/support/text/locales/keys.d.ts +216 -0
- package/support/text/locales/keys.d.ts.map +1 -0
- package/support/text/locales/keys.js +54 -0
- package/support/text/locales/keys.js.map +1 -0
- package/support/text/runtime.d.ts +17 -0
- package/support/text/runtime.d.ts.map +1 -0
- package/support/text/runtime.js +156 -0
- package/support/text/runtime.js.map +1 -0
- package/support/utils/index.d.ts +7 -0
- package/support/utils/index.d.ts.map +1 -0
- package/support/utils/index.js +11 -0
- package/support/utils/index.js.map +1 -0
- package/support/utils/time.d.ts +5 -0
- package/support/utils/time.d.ts.map +1 -0
- package/support/utils/time.js +28 -0
- package/support/utils/time.js.map +1 -0
- package/support-config.d.ts +20 -0
- package/support-config.d.ts.map +1 -0
- package/support-config.js +25 -0
- package/support-config.js.map +1 -0
- package/support.css +2 -0
- package/timeline-item.d.ts +133 -0
- package/timeline-item.d.ts.map +1 -0
- package/utils/id.d.ts +6 -0
- package/utils/id.d.ts.map +1 -0
- package/utils/id.js +13 -0
- package/utils/id.js.map +1 -0
- package/utils/index.d.ts +3 -0
- package/utils/index.js +4 -0
- package/utils/text.d.ts +5 -0
- package/utils/text.d.ts.map +1 -0
- package/utils/text.js +9 -0
- package/utils/text.js.map +1 -0
- package/utils/use-render-element.d.ts +22 -0
- package/utils/use-render-element.d.ts.map +1 -0
- package/utils/use-render-element.js +35 -0
- package/utils/use-render-element.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es.d.ts","names":[],"sources":["../../../../src/support/text/locales/es.tsx"],"sourcesContent":[],"mappings":";;;cAEM,IAAI"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//#region src/support/text/locales/es.tsx
|
|
2
|
+
const es = {
|
|
3
|
+
"common.actions.askQuestion": "Haznos una pregunta",
|
|
4
|
+
"common.actions.attachFiles": "Adjuntar archivos",
|
|
5
|
+
"common.actions.removeFile": ({ variables }) => `Eliminar ${variables.fileName}`,
|
|
6
|
+
"common.brand.watermark": "Impulsado por",
|
|
7
|
+
"common.fallbacks.aiAssistant": "Asistente de IA",
|
|
8
|
+
"common.fallbacks.cossistant": "Cossistant",
|
|
9
|
+
"common.fallbacks.someone": "Alguien",
|
|
10
|
+
"common.fallbacks.supportTeam": "Soporte",
|
|
11
|
+
"common.fallbacks.unknown": "Desconocido",
|
|
12
|
+
"common.fallbacks.you": "Tú",
|
|
13
|
+
"common.labels.aiAgentIndicator": "Agente IA",
|
|
14
|
+
"common.labels.supportOnline": "Soporte en línea",
|
|
15
|
+
"page.conversationHistory.showMore": ({ variables, utils }) => `+${utils.formatNumber(variables.count)} más`,
|
|
16
|
+
"page.conversationHistory.title": "Historial de conversaciones",
|
|
17
|
+
"page.home.greeting": ({ variables, context, utils }) => {
|
|
18
|
+
const prefix = {
|
|
19
|
+
morning: "Buenos días",
|
|
20
|
+
afternoon: "Buenas tardes",
|
|
21
|
+
evening: "Buenas noches"
|
|
22
|
+
}[utils.timeOfDay().token];
|
|
23
|
+
const visitorName = variables?.visitorName || context.visitor?.contact?.name;
|
|
24
|
+
return `${prefix}${visitorName ? ` ${visitorName}` : ""}, ¿en qué podemos ayudarte?`;
|
|
25
|
+
},
|
|
26
|
+
"page.home.history.more": ({ variables, utils }) => {
|
|
27
|
+
const count = variables.count;
|
|
28
|
+
const noun = utils.pluralize(count, {
|
|
29
|
+
one: "conversación más",
|
|
30
|
+
other: "conversaciones más"
|
|
31
|
+
});
|
|
32
|
+
return `+ ${utils.formatNumber(count)} ${noun}`;
|
|
33
|
+
},
|
|
34
|
+
"page.home.tagline": ({ variables, context, utils }) => {
|
|
35
|
+
const websiteName = variables?.websiteName || context.website?.name || "";
|
|
36
|
+
return websiteName ? `Soporte ${utils.titleCase(websiteName)}` : "Soporte";
|
|
37
|
+
},
|
|
38
|
+
"component.conversationButtonLink.fallbackTitle": "Conversación sin título",
|
|
39
|
+
"component.conversationButtonLink.lastMessage.agent": ({ variables }) => `${variables.name} - ${variables.time}`,
|
|
40
|
+
"component.conversationButtonLink.lastMessage.visitor": ({ variables }) => `Tú - ${variables.time}`,
|
|
41
|
+
"component.conversationButtonLink.typing": ({ variables }) => `${variables.name} está escribiendo...`,
|
|
42
|
+
"component.conversationEvent.assigned": ({ variables }) => `${variables.actorName} asignó la conversación`,
|
|
43
|
+
"component.conversationEvent.unassigned": ({ variables }) => `${variables.actorName} retiró la asignación de la conversación`,
|
|
44
|
+
"component.conversationEvent.default": ({ variables }) => `${variables.actorName} realizó una acción`,
|
|
45
|
+
"component.conversationEvent.participantJoined": ({ variables }) => `${variables.actorName} se unió a la conversación`,
|
|
46
|
+
"component.conversationEvent.participantLeft": ({ variables }) => `${variables.actorName} salió de la conversación`,
|
|
47
|
+
"component.conversationEvent.participantRequested": ({ variables }) => `${variables.actorName} solicitó unirse`,
|
|
48
|
+
"component.conversationEvent.priorityChanged": ({ variables }) => `${variables.actorName} cambió la prioridad`,
|
|
49
|
+
"component.conversationEvent.reopened": ({ variables }) => `${variables.actorName} reabrió la conversación`,
|
|
50
|
+
"component.conversationEvent.resolved": ({ variables }) => `${variables.actorName} resolvió la conversación`,
|
|
51
|
+
"component.conversationEvent.statusChanged": ({ variables }) => `${variables.actorName} cambió el estado`,
|
|
52
|
+
"component.conversationEvent.tagAdded": ({ variables }) => `${variables.actorName} agregó una etiqueta`,
|
|
53
|
+
"component.conversationEvent.tagRemoved": ({ variables }) => `${variables.actorName} quitó una etiqueta`,
|
|
54
|
+
"component.multimodalInput.placeholder": "Escribe tu mensaje...",
|
|
55
|
+
"component.multimodalInput.remove": ({ variables }) => `Eliminar ${variables.fileName}`,
|
|
56
|
+
"component.navigation.articles": "Artículos",
|
|
57
|
+
"component.navigation.home": "Inicio",
|
|
58
|
+
"component.message.timestamp.aiIndicator": "• Agente IA"
|
|
59
|
+
};
|
|
60
|
+
var es_default = es;
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { es_default as default };
|
|
64
|
+
//# sourceMappingURL=es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es.js","names":["es: SupportLocaleMessages"],"sources":["../../../../src/support/text/locales/es.tsx"],"sourcesContent":["import type { SupportLocaleMessages } from \"./keys\";\n\nconst es: SupportLocaleMessages = {\n\t\"common.actions.askQuestion\": \"Haznos una pregunta\",\n\t\"common.actions.attachFiles\": \"Adjuntar archivos\",\n\t\"common.actions.removeFile\": ({ variables }) =>\n\t\t`Eliminar ${variables.fileName}`,\n\t\"common.brand.watermark\": \"Impulsado por\",\n\t\"common.fallbacks.aiAssistant\": \"Asistente de IA\",\n\t\"common.fallbacks.cossistant\": \"Cossistant\",\n\t\"common.fallbacks.someone\": \"Alguien\",\n\t\"common.fallbacks.supportTeam\": \"Soporte\",\n\t\"common.fallbacks.unknown\": \"Desconocido\",\n\t\"common.fallbacks.you\": \"Tú\",\n\t\"common.labels.aiAgentIndicator\": \"Agente IA\",\n\t\"common.labels.supportOnline\": \"Soporte en línea\",\n\t\"page.conversationHistory.showMore\": ({ variables, utils }) =>\n\t\t`+${utils.formatNumber(variables.count)} más`,\n\t\"page.conversationHistory.title\": \"Historial de conversaciones\",\n\t\"page.home.greeting\": ({ variables, context, utils }) => {\n\t\tconst period = utils.timeOfDay();\n\t\tconst prefixes: Record<typeof period.token, string> = {\n\t\t\tmorning: \"Buenos días\",\n\t\t\tafternoon: \"Buenas tardes\",\n\t\t\tevening: \"Buenas noches\",\n\t\t};\n\t\tconst prefix = prefixes[period.token];\n\t\tconst visitorName =\n\t\t\tvariables?.visitorName || context.visitor?.contact?.name;\n\t\treturn `${prefix}${visitorName ? ` ${visitorName}` : \"\"}, ¿en qué podemos ayudarte?`;\n\t},\n\t\"page.home.history.more\": ({ variables, utils }) => {\n\t\tconst count = variables.count;\n\t\tconst noun = utils.pluralize(count, {\n\t\t\tone: \"conversación más\",\n\t\t\tother: \"conversaciones más\",\n\t\t});\n\t\treturn `+ ${utils.formatNumber(count)} ${noun}`;\n\t},\n\t\"page.home.tagline\": ({ variables, context, utils }) => {\n\t\tconst websiteName = variables?.websiteName || context.website?.name || \"\";\n\t\treturn websiteName ? `Soporte ${utils.titleCase(websiteName)}` : \"Soporte\";\n\t},\n\t\"component.conversationButtonLink.fallbackTitle\": \"Conversación sin título\",\n\t\"component.conversationButtonLink.lastMessage.agent\": ({ variables }) =>\n\t\t`${variables.name} - ${variables.time}`,\n\t\"component.conversationButtonLink.lastMessage.visitor\": ({ variables }) =>\n\t\t`Tú - ${variables.time}`,\n\t\"component.conversationButtonLink.typing\": ({ variables }) =>\n\t\t`${variables.name} está escribiendo...`,\n\t\"component.conversationEvent.assigned\": ({ variables }) =>\n\t\t`${variables.actorName} asignó la conversación`,\n\t\"component.conversationEvent.unassigned\": ({ variables }) =>\n\t\t`${variables.actorName} retiró la asignación de la conversación`,\n\t\"component.conversationEvent.default\": ({ variables }) =>\n\t\t`${variables.actorName} realizó una acción`,\n\t\"component.conversationEvent.participantJoined\": ({ variables }) =>\n\t\t`${variables.actorName} se unió a la conversación`,\n\t\"component.conversationEvent.participantLeft\": ({ variables }) =>\n\t\t`${variables.actorName} salió de la conversación`,\n\t\"component.conversationEvent.participantRequested\": ({ variables }) =>\n\t\t`${variables.actorName} solicitó unirse`,\n\t\"component.conversationEvent.priorityChanged\": ({ variables }) =>\n\t\t`${variables.actorName} cambió la prioridad`,\n\t\"component.conversationEvent.reopened\": ({ variables }) =>\n\t\t`${variables.actorName} reabrió la conversación`,\n\t\"component.conversationEvent.resolved\": ({ variables }) =>\n\t\t`${variables.actorName} resolvió la conversación`,\n\t\"component.conversationEvent.statusChanged\": ({ variables }) =>\n\t\t`${variables.actorName} cambió el estado`,\n\t\"component.conversationEvent.tagAdded\": ({ variables }) =>\n\t\t`${variables.actorName} agregó una etiqueta`,\n\t\"component.conversationEvent.tagRemoved\": ({ variables }) =>\n\t\t`${variables.actorName} quitó una etiqueta`,\n\t\"component.multimodalInput.placeholder\": \"Escribe tu mensaje...\",\n\t\"component.multimodalInput.remove\": ({ variables }) =>\n\t\t`Eliminar ${variables.fileName}`,\n\t\"component.navigation.articles\": \"Artículos\",\n\t\"component.navigation.home\": \"Inicio\",\n\t\"component.message.timestamp.aiIndicator\": \"• Agente IA\",\n};\n\nexport default es;\n"],"mappings":";AAEA,MAAMA,KAA4B;CACjC,8BAA8B;CAC9B,8BAA8B;CAC9B,8BAA8B,EAAE,gBAC/B,YAAY,UAAU;CACvB,0BAA0B;CAC1B,gCAAgC;CAChC,+BAA+B;CAC/B,4BAA4B;CAC5B,gCAAgC;CAChC,4BAA4B;CAC5B,wBAAwB;CACxB,kCAAkC;CAClC,+BAA+B;CAC/B,sCAAsC,EAAE,WAAW,YAClD,IAAI,MAAM,aAAa,UAAU,MAAM,CAAC;CACzC,kCAAkC;CAClC,uBAAuB,EAAE,WAAW,SAAS,YAAY;EAOxD,MAAM,SALgD;GACrD,SAAS;GACT,WAAW;GACX,SAAS;GACT,CALc,MAAM,WAAW,CAMD;EAC/B,MAAM,cACL,WAAW,eAAe,QAAQ,SAAS,SAAS;AACrD,SAAO,GAAG,SAAS,cAAc,IAAI,gBAAgB,GAAG;;CAEzD,2BAA2B,EAAE,WAAW,YAAY;EACnD,MAAM,QAAQ,UAAU;EACxB,MAAM,OAAO,MAAM,UAAU,OAAO;GACnC,KAAK;GACL,OAAO;GACP,CAAC;AACF,SAAO,KAAK,MAAM,aAAa,MAAM,CAAC,GAAG;;CAE1C,sBAAsB,EAAE,WAAW,SAAS,YAAY;EACvD,MAAM,cAAc,WAAW,eAAe,QAAQ,SAAS,QAAQ;AACvE,SAAO,cAAc,WAAW,MAAM,UAAU,YAAY,KAAK;;CAElE,kDAAkD;CAClD,uDAAuD,EAAE,gBACxD,GAAG,UAAU,KAAK,KAAK,UAAU;CAClC,yDAAyD,EAAE,gBAC1D,QAAQ,UAAU;CACnB,4CAA4C,EAAE,gBAC7C,GAAG,UAAU,KAAK;CACnB,yCAAyC,EAAE,gBAC1C,GAAG,UAAU,UAAU;CACxB,2CAA2C,EAAE,gBAC5C,GAAG,UAAU,UAAU;CACxB,wCAAwC,EAAE,gBACzC,GAAG,UAAU,UAAU;CACxB,kDAAkD,EAAE,gBACnD,GAAG,UAAU,UAAU;CACxB,gDAAgD,EAAE,gBACjD,GAAG,UAAU,UAAU;CACxB,qDAAqD,EAAE,gBACtD,GAAG,UAAU,UAAU;CACxB,gDAAgD,EAAE,gBACjD,GAAG,UAAU,UAAU;CACxB,yCAAyC,EAAE,gBAC1C,GAAG,UAAU,UAAU;CACxB,yCAAyC,EAAE,gBAC1C,GAAG,UAAU,UAAU;CACxB,8CAA8C,EAAE,gBAC/C,GAAG,UAAU,UAAU;CACxB,yCAAyC,EAAE,gBAC1C,GAAG,UAAU,UAAU;CACxB,2CAA2C,EAAE,gBAC5C,GAAG,UAAU,UAAU;CACxB,yCAAyC;CACzC,qCAAqC,EAAE,gBACtC,YAAY,UAAU;CACvB,iCAAiC;CACjC,6BAA6B;CAC7B,2CAA2C;CAC3C;AAED,iBAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr.d.ts","names":[],"sources":["../../../../src/support/text/locales/fr.tsx"],"sourcesContent":[],"mappings":";;;cAEM,IAAI"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//#region src/support/text/locales/fr.tsx
|
|
2
|
+
const fr = {
|
|
3
|
+
"common.actions.askQuestion": "Posez-nous une question",
|
|
4
|
+
"common.actions.attachFiles": "Joindre des fichiers",
|
|
5
|
+
"common.actions.removeFile": ({ variables }) => `Supprimer ${variables.fileName}`,
|
|
6
|
+
"common.brand.watermark": "Propulsé par",
|
|
7
|
+
"common.fallbacks.aiAssistant": "Assistant IA",
|
|
8
|
+
"common.fallbacks.cossistant": "Cossistant",
|
|
9
|
+
"common.fallbacks.someone": "Quelqu'un",
|
|
10
|
+
"common.fallbacks.supportTeam": "Support",
|
|
11
|
+
"common.fallbacks.unknown": "Inconnu",
|
|
12
|
+
"common.fallbacks.you": "Vous",
|
|
13
|
+
"common.labels.aiAgentIndicator": "Agent IA",
|
|
14
|
+
"common.labels.supportOnline": "Support en ligne",
|
|
15
|
+
"page.conversationHistory.showMore": ({ variables, utils }) => `+${utils.formatNumber(variables.count)} de plus`,
|
|
16
|
+
"page.conversationHistory.title": "Historique des conversations",
|
|
17
|
+
"page.home.greeting": ({ variables, context, utils }) => {
|
|
18
|
+
const prefix = {
|
|
19
|
+
morning: "Bonjour",
|
|
20
|
+
afternoon: "Bon après-midi",
|
|
21
|
+
evening: "Bonsoir"
|
|
22
|
+
}[utils.timeOfDay().token];
|
|
23
|
+
const visitorName = variables?.visitorName || context.visitor?.contact?.name;
|
|
24
|
+
return `${prefix}${visitorName ? ` ${visitorName}` : ""}, comment pouvons-nous vous aider ?`;
|
|
25
|
+
},
|
|
26
|
+
"page.home.history.more": ({ variables, utils }) => {
|
|
27
|
+
const count = variables.count;
|
|
28
|
+
const noun = utils.pluralize(count, {
|
|
29
|
+
one: "conversation supplémentaire",
|
|
30
|
+
other: "conversations supplémentaires"
|
|
31
|
+
});
|
|
32
|
+
return `+ ${utils.formatNumber(count)} ${noun}`;
|
|
33
|
+
},
|
|
34
|
+
"page.home.tagline": ({ variables, context, utils }) => {
|
|
35
|
+
const websiteName = variables?.websiteName || context.website?.name || "";
|
|
36
|
+
return websiteName ? `Support ${utils.titleCase(websiteName)}` : "Support";
|
|
37
|
+
},
|
|
38
|
+
"component.conversationButtonLink.fallbackTitle": "Conversation sans titre",
|
|
39
|
+
"component.conversationButtonLink.lastMessage.agent": ({ variables }) => `${variables.name} - ${variables.time}`,
|
|
40
|
+
"component.conversationButtonLink.lastMessage.visitor": ({ variables }) => `Vous - ${variables.time}`,
|
|
41
|
+
"component.conversationButtonLink.typing": ({ variables }) => `${variables.name} est en train d'écrire...`,
|
|
42
|
+
"component.conversationEvent.assigned": ({ variables }) => `${variables.actorName} a attribué la conversation`,
|
|
43
|
+
"component.conversationEvent.unassigned": ({ variables }) => `${variables.actorName} a retiré l'attribution de la conversation`,
|
|
44
|
+
"component.conversationEvent.default": ({ variables }) => `${variables.actorName} a effectué une action`,
|
|
45
|
+
"component.conversationEvent.participantJoined": ({ variables }) => `${variables.actorName} a rejoint la conversation`,
|
|
46
|
+
"component.conversationEvent.participantLeft": ({ variables }) => `${variables.actorName} a quitté la conversation`,
|
|
47
|
+
"component.conversationEvent.participantRequested": ({ variables }) => `${variables.actorName} a demandé à rejoindre`,
|
|
48
|
+
"component.conversationEvent.priorityChanged": ({ variables }) => `${variables.actorName} a modifié la priorité`,
|
|
49
|
+
"component.conversationEvent.reopened": ({ variables }) => `${variables.actorName} a rouvert la conversation`,
|
|
50
|
+
"component.conversationEvent.resolved": ({ variables }) => `${variables.actorName} a résolu la conversation`,
|
|
51
|
+
"component.conversationEvent.statusChanged": ({ variables }) => `${variables.actorName} a modifié le statut`,
|
|
52
|
+
"component.conversationEvent.tagAdded": ({ variables }) => `${variables.actorName} a ajouté une étiquette`,
|
|
53
|
+
"component.conversationEvent.tagRemoved": ({ variables }) => `${variables.actorName} a retiré une étiquette`,
|
|
54
|
+
"component.multimodalInput.placeholder": "Écrivez votre message...",
|
|
55
|
+
"component.multimodalInput.remove": ({ variables }) => `Supprimer ${variables.fileName}`,
|
|
56
|
+
"component.navigation.articles": "Articles",
|
|
57
|
+
"component.navigation.home": "Accueil",
|
|
58
|
+
"component.message.timestamp.aiIndicator": "• Agent IA"
|
|
59
|
+
};
|
|
60
|
+
var fr_default = fr;
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { fr_default as default };
|
|
64
|
+
//# sourceMappingURL=fr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr.js","names":["fr: SupportLocaleMessages"],"sources":["../../../../src/support/text/locales/fr.tsx"],"sourcesContent":["import type { SupportLocaleMessages } from \"./keys\";\n\nconst fr: SupportLocaleMessages = {\n\t\"common.actions.askQuestion\": \"Posez-nous une question\",\n\t\"common.actions.attachFiles\": \"Joindre des fichiers\",\n\t\"common.actions.removeFile\": ({ variables }) =>\n\t\t`Supprimer ${variables.fileName}`,\n\t\"common.brand.watermark\": \"Propulsé par\",\n\t\"common.fallbacks.aiAssistant\": \"Assistant IA\",\n\t\"common.fallbacks.cossistant\": \"Cossistant\",\n\t\"common.fallbacks.someone\": \"Quelqu'un\",\n\t\"common.fallbacks.supportTeam\": \"Support\",\n\t\"common.fallbacks.unknown\": \"Inconnu\",\n\t\"common.fallbacks.you\": \"Vous\",\n\t\"common.labels.aiAgentIndicator\": \"Agent IA\",\n\t\"common.labels.supportOnline\": \"Support en ligne\",\n\t\"page.conversationHistory.showMore\": ({ variables, utils }) =>\n\t\t`+${utils.formatNumber(variables.count)} de plus`,\n\t\"page.conversationHistory.title\": \"Historique des conversations\",\n\t\"page.home.greeting\": ({ variables, context, utils }) => {\n\t\tconst period = utils.timeOfDay();\n\t\tconst prefixes: Record<typeof period.token, string> = {\n\t\t\tmorning: \"Bonjour\",\n\t\t\tafternoon: \"Bon après-midi\",\n\t\t\tevening: \"Bonsoir\",\n\t\t};\n\t\tconst prefix = prefixes[period.token];\n\t\tconst visitorName =\n\t\t\tvariables?.visitorName || context.visitor?.contact?.name;\n\t\treturn `${prefix}${visitorName ? ` ${visitorName}` : \"\"}, comment pouvons-nous vous aider ?`;\n\t},\n\t\"page.home.history.more\": ({ variables, utils }) => {\n\t\tconst count = variables.count;\n\t\tconst noun = utils.pluralize(count, {\n\t\t\tone: \"conversation supplémentaire\",\n\t\t\tother: \"conversations supplémentaires\",\n\t\t});\n\t\treturn `+ ${utils.formatNumber(count)} ${noun}`;\n\t},\n\t\"page.home.tagline\": ({ variables, context, utils }) => {\n\t\tconst websiteName = variables?.websiteName || context.website?.name || \"\";\n\t\treturn websiteName ? `Support ${utils.titleCase(websiteName)}` : \"Support\";\n\t},\n\t\"component.conversationButtonLink.fallbackTitle\": \"Conversation sans titre\",\n\t\"component.conversationButtonLink.lastMessage.agent\": ({ variables }) =>\n\t\t`${variables.name} - ${variables.time}`,\n\t\"component.conversationButtonLink.lastMessage.visitor\": ({ variables }) =>\n\t\t`Vous - ${variables.time}`,\n\t\"component.conversationButtonLink.typing\": ({ variables }) =>\n\t\t`${variables.name} est en train d'écrire...`,\n\t\"component.conversationEvent.assigned\": ({ variables }) =>\n\t\t`${variables.actorName} a attribué la conversation`,\n\t\"component.conversationEvent.unassigned\": ({ variables }) =>\n\t\t`${variables.actorName} a retiré l'attribution de la conversation`,\n\t\"component.conversationEvent.default\": ({ variables }) =>\n\t\t`${variables.actorName} a effectué une action`,\n\t\"component.conversationEvent.participantJoined\": ({ variables }) =>\n\t\t`${variables.actorName} a rejoint la conversation`,\n\t\"component.conversationEvent.participantLeft\": ({ variables }) =>\n\t\t`${variables.actorName} a quitté la conversation`,\n\t\"component.conversationEvent.participantRequested\": ({ variables }) =>\n\t\t`${variables.actorName} a demandé à rejoindre`,\n\t\"component.conversationEvent.priorityChanged\": ({ variables }) =>\n\t\t`${variables.actorName} a modifié la priorité`,\n\t\"component.conversationEvent.reopened\": ({ variables }) =>\n\t\t`${variables.actorName} a rouvert la conversation`,\n\t\"component.conversationEvent.resolved\": ({ variables }) =>\n\t\t`${variables.actorName} a résolu la conversation`,\n\t\"component.conversationEvent.statusChanged\": ({ variables }) =>\n\t\t`${variables.actorName} a modifié le statut`,\n\t\"component.conversationEvent.tagAdded\": ({ variables }) =>\n\t\t`${variables.actorName} a ajouté une étiquette`,\n\t\"component.conversationEvent.tagRemoved\": ({ variables }) =>\n\t\t`${variables.actorName} a retiré une étiquette`,\n\t\"component.multimodalInput.placeholder\": \"Écrivez votre message...\",\n\t\"component.multimodalInput.remove\": ({ variables }) =>\n\t\t`Supprimer ${variables.fileName}`,\n\t\"component.navigation.articles\": \"Articles\",\n\t\"component.navigation.home\": \"Accueil\",\n\t\"component.message.timestamp.aiIndicator\": \"• Agent IA\",\n};\n\nexport default fr;\n"],"mappings":";AAEA,MAAMA,KAA4B;CACjC,8BAA8B;CAC9B,8BAA8B;CAC9B,8BAA8B,EAAE,gBAC/B,aAAa,UAAU;CACxB,0BAA0B;CAC1B,gCAAgC;CAChC,+BAA+B;CAC/B,4BAA4B;CAC5B,gCAAgC;CAChC,4BAA4B;CAC5B,wBAAwB;CACxB,kCAAkC;CAClC,+BAA+B;CAC/B,sCAAsC,EAAE,WAAW,YAClD,IAAI,MAAM,aAAa,UAAU,MAAM,CAAC;CACzC,kCAAkC;CAClC,uBAAuB,EAAE,WAAW,SAAS,YAAY;EAOxD,MAAM,SALgD;GACrD,SAAS;GACT,WAAW;GACX,SAAS;GACT,CALc,MAAM,WAAW,CAMD;EAC/B,MAAM,cACL,WAAW,eAAe,QAAQ,SAAS,SAAS;AACrD,SAAO,GAAG,SAAS,cAAc,IAAI,gBAAgB,GAAG;;CAEzD,2BAA2B,EAAE,WAAW,YAAY;EACnD,MAAM,QAAQ,UAAU;EACxB,MAAM,OAAO,MAAM,UAAU,OAAO;GACnC,KAAK;GACL,OAAO;GACP,CAAC;AACF,SAAO,KAAK,MAAM,aAAa,MAAM,CAAC,GAAG;;CAE1C,sBAAsB,EAAE,WAAW,SAAS,YAAY;EACvD,MAAM,cAAc,WAAW,eAAe,QAAQ,SAAS,QAAQ;AACvE,SAAO,cAAc,WAAW,MAAM,UAAU,YAAY,KAAK;;CAElE,kDAAkD;CAClD,uDAAuD,EAAE,gBACxD,GAAG,UAAU,KAAK,KAAK,UAAU;CAClC,yDAAyD,EAAE,gBAC1D,UAAU,UAAU;CACrB,4CAA4C,EAAE,gBAC7C,GAAG,UAAU,KAAK;CACnB,yCAAyC,EAAE,gBAC1C,GAAG,UAAU,UAAU;CACxB,2CAA2C,EAAE,gBAC5C,GAAG,UAAU,UAAU;CACxB,wCAAwC,EAAE,gBACzC,GAAG,UAAU,UAAU;CACxB,kDAAkD,EAAE,gBACnD,GAAG,UAAU,UAAU;CACxB,gDAAgD,EAAE,gBACjD,GAAG,UAAU,UAAU;CACxB,qDAAqD,EAAE,gBACtD,GAAG,UAAU,UAAU;CACxB,gDAAgD,EAAE,gBACjD,GAAG,UAAU,UAAU;CACxB,yCAAyC,EAAE,gBAC1C,GAAG,UAAU,UAAU;CACxB,yCAAyC,EAAE,gBAC1C,GAAG,UAAU,UAAU;CACxB,8CAA8C,EAAE,gBAC/C,GAAG,UAAU,UAAU;CACxB,yCAAyC,EAAE,gBAC1C,GAAG,UAAU,UAAU;CACxB,2CAA2C,EAAE,gBAC5C,GAAG,UAAU,UAAU;CACxB,yCAAyC;CACzC,qCAAqC,EAAE,gBACtC,aAAa,UAAU;CACxB,iCAAiC;CACjC,6BAA6B;CAC7B,2CAA2C;CAC3C;AAED,iBAAe"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { AvailableAIAgent, AvailableHumanAgent, PublicWebsiteResponse } from "@cossistant/types";
|
|
2
|
+
|
|
3
|
+
//#region src/support/text/locales/keys.d.ts
|
|
4
|
+
type SupportLocale = "en" | "fr" | "es";
|
|
5
|
+
type SupportTimeOfDayToken = "morning" | "afternoon" | "evening";
|
|
6
|
+
type SupportTimeOfDayValue = {
|
|
7
|
+
token: SupportTimeOfDayToken;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
10
|
+
type SupportTextUtils = {
|
|
11
|
+
formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;
|
|
12
|
+
pluralize: (count: number, options: {
|
|
13
|
+
one: string;
|
|
14
|
+
other: string;
|
|
15
|
+
}) => string;
|
|
16
|
+
titleCase: (value: string) => string;
|
|
17
|
+
timeOfDay: () => SupportTimeOfDayValue;
|
|
18
|
+
};
|
|
19
|
+
type SupportTextContext = {
|
|
20
|
+
website: PublicWebsiteResponse | null;
|
|
21
|
+
visitor: PublicWebsiteResponse["visitor"] | null;
|
|
22
|
+
humanAgents: AvailableHumanAgent[];
|
|
23
|
+
aiAgents: AvailableAIAgent[];
|
|
24
|
+
};
|
|
25
|
+
declare const supportTextDefinitions: {
|
|
26
|
+
readonly "common.actions.askQuestion": {
|
|
27
|
+
readonly variables: undefined;
|
|
28
|
+
};
|
|
29
|
+
readonly "common.actions.attachFiles": {
|
|
30
|
+
readonly variables: undefined;
|
|
31
|
+
};
|
|
32
|
+
readonly "common.actions.removeFile": {
|
|
33
|
+
readonly variables: {
|
|
34
|
+
readonly fileName: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
readonly "common.brand.watermark": {
|
|
38
|
+
readonly variables: undefined;
|
|
39
|
+
};
|
|
40
|
+
readonly "common.fallbacks.aiAssistant": {
|
|
41
|
+
readonly variables: undefined;
|
|
42
|
+
};
|
|
43
|
+
readonly "common.fallbacks.cossistant": {
|
|
44
|
+
readonly variables: undefined;
|
|
45
|
+
};
|
|
46
|
+
readonly "common.fallbacks.someone": {
|
|
47
|
+
readonly variables: undefined;
|
|
48
|
+
};
|
|
49
|
+
readonly "common.fallbacks.supportTeam": {
|
|
50
|
+
readonly variables: undefined;
|
|
51
|
+
};
|
|
52
|
+
readonly "common.fallbacks.unknown": {
|
|
53
|
+
readonly variables: undefined;
|
|
54
|
+
};
|
|
55
|
+
readonly "common.fallbacks.you": {
|
|
56
|
+
readonly variables: undefined;
|
|
57
|
+
};
|
|
58
|
+
readonly "common.labels.aiAgentIndicator": {
|
|
59
|
+
readonly variables: undefined;
|
|
60
|
+
};
|
|
61
|
+
readonly "common.labels.supportOnline": {
|
|
62
|
+
readonly variables: undefined;
|
|
63
|
+
};
|
|
64
|
+
readonly "page.conversationHistory.showMore": {
|
|
65
|
+
readonly variables: {
|
|
66
|
+
readonly count: number;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
readonly "page.conversationHistory.title": {
|
|
70
|
+
readonly variables: undefined;
|
|
71
|
+
};
|
|
72
|
+
readonly "page.home.greeting": {
|
|
73
|
+
readonly variables: {
|
|
74
|
+
readonly visitorName: string | undefined;
|
|
75
|
+
};
|
|
76
|
+
readonly optional: true;
|
|
77
|
+
};
|
|
78
|
+
readonly "page.home.history.more": {
|
|
79
|
+
readonly variables: {
|
|
80
|
+
readonly count: number;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
readonly "page.home.tagline": {
|
|
84
|
+
readonly variables: {
|
|
85
|
+
readonly websiteName: string | null;
|
|
86
|
+
};
|
|
87
|
+
readonly optional: true;
|
|
88
|
+
};
|
|
89
|
+
readonly "component.conversationButtonLink.fallbackTitle": {
|
|
90
|
+
readonly variables: undefined;
|
|
91
|
+
};
|
|
92
|
+
readonly "component.conversationButtonLink.lastMessage.agent": {
|
|
93
|
+
readonly variables: {
|
|
94
|
+
readonly name: string;
|
|
95
|
+
readonly time: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
readonly "component.conversationButtonLink.lastMessage.visitor": {
|
|
99
|
+
readonly variables: {
|
|
100
|
+
readonly time: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
readonly "component.conversationButtonLink.typing": {
|
|
104
|
+
readonly variables: {
|
|
105
|
+
readonly name: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
readonly "component.conversationEvent.assigned": {
|
|
109
|
+
readonly variables: {
|
|
110
|
+
readonly actorName: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly "component.conversationEvent.unassigned": {
|
|
114
|
+
readonly variables: {
|
|
115
|
+
readonly actorName: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
readonly "component.conversationEvent.default": {
|
|
119
|
+
readonly variables: {
|
|
120
|
+
readonly actorName: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
readonly "component.conversationEvent.participantJoined": {
|
|
124
|
+
readonly variables: {
|
|
125
|
+
readonly actorName: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
readonly "component.conversationEvent.participantLeft": {
|
|
129
|
+
readonly variables: {
|
|
130
|
+
readonly actorName: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
readonly "component.conversationEvent.participantRequested": {
|
|
134
|
+
readonly variables: {
|
|
135
|
+
readonly actorName: string;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
readonly "component.conversationEvent.priorityChanged": {
|
|
139
|
+
readonly variables: {
|
|
140
|
+
readonly actorName: string;
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
readonly "component.conversationEvent.reopened": {
|
|
144
|
+
readonly variables: {
|
|
145
|
+
readonly actorName: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
readonly "component.conversationEvent.resolved": {
|
|
149
|
+
readonly variables: {
|
|
150
|
+
readonly actorName: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
readonly "component.conversationEvent.statusChanged": {
|
|
154
|
+
readonly variables: {
|
|
155
|
+
readonly actorName: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
readonly "component.conversationEvent.tagAdded": {
|
|
159
|
+
readonly variables: {
|
|
160
|
+
readonly actorName: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
readonly "component.conversationEvent.tagRemoved": {
|
|
164
|
+
readonly variables: {
|
|
165
|
+
readonly actorName: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
readonly "component.multimodalInput.placeholder": {
|
|
169
|
+
readonly variables: undefined;
|
|
170
|
+
};
|
|
171
|
+
readonly "component.multimodalInput.remove": {
|
|
172
|
+
readonly variables: {
|
|
173
|
+
readonly fileName: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
readonly "component.navigation.articles": {
|
|
177
|
+
readonly variables: undefined;
|
|
178
|
+
};
|
|
179
|
+
readonly "component.navigation.home": {
|
|
180
|
+
readonly variables: undefined;
|
|
181
|
+
};
|
|
182
|
+
readonly "component.message.timestamp.aiIndicator": {
|
|
183
|
+
readonly variables: undefined;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
type SupportTextDefinitions = typeof supportTextDefinitions;
|
|
187
|
+
type SupportTextKey = keyof SupportTextDefinitions;
|
|
188
|
+
type SupportTextVariables<K extends SupportTextKey> = SupportTextDefinitions[K]["variables"];
|
|
189
|
+
type OptionalFlag<K extends SupportTextKey> = SupportTextDefinitions[K] extends {
|
|
190
|
+
optional: true;
|
|
191
|
+
} ? true : false;
|
|
192
|
+
type MessageVariables<K extends SupportTextKey, Vars = SupportTextVariables<K>> = Vars extends undefined ? undefined : OptionalFlag<K> extends true ? Vars | undefined : Vars;
|
|
193
|
+
type SupportTextMessage<K extends SupportTextKey, Vars = SupportTextVariables<K>> = string | ((args: {
|
|
194
|
+
variables: MessageVariables<K, Vars>;
|
|
195
|
+
context: SupportTextContext;
|
|
196
|
+
utils: SupportTextUtils;
|
|
197
|
+
}) => string);
|
|
198
|
+
type SupportLocaleMessages = { [K in SupportTextKey]: SupportTextMessage<K> };
|
|
199
|
+
type SupportTextContentOverrides<Locale extends string = SupportLocale> = Partial<{ [K in SupportTextKey]: SupportTextMessage<K> | Partial<Record<SupportLocale | Locale, SupportTextMessage<K>>> }>;
|
|
200
|
+
type SupportTextFormatter = {
|
|
201
|
+
<K extends SupportTextKey>(key: K, variables: SupportTextVariables<K>): string;
|
|
202
|
+
<K extends SupportTextKey>(key: K): string;
|
|
203
|
+
};
|
|
204
|
+
type KeysWithVariables = { [K in SupportTextKey]: SupportTextVariables<K> extends undefined ? never : OptionalFlag<K> extends true ? never : K }[SupportTextKey];
|
|
205
|
+
type StrictSupportTextFormatter = {
|
|
206
|
+
<K extends KeysWithVariables>(key: K, variables: SupportTextVariables<K>): string;
|
|
207
|
+
<K extends Exclude<SupportTextKey, KeysWithVariables>>(key: K, variables?: SupportTextVariables<K>): string;
|
|
208
|
+
};
|
|
209
|
+
type SupportTextResolvedFormatter = StrictSupportTextFormatter & SupportTextFormatter;
|
|
210
|
+
type SupportTextProviderValue = {
|
|
211
|
+
format: SupportTextResolvedFormatter;
|
|
212
|
+
locale: string;
|
|
213
|
+
};
|
|
214
|
+
//#endregion
|
|
215
|
+
export { StrictSupportTextFormatter, SupportLocale, SupportLocaleMessages, SupportTextContentOverrides, SupportTextContext, SupportTextDefinitions, SupportTextFormatter, SupportTextKey, SupportTextMessage, SupportTextProviderValue, SupportTextResolvedFormatter, SupportTextUtils, SupportTextVariables, SupportTimeOfDayToken, SupportTimeOfDayValue, supportTextDefinitions };
|
|
216
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","names":[],"sources":["../../../../src/support/text/locales/keys.ts"],"sourcesContent":[],"mappings":";;;KAMY,aAAA;KAEA,qBAAA;AAFA,KAIA,qBAAA,GAJa;EAEb,KAAA,EAGJ,qBAHyB;EAErB,KAAA,EAAA,MAAA;AAKZ,CAAA;AAA4B,KAAhB,gBAAA,GAAgB;cACkB,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EAAL,IAAA,CAAK,mBAAA,EAAA,GAAA,MAAA;WAG5B,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,OAAA,EAAA;IAAqB,GAAA,EAAA,MAAA;IAG3B,KAAA,EAAA,MAAA;EAAkB,CAAA,EAAA,GAAA,MAAA;WACpB,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,GAAA,MAAA;WACA,EAAA,GAAA,GALQ,qBAKR;;AAEC,KAJC,kBAAA,GAID;EAAgB,OAAA,EAHjB,qBAGiB,GAAA,IAAA;EAad,OAAA,EAfH,qBAsGyD,CAAA,SAAA,CAAA,GAAA,IAAA;EAEvD,WAAA,EAvGE,mBAuGoB,EAAA;EACtB,QAAA,EAvGD,gBAuGe,EAAA;AAE1B,CAAA;AAAgC,cA5FnB,sBA4FmB,EAAA;WAAW,4BAAA,EAAA;IAC1C,SAAA,SAAA,EAAA,SAAA;;EAAwB,SAAA,4BAAA,EAAA;IAEpB,SAAA,SAAY,EAAA,SAAA;EAAA,CAAA;WAAW,2BAAA,EAAA;IAC3B,SAAA,SAAA,EAAA;MAAuB,SAAA,QAAA,EAAA,MAAA;IAAC,CAAA;EAEpB,CAAA;EAAgB,SAAA,wBAAA,EAAA;IACV,SAAA,SAAA,EAAA,SAAA;;WACH,8BAAA,EAAA;IACJ,SAAA,SAAA,EAAA,SAAA;;WAED,6BAAA,EAAA;IACC,SAAA,SAAA,EAAA,SAAA;;EACI,SAAA,0BAAA,EAAA;IAEI,SAAA,SAAkB,EAAA,SAAA;EAAA,CAAA;WACnB,8BAAA,EAAA;IACkB,SAAA,SAAA,EAAA,SAAA;;WAIE,0BAAA,EAAA;IAAG,SAAA,SAAA,EAAA,SAAA;;WACtB,sBAAA,EAAA;IACF,SAAA,SAAA,EAAA,SAAA;EAAgB,CAAA;EAGd,SAAA,gCAAqB,EAAA;IAAA,SAAA,SAAA,EAAA,SAAA;;WACU,6BAAA,EAAA;IAAnB,SAAA,SAAA,EAAA,SAAA;EAAkB,CAAA;EAG9B,SAAA,mCAA2B,EAAA;IAAA,SAAA,SAAA,EAAA;MAAyB,SAAA,KAAA,EAAA,MAAA;IAExD,CAAA;;WACH,gCAAA,EAAA;IACe,SAAA,SAAA,EAAA,SAAA;;WAA2C,oBAAA,EAAA;IAAnB,SAAA,SAAA,EAAA;MAA/B,SAAA,WAAA,EAAA,MAAA,GAAA,SAAA;IAAR,CAAA;IAHJ,SAAA,QAAA,EAAA,IAAA;EAAO,CAAA;EAMI,SAAA,wBAAoB,EAAA;IAAA,SAAA,SAAA,EAAA;MACpB,SAAA,KAAA,EAAA,MAAA;IACL,CAAA;;WACM,mBAAA,EAAA;IAGD,SAAA,SAAA,EAAA;MAAqB,SAAA,WAAA,EAAA,MAAA,GAAA,IAAA;IAAC,CAAA;IAG7B,SAAA,QAAiB,EAAA,IAAA;EAAA,CAAA;WACf,gDAAA,EAAA;IAAsC,SAAA,SAAA,EAAA,SAAA;;WAE5B,oDAAA,EAAA;IAAb,SAAA,SAAA,EAAA;MAEC,SAAA,IAAA,EAAA,MAAA;MACH,SAAA,IAAA,EAAA,MAAA;IAAc,CAAA;EAEJ,CAAA;EAA0B,SAAA,sDAAA,EAAA;IAC1B,SAAA,SAAA,EAAA;MACL,SAAA,IAAA,EAAA,MAAA;IAC2B,CAAA;;WAEd,yCAAA,EAAA;IAAgB,SAAA,SAAA,EAAA;MAAxB,SAAA,IAAA,EAAA,MAAA;IACL,CAAA;;WACO,sCAAA,EAAA;IAAoB,SAAA,SAAA,EAAA;MAItB,SAAA,SAAA,EAAA,MAA4B;IAAA,CAAA;;WACvC,wCAAA,EAAA;IAAoB,SAAA,SAAA,EAAA;MAET,SAAA,SAAA,EAAwB,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAvExB,sBAAA,UAAgC;KAChC,cAAA,SAAuB;KAEvB,+BAA+B,kBAC1C,uBAAuB;KAEnB,uBAAuB,kBAC3B,uBAAuB;;;KAEnB,2BACM,uBACH,qBAAqB,MACzB,qCAED,aAAa,kBACZ,mBACA;KAEQ,6BACD,uBACH,qBAAqB;aAIf,iBAAiB,GAAG;WACtB;SACF;;KAGE,qBAAA,WACL,iBAAiB,mBAAmB;KAG/B,oDAAoD,iBAC/D,gBACO,iBACH,mBAAmB,KACnB,QAAQ,OAAO,gBAAgB,QAAQ,mBAAmB;KAGnD,oBAAA;aACA,qBACL,cACM,qBAAqB;aAGtB,qBAAqB;;KAG5B,iBAAA,WACE,iBAAiB,qBAAqB,+BAEzC,aAAa,0BAEZ,IACH;KAEU,0BAAA;aACA,wBACL,cACM,qBAAqB;aAEtB,QAAQ,gBAAgB,yBAC7B,eACO,qBAAqB;;KAIvB,4BAAA,GAA+B,6BAC1C;KAEW,wBAAA;UACH"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//#region src/support/text/locales/keys.ts
|
|
2
|
+
const supportTextDefinitions = {
|
|
3
|
+
"common.actions.askQuestion": { variables: void 0 },
|
|
4
|
+
"common.actions.attachFiles": { variables: void 0 },
|
|
5
|
+
"common.actions.removeFile": { variables: { fileName: "" } },
|
|
6
|
+
"common.brand.watermark": { variables: void 0 },
|
|
7
|
+
"common.fallbacks.aiAssistant": { variables: void 0 },
|
|
8
|
+
"common.fallbacks.cossistant": { variables: void 0 },
|
|
9
|
+
"common.fallbacks.someone": { variables: void 0 },
|
|
10
|
+
"common.fallbacks.supportTeam": { variables: void 0 },
|
|
11
|
+
"common.fallbacks.unknown": { variables: void 0 },
|
|
12
|
+
"common.fallbacks.you": { variables: void 0 },
|
|
13
|
+
"common.labels.aiAgentIndicator": { variables: void 0 },
|
|
14
|
+
"common.labels.supportOnline": { variables: void 0 },
|
|
15
|
+
"page.conversationHistory.showMore": { variables: { count: 0 } },
|
|
16
|
+
"page.conversationHistory.title": { variables: void 0 },
|
|
17
|
+
"page.home.greeting": {
|
|
18
|
+
variables: { visitorName: "" },
|
|
19
|
+
optional: true
|
|
20
|
+
},
|
|
21
|
+
"page.home.history.more": { variables: { count: 0 } },
|
|
22
|
+
"page.home.tagline": {
|
|
23
|
+
variables: { websiteName: "" },
|
|
24
|
+
optional: true
|
|
25
|
+
},
|
|
26
|
+
"component.conversationButtonLink.fallbackTitle": { variables: void 0 },
|
|
27
|
+
"component.conversationButtonLink.lastMessage.agent": { variables: {
|
|
28
|
+
name: "",
|
|
29
|
+
time: ""
|
|
30
|
+
} },
|
|
31
|
+
"component.conversationButtonLink.lastMessage.visitor": { variables: { time: "" } },
|
|
32
|
+
"component.conversationButtonLink.typing": { variables: { name: "" } },
|
|
33
|
+
"component.conversationEvent.assigned": { variables: { actorName: "" } },
|
|
34
|
+
"component.conversationEvent.unassigned": { variables: { actorName: "" } },
|
|
35
|
+
"component.conversationEvent.default": { variables: { actorName: "" } },
|
|
36
|
+
"component.conversationEvent.participantJoined": { variables: { actorName: "" } },
|
|
37
|
+
"component.conversationEvent.participantLeft": { variables: { actorName: "" } },
|
|
38
|
+
"component.conversationEvent.participantRequested": { variables: { actorName: "" } },
|
|
39
|
+
"component.conversationEvent.priorityChanged": { variables: { actorName: "" } },
|
|
40
|
+
"component.conversationEvent.reopened": { variables: { actorName: "" } },
|
|
41
|
+
"component.conversationEvent.resolved": { variables: { actorName: "" } },
|
|
42
|
+
"component.conversationEvent.statusChanged": { variables: { actorName: "" } },
|
|
43
|
+
"component.conversationEvent.tagAdded": { variables: { actorName: "" } },
|
|
44
|
+
"component.conversationEvent.tagRemoved": { variables: { actorName: "" } },
|
|
45
|
+
"component.multimodalInput.placeholder": { variables: void 0 },
|
|
46
|
+
"component.multimodalInput.remove": { variables: { fileName: "" } },
|
|
47
|
+
"component.navigation.articles": { variables: void 0 },
|
|
48
|
+
"component.navigation.home": { variables: void 0 },
|
|
49
|
+
"component.message.timestamp.aiIndicator": { variables: void 0 }
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
export { supportTextDefinitions };
|
|
54
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","names":[],"sources":["../../../../src/support/text/locales/keys.ts"],"sourcesContent":["import type {\n\tAvailableAIAgent,\n\tAvailableHumanAgent,\n\tPublicWebsiteResponse,\n} from \"@cossistant/types\";\n\nexport type SupportLocale = \"en\" | \"fr\" | \"es\";\n\nexport type SupportTimeOfDayToken = \"morning\" | \"afternoon\" | \"evening\";\n\nexport type SupportTimeOfDayValue = {\n\ttoken: SupportTimeOfDayToken;\n\tlabel: string;\n};\n\nexport type SupportTextUtils = {\n\tformatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n\tpluralize: (count: number, options: { one: string; other: string }) => string;\n\ttitleCase: (value: string) => string;\n\ttimeOfDay: () => SupportTimeOfDayValue;\n};\n\nexport type SupportTextContext = {\n\twebsite: PublicWebsiteResponse | null;\n\tvisitor: PublicWebsiteResponse[\"visitor\"] | null;\n\thumanAgents: AvailableHumanAgent[];\n\taiAgents: AvailableAIAgent[];\n};\n\ntype SupportTextDefinition<Vars> =\n\t| {\n\t\t\tvariables: Vars;\n\t\t\toptional?: false;\n\t }\n\t| {\n\t\t\tvariables: Vars;\n\t\t\toptional: true;\n\t };\n\nexport const supportTextDefinitions = {\n\t\"common.actions.askQuestion\": { variables: undefined },\n\t\"common.actions.attachFiles\": { variables: undefined },\n\t\"common.actions.removeFile\": { variables: { fileName: \"\" as string } },\n\t\"common.brand.watermark\": { variables: undefined },\n\t\"common.fallbacks.aiAssistant\": { variables: undefined },\n\t\"common.fallbacks.cossistant\": { variables: undefined },\n\t\"common.fallbacks.someone\": { variables: undefined },\n\t\"common.fallbacks.supportTeam\": { variables: undefined },\n\t\"common.fallbacks.unknown\": { variables: undefined },\n\t\"common.fallbacks.you\": { variables: undefined },\n\t\"common.labels.aiAgentIndicator\": { variables: undefined },\n\t\"common.labels.supportOnline\": { variables: undefined },\n\t\"page.conversationHistory.showMore\": { variables: { count: 0 as number } },\n\t\"page.conversationHistory.title\": { variables: undefined },\n\t\"page.home.greeting\": {\n\t\tvariables: { visitorName: \"\" as string | undefined },\n\t\toptional: true,\n\t},\n\t\"page.home.history.more\": { variables: { count: 0 as number } },\n\t\"page.home.tagline\": {\n\t\tvariables: { websiteName: \"\" as string | null },\n\t\toptional: true,\n\t},\n\t\"component.conversationButtonLink.fallbackTitle\": {\n\t\tvariables: undefined,\n\t},\n\t\"component.conversationButtonLink.lastMessage.agent\": {\n\t\tvariables: { name: \"\" as string, time: \"\" as string },\n\t},\n\t\"component.conversationButtonLink.lastMessage.visitor\": {\n\t\tvariables: { time: \"\" as string },\n\t},\n\t\"component.conversationButtonLink.typing\": {\n\t\tvariables: { name: \"\" as string },\n\t},\n\t\"component.conversationEvent.assigned\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.unassigned\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.default\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.participantJoined\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.participantLeft\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.participantRequested\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.priorityChanged\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.reopened\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.resolved\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.statusChanged\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.tagAdded\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.conversationEvent.tagRemoved\": {\n\t\tvariables: { actorName: \"\" as string },\n\t},\n\t\"component.multimodalInput.placeholder\": {\n\t\tvariables: undefined,\n\t},\n\t\"component.multimodalInput.remove\": {\n\t\tvariables: { fileName: \"\" as string },\n\t},\n\t\"component.navigation.articles\": {\n\t\tvariables: undefined,\n\t},\n\t\"component.navigation.home\": {\n\t\tvariables: undefined,\n\t},\n\t\"component.message.timestamp.aiIndicator\": {\n\t\tvariables: undefined,\n\t},\n} as const satisfies Record<string, SupportTextDefinition<unknown>>;\n\nexport type SupportTextDefinitions = typeof supportTextDefinitions;\nexport type SupportTextKey = keyof SupportTextDefinitions;\n\nexport type SupportTextVariables<K extends SupportTextKey> =\n\tSupportTextDefinitions[K][\"variables\"];\n\ntype OptionalFlag<K extends SupportTextKey> =\n\tSupportTextDefinitions[K] extends { optional: true } ? true : false;\n\ntype MessageVariables<\n\tK extends SupportTextKey,\n\tVars = SupportTextVariables<K>,\n> = Vars extends undefined\n\t? undefined\n\t: OptionalFlag<K> extends true\n\t\t? Vars | undefined\n\t\t: Vars;\n\nexport type SupportTextMessage<\n\tK extends SupportTextKey,\n\tVars = SupportTextVariables<K>,\n> =\n\t| string\n\t| ((args: {\n\t\t\tvariables: MessageVariables<K, Vars>;\n\t\t\tcontext: SupportTextContext;\n\t\t\tutils: SupportTextUtils;\n\t }) => string);\n\nexport type SupportLocaleMessages = {\n\t[K in SupportTextKey]: SupportTextMessage<K>;\n};\n\nexport type SupportTextContentOverrides<Locale extends string = SupportLocale> =\n\tPartial<{\n\t\t[K in SupportTextKey]:\n\t\t\t| SupportTextMessage<K>\n\t\t\t| Partial<Record<SupportLocale | Locale, SupportTextMessage<K>>>;\n\t}>;\n\nexport type SupportTextFormatter = {\n\t<K extends SupportTextKey>(\n\t\tkey: K,\n\t\tvariables: SupportTextVariables<K>\n\t): string;\n\t// biome-ignore lint/style/useUnifiedTypeSignatures: overload needed for strict variable checking\n\t<K extends SupportTextKey>(key: K): string;\n};\n\ntype KeysWithVariables = {\n\t[K in SupportTextKey]: SupportTextVariables<K> extends undefined\n\t\t? never\n\t\t: OptionalFlag<K> extends true\n\t\t\t? never\n\t\t\t: K;\n}[SupportTextKey];\n\nexport type StrictSupportTextFormatter = {\n\t<K extends KeysWithVariables>(\n\t\tkey: K,\n\t\tvariables: SupportTextVariables<K>\n\t): string;\n\t<K extends Exclude<SupportTextKey, KeysWithVariables>>(\n\t\tkey: K,\n\t\tvariables?: SupportTextVariables<K>\n\t): string;\n};\n\nexport type SupportTextResolvedFormatter = StrictSupportTextFormatter &\n\tSupportTextFormatter;\n\nexport type SupportTextProviderValue = {\n\tformat: SupportTextResolvedFormatter;\n\tlocale: string;\n};\n"],"mappings":";AAuCA,MAAa,yBAAyB;CACrC,8BAA8B,EAAE,WAAW,QAAW;CACtD,8BAA8B,EAAE,WAAW,QAAW;CACtD,6BAA6B,EAAE,WAAW,EAAE,UAAU,IAAc,EAAE;CACtE,0BAA0B,EAAE,WAAW,QAAW;CAClD,gCAAgC,EAAE,WAAW,QAAW;CACxD,+BAA+B,EAAE,WAAW,QAAW;CACvD,4BAA4B,EAAE,WAAW,QAAW;CACpD,gCAAgC,EAAE,WAAW,QAAW;CACxD,4BAA4B,EAAE,WAAW,QAAW;CACpD,wBAAwB,EAAE,WAAW,QAAW;CAChD,kCAAkC,EAAE,WAAW,QAAW;CAC1D,+BAA+B,EAAE,WAAW,QAAW;CACvD,qCAAqC,EAAE,WAAW,EAAE,OAAO,GAAa,EAAE;CAC1E,kCAAkC,EAAE,WAAW,QAAW;CAC1D,sBAAsB;EACrB,WAAW,EAAE,aAAa,IAA0B;EACpD,UAAU;EACV;CACD,0BAA0B,EAAE,WAAW,EAAE,OAAO,GAAa,EAAE;CAC/D,qBAAqB;EACpB,WAAW,EAAE,aAAa,IAAqB;EAC/C,UAAU;EACV;CACD,kDAAkD,EACjD,WAAW,QACX;CACD,sDAAsD,EACrD,WAAW;EAAE,MAAM;EAAc,MAAM;EAAc,EACrD;CACD,wDAAwD,EACvD,WAAW,EAAE,MAAM,IAAc,EACjC;CACD,2CAA2C,EAC1C,WAAW,EAAE,MAAM,IAAc,EACjC;CACD,wCAAwC,EACvC,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,0CAA0C,EACzC,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,uCAAuC,EACtC,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,iDAAiD,EAChD,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,+CAA+C,EAC9C,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,oDAAoD,EACnD,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,+CAA+C,EAC9C,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,wCAAwC,EACvC,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,wCAAwC,EACvC,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,6CAA6C,EAC5C,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,wCAAwC,EACvC,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,0CAA0C,EACzC,WAAW,EAAE,WAAW,IAAc,EACtC;CACD,yCAAyC,EACxC,WAAW,QACX;CACD,oCAAoC,EACnC,WAAW,EAAE,UAAU,IAAc,EACrC;CACD,iCAAiC,EAChC,WAAW,QACX;CACD,6BAA6B,EAC5B,WAAW,QACX;CACD,2CAA2C,EAC1C,WAAW,QACX;CACD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SupportLocale, SupportLocaleMessages, SupportTextContentOverrides, SupportTextContext, SupportTextKey, SupportTextUtils, SupportTextVariables } from "./locales/keys.js";
|
|
2
|
+
|
|
3
|
+
//#region src/support/text/runtime.d.ts
|
|
4
|
+
type NormalizedOverride<K extends SupportTextKey> = {
|
|
5
|
+
anyLocale?: SupportLocaleMessages[K];
|
|
6
|
+
byLocale: Map<string, SupportLocaleMessages[K]>;
|
|
7
|
+
};
|
|
8
|
+
type NormalizedOverrides = Map<SupportTextKey, NormalizedOverride<SupportTextKey>>;
|
|
9
|
+
declare const BUILTIN_LOCALES: Record<SupportLocale, SupportLocaleMessages>;
|
|
10
|
+
declare function createTextUtils(locale: string, isHydrated?: boolean): SupportTextUtils;
|
|
11
|
+
declare function buildLocaleChain(preferences: Array<string | null | undefined>): string[];
|
|
12
|
+
declare function normalizeOverrides(overrides?: SupportTextContentOverrides<string>): NormalizedOverrides;
|
|
13
|
+
declare function resolveMessage<K extends SupportTextKey>(key: K, localeChain: string[], overrides: NormalizedOverrides): SupportLocaleMessages[K];
|
|
14
|
+
declare function evaluateMessage<K extends SupportTextKey>(key: K, message: SupportLocaleMessages[K], variables: SupportTextVariables<K> | undefined, context: SupportTextContext, utils: SupportTextUtils): string;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { BUILTIN_LOCALES, NormalizedOverride, NormalizedOverrides, buildLocaleChain, createTextUtils, evaluateMessage, normalizeOverrides, resolveMessage };
|
|
17
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","names":[],"sources":["../../../src/support/text/runtime.ts"],"sourcesContent":[],"mappings":";;;KAeY,6BAA6B;cAC5B,sBAAsB;EADvB,QAAA,EAED,GAFC,CAAA,MAAA,EAEW,qBAFO,CAEe,CAFf,CAAA,CAAA;CAAA;AAAW,KAK7B,mBAAA,GAAsB,GALO,CAMxC,cANwC,EAOxC,kBAPwC,CAOrB,cAPqB,CAAA,CAAA;AAC5B,cASA,eATA,EASiB,MATjB,CASwB,aATxB,EASuC,qBATvC,CAAA;AAAsB,iBA6DnB,eAAA,CA7DmB,MAAA,EAAA,MAAA,EAAA,UAAA,CAAA,EAAA,OAAA,CAAA,EAgEhC,gBAhEgC;AACZ,iBA0HP,gBAAA,CA1HO,WAAA,EA2HT,KA3HS,CAAA,MAAA,GAAA,IAAA,GAAA,SAAA,CAAA,CAAA,EAAA,MAAA,EAAA;AAAsB,iBAwJ7B,kBAAA,CAxJ6B,SAAA,CAAA,EAyJhC,2BAzJgC,CAAA,MAAA,CAAA,CAAA,EA0J1C,mBA1J0C;AAAlC,iBAgMK,cAhML,CAAA,UAgM8B,cAhM9B,CAAA,CAAA,GAAA,EAiML,CAjMK,EAAA,WAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAmMC,mBAnMD,CAAA,EAoMR,qBApMQ,CAoMc,CApMd,CAAA;AAAG,iBA2NE,eA3NF,CAAA,UA2N4B,cA3N5B,CAAA,CAAA,GAAA,EA4NR,CA5NQ,EAAA,OAAA,EA6NJ,qBA7NI,CA6NkB,CA7NlB,CAAA,EAAA,SAAA,EA8NF,oBA9NE,CA8NmB,CA9NnB,CAAA,GAAA,SAAA,EAAA,OAAA,EA+NJ,kBA/NI,EAAA,KAAA,EAgON,gBAhOM,CAAA,EAAA,MAAA"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import en_default from "./locales/en.js";
|
|
2
|
+
import es_default from "./locales/es.js";
|
|
3
|
+
import fr_default from "./locales/fr.js";
|
|
4
|
+
|
|
5
|
+
//#region src/support/text/runtime.ts
|
|
6
|
+
const BUILTIN_LOCALES = {
|
|
7
|
+
en: en_default,
|
|
8
|
+
fr: fr_default,
|
|
9
|
+
es: es_default
|
|
10
|
+
};
|
|
11
|
+
const TIME_OF_DAY_THRESHOLDS = [
|
|
12
|
+
{
|
|
13
|
+
token: "morning",
|
|
14
|
+
hour: 9
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
token: "afternoon",
|
|
18
|
+
hour: 15
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
token: "evening",
|
|
22
|
+
hour: 20
|
|
23
|
+
}
|
|
24
|
+
];
|
|
25
|
+
function buildDayPeriodLabels(locale) {
|
|
26
|
+
const fallback = {
|
|
27
|
+
morning: "morning",
|
|
28
|
+
afternoon: "afternoon",
|
|
29
|
+
evening: "evening"
|
|
30
|
+
};
|
|
31
|
+
try {
|
|
32
|
+
const formatter = new Intl.DateTimeFormat(locale, {
|
|
33
|
+
hour: "numeric",
|
|
34
|
+
hour12: true
|
|
35
|
+
});
|
|
36
|
+
const labels = {};
|
|
37
|
+
for (const { token, hour } of TIME_OF_DAY_THRESHOLDS) {
|
|
38
|
+
const part = formatter.formatToParts(new Date(2020, 0, 1, hour)).find((segment) => segment.type === "dayPeriod");
|
|
39
|
+
if (part?.value) {
|
|
40
|
+
const normalized = part.value.trim();
|
|
41
|
+
if (normalized) labels[token] = normalized;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
morning: labels.morning ?? fallback.morning,
|
|
46
|
+
afternoon: labels.afternoon ?? fallback.afternoon,
|
|
47
|
+
evening: labels.evening ?? fallback.evening
|
|
48
|
+
};
|
|
49
|
+
} catch {
|
|
50
|
+
return fallback;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function createTextUtils(locale, isHydrated = false) {
|
|
54
|
+
const numberFormatter = new Intl.NumberFormat(locale);
|
|
55
|
+
const pluralRules = new Intl.PluralRules(locale);
|
|
56
|
+
const dayPeriodLabels = buildDayPeriodLabels(locale);
|
|
57
|
+
return {
|
|
58
|
+
formatNumber: (value, options) => options ? new Intl.NumberFormat(locale, options).format(value) : numberFormatter.format(value),
|
|
59
|
+
pluralize: (count, options) => {
|
|
60
|
+
return pluralRules.select(count) === "one" ? options.one : options.other;
|
|
61
|
+
},
|
|
62
|
+
titleCase: (value) => {
|
|
63
|
+
if (!value) return "";
|
|
64
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
65
|
+
},
|
|
66
|
+
timeOfDay: () => {
|
|
67
|
+
if (!isHydrated) return {
|
|
68
|
+
token: "morning",
|
|
69
|
+
label: dayPeriodLabels.morning
|
|
70
|
+
};
|
|
71
|
+
const hour = (/* @__PURE__ */ new Date()).getHours();
|
|
72
|
+
let token;
|
|
73
|
+
if (hour < 12) token = "morning";
|
|
74
|
+
else if (hour < 18) token = "afternoon";
|
|
75
|
+
else token = "evening";
|
|
76
|
+
return {
|
|
77
|
+
token,
|
|
78
|
+
label: dayPeriodLabels[token]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Normalize a locale string to its base language code
|
|
85
|
+
* Examples:
|
|
86
|
+
* - "en-US" -> "en"
|
|
87
|
+
* - "en-GB" -> "en"
|
|
88
|
+
* - "fr-FR" -> "fr"
|
|
89
|
+
*/
|
|
90
|
+
function normalizeLocaleString(locale) {
|
|
91
|
+
const [base] = locale.toLowerCase().split("-");
|
|
92
|
+
return base || locale.toLowerCase();
|
|
93
|
+
}
|
|
94
|
+
function buildLocaleChain(preferences) {
|
|
95
|
+
const seen = /* @__PURE__ */ new Set();
|
|
96
|
+
const chain = [];
|
|
97
|
+
const pushLocale = (value) => {
|
|
98
|
+
const normalized = normalizeLocaleString(value);
|
|
99
|
+
if (!seen.has(normalized)) {
|
|
100
|
+
seen.add(normalized);
|
|
101
|
+
chain.push(normalized);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
for (const candidate of preferences) {
|
|
105
|
+
if (!candidate) continue;
|
|
106
|
+
pushLocale(candidate);
|
|
107
|
+
}
|
|
108
|
+
if (!seen.has("en")) chain.push("en");
|
|
109
|
+
return chain;
|
|
110
|
+
}
|
|
111
|
+
function normalizeOverrides(overrides) {
|
|
112
|
+
const map = /* @__PURE__ */ new Map();
|
|
113
|
+
if (!overrides) return map;
|
|
114
|
+
for (const key of Object.keys(overrides)) {
|
|
115
|
+
const value = overrides[key];
|
|
116
|
+
if (!value) continue;
|
|
117
|
+
if (typeof value === "string" || typeof value === "function") {
|
|
118
|
+
map.set(key, {
|
|
119
|
+
anyLocale: value,
|
|
120
|
+
byLocale: /* @__PURE__ */ new Map()
|
|
121
|
+
});
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const byLocale = /* @__PURE__ */ new Map();
|
|
125
|
+
for (const [locale, localizedValue] of Object.entries(value)) {
|
|
126
|
+
if (!localizedValue) continue;
|
|
127
|
+
byLocale.set(locale.toLowerCase(), localizedValue);
|
|
128
|
+
}
|
|
129
|
+
map.set(key, { byLocale });
|
|
130
|
+
}
|
|
131
|
+
return map;
|
|
132
|
+
}
|
|
133
|
+
function resolveMessage(key, localeChain, overrides) {
|
|
134
|
+
const override = overrides.get(key);
|
|
135
|
+
if (override) {
|
|
136
|
+
for (const locale of localeChain) {
|
|
137
|
+
const localized = override.byLocale.get(locale);
|
|
138
|
+
if (localized) return localized;
|
|
139
|
+
}
|
|
140
|
+
if (override.anyLocale) return override.anyLocale;
|
|
141
|
+
}
|
|
142
|
+
for (const locale of localeChain) if (locale in BUILTIN_LOCALES) return BUILTIN_LOCALES[locale][key];
|
|
143
|
+
return BUILTIN_LOCALES.en[key];
|
|
144
|
+
}
|
|
145
|
+
function evaluateMessage(key, message, variables, context, utils) {
|
|
146
|
+
if (typeof message === "function") return message({
|
|
147
|
+
variables,
|
|
148
|
+
context,
|
|
149
|
+
utils
|
|
150
|
+
});
|
|
151
|
+
return message;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
//#endregion
|
|
155
|
+
export { BUILTIN_LOCALES, buildLocaleChain, createTextUtils, evaluateMessage, normalizeOverrides, resolveMessage };
|
|
156
|
+
//# sourceMappingURL=runtime.js.map
|