@mediquo/elements 0.5.0 → 0.5.2

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.
Files changed (87) hide show
  1. package/README.md +3 -1
  2. package/dist/chunks/api-chat-client-1Vz6ZOwp.js +1 -0
  3. package/dist/chunks/{apple-pay-outcomes-CjCnBYOD.js → apple-pay-outcomes-0ozxSHyb.js} +1 -1
  4. package/dist/chunks/appointment-card-skeleton-1c7552Ln.d.ts +398 -0
  5. package/dist/chunks/appointment-card-skeleton-hglMW7x6.js +1 -0
  6. package/dist/chunks/{documentation-view-fFbvjJqx.js → documentation-view-geQU8ttU.js} +1 -1
  7. package/dist/chunks/get-patient-documents-query-DIQH-TMM.js +1 -0
  8. package/dist/chunks/{index-CLdWVaEs.js → index-BBUiLb3Y.js} +1 -1
  9. package/dist/chunks/index-BJYWtEmT.js +1 -0
  10. package/dist/chunks/{index-Xcn-xs13.js → index-Bx8TWBsk.js} +1 -1
  11. package/dist/chunks/{price-BmA2Dl9f.js → price-DIhNpS8n.js} +1 -1
  12. package/dist/chunks/{refund-cancel-policy-D_tUYPyv.js → refund-cancel-policy-BQDnePq9.js} +1 -1
  13. package/dist/chunks/{schemas.d-BEA8Pl6w.d.ts → schemas.d-5CaMrfOq.d.ts} +6 -0
  14. package/dist/chunks/telemetry-client-BLJVs9me.js +1 -0
  15. package/dist/env.js +1 -1
  16. package/dist/events.d.ts +56 -1
  17. package/dist/events.js +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +1 -1
  20. package/dist/mq-apple-pay-checkout.js +1 -1
  21. package/dist/mq-appointment-checkout.d.ts +1 -1
  22. package/dist/mq-appointment-checkout.js +1 -1
  23. package/dist/mq-appointment-documentation.js +1 -1
  24. package/dist/mq-chat-room.js +1 -1
  25. package/dist/mq-checkout.js +1 -1
  26. package/dist/mq-dashboard.d.ts +224 -0
  27. package/dist/mq-dashboard.js +1 -0
  28. package/dist/mq-documents.js +1 -1
  29. package/dist/mq-google-pay-checkout.js +1 -1
  30. package/dist/mq-immediate-videocall-checkout.js +1 -1
  31. package/dist/mq-my-appointments.d.ts +9 -391
  32. package/dist/mq-my-appointments.js +1 -1
  33. package/dist/mq-payment-poller.d.ts +61 -0
  34. package/dist/mq-payment-poller.js +1 -0
  35. package/dist/mq-professional-presence-sync.js +1 -1
  36. package/dist/mq-schedule-success.js +2 -2
  37. package/dist/mq-schedule.d.ts +8 -2
  38. package/dist/mq-schedule.js +1 -1
  39. package/dist/mq-support-chat.d.ts +1 -1
  40. package/dist/mq-support-chat.js +1 -1
  41. package/dist/mq-terms-and-conditions.js +1 -1
  42. package/dist/mq-unread-count-sync.js +1 -1
  43. package/dist/mq-videocall.js +1 -1
  44. package/dist/react/mq-apple-pay-checkout.d.ts +24 -7
  45. package/dist/react/mq-apple-pay-checkout.js +1 -1
  46. package/dist/react/mq-appointment-checkout.d.ts +21 -6
  47. package/dist/react/mq-appointment-checkout.js +1 -1
  48. package/dist/react/mq-appointment-documentation.d.ts +17 -6
  49. package/dist/react/mq-appointment-documentation.js +1 -1
  50. package/dist/react/mq-chat-room.d.ts +30 -7
  51. package/dist/react/mq-chat-room.js +1 -1
  52. package/dist/react/mq-checkout.d.ts +22 -8
  53. package/dist/react/mq-checkout.js +1 -1
  54. package/dist/react/mq-dashboard.d.ts +57 -0
  55. package/dist/react/mq-dashboard.js +2 -0
  56. package/dist/react/mq-documents.d.ts +16 -2
  57. package/dist/react/mq-documents.js +1 -1
  58. package/dist/react/mq-google-pay-checkout.d.ts +29 -7
  59. package/dist/react/mq-google-pay-checkout.js +1 -1
  60. package/dist/react/mq-immediate-videocall-checkout.d.ts +15 -5
  61. package/dist/react/mq-immediate-videocall-checkout.js +1 -1
  62. package/dist/react/mq-my-appointments.d.ts +26 -6
  63. package/dist/react/mq-my-appointments.js +1 -1
  64. package/dist/react/mq-payment-poller.d.ts +33 -0
  65. package/dist/react/mq-payment-poller.js +2 -0
  66. package/dist/react/mq-professional-presence-sync.d.ts +8 -2
  67. package/dist/react/mq-professional-presence-sync.js +1 -1
  68. package/dist/react/mq-query-client-provider.d.ts +9 -2
  69. package/dist/react/mq-schedule-success.d.ts +30 -7
  70. package/dist/react/mq-schedule-success.js +1 -1
  71. package/dist/react/mq-schedule.d.ts +47 -8
  72. package/dist/react/mq-schedule.js +1 -1
  73. package/dist/react/mq-session-provider.d.ts +11 -2
  74. package/dist/react/mq-socket-provider.d.ts +13 -2
  75. package/dist/react/mq-support-chat.d.ts +31 -2
  76. package/dist/react/mq-support-chat.js +1 -1
  77. package/dist/react/mq-terms-and-conditions.d.ts +21 -5
  78. package/dist/react/mq-terms-and-conditions.js +1 -1
  79. package/dist/react/mq-theme-provider.d.ts +13 -2
  80. package/dist/react/mq-toast-container.d.ts +10 -2
  81. package/dist/react/mq-unread-count-sync.d.ts +8 -2
  82. package/dist/react/mq-unread-count-sync.js +1 -1
  83. package/dist/react/mq-videocall.d.ts +30 -12
  84. package/dist/react/mq-videocall.js +1 -1
  85. package/package.json +9 -1
  86. package/dist/chunks/api-chat-client-CqMn2JEn.js +0 -1
  87. package/dist/chunks/telemetry-client-Ca71sobH.js +0 -1
