@mediquo/elements 0.9.4 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/api-chat-client-BhxUWldC.js +1 -0
- package/dist/chunks/{apple-pay-outcomes-DyL3HLPm.js → apple-pay-outcomes-BU_PyQdT.js} +1 -1
- package/dist/chunks/ca_ES-DMretbb7.js +1 -0
- package/dist/chunks/de_DE-DUtzXD1z.js +1 -0
- package/dist/chunks/documentation-view-CEfoq9vD.js +1 -0
- package/dist/chunks/en_US-mxYf5Jqv.js +1 -0
- package/dist/chunks/{index-Dbbpnw8f.d.ts → index-Bv4Mk1Ch.d.ts} +1 -1
- package/dist/chunks/{index-CsoFYpTo.js → index-CYBd3XL2.js} +1 -1
- package/dist/chunks/{index-CFlNQLy2.d.ts → index-Cgni0Is9.d.ts} +1 -1
- package/dist/chunks/{index-DdkeWQrh.d.ts → index-D0njwg5o.d.ts} +1 -1
- package/dist/chunks/{index-DG95qEn3.js → index-DjD-3x4f.js} +1 -1
- package/dist/chunks/{index.d-XSe7Hy-Q.d.ts → index.d-DeJP_xib.d.ts} +13 -22
- package/dist/chunks/{mq-chat-room-jeDvIF1Z.d.ts → mq-chat-room-B3ant6md.d.ts} +1 -1
- package/dist/chunks/{mq-next-appointments-BIOkXfI7.js → mq-next-appointments-BdsRyXJB.js} +1 -1
- package/dist/chunks/{mq-recent-documents-DVhwoeLA.js → mq-recent-documents-CNweIX5U.js} +1 -1
- package/dist/chunks/{next-appointment-card-DBXsY3Sp.d.ts → next-appointment-card-CWz0tef1.d.ts} +2 -2
- package/dist/chunks/{next-appointment-card-DxNzffoM.js → next-appointment-card-KXLkEJDg.js} +1 -1
- package/dist/chunks/pt_PT-g8meEZVV.js +1 -0
- package/dist/env.js +1 -1
- package/dist/events.d.ts +3 -44
- package/dist/i18n.js +1 -1
- package/dist/mq-api-client-provider.d.ts +1 -1
- package/dist/mq-api-client-provider.js +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 +1 -1
- package/dist/mq-appointment-checkout.js +1 -1
- package/dist/mq-appointment-documentation.d.ts +4 -3
- package/dist/mq-appointment-documentation.js +1 -1
- package/dist/mq-chat-room.d.ts +2 -2
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.d.ts +1 -1
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-dashboard.d.ts +5 -5
- 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 +1 -1
- package/dist/mq-immediate-videocall-checkout.js +1 -1
- package/dist/mq-my-appointments.d.ts +3 -3
- package/dist/mq-my-appointments.js +1 -1
- package/dist/mq-next-appointments.d.ts +3 -3
- package/dist/mq-next-appointments.js +1 -1
- package/dist/mq-payment-poller.d.ts +15 -23
- package/dist/mq-payment-poller.js +1 -1
- package/dist/mq-recent-documents.d.ts +2 -2
- package/dist/mq-recent-documents.js +1 -1
- package/dist/mq-schedule-success.d.ts +2 -2
- package/dist/mq-schedule-success.js +1 -1
- package/dist/mq-schedule.d.ts +2 -3
- 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-terms-and-conditions.js +1 -1
- package/dist/mq-videocall.d.ts +3 -3
- package/dist/mq-videocall.js +1 -1
- package/dist/react/mq-api-client-provider.d.ts +1 -1
- package/dist/react/mq-api-client-provider.js +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 +1 -1
- package/dist/react/mq-appointment-checkout.js +1 -1
- package/dist/react/mq-appointment-documentation.d.ts +4 -3
- package/dist/react/mq-appointment-documentation.js +1 -1
- package/dist/react/mq-chat-room.d.ts +2 -2
- package/dist/react/mq-chat-room.js +1 -1
- package/dist/react/mq-checkout.d.ts +1 -1
- package/dist/react/mq-checkout.js +1 -1
- package/dist/react/mq-dashboard.d.ts +4 -4
- 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 +1 -1
- package/dist/react/mq-immediate-videocall-checkout.js +1 -1
- package/dist/react/mq-my-appointments.d.ts +3 -3
- package/dist/react/mq-my-appointments.js +1 -1
- package/dist/react/mq-next-appointments.d.ts +3 -3
- package/dist/react/mq-next-appointments.js +1 -1
- package/dist/react/mq-payment-poller.d.ts +6 -13
- package/dist/react/mq-payment-poller.js +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 +2 -2
- package/dist/react/mq-schedule-success.js +1 -1
- package/dist/react/mq-schedule.d.ts +1 -1
- package/dist/react/mq-schedule.js +1 -1
- package/dist/react/mq-support-chat.d.ts +2 -2
- package/dist/react/mq-support-chat.js +1 -1
- package/dist/react/mq-terms-and-conditions.d.ts +2 -2
- package/dist/react/mq-terms-and-conditions.js +1 -1
- package/dist/react/mq-videocall.d.ts +3 -3
- package/dist/react/mq-videocall.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/api-chat-client-5LVJAeLW.js +0 -1
- package/dist/chunks/ca_ES-OHfUU0MP.js +0 -1
- package/dist/chunks/de_DE-BTPGM932.js +0 -1
- package/dist/chunks/documentation-view-Dly6o3Fz.js +0 -1
- package/dist/chunks/en_US-C2zY9QiH.js +0 -1
- package/dist/chunks/pt_PT-DUs_Ox73.js +0 -1
|
@@ -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 r}from"./consume-CovVqBjI.js";import{m as o}from"./runtime-Bg1WXVCx.js";import{l as s}from"./localized-decorator-BlOuLhym.js";import{Q as n}from"./query-controller-BlO1Ax65.js";import{A as a}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{g as l,t as d,r as c}from"./telemetry-client-DEIuDZfA.js";import{g as m,t as h}from"./index-
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as r}from"./consume-CovVqBjI.js";import{m as o}from"./runtime-Bg1WXVCx.js";import{l as s}from"./localized-decorator-BlOuLhym.js";import{Q as n}from"./query-controller-BlO1Ax65.js";import{A as a}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{g as l,t as d,r as c}from"./telemetry-client-DEIuDZfA.js";import{g as m,t as h}from"./index-DjD-3x4f.js";import{g as u}from"./get-patient-profile-query-4AO6xvVn.js";import{i as g,a as y,x as f}from"./lit-element-DiWJYFwC.js";import{n as v}from"./property-scuRaFcM.js";import{r as b}from"./state-LQivXIgA.js";import{setEnv as j}from"../env.js";import{MqViewDocumentsEvent as x}from"../events.js";import{isValidLocale as k,setLocale as w,getLocale as S}from"../i18n.js";import{c as $,n as P}from"./api-chat-client-BhxUWldC.js";import"./index-Bw-MbGKw.js";import"./index-DEEAEB_4.js";const Q=g`:host{display:flex;flex-direction:column;align-self:start;gap:var(--sp-4);width:100%;min-width:0;box-sizing:border-box}.card{display:flex;flex-direction:column;gap:var(--sp-3);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-recent-documents-radius,12px);padding:var(--mq-recent-documents-padding,var(--sp-6))}`;let C=class MqRecentDocuments extends y{constructor(){super(...arguments),this.apiClient=$(),this.getPatientProfileQuery=new n(this,()=>u(this.apiClient,{enabled:!this.loginToken})),this.getPatientDocumentsQuery=new n(this,()=>({...m(this.apiClient,{patient_hash:this.patientHash,page:1,per_page:3}),enabled:!!this.patientHash})),this.getOrganizationSpecialtiesQuery=new n(this,()=>l(this.apiClient)),this.handleViewAll=()=>{d.track(c(this.patientHash)),this.dispatchEvent(new x)}}static{this.styles=Q}willUpdate(t){t.has("env")&&this.env&&j(this.env),t.has("locale")&&this.locale&&k(this.locale)&&w(this.locale);const e=P(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??""}renderEmptyState(){return f`<widget-empty-state icon="document" heading="${o("No tienes documentación")}" description="${o("Aquí se mostrarán tus recetas e informes médicos.")}"></widget-empty-state>`}renderSkeleton(){return f`<document-list placeholders="${3}"></document-list>`}renderError(){return f`<widget-empty-state icon="document" heading="${o("No hemos podido cargar tu documentación")}" description="${o("Vuelve a intentarlo en unos minutos.")}"></widget-empty-state>`}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:t=>0===t.data.length?this.renderEmptyState():f`<document-list .documents="${h(t.data,this.getOrganizationSpecialtiesQuery.result?.data,S())}" patientHash="${this.patientHash}"></document-list>`,initial:()=>this.getPatientProfileQuery.result?.isError?this.renderError():this.renderSkeleton(),pending:()=>this.renderSkeleton(),error:()=>this.renderError()})}render(){return f`<section-header heading="${o("Documentos recientes")}" action-label="${o("Ver todas")}" @section-action="${this.handleViewAll}"></section-header><div class="card">${this.renderDocuments()}</div>`}};t([v({type:String,attribute:"api-key"})],C.prototype,"apiKey",void 0),t([v({type:String,attribute:"token"})],C.prototype,"token",void 0),t([v({type:String,attribute:"locale"})],C.prototype,"locale",void 0),t([v({type:String,attribute:"env"})],C.prototype,"env",void 0),t([r({context:a,subscribe:!0}),b()],C.prototype,"inheritedApiClient",void 0),t([i({context:a}),b()],C.prototype,"apiClient",void 0),t([r({context:p,subscribe:!0})],C.prototype,"loginToken",void 0),C=t([s(),e("mq-recent-documents")],C);export{C as M};
|
package/dist/chunks/{next-appointment-card-DBXsY3Sp.d.ts → next-appointment-card-CWz0tef1.d.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
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, G as GetAppointmentsResponse } from './index.d-
|
|
4
|
+
import { M as MediquoApiChatClient, G as GetAppointmentsResponse } from './index.d-DeJP_xib.js';
|
|
5
5
|
import { L as LoginTokenResponse } from './schemas.d-b6_AekBb.js';
|
|
6
|
-
import './mq-chat-room-
|
|
6
|
+
import './mq-chat-room-B3ant6md.js';
|
|
7
7
|
import '../ui/mq-button.js';
|
|
8
8
|
import '../ui/mq-dialog.js';
|
|
9
9
|
import { P as PriceInCents } from './price.d-CwLosdAN.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./chunk-6CCJWPGL-TiaqZaPV.js";import{_ as t,c as i}from"./custom-element-D2ziPxYE.js";import{c as n}from"./consume-CovVqBjI.js";import{m as o,s as a}from"./runtime-Bg1WXVCx.js";import{l as s}from"./localized-decorator-BlOuLhym.js";import{Q as r}from"./query-controller-BlO1Ax65.js";import{A as l}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{i as c,a as d}from"./api-chat-client-5LVJAeLW.js";import{g as m,a as h}from"./chunk-2TKJJNS7-BGwxtEg7.js";import{g as u}from"./get-organization-setup-query-Dr1cXnHl.js";import{g,t as f,f as v,i as b,j as y,k as $,a as x}from"./telemetry-client-DEIuDZfA.js";import{g as C}from"./chunk-Y4EKUX25-QqMl3eiq.js";import{c as w}from"./refund-cancel-policy-QG_OE6g5.js";import{a as k,i as q,x as O,E as j}from"./lit-element-DiWJYFwC.js";import{n as M}from"./property-scuRaFcM.js";import{r as z}from"./state-LQivXIgA.js";import{MqAppointmentJoinVideocallEvent as S,MqAppointmentRescheduleEvent as E}from"../events.js";import{getLocale as I}from"../i18n.js";import{calendarIcon as D}from"../ui/icons/calendar-icon.js";import{dotsHorizontalIcon as R}from"../ui/icons/dots-horizontal-icon.js";import{messageBubbleIcon as _}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as A}from"../ui/icons/phone-icon.js";import{videoIcon as P}from"../ui/icons/video-icon.js";import"../mq-chat-room.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{Q as T}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as U}from"./mutation-controller-CR2qcqhH.js";import{h as N,f as L}from"./price-DU3YLTpk.js";import"./professional-overview-B4E05rLd.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-unread-badge.js";import{toast as H}from"../ui/mq-toast.js";function Q(t,i){return{queryKey:e(t,"appointments",i),queryFn:()=>t.appointments.getAppointments(i)}}function J(e){const{action:t,refundPolicySeconds:i}=e,n=null!=i&&i<3600,s=Math.ceil((i??0)/60),r=Math.ceil((i??0)/3600);return o(0===(n?s:r)?"modify"===t?"Esta cita ya ha pasado, por lo que no se puede modificar.":"Esta cita ya ha pasado, por lo que no se puede anular.":"modify"===t?n?a`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos modificarla.`:a`Lo sentimos, como faltan menos de ${r} horas para tu cita no podemos modificarla.`:n?a`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos anularla.`:a`Lo sentimos, como faltan menos de ${r} horas para tu cita no podemos anularla.`)}let F=class AppointmentActionUnavailableDialog extends k{constructor(){super(...arguments),this.open=!1,this.heading="",this.message="",this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=q`:host{display:contents}mq-dialog::part(dialog){max-width:343px;min-width:0}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{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}.actions{display:flex;margin-top:var(--sp-4)}`}render(){return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${this.heading}</h2><p slot="subheading">${this.message}</p><div class="actions"><mq-button variant="primary" fullwidth @click="${this.handleClose}">${o("Volver")}</mq-button></div></mq-dialog>`}};t([M({type:Boolean,reflect:!0})],F.prototype,"open",void 0),t([M({type:String})],F.prototype,"heading",void 0),t([M({type:String})],F.prototype,"message",void 0),F=t([s(),i("appointment-action-unavailable-dialog")],F);let V=class CancelAppointmentConfirmationDialog extends k{constructor(){super(...arguments),this.open=!1,this.cancelAppointmentMutation=new U(this,{mutationFn:async e=>this.apiClient.appointments.cancelAppointment(e),onSuccess:()=>{this.queryClientContext?.invalidateQueries(),this.dispatchEvent(new CustomEvent("success",{bubbles:!0,composed:!0}))}}),this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleDismissClick=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleConfirmClick=()=>{this.cancelAppointmentMutation.run({id:this.appointmentId})}}static{this.styles=q`:host{display:contents}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{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}.subheading-payable{font-size:var(--text-base);line-height:22px}.price-rows{display:flex;flex-direction:column;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);line-height:var(--text-sm--line-height);color:var(--color-card-foreground);width:100%;margin-bottom:var(--sp-4)}.price-row{display:flex;align-items:center;justify-content:space-between;min-height:34px;gap:var(--sp-2)}.price-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-4);justify-content:flex-end;flex-wrap:wrap}`}render(){const e=I(),t=this.price,i=N(t),n=this.cancelAppointmentMutation.isPending;if(i){const i=L(t,e),a=`-${i}`;return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${o("Confirmar cancelación")}</h2><p slot="subheading" class="subheading-payable">${o("¿Seguro que quieres cancelar esta cita? Se te devolverá el importe pagado en un plazo de 5-10 días hábiles.")}</p><div><div class="price-rows"><div class="price-row"><span>${o("Importe pagado")}</span> <span>${i}</span></div><div class="price-row"><span>${o("Importe a devolver")}</span> <span>${a}</span></div></div><div class="actions"><mq-button variant="outline" ?disabled="${n}" @click="${this.handleDismissClick}">${o("Volver")}</mq-button><mq-button variant="primary" ?disabled="${n}" @click="${this.handleConfirmClick}">${o("Confirmar")}</mq-button></div></div></mq-dialog>`}return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${o("Confirmar cancelación")}</h2><p slot="subheading">${o("¿Seguro que quieres cancelar esta cita?")}</p><div><div class="actions"><mq-button variant="outline" ?disabled="${n}" @click="${this.handleDismissClick}">${o("Cancelar")}</mq-button><mq-button variant="primary" ?disabled="${n}" @click="${this.handleConfirmClick}">${o("Confirmar")}</mq-button></div></div></mq-dialog>`}};t([n({context:l,subscribe:!0})],V.prototype,"apiClient",void 0),t([M({type:Boolean,reflect:!0})],V.prototype,"open",void 0),t([n({context:T,subscribe:!0})],V.prototype,"queryClientContext",void 0),t([M({type:String})],V.prototype,"appointmentId",void 0),t([M({type:Object})],V.prototype,"price",void 0),V=t([s(),i("cancel-appointment-confirmation-dialog")],V);const W=q`:host{display:flex;flex-direction:column;justify-content:space-between;gap:var(--sp-6);flex:1;width:100%;min-width:0;box-sizing:border-box;color:var(--color-text-icons--primary,#0a0a22)}professional-overview{--avatar-size-lg:66px;--text-lg--line-height:1.35;display:block}.details{display:flex;flex-direction:column;align-items:flex-start;gap:var(--sp-3)}.detail-row{display:inline-flex;align-items:center;gap:var(--sp-2);font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.footer{display:flex;flex-direction:column;gap:var(--sp-4)}.reminder{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--secondary,#6d658b);margin:0}.actions{--button-height-md:2.75rem;display:flex;align-items:stretch;gap:10px}.actions>mq-button{flex:1;min-width:0}.overflow{position:relative;flex:0 0 auto}.chat-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-badge{--mq-unread-badge-size:8px;flex-shrink:0}@media (max-width:767px){.actions{flex-wrap:wrap}.actions>mq-button.join{order:1;flex:1 0 100%}}.menu{position:absolute;right:0;bottom:calc(100% + var(--sp-2));z-index:2;display:flex;flex-direction:column;min-width:176px;padding:var(--sp-1);background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--border-radius-lg);box-shadow:var(--shadow-lg)}.menu-item{display:block;width:100%;background:0 0;border:none;border-radius:var(--border-radius-sm);padding:var(--sp-2) var(--sp-3);cursor:pointer;text-align:left;font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;color:var(--color-text-icons--primary,#0a0a22)}.menu-item:hover{background-color:var(--color-muted)}.menu-item.negative{color:var(--color-negative)}`;let B=class NextAppointmentCard extends k{constructor(){super(...arguments),this.token="",this.patientHash="",this.isChatOpen=!1,this.isMenuOpen=!1,this.isCancelDialogOpen=!1,this.openDialog=null,this.getUnreadMessagesQuery=new r(this,()=>({...C(this.apiClient,{roomId:this.appointmentResource?.room?.id}),enabled:!!this.appointmentResource?.room?.id})),this.getOrganizationSetupQuery=new r(this,()=>u(this.apiClient)),this.getOrganizationSpecialtiesQuery=new r(this,()=>g(this.apiClient,{enabled:!!this.appointmentResource?.speciality?.id})),this.closeMenuOnOutsideClick=e=>{e.composedPath().includes(this)||(this.isMenuOpen=!1)},this.closeMenuOnEscape=e=>{"Escape"===e.key&&(this.isMenuOpen=!1)},this.handleJoinVideocall=()=>{f.track(v(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new S({appointmentId:this.appointmentId}))},this.handleToggleChat=()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&f.track(b(this.sessionPatientHash,this.appointmentId))},this.handleModify=()=>{this.isMenuOpen=!1,this.isModifyUnavailable?this.openDialog="modify":(f.track(y(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new E({appointmentId:this.appointmentId})))},this.handleCancel=()=>{this.isMenuOpen=!1,this.isCancelUnavailable?this.openDialog="cancel":(f.track($(this.sessionPatientHash,this.appointmentId)),this.isCancelDialogOpen=!0)}}static{this.styles=W}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.closeMenuOnOutsideClick),document.addEventListener("keydown",this.closeMenuOnEscape)}disconnectedCallback(){document.removeEventListener("click",this.closeMenuOnOutsideClick),document.removeEventListener("keydown",this.closeMenuOnEscape),super.disconnectedCallback()}get appointmentId(){return this.appointmentResource.appointment.id??""}get channel(){return this.appointmentResource.appointment.channel}get sessionToken(){return this.token||this.loginToken?.access_token||""}get sessionPatientHash(){return this.patientHash||this.loginToken?.patient?.hash||""}get sessionTimezone(){return this.timezone??this.loginToken?.patient?.timezone}get unreadCount(){return this.getUnreadMessagesQuery.result?.data?.unread_count??0}get specialtyName(){const e=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>Number(e.id)===Number(this.appointmentResource.speciality?.id));return x(e?.code??"",I(),e?.name??this.appointmentResource.speciality?.name)}get hasChatSupport(){return this.appointmentResource.appointment.has_chat_in_appointment??this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment??!1}get isExpired(){return c(this.appointmentResource.appointment.expires_at)}get refundPolicySeconds(){return this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel}get policyAllowsModifyOrCancel(){return w({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:this.refundPolicySeconds})}get isModifyUnavailable(){return this.isExpired||0===this.appointmentResource.slots.length||!this.policyAllowsModifyOrCancel}get isCancelUnavailable(){return this.isExpired||!this.policyAllowsModifyOrCancel}get modifyUnavailableMessage(){return J({action:"modify",refundPolicySeconds:this.refundPolicySeconds})}get cancelUnavailableMessage(){return J({action:"cancel",refundPolicySeconds:this.refundPolicySeconds})}channelIcon(){switch(this.channel){case d.videocall:return P({size:20});case d.phonecall:return A({size:20});default:return _({size:20})}}channelLabel(){switch(this.channel){case d.videocall:return o("Videoconsulta");case d.phonecall:return o("Consulta telefónica");default:return o("Chat")}}formatWhen(){const e=I().replace("_","-"),t=m(this.sessionTimezone),i=t?{timeZone:t}:{},n=new Date(this.appointmentResource.appointment.starts_at);if(Number.isNaN(n.getTime()))return"";const s=new Intl.DateTimeFormat(e,{weekday:"long",day:"numeric",month:"long",year:"numeric",...i}).format(n),r=new Intl.DateTimeFormat(e,{timeStyle:"short",hourCycle:"h23",...i}).format(n),l=t?h(t,n):"";return o(a`${s}, ${r} h${l?` (${l})`:""}`)}renderActions(){const e=this.channel===d.videocall;return O`<div class="actions">${this.hasChatSupport?O`<mq-button variant="outline" @click="${this.handleToggleChat}"><span class="chat-label">${o("Ir a chat")}</span> ${this.unreadCount>0?O`<mq-unread-badge class="chat-badge"></mq-unread-badge>`:j}</mq-button>`:j} ${e?O`<mq-button class="join" variant="primary" @click="${this.handleJoinVideocall}">${o("Unirse a la videoconsulta")}</mq-button>`:j}<div class="overflow"><mq-button variant="outline" size="icon-lg" aria-label="${o("Más opciones")}" aria-haspopup="menu" aria-expanded="${this.isMenuOpen}" @click="${()=>{this.isMenuOpen=!this.isMenuOpen}}">${R({size:16})}</mq-button>${this.isMenuOpen?O`<div class="menu" role="menu"><button class="menu-item" type="button" role="menuitem" @click="${this.handleModify}">${o("Modificar cita")}</button> <button class="menu-item negative" type="button" role="menuitem" @click="${this.handleCancel}">${o("Anular cita")}</button></div>`:j}</div></div>`}render(){const{professional:e}=this.appointmentResource,t=this.formatWhen();return O`<professional-overview .name="${e.name}" .specialtyName="${this.specialtyName}" .collegiateNumber="${e.collegiate_number??void 0}" .description="${e.description??""}" .languages="${e.languages??[]}" .avatar="${e.avatar??""}"></professional-overview><div class="details">${t?O`<div class="detail-row">${D({size:20})} <span>${t}</span></div>`:j}<div class="detail-row">${this.channelIcon()} <span>${this.channelLabel()}</span></div></div><div class="footer"><p class="reminder">${o("Recibirás un recordatorio 15 minutos antes de la consulta")}</p>${this.renderActions()}</div><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" hideCloseButton @mq-close="${()=>{this.isChatOpen=!1}}">${this.isChatOpen?O`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.sessionToken}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${e.hash}" ?readonly="${this.isExpired}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:j}</mq-floating-bubble><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${o("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${o("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,H.success(o("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentId}}))}}"></cancel-appointment-confirmation-dialog>`}};t([n({context:l,subscribe:!0})],B.prototype,"apiClient",void 0),t([n({context:p,subscribe:!0})],B.prototype,"loginToken",void 0),t([M({type:Object})],B.prototype,"appointmentResource",void 0),t([M({type:String})],B.prototype,"token",void 0),t([M({type:String})],B.prototype,"patientHash",void 0),t([M({type:String})],B.prototype,"timezone",void 0),t([z()],B.prototype,"isChatOpen",void 0),t([z()],B.prototype,"isMenuOpen",void 0),t([z()],B.prototype,"isCancelDialogOpen",void 0),t([z()],B.prototype,"openDialog",void 0),B=t([s(),i("next-appointment-card")],B);export{J as a,Q as g};
|
|
1
|
+
import{s as e}from"./chunk-6CCJWPGL-TiaqZaPV.js";import{_ as t,c as i}from"./custom-element-D2ziPxYE.js";import{c as n}from"./consume-CovVqBjI.js";import{m as o,s as a}from"./runtime-Bg1WXVCx.js";import{l as s}from"./localized-decorator-BlOuLhym.js";import{Q as r}from"./query-controller-BlO1Ax65.js";import{A as l}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{d as c,e as d}from"./api-chat-client-BhxUWldC.js";import{g as m,a as h}from"./chunk-2TKJJNS7-BGwxtEg7.js";import{g as u}from"./get-organization-setup-query-Dr1cXnHl.js";import{g,t as f,f as v,i as b,j as y,k as $,a as x}from"./telemetry-client-DEIuDZfA.js";import{g as C}from"./chunk-Y4EKUX25-QqMl3eiq.js";import{c as w}from"./refund-cancel-policy-QG_OE6g5.js";import{a as k,i as q,x as O,E as j}from"./lit-element-DiWJYFwC.js";import{n as M}from"./property-scuRaFcM.js";import{r as z}from"./state-LQivXIgA.js";import{MqAppointmentJoinVideocallEvent as S,MqAppointmentRescheduleEvent as E}from"../events.js";import{getLocale as I}from"../i18n.js";import{calendarIcon as D}from"../ui/icons/calendar-icon.js";import{dotsHorizontalIcon as R}from"../ui/icons/dots-horizontal-icon.js";import{messageBubbleIcon as _}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as A}from"../ui/icons/phone-icon.js";import{videoIcon as P}from"../ui/icons/video-icon.js";import"../mq-chat-room.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{Q as T}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as U}from"./mutation-controller-CR2qcqhH.js";import{h as N,f as L}from"./price-DU3YLTpk.js";import"./professional-overview-B4E05rLd.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-unread-badge.js";import{toast as H}from"../ui/mq-toast.js";function Q(t,i){return{queryKey:e(t,"appointments",i),queryFn:()=>t.appointments.getAppointments(i)}}function J(e){const{action:t,refundPolicySeconds:i}=e,n=null!=i&&i<3600,s=Math.ceil((i??0)/60),r=Math.ceil((i??0)/3600);return o(0===(n?s:r)?"modify"===t?"Esta cita ya ha pasado, por lo que no se puede modificar.":"Esta cita ya ha pasado, por lo que no se puede anular.":"modify"===t?n?a`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos modificarla.`:a`Lo sentimos, como faltan menos de ${r} horas para tu cita no podemos modificarla.`:n?a`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos anularla.`:a`Lo sentimos, como faltan menos de ${r} horas para tu cita no podemos anularla.`)}let F=class AppointmentActionUnavailableDialog extends k{constructor(){super(...arguments),this.open=!1,this.heading="",this.message="",this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=q`:host{display:contents}mq-dialog::part(dialog){max-width:343px;min-width:0}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{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}.actions{display:flex;margin-top:var(--sp-4)}`}render(){return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${this.heading}</h2><p slot="subheading">${this.message}</p><div class="actions"><mq-button variant="primary" fullwidth @click="${this.handleClose}">${o("Volver")}</mq-button></div></mq-dialog>`}};t([M({type:Boolean,reflect:!0})],F.prototype,"open",void 0),t([M({type:String})],F.prototype,"heading",void 0),t([M({type:String})],F.prototype,"message",void 0),F=t([s(),i("appointment-action-unavailable-dialog")],F);let V=class CancelAppointmentConfirmationDialog extends k{constructor(){super(...arguments),this.open=!1,this.cancelAppointmentMutation=new U(this,{mutationFn:async e=>this.apiClient.appointments.cancelAppointment(e),onSuccess:()=>{this.queryClientContext?.invalidateQueries(),this.dispatchEvent(new CustomEvent("success",{bubbles:!0,composed:!0}))}}),this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleDismissClick=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleConfirmClick=()=>{this.cancelAppointmentMutation.run({id:this.appointmentId})}}static{this.styles=q`:host{display:contents}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{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}.subheading-payable{font-size:var(--text-base);line-height:22px}.price-rows{display:flex;flex-direction:column;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);line-height:var(--text-sm--line-height);color:var(--color-card-foreground);width:100%;margin-bottom:var(--sp-4)}.price-row{display:flex;align-items:center;justify-content:space-between;min-height:34px;gap:var(--sp-2)}.price-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-4);justify-content:flex-end;flex-wrap:wrap}`}render(){const e=I(),t=this.price,i=N(t),n=this.cancelAppointmentMutation.isPending;if(i){const i=L(t,e),a=`-${i}`;return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${o("Confirmar cancelación")}</h2><p slot="subheading" class="subheading-payable">${o("¿Seguro que quieres cancelar esta cita? Se te devolverá el importe pagado en un plazo de 5-10 días hábiles.")}</p><div><div class="price-rows"><div class="price-row"><span>${o("Importe pagado")}</span> <span>${i}</span></div><div class="price-row"><span>${o("Importe a devolver")}</span> <span>${a}</span></div></div><div class="actions"><mq-button variant="outline" ?disabled="${n}" @click="${this.handleDismissClick}">${o("Volver")}</mq-button><mq-button variant="primary" ?disabled="${n}" @click="${this.handleConfirmClick}">${o("Confirmar")}</mq-button></div></div></mq-dialog>`}return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${o("Confirmar cancelación")}</h2><p slot="subheading">${o("¿Seguro que quieres cancelar esta cita?")}</p><div><div class="actions"><mq-button variant="outline" ?disabled="${n}" @click="${this.handleDismissClick}">${o("Cancelar")}</mq-button><mq-button variant="primary" ?disabled="${n}" @click="${this.handleConfirmClick}">${o("Confirmar")}</mq-button></div></div></mq-dialog>`}};t([n({context:l,subscribe:!0})],V.prototype,"apiClient",void 0),t([M({type:Boolean,reflect:!0})],V.prototype,"open",void 0),t([n({context:T,subscribe:!0})],V.prototype,"queryClientContext",void 0),t([M({type:String})],V.prototype,"appointmentId",void 0),t([M({type:Object})],V.prototype,"price",void 0),V=t([s(),i("cancel-appointment-confirmation-dialog")],V);const W=q`:host{display:flex;flex-direction:column;justify-content:space-between;gap:var(--sp-6);flex:1;width:100%;min-width:0;box-sizing:border-box;color:var(--color-text-icons--primary,#0a0a22)}professional-overview{--avatar-size-lg:66px;--text-lg--line-height:1.35;display:block}.details{display:flex;flex-direction:column;align-items:flex-start;gap:var(--sp-3)}.detail-row{display:inline-flex;align-items:center;gap:var(--sp-2);font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.footer{display:flex;flex-direction:column;gap:var(--sp-4)}.reminder{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--secondary,#6d658b);margin:0}.actions{--button-height-md:2.75rem;display:flex;align-items:stretch;gap:10px}.actions>mq-button{flex:1;min-width:0}.overflow{position:relative;flex:0 0 auto}.chat-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-badge{--mq-unread-badge-size:8px;flex-shrink:0}@media (max-width:767px){.actions{flex-wrap:wrap}.actions>mq-button.join{order:1;flex:1 0 100%}}.menu{position:absolute;right:0;bottom:calc(100% + var(--sp-2));z-index:2;display:flex;flex-direction:column;min-width:176px;padding:var(--sp-1);background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--border-radius-lg);box-shadow:var(--shadow-lg)}.menu-item{display:block;width:100%;background:0 0;border:none;border-radius:var(--border-radius-sm);padding:var(--sp-2) var(--sp-3);cursor:pointer;text-align:left;font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;color:var(--color-text-icons--primary,#0a0a22)}.menu-item:hover{background-color:var(--color-muted)}.menu-item.negative{color:var(--color-negative)}`;let B=class NextAppointmentCard extends k{constructor(){super(...arguments),this.token="",this.patientHash="",this.isChatOpen=!1,this.isMenuOpen=!1,this.isCancelDialogOpen=!1,this.openDialog=null,this.getUnreadMessagesQuery=new r(this,()=>({...C(this.apiClient,{roomId:this.appointmentResource?.room?.id}),enabled:!!this.appointmentResource?.room?.id})),this.getOrganizationSetupQuery=new r(this,()=>u(this.apiClient)),this.getOrganizationSpecialtiesQuery=new r(this,()=>g(this.apiClient,{enabled:!!this.appointmentResource?.speciality?.id})),this.closeMenuOnOutsideClick=e=>{e.composedPath().includes(this)||(this.isMenuOpen=!1)},this.closeMenuOnEscape=e=>{"Escape"===e.key&&(this.isMenuOpen=!1)},this.handleJoinVideocall=()=>{f.track(v(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new S({appointmentId:this.appointmentId}))},this.handleToggleChat=()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&f.track(b(this.sessionPatientHash,this.appointmentId))},this.handleModify=()=>{this.isMenuOpen=!1,this.isModifyUnavailable?this.openDialog="modify":(f.track(y(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new E({appointmentId:this.appointmentId})))},this.handleCancel=()=>{this.isMenuOpen=!1,this.isCancelUnavailable?this.openDialog="cancel":(f.track($(this.sessionPatientHash,this.appointmentId)),this.isCancelDialogOpen=!0)}}static{this.styles=W}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.closeMenuOnOutsideClick),document.addEventListener("keydown",this.closeMenuOnEscape)}disconnectedCallback(){document.removeEventListener("click",this.closeMenuOnOutsideClick),document.removeEventListener("keydown",this.closeMenuOnEscape),super.disconnectedCallback()}get appointmentId(){return this.appointmentResource.appointment.id??""}get channel(){return this.appointmentResource.appointment.channel}get sessionToken(){return this.token||this.loginToken?.access_token||""}get sessionPatientHash(){return this.patientHash||this.loginToken?.patient?.hash||""}get sessionTimezone(){return this.timezone??this.loginToken?.patient?.timezone}get unreadCount(){return this.getUnreadMessagesQuery.result?.data?.unread_count??0}get specialtyName(){const e=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>Number(e.id)===Number(this.appointmentResource.speciality?.id));return x(e?.code??"",I(),e?.name??this.appointmentResource.speciality?.name)}get hasChatSupport(){return this.appointmentResource.appointment.has_chat_in_appointment??this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment??!1}get isExpired(){return c(this.appointmentResource.appointment.expires_at)}get refundPolicySeconds(){return this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel}get policyAllowsModifyOrCancel(){return w({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:this.refundPolicySeconds})}get isModifyUnavailable(){return this.isExpired||0===this.appointmentResource.slots.length||!this.policyAllowsModifyOrCancel}get isCancelUnavailable(){return this.isExpired||!this.policyAllowsModifyOrCancel}get modifyUnavailableMessage(){return J({action:"modify",refundPolicySeconds:this.refundPolicySeconds})}get cancelUnavailableMessage(){return J({action:"cancel",refundPolicySeconds:this.refundPolicySeconds})}channelIcon(){switch(this.channel){case d.videocall:return P({size:20});case d.phonecall:return A({size:20});default:return _({size:20})}}channelLabel(){switch(this.channel){case d.videocall:return o("Videoconsulta");case d.phonecall:return o("Consulta telefónica");default:return o("Chat")}}formatWhen(){const e=I().replace("_","-"),t=m(this.sessionTimezone),i=t?{timeZone:t}:{},n=new Date(this.appointmentResource.appointment.starts_at);if(Number.isNaN(n.getTime()))return"";const s=new Intl.DateTimeFormat(e,{weekday:"long",day:"numeric",month:"long",year:"numeric",...i}).format(n),r=new Intl.DateTimeFormat(e,{timeStyle:"short",hourCycle:"h23",...i}).format(n),l=t?h(t,n):"";return o(a`${s}, ${r} h${l?` (${l})`:""}`)}renderActions(){const e=this.channel===d.videocall;return O`<div class="actions">${this.hasChatSupport?O`<mq-button variant="outline" @click="${this.handleToggleChat}"><span class="chat-label">${o("Ir a chat")}</span> ${this.unreadCount>0?O`<mq-unread-badge class="chat-badge"></mq-unread-badge>`:j}</mq-button>`:j} ${e?O`<mq-button class="join" variant="primary" @click="${this.handleJoinVideocall}">${o("Unirse a la videoconsulta")}</mq-button>`:j}<div class="overflow"><mq-button variant="outline" size="icon-lg" aria-label="${o("Más opciones")}" aria-haspopup="menu" aria-expanded="${this.isMenuOpen}" @click="${()=>{this.isMenuOpen=!this.isMenuOpen}}">${R({size:16})}</mq-button>${this.isMenuOpen?O`<div class="menu" role="menu"><button class="menu-item" type="button" role="menuitem" @click="${this.handleModify}">${o("Modificar cita")}</button> <button class="menu-item negative" type="button" role="menuitem" @click="${this.handleCancel}">${o("Anular cita")}</button></div>`:j}</div></div>`}render(){const{professional:e}=this.appointmentResource,t=this.formatWhen();return O`<professional-overview .name="${e.name}" .specialtyName="${this.specialtyName}" .collegiateNumber="${e.collegiate_number??void 0}" .description="${e.description??""}" .languages="${e.languages??[]}" .avatar="${e.avatar??""}"></professional-overview><div class="details">${t?O`<div class="detail-row">${D({size:20})} <span>${t}</span></div>`:j}<div class="detail-row">${this.channelIcon()} <span>${this.channelLabel()}</span></div></div><div class="footer"><p class="reminder">${o("Recibirás un recordatorio 15 minutos antes de la consulta")}</p>${this.renderActions()}</div><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" hideCloseButton @mq-close="${()=>{this.isChatOpen=!1}}">${this.isChatOpen?O`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.sessionToken}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${e.hash}" ?readonly="${this.isExpired}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:j}</mq-floating-bubble><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${o("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${o("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,H.success(o("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentId}}))}}"></cancel-appointment-confirmation-dialog>`}};t([n({context:l,subscribe:!0})],B.prototype,"apiClient",void 0),t([n({context:p,subscribe:!0})],B.prototype,"loginToken",void 0),t([M({type:Object})],B.prototype,"appointmentResource",void 0),t([M({type:String})],B.prototype,"token",void 0),t([M({type:String})],B.prototype,"patientHash",void 0),t([M({type:String})],B.prototype,"timezone",void 0),t([z()],B.prototype,"isChatOpen",void 0),t([z()],B.prototype,"isMenuOpen",void 0),t([z()],B.prototype,"isCancelDialogOpen",void 0),t([z()],B.prototype,"openDialog",void 0),B=t([s(),i("next-appointment-card")],B);export{J as a,Q as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as a}from"./runtime-Bg1WXVCx.js";const e={s0043fc30b467bc43:"Ocultar detalhes",s00c8bf60a179e056:"O Google Pay não está disponível. Tente com cartão ou outro método de pagamento.",s035706a468d0c40b:"Viernes",s0520ac0a7da193d4:"Não foi possível validar o código. Tente novamente.",s071bd6bbf6c08f34:"Carregando",s08404262212123ef:"Como posso ajudar-te?",s08fe5307b5987c42:"De",s08fe5907b5988674:"Do",s09165307b5ad0e23:"Mi",s09165b07b5ad1bbb:"Ma",s09195307b5af43fa:"Lu",s092e4f07b5c19938:"Ju",s093b3307b5cbf400:"Vi",s09462f07b5d5f4b9:"Sa",s09528d5c26b62213:"Jueves",s0aaec824f7c6b501:"Enviar mensagem",s0b0085a15991b134:"Reconectando...",s0b0955208f737a86:"O arquivo excede o tamanho máximo permitido",s0eb69642cbc19745:"Esta consulta já passou, pelo que não pode ser modificada.",s0fc7c4bfd185800d:"Aqui vai ver as suas receitas e relatórios médicos.",s0fcbdef9dc977231:"Ocorreu um erro ao carregar a página. Por favor, tente novamente ou contacte o suporte.",s11605fc03de64e14:"Escreve aqui...",s12f171594a5379d2:"Tem certeza que deseja cancelar esta consulta?",s132e84f499a23985:"Não há horários disponíveis atualmente",s13317a76a9ed776e:"Repetir",s142eba34d93fe59e:"Descrição",s1513f3687bfcac96:"Domingo",s1a0efa6ac51e8a85:"Página anterior",s1a874fc38d0fcef0:"Ordem médica",s1d318e9d0ccba86b:"Chat",s1ee6d7e6d04932a4:"O email não é válido",s1fe8bb7f6ae07f9b:"Não tens consultas no histórico",s219b833c5ca095b3:"Aqui você verá todas as consultas que você teve. Pode acessar os documentos de cada consulta e reagendar uma consulta se necessário.",s22cf91a84fba4c4e:"Quando você agenda uma consulta, aparecerá aqui para que você possa consultá-la, modificá-la ou cancelá-la.",s255bf4de23c83482:"Condições de reserva:",s256189bafbcd2e34:"O telefone não é válido",s27e462e9f48eb3a6:"Documentação",s2a1d212b3cb5c1a1:"Pode chatear com o profissional até 48 horas após a sua consulta",s2aa2c19d07591438:"Vai receber um lembrete 15 minutos antes da consulta",s2aab27b26a86469f:"Motivo da consulta",s2b9fde9a5739d2a0:"Nome",s2bb20b2162a18938:"Por que precisa da consulta?",s2d6183fa992e10e9:"Este profissional não tem horários disponíveis",s2ebd846b5a30f9d1:"Lamentamos, não foi possível repetir a sua consulta. Por favor, contacte o suporte.",s30c9095a2e07d929:"Sala de espera",s31219c9bdeb7bc3e:"Continuar",s337e34cd11150eb6:"Ver as minhas consultas",s346d488070fe4cc8:"Pedir consulta",s3944638e633d719a:"Consulta",s3b77baf6a4864231:"Erro desconhecido",s3bd87e3e21b07900:"Espere enquanto a conexão é restabelecida",s3dc6584e403858df:"Não conseguimos carregar a sua documentação",s3f55bc3bfec41a5d:"Anexar arquivos",s4177fe7f5d70fd33:"Voltar",s41826ac201c3cd85:"Não foi possível abrir o chat com suporte",s4364d4be7641e15f:"Confirmar consulta",s43e5edcc8801e9a4:"Perfil de profesional",s4813ee5d305442e5:"Parece que não encontramos-te na hora da sua consulta. Pode programar outra consulta para resolver as suas dúvidas.",s49683919cdaeca83:"Hoje",s4a061033615c8016:"Documentos",s4a8494821c987a17:"Relatório",s4a8f1fcd3f5e5952:"Ainda não é hora!",s4d20157b5a655e70:"Este horário não está disponível. Por favor, selecione outro.",s4de424f531892818:"Ir para videoconferência",s51c461d40f9fb865:"Seleciona o seu especialista",s536a0b4d3d4a5d9f:"Não conseguimos carregar a sua próxima consulta",s53d957dda6cc200b:"Serviço e plataforma prestados por",s53e2497bf900c7fd:"Não tens consultas próximas",s5558a2e389d04223:"Modificar",s55c5126e99bae190:"Buscar disponibilidade",s563dcbfd432eb18f:"Cancelar consulta",s57e65113a89160cf:"Modalidade da consulta",s59612eaa6993aa7e:a`${0} minutos`,s5eef402d73eecbdc:"Anexar arquivo",s5f7956aacb5c6ca2:"A verificar Google Pay…",s5f817b8841b188d2:"Mais opções",s631f73a10d156b22:"Consulta expirada",s63f7af84683dd7c3:"Esta consulta já não pode ser modificada ou cancelada: o tempo mínimo requerido antes do início já passou.",s643155d1b6ee1684:"Tente novamente dentro de alguns minutos.",s64b78a5026d4ce8d:"Não há horários disponíveis",s65bedc0e516977d9:"Sábado",s679be6312356a21c:"Agende uma consulta médica quando você precisar. Aqui você verá todos os detalhes e poderá gerenciar as suas consultas próximas.",s67f30f9f4ea881f3:"Este código não é válido.",s6a50fd7f52263b04:"Não foi possível voltar à sala de espera",s6ab6fcd87fdbf217:"Olá",s6b1c4fb634461e7c:"Mês anterior",s6b6fa877ec1e6968:"Chatear com o profissional",s6c81d42670932f93:"Atualizar",s6e2423db05f36856:"Pedido de consulta",s6ecdc22accc55af7:"Videochamada",s70258a0040dd9e19:"Voltar à sala de espera",s718177442a7447b2:"Consulta com um especialista em menos de 72 horas",s733b3bf647b7b0fa:"Aceita os permissões de câmara e microfone",s73cad78d8a3c39c2:"Prescrição",s74d7a739b6ab651d:"Histórico",s757fef148e0c94c6:"Disponibilidade",s77320b73fdd9cc40:"Sair",s775370fdb0af1546:"Data de nascimento",s77c2b712a9813175:"Pedir uma nova consulta",s77f8e4bee88d44aa:a`${0} de ${1}`,s7907902da8916212:"O profissional vai te ligar no número que indicas neste campo.",s7aa3cd94d51825fc:"Não há profissionais disponíveis para a especialidade selecionada. Por favor, tente novamente em outro momento ou selecione outra especialidade.",s7af26e861bb6f905:"Falta o identificador de gateway do Google Pay",s7fd8da9511b66dd4:"Pode anexar imagens ou documentação adicional (análises, resultados de testes, etc.) para que o médico avalie",s83c6ce869a2bbaa7:"(1 é muito mau, 5 é excelente)",s8447efe79d058943:"Valor pago",s8581adc786786298:"Formato de arquivo não suportado",s862ca980b16911d0:"Chatear com o profissional",s8c18dbf02590a72e:"Código promocional aplicado",s8cce15c931017937:"Voltar ao início",s8e7a6119525dc7c9:a`Lamentamos, como faltam menos de ${0} minutos para a sua consulta não a podemos modificar.`,s9005845c358db9da:"Não conseguimos descarregar o documento.",s92f34d487d1d0355:"Promoção",s94626d2ffd70f075:"Código promocional validado com sucesso",s9536695467bcf9c4:"Esta consulta já passou, pelo que não pode ser cancelada.",s96474eac63a69381:"Ir para o chat",s96ceb408923a7ab1:a`Nº COL. ${0}`,s979ee14368bf1505:"Fala comigo",s9802dd10b2c2f760:"Enviar",s99898f495319cd49:"Este mensagem foi eliminado",s9c309154722f8e06:"Carregando portal de pagamento",s9cabdaf42f04afee:"Introduza o código",s9cbf16425cadadb1:"Por favor, tente novamente mais tarde.",s9d22fa67943fdc4c:"Consulta telefónica",sa00e726e1e7e46a9:"Adicionar código promocional",sa27f38ad9db3bc4f:"Assistente comercial",sa2fe3f3b565f15f4:"Cancelar",sa4186d5e26cab4bb:"Página não encontrada",sa497ebaaeb251035:"Repetir consulta",sa7de4334479674c6:"Modificar consulta",sa82bc40dafbe3256:a`Consulta agendada de ${0}`,sa83d79734eb60ee3:"Aplicar",sa86d729f62b39f99:"Entrar na videochamada",sa87d2c48a52b2617:"Você não tem documentação",sab964c37a0934399:"Não foi possível carregar o Google Pay. Verifique a configuração do site e tente novamente.",sac2728ace11e5f4b:"Especialidade*",sadc5ede25dd6e126:"O profissional vai te enviar uma mensagem para que possamos协调ar a consulta. Certifique-se de ter boa cobertura e poder atender no horário escolhido.",sae8f7ac5552b2af1:"Quando faltarem 10 minutos para a sua consulta, poderás aceder à videoconferência",saf63dc4c8601ec8c:"a",safe333e385f371ff:"Verificando seu pagamento...",saff3019e8a8c5f98:"Lunes",sb01184796ad3832e:"Como correu a tua consulta?",sb410a3509b92a90c:"Tens algum comentário sobre a consulta?",sb49dc4c5edae9d4e:"Avaliação da consulta",sb5387e21dc21422b:"Consulta modificada",sb621415007181c43:"Mês seguinte",sb73394814d122852:"Se o seu médico gerou alguma documentação, poderás ver e descarregar aqui, na secção de documentação, o seu e-mail ou o chat.",sb882f28c9b20052e:"Consulta confirmada",sba98cf8b2a7dfca4:"Ontem",sbbee712c4900abc2:"Não conseguimos iniciar o pagamento",sbc0be90393c87447:a`Resumo da consulta para ${0}`,sbcf081de432a2172:"Ver detalhes",sbcfc05bdb868b383:"Prescrição",sbd07d1f779e482ae:"Não conseguimos confirmar seu pagamento",sbd9803cceb34513a:"Iniciar chat com assistente comercial",sbda1cf7b293e17d2:"Carregar arquivo",sc27e7c4850fc5a34:a`Lamentamos, como faltam menos de ${0} horas para a sua consulta não a podemos cancelar.`,sc3bb7ea72886e4d0:"Documentos recentes",sc3c7734c15d2a045:"Conta-nos como foi o atendimento ou se tiveste algum problema com a videochamada…",sc43929cc6582a185:"Ver agenda completa",sc4edf6a4e0157d4e:"Consultas próximas",sc7cf2be40c8614fa:a`Lamentamos, como faltam menos de ${0} minutos para a sua consulta não a podemos cancelar.`,sca0e87aae6bde276:"Ocorreu algum problema?",sca4bd395e3148194:"Confirmar cancelação",sca90bc30758f9082:"A página que estás a procurar foi removida, renomeada ou pode não existir.",scbe4c6673872bda5:"Telefone",sce29e337ebd75277:"Chat com suporte",scf469737e1670fd4:"Página seguinte",scfc7f5c5f41936dc:"Meus consultas",sd1f44f1a8bc20e67:"Email",sd24922a2783f286e:"Miércoles",sd2a8fc66c53c1a27:"Saltar",sd3f7579076c6611c:"Parece que rejeitou os permissões necessárias para entrar na videoconferência. Edita os permissões no seu navegador para entrar. Uma vez concedidos, deves atualizar esta tela.",sd4beaeb9a1b1fed5:"Datas anteriores",sd812eb30f385776d:"Completa o seu perfil",sd853d3bcf5341b59:"Ver mais",sda962b28e9110c82:"Realiza a busca no seu perfil médico digital",sdb7004e477873574:"Consulta cancelada com sucesso",sdd963b1b2ce9a1f5:a`O profissional vai te ligar no ${0} no horário selecionado. Certifique-se de ter boa cobertura e poder atender no horário escolhido.`,sde993da26c048f19:"Traumatologia, ginecologia, endocrinologia, digestivo ou psiquiatria",sdee32ae81ca0d6d8:"Adicionar ao calendário",se00b081edccfae39:"Datas seguintes",se07ea9607704c5ad:"Alterar código",se090f7226b372a4a:"Se a consulta não pôde ser realizada, podes",se0c7cc77f86aa8a0:"Apelidos",se17f2b402ecea2e1:"Valor a devolver",se18fa3ef98e155de:"A preparar Google Pay…",se1cce5af3e9bb6ee:"Ocorreu um erro ao enviar o arquivo",se1cf783f86c53031:"Martes",se45e6f6f3428ad50:a`Link para a consulta: ${0}`,se5a09223256f98db:"Este campo é obrigatório",se5f9264155b99909:"Ocorreu um problema ao verificar o estado do seu pagamento. Por favor, contate o suporte se o pagamento foi realizado.",se92e438da4e7099f:a`Lamentamos, como faltam menos de ${0} horas para a sua consulta não a podemos modificar.`,sea11fd8a12559bc5:"Consulta prévia:",seb6739450e8d9c8d:"Tem certeza que deseja cancelar esta consulta? Você receberá o valor pago em um prazo de 5-10 dias úteis.",seb850e89f9ff58e8:"Próxima consulta",sed750da423170d47:"Resultados para:",sed836a96c3b5d523:"Portal de pagamento",sed8ec5e3c64fa25d:"Total",sed97e90642983578:"Continuar ao pagamento",sedb2092dda465ea1:"DNI/NIE",sedbca9676f07a51f:"Modalidade da consulta*",see7c0a7b5b6ebbc5:"Utiliza o chat para enviar o motivo da consulta, documentos ou imagens",sefc0dd68776c9466:"Questionário pré-consulta",sf0638d3fc50964d2:"Escolhe outra data",sf0695a0a125ae748:"Confirmar",sf09d5e51b63f2b7d:"Pagar com Google Pay",sf199b210440b7c5f:"Consulta finalizada",sf3457daf057bff15:"voltar à sala de espera.",sf484a0e20a7829ac:"Nós enviaremos um e-mail para o e-mail indicado quando for a hora de conectar-se à videoconferência. Certifique-se de ter uma boa conexão com a internet e um dispositivo com câmara e microfone.",sf48d12e7ae207023:"Especialidade",sf5258cfb2fa10bdc:"Aguarde ser atendido sem sair desta tela",sf63a72ff4116c6a9:"Descarregar documento",sf9705e1c4e82c017:"Não foi possível enviar o questionário",sfa6bc28a7faedc92:"Nova consulta de especialidades digitais",sfac5734d03595135:"Ver todas",sfc63af0362cfb78b:"Falta o identificador de comerciante do Google Pay",sfd51ca4e1b145054:"Não foi possível reservar este horário. Por favor, selecione outro.",sff337500b69abf7f:"O médico está a terminar a sua consulta. Atualiza em alguns minutos para ver se tem documentação.",sffbc330c8a19f838:"Ver menos",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",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",s67ebdb57fc6ed724:"Confirmar y pagar",sf75ec3d5bb6b65ab:"Método de pago",s0ef2d611972d04af:"Selecciona un método para realizar el pago de la cita",s0569fb3d65e68486:"Tarjeta",sa8771906f4c82494:"Google pay",se2570afbd791e071:"Apple pay",s3a392bf1aa5a8813:"No se puede iniciar Google Pay",sc9c8fbf418b784ac:"No se puede iniciar Apple Pay",s55e29f17a7ab0b80:"Esperando confirmación de Google Pay",s8ff9b86afd460a55:"Esperando confirmación de Apple Pay",s5b8873ddba610f68:"Abrir Google Pay",s9506fb9bc66942ed:"Abrir Apple Pay",s6db69fd67f48404c:"Abrir ventana de Google Pay",s6911c9ad386cc8b9:"Abrir ventana de Apple Pay",s4a9be42496525265:"Volver a abrir Google Pay",s3356a53ef97dcfba:"Volver a abrir Apple Pay",s9ca719e1a40e96e3:"Faltan credenciales de pago. Vuelve atrás e inténtalo de nuevo, o paga con tarjeta.",s0f6deacf5441e291:"Elegir otro método",s275336b3d23d6d9c:"No cierres esta página.",s1dec877628213eef:"Tus citas",se0c593aac5e172e6:"Accede, modifica o anula tus citas.",s230b0bee447e61a5:"Ver mis citas"};export{e as templates};
|
package/dist/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.
|
|
1
|
+
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.10.1",n={development:{MODE:"development",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"47836441",ASSETS_BASE_URL:E},production:{MODE:"production",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"46655102",ASSETS_BASE_URL:E}};let t=o;const _=new Proxy({},{get:(E,o)=>n[t??"production"][o]});function S(E){t=E}export{E as ASSETS_BASE_URL,_ as env,S as setEnv};
|
package/dist/events.d.ts
CHANGED
|
@@ -10,12 +10,7 @@
|
|
|
10
10
|
* Convention (matches `@mediquo/web-components`): a class extending `Event`,
|
|
11
11
|
* with a `static eventName`, dispatched `{ bubbles: true, composed: true }`.
|
|
12
12
|
* All names are `mq-*` prefixed to keep the published contract collision-free.
|
|
13
|
-
*
|
|
14
|
-
* The `HTMLElementEventMap` augmentation at the bottom gives hosts a single
|
|
15
|
-
* typed surface (autocomplete + checking on `addEventListener`), recovering the
|
|
16
|
-
* type-safety the discarded discriminated-union event used to provide.
|
|
17
13
|
*/
|
|
18
|
-
/** Which tab of the appointments list the host should land on. */
|
|
19
14
|
type MqAppointmentsTab = "next" | "history";
|
|
20
15
|
/**
|
|
21
16
|
* Generic "back" chrome, emitted by the presentational `back-link` primitive.
|
|
@@ -36,18 +31,14 @@ declare class MqBackEvent extends Event {
|
|
|
36
31
|
source?: string;
|
|
37
32
|
});
|
|
38
33
|
}
|
|
39
|
-
/** The user asked to return to the home screen (from `mq-my-appointments`). */
|
|
40
34
|
declare class MqHomeEvent extends Event {
|
|
41
35
|
static eventName: string;
|
|
42
36
|
constructor();
|
|
43
37
|
}
|
|
44
38
|
/**
|
|
45
|
-
* The user asked to view their appointments list on a specific tab.
|
|
46
|
-
*
|
|
47
39
|
* Carries `tab` on purpose: the discriminator (finished consultation → history,
|
|
48
40
|
* upcoming → next) is only known at the emitting call-site and cannot be
|
|
49
|
-
* reconstructed by the host afterwards.
|
|
50
|
-
* `ViewAppointmentsEvent { tab }` precedent in `@mediquo/web-components`.
|
|
41
|
+
* reconstructed by the host afterwards.
|
|
51
42
|
*/
|
|
52
43
|
declare class MqViewAppointmentsEvent extends Event {
|
|
53
44
|
readonly detail: {
|
|
@@ -58,7 +49,6 @@ declare class MqViewAppointmentsEvent extends Event {
|
|
|
58
49
|
tab: MqAppointmentsTab;
|
|
59
50
|
});
|
|
60
51
|
}
|
|
61
|
-
/** The user asked to reschedule an appointment. */
|
|
62
52
|
declare class MqAppointmentRescheduleEvent extends Event {
|
|
63
53
|
readonly detail: {
|
|
64
54
|
appointmentId: string;
|
|
@@ -68,7 +58,6 @@ declare class MqAppointmentRescheduleEvent extends Event {
|
|
|
68
58
|
appointmentId: string;
|
|
69
59
|
});
|
|
70
60
|
}
|
|
71
|
-
/** The user asked to book a new appointment (optionally pre-filtered). */
|
|
72
61
|
declare class MqAppointmentBookEvent extends Event {
|
|
73
62
|
readonly detail: {
|
|
74
63
|
specialty?: string;
|
|
@@ -82,7 +71,6 @@ declare class MqAppointmentBookEvent extends Event {
|
|
|
82
71
|
professional?: string;
|
|
83
72
|
});
|
|
84
73
|
}
|
|
85
|
-
/** The user asked to join the videocall of an appointment. */
|
|
86
74
|
declare class MqAppointmentJoinVideocallEvent extends Event {
|
|
87
75
|
readonly detail: {
|
|
88
76
|
appointmentId: string;
|
|
@@ -92,13 +80,6 @@ declare class MqAppointmentJoinVideocallEvent extends Event {
|
|
|
92
80
|
appointmentId: string;
|
|
93
81
|
});
|
|
94
82
|
}
|
|
95
|
-
/**
|
|
96
|
-
* The user asked to open an appointment's documentation.
|
|
97
|
-
*
|
|
98
|
-
* Folded into the `mq-appointment-*` family (was `goto-documentation` in
|
|
99
|
-
* `@mediquo/web-components`) so the action inventory is complete and the
|
|
100
|
-
* naming is consistent across the contract.
|
|
101
|
-
*/
|
|
102
83
|
declare class MqAppointmentViewDocumentationEvent extends Event {
|
|
103
84
|
readonly detail: {
|
|
104
85
|
appointmentId: string;
|
|
@@ -108,11 +89,6 @@ declare class MqAppointmentViewDocumentationEvent extends Event {
|
|
|
108
89
|
appointmentId: string;
|
|
109
90
|
});
|
|
110
91
|
}
|
|
111
|
-
/**
|
|
112
|
-
* Request to download a file (url + filename). Shared across the package
|
|
113
|
-
* (emitted by chat-room / videocall), so it lives in the events contract
|
|
114
|
-
* rather than colocated in a single feature.
|
|
115
|
-
*/
|
|
116
92
|
declare class DownloadFileEvent extends Event {
|
|
117
93
|
readonly detail: {
|
|
118
94
|
url: string;
|
|
@@ -124,23 +100,10 @@ declare class DownloadFileEvent extends Event {
|
|
|
124
100
|
filename: string;
|
|
125
101
|
});
|
|
126
102
|
}
|
|
127
|
-
/**
|
|
128
|
-
* The user asked to see their full documents list (from the dashboard's
|
|
129
|
-
* "recent documents" widget). No payload — the destination is a top-level
|
|
130
|
-
* screen the host owns.
|
|
131
|
-
*/
|
|
132
103
|
declare class MqViewDocumentsEvent extends Event {
|
|
133
104
|
static eventName: string;
|
|
134
105
|
constructor();
|
|
135
106
|
}
|
|
136
|
-
/**
|
|
137
|
-
* A payment session was confirmed as paid (emitted by `mq-payment-poller`).
|
|
138
|
-
*
|
|
139
|
-
* The poller only reports the *happy* terminal state: rejected and
|
|
140
|
-
* unconfirmable payments are rendered by the poller itself, because the host
|
|
141
|
-
* has no better screen to show for them and nothing to decide. Success is the
|
|
142
|
-
* one outcome where the host owns the destination, so it is the one event.
|
|
143
|
-
*/
|
|
144
107
|
declare class MqPaymentSucceededEvent extends Event {
|
|
145
108
|
readonly detail: {
|
|
146
109
|
appointmentId: string;
|
|
@@ -153,14 +116,10 @@ declare class MqPaymentSucceededEvent extends Event {
|
|
|
153
116
|
});
|
|
154
117
|
}
|
|
155
118
|
/**
|
|
156
|
-
* The user is about to be handed over to an off-site payment gateway.
|
|
157
|
-
*
|
|
158
119
|
* Unlike the rest of the contract this event is **cancelable and has a default
|
|
159
120
|
* action**: the emitting component navigates the top-level document to `url`
|
|
160
|
-
* unless a listener calls `preventDefault()`.
|
|
161
|
-
*
|
|
162
|
-
* in-app shells that must open the gateway some other way — the same reason
|
|
163
|
-
* `apple-pay-opened` / `google-pay-opened` are cancelable.
|
|
121
|
+
* unless a listener calls `preventDefault()`. The escape hatch exists for
|
|
122
|
+
* webviews and in-app shells that must open the gateway some other way.
|
|
164
123
|
*
|
|
165
124
|
* `url` is a single-use gateway checkout URL — treat it as a secret and do not
|
|
166
125
|
* log it.
|
package/dist/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{z as t}from"./chunks/external-CJj32K_p.js";const c=["ca_ES","de_DE","en_US","pt_PT"],s=t.enum(["en_US","pt_PT","de_DE","es_ES","ca_ES"]);function a(e){return s.safeParse(e).success}const o="__mqElementsLocalization__";function i(){const e=globalThis;return e[o]||(e[o]={initialized:!1}),e[o]}function r(){const t=i();if(!t.initialized){t.initialized=!0;try{const{setLocale:n,getLocale:s}=e({sourceLocale:"es_ES",targetLocales:c,loadLocale:async e=>{switch(e){case"en_US":default:return import("./chunks/en_US-
|
|
1
|
+
import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{z as t}from"./chunks/external-CJj32K_p.js";const c=["ca_ES","de_DE","en_US","pt_PT"],s=t.enum(["en_US","pt_PT","de_DE","es_ES","ca_ES"]);function a(e){return s.safeParse(e).success}const o="__mqElementsLocalization__";function i(){const e=globalThis;return e[o]||(e[o]={initialized:!1}),e[o]}function r(){const t=i();if(!t.initialized){t.initialized=!0;try{const{setLocale:n,getLocale:s}=e({sourceLocale:"es_ES",targetLocales:c,loadLocale:async e=>{switch(e){case"en_US":default:return import("./chunks/en_US-mxYf5Jqv.js");case"pt_PT":return import("./chunks/pt_PT-g8meEZVV.js");case"de_DE":return import("./chunks/de_DE-DUtzXD1z.js");case"ca_ES":return import("./chunks/ca_ES-DMretbb7.js")}}});t.setLocale=n,t.getLocale=s}catch(e){n.warn("Localization was already configured on this page.",e)}}}const u="Localization not initialized yet.";async function l(e){const{setLocale:t}=i();if(t)return t(e);n.warn(u)}function _(){const{getLocale:e}=i();return e?e():(n.warn(u),"es_ES")}export{_ as getLocale,r as initLocalization,a as isValidLocale,l as setLocale};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
-
import { M as MediquoApiChatClient } from './chunks/index.d-
|
|
2
|
+
import { M as MediquoApiChatClient } from './chunks/index.d-DeJP_xib.js';
|
|
3
3
|
import { LitElement, PropertyValues } from 'lit';
|
|
4
4
|
import { Env } from './env.js';
|
|
5
5
|
import 'axios';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{e as o}from"./chunks/provide-BwI4DDGF.js";import{A as i}from"./chunks/api-client-context-V1UAGtKW.js";import{a as r,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n}from"./chunks/property-scuRaFcM.js";import{r as p}from"./chunks/state-LQivXIgA.js";import{setEnv as c}from"./env.js";import{c as a,n as m}from"./chunks/api-chat-client-
|
|
1
|
+
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{e as o}from"./chunks/provide-BwI4DDGF.js";import{A as i}from"./chunks/api-client-context-V1UAGtKW.js";import{a as r,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n}from"./chunks/property-scuRaFcM.js";import{r as p}from"./chunks/state-LQivXIgA.js";import{setEnv as c}from"./env.js";import{c as a,n as m}from"./chunks/api-chat-client-BhxUWldC.js";import{e as h}from"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/chunk-2TKJJNS7-BGwxtEg7.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/external-CJj32K_p.js";import"./chunks/isBefore-CPpTogxo.js";h();let u=class MqApiClientProvider extends r{constructor(){super(...arguments),this.apiClient=a()}willUpdate(t){t.has("env")&&this.env&&c(this.env);const e=m(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale});e&&(this.apiClient=e)}render(){return s`<slot></slot>`}};t([n({type:String,attribute:"api-key"})],u.prototype,"apiKey",void 0),t([n({type:String,attribute:"token"})],u.prototype,"token",void 0),t([n({type:String,attribute:"locale"})],u.prototype,"locale",void 0),t([n({type:String,attribute:"env"})],u.prototype,"env",void 0),t([o({context:i}),p()],u.prototype,"apiClient",void 0),u=t([e("mq-api-client-provider")],u);export{u as MqApiClientProvider};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, PropertyValues } from 'lit';
|
|
3
|
-
import { M as MediquoApiChatClient } from './chunks/index.d-
|
|
3
|
+
import { M as MediquoApiChatClient } from './chunks/index.d-DeJP_xib.js';
|
|
4
4
|
import { Env } from './env.js';
|
|
5
5
|
import { Locale } from './i18n.js';
|
|
6
6
|
import 'axios';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as t}from"./chunks/custom-element-D2ziPxYE.js";import{e as a}from"./chunks/provide-BwI4DDGF.js";import{c as i}from"./chunks/consume-CovVqBjI.js";import{m as s}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/localized-decorator-BlOuLhym.js";import{A as o}from"./chunks/api-client-context-V1UAGtKW.js";import{L as r}from"./chunks/login-token-task-Yib__6a9.js";import{l as p}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as l,a as c,x as h}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as y}from"./chunks/state-LQivXIgA.js";import{setEnv as d}from"./env.js";import{initLocalization as m,setLocale as v,isValidLocale as k}from"./i18n.js";import{c as b,n as f}from"./chunks/api-chat-client-
|
|
1
|
+
import{_ as e,c as t}from"./chunks/custom-element-D2ziPxYE.js";import{e as a}from"./chunks/provide-BwI4DDGF.js";import{c as i}from"./chunks/consume-CovVqBjI.js";import{m as s}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/localized-decorator-BlOuLhym.js";import{A as o}from"./chunks/api-client-context-V1UAGtKW.js";import{L as r}from"./chunks/login-token-task-Yib__6a9.js";import{l as p}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as l,a as c,x as h}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as y}from"./chunks/state-LQivXIgA.js";import{setEnv as d}from"./env.js";import{initLocalization as m,setLocale as v,isValidLocale as k}from"./i18n.js";import{c as b,n as f}from"./chunks/api-chat-client-BhxUWldC.js";import{u as P,s as _,r as E}from"./chunks/apple-pay-outcomes-BU_PyQdT.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-CJj32K_p.js";import"./chunks/chunk-2TKJJNS7-BGwxtEg7.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";function g(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent;return/Safari/i.test(e)&&!/Chrome|Chromium|Edg|OPR|Firefox|FxiOS/i.test(e)}async function S(e){if("undefined"==typeof window||!window.isSecureContext)return{available:!1,reason:"unsupported"};if(!function(){if("undefined"==typeof window)return!1;const e="undefined"!=typeof ApplePaySession&&"function"==typeof ApplePaySession.canMakePayments,t="undefined"!=typeof customElements&&void 0!==customElements.get("apple-pay-button");return e&&t}())return{available:!1,reason:"sdk-missing"};if(!e.trim())return{available:!1,reason:"merchant-id-missing"};const t=ApplePaySession;if(function(e){return"function"==typeof e.applePayCapabilities}(t))try{return function(e){switch(e){case"applePayUnsupported":return{available:!1,reason:"unsupported"};case"paymentCredentialsUnavailable":case"paymentCredentialsAvailable":case"paymentCredentialStatusUnknown":return{available:!0,usesQrFlow:!g()}}}((await t.applePayCapabilities(e)).paymentCredentialStatus)}catch{return t.canMakePayments()?{available:!0,usesQrFlow:!g()}:{available:!1,reason:"unsupported"}}return t.canMakePayments()?{available:!0,usesQrFlow:!g()}:{available:!1,reason:"unsupported"}}const A={es_ES:"es-ES",en_US:"en-US",pt_PT:"pt-PT",de_DE:"de-DE",ca_ES:"ca-ES"};try{m()}catch{}const C=["visa","masterCard","amex"],w=["supports3DS"],x=l`:host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;width:100%;min-height:48px}.helper{margin:0;text-align:center;font-family:system-ui,sans-serif;font-size:13px;line-height:1.4;color:#6e6e73}.pay-row{display:block;width:100%}.pay-row--paying{opacity:.55;pointer-events:none}apple-pay-button{--apple-pay-button-width:100%;--apple-pay-button-height:48px;--apple-pay-button-border-radius:10px;--apple-pay-button-padding:0;display:block;width:100%;min-height:48px;cursor:pointer}.state{text-align:center;font-family:system-ui,sans-serif;font-size:15px;color:#86868b;margin:0}`;class ApplePayCheckoutSuccessEvent extends Event{static{this.eventName="payment-success"}constructor(e){super(ApplePayCheckoutSuccessEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutDeniedEvent extends Event{static{this.eventName="payment-denied"}constructor(e){super(ApplePayCheckoutDeniedEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutErrorEvent extends Event{static{this.eventName="payment-error"}constructor(e){super(ApplePayCheckoutErrorEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}function j(e,t){p.warn(e,{error:t instanceof Error?t.message:String(t)})}let T=class MqApplePayCheckout extends c{constructor(){super(...arguments),this._availabilityPhase="checking",this._showQrHelper=!1,this._paying=!1,this._suppressCancelEvent=!1,this._availabilityGeneration=0,this.apiClient=b(),this._loginTokenTask=new r(this,()=>this.apiClient,{args:()=>[this.apiKey,this.token],onComplete:e=>{this._sessionToken=e.access_token,this.apiClient.setAuthToken(e.access_token),this._refreshAvailability()},onError:()=>{this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"auth"}))}}),this._onPayClick=()=>{if(this._paying||"ready"!==this._availabilityPhase)return;let e;try{e=new ApplePaySession(3,this._buildPaymentRequest())}catch(e){return j("mq-apple-pay-checkout: failed to create ApplePaySession",e),void this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}this._paying=!0,this._suppressCancelEvent=!1,e.onvalidatemerchant=async t=>{try{const a=await this.apiClient.payments.validateApplePayMerchant({order_id:this.sessionId,validation_url:t.validationURL});e.completeMerchantValidation(P(a))}catch(t){j("mq-apple-pay-checkout: validate-merchant failed",t),this._suppressCancelEvent=!0,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"merchant"})),e.abort(),this._paying=!1}},e.onpaymentauthorized=async t=>{try{const a=await this.apiClient.payments.authorizeApplePay({order_id:this.sessionId,token:_(t.payment.token)}),{status:i,consultation_id:s}=a.data,n=E(i,s,this.sessionId);switch(n.kind){case"success":e.completePayment(ApplePaySession.STATUS_SUCCESS),this.dispatchEvent(new ApplePayCheckoutSuccessEvent({sessionId:n.sessionId,reference:n.reference}));break;case"denied":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutDeniedEvent({sessionId:n.sessionId}));break;case"error":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:n.reason}))}}catch(t){j("mq-apple-pay-checkout: authorize failed",t),e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"authorize"}))}finally{this._paying=!1}},e.oncancel=()=>{this._paying=!1,this._suppressCancelEvent?this._suppressCancelEvent=!1:this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"cancelled"}))};try{e.begin()}catch(e){j("mq-apple-pay-checkout: session.begin() failed",e),this._paying=!1,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}}}static{this.styles=x}willUpdate(e){e.has("env")&&this.env&&d(this.env),e.has("locale")&&v(k(this.locale)?this.locale:"es_ES");const t=f(e,{env:this.env,apiKey:this.apiKey,token:this._sessionToken,locale:k(this.locale)?this.locale:"es_ES"},this.inheritedApiClient);t&&(this.apiClient=t),e.has("merchantId")&&this._loginTokenTask.value&&this._refreshAvailability()}async _refreshAvailability(){const e=++this._availabilityGeneration;this._availabilityPhase="checking",this._showQrHelper=!1;const t=await S(this.merchantId??"");e===this._availabilityGeneration&&(t.available?(this._availabilityPhase="ready",this._showQrHelper=t.usesQrFlow):this._availabilityPhase="unavailable")}get _resolvedLocale(){return k(this.locale)?this.locale:"es_ES"}_buildPaymentRequest(){return{countryCode:this.country,currencyCode:this.currency,supportedNetworks:[...C],merchantCapabilities:[...w],total:{label:this.label,amount:this.amount}}}_renderUnavailable(){return this.merchantId?.trim()?"undefined"==typeof ApplePaySession?h`<p class="state">${s("No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`:h`<p class="state">${s("Apple Pay no está disponible")}</p>`:h`<p class="state">${s("Falta el identificador de comercio de Apple Pay")}</p>`}render(){return this._loginTokenTask.render({pending:()=>h`<p class="state">${s("Preparando Apple Pay…")}</p>`,error:()=>h`<p class="state">${s("No hemos podido iniciar el pago")}</p>`,complete:()=>{return"checking"===this._availabilityPhase?h`<p class="state">${s("Comprobando Apple Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():h`${this._showQrHelper?h`<p class="helper">${s("Para pagar con Apple Pay, escanea el código QR con tu iPhone (iOS 18 o posterior) y confirma el pago.")}</p>`:null}<div class="pay-row ${this._paying?"pay-row--paying":""}"><apple-pay-button buttonstyle="black" type="pay" locale="${e=this._resolvedLocale,A[e]??"es-ES"}" aria-label="${s("Pagar con Apple Pay")}" @click="${this._onPayClick}"></apple-pay-button></div>`;var e}})}};e([u({type:String,attribute:"env"})],T.prototype,"env",void 0),e([u({type:String,attribute:"api-key"})],T.prototype,"apiKey",void 0),e([u({type:String,attribute:"token"})],T.prototype,"token",void 0),e([u({type:String,attribute:"locale",reflect:!0})],T.prototype,"locale",void 0),e([u({type:String,attribute:"merchant-id"})],T.prototype,"merchantId",void 0),e([u({type:String,attribute:"session-id"})],T.prototype,"sessionId",void 0),e([u({type:String,attribute:"amount"})],T.prototype,"amount",void 0),e([u({type:String,attribute:"currency"})],T.prototype,"currency",void 0),e([u({type:String,attribute:"country"})],T.prototype,"country",void 0),e([u({type:String,attribute:"label"})],T.prototype,"label",void 0),e([y()],T.prototype,"_availabilityPhase",void 0),e([y()],T.prototype,"_showQrHelper",void 0),e([y()],T.prototype,"_paying",void 0),e([i({context:o,subscribe:!0}),y()],T.prototype,"inheritedApiClient",void 0),e([a({context:o}),y()],T.prototype,"apiClient",void 0),T=e([n(),t("mq-apple-pay-checkout")],T);export{ApplePayCheckoutDeniedEvent,ApplePayCheckoutErrorEvent,ApplePayCheckoutSuccessEvent,T as MqApplePayCheckout};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
-
import { C as CreatePaymentLinkRequest } from './chunks/index.d-
|
|
2
|
+
import { C as CreatePaymentLinkRequest } from './chunks/index.d-DeJP_xib.js';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
4
|
import { Env } from './env.js';
|
|
5
5
|
import { Locale } from './i18n.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{a as o,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n as i}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import"./mq-checkout.js";import"./chunks/provide-BwI4DDGF.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/consume-CovVqBjI.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/api-chat-client-
|
|
1
|
+
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{a as o,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n as i}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import"./mq-checkout.js";import"./chunks/provide-BwI4DDGF.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/consume-CovVqBjI.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/api-chat-client-BhxUWldC.js";import"./chunks/chunk-2TKJJNS7-BGwxtEg7.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/external-CJj32K_p.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/api-client-context-V1UAGtKW.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/login-token-task-Yib__6a9.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/state-LQivXIgA.js";import"./theme.js";import"./i18n.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/directive-2EDmOukv.js";class AppointmentPaidEvent extends Event{static{this.eventName="payment-success"}constructor(t){super(AppointmentPaidEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let r=class MqAppointmentCheckout extends o{constructor(){super(...arguments),this._provideSession=async t=>{const e=await t.payments.createPaymentLink({slot_id:this.slotId,service_id:this.serviceId,specialty_id:this.specialtyId,consultation_reason:this.consultationReason,discount_code:this.discountCode,preconsultation_documents:this.preconsultationDocuments});return{sessionId:e.session_id,paymentUrl:e.payment_link}},this._onSuccess=t=>{t.stopPropagation(),this.dispatchEvent(new AppointmentPaidEvent({appointmentId:t.detail.reference}))}}render(){return s`<mq-checkout env="${n(this.env)}" api-key="${this.apiKey}" token="${this.token}" locale="${this.locale}" .provideSession="${this._provideSession}" @payment-success="${this._onSuccess}"></mq-checkout>`}};t([i({type:String,attribute:"env"})],r.prototype,"env",void 0),t([i({type:String,attribute:"api-key"})],r.prototype,"apiKey",void 0),t([i({type:String,attribute:"token"})],r.prototype,"token",void 0),t([i({type:String,attribute:"locale",reflect:!0})],r.prototype,"locale",void 0),t([i({type:String,attribute:"slot-id"})],r.prototype,"slotId",void 0),t([i({type:String,attribute:"service-id"})],r.prototype,"serviceId",void 0),t([i({type:String,attribute:"specialty-id"})],r.prototype,"specialtyId",void 0),t([i({type:String,attribute:"consultation-reason"})],r.prototype,"consultationReason",void 0),t([i({type:String,attribute:"discount-code"})],r.prototype,"discountCode",void 0),t([i({attribute:!1})],r.prototype,"preconsultationDocuments",void 0),r=t([e("mq-appointment-checkout")],r);export{AppointmentPaidEvent,r as MqAppointmentCheckout};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
-
import { M as MediquoApiChatClient } from './chunks/index.d-
|
|
2
|
+
import { M as MediquoApiChatClient } from './chunks/index.d-DeJP_xib.js';
|
|
3
3
|
import { LitElement, PropertyValues } from 'lit';
|
|
4
4
|
import { Env } from './env.js';
|
|
5
5
|
import './ui/mq-button.js';
|
|
6
|
-
import './chunks/mq-chat-room-
|
|
6
|
+
import './chunks/mq-chat-room-B3ant6md.js';
|
|
7
7
|
import './ui/mq-floating-bubble.js';
|
|
8
8
|
import './ui/mq-card.js';
|
|
9
9
|
import './ui/mq-unread-badge.js';
|
|
10
10
|
import './ui/mq-page-title.js';
|
|
11
|
-
import './chunks/index-
|
|
11
|
+
import './chunks/index-Cgni0Is9.js';
|
|
12
12
|
import './chunks/mq-layout-D8Mak16a.js';
|
|
13
13
|
import 'axios';
|
|
14
14
|
import 'zod';
|
|
@@ -38,6 +38,7 @@ declare class MqAppointmentDocumentation extends LitElement {
|
|
|
38
38
|
locale?: string;
|
|
39
39
|
/** Environment override ("development" | "production"). Optional. */
|
|
40
40
|
env?: Env;
|
|
41
|
+
showMediquoBranding: boolean;
|
|
41
42
|
private getAppointmentQuery;
|
|
42
43
|
/** The organization scope this element was mounted under, if any. */
|
|
43
44
|
private inheritedApiClient?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as
|
|
1
|
+
import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as o,c as s}from"./chunks/custom-element-D2ziPxYE.js";import{e as r}from"./chunks/provide-BwI4DDGF.js";import{c as n}from"./chunks/consume-CovVqBjI.js";import{Q as a}from"./chunks/query-controller-BlO1Ax65.js";import{A as c}from"./chunks/api-client-context-V1UAGtKW.js";import{g as d}from"./chunks/get-appointment-query-C-gTTuiQ.js";import{a as p,i as l,x as m}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as h}from"./chunks/state-LQivXIgA.js";import{setEnv as k}from"./env.js";import{c as v,n as b}from"./chunks/api-chat-client-BhxUWldC.js";import"./chunks/documentation-view-CEfoq9vD.js";import"./ui/mq-card.js";import"./chunks/mq-layout-BiE8gq23.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import"./chunks/chunk-2TKJJNS7-BGwxtEg7.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/addSeconds-ofMnxlgT.js";import"./ui/icons/calendar-icon.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/icons/types.js";import"./ui/icons/clock-icon.js";import"./ui/icons/info-circle-outine-icon.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import"./ui/icons/message-bubble-icon.js";import"./mq-chat-room.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/mq-avatar.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-BUV4MGML-CkhBbfUu.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./events.js";import"./chunks/chunk-Y4EKUX25-QqMl3eiq.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./chunks/chunk-YTQUGGS3-DmCGIoFy.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-unread-badge.js";import"./ui/mq-page-title.js";import"./ui/icons/arrow-narrow-left-icon.js";import"./ui/icons/download-icon.js";import"./chunks/blob-to-base64-CUL1trde.js";import"./chunks/telemetry-client-DEIuDZfA.js";let j=class DocumentationViewSkeleton extends p{static{this.styles=l`.skeleton{border-radius:var(--border-radius-md);background-color:#f0f0f0;animation:skeleton-pulse 1.5s infinite}.page-title-skeleton{display:flex;align-items:center;gap:var(--sp-3);margin-bottom:var(--size-3)}.back-button-skeleton{width:var(--size-10);height:var(--size-10);border-radius:var(--border-radius-full);flex-shrink:0}.title-bar-skeleton{width:120px;height:24px;border-radius:var(--border-radius-sm)}@media (min-width:768px){.page-title-skeleton{gap:var(--sp-6)}.title-bar-skeleton{width:200px;height:32px}}.description-skeleton{width:100%;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-2)}.description-skeleton:last-of-type{width:70%;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-name-skeleton{width:180px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-1)}.professional-speciality-skeleton{width:140px;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.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);font-family:var(--font-body)}.icon-skeleton{width:20px;height:20px;border-radius:var(--border-radius-sm)}.text-skeleton{width:120px;height:16px;border-radius:var(--border-radius-sm)}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card .skeleton{background-color:var(--color-muted)}.documents-card-title-skeleton{width:150px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.button-skeleton{width:100%;height:44px;border-radius:var(--border-radius-md);margin-top:var(--size-4)}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}`}render(){return m`<div class="page-title-skeleton"><div class="skeleton back-button-skeleton"></div><div class="skeleton title-bar-skeleton"></div></div><div class="skeleton description-skeleton"></div><div class="skeleton description-skeleton"></div><mq-card class="professional-card" roundness="md"><div><div class="skeleton professional-name-skeleton"></div><div class="skeleton professional-speciality-skeleton"></div></div><dl class="description-list"><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div></dl></mq-card><mq-card class="documents-card" roundness="md"><div class="skeleton documents-card-title-skeleton"></div><div class="skeleton button-skeleton"></div></mq-card>`}};j=o([s("documentation-view-skeleton")],j);let g=class MqAppointmentDocumentation extends p{constructor(){super(...arguments),this.showMediquoBranding=!0,this.getAppointmentQuery=new a(this,()=>d(this.apiClient,{id:this.appointmentId})),this.apiClient=v()}willUpdate(i){i.has("env")&&this.env&&k(this.env),i.has("locale")&&this.locale&&t(this.locale)&&e(this.locale);const o=b(i,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);o&&(this.apiClient=o)}render(){return m`<mq-layout background="transparent" .showMediquoBranding="${this.showMediquoBranding}">${this.getAppointmentQuery.render({complete:t=>m`<documentation-view .token="${this.token}" .appointment="${t}"></documentation-view>`,error:()=>m``,pending:()=>m`<documentation-view-skeleton></documentation-view-skeleton>`})}</mq-layout>`}};o([u({type:String,attribute:"appointment-id"})],g.prototype,"appointmentId",void 0),o([u({type:String,attribute:"token"})],g.prototype,"token",void 0),o([u({type:String,attribute:"api-key"})],g.prototype,"apiKey",void 0),o([u({type:String,attribute:"locale"})],g.prototype,"locale",void 0),o([u({type:String,attribute:"env"})],g.prototype,"env",void 0),o([u({type:Boolean,attribute:"show-mediquo-branding",converter:{fromAttribute:t=>null===t||"false"!==t&&"0"!==t,toAttribute:t=>t?"":"false"}})],g.prototype,"showMediquoBranding",void 0),o([n({context:c,subscribe:!0}),h()],g.prototype,"inheritedApiClient",void 0),o([r({context:c}),h()],g.prototype,"apiClient",void 0),g=o([s("mq-appointment-documentation")],g),i();export{g as MqAppointmentDocumentation};
|
package/dist/mq-chat-room.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { M as MqChatRoom } from './chunks/mq-chat-room-
|
|
1
|
+
export { M as MqChatRoom } from './chunks/mq-chat-room-B3ant6md.js';
|
|
2
2
|
import 'lit-html';
|
|
3
3
|
import 'lit';
|
|
4
|
-
import './chunks/index.d-
|
|
4
|
+
import './chunks/index.d-DeJP_xib.js';
|
|
5
5
|
import 'axios';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import './chunks/schemas.d-b6_AekBb.js';
|