@mediquo/elements 0.5.0 → 0.5.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.
Files changed (85) hide show
  1. package/README.md +3 -1
  2. package/dist/chunks/api-chat-client-vbjgaIRV.js +1 -0
  3. package/dist/chunks/{apple-pay-outcomes-CjCnBYOD.js → apple-pay-outcomes-DxrMPQqB.js} +1 -1
  4. package/dist/chunks/appointment-card-skeleton-1c7552Ln.d.ts +398 -0
  5. package/dist/chunks/appointment-card-skeleton-CYFfacro.js +1 -0
  6. package/dist/chunks/{chunk-GZF3YFSX-DM-GTqxg.js → chunk-GZF3YFSX-BzloXkVp.js} +1 -1
  7. package/dist/chunks/{chunk-YTQUGGS3-DmCGIoFy.js → chunk-YTQUGGS3-p18naHsk.js} +1 -1
  8. package/dist/chunks/{documentation-view-fFbvjJqx.js → documentation-view-CS4Q-UpO.js} +1 -1
  9. package/dist/chunks/{external-CJj32K_p.js → external-mrLCXx_f.js} +1 -1
  10. package/dist/chunks/get-patient-documents-query-DIQH-TMM.js +1 -0
  11. package/dist/chunks/index-BJYWtEmT.js +1 -0
  12. package/dist/chunks/{index-Xcn-xs13.js → index-DBMxJ4Dp.js} +1 -1
  13. package/dist/chunks/{index-CLdWVaEs.js → index-yd2JNJSr.js} +1 -1
  14. package/dist/chunks/{price-BmA2Dl9f.js → price-CdF63nRC.js} +1 -1
  15. package/dist/chunks/{refund-cancel-policy-D_tUYPyv.js → refund-cancel-policy-Bl9qE8wD.js} +1 -1
  16. package/dist/chunks/telemetry-client-BLJVs9me.js +1 -0
  17. package/dist/env.js +1 -1
  18. package/dist/events.d.ts +11 -1
  19. package/dist/events.js +1 -1
  20. package/dist/i18n.js +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/mq-apple-pay-checkout.js +1 -1
  24. package/dist/mq-appointment-checkout.js +1 -1
  25. package/dist/mq-appointment-documentation.js +1 -1
  26. package/dist/mq-chat-room.js +1 -1
  27. package/dist/mq-checkout.js +1 -1
  28. package/dist/mq-dashboard.d.ts +224 -0
  29. package/dist/mq-dashboard.js +1 -0
  30. package/dist/mq-documents.js +1 -1
  31. package/dist/mq-google-pay-checkout.js +1 -1
  32. package/dist/mq-immediate-videocall-checkout.js +1 -1
  33. package/dist/mq-my-appointments.d.ts +9 -391
  34. package/dist/mq-my-appointments.js +1 -1
  35. package/dist/mq-professional-presence-sync.js +1 -1
  36. package/dist/mq-schedule-success.js +2 -2
  37. package/dist/mq-schedule.js +1 -1
  38. package/dist/mq-socket-provider.js +1 -1
  39. package/dist/mq-support-chat.js +1 -1
  40. package/dist/mq-terms-and-conditions.js +1 -1
  41. package/dist/mq-unread-count-sync.js +1 -1
  42. package/dist/mq-videocall.js +1 -1
  43. package/dist/react/mq-apple-pay-checkout.d.ts +24 -7
  44. package/dist/react/mq-apple-pay-checkout.js +1 -1
  45. package/dist/react/mq-appointment-checkout.d.ts +20 -5
  46. package/dist/react/mq-appointment-checkout.js +1 -1
  47. package/dist/react/mq-appointment-documentation.d.ts +17 -6
  48. package/dist/react/mq-appointment-documentation.js +1 -1
  49. package/dist/react/mq-chat-room.d.ts +30 -7
  50. package/dist/react/mq-chat-room.js +1 -1
  51. package/dist/react/mq-checkout.d.ts +22 -8
  52. package/dist/react/mq-checkout.js +1 -1
  53. package/dist/react/mq-dashboard.d.ts +57 -0
  54. package/dist/react/mq-dashboard.js +2 -0
  55. package/dist/react/mq-documents.d.ts +16 -2
  56. package/dist/react/mq-documents.js +1 -1
  57. package/dist/react/mq-google-pay-checkout.d.ts +29 -7
  58. package/dist/react/mq-google-pay-checkout.js +1 -1
  59. package/dist/react/mq-immediate-videocall-checkout.d.ts +15 -5
  60. package/dist/react/mq-immediate-videocall-checkout.js +1 -1
  61. package/dist/react/mq-my-appointments.d.ts +26 -6
  62. package/dist/react/mq-my-appointments.js +1 -1
  63. package/dist/react/mq-professional-presence-sync.d.ts +8 -2
  64. package/dist/react/mq-professional-presence-sync.js +1 -1
  65. package/dist/react/mq-query-client-provider.d.ts +9 -2
  66. package/dist/react/mq-schedule-success.d.ts +30 -7
  67. package/dist/react/mq-schedule-success.js +1 -1
  68. package/dist/react/mq-schedule.d.ts +46 -7
  69. package/dist/react/mq-schedule.js +1 -1
  70. package/dist/react/mq-session-provider.d.ts +11 -2
  71. package/dist/react/mq-socket-provider.d.ts +13 -2
  72. package/dist/react/mq-socket-provider.js +1 -1
  73. package/dist/react/mq-support-chat.d.ts +31 -2
  74. package/dist/react/mq-support-chat.js +1 -1
  75. package/dist/react/mq-terms-and-conditions.d.ts +21 -5
  76. package/dist/react/mq-terms-and-conditions.js +1 -1
  77. package/dist/react/mq-theme-provider.d.ts +13 -2
  78. package/dist/react/mq-toast-container.d.ts +10 -2
  79. package/dist/react/mq-unread-count-sync.d.ts +8 -2
  80. package/dist/react/mq-unread-count-sync.js +1 -1
  81. package/dist/react/mq-videocall.d.ts +30 -12
  82. package/dist/react/mq-videocall.js +1 -1
  83. package/package.json +5 -1
  84. package/dist/chunks/api-chat-client-CqMn2JEn.js +0 -1
  85. package/dist/chunks/telemetry-client-Ca71sobH.js +0 -1
