@mediquo/elements 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/api-chat-client-fYDIH220.js +1 -0
- package/dist/chunks/{apple-pay-outcomes-BHgxkeDC.js → apple-pay-outcomes-DbuQ2LI3.js} +1 -1
- package/dist/chunks/{chunk-Y4EKUX25-QqMl3eiq.js → chunk-Y4EKUX25-CWAZgcgw.js} +1 -1
- package/dist/chunks/{chunk-YTQUGGS3-DmCGIoFy.js → chunk-YTQUGGS3-DJR1Yoyy.js} +1 -1
- package/dist/chunks/documentation-view-DywQ1MfS.js +1 -0
- package/dist/chunks/{external-CJj32K_p.js → external-BXLaKy9c.js} +1 -1
- package/dist/chunks/index-BLxNeTVi.js +1 -0
- package/dist/chunks/{mq-layout-TG2K4zRv.d.ts → index-CFlNQLy2.d.ts} +0 -18
- package/dist/chunks/{index-B3po71dF.js → index-ClLOggjQ.js} +1 -1
- package/dist/chunks/mq-layout-BiE8gq23.js +1 -0
- package/dist/chunks/mq-layout-D8Mak16a.d.ts +21 -0
- package/dist/chunks/mq-next-appointments-5tvQaSba.js +1 -0
- package/dist/chunks/mq-recent-documents-DzsyvBjW.js +1 -0
- package/dist/chunks/{next-appointment-card-Bc65OZ1_.d.ts → next-appointment-card-DBXsY3Sp.d.ts} +50 -2
- package/dist/chunks/next-appointment-card-DQE7dNXw.js +1 -0
- package/dist/chunks/{telemetry-client-BdPx4SXu.js → telemetry-client-DEIuDZfA.js} +1 -1
- package/dist/env.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/mq-api-client-provider.js +1 -1
- package/dist/mq-apple-pay-checkout.js +1 -1
- package/dist/mq-appointment-checkout.js +1 -1
- package/dist/mq-appointment-documentation.d.ts +2 -1
- package/dist/mq-appointment-documentation.js +1 -1
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-dashboard.d.ts +12 -51
- package/dist/mq-dashboard.js +1 -1
- package/dist/mq-documents.js +1 -1
- package/dist/mq-google-pay-checkout.js +1 -1
- package/dist/mq-immediate-videocall-checkout.js +1 -1
- package/dist/mq-my-appointments.d.ts +91 -13
- package/dist/mq-my-appointments.js +1 -1
- package/dist/mq-next-appointments.d.ts +2 -3
- package/dist/mq-next-appointments.js +1 -1
- package/dist/mq-payment-poller.js +1 -1
- package/dist/mq-professional-presence-sync.js +1 -1
- package/dist/mq-recent-documents.js +1 -1
- package/dist/mq-schedule-success.js +2 -2
- package/dist/mq-schedule.js +1 -1
- package/dist/mq-socket-provider.js +1 -1
- package/dist/mq-support-chat.js +1 -1
- package/dist/mq-terms-and-conditions.js +1 -1
- package/dist/mq-unread-count-sync.js +1 -1
- package/dist/mq-videocall.d.ts +2 -1
- package/dist/mq-videocall.js +1 -1
- package/dist/react/mq-api-client-provider.js +1 -1
- package/dist/react/mq-apple-pay-checkout.js +1 -1
- package/dist/react/mq-appointment-checkout.js +1 -1
- package/dist/react/mq-appointment-documentation.d.ts +2 -1
- package/dist/react/mq-appointment-documentation.js +1 -1
- package/dist/react/mq-chat-room.js +1 -1
- package/dist/react/mq-checkout.js +1 -1
- package/dist/react/mq-dashboard.d.ts +13 -11
- package/dist/react/mq-dashboard.js +1 -1
- package/dist/react/mq-documents-page.js +1 -1
- package/dist/react/mq-documents.js +1 -1
- package/dist/react/mq-google-pay-checkout.js +1 -1
- package/dist/react/mq-immediate-videocall-checkout.js +1 -1
- package/dist/react/mq-my-appointments.d.ts +5 -7
- package/dist/react/mq-my-appointments.js +1 -1
- package/dist/react/mq-next-appointments.d.ts +2 -3
- package/dist/react/mq-next-appointments.js +1 -1
- package/dist/react/mq-payment-poller.js +1 -1
- package/dist/react/mq-professional-presence-sync.js +1 -1
- package/dist/react/mq-recent-documents.js +1 -1
- package/dist/react/mq-schedule-success.js +1 -1
- package/dist/react/mq-schedule.js +1 -1
- package/dist/react/mq-socket-provider.js +1 -1
- package/dist/react/mq-support-chat.js +1 -1
- package/dist/react/mq-terms-and-conditions.js +1 -1
- package/dist/react/mq-unread-count-sync.js +1 -1
- package/dist/react/mq-videocall.d.ts +2 -1
- package/dist/react/mq-videocall.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/action-unavailable-message-BIgsXk9u.js +0 -1
- package/dist/chunks/api-chat-client-Comg_IZx.js +0 -1
- package/dist/chunks/appointment-action-unavailable-dialog-CTiL4nMo.d.ts +0 -54
- package/dist/chunks/appointment-card-skeleton-C2Sim4nR.d.ts +0 -93
- package/dist/chunks/appointment-card-skeleton-g3QS2OCK.js +0 -1
- package/dist/chunks/documentation-view-Bun7yDOf.js +0 -1
- package/dist/chunks/get-patient-documents-query-NC9xCa_N.js +0 -1
- package/dist/chunks/index-k5B232K7.js +0 -1
- package/dist/chunks/mq-layout-0zgWgEiP.js +0 -1
- package/dist/chunks/next-appointment-card-C1aOjmGw.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as o}from"./custom-element-D2ziPxYE.js";import{m as C}from"./runtime-Bg1WXVCx.js";import{l as a}from"./localized-decorator-BlOuLhym.js";import{a as r,i as n,x as e}from"./lit-element-DiWJYFwC.js";import{n as i}from"./property-scuRaFcM.js";let d=class MQLayout extends r{constructor(){super(...arguments),this.background="default",this.variant="default",this.showMediquoBranding=!0}static{this.styles=n`:host{--content-max-width:560px;display:flex;flex-direction:column;height:100%;width:100%;max-width:var(--content-max-width);margin:0 auto;background-color:var(--color-background)}:host([background=solid]){background-color:var(--color-background)}:host([background=transparent]){background-color:transparent}:host([variant=wide]){--content-max-width:1000px}.content{flex:1;padding:var(--mq-layout-padding,0)}footer{display:flex;flex-direction:column;align-items:center;gap:var(--sp-4);padding-top:var(--sp-10);padding-bottom:var(--sp-3);padding-inline:var(--mq-layout-padding,0);margin-bottom:var(--sp-3);text-align:center}.branding{display:flex;justify-content:center;align-items:center;gap:var(--size-2);font-family:var(--font-body);font-size:var(--text-sm);line-height:normal;font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}`}render(){return this.showMediquoBranding?e`<div class="content"><slot></slot></div><footer><div class="branding">${C("Servicio y plataforma prestados por")} ${e`<svg width="82" height="16" viewBox="0 0 82 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M52.4506 8.97739V10.5665C52.4506 11.1054 52.0077 11.5477 51.4682 11.5477C50.9288 11.5477 50.486 11.1054 50.486 10.5665V8.97739H48.8531C48.3276 8.97739 47.8984 8.54894 47.8984 8.02383C47.8984 7.49893 48.3276 7.07053 48.8531 7.07053H50.486V5.48128C50.486 4.94243 50.9288 4.5002 51.4682 4.5002C52.0077 4.5002 52.4506 4.94243 52.4506 5.48128V7.07053H54.0836C54.609 7.07053 55.0379 7.49893 55.0379 8.02383C55.0379 8.54894 54.609 8.97739 54.0836 8.97739H52.4506ZM56.8563 5.46693C56.055 3.75203 54.5229 2.55033 52.6531 2.16979C52.3272 2.10809 51.9339 2.06818 51.5273 2.05679C48.7327 2.10005 46.4191 3.93204 45.7665 6.6209C45.397 8.13705 45.6843 9.78156 46.555 11.134C47.4258 12.4867 48.8053 13.431 50.3396 13.7243C51.7168 13.9883 53.0199 13.8046 54.2312 13.1767L54.2853 13.1506C54.554 13.0306 54.8304 12.9977 55.1481 13.0559L55.2243 13.0728C55.8277 13.2312 56.4308 13.389 57.0345 13.5467C56.8787 12.9784 56.7231 12.4168 56.5656 11.86L56.5512 11.8035C56.4673 11.4258 56.5163 11.0837 56.7011 10.7579C57.5947 9.11014 57.6548 7.17549 56.8563 5.46693ZM59.2901 15.5846C59.0891 15.8486 58.7811 16 58.4446 16C58.2872 16 58.1621 15.967 58.0617 15.9405L57.0944 15.6878C56.3739 15.4997 55.6553 15.312 54.936 15.1233C53.8594 15.6379 52.7204 15.8988 51.5464 15.8988C51.0243 15.8988 50.4877 15.8466 49.9521 15.7439C47.8668 15.3452 45.9973 14.0703 44.823 12.2461C43.6488 10.4223 43.2634 8.19505 43.7656 6.13553C44.6446 2.51324 47.7615 0.0472629 51.5211 0.000260881L51.5409 0L51.5605 0.000391321C52.0913 0.0140876 52.5926 0.0651767 53.0508 0.152094C55.5798 0.666768 57.6424 2.28597 58.7224 4.59729C59.7655 6.82947 59.7232 9.34593 58.6144 11.5401C58.8921 12.5275 59.1643 13.5268 59.4414 14.5471C59.4869 14.7106 59.6124 15.1611 59.2901 15.5846ZM79.7577 8.77869C79.7577 7.05748 78.5162 5.63246 76.7557 5.63246C74.9582 5.63246 73.8092 7.03887 73.8092 8.7416V8.77869C73.8092 10.4814 75.0508 11.9064 76.7927 11.9064C78.6089 11.9064 79.7577 10.4999 79.7577 8.81573V8.77869ZM76.7557 13.868C73.7722 13.868 71.5669 11.5915 71.5669 8.81573V8.77869C71.5669 5.98404 73.7907 3.67068 76.7927 3.67068C79.7949 3.67068 82 5.94717 82 8.7416V8.77869C82 11.5545 79.7764 13.868 76.7557 13.868ZM68.7934 13.7387C68.1816 13.7387 67.6628 13.2571 67.6628 12.6281V12.1285C67.0328 13.0538 66.1247 13.8495 64.6051 13.8495C62.4 13.8495 61.1213 12.3691 61.1213 10.0925V4.89208C61.1213 4.2631 61.6216 3.76329 62.2331 3.76329C62.8633 3.76329 63.3637 4.2631 63.3637 4.89208V9.42637C63.3637 10.944 64.1233 11.7951 65.4575 11.7951C66.7547 11.7951 67.6628 10.9071 67.6628 9.38919V4.89208C67.6628 4.2631 68.1631 3.76329 68.7934 3.76329C69.4048 3.76329 69.9236 4.2631 69.9236 4.89208V12.6281C69.9236 13.2386 69.4233 13.7387 68.7934 13.7387ZM40.4153 3.76329C41.0454 3.76329 41.5457 4.2631 41.5457 4.89208V12.6281C41.5457 13.2571 41.0454 13.7387 40.4153 13.7387C39.8038 13.7387 39.3034 13.2571 39.3034 12.6281V4.89208C39.3034 4.2631 39.7852 3.76329 40.4153 3.76329ZM40.4153 2.4678C39.6925 2.4678 39.1368 2.02361 39.1368 1.35732V1.2464C39.1368 0.580156 39.6925 0.154442 40.4153 0.154442C41.1379 0.154442 41.694 0.580156 41.694 1.2464V1.35732C41.694 2.02361 41.1379 2.4678 40.4153 2.4678ZM34.7693 8.7416C34.7693 6.85382 33.435 5.6139 31.9339 5.6139C30.3961 5.6139 29.1173 6.79821 29.1173 8.7416V8.77869C29.1173 10.6665 30.4145 11.9064 31.9339 11.9064C33.435 11.9064 34.7693 10.6476 34.7693 8.77869V8.7416ZM35.8627 13.7387C35.2325 13.7387 34.7321 13.2571 34.7321 12.6281V12.0172C34.0095 13.0353 32.9903 13.8495 31.3966 13.8495C29.0988 13.8495 26.8566 12.0172 26.8566 8.77869V8.7416C26.8566 5.50298 29.0616 3.67068 31.3966 3.67068C33.0088 3.67068 34.028 4.4665 34.7321 5.39189V1.15383C34.7321 0.524632 35.2325 0.0434802 35.8439 0.0434802C36.4742 0.0434802 36.9745 0.524632 36.9745 1.15383V12.6281C36.9745 13.2571 36.4742 13.7387 35.8627 13.7387ZM21.0065 5.50298C19.6353 5.50298 18.6718 6.55763 18.4678 8.07548H23.4897C23.3416 6.63203 22.4892 5.50298 21.0065 5.50298ZM24.6203 9.55589H18.4864C18.7272 11.1477 19.8578 12.0357 21.3032 12.0357C22.2482 12.0357 22.9895 11.7028 23.6196 11.1846C23.7863 11.0548 23.9346 10.981 24.194 10.981C24.6945 10.981 25.0836 11.3698 25.0836 11.8879C25.0836 12.1654 24.9539 12.406 24.787 12.5727C23.8975 13.3683 22.7858 13.868 21.2662 13.868C18.4308 13.868 16.244 11.8136 16.244 8.79712V8.76021C16.244 5.96556 18.227 3.67068 21.0253 3.67068C24.1384 3.67068 25.6765 6.22475 25.6765 8.48246C25.6765 9.1117 25.1948 9.55589 24.6203 9.55589ZM13.7686 13.7387C13.1387 13.7387 12.6382 13.2571 12.6382 12.6281V8.09396C12.6382 6.53915 11.9155 5.70655 10.6555 5.70655C9.43232 5.70655 8.56142 6.55763 8.56142 8.13083V12.6281C8.56142 13.2571 8.06108 13.7387 7.44958 13.7387C6.81941 13.7387 6.3192 13.2571 6.3192 12.6281V8.07548C6.3192 6.55763 5.57796 5.70655 4.33625 5.70655C3.09479 5.70655 2.24235 6.63203 2.24235 8.13083V12.6281C2.24235 13.2571 1.74205 13.7387 1.1118 13.7387C0.500341 13.7387 0 13.2571 0 12.6281V4.89208C0 4.2631 0.481844 3.76329 1.1118 3.76329C1.74205 3.76329 2.24235 4.2631 2.24235 4.89208V5.35475C2.87235 4.48511 3.72475 3.67068 5.22586 3.67068C6.63431 3.67068 7.63481 4.35545 8.15378 5.39189C8.93198 4.35545 9.96987 3.67068 11.4522 3.67068C13.5833 3.67068 14.8804 5.02183 14.8804 7.40919V12.6281C14.8804 13.2571 14.3988 13.7387 13.7686 13.7387Z" fill="#0A0A22"/></svg>`}</div></footer>`:e`<div class="content"><slot></slot></div>`}};t([i({type:String})],d.prototype,"background",void 0),t([i()],d.prototype,"variant",void 0),t([i({type:Boolean,attribute:"show-mediquo-branding"})],d.prototype,"showMediquoBranding",void 0),d=t([a(),o("mq-layout")],d);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { LitElement } from 'lit';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Presentational page frame: a centered content column with an optional
|
|
7
|
+
* "provided by mediquo" branding footer. Pure chrome — no navigation. Shared
|
|
8
|
+
* across features that need a full-screen wizard-style layout.
|
|
9
|
+
*/
|
|
10
|
+
declare class MQLayout extends LitElement {
|
|
11
|
+
static styles: lit.CSSResult;
|
|
12
|
+
background: "solid" | "default" | "transparent";
|
|
13
|
+
variant: "default" | "wide";
|
|
14
|
+
showMediquoBranding: boolean;
|
|
15
|
+
render(): lit_html.TemplateResult<1>;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
"mq-layout": MQLayout;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as o}from"./consume-CovVqBjI.js";import{m as n}from"./runtime-Bg1WXVCx.js";import{l as r}from"./localized-decorator-BlOuLhym.js";import{Q as s}from"./query-controller-BlO1Ax65.js";import{A as a}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{A as l,c as m,n as d}from"./api-chat-client-fYDIH220.js";import{g as c}from"./next-appointment-card-DQE7dNXw.js";import{g as h}from"./get-patient-profile-query-4AO6xvVn.js";import{i as u,a as g,x as y}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{r as x}from"./state-LQivXIgA.js";import{setEnv as v}from"../env.js";import{MqViewAppointmentsEvent as b}from"../events.js";import{isValidLocale as j,setLocale as k}from"../i18n.js";import"./index-DEEAEB_4.js";import"./index-Bw-MbGKw.js";import"../ui/mq-skeleton.js";const w=[l.pending,l.accepted],A=u`:host{display:flex;flex-direction:column;gap:var(--sp-4);width:100%;min-width:0;box-sizing:border-box}:host([empty]){align-self:start}:host([empty]) .card{flex:0 0 auto}.card{display:flex;flex-direction:column;flex:1;min-width:0;box-sizing:border-box;background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--mq-next-appointments-radius,12px);padding:var(--mq-next-appointments-padding,var(--sp-6))}`;let $=class MqNextAppointments extends g{constructor(){super(...arguments),this.apiClient=m(),this.getPatientProfileQuery=new s(this,()=>h(this.apiClient,{enabled:!this.loginToken})),this.getAppointmentsQuery=new s(this,()=>c(this.apiClient,{status:w,order:{field:"starts_at",direction:"asc"},page:1,per_page:1})),this.handleViewAll=()=>{this.dispatchEvent(new b({tab:"next"}))}}static{this.styles=A}willUpdate(t){t.has("env")&&this.env&&v(this.env),t.has("locale")&&this.locale&&j(this.locale)&&k(this.locale);const e=d(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);e&&(this.apiClient=e)}get patientHash(){return this.loginToken?.patient.hash??this.getPatientProfileQuery.result?.data?.hash??""}get accessToken(){return this.token||this.loginToken?.access_token||""}get patientTimezone(){return this.timezone??this.loginToken?.patient.timezone}get isEmpty(){const t=this.getAppointmentsQuery.result;return!0===t?.isSuccess&&!t.data?.data?.[0]}updated(){this.toggleAttribute("empty",this.isEmpty)}renderAppointment(){return this.getAppointmentsQuery.render({complete:t=>{const e=t.data?.[0];return e?y`<next-appointment-card .appointmentResource="${e}" .token="${this.accessToken}" .patientHash="${this.patientHash}" .timezone="${this.patientTimezone}"></next-appointment-card>`:y`<widget-empty-state icon="calendar" heading="${n("No tienes próximas citas")}" description="${n("Cuando agendes una cita, aparecerá aquí para que puedas consultarla, modificarla o cancelarla.")}"></widget-empty-state>`},pending:()=>y`<mq-skeleton height="257px"></mq-skeleton>`,error:()=>y`<widget-empty-state icon="calendar" heading="${n("No hemos podido cargar tu próxima cita")}" description="${n("Vuelve a intentarlo en unos minutos.")}"></widget-empty-state>`})}render(){return y`<section-header heading="${n("Próxima cita")}" action-label="${n("Ver todas")}" @section-action="${this.handleViewAll}"></section-header><div class="card">${this.renderAppointment()}</div>`}};t([f({type:String,attribute:"api-key"})],$.prototype,"apiKey",void 0),t([f({type:String,attribute:"token"})],$.prototype,"token",void 0),t([f({type:String,attribute:"locale"})],$.prototype,"locale",void 0),t([f({type:String,attribute:"env"})],$.prototype,"env",void 0),t([f({type:String,attribute:"timezone"})],$.prototype,"timezone",void 0),t([o({context:p,subscribe:!0})],$.prototype,"loginToken",void 0),t([o({context:a,subscribe:!0}),x()],$.prototype,"inheritedApiClient",void 0),t([i({context:a}),x()],$.prototype,"apiClient",void 0),$=t([r(),e("mq-next-appointments")],$);export{$ as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as r}from"./consume-CovVqBjI.js";import{m as o}from"./runtime-Bg1WXVCx.js";import{l as s}from"./localized-decorator-BlOuLhym.js";import{Q as n}from"./query-controller-BlO1Ax65.js";import{A as a}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{g as l,t as d,r as c}from"./telemetry-client-DEIuDZfA.js";import{g as m,t as h}from"./index-BLxNeTVi.js";import{g as u}from"./get-patient-profile-query-4AO6xvVn.js";import{i as g,a as y,x as f}from"./lit-element-DiWJYFwC.js";import{n as v}from"./property-scuRaFcM.js";import{r as b}from"./state-LQivXIgA.js";import{setEnv as j}from"../env.js";import{MqViewDocumentsEvent as x}from"../events.js";import{isValidLocale as k,setLocale as w,getLocale as S}from"../i18n.js";import{c as $,n as P}from"./api-chat-client-fYDIH220.js";import"./index-Bw-MbGKw.js";import"./index-DEEAEB_4.js";const Q=g`:host{display:flex;flex-direction:column;align-self:start;gap:var(--sp-4);width:100%;min-width:0;box-sizing:border-box}.card{display:flex;flex-direction:column;gap:var(--sp-3);min-width:0;box-sizing:border-box;background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--mq-recent-documents-radius,12px);padding:var(--mq-recent-documents-padding,var(--sp-6))}`;let C=class MqRecentDocuments extends y{constructor(){super(...arguments),this.apiClient=$(),this.getPatientProfileQuery=new n(this,()=>u(this.apiClient,{enabled:!this.loginToken})),this.getPatientDocumentsQuery=new n(this,()=>({...m(this.apiClient,{patient_hash:this.patientHash,page:1,per_page:3}),enabled:!!this.patientHash})),this.getOrganizationSpecialtiesQuery=new n(this,()=>l(this.apiClient)),this.handleViewAll=()=>{d.track(c(this.patientHash)),this.dispatchEvent(new x)}}static{this.styles=Q}willUpdate(t){t.has("env")&&this.env&&j(this.env),t.has("locale")&&this.locale&&k(this.locale)&&w(this.locale);const e=P(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);e&&(this.apiClient=e)}get patientHash(){return this.loginToken?.patient.hash??this.getPatientProfileQuery.result?.data?.hash??""}renderEmptyState(){return f`<widget-empty-state icon="document" heading="${o("No tienes documentación")}" description="${o("Aquí se mostrarán tus recetas e informes médicos.")}"></widget-empty-state>`}renderSkeleton(){return f`<document-list placeholders="${3}"></document-list>`}renderError(){return f`<widget-empty-state icon="document" heading="${o("No hemos podido cargar tu documentación")}" description="${o("Vuelve a intentarlo en unos minutos.")}"></widget-empty-state>`}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:t=>0===t.data.length?this.renderEmptyState():f`<document-list .documents="${h(t.data,this.getOrganizationSpecialtiesQuery.result?.data,S())}" patientHash="${this.patientHash}"></document-list>`,initial:()=>this.getPatientProfileQuery.result?.isError?this.renderError():this.renderSkeleton(),pending:()=>this.renderSkeleton(),error:()=>this.renderError()})}render(){return f`<section-header heading="${o("Documentos recientes")}" action-label="${o("Ver todas")}" @section-action="${this.handleViewAll}"></section-header><div class="card">${this.renderDocuments()}</div>`}};t([v({type:String,attribute:"api-key"})],C.prototype,"apiKey",void 0),t([v({type:String,attribute:"token"})],C.prototype,"token",void 0),t([v({type:String,attribute:"locale"})],C.prototype,"locale",void 0),t([v({type:String,attribute:"env"})],C.prototype,"env",void 0),t([r({context:a,subscribe:!0}),b()],C.prototype,"inheritedApiClient",void 0),t([i({context:a}),b()],C.prototype,"apiClient",void 0),t([r({context:p,subscribe:!0})],C.prototype,"loginToken",void 0),C=t([s(),e("mq-recent-documents")],C);export{C as M};
|
package/dist/chunks/{next-appointment-card-Bc65OZ1_.d.ts → next-appointment-card-DBXsY3Sp.d.ts}
RENAMED
|
@@ -4,12 +4,60 @@ import { LitElement } from 'lit';
|
|
|
4
4
|
import { M as MediquoApiChatClient, G as GetAppointmentsResponse } from './index.d-XSe7Hy-Q.js';
|
|
5
5
|
import { L as LoginTokenResponse } from './schemas.d-b6_AekBb.js';
|
|
6
6
|
import './mq-chat-room-jeDvIF1Z.js';
|
|
7
|
-
import './appointment-action-unavailable-dialog-CTiL4nMo.js';
|
|
8
|
-
import './professional-overview-mO3tuMuH.js';
|
|
9
7
|
import '../ui/mq-button.js';
|
|
8
|
+
import '../ui/mq-dialog.js';
|
|
9
|
+
import { P as PriceInCents } from './price.d-CwLosdAN.js';
|
|
10
|
+
import { QueryClient } from '@tanstack/query-core';
|
|
11
|
+
import './professional-overview-mO3tuMuH.js';
|
|
10
12
|
import '../ui/mq-floating-bubble.js';
|
|
11
13
|
import '../ui/mq-unread-badge.js';
|
|
12
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Informational dialog shown when an appointment action (modify, cancel,
|
|
17
|
+
* repeat) is currently unavailable. Purely presentational: the parent owns
|
|
18
|
+
* the copy (already translated) and decides when to open it.
|
|
19
|
+
*
|
|
20
|
+
* Usage:
|
|
21
|
+
* <appointment-action-unavailable-dialog
|
|
22
|
+
* .open=${true}
|
|
23
|
+
* .heading=${"Anular cita"}
|
|
24
|
+
* .message=${"Lo sentimos, ..."}
|
|
25
|
+
* @close=${() => { ... }}
|
|
26
|
+
* ></appointment-action-unavailable-dialog>
|
|
27
|
+
*/
|
|
28
|
+
declare class AppointmentActionUnavailableDialog extends LitElement {
|
|
29
|
+
static styles: lit.CSSResult;
|
|
30
|
+
open: boolean;
|
|
31
|
+
heading: string;
|
|
32
|
+
message: string;
|
|
33
|
+
private handleClose;
|
|
34
|
+
render(): lit_html.TemplateResult<1>;
|
|
35
|
+
}
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
"appointment-action-unavailable-dialog": AppointmentActionUnavailableDialog;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare class CancelAppointmentConfirmationDialog extends LitElement {
|
|
43
|
+
apiClient: MediquoApiChatClient;
|
|
44
|
+
static styles: lit.CSSResult;
|
|
45
|
+
open: boolean;
|
|
46
|
+
queryClientContext: QueryClient | undefined;
|
|
47
|
+
appointmentId: string;
|
|
48
|
+
price?: PriceInCents;
|
|
49
|
+
private cancelAppointmentMutation;
|
|
50
|
+
private handleClose;
|
|
51
|
+
private handleDismissClick;
|
|
52
|
+
private handleConfirmClick;
|
|
53
|
+
render(): lit_html.TemplateResult<1>;
|
|
54
|
+
}
|
|
55
|
+
declare global {
|
|
56
|
+
interface HTMLElementTagNameMap {
|
|
57
|
+
"cancel-appointment-confirmation-dialog": CancelAppointmentConfirmationDialog;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
13
61
|
declare class NextAppointmentCard extends LitElement {
|
|
14
62
|
static styles: lit.CSSResult;
|
|
15
63
|
apiClient: MediquoApiChatClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./chunk-6CCJWPGL-TiaqZaPV.js";import{_ as t,c as i}from"./custom-element-D2ziPxYE.js";import{c as n}from"./consume-CovVqBjI.js";import{m as o,s as a}from"./runtime-Bg1WXVCx.js";import{l as s}from"./localized-decorator-BlOuLhym.js";import{Q as r}from"./query-controller-BlO1Ax65.js";import{A as l}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{i as c,a as d}from"./api-chat-client-fYDIH220.js";import{g as m,a as h}from"./chunk-2TKJJNS7-BGwxtEg7.js";import{g as u}from"./get-organization-setup-query-Dr1cXnHl.js";import{g,t as f,f as v,i as b,j as y,k as $,a as x}from"./telemetry-client-DEIuDZfA.js";import{g as C}from"./chunk-Y4EKUX25-CWAZgcgw.js";import{c as w}from"./refund-cancel-policy-QG_OE6g5.js";import{a as k,i as q,x as O,E as j}from"./lit-element-DiWJYFwC.js";import{n as M}from"./property-scuRaFcM.js";import{r as z}from"./state-LQivXIgA.js";import{MqAppointmentJoinVideocallEvent as S,MqAppointmentRescheduleEvent as E}from"../events.js";import{getLocale as I}from"../i18n.js";import{calendarIcon as D}from"../ui/icons/calendar-icon.js";import{dotsHorizontalIcon as R}from"../ui/icons/dots-horizontal-icon.js";import{messageBubbleIcon as _}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as A}from"../ui/icons/phone-icon.js";import{videoIcon as P}from"../ui/icons/video-icon.js";import"../mq-chat-room.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{Q as T}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as U}from"./mutation-controller-CR2qcqhH.js";import{h as N,f as L}from"./price-DU3YLTpk.js";import"./professional-overview-C4H_znIJ.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-unread-badge.js";import{toast as H}from"../ui/mq-toast.js";function Q(t,i){return{queryKey:e(t,"appointments",i),queryFn:()=>t.appointments.getAppointments(i)}}function J(e){const{action:t,refundPolicySeconds:i}=e,n=null!=i&&i<3600,s=Math.ceil((i??0)/60),r=Math.ceil((i??0)/3600);return o(0===(n?s:r)?"modify"===t?"Esta cita ya ha pasado, por lo que no se puede modificar.":"Esta cita ya ha pasado, por lo que no se puede anular.":"modify"===t?n?a`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos modificarla.`:a`Lo sentimos, como faltan menos de ${r} horas para tu cita no podemos modificarla.`:n?a`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos anularla.`:a`Lo sentimos, como faltan menos de ${r} horas para tu cita no podemos anularla.`)}let F=class AppointmentActionUnavailableDialog extends k{constructor(){super(...arguments),this.open=!1,this.heading="",this.message="",this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=q`:host{display:contents}mq-dialog::part(dialog){max-width:343px;min-width:0}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.actions{display:flex;margin-top:var(--sp-4)}`}render(){return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${this.heading}</h2><p slot="subheading">${this.message}</p><div class="actions"><mq-button variant="primary" fullwidth @click="${this.handleClose}">${o("Volver")}</mq-button></div></mq-dialog>`}};t([M({type:Boolean,reflect:!0})],F.prototype,"open",void 0),t([M({type:String})],F.prototype,"heading",void 0),t([M({type:String})],F.prototype,"message",void 0),F=t([s(),i("appointment-action-unavailable-dialog")],F);let V=class CancelAppointmentConfirmationDialog extends k{constructor(){super(...arguments),this.open=!1,this.cancelAppointmentMutation=new U(this,{mutationFn:async e=>this.apiClient.appointments.cancelAppointment(e),onSuccess:()=>{this.queryClientContext?.invalidateQueries(),this.dispatchEvent(new CustomEvent("success",{bubbles:!0,composed:!0}))}}),this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleDismissClick=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleConfirmClick=()=>{this.cancelAppointmentMutation.run({id:this.appointmentId})}}static{this.styles=q`:host{display:contents}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.subheading-payable{font-size:var(--text-base);line-height:22px}.price-rows{display:flex;flex-direction:column;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);line-height:var(--text-sm--line-height);color:var(--color-card-foreground);width:100%;margin-bottom:var(--sp-4)}.price-row{display:flex;align-items:center;justify-content:space-between;min-height:34px;gap:var(--sp-2)}.price-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-4);justify-content:flex-end;flex-wrap:wrap}`}render(){const e=I(),t=this.price,i=N(t),n=this.cancelAppointmentMutation.isPending;if(i){const i=L(t,e),a=`-${i}`;return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${o("Confirmar cancelación")}</h2><p slot="subheading" class="subheading-payable">${o("¿Seguro que quieres cancelar esta cita? Se te devolverá el importe pagado en un plazo de 5-10 días hábiles.")}</p><div><div class="price-rows"><div class="price-row"><span>${o("Importe pagado")}</span> <span>${i}</span></div><div class="price-row"><span>${o("Importe a devolver")}</span> <span>${a}</span></div></div><div class="actions"><mq-button variant="outline" ?disabled="${n}" @click="${this.handleDismissClick}">${o("Volver")}</mq-button><mq-button variant="primary" ?disabled="${n}" @click="${this.handleConfirmClick}">${o("Confirmar")}</mq-button></div></div></mq-dialog>`}return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${o("Confirmar cancelación")}</h2><p slot="subheading">${o("¿Seguro que quieres cancelar esta cita?")}</p><div><div class="actions"><mq-button variant="outline" ?disabled="${n}" @click="${this.handleDismissClick}">${o("Cancelar")}</mq-button><mq-button variant="primary" ?disabled="${n}" @click="${this.handleConfirmClick}">${o("Confirmar")}</mq-button></div></div></mq-dialog>`}};t([n({context:l,subscribe:!0})],V.prototype,"apiClient",void 0),t([M({type:Boolean,reflect:!0})],V.prototype,"open",void 0),t([n({context:T,subscribe:!0})],V.prototype,"queryClientContext",void 0),t([M({type:String})],V.prototype,"appointmentId",void 0),t([M({type:Object})],V.prototype,"price",void 0),V=t([s(),i("cancel-appointment-confirmation-dialog")],V);const W=q`:host{display:flex;flex-direction:column;justify-content:space-between;gap:var(--sp-6);flex:1;width:100%;min-width:0;box-sizing:border-box;color:var(--color-text-icons--primary,#0a0a22)}professional-overview{--avatar-size-lg:66px;--text-lg--line-height:1.35;display:block}.details{display:flex;flex-direction:column;align-items:flex-start;gap:var(--sp-3)}.detail-row{display:inline-flex;align-items:center;gap:var(--sp-2);font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.footer{display:flex;flex-direction:column;gap:var(--sp-4)}.reminder{font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--secondary,#6d658b);margin:0}.actions{--button-height-md:2.75rem;display:flex;align-items:stretch;gap:10px}.actions>mq-button{flex:1;min-width:0}.overflow{position:relative;flex:0 0 auto}.chat-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-badge{--mq-unread-badge-size:8px;flex-shrink:0}@media (max-width:767px){.actions{flex-wrap:wrap}.actions>mq-button.join{order:1;flex:1 0 100%}}.menu{position:absolute;right:0;bottom:calc(100% + var(--sp-2));z-index:2;display:flex;flex-direction:column;min-width:176px;padding:var(--sp-1);background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--border-radius-lg);box-shadow:var(--shadow-lg)}.menu-item{display:block;width:100%;background:0 0;border:none;border-radius:var(--border-radius-sm);padding:var(--sp-2) var(--sp-3);cursor:pointer;text-align:left;font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;color:var(--color-text-icons--primary,#0a0a22)}.menu-item:hover{background-color:var(--color-muted)}.menu-item.negative{color:var(--color-negative)}`;let B=class NextAppointmentCard extends k{constructor(){super(...arguments),this.token="",this.patientHash="",this.isChatOpen=!1,this.isMenuOpen=!1,this.isCancelDialogOpen=!1,this.openDialog=null,this.getUnreadMessagesQuery=new r(this,()=>({...C(this.apiClient,{roomId:this.appointmentResource?.room?.id}),enabled:!!this.appointmentResource?.room?.id})),this.getOrganizationSetupQuery=new r(this,()=>u(this.apiClient)),this.getOrganizationSpecialtiesQuery=new r(this,()=>g(this.apiClient,{enabled:!!this.appointmentResource?.speciality?.id})),this.closeMenuOnOutsideClick=e=>{e.composedPath().includes(this)||(this.isMenuOpen=!1)},this.closeMenuOnEscape=e=>{"Escape"===e.key&&(this.isMenuOpen=!1)},this.handleJoinVideocall=()=>{f.track(v(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new S({appointmentId:this.appointmentId}))},this.handleToggleChat=()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&f.track(b(this.sessionPatientHash,this.appointmentId))},this.handleModify=()=>{this.isMenuOpen=!1,this.isModifyUnavailable?this.openDialog="modify":(f.track(y(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new E({appointmentId:this.appointmentId})))},this.handleCancel=()=>{this.isMenuOpen=!1,this.isCancelUnavailable?this.openDialog="cancel":(f.track($(this.sessionPatientHash,this.appointmentId)),this.isCancelDialogOpen=!0)}}static{this.styles=W}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.closeMenuOnOutsideClick),document.addEventListener("keydown",this.closeMenuOnEscape)}disconnectedCallback(){document.removeEventListener("click",this.closeMenuOnOutsideClick),document.removeEventListener("keydown",this.closeMenuOnEscape),super.disconnectedCallback()}get appointmentId(){return this.appointmentResource.appointment.id??""}get channel(){return this.appointmentResource.appointment.channel}get sessionToken(){return this.token||this.loginToken?.access_token||""}get sessionPatientHash(){return this.patientHash||this.loginToken?.patient?.hash||""}get sessionTimezone(){return this.timezone??this.loginToken?.patient?.timezone}get unreadCount(){return this.getUnreadMessagesQuery.result?.data?.unread_count??0}get specialtyName(){const e=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>Number(e.id)===Number(this.appointmentResource.speciality?.id));return x(e?.code??"",I(),e?.name??this.appointmentResource.speciality?.name)}get hasChatSupport(){return this.appointmentResource.appointment.has_chat_in_appointment??this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment??!1}get isExpired(){return c(this.appointmentResource.appointment.expires_at)}get refundPolicySeconds(){return this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel}get policyAllowsModifyOrCancel(){return w({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:this.refundPolicySeconds})}get isModifyUnavailable(){return this.isExpired||0===this.appointmentResource.slots.length||!this.policyAllowsModifyOrCancel}get isCancelUnavailable(){return this.isExpired||!this.policyAllowsModifyOrCancel}get modifyUnavailableMessage(){return J({action:"modify",refundPolicySeconds:this.refundPolicySeconds})}get cancelUnavailableMessage(){return J({action:"cancel",refundPolicySeconds:this.refundPolicySeconds})}channelIcon(){switch(this.channel){case d.videocall:return P({size:20});case d.phonecall:return A({size:20});default:return _({size:20})}}channelLabel(){switch(this.channel){case d.videocall:return o("Videoconsulta");case d.phonecall:return o("Consulta telefónica");default:return o("Chat")}}formatWhen(){const e=I().replace("_","-"),t=m(this.sessionTimezone),i=t?{timeZone:t}:{},n=new Date(this.appointmentResource.appointment.starts_at);if(Number.isNaN(n.getTime()))return"";const s=new Intl.DateTimeFormat(e,{weekday:"long",day:"numeric",month:"long",year:"numeric",...i}).format(n),r=new Intl.DateTimeFormat(e,{timeStyle:"short",hourCycle:"h23",...i}).format(n),l=t?h(t,n):"";return o(a`${s}, ${r} h${l?` (${l})`:""}`)}renderActions(){const e=this.channel===d.videocall;return O`<div class="actions">${this.hasChatSupport?O`<mq-button variant="outline" @click="${this.handleToggleChat}"><span class="chat-label">${o("Ir a chat")}</span> ${this.unreadCount>0?O`<mq-unread-badge class="chat-badge"></mq-unread-badge>`:j}</mq-button>`:j} ${e?O`<mq-button class="join" variant="primary" @click="${this.handleJoinVideocall}">${o("Unirse a la videoconsulta")}</mq-button>`:j}<div class="overflow"><mq-button variant="outline" size="icon-lg" aria-label="${o("Más opciones")}" aria-haspopup="menu" aria-expanded="${this.isMenuOpen}" @click="${()=>{this.isMenuOpen=!this.isMenuOpen}}">${R({size:16})}</mq-button>${this.isMenuOpen?O`<div class="menu" role="menu"><button class="menu-item" type="button" role="menuitem" @click="${this.handleModify}">${o("Modificar cita")}</button> <button class="menu-item negative" type="button" role="menuitem" @click="${this.handleCancel}">${o("Anular cita")}</button></div>`:j}</div></div>`}render(){const{professional:e}=this.appointmentResource,t=this.formatWhen();return O`<professional-overview .name="${e.name}" .specialtyName="${this.specialtyName}" .collegiateNumber="${e.collegiate_number??void 0}" .description="${e.description??""}" .languages="${e.languages??[]}" .avatar="${e.avatar??""}"></professional-overview><div class="details">${t?O`<div class="detail-row">${D({size:20})} <span>${t}</span></div>`:j}<div class="detail-row">${this.channelIcon()} <span>${this.channelLabel()}</span></div></div><div class="footer"><p class="reminder">${o("Recibirás un recordatorio 15 minutos antes de la consulta")}</p>${this.renderActions()}</div><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" hideCloseButton @mq-close="${()=>{this.isChatOpen=!1}}">${this.isChatOpen?O`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.sessionToken}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${e.hash}" ?readonly="${this.isExpired}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:j}</mq-floating-bubble><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${o("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${o("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,H.success(o("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentId}}))}}"></cancel-appointment-confirmation-dialog>`}};t([n({context:l,subscribe:!0})],B.prototype,"apiClient",void 0),t([n({context:p,subscribe:!0})],B.prototype,"loginToken",void 0),t([M({type:Object})],B.prototype,"appointmentResource",void 0),t([M({type:String})],B.prototype,"token",void 0),t([M({type:String})],B.prototype,"patientHash",void 0),t([M({type:String})],B.prototype,"timezone",void 0),t([z()],B.prototype,"isChatOpen",void 0),t([z()],B.prototype,"isMenuOpen",void 0),t([z()],B.prototype,"isCancelDialogOpen",void 0),t([z()],B.prototype,"openDialog",void 0),B=t([s(),i("next-appointment-card")],B);export{J as a,Q as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as t}from"./chunk-6CCJWPGL-TiaqZaPV.js";function e(e,n){return{queryKey:t(e,"organization-specialties"),queryFn:()=>e.organizations.getOrganizationSpecialties(),...n}}function n(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function i(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function a(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 p(t,e){return{action_type:"event",event_type:"view appointment document list button click",patient_hash:t,id_appointment:e}}function s(t,e){return{action_type:"event",event_type:"repeat appointment button click",patient_hash:t,id_appointment:e}}function c(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function _(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function r(t,e){return{action_type:"event",event_type:"add to calendar button click",patient_hash:t,id_appointment:e}}function l(t,e){return{action_type:"pageview",event_type:"appointment success page view",patient_hash:t,id_appointment:e}}function u(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function d(t,e){return{action_type:"event",event_type:"update documentation",patient_hash:t,id_appointment:e}}function y(t,e){return{action_type:"pageview",event_type:"documentation page view",patient_hash:t,id_appointment:e}}function h(t){return{action_type:"event",event_type:"view documentation list button click",patient_hash:t}}function v(t,e){return{action_type:"event",event_type:"download document button click",patient_hash:t,id_document:e}}function g(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 f(t){return{action_type:"pageview",event_type:"home page view",patient_hash:t}}function E(t,e,n){return{action_type:"event",event_type:"find availability button click",patient_hash:t,speciality_id:e,service_id:n}}function S(t,e,n,i,a,o,p){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:o,total_slots:p}}function k(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 b(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 T(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 w(t){return{action_type:"pageview",event_type:"select professional step page view",patient_hash:t}}function P(t,e){return{action_type:"pageview",event_type:"not time yet pageview",patient_hash:t,id_appointment:e}}function C(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function D(t,e){return{action_type:"pageview",event_type:"waiting room pageview",patient_hash:t,id_appointment:e}}function q(t,e){return{action_type:"pageview",event_type:"videocall pageview",patient_hash:t,id_appointment:e}}var K={digestive_system:{de_DE:"Verdauungssystem",en_US:"Digestive System",es_ES:"Aparato Digestivo",ca_ES:"Aparell Digestiu",pt_PT:"Aparelho Digestivo"},orthopedic_surgery_traumatology:{de_DE:"Traumatologie und Orthopädische Chirurgie",en_US:"Traumatology and Orthopedic Surgery",es_ES:"Traumatología y Cirugía Ortopédica",ca_ES:"Traumatologia i Cirurgia Ortopèdica",pt_PT:"Traumatologia e Cirurgia Ortopédica"},gynecology:{de_DE:"Gynäkologie",en_US:"Gynecology",es_ES:"Ginecología",ca_ES:"Ginecologia",pt_PT:"Ginecologia"},endocrinology:{de_DE:"Endokrinologie",en_US:"Endocrinology",es_ES:"Endocrinología",ca_ES:"Endocrinologia",pt_PT:"Endocrinologia"},psychiatry:{de_DE:"Psychiatrie",en_US:"Psychiatry",es_ES:"Psiquiatría",ca_ES:"Psiquiatria",pt_PT:"Psiquiatria"}},O={videocall:{de_DE:"Videosprechstunde",en_US:"Videocall",es_ES:"Videoconsulta",ca_ES:"Videoconsulta",pt_PT:"Videoconsulta"},phonecall:{de_DE:"Telefonische Behandlung",en_US:"Phone consultation",es_ES:"Consulta telefónica",ca_ES:"Consulta telefònica",pt_PT:"Consulta telefónica"}},U={de_DE:"Konsultationspreis",en_US:"Consultation price",es_ES:"Precio de consulta",ca_ES:"Preu de consulta",pt_PT:"Preço da consulta"},G={videocall:"videocall",phonecall:"phonecall",adeslas_videocall:"videocall",adeslas_prod_videocall:"videocall",adeslas_phonecall:"phonecall",adeslas_prod_phonecall:"phonecall"};function A(t,e,n){if(!t)return n??"";const i=G[t];return i?O[i][e]:n??U[e]}var V={consulta_telefonica:"phonecall",videoconsulta:"videocall"},x={"aparato-digestivo":"digestive_system","cirugia-ortopedica-y-traumatologia":"orthopedic_surgery_traumatology",ginecologia:"gynecology",endocrinologia:"endocrinology",psiquiatria:"psychiatry"};function z(t,e,n){const i=n?.trim();if(i)return i;const a=K[t]?.[e];return void 0!==a?a:t}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 j=new class AppTelemetryClient extends MediquoTelemetryClient{track(t){}};export{k as A,b as B,S as C,w as D,P as E,C as F,D as G,q as H,V as S,
|
|
1
|
+
import{s as t}from"./chunk-6CCJWPGL-TiaqZaPV.js";function e(e,n){return{queryKey:t(e,"organization-specialties"),queryFn:()=>e.organizations.getOrganizationSpecialties(),...n}}function n(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function i(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function a(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 p(t,e){return{action_type:"event",event_type:"view appointment document list button click",patient_hash:t,id_appointment:e}}function s(t,e){return{action_type:"event",event_type:"repeat appointment button click",patient_hash:t,id_appointment:e}}function c(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function _(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function r(t,e){return{action_type:"event",event_type:"add to calendar button click",patient_hash:t,id_appointment:e}}function l(t,e){return{action_type:"pageview",event_type:"appointment success page view",patient_hash:t,id_appointment:e}}function u(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function d(t,e){return{action_type:"event",event_type:"update documentation",patient_hash:t,id_appointment:e}}function y(t,e){return{action_type:"pageview",event_type:"documentation page view",patient_hash:t,id_appointment:e}}function h(t){return{action_type:"event",event_type:"view documentation list button click",patient_hash:t}}function v(t,e){return{action_type:"event",event_type:"download document button click",patient_hash:t,id_document:e}}function g(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 f(t){return{action_type:"pageview",event_type:"home page view",patient_hash:t}}function E(t,e,n){return{action_type:"event",event_type:"find availability button click",patient_hash:t,speciality_id:e,service_id:n}}function S(t,e,n,i,a,o,p){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:o,total_slots:p}}function k(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 b(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 T(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 w(t){return{action_type:"pageview",event_type:"select professional step page view",patient_hash:t}}function P(t,e){return{action_type:"pageview",event_type:"not time yet pageview",patient_hash:t,id_appointment:e}}function C(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function D(t,e){return{action_type:"pageview",event_type:"waiting room pageview",patient_hash:t,id_appointment:e}}function q(t,e){return{action_type:"pageview",event_type:"videocall pageview",patient_hash:t,id_appointment:e}}var K={digestive_system:{de_DE:"Verdauungssystem",en_US:"Digestive System",es_ES:"Aparato Digestivo",ca_ES:"Aparell Digestiu",pt_PT:"Aparelho Digestivo"},orthopedic_surgery_traumatology:{de_DE:"Traumatologie und Orthopädische Chirurgie",en_US:"Traumatology and Orthopedic Surgery",es_ES:"Traumatología y Cirugía Ortopédica",ca_ES:"Traumatologia i Cirurgia Ortopèdica",pt_PT:"Traumatologia e Cirurgia Ortopédica"},gynecology:{de_DE:"Gynäkologie",en_US:"Gynecology",es_ES:"Ginecología",ca_ES:"Ginecologia",pt_PT:"Ginecologia"},endocrinology:{de_DE:"Endokrinologie",en_US:"Endocrinology",es_ES:"Endocrinología",ca_ES:"Endocrinologia",pt_PT:"Endocrinologia"},psychiatry:{de_DE:"Psychiatrie",en_US:"Psychiatry",es_ES:"Psiquiatría",ca_ES:"Psiquiatria",pt_PT:"Psiquiatria"}},O={videocall:{de_DE:"Videosprechstunde",en_US:"Videocall",es_ES:"Videoconsulta",ca_ES:"Videoconsulta",pt_PT:"Videoconsulta"},phonecall:{de_DE:"Telefonische Behandlung",en_US:"Phone consultation",es_ES:"Consulta telefónica",ca_ES:"Consulta telefònica",pt_PT:"Consulta telefónica"}},U={de_DE:"Konsultationspreis",en_US:"Consultation price",es_ES:"Precio de consulta",ca_ES:"Preu de consulta",pt_PT:"Preço da consulta"},G={videocall:"videocall",phonecall:"phonecall",adeslas_videocall:"videocall",adeslas_prod_videocall:"videocall",adeslas_phonecall:"phonecall",adeslas_prod_phonecall:"phonecall"};function A(t,e,n){if(!t)return n??"";const i=G[t];return i?O[i][e]:n??U[e]}var V={consulta_telefonica:"phonecall",videoconsulta:"videocall"},x={"aparato-digestivo":"digestive_system","cirugia-ortopedica-y-traumatologia":"orthopedic_surgery_traumatology",ginecologia:"gynecology",endocrinologia:"endocrinology",psiquiatria:"psychiatry"};function z(t,e,n){const i=n?.trim();if(i)return i;const a=K[t]?.[e];return void 0!==a?a:t}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 j=new class AppTelemetryClient extends MediquoTelemetryClient{track(t){}};export{k as A,b as B,S as C,w as D,P as E,C as F,D as G,q as H,V as S,z as a,y as b,d as c,v as d,u as e,n as f,e as g,f as h,i,a as j,o as k,l,g as m,r as n,c as o,_ as p,s as q,h as r,p as s,j as t,x as u,m as v,A as w,T as x,E as y,K 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.9.
|
|
1
|
+
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.9.3",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/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{z as t}from"./chunks/external-
|
|
1
|
+
import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{z as t}from"./chunks/external-BXLaKy9c.js";const c=["ca_ES","de_DE","en_US","pt_PT"],s=t.enum(["en_US","pt_PT","de_DE","es_ES","ca_ES"]);function a(e){return s.safeParse(e).success}const o="__mqElementsLocalization__";function i(){const e=globalThis;return e[o]||(e[o]={initialized:!1}),e[o]}function r(){const t=i();if(!t.initialized){t.initialized=!0;try{const{setLocale:n,getLocale:s}=e({sourceLocale:"es_ES",targetLocales:c,loadLocale:async e=>{switch(e){case"en_US":default:return import("./chunks/en_US-C2zY9QiH.js");case"pt_PT":return import("./chunks/pt_PT-DUs_Ox73.js");case"de_DE":return import("./chunks/de_DE-BTPGM932.js");case"ca_ES":return import("./chunks/ca_ES-OHfUU0MP.js")}}});t.setLocale=n,t.getLocale=s}catch(e){n.warn("Localization was already configured on this page.",e)}}}const u="Localization not initialized yet.";async function l(e){const{setLocale:t}=i();if(t)return t(e);n.warn(u)}function _(){const{getLocale:e}=i();return e?e():(n.warn(u),"es_ES")}export{_ as getLocale,r as initLocalization,a as isValidLocale,l as setLocale};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{e as o}from"./chunks/provide-BwI4DDGF.js";import{A as i}from"./chunks/api-client-context-V1UAGtKW.js";import{a as r,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n}from"./chunks/property-scuRaFcM.js";import{r as p}from"./chunks/state-LQivXIgA.js";import{setEnv as c}from"./env.js";import{c as a,n as m}from"./chunks/api-chat-client-
|
|
1
|
+
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{e as o}from"./chunks/provide-BwI4DDGF.js";import{A as i}from"./chunks/api-client-context-V1UAGtKW.js";import{a as r,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n}from"./chunks/property-scuRaFcM.js";import{r as p}from"./chunks/state-LQivXIgA.js";import{setEnv as c}from"./env.js";import{c as a,n as m}from"./chunks/api-chat-client-fYDIH220.js";import{e as h}from"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/chunk-2TKJJNS7-BGwxtEg7.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/external-BXLaKy9c.js";import"./chunks/isBefore-CPpTogxo.js";h();let u=class MqApiClientProvider extends r{constructor(){super(...arguments),this.apiClient=a()}willUpdate(t){t.has("env")&&this.env&&c(this.env);const e=m(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale});e&&(this.apiClient=e)}render(){return s`<slot></slot>`}};t([n({type:String,attribute:"api-key"})],u.prototype,"apiKey",void 0),t([n({type:String,attribute:"token"})],u.prototype,"token",void 0),t([n({type:String,attribute:"locale"})],u.prototype,"locale",void 0),t([n({type:String,attribute:"env"})],u.prototype,"env",void 0),t([o({context:i}),p()],u.prototype,"apiClient",void 0),u=t([e("mq-api-client-provider")],u);export{u as MqApiClientProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as t}from"./chunks/custom-element-D2ziPxYE.js";import{e as a}from"./chunks/provide-BwI4DDGF.js";import{c as i}from"./chunks/consume-CovVqBjI.js";import{m as s}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/localized-decorator-BlOuLhym.js";import{A as o}from"./chunks/api-client-context-V1UAGtKW.js";import{L as r}from"./chunks/login-token-task-Yib__6a9.js";import{l as p}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as l,a as c,x as h}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as y}from"./chunks/state-LQivXIgA.js";import{setEnv as d}from"./env.js";import{initLocalization as m,setLocale as v,isValidLocale as k}from"./i18n.js";import{c as b,n as f}from"./chunks/api-chat-client-
|
|
1
|
+
import{_ as e,c as t}from"./chunks/custom-element-D2ziPxYE.js";import{e as a}from"./chunks/provide-BwI4DDGF.js";import{c as i}from"./chunks/consume-CovVqBjI.js";import{m as s}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/localized-decorator-BlOuLhym.js";import{A as o}from"./chunks/api-client-context-V1UAGtKW.js";import{L as r}from"./chunks/login-token-task-Yib__6a9.js";import{l as p}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as l,a as c,x as h}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as y}from"./chunks/state-LQivXIgA.js";import{setEnv as d}from"./env.js";import{initLocalization as m,setLocale as v,isValidLocale as k}from"./i18n.js";import{c as b,n as f}from"./chunks/api-chat-client-fYDIH220.js";import{u as P,s as _,r as E}from"./chunks/apple-pay-outcomes-DbuQ2LI3.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-BXLaKy9c.js";import"./chunks/chunk-2TKJJNS7-BGwxtEg7.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";function g(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent;return/Safari/i.test(e)&&!/Chrome|Chromium|Edg|OPR|Firefox|FxiOS/i.test(e)}async function S(e){if("undefined"==typeof window||!window.isSecureContext)return{available:!1,reason:"unsupported"};if(!function(){if("undefined"==typeof window)return!1;const e="undefined"!=typeof ApplePaySession&&"function"==typeof ApplePaySession.canMakePayments,t="undefined"!=typeof customElements&&void 0!==customElements.get("apple-pay-button");return e&&t}())return{available:!1,reason:"sdk-missing"};if(!e.trim())return{available:!1,reason:"merchant-id-missing"};const t=ApplePaySession;if(function(e){return"function"==typeof e.applePayCapabilities}(t))try{return function(e){switch(e){case"applePayUnsupported":return{available:!1,reason:"unsupported"};case"paymentCredentialsUnavailable":case"paymentCredentialsAvailable":case"paymentCredentialStatusUnknown":return{available:!0,usesQrFlow:!g()}}}((await t.applePayCapabilities(e)).paymentCredentialStatus)}catch{return t.canMakePayments()?{available:!0,usesQrFlow:!g()}:{available:!1,reason:"unsupported"}}return t.canMakePayments()?{available:!0,usesQrFlow:!g()}:{available:!1,reason:"unsupported"}}const A={es_ES:"es-ES",en_US:"en-US",pt_PT:"pt-PT",de_DE:"de-DE",ca_ES:"ca-ES"};try{m()}catch{}const C=["visa","masterCard","amex"],w=["supports3DS"],x=l`:host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;width:100%;min-height:48px}.helper{margin:0;text-align:center;font-family:system-ui,sans-serif;font-size:13px;line-height:1.4;color:#6e6e73}.pay-row{display:block;width:100%}.pay-row--paying{opacity:.55;pointer-events:none}apple-pay-button{--apple-pay-button-width:100%;--apple-pay-button-height:48px;--apple-pay-button-border-radius:10px;--apple-pay-button-padding:0;display:block;width:100%;min-height:48px;cursor:pointer}.state{text-align:center;font-family:system-ui,sans-serif;font-size:15px;color:#86868b;margin:0}`;class ApplePayCheckoutSuccessEvent extends Event{static{this.eventName="payment-success"}constructor(e){super(ApplePayCheckoutSuccessEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutDeniedEvent extends Event{static{this.eventName="payment-denied"}constructor(e){super(ApplePayCheckoutDeniedEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutErrorEvent extends Event{static{this.eventName="payment-error"}constructor(e){super(ApplePayCheckoutErrorEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}function j(e,t){p.warn(e,{error:t instanceof Error?t.message:String(t)})}let T=class MqApplePayCheckout extends c{constructor(){super(...arguments),this._availabilityPhase="checking",this._showQrHelper=!1,this._paying=!1,this._suppressCancelEvent=!1,this._availabilityGeneration=0,this.apiClient=b(),this._loginTokenTask=new r(this,()=>this.apiClient,{args:()=>[this.apiKey,this.token],onComplete:e=>{this._sessionToken=e.access_token,this.apiClient.setAuthToken(e.access_token),this._refreshAvailability()},onError:()=>{this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"auth"}))}}),this._onPayClick=()=>{if(this._paying||"ready"!==this._availabilityPhase)return;let e;try{e=new ApplePaySession(3,this._buildPaymentRequest())}catch(e){return j("mq-apple-pay-checkout: failed to create ApplePaySession",e),void this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}this._paying=!0,this._suppressCancelEvent=!1,e.onvalidatemerchant=async t=>{try{const a=await this.apiClient.payments.validateApplePayMerchant({order_id:this.sessionId,validation_url:t.validationURL});e.completeMerchantValidation(P(a))}catch(t){j("mq-apple-pay-checkout: validate-merchant failed",t),this._suppressCancelEvent=!0,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"merchant"})),e.abort(),this._paying=!1}},e.onpaymentauthorized=async t=>{try{const a=await this.apiClient.payments.authorizeApplePay({order_id:this.sessionId,token:_(t.payment.token)}),{status:i,consultation_id:s}=a.data,n=E(i,s,this.sessionId);switch(n.kind){case"success":e.completePayment(ApplePaySession.STATUS_SUCCESS),this.dispatchEvent(new ApplePayCheckoutSuccessEvent({sessionId:n.sessionId,reference:n.reference}));break;case"denied":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutDeniedEvent({sessionId:n.sessionId}));break;case"error":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:n.reason}))}}catch(t){j("mq-apple-pay-checkout: authorize failed",t),e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"authorize"}))}finally{this._paying=!1}},e.oncancel=()=>{this._paying=!1,this._suppressCancelEvent?this._suppressCancelEvent=!1:this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"cancelled"}))};try{e.begin()}catch(e){j("mq-apple-pay-checkout: session.begin() failed",e),this._paying=!1,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}}}static{this.styles=x}willUpdate(e){e.has("env")&&this.env&&d(this.env),e.has("locale")&&v(k(this.locale)?this.locale:"es_ES");const t=f(e,{env:this.env,apiKey:this.apiKey,token:this._sessionToken,locale:k(this.locale)?this.locale:"es_ES"},this.inheritedApiClient);t&&(this.apiClient=t),e.has("merchantId")&&this._loginTokenTask.value&&this._refreshAvailability()}async _refreshAvailability(){const e=++this._availabilityGeneration;this._availabilityPhase="checking",this._showQrHelper=!1;const t=await S(this.merchantId??"");e===this._availabilityGeneration&&(t.available?(this._availabilityPhase="ready",this._showQrHelper=t.usesQrFlow):this._availabilityPhase="unavailable")}get _resolvedLocale(){return k(this.locale)?this.locale:"es_ES"}_buildPaymentRequest(){return{countryCode:this.country,currencyCode:this.currency,supportedNetworks:[...C],merchantCapabilities:[...w],total:{label:this.label,amount:this.amount}}}_renderUnavailable(){return this.merchantId?.trim()?"undefined"==typeof ApplePaySession?h`<p class="state">${s("No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`:h`<p class="state">${s("Apple Pay no está disponible")}</p>`:h`<p class="state">${s("Falta el identificador de comercio de Apple Pay")}</p>`}render(){return this._loginTokenTask.render({pending:()=>h`<p class="state">${s("Preparando Apple Pay…")}</p>`,error:()=>h`<p class="state">${s("No hemos podido iniciar el pago")}</p>`,complete:()=>{return"checking"===this._availabilityPhase?h`<p class="state">${s("Comprobando Apple Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():h`${this._showQrHelper?h`<p class="helper">${s("Para pagar con Apple Pay, escanea el código QR con tu iPhone (iOS 18 o posterior) y confirma el pago.")}</p>`:null}<div class="pay-row ${this._paying?"pay-row--paying":""}"><apple-pay-button buttonstyle="black" type="pay" locale="${e=this._resolvedLocale,A[e]??"es-ES"}" aria-label="${s("Pagar con Apple Pay")}" @click="${this._onPayClick}"></apple-pay-button></div>`;var e}})}};e([u({type:String,attribute:"env"})],T.prototype,"env",void 0),e([u({type:String,attribute:"api-key"})],T.prototype,"apiKey",void 0),e([u({type:String,attribute:"token"})],T.prototype,"token",void 0),e([u({type:String,attribute:"locale",reflect:!0})],T.prototype,"locale",void 0),e([u({type:String,attribute:"merchant-id"})],T.prototype,"merchantId",void 0),e([u({type:String,attribute:"session-id"})],T.prototype,"sessionId",void 0),e([u({type:String,attribute:"amount"})],T.prototype,"amount",void 0),e([u({type:String,attribute:"currency"})],T.prototype,"currency",void 0),e([u({type:String,attribute:"country"})],T.prototype,"country",void 0),e([u({type:String,attribute:"label"})],T.prototype,"label",void 0),e([y()],T.prototype,"_availabilityPhase",void 0),e([y()],T.prototype,"_showQrHelper",void 0),e([y()],T.prototype,"_paying",void 0),e([i({context:o,subscribe:!0}),y()],T.prototype,"inheritedApiClient",void 0),e([a({context:o}),y()],T.prototype,"apiClient",void 0),T=e([n(),t("mq-apple-pay-checkout")],T);export{ApplePayCheckoutDeniedEvent,ApplePayCheckoutErrorEvent,ApplePayCheckoutSuccessEvent,T as MqApplePayCheckout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{a as o,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n as i}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import"./mq-checkout.js";import"./chunks/provide-BwI4DDGF.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/consume-CovVqBjI.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/api-chat-client-
|
|
1
|
+
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{a as o,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n as i}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import"./mq-checkout.js";import"./chunks/provide-BwI4DDGF.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/consume-CovVqBjI.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/api-chat-client-fYDIH220.js";import"./chunks/chunk-2TKJJNS7-BGwxtEg7.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/external-BXLaKy9c.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/api-client-context-V1UAGtKW.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/login-token-task-Yib__6a9.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/state-LQivXIgA.js";import"./theme.js";import"./i18n.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/directive-2EDmOukv.js";class AppointmentPaidEvent extends Event{static{this.eventName="payment-success"}constructor(t){super(AppointmentPaidEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let r=class MqAppointmentCheckout extends o{constructor(){super(...arguments),this._provideSession=async t=>{const e=await t.payments.createPaymentLink({slot_id:this.slotId,service_id:this.serviceId,specialty_id:this.specialtyId,consultation_reason:this.consultationReason,discount_code:this.discountCode,preconsultation_documents:this.preconsultationDocuments});return{sessionId:e.session_id,paymentUrl:e.payment_link}},this._onSuccess=t=>{t.stopPropagation(),this.dispatchEvent(new AppointmentPaidEvent({appointmentId:t.detail.reference}))}}render(){return s`<mq-checkout env="${n(this.env)}" api-key="${this.apiKey}" token="${this.token}" locale="${this.locale}" .provideSession="${this._provideSession}" @payment-success="${this._onSuccess}"></mq-checkout>`}};t([i({type:String,attribute:"env"})],r.prototype,"env",void 0),t([i({type:String,attribute:"api-key"})],r.prototype,"apiKey",void 0),t([i({type:String,attribute:"token"})],r.prototype,"token",void 0),t([i({type:String,attribute:"locale",reflect:!0})],r.prototype,"locale",void 0),t([i({type:String,attribute:"slot-id"})],r.prototype,"slotId",void 0),t([i({type:String,attribute:"service-id"})],r.prototype,"serviceId",void 0),t([i({type:String,attribute:"specialty-id"})],r.prototype,"specialtyId",void 0),t([i({type:String,attribute:"consultation-reason"})],r.prototype,"consultationReason",void 0),t([i({type:String,attribute:"discount-code"})],r.prototype,"discountCode",void 0),t([i({attribute:!1})],r.prototype,"preconsultationDocuments",void 0),r=t([e("mq-appointment-checkout")],r);export{AppointmentPaidEvent,r as MqAppointmentCheckout};
|
|
@@ -8,7 +8,8 @@ import './ui/mq-floating-bubble.js';
|
|
|
8
8
|
import './ui/mq-card.js';
|
|
9
9
|
import './ui/mq-unread-badge.js';
|
|
10
10
|
import './ui/mq-page-title.js';
|
|
11
|
-
import './chunks/
|
|
11
|
+
import './chunks/index-CFlNQLy2.js';
|
|
12
|
+
import './chunks/mq-layout-D8Mak16a.js';
|
|
12
13
|
import 'axios';
|
|
13
14
|
import 'zod';
|
|
14
15
|
import './chunks/schemas.d-b6_AekBb.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as s,c as o}from"./chunks/custom-element-D2ziPxYE.js";import{e as r}from"./chunks/provide-BwI4DDGF.js";import{c as n}from"./chunks/consume-CovVqBjI.js";import{Q as a}from"./chunks/query-controller-BlO1Ax65.js";import{A as c}from"./chunks/api-client-context-V1UAGtKW.js";import{g as p}from"./chunks/get-appointment-query-C-gTTuiQ.js";import{a as d,i as m,x as l}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as k}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{c as v,n as j}from"./chunks/api-chat-client-
|
|
1
|
+
import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as s,c as o}from"./chunks/custom-element-D2ziPxYE.js";import{e as r}from"./chunks/provide-BwI4DDGF.js";import{c as n}from"./chunks/consume-CovVqBjI.js";import{Q as a}from"./chunks/query-controller-BlO1Ax65.js";import{A as c}from"./chunks/api-client-context-V1UAGtKW.js";import{g as p}from"./chunks/get-appointment-query-C-gTTuiQ.js";import{a as d,i as m,x as l}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as k}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{c as v,n as j}from"./chunks/api-chat-client-fYDIH220.js";import"./chunks/documentation-view-DywQ1MfS.js";import"./ui/mq-card.js";import"./chunks/mq-layout-BiE8gq23.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-BXLaKy9c.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import"./chunks/chunk-2TKJJNS7-BGwxtEg7.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/addSeconds-ofMnxlgT.js";import"./ui/icons/calendar-icon.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/icons/types.js";import"./ui/icons/clock-icon.js";import"./ui/icons/info-circle-outine-icon.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import"./ui/icons/message-bubble-icon.js";import"./mq-chat-room.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/mq-avatar.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-BUV4MGML-CkhBbfUu.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./events.js";import"./chunks/chunk-Y4EKUX25-CWAZgcgw.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./chunks/chunk-YTQUGGS3-DJR1Yoyy.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-unread-badge.js";import"./ui/mq-page-title.js";import"./ui/icons/arrow-narrow-left-icon.js";import"./ui/icons/download-icon.js";import"./chunks/blob-to-base64-CUL1trde.js";import"./chunks/telemetry-client-DEIuDZfA.js";let b=class DocumentationViewSkeleton extends d{static{this.styles=m`.skeleton{border-radius:var(--border-radius-md);background-color:#f0f0f0;animation:skeleton-pulse 1.5s infinite}.page-title-skeleton{display:flex;align-items:center;gap:var(--sp-3);margin-bottom:var(--size-3)}.back-button-skeleton{width:var(--size-10);height:var(--size-10);border-radius:var(--border-radius-full);flex-shrink:0}.title-bar-skeleton{width:120px;height:24px;border-radius:var(--border-radius-sm)}@media (min-width:768px){.page-title-skeleton{gap:var(--sp-6)}.title-bar-skeleton{width:200px;height:32px}}.description-skeleton{width:100%;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-2)}.description-skeleton:last-of-type{width:70%;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-name-skeleton{width:180px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-1)}.professional-speciality-skeleton{width:140px;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);font-family:var(--font-body)}.icon-skeleton{width:20px;height:20px;border-radius:var(--border-radius-sm)}.text-skeleton{width:120px;height:16px;border-radius:var(--border-radius-sm)}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card .skeleton{background-color:var(--color-muted)}.documents-card-title-skeleton{width:150px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.button-skeleton{width:100%;height:44px;border-radius:var(--border-radius-md);margin-top:var(--size-4)}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}`}render(){return l`<div class="page-title-skeleton"><div class="skeleton back-button-skeleton"></div><div class="skeleton title-bar-skeleton"></div></div><div class="skeleton description-skeleton"></div><div class="skeleton description-skeleton"></div><mq-card class="professional-card" roundness="md"><div><div class="skeleton professional-name-skeleton"></div><div class="skeleton professional-speciality-skeleton"></div></div><dl class="description-list"><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div></dl></mq-card><mq-card class="documents-card" roundness="md"><div class="skeleton documents-card-title-skeleton"></div><div class="skeleton button-skeleton"></div></mq-card>`}};b=s([o("documentation-view-skeleton")],b);let g=class MqAppointmentDocumentation extends d{constructor(){super(...arguments),this.getAppointmentQuery=new a(this,()=>p(this.apiClient,{id:this.appointmentId})),this.apiClient=v()}willUpdate(i){i.has("env")&&this.env&&h(this.env),i.has("locale")&&this.locale&&t(this.locale)&&e(this.locale);const s=j(i,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);s&&(this.apiClient=s)}render(){return l`<mq-layout background="transparent">${this.getAppointmentQuery.render({complete:t=>l`<documentation-view .token="${this.token}" .appointment="${t}"></documentation-view>`,error:()=>l``,pending:()=>l`<documentation-view-skeleton></documentation-view-skeleton>`})}</mq-layout>`}};s([u({type:String,attribute:"appointment-id"})],g.prototype,"appointmentId",void 0),s([u({type:String,attribute:"token"})],g.prototype,"token",void 0),s([u({type:String,attribute:"api-key"})],g.prototype,"apiKey",void 0),s([u({type:String,attribute:"locale"})],g.prototype,"locale",void 0),s([u({type:String,attribute:"env"})],g.prototype,"env",void 0),s([n({context:c,subscribe:!0}),k()],g.prototype,"inheritedApiClient",void 0),s([r({context:c}),k()],g.prototype,"apiClient",void 0),g=s([o("mq-appointment-documentation")],g),i();export{g as MqAppointmentDocumentation};
|