@mediquo/elements 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{api-chat-client-Comg_IZx.js → api-chat-client-5LVJAeLW.js} +1 -1
- package/dist/chunks/{apple-pay-outcomes-BHgxkeDC.js → apple-pay-outcomes-DyL3HLPm.js} +1 -1
- package/dist/chunks/documentation-view-Dly6o3Fz.js +1 -0
- package/dist/chunks/{mq-layout-TG2K4zRv.d.ts → index-CFlNQLy2.d.ts} +0 -18
- package/dist/chunks/{index-B3po71dF.js → index-CsoFYpTo.js} +1 -1
- package/dist/chunks/index-DG95qEn3.js +1 -0
- package/dist/chunks/mq-layout-BiE8gq23.js +1 -0
- package/dist/chunks/mq-layout-D8Mak16a.d.ts +21 -0
- package/dist/chunks/mq-next-appointments-BIOkXfI7.js +1 -0
- package/dist/chunks/mq-recent-documents-DVhwoeLA.js +1 -0
- package/dist/chunks/{next-appointment-card-Bc65OZ1_.d.ts → next-appointment-card-DBXsY3Sp.d.ts} +50 -2
- package/dist/chunks/next-appointment-card-DxNzffoM.js +1 -0
- package/dist/chunks/professional-overview-B4E05rLd.js +1 -0
- package/dist/chunks/{telemetry-client-BdPx4SXu.js → telemetry-client-DEIuDZfA.js} +1 -1
- package/dist/env.js +1 -1
- package/dist/mq-api-client-provider.js +1 -1
- package/dist/mq-apple-pay-checkout.js +1 -1
- package/dist/mq-appointment-checkout.js +1 -1
- package/dist/mq-appointment-documentation.d.ts +2 -1
- package/dist/mq-appointment-documentation.js +1 -1
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-dashboard.d.ts +12 -51
- package/dist/mq-dashboard.js +1 -1
- package/dist/mq-documents.js +1 -1
- package/dist/mq-google-pay-checkout.js +1 -1
- package/dist/mq-immediate-videocall-checkout.js +1 -1
- package/dist/mq-my-appointments.d.ts +91 -13
- package/dist/mq-my-appointments.js +1 -1
- package/dist/mq-next-appointments.d.ts +2 -3
- package/dist/mq-next-appointments.js +1 -1
- package/dist/mq-payment-poller.js +1 -1
- package/dist/mq-recent-documents.js +1 -1
- package/dist/mq-schedule-success.js +2 -2
- package/dist/mq-schedule.js +1 -1
- package/dist/mq-support-chat.js +1 -1
- package/dist/mq-terms-and-conditions.js +1 -1
- package/dist/mq-videocall.d.ts +2 -1
- package/dist/mq-videocall.js +1 -1
- package/dist/react/mq-api-client-provider.js +1 -1
- package/dist/react/mq-apple-pay-checkout.js +1 -1
- package/dist/react/mq-appointment-checkout.js +1 -1
- package/dist/react/mq-appointment-documentation.d.ts +2 -1
- package/dist/react/mq-appointment-documentation.js +1 -1
- package/dist/react/mq-chat-room.js +1 -1
- package/dist/react/mq-checkout.js +1 -1
- package/dist/react/mq-dashboard.d.ts +13 -11
- package/dist/react/mq-dashboard.js +1 -1
- package/dist/react/mq-documents-page.js +1 -1
- package/dist/react/mq-documents.js +1 -1
- package/dist/react/mq-google-pay-checkout.js +1 -1
- package/dist/react/mq-immediate-videocall-checkout.js +1 -1
- package/dist/react/mq-my-appointments.d.ts +5 -7
- package/dist/react/mq-my-appointments.js +1 -1
- package/dist/react/mq-next-appointments.d.ts +2 -3
- package/dist/react/mq-next-appointments.js +1 -1
- package/dist/react/mq-payment-poller.js +1 -1
- package/dist/react/mq-recent-documents.js +1 -1
- package/dist/react/mq-schedule-success.js +1 -1
- package/dist/react/mq-schedule.js +1 -1
- package/dist/react/mq-support-chat.js +1 -1
- package/dist/react/mq-terms-and-conditions.js +1 -1
- package/dist/react/mq-videocall.d.ts +2 -1
- package/dist/react/mq-videocall.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/action-unavailable-message-BIgsXk9u.js +0 -1
- package/dist/chunks/appointment-action-unavailable-dialog-CTiL4nMo.d.ts +0 -54
- package/dist/chunks/appointment-card-skeleton-C2Sim4nR.d.ts +0 -93
- package/dist/chunks/appointment-card-skeleton-g3QS2OCK.js +0 -1
- package/dist/chunks/documentation-view-Bun7yDOf.js +0 -1
- package/dist/chunks/get-patient-documents-query-NC9xCa_N.js +0 -1
- package/dist/chunks/index-k5B232K7.js +0 -1
- package/dist/chunks/mq-layout-0zgWgEiP.js +0 -1
- package/dist/chunks/next-appointment-card-C1aOjmGw.js +0 -1
- package/dist/chunks/professional-overview-C4H_znIJ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./chunk-2TKJJNS7-BGwxtEg7.js";import{z as t,o as n,s as i,n as r,a as s,e as o,i as a,b as l,r as c,u,c as d,d as p,f as h,l as f,g as m}from"./external-CJj32K_p.js";import{i as g}from"./isBefore-CPpTogxo.js";import{env as b}from"../env.js";var y=t.enum(["pending","expired","accepted","inCall","declined","cancelled","finished","free_of_charge","owed","unpaid","reporting"]),_=y.enum,v=t.enum(["videocall","chat","phonecall"]),w=v.enum,C=t.object({id:t.string().uuid(),room_id:t.string(),channel:v,consultation_short_url:t.string().url().nullable(),call_id:t.string().url(),duration:t.number(),from:t.object({hash:t.string(),name:t.string().nullable(),avatar:t.string().url().nullable(),speciality:t.string().nullable(),collegiate_number:t.string().nullable(),is_dismissed:t.boolean(),languages:t.array(t.string()),description:t.string().nullable()}),to:t.object({id:t.number(),hash:t.string(),name:t.string().nullable(),avatar:t.string().url().nullable(),is_dismissed:t.boolean()}),speciality_id:t.number().nullable(),has_chat_in_appointment:t.boolean().optional(),created_at:t.string(),status:y,seconds_to_open:t.number().nonnegative(),start_date:t.string(),started_at:t.string().nullable(),expires_at:t.string().nullable(),consultation_reason:t.string().nullable(),preconsultation_documents:t.array(t.object({file_path:t.string(),file_name:t.string(),id:t.string().uuid()})).nullable(),service_id:t.string().uuid().nullable(),price:t.number().nullable().optional(),currency:t.string().nullable().optional(),discount_amount:t.number().nullable().optional()}),E=t.enum(["appointment","chat","immediate"]),R=E.enum;function S(e){return 0===e.seconds_to_open}function O(t){if(!t)return!1;const n=new Date,i=e(t);return g(i,n)}var A=o(["available","reserved"]),T=A.enum,j=n({id:i().uuid(),channel:v,duration:r(),starts_at:i(),finishes_at:i(),professional:n({id:i().uuid(),name:i()}),services:s(n({id:i().uuid(),name:i()})),speciality:n({id:r(),price:n({amount:r(),currency:i()}).nullish()}),status:A}),x=t.array(t.object({id:t.string().uuid(),name:t.string(),code:t.string(),channel:v,price:t.object({amount:t.number(),currency:t.string()}).nullable()})),P=t.array(t.object({id:t.string().uuid(),avatar:t.string().url().nullable(),description:t.string().nullable(),collegiate_number:t.string().nullable(),languages:t.array(t.string()),name:t.string(),slots:t.array(j),speciality:t.object({id:t.number()}),tax_id:t.string().nullable()}));t.object({speciality_id:t.number(),organization_schedule_service_id:t.string().uuid(),closest_slots_days:t.number().optional(),slots_per_day:t.number().optional()}),t.object({service_id:t.string().uuid(),professional_hash:t.string().uuid(),starts_at:t.string(),finishes_at:t.string(),rescheduling_appointment_id:t.string().uuid().optional()});var k=t.array(j),N=t.array(t.object({id:t.number(),name:t.string(),code:t.string().nullish(),price:t.object({amount:t.number(),currency:t.string()}).nullable()}));t.object({slot_id:t.string().uuid(),service_id:t.string().uuid().optional(),speciality_id:t.number().optional()});var U=j;n({consultation_id:i(),consultation_type:E,rating:r().int().min(1).max(5),comment:i().nullable().optional()});var L=n({rating:r().int().optional(),comment:i().nullable().optional()}).passthrough();n({file:a(File)});var F=n({url:i().url()});function D(e){return n({data:s(e),meta:n({current_page:r(),last_page:r(),per_page:r(),total:r()})})}var B=t.enum(["prescription","report","diagnosticTestPrescription"]),I=B.enum,$=t.enum(["published","draft"]);$.enum;var q=t.object({document_id:t.string().uuid(),document_type:B,name:t.string(),professional:t.object({speciality_id:t.number(),speciality_name:t.string().optional()}),status:$,url:t.string().url(),created_at:t.string()}),z=n({hash:i(),profile:n({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:n({tax_id:i().nullable(),address:i().nullable(),country_code:i().nullable(),region:i().nullable(),postal_code:i().nullable()})})});function M(e){const t=e?.profile;return`${t?.first_name??""} ${t?.last_name??""}`.trim()}function K(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)}t.object({appointmentId:t.string()});var H=C;t.object({callId:t.string()});var J=t.object({session_id:t.string(),session_token:t.string()});t.object({professional_hash:t.string(),consultation_id:t.string(),consultation_type:t.enum(["appointment"])}),t.object({professional_hash:t.string(),consultation_id:t.string(),consultation_type:t.enum(["appointment"])}),t.object({appointment_id:t.string()});var W=t.array(q);t.object({url:t.string().url()}),t.object({first_name:z.shape.profile.shape.first_name,last_name:z.shape.profile.shape.last_name,tax_id:z.shape.profile.shape.billing.shape.tax_id,birth_date:z.shape.profile.shape.birth_date,gender:z.shape.profile.shape.gender.optional(),email:z.shape.profile.shape.email,phone_prefix:z.shape.profile.shape.phone_prefix,phone:z.shape.profile.shape.phone,terms_accepted:t.boolean(),privacy_accepted:t.boolean()}),t.object({patient_hash:t.string(),page:t.number().optional(),per_page:t.number().optional()});var V=D(q);n({slot_id:i().uuid(),service_id:i().uuid(),specialty_id:i(),consultation_reason:i().optional(),preconsultation_documents:s(n({file_path:i(),file_name:i()})).optional(),discount_code:i().optional(),return_url:i().url().optional()});var X=n({id:i(),percent_off:r(),code:i(),after_discount_amount:r().nullable()}),G=n({id:i(),percent_off:r(),code:i(),name:i().nullish()}),Q={Addon:"addon",Stripe:"stripe"},Z=n({session_id:i(),payment_link:i().url(),provider:l(Q).optional()});n({video_call_schedule_id:i()});var Y=Z;n({professional_hash:i().uuid()});var ee=Z,te={Paid:"paid",Unpaid:"unpaid",Denied:"denied"},ne=n({status:l(te),consultation_id:i(),consultation_type:i()});n({order_id:i(),validation_url:i().url()});var ie=c(u());n({order_id:i(),token:i()});var re=n({data:n({status:l(te),consultation_id:i(),consultation_type:i().optional()})});n({order_id:i(),token:i()});var se=n({data:n({status:l(te),consultation_id:i(),consultation_type:i().optional()})}),oe=t.array(t.object({id:t.number(),name:t.string(),code:t.string()})),ae=t.object({primary_color:t.string().nullable(),logo:t.string().nullable(),favicon:t.string().nullable(),support_professional:t.object({hash:t.string().nullable()}).optional(),home:t.object({title:t.string().nullable(),description:t.string().nullable(),image_url:t.string().nullable()}),appointments:t.object({reserve_conditions:t.string().nullable(),seconds_before_start_to_refund_on_cancel:t.number().nullable(),has_nps:t.boolean().optional(),has_chat_in_appointment:t.boolean().optional(),has_discount_coupons_show:t.boolean().optional(),payment_provider:t.nativeEnum(Q).nullish()}),legal_consent:t.object({terms_url:t.string().nullable(),privacy_url:t.string().nullable()})}),le=o(["monday","tuesday","wednesday","thursday","friday","saturday","sunday","working_week","weekend","all_week"]);le.enum;var ce=n({days_of_week:le,from_time:i(),to_time:i()});n({hash:i().uuid()});var ue=n({hash:i().uuid(),active_absence:n({id:i().uuid(),finishes_at:i()}).nullable(),avatar:i().url().nullable(),collegiate_number:i().nullable(),description:i().nullable(),is_available:d(),name:i(),overview:i().nullable(),schedule_description:i().nullable(),speciality_id:r().nullable(),status:o(["online","offline"]),title:i().nullable(),chat_schedule:n({channel:v,duration:r(),name:i(),timezone:i(),starts_at:i(),gaps:s(ce)}).nullable()});function de(e){return e.active_absence?"absent":"online"===e.status?"online":"offline"}o(["online","offline","absent"]),n({roomId:r()});var pe=z;n({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:d(),privacy_accepted:d()}),n({terms_accepted:d(),privacy_accepted:d(),commercial_accepted:d()}),n({hash:i().uuid()});var he=n({id:r(),hash:i().uuid(),speciality_alias:i(),name:i(),avatar:i().url(),description:i(),collegiate_number:i(),languages:s(i()),centers:s(n({id:i().uuid(),name:i()}))});p([f(1),f(2),f(3)]);var fe={Sent:1,Received:2,Read:3},me=n({roomId:r(),messageId:i().uuid(),string:i(),status:r(),senderType:o(["ordinary","system"]),fromUserHash:i().uuid(),auto:p([f(0),f(1)]),createdAt:i().nullable(),deletedAt:i().nullable(),time:r().nullable()}),ge=n({file_name:i(),file_size:r(),url:i().url(),signed_url:i().url().nullable(),type:o(["uncategorized","voice_note"]),meta:n({duration:r()})}),be=me.extend({type:f("string"),attachment:h()}),ye=me.extend({type:f("file"),attachment:ge}),_e=me.extend({type:f("image"),attachment:ge});n({roomId:r()});var ve=s(p([be,ye,_e]));n({roomId:r()});var we=n({unread_count:r()});n({professional_hash:i()});var Ce=n({room_id:r()});n({status:s(y).optional(),order:n({field:o(["starts_at"]).optional(),direction:o(["asc","desc"]).optional()}).optional(),page:r().optional(),per_page:r().optional()});var Ee=D(n({appointment:n({id:i().uuid(),url:i().url(),starts_at:i(),duration:r(),status:y,channel:v,expires_at:i().nullable(),service_id:i().uuid().nullable(),has_chat_in_appointment:d().optional()}),room:n({id:r()}),price:n({amount:r(),currency:i()}).nullable(),patient:n({hash:i().uuid()}),slots:s(m()),professional:n({hash:i().uuid(),name:i(),avatar:i().url().optional(),description:i().optional(),languages:s(i()),collegiate_number:i().optional()}),speciality:n({id:r(),name:i()})}));n({slot_id:i().uuid(),service_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:s(n({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var Re=n({appointment:n({id:i().uuid()})});n({id:i().uuid()});var Se=C,Oe=n({file_path:i(),presigned_storage_url:i().url()});n({id:i().uuid(),slot_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:s(n({file_path:i(),file_name:i()})).optional()}),n({id:i().uuid()}),n({appointment_id:i().uuid(),consultation_reason:i().optional()}),n({appointment_id:i().uuid(),file_path:i(),file_name:i()}),n({appointment_id:i().uuid(),document_id:i().uuid()}),n({appointmentId:i().uuid()}),t.object({api_key:t.string(),token:t.string()});var Ae=t.object({access_token:t.string(),patient:t.object({hash:t.string(),country_code:t.string(),timezone:t.string(),first_name:t.string(),last_name:t.string().nullable(),name:t.string(),birth_date:t.string().nullable(),email:t.string().email().nullable(),language_code:t.string(),phone:t.string(),phone_prefix:t.string(),tax_id:t.string().nullable(),legal_consent:t.object({accepted_at:t.string().nullable(),last_version_at:t.string().nullable(),terms_url:t.string(),privacy_url:t.string(),has_commercial_communications:t.boolean(),organization_name:t.string()})})});function Te(e,t){return function(){return e.apply(t,arguments)}}const{toString:je}=Object.prototype,{getPrototypeOf:xe}=Object,{iterator:Pe,toStringTag:ke}=Symbol,Ne=(Ue=Object.create(null),e=>{const t=je.call(e);return Ue[t]||(Ue[t]=t.slice(8,-1).toLowerCase())});var Ue;const Le=e=>(e=e.toLowerCase(),t=>Ne(t)===e),Fe=e=>t=>typeof t===e,{isArray:De}=Array,Be=Fe("undefined");function Ie(e){return null!==e&&!Be(e)&&null!==e.constructor&&!Be(e.constructor)&&ze(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $e=Le("ArrayBuffer");const qe=Fe("string"),ze=Fe("function"),Me=Fe("number"),Ke=e=>null!==e&&"object"==typeof e,He=e=>{if("object"!==Ne(e))return!1;const t=xe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ke in e||Pe in e)},Je=Le("Date"),We=Le("File"),Ve=Le("Blob"),Xe=Le("FileList"),Ge=Le("URLSearchParams"),[Qe,Ze,Ye,et]=["ReadableStream","Request","Response","Headers"].map(Le);function tt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let i,r;if("object"!=typeof e&&(e=[e]),De(e))for(i=0,r=e.length;i<r;i++)t.call(null,e[i],i,e);else{if(Ie(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),s=r.length;let o;for(i=0;i<s;i++)o=r[i],t.call(null,e[o],o,e)}}function nt(e,t){if(Ie(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i,r=n.length;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const it="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,rt=e=>!Be(e)&&e!==it;const st=(ot="undefined"!=typeof Uint8Array&&xe(Uint8Array),e=>ot&&e instanceof ot);var ot;const at=Le("HTMLFormElement"),lt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ct=Le("RegExp"),ut=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};tt(n,(n,r)=>{let s;!1!==(s=t(n,r,e))&&(i[r]=s||n)}),Object.defineProperties(e,i)};const dt=Le("AsyncFunction"),pt=(ht="function"==typeof setImmediate,ft=ze(it.postMessage),ht?setImmediate:ft?(mt=`axios@${Math.random()}`,gt=[],it.addEventListener("message",({source:e,data:t})=>{e===it&&t===mt&>.length&>.shift()()},!1),e=>{gt.push(e),it.postMessage(mt,"*")}):e=>setTimeout(e));var ht,ft,mt,gt;const bt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(it):"undefined"!=typeof process&&process.nextTick||pt;var yt={isArray:De,isArrayBuffer:$e,isBuffer:Ie,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ze(e.append)&&("formdata"===(t=Ne(e))||"object"===t&&ze(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$e(e.buffer),t},isString:qe,isNumber:Me,isBoolean:e=>!0===e||!1===e,isObject:Ke,isPlainObject:He,isEmptyObject:e=>{if(!Ke(e)||Ie(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Qe,isRequest:Ze,isResponse:Ye,isHeaders:et,isUndefined:Be,isDate:Je,isFile:We,isBlob:Ve,isRegExp:ct,isFunction:ze,isStream:e=>Ke(e)&&ze(e.pipe),isURLSearchParams:Ge,isTypedArray:st,isFileList:Xe,forEach:tt,merge:function e(){const{caseless:t}=rt(this)&&this||{},n={},i=(i,r)=>{const s=t&&nt(n,r)||r;He(n[s])&&He(i)?n[s]=e(n[s],i):He(i)?n[s]=e({},i):De(i)?n[s]=i.slice():n[s]=i};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&tt(arguments[e],i);return n},extend:(e,t,n,{allOwnKeys:i}={})=>(tt(t,(t,i)=>{n&&ze(t)?e[i]=Te(t,n):e[i]=t},{allOwnKeys:i}),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,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let r,s,o;const a={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)o=r[s],i&&!i(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&xe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Ne,kindOfTest:Le,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return-1!==i&&i===n},toArray:e=>{if(!e)return null;if(De(e))return e;let t=e.length;if(!Me(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Pe]).call(e);let i;for(;(i=n.next())&&!i.done;){const n=i.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const i=[];for(;null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:at,hasOwnProperty:lt,hasOwnProp:lt,reduceDescriptors:ut,freezeMethods:e=>{ut(e,(t,n)=>{if(ze(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const i=e[n];ze(i)&&(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={},i=e=>{e.forEach(e=>{n[e]=!0})};return De(e)?i(e):i(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:nt,global:it,isContextDefined:rt,isSpecCompliantForm:function(e){return!!(e&&ze(e.append)&&"FormData"===e[ke]&&e[Pe])},toJSONObject:e=>{const t=new Array(10),n=(e,i)=>{if(Ke(e)){if(t.indexOf(e)>=0)return;if(Ie(e))return e;if(!("toJSON"in e)){t[i]=e;const r=De(e)?[]:{};return tt(e,(e,t)=>{const s=n(e,i+1);!Be(s)&&(r[t]=s)}),t[i]=void 0,r}}return e};return n(e,0)},isAsyncFn:dt,isThenable:e=>e&&(Ke(e)||ze(e))&&ze(e.then)&&ze(e.catch),setImmediate:pt,asap:bt,isIterable:e=>null!=e&&ze(e[Pe])};function _t(e,t,n,i,r){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),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}yt.inherits(_t,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:yt.toJSONObject(this.config),code:this.code,status:this.status}}});const vt=_t.prototype,wt={};["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=>{wt[e]={value:e}}),Object.defineProperties(_t,wt),Object.defineProperty(vt,"isAxiosError",{value:!0}),_t.from=(e,t,n,i,r,s)=>{const o=Object.create(vt);return yt.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),_t.call(o,e.message,t,n,i,r),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};function Ct(e){return yt.isPlainObject(e)||yt.isArray(e)}function Et(e){return yt.endsWith(e,"[]")?e.slice(0,-2):e}function Rt(e,t,n){return e?e.concat(t).map(function(e,t){return e=Et(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const St=yt.toFlatObject(yt,{},null,function(e){return/^is[A-Z]/.test(e)});function Ot(e,t,n){if(!yt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(n=yt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!yt.isUndefined(t[e])})).metaTokens,r=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&yt.isSpecCompliantForm(t);if(!yt.isFunction(r))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(yt.isDate(e))return e.toISOString();if(yt.isBoolean(e))return e.toString();if(!a&&yt.isBlob(e))throw new _t("Blob is not supported. Use a Buffer instead.");return yt.isArrayBuffer(e)||yt.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,r){let a=e;if(e&&!r&&"object"==typeof e)if(yt.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(yt.isArray(e)&&function(e){return yt.isArray(e)&&!e.some(Ct)}(e)||(yt.isFileList(e)||yt.endsWith(n,"[]"))&&(a=yt.toArray(e)))return n=Et(n),a.forEach(function(e,i){!yt.isUndefined(e)&&null!==e&&t.append(!0===o?Rt([n],i,s):null===o?n:n+"[]",l(e))}),!1;return!!Ct(e)||(t.append(Rt(r,n,s),l(e)),!1)}const u=[],d=Object.assign(St,{defaultVisitor:c,convertValue:l,isVisitable:Ct});if(!yt.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!yt.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+i.join("."));u.push(n),yt.forEach(n,function(n,s){!0===(!(yt.isUndefined(n)||null===n)&&r.call(t,n,yt.isString(s)?s.trim():s,i,d))&&e(n,i?i.concat(s):[s])}),u.pop()}}(e),t}function At(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Tt(e,t){this._pairs=[],e&&Ot(e,this,t)}const jt=Tt.prototype;function xt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pt(e,t,n){if(!t)return e;const i=n&&n.encode||xt;yt.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let s;if(s=r?r(t,n):yt.isURLSearchParams(t)?t.toString():new Tt(t,n).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}jt.append=function(e,t){this._pairs.push([e,t])},jt.toString=function(e){const t=e?function(t){return e.call(this,t,At)}:At;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){yt.forEach(this.handlers,function(t){null!==t&&e(t)})}}var kt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Tt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ut="undefined"!=typeof window&&"undefined"!=typeof document,Lt="object"==typeof navigator&&navigator||void 0,Ft=Ut&&(!Lt||["ReactNative","NativeScript","NS"].indexOf(Lt.product)<0),Dt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Bt=Ut&&window.location.href||"http://localhost";var It={...Object.freeze({__proto__:null,hasBrowserEnv:Ut,hasStandardBrowserEnv:Ft,hasStandardBrowserWebWorkerEnv:Dt,navigator:Lt,origin:Bt}),...Nt};function $t(e){function t(e,n,i,r){let s=e[r++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=r>=e.length;if(s=!s&&yt.isArray(i)?i.length:s,a)return yt.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!o;i[s]&&yt.isObject(i[s])||(i[s]=[]);return t(e,n,i[s],r)&&yt.isArray(i[s])&&(i[s]=function(e){const t={},n=Object.keys(e);let i;const r=n.length;let s;for(i=0;i<r;i++)s=n[i],t[s]=e[s];return t}(i[s])),!o}if(yt.isFormData(e)&&yt.isFunction(e.entries)){const n={};return yt.forEachEntry(e,(e,i)=>{t(function(e){return yt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),i,n,0)}),n}return null}const qt={transitional:kt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,r=yt.isObject(e);r&&yt.isHTMLForm(e)&&(e=new FormData(e));if(yt.isFormData(e))return i?JSON.stringify($t(e)):e;if(yt.isArrayBuffer(e)||yt.isBuffer(e)||yt.isStream(e)||yt.isFile(e)||yt.isBlob(e)||yt.isReadableStream(e))return e;if(yt.isArrayBufferView(e))return e.buffer;if(yt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ot(e,new It.classes.URLSearchParams,{visitor:function(e,t,n,i){return It.isNode&&yt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=yt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ot(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||i?(t.setContentType("application/json",!1),function(e,t,n){if(yt.isString(e))try{return(t||JSON.parse)(e),yt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||qt.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(yt.isResponse(e)||yt.isReadableStream(e))return e;if(e&&yt.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw _t.from(e,_t.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:It.classes.FormData,Blob:It.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};yt.forEach(["delete","get","head","post","put","patch"],e=>{qt.headers[e]={}});const zt=yt.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 Mt=Symbol("internals");function Kt(e){return e&&String(e).trim().toLowerCase()}function Ht(e){return!1===e||null==e?e:yt.isArray(e)?e.map(Ht):String(e)}function Jt(e,t,n,i,r){return yt.isFunction(i)?i.call(this,t,n):(r&&(t=n),yt.isString(t)?yt.isString(i)?-1!==t.indexOf(i):yt.isRegExp(i)?i.test(t):void 0:void 0)}let Wt=class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function r(e,t,n){const r=Kt(t);if(!r)throw new Error("header name must be a non-empty string");const s=yt.findKey(i,r);(!s||void 0===i[s]||!0===n||void 0===n&&!1!==i[s])&&(i[s||t]=Ht(e))}const s=(e,t)=>yt.forEach(e,(e,n)=>r(e,n,t));if(yt.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(yt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,i,r;return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),i=e.substring(r+1).trim(),!n||t[n]&&zt[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t})(e),t);else if(yt.isObject(e)&&yt.isIterable(e)){let n,i,r={};for(const t of e){if(!yt.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[i=t[0]]=(n=r[i])?yt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(r,t)}else null!=e&&r(t,e,n);return this}get(e,t){if(e=Kt(e)){const n=yt.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 i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(yt.isFunction(t))return t.call(this,e,n);if(yt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Kt(e)){const n=yt.findKey(this,e);return!(!n||void 0===this[n]||t&&!Jt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function r(e){if(e=Kt(e)){const r=yt.findKey(n,e);!r||t&&!Jt(0,n[r],r,t)||(delete n[r],i=!0)}}return yt.isArray(e)?e.forEach(r):r(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const r=t[n];e&&!Jt(0,this[r],r,e,!0)||(delete this[r],i=!0)}return i}normalize(e){const t=this,n={};return yt.forEach(this,(i,r)=>{const s=yt.findKey(n,r);if(s)return t[s]=Ht(i),void delete t[r];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(r):String(r).trim();o!==r&&delete t[r],t[o]=Ht(i),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return yt.forEach(this,(n,i)=>{null!=n&&!1!==n&&(t[i]=e&&yt.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[Mt]=this[Mt]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=Kt(e);t[i]||(!function(e,t){const n=yt.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(e,n,r){return this[i].call(this,t,e,n,r)},configurable:!0})})}(n,e),t[i]=!0)}return yt.isArray(e)?e.forEach(i):i(e),this}};function Vt(e,t){const n=this||qt,i=t||n,r=Wt.from(i.headers);let s=i.data;return yt.forEach(e,function(e){s=e.call(n,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function Xt(e){return!(!e||!e.__CANCEL__)}function Gt(e,t,n){_t.call(this,e??"canceled",_t.ERR_CANCELED,t,n),this.name="CanceledError"}function Qt(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new _t("Request failed with status code "+n.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),yt.reduceDescriptors(Wt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),yt.freezeMethods(Wt),yt.inherits(Gt,_t,{__CANCEL__:!0});const Zt=(e,t,n=3)=>{let i=0;const r=function(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=i[o];r||(r=l),n[s]=a,i[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-r<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let n,i,r=0,s=1e3/t;const o=(t,s=Date.now())=>{r=s,n=null,i&&(clearTimeout(i),i=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-r;a>=s?o(e,t):(n=e,i||(i=setTimeout(()=>{i=null,o(n)},s-a)))},()=>n&&o(n)]}(n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,a=s-i,l=r(a);i=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)},Yt=(e,t)=>{const n=null!=e;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},en=e=>(...t)=>yt.asap(()=>e(...t));var tn=It.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,It.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(It.origin),It.navigator&&/(msie|trident)/i.test(It.navigator.userAgent)):()=>!0,nn=It.hasStandardBrowserEnv?{write(e,t,n,i,r,s){const o=[e+"="+encodeURIComponent(t)];yt.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),yt.isString(i)&&o.push("path="+i),yt.isString(r)&&o.push("domain="+r),!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 rn(e,t,n){let i=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(i||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const sn=e=>e instanceof Wt?{...e}:e;function on(e,t){t=t||{};const n={};function i(e,t,n,i){return yt.isPlainObject(e)&&yt.isPlainObject(t)?yt.merge.call({caseless:i},e,t):yt.isPlainObject(t)?yt.merge({},t):yt.isArray(t)?t.slice():t}function r(e,t,n,r){return yt.isUndefined(t)?yt.isUndefined(e)?void 0:i(void 0,e,0,r):i(e,t,0,r)}function s(e,t){if(!yt.isUndefined(t))return i(void 0,t)}function o(e,t){return yt.isUndefined(t)?yt.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function a(n,r,s){return s in t?i(n,r):s in e?i(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)=>r(sn(e),sn(t),0,!0)};return yt.forEach(Object.keys({...e,...t}),function(i){const s=l[i]||r,o=s(e[i],t[i],i);yt.isUndefined(o)&&s!==a||(n[i]=o)}),n}var an=e=>{const t=on({},e);let n,{data:i,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=t;if(t.headers=a=Wt.from(a),t.url=Pt(rn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),yt.isFormData(i))if(It.hasStandardBrowserEnv||It.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(It.hasStandardBrowserEnv&&(r&&yt.isFunction(r)&&(r=r(t)),r||!1!==r&&tn(t.url))){const e=s&&o&&nn.read(o);e&&a.set(s,e)}return t};var ln="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const i=an(e);let r=i.data;const s=Wt.from(i.headers).normalize();let o,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=i;function f(){c&&c(),u&&u(),i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const i=Wt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Qt(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:i,config:e,request:m}),m=null}m.open(i.method.toUpperCase(),i.url,!0),m.timeout=i.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 _t("Request aborted",_t.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new _t("Network Error",_t.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const r=i.transitional||kt;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),n(new _t(t,r.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,e,m)),m=null},void 0===r&&s.setContentType(null),"setRequestHeader"in m&&yt.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),yt.isUndefined(i.withCredentials)||(m.withCredentials=!!i.withCredentials),d&&"json"!==d&&(m.responseType=i.responseType),h&&([l,u]=Zt(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([a,c]=Zt(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(i.cancelToken||i.signal)&&(o=t=>{m&&(n(!t||t.type?new Gt(null,e,m):t),m.abort(),m=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);b&&-1===It.protocols.indexOf(b)?n(new _t("Unsupported protocol "+b+":",_t.ERR_BAD_REQUEST,e)):m.send(r||null)})};const cn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,i=new AbortController;const r=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;i.abort(t instanceof _t?t:new Gt(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,r(new _t(`timeout ${t} of ms exceeded`,_t.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)}),e=null)};e.forEach(e=>e.addEventListener("abort",r));const{signal:a}=i;return a.unsubscribe=()=>yt.asap(o),a}},un=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let i,r=0;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},dn=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()}},pn=(e,t,n,i)=>{const r=async function*(e,t){for await(const n of dn(e))yield*un(n,t)}(e,t);let s,o=0,a=e=>{s||(s=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await r.next();if(t)return a(),void e.close();let s=i.byteLength;if(n){let e=o+=s;n(e)}e.enqueue(new Uint8Array(i))}catch(e){throw a(e),e}},cancel:e=>(a(e),r.return())},{highWaterMark:2})},hn="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,fn=hn&&"function"==typeof ReadableStream,mn=hn&&("function"==typeof TextEncoder?(gn=new TextEncoder,e=>gn.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var gn;const bn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},yn=fn&&bn(()=>{let e=!1;const t=new Request(It.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),_n=fn&&bn(()=>yt.isReadableStream(new Response("").body)),vn={stream:_n&&(e=>e.body)};var wn;hn&&(wn=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!vn[e]&&(vn[e]=yt.isFunction(wn[e])?t=>t[e]():(t,n)=>{throw new _t(`Response type '${e}' is not supported`,_t.ERR_NOT_SUPPORT,n)})}));const Cn=async(e,t)=>{const n=yt.toFiniteNumber(e.getContentLength());return n??(async e=>{if(null==e)return 0;if(yt.isBlob(e))return e.size;if(yt.isSpecCompliantForm(e)){const t=new Request(It.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return yt.isArrayBufferView(e)||yt.isArrayBuffer(e)?e.byteLength:(yt.isURLSearchParams(e)&&(e+=""),yt.isString(e)?(await mn(e)).byteLength:void 0)})(t)};const En={http:null,xhr:ln,fetch:hn&&(async e=>{let{url:t,method:n,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=an(e);c=c?(c+"").toLowerCase():"text";let h,f=cn([r,s&&s.toAbortSignal()],o);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(l&&yn&&"get"!==n&&"head"!==n&&0!==(g=await Cn(u,i))){let e,n=new Request(t,{method:"POST",body:i,duplex:"half"});if(yt.isFormData(i)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Yt(g,Zt(en(l)));i=pn(n.body,65536,e,t)}}yt.isString(d)||(d=d?"include":"omit");const r="credentials"in Request.prototype;h=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:r?d:void 0});let s=await fetch(h,p);const o=_n&&("stream"===c||"response"===c);if(_n&&(a||o&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=s[t]});const t=yt.toFiniteNumber(s.headers.get("content-length")),[n,i]=a&&Yt(t,Zt(en(a),!0))||[];s=new Response(pn(s.body,65536,n,()=>{i&&i(),m&&m()}),e)}c=c||"text";let b=await vn[yt.findKey(vn,c)||"text"](s,e);return!o&&m&&m(),await new Promise((t,n)=>{Qt(t,n,{data:b,headers:Wt.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 _t("Network Error",_t.ERR_NETWORK,e,h),{cause:t.cause||t});throw _t.from(t,t&&t.code,e,h)}})};yt.forEach(En,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Rn=e=>`- ${e}`,Sn=e=>yt.isFunction(e)||null===e||!1===e;var On=e=>{e=yt.isArray(e)?e:[e];const{length:t}=e;let n,i;const r={};for(let s=0;s<t;s++){let t;if(n=e[s],i=n,!Sn(n)&&(i=En[(t=String(n)).toLowerCase()],void 0===i))throw new _t(`Unknown adapter '${t}'`);if(i)break;r[t||"#"+s]=i}if(!i){const e=Object.entries(r).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new _t("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Rn).join("\n"):" "+Rn(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function An(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Gt(null,e)}function Tn(e){An(e),e.headers=Wt.from(e.headers),e.data=Vt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return On(e.adapter||qt.adapter)(e).then(function(t){return An(e),t.data=Vt.call(e,e.transformResponse,t),t.headers=Wt.from(t.headers),t},function(t){return Xt(t)||(An(e),t&&t.response&&(t.response.data=Vt.call(e,e.transformResponse,t.response),t.response.headers=Wt.from(t.response.headers))),Promise.reject(t)})}const jn="1.11.0",xn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{xn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Pn={};xn.transitional=function(e,t,n){function i(e,t){return"[Axios v"+jn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,s)=>{if(!1===e)throw new _t(i(r," has been removed"+(t?" in "+t:"")),_t.ERR_DEPRECATED);return t&&!Pn[r]&&(Pn[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},xn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var kn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const s=i[r],o=t[s];if(o){const t=e[s],n=void 0===t||o(t,s,e);if(!0!==n)throw new _t("option "+s+" must be "+n,_t.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new _t("Unknown option "+s,_t.ERR_BAD_OPTION)}},validators:xn};const Nn=kn.validators;let Un=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=on(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:r}=t;void 0!==n&&kn.assertOptions(n,{silentJSONParsing:Nn.transitional(Nn.boolean),forcedJSONParsing:Nn.transitional(Nn.boolean),clarifyTimeoutError:Nn.transitional(Nn.boolean)},!1),null!=i&&(yt.isFunction(i)?t.paramsSerializer={serialize:i}:kn.assertOptions(i,{encode:Nn.function,serialize:Nn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),kn.assertOptions(t,{baseUrl:Nn.spelling("baseURL"),withXsrfToken:Nn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=r&&yt.merge(r.common,r[t.method]);r&&yt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete r[e]}),t.headers=Wt.concat(s,r);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=[Tn.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=Tn.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 Pt(rn((e=on(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};yt.forEach(["delete","get","head","options"],function(e){Un.prototype[e]=function(t,n){return this.request(on(n||{},{method:e,url:t,data:(n||{}).data}))}}),yt.forEach(["post","put","patch"],function(e){function t(t){return function(n,i,r){return this.request(on(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Un.prototype[e]=t(),Un.prototype[e+"Form"]=t(!0)});const Ln={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(Ln).forEach(([e,t])=>{Ln[t]=e});const Fn=function e(t){const n=new Un(t),i=Te(Un.prototype.request,n);return yt.extend(i,Un.prototype,n,{allOwnKeys:!0}),yt.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(on(t,n))},i}(qt);Fn.Axios=Un,Fn.CanceledError=Gt,Fn.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 i=new Promise(e=>{n.subscribe(e),t=e}).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e(function(e,i,r){n.reason||(n.reason=new Gt(e,i,r),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}}},Fn.isCancel=Xt,Fn.VERSION=jn,Fn.toFormData=Ot,Fn.AxiosError=_t,Fn.Cancel=Fn.CanceledError,Fn.all=function(e){return Promise.all(e)},Fn.spread=function(e){return function(t){return e.apply(null,t)}},Fn.isAxiosError=function(e){return yt.isObject(e)&&!0===e.isAxiosError},Fn.mergeConfig=on,Fn.AxiosHeaders=Wt,Fn.formToJSON=e=>$t(yt.isHTMLForm(e)?new FormData(e):e),Fn.getAdapter=On,Fn.HttpStatusCode=Ln,Fn.default=Fn;const{Axios:Dn,AxiosError:Bn,CanceledError:In,isCancel:$n,CancelToken:qn,VERSION:zn,all:Mn,Cancel:Kn,isAxiosError:Hn,spread:Jn,toFormData:Wn,AxiosHeaders:Vn,HttpStatusCode:Xn,formToJSON:Gn,getAdapter:Qn,mergeConfig:Zn}=Fn;var Yn=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointments(e){return this.httpClient.get("/appointments/v1",{params:e}).then(this.validate(Ee))}async createAppointment(e){return this.httpClient.post(`/appointments/v1/slots/${e.slot_id}`,e).then(e=>e.data).then(this.validate(Re))}async getAppointment(e){return this.httpClient.get(`/api/v1/appointments/${e.id}`).then(e=>e.data).then(this.validate(Se))}async getDocumentsStorage(){return this.httpClient.get("/appointments/v1/documents/storage").then(e=>e.data).then(this.validate(Oe))}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`)}},ei=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(Ae))}};var ti=class{constructor(e,t){this.httpClient=e,this.validate=t}async postReview(e){return this.httpClient.post("/consultations/v1/review",e)}async startChatConsultation(e){return this.httpClient.put(`/consultations/v1/chat/professionals/${encodeURIComponent(e)}/consult`).then(()=>{})}async getReview(e){return this.httpClient.get(`/consultations/v1/review/${e}`).then(e=>e.data).then(this.validate(L))}},ni=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(F))}},ii=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(H))}async joinCall(e){return this.httpClient.get(`/flash/v1/calls/${e.callId}/join`).then(e=>e.data).then(this.validate(J))}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(W))}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(V))}},ri=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(oe))}async getOrganizationSetup(){return this.httpClient.get("/organizations/v1/setup").then(e=>e.data).then(this.validate(ae))}},si=class{constructor(e,t){this.httpClient=e,this.validate=t}async createPaymentLink(e){const{specialty_id:t,...n}=e,i={...n,speciality_id:t};return this.httpClient.post("/payments/v1/schedule",i).then(e=>e.data).then(this.validate(Z))}async createImmediateVideocallPaymentLink(e){return this.httpClient.post("/payments/v1/immediate-videocall",e).then(e=>e.data).then(this.validate(Y))}async createChatConsultationPaymentLink(e){return this.httpClient.post("/payments/v1/schedule",e).then(e=>e.data).then(this.validate(ee))}async getConsultationCoupon(e,t){return this.httpClient.get(`/payments/v1/consultation-coupon/${encodeURIComponent(e)}`,{params:{amount:t}}).then(e=>e.data).then(this.validate(X))}async getAppointmentConsultationCoupon(e){return this.httpClient.get(`/payments/v1/appointment/${encodeURIComponent(e)}/consultation-coupon`).then(e=>e.data).then(this.validate(G))}async getPaymentSession(e){return this.httpClient.get(`/payments/v1/session/${e}`).then(e=>e.data).then(this.validate(ne))}async validateApplePayMerchant(e){return this.httpClient.post("/payments/v1/apple-pay/validate-merchant",e).then(this.validate(ie))}async authorizeApplePay(e){return this.httpClient.post("/payments/v1/apple-pay/authorize",e).then(this.validate(re))}async authorizeGooglePay(e){return this.httpClient.post("/payments/v1/google-pay/authorize",e).then(this.validate(se))}},oi=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(ue))}async readAllMessages(e){return this.httpClient.put(`sdk/v1/rooms/${e.roomId}/messages/read`).then(e=>e.data)}},ai=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(pe))}async getProfessionalPublicProfile(e){return this.httpClient.get(`/profile/v1/public/professionals/${e.hash}`).then(e=>e.data).then(this.validate(he))}async acceptLegalConsent(e){return this.httpClient.post("/profile/v1/legal-consent",e)}},li=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(ve))}async getUnreadMessagesCount(e){return this.httpClient.get(`chat/v1/${e.roomId}/unread-count`).then(e=>e.data).then(this.validate(we))}async createSupportRoom(e){return this.httpClient.post("chat/v1/support-room",e).then(e=>e.data).then(this.validate(Ce))}},ci=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(x))}async getProfessionalsBySpecialtyAndService(e){return this.httpClient.get("/schedules/v1/professionals",{params:e}).then(e=>e.data).then(this.validate(P))}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(k))}async getScheduleServiceSpecialities(e){return this.httpClient.get(`/schedules/v1/services/${e}/specialities`).then(e=>e.data).then(this.validate(N))}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(U))}};var ui={development:"https://chat-dev.mediquo.com",production:"https://chat.mediquo.com"},di=class{constructor({env:e="production",baseURL:t,debug:n,apiKey:i,token:r,locale:s}={}){const o=t??ui[e];var a;this.httpClient=(a=o,Fn.create({baseURL:a,headers:{"Content-Type":"application/json"}}));const l=(c={debug:n},e=>t=>{const n=e.safeParse(t.data);if(n.error&&c?.debug){const e=t.config?.url??"";console.warn(`[Validation Error]${e?` - URL: ${e}`:""}\n${i=n.error,i.issues.map(e=>`${e.path.join(".")}: ${e.message}`).join("\n")}`)}var i;return n.data??t.data});var c;this.flash=new ii(this.httpClient,l),this.auth=new ei(this.httpClient,l),this.appointments=new Yn(this.httpClient,l),this.payments=new si(this.httpClient,l),this.schedules=new ci(this.httpClient,l),this.organizations=new ri(this.httpClient,l),this.profile=new ai(this.httpClient,l),this.professionals=new oi(this.httpClient,l),this.rooms=new li(this.httpClient,l),this.documents=new ni(this.httpClient,l),this.consultations=new ti(this.httpClient,l),i&&this.setApiKey(i),r&&this.setAuthToken(r),s&&this.setLanguage(s)}setAuthToken(e){this.httpClient.defaults.headers.common.Authorization=`Bearer ${e}`}setApiKey(e){this._apiKey=e,this.httpClient.defaults.headers.common["x-api-key"]=e}getApiKey(){return this._apiKey}setLanguage(e){this.httpClient.defaults.headers.common["Accept-Language"]=e}};function pi({env:e,apiKey:t,token:n,locale:i}={}){const r=e??b.MODE;return new di({env:r,debug:"development"===r,apiKey:t,token:n,locale:i})}const hi=["env","apiKey","token","locale","inheritedApiClient"];function fi(e,t,n){if(hi.some(t=>e.has(t)))return t.apiKey||t.token||t.locale||!n?pi({...t,apiKey:t.apiKey??n?.getApiKey()}):n}export{w as A,R as C,I as D,fe as M,te as P,T as S,_ as a,Hn as b,pi as c,Q as d,M as e,K as f,de as g,S as h,O as i,fi as n};
|
|
1
|
+
import{b as e}from"./chunk-2TKJJNS7-BGwxtEg7.js";import{z as t,o as n,s as i,n as r,a as s,e as o,i as a,b as l,r as c,u,c as d,d as p,f as h,l as f,g as m}from"./external-CJj32K_p.js";import{i as g}from"./isBefore-CPpTogxo.js";import{env as b}from"../env.js";var y=t.enum(["pending","expired","accepted","inCall","declined","cancelled","finished","free_of_charge","owed","unpaid","reporting"]),_=y.enum,v=t.enum(["videocall","chat","phonecall"]),w=v.enum,C=t.object({id:t.string().uuid(),room_id:t.string(),channel:v,consultation_short_url:t.string().url().nullable(),call_id:t.string().url(),duration:t.number(),from:t.object({hash:t.string(),name:t.string().nullable(),avatar:t.string().url().nullable(),speciality:t.string().nullable(),collegiate_number:t.string().nullable(),is_dismissed:t.boolean(),languages:t.array(t.string()),description:t.string().nullable()}),to:t.object({id:t.number(),hash:t.string(),name:t.string().nullable(),avatar:t.string().url().nullable(),is_dismissed:t.boolean()}),speciality_id:t.number().nullable(),has_chat_in_appointment:t.boolean().optional(),created_at:t.string(),status:y,seconds_to_open:t.number().nonnegative(),start_date:t.string(),started_at:t.string().nullable(),expires_at:t.string().nullable(),consultation_reason:t.string().nullable(),preconsultation_documents:t.array(t.object({file_path:t.string(),file_name:t.string(),id:t.string().uuid()})).nullable(),service_id:t.string().uuid().nullable(),price:t.number().nullable().optional(),currency:t.string().nullable().optional(),discount_amount:t.number().nullable().optional()}),E=t.enum(["appointment","chat","immediate"]),R=E.enum;function S(e){return 0===e.seconds_to_open}function O(t){if(!t)return!1;const n=new Date,i=e(t);return g(i,n)}var A=o(["available","reserved"]),T=A.enum,j=n({id:i().uuid(),channel:v,duration:r(),starts_at:i(),finishes_at:i(),professional:n({id:i().uuid(),name:i()}),services:s(n({id:i().uuid(),name:i()})),speciality:n({id:r(),price:n({amount:r(),currency:i()}).nullish()}),status:A}),x=t.array(t.object({id:t.string().uuid(),name:t.string(),code:t.string(),channel:v,price:t.object({amount:t.number(),currency:t.string()}).nullable()})),P=t.array(t.object({id:t.string().uuid(),avatar:t.string().url().nullable(),description:t.string().nullable(),collegiate_number:t.string().nullable(),languages:t.array(t.string()),name:t.string(),slots:t.array(j),speciality:t.object({id:t.number()}),tax_id:t.string().nullable()}));t.object({speciality_id:t.number(),organization_schedule_service_id:t.string().uuid(),closest_slots_days:t.number().optional(),slots_per_day:t.number().optional()}),t.object({service_id:t.string().uuid(),professional_hash:t.string().uuid(),starts_at:t.string(),finishes_at:t.string(),rescheduling_appointment_id:t.string().uuid().optional()});var k=t.array(j),N=t.array(t.object({id:t.number(),name:t.string(),code:t.string().nullish(),price:t.object({amount:t.number(),currency:t.string()}).nullable()}));t.object({slot_id:t.string().uuid(),service_id:t.string().uuid().optional(),speciality_id:t.number().optional()});var U=j;n({consultation_id:i(),consultation_type:E,rating:r().int().min(1).max(5),comment:i().nullable().optional()});var L=n({rating:r().int().optional(),comment:i().nullable().optional()}).passthrough();n({file:a(File)});var F=n({url:i().url()});function D(e){return n({data:s(e),meta:n({current_page:r(),last_page:r(),per_page:r(),total:r()})})}var B=t.enum(["prescription","report","diagnosticTestPrescription"]),I=B.enum,$=t.enum(["published","draft"]);$.enum;var q=t.object({document_id:t.string().uuid(),document_type:B,name:t.string(),professional:t.object({speciality_id:t.number(),speciality_name:t.string().optional()}),status:$,url:t.string().url(),created_at:t.string()}),z=n({hash:i(),profile:n({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:n({tax_id:i().nullable(),address:i().nullable(),country_code:i().nullable(),region:i().nullable(),postal_code:i().nullable()})})});function M(e){const t=e?.profile;return`${t?.first_name??""} ${t?.last_name??""}`.trim()}function K(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)}t.object({appointmentId:t.string()});var H=C;t.object({callId:t.string()});var J=t.object({session_id:t.string(),session_token:t.string()});t.object({professional_hash:t.string(),consultation_id:t.string(),consultation_type:t.enum(["appointment"])}),t.object({professional_hash:t.string(),consultation_id:t.string(),consultation_type:t.enum(["appointment"])}),t.object({appointment_id:t.string()});var W=t.array(q);t.object({url:t.string().url()}),t.object({first_name:z.shape.profile.shape.first_name,last_name:z.shape.profile.shape.last_name,tax_id:z.shape.profile.shape.billing.shape.tax_id,birth_date:z.shape.profile.shape.birth_date,gender:z.shape.profile.shape.gender.optional(),email:z.shape.profile.shape.email,phone_prefix:z.shape.profile.shape.phone_prefix,phone:z.shape.profile.shape.phone,terms_accepted:t.boolean(),privacy_accepted:t.boolean()}),t.object({patient_hash:t.string(),page:t.number().optional(),per_page:t.number().optional()});var V=D(q);n({slot_id:i().uuid(),service_id:i().uuid(),specialty_id:i(),consultation_reason:i().optional(),preconsultation_documents:s(n({file_path:i(),file_name:i()})).optional(),discount_code:i().optional(),return_url:i().url().optional()});var X=n({id:i(),percent_off:r(),code:i(),after_discount_amount:r().nullable()}),G=n({id:i(),percent_off:r(),code:i(),name:i().nullish()}),Q={Addon:"addon",Stripe:"stripe"},Z=n({session_id:i(),payment_link:i().url(),provider:l(Q).optional()});n({video_call_schedule_id:i()});var Y=Z;n({professional_hash:i().uuid()});var ee=Z,te={Paid:"paid",Unpaid:"unpaid",Denied:"denied"},ne=n({status:l(te),consultation_id:i(),consultation_type:i()});n({order_id:i(),validation_url:i().url()});var ie=c(u());n({order_id:i(),token:i()});var re=n({data:n({status:l(te),consultation_id:i(),consultation_type:i().optional()})});n({order_id:i(),token:i()});var se=n({data:n({status:l(te),consultation_id:i(),consultation_type:i().optional()})}),oe=t.array(t.object({id:t.number(),name:t.string(),code:t.string()})),ae=t.object({primary_color:t.string().nullable(),logo:t.string().nullable(),favicon:t.string().nullable(),support_professional:t.object({hash:t.string().nullable()}).optional(),home:t.object({title:t.string().nullable(),description:t.string().nullable(),image_url:t.string().nullable()}),appointments:t.object({reserve_conditions:t.string().nullable(),seconds_before_start_to_refund_on_cancel:t.number().nullable(),has_nps:t.boolean().optional(),has_chat_in_appointment:t.boolean().optional(),has_discount_coupons_show:t.boolean().optional(),payment_provider:t.nativeEnum(Q).nullish()}),legal_consent:t.object({terms_url:t.string().nullable(),privacy_url:t.string().nullable()})}),le=o(["monday","tuesday","wednesday","thursday","friday","saturday","sunday","working_week","weekend","all_week"]);le.enum;var ce=n({days_of_week:le,from_time:i(),to_time:i()});n({hash:i().uuid()});var ue=n({hash:i().uuid(),active_absence:n({id:i().uuid(),finishes_at:i()}).nullable(),avatar:i().url().nullable(),collegiate_number:i().nullable(),description:i().nullable(),is_available:d(),name:i(),overview:i().nullable(),schedule_description:i().nullable(),speciality_id:r().nullable(),status:o(["online","offline"]),title:i().nullable(),chat_schedule:n({channel:v,duration:r(),name:i(),timezone:i(),starts_at:i(),gaps:s(ce)}).nullable()});function de(e){return e.active_absence?"absent":"online"===e.status?"online":"offline"}o(["online","offline","absent"]),n({roomId:r()});var pe=z;n({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:d(),privacy_accepted:d()}),n({terms_accepted:d(),privacy_accepted:d(),commercial_accepted:d()}),n({hash:i().uuid()});var he=n({id:r(),hash:i().uuid(),speciality_alias:i(),name:i(),avatar:i().url(),description:i(),collegiate_number:i(),languages:s(i()),centers:s(n({id:i().uuid(),name:i()}))});p([f(1),f(2),f(3)]);var fe={Sent:1,Received:2,Read:3},me=n({roomId:r(),messageId:i().uuid(),string:i(),status:r(),senderType:o(["ordinary","system"]),fromUserHash:i().uuid(),auto:p([f(0),f(1)]),createdAt:i().nullable(),deletedAt:i().nullable(),time:r().nullable()}),ge=n({file_name:i(),file_size:r(),url:i().url(),signed_url:i().url().nullable(),type:o(["uncategorized","voice_note"]),meta:n({duration:r()})}),be=me.extend({type:f("string"),attachment:h()}),ye=me.extend({type:f("file"),attachment:ge}),_e=me.extend({type:f("image"),attachment:ge});n({roomId:r()});var ve=s(p([be,ye,_e]));n({roomId:r()});var we=n({unread_count:r()});n({professional_hash:i()});var Ce=n({room_id:r()});n({status:s(y).optional(),order:n({field:o(["starts_at"]).optional(),direction:o(["asc","desc"]).optional()}).optional(),page:r().optional(),per_page:r().optional()});var Ee=D(n({appointment:n({id:i().uuid(),url:i().url(),starts_at:i(),duration:r(),status:y,channel:v,expires_at:i().nullable(),service_id:i().uuid().nullable(),has_chat_in_appointment:d().optional()}),room:n({id:r()}),price:n({amount:r(),currency:i()}).nullable(),patient:n({hash:i().uuid()}),slots:s(m()),professional:n({hash:i().uuid(),name:i(),avatar:i().url().optional(),description:i().optional(),languages:s(i()),collegiate_number:i().optional()}),speciality:n({id:r(),name:i()})}));n({slot_id:i().uuid(),service_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:s(n({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var Re=n({appointment:n({id:i().uuid()})});n({id:i().uuid()});var Se=C,Oe=n({file_path:i(),presigned_storage_url:i().url()});n({id:i().uuid(),slot_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:s(n({file_path:i(),file_name:i()})).optional()}),n({id:i().uuid()}),n({appointment_id:i().uuid(),consultation_reason:i().optional()}),n({appointment_id:i().uuid(),file_path:i(),file_name:i()}),n({appointment_id:i().uuid(),document_id:i().uuid()}),n({appointmentId:i().uuid()}),t.object({api_key:t.string(),token:t.string()});var Ae=t.object({access_token:t.string(),patient:t.object({hash:t.string(),country_code:t.string(),timezone:t.string(),first_name:t.string(),last_name:t.string().nullable(),name:t.string(),birth_date:t.string().nullable(),email:t.string().email().nullable(),language_code:t.string(),phone:t.string(),phone_prefix:t.string(),tax_id:t.string().nullable(),legal_consent:t.object({accepted_at:t.string().nullable(),last_version_at:t.string().nullable(),terms_url:t.string(),privacy_url:t.string(),has_commercial_communications:t.boolean(),organization_name:t.string()})})});function Te(e,t){return function(){return e.apply(t,arguments)}}const{toString:je}=Object.prototype,{getPrototypeOf:xe}=Object,{iterator:Pe,toStringTag:ke}=Symbol,Ne=(Ue=Object.create(null),e=>{const t=je.call(e);return Ue[t]||(Ue[t]=t.slice(8,-1).toLowerCase())});var Ue;const Le=e=>(e=e.toLowerCase(),t=>Ne(t)===e),Fe=e=>t=>typeof t===e,{isArray:De}=Array,Be=Fe("undefined");function Ie(e){return null!==e&&!Be(e)&&null!==e.constructor&&!Be(e.constructor)&&ze(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $e=Le("ArrayBuffer");const qe=Fe("string"),ze=Fe("function"),Me=Fe("number"),Ke=e=>null!==e&&"object"==typeof e,He=e=>{if("object"!==Ne(e))return!1;const t=xe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||ke in e||Pe in e)},Je=Le("Date"),We=Le("File"),Ve=Le("Blob"),Xe=Le("FileList"),Ge=Le("URLSearchParams"),[Qe,Ze,Ye,et]=["ReadableStream","Request","Response","Headers"].map(Le);function tt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let i,r;if("object"!=typeof e&&(e=[e]),De(e))for(i=0,r=e.length;i<r;i++)t.call(null,e[i],i,e);else{if(Ie(e))return;const r=n?Object.getOwnPropertyNames(e):Object.keys(e),s=r.length;let o;for(i=0;i<s;i++)o=r[i],t.call(null,e[o],o,e)}}function nt(e,t){if(Ie(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i,r=n.length;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const it="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,rt=e=>!Be(e)&&e!==it;const st=(ot="undefined"!=typeof Uint8Array&&xe(Uint8Array),e=>ot&&e instanceof ot);var ot;const at=Le("HTMLFormElement"),lt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ct=Le("RegExp"),ut=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};tt(n,(n,r)=>{let s;!1!==(s=t(n,r,e))&&(i[r]=s||n)}),Object.defineProperties(e,i)};const dt=Le("AsyncFunction"),pt=(ht="function"==typeof setImmediate,ft=ze(it.postMessage),ht?setImmediate:ft?(mt=`axios@${Math.random()}`,gt=[],it.addEventListener("message",({source:e,data:t})=>{e===it&&t===mt&>.length&>.shift()()},!1),e=>{gt.push(e),it.postMessage(mt,"*")}):e=>setTimeout(e));var ht,ft,mt,gt;const bt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(it):"undefined"!=typeof process&&process.nextTick||pt;var yt={isArray:De,isArrayBuffer:$e,isBuffer:Ie,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||ze(e.append)&&("formdata"===(t=Ne(e))||"object"===t&&ze(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$e(e.buffer),t},isString:qe,isNumber:Me,isBoolean:e=>!0===e||!1===e,isObject:Ke,isPlainObject:He,isEmptyObject:e=>{if(!Ke(e)||Ie(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Qe,isRequest:Ze,isResponse:Ye,isHeaders:et,isUndefined:Be,isDate:Je,isFile:We,isBlob:Ve,isRegExp:ct,isFunction:ze,isStream:e=>Ke(e)&&ze(e.pipe),isURLSearchParams:Ge,isTypedArray:st,isFileList:Xe,forEach:tt,merge:function e(){const{caseless:t}=rt(this)&&this||{},n={},i=(i,r)=>{const s=t&&nt(n,r)||r;He(n[s])&&He(i)?n[s]=e(n[s],i):He(i)?n[s]=e({},i):De(i)?n[s]=i.slice():n[s]=i};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&tt(arguments[e],i);return n},extend:(e,t,n,{allOwnKeys:i}={})=>(tt(t,(t,i)=>{n&&ze(t)?e[i]=Te(t,n):e[i]=t},{allOwnKeys:i}),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,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let r,s,o;const a={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),s=r.length;s-- >0;)o=r[s],i&&!i(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&xe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Ne,kindOfTest:Le,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return-1!==i&&i===n},toArray:e=>{if(!e)return null;if(De(e))return e;let t=e.length;if(!Me(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Pe]).call(e);let i;for(;(i=n.next())&&!i.done;){const n=i.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const i=[];for(;null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:at,hasOwnProperty:lt,hasOwnProp:lt,reduceDescriptors:ut,freezeMethods:e=>{ut(e,(t,n)=>{if(ze(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const i=e[n];ze(i)&&(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={},i=e=>{e.forEach(e=>{n[e]=!0})};return De(e)?i(e):i(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:nt,global:it,isContextDefined:rt,isSpecCompliantForm:function(e){return!!(e&&ze(e.append)&&"FormData"===e[ke]&&e[Pe])},toJSONObject:e=>{const t=new Array(10),n=(e,i)=>{if(Ke(e)){if(t.indexOf(e)>=0)return;if(Ie(e))return e;if(!("toJSON"in e)){t[i]=e;const r=De(e)?[]:{};return tt(e,(e,t)=>{const s=n(e,i+1);!Be(s)&&(r[t]=s)}),t[i]=void 0,r}}return e};return n(e,0)},isAsyncFn:dt,isThenable:e=>e&&(Ke(e)||ze(e))&&ze(e.then)&&ze(e.catch),setImmediate:pt,asap:bt,isIterable:e=>null!=e&&ze(e[Pe])};function _t(e,t,n,i,r){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),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}yt.inherits(_t,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:yt.toJSONObject(this.config),code:this.code,status:this.status}}});const vt=_t.prototype,wt={};["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=>{wt[e]={value:e}}),Object.defineProperties(_t,wt),Object.defineProperty(vt,"isAxiosError",{value:!0}),_t.from=(e,t,n,i,r,s)=>{const o=Object.create(vt);return yt.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),_t.call(o,e.message,t,n,i,r),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};function Ct(e){return yt.isPlainObject(e)||yt.isArray(e)}function Et(e){return yt.endsWith(e,"[]")?e.slice(0,-2):e}function Rt(e,t,n){return e?e.concat(t).map(function(e,t){return e=Et(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const St=yt.toFlatObject(yt,{},null,function(e){return/^is[A-Z]/.test(e)});function Ot(e,t,n){if(!yt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(n=yt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!yt.isUndefined(t[e])})).metaTokens,r=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&yt.isSpecCompliantForm(t);if(!yt.isFunction(r))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(yt.isDate(e))return e.toISOString();if(yt.isBoolean(e))return e.toString();if(!a&&yt.isBlob(e))throw new _t("Blob is not supported. Use a Buffer instead.");return yt.isArrayBuffer(e)||yt.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,r){let a=e;if(e&&!r&&"object"==typeof e)if(yt.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(yt.isArray(e)&&function(e){return yt.isArray(e)&&!e.some(Ct)}(e)||(yt.isFileList(e)||yt.endsWith(n,"[]"))&&(a=yt.toArray(e)))return n=Et(n),a.forEach(function(e,i){!yt.isUndefined(e)&&null!==e&&t.append(!0===o?Rt([n],i,s):null===o?n:n+"[]",l(e))}),!1;return!!Ct(e)||(t.append(Rt(r,n,s),l(e)),!1)}const u=[],d=Object.assign(St,{defaultVisitor:c,convertValue:l,isVisitable:Ct});if(!yt.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!yt.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+i.join("."));u.push(n),yt.forEach(n,function(n,s){!0===(!(yt.isUndefined(n)||null===n)&&r.call(t,n,yt.isString(s)?s.trim():s,i,d))&&e(n,i?i.concat(s):[s])}),u.pop()}}(e),t}function At(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Tt(e,t){this._pairs=[],e&&Ot(e,this,t)}const jt=Tt.prototype;function xt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pt(e,t,n){if(!t)return e;const i=n&&n.encode||xt;yt.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let s;if(s=r?r(t,n):yt.isURLSearchParams(t)?t.toString():new Tt(t,n).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}jt.append=function(e,t){this._pairs.push([e,t])},jt.toString=function(e){const t=e?function(t){return e.call(this,t,At)}:At;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){yt.forEach(this.handlers,function(t){null!==t&&e(t)})}}var kt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Nt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Tt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ut="undefined"!=typeof window&&"undefined"!=typeof document,Lt="object"==typeof navigator&&navigator||void 0,Ft=Ut&&(!Lt||["ReactNative","NativeScript","NS"].indexOf(Lt.product)<0),Dt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Bt=Ut&&window.location.href||"http://localhost";var It={...Object.freeze({__proto__:null,hasBrowserEnv:Ut,hasStandardBrowserEnv:Ft,hasStandardBrowserWebWorkerEnv:Dt,navigator:Lt,origin:Bt}),...Nt};function $t(e){function t(e,n,i,r){let s=e[r++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=r>=e.length;if(s=!s&&yt.isArray(i)?i.length:s,a)return yt.hasOwnProp(i,s)?i[s]=[i[s],n]:i[s]=n,!o;i[s]&&yt.isObject(i[s])||(i[s]=[]);return t(e,n,i[s],r)&&yt.isArray(i[s])&&(i[s]=function(e){const t={},n=Object.keys(e);let i;const r=n.length;let s;for(i=0;i<r;i++)s=n[i],t[s]=e[s];return t}(i[s])),!o}if(yt.isFormData(e)&&yt.isFunction(e.entries)){const n={};return yt.forEachEntry(e,(e,i)=>{t(function(e){return yt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),i,n,0)}),n}return null}const qt={transitional:kt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,r=yt.isObject(e);r&&yt.isHTMLForm(e)&&(e=new FormData(e));if(yt.isFormData(e))return i?JSON.stringify($t(e)):e;if(yt.isArrayBuffer(e)||yt.isBuffer(e)||yt.isStream(e)||yt.isFile(e)||yt.isBlob(e)||yt.isReadableStream(e))return e;if(yt.isArrayBufferView(e))return e.buffer;if(yt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Ot(e,new It.classes.URLSearchParams,{visitor:function(e,t,n,i){return It.isNode&&yt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=yt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ot(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||i?(t.setContentType("application/json",!1),function(e,t,n){if(yt.isString(e))try{return(t||JSON.parse)(e),yt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||qt.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(yt.isResponse(e)||yt.isReadableStream(e))return e;if(e&&yt.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw _t.from(e,_t.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:It.classes.FormData,Blob:It.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};yt.forEach(["delete","get","head","post","put","patch"],e=>{qt.headers[e]={}});const zt=yt.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 Mt=Symbol("internals");function Kt(e){return e&&String(e).trim().toLowerCase()}function Ht(e){return!1===e||null==e?e:yt.isArray(e)?e.map(Ht):String(e)}function Jt(e,t,n,i,r){return yt.isFunction(i)?i.call(this,t,n):(r&&(t=n),yt.isString(t)?yt.isString(i)?-1!==t.indexOf(i):yt.isRegExp(i)?i.test(t):void 0:void 0)}let Wt=class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function r(e,t,n){const r=Kt(t);if(!r)throw new Error("header name must be a non-empty string");const s=yt.findKey(i,r);(!s||void 0===i[s]||!0===n||void 0===n&&!1!==i[s])&&(i[s||t]=Ht(e))}const s=(e,t)=>yt.forEach(e,(e,n)=>r(e,n,t));if(yt.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(yt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,i,r;return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),i=e.substring(r+1).trim(),!n||t[n]&&zt[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t})(e),t);else if(yt.isObject(e)&&yt.isIterable(e)){let n,i,r={};for(const t of e){if(!yt.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[i=t[0]]=(n=r[i])?yt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(r,t)}else null!=e&&r(t,e,n);return this}get(e,t){if(e=Kt(e)){const n=yt.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 i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(yt.isFunction(t))return t.call(this,e,n);if(yt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Kt(e)){const n=yt.findKey(this,e);return!(!n||void 0===this[n]||t&&!Jt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function r(e){if(e=Kt(e)){const r=yt.findKey(n,e);!r||t&&!Jt(0,n[r],r,t)||(delete n[r],i=!0)}}return yt.isArray(e)?e.forEach(r):r(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const r=t[n];e&&!Jt(0,this[r],r,e,!0)||(delete this[r],i=!0)}return i}normalize(e){const t=this,n={};return yt.forEach(this,(i,r)=>{const s=yt.findKey(n,r);if(s)return t[s]=Ht(i),void delete t[r];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(r):String(r).trim();o!==r&&delete t[r],t[o]=Ht(i),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return yt.forEach(this,(n,i)=>{null!=n&&!1!==n&&(t[i]=e&&yt.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[Mt]=this[Mt]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=Kt(e);t[i]||(!function(e,t){const n=yt.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(e,n,r){return this[i].call(this,t,e,n,r)},configurable:!0})})}(n,e),t[i]=!0)}return yt.isArray(e)?e.forEach(i):i(e),this}};function Vt(e,t){const n=this||qt,i=t||n,r=Wt.from(i.headers);let s=i.data;return yt.forEach(e,function(e){s=e.call(n,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function Xt(e){return!(!e||!e.__CANCEL__)}function Gt(e,t,n){_t.call(this,e??"canceled",_t.ERR_CANCELED,t,n),this.name="CanceledError"}function Qt(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new _t("Request failed with status code "+n.status,[_t.ERR_BAD_REQUEST,_t.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),yt.reduceDescriptors(Wt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),yt.freezeMethods(Wt),yt.inherits(Gt,_t,{__CANCEL__:!0});const Zt=(e,t,n=3)=>{let i=0;const r=function(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=i[o];r||(r=l),n[s]=a,i[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-r<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let n,i,r=0,s=1e3/t;const o=(t,s=Date.now())=>{r=s,n=null,i&&(clearTimeout(i),i=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-r;a>=s?o(e,t):(n=e,i||(i=setTimeout(()=>{i=null,o(n)},s-a)))},()=>n&&o(n)]}(n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,a=s-i,l=r(a);i=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)},Yt=(e,t)=>{const n=null!=e;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},en=e=>(...t)=>yt.asap(()=>e(...t));var tn=It.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,It.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(It.origin),It.navigator&&/(msie|trident)/i.test(It.navigator.userAgent)):()=>!0,nn=It.hasStandardBrowserEnv?{write(e,t,n,i,r,s){const o=[e+"="+encodeURIComponent(t)];yt.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),yt.isString(i)&&o.push("path="+i),yt.isString(r)&&o.push("domain="+r),!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 rn(e,t,n){let i=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(i||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const sn=e=>e instanceof Wt?{...e}:e;function on(e,t){t=t||{};const n={};function i(e,t,n,i){return yt.isPlainObject(e)&&yt.isPlainObject(t)?yt.merge.call({caseless:i},e,t):yt.isPlainObject(t)?yt.merge({},t):yt.isArray(t)?t.slice():t}function r(e,t,n,r){return yt.isUndefined(t)?yt.isUndefined(e)?void 0:i(void 0,e,0,r):i(e,t,0,r)}function s(e,t){if(!yt.isUndefined(t))return i(void 0,t)}function o(e,t){return yt.isUndefined(t)?yt.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function a(n,r,s){return s in t?i(n,r):s in e?i(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)=>r(sn(e),sn(t),0,!0)};return yt.forEach(Object.keys({...e,...t}),function(i){const s=l[i]||r,o=s(e[i],t[i],i);yt.isUndefined(o)&&s!==a||(n[i]=o)}),n}var an=e=>{const t=on({},e);let n,{data:i,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=t;if(t.headers=a=Wt.from(a),t.url=Pt(rn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),yt.isFormData(i))if(It.hasStandardBrowserEnv||It.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(It.hasStandardBrowserEnv&&(r&&yt.isFunction(r)&&(r=r(t)),r||!1!==r&&tn(t.url))){const e=s&&o&&nn.read(o);e&&a.set(s,e)}return t};var ln="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const i=an(e);let r=i.data;const s=Wt.from(i.headers).normalize();let o,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=i;function f(){c&&c(),u&&u(),i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const i=Wt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Qt(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:i,config:e,request:m}),m=null}m.open(i.method.toUpperCase(),i.url,!0),m.timeout=i.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 _t("Request aborted",_t.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new _t("Network Error",_t.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const r=i.transitional||kt;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),n(new _t(t,r.clarifyTimeoutError?_t.ETIMEDOUT:_t.ECONNABORTED,e,m)),m=null},void 0===r&&s.setContentType(null),"setRequestHeader"in m&&yt.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),yt.isUndefined(i.withCredentials)||(m.withCredentials=!!i.withCredentials),d&&"json"!==d&&(m.responseType=i.responseType),h&&([l,u]=Zt(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([a,c]=Zt(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(i.cancelToken||i.signal)&&(o=t=>{m&&(n(!t||t.type?new Gt(null,e,m):t),m.abort(),m=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);b&&-1===It.protocols.indexOf(b)?n(new _t("Unsupported protocol "+b+":",_t.ERR_BAD_REQUEST,e)):m.send(r||null)})};const cn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,i=new AbortController;const r=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;i.abort(t instanceof _t?t:new Gt(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,r(new _t(`timeout ${t} of ms exceeded`,_t.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)}),e=null)};e.forEach(e=>e.addEventListener("abort",r));const{signal:a}=i;return a.unsubscribe=()=>yt.asap(o),a}},un=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let i,r=0;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},dn=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()}},pn=(e,t,n,i)=>{const r=async function*(e,t){for await(const n of dn(e))yield*un(n,t)}(e,t);let s,o=0,a=e=>{s||(s=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await r.next();if(t)return a(),void e.close();let s=i.byteLength;if(n){let e=o+=s;n(e)}e.enqueue(new Uint8Array(i))}catch(e){throw a(e),e}},cancel:e=>(a(e),r.return())},{highWaterMark:2})},hn="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,fn=hn&&"function"==typeof ReadableStream,mn=hn&&("function"==typeof TextEncoder?(gn=new TextEncoder,e=>gn.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var gn;const bn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},yn=fn&&bn(()=>{let e=!1;const t=new Request(It.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),_n=fn&&bn(()=>yt.isReadableStream(new Response("").body)),vn={stream:_n&&(e=>e.body)};var wn;hn&&(wn=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!vn[e]&&(vn[e]=yt.isFunction(wn[e])?t=>t[e]():(t,n)=>{throw new _t(`Response type '${e}' is not supported`,_t.ERR_NOT_SUPPORT,n)})}));const Cn=async(e,t)=>{const n=yt.toFiniteNumber(e.getContentLength());return n??(async e=>{if(null==e)return 0;if(yt.isBlob(e))return e.size;if(yt.isSpecCompliantForm(e)){const t=new Request(It.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return yt.isArrayBufferView(e)||yt.isArrayBuffer(e)?e.byteLength:(yt.isURLSearchParams(e)&&(e+=""),yt.isString(e)?(await mn(e)).byteLength:void 0)})(t)};const En={http:null,xhr:ln,fetch:hn&&(async e=>{let{url:t,method:n,data:i,signal:r,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=an(e);c=c?(c+"").toLowerCase():"text";let h,f=cn([r,s&&s.toAbortSignal()],o);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(l&&yn&&"get"!==n&&"head"!==n&&0!==(g=await Cn(u,i))){let e,n=new Request(t,{method:"POST",body:i,duplex:"half"});if(yt.isFormData(i)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=Yt(g,Zt(en(l)));i=pn(n.body,65536,e,t)}}yt.isString(d)||(d=d?"include":"omit");const r="credentials"in Request.prototype;h=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:i,duplex:"half",credentials:r?d:void 0});let s=await fetch(h,p);const o=_n&&("stream"===c||"response"===c);if(_n&&(a||o&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=s[t]});const t=yt.toFiniteNumber(s.headers.get("content-length")),[n,i]=a&&Yt(t,Zt(en(a),!0))||[];s=new Response(pn(s.body,65536,n,()=>{i&&i(),m&&m()}),e)}c=c||"text";let b=await vn[yt.findKey(vn,c)||"text"](s,e);return!o&&m&&m(),await new Promise((t,n)=>{Qt(t,n,{data:b,headers:Wt.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 _t("Network Error",_t.ERR_NETWORK,e,h),{cause:t.cause||t});throw _t.from(t,t&&t.code,e,h)}})};yt.forEach(En,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Rn=e=>`- ${e}`,Sn=e=>yt.isFunction(e)||null===e||!1===e;var On=e=>{e=yt.isArray(e)?e:[e];const{length:t}=e;let n,i;const r={};for(let s=0;s<t;s++){let t;if(n=e[s],i=n,!Sn(n)&&(i=En[(t=String(n)).toLowerCase()],void 0===i))throw new _t(`Unknown adapter '${t}'`);if(i)break;r[t||"#"+s]=i}if(!i){const e=Object.entries(r).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new _t("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Rn).join("\n"):" "+Rn(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return i};function An(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Gt(null,e)}function Tn(e){An(e),e.headers=Wt.from(e.headers),e.data=Vt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return On(e.adapter||qt.adapter)(e).then(function(t){return An(e),t.data=Vt.call(e,e.transformResponse,t),t.headers=Wt.from(t.headers),t},function(t){return Xt(t)||(An(e),t&&t.response&&(t.response.data=Vt.call(e,e.transformResponse,t.response),t.response.headers=Wt.from(t.response.headers))),Promise.reject(t)})}const jn="1.11.0",xn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{xn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Pn={};xn.transitional=function(e,t,n){function i(e,t){return"[Axios v"+jn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,s)=>{if(!1===e)throw new _t(i(r," has been removed"+(t?" in "+t:"")),_t.ERR_DEPRECATED);return t&&!Pn[r]&&(Pn[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},xn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var kn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new _t("options must be an object",_t.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const s=i[r],o=t[s];if(o){const t=e[s],n=void 0===t||o(t,s,e);if(!0!==n)throw new _t("option "+s+" must be "+n,_t.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new _t("Unknown option "+s,_t.ERR_BAD_OPTION)}},validators:xn};const Nn=kn.validators;let Un=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=on(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:r}=t;void 0!==n&&kn.assertOptions(n,{silentJSONParsing:Nn.transitional(Nn.boolean),forcedJSONParsing:Nn.transitional(Nn.boolean),clarifyTimeoutError:Nn.transitional(Nn.boolean)},!1),null!=i&&(yt.isFunction(i)?t.paramsSerializer={serialize:i}:kn.assertOptions(i,{encode:Nn.function,serialize:Nn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),kn.assertOptions(t,{baseUrl:Nn.spelling("baseURL"),withXsrfToken:Nn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=r&&yt.merge(r.common,r[t.method]);r&&yt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete r[e]}),t.headers=Wt.concat(s,r);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=[Tn.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=Tn.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 Pt(rn((e=on(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};yt.forEach(["delete","get","head","options"],function(e){Un.prototype[e]=function(t,n){return this.request(on(n||{},{method:e,url:t,data:(n||{}).data}))}}),yt.forEach(["post","put","patch"],function(e){function t(t){return function(n,i,r){return this.request(on(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Un.prototype[e]=t(),Un.prototype[e+"Form"]=t(!0)});const Ln={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(Ln).forEach(([e,t])=>{Ln[t]=e});const Fn=function e(t){const n=new Un(t),i=Te(Un.prototype.request,n);return yt.extend(i,Un.prototype,n,{allOwnKeys:!0}),yt.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(on(t,n))},i}(qt);Fn.Axios=Un,Fn.CanceledError=Gt,Fn.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 i=new Promise(e=>{n.subscribe(e),t=e}).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e(function(e,i,r){n.reason||(n.reason=new Gt(e,i,r),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}}},Fn.isCancel=Xt,Fn.VERSION=jn,Fn.toFormData=Ot,Fn.AxiosError=_t,Fn.Cancel=Fn.CanceledError,Fn.all=function(e){return Promise.all(e)},Fn.spread=function(e){return function(t){return e.apply(null,t)}},Fn.isAxiosError=function(e){return yt.isObject(e)&&!0===e.isAxiosError},Fn.mergeConfig=on,Fn.AxiosHeaders=Wt,Fn.formToJSON=e=>$t(yt.isHTMLForm(e)?new FormData(e):e),Fn.getAdapter=On,Fn.HttpStatusCode=Ln,Fn.default=Fn;const{Axios:Dn,AxiosError:Bn,CanceledError:In,isCancel:$n,CancelToken:qn,VERSION:zn,all:Mn,Cancel:Kn,isAxiosError:Hn,spread:Jn,toFormData:Wn,AxiosHeaders:Vn,HttpStatusCode:Xn,formToJSON:Gn,getAdapter:Qn,mergeConfig:Zn}=Fn;var Yn=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointments(e){return this.httpClient.get("/appointments/v1",{params:e}).then(this.validate(Ee))}async createAppointment(e){return this.httpClient.post(`/appointments/v1/slots/${e.slot_id}`,e).then(e=>e.data).then(this.validate(Re))}async getAppointment(e){return this.httpClient.get(`/api/v1/appointments/${e.id}`).then(e=>e.data).then(this.validate(Se))}async getDocumentsStorage(){return this.httpClient.get("/appointments/v1/documents/storage").then(e=>e.data).then(this.validate(Oe))}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`)}},ei=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(Ae))}};var ti=class{constructor(e,t){this.httpClient=e,this.validate=t}async postReview(e){return this.httpClient.post("/consultations/v1/review",e)}async startChatConsultation(e){return this.httpClient.put(`/consultations/v1/chat/professionals/${encodeURIComponent(e)}/consult`).then(()=>{})}async getReview(e){return this.httpClient.get(`/consultations/v1/review/${e}`).then(e=>e.data).then(this.validate(L))}},ni=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(F))}},ii=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(H))}async joinCall(e){return this.httpClient.get(`/flash/v1/calls/${e.callId}/join`).then(e=>e.data).then(this.validate(J))}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(W))}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(V))}},ri=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(oe))}async getOrganizationSetup(){return this.httpClient.get("/organizations/v1/setup").then(e=>e.data).then(this.validate(ae))}},si=class{constructor(e,t){this.httpClient=e,this.validate=t}async createPaymentLink(e){const{specialty_id:t,...n}=e,i={...n,speciality_id:t};return this.httpClient.post("/payments/v1/schedule",i).then(e=>e.data).then(this.validate(Z))}async createImmediateVideocallPaymentLink(e){return this.httpClient.post("/payments/v1/immediate-videocall",e).then(e=>e.data).then(this.validate(Y))}async createChatConsultationPaymentLink(e){return this.httpClient.post("/payments/v1/schedule",e).then(e=>e.data).then(this.validate(ee))}async getConsultationCoupon(e,t){return this.httpClient.get(`/payments/v1/consultation-coupon/${encodeURIComponent(e)}`,{params:{amount:t}}).then(e=>e.data).then(this.validate(X))}async getAppointmentConsultationCoupon(e){return this.httpClient.get(`/payments/v1/appointment/${encodeURIComponent(e)}/consultation-coupon`).then(e=>e.data).then(this.validate(G))}async getPaymentSession(e){return this.httpClient.get(`/payments/v1/session/${e}`).then(e=>e.data).then(this.validate(ne))}async validateApplePayMerchant(e){return this.httpClient.post("/payments/v1/apple-pay/validate-merchant",e).then(this.validate(ie))}async authorizeApplePay(e){return this.httpClient.post("/payments/v1/apple-pay/authorize",e).then(this.validate(re))}async authorizeGooglePay(e){return this.httpClient.post("/payments/v1/google-pay/authorize",e).then(this.validate(se))}},oi=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(ue))}async readAllMessages(e){return this.httpClient.put(`sdk/v1/rooms/${e.roomId}/messages/read`).then(e=>e.data)}},ai=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(pe))}async getProfessionalPublicProfile(e){return this.httpClient.get(`/profile/v1/public/professionals/${e.hash}`).then(e=>e.data).then(this.validate(he))}async acceptLegalConsent(e){return this.httpClient.post("/profile/v1/legal-consent",e)}},li=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(ve))}async getUnreadMessagesCount(e){return this.httpClient.get(`chat/v1/${e.roomId}/unread-count`).then(e=>e.data).then(this.validate(we))}async createSupportRoom(e){return this.httpClient.post("chat/v1/support-room",e).then(e=>e.data).then(this.validate(Ce))}},ci=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(x))}async getProfessionalsBySpecialtyAndService(e){return this.httpClient.get("/schedules/v1/professionals",{params:e}).then(e=>e.data).then(this.validate(P))}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(k))}async getScheduleServiceSpecialities(e){return this.httpClient.get(`/schedules/v1/services/${e}/specialities`).then(e=>e.data).then(this.validate(N))}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(U))}};var ui={development:"https://chat-dev.mediquo.com",production:"https://chat.mediquo.com"},di=class{constructor({env:e="production",baseURL:t,debug:n,apiKey:i,token:r,locale:s}={}){const o=t??ui[e];var a;this.httpClient=(a=o,Fn.create({baseURL:a,headers:{"Content-Type":"application/json"}}));const l=(c={debug:n},e=>t=>{const n=e.safeParse(t.data);if(n.error&&c?.debug){const e=t.config?.url??"";console.warn(`[Validation Error]${e?` - URL: ${e}`:""}\n${i=n.error,i.issues.map(e=>`${e.path.join(".")}: ${e.message}`).join("\n")}`)}var i;return n.data??t.data});var c;this.flash=new ii(this.httpClient,l),this.auth=new ei(this.httpClient,l),this.appointments=new Yn(this.httpClient,l),this.payments=new si(this.httpClient,l),this.schedules=new ci(this.httpClient,l),this.organizations=new ri(this.httpClient,l),this.profile=new ai(this.httpClient,l),this.professionals=new oi(this.httpClient,l),this.rooms=new li(this.httpClient,l),this.documents=new ni(this.httpClient,l),this.consultations=new ti(this.httpClient,l),i&&this.setApiKey(i),r&&this.setAuthToken(r),s&&this.setLanguage(s)}setAuthToken(e){this.httpClient.defaults.headers.common.Authorization=`Bearer ${e}`}setApiKey(e){this._apiKey=e,this.httpClient.defaults.headers.common["x-api-key"]=e}getApiKey(){return this._apiKey}setLanguage(e){this.httpClient.defaults.headers.common["Accept-Language"]=e}};function pi({env:e,apiKey:t,token:n,locale:i}={}){const r=e??b.MODE;return new di({env:r,debug:"development"===r,apiKey:t,token:n,locale:i})}const hi=["env","apiKey","token","locale","inheritedApiClient"];function fi(e,t,n){if(hi.some(t=>e.has(t)))return t.apiKey||t.token||t.locale||!n?pi({...t,apiKey:t.apiKey??n?.getApiKey()}):n}export{_ as A,R as C,I as D,fe as M,te as P,T as S,w as a,Hn as b,pi as c,Q as d,M as e,K as f,de as g,S as h,O as i,fi as n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as n}from"./api-chat-client-
|
|
1
|
+
import{P as n}from"./api-chat-client-5LVJAeLW.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 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-Bj8p7kJX.js";import{A as s}from"./api-client-context-V1UAGtKW.js";import{C as r,D as l,i as d}from"./api-chat-client-5LVJAeLW.js";import{g as c,a as p}from"./chunk-2TKJJNS7-BGwxtEg7.js";import{a as m}from"./addSeconds-ofMnxlgT.js";import{a as h,i as u,E as f,x as g}from"./lit-element-DiWJYFwC.js";import{n as v}from"./property-scuRaFcM.js";import{getLocale as y}from"../i18n.js";import{calendarIcon as b}from"../ui/icons/calendar-icon.js";import{clockIcon as x}from"../ui/icons/clock-icon.js";import{r as w}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as $}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as k}from"./chunk-S5RWG6G2-DPesx3Od.js";import{messageBubbleIcon as z}from"../ui/icons/message-bubble-icon.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as q}from"./consume-CovVqBjI.js";import{Q as j}from"./query-controller-BlO1Ax65.js";import{g as C}from"./chunk-Y4EKUX25-QqMl3eiq.js";import"../ui/mq-page-title.js";import{downloadIcon as _}from"../ui/icons/download-icon.js";import{b as S}from"./blob-to-base64-CUL1trde.js";import{DownloadFileEvent as D,MqViewAppointmentsEvent as T}from"../events.js";import{M as I}from"./mutation-controller-CR2qcqhH.js";import{g as O,t as P,b as E,a as F,c as U,e as H}from"./telemetry-client-DEIuDZfA.js";let N=class ChatCta extends h{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new j(this,()=>C(this.apiClient,{roomId:this.roomId}))}static{this.styles=[u`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return g`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${$({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${z({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?g`<mq-unread-badge></mq-unread-badge>`:f}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?g`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:f}</mq-floating-bubble>`}};t([q({context:s,subscribe:!0})],N.prototype,"apiClient",void 0),t([v({type:Number})],N.prototype,"roomId",void 0),t([v({type:String})],N.prototype,"professionalHash",void 0),t([v({type:String})],N.prototype,"text",void 0),t([v({type:String})],N.prototype,"consultationId",void 0),t([v({type:Boolean,reflect:!0})],N.prototype,"readonly",void 0),t([v({attribute:!1})],N.prototype,"onOpenChat",void 0),t([q({context:k})],N.prototype,"loginToken",void 0),t([w()],N.prototype,"isChatOpen",void 0),N=t([o(),e("chat-cta")],N);let Q=class PageLayout extends h{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=u`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return g`<div><main><slot></slot></main></div>`}};t([v({type:Boolean,attribute:"y-centered"})],Q.prototype,"yCentered",void 0),t([v({type:String})],Q.prototype,"background",void 0),Q=t([e("page-layout")],Q);const R=u`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let A=class PatientDocument extends h{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=R}getFormatter(){const t=y().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await this.apiClient.flash.downloadDocument({url:this.downloadUrl}),e=await S(t);this.dispatchEvent(new D({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case l.prescription:return i("Receta");case l.report:return i("Informe");case l.diagnosticTestPrescription:return i("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return g`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${_({size:24})}</mq-button>`}};t([q({context:s,subscribe:!0})],A.prototype,"apiClient",void 0),t([v({type:String})],A.prototype,"kind",void 0),t([v({type:String})],A.prototype,"filename",void 0),t([v({type:String})],A.prototype,"specialty",void 0),t([v({type:String})],A.prototype,"description",void 0),t([v({type:String})],A.prototype,"date",void 0),t([v({type:String})],A.prototype,"downloadUrl",void 0),t([w()],A.prototype,"isDownloading",void 0),A=t([o(),e("patient-document")],A);const B=u`mq-page-title{margin:var(--size-3) 0}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let G=class DocumentationView extends h{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await this.apiClient.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new j(this,()=>O(this.apiClient)),this._reconnectMutation=new I(this,{mutationFn:t=>this.apiClient.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=B}firstUpdated(){P.track(E(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.appointment.has_chat_in_appointment,e=y(),o=e.replace("_","-"),a=c(this.loginToken.patient.timezone),s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),l=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),h=new Date(this.appointment.start_date),u=m(h,this.appointment.duration),v=a?p(a,h):"";return g`<mq-page-title .title="${i("Consulta finalizada")}" back-label="${i("Salir")}" @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new T({tab:"history"}))}}"></mq-page-title><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${b()}</dt><dd>${r.format(h)}</dd></div><div class="description-list-item"><dt>${x()}</dt><dd>${l.format(h)} - ${l.format(u)}${v?` (${v})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>g`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?g`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>g`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return F(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{P.track(U(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?g`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:f} ${t?g`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${d(this.appointment.expires_at)}" .onOpenChat="${()=>{P.track(H(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:f}</div>`}};t([q({context:s,subscribe:!0})],G.prototype,"apiClient",void 0),t([v({type:Object})],G.prototype,"appointment",void 0),t([v({type:String})],G.prototype,"token",void 0),t([v({type:Boolean,attribute:"can-reconnect"})],G.prototype,"canReconnect",void 0),t([q({context:k})],G.prototype,"loginToken",void 0),G=t([o(),e("documentation-view")],G);
|
|
@@ -28,21 +28,3 @@ declare global {
|
|
|
28
28
|
"patient-document": PatientDocument;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Presentational page frame: a centered content column with an optional
|
|
34
|
-
* "provided by mediquo" branding footer. Pure chrome — no navigation. Shared
|
|
35
|
-
* across features that need a full-screen wizard-style layout.
|
|
36
|
-
*/
|
|
37
|
-
declare class MQLayout extends LitElement {
|
|
38
|
-
static styles: lit.CSSResult;
|
|
39
|
-
background: "solid" | "default" | "transparent";
|
|
40
|
-
variant: "default" | "wide";
|
|
41
|
-
showMediquoBranding: boolean;
|
|
42
|
-
render(): lit_html.TemplateResult<1>;
|
|
43
|
-
}
|
|
44
|
-
declare global {
|
|
45
|
-
interface HTMLElementTagNameMap {
|
|
46
|
-
"mq-layout": MQLayout;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as o}from"./consume-CovVqBjI.js";import{A as n}from"./api-client-context-V1UAGtKW.js";import{i as a,a as s,x as r}from"./lit-element-DiWJYFwC.js";import{n as l}from"./property-scuRaFcM.js";import{r as h}from"./state-LQivXIgA.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as c}from"./mutation-controller-CR2qcqhH.js";import{setEnv as d}from"../env.js";import{c as m,n as p}from"./api-chat-client-
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as o}from"./consume-CovVqBjI.js";import{A as n}from"./api-client-context-V1UAGtKW.js";import{i as a,a as s,x as r}from"./lit-element-DiWJYFwC.js";import{n as l}from"./property-scuRaFcM.js";import{r as h}from"./state-LQivXIgA.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as c}from"./mutation-controller-CR2qcqhH.js";import{setEnv as d}from"../env.js";import{c as m,n as p}from"./api-chat-client-5LVJAeLW.js";const g=a`.page-header{box-sizing:border-box;width:100%;display:none}.page-title{font-family:var(--font-body);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.page-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.page-subtitle{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-subtle)}.page-subtitle ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-section{box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--sp-6);background-color:var(--color-neutrals-background-weak);padding:var(--sp-6);border-radius:var(--border-radius-md)}.terms-title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.terms-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-description{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}.terms-description ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.checkbox-container{display:flex;gap:var(--sp-3);align-items:flex-start;cursor:pointer}.checkbox-label{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);flex:1}@media (min-width:768px){.page-header{display:block;margin-bottom:var(--sp-10)}.page-title{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height)}.page-title ::slotted(*){font-size:inherit;line-height:inherit}.page-subtitle{font-size:var(--text-base);line-height:var(--text-base--line-height)}.page-subtitle ::slotted(*){font-size:inherit;line-height:inherit}.terms-title{font-size:var(--text-2xl);line-height:var(--text-2xl--line-height)}.terms-title ::slotted(*){font-size:inherit;line-height:inherit}.terms-description{font-size:var(--text-base);line-height:var(--text-base--line-height)}.terms-description ::slotted(*){font-size:inherit;line-height:inherit}.checkbox-label{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`;let v=class MqTermsAndConditions extends s{constructor(){super(...arguments),this.disabled=!1,this.hasCommercialCommunications=!1,this._accepted=!1,this.apiClient=m(),this.acceptLegalConsentMutation=new c(this,{mutationFn:async t=>this.apiClient.profile.acceptLegalConsent(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("continue"))}})}static{this.styles=g}willUpdate(t){t.has("env")&&this.env&&d(this.env);const e=p(t,{env:this.env,apiKey:this.apiKey,token:this.token},this.inheritedApiClient);e&&(this.apiClient=e)}handleCheckboxChange(t){this._accepted=t.detail.checked}handleContinue(){this._accepted&&!this.disabled&&this.acceptLegalConsentMutation.run({terms_accepted:!0,privacy_accepted:!0,commercial_accepted:this.hasCommercialCommunications})}render(){const t=!this._accepted||this.disabled;return r`<div class="page-header"><div class="page-title"><slot name="page-title"></slot></div><div class="page-subtitle"><slot name="page-subtitle"></slot></div></div><div class="terms-section"><div><div class="terms-title"><slot name="terms-title"></slot></div><div class="terms-description"><slot name="terms-description"></slot></div></div><div class="checkbox-container"><mq-checkbox id="terms-checkbox" @change="${this.handleCheckboxChange}" ?disabled="${this.disabled}"></mq-checkbox><label class="checkbox-label" for="terms-checkbox"><slot name="checkbox-label"></slot></label></div><mq-button variant="primary" size="md" fullwidth ?disabled="${this.acceptLegalConsentMutation.isPending||t}" @click="${this.handleContinue}"><slot name="button-text"></slot></mq-button></div>`}};t([l({type:Boolean})],v.prototype,"disabled",void 0),t([l({type:Boolean})],v.prototype,"hasCommercialCommunications",void 0),t([l({type:String,attribute:"api-key"})],v.prototype,"apiKey",void 0),t([l({type:String,attribute:"token"})],v.prototype,"token",void 0),t([l({type:String,attribute:"env"})],v.prototype,"env",void 0),t([h()],v.prototype,"_accepted",void 0),t([o({context:n,subscribe:!0}),h()],v.prototype,"inheritedApiClient",void 0),t([i({context:n}),h()],v.prototype,"apiClient",void 0),v=t([e("mq-terms-and-conditions")],v);export{v as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as t}from"./chunk-6CCJWPGL-TiaqZaPV.js";import{_ as e,c as o}from"./custom-element-D2ziPxYE.js";import{t as i,d as r,a}from"./telemetry-client-DEIuDZfA.js";import{i as s,a as n,x as d,E as l}from"./lit-element-DiWJYFwC.js";import{n as c}from"./property-scuRaFcM.js";import{c as p}from"./consume-CovVqBjI.js";import{m}from"./runtime-Bg1WXVCx.js";import{l as h}from"./localized-decorator-BlOuLhym.js";import{A as f}from"./api-client-context-V1UAGtKW.js";import{D as u}from"./api-chat-client-5LVJAeLW.js";import{b as g}from"./blob-to-base64-CUL1trde.js";import{r as y}from"./state-LQivXIgA.js";import{DownloadFileEvent as v}from"../events.js";import{getLocale as w}from"../i18n.js";import{download02Icon as b}from"../ui/icons/download-02-icon.js";import"../ui/mq-button.js";import{toast as x}from"../ui/mq-toast.js";import"../ui/mq-skeleton.js";function k(e,o){return{queryKey:t(e,"patient-documents",o),queryFn:()=>e.flash.getPatientDocuments(o)}}const $=s`:host{display:flex;align-items:center;gap:var(--sp-3);padding:var(--sp-1) 0;width:100%;min-width:0;box-sizing:border-box}.details{display:flex;flex-direction:column;align-items:flex-start;gap:6px;flex:1;min-width:0}.tag{display:inline-flex;align-items:center;border-radius:var(--border-radius-sm);padding:var(--sp-1) var(--sp-2);font-family:var(--font-body);font-size:var(--text-xs);line-height:1.35;font-weight:var(--font-weight-normal)}.tag.prescription{background-color:var(--color-feedback--info-subtle,#eceefd);color:var(--color-feedback--info-text,#4a1ea7)}.tag.report{background-color:var(--color-feedback--warning-subtle,#ffebce);color:var(--color-feedback--warning-text,#8f4700)}.tag.diagnostic-test-prescription{background-color:var(--color-feedback--success-subtle,#e8f6ec);color:var(--color-feedback--success-text,#16653a)}.text{display:flex;flex-direction:column;gap:var(--sp-1);width:100%;min-width:0}.name{font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--primary,#0a0a22);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.meta{font-family:var(--font-body);font-size:var(--text-xs);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--secondary,#6d658b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let j=class DocumentRow extends n{constructor(){super(...arguments),this.documentId="",this.name="",this.specialty="",this.date="",this.downloadUrl="",this.patientHash="",this.isDownloading=!1,this.handleDownload=async()=>{this.isDownloading=!0;try{i.track(r(this.patientHash,this.documentId));const t=await this.apiClient.flash.downloadDocument({url:this.downloadUrl}),e=await g(t);this.dispatchEvent(new v({url:e,filename:`${this.name}.pdf`}))}catch{x.error(m("No hemos podido descargar el documento."))}finally{this.isDownloading=!1}}}static{this.styles=$}formatDate(){const t=new Date(this.date);if(Number.isNaN(t.getTime()))return"";const e=w().replace("_","-");return new Intl.DateTimeFormat(e,{day:"2-digit",month:"2-digit",year:"2-digit"}).format(t)}formatKind(){switch(this.kind){case u.prescription:return m("Receta");case u.report:return m("Informe");case u.diagnosticTestPrescription:return m("Orden médica")}}get kindClass(){return(this.kind??"").replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}get metaLine(){return[this.formatDate(),this.specialty].filter(Boolean).join(" - ")}render(){return d`<div class="details"><span class="tag ${this.kindClass}">${this.formatKind()}</span><div class="text"><span class="name" title="${this.name}">${this.name}</span> <span class="meta">${this.metaLine}</span></div></div><mq-button variant="outline" size="icon-lg" aria-label="${m("Descargar documento")}" ?disabled="${this.isDownloading}" @click="${this.handleDownload}">${b({size:24})}</mq-button>`}};function D(t,e,o){return t.map(t=>{const i=e?.find(e=>Number(e.id)===Number(t.professional.speciality_id));return{documentId:t.document_id,kind:t.document_type,name:t.name,specialty:a(i?.code??"",o,i?.name??t.professional.speciality_name),date:t.created_at,downloadUrl:t.url}})}e([p({context:f,subscribe:!0})],j.prototype,"apiClient",void 0),e([c({type:String})],j.prototype,"documentId",void 0),e([c({type:String})],j.prototype,"kind",void 0),e([c({type:String})],j.prototype,"name",void 0),e([c({type:String})],j.prototype,"specialty",void 0),e([c({type:String})],j.prototype,"date",void 0),e([c({type:String})],j.prototype,"downloadUrl",void 0),e([c({type:String})],j.prototype,"patientHash",void 0),e([y()],j.prototype,"isDownloading",void 0),j=e([h(),o("document-row")],j);const q=s`:host{display:flex;flex-direction:column;gap:var(--sp-3);width:100%;min-width:0;box-sizing:border-box}.divider{height:1px;width:100%;background-color:var(--color-border-subtle,#edecf1);flex-shrink:0}`;let z=class DocumentList extends n{constructor(){super(...arguments),this.documents=[],this.patientHash="",this.placeholders=0}static{this.styles=q}get rows(){return this.placeholders>0?Array.from({length:this.placeholders},()=>d`<mq-skeleton height="${"77px"}"></mq-skeleton>`):this.documents.map(t=>d`<document-row documentId="${t.documentId}" kind="${t.kind}" name="${t.name}" specialty="${t.specialty}" date="${t.date}" downloadUrl="${t.downloadUrl}" patientHash="${this.patientHash}"></document-row>`)}render(){const t=this.rows;return t.map((e,o)=>d`${e} ${o<t.length-1?d`<div class="divider"></div>`:l}`)}};e([c({type:Array})],z.prototype,"documents",void 0),e([c({type:String})],z.prototype,"patientHash",void 0),e([c({type:Number})],z.prototype,"placeholders",void 0),z=e([o("document-list")],z);export{k as g,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as o}from"./custom-element-D2ziPxYE.js";import{m as C}from"./runtime-Bg1WXVCx.js";import{l as a}from"./localized-decorator-BlOuLhym.js";import{a as r,i as n,x as e}from"./lit-element-DiWJYFwC.js";import{n as i}from"./property-scuRaFcM.js";let d=class MQLayout extends r{constructor(){super(...arguments),this.background="default",this.variant="default",this.showMediquoBranding=!0}static{this.styles=n`:host{--content-max-width:560px;display:flex;flex-direction:column;height:100%;width:100%;max-width:var(--content-max-width);margin:0 auto;background-color:var(--color-background)}:host([background=solid]){background-color:var(--color-background)}:host([background=transparent]){background-color:transparent}:host([variant=wide]){--content-max-width:1000px}.content{flex:1;padding:var(--mq-layout-padding,0)}footer{display:flex;flex-direction:column;align-items:center;gap:var(--sp-4);padding-top:var(--sp-10);padding-bottom:var(--sp-3);padding-inline:var(--mq-layout-padding,0);margin-bottom:var(--sp-3);text-align:center}.branding{display:flex;justify-content:center;align-items:center;gap:var(--size-2);font-family:var(--font-body);font-size:var(--text-sm);line-height:normal;font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}`}render(){return this.showMediquoBranding?e`<div class="content"><slot></slot></div><footer><div class="branding">${C("Servicio y plataforma prestados por")} ${e`<svg width="82" height="16" viewBox="0 0 82 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M52.4506 8.97739V10.5665C52.4506 11.1054 52.0077 11.5477 51.4682 11.5477C50.9288 11.5477 50.486 11.1054 50.486 10.5665V8.97739H48.8531C48.3276 8.97739 47.8984 8.54894 47.8984 8.02383C47.8984 7.49893 48.3276 7.07053 48.8531 7.07053H50.486V5.48128C50.486 4.94243 50.9288 4.5002 51.4682 4.5002C52.0077 4.5002 52.4506 4.94243 52.4506 5.48128V7.07053H54.0836C54.609 7.07053 55.0379 7.49893 55.0379 8.02383C55.0379 8.54894 54.609 8.97739 54.0836 8.97739H52.4506ZM56.8563 5.46693C56.055 3.75203 54.5229 2.55033 52.6531 2.16979C52.3272 2.10809 51.9339 2.06818 51.5273 2.05679C48.7327 2.10005 46.4191 3.93204 45.7665 6.6209C45.397 8.13705 45.6843 9.78156 46.555 11.134C47.4258 12.4867 48.8053 13.431 50.3396 13.7243C51.7168 13.9883 53.0199 13.8046 54.2312 13.1767L54.2853 13.1506C54.554 13.0306 54.8304 12.9977 55.1481 13.0559L55.2243 13.0728C55.8277 13.2312 56.4308 13.389 57.0345 13.5467C56.8787 12.9784 56.7231 12.4168 56.5656 11.86L56.5512 11.8035C56.4673 11.4258 56.5163 11.0837 56.7011 10.7579C57.5947 9.11014 57.6548 7.17549 56.8563 5.46693ZM59.2901 15.5846C59.0891 15.8486 58.7811 16 58.4446 16C58.2872 16 58.1621 15.967 58.0617 15.9405L57.0944 15.6878C56.3739 15.4997 55.6553 15.312 54.936 15.1233C53.8594 15.6379 52.7204 15.8988 51.5464 15.8988C51.0243 15.8988 50.4877 15.8466 49.9521 15.7439C47.8668 15.3452 45.9973 14.0703 44.823 12.2461C43.6488 10.4223 43.2634 8.19505 43.7656 6.13553C44.6446 2.51324 47.7615 0.0472629 51.5211 0.000260881L51.5409 0L51.5605 0.000391321C52.0913 0.0140876 52.5926 0.0651767 53.0508 0.152094C55.5798 0.666768 57.6424 2.28597 58.7224 4.59729C59.7655 6.82947 59.7232 9.34593 58.6144 11.5401C58.8921 12.5275 59.1643 13.5268 59.4414 14.5471C59.4869 14.7106 59.6124 15.1611 59.2901 15.5846ZM79.7577 8.77869C79.7577 7.05748 78.5162 5.63246 76.7557 5.63246C74.9582 5.63246 73.8092 7.03887 73.8092 8.7416V8.77869C73.8092 10.4814 75.0508 11.9064 76.7927 11.9064C78.6089 11.9064 79.7577 10.4999 79.7577 8.81573V8.77869ZM76.7557 13.868C73.7722 13.868 71.5669 11.5915 71.5669 8.81573V8.77869C71.5669 5.98404 73.7907 3.67068 76.7927 3.67068C79.7949 3.67068 82 5.94717 82 8.7416V8.77869C82 11.5545 79.7764 13.868 76.7557 13.868ZM68.7934 13.7387C68.1816 13.7387 67.6628 13.2571 67.6628 12.6281V12.1285C67.0328 13.0538 66.1247 13.8495 64.6051 13.8495C62.4 13.8495 61.1213 12.3691 61.1213 10.0925V4.89208C61.1213 4.2631 61.6216 3.76329 62.2331 3.76329C62.8633 3.76329 63.3637 4.2631 63.3637 4.89208V9.42637C63.3637 10.944 64.1233 11.7951 65.4575 11.7951C66.7547 11.7951 67.6628 10.9071 67.6628 9.38919V4.89208C67.6628 4.2631 68.1631 3.76329 68.7934 3.76329C69.4048 3.76329 69.9236 4.2631 69.9236 4.89208V12.6281C69.9236 13.2386 69.4233 13.7387 68.7934 13.7387ZM40.4153 3.76329C41.0454 3.76329 41.5457 4.2631 41.5457 4.89208V12.6281C41.5457 13.2571 41.0454 13.7387 40.4153 13.7387C39.8038 13.7387 39.3034 13.2571 39.3034 12.6281V4.89208C39.3034 4.2631 39.7852 3.76329 40.4153 3.76329ZM40.4153 2.4678C39.6925 2.4678 39.1368 2.02361 39.1368 1.35732V1.2464C39.1368 0.580156 39.6925 0.154442 40.4153 0.154442C41.1379 0.154442 41.694 0.580156 41.694 1.2464V1.35732C41.694 2.02361 41.1379 2.4678 40.4153 2.4678ZM34.7693 8.7416C34.7693 6.85382 33.435 5.6139 31.9339 5.6139C30.3961 5.6139 29.1173 6.79821 29.1173 8.7416V8.77869C29.1173 10.6665 30.4145 11.9064 31.9339 11.9064C33.435 11.9064 34.7693 10.6476 34.7693 8.77869V8.7416ZM35.8627 13.7387C35.2325 13.7387 34.7321 13.2571 34.7321 12.6281V12.0172C34.0095 13.0353 32.9903 13.8495 31.3966 13.8495C29.0988 13.8495 26.8566 12.0172 26.8566 8.77869V8.7416C26.8566 5.50298 29.0616 3.67068 31.3966 3.67068C33.0088 3.67068 34.028 4.4665 34.7321 5.39189V1.15383C34.7321 0.524632 35.2325 0.0434802 35.8439 0.0434802C36.4742 0.0434802 36.9745 0.524632 36.9745 1.15383V12.6281C36.9745 13.2571 36.4742 13.7387 35.8627 13.7387ZM21.0065 5.50298C19.6353 5.50298 18.6718 6.55763 18.4678 8.07548H23.4897C23.3416 6.63203 22.4892 5.50298 21.0065 5.50298ZM24.6203 9.55589H18.4864C18.7272 11.1477 19.8578 12.0357 21.3032 12.0357C22.2482 12.0357 22.9895 11.7028 23.6196 11.1846C23.7863 11.0548 23.9346 10.981 24.194 10.981C24.6945 10.981 25.0836 11.3698 25.0836 11.8879C25.0836 12.1654 24.9539 12.406 24.787 12.5727C23.8975 13.3683 22.7858 13.868 21.2662 13.868C18.4308 13.868 16.244 11.8136 16.244 8.79712V8.76021C16.244 5.96556 18.227 3.67068 21.0253 3.67068C24.1384 3.67068 25.6765 6.22475 25.6765 8.48246C25.6765 9.1117 25.1948 9.55589 24.6203 9.55589ZM13.7686 13.7387C13.1387 13.7387 12.6382 13.2571 12.6382 12.6281V8.09396C12.6382 6.53915 11.9155 5.70655 10.6555 5.70655C9.43232 5.70655 8.56142 6.55763 8.56142 8.13083V12.6281C8.56142 13.2571 8.06108 13.7387 7.44958 13.7387C6.81941 13.7387 6.3192 13.2571 6.3192 12.6281V8.07548C6.3192 6.55763 5.57796 5.70655 4.33625 5.70655C3.09479 5.70655 2.24235 6.63203 2.24235 8.13083V12.6281C2.24235 13.2571 1.74205 13.7387 1.1118 13.7387C0.500341 13.7387 0 13.2571 0 12.6281V4.89208C0 4.2631 0.481844 3.76329 1.1118 3.76329C1.74205 3.76329 2.24235 4.2631 2.24235 4.89208V5.35475C2.87235 4.48511 3.72475 3.67068 5.22586 3.67068C6.63431 3.67068 7.63481 4.35545 8.15378 5.39189C8.93198 4.35545 9.96987 3.67068 11.4522 3.67068C13.5833 3.67068 14.8804 5.02183 14.8804 7.40919V12.6281C14.8804 13.2571 14.3988 13.7387 13.7686 13.7387Z" fill="#0A0A22"/></svg>`}</div></footer>`:e`<div class="content"><slot></slot></div>`}};t([i({type:String})],d.prototype,"background",void 0),t([i()],d.prototype,"variant",void 0),t([i({type:Boolean,attribute:"show-mediquo-branding"})],d.prototype,"showMediquoBranding",void 0),d=t([a(),o("mq-layout")],d);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { LitElement } from 'lit';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Presentational page frame: a centered content column with an optional
|
|
7
|
+
* "provided by mediquo" branding footer. Pure chrome — no navigation. Shared
|
|
8
|
+
* across features that need a full-screen wizard-style layout.
|
|
9
|
+
*/
|
|
10
|
+
declare class MQLayout extends LitElement {
|
|
11
|
+
static styles: lit.CSSResult;
|
|
12
|
+
background: "solid" | "default" | "transparent";
|
|
13
|
+
variant: "default" | "wide";
|
|
14
|
+
showMediquoBranding: boolean;
|
|
15
|
+
render(): lit_html.TemplateResult<1>;
|
|
16
|
+
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface HTMLElementTagNameMap {
|
|
19
|
+
"mq-layout": MQLayout;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as o}from"./consume-CovVqBjI.js";import{m as n}from"./runtime-Bg1WXVCx.js";import{l as r}from"./localized-decorator-BlOuLhym.js";import{Q as s}from"./query-controller-BlO1Ax65.js";import{A as a}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{A as l,c as m,n as d}from"./api-chat-client-5LVJAeLW.js";import{g as c}from"./next-appointment-card-DxNzffoM.js";import{g as h}from"./get-patient-profile-query-4AO6xvVn.js";import{i as u,a as g,x as y}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{r as x}from"./state-LQivXIgA.js";import{setEnv as v}from"../env.js";import{MqViewAppointmentsEvent as b}from"../events.js";import{isValidLocale as j,setLocale as k}from"../i18n.js";import"./index-DEEAEB_4.js";import"./index-Bw-MbGKw.js";import"../ui/mq-skeleton.js";const w=[l.pending,l.accepted],A=u`:host{display:flex;flex-direction:column;gap:var(--sp-4);width:100%;min-width:0;box-sizing:border-box}:host([empty]){align-self:start}:host([empty]) .card{flex:0 0 auto}.card{display:flex;flex-direction:column;flex:1;min-width:0;box-sizing:border-box;background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--mq-next-appointments-radius,12px);padding:var(--mq-next-appointments-padding,var(--sp-6))}`;let $=class MqNextAppointments extends g{constructor(){super(...arguments),this.apiClient=m(),this.getPatientProfileQuery=new s(this,()=>h(this.apiClient,{enabled:!this.loginToken})),this.getAppointmentsQuery=new s(this,()=>c(this.apiClient,{status:w,order:{field:"starts_at",direction:"asc"},page:1,per_page:1})),this.handleViewAll=()=>{this.dispatchEvent(new b({tab:"next"}))}}static{this.styles=A}willUpdate(t){t.has("env")&&this.env&&v(this.env),t.has("locale")&&this.locale&&j(this.locale)&&k(this.locale);const e=d(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);e&&(this.apiClient=e)}get patientHash(){return this.loginToken?.patient.hash??this.getPatientProfileQuery.result?.data?.hash??""}get accessToken(){return this.token||this.loginToken?.access_token||""}get patientTimezone(){return this.timezone??this.loginToken?.patient.timezone}get isEmpty(){const t=this.getAppointmentsQuery.result;return!0===t?.isSuccess&&!t.data?.data?.[0]}updated(){this.toggleAttribute("empty",this.isEmpty)}renderAppointment(){return this.getAppointmentsQuery.render({complete:t=>{const e=t.data?.[0];return e?y`<next-appointment-card .appointmentResource="${e}" .token="${this.accessToken}" .patientHash="${this.patientHash}" .timezone="${this.patientTimezone}"></next-appointment-card>`:y`<widget-empty-state icon="calendar" heading="${n("No tienes próximas citas")}" description="${n("Cuando agendes una cita, aparecerá aquí para que puedas consultarla, modificarla o cancelarla.")}"></widget-empty-state>`},pending:()=>y`<mq-skeleton height="257px"></mq-skeleton>`,error:()=>y`<widget-empty-state icon="calendar" heading="${n("No hemos podido cargar tu próxima cita")}" description="${n("Vuelve a intentarlo en unos minutos.")}"></widget-empty-state>`})}render(){return y`<section-header heading="${n("Próxima cita")}" action-label="${n("Ver todas")}" @section-action="${this.handleViewAll}"></section-header><div class="card">${this.renderAppointment()}</div>`}};t([f({type:String,attribute:"api-key"})],$.prototype,"apiKey",void 0),t([f({type:String,attribute:"token"})],$.prototype,"token",void 0),t([f({type:String,attribute:"locale"})],$.prototype,"locale",void 0),t([f({type:String,attribute:"env"})],$.prototype,"env",void 0),t([f({type:String,attribute:"timezone"})],$.prototype,"timezone",void 0),t([o({context:p,subscribe:!0})],$.prototype,"loginToken",void 0),t([o({context:a,subscribe:!0}),x()],$.prototype,"inheritedApiClient",void 0),t([i({context:a}),x()],$.prototype,"apiClient",void 0),$=t([r(),e("mq-next-appointments")],$);export{$ as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{e as i}from"./provide-BwI4DDGF.js";import{c as r}from"./consume-CovVqBjI.js";import{m as o}from"./runtime-Bg1WXVCx.js";import{l as s}from"./localized-decorator-BlOuLhym.js";import{Q as n}from"./query-controller-BlO1Ax65.js";import{A as a}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{g as l,t as d,r as c}from"./telemetry-client-DEIuDZfA.js";import{g as m,t as h}from"./index-DG95qEn3.js";import{g as u}from"./get-patient-profile-query-4AO6xvVn.js";import{i as g,a as y,x as f}from"./lit-element-DiWJYFwC.js";import{n as v}from"./property-scuRaFcM.js";import{r as b}from"./state-LQivXIgA.js";import{setEnv as j}from"../env.js";import{MqViewDocumentsEvent as x}from"../events.js";import{isValidLocale as k,setLocale as w,getLocale as S}from"../i18n.js";import{c as $,n as P}from"./api-chat-client-5LVJAeLW.js";import"./index-Bw-MbGKw.js";import"./index-DEEAEB_4.js";const Q=g`:host{display:flex;flex-direction:column;align-self:start;gap:var(--sp-4);width:100%;min-width:0;box-sizing:border-box}.card{display:flex;flex-direction:column;gap:var(--sp-3);min-width:0;box-sizing:border-box;background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--mq-recent-documents-radius,12px);padding:var(--mq-recent-documents-padding,var(--sp-6))}`;let C=class MqRecentDocuments extends y{constructor(){super(...arguments),this.apiClient=$(),this.getPatientProfileQuery=new n(this,()=>u(this.apiClient,{enabled:!this.loginToken})),this.getPatientDocumentsQuery=new n(this,()=>({...m(this.apiClient,{patient_hash:this.patientHash,page:1,per_page:3}),enabled:!!this.patientHash})),this.getOrganizationSpecialtiesQuery=new n(this,()=>l(this.apiClient)),this.handleViewAll=()=>{d.track(c(this.patientHash)),this.dispatchEvent(new x)}}static{this.styles=Q}willUpdate(t){t.has("env")&&this.env&&j(this.env),t.has("locale")&&this.locale&&k(this.locale)&&w(this.locale);const e=P(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);e&&(this.apiClient=e)}get patientHash(){return this.loginToken?.patient.hash??this.getPatientProfileQuery.result?.data?.hash??""}renderEmptyState(){return f`<widget-empty-state icon="document" heading="${o("No tienes documentación")}" description="${o("Aquí se mostrarán tus recetas e informes médicos.")}"></widget-empty-state>`}renderSkeleton(){return f`<document-list placeholders="${3}"></document-list>`}renderError(){return f`<widget-empty-state icon="document" heading="${o("No hemos podido cargar tu documentación")}" description="${o("Vuelve a intentarlo en unos minutos.")}"></widget-empty-state>`}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:t=>0===t.data.length?this.renderEmptyState():f`<document-list .documents="${h(t.data,this.getOrganizationSpecialtiesQuery.result?.data,S())}" patientHash="${this.patientHash}"></document-list>`,initial:()=>this.getPatientProfileQuery.result?.isError?this.renderError():this.renderSkeleton(),pending:()=>this.renderSkeleton(),error:()=>this.renderError()})}render(){return f`<section-header heading="${o("Documentos recientes")}" action-label="${o("Ver todas")}" @section-action="${this.handleViewAll}"></section-header><div class="card">${this.renderDocuments()}</div>`}};t([v({type:String,attribute:"api-key"})],C.prototype,"apiKey",void 0),t([v({type:String,attribute:"token"})],C.prototype,"token",void 0),t([v({type:String,attribute:"locale"})],C.prototype,"locale",void 0),t([v({type:String,attribute:"env"})],C.prototype,"env",void 0),t([r({context:a,subscribe:!0}),b()],C.prototype,"inheritedApiClient",void 0),t([i({context:a}),b()],C.prototype,"apiClient",void 0),t([r({context:p,subscribe:!0})],C.prototype,"loginToken",void 0),C=t([s(),e("mq-recent-documents")],C);export{C as M};
|
package/dist/chunks/{next-appointment-card-Bc65OZ1_.d.ts → next-appointment-card-DBXsY3Sp.d.ts}
RENAMED
|
@@ -4,12 +4,60 @@ import { LitElement } from 'lit';
|
|
|
4
4
|
import { M as MediquoApiChatClient, G as GetAppointmentsResponse } from './index.d-XSe7Hy-Q.js';
|
|
5
5
|
import { L as LoginTokenResponse } from './schemas.d-b6_AekBb.js';
|
|
6
6
|
import './mq-chat-room-jeDvIF1Z.js';
|
|
7
|
-
import './appointment-action-unavailable-dialog-CTiL4nMo.js';
|
|
8
|
-
import './professional-overview-mO3tuMuH.js';
|
|
9
7
|
import '../ui/mq-button.js';
|
|
8
|
+
import '../ui/mq-dialog.js';
|
|
9
|
+
import { P as PriceInCents } from './price.d-CwLosdAN.js';
|
|
10
|
+
import { QueryClient } from '@tanstack/query-core';
|
|
11
|
+
import './professional-overview-mO3tuMuH.js';
|
|
10
12
|
import '../ui/mq-floating-bubble.js';
|
|
11
13
|
import '../ui/mq-unread-badge.js';
|
|
12
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Informational dialog shown when an appointment action (modify, cancel,
|
|
17
|
+
* repeat) is currently unavailable. Purely presentational: the parent owns
|
|
18
|
+
* the copy (already translated) and decides when to open it.
|
|
19
|
+
*
|
|
20
|
+
* Usage:
|
|
21
|
+
* <appointment-action-unavailable-dialog
|
|
22
|
+
* .open=${true}
|
|
23
|
+
* .heading=${"Anular cita"}
|
|
24
|
+
* .message=${"Lo sentimos, ..."}
|
|
25
|
+
* @close=${() => { ... }}
|
|
26
|
+
* ></appointment-action-unavailable-dialog>
|
|
27
|
+
*/
|
|
28
|
+
declare class AppointmentActionUnavailableDialog extends LitElement {
|
|
29
|
+
static styles: lit.CSSResult;
|
|
30
|
+
open: boolean;
|
|
31
|
+
heading: string;
|
|
32
|
+
message: string;
|
|
33
|
+
private handleClose;
|
|
34
|
+
render(): lit_html.TemplateResult<1>;
|
|
35
|
+
}
|
|
36
|
+
declare global {
|
|
37
|
+
interface HTMLElementTagNameMap {
|
|
38
|
+
"appointment-action-unavailable-dialog": AppointmentActionUnavailableDialog;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare class CancelAppointmentConfirmationDialog extends LitElement {
|
|
43
|
+
apiClient: MediquoApiChatClient;
|
|
44
|
+
static styles: lit.CSSResult;
|
|
45
|
+
open: boolean;
|
|
46
|
+
queryClientContext: QueryClient | undefined;
|
|
47
|
+
appointmentId: string;
|
|
48
|
+
price?: PriceInCents;
|
|
49
|
+
private cancelAppointmentMutation;
|
|
50
|
+
private handleClose;
|
|
51
|
+
private handleDismissClick;
|
|
52
|
+
private handleConfirmClick;
|
|
53
|
+
render(): lit_html.TemplateResult<1>;
|
|
54
|
+
}
|
|
55
|
+
declare global {
|
|
56
|
+
interface HTMLElementTagNameMap {
|
|
57
|
+
"cancel-appointment-confirmation-dialog": CancelAppointmentConfirmationDialog;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
13
61
|
declare class NextAppointmentCard extends LitElement {
|
|
14
62
|
static styles: lit.CSSResult;
|
|
15
63
|
apiClient: MediquoApiChatClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e}from"./chunk-6CCJWPGL-TiaqZaPV.js";import{_ as t,c as i}from"./custom-element-D2ziPxYE.js";import{c as n}from"./consume-CovVqBjI.js";import{m as o,s as a}from"./runtime-Bg1WXVCx.js";import{l as s}from"./localized-decorator-BlOuLhym.js";import{Q as r}from"./query-controller-BlO1Ax65.js";import{A as l}from"./api-client-context-V1UAGtKW.js";import{l as p}from"./chunk-S5RWG6G2-DPesx3Od.js";import{i as c,a as d}from"./api-chat-client-5LVJAeLW.js";import{g as m,a as h}from"./chunk-2TKJJNS7-BGwxtEg7.js";import{g as u}from"./get-organization-setup-query-Dr1cXnHl.js";import{g,t as f,f as v,i as b,j as y,k as $,a as x}from"./telemetry-client-DEIuDZfA.js";import{g as C}from"./chunk-Y4EKUX25-QqMl3eiq.js";import{c as w}from"./refund-cancel-policy-QG_OE6g5.js";import{a as k,i as q,x as O,E as j}from"./lit-element-DiWJYFwC.js";import{n as M}from"./property-scuRaFcM.js";import{r as z}from"./state-LQivXIgA.js";import{MqAppointmentJoinVideocallEvent as S,MqAppointmentRescheduleEvent as E}from"../events.js";import{getLocale as I}from"../i18n.js";import{calendarIcon as D}from"../ui/icons/calendar-icon.js";import{dotsHorizontalIcon as R}from"../ui/icons/dots-horizontal-icon.js";import{messageBubbleIcon as _}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as A}from"../ui/icons/phone-icon.js";import{videoIcon as P}from"../ui/icons/video-icon.js";import"../mq-chat-room.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{Q as T}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as U}from"./mutation-controller-CR2qcqhH.js";import{h as N,f as L}from"./price-DU3YLTpk.js";import"./professional-overview-B4E05rLd.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-unread-badge.js";import{toast as H}from"../ui/mq-toast.js";function Q(t,i){return{queryKey:e(t,"appointments",i),queryFn:()=>t.appointments.getAppointments(i)}}function J(e){const{action:t,refundPolicySeconds:i}=e,n=null!=i&&i<3600,s=Math.ceil((i??0)/60),r=Math.ceil((i??0)/3600);return o(0===(n?s:r)?"modify"===t?"Esta cita ya ha pasado, por lo que no se puede modificar.":"Esta cita ya ha pasado, por lo que no se puede anular.":"modify"===t?n?a`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos modificarla.`:a`Lo sentimos, como faltan menos de ${r} horas para tu cita no podemos modificarla.`:n?a`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos anularla.`:a`Lo sentimos, como faltan menos de ${r} horas para tu cita no podemos anularla.`)}let F=class AppointmentActionUnavailableDialog extends k{constructor(){super(...arguments),this.open=!1,this.heading="",this.message="",this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=q`:host{display:contents}mq-dialog::part(dialog){max-width:343px;min-width:0}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.actions{display:flex;margin-top:var(--sp-4)}`}render(){return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${this.heading}</h2><p slot="subheading">${this.message}</p><div class="actions"><mq-button variant="primary" fullwidth @click="${this.handleClose}">${o("Volver")}</mq-button></div></mq-dialog>`}};t([M({type:Boolean,reflect:!0})],F.prototype,"open",void 0),t([M({type:String})],F.prototype,"heading",void 0),t([M({type:String})],F.prototype,"message",void 0),F=t([s(),i("appointment-action-unavailable-dialog")],F);let V=class CancelAppointmentConfirmationDialog extends k{constructor(){super(...arguments),this.open=!1,this.cancelAppointmentMutation=new U(this,{mutationFn:async e=>this.apiClient.appointments.cancelAppointment(e),onSuccess:()=>{this.queryClientContext?.invalidateQueries(),this.dispatchEvent(new CustomEvent("success",{bubbles:!0,composed:!0}))}}),this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleDismissClick=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleConfirmClick=()=>{this.cancelAppointmentMutation.run({id:this.appointmentId})}}static{this.styles=q`:host{display:contents}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.subheading-payable{font-size:var(--text-base);line-height:22px}.price-rows{display:flex;flex-direction:column;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);line-height:var(--text-sm--line-height);color:var(--color-card-foreground);width:100%;margin-bottom:var(--sp-4)}.price-row{display:flex;align-items:center;justify-content:space-between;min-height:34px;gap:var(--sp-2)}.price-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-4);justify-content:flex-end;flex-wrap:wrap}`}render(){const e=I(),t=this.price,i=N(t),n=this.cancelAppointmentMutation.isPending;if(i){const i=L(t,e),a=`-${i}`;return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${o("Confirmar cancelación")}</h2><p slot="subheading" class="subheading-payable">${o("¿Seguro que quieres cancelar esta cita? Se te devolverá el importe pagado en un plazo de 5-10 días hábiles.")}</p><div><div class="price-rows"><div class="price-row"><span>${o("Importe pagado")}</span> <span>${i}</span></div><div class="price-row"><span>${o("Importe a devolver")}</span> <span>${a}</span></div></div><div class="actions"><mq-button variant="outline" ?disabled="${n}" @click="${this.handleDismissClick}">${o("Volver")}</mq-button><mq-button variant="primary" ?disabled="${n}" @click="${this.handleConfirmClick}">${o("Confirmar")}</mq-button></div></div></mq-dialog>`}return O`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${o("Confirmar cancelación")}</h2><p slot="subheading">${o("¿Seguro que quieres cancelar esta cita?")}</p><div><div class="actions"><mq-button variant="outline" ?disabled="${n}" @click="${this.handleDismissClick}">${o("Cancelar")}</mq-button><mq-button variant="primary" ?disabled="${n}" @click="${this.handleConfirmClick}">${o("Confirmar")}</mq-button></div></div></mq-dialog>`}};t([n({context:l,subscribe:!0})],V.prototype,"apiClient",void 0),t([M({type:Boolean,reflect:!0})],V.prototype,"open",void 0),t([n({context:T,subscribe:!0})],V.prototype,"queryClientContext",void 0),t([M({type:String})],V.prototype,"appointmentId",void 0),t([M({type:Object})],V.prototype,"price",void 0),V=t([s(),i("cancel-appointment-confirmation-dialog")],V);const W=q`:host{display:flex;flex-direction:column;justify-content:space-between;gap:var(--sp-6);flex:1;width:100%;min-width:0;box-sizing:border-box;color:var(--color-text-icons--primary,#0a0a22)}professional-overview{--avatar-size-lg:66px;--text-lg--line-height:1.35;display:block}.details{display:flex;flex-direction:column;align-items:flex-start;gap:var(--sp-3)}.detail-row{display:inline-flex;align-items:center;gap:var(--sp-2);font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.footer{display:flex;flex-direction:column;gap:var(--sp-4)}.reminder{font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--secondary,#6d658b);margin:0}.actions{--button-height-md:2.75rem;display:flex;align-items:stretch;gap:10px}.actions>mq-button{flex:1;min-width:0}.overflow{position:relative;flex:0 0 auto}.chat-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-badge{--mq-unread-badge-size:8px;flex-shrink:0}@media (max-width:767px){.actions{flex-wrap:wrap}.actions>mq-button.join{order:1;flex:1 0 100%}}.menu{position:absolute;right:0;bottom:calc(100% + var(--sp-2));z-index:2;display:flex;flex-direction:column;min-width:176px;padding:var(--sp-1);background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--border-radius-lg);box-shadow:var(--shadow-lg)}.menu-item{display:block;width:100%;background:0 0;border:none;border-radius:var(--border-radius-sm);padding:var(--sp-2) var(--sp-3);cursor:pointer;text-align:left;font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;color:var(--color-text-icons--primary,#0a0a22)}.menu-item:hover{background-color:var(--color-muted)}.menu-item.negative{color:var(--color-negative)}`;let B=class NextAppointmentCard extends k{constructor(){super(...arguments),this.token="",this.patientHash="",this.isChatOpen=!1,this.isMenuOpen=!1,this.isCancelDialogOpen=!1,this.openDialog=null,this.getUnreadMessagesQuery=new r(this,()=>({...C(this.apiClient,{roomId:this.appointmentResource?.room?.id}),enabled:!!this.appointmentResource?.room?.id})),this.getOrganizationSetupQuery=new r(this,()=>u(this.apiClient)),this.getOrganizationSpecialtiesQuery=new r(this,()=>g(this.apiClient,{enabled:!!this.appointmentResource?.speciality?.id})),this.closeMenuOnOutsideClick=e=>{e.composedPath().includes(this)||(this.isMenuOpen=!1)},this.closeMenuOnEscape=e=>{"Escape"===e.key&&(this.isMenuOpen=!1)},this.handleJoinVideocall=()=>{f.track(v(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new S({appointmentId:this.appointmentId}))},this.handleToggleChat=()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&f.track(b(this.sessionPatientHash,this.appointmentId))},this.handleModify=()=>{this.isMenuOpen=!1,this.isModifyUnavailable?this.openDialog="modify":(f.track(y(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new E({appointmentId:this.appointmentId})))},this.handleCancel=()=>{this.isMenuOpen=!1,this.isCancelUnavailable?this.openDialog="cancel":(f.track($(this.sessionPatientHash,this.appointmentId)),this.isCancelDialogOpen=!0)}}static{this.styles=W}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.closeMenuOnOutsideClick),document.addEventListener("keydown",this.closeMenuOnEscape)}disconnectedCallback(){document.removeEventListener("click",this.closeMenuOnOutsideClick),document.removeEventListener("keydown",this.closeMenuOnEscape),super.disconnectedCallback()}get appointmentId(){return this.appointmentResource.appointment.id??""}get channel(){return this.appointmentResource.appointment.channel}get sessionToken(){return this.token||this.loginToken?.access_token||""}get sessionPatientHash(){return this.patientHash||this.loginToken?.patient?.hash||""}get sessionTimezone(){return this.timezone??this.loginToken?.patient?.timezone}get unreadCount(){return this.getUnreadMessagesQuery.result?.data?.unread_count??0}get specialtyName(){const e=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>Number(e.id)===Number(this.appointmentResource.speciality?.id));return x(e?.code??"",I(),e?.name??this.appointmentResource.speciality?.name)}get hasChatSupport(){return this.appointmentResource.appointment.has_chat_in_appointment??this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment??!1}get isExpired(){return c(this.appointmentResource.appointment.expires_at)}get refundPolicySeconds(){return this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel}get policyAllowsModifyOrCancel(){return w({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:this.refundPolicySeconds})}get isModifyUnavailable(){return this.isExpired||0===this.appointmentResource.slots.length||!this.policyAllowsModifyOrCancel}get isCancelUnavailable(){return this.isExpired||!this.policyAllowsModifyOrCancel}get modifyUnavailableMessage(){return J({action:"modify",refundPolicySeconds:this.refundPolicySeconds})}get cancelUnavailableMessage(){return J({action:"cancel",refundPolicySeconds:this.refundPolicySeconds})}channelIcon(){switch(this.channel){case d.videocall:return P({size:20});case d.phonecall:return A({size:20});default:return _({size:20})}}channelLabel(){switch(this.channel){case d.videocall:return o("Videoconsulta");case d.phonecall:return o("Consulta telefónica");default:return o("Chat")}}formatWhen(){const e=I().replace("_","-"),t=m(this.sessionTimezone),i=t?{timeZone:t}:{},n=new Date(this.appointmentResource.appointment.starts_at);if(Number.isNaN(n.getTime()))return"";const s=new Intl.DateTimeFormat(e,{weekday:"long",day:"numeric",month:"long",year:"numeric",...i}).format(n),r=new Intl.DateTimeFormat(e,{timeStyle:"short",hourCycle:"h23",...i}).format(n),l=t?h(t,n):"";return o(a`${s}, ${r} h${l?` (${l})`:""}`)}renderActions(){const e=this.channel===d.videocall;return O`<div class="actions">${this.hasChatSupport?O`<mq-button variant="outline" @click="${this.handleToggleChat}"><span class="chat-label">${o("Ir a chat")}</span> ${this.unreadCount>0?O`<mq-unread-badge class="chat-badge"></mq-unread-badge>`:j}</mq-button>`:j} ${e?O`<mq-button class="join" variant="primary" @click="${this.handleJoinVideocall}">${o("Unirse a la videoconsulta")}</mq-button>`:j}<div class="overflow"><mq-button variant="outline" size="icon-lg" aria-label="${o("Más opciones")}" aria-haspopup="menu" aria-expanded="${this.isMenuOpen}" @click="${()=>{this.isMenuOpen=!this.isMenuOpen}}">${R({size:16})}</mq-button>${this.isMenuOpen?O`<div class="menu" role="menu"><button class="menu-item" type="button" role="menuitem" @click="${this.handleModify}">${o("Modificar cita")}</button> <button class="menu-item negative" type="button" role="menuitem" @click="${this.handleCancel}">${o("Anular cita")}</button></div>`:j}</div></div>`}render(){const{professional:e}=this.appointmentResource,t=this.formatWhen();return O`<professional-overview .name="${e.name}" .specialtyName="${this.specialtyName}" .collegiateNumber="${e.collegiate_number??void 0}" .description="${e.description??""}" .languages="${e.languages??[]}" .avatar="${e.avatar??""}"></professional-overview><div class="details">${t?O`<div class="detail-row">${D({size:20})} <span>${t}</span></div>`:j}<div class="detail-row">${this.channelIcon()} <span>${this.channelLabel()}</span></div></div><div class="footer"><p class="reminder">${o("Recibirás un recordatorio 15 minutos antes de la consulta")}</p>${this.renderActions()}</div><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" hideCloseButton @mq-close="${()=>{this.isChatOpen=!1}}">${this.isChatOpen?O`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.sessionToken}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${e.hash}" ?readonly="${this.isExpired}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:j}</mq-floating-bubble><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${o("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${o("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,H.success(o("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentId}}))}}"></cancel-appointment-confirmation-dialog>`}};t([n({context:l,subscribe:!0})],B.prototype,"apiClient",void 0),t([n({context:p,subscribe:!0})],B.prototype,"loginToken",void 0),t([M({type:Object})],B.prototype,"appointmentResource",void 0),t([M({type:String})],B.prototype,"token",void 0),t([M({type:String})],B.prototype,"patientHash",void 0),t([M({type:String})],B.prototype,"timezone",void 0),t([z()],B.prototype,"isChatOpen",void 0),t([z()],B.prototype,"isMenuOpen",void 0),t([z()],B.prototype,"isCancelDialogOpen",void 0),t([z()],B.prototype,"openDialog",void 0),B=t([s(),i("next-appointment-card")],B);export{J as a,Q as g};
|