package/README.md CHANGED
@@ -54,6 +54,7 @@ schedule?.addEventListener("back", () => {
54
54
 
55
55
  | Element | Import | Description |
56
56
  | --- | --- | --- |
57
+ | `mq-dashboard` | `@mediquo/elements/mq-dashboard` | Patient home dashboard (hero, next appointment, recent documents, support banner); emits redirect events |
57
58
  | `mq-schedule` | `@mediquo/elements/mq-schedule` | Multi-step appointment booking / reschedule |
58
59
  | `mq-schedule-success` | `@mediquo/elements/mq-schedule-success` | Post-booking confirmation screen |
59
60
  | `mq-my-appointments` | `@mediquo/elements/mq-my-appointments` | Upcoming and past appointments |
@@ -77,7 +78,7 @@ Mount these as ancestors of the features that need them:
77
78
  | `mq-theme-provider` | `@mediquo/elements/mq-theme-provider` | Always — design tokens |
78
79
  | `mq-query-client-provider` | `@mediquo/elements/mq-query-client-provider` | Data-fetching features (`mq-schedule`, `mq-chat-room`, …) |
79
80
  | `mq-socket-provider` | `@mediquo/elements/mq-socket-provider` | Realtime features (`mq-chat-room`) |
80
- | `mq-session-provider` | `@mediquo/elements/mq-session-provider` | Features that read the patient session — `mq-my-appointments`, `mq-videocall`, `mq-appointment-documentation`, background sync |
81
+ | `mq-session-provider` | `@mediquo/elements/mq-session-provider` | Features that read the patient session — `mq-dashboard`, `mq-my-appointments`, `mq-videocall`, `mq-appointment-documentation`, background sync |
81
82
 
82
83
  Set `mq-session-provider`'s `session` as a **property** (it's the login-token
83
84
  response object from your auth exchange, not a string attribute):
@@ -207,6 +208,7 @@ Shared contract (also exported from `@mediquo/elements/events`):
207
208
  | `mq-appointment-reschedule` | `{ appointmentId }` | Reschedule |
208
209
  | `mq-appointment-join-videocall` | `{ appointmentId }` | Join videocall |
209
210
  | `mq-appointment-view-documentation` | `{ appointmentId }` | Open documentation |
211
+ | `mq-view-documents` | — | Open the full documents list (from `mq-dashboard`) |
210
212
  | `mq-download-file` | `{ url, filename }` | Host should persist / download a file |
211
213
 
212
214
  Feature-specific events (e.g. `appointment-created` on `mq-schedule`) are documented per component.
@@ -0,0 +1 @@
1
+ import{p as e}from"./parseISO-Dj3qSTG8.js";import{f as t}from"./format-CRFiCNHw.js";import{z as n,o as r,s as i,n as s,e as o,a,b as l,c,r as u,u as d,d as p,f as h,l as f,g as m,i as g}from"./external-mrLCXx_f.js";import{i as b}from"./isBefore-CPpTogxo.js";import{env as y}from"../env.js";function _(t){return e(`${t.replace(" ","T")}Z`)}function v(e){const n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()));return t(n,"yyyy-MM-dd HH:mm:ss")}function w(e,t){try{const n=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"shortOffset"}).formatToParts(t);return n.find(e=>"timeZoneName"===e.type)?.value??""}catch{return""}}var E=n.enum(["pending","expired","accepted","inCall","declined","cancelled","finished","free_of_charge","owed","unpaid","reporting"]),C=E.enum,R=n.enum(["videocall","chat","phonecall"]),O=R.enum,S=n.object({id:n.string().uuid(),room_id:n.string(),channel:R,consultation_short_url:n.string().url().nullable(),call_id:n.string().url(),duration:n.number(),from:n.object({hash:n.string(),name:n.string().nullable(),avatar:n.string().url().nullable(),speciality:n.string().nullable(),collegiate_number:n.string().nullable(),is_dismissed:n.boolean(),languages:n.array(n.string()),description:n.string().nullable()}),to:n.object({id:n.number(),hash:n.string(),name:n.string().nullable(),avatar:n.string().url().nullable(),is_dismissed:n.boolean()}),speciality_id:n.number().nullable(),created_at:n.string(),status:E,seconds_to_open:n.number().nonnegative(),start_date:n.string(),started_at:n.string().nullable(),expires_at:n.string().nullable(),consultation_reason:n.string().nullable(),preconsultation_documents:n.array(n.object({file_path:n.string(),file_name:n.string(),id:n.string().uuid()})).nullable(),service_id:n.string().uuid().nullable(),price:n.number().nullable().optional(),currency:n.string().nullable().optional(),discount_amount:n.number().nullable().optional()}),A=n.enum(["appointment","chat","immediate"]),T=A.enum;function j(e){return 0===e.seconds_to_open}function x(e){if(!e)return!1;const t=new Date,n=_(e);return b(n,t)}r({consultation_id:i(),consultation_type:A,rating:s().int().min(1).max(5),comment:i().nullable().optional()});var P=r({rating:s().int().optional(),comment:i().nullable().optional()}).passthrough(),k=n.array(n.object({id:n.number(),name:n.string(),code:n.string()})),N=n.object({primary_color:n.string().nullable(),logo:n.string().nullable(),favicon:n.string().nullable(),support_professional:n.object({hash:n.string().nullable()}).optional(),home:n.object({title:n.string().nullable(),description:n.string().nullable(),image_url:n.string().nullable()}),appointments:n.object({reserve_conditions:n.string().nullable(),seconds_before_start_to_refund_on_cancel:n.number().nullable(),has_nps:n.boolean().optional(),has_chat_in_appointment:n.boolean().optional(),has_discount_coupons_show:n.boolean().optional()}),legal_consent:n.object({terms_url:n.string().nullable(),privacy_url:n.string().nullable()})}),U=o(["monday","tuesday","wednesday","thursday","friday","saturday","sunday","working_week","weekend","all_week"]);U.enum;var D=r({days_of_week:U,from_time:i(),to_time:i()});r({hash:i().uuid()});var L=r({hash:i().uuid(),active_absence:r({id:i().uuid(),finishes_at:i()}).nullable(),avatar:i().url().nullable(),collegiate_number:i().nullable(),description:i().nullable(),is_available:l(),name:i(),overview:i().nullable(),schedule_description:i().nullable(),speciality_id:s().nullable(),status:o(["online","offline"]),title:i().nullable(),chat_schedule:r({channel:R,duration:s(),name:i(),timezone:i(),starts_at:i(),gaps:a(D)}).nullable()});function F(e){return e.active_absence?"absent":"online"===e.status?"online":"offline"}o(["online","offline","absent"]),r({roomId:s()}),r({slot_id:i().uuid(),service_id:i().uuid(),specialty_id:i(),consultation_reason:i().optional(),preconsultation_documents:a(r({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var B=r({id:i(),percent_off:s(),code:i(),after_discount_amount:s().nullable()}),I=r({id:i(),percent_off:s(),code:i(),name:i().nullish()}),$=r({session_id:i(),payment_link:i().url()});r({video_call_schedule_id:i()});var M=$,q={Paid:"paid",Unpaid:"unpaid",Denied:"denied"},z=r({status:c(q),consultation_id:i(),consultation_type:i()});r({order_id:i(),validation_url:i().url()});var H=u(d());r({order_id:i(),token:i()});var J=r({data:r({status:c(q),consultation_id:i(),consultation_type:i().optional()})});r({order_id:i(),token:i()});var W=r({data:r({status:c(q),consultation_id:i(),consultation_type:i().optional()})}),V=r({hash:i(),profile:r({first_name:i().nullable(),last_name:i().nullable(),birth_date:i().nullable(),gender:o(["male","female"]).nullable(),email:i().nullable(),phone_prefix:i().nullable(),phone:i().nullable(),billing:r({tax_id:i().nullable(),address:i().nullable(),country_code:i().nullable(),region:i().nullable(),postal_code:i().nullable()})})});function K(e){const t=e?.profile;return`${t?.first_name??""} ${t?.last_name??""}`.trim()}function X(e){return[e?.profile.first_name,e?.profile.last_name,e?.profile.email,e?.profile.phone,e?.profile.birth_date,e?.profile?.billing?.tax_id].every(e=>null!==e)}var G=V;r({first_name:i(),last_name:i(),tax_id:i(),birth_date:i(),gender:o(["male","female"]),email:i(),phone_prefix:i(),phone:i(),terms_accepted:l(),privacy_accepted:l()}),r({terms_accepted:l(),privacy_accepted:l(),commercial_accepted:l()}),r({hash:i().uuid()});var Z=r({id:s(),hash:i().uuid(),speciality_alias:i(),name:i(),avatar:i().url(),description:i(),collegiate_number:i(),languages:a(i()),centers:a(r({id:i().uuid(),name:i()}))});p([f(1),f(2),f(3)]);var Q={Sent:1,Received:2,Read:3},Y=r({roomId:s(),messageId:i().uuid(),string:i(),status:s(),senderType:o(["ordinary","system"]),fromUserHash:i().uuid(),auto:p([f(0),f(1)]),createdAt:i().nullable(),deletedAt:i().nullable(),time:s().nullable()}),ee=r({file_name:i(),file_size:s(),url:i().url(),signed_url:i().url().nullable(),type:o(["uncategorized","voice_note"]),meta:r({duration:s()})}),te=Y.extend({type:f("string"),attachment:h()}),ne=Y.extend({type:f("file"),attachment:ee}),re=Y.extend({type:f("image"),attachment:ee});r({roomId:s()});var ie=a(p([te,ne,re]));r({roomId:s()});var se=r({unread_count:s()});r({professional_hash:i()});var oe=r({room_id:s()}),ae=o(["available","reserved"]),le=ae.enum,ce=r({id:i().uuid(),channel:R,duration:s(),starts_at:i(),finishes_at:i(),professional:r({id:i().uuid(),name:i()}),services:a(r({id:i().uuid(),name:i()})),speciality:r({id:s(),price:r({amount:s(),currency:i()}).nullish()}),status:ae}),ue=n.array(n.object({id:n.string().uuid(),name:n.string(),code:n.string(),channel:R,price:n.object({amount:n.number(),currency:n.string()}).nullable()})),de=n.array(n.object({id:n.string().uuid(),avatar:n.string().url().nullable(),description:n.string().nullable(),collegiate_number:n.string().nullable(),languages:n.array(n.string()),name:n.string(),slots:n.array(ce),speciality:n.object({id:n.number()}),tax_id:n.string().nullable()}));n.object({speciality_id:n.number(),organization_schedule_service_id:n.string().uuid(),closest_slots_days:n.number().optional(),slots_per_day:n.number().optional()}),n.object({service_id:n.string().uuid(),professional_hash:n.string().uuid(),starts_at:n.string(),finishes_at:n.string(),rescheduling_appointment_id:n.string().uuid().optional()});var pe=n.array(ce),he=n.array(n.object({id:n.number(),name:n.string(),code:n.string().nullish(),price:n.object({amount:n.number(),currency:n.string()}).nullable()}));n.object({slot_id:n.string().uuid(),service_id:n.string().uuid().optional(),speciality_id:n.number().optional()});var fe=ce;function me(e){return r({data:a(e),meta:r({current_page:s(),last_page:s(),per_page:s(),total:s()})})}r({status:a(E).optional(),order:r({field:o(["starts_at"]).optional(),direction:o(["asc","desc"]).optional()}).optional(),page:s().optional(),per_page:s().optional()});var ge=me(r({appointment:r({id:i().uuid(),url:i().url(),starts_at:i(),duration:s(),status:E,channel:R,expires_at:i().nullable(),service_id:i().uuid().nullable()}),room:r({id:s()}),price:r({amount:s(),currency:i()}).nullable(),patient:r({hash:i().uuid()}),slots:a(m()),professional:r({hash:i().uuid(),name:i(),avatar:i().url().optional(),description:i().optional(),languages:a(i()),collegiate_number:i().optional()}),speciality:r({id:s(),name:i()})}));r({slot_id:i().uuid(),service_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:a(r({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var be=r({appointment:r({id:i().uuid()})});r({id:i().uuid()});var ye=S,_e=r({file_path:i(),presigned_storage_url:i().url()});r({id:i().uuid(),slot_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:a(r({file_path:i(),file_name:i()})).optional()}),r({id:i().uuid()}),r({appointment_id:i().uuid(),consultation_reason:i().optional()}),r({appointment_id:i().uuid(),file_path:i(),file_name:i()}),r({appointment_id:i().uuid(),document_id:i().uuid()}),r({appointmentId:i().uuid()}),n.object({api_key:n.string(),token:n.string()});var ve=n.object({access_token:n.string(),patient:n.object({hash:n.string(),country_code:n.string(),timezone:n.string(),first_name:n.string(),last_name:n.string(),name:n.string(),birth_date:n.string(),email:n.string().email(),language_code:n.string(),phone:n.string(),phone_prefix:n.string(),tax_id:n.string(),legal_consent:n.object({accepted_at:n.string().nullable(),last_version_at:n.string().nullable(),terms_url:n.string(),privacy_url:n.string(),has_commercial_communications:n.boolean(),organization_name:n.string()})})});r({file:g(File)});var we=r({url:i().url()}),Ee=n.enum(["prescription","report","diagnosticTestPrescription"]),Ce=Ee.enum,Re=n.enum(["published","draft"]);Re.enum;var Oe=n.object({document_id:n.string().uuid(),document_type:Ee,name:n.string(),professional:n.object({speciality_id:n.number()}),status:Re,url:n.string().url(),created_at:n.string()});n.object({appointmentId:n.string()});var Se=S;n.object({callId:n.string()});var Ae=n.object({session_id:n.string(),session_token:n.string()});n.object({professional_hash:n.string(),consultation_id:n.string(),consultation_type:n.enum(["appointment"])}),n.object({professional_hash:n.string(),consultation_id:n.string(),consultation_type:n.enum(["appointment"])}),n.object({appointment_id:n.string()});var Te=n.array(Oe);n.object({url:n.string().url()}),n.object({first_name:V.shape.profile.shape.first_name,last_name:V.shape.profile.shape.last_name,tax_id:V.shape.profile.shape.billing.shape.tax_id,birth_date:V.shape.profile.shape.birth_date,gender:V.shape.profile.shape.gender.optional(),email:V.shape.profile.shape.email,phone_prefix:V.shape.profile.shape.phone_prefix,phone:V.shape.profile.shape.phone,terms_accepted:n.boolean(),privacy_accepted:n.boolean()}),n.object({patient_hash:n.string(),page:n.number().optional(),per_page:n.number().optional()});var je=me(Oe);function xe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Pe}=Object.prototype,{getPrototypeOf:ke}=Object,{iterator:Ne,toStringTag:Ue}=Symbol,De=(Le=Object.create(null),e=>{const t=Pe.call(e);return Le[t]||(Le[t]=t.slice(8,-1).toLowerCase())});var Le;const Fe=e=>(e=e.toLowerCase(),t=>De(t)===e),Be=e=>t=>typeof t===e,{isArray:Ie}=Array,$e=Be("undefined");function Me(e){return null!==e&&!$e(e)&&null!==e.constructor&&!$e(e.constructor)&&He(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qe=Fe("ArrayBuffer");const ze=Be("string"),He=Be("function"),Je=Be("number"),We=e=>null!==e&&"object"==typeof e,Ve=e=>{if("object"!==De(e))return!1;const t=ke(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Ue in e||Ne in e)},Ke=Fe("Date"),Xe=Fe("File"),Ge=Fe("Blob"),Ze=Fe("FileList"),Qe=Fe("URLSearchParams"),[Ye,et,tt,nt]=["ReadableStream","Request","Response","Headers"].map(Fe);function rt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),Ie(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Me(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let o;for(r=0;r<s;r++)o=i[r],t.call(null,e[o],o,e)}}function it(e,t){if(Me(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const st="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ot=e=>!$e(e)&&e!==st;const at=(lt="undefined"!=typeof Uint8Array&&ke(Uint8Array),e=>lt&&e instanceof lt);var lt;const ct=Fe("HTMLFormElement"),ut=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dt=Fe("RegExp"),pt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};rt(n,(n,i)=>{let s;!1!==(s=t(n,i,e))&&(r[i]=s||n)}),Object.defineProperties(e,r)};const ht=Fe("AsyncFunction"),ft=(mt="function"==typeof setImmediate,gt=He(st.postMessage),mt?setImmediate:gt?(bt=`axios@${Math.random()}`,yt=[],st.addEventListener("message",({source:e,data:t})=>{e===st&&t===bt&&yt.length&&yt.shift()()},!1),e=>{yt.push(e),st.postMessage(bt,"*")}):e=>setTimeout(e));var mt,gt,bt,yt;const _t="undefined"!=typeof queueMicrotask?queueMicrotask.bind(st):"undefined"!=typeof process&&process.nextTick||ft;var vt={isArray:Ie,isArrayBuffer:qe,isBuffer:Me,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||He(e.append)&&("formdata"===(t=De(e))||"object"===t&&He(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&qe(e.buffer),t},isString:ze,isNumber:Je,isBoolean:e=>!0===e||!1===e,isObject:We,isPlainObject:Ve,isEmptyObject:e=>{if(!We(e)||Me(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Ye,isRequest:et,isResponse:tt,isHeaders:nt,isUndefined:$e,isDate:Ke,isFile:Xe,isBlob:Ge,isRegExp:dt,isFunction:He,isStream:e=>We(e)&&He(e.pipe),isURLSearchParams:Qe,isTypedArray:at,isFileList:Ze,forEach:rt,merge:function e(){const{caseless:t}=ot(this)&&this||{},n={},r=(r,i)=>{const s=t&&it(n,i)||i;Ve(n[s])&&Ve(r)?n[s]=e(n[s],r):Ve(r)?n[s]=e({},r):Ie(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&rt(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(rt(t,(t,r)=>{n&&He(t)?e[r]=xe(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],r&&!r(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&ke(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:De,kindOfTest:Fe,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ie(e))return e;let t=e.length;if(!Je(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ne]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ct,hasOwnProperty:ut,hasOwnProp:ut,reduceDescriptors:pt,freezeMethods:e=>{pt(e,(t,n)=>{if(He(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];He(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ie(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:it,global:st,isContextDefined:ot,isSpecCompliantForm:function(e){return!!(e&&He(e.append)&&"FormData"===e[Ue]&&e[Ne])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(We(e)){if(t.indexOf(e)>=0)return;if(Me(e))return e;if(!("toJSON"in e)){t[r]=e;const i=Ie(e)?[]:{};return rt(e,(e,t)=>{const s=n(e,r+1);!$e(s)&&(i[t]=s)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:ht,isThenable:e=>e&&(We(e)||He(e))&&He(e.then)&&He(e.catch),setImmediate:ft,asap:_t,isIterable:e=>null!=e&&He(e[Ne])};function wt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}vt.inherits(wt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:vt.toJSONObject(this.config),code:this.code,status:this.status}}});const Et=wt.prototype,Ct={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ct[e]={value:e}}),Object.defineProperties(wt,Ct),Object.defineProperty(Et,"isAxiosError",{value:!0}),wt.from=(e,t,n,r,i,s)=>{const o=Object.create(Et);return vt.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),wt.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};function Rt(e){return vt.isPlainObject(e)||vt.isArray(e)}function Ot(e){return vt.endsWith(e,"[]")?e.slice(0,-2):e}function St(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ot(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const At=vt.toFlatObject(vt,{},null,function(e){return/^is[A-Z]/.test(e)});function Tt(e,t,n){if(!vt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=vt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!vt.isUndefined(t[e])})).metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&vt.isSpecCompliantForm(t);if(!vt.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(vt.isDate(e))return e.toISOString();if(vt.isBoolean(e))return e.toString();if(!a&&vt.isBlob(e))throw new wt("Blob is not supported. Use a Buffer instead.");return vt.isArrayBuffer(e)||vt.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(vt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(vt.isArray(e)&&function(e){return vt.isArray(e)&&!e.some(Rt)}(e)||(vt.isFileList(e)||vt.endsWith(n,"[]"))&&(a=vt.toArray(e)))return n=Ot(n),a.forEach(function(e,r){!vt.isUndefined(e)&&null!==e&&t.append(!0===o?St([n],r,s):null===o?n:n+"[]",l(e))}),!1;return!!Rt(e)||(t.append(St(i,n,s),l(e)),!1)}const u=[],d=Object.assign(At,{defaultVisitor:c,convertValue:l,isVisitable:Rt});if(!vt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!vt.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),vt.forEach(n,function(n,s){!0===(!(vt.isUndefined(n)||null===n)&&i.call(t,n,vt.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function jt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function xt(e,t){this._pairs=[],e&&Tt(e,this,t)}const Pt=xt.prototype;function kt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nt(e,t,n){if(!t)return e;const r=n&&n.encode||kt;vt.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(s=i?i(t,n):vt.isURLSearchParams(t)?t.toString():new xt(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}Pt.append=function(e,t){this._pairs.push([e,t])},Pt.toString=function(e){const t=e?function(t){return e.call(this,t,jt)}:jt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class InterceptorManager{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){vt.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:xt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Lt="undefined"!=typeof window&&"undefined"!=typeof document,Ft="object"==typeof navigator&&navigator||void 0,Bt=Lt&&(!Ft||["ReactNative","NativeScript","NS"].indexOf(Ft.product)<0),It="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,$t=Lt&&window.location.href||"http://localhost";var Mt={...Object.freeze({__proto__:null,hasBrowserEnv:Lt,hasStandardBrowserEnv:Bt,hasStandardBrowserWebWorkerEnv:It,navigator:Ft,origin:$t}),...Dt};function qt(e){function t(e,n,r,i){let s=e[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=e.length;if(s=!s&&vt.isArray(r)?r.length:s,a)return vt.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!o;r[s]&&vt.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],i)&&vt.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}(r[s])),!o}if(vt.isFormData(e)&&vt.isFunction(e.entries)){const n={};return vt.forEachEntry(e,(e,r)=>{t(function(e){return vt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const zt={transitional:Ut,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=vt.isObject(e);i&&vt.isHTMLForm(e)&&(e=new FormData(e));if(vt.isFormData(e))return r?JSON.stringify(qt(e)):e;if(vt.isArrayBuffer(e)||vt.isBuffer(e)||vt.isStream(e)||vt.isFile(e)||vt.isBlob(e)||vt.isReadableStream(e))return e;if(vt.isArrayBufferView(e))return e.buffer;if(vt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Tt(e,new Mt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Mt.isNode&&vt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=vt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Tt(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(vt.isString(e))try{return(t||JSON.parse)(e),vt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||zt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(vt.isResponse(e)||vt.isReadableStream(e))return e;if(e&&vt.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw wt.from(e,wt.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vt.forEach(["delete","get","head","post","put","patch"],e=>{zt.headers[e]={}});const Ht=vt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Jt=Symbol("internals");function Wt(e){return e&&String(e).trim().toLowerCase()}function Vt(e){return!1===e||null==e?e:vt.isArray(e)?e.map(Vt):String(e)}function Kt(e,t,n,r,i){return vt.isFunction(r)?r.call(this,t,n):(i&&(t=n),vt.isString(t)?vt.isString(r)?-1!==t.indexOf(r):vt.isRegExp(r)?r.test(t):void 0:void 0)}let Xt=class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=Wt(t);if(!i)throw new Error("header name must be a non-empty string");const s=vt.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Vt(e))}const s=(e,t)=>vt.forEach(e,(e,n)=>i(e,n,t));if(vt.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(vt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&Ht[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(vt.isObject(e)&&vt.isIterable(e)){let n,r,i={};for(const t of e){if(!vt.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?vt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=Wt(e)){const n=vt.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(vt.isFunction(t))return t.call(this,e,n);if(vt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wt(e)){const n=vt.findKey(this,e);return!(!n||void 0===this[n]||t&&!Kt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=Wt(e)){const i=vt.findKey(n,e);!i||t&&!Kt(0,n[i],i,t)||(delete n[i],r=!0)}}return vt.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Kt(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return vt.forEach(this,(r,i)=>{const s=vt.findKey(n,i);if(s)return t[s]=Vt(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();o!==i&&delete t[i],t[o]=Vt(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return vt.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&vt.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Jt]=this[Jt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Wt(e);t[r]||(!function(e,t){const n=vt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return vt.isArray(e)?e.forEach(r):r(e),this}};function Gt(e,t){const n=this||zt,r=t||n,i=Xt.from(r.headers);let s=r.data;return vt.forEach(e,function(e){s=e.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Zt(e){return!(!e||!e.__CANCEL__)}function Qt(e,t,n){wt.call(this,e??"canceled",wt.ERR_CANCELED,t,n),this.name="CanceledError"}function Yt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new wt("Request failed with status code "+n.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),vt.reduceDescriptors(Xt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),vt.freezeMethods(Xt),vt.inherits(Qt,wt,{__CANCEL__:!0});const en=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=r[o];i||(i=l),n[s]=a,r[s]=l;let u=o,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let n,r,i=0,s=1e3/t;const o=(t,s=Date.now())=>{i=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=s?o(e,t):(n=e,r||(r=setTimeout(()=>{r=null,o(n)},s-a)))},()=>n&&o(n)]}(n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,a=s-r,l=i(a);r=s;e({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})},n)},tn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},nn=e=>(...t)=>vt.asap(()=>e(...t));var rn=Mt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Mt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,sn=Mt.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];vt.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),vt.isString(r)&&o.push("path="+r),vt.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function on(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const an=e=>e instanceof Xt?{...e}:e;function ln(e,t){t=t||{};const n={};function r(e,t,n,r){return vt.isPlainObject(e)&&vt.isPlainObject(t)?vt.merge.call({caseless:r},e,t):vt.isPlainObject(t)?vt.merge({},t):vt.isArray(t)?t.slice():t}function i(e,t,n,i){return vt.isUndefined(t)?vt.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function s(e,t){if(!vt.isUndefined(t))return r(void 0,t)}function o(e,t){return vt.isUndefined(t)?vt.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,s){return s in t?r(n,i):s in e?r(void 0,n):void 0}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t,n)=>i(an(e),an(t),0,!0)};return vt.forEach(Object.keys({...e,...t}),function(r){const s=l[r]||i,o=s(e[r],t[r],r);vt.isUndefined(o)&&s!==a||(n[r]=o)}),n}var cn=e=>{const t=ln({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=t;if(t.headers=a=Xt.from(a),t.url=Nt(on(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),vt.isFormData(r))if(Mt.hasStandardBrowserEnv||Mt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(Mt.hasStandardBrowserEnv&&(i&&vt.isFunction(i)&&(i=i(t)),i||!1!==i&&rn(t.url))){const e=s&&o&&sn.read(o);e&&a.set(s,e)}return t};var un="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=cn(e);let i=r.data;const s=Xt.from(r.headers).normalize();let o,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Xt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Yt(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new wt("Request aborted",wt.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new wt("Network Error",wt.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Ut;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new wt(t,i.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,e,m)),m=null},void 0===i&&s.setContentType(null),"setRequestHeader"in m&&vt.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),vt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=en(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([a,c]=en(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new Qt(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===Mt.protocols.indexOf(b)?n(new wt("Unsupported protocol "+b+":",wt.ERR_BAD_REQUEST,e)):m.send(i||null)})};const dn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof wt?t:new Qt(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,i(new wt(`timeout ${t} of ms exceeded`,wt.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>vt.asap(o),a}},pn=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},hn=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},fn=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of hn(e))yield*pn(n,t)}(e,t);let s,o=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=o+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},mn="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,gn=mn&&"function"==typeof ReadableStream,bn=mn&&("function"==typeof TextEncoder?(yn=new TextEncoder,e=>yn.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var yn;const _n=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},vn=gn&&_n(()=>{let e=!1;const t=new Request(Mt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),wn=gn&&_n(()=>vt.isReadableStream(new Response("").body)),En={stream:wn&&(e=>e.body)};var Cn;mn&&(Cn=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!En[e]&&(En[e]=vt.isFunction(Cn[e])?t=>t[e]():(t,n)=>{throw new wt(`Response type '${e}' is not supported`,wt.ERR_NOT_SUPPORT,n)})}));const Rn=async(e,t)=>{const n=vt.toFiniteNumber(e.getContentLength());return n??(async e=>{if(null==e)return 0;if(vt.isBlob(e))return e.size;if(vt.isSpecCompliantForm(e)){const t=new Request(Mt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return vt.isArrayBufferView(e)||vt.isArrayBuffer(e)?e.byteLength:(vt.isURLSearchParams(e)&&(e+=""),vt.isString(e)?(await bn(e)).byteLength:void 0)})(t)};const On={http:null,xhr:un,fetch:mn&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=cn(e);c=c?(c+"").toLowerCase():"text";let h,f=dn([i,s&&s.toAbortSignal()],o);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(l&&vn&&"get"!==n&&"head"!==n&&0!==(g=await Rn(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(vt.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=tn(g,en(nn(l)));r=fn(n.body,65536,e,t)}}vt.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;h=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let s=await fetch(h,p);const o=wn&&("stream"===c||"response"===c);if(wn&&(a||o&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=s[t]});const t=vt.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&tn(t,en(nn(a),!0))||[];s=new Response(fn(s.body,65536,n,()=>{r&&r(),m&&m()}),e)}c=c||"text";let b=await En[vt.findKey(En,c)||"text"](s,e);return!o&&m&&m(),await new Promise((t,n)=>{Yt(t,n,{data:b,headers:Xt.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:h})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new wt("Network Error",wt.ERR_NETWORK,e,h),{cause:t.cause||t});throw wt.from(t,t&&t.code,e,h)}})};vt.forEach(On,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Sn=e=>`- ${e}`,An=e=>vt.isFunction(e)||null===e||!1===e;var Tn=e=>{e=vt.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!An(n)&&(r=On[(t=String(n)).toLowerCase()],void 0===r))throw new wt(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+s]=r}if(!r){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new wt("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Sn).join("\n"):" "+Sn(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function jn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qt(null,e)}function xn(e){jn(e),e.headers=Xt.from(e.headers),e.data=Gt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Tn(e.adapter||zt.adapter)(e).then(function(t){return jn(e),t.data=Gt.call(e,e.transformResponse,t),t.headers=Xt.from(t.headers),t},function(t){return Zt(t)||(jn(e),t&&t.response&&(t.response.data=Gt.call(e,e.transformResponse,t.response),t.response.headers=Xt.from(t.response.headers))),Promise.reject(t)})}const Pn="1.11.0",kn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{kn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Nn={};kn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Pn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,s)=>{if(!1===e)throw new wt(r(i," has been removed"+(t?" in "+t:"")),wt.ERR_DEPRECATED);return t&&!Nn[i]&&(Nn[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,s)}},kn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Un={assertOptions:function(e,t,n){if("object"!=typeof e)throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const t=e[s],n=void 0===t||o(t,s,e);if(!0!==n)throw new wt("option "+s+" must be "+n,wt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new wt("Unknown option "+s,wt.ERR_BAD_OPTION)}},validators:kn};const Dn=Un.validators;let Ln=class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ln(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Un.assertOptions(n,{silentJSONParsing:Dn.transitional(Dn.boolean),forcedJSONParsing:Dn.transitional(Dn.boolean),clarifyTimeoutError:Dn.transitional(Dn.boolean)},!1),null!=r&&(vt.isFunction(r)?t.paramsSerializer={serialize:r}:Un.assertOptions(r,{encode:Dn.function,serialize:Dn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Un.assertOptions(t,{baseUrl:Dn.spelling("baseURL"),withXsrfToken:Dn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=i&&vt.merge(i.common,i[t.method]);i&&vt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=Xt.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[xn.bind(this),void 0];for(e.unshift(...o),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=o.length;let p=t;for(d=0;d<u;){const e=o[d++],t=o[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{c=xn.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return Nt(on((e=ln(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};vt.forEach(["delete","get","head","options"],function(e){Ln.prototype[e]=function(t,n){return this.request(ln(n||{},{method:e,url:t,data:(n||{}).data}))}}),vt.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(ln(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ln.prototype[e]=t(),Ln.prototype[e+"Form"]=t(!0)});const Fn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fn).forEach(([e,t])=>{Fn[t]=e});const Bn=function e(t){const n=new Ln(t),r=xe(Ln.prototype.request,n);return vt.extend(r,Ln.prototype,n,{allOwnKeys:!0}),vt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ln(t,n))},r}(zt);Bn.Axios=Ln,Bn.CanceledError=Qt,Bn.CancelToken=class CancelToken{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Qt(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CancelToken(function(t){e=t}),cancel:e}}},Bn.isCancel=Zt,Bn.VERSION=Pn,Bn.toFormData=Tt,Bn.AxiosError=wt,Bn.Cancel=Bn.CanceledError,Bn.all=function(e){return Promise.all(e)},Bn.spread=function(e){return function(t){return e.apply(null,t)}},Bn.isAxiosError=function(e){return vt.isObject(e)&&!0===e.isAxiosError},Bn.mergeConfig=ln,Bn.AxiosHeaders=Xt,Bn.formToJSON=e=>qt(vt.isHTMLForm(e)?new FormData(e):e),Bn.getAdapter=Tn,Bn.HttpStatusCode=Fn,Bn.default=Bn;const{Axios:In,AxiosError:$n,CanceledError:Mn,isCancel:qn,CancelToken:zn,VERSION:Hn,all:Jn,Cancel:Wn,isAxiosError:Vn,spread:Kn,toFormData:Xn,AxiosHeaders:Gn,HttpStatusCode:Zn,formToJSON:Qn,getAdapter:Yn,mergeConfig:er}=Bn;var tr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointments(e){return this.httpClient.get("/appointments/v1",{params:e}).then(this.validate(ge))}async createAppointment(e){return this.httpClient.post(`/appointments/v1/slots/${e.slot_id}`,e).then(e=>e.data).then(this.validate(be))}async getAppointment(e){return this.httpClient.get(`/api/v1/appointments/${e.id}`).then(e=>e.data).then(this.validate(ye))}async getDocumentsStorage(){return this.httpClient.get("/appointments/v1/documents/storage").then(e=>e.data).then(this.validate(_e))}async rescheduleAppointment(e){const{id:t,...n}=e;return this.httpClient.put(`/appointments/v1/${t}/reschedule`,n)}async cancelAppointment(e){return this.httpClient.put(`/appointments/v1/${e.id}/cancel`)}async updateAppointment(e){const{appointment_id:t,...n}=e;return this.httpClient.put(`/appointments/v1/${t}/update`,n)}async addDocument(e){const{appointment_id:t,...n}=e;return this.httpClient.post(`/appointments/v1/${t}/consultation-document`,n)}async deleteDocument(e){return this.httpClient.delete(`/appointments/v1/${e.appointment_id}/consultation-document/${e.document_id}`)}async reconnectAppointment(e){return this.httpClient.put(`/appointments/v1/${e.appointmentId}/reconnect`)}},nr=class{constructor(e,t){this.httpClient=e,this.validate=t}async loginToken(e){return this.httpClient.post("/login/v1/token",{token:e.token},{headers:{"x-api-key":e.api_key}}).then(this.validate(ve))}};var rr=class{constructor(e,t){this.httpClient=e,this.validate=t}async postReview(e){return this.httpClient.post("/consultations/v1/review",e)}async getReview(e){return this.httpClient.get(`/consultations/v1/review/${e}`).then(e=>e.data).then(this.validate(P))}},ir=class{constructor(e,t){this.httpClient=e,this.validate=t}async uploadFile(e){const t=new FormData;return t.append("file",e.file,e.file.name),this.httpClient.post("/documents/v1/upload-file",t,{headers:{"Content-Type":"multipart/form-data"}}).then(this.validate(we))}},sr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointment(e){return this.httpClient.get(`/flash/v1/appointments/${e.appointmentId}`).then(e=>e.data).then(this.validate(Se))}async joinCall(e){return this.httpClient.get(`/flash/v1/calls/${e.callId}/join`).then(e=>e.data).then(this.validate(Ae))}async setReady(e){return this.httpClient.post(`/flash/v1/waiting/${e.professional_hash}/ready`,{consultation_id:e.consultation_id,consultation_type:e.consultation_type})}async leaveWaitingRoom(e){return this.httpClient.post(`/flash/v1/waiting/${e.professional_hash}/leave`,{consultation_id:e.consultation_id,consultation_type:e.consultation_type})}async getSharedDocuments(e){return this.httpClient.get(`/flash/v1/appointments/${e.appointment_id}/documents`).then(e=>e.data).then(this.validate(Te))}async downloadDocument(e){return this.httpClient.get(e.url,{responseType:"blob"}).then(e=>e.data)}async updatePatientProfile(e){return this.httpClient.put("/flash/v1/profile",e)}async getPatientDocuments(e){return this.httpClient.get(`/flash/v1/patients/${e.patient_hash}/documents`,{params:{page:e.page,per_page:e.per_page}}).then(this.validate(je))}},or=class{constructor(e,t){this.httpClient=e,this.validate=t}async getOrganizationSpecialties(){return this.httpClient.get("/organizations/v1/specialities").then(e=>e.data).then(this.validate(k))}async getOrganizationSetup(){return this.httpClient.get("/organizations/v1/setup").then(e=>e.data).then(this.validate(N))}},ar=class{constructor(e,t){this.httpClient=e,this.validate=t}async createPaymentLink(e){const{specialty_id:t,...n}=e,r={...n,speciality_id:t};return this.httpClient.post("/payments/v1/schedule",r).then(e=>e.data).then(this.validate($))}async createImmediateVideocallPaymentLink(e){return this.httpClient.post("/payments/v1/immediate-videocall",e).then(e=>e.data).then(this.validate(M))}async getConsultationCoupon(e,t){return this.httpClient.get(`/payments/v1/consultation-coupon/${encodeURIComponent(e)}`,{params:{amount:t}}).then(e=>e.data).then(this.validate(B))}async getAppointmentConsultationCoupon(e){return this.httpClient.get(`/payments/v1/appointment/${encodeURIComponent(e)}/consultation-coupon`).then(e=>e.data).then(this.validate(I))}async getPaymentSession(e){return this.httpClient.get(`/payments/v1/session/${e}`).then(e=>e.data).then(this.validate(z))}async validateApplePayMerchant(e){return this.httpClient.post("/payments/v1/apple-pay/validate-merchant",e).then(this.validate(H))}async authorizeApplePay(e){return this.httpClient.post("/payments/v1/apple-pay/authorize",e).then(this.validate(J))}async authorizeGooglePay(e){return this.httpClient.post("/payments/v1/google-pay/authorize",e).then(this.validate(W))}},lr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getProfessional(e){return this.httpClient.get(`sdk/v1/professionals/${e.hash}`).then(e=>e.data).then(this.validate(L))}async readAllMessages(e){return this.httpClient.put(`sdk/v1/rooms/${e.roomId}/messages/read`).then(e=>e.data)}},cr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getPatientProfile(){return this.httpClient.get("/profile/v1/patients").then(e=>e.data).then(this.validate(G))}async getProfessionalPublicProfile(e){return this.httpClient.get(`/profile/v1/public/professionals/${e.hash}`).then(e=>e.data).then(this.validate(Z))}async acceptLegalConsent(e){return this.httpClient.post("/profile/v1/legal-consent",e)}},ur=class{constructor(e,t){this.httpClient=e,this.validate=t}async getRoomMessages(e){return this.httpClient.get(`api/v1/rooms/${e.roomId}/messages`).then(e=>e.data).then(this.validate(ie))}async getUnreadMessagesCount(e){return this.httpClient.get(`chat/v1/${e.roomId}/unread-count`).then(e=>e.data).then(this.validate(se))}async createSupportRoom(e){return this.httpClient.post("chat/v1/support-room",e).then(e=>e.data).then(this.validate(oe))}},dr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getScheduleServices(){return this.httpClient.get("/schedules/v1/services").then(e=>e.data).then(this.validate(ue))}async getProfessionalsBySpecialtyAndService(e){return this.httpClient.get("/schedules/v1/professionals",{params:e}).then(e=>e.data).then(this.validate(de))}async getScheduleServiceProfessionalSlots(e){return this.httpClient.get(`/schedules/v1/services/${e.service_id}/professionals/${e.professional_hash}/slots`,{params:{starts_at:e.starts_at,finishes_at:e.finishes_at,rescheduling_appointment_id:e.rescheduling_appointment_id}}).then(e=>e.data).then(this.validate(pe))}async getScheduleServiceSpecialities(e){return this.httpClient.get(`/schedules/v1/services/${e}/specialities`).then(e=>e.data).then(this.validate(he))}async getScheduleSlot(e){return this.httpClient.get(`schedules/v1/slot/${e.slot_id}`,{params:{service_id:e.service_id,speciality_id:e.speciality_id}}).then(e=>e.data).then(this.validate(fe))}};var pr={development:"https://chat-dev.mediquo.com",production:"https://chat.mediquo.com"},hr=class{constructor({env:e="production",baseURL:t,debug:n}={}){const r=t??pr[e];var i;this.httpClient=(i=r,Bn.create({baseURL:i,headers:{"Content-Type":"application/json"}}));const s=(o={debug:n},e=>t=>{const n=e.safeParse(t.data);if(n.error&&o?.debug){const e=t.config?.url??"";console.warn(`[Validation Error]${e?` - URL: ${e}`:""}\n${r=n.error,r.issues.map(e=>`${e.path.join(".")}: ${e.message}`).join("\n")}`)}var r;return n.data??t.data});var o;this.flash=new sr(this.httpClient,s),this.auth=new nr(this.httpClient,s),this.appointments=new tr(this.httpClient,s),this.payments=new ar(this.httpClient,s),this.schedules=new dr(this.httpClient,s),this.organizations=new or(this.httpClient,s),this.profile=new cr(this.httpClient,s),this.professionals=new lr(this.httpClient,s),this.rooms=new ur(this.httpClient,s),this.documents=new ir(this.httpClient,s),this.consultations=new rr(this.httpClient,s)}setAuthToken(e){this.httpClient.defaults.headers.common.Authorization=`Bearer ${e}`}setApiKey(e){this.httpClient.defaults.headers.common["x-api-key"]=e}setLanguage(e){this.httpClient.defaults.headers.common["Accept-Language"]=e}};let fr=null,mr=null;const gr=new Proxy({},{get:(e,t)=>(fr&&mr===y.MODE||(fr=new hr({env:y.MODE,debug:"development"===y.MODE}),mr=y.MODE),fr)[t]});export{O as A,T as C,Ce as D,Q as M,q as P,le as S,gr as a,w as b,F as c,C as d,Vn as e,v as f,_ as g,K as h,x as i,X as j,j as k};
@@ -1 +1 @@
1
- import{P as n}from"./api-chat-client-CqMn2JEn.js";function e(e,r,t){return e===n.Paid?{kind:"success",sessionId:t,reference:r}:e===n.Denied?{kind:"denied",sessionId:t}:{kind:"error",reason:"authorize"}}function r(n){const e=n.merchant_session;return null===e||"object"!=typeof e||Array.isArray(e)?n:e}function t(n){if("string"==typeof n)return n;if(null!==n&&"object"==typeof n&&"paymentData"in n){const e=n.paymentData;if("string"==typeof e)return e;if(null!=e)return JSON.stringify(e)}return JSON.stringify(n)}export{e as r,t as s,r as u};
1
+ import{P as n}from"./api-chat-client-vbjgaIRV.js";function e(e,r,t){return e===n.Paid?{kind:"success",sessionId:t,reference:r}:e===n.Denied?{kind:"denied",sessionId:t}:{kind:"error",reason:"authorize"}}function r(n){const e=n.merchant_session;return null===e||"object"!=typeof e||Array.isArray(e)?n:e}function t(n){if("string"==typeof n)return n;if(null!==n&&"object"==typeof n&&"paymentData"in n){const e=n.paymentData;if("string"==typeof e)return e;if(null!=e)return JSON.stringify(e)}return JSON.stringify(n)}export{e as r,t as s,r as u};
@@ -0,0 +1,398 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement } from 'lit';
4
+ import { z } from 'zod';
5
+ import './appointment-details-DpzdYLjq.js';
6
+ import '../ui/mq-card.js';
7
+ import './professional-overview-mO3tuMuH.js';
8
+ import { L as LoginTokenResponse } from './schemas.d-5LR6aN9I.js';
9
+ import './mq-chat-room-DuG4RuIp.js';
10
+ import '../ui/mq-floating-bubble.js';
11
+ import { P as PriceInCents } from './price.d-CwLosdAN.js';
12
+ import '../ui/mq-button.js';
13
+ import '../ui/mq-dialog.js';
14
+ import { QueryClient } from '@tanstack/query-core';
15
+ import '../ui/mq-unread-badge.js';
16
+
17
+ declare const GetAppointmentsResponseSchema: z.ZodObject<{
18
+ data: z.ZodArray<z.ZodObject<{
19
+ appointment: z.ZodObject<{
20
+ id: z.ZodString;
21
+ url: z.ZodString;
22
+ starts_at: z.ZodString;
23
+ duration: z.ZodNumber;
24
+ status: z.ZodEnum<["pending", "expired", "accepted", "inCall", "declined", "cancelled", "finished", "free_of_charge", "owed", "unpaid", "reporting"]>;
25
+ channel: z.ZodEnum<["videocall", "chat", "phonecall"]>;
26
+ expires_at: z.ZodNullable<z.ZodString>;
27
+ service_id: z.ZodNullable<z.ZodString>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ url: string;
30
+ status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
31
+ id: string;
32
+ channel: "videocall" | "chat" | "phonecall";
33
+ duration: number;
34
+ expires_at: string | null;
35
+ service_id: string | null;
36
+ starts_at: string;
37
+ }, {
38
+ url: string;
39
+ status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
40
+ id: string;
41
+ channel: "videocall" | "chat" | "phonecall";
42
+ duration: number;
43
+ expires_at: string | null;
44
+ service_id: string | null;
45
+ starts_at: string;
46
+ }>;
47
+ room: z.ZodObject<{
48
+ id: z.ZodNumber;
49
+ }, "strip", z.ZodTypeAny, {
50
+ id: number;
51
+ }, {
52
+ id: number;
53
+ }>;
54
+ price: z.ZodNullable<z.ZodObject<{
55
+ amount: z.ZodNumber;
56
+ currency: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ currency: string;
59
+ amount: number;
60
+ }, {
61
+ currency: string;
62
+ amount: number;
63
+ }>>;
64
+ patient: z.ZodObject<{
65
+ hash: z.ZodString;
66
+ }, "strip", z.ZodTypeAny, {
67
+ hash: string;
68
+ }, {
69
+ hash: string;
70
+ }>;
71
+ slots: z.ZodArray<z.ZodAny, "many">;
72
+ professional: z.ZodObject<{
73
+ hash: z.ZodString;
74
+ name: z.ZodString;
75
+ avatar: z.ZodOptional<z.ZodString>;
76
+ description: z.ZodOptional<z.ZodString>;
77
+ languages: z.ZodArray<z.ZodString, "many">;
78
+ collegiate_number: z.ZodOptional<z.ZodString>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ hash: string;
81
+ name: string;
82
+ languages: string[];
83
+ avatar?: string | undefined;
84
+ collegiate_number?: string | undefined;
85
+ description?: string | undefined;
86
+ }, {
87
+ hash: string;
88
+ name: string;
89
+ languages: string[];
90
+ avatar?: string | undefined;
91
+ collegiate_number?: string | undefined;
92
+ description?: string | undefined;
93
+ }>;
94
+ speciality: z.ZodObject<{
95
+ id: z.ZodNumber;
96
+ name: z.ZodString;
97
+ }, "strip", z.ZodTypeAny, {
98
+ id: number;
99
+ name: string;
100
+ }, {
101
+ id: number;
102
+ name: string;
103
+ }>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ speciality: {
106
+ id: number;
107
+ name: string;
108
+ };
109
+ price: {
110
+ currency: string;
111
+ amount: number;
112
+ } | null;
113
+ appointment: {
114
+ url: string;
115
+ status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
116
+ id: string;
117
+ channel: "videocall" | "chat" | "phonecall";
118
+ duration: number;
119
+ expires_at: string | null;
120
+ service_id: string | null;
121
+ starts_at: string;
122
+ };
123
+ room: {
124
+ id: number;
125
+ };
126
+ patient: {
127
+ hash: string;
128
+ };
129
+ slots: any[];
130
+ professional: {
131
+ hash: string;
132
+ name: string;
133
+ languages: string[];
134
+ avatar?: string | undefined;
135
+ collegiate_number?: string | undefined;
136
+ description?: string | undefined;
137
+ };
138
+ }, {
139
+ speciality: {
140
+ id: number;
141
+ name: string;
142
+ };
143
+ price: {
144
+ currency: string;
145
+ amount: number;
146
+ } | null;
147
+ appointment: {
148
+ url: string;
149
+ status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
150
+ id: string;
151
+ channel: "videocall" | "chat" | "phonecall";
152
+ duration: number;
153
+ expires_at: string | null;
154
+ service_id: string | null;
155
+ starts_at: string;
156
+ };
157
+ room: {
158
+ id: number;
159
+ };
160
+ patient: {
161
+ hash: string;
162
+ };
163
+ slots: any[];
164
+ professional: {
165
+ hash: string;
166
+ name: string;
167
+ languages: string[];
168
+ avatar?: string | undefined;
169
+ collegiate_number?: string | undefined;
170
+ description?: string | undefined;
171
+ };
172
+ }>, "many">;
173
+ meta: z.ZodObject<{
174
+ current_page: z.ZodNumber;
175
+ last_page: z.ZodNumber;
176
+ per_page: z.ZodNumber;
177
+ total: z.ZodNumber;
178
+ }, "strip", z.ZodTypeAny, {
179
+ current_page: number;
180
+ last_page: number;
181
+ per_page: number;
182
+ total: number;
183
+ }, {
184
+ current_page: number;
185
+ last_page: number;
186
+ per_page: number;
187
+ total: number;
188
+ }>;
189
+ }, "strip", z.ZodTypeAny, {
190
+ data: {
191
+ speciality: {
192
+ id: number;
193
+ name: string;
194
+ };
195
+ price: {
196
+ currency: string;
197
+ amount: number;
198
+ } | null;
199
+ appointment: {
200
+ url: string;
201
+ status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
202
+ id: string;
203
+ channel: "videocall" | "chat" | "phonecall";
204
+ duration: number;
205
+ expires_at: string | null;
206
+ service_id: string | null;
207
+ starts_at: string;
208
+ };
209
+ room: {
210
+ id: number;
211
+ };
212
+ patient: {
213
+ hash: string;
214
+ };
215
+ slots: any[];
216
+ professional: {
217
+ hash: string;
218
+ name: string;
219
+ languages: string[];
220
+ avatar?: string | undefined;
221
+ collegiate_number?: string | undefined;
222
+ description?: string | undefined;
223
+ };
224
+ }[];
225
+ meta: {
226
+ current_page: number;
227
+ last_page: number;
228
+ per_page: number;
229
+ total: number;
230
+ };
231
+ }, {
232
+ data: {
233
+ speciality: {
234
+ id: number;
235
+ name: string;
236
+ };
237
+ price: {
238
+ currency: string;
239
+ amount: number;
240
+ } | null;
241
+ appointment: {
242
+ url: string;
243
+ status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
244
+ id: string;
245
+ channel: "videocall" | "chat" | "phonecall";
246
+ duration: number;
247
+ expires_at: string | null;
248
+ service_id: string | null;
249
+ starts_at: string;
250
+ };
251
+ room: {
252
+ id: number;
253
+ };
254
+ patient: {
255
+ hash: string;
256
+ };
257
+ slots: any[];
258
+ professional: {
259
+ hash: string;
260
+ name: string;
261
+ languages: string[];
262
+ avatar?: string | undefined;
263
+ collegiate_number?: string | undefined;
264
+ description?: string | undefined;
265
+ };
266
+ }[];
267
+ meta: {
268
+ current_page: number;
269
+ last_page: number;
270
+ per_page: number;
271
+ total: number;
272
+ };
273
+ }>;
274
+ type GetAppointmentsResponse = z.infer<typeof GetAppointmentsResponseSchema>;
275
+
276
+ declare class CancelAppointmentConfirmationDialog extends LitElement {
277
+ static styles: lit.CSSResult;
278
+ open: boolean;
279
+ queryClientContext: QueryClient | undefined;
280
+ appointmentId: string;
281
+ price?: PriceInCents;
282
+ private cancelAppointmentMutation;
283
+ private handleClose;
284
+ private handleDismissClick;
285
+ private handleConfirmClick;
286
+ render(): lit_html.TemplateResult<1>;
287
+ }
288
+ declare global {
289
+ interface HTMLElementTagNameMap {
290
+ "cancel-appointment-confirmation-dialog": CancelAppointmentConfirmationDialog;
291
+ }
292
+ }
293
+
294
+ /**
295
+ * Informational dialog shown when an appointment action (modify, cancel,
296
+ * repeat) is currently unavailable. Purely presentational: the parent owns
297
+ * the copy (already translated) and decides when to open it.
298
+ *
299
+ * Usage:
300
+ * <appointment-action-unavailable-dialog
301
+ * .open=${true}
302
+ * .heading=${"Anular cita"}
303
+ * .message=${"Lo sentimos, ..."}
304
+ * @close=${() => { ... }}
305
+ * ></appointment-action-unavailable-dialog>
306
+ */
307
+ declare class AppointmentActionUnavailableDialog extends LitElement {
308
+ static styles: lit.CSSResult;
309
+ open: boolean;
310
+ heading: string;
311
+ message: string;
312
+ private handleClose;
313
+ render(): lit_html.TemplateResult<1>;
314
+ }
315
+ declare global {
316
+ interface HTMLElementTagNameMap {
317
+ "appointment-action-unavailable-dialog": AppointmentActionUnavailableDialog;
318
+ }
319
+ }
320
+
321
+ type RepeatTarget = {
322
+ specialty: string;
323
+ service: string;
324
+ };
325
+ /**
326
+ * Action buttons block for an appointment card.
327
+ *
328
+ * The modify / cancel / repeat actions are ALWAYS rendered with a normal
329
+ * (enabled) appearance. When the corresponding action is currently
330
+ * unavailable, clicking it opens an informational dialog explaining why
331
+ * instead of executing the action — and no telemetry is tracked for that
332
+ * blocked click.
333
+ *
334
+ * Chat toggle and cancel-confirmation are owned by the parent card, so this
335
+ * element only emits `toggle-chat` and `request-cancel` for those.
336
+ */
337
+ declare class AppointmentCardActions extends LitElement {
338
+ static styles: lit.CSSResult;
339
+ loginToken: LoginTokenResponse;
340
+ variant: "next" | "history";
341
+ appointmentId: string;
342
+ isVideocall: boolean;
343
+ hasChatSupport: boolean;
344
+ unreadCount: number;
345
+ isModifyUnavailable: boolean;
346
+ isCancelUnavailable: boolean;
347
+ hasNoSlots: boolean;
348
+ modifyUnavailableMessage: string;
349
+ cancelUnavailableMessage: string;
350
+ repeatTarget: RepeatTarget | null;
351
+ professionalHash: string;
352
+ private openDialog;
353
+ private get patientHash();
354
+ private renderChatButton;
355
+ private handleModifyClick;
356
+ private handleCancelClick;
357
+ private handleRepeatClick;
358
+ private renderNextActions;
359
+ private renderHistoryActions;
360
+ private handleDialogClose;
361
+ render(): lit_html.TemplateResult<1>;
362
+ }
363
+ declare global {
364
+ interface HTMLElementTagNameMap {
365
+ "appointment-card-actions": AppointmentCardActions;
366
+ }
367
+ }
368
+
369
+ declare class AppointmentCard extends LitElement {
370
+ static styles: lit.CSSResult;
371
+ appointmentResource: GetAppointmentsResponse["data"][number];
372
+ specialtyId: number;
373
+ variant: "next" | "history";
374
+ detailsVariant: "default" | "wide";
375
+ loginToken: LoginTokenResponse;
376
+ private isChatOpen;
377
+ private isCancelDialogOpen;
378
+ private unreadQuery;
379
+ private getOrganizationSpecialtiesQuery;
380
+ private getOrganizationSetupQuery;
381
+ private getScheduleServicesQuery;
382
+ render(): lit_html.TemplateResult<1>;
383
+ }
384
+ declare global {
385
+ interface HTMLElementTagNameMap {
386
+ "appointment-card": AppointmentCard;
387
+ }
388
+ }
389
+
390
+ declare class AppointmentCardSkeleton extends LitElement {
391
+ static styles: lit.CSSResult;
392
+ render(): lit_html.TemplateResult<1>;
393
+ }
394
+ declare global {
395
+ interface HTMLElementTagNameMap {
396
+ "appointment-card-skeleton": AppointmentCardSkeleton;
397
+ }
398
+ }
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{c as i}from"./consume-CovVqBjI.js";import{m as a,s as o}from"./runtime-Bg1WXVCx.js";import{l as n}from"./localized-decorator-BlOuLhym.js";import{Q as s}from"./query-controller-BlO1Ax65.js";import{g as p}from"./get-organization-setup-query-BMbuRi6v.js";import{g as r,a as l}from"./i18n-formats-DYS91YEa.js";import{g as c,c as d}from"./refund-cancel-policy-Bl9qE8wD.js";import{g as h}from"./chunk-GZF3YFSX-BzloXkVp.js";import{a as m,i as u,x as g,E as v}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{r as y}from"./state-LQivXIgA.js";import{getLocale as b}from"../i18n.js";import{a as $,A as C,i as x}from"./api-chat-client-vbjgaIRV.js";import{h as q,f as w}from"./price-CdF63nRC.js";import"../ui/mq-card.js";import"./professional-overview-CfjgnTw4.js";import{l as k}from"./chunk-S5RWG6G2-DPesx3Od.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import{Q as j}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as S}from"./mutation-controller-CR2qcqhH.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{t as R,j as D,k as I,l as M,n as O,o as E,p as z}from"./telemetry-client-BLJVs9me.js";import{e as A}from"./class-map-Co76I6aw.js";import{MqAppointmentRescheduleEvent as U,MqAppointmentBookEvent as _,MqAppointmentJoinVideocallEvent as H,MqAppointmentViewDocumentationEvent as N}from"../events.js";import{messageBubbleIcon as T}from"../ui/icons/message-bubble-icon.js";import{videoIcon as B}from"../ui/icons/video-icon.js";import"../ui/mq-unread-badge.js";import{toast as P}from"../ui/mq-toast.js";function Q(t,e){return{queryKey:["appointments",e],queryFn:()=>t.appointments.getAppointments(e)}}let V=class CancelAppointmentConfirmationDialog extends m{constructor(){super(...arguments),this.open=!1,this.cancelAppointmentMutation=new S(this,{mutationFn:async t=>$.appointments.cancelAppointment(t),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=u`: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 t=b(),e=this.price,i=q(e),o=this.cancelAppointmentMutation.isPending;if(i){const i=w(e,t),n=`-${i}`;return g`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${a("Confirmar cancelación")}</h2><p slot="subheading" class="subheading-payable">${a("¿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>${a("Importe pagado")}</span> <span>${i}</span></div><div class="price-row"><span>${a("Importe a devolver")}</span> <span>${n}</span></div></div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${a("Volver")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${a("Confirmar")}</mq-button></div></div></mq-dialog>`}return g`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${a("Confirmar cancelación")}</h2><p slot="subheading">${a("¿Seguro que quieres cancelar esta cita?")}</p><div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${a("Cancelar")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${a("Confirmar")}</mq-button></div></div></mq-dialog>`}};t([f({type:Boolean,reflect:!0})],V.prototype,"open",void 0),t([i({context:j,subscribe:!0})],V.prototype,"queryClientContext",void 0),t([f({type:String})],V.prototype,"appointmentId",void 0),t([f({type:Object})],V.prototype,"price",void 0),V=t([n(),e("cancel-appointment-confirmation-dialog")],V);let F=class AppointmentActionUnavailableDialog extends m{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=u`: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 g`<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}">${a("Volver")}</mq-button></div></mq-dialog>`}};t([f({type:Boolean,reflect:!0})],F.prototype,"open",void 0),t([f({type:String})],F.prototype,"heading",void 0),t([f({type:String})],F.prototype,"message",void 0),F=t([n(),e("appointment-action-unavailable-dialog")],F);let L=class AppointmentCardActions extends m{constructor(){super(...arguments),this.variant="next",this.isVideocall=!1,this.hasChatSupport=!1,this.unreadCount=0,this.isModifyUnavailable=!1,this.isCancelUnavailable=!1,this.hasNoSlots=!1,this.modifyUnavailableMessage="",this.cancelUnavailableMessage="",this.repeatTarget=null,this.professionalHash="",this.openDialog=null,this.handleModifyClick=()=>{this.isModifyUnavailable?this.openDialog="modify":(R.track(D(this.patientHash,this.appointmentId)),this.dispatchEvent(new U({appointmentId:this.appointmentId})))},this.handleCancelClick=()=>{this.isCancelUnavailable?this.openDialog="cancel":(R.track(I(this.patientHash,this.appointmentId)),this.dispatchEvent(new CustomEvent("request-cancel",{bubbles:!0,composed:!0})))},this.handleRepeatClick=()=>{this.hasNoSlots?this.openDialog="repeat-no-slots":this.repeatTarget?(R.track(M(this.patientHash,this.appointmentId)),this.dispatchEvent(new _({specialty:this.repeatTarget.specialty,service:this.repeatTarget.service,professional:this.professionalHash}))):this.openDialog="repeat-error"},this.handleDialogClose=()=>{this.openDialog=null}}static{this.styles=u`:host{display:contents}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}get patientHash(){return this.loginToken.patient.hash}renderChatButton(){return g`<mq-button variant="primary" fullwidth noPadding @click="${()=>{this.dispatchEvent(new CustomEvent("toggle-chat",{bubbles:!0,composed:!0}))}}">${T({size:24})} ${a("Chat")} ${this.unreadCount>0?g`<mq-unread-badge></mq-unread-badge>`:v}</mq-button>`}renderNextActions(){return g`${this.isVideocall?g`<mq-button variant="outline" fullwidth noPadding @click="${()=>{R.track(O(this.patientHash,this.appointmentId)),this.dispatchEvent(new H({appointmentId:this.appointmentId}))}}">${B({size:24})} ${a("Ir a videollamada")}</mq-button>`:v}<div class="actions-secondary">${this.hasChatSupport?this.renderChatButton():v}<mq-button variant="outline" fullwidth noPadding @click="${this.handleModifyClick}">${a("Modificar")}</mq-button><mq-button variant="outline-negative" fullwidth noPadding @click="${this.handleCancelClick}">${a("Cancelar")}</mq-button></div>`}renderHistoryActions(){return g`${this.hasChatSupport?this.renderChatButton():v}<mq-button variant="outline" fullwidth noPadding @click="${()=>{R.track(E(this.patientHash,this.appointmentId)),this.dispatchEvent(new N({appointmentId:this.appointmentId}))}}">${a("Documentos")}</mq-button><mq-button variant="outline" fullwidth noPadding @click="${this.handleRepeatClick}">${a("Repetir")}</mq-button>`}render(){return g`<div class="${A({actions:!0,next:"next"===this.variant})}">${"next"===this.variant?this.renderNextActions():this.renderHistoryActions()}</div><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${a("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${a("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-no-slots"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Este profesional no tiene horarios disponibles")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-error"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Lo sentimos, no hemos podido repetir tu cita. Por favor, contacta con soporte.")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog>`}};function G(t){const{action:e,refundPolicySeconds:i}=t,n=null!=i&&i<3600,s=Math.ceil((i??0)/60),p=Math.ceil((i??0)/3600);return a(0===(n?s:p)?"modify"===e?"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"===e?n?o`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos modificarla.`:o`Lo sentimos, como faltan menos de ${p} horas para tu cita no podemos modificarla.`:n?o`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos anularla.`:o`Lo sentimos, como faltan menos de ${p} horas para tu cita no podemos anularla.`)}t([i({context:k})],L.prototype,"loginToken",void 0),t([f({type:String})],L.prototype,"variant",void 0),t([f({type:String})],L.prototype,"appointmentId",void 0),t([f({type:Boolean})],L.prototype,"isVideocall",void 0),t([f({type:Boolean})],L.prototype,"hasChatSupport",void 0),t([f({type:Number})],L.prototype,"unreadCount",void 0),t([f({type:Boolean})],L.prototype,"isModifyUnavailable",void 0),t([f({type:Boolean})],L.prototype,"isCancelUnavailable",void 0),t([f({type:Boolean})],L.prototype,"hasNoSlots",void 0),t([f({type:String})],L.prototype,"modifyUnavailableMessage",void 0),t([f({type:String})],L.prototype,"cancelUnavailableMessage",void 0),t([f({type:Object})],L.prototype,"repeatTarget",void 0),t([f({type:String})],L.prototype,"professionalHash",void 0),t([y()],L.prototype,"openDialog",void 0),L=t([n(),e("appointment-card-actions")],L);let X=class AppointmentCard extends m{constructor(){super(...arguments),this.variant="next",this.detailsVariant="wide",this.isChatOpen=!1,this.isCancelDialogOpen=!1,this.unreadQuery=new s(this,()=>h($,{roomId:this.appointmentResource?.room?.id})),this.getOrganizationSpecialtiesQuery=new s(this,()=>r($,{enabled:!!this.appointmentResource?.speciality?.id})),this.getOrganizationSetupQuery=new s(this,()=>p($)),this.getScheduleServicesQuery=new s(this,()=>c($))}static{this.styles=u`:host{display:flex}.card{width:100%;padding:var(--sp-6);display:flex;flex-direction:column;gap:var(--sp-4);justify-content:space-between}.card-top-content{display:flex;flex-direction:column;gap:var(--sp-6)}.see-details{color:var(--color-primary-link-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.see-details:hover{text-decoration:underline}.chevron-down{width:16px;height:16px;transition:transform .2s ease}.appointment-details{display:flex;flex-direction:column;gap:12px}.clock-icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.clock-icon-wrapper svg{width:100%;height:100%}.appointment-type{display:flex;align-items:center;gap:12px;font-size:18px;color:#2c3e50}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}render(){const t=this.appointmentResource.appointment.channel===C.videocall,e=this.appointmentResource.appointment.channel===C.phonecall,i=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,o=(t||e)&&i,n=b(),s=x(this.appointmentResource.appointment.expires_at),p=0===this.appointmentResource.slots.length,r=this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel,c=d({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:r}),h=s||p||!c,m=s||!c,u=G({action:"modify",refundPolicySeconds:r}),f=G({action:"cancel",refundPolicySeconds:r}),y=this.getOrganizationSpecialtiesQuery.result?.data?.find(t=>Number(t.id)===Number(this.appointmentResource.speciality.id)),$=l(y?.code??"",n,y?.name??this.appointmentResource.speciality.name),q=this.getScheduleServicesQuery.result?.data?.find(t=>t.id===this.appointmentResource.appointment.service_id)?.code,w=y?.code&&q?{specialty:y.code,service:q}:null;return g`<mq-card class="card" roundness="md"><div class="card-top-content"><professional-overview .specialtyName="${$??""}" .collegiateNumber="${this.appointmentResource.professional.collegiate_number??void 0}" .description="${this.appointmentResource.professional.description??""}" .languages="${this.appointmentResource.professional.languages}" .avatar="${this.appointmentResource.professional.avatar??""}" .name="${this.appointmentResource.professional.name}"></professional-overview><appointment-details .startsAt="${this.appointmentResource.appointment.starts_at}" .duration="${this.appointmentResource.appointment.duration}" .channel="${this.appointmentResource.appointment.channel}" .timezone="${this.loginToken?.patient?.timezone}" variant="${this.detailsVariant}"></appointment-details></div><appointment-card-actions .variant="${this.variant}" .appointmentId="${this.appointmentResource.appointment.id??""}" .isVideocall="${t}" .hasChatSupport="${o}" .unreadCount="${this.unreadQuery.result?.data?.unread_count??0}" .isModifyUnavailable="${h}" .isCancelUnavailable="${m}" .hasNoSlots="${p}" .modifyUnavailableMessage="${u}" .cancelUnavailableMessage="${f}" .repeatTarget="${w}" .professionalHash="${this.appointmentResource.professional.hash}" @toggle-chat="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&R.track(z(this.loginToken.patient.hash,this.appointmentResource.appointment.id??""))}}" @request-cancel="${()=>{this.isCancelDialogOpen=!0}}"></appointment-card-actions><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?g`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.loginToken.access_token}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${this.appointmentResource.professional.hash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}" ?readonly="${s}"></mq-chat-room>`:v}</mq-floating-bubble><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,P.success(a("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentResource.appointment.id}}))}}"></cancel-appointment-confirmation-dialog></mq-card>`}};t([f({type:Object})],X.prototype,"appointmentResource",void 0),t([f({type:Number})],X.prototype,"specialtyId",void 0),t([f({type:String})],X.prototype,"variant",void 0),t([f({type:String})],X.prototype,"detailsVariant",void 0),t([i({context:k})],X.prototype,"loginToken",void 0),t([y()],X.prototype,"isChatOpen",void 0),t([y()],X.prototype,"isCancelDialogOpen",void 0),X=t([n(),e("appointment-card")],X);let Z=class AppointmentCardSkeleton extends m{static{this.styles=u`div{border-radius:var(--border-radius-md);background:color-mix(in srgb,var(--color-neutrals-background-disabled) 50%,#fff 50%);height:337px;width:100%}`}render(){return g`<div></div>`}};Z=t([e("appointment-card-skeleton")],Z);export{Q as g};
@@ -1 +1 @@
1
- import{z as e}from"./external-CJj32K_p.js";var r=e.enum(["ordinary","system"]).enum;function s(e,r,s){return{queryKey:["unread-messages",r],queryFn:()=>e.rooms.getUnreadMessagesCount(r),staleTime:0,...s}}export{r as S,s as g};
1
+ import{z as e}from"./external-mrLCXx_f.js";var r=e.enum(["ordinary","system"]).enum;function s(e,r,s){return{queryKey:["unread-messages",r],queryFn:()=>e.rooms.getUnreadMessagesCount(r),staleTime:0,...s}}export{r as S,s as g};
@@ -1 +1 @@
1
- import{n as e}from"./create-context-DqP79qjF.js";import{z as t}from"./external-CJj32K_p.js";var n=e(Symbol.for("mq-socket")),a=t.enum(["message","messageStatus","room_accepted","room_rejected","call_requested","call_rejected","call_picked_up","appointment_created","appointment_cancelled","appointment_accepted","appointment_finished","appointment_expired","appointment_owed","appointment_paid","appointment_unpaid","appointment_uncharged","appointment_rescheduled","absence_cancelled","absence_created","appointment_reporting","consultation_assigned","consultation_finished","consultation_skipped","call_joined","message_deleted","stop_typing","typing","joinRoom"]).enum,o=class _EventReceivedEvent extends Event{constructor(e,t){super(_EventReceivedEvent.eventName,{bubbles:!0,composed:!0}),this.name=e,this.data=t}static{this.eventName="mq-event-received"}};export{o as E,n as S,a};
1
+ import{n as e}from"./create-context-DqP79qjF.js";import{z as t}from"./external-mrLCXx_f.js";var n=e(Symbol.for("mq-socket")),a=t.enum(["message","messageStatus","room_accepted","room_rejected","call_requested","call_rejected","call_picked_up","appointment_created","appointment_cancelled","appointment_accepted","appointment_finished","appointment_expired","appointment_owed","appointment_paid","appointment_unpaid","appointment_uncharged","appointment_rescheduled","absence_cancelled","absence_created","appointment_reporting","consultation_assigned","consultation_finished","consultation_skipped","call_joined","message_deleted","stop_typing","typing","joinRoom"]).enum,o=class _EventReceivedEvent extends Event{constructor(e,t){super(_EventReceivedEvent.eventName,{bubbles:!0,composed:!0}),this.name=e,this.data=t}static{this.eventName="mq-event-received"}};export{o as E,n as S,a};