@mediquo/elements 0.11.0 → 0.12.0-rc.0
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/README.md +7 -18
- package/dist/chunks/appointment-details-BM8peAHH.js +1 -0
- package/dist/chunks/{appointment-details-CVEDe_k0.d.ts → appointment-details-KL9fK6vG.d.ts} +1 -2
- package/dist/chunks/ca_ES-DYhnenv6.js +1 -0
- package/dist/chunks/checkout-bridge-BFpVxNww.js +1 -0
- package/dist/chunks/de_DE-Dw0iVZNb.js +1 -0
- package/dist/chunks/{documentation-view-BSt0gtCR.js → documentation-view-CzCDvut1.js} +1 -1
- package/dist/chunks/en_US-DONnbI9l.js +1 -0
- package/dist/chunks/{index-CUirgiWh.d.ts → index-BEPyJrJL.d.ts} +1 -1
- package/dist/chunks/{index-B3rs7SlM.d.ts → index-BKjqWyIs.d.ts} +1 -1
- package/dist/chunks/{index-CCWMMqiq.js → index-DABvAuIz.js} +1 -1
- package/dist/chunks/index-Djkwyh_M.js +1 -0
- package/dist/chunks/{appointment.model.d-BWwBLaEL.d.ts → index-DwlJg2um.d.ts} +13 -0
- package/dist/chunks/{index-D2yqKnpP.js → index-VQqG1eyA.js} +1 -1
- package/dist/chunks/{index-DFaKhE7Q.d.ts → index-fut7tm1R.d.ts} +1 -1
- package/dist/chunks/{index.d-ByhRBSb1.d.ts → index.d-DHMNq1lu.d.ts} +2 -7
- package/dist/chunks/{login-token-task-Yib__6a9.js → login-token-task-NQJ77O_q.js} +1 -1
- package/dist/chunks/{mq-chat-room-C8wCADp2.d.ts → mq-chat-room-C0dJCvpV.d.ts} +2 -2
- package/dist/chunks/mq-chat-room-C2EALCSm.js +1 -0
- package/dist/chunks/{mq-next-appointments-CbjNpG1H.js → mq-next-appointments-DElOAaYx.js} +1 -1
- package/dist/chunks/{mq-recent-documents-DNqh_8J0.js → mq-recent-documents-DS5zUnH8.js} +1 -1
- package/dist/chunks/mq-schedule-CIb5mOTX.js +1 -0
- package/dist/chunks/{mq-support-chat-tdev5LC-.js → mq-support-chat-DYmvYk7b.js} +1 -1
- package/dist/chunks/{mq-videocall-CwYtlPu6.js → mq-videocall-CMPrGJK6.js} +1 -1
- package/dist/chunks/{next-appointment-card-DLU7-wIv.js → next-appointment-card-BOzfcwjD.js} +1 -1
- package/dist/chunks/{next-appointment-card-CPg9FuOI.d.ts → next-appointment-card-Z5G1jqtz.d.ts} +4 -4
- package/dist/chunks/professional-overview-Ck_SPivX.js +1 -0
- package/dist/chunks/{professional-overview-mO3tuMuH.d.ts → professional-overview-QVHl_ITk.d.ts} +1 -0
- package/dist/chunks/pt_PT-dELUeDqB.js +1 -0
- package/dist/chunks/task-CqjSKFwZ.js +1 -0
- package/dist/chunks/{telemetry-client-K37KMdy_.js → telemetry-client-DA2_SZBC.js} +1 -1
- package/dist/env.js +1 -1
- package/dist/events.d.ts +1 -22
- package/dist/events.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mq-api-client-provider.d.ts +1 -1
- package/dist/mq-apple-pay-checkout.d.ts +1 -1
- package/dist/mq-apple-pay-checkout.js +1 -1
- package/dist/mq-appointment-checkout.d.ts +20 -14
- package/dist/mq-appointment-checkout.js +1 -1
- package/dist/mq-appointment-documentation.d.ts +4 -4
- package/dist/mq-appointment-documentation.js +1 -1
- package/dist/mq-chat-room.d.ts +3 -3
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.d.ts +44 -61
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-dashboard.d.ts +6 -6
- package/dist/mq-dashboard.js +1 -1
- package/dist/mq-documents.d.ts +2 -2
- package/dist/mq-documents.js +1 -1
- package/dist/mq-google-pay-checkout.d.ts +1 -1
- package/dist/mq-google-pay-checkout.js +1 -1
- package/dist/mq-immediate-videocall-checkout.d.ts +10 -9
- package/dist/mq-immediate-videocall-checkout.js +1 -1
- package/dist/mq-my-appointments.d.ts +6 -6
- package/dist/mq-my-appointments.js +1 -1
- package/dist/mq-next-appointments.d.ts +5 -5
- package/dist/mq-next-appointments.js +1 -1
- package/dist/mq-payment-poller.d.ts +2 -2
- package/dist/mq-recent-documents.d.ts +2 -2
- package/dist/mq-recent-documents.js +1 -1
- package/dist/mq-schedule-success.d.ts +5 -5
- package/dist/mq-schedule-success.js +2 -2
- package/dist/mq-schedule.d.ts +52 -98
- package/dist/mq-schedule.js +1 -1
- package/dist/mq-support-chat.d.ts +3 -3
- package/dist/mq-support-chat.js +1 -1
- package/dist/mq-terms-and-conditions.d.ts +2 -2
- package/dist/mq-videocall.d.ts +5 -5
- package/dist/mq-videocall.js +1 -1
- package/dist/react/mq-api-client-provider.d.ts +1 -1
- package/dist/react/mq-apple-pay-checkout.d.ts +1 -1
- package/dist/react/mq-apple-pay-checkout.js +1 -1
- package/dist/react/mq-appointment-checkout.d.ts +12 -8
- package/dist/react/mq-appointment-checkout.js +1 -1
- package/dist/react/mq-appointment-documentation.d.ts +4 -4
- package/dist/react/mq-appointment-documentation.js +1 -1
- package/dist/react/mq-chat-room.d.ts +3 -3
- package/dist/react/mq-chat-room.js +1 -1
- package/dist/react/mq-checkout.d.ts +11 -8
- package/dist/react/mq-checkout.js +1 -1
- package/dist/react/mq-dashboard.d.ts +6 -6
- package/dist/react/mq-dashboard.js +1 -1
- package/dist/react/mq-documents-page.d.ts +2 -2
- package/dist/react/mq-documents-page.js +1 -1
- package/dist/react/mq-documents.d.ts +2 -2
- package/dist/react/mq-documents.js +1 -1
- package/dist/react/mq-google-pay-checkout.d.ts +1 -1
- package/dist/react/mq-google-pay-checkout.js +1 -1
- package/dist/react/mq-immediate-videocall-checkout.d.ts +4 -2
- package/dist/react/mq-immediate-videocall-checkout.js +1 -1
- package/dist/react/mq-my-appointments.d.ts +6 -6
- package/dist/react/mq-my-appointments.js +1 -1
- package/dist/react/mq-next-appointments.d.ts +5 -5
- package/dist/react/mq-next-appointments.js +1 -1
- package/dist/react/mq-payment-poller.d.ts +1 -1
- package/dist/react/mq-recent-documents.d.ts +2 -2
- package/dist/react/mq-recent-documents.js +1 -1
- package/dist/react/mq-schedule-success.d.ts +5 -5
- package/dist/react/mq-schedule-success.js +1 -1
- package/dist/react/mq-schedule.d.ts +4 -14
- package/dist/react/mq-schedule.js +1 -1
- package/dist/react/mq-support-chat.d.ts +3 -3
- package/dist/react/mq-support-chat.js +1 -1
- package/dist/react/mq-terms-and-conditions.d.ts +2 -2
- package/dist/react/mq-videocall.d.ts +5 -5
- package/dist/react/mq-videocall.js +1 -1
- package/dist/ui/mq-calendar.js +1 -1
- package/dist/ui/mq-tabs.js +49 -22
- package/package.json +2 -2
- package/dist/chunks/appointment-details-BYGwLfww.js +0 -1
- package/dist/chunks/ca_ES-BOvS9ayb.js +0 -1
- package/dist/chunks/de_DE-B-4V4SgD.js +0 -1
- package/dist/chunks/en_US-CgxjeeCm.js +0 -1
- package/dist/chunks/mq-chat-room-B_WgeuXn.js +0 -1
- package/dist/chunks/mq-schedule-BfW7y8uG.js +0 -1
- package/dist/chunks/professional-overview-B4E05rLd.js +0 -1
- package/dist/chunks/pt_PT-Vb6hoo2l.js +0 -1
- package/dist/chunks/task-Bj8p7kJX.js +0 -1
package/README.md
CHANGED
|
@@ -69,24 +69,13 @@ schedule?.addEventListener("back", () => {
|
|
|
69
69
|
|
|
70
70
|
Most features accept `api-key`, `token`, `locale`, and `env` when used standalone. See the [documentation](https://wc-showcase.mediquo.com) for per-component attributes and events.
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
In React, the same flags are `googlePayEnabled` / `applePayEnabled` on `MqSchedule`.
|
|
81
|
-
|
|
82
|
-
When the payment gateway is Stripe, `mq-schedule` embeds the checkout in the
|
|
83
|
-
payment step. Add `stripe-redirect` (`stripeRedirect` in React) to send the user
|
|
84
|
-
to Stripe hosted checkout instead; the step fires a cancelable
|
|
85
|
-
`mq-payment-redirect` event before navigating, and Stripe returns to `return-url`.
|
|
86
|
-
|
|
87
|
-
```html
|
|
88
|
-
<mq-schedule api-key="YOUR_API_KEY" return-url="https://host.example/return" stripe-redirect></mq-schedule>
|
|
89
|
-
```
|
|
72
|
+
Payments are handled by the Mediquo hosted checkout, which `mq-schedule`,
|
|
73
|
+
`mq-checkout`, `mq-appointment-checkout` and `mq-immediate-videocall-checkout`
|
|
74
|
+
embed in an iframe: it creates the payment session and offers the payment
|
|
75
|
+
methods the organization supports, so there is nothing payment-related to
|
|
76
|
+
configure. `mq-schedule` and the checkout elements only hand it what is being
|
|
77
|
+
paid (and, when applied, a discount coupon); they report the outcome through
|
|
78
|
+
their `payment-success` / `payment-error` events.
|
|
90
79
|
|
|
91
80
|
## Providers
|
|
92
81
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{g as n,p as a,a as r}from"./chunk-NIAGR3ZC-BDlNUZa1.js";import{a as s}from"./addSeconds-fO5orJrt.js";import{i as l,a as p,E as c,x as m}from"./lit-element-DiWJYFwC.js";import{n as h}from"./property-scuRaFcM.js";import{getLocale as d}from"../i18n.js";import{briefcaseIcon as u}from"../ui/icons/briefcase-icon.js";import{calendarIcon as f}from"../ui/icons/calendar-icon.js";import{clockIcon as v}from"../ui/icons/clock-icon.js";import{messageBubbleIcon as g}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as y}from"../ui/icons/phone-icon.js";const w=l`.appointment-details{display:flex;flex-direction:column;gap:var(--sp-3)}.detail-row{display:inline-flex;width:fit-content;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.detail-row.full-width{width:100%}:host([strike-through]) .detail-row span{text-decoration:line-through}`;let j=class AppointmentDetails extends p{constructor(){super(...arguments),this.channel=void 0,this.strikeThrough=!1,this.timezone=void 0,this._appointmentChannelToLabel=t=>{switch(t){case"videocall":return i("Videoconsulta");case"chat":return i("Chat");case"phonecall":return i("Consulta telefónica");default:return""}},this._appointmentChannelToIcon=t=>{switch(t){case"videocall":return u({size:24});case"chat":return g({size:24});case"phonecall":return y({size:24});default:return c}}}static{this.styles=w}render(){const t=d().replace("_","-"),e=n(this.timezone),i=new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",...e?{timeZone:e}:{}}),o=new Intl.DateTimeFormat(t,{timeStyle:"short",...e?{timeZone:e}:{}}),l=a(this.startsAt),p=s(l,this.duration),h=i.format(l),u=o.format(l),g=o.format(p),y=e?r(e,l):"";return m`<div class="appointment-details"><div class="detail-row">${f({size:24})} <span>${h}</span></div><div class="detail-row">${v({size:24})} <span>${u} - ${g}${y?` (${y})`:""}</span></div>${this.channel?m`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:c}</div>`}};t([h({type:String})],j.prototype,"startsAt",void 0),t([h({type:Number})],j.prototype,"duration",void 0),t([h({type:String})],j.prototype,"channel",void 0),t([h({type:Boolean,attribute:"strike-through"})],j.prototype,"strikeThrough",void 0),t([h({type:String})],j.prototype,"timezone",void 0),j=t([o(),e("appointment-details")],j);export{j as A};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
import { A as AppointmentChannel } from './
|
|
4
|
+
import { A as AppointmentChannel } from './index-DwlJg2um.js';
|
|
5
5
|
|
|
6
6
|
declare class AppointmentDetails extends LitElement {
|
|
7
7
|
static styles: lit.CSSResult;
|
|
8
8
|
startsAt: string;
|
|
9
9
|
duration: number;
|
|
10
10
|
channel: AppointmentChannel | undefined;
|
|
11
|
-
variant: "default" | "wide";
|
|
12
11
|
strikeThrough: boolean;
|
|
13
12
|
timezone: string | undefined;
|
|
14
13
|
private _appointmentChannelToLabel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as a}from"./runtime-Bg1WXVCx.js";const e={s0043fc30b467bc43:"Ocultar detalls",s00c8bf60a179e056:"Google Pay no està disponible. Prova amb targeta o un altre mètode de pagament.",s035706a468d0c40b:"Divendres",s0520ac0a7da193d4:"No hem pogut validar el codi. Torna-ho a provar.",s071bd6bbf6c08f34:"Carregant",s08404262212123ef:"Com et puc ajudar?",s08fe5307b5987c42:"De",s08fe5907b5988674:"Dg",s09165307b5ad0e23:"Dme",s09165b07b5ad1bbb:"Dm",s09195307b5af43fa:"Dl",s092e4f07b5c19938:"Dj",s093b3307b5cbf400:"Dv",s09462f07b5d5f4b9:"Ds",s09528d5c26b62213:"Dijous",s0aaec824f7c6b501:"Enviar missatge",s0b0085a15991b134:"Reconectant...",s0b0955208f737a86:"L'arxiu supera la mida màxima permesa",s0eb69642cbc19745:"Aquesta cita ja ha passat, per la qual cosa no es pot modificar.",s0fc7c4bfd185800d:"Aquí es mostraran les teves receptes i informes mèdics.",s0fcbdef9dc977231:"S'ha produït un error en carregar la pàgina. Si us plau, intenta-ho de nou o contacta amb el suport.",s11605fc03de64e14:"Escriu aquí...",s12f171594a5379d2:"¿Segur que vols cancel·lar aquesta cita?",s132e84f499a23985:"Sense horaris disponibles actualment",s13317a76a9ed776e:"Repetir",s142eba34d93fe59e:"Descripció",s1513f3687bfcac96:"Diumenge",s1a0efa6ac51e8a85:"Pàgina anterior",s1a874fc38d0fcef0:"Ordre mèdica",s1d318e9d0ccba86b:"Xat",s1ee6d7e6d04932a4:"El correu electrònic no és vàlid",s1fe8bb7f6ae07f9b:"No tens cites en l'historial",s219b833c5ca095b3:"Aquí podràs veure totes les cites que has tingut. Pots accedir a les documents de cada consulta i reagendar una cita si és necessari.",s22cf91a84fba4c4e:"Quan agendis una cita, apareixerà aquí per que puguis consultar-la, modificar-la o cancel·lar-la.",s238c3ed6d3ecc66a:"Tancar",s24b59d5a129dc0d0:"No hem pogut anul·lar la cita. Torna-ho a provar.",s255bf4de23c83482:"Condicions de reserva:",s256189bafbcd2e34:"El telèfon no és vàlid",s27e462e9f48eb3a6:"Documentació",s2a1d212b3cb5c1a1:"Pots xatejar amb el professional fins 48 hores finalitzada la teva cita",s2aa2c19d07591438:"Rebràs un recordatori 15 minuts abans de la consulta",s2aab27b26a86469f:"Motiu de consulta",s2b9fde9a5739d2a0:"Nom",s2bb20b2162a18938:"¿Per què necessites la consulta?",s2d6183fa992e10e9:"Aquest professional no té horaris disponibles",s2ebd846b5a30f9d1:"Ho sentim, no hem pogut repetir la teva cita. Si us plau, contacta amb el suport.",s30c9095a2e07d929:"Sala d'espera",s31219c9bdeb7bc3e:"Continuar",s337e34cd11150eb6:"Veure totes les meves cites",s346d488070fe4cc8:"Demanar cita",s3944638e633d719a:"Consulta",s3b77baf6a4864231:"Error desconegut",s3bd87e3e21b07900:"Espereu mentre es restableix la connexió",s3dc6584e403858df:"No hem pogut carregar la teva documentació",s3f55bc3bfec41a5d:"Adjuntar arxius",s4177fe7f5d70fd33:"Tornar",s41826ac201c3cd85:"No s'ha pogut obrir el chat amb suport",s4364d4be7641e15f:"Confirmar cita",s43e5edcc8801e9a4:"Perfil del professional",s47afb8f6895a937b:a`Actualment hi ha una demanda elevada de cites a ${0}, de manera que els temps d'espera poden ser més llargs de l'habitual.`,s4813ee5d305442e5:"Sembla que no t'hem trobat a l'hora de la teva cita. Pots programar una altra consulta per resoldre els teus dubtes.",s49683919cdaeca83:"Avui",s4a061033615c8016:"Documents",s4a8494821c987a17:"Informe",s4a8f1fcd3f5e5952:"Encara no és l'hora!",s4d20157b5a655e70:"Aquest horari no està disponible. Si us plau, seleccioneu un altre.",s4de424f531892818:"Anar a videotrucada",s51c461d40f9fb865:"Selecciona el teu especialista",s536a0b4d3d4a5d9f:"No hem pogut carregar la teva propera cita",s53d957dda6cc200b:"Servei i plataforma prestats per",s53e2497bf900c7fd:"No tens properes cites",s5558a2e389d04223:"Modificar",s55c5126e99bae190:"Buscar disponibilitat",s563dcbfd432eb18f:"Anul·lar cita",s57e65113a89160cf:"Modalitat de la cita",s59612eaa6993aa7e:a`${0} minuts`,s5b7cc3cc732206e2:"La reserva d'aquest horari ha caducat. Si us plau, seleccioni'n un altre.",s5eef402d73eecbdc:"Adjuntar arxiu",s5f7956aacb5c6ca2:"Comprovant Google Pay…",s5f817b8841b188d2:"Més opcions",s631f73a10d156b22:"Consulta expirada",s63f7af84683dd7c3:"Aquesta cita ja no es pot modificar ni anul·lar: no queda el temps mínim requerit abans del començament.",s643155d1b6ee1684:"Torna-ho a provar en uns minuts.",s64b78a5026d4ce8d:"No hi ha horaris disponibles",s65bedc0e516977d9:"Dissabte",s679be6312356a21c:"Agenda una consulta mèdica quan la necessitis. Aquí podràs veure tots els detalls i podràs gestionar les teves properes cites.",s67f30f9f4ea881f3:"Aquest codi no és vàlid.",s6a50fd7f52263b04:"No s'ha pogut tornar a la sala d'espera",s6ab6fcd87fdbf217:"Hola",s6b1c4fb634461e7c:"Mes anterior",s6b6fa877ec1e6968:"Xatejar amb el professional",s6c81d42670932f93:"Actualitzar",s6e2423db05f36856:"Petició de cita",s6ecdc22accc55af7:"Videoconferència",s70258a0040dd9e19:"Tornar a la sala d'espera",s705f4bd8bc8e04d8:"Falten les credencials de pagament. Torna enrere i torna-ho a provar.",s718177442a7447b2:"Cita amb un especialista en menys de 72 hores",s733b3bf647b7b0fa:"Accepta els permisos de càmera i micròfon",s73cad78d8a3c39c2:"Prescripció",s74d7a739b6ab651d:"Històric",s757fef148e0c94c6:"Disponibilitat",s77320b73fdd9cc40:"Sortir",s775370fdb0af1546:"Data de naixement",s77c2b712a9813175:"Demanar una nova cita",s77f8e4bee88d44aa:a`${0} de ${1}`,s7907902da8916212:"El professional et trucarà al número que indiques en aquest camp.",s7aa3cd94d51825fc:"No hi ha professionals disponibles per a l'especialitat seleccionada. Si us plau, torna a intentar-ho en un altre moment o selecciona una altra especialitat.",s7af26e861bb6f905:"Falta l'identificador de passarel·la de Google Pay",s7fd8da9511b66dd4:"Pots adjuntar imatges o documentació addicional (analítiques, resultats de proves, etc.) perquè les avaluï el metge",s83c6ce869a2bbaa7:"(1 és molt dolent, 5 és excel·lent)",s8447efe79d058943:"Import pagat",s8581adc786786298:"Format d'arxiu no suportat",s862ca980b16911d0:"Xateja amb el professional",s8c18dbf02590a72e:"Codi de promoció aplicat",s8cce15c931017937:"Tornar a l'inici",s8e7a6119525dc7c9:a`Ho sentim, com falten menys de ${0} minuts per a la teva cita no la podem modificar.`,s9005845c358db9da:"No hem pogut descarregar el document.",s92f34d487d1d0355:"Promoció",s94626d2ffd70f075:"Codi de promoció validat correctament",s9536695467bcf9c4:"Aquesta cita ja ha passat, per la qual cosa no es pot anul·lar.",s96474eac63a69381:"Anar al xat",s96ceb408923a7ab1:a`Nº COL. ${0}`,s970d59d6d88e7e6c:"No es pot iniciar el pagament",s979ee14368bf1505:"Xateja amb mi",s9802dd10b2c2f760:"Enviar",s99898f495319cd49:"Aquest missatge ha estat eliminat",s9c309154722f8e06:"Carregant el portal de pagament",s9cabdaf42f04afee:"Introdueix el codi",s9cbf16425cadadb1:"Si us plau, intenta-ho de nou més tard.",s9d22fa67943fdc4c:"Consulta telefònica",sa00e726e1e7e46a9:"Afegir codi de promoció",sa27f38ad9db3bc4f:"Asesor comercial",sa2fe3f3b565f15f4:"Cancel·lar",sa4186d5e26cab4bb:"Pàgina no trobada",sa497ebaaeb251035:"Repetir cita",sa7de4334479674c6:"Modificar cita",sa82bc40dafbe3256:a`Cita agendada de ${0}`,sa83d79734eb60ee3:"Aplicar",sa86d729f62b39f99:"Unir-se a la videoconferència",sa87d2c48a52b2617:"No tens documentació",sab964c37a0934399:"No s'ha pogut carregar Google Pay. Comprova la configuració del lloc web i torna-ho a provar.",sac2728ace11e5f4b:"Especialitat*",sadc5ede25dd6e126:"El professional t'enviarà un missatge per poder coordinar la cita. Assegura't de tenir bona cobertura i poder atendre en el horari escollit.",sae8f7ac5552b2af1:"Quan faltin 10 minuts per a la teva consulta, podràs accedir a la videoconferència",saf63dc4c8601ec8c:"a",safe333e385f371ff:"Verificant el teu pagament...",saff3019e8a8c5f98:"Dilluns",sb01184796ad3832e:"Com t'ha anat la cita?",sb410a3509b92a90c:"Tens algun comentari sobre la consulta?",sb49dc4c5edae9d4e:"Valoració de la consulta",sb5387e21dc21422b:"Cita modificada",sb621415007181c43:"Mes següent",sb73394814d122852:"Si el teu metge ha generat alguna documentació, podràs veure-la i descarregar-la aquí, des de la secció de documentació, el teu correu o el xat.",sb882f28c9b20052e:"Cita confirmada",sba98cf8b2a7dfca4:"Ahir",sbbee712c4900abc2:"No hem pogut iniciar el pagament",sbc0be90393c87447:a`Resum de la cita per a ${0}`,sbcf081de432a2172:"Veure detalls",sbcfc05bdb868b383:"Receta",sbd07d1f779e482ae:"No hem pogut confirmar el teu pagament",sbd9803cceb34513a:"Iniciar xat amb assessor comercial",sbda1cf7b293e17d2:"Pujar arxiu",sc27e7c4850fc5a34:a`Ho sentim, com falten menys de ${0} hores per a la teva cita no la podem anul·lar.`,sc3bb7ea72886e4d0:"Documents recents",sc3c7734c15d2a045:"Explica'ns com va anar l'atenció o si vas tenir cap problema amb la videotrucada…",sc43929cc6582a185:"Veure agenda completa",sc4edf6a4e0157d4e:"Properes cites",sc6f816a96e8578ff:"Ho sentim, aquesta cita ja no es pot anul·lar.",sc7cf2be40c8614fa:a`Ho sentim, com falten menys de ${0} minuts per a la teva cita no la podem anul·lar.`,sca0e87aae6bde276:"Va passar algun problema?",sca4bd395e3148194:"Confirmar cancel·lació",sca90bc30758f9082:"La pàgina que estàs buscant ha estat eliminada, renombrada o pot que no existeixi.",scbe4c6673872bda5:"Telèfon",sce29e337ebd75277:"Chat amb suport",scf469737e1670fd4:"Pàgina següent",scfc7f5c5f41936dc:"Les meves cites",sd1f44f1a8bc20e67:"Correu electrònic",sd24922a2783f286e:"Dimecres",sd2a8fc66c53c1a27:"Ometre",sd3f7579076c6611c:"Sembla que has denegat els permisos necessaris per entrar a la videotrucada. Edita els permisos en el teu navegador per entrar. Una vegada concedits, has de refrescar aquesta pantalla.",sd4beaeb9a1b1fed5:"Dates anteriors",sd812eb30f385776d:"Completa el teu perfil",sd853d3bcf5341b59:"Veure més",sda962b28e9110c82:"Realitza la cerca en el teu quadre mèdic digital",sdb7004e477873574:"Consulta anul·lada correctament",sdd963b1b2ce9a1f5:a`El professional et trucarà al ${0} en el horari seleccionat. Assegura't de tenir bona cobertura i poder atendre en el horari escollit.`,sde993da26c048f19:"Traumatologia, ginecologia, endocrinologia, digestiva o psiquiatria",sdee32ae81ca0d6d8:"Afegeix al calendari",se00b081edccfae39:"Dates següents",se07ea9607704c5ad:"Canviar codi",se090f7226b372a4a:"Si la cita no s'ha pogut fer, pots",se0c7cc77f86aa8a0:"Cognoms",se17f2b402ecea2e1:"Import a devolver",se18fa3ef98e155de:"Preparant Google Pay…",se1cce5af3e9bb6ee:"S'ha produït un error en l'enviament de l'arxiu",se1cf783f86c53031:"Dimarts",se45e6f6f3428ad50:a`Enllaç a la cita: ${0}`,se5a09223256f98db:"Aquest camp és obligatori",se5f9264155b99909:"S'ha produït un problema en verificar l'estat del teu pagament. Si us plau, contacta amb el suport si el càrrega s'ha realitzat.",se92e438da4e7099f:a`Ho sentim, com falten menys de ${0} hores per a la teva cita no la podem modificar.`,sea11fd8a12559bc5:"Cita prèvia:",seb6739450e8d9c8d:"¿Segur que vols cancel·lar aquesta cita? Se t'devolverà el import pagat en un termini de 5-10 dies hàbils.",seb850e89f9ff58e8:"Propera cita",sed750da423170d47:"Resultats per a:",sed836a96c3b5d523:"Portal de pagament",sed8ec5e3c64fa25d:"Total",sed97e90642983578:"Continuar al pagament",sedb2092dda465ea1:"DNI/NIE",sedbca9676f07a51f:"Modalitat de la cita*",see7c0a7b5b6ebbc5:"Utilitza el xat per enviar el motiu de consulta, documents o imatges",sefc0dd68776c9466:"Qüestionari preconsulta",sf0638d3fc50964d2:"Escull una altra data",sf0695a0a125ae748:"Confirmar",sf199b210440b7c5f:"Consulta finalitzada",sf3457daf057bff15:"tornar a la sala d'espera.",sf484a0e20a7829ac:"T'enviarem un enllaç al correu electrònic indicat quan sigui el moment de connectar-te a la videoconferència. Assegura't de tenir bona connexió a internet i un dispositiu amb càmera i micròfon.",sf48d12e7ae207023:"Especialitat",sf5258cfb2fa10bdc:"Espera a ser atès sense sortir d'aquesta pantalla",sf63a72ff4116c6a9:"Descarregar document",sf9705e1c4e82c017:"No s'ha pogut enviar el qüestionari",sfa6bc28a7faedc92:"Nova cita d'especialitats digitals",sfac5734d03595135:"Veure-les totes",sfc63af0362cfb78b:"Falta l'identificador de comerç de Google Pay",sfd51ca4e1b145054:"No s'ha pogut reservar aquest horari. Si us plau, seleccioneu un altre.",sff337500b69abf7f:"El metge està finalitzant la gestió de la teva consulta. Actualitza en uns minuts per veure si tens documentació.",sffbc330c8a19f838:"Veure menys",sc6a6d42245892254:"Falta el identificador de comercio de Apple Pay",s3da77e69fe62cb2a:"No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.",se1dd5d211b5b00e4:"Apple Pay no está disponible",s7e8b7a5acbdf83ed:"Preparando Apple Pay…",sc8271ba819299b59:"Comprobando Apple Pay…",s57e95bc3afddfeb0:"Para pagar con Apple Pay, escanea el código QR con tu iPhone (iOS 18 o posterior) y confirma el pago.",sf32cd04f9a848ee2:"Pagar con Apple Pay",sfbfb2a1dc8c3f636:"Esta consulta no se puede pagar aquí",s50247070c73385c2:"Por favor, contacta con soporte para poder continuar.",s6a796114fe45025d:a`${0}, ${1} h${2}`,s35d601992fe66fed:"Confirmando tu pago",s5370521b92483bf3:"No cierres, vuelvas atrás ni actualices la ventana; esto puede tardar unos momentos.",s77bf41039c589159:"Tu pago no se ha completado",s0e850d0fec6daf7d:"El pago ha sido rechazado y no hemos creado la cita. No se te ha cobrado nada: puedes volver a reservar desde el inicio.",s4007fa55a28f1f73:"Ese horario ya no está disponible",s0089e78f42dfd1a4:"Otro paciente ha reservado esa cita mientras completabas el pago, así que no hemos podido crearla.",saeefd0d6fb204a80:"Te hemos devuelto el importe automáticamente; puede tardar unos días en reflejarse en tu cuenta.",se478d6710916dadf:"No hemos podido devolverte el importe automáticamente. Escríbenos y lo resolvemos:",sf9e6fbadcce256d0:"Ha ocurrido un error",sa24acad3b1338788:"No hemos podido confirmar tu pago. Por favor, inténtalo de nuevo más tarde.",s8bbbd679ddb50d3b:"Si se te ha cobrado sin una cita confirmada, contacta con nuestro equipo en",s1dec877628213eef:"Tus citas",se0c593aac5e172e6:"Accede, modifica o anula tus citas.",s230b0bee447e61a5:"Ver mis citas"};export{e as templates};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e="https://checkout.mediquo.com";function s(s){const r=new URL(`${e}/pay`);r.searchParams.set("api_key",s.apiKey),r.searchParams.set("env",s.env),r.searchParams.set("locale",s.locale),r.searchParams.set("payable_reference",s.payableReference.trim());const t=s.mode??"embed";r.searchParams.set("mode",t),s.framedByHost&&"embed"===t&&r.searchParams.set("frame","host");const n=[["discount_code",s.discountCode?.trim()],["amount",s.amount],["currency",s.currency],["country",s.country],["label",s.label],["methods",s.methods?.join(",")],["success_url",s.successUrl],["error_url",s.errorUrl]];for(const[e,s]of n)s&&r.searchParams.set(e,s);const a=new URLSearchParams({token:s.token}),o=s.consultationReason?.trim();return o&&a.set("consultation_reason",o),r.hash=a.toString(),r.toString()}const r="https://stripe-checkout.mediquo.com",t=new Set([e,r]),n=new Set(["cancelled","merchant","authorize"]),a=new Set(["auth","session","timeout","unsupported","expired"]);function o(e){return"string"==typeof e?e:""}function c(e){if(e&&"object"==typeof e){const s=e;return"mediquo:payment:resize"===s.type&&"number"==typeof s.height?{type:"resize",height:s.height}:null}if("string"!=typeof e)return null;let s;try{s=JSON.parse(e)}catch{return null}const r=s?.payload??{};switch(s?.type){case"success":{const e=o(r.reference);return e?{type:"success",sessionId:o(r.sessionId),reference:e}:{type:"error",reason:"unavailable"}}case"denied":return{type:"denied",sessionId:o(r.sessionId)};case"granted":return{type:"granted"};case"error":{const e="string"!=typeof(t=r.reason)?"session":n.has(t)?null:a.has(t)?t:"unavailable"===t||"unconfigured"===t||"stripe_unconfigured"===t||"not_found"===t||"result_unavailable"===t?"unavailable":"session";return e?{type:"error",reason:e}:null}default:return null}var t}function u(e,s){return!!s&&e.source===s&&t.has(e.origin)}export{r as S,s as b,u as i,c as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./runtime-Bg1WXVCx.js";const n={s0043fc30b467bc43:"Details ausblenden",s00c8bf60a179e056:"Google Pay ist nicht verfügbar. Versuche es mit Karte oder einer anderen Zahlungsmethode.",s035706a468d0c40b:"Freitag",s0520ac0a7da193d4:"Wir konnten den Code nicht überprüfen. Bitte versuchen Sie es erneut.",s071bd6bbf6c08f34:"Laden",s08404262212123ef:"Wie kann ich dir helfen?",s08fe5307b5987c42:"De",s08fe5907b5988674:"Do",s09165307b5ad0e23:"Mi",s09165b07b5ad1bbb:"Ma",s09195307b5af43fa:"Lu",s092e4f07b5c19938:"Ju",s093b3307b5cbf400:"Vi",s09462f07b5d5f4b9:"Sa",s09528d5c26b62213:"Donnerstag",s0aaec824f7c6b501:"Nachricht senden",s0b0085a15991b134:"Wiederherstellen...",s0b0955208f737a86:"Die Datei überschreitet die maximale Größe",s0eb69642cbc19745:"Dieser Termin liegt bereits in der Vergangenheit und kann daher nicht mehr geändert werden.",s0fc7c4bfd185800d:"Hier werden Ihre Rezepte und Arztberichte angezeigt.",s0fcbdef9dc977231:"Ein Fehler ist beim Laden der Seite aufgetreten. Bitte versuchen Sie es erneut oder kontaktieren Sie den Support.",s11605fc03de64e14:"Schreiben Sie hier...",s12f171594a5379d2:"Sind Sie sicher, dass Sie diese Behandlung stornieren möchten?",s132e84f499a23985:"Keine Zeitpläne verfügbar",s13317a76a9ed776e:"Wiederholen",s142eba34d93fe59e:"Beschreibung",s1513f3687bfcac96:"Sonntag",s1a0efa6ac51e8a85:"Vorherige Seite",s1a874fc38d0fcef0:"Ärztliche Verordnung",s1d318e9d0ccba86b:"Chat",s1ee6d7e6d04932a4:"Die E-Mail ist nicht gültig",s1fe8bb7f6ae07f9b:"Sie haben keine Behandlungen in Ihrer Chronik",s219b833c5ca095b3:"Hier sehen Sie alle Behandlungen, auf die Sie zugegriffen haben. Sie können auf die Dokumente jeder Behandlung zugreifen und eine Behandlung neu planen, wenn dies erforderlich ist.",s22cf91a84fba4c4e:"Wenn Sie eine Behandlung planen, erscheint hier, um Sie zu konsultieren, zu ändern oder zu stornieren.",s238c3ed6d3ecc66a:"Schließen",s24b59d5a129dc0d0:"Der Termin konnte nicht storniert werden. Bitte versuche es erneut.",s255bf4de23c83482:"Bedingungen der Buchung:",s256189bafbcd2e34:"Die Telefonnummer ist nicht gültig",s27e462e9f48eb3a6:"Dokumentation",s2a1d212b3cb5c1a1:"Sie können mit Ihrem Experten bis 48 Stunden nach der Behandlung chatten",s2aa2c19d07591438:"Sie erhalten 15 Minuten vor der Behandlung eine Erinnerung",s2aab27b26a86469f:"Behandlungsmotive",s2b9fde9a5739d2a0:"Vorname",s2bb20b2162a18938:"Warum benötigen Sie die Behandlung?",s2d6183fa992e10e9:"Dieser Experte hat keine verfügbaren Termine",s2ebd846b5a30f9d1:"Es tut uns leid, wir konnten Ihre Behandlung nicht wiederholen. Bitte wenden Sie sich an den Support.",s30c9095a2e07d929:"Wartezimmer",s31219c9bdeb7bc3e:"Weiter",s337e34cd11150eb6:"Meine Behandlungen anzeigen",s346d488070fe4cc8:"Behandlung anfragen",s3944638e633d719a:"Konsultation",s3b77baf6a4864231:"Unbekannter Fehler",s3bd87e3e21b07900:"Warten Sie, während die Verbindung wiederhergestellt wird",s3dc6584e403858df:"Wir konnten Ihre Dokumente nicht laden",s3f55bc3bfec41a5d:"Datei anhängen",s4177fe7f5d70fd33:"Zurück",s41826ac201c3cd85:"Der Chat mit Support konnte nicht geöffnet werden",s4364d4be7641e15f:"Termin bestätigen",s43e5edcc8801e9a4:"Professioneller Profil",s47afb8f6895a937b:e`Die Nachfrage nach Terminen in ${0} ist derzeit hoch, daher kann es zu längeren Wartezeiten als üblich kommen.`,s4813ee5d305442e5:"Es scheint, dass wir Sie zu der Zeit nicht gefunden haben, zu der Sie Ihre Behandlung haben. Sie können eine andere Behandlung planen, um Ihre Fragen zu beantworten.",s49683919cdaeca83:"Heute",s4a061033615c8016:"Dokumente",s4a8494821c987a17:"Bericht",s4a8f1fcd3f5e5952:"Es ist noch nicht die Zeit!",s4d20157b5a655e70:"Dieser Zeitplan ist nicht verfügbar. Bitte wählen Sie einen anderen.",s4de424f531892818:"Zu Videocall gehen",s51c461d40f9fb865:"Wählen Sie Ihren Experten",s536a0b4d3d4a5d9f:"Wir konnten Ihre nächste Behandlung nicht laden",s53d957dda6cc200b:"Service und Plattform von",s53e2497bf900c7fd:"Sie haben keine nächsten Behandlungen",s5558a2e389d04223:"Ändern",s55c5126e99bae190:"Verfügbarkeit suchen",s563dcbfd432eb18f:"Behandlung stornieren",s57e65113a89160cf:"Behandlungsmode",s59612eaa6993aa7e:e`${0} Minuten`,s5b7cc3cc732206e2:"Die Reservierung für diesen Termin ist abgelaufen. Bitte wählen Sie einen anderen.",s5eef402d73eecbdc:"Datei anhängen",s5f7956aacb5c6ca2:"Google Pay wird geprüft…",s5f817b8841b188d2:"Weitere Optionen",s631f73a10d156b22:"Behandlung abgelaufen",s63f7af84683dd7c3:"Diese Behandlung kann nicht geändert oder storniert werden: Es ist nicht genügend Zeit vor dem Beginn verbleiben.",s643155d1b6ee1684:"Versuchen Sie es in einigen Minuten erneut.",s64b78a5026d4ce8d:"Keine Zeitpläne verfügbar",s65bedc0e516977d9:"Samstag",s679be6312356a21c:"Planen Sie eine medizinische Behandlung, wenn Sie sie benötigen. Hier sehen Sie alle Details und können Ihre nächsten Behandlungen verwalten.",s67f30f9f4ea881f3:"Dieser Code ist ungültig.",s6a50fd7f52263b04:"Rückkehr ins Wartezimmer nicht möglich",s6ab6fcd87fdbf217:"Hallo",s6b1c4fb634461e7c:"Vorheriger Monat",s6b6fa877ec1e6968:"Mit dem Experten chatten",s6c81d42670932f93:"Aktualisieren",s6e2423db05f36856:"Behandlungsanfrage",s6ecdc22accc55af7:"Videoanruf",s70258a0040dd9e19:"Zurück zum Wartezimmer",s705f4bd8bc8e04d8:"Die Zahlungsdaten fehlen. Gehen Sie zurück und versuchen Sie es erneut.",s718177442a7447b2:"Behandlung mit einem Experten in weniger als 72 Stunden",s733b3bf647b7b0fa:"Akzeptieren Sie die Berechtigungen für Kamera und Mikrofon",s73cad78d8a3c39c2:"Rezept",s74d7a739b6ab651d:"Chronik",s757fef148e0c94c6:"Verfügbarkeit",s77320b73fdd9cc40:"Verlassen",s775370fdb0af1546:"Geburtsdatum",s77c2b712a9813175:"Neue Behandlung anfragen",s77f8e4bee88d44aa:e`${0} von ${1}`,s7907902da8916212:"Der Experte wird Ihnen eine Nachricht senden, um die Behandlung zu koordinieren. Stellen Sie sicher, dass Sie eine gute Mobilfunkabdeckung haben und in dem ausgewählten Zeitplan antreten können.",s7aa3cd94d51825fc:"Es gibt keine professionellen für die ausgewählte Spezialität verfügbar. Bitte versuchen Sie es erneut oder wählen Sie eine andere Spezialität.",s7af26e861bb6f905:"Google Pay-Gateway-Händlerkennung fehlt",s7fd8da9511b66dd4:"Sie können Bilder oder zusätzliche Dokumentation (Analysen, Testresultate, etc.) für den Arzt hochladen",s83c6ce869a2bbaa7:"(1 ist sehr schlecht, 5 ist ausgezeichnet)",s8447efe79d058943:"Bezahlter Betrag",s8581adc786786298:"Dateiformat nicht unterstützt",s862ca980b16911d0:"Mit dem Experten chatten",s8c18dbf02590a72e:"Aktionscode angewendet",s8cce15c931017937:"Zurück zur Startseite",s8e7a6119525dc7c9:e`Leider können wir Ihren Termin nicht ändern, da bis dahin weniger als ${0} Minuten verbleiben.`,s9005845c358db9da:"Wir konnten das Dokument nicht herunterladen.",s92f34d487d1d0355:"Aktion",s94626d2ffd70f075:"Aktionscode erfolgreich angewendet",s9536695467bcf9c4:"Dieser Termin liegt bereits in der Vergangenheit und kann daher nicht mehr storniert werden.",s96474eac63a69381:"Zum Chat gehen",s96ceb408923a7ab1:e`Nr. KOL. ${0}`,s970d59d6d88e7e6c:"Die Zahlung kann nicht gestartet werden",s979ee14368bf1505:"Chatte mit mir",s9802dd10b2c2f760:"Senden",s99898f495319cd49:"Dieser Nachricht wurde gelöscht",s9c309154722f8e06:"Laden des Zahlungsportals",s9cabdaf42f04afee:"Code eingeben",s9cbf16425cadadb1:"Bitte versuchen Sie es erneut später.",s9d22fa67943fdc4c:"Telefonische Behandlung",sa00e726e1e7e46a9:"Aktionscode hinzufügen",sa27f38ad9db3bc4f:"Kommerzialberater",sa2fe3f3b565f15f4:"Stornieren",sa4186d5e26cab4bb:"Seite nicht gefunden",sa497ebaaeb251035:"Behandlung wiederholen",sa7de4334479674c6:"Behandlung ändern",sa82bc40dafbe3256:e`Behandlung geplant für ${0}`,sa83d79734eb60ee3:"Anwenden",sa86d729f62b39f99:"Am Videoanruf teilnehmen",sa87d2c48a52b2617:"Sie haben keine Dokumentation",sab964c37a0934399:"Google Pay konnte nicht geladen werden. Überprüfe die Website-Konfiguration und versuche es erneut.",sac2728ace11e5f4b:"Spezialität*",sadc5ede25dd6e126:"Der Experte wird Ihnen eine Nachricht senden, um die Behandlung zu koordinieren. Stellen Sie sicher, dass Sie eine gute Mobilfunkabdeckung haben und in dem ausgewählten Zeitplan antreten können.",sae8f7ac5552b2af1:"Wenn es 10 Minuten bis zur Behandlung gibt, können Sie auf die Videokonferenz zugreifen",saf63dc4c8601ec8c:"a",safe333e385f371ff:"Überprüfen Sie Ihre Zahlung...",saff3019e8a8c5f98:"Montag",sb01184796ad3832e:"Wie war dein Termin?",sb410a3509b92a90c:"Hast du Anmerkungen zum Termin?",sb49dc4c5edae9d4e:"Bewertung der Konsultation",sb5387e21dc21422b:"Behandlung geändert",sb621415007181c43:"Nächster Monat",sb73394814d122852:"Wenn Ihr Arzt irgendeine Dokumentation generiert hat, können Sie sie hier sehen und herunterladen, von der Dokumentation-Sektion, Ihrer E-Mail oder dem Chat.",sb882f28c9b20052e:"Behandlung bestätigt",sba98cf8b2a7dfca4:"Gestern",sbbee712c4900abc2:"Wir konnten den Zahlungsvorgang nicht starten",sbc0be90393c87447:e`Zusammenfassung der Behandlung für ${0}`,sbcf081de432a2172:"Details anzeigen",sbcfc05bdb868b383:"Rezept",sbd07d1f779e482ae:"Wir konnten Ihre Zahlung nicht bestätigen",sbd9803cceb34513a:"Chat mit Kommerzialberater starten",sbda1cf7b293e17d2:"Datei hochladen",sc27e7c4850fc5a34:e`Leider können wir Ihren Termin nicht stornieren, da bis dahin weniger als ${0} Stunden verbleiben.`,sc3bb7ea72886e4d0:"Neueste Dokumente",sc3c7734c15d2a045:"Erzähl uns, wie die Betreuung war oder ob es Probleme mit dem Videocall gab…",sc43929cc6582a185:"Vollständiges Kalender anzeigen",sc4edf6a4e0157d4e:"Nächste Behandlungen",sc6f816a96e8578ff:"Dieser Termin kann leider nicht mehr storniert werden.",sc7cf2be40c8614fa:e`Leider können wir Ihren Termin nicht stornieren, da bis dahin weniger als ${0} Minuten verbleiben.`,sca0e87aae6bde276:"Gab es ein Problem?",sca4bd395e3148194:"Behandlung stornieren bestätigen",sca90bc30758f9082:"Die von Ihnen gesuchte Seite wurde entfernt, umbenannt oder könnte nicht existieren.",scbe4c6673872bda5:"Telefon",sce29e337ebd75277:"Chat mit Support",scf469737e1670fd4:"Nächste Seite",scfc7f5c5f41936dc:"Meine Behandlungen",sd1f44f1a8bc20e67:"E-Mail",sd24922a2783f286e:"Mittwoch",sd2a8fc66c53c1a27:"Überspringen",sd3f7579076c6611c:"Es scheint, dass Sie die erforderlichen Berechtigungen für den Videocall abgelehnt haben. Bearbeiten Sie die Berechtigungen in Ihrem Browser, um einzutreten. Sobald sie erteilt sind, müssen Sie diese Seite aktualisieren.",sd4beaeb9a1b1fed5:"Vorherige Daten",sd812eb30f385776d:"Füllen Sie Ihr Profil aus",sd853d3bcf5341b59:"Mehr anzeigen",sda962b28e9110c82:"Suchen Sie in Ihrem medizinischen Digitalprofil",sdb7004e477873574:"Behandlung storniert",sdd963b1b2ce9a1f5:e`Der Experte wird Ihnen unter ${0} am ausgewählten Zeitplan anrufen. Stellen Sie sicher, dass Sie eine gute Mobilfunkabdeckung haben und in dem ausgewählten Zeitplan antreten können.`,sde993da26c048f19:"Traumatologie, Gynäkologie, Endokrinologie, Verdauungssystem oder Psychiatrie",sdee32ae81ca0d6d8:"Zu Kalender hinzufügen",se00b081edccfae39:"Nächste Daten",se07ea9607704c5ad:"Code ändern",se090f7226b372a4a:"Wenn der Termin nicht stattfinden konnte, kannst du",se0c7cc77f86aa8a0:"Nachname",se17f2b402ecea2e1:"Zurückzugebender Betrag",se18fa3ef98e155de:"Google Pay wird vorbereitet…",se1cce5af3e9bb6ee:"Es ist ein Fehler aufgetreten, während der Datei hochgeladen wurde",se1cf783f86c53031:"Dienstag",se45e6f6f3428ad50:e`Link zur Behandlung: ${0}`,se5a09223256f98db:"Dieses Feld ist erforderlich",se5f9264155b99909:"Es ist ein Problem aufgetreten, während der Zahlungszustand überprüft wurde. Bitte kontaktieren Sie den Support, wenn die Gebühr erstattet wurde.",se92e438da4e7099f:e`Leider können wir Ihren Termin nicht ändern, da bis dahin weniger als ${0} Stunden verbleiben.`,sea11fd8a12559bc5:"Vorherige Behandlung:",seb6739450e8d9c8d:"Sind Sie sicher, dass Sie diese Behandlung stornieren möchten? Sie erhalten den bezahlten Betrag innerhalb von 5-10 Werktagen zurück.",seb850e89f9ff58e8:"Nächste Behandlung",sed750da423170d47:"Ergebnisse für:",sed836a96c3b5d523:"Zahlungsportal",sed8ec5e3c64fa25d:"Gesamt",sed97e90642983578:"Zur Zahlung fortfahren",sedb2092dda465ea1:"DNI/NIE",sedbca9676f07a51f:"Behandlungsmode*",see7c0a7b5b6ebbc5:"Verwenden Sie den Chat, um das Behandlungsmotive, Dokumente oder Bilder zu senden",sefc0dd68776c9466:"Fragebogen vor der Behandlung",sf0638d3fc50964d2:"Andere Datum wählen",sf0695a0a125ae748:"Bestätigen",sf199b210440b7c5f:"Behandlung abgeschlossen",sf3457daf057bff15:"ins Wartezimmer zurückkehren.",sf484a0e20a7829ac:"Wir senden Ihnen eine E-Mail, wenn es Zeit ist, sich für die Videocall zu verbinden. Stellen Sie sicher, dass Sie eine gute Internetverbindung und ein Gerät mit Kamera und Mikrofon haben.",sf48d12e7ae207023:"Spezialität",sf5258cfb2fa10bdc:"Warten Sie auf Ihre Behandlung, ohne dieses Fenster zu verlassen",sf63a72ff4116c6a9:"Dokument herunterladen",sf9705e1c4e82c017:"Fragebogen konnte nicht gesendet werden",sfa6bc28a7faedc92:"Neue Digital-Spezialitäten-Behandlung",sfac5734d03595135:"Alle ansehen",sfc63af0362cfb78b:"Google Pay-Händlerkennung fehlt",sfd51ca4e1b145054:"Es konnte dieser Zeitplan nicht reserviert werden. Bitte wählen Sie einen anderen.",sff337500b69abf7f:"Der Arzt beendet Ihre Behandlung. Aktualisieren Sie in einigen Minuten, um zu sehen, ob Sie Dokumentation haben.",sffbc330c8a19f838:"Weniger anzeigen",sc6a6d42245892254:"Falta el identificador de comercio de Apple Pay",s3da77e69fe62cb2a:"No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.",se1dd5d211b5b00e4:"Apple Pay no está disponible",s7e8b7a5acbdf83ed:"Preparando Apple Pay…",sc8271ba819299b59:"Comprobando Apple Pay…",s57e95bc3afddfeb0:"Para pagar con Apple Pay, escanea el código QR con tu iPhone (iOS 18 o posterior) y confirma el pago.",sf32cd04f9a848ee2:"Pagar con Apple Pay",sfbfb2a1dc8c3f636:"Esta consulta no se puede pagar aquí",s50247070c73385c2:"Por favor, contacta con soporte para poder continuar.",s6a796114fe45025d:e`${0}, ${1} h${2}`,s35d601992fe66fed:"Confirmando tu pago",s5370521b92483bf3:"No cierres, vuelvas atrás ni actualices la ventana; esto puede tardar unos momentos.",s77bf41039c589159:"Tu pago no se ha completado",s0e850d0fec6daf7d:"El pago ha sido rechazado y no hemos creado la cita. No se te ha cobrado nada: puedes volver a reservar desde el inicio.",s4007fa55a28f1f73:"Ese horario ya no está disponible",s0089e78f42dfd1a4:"Otro paciente ha reservado esa cita mientras completabas el pago, así que no hemos podido crearla.",saeefd0d6fb204a80:"Te hemos devuelto el importe automáticamente; puede tardar unos días en reflejarse en tu cuenta.",se478d6710916dadf:"No hemos podido devolverte el importe automáticamente. Escríbenos y lo resolvemos:",sf9e6fbadcce256d0:"Ha ocurrido un error",sa24acad3b1338788:"No hemos podido confirmar tu pago. Por favor, inténtalo de nuevo más tarde.",s8bbbd679ddb50d3b:"Si se te ha cobrado sin una cita confirmada, contacta con nuestro equipo en",s1dec877628213eef:"Tus citas",se0c593aac5e172e6:"Accede, modifica o anula tus citas.",s230b0bee447e61a5:"Ver mis citas"};export{n as templates};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-Bj8p7kJX.js";import{A as s}from"./api-client-context-BXGqBAlO.js";import{C as r,D as l,d}from"./api-chat-client-s45J7LKB.js";import{r as c,p,g as m,a as h}from"./chunk-NIAGR3ZC-BDlNUZa1.js";import{a as u}from"./addSeconds-fO5orJrt.js";import{a as f,i as g,E as v,x as y}from"./lit-element-DiWJYFwC.js";import{n as b}from"./property-scuRaFcM.js";import{getLocale as x}from"../i18n.js";import{calendarIcon as w}from"../ui/icons/calendar-icon.js";import{clockIcon as $}from"../ui/icons/clock-icon.js";import{r as k}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as z}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as q}from"./chunk-S5RWG6G2-CQJ38pW6.js";import{messageBubbleIcon as j}from"../ui/icons/message-bubble-icon.js";import"./mq-chat-room-B_WgeuXn.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as C}from"./consume-CovVqBjI.js";import{Q as _}from"./query-controller-B1byDHlF.js";import{g as S}from"./chunk-Y4EKUX25-Bix9r5ry.js";import"../ui/mq-page-title.js";import{downloadIcon as T}from"../ui/icons/download-icon.js";import{b as D}from"./blob-to-base64-CUL1trde.js";import{DownloadFileEvent as I,MqViewAppointmentsEvent as O}from"../events.js";import{M as P}from"./mutation-controller-CR2qcqhH.js";import{g as E,t as R,b as F,a as U,c as A,e as N}from"./telemetry-client-K37KMdy_.js";let Q=class ChatCta extends f{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new _(this,()=>S(this.apiClient,{roomId:this.roomId}))}static{this.styles=[g`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return y`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${z({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${j({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?y`<mq-unread-badge></mq-unread-badge>`:v}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?y`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:v}</mq-floating-bubble>`}};t([C({context:s,subscribe:!0})],Q.prototype,"apiClient",void 0),t([b({type:Number})],Q.prototype,"roomId",void 0),t([b({type:String})],Q.prototype,"professionalHash",void 0),t([b({type:String})],Q.prototype,"text",void 0),t([b({type:String})],Q.prototype,"consultationId",void 0),t([b({type:Boolean,reflect:!0})],Q.prototype,"readonly",void 0),t([b({attribute:!1})],Q.prototype,"onOpenChat",void 0),t([C({context:q})],Q.prototype,"loginToken",void 0),t([k()],Q.prototype,"isChatOpen",void 0),Q=t([o(),e("chat-cta")],Q);let B=class PageLayout extends f{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=g`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return y`<div><main><slot></slot></main></div>`}};t([b({type:Boolean,attribute:"y-centered"})],B.prototype,"yCentered",void 0),t([b({type:String})],B.prototype,"background",void 0),B=t([e("page-layout")],B);const G=g`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let H=class PatientDocument extends f{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=G}getFormatter(){const t=x().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric",timeZone:c(this.loginToken?.patient?.timezone)})}async _handleDownload(){this.isDownloading=!0;const t=await this.apiClient.flash.downloadDocument({url:this.downloadUrl}),e=await D(t);this.dispatchEvent(new I({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case l.prescription:return i("Receta");case l.report:return i("Informe");case l.diagnosticTestPrescription:return i("Prescripción")}}render(){const t=this.getFormatter().format(p(this.date));return y`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${T({size:24})}</mq-button>`}};t([C({context:s,subscribe:!0})],H.prototype,"apiClient",void 0),t([b({type:String})],H.prototype,"kind",void 0),t([b({type:String})],H.prototype,"filename",void 0),t([b({type:String})],H.prototype,"specialty",void 0),t([b({type:String})],H.prototype,"description",void 0),t([b({type:String})],H.prototype,"date",void 0),t([b({type:String})],H.prototype,"downloadUrl",void 0),t([C({context:q,subscribe:!0})],H.prototype,"loginToken",void 0),t([k()],H.prototype,"isDownloading",void 0),H=t([o(),e("patient-document")],H);const K=g`mq-page-title{margin:var(--size-3) 0}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let M=class DocumentationView extends f{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await this.apiClient.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new _(this,()=>E(this.apiClient)),this._reconnectMutation=new P(this,{mutationFn:t=>this.apiClient.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=K}firstUpdated(){R.track(F(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.appointment.has_chat_in_appointment,e=x(),o=e.replace("_","-"),a=m(this.loginToken.patient.timezone),s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),l=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),c=p(this.appointment.start_date),f=u(c,this.appointment.duration),g=a?h(a,c):"";return y`<mq-page-title .title="${i("Consulta finalizada")}" back-label="${i("Salir")}" @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new O({tab:"history"}))}}"></mq-page-title><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${w()}</dt><dd>${r.format(c)}</dd></div><div class="description-list-item"><dt>${$()}</dt><dd>${l.format(c)} - ${l.format(f)}${g?` (${g})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>y`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?y`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>y`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return U(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{R.track(A(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?y`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:v} ${t?y`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${d(this.appointment.expires_at)}" .onOpenChat="${()=>{R.track(N(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:v}</div>`}};t([C({context:s,subscribe:!0})],M.prototype,"apiClient",void 0),t([b({type:Object})],M.prototype,"appointment",void 0),t([b({type:String})],M.prototype,"token",void 0),t([b({type:Boolean,attribute:"can-reconnect"})],M.prototype,"canReconnect",void 0),t([C({context:q})],M.prototype,"loginToken",void 0),M=t([o(),e("documentation-view")],M);
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-CqjSKFwZ.js";import{A as s}from"./api-client-context-BXGqBAlO.js";import{C as r,D as l,d}from"./api-chat-client-s45J7LKB.js";import{r as c,p,g as m,a as h}from"./chunk-NIAGR3ZC-BDlNUZa1.js";import{a as u}from"./addSeconds-fO5orJrt.js";import{a as f,i as g,E as v,x as y}from"./lit-element-DiWJYFwC.js";import{n as b}from"./property-scuRaFcM.js";import{getLocale as x}from"../i18n.js";import{calendarIcon as w}from"../ui/icons/calendar-icon.js";import{clockIcon as $}from"../ui/icons/clock-icon.js";import{r as k}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as z}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as q}from"./chunk-S5RWG6G2-CQJ38pW6.js";import{messageBubbleIcon as j}from"../ui/icons/message-bubble-icon.js";import"./mq-chat-room-C2EALCSm.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as C}from"./consume-CovVqBjI.js";import{Q as _}from"./query-controller-B1byDHlF.js";import{g as T}from"./chunk-Y4EKUX25-Bix9r5ry.js";import"../ui/mq-page-title.js";import{downloadIcon as S}from"../ui/icons/download-icon.js";import{b as D}from"./blob-to-base64-CUL1trde.js";import{DownloadFileEvent as I,MqViewAppointmentsEvent as O}from"../events.js";import{M as E}from"./mutation-controller-CR2qcqhH.js";import{g as P,t as R,b as F,a as U,c as A,e as N}from"./telemetry-client-DA2_SZBC.js";let Q=class ChatCta extends f{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new _(this,()=>T(this.apiClient,{roomId:this.roomId}))}static{this.styles=[g`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return y`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${z({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${j({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?y`<mq-unread-badge></mq-unread-badge>`:v}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?y`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:v}</mq-floating-bubble>`}};t([C({context:s,subscribe:!0})],Q.prototype,"apiClient",void 0),t([b({type:Number})],Q.prototype,"roomId",void 0),t([b({type:String})],Q.prototype,"professionalHash",void 0),t([b({type:String})],Q.prototype,"text",void 0),t([b({type:String})],Q.prototype,"consultationId",void 0),t([b({type:Boolean,reflect:!0})],Q.prototype,"readonly",void 0),t([b({attribute:!1})],Q.prototype,"onOpenChat",void 0),t([C({context:q})],Q.prototype,"loginToken",void 0),t([k()],Q.prototype,"isChatOpen",void 0),Q=t([o(),e("chat-cta")],Q);let B=class PageLayout extends f{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=g`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return y`<div><main><slot></slot></main></div>`}};t([b({type:Boolean,attribute:"y-centered"})],B.prototype,"yCentered",void 0),t([b({type:String})],B.prototype,"background",void 0),B=t([e("page-layout")],B);const G=g`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let H=class PatientDocument extends f{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=G}getFormatter(){const t=x().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric",timeZone:c(this.loginToken?.patient?.timezone)})}async _handleDownload(){this.isDownloading=!0;const t=await this.apiClient.flash.downloadDocument({url:this.downloadUrl}),e=await D(t);this.dispatchEvent(new I({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case l.prescription:return i("Receta");case l.report:return i("Informe");case l.diagnosticTestPrescription:return i("Prescripción")}}render(){const t=this.getFormatter().format(p(this.date));return y`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${S({size:24})}</mq-button>`}};t([C({context:s,subscribe:!0})],H.prototype,"apiClient",void 0),t([b({type:String})],H.prototype,"kind",void 0),t([b({type:String})],H.prototype,"filename",void 0),t([b({type:String})],H.prototype,"specialty",void 0),t([b({type:String})],H.prototype,"description",void 0),t([b({type:String})],H.prototype,"date",void 0),t([b({type:String})],H.prototype,"downloadUrl",void 0),t([C({context:q,subscribe:!0})],H.prototype,"loginToken",void 0),t([k()],H.prototype,"isDownloading",void 0),H=t([o(),e("patient-document")],H);const M=g`mq-page-title{margin:var(--size-3) 0}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let K=class DocumentationView extends f{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await this.apiClient.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new _(this,()=>P(this.apiClient)),this._reconnectMutation=new E(this,{mutationFn:t=>this.apiClient.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=M}firstUpdated(){R.track(F(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.appointment.has_chat_in_appointment,e=x(),o=e.replace("_","-"),a=m(this.loginToken.patient.timezone),s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),l=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),c=p(this.appointment.start_date),f=u(c,this.appointment.duration),g=a?h(a,c):"";return y`<mq-page-title .title="${i("Consulta finalizada")}" back-label="${i("Salir")}" @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new O({tab:"history"}))}}"></mq-page-title><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${w()}</dt><dd>${r.format(c)}</dd></div><div class="description-list-item"><dt>${$()}</dt><dd>${l.format(c)} - ${l.format(f)}${g?` (${g})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>y`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?y`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>y`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return U(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{R.track(A(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?y`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:v} ${t?y`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${d(this.appointment.expires_at)}" .onOpenChat="${()=>{R.track(N(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:v}</div>`}};t([C({context:s,subscribe:!0})],K.prototype,"apiClient",void 0),t([b({type:Object})],K.prototype,"appointment",void 0),t([b({type:String})],K.prototype,"token",void 0),t([b({type:Boolean,attribute:"can-reconnect"})],K.prototype,"canReconnect",void 0),t([C({context:q})],K.prototype,"loginToken",void 0),K=t([o(),e("documentation-view")],K);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./runtime-Bg1WXVCx.js";const a={s0043fc30b467bc43:"Hide details",s00c8bf60a179e056:"Google Pay is not available. Try card or another payment method.",s035706a468d0c40b:"Friday",s0520ac0a7da193d4:"We couldn't validate the code. Please try again.",s071bd6bbf6c08f34:"Loading",s08404262212123ef:"How can I help you?",s08fe5307b5987c42:"De",s08fe5907b5988674:"Do",s09165307b5ad0e23:"Mi",s09165b07b5ad1bbb:"Ma",s09195307b5af43fa:"Lu",s092e4f07b5c19938:"Ju",s093b3307b5cbf400:"Vi",s09462f07b5d5f4b9:"Sa",s09528d5c26b62213:"Thursday",s0aaec824f7c6b501:"Send message",s0b0085a15991b134:"Reconnecting...",s0b0955208f737a86:"The file exceeds the maximum size allowed",s0eb69642cbc19745:"This appointment has already passed, so it can no longer be modified.",s0fc7c4bfd185800d:"Your prescriptions and medical reports will appear here.",s0fcbdef9dc977231:"An error occurred while loading the page. Please try again or contact support.",s11605fc03de64e14:"Write here...",s12f171594a5379d2:"Are you sure you want to cancel this appointment?",s132e84f499a23985:"No slots available currently",s13317a76a9ed776e:"Repeat",s142eba34d93fe59e:"Description",s1513f3687bfcac96:"Sunday",s1a0efa6ac51e8a85:"Previous page",s1a874fc38d0fcef0:"Medical order",s1d318e9d0ccba86b:"Chat",s1ee6d7e6d04932a4:"The email is not valid",s1fe8bb7f6ae07f9b:"You have no appointments in the history",s219b833c5ca095b3:"Here you will see all the appointments you have had. You can access the documents of each consultation and reschedule an appointment if necessary.",s22cf91a84fba4c4e:"When you schedule an appointment, it will appear here so you can consult it, modify it or cancel it.",s238c3ed6d3ecc66a:"Close",s24b59d5a129dc0d0:"We couldn't cancel the appointment. Please try again.",s255bf4de23c83482:"Booking conditions:",s256189bafbcd2e34:"The phone is not valid",s27e462e9f48eb3a6:"Documentation",s2a1d212b3cb5c1a1:"You can chat with your professional up to 48 hours after your appointment",s2aa2c19d07591438:"You will receive a reminder 15 minutes before the appointment",s2aab27b26a86469f:"Consultation reason",s2b9fde9a5739d2a0:"Name",s2bb20b2162a18938:"Why do you need the consultation?",s2d6183fa992e10e9:"This professional has no available time slots",s2ebd846b5a30f9d1:"We're sorry, we couldn't repeat your appointment. Please contact support.",s30c9095a2e07d929:"Waiting room",s31219c9bdeb7bc3e:"Continue",s337e34cd11150eb6:"View my appointments",s346d488070fe4cc8:"Request appointment",s3944638e633d719a:"Consultation",s3b77baf6a4864231:"Unknown error",s3bd87e3e21b07900:"Wait while the connection is restored",s3dc6584e403858df:"We could not load your documents",s3f55bc3bfec41a5d:"Attach files",s4177fe7f5d70fd33:"Back",s41826ac201c3cd85:"Could not open the support chat",s4364d4be7641e15f:"Confirm appointment",s43e5edcc8801e9a4:"Professional profile",s47afb8f6895a937b:e`We are currently experiencing high demand for ${0} appointments, so you may encounter longer waiting times than usual.`,s4813ee5d305442e5:"It seems we couldn't find you at the time of your appointment. You can schedule another consultation to resolve your questions.",s49683919cdaeca83:"Today",s4a061033615c8016:"Documents",s4a8494821c987a17:"Report",s4a8f1fcd3f5e5952:"It's not time yet!",s4d20157b5a655e70:"This time slot is not available. Please select another.",s4de424f531892818:"Go to videocall",s51c461d40f9fb865:"Select your specialist",s536a0b4d3d4a5d9f:"We could not load your next appointment",s53d957dda6cc200b:"Service and platform provided by",s53e2497bf900c7fd:"You have no upcoming appointments",s5558a2e389d04223:"Modify",s55c5126e99bae190:"Search availability",s563dcbfd432eb18f:"Cancel appointment",s57e65113a89160cf:"Appointment modality",s59612eaa6993aa7e:e`${0} minutes`,s5b7cc3cc732206e2:"The reservation for this time slot has expired. Please select another one.",s5eef402d73eecbdc:"Attach file",s5f7956aacb5c6ca2:"Checking Google Pay…",s5f817b8841b188d2:"More options",s631f73a10d156b22:"Consultation expired",s63f7af84683dd7c3:"This appointment cannot be modified or cancelled: the minimum time required before the start has passed.",s643155d1b6ee1684:"Try again in a few minutes.",s64b78a5026d4ce8d:"No available schedules",s65bedc0e516977d9:"Saturday",s679be6312356a21c:"Schedule a medical consultation when you need it. Here you will see all the details and you can manage your upcoming appointments.",s67f30f9f4ea881f3:"This code is not valid.",s6a50fd7f52263b04:"Could not return to the waiting room",s6ab6fcd87fdbf217:"Hello",s6b1c4fb634461e7c:"Previous month",s6b6fa877ec1e6968:"Chat with the professional",s6c81d42670932f93:"Update",s6e2423db05f36856:"Appointment request",s6ecdc22accc55af7:"Videocall",s70258a0040dd9e19:"Return to the waiting room",s705f4bd8bc8e04d8:"Payment credentials are missing. Go back and try again.",s718177442a7447b2:"Appointment with an expert in less than 72 hours",s733b3bf647b7b0fa:"Accept camera and microphone permissions",s73cad78d8a3c39c2:"Prescription",s74d7a739b6ab651d:"History",s757fef148e0c94c6:"Availability",s77320b73fdd9cc40:"Leave",s775370fdb0af1546:"Birth date",s77c2b712a9813175:"Request a new appointment",s77f8e4bee88d44aa:e`${0} of ${1}`,s7907902da8916212:"The professional will call you at the number you indicate in this field.",s7aa3cd94d51825fc:"There are no professionals available for the selected specialty. Please try again later or select another specialty.",s7af26e861bb6f905:"Google Pay gateway merchant identifier is missing",s7fd8da9511b66dd4:"You can attach images or additional documentation (analyses, test results, etc.) for the doctor to evaluate",s83c6ce869a2bbaa7:"(1 is very bad, 5 is excellent)",s8447efe79d058943:"Amount paid",s8581adc786786298:"File format not supported",s862ca980b16911d0:"Chat with the professional",s8c18dbf02590a72e:"Promo code applied",s8cce15c931017937:"Back to home",s8e7a6119525dc7c9:e`Sorry, since there are less than ${0} minutes until your appointment, we can't modify it.`,s9005845c358db9da:"We couldn't download the document.",s92f34d487d1d0355:"Promotion",s94626d2ffd70f075:"Promo code applied successfully",s9536695467bcf9c4:"This appointment has already passed, so it can no longer be cancelled.",s96474eac63a69381:"Go to chat",s96ceb408923a7ab1:e`No. COL. ${0}`,s970d59d6d88e7e6c:"The payment cannot be started",s979ee14368bf1505:"Chat with me",s9802dd10b2c2f760:"Send",s99898f495319cd49:"This message was deleted",s9c309154722f8e06:"Loading payment portal",s9cabdaf42f04afee:"Enter the code",s9cbf16425cadadb1:"Please try again later.",s9d22fa67943fdc4c:"Phone consultation",sa00e726e1e7e46a9:"Add promo code",sa27f38ad9db3bc4f:"Commercial advisor",sa2fe3f3b565f15f4:"Cancel",sa4186d5e26cab4bb:"Page not found",sa497ebaaeb251035:"Repeat appointment",sa7de4334479674c6:"Modify appointment",sa82bc40dafbe3256:e`Scheduled appointment for ${0}`,sa83d79734eb60ee3:"Apply",sa86d729f62b39f99:"Join the videocall",sa87d2c48a52b2617:"You don't have documentation",sab964c37a0934399:"Google Pay could not be loaded. Check the site configuration and try again.",sac2728ace11e5f4b:"Specialty*",sadc5ede25dd6e126:"The professional will send you a message to coordinate the appointment. Make sure you have good coverage and can attend at the chosen time.",sae8f7ac5552b2af1:"When there are 10 minutes left for your consultation, you can access the videoconference",saf63dc4c8601ec8c:"a",safe333e385f371ff:"Verifying your payment...",saff3019e8a8c5f98:"Monday",sb01184796ad3832e:"How did your appointment go?",sb410a3509b92a90c:"Any comments about the appointment?",sb49dc4c5edae9d4e:"Consultation rating",sb5387e21dc21422b:"Modified appointment",sb621415007181c43:"Next month",sb73394814d122852:"If your doctor has generated any documentation, you can see and download it here, from the documentation section, your email or the chat.",sb882f28c9b20052e:"Confirmed appointment",sba98cf8b2a7dfca4:"Yesterday",sbbee712c4900abc2:"We couldn't start the payment",sbc0be90393c87447:e`Summary of the appointment for ${0}`,sbcf081de432a2172:"View details",sbcfc05bdb868b383:"Prescription",sbd07d1f779e482ae:"We couldn't confirm your payment",sbd9803cceb34513a:"Start chat with commercial advisor",sbda1cf7b293e17d2:"Upload file",sc27e7c4850fc5a34:e`Sorry, since there are less than ${0} hours until your appointment, we can't cancel it.`,sc3bb7ea72886e4d0:"Recent documents",sc3c7734c15d2a045:"Share how the care was or whether you had any issues with the video call…",sc43929cc6582a185:"View full calendar",sc4edf6a4e0157d4e:"Upcoming appointments",sc6f816a96e8578ff:"Sorry, this appointment can no longer be cancelled.",sc7cf2be40c8614fa:e`Sorry, since there are less than ${0} minutes until your appointment, we can't cancel it.`,sca0e87aae6bde276:"Did something go wrong?",sca4bd395e3148194:"Confirm cancellation",sca90bc30758f9082:"The page you are looking for has been removed, renamed, or may not exist.",scbe4c6673872bda5:"Phone",sce29e337ebd75277:"Support chat",scf469737e1670fd4:"Next page",scfc7f5c5f41936dc:"My appointments",sd1f44f1a8bc20e67:"Email",sd24922a2783f286e:"Wednesday",sd2a8fc66c53c1a27:"Skip",sd3f7579076c6611c:"It seems you have denied the necessary permissions to enter the videocall. Edit the permissions in your browser to enter. Once granted, you must refresh this screen.",sd4beaeb9a1b1fed5:"Previous dates",sd812eb30f385776d:"Complete your profile",sd853d3bcf5341b59:"See more",sda962b28e9110c82:"Search in your medical digital profile",sdb7004e477873574:"Consultation cancelled successfully",sdd963b1b2ce9a1f5:e`The professional will call you at ${0} at the selected time. Make sure you have good coverage and can attend at the chosen time.`,sde993da26c048f19:"Traumatology, gynecology, endocrinology, digestive or psychiatry",sdee32ae81ca0d6d8:"Add to calendar",se00b081edccfae39:"Next dates",se07ea9607704c5ad:"Change code",se090f7226b372a4a:"If the appointment couldn't take place, you can",se0c7cc77f86aa8a0:"Last name",se17f2b402ecea2e1:"Amount to refund",se18fa3ef98e155de:"Preparing Google Pay…",se1cce5af3e9bb6ee:"An error occurred while uploading the file",se1cf783f86c53031:"Tuesday",se45e6f6f3428ad50:e`Link to the consultation: ${0}`,se5a09223256f98db:"This field is required",se5f9264155b99909:"An error occurred while verifying your payment status. Please contact support if the charge has been made.",se92e438da4e7099f:e`Sorry, since there are less than ${0} hours until your appointment, we can't modify it.`,sea11fd8a12559bc5:"Previous appointment:",seb6739450e8d9c8d:"Are you sure you want to cancel this appointment? You will receive the amount paid within 5-10 business days.",seb850e89f9ff58e8:"Next appointment",sed750da423170d47:"Results for:",sed836a96c3b5d523:"Payment portal",sed8ec5e3c64fa25d:"Total",sed97e90642983578:"Continue to payment",sedb2092dda465ea1:"DNI/NIE",sedbca9676f07a51f:"Appointment modality*",see7c0a7b5b6ebbc5:"Use the chat to send the consultation reason, documents or images",sefc0dd68776c9466:"Pre-consultation questionnaire",sf0638d3fc50964d2:"Choose another date",sf0695a0a125ae748:"Confirm",sf199b210440b7c5f:"Consultation finished",sf3457daf057bff15:"return to the waiting room.",sf484a0e20a7829ac:"We will send you an email when it is time to connect to the videocall. Make sure you have good internet connection and a device with a camera and microphone.",sf48d12e7ae207023:"Specialty",sf5258cfb2fa10bdc:"Wait for your treatment without leaving this screen",sf63a72ff4116c6a9:"Download document",sf9705e1c4e82c017:"Could not submit the questionnaire",sfa6bc28a7faedc92:"New digital specialties appointment",sfac5734d03595135:"View all",sfc63af0362cfb78b:"Google Pay merchant identifier is missing",sfd51ca4e1b145054:"Could not reserve this time slot. Please select another.",sff337500b69abf7f:"The doctor is finishing your consultation. Update in a few minutes to see if you have documentation.",sffbc330c8a19f838:"See less",sc6a6d42245892254:"Falta el identificador de comercio de Apple Pay",s3da77e69fe62cb2a:"No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.",se1dd5d211b5b00e4:"Apple Pay no está disponible",s7e8b7a5acbdf83ed:"Preparando Apple Pay…",sc8271ba819299b59:"Comprobando Apple Pay…",s57e95bc3afddfeb0:"Para pagar con Apple Pay, escanea el código QR con tu iPhone (iOS 18 o posterior) y confirma el pago.",sf32cd04f9a848ee2:"Pagar con Apple Pay",sfbfb2a1dc8c3f636:"Esta consulta no se puede pagar aquí",s50247070c73385c2:"Por favor, contacta con soporte para poder continuar.",s6a796114fe45025d:e`${0}, ${1} h${2}`,s35d601992fe66fed:"Confirmando tu pago",s5370521b92483bf3:"No cierres, vuelvas atrás ni actualices la ventana; esto puede tardar unos momentos.",s77bf41039c589159:"Tu pago no se ha completado",s0e850d0fec6daf7d:"El pago ha sido rechazado y no hemos creado la cita. No se te ha cobrado nada: puedes volver a reservar desde el inicio.",s4007fa55a28f1f73:"Ese horario ya no está disponible",s0089e78f42dfd1a4:"Otro paciente ha reservado esa cita mientras completabas el pago, así que no hemos podido crearla.",saeefd0d6fb204a80:"Te hemos devuelto el importe automáticamente; puede tardar unos días en reflejarse en tu cuenta.",se478d6710916dadf:"No hemos podido devolverte el importe automáticamente. Escríbenos y lo resolvemos:",sf9e6fbadcce256d0:"Ha ocurrido un error",sa24acad3b1338788:"No hemos podido confirmar tu pago. Por favor, inténtalo de nuevo más tarde.",s8bbbd679ddb50d3b:"Si se te ha cobrado sin una cita confirmada, contacta con nuestro equipo en",s1dec877628213eef:"Tus citas",se0c593aac5e172e6:"Accede, modifica o anula tus citas.",s230b0bee447e61a5:"Ver mis citas"};export{a as templates};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement, PropertyValues } from 'lit';
|
|
4
|
-
import { M as MediquoApiChatClient } from './index.d-
|
|
4
|
+
import { M as MediquoApiChatClient } from './index.d-DHMNq1lu.js';
|
|
5
5
|
import '../ui/mq-checkbox.js';
|
|
6
6
|
import '../ui/mq-button.js';
|
|
7
7
|
import { Env } from '../env.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
import { M as MediquoApiChatClient } from './index.d-
|
|
4
|
+
import { M as MediquoApiChatClient } from './index.d-DHMNq1lu.js';
|
|
5
5
|
import '../ui/mq-button.js';
|
|
6
6
|
import { D as DocumentType } from './document.model.d-DIzMiOmd.js';
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as t}from"./chunk-6CCJWPGL-TiaqZaPV.js";import{D as e}from"./chunk-5EJXDIGT-Bb4_pfDr.js";import{_ as o,c as i}from"./custom-element-D2ziPxYE.js";import{t as r,d as s,a}from"./telemetry-client-
|
|
1
|
+
import{s as t}from"./chunk-6CCJWPGL-TiaqZaPV.js";import{D as e}from"./chunk-5EJXDIGT-Bb4_pfDr.js";import{_ as o,c as i}from"./custom-element-D2ziPxYE.js";import{t as r,d as s,a}from"./telemetry-client-DA2_SZBC.js";import{i as n,a as d,x as l,E as c}from"./lit-element-DiWJYFwC.js";import{n as p}from"./property-scuRaFcM.js";import{c as m}from"./consume-CovVqBjI.js";import{m as h}from"./runtime-Bg1WXVCx.js";import{l as f}from"./localized-decorator-BlOuLhym.js";import{A as u}from"./api-client-context-BXGqBAlO.js";import{l as g}from"./chunk-S5RWG6G2-CQJ38pW6.js";import{D as y}from"./api-chat-client-s45J7LKB.js";import{b as v}from"./blob-to-base64-CUL1trde.js";import{p as w,r as b}from"./chunk-NIAGR3ZC-BDlNUZa1.js";import{r as x}from"./state-LQivXIgA.js";import{DownloadFileEvent as k}from"../events.js";import{getLocale as j}from"../i18n.js";import{download02Icon as $}from"../ui/icons/download-02-icon.js";import"../ui/mq-button.js";import{toast as D}from"../ui/mq-toast.js";import"../ui/mq-skeleton.js";function I(o,i){return{queryKey:t(o,"patient-documents",i),queryFn:()=>o.flash.getPatientDocuments(i),staleTime:e}}const q=n`:host{display:flex;align-items:center;gap:var(--sp-3);padding:var(--sp-1) 0;width:100%;min-width:0;box-sizing:border-box}.details{display:flex;flex-direction:column;align-items:flex-start;gap:6px;flex:1;min-width:0}.tag{display:inline-flex;align-items:center;border-radius:var(--border-radius-sm);padding:var(--sp-1) var(--sp-2);font-family:var(--font-body);font-size:var(--text-xs);line-height:1.35;font-weight:var(--font-weight-normal)}.tag.prescription{background-color:var(--color-feedback--info-subtle,#eceefd);color:var(--color-feedback--info-text,#4a1ea7)}.tag.report{background-color:var(--color-feedback--warning-subtle,#ffebce);color:var(--color-feedback--warning-text,#8f4700)}.tag.diagnostic-test-prescription{background-color:var(--color-feedback--success-subtle,#e8f6ec);color:var(--color-feedback--success-text,#16653a)}.text{display:flex;flex-direction:column;gap:var(--sp-1);width:100%;min-width:0}.name{font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--primary,#0a0a22);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.meta{font-family:var(--font-body);font-size:var(--text-xs);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--secondary,#6d658b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let z=class DocumentRow extends d{constructor(){super(...arguments),this.documentId="",this.name="",this.specialty="",this.date="",this.downloadUrl="",this.patientHash="",this.isDownloading=!1,this.handleDownload=async()=>{this.isDownloading=!0;try{r.track(s(this.patientHash,this.documentId));const t=await this.apiClient.flash.downloadDocument({url:this.downloadUrl}),e=await v(t);this.dispatchEvent(new k({url:e,filename:`${this.name}.pdf`}))}catch{D.error(h("No hemos podido descargar el documento."))}finally{this.isDownloading=!1}}}static{this.styles=q}formatDate(){const t=w(this.date);if(Number.isNaN(t.getTime()))return"";const e=j().replace("_","-");return new Intl.DateTimeFormat(e,{day:"2-digit",month:"2-digit",year:"2-digit",timeZone:b(this.loginToken?.patient?.timezone)}).format(t)}formatKind(){switch(this.kind){case y.prescription:return h("Receta");case y.report:return h("Informe");case y.diagnosticTestPrescription:return h("Orden médica")}}get kindClass(){return(this.kind??"").replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}get metaLine(){return[this.formatDate(),this.specialty].filter(Boolean).join(" - ")}render(){return l`<div class="details"><span class="tag ${this.kindClass}">${this.formatKind()}</span><div class="text"><span class="name" title="${this.name}">${this.name}</span> <span class="meta">${this.metaLine}</span></div></div><mq-button variant="outline" size="icon-lg" aria-label="${h("Descargar documento")}" ?disabled="${this.isDownloading}" @click="${this.handleDownload}">${$({size:24})}</mq-button>`}};function C(t,e,o){return t.map(t=>{const i=e?.find(e=>Number(e.id)===Number(t.professional.speciality_id));return{documentId:t.document_id,kind:t.document_type,name:t.name,specialty:a(i?.code??"",o,i?.name??t.professional.speciality_name),date:t.created_at,downloadUrl:t.url}})}o([m({context:u,subscribe:!0})],z.prototype,"apiClient",void 0),o([p({type:String})],z.prototype,"documentId",void 0),o([p({type:String})],z.prototype,"kind",void 0),o([p({type:String})],z.prototype,"name",void 0),o([p({type:String})],z.prototype,"specialty",void 0),o([p({type:String})],z.prototype,"date",void 0),o([p({type:String})],z.prototype,"downloadUrl",void 0),o([p({type:String})],z.prototype,"patientHash",void 0),o([m({context:g,subscribe:!0})],z.prototype,"loginToken",void 0),o([x()],z.prototype,"isDownloading",void 0),z=o([f(),i("document-row")],z);const S=n`:host{display:flex;flex-direction:column;gap:var(--sp-3);width:100%;min-width:0;box-sizing:border-box}.divider{height:1px;width:100%;background-color:var(--color-border-subtle,#edecf1);flex-shrink:0}`;let N=class DocumentList extends d{constructor(){super(...arguments),this.documents=[],this.patientHash="",this.placeholders=0}static{this.styles=S}get rows(){return this.placeholders>0?Array.from({length:this.placeholders},()=>l`<mq-skeleton height="${"77px"}"></mq-skeleton>`):this.documents.map(t=>l`<document-row documentId="${t.documentId}" kind="${t.kind}" name="${t.name}" specialty="${t.specialty}" date="${t.date}" downloadUrl="${t.downloadUrl}" patientHash="${this.patientHash}"></document-row>`)}render(){const t=this.rows;return t.map((e,o)=>l`${e} ${o<t.length-1?l`<div class="divider"></div>`:c}`)}};o([p({type:Array})],N.prototype,"documents",void 0),o([p({type:String})],N.prototype,"patientHash",void 0),o([p({type:Number})],N.prototype,"placeholders",void 0),N=o([i("document-list")],N);export{I as g,C as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{i as r,a as s,x as o}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";const a=/\r\n?|[\u2028\u2029]/g,i=/(https?:\/\/[^\s<>"]+|www\.[^\s<>"]+)/gi,p=/[.,;:!?)\]}'"»]+$/,l=r`:host{white-space:pre-wrap;overflow-wrap:anywhere;tab-size:4}a{color:var(--color-primary-text-link,#4a1ea7);text-decoration:underline}`;function c(t){return t.split(i).flatMap((t,e)=>e%2==0?[t]:function(t){const e=t.match(p)?.[0]??"",r=t.slice(0,t.length-e.length),s=r.toLowerCase().startsWith("http")?r:`https://${r}`;return[o`<a href="${s}" target="_blank" rel="noopener noreferrer">${r}</a>`,e]}(t))}let h=class ProfessionalDescription extends s{constructor(){super(...arguments),this.text=""}static{this.styles=l}render(){return c(this.text.replace(a,"\n").trim())}};t([n({type:String})],h.prototype,"text",void 0),h=t([e("professional-description")],h);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
4
|
|
|
3
5
|
declare const AppointmentChannelSchema: z.ZodEnum<["videocall", "chat", "phonecall"]>;
|
|
4
6
|
type AppointmentChannel = z.infer<typeof AppointmentChannelSchema>;
|
|
@@ -171,4 +173,15 @@ type Appointment = z.infer<typeof AppointmentSchema>;
|
|
|
171
173
|
declare const ConsultationTypeSchema: z.ZodEnum<["appointment", "chat", "immediate"]>;
|
|
172
174
|
type ConsultationType = z.infer<typeof ConsultationTypeSchema>;
|
|
173
175
|
|
|
176
|
+
declare class ProfessionalDescription extends LitElement {
|
|
177
|
+
static styles: lit.CSSResult;
|
|
178
|
+
text: string;
|
|
179
|
+
render(): (string | TemplateResult)[];
|
|
180
|
+
}
|
|
181
|
+
declare global {
|
|
182
|
+
interface HTMLElementTagNameMap {
|
|
183
|
+
"professional-description": ProfessionalDescription;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
174
187
|
export type { AppointmentChannel as A, ConsultationType as C, Appointment as a };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as a}from"./runtime-Bg1WXVCx.js";import{l as r}from"./localized-decorator-BlOuLhym.js";import{i as n,a as s,x as o}from"./lit-element-DiWJYFwC.js";import{n as i}from"./property-scuRaFcM.js";import{r as d}from"./state-LQivXIgA.js";import{e as l}from"./class-map-Co76I6aw.js";import{chevronLeftIcon as c}from"../ui/icons/chevron-left-icon.js";import{chevronRightIcon as v}from"../ui/icons/chevron-right-icon.js";import{spinnerIcon as h}from"../ui/icons/spinner-icon.js";import{g as p,i as u}from"./format-tMwfQwDf.js";import{t as g,c as m,n as y,g as b,p as f,a as D,s as k}from"./parseISO-CEksKisk.js";import{i as w}from"./isBefore-DBi1CiNR.js";function M(t,e,a){const r=g(t,a?.in);if(isNaN(e))return m(t,NaN);if(!e)return r;const n=r.getDate(),s=m(t,r.getTime());s.setMonth(r.getMonth()+e+1,0);return n>=s.getDate()?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}function S(t,e){const a=g(t,e?.in),r=a.getMonth();return a.setFullYear(a.getFullYear(),r+1,0),a.setHours(23,59,59,999),a}function x(t,e){const{start:a,end:r}=function(t,e){const[a,r]=y(t,e.start,e.end);return{start:a,end:r}}(e?.in,t);let n=+a>+r;const s=n?+a:+r,o=n?r:a;o.setHours(0,0,0,0);const i=[];for(;+o<=s;)i.push(m(a,o)),o.setDate(o.getDate()+1),o.setHours(0,0,0,0);return n?i.reverse():i}function j(t,e){const a=g(t,e?.in);return a.setDate(1),a.setHours(0,0,0,0),a}function E(t,e){const a=b(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,n=g(t,e?.in),s=n.getDay(),o=6+(s<r?-7:0)-(s-r);return n.setDate(n.getDate()+o),n.setHours(23,59,59,999),n}function
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as a}from"./runtime-Bg1WXVCx.js";import{l as r}from"./localized-decorator-BlOuLhym.js";import{i as n,a as s,x as o}from"./lit-element-DiWJYFwC.js";import{n as i}from"./property-scuRaFcM.js";import{r as d}from"./state-LQivXIgA.js";import{e as l}from"./class-map-Co76I6aw.js";import{chevronLeftIcon as c}from"../ui/icons/chevron-left-icon.js";import{chevronRightIcon as v}from"../ui/icons/chevron-right-icon.js";import{spinnerIcon as h}from"../ui/icons/spinner-icon.js";import{g as p,i as u}from"./format-tMwfQwDf.js";import{t as g,c as m,n as y,g as b,p as f,a as D,s as k}from"./parseISO-CEksKisk.js";import{i as w}from"./isBefore-DBi1CiNR.js";function M(t,e,a){const r=g(t,a?.in);if(isNaN(e))return m(t,NaN);if(!e)return r;const n=r.getDate(),s=m(t,r.getTime());s.setMonth(r.getMonth()+e+1,0);return n>=s.getDate()?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}function S(t,e){const a=g(t,e?.in),r=a.getMonth();return a.setFullYear(a.getFullYear(),r+1,0),a.setHours(23,59,59,999),a}function x(t,e){const{start:a,end:r}=function(t,e){const[a,r]=y(t,e.start,e.end);return{start:a,end:r}}(e?.in,t);let n=+a>+r;const s=n?+a:+r,o=n?r:a;o.setHours(0,0,0,0);const i=[];for(;+o<=s;)i.push(m(a,o)),o.setDate(o.getDate()+1),o.setHours(0,0,0,0);return n?i.reverse():i}function j(t,e){const a=g(t,e?.in);return a.setDate(1),a.setHours(0,0,0,0),a}function E(t,e){const a=b(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,n=g(t,e?.in),s=n.getDay(),o=6+(s<r?-7:0)-(s-r);return n.setDate(n.getDate()+o),n.setHours(23,59,59,999),n}function $(t,e){return+g(t)>+g(e)}const N=n`:host{display:block;font-family:var(--font-body)}.calendar{background:var(--color-card);border-radius:var(--border-radius-lg);user-select:none}.calendar-header{display:flex;align-items:center;justify-content:space-between;background:var(--color-primary-background-extraWeak);padding:var(--sp-4);border-radius:var(--border-radius-lg) var(--border-radius-lg) 0 0}.calendar-header-title{font-family:var(--font-titles);font-size:var(--text-lg);font-weight:var(--font-weight-bold);color:var(--color-gray-darkest)}.calendar-body{position:relative;transition:opacity .2s}.calendar-body.loading{opacity:.4;pointer-events:none}.calendar-nav{display:flex;gap:var(--sp-2)}.calendar-nav-button{display:flex;align-items:center;justify-content:center;width:var(--size-8);height:var(--size-8);border:none;background:0 0;border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .2s;color:var(--color-gray-darkest);padding:0}.calendar-nav-button:hover{background:var(--color-background-primary-light)}.calendar-nav-button:disabled{opacity:.3;cursor:not-allowed}.calendar-weekdays{display:grid;grid-template-columns:repeat(7,var(--sp-11));justify-content:space-between;padding:var(--sp-4) var(--sp-4) var(--sp-2) var(--sp-4)}.calendar-weekday{text-align:center;font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-gray-darkest);padding:var(--sp-2)}.calendar-days{display:grid;gap:var(--sp-1);grid-template-columns:repeat(7,var(--sp-11));justify-content:space-between;padding:0 var(--sp-4) var(--sp-4) var(--sp-4)}.calendar-day{width:var(--sp-11);height:var(--sp-11);display:flex;align-items:center;justify-content:center;border:none;background:0 0;border-radius:var(--border-radius-full);cursor:pointer;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);color:var(--color-gray-darkest);transition:all .2s;padding:0;position:relative}.calendar-day:hover:not(:disabled):not(.other-month){background:var(--color-gray-lighter)}.calendar-day.other-month{color:var(--color-gray-medium);background:0 0}.calendar-day:disabled{color:var(--color-gray-medium);background:0 0;cursor:not-allowed}.calendar-day.available:not(.selected){background:var(--color-primary);color:var(--color-white);font-weight:var(--font-weight-semibold)}.calendar-day.available:hover:not(:disabled):not(.selected){background:var(--color-primary-dark)}.calendar-day.selected{background:var(--color-primary);color:var(--color-white);font-weight:var(--font-weight-bold)}.calendar-day.selected:hover:not(:disabled){background:var(--color-primary-dark)}.calendar-day-empty{width:var(--sp-11);height:var(--sp-11)}.calendar-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:10}@media (min-width:640px){.calendar-weekdays{gap:var(--sp-2)}.calendar-days{gap:var(--sp-2)}}@media (min-width:768px){.calendar-weekdays{gap:var(--sp-3)}.calendar-days{gap:var(--sp-3)}}@media (min-width:1024px){.calendar-weekdays{gap:var(--sp-4)}.calendar-days{gap:var(--sp-4)}}`;class DateSelectEvent extends Event{static{this.eventName="date-select"}constructor(t){super(DateSelectEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class PrevMonthEvent extends Event{static{this.eventName="prev-month"}constructor(t){super(PrevMonthEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class NextMonthEvent extends Event{static{this.eventName="next-month"}constructor(t){super(NextMonthEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let C=class MqCalendar extends s{constructor(){super(...arguments),this.locale="es-ES",this.isLoading=!1,this.handlePrevMonth=()=>{const t=this.getCurrentMonthDate(),e=M(t,-1,a);var a;this.dispatchEvent(new PrevMonthEvent({currentMonth:e.toISOString()}))},this.handleNextMonth=()=>{const t=M(this.getCurrentMonthDate(),1);this.dispatchEvent(new NextMonthEvent({currentMonth:t.toISOString()}))},this.handleDayClick=t=>{t.isDisabled||(this.selectedDate=t.date,this.value=t.date.toISOString(),this.dispatchEvent(new DateSelectEvent({date:t.date.toISOString()})),this.requestUpdate())}}static{this.styles=[N]}connectedCallback(){super.connectedCallback(),this.value&&(this.selectedDate=f(this.value))}getMonthYear(){const t=this.getCurrentMonthDate();return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(t)}getCurrentMonthDate(){return this.currentMonth?f(this.currentMonth):this.getToday()}getToday(){return f(p(new Date,this.timezone))}getWeekdays(){const t=D(new Date(2024,0,1),{weekStartsOn:1}),e=x({start:t,end:E(t,{weekStartsOn:1})}),a=new Intl.DateTimeFormat(this.locale,{weekday:"narrow"});return e.map(t=>a.format(t).toUpperCase())}getDaysInMonth(){const t=this.getCurrentMonthDate(),e=j(t),a=S(t);return x({start:D(e,{weekStartsOn:1}),end:E(a,{weekStartsOn:1})}).map(e=>{const a=function(t,e,a){const[r,n]=y(a?.in,t,e);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}(e,t);return this.createCalendarDay(e,a)})}createCalendarDay(t,e){const a=k(t),r=u(a,this.getToday()),n=this.isDateAvailable(a);return{date:a,isCurrentMonth:e,isToday:r,isDisabled:this.isDateDisabled(a,n),isSelected:!!this.selectedDate&&u(a,this.selectedDate),isAvailable:n}}isDateAvailable(t){if(!this.availableDays||0===this.availableDays.length)return!1;const e=k(t);return this.availableDays.some(t=>{const a=k(f(t));return u(e,a)})}isDateDisabled(t,e){const a=k(t);if(this.availableDays&&this.availableDays.length>0)return!e;if(this.minDate){const t=k(f(this.minDate));if(w(a,t))return!0}if(this.maxDate){if($(a,k(f(this.maxDate))))return!0}return!1}render(){const t=this.getDaysInMonth(),e=this.getWeekdays();return o`<div class="calendar"><div class="calendar-header"><button class="calendar-nav-button" @click="${this.handlePrevMonth}" aria-label="${a("Mes anterior")}">${c({size:24})}</button><div class="calendar-header-title">${this.getMonthYear()}</div><button class="calendar-nav-button" @click="${this.handleNextMonth}" aria-label="${a("Mes siguiente")}">${v({size:24})}</button></div><div class="calendar-body ${this.isLoading?"loading":""}"><div class="calendar-weekdays">${e.map(t=>o`<div class="calendar-weekday">${t}</div>`)}</div><div class="calendar-days">${t.map(t=>t.isCurrentMonth?o`<button class="${l({"calendar-day":!0,"other-month":!t.isCurrentMonth,today:t.isToday,selected:t.isSelected,available:t.isAvailable})}" ?disabled="${t.isDisabled||this.isLoading}" @click="${()=>this.handleDayClick(t)}" aria-label="${t.date.toLocaleDateString(this.locale)}">${t.date.getDate()}</button>`:o`<div class="calendar-day-empty"></div>`)}</div>${this.isLoading?o`<div class="calendar-spinner">${h({size:40,color:"var(--color-primary)"})}</div>`:""}</div></div>`}};t([i({type:String})],C.prototype,"locale",void 0),t([i({type:String,attribute:"min-date"})],C.prototype,"minDate",void 0),t([i({type:String,attribute:"max-date"})],C.prototype,"maxDate",void 0),t([i({type:String})],C.prototype,"value",void 0),t([i({type:Boolean,attribute:"is-loading"})],C.prototype,"isLoading",void 0),t([i({type:String,attribute:"current-month"})],C.prototype,"currentMonth",void 0),t([i({type:Array,attribute:"available-days"})],C.prototype,"availableDays",void 0),t([i({type:String})],C.prototype,"timezone",void 0),t([d()],C.prototype,"selectedDate",void 0),C=t([r(),e("mq-calendar")],C);export{DateSelectEvent as D,C as M,NextMonthEvent as N,PrevMonthEvent as P,S as e,$ as i,j as s};
|
|
@@ -2,7 +2,7 @@ import * as lit_html from 'lit-html';
|
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
4
|
import { D as DocumentType } from './document.model.d-DIzMiOmd.js';
|
|
5
|
-
import { M as MediquoApiChatClient } from './index.d-
|
|
5
|
+
import { M as MediquoApiChatClient } from './index.d-DHMNq1lu.js';
|
|
6
6
|
import '../ui/mq-button.js';
|
|
7
7
|
import '../ui/mq-skeleton.js';
|
|
8
8
|
|
|
@@ -1300,11 +1300,6 @@ declare const GetAppointmentConsultationCouponResponseSchema: z.ZodObject<{
|
|
|
1300
1300
|
name?: string | null | undefined;
|
|
1301
1301
|
}>;
|
|
1302
1302
|
type GetAppointmentConsultationCouponResponse = z.infer<typeof GetAppointmentConsultationCouponResponseSchema>;
|
|
1303
|
-
declare const PaymentProvider: {
|
|
1304
|
-
readonly Addon: "addon";
|
|
1305
|
-
readonly Stripe: "stripe";
|
|
1306
|
-
};
|
|
1307
|
-
type PaymentProvider = (typeof PaymentProvider)[keyof typeof PaymentProvider];
|
|
1308
1303
|
declare const CreatePaymentLinkResponseSchema: z.ZodObject<{
|
|
1309
1304
|
session_id: z.ZodString;
|
|
1310
1305
|
payment_link: z.ZodString;
|
|
@@ -3332,5 +3327,5 @@ declare class MediquoApiChatClient {
|
|
|
3332
3327
|
setLanguage(language: string): void;
|
|
3333
3328
|
}
|
|
3334
3329
|
|
|
3335
|
-
export { MediquoApiChatClient as M
|
|
3336
|
-
export type {
|
|
3330
|
+
export { MediquoApiChatClient as M };
|
|
3331
|
+
export type { FileMessage as F, GetAppointmentsResponse as G, ImageMessage as I, ScheduleProfessional as S, Message as a, GetOrganizationSetupResponse as b, GetScheduleServicesResponse as c };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as a}from"./task-
|
|
1
|
+
import{h as a}from"./task-CqjSKFwZ.js";var s=class extends a{constructor(a,s,t){super(a,{task:async([a,t])=>await s().auth.loginToken({api_key:a,token:t}),...t})}};export{s as L};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement, PropertyValues } from 'lit';
|
|
4
|
-
import { M as MediquoApiChatClient, a as Message, I as ImageMessage, F as FileMessage } from './index.d-
|
|
4
|
+
import { M as MediquoApiChatClient, a as Message, I as ImageMessage, F as FileMessage } from './index.d-DHMNq1lu.js';
|
|
5
5
|
import '../ui/mq-avatar.js';
|
|
6
6
|
import '../ui/mq-button.js';
|
|
7
7
|
import '../ui/mq-skeleton.js';
|
|
8
|
-
import { C as ConsultationType } from './
|
|
8
|
+
import { C as ConsultationType } from './index-DwlJg2um.js';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { QueryClient } from '@tanstack/query-core';
|
|
11
11
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,c as t}from"./custom-element-D2ziPxYE.js";import{e as s}from"./provide-BwI4DDGF.js";import{c as i}from"./consume-CovVqBjI.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{m as a,s as r}from"./runtime-Bg1WXVCx.js";import{A as n}from"./api-client-context-BXGqBAlO.js";import{i as l,a as d,x as c,E as m}from"./lit-element-DiWJYFwC.js";import{n as h}from"./property-scuRaFcM.js";import{r as p}from"./state-LQivXIgA.js";import{n as g}from"./create-context-DqP79qjF.js";import{tokens as u}from"../theme.js";import{xIcon as v}from"../ui/icons/x-icon.js";import"../ui/mq-avatar.js";import"../ui/mq-button.js";import"../ui/mq-skeleton.js";import{Q as y}from"./query-controller-B1byDHlF.js";import{g as b}from"./chunk-BUV4MGML-CkhBbfUu.js";import{o as f}from"./if-defined-BYeVdwgd.js";import{chevronLeftIcon as w}from"../ui/icons/chevron-left-icon.js";import{l as x}from"./chunk-S5RWG6G2-CQJ38pW6.js";import{r as k,c as $}from"./chunk-NIAGR3ZC-BDlNUZa1.js";import{e as C}from"./query-CeeutdfT.js";import{l as z}from"./chunk-FUCSYDW7-Duj5hy8S.js";import{DownloadFileEvent as I}from"../events.js";import{M as T,c as M,n as D}from"./api-chat-client-s45J7LKB.js";import{S,g as q}from"./chunk-Y4EKUX25-Bix9r5ry.js";import{checkDoubleIcon as j}from"../ui/icons/check-double-icon.js";import{checkIcon as P}from"../ui/icons/check-icon.js";import{getLocale as A}from"../i18n.js";import{f as _,p as E}from"./parseISO-CEksKisk.js";import{a as R}from"./addDays-CdyO-PRI.js";import{S as U,E as B}from"./chunk-YTQUGGS3-DH0H7ld7.js";import{s as N}from"./context-consumer-ESdICVAb.js";import{s as H}from"./chunk-6CCJWPGL-TiaqZaPV.js";import{Q as L}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{e as K}from"./class-map-Co76I6aw.js";import"./index-Djkwyh_M.js";import{M as O}from"./mutation-controller-CR2qcqhH.js";const F=g("apiKey"),Q=g("token"),V=g("professionalHash"),G=g("roomId"),Z=g("consultationId"),J=g("consultationType");class MqChatRoomCloseEvent extends Event{static{this.eventName="mq-chat-room-close"}constructor(){super(MqChatRoomCloseEvent.eventName,{bubbles:!0,composed:!0})}}class MqChatRoomProfileEvent extends Event{static{this.eventName="mq-chat-room-profile"}constructor(){super(MqChatRoomProfileEvent.eventName,{bubbles:!0,composed:!0})}}const W=l`header{padding:var(--size-3) var(--size-4);background-color:var(--color-background-primary);display:flex;justify-content:space-between;gap:var(--size-1)}.left-side{display:flex;flex:1;min-width:0;align-items:center;gap:var(--size-3)}.left-side mq-avatar{flex-shrink:0}.info{min-width:0}.ghost-btn{text-align:left;background:0 0;border:none;padding:0;cursor:pointer}.right-side{display:flex;align-items:center}.name{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold);margin:0;color:var(--color-background);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.specialty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0;color:var(--color-white);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.name-skeleton{margin-bottom:var(--size-1)}.profile-title{font-family:var(--font-body);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-medium);margin:0;color:var(--color-white)}`;let Y=class ChatRoomHeader extends d{constructor(){super(...arguments),this.hideCloseButton=!1,this.getProfessionalQuery=new y(this,()=>b(this.apiClient,{hash:this.professionalHash}))}static{this.styles=W}handleClose(){this.dispatchEvent(new MqChatRoomCloseEvent)}handleClickProfile(){this.dispatchEvent(new MqChatRoomProfileEvent)}renderProfile(){return c`<div class="left-side"><mq-button type="button" size="icon-md" variant="ghost-inverted" @click="${()=>{this.dispatchEvent(new CustomEvent("goto-chat",{bubbles:!0,composed:!0}))}}">${w({size:24})}</mq-button><p class="profile-title">${a("Perfil de profesional")}</p></div>`}renderChat(){return c`${this.getProfessionalQuery.render({complete:e=>c`<button type="button" class="left-side ghost-btn" @click="${this.handleClickProfile}"><mq-avatar src="${f(e.avatar??void 0)}" alt="User Avatar" fallback="John Doe" size="sm"></mq-avatar><div class="info"><p class="name">${e.name}</p><p class="specialty">${e.title}</p></div></button>`,pending:()=>c`<div class="left-side"><mq-skeleton width="45px" height="45px" border-radius="full"></mq-skeleton><div><mq-skeleton class="name-skeleton" height="14px" width="120px"></mq-skeleton><mq-skeleton height="14px" width="100px"></mq-skeleton></div></div>`})}`}render(){return c`<header>${"profile"===this.view?this.renderProfile():this.renderChat()}<div class="right-side">${this.hideCloseButton?m:c`<mq-button type="button" size="icon-md" variant="ghost-inverted" @click="${this.handleClose}">${v({size:24})}</mq-button>`}</div></header>`}};e([i({context:n,subscribe:!0})],Y.prototype,"apiClient",void 0),e([h({type:String})],Y.prototype,"professionalHash",void 0),e([h({type:Boolean})],Y.prototype,"hideCloseButton",void 0),e([h({type:String})],Y.prototype,"view",void 0),Y=e([o(),t("chat-room-header")],Y);const X=/(https?:\/\/[^\s,;:!)\]}\]]+|www\.[^\s,;:!)\]}\]]+|[a-zA-Z0-9][-a-zA-Z0-9]*(?:\.[a-zA-Z0-9][-a-zA-Z0-9]*)+(?:\/[^\s,;:!)\]}\]]*|(?:\?|#|&)[^\s,;:!)\]}\]]*)?)/gi;function ee(e){return e.split(X).map((e,t)=>{if(t%2==1){const t=e.startsWith("http")?e:`https://${e}`;return c`<a href="${t}" target="_blank" rel="noopener noreferrer" class="message-link">${e}</a>`}return e})}let te=class TextMessageBubble extends d{static{this.styles=[l`:host{display:block}.message-bubble{padding:var(--size-2_5) var(--size-4);border-radius:var(--border-radius-lg);word-wrap:break-word;font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal)}.message-bubble.received{background-color:var(--chat-received-message-background);color:var(--chat-received-message-foreground);border-bottom-left-radius:0}.message-bubble.sent{background-color:var(--chat-sent-message-background);color:var(--chat-sent-message-foreground);border-bottom-right-radius:0}.message-content{white-space:pre-wrap}.message-paragraph{margin:0 0 var(--size-3) 0}.message-paragraph:last-child{margin-bottom:0}.message-bubble.received .message-content a.message-link,.message-bubble.sent .message-content a.message-link{color:var(--color-primary-link-default);text-decoration:underline}.message-bubble.received .message-content a.message-link:hover,.message-bubble.sent .message-content a.message-link:hover{opacity:.8}`]}formatMessageContent(e){const t=e.split("\n\n").filter(e=>e.trim());if(t.length<=1)return c`<div class="message-content">${ee(e)}</div>`;const s=t.map(e=>c`<div class="message-paragraph">${ee(e.trim())}</div>`);return c`<div class="message-content">${s}</div>`}render(){return c`<div class="message-bubble ${this.kind}">${this.formatMessageContent(this.message.string)}</div>`}};e([h({type:Object})],te.prototype,"message",void 0),e([h({type:String})],te.prototype,"kind",void 0),te=e([t("text-message-bubble")],te);const se=l`:host{display:block}.message-bubble{padding:var(--size-2);border-radius:var(--border-radius-lg);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);overflow:hidden}.message-bubble.received{background-color:var(--chat-received-message-background);border-bottom-left-radius:0}.message-bubble.sent{background-color:var(--chat-sent-message-background);border-bottom-right-radius:0}.image-content{display:block;width:229px;height:229px;object-fit:cover;border-radius:var(--border-radius-md)}.image-placeholder{display:flex;align-items:center;justify-content:center;width:100%;max-width:300px;height:200px;background-color:var(--color-gray-light);border-radius:var(--border-radius-md);color:var(--chat-sent-message-foreground);font-size:var(--text-sm)}.image-content{cursor:pointer;transition:opacity .2s ease}.image-content:hover{opacity:.9}.preview-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:var(--dialog-underlay);display:flex;align-items:center;justify-content:center;z-index:1000;cursor:pointer;opacity:0;transition:opacity var(--dialog-transition-duration) ease}.preview-overlay.open{opacity:1}.preview-image{position:fixed;z-index:1000;inset:var(--mq-safe-top,0) var(--mq-safe-right,0) var(--mq-safe-bottom,0) var(--mq-safe-left,0);max-width:calc(100% - var(--mq-safe-left,4px) - var(--mq-safe-right,4px));max-height:calc(100% - var(--mq-safe-top,4px) - var(--mq-safe-bottom,4px));margin:auto;object-fit:contain;cursor:default;box-shadow:var(--dialog-shadow);transform:scale(.95);transition:transform var(--dialog-transition-duration) ease}.preview-overlay.open .preview-image{transform:scale(1)}.preview-close{z-index:1001;display:inline-flex;align-items:center;justify-content:center;height:var(--size-10);width:var(--size-10);position:absolute;top:var(--mq-safe-top,4px);right:var(--mq-safe-right,4px);background:rgba(255,255,255,.3);border:none;color:var(--color-neutrals-text-default);font-size:var(--text-xl);padding:var(--size-2) var(--size-3);border-radius:var(--border-radius-md);cursor:pointer;transition:background var(--dialog-transition-duration) ease}.preview-close:hover{background:var(--dialog-close-hover-bg)}`;let ie=class ImageMessageBubble extends d{constructor(){super(...arguments),this.showPreview=!1,this.isPreviewRendered=!1,this.isPreviewActive=!1,this.closeTimer=null}static{this.styles=se}handleImageError(e){const t=e.target;t.style.display="none";const s=t.nextElementSibling;s&&(s.style.display="flex")}handleImageLoad(e){const t=e.target.nextElementSibling;t&&(t.style.display="none")}handleImageClick(){this.showPreview=!0,this.isPreviewRendered=!0,this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.isPreviewActive=!0})})}handleImageKeyDown(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleImageClick())}handleClosePreview(e){e&&e.stopPropagation(),this.isPreviewActive=!1,this.closeTimer&&window.clearTimeout(this.closeTimer),this.closeTimer=window.setTimeout(()=>{this.isPreviewRendered=!1,this.showPreview=!1,this.closeTimer=null},200)}handleOverlayClick(e){e.target===e.currentTarget&&this.handleClosePreview()}handleOverlayKeyDown(e){"Enter"!==e.key&&" "!==e.key||e.target===e.currentTarget&&(e.preventDefault(),this.handleClosePreview())}handleKeyDown(e){"Escape"===e.key&&this.showPreview&&(e.preventDefault(),this.handleClosePreview())}handlePreviewImageKeyDown(e){e.stopPropagation()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown.bind(this)),this.closeTimer&&(window.clearTimeout(this.closeTimer),this.closeTimer=null)}render(){const e=this.message.attachment.signed_url??this.message.attachment.url;return c`<div class="message-bubble ${this.kind}"><img class="image-content" src="${e}" width="229" height="229" alt="Shared attachment" @error="${this.handleImageError}" @load="${this.handleImageLoad}" @click="${this.handleImageClick}" @keydown="${this.handleImageKeyDown}" tabindex="0"><div class="image-placeholder" style="display:none">Image unavailable</div></div>${this.showPreview&&this.isPreviewRendered?c`<div class="preview-overlay ${this.isPreviewActive?"open":""}" @click="${this.handleOverlayClick}" @keydown="${this.handleOverlayKeyDown}" tabindex="0"><button class="preview-close" @click="${this.handleClosePreview}" aria-label="Close preview">${v({size:24})}</button> <img class="preview-image" src="${e}" alt="Shared attachment preview" @click="${e=>e.stopPropagation()}" @keydown="${this.handlePreviewImageKeyDown}" tabindex="0"></div>`:""}`}};e([h({type:Object})],ie.prototype,"message",void 0),e([h({type:String})],ie.prototype,"kind",void 0),e([i({context:Q})],ie.prototype,"token",void 0),e([p()],ie.prototype,"showPreview",void 0),e([p()],ie.prototype,"isPreviewRendered",void 0),e([p()],ie.prototype,"isPreviewActive",void 0),ie=e([t("image-message-bubble")],ie);const oe=l`:host{background-color:var(--chat-system-message-background);color:var(--chat-system-message-foreground);display:block;padding:var(--size-2_5) var(--size-4);border-radius:var(--border-radius-lg);font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal)}a.message-link{color:var(--color-primary-link-default);text-decoration:underline}a.message-link:hover{opacity:.8}`;let ae=class SystemMessageBubble extends d{static{this.styles=oe}render(){return c`<div class="system-message-bubble">${ee(this.message.string)}</div>`}};e([h({type:Object})],ae.prototype,"message",void 0),ae=e([t("system-message-bubble")],ae);const re=l`:host{display:block}.message-bubble{display:inline-block;padding:var(--size-2_5) var(--size-4);border-radius:var(--border-radius-lg);word-wrap:break-word;font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);text-decoration:underline;color:var(--color-primary-link-default);border:none;cursor:pointer;text-align:left}.message-bubble:hover:not(:disabled){opacity:.8}.message-bubble:disabled{opacity:.5;cursor:not-allowed}.message-bubble.received{background-color:var(--chat-received-message-background);border-bottom-left-radius:0}.message-bubble.sent{background-color:var(--chat-sent-message-background);border-bottom-right-radius:0}.message-content{white-space:pre-wrap}.message-paragraph{margin:0 0 var(--size-3) 0}.message-paragraph:last-child{margin-bottom:0}`;let ne=class FileMessageBubble extends d{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=re}formatMessageContent(e){const t=e.split("\n\n").filter(e=>e.trim());if(t.length<=1)return c`<div class="message-content">${e}</div>`;const s=t.map(e=>c`<div class="message-paragraph">${e.trim()}</div>`);return c`<div class="message-content">${s}</div>`}async handleDownload(){if(this.isDownloading)return;const e=this.message.attachment.url;try{this.isDownloading=!0;const t=await fetch(e,{headers:{Authorization:`Bearer ${this.token}`}});if(!t.ok)throw new Error(`Failed to fetch file: ${t.statusText}`);const s=await t.blob(),i=new FileReader;i.onloadend=()=>{const e=i.result,t=new I({url:e,filename:this.message.attachment.file_name});this.dispatchEvent(t),this.isDownloading=!1},i.onerror=()=>{z.error("Error reading file as data URL"),this.isDownloading=!1},i.readAsDataURL(s)}catch(e){z.error("Error downloading file:",e),this.isDownloading=!1}}render(){return c`<button type="button" @click="${this.handleDownload}" class="message-bubble ${this.kind}" ?disabled="${this.isDownloading}">${this.formatMessageContent(this.message.attachment.file_name)}</button>`}};e([h({type:Object})],ne.prototype,"message",void 0),e([h({type:String})],ne.prototype,"kind",void 0),e([i({context:Q})],ne.prototype,"token",void 0),e([p()],ne.prototype,"isDownloading",void 0),ne=e([t("file-message-bubble")],ne);let le=class MessageBubble extends d{constructor(){super(...arguments),this.showTimestamp=!0}static{this.styles=[l`:host{display:block}.timestamp{font-family:var(--font-body);font-size:var(--text-xs);color:var(--color-gray-medium);font-weight:var(--font-weight-normal);text-align:left;display:flex;align-items:center;gap:var(--size-1)}.timestamp.sent{text-align:right;justify-content:flex-end}.status-icon{width:12px;height:12px}.status-icon.read{color:var(--color-primary)}`]}formatTimestamp(e){if(!e)return"";try{const t=new Date(e);return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:k(this.timezone)}).format(t)}catch{return e}}renderStatusIcon(){switch(this.message.status){case T.Sent:return P({size:12,color:"currentColor"});case T.Received:return j({size:12,color:"currentColor"});case T.Read:return j({size:12,color:"currentColor",className:"read"});default:return null}}renderBubbleContent(){switch(this.message.type){case"image":return c`<image-message-bubble .message="${this.message}" .kind="${this.kind}"></image-message-bubble>`;case"file":return c`<file-message-bubble .message="${this.message}" .kind="${this.kind}"></file-message-bubble>`;default:return c`<text-message-bubble .message="${this.message}" .kind="${this.kind}"></text-message-bubble>`}}render(){if(this.message.senderType===S.system)return c`<system-message-bubble .message="${this.message}"></system-message-bubble>`;const e=this.message.createdAt?new Date(this.message.createdAt):this.message.time?new Date(this.message.time):null;return c`${this.renderBubbleContent()} ${this.showTimestamp&&e?c`<div class="timestamp ${this.kind}">${this.formatTimestamp(e.toISOString())} ${"sent"===this.kind?c`<span class="status-icon ${this.message.status===T.Read?"read":""}">${this.renderStatusIcon()}</span>`:""}</div>`:""}`}};e([h({type:String})],le.prototype,"kind",void 0),e([h({type:Object})],le.prototype,"message",void 0),e([h({type:Boolean})],le.prototype,"showTimestamp",void 0),e([h({type:String})],le.prototype,"timezone",void 0),le=e([t("message-bubble")],le);let de=class DateBanner extends d{constructor(){super(...arguments),this.date=""}static{this.styles=[u,l`:host{display:block;margin-bottom:var(--size-2)}.date-banner{display:flex;align-items:center;justify-content:center;position:relative}.date-text{background-color:var(--color-gray-light);color:var(--color-gray-darker);font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);padding:var(--size-1) var(--size-2);border-radius:var(--border-radius-2xl);white-space:nowrap}`]}formatDate(e){const t=A().replace("_","-"),s=$(new Date,k(this.timezone)),i=_((o=E(s),R(o,-1,r)),"yyyy-MM-dd");var o,r;return e===s?a("Hoy"):e===i?a("Ayer"):E(e).toLocaleDateString(t,{dateStyle:"medium"})}render(){return c`<div class="date-banner"><span class="date-text">${this.formatDate(this.date)}</span></div>`}};function ce(e){return e.createdAt?new Date(e.createdAt):e.time?new Date(e.time):new Date}e([h({type:String})],de.prototype,"date",void 0),e([h({type:String})],de.prototype,"timezone",void 0),de=e([o(),t("date-banner")],de);let me=class MessagesList extends d{constructor(){super(...arguments),this.messages=[]}static{this.styles=[u,l`:host{display:block;width:100%;height:100%;overflow-y:auto;overflow-x:hidden}.messages-container{display:flex;flex-direction:column;padding:var(--size-4);gap:var(--size-1);background-color:var(--color-white);padding-bottom:var(--size-4)}.message-wrapper{display:flex;width:100%}.message-wrapper.received{justify-content:flex-start}.message-wrapper.sent{justify-content:flex-end}.message-wrapper.system{justify-content:center}message-bubble{max-width:70%}`]}get timezone(){return k(this.loginToken?.patient?.timezone)}scrollToBottom(){requestAnimationFrame(()=>{const e=this.messagesContainerEnd;e&&e.scrollIntoView({behavior:"instant",block:"end"})})}shouldShowMessageTimestamp(e,t){if(e.senderType===S.system)return!1;if(!t)return!0;if(t.senderType!==e.senderType)return!0;if(t.senderType===S.ordinary&&e.senderType===S.ordinary&&t.fromUserHash!==e.fromUserHash)return!0;return(ce(t).getTime()-ce(e).getTime())/6e4>1}groupMessagesByDate(e){const t=[];let s=null;const i=this.timezone;return e.forEach((o,a)=>{const r=$(ce(o),i);r!==s&&(t.push({type:"date",data:r}),s=r);const n=e[a+1],l=this.shouldShowMessageTimestamp(o,n);t.push({type:"message",data:o,showTimestamp:l})}),t}firstUpdated(){this.scrollToBottom()}willUpdate(e){e.has("messages")&&this.scrollToBottom()}render(){const e=this.groupMessagesByDate(this.messages),t=e.map((t,s)=>{if("date"===t.type)return c`<date-banner .date="${t.data}" .timezone="${this.timezone}"></date-banner>`;const i=this.professionalHash!==t.data.fromUserHash,o=t.data.senderType===S.system?"system":i?"sent":"received";return c`<div class="message-wrapper ${o}"><message-bubble .message="${t.data}" .kind="${o}" .timezone="${this.timezone}" .showTimestamp="${t.showTimestamp||"date"===e[s+1]?.type}"></message-bubble></div>`});return c`<div class="messages-container">${t}<div class="messages-container-end"></div></div>`}};e([h({type:Array})],me.prototype,"messages",void 0),e([h({type:String})],me.prototype,"professionalHash",void 0),e([i({context:x,subscribe:!0})],me.prototype,"loginToken",void 0),e([C(".messages-container-end")],me.prototype,"messagesContainerEnd",void 0),me=e([t("messages-list")],me);let he=class MessageBubbleSkeleton extends d{constructor(){super(...arguments),this.variant="patient",this.height="md",this.showTimestamp=!0}static{this.styles=[l`:host{display:block}.message-bubble{padding:var(--size-4);border-radius:var(--border-radius-lg);margin-bottom:var(--size-1);position:relative;overflow:hidden}.message-bubble.doctor{background-color:var(--color-gray-light);border-bottom-left-radius:0}.message-bubble.patient{background-color:var(--color-background-primary-light);border-bottom-right-radius:0}:host([height=sm]) .message-bubble{height:var(--size-8)}:host([height=md]) .message-bubble{height:var(--size-12)}`]}render(){return c`<div class="message-bubble ${this.variant}"></div>${this.showTimestamp?c`<div class="timestamp-skeleton ${this.variant}"></div>`:""}`}};e([h({type:String})],he.prototype,"variant",void 0),e([h({type:String})],he.prototype,"height",void 0),e([h({type:Boolean})],he.prototype,"showTimestamp",void 0),he=e([t("message-bubble-skeleton")],he);let pe=class MessagesSkeleton extends d{constructor(){super(...arguments),this.messageCount=6}static{this.styles=[u,l`:host{display:block;width:100%;height:100%;overflow:hidden}.messages-container{display:flex;flex-direction:column;padding:var(--size-4);gap:var(--size-3);max-width:100%;height:100%;background-color:var(--color-white)}.message-wrapper{display:flex;width:100%}.message-wrapper.doctor{justify-content:flex-start}.message-wrapper.patient{justify-content:flex-end}message-bubble-skeleton{max-width:85%;min-width:60%;width:100%}`]}getSkeletonHeight(e){const t=["sm","md","sm","md","sm","md"];return t[e%t.length]}getSkeletonVariant(e){const t=["doctor","patient","doctor","doctor","patient","doctor","patient"];return t[e%t.length]}renderSkeletonMessages(){return Array.from({length:this.messageCount},(e,t)=>{const s=this.getSkeletonVariant(t),i=this.getSkeletonHeight(t);return c`<div class="message-wrapper ${s}"><message-bubble-skeleton variant="${s}" height="${i}" ?showTimestamp="${t===this.messageCount-1||Math.random()>.7}"></message-bubble-skeleton></div>`})}render(){return c`<div class="messages-container">${this.renderSkeletonMessages()}</div>`}};e([h({type:Number})],pe.prototype,"messageCount",void 0),pe=e([t("messages-skeleton")],pe);var ge=class{constructor(e,t){this.host=e,this.listeners=[],this.host.addController(this),this.socketContext=new N(this.host,{context:U,subscribe:!0,callback:e=>{if(e&&(this.socket=e,t?.listeners)){this.listeners=t.listeners;for(const e of this.listeners)this.socket?.on(e.eventName,e.callback)}}})}hostConnected(){}hostDisconnected(){for(const e of this.listeners)this.socket?.off(e.eventName,e.callback)}};function ue(e,t){return{queryKey:H(e,"rooms",t.roomId),queryFn:()=>e.rooms.getRoomMessages(t),staleTime:0}}class OptimisticUpdatesController{constructor(e){this.host=e,this.apiClientContext=new N(this.host,{context:n,subscribe:!0,callback:e=>{this.apiClient=e}}),this.queryClientContext=new N(this.host,{context:L,subscribe:!0,callback:e=>{e&&(this.queryClient=e)}}),this.host.addController(this)}hostConnected(){}appendMessageToRoom(e,t){if(!this.apiClient)return;const s=ue(this.apiClient,{roomId:t}).queryKey;this.queryClient?.setQueriesData({queryKey:s,exact:!0},t=>[...t??[],e])}deleteMessage(e,t){if(!this.queryClient||!this.apiClient)return;const s=ue(this.apiClient,{roomId:t}).queryKey;this.queryClient.setQueryData(s,t=>(t??[]).map(t=>t.messageId===e?{...t,deletedAt:(new Date).toISOString(),string:a("Este mensaje fue eliminado")}:t))}updateMessageStatus({messageId:e,status:t,roomId:s}){if(!this.queryClient||!this.apiClient)return;const i=ue(this.apiClient,{roomId:s}).queryKey;this.queryClient.setQueryData(i,s=>(s??[]).map(s=>s.messageId===e?{...s,status:t}:s))}}let ve=class ChatRoomMessages extends d{constructor(){super(...arguments),this.getRoomMessagesQuery=new y(this,()=>ue(this.apiClient,{roomId:this.roomId})),this.optimisticUpdatesController=new OptimisticUpdatesController(this),this.onMessageReceived=e=>{if(e.roomId!==this.roomId)return;const t=function(e){const t={roomId:"string"==typeof e.roomId?Number.parseInt(e.roomId,10):e.roomId,messageId:e.messageId,status:e.status,senderType:e.senderType,fromUserHash:e.fromUserHash,time:e.time,createdAt:e.time?new Date(e.time).toISOString():null,deletedAt:null};switch(e.type){case"string":return{...t,type:"string",string:e.string,auto:e.auto?1:0,attachment:null};case"image":return{...t,type:"image",string:e.fileName||"",auto:0,attachment:{file_name:e.fileName,file_size:e.fileSize,url:e.imageUrl,type:"uncategorized",meta:{duration:0},signed_url:e.imageUrl}};case"file":return{...t,type:"file",string:e.fileName||"",auto:0,attachment:{file_name:e.fileName,file_size:e.fileSize,url:e.fileUrl,type:"uncategorized",meta:{duration:0},signed_url:e.fileUrl}};default:return{...t,type:"string",string:"",auto:0,attachment:null}}}(e);this.optimisticUpdatesController.appendMessageToRoom(t,t.roomId),t.roomId===this.roomId&&e.fromUserHash===this.professionalHash&&this._socketController.socket?.emit(B.messageStatus,e.messageId,this.roomId,T.Read)},this.onMessageDeleted=e=>{e.room_id===this.roomId&&this.optimisticUpdatesController.deleteMessage(e.message_id,e.room_id)},this.onMessageStatusUpdated=e=>{e.roomId===this.roomId&&this.optimisticUpdatesController.updateMessageStatus({messageId:e.messageId,status:e.status,roomId:e.roomId})},this._socketController=new ge(this,{listeners:[{eventName:B.message,callback:this.onMessageReceived},{eventName:B.message_deleted,callback:this.onMessageDeleted},{eventName:B.messageStatus,callback:this.onMessageStatusUpdated}]})}static{this.styles=[u,l`:host{display:block;width:100%;height:100%}`]}render(){return this.getRoomMessagesQuery.render({pending:()=>c`<messages-skeleton messageCount="8"></messages-skeleton>`,complete:e=>c`<messages-list .messages="${e}" .professionalHash="${this.professionalHash}"></messages-list>`})}};e([i({context:n,subscribe:!0})],ve.prototype,"apiClient",void 0),e([h({type:Number})],ve.prototype,"roomId",void 0),e([h({type:String})],ve.prototype,"professionalHash",void 0),ve=e([t("chat-room-messages")],ve);var ye=class{constructor(e){this.string=e.string,this.roomId=e.roomId,this.messageId=e.messageId,this.type=e.type,this.fileName=e.fileName,this.autoMessage=e.autoMessage,this.senderType=e.senderType,this.attachmentType=e.attachmentType,this.consultationId=e.consultationId,this.consultationType=e.consultationType}toSocketMessage(){return[B.message,this.string,this.roomId,this.messageId,this.type,this.fileName,this.autoMessage,this.senderType,this.attachmentType,this.consultationId,this.consultationType]}},be=class extends ye{constructor(e){super({roomId:e.roomId,messageId:e.messageId,string:e.string,type:"string",fileName:null,autoMessage:!1,senderType:S.ordinary,attachmentType:"uncategorized",consultationId:e.consultationId,consultationType:e.consultationType})}},fe=class extends ye{constructor(e){super({roomId:e.roomId,messageId:e.messageId,string:e.base64Attachment,fileName:e.fileName,type:e.type,autoMessage:!1,senderType:S.ordinary,attachmentType:"uncategorized",consultationId:e.consultationId,consultationType:e.consultationType})}};async function we(e){return await Promise.all(e.map(async e=>{const t=await function(e){return new Promise((t,s)=>{const i=new FileReader;i.onload=()=>{const o=i.result.split(",")[1];o?t(o):s(new Error(`Invalid data URL format for file: ${e.name}`))},i.onerror=()=>{s(new Error(`Failed to read file: ${e.name}`))},i.readAsDataURL(e)})}(e);return{name:e.name,size:e.size,type:e.type,base64:t}}))}const xe=l`:host{display:block;position:absolute;bottom:0;padding:var(--size-2) var(--size-2);background:#fff}.footer-container{display:flex;align-items:center;gap:var(--size-1);max-width:100%}.input-container{flex:1;position:relative;display:flex;align-items:center;border:1px solid var(--color-neutrals-border-disabled);border-radius:var(--border-radius-2xl);padding:0 var(--size-1);overflow:hidden}.input-container:focus-within{border-color:var(--color-primary)}.message-input{flex:1;border:none;outline:0;background:0 0;font-family:var(--font-body);font-size:var(--text-base);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);padding-left:var(--sp-2)}.message-input::placeholder{color:var(--color-neutrals-text-medium)}.attachment-icon{width:var(--size-5);height:var(--size-5);color:var(--color-primary)}.send-icon{width:var(--size-5);height:var(--size-5);color:var(--color-primary)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.send-button{color:var(--color-neutrals-link-disabled);background:0 0;border:none;padding:var(--size-2);border-radius:var(--border-radius-md);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color .2s ease}.send-button:hover:not(.disabled){background:var(--color-primary-light)}.send-button:active:not(.disabled){background-color:var(--color-neutrals-background-active)}.send-button.disabled{cursor:not-allowed;opacity:.4}.send-button.disabled .send-icon{color:var(--color-neutrals-text-disabled)}`;let ke=class ChatRoomFooter extends d{constructor(){super(...arguments),this.isTyping=!1,this.typingTimeoutId=null,this.inputValue="",this.socketController=new ge(this)}static{this.styles=[xe]}handleInputChange(e){const t=e.target;this.inputValue=t.value,this.isTyping||(this.socketController.socket?.emit(B.typing,this.roomId),this.isTyping=!0),this.typingTimeoutId&&clearTimeout(this.typingTimeoutId),this.typingTimeoutId=setTimeout(()=>{this.isTyping&&(this.socketController.socket?.emit(B.stop_typing,this.roomId),this.isTyping=!1)},1500)}handleKeyDown(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),this.handleSendMessage())}async handleAttachment(e){const t=e.target.files;if(!t||0===t.length)return;const s=t.item(0);if(s)try{const e=(await we([s]))[0];if(!e)return void z.error("Error converting file to base64");const t=e?.type.includes("image")?"image":"file",i=crypto.randomUUID(),o=s.name,a=new fe({type:t,base64Attachment:e.base64,fileName:o,roomId:this.roomId,messageId:i,consultationId:this.consultationId,consultationType:this.consultationType});this.socketController.socket?.emit(...a.toSocketMessage())}catch(e){z.error("Error converting files to base64:",e)}}handleAttachmentClick(){this.attachmentInput.click()}handleSendMessage(){const e=this.inputValue.trim();if(!e)return;const t=crypto.randomUUID();this.isTyping&&(this.socketController.socket?.emit(B.stop_typing,this.roomId),this.isTyping=!1,this.typingTimeoutId&&clearTimeout(this.typingTimeoutId));const s=new be({messageId:t,string:e,roomId:this.roomId,consultationId:this.consultationId,consultationType:this.consultationType});this.socketController.socket?.emit(...s.toSocketMessage()),this.inputValue=""}disconnectedCallback(){this.isTyping&&(this.socketController.socket?.emit(B.stop_typing,this.roomId),this.typingTimeoutId&&clearTimeout(this.typingTimeoutId))}render(){const e=this.inputValue.trim().length>0;return c`<div class="footer-container"><div class="input-container"><input class="message-input" type="text" placeholder="${a("Escribe aquí...")}" .value="${this.inputValue}" @input="${this.handleInputChange}" @keydown="${this.handleKeyDown}"><div><input class="attachment-input sr-only" type="file" accept="image/jpeg,image/jpg,image/png,image/gif,image/bmp,image/tiff,application/pdf,text/*,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/*,video/*" @change="${this.handleAttachment}"><mq-button variant="ghost" size="icon-sm" @click="${this.handleAttachmentClick}" title="${a("Adjuntar archivo")}">${c`<svg class="attachment-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>`}</mq-button></div></div><button class="send-button ${e?"":"disabled"}" @click="${this.handleSendMessage}" ?disabled="${!e}" title="${a("Enviar mensaje")}">${c`<svg class="send-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13"/><path d="M22 2L15 22L11 13L2 9L22 2z"/></svg>`}</button></div>`}};e([i({context:Z})],ke.prototype,"consultationId",void 0),e([i({context:J})],ke.prototype,"consultationType",void 0),e([h({type:Number})],ke.prototype,"roomId",void 0),e([p()],ke.prototype,"inputValue",void 0),e([C(".attachment-input")],ke.prototype,"attachmentInput",void 0),ke=e([t("chat-room-footer")],ke);const $e=e=>({all_week:!0,monday:1===e,tuesday:2===e,wednesday:3===e,thursday:4===e,friday:5===e,saturday:6===e,sunday:7===e,working_week:e>=1&&e<=5,weekend:0===e||6===e});function Ce(e,t){const s=$e(6===e?0:e+1);return t.some(e=>{const t=e.days_of_week;return!0===s[t]})}let ze=class AvailabilitySection extends d{constructor(){super(...arguments),this.gaps=[],this.selectedDay=function(){const e=(new Date).getDay();return 0===e?6:e-1}()}static{this.styles=l`:host{display:flex;flex-direction:column;gap:var(--size-3)}.availability-header{font-family:var(--font-body);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-normal);color:var(--color-primary);text-align:center;margin:0;margin-bottom:var(--size-4) 0}.availability-days{display:flex;flex-direction:row;justify-content:center;gap:var(--size-1);overflow-x:auto;padding-bottom:var(--size-4)}.availability-button{outline:0;border:1px solid var(--color-gray-medium);background:0 0;color:var(--color-gray-medium);cursor:pointer;height:var(--size-9);width:var(--size-10);border-radius:var(--border-radius-sm);text-transform:capitalize;font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium)}.availability-button:hover{background-color:color-mix(in srgb,var(--color-gray-light) 50%,transparent)}.availability-button:focus{background-color:color-mix(in srgb,var(--color-gray-light) 50%,transparent)}.availability-button.active{background:var(--color-primary);color:var(--color-white);border:none}.availability-button:disabled{opacity:.5;cursor:not-allowed;background-color:var(--color-gray-light)}.time-title{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);color:var(--color-gray-dark);margin:0;margin-bottom:var(--size-1)}.time-entries{display:flex;flex-direction:column;gap:var(--size-1);margin-bottom:var(--size-6)}.time-entry{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);color:var(--color-gray-medium);margin:0}`}updated(e){e.has("gaps")&&(void 0===this.selectedDay||Ce(this.selectedDay,this.gaps)||(this.selectedDay=void 0))}render(){const e=[{shortLabel:a("Lu"),label:a("Lunes"),key:"monday",disabled:!Ce(0,this.gaps)},{shortLabel:a("Ma"),label:a("Martes"),key:"tuesday",disabled:!Ce(1,this.gaps)},{shortLabel:a("Mi"),label:a("Miércoles"),key:"wednesday",disabled:!Ce(2,this.gaps)},{shortLabel:a("Ju"),label:a("Jueves"),key:"thursday",disabled:!Ce(3,this.gaps)},{shortLabel:a("Vi"),label:a("Viernes"),key:"friday",disabled:!Ce(4,this.gaps)},{shortLabel:a("Sa"),label:a("Sábado"),key:"saturday",disabled:!Ce(5,this.gaps)},{shortLabel:a("Do"),label:a("Domingo"),key:"sunday",disabled:!Ce(6,this.gaps)}];return c`<h2 class="availability-header">${a("Disponibilidad")}</h2><div class="availability-days">${e.map((e,t)=>c`<button type="button" class="availability-button ${K({active:this.selectedDay===t&&!e.disabled})}" ?disabled="${e.disabled}" @click="${()=>{e.disabled||(this.selectedDay=t)}}">${e.shortLabel}</button>`)}</div>${void 0===this.selectedDay||e[this.selectedDay]?.disabled?"":(()=>{const t=function(e,t){const s=$e(6===e?0:e+1);return t.filter(e=>{const t=e.days_of_week;return!0===s[t]}).map(e=>({from_time:e.from_time,to_time:e.to_time}))}(this.selectedDay,this.gaps);return c`<div class="availability-time"><p class="time-title">${e[this.selectedDay]?.label}</p><div class="time-entries">${t.length>0?t.map(e=>c`<p class="time-entry">${a("De")} ${e.from_time} ${a("a")} ${e.to_time}</p>`):c`<p class="time-entry">${a("No hay horarios disponibles")}</p>`}</div></div>`})()}`}};e([h({type:Array})],ze.prototype,"gaps",void 0),e([p()],ze.prototype,"selectedDay",void 0),ze=e([o(),t("availability-section")],ze);const Ie=l`:host{display:flex;flex-direction:column;height:100%;overflow-y:auto;background-color:var(--color-white)}.profile-container{padding:var(--size-6);display:flex;flex-direction:column}.profile-header{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:var(--size-6);border-bottom:1px solid var(--color-gray-medium);margin-bottom:var(--size-6)}.profile-avatar{margin-bottom:var(--size-2)}.profile-name{font-family:var(--font-body);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-medium);color:var(--color-text-primary);margin:var(--size-4) 0}.profile-specialty{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);color:var(--color-text-icons--secondary);margin:0;margin-bottom:var(--size-2);text-transform:uppercase}.profile-collegiate{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);color:var(--color-gray-medium);text-transform:uppercase;margin:0}.description-header{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-medium);color:var(--color-primary);margin:0;margin-bottom:var(--size-3)}.description-text{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-foreground);margin:0}`;let Te=class ChatRoomProfile extends d{constructor(){super(...arguments),this.getProfessionalQuery=new y(this,()=>b(this.apiClient,{hash:this.professionalHash}))}static{this.styles=[u,Ie]}renderProfile(e){return c`<div class="profile-container"><div class="profile-header"><mq-avatar class="profile-avatar" src="${e.avatar||""}" fallback="${e.name}" alt="${e.name}'s profile picture" size="xl"></mq-avatar><div><h1 class="profile-name">${e.name}</h1>${e.title?c`<p class="profile-specialty">${e.title}</p>`:""} ${e.collegiate_number?c`<p class="profile-collegiate">${a(r`Nº COL. ${e.collegiate_number}`)}</p>`:""}</div></div>${e.chat_schedule&&e.chat_schedule.gaps.length>0?c`<availability-section .gaps="${e.chat_schedule.gaps}"></availability-section>`:m} ${e.description||e.overview?c`<div><h2 class="description-header">${a("Descripción")}</h2><p class="description-text"><professional-description .text="${e.description||e.overview||""}"></professional-description></p></div>`:""}</div>`}render(){return this.getProfessionalQuery.render({pending:()=>c``,complete:e=>this.renderProfile(e)})}};e([i({context:n,subscribe:!0})],Te.prototype,"apiClient",void 0),e([h({type:String})],Te.prototype,"professionalHash",void 0),Te=e([o(),t("chat-room-profile")],Te);const Me=l`.root{display:flex;flex-direction:column;height:100%;overflow:hidden}chat-room-header{flex-shrink:0}chat-room-messages{flex:1;overflow-y:auto;overflow-x:hidden}chat-room-footer{position:sticky;bottom:0;left:0;right:0;flex-shrink:0}`;let De=class MqChatRoom extends d{constructor(){super(...arguments),this.consultationId=void 0,this.consultationType=void 0,this.readonly=!1,this.hideCloseButton=!1,this.view="chat",this.socketController=new ge(this),this.readAllMessagesMutation=new O(this,{mutationFn:()=>this.apiClient.professionals.readAllMessages({roomId:this.roomId}),onSuccess:()=>{this.queryClientContext?.invalidateQueries({queryKey:q(this.apiClient,{roomId:this.roomId}).queryKey})}}),this.apiClient=M()}static{this.styles=[u,Me]}willUpdate(e){const t=D(e,{apiKey:this.apiKey,token:this.token},this.inheritedApiClient);t&&(this.apiClient=t),e.has("roomId")&&(this.socketController.socket?.emit(B.joinRoom,this.roomId),this.readAllMessagesMutation.run(void 0))}render(){return c`<div class="root"><chat-room-header .professionalHash="${this.professionalHash}" .view="${this.view}" .hideCloseButton="${this.hideCloseButton}" @mq-chat-room-profile="${()=>{this.view="profile"}}" @goto-chat="${()=>{this.view="chat"}}"></chat-room-header>${"chat"===this.view?c`<chat-room-messages .roomId="${this.roomId}" .professionalHash="${this.professionalHash}"></chat-room-messages>${this.readonly?m:c`<chat-room-footer .roomId="${this.roomId}"></chat-room-footer>`}`:c`<chat-room-profile .professionalHash="${this.professionalHash}" @mq-chat-room-chat="${()=>{this.view="chat"}}"></chat-room-profile>`}</div>`}};e([s({context:F}),h({type:String,attribute:"api-key"})],De.prototype,"apiKey",void 0),e([s({context:Q}),h({type:String,attribute:"token"})],De.prototype,"token",void 0),e([s({context:V}),h({type:String,attribute:"professional-hash"})],De.prototype,"professionalHash",void 0),e([s({context:G}),h({type:Number,attribute:"room-id"})],De.prototype,"roomId",void 0),e([s({context:Z}),h({type:String,attribute:"consultation-id"})],De.prototype,"consultationId",void 0),e([s({context:J}),h({type:String,attribute:"consultation-type"})],De.prototype,"consultationType",void 0),e([h({type:Boolean,reflect:!0})],De.prototype,"readonly",void 0),e([h({type:Boolean,attribute:"hide-close-button"})],De.prototype,"hideCloseButton",void 0),e([p()],De.prototype,"view",void 0),e([i({context:L,subscribe:!0})],De.prototype,"queryClientContext",void 0),e([i({context:n,subscribe:!0}),p()],De.prototype,"inheritedApiClient",void 0),e([s({context:n}),p()],De.prototype,"apiClient",void 0),De=e([o(),t("mq-chat-room")],De);export{De as M,MqChatRoomCloseEvent as a,MqChatRoomProfileEvent as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as o}from"./consume-CovVqBjI.js";import{m as n}from"./runtime-Bg1WXVCx.js";import{l as r}from"./localized-decorator-BlOuLhym.js";import{Q as s}from"./query-controller-B1byDHlF.js";import{A as a}from"./api-client-context-BXGqBAlO.js";import{l as p}from"./chunk-S5RWG6G2-CQJ38pW6.js";import{A as l,c as m,n as c}from"./api-chat-client-s45J7LKB.js";import"./chunk-NIAGR3ZC-BDlNUZa1.js";import{g as d}from"./next-appointment-card-
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as o}from"./consume-CovVqBjI.js";import{m as n}from"./runtime-Bg1WXVCx.js";import{l as r}from"./localized-decorator-BlOuLhym.js";import{Q as s}from"./query-controller-B1byDHlF.js";import{A as a}from"./api-client-context-BXGqBAlO.js";import{l as p}from"./chunk-S5RWG6G2-CQJ38pW6.js";import{A as l,c as m,n as c}from"./api-chat-client-s45J7LKB.js";import"./chunk-NIAGR3ZC-BDlNUZa1.js";import{g as d}from"./next-appointment-card-BOzfcwjD.js";import{g as h}from"./get-patient-profile-query-D9btgcxl.js";import{i as u,a as g,x as y}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{r as x}from"./state-LQivXIgA.js";import{setEnv as v}from"../env.js";import{MqViewAppointmentsEvent as b}from"../events.js";import{isValidLocale as j,setLocale as k}from"../i18n.js";import"./index-D3_2tkC3.js";import"./index-MfyXh-qX.js";import"../ui/mq-skeleton.js";const A=[l.pending,l.accepted],w=u`:host{display:flex;flex-direction:column;gap:var(--sp-4);width:100%;min-width:0;box-sizing:border-box}:host([empty]){align-self:start}:host([empty]) .card{flex:0 0 auto}.card{display:flex;flex-direction:column;flex:1;min-width:0;box-sizing:border-box;background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--mq-next-appointments-radius,12px);padding:var(--mq-next-appointments-padding,var(--sp-6))}`;let $=class MqNextAppointments extends g{constructor(){super(...arguments),this.apiClient=m(),this.getPatientProfileQuery=new s(this,()=>h(this.apiClient,{enabled:!this.loginToken})),this.getAppointmentsQuery=new s(this,()=>d(this.apiClient,{status:A,order:{field:"starts_at",direction:"asc"},page:1,per_page:1})),this.handleViewAll=()=>{this.dispatchEvent(new b({tab:"next"}))}}static{this.styles=w}willUpdate(t){t.has("env")&&this.env&&v(this.env),t.has("locale")&&this.locale&&j(this.locale)&&k(this.locale);const e=c(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);e&&(this.apiClient=e)}get patientHash(){return this.loginToken?.patient.hash??this.getPatientProfileQuery.result?.data?.hash??""}get accessToken(){return this.token||this.loginToken?.access_token||""}get patientTimezone(){return this.timezone??this.loginToken?.patient.timezone}get isEmpty(){const t=this.getAppointmentsQuery.result;return!0===t?.isSuccess&&!t.data?.data?.[0]}updated(){this.toggleAttribute("empty",this.isEmpty)}renderAppointment(){return this.getAppointmentsQuery.render({complete:t=>{const e=t.data?.[0];return e?y`<next-appointment-card .appointmentResource="${e}" .token="${this.accessToken}" .patientHash="${this.patientHash}" .timezone="${this.patientTimezone}"></next-appointment-card>`:y`<widget-empty-state icon="calendar" heading="${n("No tienes próximas citas")}" description="${n("Cuando agendes una cita, aparecerá aquí para que puedas consultarla, modificarla o cancelarla.")}"></widget-empty-state>`},pending:()=>y`<mq-skeleton height="257px"></mq-skeleton>`,error:()=>y`<widget-empty-state icon="calendar" heading="${n("No hemos podido cargar tu próxima cita")}" description="${n("Vuelve a intentarlo en unos minutos.")}"></widget-empty-state>`})}render(){return y`<section-header heading="${n("Próxima cita")}" action-label="${n("Ver todas")}" @section-action="${this.handleViewAll}"></section-header><div class="card">${this.renderAppointment()}</div>`}};t([f({type:String,attribute:"api-key"})],$.prototype,"apiKey",void 0),t([f({type:String,attribute:"token"})],$.prototype,"token",void 0),t([f({type:String,attribute:"locale"})],$.prototype,"locale",void 0),t([f({type:String,attribute:"env"})],$.prototype,"env",void 0),t([f({type:String,attribute:"timezone"})],$.prototype,"timezone",void 0),t([o({context:p,subscribe:!0})],$.prototype,"loginToken",void 0),t([o({context:a,subscribe:!0}),x()],$.prototype,"inheritedApiClient",void 0),t([i({context:a}),x()],$.prototype,"apiClient",void 0),$=t([r(),e("mq-next-appointments")],$);export{$ as M};
|