@botuyo/chat-widget-standalone 1.0.19 → 1.0.21
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/botuyo-chat.es.js +5 -5
- package/dist/botuyo-chat.es.js.map +1 -1
- package/dist/botuyo-chat.umd.js +1 -1
- package/dist/botuyo-chat.umd.js.map +1 -1
- package/dist/{chunk-audio-CDtwQRaH.js → chunk-audio-C0i6pIL6.js} +2 -2
- package/dist/{chunk-audio-CDtwQRaH.js.map → chunk-audio-C0i6pIL6.js.map} +1 -1
- package/dist/{chunk-chat-ui-DMRNluu0.js → chunk-chat-ui-_0LmcZf0.js} +33 -33
- package/dist/{chunk-chat-ui-DMRNluu0.js.map → chunk-chat-ui-_0LmcZf0.js.map} +1 -1
- package/dist/{chunk-gallery-IPj0rIQn.js → chunk-gallery-8F2X2Wky.js} +2 -2
- package/dist/{chunk-gallery-IPj0rIQn.js.map → chunk-gallery-8F2X2Wky.js.map} +1 -1
- package/dist/src/chat-widget/ChatWidget.d.ts.map +1 -1
- package/dist/src/chat-widget/components/ChatWindow.d.ts +6 -1
- package/dist/src/chat-widget/components/ChatWindow.d.ts.map +1 -1
- package/dist/src/chat-widget/components/VoiceCallOverlay.d.ts +6 -1
- package/dist/src/chat-widget/components/VoiceCallOverlay.d.ts.map +1 -1
- package/dist/src/chat-widget/hooks/useChatSocket.d.ts +3 -0
- package/dist/src/chat-widget/hooks/useChatSocket.d.ts.map +1 -1
- package/dist/src/chat-widget/hooks/useChatWidget.d.ts +1 -0
- package/dist/src/chat-widget/hooks/useChatWidget.d.ts.map +1 -1
- package/dist/stats-umd.html +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as r,jsx as e,Fragment as a}from"react/jsx-runtime";import{memo as t,useState as l,useRef as o,useMemo as n,useCallback as i}from"react";import{g as s,c,R as d,L as u,P as h,a as m,C as f}from"./chunk-chat-ui-
|
|
1
|
+
import{jsxs as r,jsx as e,Fragment as a}from"react/jsx-runtime";import{memo as t,useState as l,useRef as o,useMemo as n,useCallback as i}from"react";import{g as s,c,R as d,L as u,P as h,a as m,C as f}from"./chunk-chat-ui-_0LmcZf0.js";const p=t(function({url:t,isBot:p,primaryColor:y}){const[x,N]=l(!1),[g,w]=l(0),[b,v]=l(0),[C,k]=l(!0),[j,M]=l(null),P=o(null),S=n(()=>s({primaryColor:y}),[y]),E=i(()=>{j||(x?P.current?.pause():P.current?.play().catch(r=>{console.error("[AudioPlayer] Play error:",r),M("Error al reproducir")}),N(!x))},[x,j]),T=i(()=>{w(P.current?.duration||0)},[]),$=i(()=>{k(!1),M(null)},[]),A=i(()=>{console.error("[AudioPlayer] Failed to load audio:",t),k(!1),M("No se pudo cargar")},[t]),L=i(()=>{k(!0),M(null),P.current&&P.current.load()},[]);/* @__PURE__ */
|
|
2
2
|
return r("div",{className:c("flex items-center gap-3 py-1 min-w-[200px]",p?"text-foreground":"text-primary-foreground"),children:[
|
|
3
3
|
/* @__PURE__ */e("audio",{ref:P,src:t,preload:"metadata",onLoadedMetadata:T,onCanPlayThrough:$,onTimeUpdate:()=>v(P.current?.currentTime||0),onEnded:()=>N(!1),onError:A}),
|
|
4
4
|
/* @__PURE__ */e("button",j?{onClick:L,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 bg-red-500/20 text-red-500 hover:bg-red-500/30 transition-colors",title:"Reintentar",children:/* @__PURE__ */e(d,{className:"w-4 h-4"})}:{onClick:E,disabled:C,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 transition-opacity",style:{backgroundColor:p?S:"hsl(var(--card))",color:p?"white":S,opacity:C?.6:1},children:C?/* @__PURE__ */e(u,{className:"w-4 h-4 animate-spin"}):x?/* @__PURE__ */e(h,{className:"w-4 h-4 fill-current"}):/* @__PURE__ */e(m,{className:"w-4 h-4 fill-current ml-0.5"})}),
|
|
@@ -9,4 +9,4 @@ return r("div",{className:c("flex items-center gap-3 py-1 min-w-[200px]",p?"text
|
|
|
9
9
|
/* @__PURE__ */r("div",{className:"flex justify-between text-[9px] font-bold opacity-60",children:[
|
|
10
10
|
/* @__PURE__ */r("span",{children:[Math.floor(b/60),":",Math.floor(b%60).toString().padStart(2,"0")]}),
|
|
11
11
|
/* @__PURE__ */e("span",{children:C?"--:--":`${Math.floor(g/60)}:${Math.floor(g%60).toString().padStart(2,"0")}`})]})]})})]})});export{p as AudioPlayer};
|
|
12
|
-
//# sourceMappingURL=chunk-audio-
|
|
12
|
+
//# sourceMappingURL=chunk-audio-C0i6pIL6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-audio-
|
|
1
|
+
{"version":3,"file":"chunk-audio-C0i6pIL6.js","sources":["../src/chat-widget/components/AudioPlayer.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { useState, useRef, useMemo, memo, useCallback } from 'react'\r\nimport { Play, Pause, Loader2, AlertCircle, RotateCw } from './Icons'\r\nimport { cn } from '@/lib/utils'\r\nimport { getPrimaryColor } from '../utils/theme'\r\n\r\ninterface AudioPlayerProps {\r\n url: string\r\n isBot: boolean\r\n primaryColor?: string\r\n}\r\n\r\nexport type { AudioPlayerProps }\r\n\r\nexport const AudioPlayer = memo(function AudioPlayer({\r\n url,\r\n isBot,\r\n primaryColor,\r\n}: AudioPlayerProps) {\r\n const [isPlaying, setIsPlaying] = useState(false)\r\n const [duration, setDuration] = useState(0)\r\n const [currentTime, setCurrentTime] = useState(0)\r\n const [isLoading, setIsLoading] = useState(true)\r\n const [error, setError] = useState<string | null>(null)\r\n const audioRef = useRef<HTMLAudioElement>(null)\r\n\r\n const brandColor = useMemo(() => getPrimaryColor({ primaryColor }), [primaryColor])\r\n\r\n const togglePlay = useCallback(() => {\r\n if (error) return\r\n if (isPlaying) audioRef.current?.pause()\r\n else audioRef.current?.play().catch((e) => {\r\n console.error('[AudioPlayer] Play error:', e)\r\n setError('Error al reproducir')\r\n })\r\n setIsPlaying(!isPlaying)\r\n }, [isPlaying, error])\r\n\r\n const handleLoadedMetadata = useCallback(() => {\r\n setDuration(audioRef.current?.duration || 0)\r\n }, [])\r\n\r\n const handleCanPlayThrough = useCallback(() => {\r\n setIsLoading(false)\r\n setError(null)\r\n }, [])\r\n\r\n const handleError = useCallback(() => {\r\n console.error('[AudioPlayer] Failed to load audio:', url)\r\n setIsLoading(false)\r\n setError('No se pudo cargar')\r\n }, [url])\r\n\r\n const handleRetry = useCallback(() => {\r\n setIsLoading(true)\r\n setError(null)\r\n if (audioRef.current) {\r\n audioRef.current.load()\r\n }\r\n }, [])\r\n\r\n return (\r\n <div\r\n className={cn(\r\n 'flex items-center gap-3 py-1 min-w-[200px]',\r\n isBot ? 'text-foreground' : 'text-primary-foreground'\r\n )}\r\n >\r\n <audio\r\n ref={audioRef}\r\n src={url}\r\n preload=\"metadata\"\r\n onLoadedMetadata={handleLoadedMetadata}\r\n onCanPlayThrough={handleCanPlayThrough}\r\n onTimeUpdate={() => setCurrentTime(audioRef.current?.currentTime || 0)}\r\n onEnded={() => setIsPlaying(false)}\r\n onError={handleError}\r\n />\r\n \r\n {error ? (\r\n // Error state - show retry button\r\n <button\r\n onClick={handleRetry}\r\n className=\"w-8 h-8 rounded-full flex items-center justify-center shrink-0 bg-red-500/20 text-red-500 hover:bg-red-500/30 transition-colors\"\r\n title=\"Reintentar\"\r\n >\r\n <RotateCw className=\"w-4 h-4\" />\r\n </button>\r\n ) : (\r\n // Normal play/pause button\r\n <button\r\n onClick={togglePlay}\r\n disabled={isLoading}\r\n className=\"w-8 h-8 rounded-full flex items-center justify-center shrink-0 transition-opacity\"\r\n style={{\r\n backgroundColor: isBot ? brandColor : 'hsl(var(--card))',\r\n color: isBot ? 'white' : brandColor,\r\n opacity: isLoading ? 0.6 : 1,\r\n }}\r\n >\r\n {isLoading ? (\r\n <Loader2 className=\"w-4 h-4 animate-spin\" />\r\n ) : isPlaying ? (\r\n <Pause className=\"w-4 h-4 fill-current\" />\r\n ) : (\r\n <Play className=\"w-4 h-4 fill-current ml-0.5\" />\r\n )}\r\n </button>\r\n )}\r\n \r\n <div className=\"flex-1 space-y-1\">\r\n {error ? (\r\n <div className=\"flex items-center gap-1.5 text-red-500\">\r\n <AlertCircle className=\"w-3 h-3\" />\r\n <span className=\"text-[9px] font-bold\">{error}</span>\r\n </div>\r\n ) : (\r\n <>\r\n <div className=\"relative h-1 w-full bg-current/20 rounded-full overflow-hidden\">\r\n <div\r\n className=\"absolute h-full bg-current rounded-full transition-all\"\r\n style={{ width: `${(currentTime / duration) * 100 || 0}%` }}\r\n />\r\n </div>\r\n <div className=\"flex justify-between text-[9px] font-bold opacity-60\">\r\n <span>\r\n {Math.floor(currentTime / 60)}:\r\n {Math.floor(currentTime % 60)\r\n .toString()\r\n .padStart(2, '0')}\r\n </span>\r\n <span>\r\n {isLoading ? '--:--' : `${Math.floor(duration / 60)}:${Math.floor(duration % 60).toString().padStart(2, '0')}`}\r\n </span>\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n )\r\n})\r\n"],"names":["AudioPlayer","memo","url","isBot","primaryColor","isPlaying","setIsPlaying","useState","duration","setDuration","currentTime","setCurrentTime","isLoading","setIsLoading","error","setError","audioRef","useRef","brandColor","useMemo","getPrimaryColor","togglePlay","useCallback","current","pause","play","catch","e","console","handleLoadedMetadata","handleCanPlayThrough","handleError","handleRetry","load","jsxs","className","cn","children","jsx","ref","src","preload","onLoadedMetadata","onCanPlayThrough","onTimeUpdate","onEnded","onError","onClick","title","RotateCw","disabled","style","backgroundColor","color","opacity","Loader2","Pause","Play","AlertCircle","Fragment","width","Math","floor","toString","padStart"],"mappings":"0OAeO,MAAMA,EAAcC,EAAK,UAAqBC,IACnDA,EAAAC,MACAA,EAAAC,aACAA,IAEA,MAAOC,EAAWC,GAAgBC,GAAS,IACpCC,EAAUC,GAAeF,EAAS,IAClCG,EAAaC,GAAkBJ,EAAS,IACxCK,EAAWC,GAAgBN,GAAS,IACpCO,EAAOC,GAAYR,EAAwB,MAC5CS,EAAWC,EAAyB,MAEpCC,EAAaC,EAAQ,IAAMC,EAAgB,CAAEhB,iBAAiB,CAACA,IAE/DiB,EAAaC,EAAY,KACzBR,IACAT,EAAWW,EAASO,SAASC,UACnBD,SAASE,OAAOC,MAAOC,IACnCC,QAAQd,MAAM,4BAA6Ba,GAC3CZ,EAAS,yBAEXT,GAAcD,KACb,CAACA,EAAWS,IAETe,EAAuBP,EAAY,KACvCb,EAAYO,EAASO,SAASf,UAAY,IACzC,IAEGsB,EAAuBR,EAAY,KACvCT,GAAa,GACbE,EAAS,OACR,IAEGgB,EAAcT,EAAY,KAC9BM,QAAQd,MAAM,sCAAuCZ,GACrDW,GAAa,GACbE,EAAS,sBACR,CAACb,IAEE8B,EAAcV,EAAY,KAC9BT,GAAa,GACbE,EAAS,MACLC,EAASO,SACXP,EAASO,QAAQU,QAElB;AAEH,OACEC,EAAC,MAAA,CACCC,UAAWC,EACT,6CACAjC,EAAQ,kBAAoB,2BAG9BkC,SAAA;eAAAC,EAAC,QAAA,CACCC,IAAKvB,EACLwB,IAAKtC,EACLuC,QAAQ,WACRC,iBAAkBb,EAClBc,iBAAkBb,EAClBc,aAAc,IAAMjC,EAAeK,EAASO,SAASb,aAAe,GACpEmC,QAAS,IAAMvC,GAAa,GAC5BwC,QAASf;eAKTO,EAAC,SAFFxB,EAEE,CACCiC,QAASf,EACTG,UAAU,kIACVa,MAAM,aAENX,wBAAAC,EAACW,EAAA,CAASd,UAAU,aAIrB,CACCY,QAAS1B,EACT6B,SAAUtC,EACVuB,UAAU,oFACVgB,MAAO,CACLC,gBAAiBjD,EAAQe,EAAa,mBACtCmC,MAAOlD,EAAQ,QAAUe,EACzBoC,QAAS1C,EAAY,GAAM,GAG5ByB,SAAAzB,iBACC0B,EAACiB,EAAA,CAAQpB,UAAU,yBACjB9B,iBACFiC,EAACkB,EAAA,CAAMrB,UAAU,0CAEhBsB,EAAA,CAAKtB,UAAU;eAKtBG,EAAC,OAAIH,UAAU,mBACZE,0BACCH,EAAC,MAAA,CAAIC,UAAU,yCACbE,SAAA;eAAAC,EAACoB,EAAA,CAAYvB,UAAU;iBACtB,OAAA,CAAKA,UAAU,uBAAwBE,SAAAvB,sBAG1CoB,EAAAyB,EAAA,CACEtB,SAAA;eAAAC,EAAC,MAAA,CAAIH,UAAU,iEACbE,wBAAAC,EAAC,MAAA,CACCH,UAAU,yDACVgB,MAAO,CAAES,MAAO,GAAIlD,EAAcF,EAAY,KAAO;eAGzD0B,EAAC,MAAA,CAAIC,UAAU,uDACbE,SAAA;eAAAH,EAAC,OAAA,CACEG,SAAA,CAAAwB,KAAKC,MAAMpD,EAAc,IAAI,IAC7BmD,KAAKC,MAAMpD,EAAc,IACvBqD,WACAC,SAAS,EAAG;eAEjB1B,EAAC,QACED,SAAAzB,EAAY,QAAU,GAAGiD,KAAKC,MAAMtD,EAAW,OAAOqD,KAAKC,MAAMtD,EAAW,IAAIuD,WAAWC,SAAS,EAAG,mBAQxH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import*as e from"react";import t,{createContext as r,useContext as o,useState as n,useEffect as s,useCallback as a,forwardRef as i,createElement as l,useMemo as c,lazy as d,memo as u,Suspense as m,useRef as h}from"react";import{jsx as p,jsxs as g,Fragment as f}from"react/jsx-runtime";import{flushSync as b}from"react-dom";import{M as x,r as v,a as y}from"./chunk-markdown-C7alTngS.js";const w={es:{online:"En línea",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Con ❤️ por BotUyo",preview:"Vista previa",fotos:"Fotos",ubicacion:"Ubicación",input_placeholder:"Escribe un mensaje...",send:"Enviar",attach_photo:"Adjuntar foto",attach_location:"Compartir ubicación",recording:"Grabando...",rate_limit_exceeded:"Has enviado demasiados mensajes. Espera un momento.",connection_error:"Error de conexión",file_too_large:"Archivo demasiado grande",invalid_file:"Tipo de archivo no válido",extracted:{assistant:"Asistente",anterior:"Anterior",siguiente:"Siguiente",cerrar:"Cerrar",cerrar_chat:"Cerrar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver ubicación"},accessibility:{closeChat:"Cerrar ventana de chat",closeChatHint:"Presiona Escape para cerrar",chatMessages:"Mensajes del chat",messageHistory:"Historial de mensajes",dialogDescription:"Ventana de chat con {{botName}}. Presiona Escape para cerrar. Usa Ctrl+Enter para enviar mensajes.",sendMessage:"Enviar mensaje",sendMessageHint:"Presiona Enter o Ctrl+Enter para enviar",typeMessage:"Escribe tu mensaje aquí",botMessage:"Mensaje del asistente",userMessage:"Tu mensaje",messageFrom:"Mensaje de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nuevo mensaje recibido"}},en:{online:"Online",offline:"Offline",connecting:"Connecting...",con_amor_paseo_libre:"With ❤️ by BotUyo",preview:"Preview",fotos:"Photos",ubicacion:"Location",input_placeholder:"Type a message...",send:"Send",attach_photo:"Attach photo",attach_location:"Share location",recording:"Recording...",rate_limit_exceeded:"You have sent too many messages. Please wait.",connection_error:"Connection error",file_too_large:"File too large",invalid_file:"Invalid file type",extracted:{assistant:"Assistant",anterior:"Previous",siguiente:"Next",cerrar:"Close",cerrar_chat:"Close chat",abrir_chat:"Open chat",ver_ubicacion:"View location"},accessibility:{closeChat:"Close chat window",closeChatHint:"Press Escape to close",chatMessages:"Chat messages",messageHistory:"Message history",dialogDescription:"Chat window with {{botName}}. Press Escape to close. Use Ctrl+Enter to send messages.",sendMessage:"Send message",sendMessageHint:"Press Enter or Ctrl+Enter to send",typeMessage:"Type your message here",botMessage:"Assistant message",userMessage:"Your message",messageFrom:"Message from {{sender}}",messageTime:"Sent {{time}}",newMessage:"New message received"}},pt:{online:"Online",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Com ❤️ por BotUyo",preview:"Visualizar",fotos:"Fotos",ubicacion:"Localização",input_placeholder:"Digite uma mensagem...",send:"Enviar",attach_photo:"Anexar foto",attach_location:"Compartilhar localização",recording:"Gravando...",rate_limit_exceeded:"Você enviou muitas mensagens. Aguarde um momento.",connection_error:"Erro de conexão",file_too_large:"Arquivo muito grande",invalid_file:"Tipo de arquivo inválido",extracted:{assistant:"Assistente",anterior:"Anterior",siguiente:"Próximo",cerrar:"Fechar",cerrar_chat:"Fechar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver localização"},accessibility:{closeChat:"Fechar janela de chat",closeChatHint:"Pressione Escape para fechar",chatMessages:"Mensagens do chat",messageHistory:"Histórico de mensagens",dialogDescription:"Janela de chat com {{botName}}. Pressione Escape para fechar. Use Ctrl+Enter para enviar mensagens.",sendMessage:"Enviar mensagem",sendMessageHint:"Pressione Enter ou Ctrl+Enter para enviar",typeMessage:"Digite sua mensagem aqui",botMessage:"Mensagem do assistente",userMessage:"Sua mensagem",messageFrom:"Mensagem de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nova mensagem recebida"}},fr:{online:"En ligne",offline:"Déconnecté",connecting:"Connexion...",con_amor_paseo_libre:"Avec ❤️ par BotUyo",preview:"Aperçu",fotos:"Photos",ubicacion:"Emplacement",input_placeholder:"Tapez un message...",send:"Envoyer",attach_photo:"Joindre une photo",attach_location:"Partager la localisation",recording:"Enregistrement...",rate_limit_exceeded:"Vous avez envoyé trop de messages. Veuillez patienter.",connection_error:"Erreur de connexion",file_too_large:"Fichier trop volumineux",invalid_file:"Type de fichier invalide",extracted:{assistant:"Assistant",anterior:"Précédent",siguiente:"Suivant",cerrar:"Fermer",cerrar_chat:"Fermer le chat",abrir_chat:"Ouvrir le chat",ver_ubicacion:"Voir l'emplacement"},accessibility:{closeChat:"Fermer la fenêtre de chat",closeChatHint:"Appuyez sur Échap pour fermer",chatMessages:"Messages du chat",messageHistory:"Historique des messages",dialogDescription:"Fenêtre de chat avec {{botName}}. Appuyez sur Échap pour fermer. Utilisez Ctrl+Entrée pour envoyer des messages.",sendMessage:"Envoyer un message",sendMessageHint:"Appuyez sur Entrée ou Ctrl+Entrée pour envoyer",typeMessage:"Tapez votre message ici",botMessage:"Message de l'assistant",userMessage:"Votre message",messageFrom:"Message de {{sender}}",messageTime:"Envoyé {{time}}",newMessage:"Nouveau message reçu"}}};function k(){if("undefined"==typeof navigator)return"es";const e=navigator.language.split("-")[0];return w[e]?e:"es"}const C=r(void 0),N="botuyo-chat-locale";function M({children:e,defaultLocale:t}){const[r,o]=n(()=>{if(t)return t;if("undefined"!=typeof window){const e=localStorage.getItem(N);if(e)return e}return k()});return s(()=>{if("undefined"==typeof window||t)return;const e=()=>{localStorage.getItem(N)||o(k())};return window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e)},[t]),/* @__PURE__ */p(C.Provider,{value:{locale:r,setLocale:e=>{["es","en","pt","fr"].includes(e)?(o(e),"undefined"!=typeof window&&localStorage.setItem(N,e)):console.warn(`[BotUyo] Locale "${e}" no es soportado. Manteniendo "${r}"`)}},children:e})}function z(){const e=o(C);if(void 0===e)throw new Error("useLanguage debe usarse dentro de un LanguageProvider");return e}function S(e){const{locale:t,setLocale:r}=z();return{t:a(r=>{var o,n;return(o=w[t],(n=e?`${e}.${r}`:r).split(".").reduce((e,t)=>e?.[t],o)||n)||r},[t,e]),setLocale:r,currentLocale:t}}const E=(...e)=>e.filter((e,t,r)=>Boolean(e)&&r.indexOf(e)===t).join(" ");var j={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const A=i(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:s,iconNode:a,...i},c)=>l("svg",{ref:c,...j,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:E("lucide",n),...i},[...a.map(([e,t])=>l(e,t)),...Array.isArray(s)?s:[s]])),_=(e,t)=>{const r=i(({className:r,...o},n)=>{return l(A,{ref:n,iconNode:t,className:E(`lucide-${s=e,s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,r),...o});var s});return r.displayName=`${e}`,r},I=_("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),F=_("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),$=_("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),L=_("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),T=_("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),O=_("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),D=_("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),P=_("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),U=_("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]),W=_("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),R=_("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),V=_("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),B=_("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]),H=_("MicOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),q=_("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),G=_("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]),K=_("PhoneOff",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]),Z=_("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]),Y=_("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),J=_("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),X=_("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),Q=_("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]),ee=_("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),te=_("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),re=_("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]),oe=_("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ne=_("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function se(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=se(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const ae=(e=/* @__PURE__ */new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),ie="-",le=[],ce=e=>{const t=me(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return ue(e);const r=e.split(ie),o=""===r[0]&&r.length>1?1:0;return de(r,o,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=o[e],n=r[e];return t?n?((e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r})(n,t):t:n||le}return r[e]||le}}},de=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const o=e[t],n=r.nextPart.get(o);if(n){const r=de(e,t+1,n);if(r)return r}const s=r.validators;if(null===s)return;const a=0===t?e.join(ie):e.slice(t).join(ie),i=s.length;for(let l=0;l<i;l++){const e=s[l];if(e.validator(a))return e.classGroupId}},ue=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?"arbitrary.."+o:void 0})(),me=e=>{const{theme:t,classGroups:r}=e;return he(r,t)},he=(e,t)=>{const r=ae();for(const o in e){const n=e[o];pe(n,r,o,t)}return r},pe=(e,t,r,o)=>{const n=e.length;for(let s=0;s<n;s++){const n=e[s];ge(n,t,r,o)}},ge=(e,t,r,o)=>{"string"!=typeof e?"function"!=typeof e?xe(e,t,r,o):be(e,t,r,o):fe(e,t,r)},fe=(e,t,r)=>{(""===e?t:ve(t,e)).classGroupId=r},be=(e,t,r,o)=>{ye(e)?pe(e(o),t,r,o):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},xe=(e,t,r,o)=>{const n=Object.entries(e),s=n.length;for(let a=0;a<s;a++){const[e,s]=n[a];pe(s,ve(t,e),r,o)}},ve=(e,t)=>{let r=e;const o=t.split(ie),n=o.length;for(let s=0;s<n;s++){const e=o[s];let t=r.nextPart.get(e);t||(t=ae(),r.nextPart.set(e,t)),r=t}return r},ye=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,we=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=/* @__PURE__ */Object.create(null),o=/* @__PURE__ */Object.create(null);const n=(n,s)=>{r[n]=s,t++,t>e&&(t=0,o=r,r=/* @__PURE__ */Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=o[e])?(n(e,t),t):void 0},set(e,t){e in r?r[e]=t:n(e,t)}}},ke=[],Ce=(e,t,r,o,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:n}),Ne=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=e=>{const t=[];let r,o=0,n=0,s=0;const a=e.length;for(let d=0;d<a;d++){const a=e[d];if(0===o&&0===n){if(":"===a){t.push(e.slice(s,d)),s=d+1;continue}if("/"===a){r=d;continue}}"["===a?o++:"]"===a?o--:"("===a?n++:")"===a&&n--}const i=0===t.length?e:e.slice(s);let l=i,c=!1;return i.endsWith("!")?(l=i.slice(0,-1),c=!0):i.startsWith("!")&&(l=i.slice(1),c=!0),Ce(t,c,l,r&&r>s?r-s:void 0)};if(t){const e=t+":",r=o;o=t=>t.startsWith(e)?r(t.slice(e.length)):Ce(ke,!1,t,void 0,!0)}if(r){const e=o;o=t=>r({className:t,parseClassName:e})}return o},Me=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let o=[];for(let n=0;n<e.length;n++){const s=e[n],a="["===s[0],i=t.has(s);a||i?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},ze=/\s+/,Se=e=>{if("string"==typeof e)return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Se(e[o]))&&(r&&(r+=" "),r+=t);return r},Ee=[],je=e=>{const t=t=>t[e]||Ee;return t.isThemeGetter=!0,t},Ae=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_e=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ie=/^\d+\/\d+$/,Fe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$e=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Le=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Te=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Oe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,De=e=>Ie.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),Ue=e=>!!e&&Number.isInteger(Number(e)),We=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),Re=e=>Fe.test(e),Ve=()=>!0,Be=e=>$e.test(e)&&!Le.test(e),He=()=>!1,qe=e=>Te.test(e),Ge=e=>Oe.test(e),Ke=e=>!Ye(e)&&!rt(e),Ze=e=>ct(e,ht,He),Ye=e=>Ae.test(e),Je=e=>ct(e,pt,Be),Xe=e=>ct(e,gt,Pe),Qe=e=>ct(e,ut,He),et=e=>ct(e,mt,Ge),tt=e=>ct(e,bt,qe),rt=e=>_e.test(e),ot=e=>dt(e,pt),nt=e=>dt(e,ft),st=e=>dt(e,ut),at=e=>dt(e,ht),it=e=>dt(e,mt),lt=e=>dt(e,bt,!0),ct=(e,t,r)=>{const o=Ae.exec(e);return!!o&&(o[1]?t(o[1]):r(o[2]))},dt=(e,t,r=!1)=>{const o=_e.exec(e);return!!o&&(o[1]?t(o[1]):r)},ut=e=>"position"===e||"percentage"===e,mt=e=>"image"===e||"url"===e,ht=e=>"length"===e||"size"===e||"bg-size"===e,pt=e=>"length"===e,gt=e=>"number"===e,ft=e=>"family-name"===e,bt=e=>"shadow"===e,xt=/* @__PURE__ */((e,...t)=>{let r,o,n,s;const a=e=>{const t=o(e);if(t)return t;const s=((e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n,sortModifiers:s}=t,a=[],i=e.trim().split(ze);let l="";for(let c=i.length-1;c>=0;c-=1){const e=i[c],{isExternal:t,modifiers:d,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:h}=r(e);if(t){l=e+(l.length>0?" "+l:l);continue}let p=!!h,g=o(p?m.substring(0,h):m);if(!g){if(!p){l=e+(l.length>0?" "+l:l);continue}if(g=o(m),!g){l=e+(l.length>0?" "+l:l);continue}p=!1}const f=0===d.length?"":1===d.length?d[0]:s(d).join(":"),b=u?f+"!":f,x=b+g;if(a.indexOf(x)>-1)continue;a.push(x);const v=n(g,p);for(let r=0;r<v.length;++r){const e=v[r];a.push(b+e)}l=e+(l.length>0?" "+l:l)}return l})(e,r);return n(e,s),s};return s=i=>{const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:we(e.cacheSize),parseClassName:Ne(e),sortModifiers:Me(e),...ce(e)}))(l),o=r.cache.get,n=r.cache.set,s=a,a(i)},(...e)=>s(((...e)=>{let t,r,o=0,n="";for(;o<e.length;)(t=e[o++])&&(r=Se(t))&&(n&&(n+=" "),n+=r);return n})(...e))})(()=>{const e=je("color"),t=je("font"),r=je("text"),o=je("font-weight"),n=je("tracking"),s=je("leading"),a=je("breakpoint"),i=je("container"),l=je("spacing"),c=je("radius"),d=je("shadow"),u=je("inset-shadow"),m=je("text-shadow"),h=je("drop-shadow"),p=je("blur"),g=je("perspective"),f=je("aspect"),b=je("ease"),x=je("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",rt,Ye],y=()=>[rt,Ye,l],w=()=>[De,"full","auto",...y()],k=()=>[Ue,"none","subgrid",rt,Ye],C=()=>["auto",{span:["full",Ue,rt,Ye]},Ue,rt,Ye],N=()=>[Ue,"auto",rt,Ye],M=()=>["auto","min","max","fr",rt,Ye],z=()=>["auto",...y()],S=()=>[De,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],E=()=>[e,rt,Ye],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",st,Qe,{position:[rt,Ye]}],A=()=>["auto","cover","contain",at,Ze,{size:[rt,Ye]}],_=()=>[We,ot,Je],I=()=>["","none","full",c,rt,Ye],F=()=>["",Pe,ot,Je],$=()=>[Pe,We,st,Qe],L=()=>["","none",p,rt,Ye],T=()=>["none",Pe,rt,Ye],O=()=>["none",Pe,rt,Ye],D=()=>[Pe,rt,Ye],P=()=>[De,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Re],breakpoint:[Re],color:[Ve],container:[Re],"drop-shadow":[Re],ease:["in","out","in-out"],font:[Ke],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Re],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Re],shadow:[Re],spacing:["px",Pe],text:[Re],"text-shadow":[Re],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",De,Ye,rt,f]}],container:["container"],columns:[{columns:[Pe,Ye,rt,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[Ue,"auto",rt,Ye]}],basis:[{basis:[De,"full","auto",i,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,De,"auto","initial","none",Ye]}],grow:[{grow:["",Pe,rt,Ye]}],shrink:[{shrink:["",Pe,rt,Ye]}],order:[{order:[Ue,"first","last","none",rt,Ye]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:C()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:C()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[i,"screen",...S()]}],"min-w":[{"min-w":[i,"screen","none",...S()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",r,ot,Je]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,rt,Xe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",We,Ye]}],"font-family":[{font:[nt,Ye,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,rt,Ye]}],"line-clamp":[{"line-clamp":[Pe,"none",rt,Xe]}],leading:[{leading:[s,...y()]}],"list-image":[{"list-image":["none",rt,Ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",rt,Ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",rt,Je]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[Pe,"auto",rt,Ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",rt,Ye]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",rt,Ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ue,rt,Ye],radial:["",rt,Ye],conic:[Ue,rt,Ye]},it,et]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,rt,Ye]}],"outline-w":[{outline:["",Pe,ot,Je]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",d,lt,tt]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",u,lt,tt]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[Pe,Je]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",m,lt,tt]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[Pe,rt,Ye]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[rt,Ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",rt,Ye]}],filter:[{filter:["","none",rt,Ye]}],blur:[{blur:L()}],brightness:[{brightness:[Pe,rt,Ye]}],contrast:[{contrast:[Pe,rt,Ye]}],"drop-shadow":[{"drop-shadow":["","none",h,lt,tt]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",Pe,rt,Ye]}],"hue-rotate":[{"hue-rotate":[Pe,rt,Ye]}],invert:[{invert:["",Pe,rt,Ye]}],saturate:[{saturate:[Pe,rt,Ye]}],sepia:[{sepia:["",Pe,rt,Ye]}],"backdrop-filter":[{"backdrop-filter":["","none",rt,Ye]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,rt,Ye]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,rt,Ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,rt,Ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,rt,Ye]}],"backdrop-invert":[{"backdrop-invert":["",Pe,rt,Ye]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,rt,Ye]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,rt,Ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,rt,Ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",rt,Ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",rt,Ye]}],ease:[{ease:["linear","initial",b,rt,Ye]}],delay:[{delay:[Pe,rt,Ye]}],animate:[{animate:["none",x,rt,Ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,rt,Ye]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:T()}],"rotate-x":[{"rotate-x":T()}],"rotate-y":[{"rotate-y":T()}],"rotate-z":[{"rotate-z":T()}],scale:[{scale:O()}],"scale-x":[{"scale-x":O()}],"scale-y":[{"scale-y":O()}],"scale-z":[{"scale-z":O()}],"scale-3d":["scale-3d"],skew:[{skew:D()}],"skew-x":[{"skew-x":D()}],"skew-y":[{"skew-y":D()}],transform:[{transform:[rt,Ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:P()}],"translate-x":[{"translate-x":P()}],"translate-y":[{"translate-y":P()}],"translate-z":[{"translate-z":P()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",rt,Ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",rt,Ye]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[Pe,ot,Je,Xe]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function vt(...e){return xt(function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=se(e))&&(o&&(o+=" "),o+=t);return o}(e))}const yt={background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%",cardForeground:"240 10% 3.9%",primary:"160 84% 39%",primaryForeground:"0 0% 100%",muted:"240 4.8% 95.9%",mutedForeground:"240 3.8% 46.1%",border:"240 5.9% 90%",destructive:"0 84.2% 60.2%",radius:"0.5rem",spacing1:"0.25rem",spacing2:"0.5rem",spacing3:"0.75rem",spacing4:"1rem",spacing5:"0.75rem",spacing6:"1.5rem",spacing8:"2rem"},wt="hsl(160, 84%, 39%)";function kt(e,t){const r={...yt,...t?.cssVariables||{},...e?.cssVariables||{}};return{primaryColor:e?.primaryColor||t?.primaryColor||wt,botName:e?.botName||t?.botName||"Asistente",logoUrl:e?.logoUrl||t?.logoUrl||"",position:e?.position||t?.position||"bottom-right",welcomeMessage:e?.welcomeMessage||t?.welcomeMessage||"¡Hola! ¿En qué puedo ayudarte?",inputPlaceholder:e?.inputPlaceholder||t?.inputPlaceholder||"Escribe un mensaje...",cssVariables:r}}function Ct(e){return e.primaryColor||wt}const Nt={enabled:!0,messageEntry:"spring",typingIndicator:"wave",buttonEffects:!0,smoothScroll:!0,speedMultiplier:1,staggerDelay:50,windowTransitions:!0,launcherPulse:!0},Mt={glassmorphism:!0,gradients:!0,softShadows:!0,glowEffects:!0,particles:!1,soundEffects:!1,hapticFeedback:!0,shimmerLoading:!0,hoverLift:!0},zt=r(Nt),St=r(Mt);function Et({children:e,animations:t,effects:r}){const o=c(()=>({...Nt,...t}),[t]),n=c(()=>({...Mt,...r}),[r]);/* @__PURE__ */
|
|
2
|
-
return p(zt.Provider,{value:o,children:/* @__PURE__ */p(St.Provider,{value:n,children:e})})}function jt(){return o(zt)}function At(){const e=o(St);return{getGlassClass:()=>e.glassmorphism?"backdrop-blur-md bg-white/80 dark:bg-black/80":"",getShadowClass:()=>e.softShadows?"shadow-soft-xl":"shadow-md",getGlowClass:()=>e.glowEffects?"hover:shadow-primary/20":"",getHoverLiftClass:()=>e.hoverLift?"hover:-translate-y-1 hover:shadow-lg transition-all":"",getGradientClass:()=>e.gradients?"bg-gradient-to-br from-primary/10 to-transparent":"",getShimmerClass:()=>e.shimmerLoading?"animate-shimmer":"animate-pulse",triggerHaptic:()=>{e.hapticFeedback&&"vibrate"in navigator&&navigator.vibrate(10)},playSound:t=>{e.soundEffects&&console.log(`[Sound] ${t}`)},triggerParticles:t=>{e.particles&&console.log("[Particles] triggered on",t)}}}function _t(){return"undefined"!=typeof window&&!!window.DEBUG}const It={log:(e,...t)=>{_t()&&console.log(`[BotUyo] ${e}`,...t)},warn:(e,...t)=>{_t()&&console.warn(`[BotUyo] ${e}`,...t)},error:(e,...t)=>{console.error(`[BotUyo] ${e}`,...t)},debug:(e,...t)=>{_t()},info:(e,...t)=>{_t()&&console.info(`[BotUyo] ${e}`,...t)}},Ft=`data:image/svg+xml,${encodeURIComponent('\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">\n <defs>\n <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">\n <stop offset="0%" style="stop-color:#10b981"/>\n <stop offset="100%" style="stop-color:#059669"/>\n </linearGradient>\n </defs>\n <circle cx="32" cy="32" r="32" fill="url(#bg)"/>\n <rect x="16" y="20" width="32" height="24" rx="4" fill="white"/>\n <circle cx="24" cy="30" r="3" fill="#10b981"/>\n <circle cx="40" cy="30" r="3" fill="#10b981"/>\n <rect x="22" y="36" width="20" height="3" rx="1.5" fill="#10b981"/>\n <rect x="28" y="12" width="8" height="8" rx="2" fill="white"/>\n</svg>\n')}`,$t=function(){const e=Math.floor(1200),t=2*e,r=44+t,o=new ArrayBuffer(r),n=new DataView(o);Lt(n,0,"RIFF"),n.setUint32(4,r-8,!0),Lt(n,8,"WAVE"),Lt(n,12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,8e3,!0),n.setUint32(28,16e3,!0),n.setUint16(32,2,!0),n.setUint16(34,16,!0),Lt(n,36,"data"),n.setUint32(40,t,!0);for(let i=0;i<e;i++){const t=i/8e3,r=1-i/e,o=Math.sin(2*Math.PI*880*t)*r*.5*32767;n.setInt16(44+2*i,o,!0)}const s=new Uint8Array(o);let a="";for(let i=0;i<s.length;i++)a+=String.fromCharCode(s[i]);return`data:audio/wav;base64,${btoa(a)}`}();function Lt(e,t,r){for(let o=0;o<r.length;o++)e.setUint8(t+o,r.charCodeAt(o))}function Tt(e,t,r){let o,n=r.initialDeps??[],s=!0;function a(){var a,i,l;let c;r.key&&(null==(a=r.debug)?void 0:a.call(r))&&(c=Date.now());const d=e();if(d.length===n.length&&!d.some((e,t)=>n[t]!==e))return o;let u;if(n=d,r.key&&(null==(i=r.debug)?void 0:i.call(r))&&(u=Date.now()),o=t(...d),r.key&&(null==(l=r.debug)?void 0:l.call(r))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-u))/100,o=t/16,n=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${n(t,5)} /${n(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==r?void 0:r.key)}return!(null==r?void 0:r.onChange)||s&&r.skipInitialOnChange||r.onChange(o),s=!1,o}return a.updateDeps=e=>{n=e},a}function Ot(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const Dt=(e,t,r)=>{let o;return function(...n){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,n),r)}},Pt=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},Ut=e=>e,Wt=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let n=t;n<=r;n++)o.push(n);return o},Rt=(e,t)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const n=e=>{const{width:r,height:o}=e;t({width:Math.round(r),height:Math.round(o)})};if(n(Pt(r)),!o.ResizeObserver)return()=>{};const s=new o.ResizeObserver(t=>{const o=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void n({width:t.inlineSize,height:t.blockSize})}n(Pt(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return s.observe(r,{box:"border-box"}),()=>{s.unobserve(r)}},Vt={passive:!0},Bt="undefined"==typeof window||"onscrollend"in window,Ht=(e,t)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;let n=0;const s=e.options.useScrollendEvent&&Bt?()=>{}:Dt(o,()=>{t(n,!1)},e.options.isScrollingResetDelay),a=o=>()=>{const{horizontal:a,isRtl:i}=e.options;n=a?r.scrollLeft*(i?-1:1):r.scrollTop,s(),t(n,o)},i=a(!0),l=a(!1);r.addEventListener("scroll",i,Vt);const c=e.options.useScrollendEvent&&Bt;return c&&r.addEventListener("scrollend",l,Vt),()=>{r.removeEventListener("scroll",i),c&&r.removeEventListener("scrollend",l)}},qt=(e,t,r)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},Gt=(e,{adjustments:t=0,behavior:r},o)=>{var n,s;const a=e+t;null==(s=null==(n=o.scrollElement)?void 0:n.scrollTo)||s.call(n,{[o.options.horizontal?"left":"top"]:a,behavior:r})};class Kt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=/* @__PURE__ */new Map,this.laneAssignments=/* @__PURE__ */new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=/* @__PURE__ */new Map,this.observer=/* @__PURE__ */(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var r;null==(r=t())||r.disconnect(),e=null},observe:e=>{var r;return null==(r=t())?void 0:r.observe(e,{box:"border-box"})},unobserve:e=>{var r;return null==(r=t())?void 0:r.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,r])=>{void 0===r&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ut,rangeExtractor:Wt,onChange:()=>{},measureElement:qt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,r;null==(r=(t=this.options).onChange)||r.call(t,this,e)},this.maybeNotify=Tt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const r=/* @__PURE__ */new Map,o=/* @__PURE__ */new Map;for(let n=t-1;n>=0;n--){const t=e[n];if(r.has(t.lane))continue;const s=o.get(t.lane);if(null==s||t.end>s.end?o.set(t.lane,t):t.end<s.end&&r.set(t.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=Tt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,r,o,n,s)=>(void 0!==this.prevLanes&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:r,getItemKey:o,enabled:n,lanes:s}),{key:!1}),this.getMeasurements=Tt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:r,getItemKey:o,enabled:n,lanes:s},a)=>{if(!n)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const d of this.laneAssignments.keys())d>=e&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const i=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const l=this.measurementsCache.slice(0,i),c=new Array(s).fill(void 0);for(let d=0;d<i;d++){const e=l[d];e&&(c[e.lane]=d)}for(let d=i;d<e;d++){const e=o(d),n=this.laneAssignments.get(d);let s,i;if(void 0!==n&&this.options.lanes>1){s=n;const e=c[s],o=void 0!==e?l[e]:void 0;i=o?o.end+this.options.gap:t+r}else{const e=1===this.options.lanes?l[d-1]:this.getFurthestMeasurement(l,d);i=e?e.end+this.options.gap:t+r,s=e?e.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,s)}const u=a.get(e),m="number"==typeof u?u:this.options.estimateSize(d),h=i+m;l[d]={index:d,start:i,size:m,end:h,key:e,lane:s},c[s]=d}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Tt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,r,o)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:r,lanes:o}){const n=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:n};let s=Zt(0,n,t=>e[t].start,r),a=s;if(1===o)for(;a<n&&e[a].end<r+t;)a++;else if(o>1){const i=Array(o).fill(0);for(;a<n&&i.some(e=>e<r+t);){const t=e[a];i[t.lane]=t.end,a++}const l=Array(o).fill(r+t);for(;s>=0&&l.some(e=>e>=r);){const t=e[s];l[t.lane]=t.start,s--}s=Math.max(0,s-s%o),a=Math.min(n,a+(o-1-a%o))}return{startIndex:s,endIndex:a}}({measurements:e,outerSize:t,scrollOffset:r,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Tt(()=>{let e=null,t=null;const r=this.calculateRange();return r&&(e=r.startIndex,t=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,r,o,n)=>null===o||null===n?[]:e({startIndex:o,endIndex:n,overscan:t,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,r=e.getAttribute(t);return r?parseInt(r,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const r=this.indexFromElement(e),o=this.measurementsCache[r];if(!o)return;const n=o.key,s=this.elementsCache.get(n);s!==e&&(s&&this.observer.unobserve(s),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&this.resizeItem(r,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const r=this.measurementsCache[e];if(!r)return;const o=t-(this.itemSizeCache.get(r.key)??r.size);0!==o&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=Tt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const r=[];for(let o=0,n=e.length;o<n;o++){const n=t[e[o]];r.push(n)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return Ot(t[Zt(0,t.length-1,e=>Ot(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,r=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),n=this.getScrollOffset();"auto"===t&&(t=e>=n+o?"end":"start"),"center"===t?e+=(r-o)/2:"end"===t&&(e-=o);const s=this.getMaxScrollOffset();return Math.max(Math.min(s,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const r=this.measurementsCache[e];if(!r)return;const o=this.getSize(),n=this.getScrollOffset();if("auto"===t)if(r.end>=n+o-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=n+this.options.scrollPaddingStart))return[n,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const s="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,t,r.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:r}={})=>{"smooth"===r&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:r})},this.scrollToIndex=(e,{align:t="auto",behavior:r}={})=>{"smooth"===r&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let o=0;const n=t=>{if(!this.targetWindow)return;const o=this.getOffsetForIndex(e,t);if(!o)return void console.warn("Failed to get offset for index:",e);const[n,a]=o;this._scrollToOffset(n,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const t=()=>{if(this.currentScrollToIndex!==e)return;const t=this.getScrollOffset(),r=this.getOffsetForIndex(e,a);var o,n;r?(o=r[0],n=t,Math.abs(o-n)<1.01||s(a)):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},s=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(o++,o<10?this.targetWindow.requestAnimationFrame(()=>n(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};n(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let r;if(0===t.length)r=this.options.paddingStart;else if(1===this.options.lanes)r=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let o=t.length-1;for(;o>=0&&e.some(e=>null===e);){const r=t[o];null===e[r.lane]&&(e[r.lane]=r.end),o--}r=Math.max(...e.filter(e=>null!==e))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:r})=>{this.options.scrollToFn(e,{behavior:r,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=/* @__PURE__ */new Map,this.laneAssignments=/* @__PURE__ */new Map,this.notify(!1)},this.setOptions(e)}}const Zt=(e,t,r,o)=>{for(;e<=t;){const n=(e+t)/2|0,s=r(n);if(s<o)e=n+1;else{if(!(s>o))return n;t=n-1}}return e>0?e-1:0},Yt="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;const Jt=d(()=>import("./chunk-audio-CDtwQRaH.js").then(e=>({default:e.AudioPlayer}))),Xt=d(()=>import("./chunk-gallery-IPj0rIQn.js").then(e=>({default:e.Gallery}))),Qt=u(function({message:e,primaryColor:t,botAvatar:r,botName:n="Mar",avatars:s,isFirst:a=!0,isLast:i=!0,index:l=0}){const{t:d}=S("extracted"),u="user"===e.sender,h="system"===e.type||"system"===e.sender,f=!u&&!h,b=Ct({primaryColor:t}),w=function(){const e=o(zt);return e.enabled&&"none"!==e.messageEntry?{slide:"animate-message-slide",fade:"animate-message-fade",scale:"animate-message-scale",spring:"animate-message-spring"}[e.messageEntry]||"animate-message-spring":""}(),k=c(()=>{if(u)return null;if("text"===e.type){const t=e;if(t.emotion&&s?.[t.emotion])return s[t.emotion]}return r},[e,s,r,u]),C=({href:e,children:t})=>{if(!e)return null;const r=String(t).toLowerCase(),o=r.includes("reservar")||r.includes("ver")||r.includes("pagar");return e.includes("maps.google")||e.includes("goo.gl")?/* @__PURE__ */p("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"block my-2 no-underline group",children:/* @__PURE__ */g("span",{className:"flex items-center gap-3 p-3 border rounded-xl shadow-sm group-hover:border-primary/30 transition-all",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:[
|
|
2
|
+
return p(zt.Provider,{value:o,children:/* @__PURE__ */p(St.Provider,{value:n,children:e})})}function jt(){return o(zt)}function At(){const e=o(St);return{getGlassClass:()=>e.glassmorphism?"backdrop-blur-md bg-white/80 dark:bg-black/80":"",getShadowClass:()=>e.softShadows?"shadow-soft-xl":"shadow-md",getGlowClass:()=>e.glowEffects?"hover:shadow-primary/20":"",getHoverLiftClass:()=>e.hoverLift?"hover:-translate-y-1 hover:shadow-lg transition-all":"",getGradientClass:()=>e.gradients?"bg-gradient-to-br from-primary/10 to-transparent":"",getShimmerClass:()=>e.shimmerLoading?"animate-shimmer":"animate-pulse",triggerHaptic:()=>{e.hapticFeedback&&"vibrate"in navigator&&navigator.vibrate(10)},playSound:t=>{e.soundEffects&&console.log(`[Sound] ${t}`)},triggerParticles:t=>{e.particles&&console.log("[Particles] triggered on",t)}}}function _t(){return"undefined"!=typeof window&&!!window.DEBUG}const It={log:(e,...t)=>{_t()&&console.log(`[BotUyo] ${e}`,...t)},warn:(e,...t)=>{_t()&&console.warn(`[BotUyo] ${e}`,...t)},error:(e,...t)=>{console.error(`[BotUyo] ${e}`,...t)},debug:(e,...t)=>{_t()},info:(e,...t)=>{_t()&&console.info(`[BotUyo] ${e}`,...t)}},Ft=`data:image/svg+xml,${encodeURIComponent('\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">\n <defs>\n <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">\n <stop offset="0%" style="stop-color:#10b981"/>\n <stop offset="100%" style="stop-color:#059669"/>\n </linearGradient>\n </defs>\n <circle cx="32" cy="32" r="32" fill="url(#bg)"/>\n <rect x="16" y="20" width="32" height="24" rx="4" fill="white"/>\n <circle cx="24" cy="30" r="3" fill="#10b981"/>\n <circle cx="40" cy="30" r="3" fill="#10b981"/>\n <rect x="22" y="36" width="20" height="3" rx="1.5" fill="#10b981"/>\n <rect x="28" y="12" width="8" height="8" rx="2" fill="white"/>\n</svg>\n')}`,$t=function(){const e=Math.floor(1200),t=2*e,r=44+t,o=new ArrayBuffer(r),n=new DataView(o);Lt(n,0,"RIFF"),n.setUint32(4,r-8,!0),Lt(n,8,"WAVE"),Lt(n,12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,8e3,!0),n.setUint32(28,16e3,!0),n.setUint16(32,2,!0),n.setUint16(34,16,!0),Lt(n,36,"data"),n.setUint32(40,t,!0);for(let i=0;i<e;i++){const t=i/8e3,r=1-i/e,o=Math.sin(2*Math.PI*880*t)*r*.5*32767;n.setInt16(44+2*i,o,!0)}const s=new Uint8Array(o);let a="";for(let i=0;i<s.length;i++)a+=String.fromCharCode(s[i]);return`data:audio/wav;base64,${btoa(a)}`}();function Lt(e,t,r){for(let o=0;o<r.length;o++)e.setUint8(t+o,r.charCodeAt(o))}function Tt(e,t,r){let o,n=r.initialDeps??[],s=!0;function a(){var a,i,l;let c;r.key&&(null==(a=r.debug)?void 0:a.call(r))&&(c=Date.now());const d=e();if(d.length===n.length&&!d.some((e,t)=>n[t]!==e))return o;let u;if(n=d,r.key&&(null==(i=r.debug)?void 0:i.call(r))&&(u=Date.now()),o=t(...d),r.key&&(null==(l=r.debug)?void 0:l.call(r))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-u))/100,o=t/16,n=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${n(t,5)} /${n(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==r?void 0:r.key)}return!(null==r?void 0:r.onChange)||s&&r.skipInitialOnChange||r.onChange(o),s=!1,o}return a.updateDeps=e=>{n=e},a}function Ot(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const Dt=(e,t,r)=>{let o;return function(...n){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,n),r)}},Pt=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},Ut=e=>e,Wt=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let n=t;n<=r;n++)o.push(n);return o},Rt=(e,t)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const n=e=>{const{width:r,height:o}=e;t({width:Math.round(r),height:Math.round(o)})};if(n(Pt(r)),!o.ResizeObserver)return()=>{};const s=new o.ResizeObserver(t=>{const o=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void n({width:t.inlineSize,height:t.blockSize})}n(Pt(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return s.observe(r,{box:"border-box"}),()=>{s.unobserve(r)}},Vt={passive:!0},Bt="undefined"==typeof window||"onscrollend"in window,Ht=(e,t)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;let n=0;const s=e.options.useScrollendEvent&&Bt?()=>{}:Dt(o,()=>{t(n,!1)},e.options.isScrollingResetDelay),a=o=>()=>{const{horizontal:a,isRtl:i}=e.options;n=a?r.scrollLeft*(i?-1:1):r.scrollTop,s(),t(n,o)},i=a(!0),l=a(!1);r.addEventListener("scroll",i,Vt);const c=e.options.useScrollendEvent&&Bt;return c&&r.addEventListener("scrollend",l,Vt),()=>{r.removeEventListener("scroll",i),c&&r.removeEventListener("scrollend",l)}},qt=(e,t,r)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},Gt=(e,{adjustments:t=0,behavior:r},o)=>{var n,s;const a=e+t;null==(s=null==(n=o.scrollElement)?void 0:n.scrollTo)||s.call(n,{[o.options.horizontal?"left":"top"]:a,behavior:r})};class Kt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=/* @__PURE__ */new Map,this.laneAssignments=/* @__PURE__ */new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=/* @__PURE__ */new Map,this.observer=/* @__PURE__ */(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var r;null==(r=t())||r.disconnect(),e=null},observe:e=>{var r;return null==(r=t())?void 0:r.observe(e,{box:"border-box"})},unobserve:e=>{var r;return null==(r=t())?void 0:r.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,r])=>{void 0===r&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ut,rangeExtractor:Wt,onChange:()=>{},measureElement:qt,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,r;null==(r=(t=this.options).onChange)||r.call(t,this,e)},this.maybeNotify=Tt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const r=/* @__PURE__ */new Map,o=/* @__PURE__ */new Map;for(let n=t-1;n>=0;n--){const t=e[n];if(r.has(t.lane))continue;const s=o.get(t.lane);if(null==s||t.end>s.end?o.set(t.lane,t):t.end<s.end&&r.set(t.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=Tt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,r,o,n,s)=>(void 0!==this.prevLanes&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:r,getItemKey:o,enabled:n,lanes:s}),{key:!1}),this.getMeasurements=Tt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:r,getItemKey:o,enabled:n,lanes:s},a)=>{if(!n)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const d of this.laneAssignments.keys())d>=e&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const i=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const l=this.measurementsCache.slice(0,i),c=new Array(s).fill(void 0);for(let d=0;d<i;d++){const e=l[d];e&&(c[e.lane]=d)}for(let d=i;d<e;d++){const e=o(d),n=this.laneAssignments.get(d);let s,i;if(void 0!==n&&this.options.lanes>1){s=n;const e=c[s],o=void 0!==e?l[e]:void 0;i=o?o.end+this.options.gap:t+r}else{const e=1===this.options.lanes?l[d-1]:this.getFurthestMeasurement(l,d);i=e?e.end+this.options.gap:t+r,s=e?e.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,s)}const u=a.get(e),m="number"==typeof u?u:this.options.estimateSize(d),h=i+m;l[d]={index:d,start:i,size:m,end:h,key:e,lane:s},c[s]=d}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Tt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,r,o)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:r,lanes:o}){const n=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:n};let s=Zt(0,n,t=>e[t].start,r),a=s;if(1===o)for(;a<n&&e[a].end<r+t;)a++;else if(o>1){const i=Array(o).fill(0);for(;a<n&&i.some(e=>e<r+t);){const t=e[a];i[t.lane]=t.end,a++}const l=Array(o).fill(r+t);for(;s>=0&&l.some(e=>e>=r);){const t=e[s];l[t.lane]=t.start,s--}s=Math.max(0,s-s%o),a=Math.min(n,a+(o-1-a%o))}return{startIndex:s,endIndex:a}}({measurements:e,outerSize:t,scrollOffset:r,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Tt(()=>{let e=null,t=null;const r=this.calculateRange();return r&&(e=r.startIndex,t=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,r,o,n)=>null===o||null===n?[]:e({startIndex:o,endIndex:n,overscan:t,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,r=e.getAttribute(t);return r?parseInt(r,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const r=this.indexFromElement(e),o=this.measurementsCache[r];if(!o)return;const n=o.key,s=this.elementsCache.get(n);s!==e&&(s&&this.observer.unobserve(s),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&this.resizeItem(r,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const r=this.measurementsCache[e];if(!r)return;const o=t-(this.itemSizeCache.get(r.key)??r.size);0!==o&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,o,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=Tt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const r=[];for(let o=0,n=e.length;o<n;o++){const n=t[e[o]];r.push(n)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return Ot(t[Zt(0,t.length-1,e=>Ot(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,r=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),n=this.getScrollOffset();"auto"===t&&(t=e>=n+o?"end":"start"),"center"===t?e+=(r-o)/2:"end"===t&&(e-=o);const s=this.getMaxScrollOffset();return Math.max(Math.min(s,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const r=this.measurementsCache[e];if(!r)return;const o=this.getSize(),n=this.getScrollOffset();if("auto"===t)if(r.end>=n+o-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=n+this.options.scrollPaddingStart))return[n,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const s="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,t,r.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:r}={})=>{"smooth"===r&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:r})},this.scrollToIndex=(e,{align:t="auto",behavior:r}={})=>{"smooth"===r&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let o=0;const n=t=>{if(!this.targetWindow)return;const o=this.getOffsetForIndex(e,t);if(!o)return void console.warn("Failed to get offset for index:",e);const[n,a]=o;this._scrollToOffset(n,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const t=()=>{if(this.currentScrollToIndex!==e)return;const t=this.getScrollOffset(),r=this.getOffsetForIndex(e,a);var o,n;r?(o=r[0],n=t,Math.abs(o-n)<1.01||s(a)):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},s=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(o++,o<10?this.targetWindow.requestAnimationFrame(()=>n(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};n(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let r;if(0===t.length)r=this.options.paddingStart;else if(1===this.options.lanes)r=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let o=t.length-1;for(;o>=0&&e.some(e=>null===e);){const r=t[o];null===e[r.lane]&&(e[r.lane]=r.end),o--}r=Math.max(...e.filter(e=>null!==e))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:r})=>{this.options.scrollToFn(e,{behavior:r,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=/* @__PURE__ */new Map,this.laneAssignments=/* @__PURE__ */new Map,this.notify(!1)},this.setOptions(e)}}const Zt=(e,t,r,o)=>{for(;e<=t;){const n=(e+t)/2|0,s=r(n);if(s<o)e=n+1;else{if(!(s>o))return n;t=n-1}}return e>0?e-1:0},Yt="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;const Jt=d(()=>import("./chunk-audio-C0i6pIL6.js").then(e=>({default:e.AudioPlayer}))),Xt=d(()=>import("./chunk-gallery-8F2X2Wky.js").then(e=>({default:e.Gallery}))),Qt=u(function({message:e,primaryColor:t,botAvatar:r,botName:n="Mar",avatars:s,isFirst:a=!0,isLast:i=!0,index:l=0}){const{t:d}=S("extracted"),u="user"===e.sender,h="system"===e.type||"system"===e.sender,f=!u&&!h,b=Ct({primaryColor:t}),w=function(){const e=o(zt);return e.enabled&&"none"!==e.messageEntry?{slide:"animate-message-slide",fade:"animate-message-fade",scale:"animate-message-scale",spring:"animate-message-spring"}[e.messageEntry]||"animate-message-spring":""}(),k=c(()=>{if(u)return null;if("text"===e.type){const t=e;if(t.emotion&&s?.[t.emotion])return s[t.emotion]}return r},[e,s,r,u]),C=({href:e,children:t})=>{if(!e)return null;const r=String(t).toLowerCase(),o=r.includes("reservar")||r.includes("ver")||r.includes("pagar");return e.includes("maps.google")||e.includes("goo.gl")?/* @__PURE__ */p("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"block my-2 no-underline group",children:/* @__PURE__ */g("span",{className:"flex items-center gap-3 p-3 border rounded-xl shadow-sm group-hover:border-primary/30 transition-all",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:[
|
|
3
3
|
/* @__PURE__ */p("span",{className:"flex-shrink-0 p-2 rounded-full",style:{backgroundColor:`${b}1a`,color:b},children:/* @__PURE__ */p(V,{size:16,strokeWidth:2.5})}),
|
|
4
4
|
/* @__PURE__ */p("span",{className:"flex flex-col min-w-0 flex-1 text-[11px] font-bold text-foreground leading-tight uppercase tracking-tight",children:d("ver_ubicacion")}),
|
|
5
5
|
/* @__PURE__ */p(D,{size:12,className:"text-muted-foreground/40 group-hover:text-primary"})]})}):o?/* @__PURE__ */g("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 mt-2 text-[11px] font-black w-full sm:w-auto rounded-xl shadow-md uppercase tracking-widest transition-transform active:scale-95 text-white",style:{backgroundColor:b},children:[t," ",
|
|
@@ -63,44 +63,44 @@ return g("div",{className:"relative",children:[(C||M)&&/* @__PURE__ */p("div",{c
|
|
|
63
63
|
/* @__PURE__ */g("span",{className:"text-destructive font-black text-[11px] tabular-nums",children:[Math.floor(w/60),":",(w%60).toString().padStart(2,"0")]})]}),
|
|
64
64
|
/* @__PURE__ */p("button",{onClick:()=>H(!0),className:"w-7 h-7 rounded-full bg-destructive flex items-center justify-center text-white shadow-lg",children:/* @__PURE__ */p(Q,{size:12,fill:"currentColor"})})]}:{className:"w-full relative flex items-center",children:[
|
|
65
65
|
/* @__PURE__ */p("textarea",{ref:A,rows:1,value:u,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey?"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),U()):(e.preventDefault(),U())},onChange:e=>{const t=e.target.value.slice(0,ar);m(t),A.current&&(A.current.style.height="40px",A.current.style.height=`${Math.min(A.current.scrollHeight,120)}px`)},onFocus:()=>x(!1),placeholder:t,"aria-label":d("accessibility.typeMessage"),"aria-describedby":"send-message-hint","aria-invalid":u.length>ar,disabled:!e,className:"w-full bg-transparent text-sm py-2.5 outline-none resize-none overflow-hidden leading-tight pr-8 scrollbar-none disabled:opacity-50",style:{scrollbarWidth:"none",msOverflowStyle:"none",color:"hsl(var(--foreground))"}}),
|
|
66
|
-
/* @__PURE__ */p("span",{id:"send-message-hint",className:"sr-only",children:d("accessibility.sendMessageHint")}),u.length>800&&/* @__PURE__ */p("span",{className:vt("absolute right-0 text-[9px] font-bold tabular-nums",u.length>=ar?"text-destructive":"text-muted-foreground/40"),children:ar-u.length})]})}),!v&&/* @__PURE__ */p(f,{children:u.trim()||C?/* @__PURE__ */p("button",{onClick:U,disabled:!e||M&&!!C,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:/* @__PURE__ */p(Q,{size:18,className:"text-white ml-0.5 fill-current"})}):O.enableAudio&&a?/* @__PURE__ */p("button",{onClick:async()=>{if(e)try{const e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);F.current=t,$.current=[],t.ondataavailable=e=>$.current.push(e.data),t.onstop=()=>{const e=new File([new Blob($.current)],"voice.webm",{type:"audio/webm"});a?.(e,"audio")},t.start(),y(!0),L.current=setInterval(()=>k(e=>e+1),1e3)}catch{alert("Micrófono denegado o no disponible")}},disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:/* @__PURE__ */p(q,{size:20,strokeWidth:2.5,className:"text-white"})}):/* @__PURE__ */p("button",{onClick:U,disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:/* @__PURE__ */p(Q,{size:18,className:"text-white ml-0.5 fill-current"})})})]})]})}function cr(e,t){let r=0,o=null;return function(...n){const s=Date.now(),a=s-r,i=()=>{r=s,e(...n)};a>=t?(o&&(clearTimeout(o),o=null),i()):o||(o=setTimeout(()=>{i(),o=null},t-a))}}function dr(e=640){const[t,r]=n(()=>"undefined"!=typeof window&&window.innerWidth<e);return s(()=>{const t=cr(()=>{r(window.innerWidth<e)},250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t}const ur="24px",mr={happy:"😊",wink:"😉",thinking:"🤔",sad:"😢",excited:"🤩",love:"❤️",laugh:"😄",surprised:"😲",angry:"😠",confused:"😕",sorry:"😔",default:"💬"},hr={idle:"Llamada de voz",connecting:"Conectando...",listening:"Escuchando...",thinking:"Pensando...",speaking:"Hablando..."};function
|
|
66
|
+
/* @__PURE__ */p("span",{id:"send-message-hint",className:"sr-only",children:d("accessibility.sendMessageHint")}),u.length>800&&/* @__PURE__ */p("span",{className:vt("absolute right-0 text-[9px] font-bold tabular-nums",u.length>=ar?"text-destructive":"text-muted-foreground/40"),children:ar-u.length})]})}),!v&&/* @__PURE__ */p(f,{children:u.trim()||C?/* @__PURE__ */p("button",{onClick:U,disabled:!e||M&&!!C,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:/* @__PURE__ */p(Q,{size:18,className:"text-white ml-0.5 fill-current"})}):O.enableAudio&&a?/* @__PURE__ */p("button",{onClick:async()=>{if(e)try{const e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);F.current=t,$.current=[],t.ondataavailable=e=>$.current.push(e.data),t.onstop=()=>{const e=new File([new Blob($.current)],"voice.webm",{type:"audio/webm"});a?.(e,"audio")},t.start(),y(!0),L.current=setInterval(()=>k(e=>e+1),1e3)}catch{alert("Micrófono denegado o no disponible")}},disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:/* @__PURE__ */p(q,{size:20,strokeWidth:2.5,className:"text-white"})}):/* @__PURE__ */p("button",{onClick:U,disabled:!e,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:T},children:/* @__PURE__ */p(Q,{size:18,className:"text-white ml-0.5 fill-current"})})})]})]})}function cr(e,t){let r=0,o=null;return function(...n){const s=Date.now(),a=s-r,i=()=>{r=s,e(...n)};a>=t?(o&&(clearTimeout(o),o=null),i()):o||(o=setTimeout(()=>{i(),o=null},t-a))}}function dr(e=640){const[t,r]=n(()=>"undefined"!=typeof window&&window.innerWidth<e);return s(()=>{const t=cr(()=>{r(window.innerWidth<e)},250);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t}const ur="24px",mr={happy:"😊",wink:"😉",thinking:"🤔",sad:"😢",excited:"🤩",love:"❤️",laugh:"😄",surprised:"😲",angry:"😠",confused:"😕",sorry:"😔",default:"💬"},hr={idle:"Llamada de voz",connecting:"Conectando...",listening:"Escuchando...",thinking:"Pensando...",speaking:"Hablando..."},pr=24e3;function gr({avatars:e,logoUrl:t,emotion:r,callState:o,audioLevel:n,config:s}){const a=e&&Object.keys(e).length>0,i=!!t,l=c(()=>a||i?a?e[r||"default"]||e.default||t||Ft:t||Ft:null,[a,i,e,r,t]),d="listening"===o||"speaking"===o,u="speaking"===o?s.speakingColor:"thinking"===o?s.thinkingColor:"listening"===o?s.listeningColor:"#ffffff20",m="speaking"===o?s.speakingScale:"thinking"===o?s.thinkingScale:1,h=s.orbSize;/* @__PURE__ */
|
|
67
67
|
return g("div",l?{className:"relative flex flex-col items-center gap-4",children:[
|
|
68
68
|
/* @__PURE__ */g("div",{className:vt("relative rounded-full flex items-center justify-center","transition-all duration-500 ease-out"),style:{width:`${h}px`,height:`${h}px`,boxShadow:d?`0 0 0 4px ${u}40, 0 0 30px ${u}30, 0 0 60px ${u}15`:`0 0 0 2px ${u}20`,transform:`scale(${m})`},children:[
|
|
69
|
-
/* @__PURE__ */p("img",{src:l,alt:"Bot avatar",className:vt("h-full w-full rounded-full object-cover","transition-all duration-300","thinking"===o&&"opacity-80"),style:{boxShadow:"listening"===o?`0 0 0 2px ${s.listeningColor}80`:"speaking"===o?`0 0 0 2px ${s.speakingColor}80`:"none"}}),s.showEmotionLabel&&r&&/* @__PURE__ */g("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 px-2 py-0.5 rounded-full bg-black/70 backdrop-blur-sm text-[10px] font-bold text-white whitespace-nowrap",children:[s.showEmojis&&(s.emotionEmojis[r]||"💬")," ",r]})]}),s.showWaveform&&/* @__PURE__ */p(
|
|
69
|
+
/* @__PURE__ */p("img",{src:l,alt:"Bot avatar",className:vt("h-full w-full rounded-full object-cover","transition-all duration-300","thinking"===o&&"opacity-80"),style:{boxShadow:"listening"===o?`0 0 0 2px ${s.listeningColor}80`:"speaking"===o?`0 0 0 2px ${s.speakingColor}80`:"none"}}),s.showEmotionLabel&&r&&/* @__PURE__ */g("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 px-2 py-0.5 rounded-full bg-black/70 backdrop-blur-sm text-[10px] font-bold text-white whitespace-nowrap",children:[s.showEmojis&&(s.emotionEmojis[r]||"💬")," ",r]})]}),s.showWaveform&&/* @__PURE__ */p(fr,{isActive:d,audioLevel:n,color:u})]}:{className:"relative flex flex-col items-center gap-6",children:[
|
|
70
70
|
/* @__PURE__ */g("div",{className:"relative",style:{width:`${h+48}px`,height:`${h+48}px`},children:[
|
|
71
71
|
/* @__PURE__ */p("div",{className:"absolute inset-0 rounded-full",style:{border:`1.5px solid ${u}20`,animation:d?"spin 8s linear infinite":"none"}}),
|
|
72
72
|
/* @__PURE__ */p("div",{className:"absolute rounded-full",style:{inset:"12px",border:`1px solid ${u}15`,animation:d?"spin 12s linear infinite reverse":"none"}}),
|
|
73
|
-
/* @__PURE__ */p("div",{className:"absolute rounded-full flex items-center justify-center",style:{inset:"24px",background:`radial-gradient(circle at 35% 35%, ${u}40, ${u}10 60%, transparent 80%)`,boxShadow:d?`0 0 60px ${u}35, 0 0 120px ${u}15, inset 0 0 40px ${u}10`:`0 0 30px ${u}15`,transform:`scale(${m})`,transition:"all 0.5s cubic-bezier(0.4, 0, 0.2, 1)"},children:/* @__PURE__ */p("div",{className:"rounded-full",style:{width:.35*h+"px",height:.35*h+"px",background:`radial-gradient(circle, ${u}90, ${u}40)`,boxShadow:`0 0 20px ${u}60`,animation:d?"pulse 2s ease-in-out infinite":"none"}})}),d&&[0,1,2].map(e=>/* @__PURE__ */p("div",{className:"absolute rounded-full",style:{width:"4px",height:"4px",backgroundColor:u,opacity:.6,top:"50%",left:"50%",transform:`rotate(${120*e+Date.now()/20%360}deg) translateX(${(h+48)/2}px)`,animation:`spin ${6+2*e}s linear infinite`,boxShadow:`0 0 6px ${u}`}},e))]}),s.showWaveform&&/* @__PURE__ */p(
|
|
73
|
+
/* @__PURE__ */p("div",{className:"absolute rounded-full flex items-center justify-center",style:{inset:"24px",background:`radial-gradient(circle at 35% 35%, ${u}40, ${u}10 60%, transparent 80%)`,boxShadow:d?`0 0 60px ${u}35, 0 0 120px ${u}15, inset 0 0 40px ${u}10`:`0 0 30px ${u}15`,transform:`scale(${m})`,transition:"all 0.5s cubic-bezier(0.4, 0, 0.2, 1)"},children:/* @__PURE__ */p("div",{className:"rounded-full",style:{width:.35*h+"px",height:.35*h+"px",background:`radial-gradient(circle, ${u}90, ${u}40)`,boxShadow:`0 0 20px ${u}60`,animation:d?"pulse 2s ease-in-out infinite":"none"}})}),d&&[0,1,2].map(e=>/* @__PURE__ */p("div",{className:"absolute rounded-full",style:{width:"4px",height:"4px",backgroundColor:u,opacity:.6,top:"50%",left:"50%",transform:`rotate(${120*e+Date.now()/20%360}deg) translateX(${(h+48)/2}px)`,animation:`spin ${6+2*e}s linear infinite`,boxShadow:`0 0 6px ${u}`}},e))]}),s.showWaveform&&/* @__PURE__ */p(fr,{isActive:d,audioLevel:n,color:u})]})}function fr({isActive:e,audioLevel:t,color:r}){/* @__PURE__ */
|
|
74
74
|
return p("div",{className:"flex items-center gap-[3px] h-10",children:Array.from({length:12}).map((o,n)=>{const s=Math.abs(n-5.5)/5.5,a=e?Math.max(4,40*t*(1-.5*s)*(.5+.5*Math.sin(Date.now()/100+.8*n))):4;/* @__PURE__ */
|
|
75
|
-
return p("div",{className:"rounded-full transition-all duration-100",style:{width:"3px",height:`${a}px`,backgroundColor:r,opacity:e?.7-.3*s:.2}},n)})})}function
|
|
75
|
+
return p("div",{className:"rounded-full transition-all duration-100",style:{width:"3px",height:`${a}px`,backgroundColor:r,opacity:e?.7-.3*s:.2}},n)})})}function br({isOpen:e,onClose:t,primaryColor:r="#10b981",getSocket:o,avatars:i,logoUrl:l,voiceConfig:d,onAddMessage:u}){const m=c(()=>function(e,t="#10b981"){return{backgroundColor:e?.backgroundColor??"#0a0a0a",listeningColor:e?.listeningColor??"#10b981",speakingColor:e?.speakingColor??t,thinkingColor:e?.thinkingColor??"#a855f7",showEmojis:e?.showEmojis??!0,showEmotionLabel:e?.showEmotionLabel??!0,showWaveform:e?.showWaveform??!0,showBadge:e?.showBadge??!1,badgeText:e?.badgeText??"",emotionEmojis:{...mr,...e?.emotionEmojis},statusLabels:{...hr,...e?.statusLabels},orbSize:e?.orbSize??128,speakingScale:e?.speakingScale??1.08,thinkingScale:e?.thinkingScale??.95}}(d,r),[d,r]),[b,x]=n("idle"),[v,y]=n(0),[w,k]=n(!1),[C,N]=n(0),[M,z]=n(null),[S,E]=n([]),j=h(null),A=h(null),_=h(null),I=h(null),F=h(null),$=h(0),L=h(!1),T=h(null),O=h(null),D=h(null),P=h([]),U=h(!1),W=h(0),R=h([]),V=a(e=>`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`,[]),B=a(()=>{if(0===P.current.length)return;D.current&&"closed"!==D.current.state||(D.current=new AudioContext({sampleRate:pr}));const e=D.current;U.current=!0,x("speaking");const t=e.currentTime;for(W.current<t&&(W.current=t);P.current.length>0;){const t=P.current.shift(),r=e.createBuffer(1,t.length,pr);r.getChannelData(0).set(t);const o=e.createBufferSource();o.buffer=r,o.connect(e.destination),o.start(W.current),R.current.push(o),o.onended=()=>{R.current=R.current.filter(e=>e!==o),0===R.current.length&&0===P.current.length&&(U.current=!1,x(e=>"speaking"===e?"listening":e))},W.current+=t.length/pr}},[]),G=h({}),Z=a(()=>{const e=o?.();if(!e||L.current)return;const t=()=>{x("listening")},r=e=>{if(!e?.data)return;const t=function(e){const t=atob(e),r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);const o=new Int16Array(r.buffer),n=new Float32Array(o.length);for(let s=0;s<o.length;s++)n[s]=o[s]/32768;return n}(e.data);P.current.push(t),B()},n=()=>{R.current.forEach(e=>{try{e.stop()}catch{}}),R.current=[],P.current.length=0,W.current=0,U.current=!1,x("listening")},s=()=>{},a=e=>{console.error("[VoiceCall] Voice error:",e)},i=e=>{e?.emotion&&(z(e.emotion),setTimeout(()=>z(t=>t===e.emotion?null:t),4e3))},l=e=>{e?.text&&E(t=>{if(t.length>0&&"user"===t[t.length-1].role){const r=[...t];return r[r.length-1]={...r[r.length-1],text:r[r.length-1].text+e.text},r}return[...t,{role:"user",text:e.text}]})},c=e=>{e?.text&&E(t=>{if(t.length>0&&"bot"===t[t.length-1].role){const r=[...t];return r[r.length-1]={...r[r.length-1],text:r[r.length-1].text+e.text},r}return[...t,{role:"bot",text:e.text}]})},d=()=>{x("thinking")};G.current={voiceReady:t,voiceAudioChunk:r,voiceInterrupted:n,voiceTurnComplete:s,voiceError:a,voiceEmotion:i,voiceUserTranscript:l,voiceModelTranscript:c,voiceModelThinking:d},e.on("voice_ready",t),e.on("voice_audio_chunk",r),e.on("voice_interrupted",n),e.on("voice_turn_complete",s),e.on("voice_error",a),e.on("voice_emotion",i),e.on("voice_user_transcript",l),e.on("voice_model_transcript",c),e.on("voice_model_thinking",d),L.current=!0},[o,B]),Y=a(()=>{const e=o?.();if(!e||!L.current)return;const t=G.current;t.voiceReady&&e.off("voice_ready",t.voiceReady),t.voiceAudioChunk&&e.off("voice_audio_chunk",t.voiceAudioChunk),t.voiceInterrupted&&e.off("voice_interrupted",t.voiceInterrupted),t.voiceTurnComplete&&e.off("voice_turn_complete",t.voiceTurnComplete),t.voiceError&&e.off("voice_error",t.voiceError),t.voiceEmotion&&e.off("voice_emotion",t.voiceEmotion),t.voiceUserTranscript&&e.off("voice_user_transcript",t.voiceUserTranscript),t.voiceModelTranscript&&e.off("voice_model_transcript",t.voiceModelTranscript),t.voiceModelThinking&&e.off("voice_model_thinking",t.voiceModelThinking),G.current={},L.current=!1},[o]),J=a(async()=>{const e=o?.();if(!e)return;const t=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:16e3,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});_.current=t;const r=new AudioContext({sampleRate:16e3});I.current=r;const n=r.createMediaStreamSource(t),s=r.createAnalyser();if(s.fftSize=256,n.connect(s),A.current=s,!T.current){const e=new Blob(["\nclass VoicePCMProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n this.buffer = new Float32Array(1600); // 100ms at 16kHz\n this.bufferIndex = 0;\n }\n process(inputs) {\n const input = inputs[0]?.[0];\n if (!input) return true;\n for (let i = 0; i < input.length; i++) {\n this.buffer[this.bufferIndex++] = input[i];\n if (this.bufferIndex >= 1600) {\n // Convert Float32 → Int16 PCM\n const int16 = new Int16Array(1600);\n for (let j = 0; j < 1600; j++) {\n const s = Math.max(-1, Math.min(1, this.buffer[j]));\n int16[j] = s < 0 ? s * 0x8000 : s * 0x7FFF;\n }\n this.port.postMessage(int16.buffer, [int16.buffer]);\n this.buffer = new Float32Array(1600);\n this.bufferIndex = 0;\n }\n }\n return true;\n }\n}\nregisterProcessor('voice-pcm-processor', VoicePCMProcessor);\n"],{type:"application/javascript"});T.current=URL.createObjectURL(e)}await r.audioWorklet.addModule(T.current);const a=new AudioWorkletNode(r,"voice-pcm-processor");F.current=a,a.port.onmessage=t=>{if(e.connected&&!w){const r=function(e){const t=new Uint8Array(e);let r="";for(let o=0;o<t.byteLength;o++)r+=String.fromCharCode(t[o]);return btoa(r)}(t.data);e.emit("voice_audio_chunk",{data:r})}},n.connect(a);const i=()=>{if(!A.current)return;const e=new Uint8Array(A.current.frequencyBinCount);A.current.getByteFrequencyData(e);const t=e.reduce((e,t)=>e+t,0)/e.length;N(t/255),$.current=requestAnimationFrame(i)};i()},[o,w]),X=a(()=>{cancelAnimationFrame($.current),F.current?.disconnect(),F.current=null,_.current?.getTracks().forEach(e=>e.stop()),_.current=null,I.current?.close(),I.current=null,A.current=null,N(0)},[]),Q=a(async()=>{const e=o?.();if(e?.connected){x("connecting"),y(0),E([]),z(null),P.current=[],Z();try{await J()}catch(t){return console.error("[VoiceCall] Mic error:",t),void x("idle")}e.emit("voice_start",{language:"es-AR",voice:"Kore"}),j.current=setInterval(()=>{y(e=>e+1)},1e3)}else console.error("[VoiceCall] Socket not connected")},[o,Z,J]),ee=a(()=>{X(),R.current.forEach(e=>{try{e.stop()}catch{}}),R.current=[],P.current=[],W.current=0,U.current=!1,D.current?.close(),D.current=null,j.current&&(clearInterval(j.current),j.current=null);const e=o?.();e?.connected&&e.emit("voice_stop"),u&&S.length>0&&S.forEach(e=>{u({sender:"user"===e.role?"user":"bot",content:e.text})}),Y(),x("idle"),N(0),y(0),k(!1),E([]),t()},[o,X,Y,t,u,S]),te=a(()=>{k(e=>!e)},[]);if(s(()=>{e&&"idle"===b&&Q()},[e]),s(()=>()=>{X(),j.current&&clearInterval(j.current),Y()},[]),!e)return null;const oe="speaking"===b?m.speakingColor:"thinking"===b?m.thinkingColor:"listening"===b?m.listeningColor:r;/* @__PURE__ */
|
|
76
76
|
return g("div",{className:vt("absolute inset-0 z-50 flex flex-col overflow-hidden","animate-in fade-in duration-300"),style:{backgroundColor:"#0a0a0f",borderRadius:"inherit"},children:[
|
|
77
77
|
/* @__PURE__ */g("div",{className:"absolute inset-0 pointer-events-none",style:{overflow:"hidden"},children:[
|
|
78
|
-
/* @__PURE__ */p("div",{className:"absolute rounded-full",style:{width:"300px",height:"300px",top:"-80px",right:"-60px",background:`radial-gradient(circle, ${
|
|
79
|
-
/* @__PURE__ */p("div",{className:"absolute rounded-full",style:{width:"250px",height:"250px",bottom:"-40px",left:"-50px",background:`radial-gradient(circle, ${
|
|
80
|
-
/* @__PURE__ */p("div",{className:"absolute rounded-full",style:{width:"200px",height:"200px",top:"40%",left:"50%",transform:"translateX(-50%)",background:`radial-gradient(circle, ${
|
|
81
|
-
/* @__PURE__ */g("div",{className:"relative flex items-center justify-between
|
|
78
|
+
/* @__PURE__ */p("div",{className:"absolute rounded-full",style:{width:"300px",height:"300px",top:"-80px",right:"-60px",background:`radial-gradient(circle, ${oe}18 0%, transparent 70%)`,transition:"background 1.5s ease",filter:"blur(40px)"}}),
|
|
79
|
+
/* @__PURE__ */p("div",{className:"absolute rounded-full",style:{width:"250px",height:"250px",bottom:"-40px",left:"-50px",background:`radial-gradient(circle, ${m.thinkingColor}12 0%, transparent 70%)`,filter:"blur(50px)"}}),
|
|
80
|
+
/* @__PURE__ */p("div",{className:"absolute rounded-full",style:{width:"200px",height:"200px",top:"40%",left:"50%",transform:"translateX(-50%)",background:`radial-gradient(circle, ${oe}10 0%, transparent 70%)`,transition:"background 1.5s ease",filter:"blur(60px)"}})]}),
|
|
81
|
+
/* @__PURE__ */g("div",{className:"relative flex items-center justify-between",style:{background:"rgba(255,255,255,0.03)",borderBottom:"1px solid rgba(255,255,255,0.06)",padding:"16px 24px",paddingTop:"20px"},children:[
|
|
82
82
|
/* @__PURE__ */g("div",{className:"flex items-center gap-3",children:[
|
|
83
|
-
/* @__PURE__ */p("div",{className:"relative",children:/* @__PURE__ */p("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:
|
|
84
|
-
/* @__PURE__ */p("span",{style:{color:"rgba(255,255,255,0.8)",fontSize:"13px",fontWeight:500,letterSpacing:"-0.01em"},children:
|
|
85
|
-
/* @__PURE__ */g("div",{className:"flex items-center gap-3",children:[
|
|
86
|
-
/* @__PURE__ */p("span",{style:{fontSize:"13px",fontFamily:"ui-monospace, monospace",color:"rgba(255,255,255,0.4)",fontVariantNumeric:"tabular-nums"},children:
|
|
87
|
-
/* @__PURE__ */p("div",{className:"relative flex-1 overflow-y-auto px-5 py-4",style:{scrollbarWidth:"none"},children:0===
|
|
88
|
-
/* @__PURE__ */p("div",{ref:
|
|
89
|
-
/* @__PURE__ */p("div",{style:{textAlign:"center",paddingBottom:"12px"},children:/* @__PURE__ */p("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 16px",borderRadius:"20px",fontSize:"11px",fontWeight:500,color:"rgba(255,255,255,0.35)",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)",letterSpacing:"0.02em"},children:
|
|
90
|
-
/* @__PURE__ */p(H,{style:{width:"12px",height:"12px"}})," Micrófono silenciado"]}):"thinking"===
|
|
83
|
+
/* @__PURE__ */p("div",{className:"relative",children:/* @__PURE__ */p("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:oe,boxShadow:`0 0 8px ${oe}80`,animation:"idle"!==b?"pulse 2s ease-in-out infinite":"none"}})}),
|
|
84
|
+
/* @__PURE__ */p("span",{style:{color:"rgba(255,255,255,0.8)",fontSize:"13px",fontWeight:500,letterSpacing:"-0.01em"},children:m.statusLabels[b]||b})]}),
|
|
85
|
+
/* @__PURE__ */g("div",{className:"flex items-center gap-3",children:[m.showEmotionLabel&&M&&/* @__PURE__ */g("span",{style:{fontSize:"11px",padding:"2px 10px",borderRadius:"20px",background:`${oe}15`,border:`1px solid ${oe}25`,color:oe,fontWeight:600},children:[m.showEmojis&&(m.emotionEmojis[M]||"💬")," ",M]}),
|
|
86
|
+
/* @__PURE__ */p("span",{style:{fontSize:"13px",fontFamily:"ui-monospace, monospace",color:"rgba(255,255,255,0.4)",fontVariantNumeric:"tabular-nums"},children:V(v)})]})]}),m.showBadge&&m.badgeText&&/* @__PURE__ */p("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:/* @__PURE__ */p("span",{style:{padding:"4px 14px",borderRadius:"20px",fontSize:"11px",fontWeight:700,background:`linear-gradient(135deg, ${r}, ${m.thinkingColor})`,color:"white"},children:m.badgeText})}),
|
|
87
|
+
/* @__PURE__ */p("div",{className:"relative flex-1 overflow-y-auto px-5 py-4",style:{scrollbarWidth:"none"},children:0===S.length?/* @__PURE__ */p("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:/* @__PURE__ */p(gr,{avatars:i,logoUrl:l,emotion:M,callState:b,audioLevel:C,config:m})}):/* @__PURE__ */g("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[S.map((e,t)=>{/* @__PURE__ */return p("div",{style:{maxWidth:"85%",padding:"10px 14px",borderRadius:"user"===e.role?"16px 16px 4px 16px":"16px 16px 16px 4px",fontSize:"13.5px",lineHeight:1.5,color:"white",marginLeft:"user"===e.role?"auto":"0",marginRight:"user"===e.role?"0":"auto",backgroundColor:"user"===e.role?"rgba(255,255,255,0.08)":`${r}25`,backdropFilter:"blur(8px)",border:"user"===e.role?"1px solid rgba(255,255,255,0.08)":`1px solid ${r}20`},dangerouslySetInnerHTML:{__html:(o=e.text,o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/`([^`]+)`/g,'<code style="background:rgba(255,255,255,0.1);padding:0 4px;border-radius:3px">$1</code>').replace(/\n/g,"<br>"))}},t);var o}),
|
|
88
|
+
/* @__PURE__ */p("div",{ref:O})]})}),
|
|
89
|
+
/* @__PURE__ */p("div",{style:{textAlign:"center",paddingBottom:"12px"},children:/* @__PURE__ */p("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 16px",borderRadius:"20px",fontSize:"11px",fontWeight:500,color:"rgba(255,255,255,0.35)",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)",letterSpacing:"0.02em"},children:w?/* @__PURE__ */g(f,{children:[
|
|
90
|
+
/* @__PURE__ */p(H,{style:{width:"12px",height:"12px"}})," Micrófono silenciado"]}):"thinking"===b?"Procesando...":"speaking"===b?/* @__PURE__ */g(f,{children:[
|
|
91
91
|
/* @__PURE__ */p(re,{style:{width:"12px",height:"12px"}})," Respuesta de voz"]}):"Habla cuando quieras"})}),
|
|
92
92
|
/* @__PURE__ */g("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"20px",paddingBottom:"28px",paddingTop:"8px"},children:[
|
|
93
|
-
/* @__PURE__ */p("button",{onClick:
|
|
94
|
-
/* @__PURE__ */p("button",{onClick:
|
|
95
|
-
/* @__PURE__ */p("div",{style:{width:"52px",height:"52px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"speaking"===
|
|
96
|
-
/* @__PURE__ */p("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes pulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.7; transform: scale(0.95); }\n }\n "})]})}function
|
|
93
|
+
/* @__PURE__ */p("button",{onClick:te,style:{width:"52px",height:"52px",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",backgroundColor:w?"rgba(239,68,68,0.15)":"rgba(255,255,255,0.08)",color:w?"#f87171":"rgba(255,255,255,0.7)",backdropFilter:"blur(12px)",border:"1px solid "+(w?"rgba(239,68,68,0.2)":"rgba(255,255,255,0.08)")},"aria-label":w?"Activar micrófono":"Silenciar micrófono",children:/* @__PURE__ */p(w?H:q,{style:{width:"22px",height:"22px"}})}),
|
|
94
|
+
/* @__PURE__ */p("button",{onClick:ee,style:{width:"64px",height:"64px",borderRadius:"50%",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",boxShadow:"0 4px 24px rgba(239,68,68,0.4), 0 0 0 4px rgba(239,68,68,0.1)",transition:"all 0.2s"},"aria-label":"Finalizar llamada",children:/* @__PURE__ */p(K,{style:{width:"26px",height:"26px"}})}),
|
|
95
|
+
/* @__PURE__ */p("div",{style:{width:"52px",height:"52px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"speaking"===b?`${m.listeningColor}15`:"rgba(255,255,255,0.08)",color:"speaking"===b?m.listeningColor:"rgba(255,255,255,0.5)",border:"1px solid "+("speaking"===b?`${m.listeningColor}25`:"rgba(255,255,255,0.08)"),transition:"all 0.3s"},children:/* @__PURE__ */p(re,{style:{width:"22px",height:"22px"}})})]}),
|
|
96
|
+
/* @__PURE__ */p("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n @keyframes pulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.7; transform: scale(0.95); }\n }\n "})]})}function xr({isOpen:e,isConnected:t,isTyping:r,messages:o,botName:i="Mar",logoUrl:l,welcomeMessage:c,inputPlaceholder:d,primaryColor:u,mediaConfig:m,onClose:b,onSendMessage:x,bubbleStyles:v,avatars:y,onSendAttachment:w,onSendLocation:k,getSocket:C,onAddVoiceMessage:N,theme:M}){const[z,E]=n(!1),[j,A]=n(!1),{t:_}=S(),I=dr(),F=Ct({primaryColor:u}),$=function({isOpen:e,height:t,bottom:r}){const o=dr(),[i,l]=n({}),c=a(()=>{if(o){const e=()=>{window.visualViewport?l({height:`${window.visualViewport.height}px`,width:"100%",top:`${window.visualViewport.offsetTop}px`,left:"0px",bottom:"auto",right:"auto",transform:"none"}):l({height:"100dvh",width:"100%",top:"0px",left:"0px"})};return e(),window.visualViewport?.addEventListener("resize",e),window.visualViewport?.addEventListener("scroll",e),()=>{window.visualViewport?.removeEventListener("resize",e),window.visualViewport?.removeEventListener("scroll",e)}}{const e=parseFloat(r||ur)||24,o=window.innerHeight-64-e;if(t){const e=parseFloat(t)||700,n=Math.min(e,o);l({height:`${n}px`,maxHeight:`${o}px`,bottom:r||ur})}else{const e=Math.min(700,Math.max(500,o));l({height:`${e}px`,maxHeight:`${o}px`,bottom:r||ur})}}},[o,t,r]);return s(()=>{if(!e)return;const t=c();return window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c),t&&t()}},[e,c]),i}({isOpen:e,height:M?.height,bottom:M?.bottom}),L=function({enabled:e,returnFocusRef:t,onEscape:r}){const o=h(null),n=h(null);return s(()=>{if(!e)return;n.current=document.activeElement;const s=t?.current,a=o.current;if(!a)return;const i=setTimeout(()=>{const e=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e.length>0?e[0].focus():a.focus()},100),l=e=>{if(a)if("Escape"!==e.key){if("Tab"===e.key){const t=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const r=t[0],o=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),o.focus()):e.shiftKey||document.activeElement!==o||(e.preventDefault(),r.focus())}}else r?.()};return document.addEventListener("keydown",l),()=>{clearTimeout(i),document.removeEventListener("keydown",l);const e=s||n.current;e&&"function"==typeof e.focus&&e.focus()}},[e,r,t]),o}({enabled:e,onEscape:b});if(s(()=>{if(e)return I&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"),()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.width=""}},[e,I]),!e)return null;const T="bottom-left"===M?.position;/* @__PURE__ */
|
|
97
97
|
return g(f,{children:[
|
|
98
|
-
/* @__PURE__ */p("div",{id:"chat-window-description",className:"sr-only",children:
|
|
99
|
-
/* @__PURE__ */g("div",{ref:
|
|
98
|
+
/* @__PURE__ */p("div",{id:"chat-window-description",className:"sr-only",children:_("accessibility.dialogDescription")}),
|
|
99
|
+
/* @__PURE__ */g("div",{ref:L,role:"dialog","aria-modal":"true","aria-labelledby":"chat-window-title","aria-describedby":"chat-window-description",tabIndex:-1,className:vt("flex flex-col overflow-hidden transition-all duration-500 ease-[cubic-bezier(0.16,1,0.3,1)]","text-foreground z-[9999]",!I&&["fixed",T?"left-6":"right-6","w-[350px] min-w-[350px] max-w-[350px]","rounded-[32px] border shadow-soft-2xl","animate-in fade-in zoom-in-95","slide-in-from-bottom-10"],I&&["fixed inset-0 w-full"]),style:{...$,backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))",color:"hsl(var(--foreground))"},children:[
|
|
100
100
|
/* @__PURE__ */p("header",{className:"relative shrink-0 border-b z-20",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--background) / 0.9)",borderColor:"hsl(var(--border))",backdropFilter:"blur(24px)"},children:/* @__PURE__ */g("div",{className:"flex items-center justify-between",children:[
|
|
101
101
|
/* @__PURE__ */g("div",{className:"flex items-center gap-3",children:[
|
|
102
102
|
/* @__PURE__ */g("div",{className:"relative",children:[
|
|
103
|
-
/* @__PURE__ */p("div",{className:"h-10 w-10 rounded-2xl overflow-hidden bg-primary/10 border-2 border-background shadow-soft-sm",children:
|
|
103
|
+
/* @__PURE__ */p("div",{className:"h-10 w-10 rounded-2xl overflow-hidden bg-primary/10 border-2 border-background shadow-soft-sm",children:z?/* @__PURE__ */p("div",{className:"h-full w-full flex items-center justify-center bg-muted text-muted-foreground",children:/* @__PURE__ */p("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */p("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}):/* @__PURE__ */p("img",{src:l||Ft,alt:i,className:"h-full w-full object-cover",onError:()=>E(!0)})}),
|
|
104
104
|
/* @__PURE__ */p("div",{className:vt("absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full border-2 border-background",t?"bg-emerald-500":"bg-amber-500 animate-pulse")})]}),
|
|
105
105
|
/* @__PURE__ */g("div",{className:"flex flex-col",children:[
|
|
106
106
|
/* @__PURE__ */g("div",{className:"flex items-center gap-1",children:[
|
|
@@ -108,16 +108,16 @@ return g(f,{children:[
|
|
|
108
108
|
/* @__PURE__ */p(ee,{className:"h-3 w-3 text-primary fill-primary/10"})]}),
|
|
109
109
|
/* @__PURE__ */g("div",{id:"chat-window-description",className:"flex items-center gap-1.5 mt-0.5",children:[
|
|
110
110
|
/* @__PURE__ */p("span",{className:"flex h-1 w-1 rounded-full bg-emerald-500"}),
|
|
111
|
-
/* @__PURE__ */p("span",{className:"text-[9px] font-black text-muted-foreground uppercase tracking-[0.1em]",children:
|
|
112
|
-
/* @__PURE__ */g("div",{className:"flex items-center gap-2",children:[m?.enableVoice&&/* @__PURE__ */p("button",{onClick:()=>
|
|
113
|
-
/* @__PURE__ */p("button",{onClick:b,"aria-label":
|
|
114
|
-
/* @__PURE__ */g("main",{role:"region","aria-label":
|
|
111
|
+
/* @__PURE__ */p("span",{className:"text-[9px] font-black text-muted-foreground uppercase tracking-[0.1em]",children:_(t?"online":"offline")})]})]})]}),
|
|
112
|
+
/* @__PURE__ */g("div",{className:"flex items-center gap-2",children:[m?.enableVoice&&/* @__PURE__ */p("button",{onClick:()=>A(!0),"aria-label":"Iniciar llamada de voz",title:"Llamar",className:"h-8 w-8 flex items-center justify-center rounded-full bg-emerald-500/10 hover:bg-emerald-500/20 text-emerald-600 transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2",children:/* @__PURE__ */p(Z,{className:"h-4 w-4","aria-hidden":"true"})}),
|
|
113
|
+
/* @__PURE__ */p("button",{onClick:b,"aria-label":_("accessibility.closeChat"),title:"Esc",className:"h-8 w-8 flex items-center justify-center rounded-full bg-muted/60 hover:bg-muted text-foreground transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:/* @__PURE__ */p(oe,{className:"h-4 w-4","aria-hidden":"true"})})]})]})}),
|
|
114
|
+
/* @__PURE__ */g("main",{role:"region","aria-label":_("accessibility.chatMessages"),className:"flex-1 min-h-0 relative flex flex-col",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--muted))"},children:[
|
|
115
115
|
/* @__PURE__ */p(or,{messages:o,isTyping:r,welcomeMessage:c,primaryColor:u,logoUrl:l,botName:i,bubbleStyles:v,avatars:y}),
|
|
116
116
|
/* @__PURE__ */p("div",{className:"absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-background/10 to-transparent pointer-events-none"})]}),
|
|
117
|
-
/* @__PURE__ */g("footer",{className:"border-t",style:{paddingTop:"var(--spacing-5)",paddingLeft:"var(--spacing-5)",paddingRight:"var(--spacing-5)",paddingBottom:
|
|
118
|
-
/* @__PURE__ */p(lr,{isConnected:t,placeholder:d,primaryColor:
|
|
117
|
+
/* @__PURE__ */g("footer",{className:"border-t",style:{paddingTop:"var(--spacing-5)",paddingLeft:"var(--spacing-5)",paddingRight:"var(--spacing-5)",paddingBottom:I?"max(var(--spacing-3), env(safe-area-inset-bottom))":"var(--spacing-3)",backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))"},children:[
|
|
118
|
+
/* @__PURE__ */p(lr,{isConnected:t,placeholder:d,primaryColor:F,mediaConfig:m,onSendMessage:x,onSendAttachment:w,onSendLocation:k,onVoiceCall:m?.enableVoice?()=>A(!0):void 0}),
|
|
119
119
|
/* @__PURE__ */g("div",{className:"flex items-center justify-center gap-1 opacity-25 select-none",style:{marginTop:"var(--spacing-2)",paddingBottom:"var(--spacing-1)"},children:[
|
|
120
120
|
/* @__PURE__ */p(U,{className:"h-2 w-2 text-primary fill-primary"}),
|
|
121
|
-
/* @__PURE__ */p("span",{className:"text-[7px] font-bold uppercase tracking-[0.2em]",children:
|
|
122
|
-
/* @__PURE__ */p(
|
|
123
|
-
//# sourceMappingURL=chunk-chat-ui-
|
|
121
|
+
/* @__PURE__ */p("span",{className:"text-[7px] font-bold uppercase tracking-[0.2em]",children:_("con_amor_paseo_libre")})]})]}),
|
|
122
|
+
/* @__PURE__ */p(br,{isOpen:j,onClose:()=>A(!1),primaryColor:F,avatars:y,logoUrl:l,getSocket:C,onAddMessage:N})]})]})}export{T as C,Ft as D,R as L,B as M,G as P,X as R,oe as X,ne as Z,Y as a,$ as b,vt as c,L as d,jt as e,At as f,Ct as g,$t as h,M as i,dr as j,Et as k,It as l,kt as m,xr as n,z as o,cr as t,S as u};
|
|
123
|
+
//# sourceMappingURL=chunk-chat-ui-_0LmcZf0.js.map
|