@@ -1 +1 @@
1
- import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-Bj8p7kJX.js";import{a as s,C as r,b as l,i as d}from"./api-chat-client-CqMn2JEn.js";import{t as c,d as m,a as p,b as h,c as u}from"./telemetry-client-Ca71sobH.js";import{a as f,i as g,E as v,x as y}from"./lit-element-DiWJYFwC.js";import{n as b}from"./property-scuRaFcM.js";import{getLocale as x}from"../i18n.js";import{calendarIcon as $}from"../ui/icons/calendar-icon.js";import{clockIcon as k}from"../ui/icons/clock-icon.js";import{r as w}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as z}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as q}from"./chunk-S5RWG6G2-DPesx3Od.js";import{messageBubbleIcon as j}from"../ui/icons/message-bubble-icon.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as _}from"./consume-CovVqBjI.js";import{Q as C}from"./query-controller-BlO1Ax65.js";import{g as O}from"./chunk-GZF3YFSX-DM-GTqxg.js";import"../ui/back-link.js";import"./index-Xcn-xs13.js";import{M as S}from"./mutation-controller-CR2qcqhH.js";import{g as T}from"./get-organization-setup-query-BMbuRi6v.js";import{g as I,a as D}from"./i18n-formats-DYS91YEa.js";import{MqViewAppointmentsEvent as Q}from"../events.js";let E=class ChatCta extends f{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new C(this,()=>O(s,{roomId:this.roomId}))}static{this.styles=[g`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return y`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${z({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${j({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?y`<mq-unread-badge></mq-unread-badge>`:v}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?y`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:v}</mq-floating-bubble>`}};t([b({type:Number})],E.prototype,"roomId",void 0),t([b({type:String})],E.prototype,"professionalHash",void 0),t([b({type:String})],E.prototype,"text",void 0),t([b({type:String})],E.prototype,"consultationId",void 0),t([b({type:Boolean,reflect:!0})],E.prototype,"readonly",void 0),t([b({attribute:!1})],E.prototype,"onOpenChat",void 0),t([_({context:q})],E.prototype,"loginToken",void 0),t([w()],E.prototype,"isChatOpen",void 0),E=t([o(),e("chat-cta")],E);let F=class PageLayout extends f{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=g`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return y`<div><main><slot></slot></main></div>`}};t([b({type:Boolean,attribute:"y-centered"})],F.prototype,"yCentered",void 0),t([b({type:String})],F.prototype,"background",void 0),F=t([e("page-layout")],F);const B=g`.title{margin:var(--size-3) 0;font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold)}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let G=class DocumentationView extends f{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await s.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new C(this,()=>I(s)),this.getOrganizationSetupQuery=new C(this,()=>T(s)),this._reconnectMutation=new S(this,{mutationFn:t=>s.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=B}firstUpdated(){c.track(m(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,e=x(),o=e.replace("_","-"),a=this.loginToken.patient.timezone,s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),m=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),f=new Date(this.appointment.start_date),g=p(f,this.appointment.duration),b=a?l(a,f):"";return y`<back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new Q({tab:"history"}))}}">${i("Salir")}</back-link><h1 class="title">${i("Consulta finalizada")}</h1><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${$()}</dt><dd>${r.format(f)}</dd></div><div class="description-list-item"><dt>${k()}</dt><dd>${m.format(f)} - ${m.format(g)}${b?` (${b})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>y`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?y`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>y`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return D(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{c.track(h(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?y`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:v} ${t?y`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${d(this.appointment.expires_at)}" .onOpenChat="${()=>{c.track(u(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:v}</div>`}};t([b({type:Object})],G.prototype,"appointment",void 0),t([b({type:String})],G.prototype,"token",void 0),t([b({type:Boolean,attribute:"can-reconnect"})],G.prototype,"canReconnect",void 0),t([_({context:q})],G.prototype,"loginToken",void 0),G=t([o(),e("documentation-view")],G);
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-Bj8p7kJX.js";import{a as s,C as r,b as l,i as d}from"./api-chat-client-1Vz6ZOwp.js";import{t as c,d as m,a as p,b as h,c as u}from"./telemetry-client-BLJVs9me.js";import{a as f,i as g,E as v,x as y}from"./lit-element-DiWJYFwC.js";import{n as b}from"./property-scuRaFcM.js";import{getLocale as x}from"../i18n.js";import{calendarIcon as $}from"../ui/icons/calendar-icon.js";import{clockIcon as k}from"../ui/icons/clock-icon.js";import{r as w}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as z}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as q}from"./chunk-S5RWG6G2-DPesx3Od.js";import{messageBubbleIcon as j}from"../ui/icons/message-bubble-icon.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as _}from"./consume-CovVqBjI.js";import{Q as C}from"./query-controller-BlO1Ax65.js";import{g as O}from"./chunk-GZF3YFSX-DM-GTqxg.js";import"../ui/back-link.js";import"./index-Bx8TWBsk.js";import{M as S}from"./mutation-controller-CR2qcqhH.js";import{g as T}from"./get-organization-setup-query-BMbuRi6v.js";import{g as I,a as D}from"./i18n-formats-DYS91YEa.js";import{MqViewAppointmentsEvent as Q}from"../events.js";let E=class ChatCta extends f{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new C(this,()=>O(s,{roomId:this.roomId}))}static{this.styles=[g`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return y`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${z({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${j({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?y`<mq-unread-badge></mq-unread-badge>`:v}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?y`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:v}</mq-floating-bubble>`}};t([b({type:Number})],E.prototype,"roomId",void 0),t([b({type:String})],E.prototype,"professionalHash",void 0),t([b({type:String})],E.prototype,"text",void 0),t([b({type:String})],E.prototype,"consultationId",void 0),t([b({type:Boolean,reflect:!0})],E.prototype,"readonly",void 0),t([b({attribute:!1})],E.prototype,"onOpenChat",void 0),t([_({context:q})],E.prototype,"loginToken",void 0),t([w()],E.prototype,"isChatOpen",void 0),E=t([o(),e("chat-cta")],E);let F=class PageLayout extends f{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=g`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return y`<div><main><slot></slot></main></div>`}};t([b({type:Boolean,attribute:"y-centered"})],F.prototype,"yCentered",void 0),t([b({type:String})],F.prototype,"background",void 0),F=t([e("page-layout")],F);const B=g`.title{margin:var(--size-3) 0;font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold)}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let G=class DocumentationView extends f{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await s.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new C(this,()=>I(s)),this.getOrganizationSetupQuery=new C(this,()=>T(s)),this._reconnectMutation=new S(this,{mutationFn:t=>s.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=B}firstUpdated(){c.track(m(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,e=x(),o=e.replace("_","-"),a=this.loginToken.patient.timezone,s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),m=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),f=new Date(this.appointment.start_date),g=p(f,this.appointment.duration),b=a?l(a,f):"";return y`<back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new Q({tab:"history"}))}}">${i("Salir")}</back-link><h1 class="title">${i("Consulta finalizada")}</h1><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${$()}</dt><dd>${r.format(f)}</dd></div><div class="description-list-item"><dt>${k()}</dt><dd>${m.format(f)} - ${m.format(g)}${b?` (${b})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>y`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?y`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>y`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return D(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{c.track(h(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?y`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:v} ${t?y`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${d(this.appointment.expires_at)}" .onOpenChat="${()=>{c.track(u(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:v}</div>`}};t([b({type:Object})],G.prototype,"appointment",void 0),t([b({type:String})],G.prototype,"token",void 0),t([b({type:Boolean,attribute:"can-reconnect"})],G.prototype,"canReconnect",void 0),t([_({context:q})],G.prototype,"loginToken",void 0),G=t([o(),e("documentation-view")],G);
@@ -0,0 +1 @@
1
+ function e(e,t){return{queryKey:["patient-documents",t],queryFn:()=>e.flash.getPatientDocuments(t)}}export{e as g};
@@ -1 +1 @@
1
- import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as a}from"./property-scuRaFcM.js";import{r as s}from"./state-LQivXIgA.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as r}from"./mutation-controller-CR2qcqhH.js";import{setEnv as l}from"../env.js";import{a as h}from"./api-chat-client-CqMn2JEn.js";const c=i`.page-header{box-sizing:border-box;width:100%;display:none}.page-title{font-family:var(--font-body);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.page-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.page-subtitle{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-subtle)}.page-subtitle ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-section{box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--sp-6);background-color:var(--color-neutrals-background-weak);padding:var(--sp-6);border-radius:var(--border-radius-md)}.terms-title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.terms-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-description{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}.terms-description ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.checkbox-container{display:flex;gap:var(--sp-3);align-items:flex-start;cursor:pointer}.checkbox-label{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);flex:1}@media (min-width:768px){.page-header{display:block;margin-bottom:var(--sp-10)}.page-title{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height)}.page-title ::slotted(*){font-size:inherit;line-height:inherit}.page-subtitle{font-size:var(--text-base);line-height:var(--text-base--line-height)}.page-subtitle ::slotted(*){font-size:inherit;line-height:inherit}.terms-title{font-size:var(--text-2xl);line-height:var(--text-2xl--line-height)}.terms-title ::slotted(*){font-size:inherit;line-height:inherit}.terms-description{font-size:var(--text-base);line-height:var(--text-base--line-height)}.terms-description ::slotted(*){font-size:inherit;line-height:inherit}.checkbox-label{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`;let d=class MqTermsAndConditions extends o{constructor(){super(...arguments),this.disabled=!1,this.hasCommercialCommunications=!1,this._accepted=!1,this.acceptLegalConsentMutation=new r(this,{mutationFn:async t=>h.profile.acceptLegalConsent(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("continue"))}})}static{this.styles=c}willUpdate(t){t.has("env")&&this.env&&l(this.env),t.has("apiKey")&&this.apiKey&&h.setApiKey(this.apiKey),t.has("token")&&this.token&&h.setAuthToken(this.token)}handleCheckboxChange(t){this._accepted=t.detail.checked}handleContinue(){this._accepted&&!this.disabled&&this.acceptLegalConsentMutation.run({terms_accepted:!0,privacy_accepted:!0,commercial_accepted:this.hasCommercialCommunications})}render(){const t=!this._accepted||this.disabled;return n`<div class="page-header"><div class="page-title"><slot name="page-title"></slot></div><div class="page-subtitle"><slot name="page-subtitle"></slot></div></div><div class="terms-section"><div><div class="terms-title"><slot name="terms-title"></slot></div><div class="terms-description"><slot name="terms-description"></slot></div></div><div class="checkbox-container"><mq-checkbox id="terms-checkbox" @change="${this.handleCheckboxChange}" ?disabled="${this.disabled}"></mq-checkbox><label class="checkbox-label" for="terms-checkbox"><slot name="checkbox-label"></slot></label></div><mq-button variant="primary" size="md" fullwidth ?disabled="${this.acceptLegalConsentMutation.isPending||t}" @click="${this.handleContinue}"><slot name="button-text"></slot></mq-button></div>`}};t([a({type:Boolean})],d.prototype,"disabled",void 0),t([a({type:Boolean})],d.prototype,"hasCommercialCommunications",void 0),t([a({type:String,attribute:"api-key"})],d.prototype,"apiKey",void 0),t([a({type:String,attribute:"token"})],d.prototype,"token",void 0),t([a({type:String,attribute:"env"})],d.prototype,"env",void 0),t([s()],d.prototype,"_accepted",void 0),d=t([e("mq-terms-and-conditions")],d);export{d as M};
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as a}from"./property-scuRaFcM.js";import{r as s}from"./state-LQivXIgA.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as r}from"./mutation-controller-CR2qcqhH.js";import{setEnv as l}from"../env.js";import{a as h}from"./api-chat-client-1Vz6ZOwp.js";const c=i`.page-header{box-sizing:border-box;width:100%;display:none}.page-title{font-family:var(--font-body);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.page-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.page-subtitle{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-subtle)}.page-subtitle ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-section{box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--sp-6);background-color:var(--color-neutrals-background-weak);padding:var(--sp-6);border-radius:var(--border-radius-md)}.terms-title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.terms-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-description{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}.terms-description ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.checkbox-container{display:flex;gap:var(--sp-3);align-items:flex-start;cursor:pointer}.checkbox-label{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);flex:1}@media (min-width:768px){.page-header{display:block;margin-bottom:var(--sp-10)}.page-title{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height)}.page-title ::slotted(*){font-size:inherit;line-height:inherit}.page-subtitle{font-size:var(--text-base);line-height:var(--text-base--line-height)}.page-subtitle ::slotted(*){font-size:inherit;line-height:inherit}.terms-title{font-size:var(--text-2xl);line-height:var(--text-2xl--line-height)}.terms-title ::slotted(*){font-size:inherit;line-height:inherit}.terms-description{font-size:var(--text-base);line-height:var(--text-base--line-height)}.terms-description ::slotted(*){font-size:inherit;line-height:inherit}.checkbox-label{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`;let d=class MqTermsAndConditions extends o{constructor(){super(...arguments),this.disabled=!1,this.hasCommercialCommunications=!1,this._accepted=!1,this.acceptLegalConsentMutation=new r(this,{mutationFn:async t=>h.profile.acceptLegalConsent(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("continue"))}})}static{this.styles=c}willUpdate(t){t.has("env")&&this.env&&l(this.env),t.has("apiKey")&&this.apiKey&&h.setApiKey(this.apiKey),t.has("token")&&this.token&&h.setAuthToken(this.token)}handleCheckboxChange(t){this._accepted=t.detail.checked}handleContinue(){this._accepted&&!this.disabled&&this.acceptLegalConsentMutation.run({terms_accepted:!0,privacy_accepted:!0,commercial_accepted:this.hasCommercialCommunications})}render(){const t=!this._accepted||this.disabled;return n`<div class="page-header"><div class="page-title"><slot name="page-title"></slot></div><div class="page-subtitle"><slot name="page-subtitle"></slot></div></div><div class="terms-section"><div><div class="terms-title"><slot name="terms-title"></slot></div><div class="terms-description"><slot name="terms-description"></slot></div></div><div class="checkbox-container"><mq-checkbox id="terms-checkbox" @change="${this.handleCheckboxChange}" ?disabled="${this.disabled}"></mq-checkbox><label class="checkbox-label" for="terms-checkbox"><slot name="checkbox-label"></slot></label></div><mq-button variant="primary" size="md" fullwidth ?disabled="${this.acceptLegalConsentMutation.isPending||t}" @click="${this.handleContinue}"><slot name="button-text"></slot></mq-button></div>`}};t([a({type:Boolean})],d.prototype,"disabled",void 0),t([a({type:Boolean})],d.prototype,"hasCommercialCommunications",void 0),t([a({type:String,attribute:"api-key"})],d.prototype,"apiKey",void 0),t([a({type:String,attribute:"token"})],d.prototype,"token",void 0),t([a({type:String,attribute:"env"})],d.prototype,"env",void 0),t([s()],d.prototype,"_accepted",void 0),d=t([e("mq-terms-and-conditions")],d);export{d as M};
@@ -0,0 +1 @@
1
+ class SupportChatToggleRequestEvent extends Event{static{this.eventName="mq-support-chat-toggle-request"}constructor(){super(SupportChatToggleRequestEvent.eventName,{bubbles:!0,composed:!0})}}class SupportChatUnreadRequestEvent extends Event{static{this.eventName="mq-support-chat-unread-request"}constructor(){super(SupportChatUnreadRequestEvent.eventName,{bubbles:!0,composed:!0})}}class SupportChatUnreadChangeEvent extends Event{static{this.eventName="mq-support-chat-unread-change"}constructor(e){super(SupportChatUnreadChangeEvent.eventName,{bubbles:!0,composed:!0}),this.count=e}}class SupportChatOpenEvent extends Event{static{this.eventName="mq-support-chat-open"}constructor(){super(SupportChatOpenEvent.eventName,{bubbles:!0,composed:!0})}}class SupportChatCloseEvent extends Event{static{this.eventName="mq-support-chat-close"}constructor(){super(SupportChatCloseEvent.eventName,{bubbles:!0,composed:!0})}}export{SupportChatUnreadChangeEvent as S,SupportChatUnreadRequestEvent as a,SupportChatToggleRequestEvent as b,SupportChatOpenEvent as c,SupportChatCloseEvent as d};
@@ -1 +1 @@
1
- import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{i as o,a as i,x as r}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";import{r as a}from"./state-LQivXIgA.js";import{downloadIcon as s}from"../ui/icons/download-icon.js";import"../ui/mq-button.js";import{m as l}from"./runtime-Bg1WXVCx.js";import{l as d}from"./localized-decorator-BlOuLhym.js";import{a as p,D as c}from"./api-chat-client-CqMn2JEn.js";import{DownloadFileEvent as m}from"../events.js";import{getLocale as f}from"../i18n.js";const h=o`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let u=class PatientDocument extends i{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=h}getFormatter(){const t=f().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await p.flash.downloadDocument({url:this.downloadUrl}),e=await async function(t){return new Promise((e,o)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.onerror=o,i.readAsDataURL(t)})}(t);this.dispatchEvent(new m({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case c.prescription:return l("Receta");case c.report:return l("Informe");case c.diagnosticTestPrescription:return l("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return r`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${s({size:24})}</mq-button>`}};t([n({type:String})],u.prototype,"kind",void 0),t([n({type:String})],u.prototype,"filename",void 0),t([n({type:String})],u.prototype,"specialty",void 0),t([n({type:String})],u.prototype,"description",void 0),t([n({type:String})],u.prototype,"date",void 0),t([n({type:String})],u.prototype,"downloadUrl",void 0),t([a()],u.prototype,"isDownloading",void 0),u=t([d(),e("patient-document")],u);
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{i as o,a as i,x as r}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";import{r as a}from"./state-LQivXIgA.js";import{downloadIcon as s}from"../ui/icons/download-icon.js";import"../ui/mq-button.js";import{m as l}from"./runtime-Bg1WXVCx.js";import{l as d}from"./localized-decorator-BlOuLhym.js";import{a as p,D as c}from"./api-chat-client-1Vz6ZOwp.js";import{DownloadFileEvent as m}from"../events.js";import{getLocale as f}from"../i18n.js";const h=o`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let u=class PatientDocument extends i{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=h}getFormatter(){const t=f().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await p.flash.downloadDocument({url:this.downloadUrl}),e=await async function(t){return new Promise((e,o)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.onerror=o,i.readAsDataURL(t)})}(t);this.dispatchEvent(new m({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case c.prescription:return l("Receta");case c.report:return l("Informe");case c.diagnosticTestPrescription:return l("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return r`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${s({size:24})}</mq-button>`}};t([n({type:String})],u.prototype,"kind",void 0),t([n({type:String})],u.prototype,"filename",void 0),t([n({type:String})],u.prototype,"specialty",void 0),t([n({type:String})],u.prototype,"description",void 0),t([n({type:String})],u.prototype,"date",void 0),t([n({type:String})],u.prototype,"downloadUrl",void 0),t([a()],u.prototype,"isDownloading",void 0),u=t([d(),e("patient-document")],u);
@@ -1 +1 @@
1
- import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{b as n}from"./api-chat-client-CqMn2JEn.js";import{a as r}from"./telemetry-client-Ca71sobH.js";import{i as a,a as s,E as l,x as m}from"./lit-element-DiWJYFwC.js";import{n as p}from"./property-scuRaFcM.js";import{e as c}from"./class-map-Co76I6aw.js";import{getLocale as h}from"../i18n.js";import{briefcaseIcon as d}from"../ui/icons/briefcase-icon.js";import{calendarIcon as u}from"../ui/icons/calendar-icon.js";import{clockIcon as f}from"../ui/icons/clock-icon.js";import{messageBubbleIcon as v}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as w}from"../ui/icons/phone-icon.js";const y=a`.appointment-details{display:flex;flex-direction:column;gap:var(--sp-3)}.detail-row{display:inline-flex;width:fit-content;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.detail-row.full-width{width:100%}:host([strike-through]) .detail-row span{text-decoration:line-through}@media (min-width:768px){.appointment-details.wide{flex-direction:row;flex-wrap:wrap}}`;let g=class AppointmentDetails extends s{constructor(){super(...arguments),this.channel=void 0,this.variant="default",this.strikeThrough=!1,this.timezone=void 0,this._appointmentChannelToLabel=t=>{switch(t){case"videocall":return i("Videoconsulta");case"chat":return i("Chat");case"phonecall":return i("Consulta telefónica");default:return""}},this._appointmentChannelToIcon=t=>{switch(t){case"videocall":return d({size:24});case"chat":return v({size:24});case"phonecall":return w({size:24});default:return l}}}static{this.styles=y}render(){const t=h().replace("_","-"),e=new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",...this.timezone?{timeZone:this.timezone}:{}}),i=new Intl.DateTimeFormat(t,{timeStyle:"short",...this.timezone?{timeZone:this.timezone}:{}}),o=new Date(this.startsAt),a=r(o,this.duration),s=e.format(o),p=i.format(o),d=i.format(a),v=this.timezone?n(this.timezone,o):"";return m`<div class="${c({"appointment-details":!0,wide:"wide"===this.variant})}"><div class="detail-row">${u({size:24})} <span>${s}</span></div><div class="detail-row">${f({size:24})} <span>${p} - ${d}${v?` (${v})`:""}</span></div>${this.channel?m`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:l}</div>`}};function x(t){return t/100}function z(t,e){const i=e.replaceAll("_","-");return new Intl.NumberFormat(i,{style:"currency",currency:t.currency}).format(x(t.amount))}function j(t){return null!=t&&t.amount>0}t([p({type:String})],g.prototype,"startsAt",void 0),t([p({type:Number})],g.prototype,"duration",void 0),t([p({type:String})],g.prototype,"channel",void 0),t([p({type:String})],g.prototype,"variant",void 0),t([p({type:Boolean,attribute:"strike-through"})],g.prototype,"strikeThrough",void 0),t([p({type:String})],g.prototype,"timezone",void 0),g=t([o(),e("appointment-details")],g);export{g as A,x as c,z as f,j as h};
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{b as n}from"./api-chat-client-1Vz6ZOwp.js";import{a as r}from"./telemetry-client-BLJVs9me.js";import{i as a,a as s,E as l,x as m}from"./lit-element-DiWJYFwC.js";import{n as p}from"./property-scuRaFcM.js";import{e as c}from"./class-map-Co76I6aw.js";import{getLocale as h}from"../i18n.js";import{briefcaseIcon as d}from"../ui/icons/briefcase-icon.js";import{calendarIcon as u}from"../ui/icons/calendar-icon.js";import{clockIcon as f}from"../ui/icons/clock-icon.js";import{messageBubbleIcon as v}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as w}from"../ui/icons/phone-icon.js";const y=a`.appointment-details{display:flex;flex-direction:column;gap:var(--sp-3)}.detail-row{display:inline-flex;width:fit-content;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.detail-row.full-width{width:100%}:host([strike-through]) .detail-row span{text-decoration:line-through}@media (min-width:768px){.appointment-details.wide{flex-direction:row;flex-wrap:wrap}}`;let g=class AppointmentDetails extends s{constructor(){super(...arguments),this.channel=void 0,this.variant="default",this.strikeThrough=!1,this.timezone=void 0,this._appointmentChannelToLabel=t=>{switch(t){case"videocall":return i("Videoconsulta");case"chat":return i("Chat");case"phonecall":return i("Consulta telefónica");default:return""}},this._appointmentChannelToIcon=t=>{switch(t){case"videocall":return d({size:24});case"chat":return v({size:24});case"phonecall":return w({size:24});default:return l}}}static{this.styles=y}render(){const t=h().replace("_","-"),e=new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",...this.timezone?{timeZone:this.timezone}:{}}),i=new Intl.DateTimeFormat(t,{timeStyle:"short",...this.timezone?{timeZone:this.timezone}:{}}),o=new Date(this.startsAt),a=r(o,this.duration),s=e.format(o),p=i.format(o),d=i.format(a),v=this.timezone?n(this.timezone,o):"";return m`<div class="${c({"appointment-details":!0,wide:"wide"===this.variant})}"><div class="detail-row">${u({size:24})} <span>${s}</span></div><div class="detail-row">${f({size:24})} <span>${p} - ${d}${v?` (${v})`:""}</span></div>${this.channel?m`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:l}</div>`}};function x(t){return t/100}function z(t,e){const i=e.replaceAll("_","-");return new Intl.NumberFormat(i,{style:"currency",currency:t.currency}).format(x(t.amount))}function j(t){return null!=t&&t.amount>0}t([p({type:String})],g.prototype,"startsAt",void 0),t([p({type:Number})],g.prototype,"duration",void 0),t([p({type:String})],g.prototype,"channel",void 0),t([p({type:String})],g.prototype,"variant",void 0),t([p({type:Boolean,attribute:"strike-through"})],g.prototype,"strikeThrough",void 0),t([p({type:String})],g.prototype,"timezone",void 0),g=t([o(),e("appointment-details")],g);export{g as A,x as c,z as f,j as h};
@@ -1 +1 @@
1
- import{g as e}from"./api-chat-client-CqMn2JEn.js";import{t}from"./parseISO-Dj3qSTG8.js";function n(e,n,r){const s=function(e,n){return+t(e)-+t(n)}(e,n)/1e3;return(c=r?.roundingMethod,e=>{const t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(s);var c}function r(e){return{queryKey:["schedule-services"],queryFn:()=>e.schedules.getScheduleServices()}}function s(t){const{startsAtIso:r,refundPolicySeconds:s,now:c=new Date}=t,o=n(e(r),c);return!(o<0)&&(null==s||o>=s)}export{s as c,r as g};
1
+ import{g as e}from"./api-chat-client-1Vz6ZOwp.js";import{t}from"./parseISO-Dj3qSTG8.js";function n(e,n,r){const s=function(e,n){return+t(e)-+t(n)}(e,n)/1e3;return(c=r?.roundingMethod,e=>{const t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(s);var c}function r(e){return{queryKey:["schedule-services"],queryFn:()=>e.schedules.getScheduleServices()}}function s(t){const{startsAtIso:r,refundPolicySeconds:s,now:c=new Date}=t,o=n(e(r),c);return!(o<0)&&(null==s||o>=s)}export{s as c,r as g};
@@ -40,5 +40,11 @@ declare const CreatePaymentLinkRequestSchema: z.ZodObject<{
40
40
  discount_code?: string | undefined;
41
41
  }>;
42
42
  type CreatePaymentLinkRequest = z.infer<typeof CreatePaymentLinkRequestSchema>;
43
+ declare const PaymentProvider: {
44
+ readonly Addon: "addon";
45
+ readonly Stripe: "stripe";
46
+ };
47
+ type PaymentProvider = (typeof PaymentProvider)[keyof typeof PaymentProvider];
43
48
 
49
+ export { PaymentProvider as P };
44
50
  export type { CreatePaymentLinkRequest as C };
@@ -0,0 +1 @@
1
+ import{c as t,t as e}from"./parseISO-Dj3qSTG8.js";function n(n,i,a){return function(n,i){return t(n,+e(n)+i)}(n,1e3*i)}function i(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function a(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function p(t,e){return{action_type:"event",event_type:"modify appoinment button click",patient_hash:t,id_appointment:e}}function o(t,e){return{action_type:"event",event_type:"cancel appoinment button click",patient_hash:t,id_appointment:e}}function s(t,e){return{action_type:"event",event_type:"view appointment document list button click",patient_hash:t,id_appointment:e}}function c(t,e){return{action_type:"event",event_type:"repeat appointment button click",patient_hash:t,id_appointment:e}}function _(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function r(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function u(t,e){return{action_type:"event",event_type:"add to calendar button click",patient_hash:t,id_appointment:e}}function h(t,e){return{action_type:"pageview",event_type:"appointment success page view",patient_hash:t,id_appointment:e}}function y(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function l(t,e){return{action_type:"event",event_type:"update documentation",patient_hash:t,id_appointment:e}}function v(t,e){return{action_type:"pageview",event_type:"documentation page view",patient_hash:t,id_appointment:e}}function d(t){return{action_type:"event",event_type:"view documentation list button click",patient_hash:t}}function f(t){return{action_type:"event",event_type:"make an appointment button click",patient_hash:t}}function m(t){return{action_type:"event",event_type:"view appointment list button click",patient_hash:t}}function b(t){return{action_type:"pageview",event_type:"home page view",patient_hash:t}}function k(t,e,n){return{action_type:"event",event_type:"find availability button click",patient_hash:t,speciality_id:e,service_id:n}}function w(t,e,n,i,a,p,o){return{action_type:"debug",event_type:"find availability result",patient_hash:t,speciality_id:e,service_id:n,first_slot_date:i,first_slot_professional_hash:a,total_professionals:p,total_slots:o}}function g(t,e,n,i,a){return{action_type:"event",event_type:"professional schedule slot button click",patient_hash:t,professional_hash:e,start_date:n,speciality_id:i,service_id:a}}function T(t,e,n,i){return{action_type:"event",event_type:"professional availability button click",patient_hash:t,professional_hash:e,speciality_id:n,service_id:i}}function K(t,e,n,i,a){return{action_type:"event",event_type:"confirm appointment button click",patient_hash:t,professional_hash:e,start_date:n,speciality_id:i,service_id:a}}function C(t){return{action_type:"pageview",event_type:"select professional step page view",patient_hash:t}}function q(t,e){return{action_type:"pageview",event_type:"not time yet pageview",patient_hash:t,id_appointment:e}}function x(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function j(t,e){return{action_type:"pageview",event_type:"waiting room pageview",patient_hash:t,id_appointment:e}}function A(t,e){return{action_type:"pageview",event_type:"videocall pageview",patient_hash:t,id_appointment:e}}class HttpTransport{endpoint;apiKey;constructor(t,e){this.endpoint=t,this.apiKey=e}send(t){fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.apiKey},body:JSON.stringify(t)}).catch(()=>{})}}class MediquoTelemetryClient{_apiKey=null;_transport=null;setApiKey(t){this._apiKey=t,this._buildTransport()}track(t){null!==this._transport&&this._transport.send(t)}_buildTransport(){null!==this._apiKey&&(this._transport=new HttpTransport("https://tracking.____.mediquo.com/sdk",this._apiKey))}}const O=new class AppTelemetryClient extends MediquoTelemetryClient{track(t){}};export{x as A,j as B,A as C,n as a,l as b,y as c,v as d,h as e,u as f,_ as g,r as h,b as i,p as j,o as k,c as l,f as m,i as n,s as o,a as p,k as q,d as r,K as s,O as t,g as u,m as v,T as w,w as x,C as y,q as z};
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.5.0",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};
1
+ const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.5.2",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
@@ -124,8 +124,62 @@ declare class DownloadFileEvent extends Event {
124
124
  filename: string;
125
125
  });
126
126
  }
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
+ declare class MqViewDocumentsEvent extends Event {
133
+ static eventName: string;
134
+ constructor();
135
+ }
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
+ declare class MqPaymentSucceededEvent extends Event {
145
+ readonly detail: {
146
+ appointmentId: string;
147
+ consultationType: string;
148
+ };
149
+ static eventName: string;
150
+ constructor(detail: {
151
+ appointmentId: string;
152
+ consultationType: string;
153
+ });
154
+ }
155
+ /**
156
+ * The user is about to be handed over to an off-site payment gateway.
157
+ *
158
+ * Unlike the rest of the contract this event is **cancelable and has a default
159
+ * action**: the emitting component navigates the top-level document to `url`
160
+ * unless a listener calls `preventDefault()`. Hosts that render in a plain
161
+ * browser tab need no listener at all; the escape hatch exists for webviews and
162
+ * in-app shells that must open the gateway some other way — the same reason
163
+ * `apple-pay-opened` / `google-pay-opened` are cancelable.
164
+ *
165
+ * `url` is a single-use gateway checkout URL — treat it as a secret and do not
166
+ * log it.
167
+ */
168
+ declare class MqPaymentRedirectEvent extends Event {
169
+ readonly detail: {
170
+ url: string;
171
+ sessionId: string;
172
+ };
173
+ static eventName: string;
174
+ constructor(detail: {
175
+ url: string;
176
+ sessionId: string;
177
+ });
178
+ }
127
179
  declare global {
128
180
  interface HTMLElementEventMap {
181
+ "mq-payment-succeeded": MqPaymentSucceededEvent;
182
+ "mq-payment-redirect": MqPaymentRedirectEvent;
129
183
  "mq-back": MqBackEvent;
130
184
  "mq-home": MqHomeEvent;
131
185
  "mq-view-appointments": MqViewAppointmentsEvent;
@@ -133,9 +187,10 @@ declare global {
133
187
  "mq-appointment-book": MqAppointmentBookEvent;
134
188
  "mq-appointment-join-videocall": MqAppointmentJoinVideocallEvent;
135
189
  "mq-appointment-view-documentation": MqAppointmentViewDocumentationEvent;
190
+ "mq-view-documents": MqViewDocumentsEvent;
136
191
  "mq-download-file": DownloadFileEvent;
137
192
  }
138
193
  }
139
194
 
140
- export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent };
195
+ export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqBackEvent, MqHomeEvent, MqPaymentRedirectEvent, MqPaymentSucceededEvent, MqViewAppointmentsEvent, MqViewDocumentsEvent };
141
196
  export type { MqAppointmentsTab };
package/dist/events.js CHANGED
@@ -1 +1 @@
1
- class MqBackEvent extends Event{static{this.eventName="mq-back"}constructor(e={}){super(MqBackEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqHomeEvent extends Event{static{this.eventName="mq-home"}constructor(){super(MqHomeEvent.eventName,{bubbles:!0,composed:!0})}}class MqViewAppointmentsEvent extends Event{static{this.eventName="mq-view-appointments"}constructor(e){super(MqViewAppointmentsEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentRescheduleEvent extends Event{static{this.eventName="mq-appointment-reschedule"}constructor(e){super(MqAppointmentRescheduleEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentBookEvent extends Event{static{this.eventName="mq-appointment-book"}constructor(e={}){super(MqAppointmentBookEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentJoinVideocallEvent extends Event{static{this.eventName="mq-appointment-join-videocall"}constructor(e){super(MqAppointmentJoinVideocallEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentViewDocumentationEvent extends Event{static{this.eventName="mq-appointment-view-documentation"}constructor(e){super(MqAppointmentViewDocumentationEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class DownloadFileEvent extends Event{static{this.eventName="mq-download-file"}constructor(e){super(DownloadFileEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent};
1
+ class MqBackEvent extends Event{static{this.eventName="mq-back"}constructor(e={}){super(MqBackEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqHomeEvent extends Event{static{this.eventName="mq-home"}constructor(){super(MqHomeEvent.eventName,{bubbles:!0,composed:!0})}}class MqViewAppointmentsEvent extends Event{static{this.eventName="mq-view-appointments"}constructor(e){super(MqViewAppointmentsEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentRescheduleEvent extends Event{static{this.eventName="mq-appointment-reschedule"}constructor(e){super(MqAppointmentRescheduleEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentBookEvent extends Event{static{this.eventName="mq-appointment-book"}constructor(e={}){super(MqAppointmentBookEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentJoinVideocallEvent extends Event{static{this.eventName="mq-appointment-join-videocall"}constructor(e){super(MqAppointmentJoinVideocallEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentViewDocumentationEvent extends Event{static{this.eventName="mq-appointment-view-documentation"}constructor(e){super(MqAppointmentViewDocumentationEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class DownloadFileEvent extends Event{static{this.eventName="mq-download-file"}constructor(e){super(DownloadFileEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqViewDocumentsEvent extends Event{static{this.eventName="mq-view-documents"}constructor(){super(MqViewDocumentsEvent.eventName,{bubbles:!0,composed:!0})}}class MqPaymentSucceededEvent extends Event{static{this.eventName="mq-payment-succeeded"}constructor(e){super(MqPaymentSucceededEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqPaymentRedirectEvent extends Event{static{this.eventName="mq-payment-redirect"}constructor(e){super(MqPaymentRedirectEvent.eventName,{bubbles:!0,composed:!0,cancelable:!0}),this.detail=e}}export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqPaymentRedirectEvent,MqPaymentSucceededEvent,MqViewAppointmentsEvent,MqViewDocumentsEvent};
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { MqThemeProvider, ThemeName } from './mq-theme-provider.js';
2
- export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqAppointmentsTab, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent } from './events.js';
2
+ export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqAppointmentsTab, MqBackEvent, MqHomeEvent, MqPaymentRedirectEvent, MqPaymentSucceededEvent, MqViewAppointmentsEvent, MqViewDocumentsEvent } from './events.js';
3
3
  export { d as defaultTheme } from './chunks/default-IpEn36CA.js';
4
4
  import 'lit-html';
5
5
  import 'lit';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{MqThemeProvider}from"./mq-theme-provider.js";export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent}from"./events.js";export{defaultTheme}from"./theme.js";import"./chunks/custom-element-DA9Fxvxd.js";import"./chunks/lit-element-DiWJYFwC.js";import"./chunks/property-scuRaFcM.js";import"./chunks/state-LQivXIgA.js";import"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";
1
+ export{MqThemeProvider}from"./mq-theme-provider.js";export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqPaymentRedirectEvent,MqPaymentSucceededEvent,MqViewAppointmentsEvent,MqViewDocumentsEvent}from"./events.js";export{defaultTheme}from"./theme.js";import"./chunks/custom-element-DA9Fxvxd.js";import"./chunks/lit-element-DiWJYFwC.js";import"./chunks/property-scuRaFcM.js";import"./chunks/state-LQivXIgA.js";import"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";
@@ -1 +1 @@
1
- import{_ as e,t}from"./chunks/custom-element-DA9Fxvxd.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as s}from"./chunks/localized-decorator-BlOuLhym.js";import{L as i}from"./chunks/login-token-task-BI-L2zSV.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as o,a as r,x as p}from"./chunks/lit-element-DiWJYFwC.js";import{n as l}from"./chunks/property-scuRaFcM.js";import{r as c}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{initLocalization as u,isValidLocale as y,setLocale as d}from"./i18n.js";import{a as m}from"./chunks/api-chat-client-CqMn2JEn.js";import{u as v,s as b,r as k}from"./chunks/apple-pay-outcomes-CjCnBYOD.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";function f(){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 P(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:!f()}}}((await t.applePayCapabilities(e)).paymentCredentialStatus)}catch{return t.canMakePayments()?{available:!0,usesQrFlow:!f()}:{available:!1,reason:"unsupported"}}return t.canMakePayments()?{available:!0,usesQrFlow:!f()}:{available:!1,reason:"unsupported"}}const g={es_ES:"es-ES",en_US:"en-US",pt_PT:"pt-PT",de_DE:"de-DE",ca_ES:"ca-ES"};try{u()}catch{}const E=["visa","masterCard","amex"],_=["supports3DS"],S=o`: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 A(e,t){n.warn(e,{error:t instanceof Error?t.message:String(t)})}let C=class MqApplePayCheckout extends r{constructor(){super(...arguments),this._availabilityPhase="checking",this._showQrHelper=!1,this._paying=!1,this._suppressCancelEvent=!1,this._availabilityGeneration=0,this._loginTokenTask=new i(this,m,{args:()=>[this.apiKey,this.token],onComplete:e=>{m.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 A("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 m.payments.validateApplePayMerchant({order_id:this.sessionId,validation_url:t.validationURL});e.completeMerchantValidation(v(a))}catch(t){A("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 m.payments.authorizeApplePay({order_id:this.sessionId,token:b(t.payment.token)}),{status:s,consultation_id:i}=a.data,n=k(s,i,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){A("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){A("mq-apple-pay-checkout: session.begin() failed",e),this._paying=!1,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}}}static{this.styles=S}willUpdate(e){if(e.has("env")&&this.env&&h(this.env),e.has("apiKey")&&m.setApiKey(this.apiKey),e.has("locale")){const e=y(this.locale)?this.locale:"es_ES";d(e),m.setLanguage(e)}e.has("merchantId")&&this._loginTokenTask.value&&this._refreshAvailability()}async _refreshAvailability(){const e=++this._availabilityGeneration;this._availabilityPhase="checking",this._showQrHelper=!1;const t=await P(this.merchantId??"");e===this._availabilityGeneration&&(t.available?(this._availabilityPhase="ready",this._showQrHelper=t.usesQrFlow):this._availabilityPhase="unavailable")}get _resolvedLocale(){return y(this.locale)?this.locale:"es_ES"}_buildPaymentRequest(){return{countryCode:this.country,currencyCode:this.currency,supportedNetworks:[...E],merchantCapabilities:[..._],total:{label:this.label,amount:this.amount}}}_renderUnavailable(){return this.merchantId?.trim()?"undefined"==typeof ApplePaySession?p`<p class="state">${a("No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`:p`<p class="state">${a("Apple Pay no está disponible")}</p>`:p`<p class="state">${a("Falta el identificador de comercio de Apple Pay")}</p>`}render(){return this._loginTokenTask.render({pending:()=>p`<p class="state">${a("Preparando Apple Pay…")}</p>`,error:()=>p`<p class="state">${a("No hemos podido iniciar el pago")}</p>`,complete:()=>{return"checking"===this._availabilityPhase?p`<p class="state">${a("Comprobando Apple Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():p`${this._showQrHelper?p`<p class="helper">${a("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,g[e]??"es-ES"}" aria-label="${a("Pagar con Apple Pay")}" @click="${this._onPayClick}"></apple-pay-button></div>`;var e}})}};e([l({type:String,attribute:"env"})],C.prototype,"env",void 0),e([l({type:String,attribute:"api-key"})],C.prototype,"apiKey",void 0),e([l({type:String,attribute:"token"})],C.prototype,"token",void 0),e([l({type:String,attribute:"locale",reflect:!0})],C.prototype,"locale",void 0),e([l({type:String,attribute:"merchant-id"})],C.prototype,"merchantId",void 0),e([l({type:String,attribute:"session-id"})],C.prototype,"sessionId",void 0),e([l({type:String,attribute:"amount"})],C.prototype,"amount",void 0),e([l({type:String,attribute:"currency"})],C.prototype,"currency",void 0),e([l({type:String,attribute:"country"})],C.prototype,"country",void 0),e([l({type:String,attribute:"label"})],C.prototype,"label",void 0),e([c()],C.prototype,"_availabilityPhase",void 0),e([c()],C.prototype,"_showQrHelper",void 0),e([c()],C.prototype,"_paying",void 0),C=e([s(),t("mq-apple-pay-checkout")],C);export{ApplePayCheckoutDeniedEvent,ApplePayCheckoutErrorEvent,ApplePayCheckoutSuccessEvent,C as MqApplePayCheckout};
1
+ import{_ as e,t}from"./chunks/custom-element-DA9Fxvxd.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as s}from"./chunks/localized-decorator-BlOuLhym.js";import{L as i}from"./chunks/login-token-task-BI-L2zSV.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as o,a as r,x as p}from"./chunks/lit-element-DiWJYFwC.js";import{n as l}from"./chunks/property-scuRaFcM.js";import{r as c}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{initLocalization as u,isValidLocale as y,setLocale as d}from"./i18n.js";import{a as m}from"./chunks/api-chat-client-1Vz6ZOwp.js";import{u as v,s as b,r as k}from"./chunks/apple-pay-outcomes-0ozxSHyb.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";function f(){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 P(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:!f()}}}((await t.applePayCapabilities(e)).paymentCredentialStatus)}catch{return t.canMakePayments()?{available:!0,usesQrFlow:!f()}:{available:!1,reason:"unsupported"}}return t.canMakePayments()?{available:!0,usesQrFlow:!f()}:{available:!1,reason:"unsupported"}}const g={es_ES:"es-ES",en_US:"en-US",pt_PT:"pt-PT",de_DE:"de-DE",ca_ES:"ca-ES"};try{u()}catch{}const E=["visa","masterCard","amex"],_=["supports3DS"],S=o`: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 A(e,t){n.warn(e,{error:t instanceof Error?t.message:String(t)})}let C=class MqApplePayCheckout extends r{constructor(){super(...arguments),this._availabilityPhase="checking",this._showQrHelper=!1,this._paying=!1,this._suppressCancelEvent=!1,this._availabilityGeneration=0,this._loginTokenTask=new i(this,m,{args:()=>[this.apiKey,this.token],onComplete:e=>{m.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 A("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 m.payments.validateApplePayMerchant({order_id:this.sessionId,validation_url:t.validationURL});e.completeMerchantValidation(v(a))}catch(t){A("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 m.payments.authorizeApplePay({order_id:this.sessionId,token:b(t.payment.token)}),{status:s,consultation_id:i}=a.data,n=k(s,i,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){A("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){A("mq-apple-pay-checkout: session.begin() failed",e),this._paying=!1,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}}}static{this.styles=S}willUpdate(e){if(e.has("env")&&this.env&&h(this.env),e.has("apiKey")&&m.setApiKey(this.apiKey),e.has("locale")){const e=y(this.locale)?this.locale:"es_ES";d(e),m.setLanguage(e)}e.has("merchantId")&&this._loginTokenTask.value&&this._refreshAvailability()}async _refreshAvailability(){const e=++this._availabilityGeneration;this._availabilityPhase="checking",this._showQrHelper=!1;const t=await P(this.merchantId??"");e===this._availabilityGeneration&&(t.available?(this._availabilityPhase="ready",this._showQrHelper=t.usesQrFlow):this._availabilityPhase="unavailable")}get _resolvedLocale(){return y(this.locale)?this.locale:"es_ES"}_buildPaymentRequest(){return{countryCode:this.country,currencyCode:this.currency,supportedNetworks:[...E],merchantCapabilities:[..._],total:{label:this.label,amount:this.amount}}}_renderUnavailable(){return this.merchantId?.trim()?"undefined"==typeof ApplePaySession?p`<p class="state">${a("No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`:p`<p class="state">${a("Apple Pay no está disponible")}</p>`:p`<p class="state">${a("Falta el identificador de comercio de Apple Pay")}</p>`}render(){return this._loginTokenTask.render({pending:()=>p`<p class="state">${a("Preparando Apple Pay…")}</p>`,error:()=>p`<p class="state">${a("No hemos podido iniciar el pago")}</p>`,complete:()=>{return"checking"===this._availabilityPhase?p`<p class="state">${a("Comprobando Apple Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():p`${this._showQrHelper?p`<p class="helper">${a("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,g[e]??"es-ES"}" aria-label="${a("Pagar con Apple Pay")}" @click="${this._onPayClick}"></apple-pay-button></div>`;var e}})}};e([l({type:String,attribute:"env"})],C.prototype,"env",void 0),e([l({type:String,attribute:"api-key"})],C.prototype,"apiKey",void 0),e([l({type:String,attribute:"token"})],C.prototype,"token",void 0),e([l({type:String,attribute:"locale",reflect:!0})],C.prototype,"locale",void 0),e([l({type:String,attribute:"merchant-id"})],C.prototype,"merchantId",void 0),e([l({type:String,attribute:"session-id"})],C.prototype,"sessionId",void 0),e([l({type:String,attribute:"amount"})],C.prototype,"amount",void 0),e([l({type:String,attribute:"currency"})],C.prototype,"currency",void 0),e([l({type:String,attribute:"country"})],C.prototype,"country",void 0),e([l({type:String,attribute:"label"})],C.prototype,"label",void 0),e([c()],C.prototype,"_availabilityPhase",void 0),e([c()],C.prototype,"_showQrHelper",void 0),e([c()],C.prototype,"_paying",void 0),C=e([s(),t("mq-apple-pay-checkout")],C);export{ApplePayCheckoutDeniedEvent,ApplePayCheckoutErrorEvent,ApplePayCheckoutSuccessEvent,C as MqApplePayCheckout};
@@ -1,5 +1,5 @@
1
1
  import * as lit_html from 'lit-html';
2
- import { C as CreatePaymentLinkRequest } from './chunks/schemas.d-BEA8Pl6w.js';
2
+ import { C as CreatePaymentLinkRequest } from './chunks/schemas.d-5CaMrfOq.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,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{a as o,x as i}from"./chunks/lit-element-DiWJYFwC.js";import{n as s}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import{a as p}from"./chunks/api-chat-client-CqMn2JEn.js";import"./mq-checkout.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/login-token-task-BI-L2zSV.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()=>{const t=await p.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:t.session_id,paymentUrl:t.payment_link}},this._onSuccess=t=>{t.stopPropagation(),this.dispatchEvent(new AppointmentPaidEvent({appointmentId:t.detail.reference}))}}render(){return i`<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([s({type:String,attribute:"env"})],r.prototype,"env",void 0),t([s({type:String,attribute:"api-key"})],r.prototype,"apiKey",void 0),t([s({type:String,attribute:"token"})],r.prototype,"token",void 0),t([s({type:String,attribute:"locale",reflect:!0})],r.prototype,"locale",void 0),t([s({type:String,attribute:"slot-id"})],r.prototype,"slotId",void 0),t([s({type:String,attribute:"service-id"})],r.prototype,"serviceId",void 0),t([s({type:String,attribute:"specialty-id"})],r.prototype,"specialtyId",void 0),t([s({type:String,attribute:"consultation-reason"})],r.prototype,"consultationReason",void 0),t([s({type:String,attribute:"discount-code"})],r.prototype,"discountCode",void 0),t([s({attribute:!1})],r.prototype,"preconsultationDocuments",void 0),r=t([e("mq-appointment-checkout")],r);export{AppointmentPaidEvent,r as MqAppointmentCheckout};
1
+ import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{a as o,x as i}from"./chunks/lit-element-DiWJYFwC.js";import{n as s}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import{a as p}from"./chunks/api-chat-client-1Vz6ZOwp.js";import"./mq-checkout.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/login-token-task-BI-L2zSV.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()=>{const t=await p.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:t.session_id,paymentUrl:t.payment_link}},this._onSuccess=t=>{t.stopPropagation(),this.dispatchEvent(new AppointmentPaidEvent({appointmentId:t.detail.reference}))}}render(){return i`<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([s({type:String,attribute:"env"})],r.prototype,"env",void 0),t([s({type:String,attribute:"api-key"})],r.prototype,"apiKey",void 0),t([s({type:String,attribute:"token"})],r.prototype,"token",void 0),t([s({type:String,attribute:"locale",reflect:!0})],r.prototype,"locale",void 0),t([s({type:String,attribute:"slot-id"})],r.prototype,"slotId",void 0),t([s({type:String,attribute:"service-id"})],r.prototype,"serviceId",void 0),t([s({type:String,attribute:"specialty-id"})],r.prototype,"specialtyId",void 0),t([s({type:String,attribute:"consultation-reason"})],r.prototype,"consultationReason",void 0),t([s({type:String,attribute:"discount-code"})],r.prototype,"discountCode",void 0),t([s({attribute:!1})],r.prototype,"preconsultationDocuments",void 0),r=t([e("mq-appointment-checkout")],r);export{AppointmentPaidEvent,r as MqAppointmentCheckout};
@@ -1 +1 @@
1
- import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as s,t as o}from"./chunks/custom-element-DA9Fxvxd.js";import{Q as r}from"./chunks/query-controller-BlO1Ax65.js";import{g as n}from"./chunks/get-appointment-query-Ck68BEMg.js";import{a,i as c,x as m}from"./chunks/lit-element-DiWJYFwC.js";import{n as d}from"./chunks/property-scuRaFcM.js";import{setEnv as p}from"./env.js";import{a as l}from"./chunks/api-chat-client-CqMn2JEn.js";import"./chunks/documentation-view-fFbvjJqx.js";import"./ui/mq-card.js";import"./chunks/mq-layout-CGcdxGMQ.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/query-Cjvi4_dT.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/telemetry-client-Ca71sobH.js";import"./ui/icons/calendar-icon.js";import"./ui/icons/types.js";import"./ui/icons/clock-icon.js";import"./chunks/state-LQivXIgA.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"./chunks/provide-D2fnEhT2.js";import"./chunks/context-provider--AKuwfs9.js";import"./chunks/consume-CovVqBjI.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-YMQSBQHL-De_r7BNk.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./events.js";import"./chunks/chunk-GZF3YFSX-DM-GTqxg.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/back-link.js";import"./ui/mq-text-button.js";import"./chunks/index-Xcn-xs13.js";import"./ui/icons/download-icon.js";import"./chunks/get-organization-setup-query-BMbuRi6v.js";import"./chunks/i18n-formats-DYS91YEa.js";let u=class DocumentationViewSkeleton extends a{static{this.styles=c`.skeleton{border-radius:var(--border-radius-md);background-color:#f0f0f0;animation:skeleton-pulse 1.5s infinite}.back-link-skeleton{width:60px;height:20px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-6)}.title-skeleton{width:200px;height:32px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-3)}.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="skeleton back-link-skeleton"></div><div class="skeleton title-skeleton"></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>`}};u=s([o("documentation-view-skeleton")],u);let k=class MqAppointmentDocumentation extends a{constructor(){super(...arguments),this.getAppointmentQuery=new r(this,()=>n(l,{id:this.appointmentId}))}willUpdate(i){i.has("env")&&this.env&&p(this.env),i.has("apiKey")&&this.apiKey&&l.setApiKey(this.apiKey),i.has("token")&&this.token&&l.setAuthToken(this.token),i.has("locale")&&this.locale&&t(this.locale)&&(e(this.locale),l.setLanguage(this.locale))}render(){return m`<mq-layout background="transparent">${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>`}};s([d({type:String,attribute:"appointment-id"})],k.prototype,"appointmentId",void 0),s([d({type:String,attribute:"token"})],k.prototype,"token",void 0),s([d({type:String,attribute:"api-key"})],k.prototype,"apiKey",void 0),s([d({type:String,attribute:"locale"})],k.prototype,"locale",void 0),s([d({type:String,attribute:"env"})],k.prototype,"env",void 0),k=s([o("mq-appointment-documentation")],k),i();export{k as MqAppointmentDocumentation};
1
+ import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as s,t as o}from"./chunks/custom-element-DA9Fxvxd.js";import{Q as r}from"./chunks/query-controller-BlO1Ax65.js";import{g as n}from"./chunks/get-appointment-query-Ck68BEMg.js";import{a,i as c,x as m}from"./chunks/lit-element-DiWJYFwC.js";import{n as d}from"./chunks/property-scuRaFcM.js";import{setEnv as p}from"./env.js";import{a as l}from"./chunks/api-chat-client-1Vz6ZOwp.js";import"./chunks/documentation-view-geQU8ttU.js";import"./ui/mq-card.js";import"./chunks/mq-layout-CGcdxGMQ.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/query-Cjvi4_dT.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/telemetry-client-BLJVs9me.js";import"./ui/icons/calendar-icon.js";import"./ui/icons/types.js";import"./ui/icons/clock-icon.js";import"./chunks/state-LQivXIgA.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"./chunks/provide-D2fnEhT2.js";import"./chunks/context-provider--AKuwfs9.js";import"./chunks/consume-CovVqBjI.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-YMQSBQHL-De_r7BNk.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./events.js";import"./chunks/chunk-GZF3YFSX-DM-GTqxg.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/back-link.js";import"./ui/mq-text-button.js";import"./chunks/index-Bx8TWBsk.js";import"./ui/icons/download-icon.js";import"./chunks/get-organization-setup-query-BMbuRi6v.js";import"./chunks/i18n-formats-DYS91YEa.js";let u=class DocumentationViewSkeleton extends a{static{this.styles=c`.skeleton{border-radius:var(--border-radius-md);background-color:#f0f0f0;animation:skeleton-pulse 1.5s infinite}.back-link-skeleton{width:60px;height:20px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-6)}.title-skeleton{width:200px;height:32px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-3)}.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="skeleton back-link-skeleton"></div><div class="skeleton title-skeleton"></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>`}};u=s([o("documentation-view-skeleton")],u);let k=class MqAppointmentDocumentation extends a{constructor(){super(...arguments),this.getAppointmentQuery=new r(this,()=>n(l,{id:this.appointmentId}))}willUpdate(i){i.has("env")&&this.env&&p(this.env),i.has("apiKey")&&this.apiKey&&l.setApiKey(this.apiKey),i.has("token")&&this.token&&l.setAuthToken(this.token),i.has("locale")&&this.locale&&t(this.locale)&&(e(this.locale),l.setLanguage(this.locale))}render(){return m`<mq-layout background="transparent">${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>`}};s([d({type:String,attribute:"appointment-id"})],k.prototype,"appointmentId",void 0),s([d({type:String,attribute:"token"})],k.prototype,"token",void 0),s([d({type:String,attribute:"api-key"})],k.prototype,"apiKey",void 0),s([d({type:String,attribute:"locale"})],k.prototype,"locale",void 0),s([d({type:String,attribute:"env"})],k.prototype,"env",void 0),k=s([o("mq-appointment-documentation")],k),i();export{k as MqAppointmentDocumentation};