@mediquo/elements 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/chunks/api-chat-client-BTBtu01T.js +1 -0
- package/dist/chunks/apple-pay-outcomes-BlytM6W-.js +1 -0
- package/dist/chunks/appointment-details-DpzdYLjq.d.ts +24 -0
- package/dist/chunks/appointment.model.d-Dy50gMPg.d.ts +171 -0
- package/dist/chunks/ca_ES-nttMFJzr.js +1 -0
- package/dist/chunks/chunk-S5RWG6G2-oTcdgk2H.js +1 -0
- package/dist/chunks/chunk-YTQUGGS3-DN-JZpgG.js +1 -0
- package/dist/chunks/class-map-Co76I6aw.js +1 -0
- package/dist/chunks/context-provider-CiMFpvDA.js +1 -0
- package/dist/chunks/context-request-event-Dfydf1ub.js +1 -0
- package/dist/chunks/custom-element-DA9Fxvxd.js +1 -0
- package/dist/chunks/de_DE-CrwfSJnS.js +1 -0
- package/dist/chunks/default-IpEn36CA.d.ts +5 -0
- package/dist/chunks/directive-2EDmOukv.js +1 -0
- package/dist/chunks/en_US-BslWF9nj.js +1 -0
- package/dist/chunks/ensure-context-root-DbdqwnKB.js +1 -0
- package/dist/chunks/exports-XZaVrMLd.js +1 -0
- package/dist/chunks/external-zAbuzxDj.js +1 -0
- package/dist/chunks/format-Cm3B1GMy.js +1 -0
- package/dist/chunks/get-organization-setup-query-BMbuRi6v.js +1 -0
- package/dist/chunks/get-patient-profile-query-C8T8DJ7z.js +1 -0
- package/dist/chunks/if-defined-BYeVdwgd.js +1 -0
- package/dist/chunks/index-B9iWdvW3.js +1 -0
- package/dist/chunks/index-BYHKNPG2.js +1 -0
- package/dist/chunks/index-Bxh8Qfwr.js +1 -0
- package/dist/chunks/isBefore-Cof0D841.js +1 -0
- package/dist/chunks/isSameDay-DPfclwIL.js +1 -0
- package/dist/chunks/lit-element-DiWJYFwC.js +1 -0
- package/dist/chunks/login-token-task-BI-L2zSV.js +1 -0
- package/dist/chunks/mq-chat-room-DuG4RuIp.d.ts +503 -0
- package/dist/chunks/mq-layout-D8Mak16a.d.ts +21 -0
- package/dist/chunks/mq-layout-DpzeL9_i.js +1 -0
- package/dist/chunks/mutation-controller-OVT8NEt6.js +1 -0
- package/dist/chunks/parseISO-jT42c8Ob.js +1 -0
- package/dist/chunks/price-Dtdjx70D.js +1 -0
- package/dist/chunks/price.d-CwLosdAN.d.ts +10 -0
- package/dist/chunks/professional-overview-mO3tuMuH.d.ts +25 -0
- package/dist/chunks/property-scuRaFcM.js +1 -0
- package/dist/chunks/provide-CfT7g_Zi.js +1 -0
- package/dist/chunks/pt_PT-CFbbWowX.js +1 -0
- package/dist/chunks/query-CeeutdfT.js +1 -0
- package/dist/chunks/query-QJ1INUTG.js +1 -0
- package/dist/chunks/refund-cancel-policy-Bm5djPds.js +1 -0
- package/dist/chunks/runtime-Bg1WXVCx.js +1 -0
- package/dist/chunks/schemas.d-BEA8Pl6w.d.ts +44 -0
- package/dist/chunks/state-LQivXIgA.js +1 -0
- package/dist/chunks/style-map-CIdqdn7C.js +1 -0
- package/dist/chunks/task-Bj8p7kJX.js +1 -0
- package/dist/chunks/telemetry-client-CKCb9Gnf.js +1 -0
- package/dist/env.d.ts +21 -0
- package/dist/env.js +1 -0
- package/dist/events.d.ts +141 -0
- package/dist/events.js +1 -0
- package/dist/i18n.d.ts +11 -0
- package/dist/i18n.js +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -0
- package/dist/mq-apple-pay-checkout.d.ts +82 -0
- package/dist/mq-apple-pay-checkout.js +1 -0
- package/dist/mq-appointment-checkout.d.ts +55 -0
- package/dist/mq-appointment-checkout.js +1 -0
- package/dist/mq-chat-room.d.ts +20 -0
- package/dist/mq-chat-room.js +1 -0
- package/dist/mq-checkout.d.ts +108 -0
- package/dist/mq-checkout.js +1 -0
- package/dist/mq-google-pay-checkout.d.ts +117 -0
- package/dist/mq-google-pay-checkout.js +1 -0
- package/dist/mq-immediate-videocall-checkout.d.ts +47 -0
- package/dist/mq-immediate-videocall-checkout.js +1 -0
- package/dist/mq-my-appointments.d.ts +602 -0
- package/dist/mq-my-appointments.js +1 -0
- package/dist/mq-query-client-provider.d.ts +17 -0
- package/dist/mq-query-client-provider.js +1 -0
- package/dist/mq-schedule-success.d.ts +84 -0
- package/dist/mq-schedule-success.js +4 -0
- package/dist/mq-schedule.d.ts +1013 -0
- package/dist/mq-schedule.js +1 -0
- package/dist/mq-socket-provider.d.ts +103 -0
- package/dist/mq-socket-provider.js +1 -0
- package/dist/mq-support-chat.d.ts +86 -0
- package/dist/mq-support-chat.js +1 -0
- package/dist/mq-theme-provider.d.ts +34 -0
- package/dist/mq-theme-provider.js +1 -0
- package/dist/mq-videocall.d.ts +151 -0
- package/dist/mq-videocall.js +1 -0
- package/dist/theme.d.ts +200 -0
- package/dist/theme.js +1 -0
- package/dist/ui/back-link.d.ts +21 -0
- package/dist/ui/back-link.js +1 -0
- package/dist/ui/icons/alert-circle-icon.d.ts +6 -0
- package/dist/ui/icons/alert-circle-icon.js +1 -0
- package/dist/ui/icons/annotation-question-icon.d.ts +6 -0
- package/dist/ui/icons/annotation-question-icon.js +1 -0
- package/dist/ui/icons/briefcase-icon.d.ts +6 -0
- package/dist/ui/icons/briefcase-icon.js +1 -0
- package/dist/ui/icons/calendar-icon.d.ts +6 -0
- package/dist/ui/icons/calendar-icon.js +1 -0
- package/dist/ui/icons/chat-bubble-icon.d.ts +6 -0
- package/dist/ui/icons/chat-bubble-icon.js +1 -0
- package/dist/ui/icons/check-circle-icon.d.ts +5 -0
- package/dist/ui/icons/check-circle-icon.js +1 -0
- package/dist/ui/icons/check-double-icon.d.ts +6 -0
- package/dist/ui/icons/check-double-icon.js +1 -0
- package/dist/ui/icons/check-icon.d.ts +6 -0
- package/dist/ui/icons/check-icon.js +1 -0
- package/dist/ui/icons/chevron-down-icon.d.ts +6 -0
- package/dist/ui/icons/chevron-down-icon.js +1 -0
- package/dist/ui/icons/chevron-left-icon.d.ts +6 -0
- package/dist/ui/icons/chevron-left-icon.js +1 -0
- package/dist/ui/icons/chevron-right-icon.d.ts +6 -0
- package/dist/ui/icons/chevron-right-icon.js +1 -0
- package/dist/ui/icons/clock-icon.d.ts +6 -0
- package/dist/ui/icons/clock-icon.js +1 -0
- package/dist/ui/icons/download-icon.d.ts +6 -0
- package/dist/ui/icons/download-icon.js +1 -0
- package/dist/ui/icons/file-icon.d.ts +6 -0
- package/dist/ui/icons/file-icon.js +1 -0
- package/dist/ui/icons/heartbeat-icon.d.ts +5 -0
- package/dist/ui/icons/heartbeat-icon.js +1 -0
- package/dist/ui/icons/info-circle-outine-icon.d.ts +6 -0
- package/dist/ui/icons/info-circle-outine-icon.js +1 -0
- package/dist/ui/icons/message-bubble-icon.d.ts +6 -0
- package/dist/ui/icons/message-bubble-icon.js +1 -0
- package/dist/ui/icons/message-square-icon.d.ts +6 -0
- package/dist/ui/icons/message-square-icon.js +1 -0
- package/dist/ui/icons/mic-icon.d.ts +6 -0
- package/dist/ui/icons/mic-icon.js +1 -0
- package/dist/ui/icons/mic-off-icon.d.ts +6 -0
- package/dist/ui/icons/mic-off-icon.js +1 -0
- package/dist/ui/icons/phone-icon.d.ts +6 -0
- package/dist/ui/icons/phone-icon.js +1 -0
- package/dist/ui/icons/spinner-icon.d.ts +6 -0
- package/dist/ui/icons/spinner-icon.js +1 -0
- package/dist/ui/icons/tag-icon.d.ts +6 -0
- package/dist/ui/icons/tag-icon.js +1 -0
- package/dist/ui/icons/time-left-icon.d.ts +5 -0
- package/dist/ui/icons/time-left-icon.js +1 -0
- package/dist/ui/icons/types.d.ts +9 -0
- package/dist/ui/icons/types.js +1 -0
- package/dist/ui/icons/upload-icon.d.ts +6 -0
- package/dist/ui/icons/upload-icon.js +1 -0
- package/dist/ui/icons/video-icon.d.ts +6 -0
- package/dist/ui/icons/video-icon.js +1 -0
- package/dist/ui/icons/video-off-icon.d.ts +6 -0
- package/dist/ui/icons/video-off-icon.js +1 -0
- package/dist/ui/icons/x-icon.d.ts +6 -0
- package/dist/ui/icons/x-icon.js +1 -0
- package/dist/ui/mq-avatar.d.ts +37 -0
- package/dist/ui/mq-avatar.js +1 -0
- package/dist/ui/mq-button.d.ts +34 -0
- package/dist/ui/mq-button.js +1 -0
- package/dist/ui/mq-calendar.d.ts +66 -0
- package/dist/ui/mq-calendar.js +1 -0
- package/dist/ui/mq-callout.d.ts +23 -0
- package/dist/ui/mq-callout.js +1 -0
- package/dist/ui/mq-card.d.ts +18 -0
- package/dist/ui/mq-card.js +1 -0
- package/dist/ui/mq-checkbox.d.ts +41 -0
- package/dist/ui/mq-checkbox.js +1 -0
- package/dist/ui/mq-clamped-text.d.ts +46 -0
- package/dist/ui/mq-clamped-text.js +1 -0
- package/dist/ui/mq-dialog.d.ts +53 -0
- package/dist/ui/mq-dialog.js +1 -0
- package/dist/ui/mq-floating-bubble.d.ts +42 -0
- package/dist/ui/mq-floating-bubble.js +1 -0
- package/dist/ui/mq-input.d.ts +41 -0
- package/dist/ui/mq-input.js +1 -0
- package/dist/ui/mq-rating.d.ts +30 -0
- package/dist/ui/mq-rating.js +1 -0
- package/dist/ui/mq-select.d.ts +83 -0
- package/dist/ui/mq-select.js +1 -0
- package/dist/ui/mq-skeleton.d.ts +18 -0
- package/dist/ui/mq-skeleton.js +1 -0
- package/dist/ui/mq-tabs.d.ts +56 -0
- package/dist/ui/mq-tabs.js +1 -0
- package/dist/ui/mq-text-button.d.ts +39 -0
- package/dist/ui/mq-text-button.js +1 -0
- package/dist/ui/mq-textarea.d.ts +38 -0
- package/dist/ui/mq-textarea.js +1 -0
- package/dist/ui/mq-time-slot-picker.d.ts +84 -0
- package/dist/ui/mq-time-slot-picker.js +1 -0
- package/dist/ui/mq-toast.d.ts +111 -0
- package/dist/ui/mq-toast.js +1 -0
- package/dist/ui/mq-unread-badge.d.ts +15 -0
- package/dist/ui/mq-unread-badge.js +1 -0
- package/package.json +176 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{h as s,j as i,k as a,R as r,l as n,g as o,S as u,m as h,n as c,o as l,q as d,u as f,f as y,v as p,a as m,w as g,x as v,y as b,z as C,Q as q}from"./chunks/query-QJ1INUTG.js";import{e as O}from"./chunks/provide-CfT7g_Zi.js";import{x as P,a as w}from"./chunks/lit-element-DiWJYFwC.js";import{r as Q}from"./chunks/state-LQivXIgA.js";import{e as x}from"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-provider-CiMFpvDA.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/property-scuRaFcM.js";var D=Object.defineProperty;function M(t){return{onFetch:(e,r)=>{const n=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,u=e.state.data?.pages||[],h=e.state.data?.pageParams||[];let c={pages:[],pageParams:[]},l=0;const d=async()=>{let r=!1;const d=s(e.options,e.fetchOptions),f=async(t,s,n)=>{if(r)return Promise.reject();if(null==s&&t.pages.length)return Promise.resolve(t);const o=(()=>{const t={client:e.client,queryKey:e.queryKey,pageParam:s,direction:n?"backward":"forward",meta:e.options.meta};var i;return i=t,Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(e.signal.aborted?r=!0:e.signal.addEventListener("abort",()=>{r=!0}),e.signal)}),t})(),u=await d(o),{maxPages:h}=e.options,c=n?i:a;return{pages:c(t.pages,u,h),pageParams:c(t.pageParams,s,h)}};if(o&&u.length){const t="backward"===o,e={pages:u,pageParams:h},s=(t?k:A)(n,e);c=await f(e,s,t)}else{const e=t??u.length;do{const t=0===l?h[0]??n.initialPageParam:A(n,c);if(l>0&&null==t)break;c=await f(c,t),l++}while(l<e)}return c};e.options.persister?e.fetchFn=()=>e.options.persister?.(d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=d}}}function A(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function k(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var E=class extends r{#t;#e;#s;constructor(t){super(),this.mutationId=t.mutationId,this.#e=t.mutationCache,this.#t=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#e.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})};this.#s=n({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#i({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const s="pending"===this.state.status,i=!this.#s.canStart();try{if(s)e();else{this.#i({type:"pending",variables:t,isPaused:i}),await(this.#e.config.onMutate?.(t,this));const e=await(this.options.onMutate?.(t));e!==this.state.context&&this.#i({type:"pending",context:e,variables:t,isPaused:i})}const a=await this.#s.start();return await(this.#e.config.onSuccess?.(a,t,this.state.context,this)),await(this.options.onSuccess?.(a,t,this.state.context)),await(this.#e.config.onSettled?.(a,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(a,null,t,this.state.context)),this.#i({type:"success",data:a}),a}catch(e){try{throw await(this.#e.config.onError?.(e,t,this.state.context,this)),await(this.options.onError?.(e,t,this.state.context)),await(this.#e.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,e,t,this.state.context)),e}finally{this.#i({type:"error",error:e})}}finally{this.#e.runNext(this)}}#i(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),o.batch(()=>{this.#t.forEach(e=>{e.onMutationUpdate(t)}),this.#e.notify({mutation:this,type:"updated",action:t})})}};var K=class extends u{constructor(t={}){super(),this.config=t,this.#a=new Set,this.#r=new Map,this.#n=0}#a;#r;#n;build(t,e,s){const i=new E({mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#a.add(t);const e=j(t);if("string"==typeof e){const s=this.#r.get(e);s?s.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#a.delete(t)){const e=j(t);if("string"==typeof e){const s=this.#r.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=j(t);if("string"==typeof e){const s=this.#r.get(e),i=s?.find(t=>"pending"===t.state.status);return!i||i===t}return!0}runNext(t){const e=j(t);if("string"==typeof e){const s=this.#r.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}return Promise.resolve()}clear(){o.batch(()=>{this.#a.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#a.clear(),this.#r.clear()})}getAll(){return Array.from(this.#a)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>h(e,t))}findAll(t={}){return this.getAll().filter(e=>h(t,e))}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return o.batch(()=>Promise.all(t.map(t=>t.continue().catch(c))))}};function j(t){return t.options.scope?.id}var F=class extends u{constructor(t={}){super(),this.config=t,this.#o=new Map}#o;build(t,e,s){const i=e.queryKey,a=e.queryHash??l(i,e);let r=this.get(a);return r||(r=new d({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(r)),r}add(t){this.#o.has(t.queryHash)||(this.#o.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#o.get(t.queryHash);e&&(t.destroy(),e===t&&this.#o.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){o.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#o.get(t)}getAll(){return[...this.#o.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>f(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>f(t,e)):e}notify(t){o.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){o.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){o.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},S=class{#u;#e;#h;#c;#l;#d;#f;#y;constructor(t={}){this.#u=t.queryCache||new F,this.#e=t.mutationCache||new K,this.#h=t.defaultOptions||{},this.#c=new Map,this.#l=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#f=y.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#y=p.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#f?.(),this.#f=void 0,this.#y?.(),this.#y=void 0)}isFetching(t){return this.#u.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#u.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#u.build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(m(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#u.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#u.get(i.queryHash),r=a?.state.data,n=g(e,r);if(void 0!==n)return this.#u.build(this,i).setData(n,{...s,manual:!0})}setQueriesData(t,e,s){return o.batch(()=>this.#u.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#u.get(e.queryHash)?.state}removeQueries(t){const e=this.#u;o.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#u;return o.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=o.batch(()=>this.#u.findAll(t).map(t=>t.cancel(s)));return Promise.all(i).then(c).catch(c)}invalidateQueries(t,e={}){return o.batch(()=>(this.#u.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=o.batch(()=>this.#u.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(c)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(i).then(c)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#u.build(this,e);return s.isStaleByTime(m(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(c).catch(c)}fetchInfiniteQuery(t){return t.behavior=M(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(c).catch(c)}ensureInfiniteQueryData(t){return t.behavior=M(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return p.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#u}getMutationCache(){return this.#e}getDefaultOptions(){return this.#h}setDefaultOptions(t){this.#h=t}setQueryDefaults(t,e){this.#c.set(v(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#c.values()],s={};return e.forEach(e=>{b(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#l.set(v(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#l.values()],s={};return e.forEach(e=>{b(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#h.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=l(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===C&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#h.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#u.clear(),this.#e.clear()}},R=t=>{class QueryClientMixinClass extends t{constructor(){super(...arguments),this.queryClient=new S({defaultOptions:{queries:{staleTime:6e4}}})}connectedCallback(){super.connectedCallback(),this.queryClient.mount()}disconnectedCallback(){super.disconnectedCallback(),this.queryClient.unmount()}}return((t,e,s)=>{for(var i,a=void 0,r=t.length-1;r>=0;r--)(i=t[r])&&(a=i(e,s,a)||a);a&&D(e,s,a)})([O({context:q}),Q()],QueryClientMixinClass.prototype,"queryClient"),QueryClientMixinClass};x();let H=class QueryClientProvider extends(R(w)){render(){return P`<slot></slot>`}};H=t([e("mq-query-client-provider")],H);export{H as QueryClientProvider};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
4
|
+
import { Env } from './env.js';
|
|
5
|
+
import './ui/mq-callout.js';
|
|
6
|
+
import './ui/mq-button.js';
|
|
7
|
+
import './chunks/professional-overview-mO3tuMuH.js';
|
|
8
|
+
import './chunks/appointment-details-DpzdYLjq.js';
|
|
9
|
+
import './chunks/mq-chat-room-DuG4RuIp.js';
|
|
10
|
+
import './ui/mq-floating-bubble.js';
|
|
11
|
+
import './ui/mq-unread-badge.js';
|
|
12
|
+
import './ui/mq-skeleton.js';
|
|
13
|
+
import './ui/mq-card.js';
|
|
14
|
+
import { QueryClient } from '@tanstack/query-core';
|
|
15
|
+
import './ui/mq-text-button.js';
|
|
16
|
+
import './ui/mq-avatar.js';
|
|
17
|
+
import './chunks/appointment.model.d-Dy50gMPg.js';
|
|
18
|
+
import 'zod';
|
|
19
|
+
|
|
20
|
+
declare class MqScheduleSuccessSkeleton extends LitElement {
|
|
21
|
+
static styles: lit.CSSResult;
|
|
22
|
+
render(): lit_html.TemplateResult<1>;
|
|
23
|
+
}
|
|
24
|
+
declare global {
|
|
25
|
+
interface HTMLElementTagNameMap {
|
|
26
|
+
"mq-schedule-success-skeleton": MqScheduleSuccessSkeleton;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare class OpenVideocallEvent extends Event {
|
|
31
|
+
readonly detail: {
|
|
32
|
+
appointmentId: string;
|
|
33
|
+
};
|
|
34
|
+
static eventName: string;
|
|
35
|
+
constructor(detail: {
|
|
36
|
+
appointmentId: string;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @fires open-videocall - Fired when the user wants to join the videocall
|
|
41
|
+
*/
|
|
42
|
+
declare class MqScheduleSuccess extends LitElement {
|
|
43
|
+
static styles: lit.CSSResult;
|
|
44
|
+
kind: "schedule" | "reschedule";
|
|
45
|
+
appointmentId: string;
|
|
46
|
+
/** Mediquo API key. Required when used standalone (outside mq-router). */
|
|
47
|
+
apiKey?: string;
|
|
48
|
+
/** Already-exchanged access token. Required when used standalone. */
|
|
49
|
+
token?: string;
|
|
50
|
+
/** IANA timezone for rendering the appointment time. Defaults to the
|
|
51
|
+
* browser's resolved timezone. */
|
|
52
|
+
timezone?: string;
|
|
53
|
+
/** Locale (e.g. "es_ES"). Optional; defaults to the host/build locale. */
|
|
54
|
+
locale?: string;
|
|
55
|
+
/** Environment override ("development" | "production"). Optional. */
|
|
56
|
+
env?: Env;
|
|
57
|
+
queryClientContext: QueryClient | undefined;
|
|
58
|
+
/** Available when embedded in mq-router; standalone hosts pass `token` instead. */
|
|
59
|
+
private loginToken?;
|
|
60
|
+
private get _accessToken();
|
|
61
|
+
private get _timezone();
|
|
62
|
+
private _trackedPageView;
|
|
63
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
64
|
+
private getPatientProfileQuery;
|
|
65
|
+
private getAppointmentQuery;
|
|
66
|
+
private getCouponQuery;
|
|
67
|
+
private getOrganizationSpecialtiesQuery;
|
|
68
|
+
private getOrganizationSetupQuery;
|
|
69
|
+
private isChatOpen;
|
|
70
|
+
private unreadQuery;
|
|
71
|
+
private get _patientHash();
|
|
72
|
+
connectedCallback(): void;
|
|
73
|
+
protected updated(): void;
|
|
74
|
+
private _getCalloutText;
|
|
75
|
+
private renderPriceBreakdown;
|
|
76
|
+
render(): lit_html.TemplateResult<1> | null;
|
|
77
|
+
}
|
|
78
|
+
declare global {
|
|
79
|
+
interface HTMLElementTagNameMap {
|
|
80
|
+
"mq-schedule-success": MqScheduleSuccess;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { MqScheduleSuccess, OpenVideocallEvent };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as n}from"./i18n.js";import{_ as o,t as a}from"./chunks/custom-element-DA9Fxvxd.js";import{m as s,s as r}from"./chunks/runtime-Bg1WXVCx.js";import{l as c}from"./chunks/parseISO-jT42c8Ob.js";import{i as p,a as l,x as d,E as m}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as h}from"./chunks/state-LQivXIgA.js";import{setEnv as g}from"./env.js";import{a as v,A as f,c as y,C as b}from"./chunks/api-chat-client-BTBtu01T.js";import{checkIcon as k}from"./ui/icons/check-icon.js";import"./ui/mq-callout.js";import"./ui/mq-button.js";import{Q as x,c as w}from"./chunks/mutation-controller-OVT8NEt6.js";import{l as j}from"./chunks/chunk-S5RWG6G2-oTcdgk2H.js";import{g as $,t as q,b as _,a as C,c as S,d as z,e as I,f as O}from"./chunks/telemetry-client-CKCb9Gnf.js";import{f as A}from"./chunks/price-Dtdjx70D.js";import{g as Q,a as P}from"./chunks/get-patient-profile-query-C8T8DJ7z.js";import{g as T}from"./chunks/get-organization-setup-query-BMbuRi6v.js";import{a as E}from"./chunks/exports-XZaVrMLd.js";import{calendarIcon as H}from"./ui/icons/calendar-icon.js";import{chatbubbleIcon as N}from"./ui/icons/chat-bubble-icon.js";import{videoIcon as V}from"./ui/icons/video-icon.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-unread-badge.js";import"./ui/mq-skeleton.js";import"./ui/mq-card.js";import{Q as K}from"./chunks/query-QJ1INUTG.js";import"./chunks/external-zAbuzxDj.js";import"./chunks/format-Cm3B1GMy.js";import"./chunks/isBefore-Cof0D841.js";import"./ui/icons/types.js";import"./ui/icons/info-circle-outine-icon.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-provider-CiMFpvDA.js";import"./ui/icons/chevron-down-icon.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/mq-text-button.js";import"./ui/mq-avatar.js";import"./ui/icons/briefcase-icon.js";import"./ui/icons/clock-icon.js";import"./ui/icons/message-bubble-icon.js";import"./ui/icons/phone-icon.js";import"./chunks/provide-CfT7g_Zi.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./events.js";import"./ui/icons/check-double-icon.js";import"./chunks/chunk-YTQUGGS3-DN-JZpgG.js";import"./chunks/style-map-CIdqdn7C.js";const B=p`header{padding:var(--sp-6) var(--sp-4);display:flex;align-items:center;gap:var(--sp-2);max-width:var(--content-max-width);margin:0 auto}.summary{padding:var(--sp-6) var(--sp-4);background-color:var(--color-neutrals-background-weak);max-width:var(--content-max-width);margin:0 auto}.summary-content{display:flex;flex-direction:column;gap:var(--sp-4)}.manage-appointment{box-sizing:border-box;max-width:var(--content-max-width);margin:0 auto}`;let U=class MqScheduleSuccessSkeleton extends l{static{this.styles=B}render(){return d`<div><header><mq-skeleton width="220px" height="40px" border-radius="md"></mq-skeleton></header><div class="summary"><div class="summary-content"><mq-skeleton width="280px" height="32px" border-radius="md"></mq-skeleton><mq-skeleton width="100%" height="400px" border-radius="lg"></mq-skeleton><mq-skeleton width="100%" height="80px" border-radius="lg"></mq-skeleton></div></div><div class="manage-appointment"><mq-skeleton width="100%" height="313px" border-radius="lg"></mq-skeleton></div></div>`}};U=o([a("mq-schedule-success-skeleton")],U);const G=p`.success-title{display:flex;align-items:center;gap:var(--sp-2);margin-bottom:var(--sp-4)}header h1{font-family:var(--font-titles);font-size:var(--text-3xl);line-height:var(--text-3xl--line-height);font-weight:var(--font-weight-bold);margin: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;margin-bottom:var(--sp-6)}.summary{padding:var(--sp-6) var(--sp-4)}.professional-card{padding:var(--sp-4)}.appointment-summary{margin-bottom:var(--sp-2);display:flex;flex-direction:column;gap:var(--sp-4)}.add-to-calendar-container{padding-top:var(--sp-4);border-top:1px solid var(--color-neutrals-border-disabled)}.price-breakdown{display:flex;flex-direction:column;gap:var(--sp-2)}.price-row{display:flex;justify-content:space-between;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default)}.price-row--total{font-weight:var(--font-weight-semibold)}.price-breakdown hr{width:100%;border:none;border-top:1px solid var(--color-neutrals-border-disabled);margin:var(--sp-1) 0}.floating-content{height:100%}.actions{display:flex;flex-direction:column;gap:var(--sp-4)}@media (min-width:768px){.actions{flex-direction:row}}`;class OpenVideocallEvent extends Event{static{this.eventName="open-videocall"}constructor(t){super(OpenVideocallEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let M=class MqScheduleSuccess extends l{constructor(){super(...arguments),this.kind="schedule",this._trackedPageView=!1,this.getPatientProfileQuery=new x(this,()=>Q(v)),this.getAppointmentQuery=new x(this,()=>P(v,{id:this.appointmentId})),this.getCouponQuery=new x(this,()=>{return t=v,e={appointmentId:this.appointmentId},i={enabled:!!this.appointmentId},{queryKey:["appointment-consultation-coupon",e.appointmentId],queryFn:()=>t.payments.getAppointmentConsultationCoupon(e.appointmentId),retry:!1,...i};var t,e,i}),this.getOrganizationSpecialtiesQuery=new x(this,()=>$(v)),this.getOrganizationSetupQuery=new x(this,()=>T(v)),this.isChatOpen=!1,this.unreadQuery=new x(this,()=>E(v,{roomId:Number(this.getAppointmentQuery.result?.data?.room_id)},{enabled:!!this.getAppointmentQuery.result?.data?.room_id})),this._getCalloutText=t=>{switch(t.channel){case f.videocall:return s("Te enviaremos un enlace al email indicado cuando sea el momento de conectarte a la vídeoconsulta. Asegúrate de tener buena conexión a internet y un dispositivo con cámara y micrófono.");case f.phonecall:return s(r`El profesional te llamará al
|
|
2
|
+
${this.getPatientProfileQuery.result?.data?.profile.phone??""} en el horario
|
|
3
|
+
seleccionado. Asegúrate de tener buena cobertura y poder atender en
|
|
4
|
+
el horario elegido.`);case f.chat:return s("El profesional te enviará un mensaje para que podamos coordinar la cita. Asegúrate de tener buena cobertura y poder atender en el horario elegido.");default:return m}}}static{this.styles=G}get _accessToken(){return this.token??this.loginToken?.access_token}get _timezone(){return this.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}willUpdate(i){i.has("env")&&this.env&&g(this.env),i.has("apiKey")&&this.apiKey&&v.setApiKey(this.apiKey),i.has("token")&&this.token&&v.setAuthToken(this.token),i.has("locale")&&this.locale&&t(this.locale)&&(e(this.locale),v.setLanguage(this.locale))}get _patientHash(){return this.getPatientProfileQuery.result?.data?.hash??""}connectedCallback(){super.connectedCallback(),this.queryClientContext?.invalidateQueries()}updated(){!this._trackedPageView&&this._patientHash&&(this._trackedPageView=!0,q.track(_(this._patientHash,this.appointmentId)))}renderPriceBreakdown(t,e,i){const n=t.price;if(null==n||n<=0)return m;const o=t.currency??"EUR",a=t.discount_amount??0,r=a>0,c=n-a,p=this.getCouponQuery.result?.data,l=p?.name??p?.code,u=r?p?.percent_off??Math.round(a/n*100):0,h=l?`${s("Promoción")} ${l}`:s("Promoción");return d`<div class="price-breakdown"><div class="price-row"><span>${i}</span> <span>${A({amount:n,currency:o},e)}</span></div>${r?d`<div class="price-row"><span>${h} (-${u}%)</span> <span>${A({amount:-a,currency:o},e)}</span></div><hr><div class="price-row price-row--total"><span>${s("Total")}</span> <span>${A({amount:c,currency:o},e)}</span></div>`:m}</div>`}render(){return this.getAppointmentQuery.render({pending:()=>d`<mq-schedule-success-skeleton></mq-schedule-success-skeleton>`,complete:t=>{const e=i(),n=y(t.start_date),o=C(n,t.duration),a=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===Number(t.speciality_id)),c=S(a?.code??"",e,a?.name),p=t.channel===f.videocall,l=t.channel===f.phonecall,u=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,h=(p||l)&&u,g=this._accessToken;return d`<div><header><div class="success-title">${k()}<h1>${"schedule"===this.kind?s("Cita confirmada"):s("Cita modificada")}</h1></div><h2>${s(r`Resumen de la cita para ${t?.to?.name??""}`)}</h2></header><mq-card class="summary" roundness="md"><div class="appointment-summary"><professional-overview .name="${t.from.name??""}" .specialtyName="${c}" .collegiateNumber="${t.from.collegiate_number??void 0}" .description="${t.from.description??""}" .languages="${t.from.languages??[]}" .avatar="${t.from.avatar??""}" always-expanded-on-desktop></professional-overview><appointment-details .startsAt="${n.toISOString()}" .duration="${t.duration}" .channel="${t.channel}" .timezone="${this._timezone}"></appointment-details>${this.renderPriceBreakdown(t,e,c||s("Consulta"))}<div class="add-to-calendar-container"><mq-text-button fontWeight="bold" size="sm" @click="${()=>{q.track(z(this._patientHash,this.appointmentId));const e=function({title:t,description:e,startsAt:i,endsAt:n}){const o=t=>t.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),a=o(i),s=o(n);return`https://www.google.com/calendar/render?${new URLSearchParams({action:"TEMPLATE",text:t,dates:`${a}/${s}`,...e&&{details:e}}).toString()}`}({title:s(r`Cita agendada de ${t.from.speciality??""}`),startsAt:n,endsAt:o,description:p&&t.consultation_short_url?s(r`Enlace a la cita: ${t.consultation_short_url}`):void 0});window.open(e,"_blank")}}">${H({size:24})} ${s("Añadir al calendario")}</mq-text-button></div>${h||p?d`<div class="actions">${h?d`<mq-button variant="primary" fullwidth size="md" @click="${()=>{q.track(I(this._patientHash,this.appointmentId)),this.isChatOpen=!this.isChatOpen}}">${N({size:24})} ${s("Chatear con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?d`<mq-unread-badge></mq-unread-badge>`:m}</mq-button>`:m} ${p?d`<mq-button variant="outline" fullwidth size="md" @click="${()=>{q.track(O(this._patientHash,this.appointmentId)),this.dispatchEvent(new OpenVideocallEvent({appointmentId:this.appointmentId}))}}">${V({size:24})} ${s("Ir a videollamada")}</mq-button>`:m}</div>`:m}</div><mq-callout background="default" variant="info" ?noPadding="${!(h||p)}">${this._getCalloutText(t)}</mq-callout></mq-card></div><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen&&g?d`<div slot="content" class="floating-content"><mq-chat-room .consultationId="${t.id}" .consultationType="${b.appointment}" .token="${g}" .roomId="${Number(t.room_id)}" .professionalHash="${t.from.hash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room></div>`:m}</mq-floating-bubble>`}})}};o([u({type:String})],M.prototype,"kind",void 0),o([u({type:String})],M.prototype,"appointmentId",void 0),o([u({type:String,attribute:"api-key"})],M.prototype,"apiKey",void 0),o([u({type:String,attribute:"token"})],M.prototype,"token",void 0),o([u({type:String,attribute:"timezone"})],M.prototype,"timezone",void 0),o([u({type:String,attribute:"locale"})],M.prototype,"locale",void 0),o([u({type:String,attribute:"env"})],M.prototype,"env",void 0),o([w({context:K,subscribe:!0})],M.prototype,"queryClientContext",void 0),o([w({context:j})],M.prototype,"loginToken",void 0),o([h()],M.prototype,"isChatOpen",void 0),M=o([c(),a("mq-schedule-success")],M),n();export{M as MqScheduleSuccess,OpenVideocallEvent};
|