@mediquo/elements 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/chunks/{api-chat-client-BTBtu01T.js → api-chat-client-C8SqZtCa.js} +1 -1
  2. package/dist/chunks/{apple-pay-outcomes-BlytM6W-.js → apple-pay-outcomes-BNkcTbbM.js} +1 -1
  3. package/dist/chunks/create-component-BB-6Gu6l.js +1 -0
  4. package/dist/chunks/exports-G_7Ih_GH.js +1 -0
  5. package/dist/chunks/{index-B9iWdvW3.js → index-BJcdB5MT.js} +1 -1
  6. package/dist/chunks/index-DiqYAEHW.js +1 -0
  7. package/dist/chunks/{mq-layout-DpzeL9_i.js → mq-layout-CpIZTsV2.js} +1 -1
  8. package/dist/chunks/{price-Dtdjx70D.js → price-tImUmtpX.js} +1 -1
  9. package/dist/chunks/{refund-cancel-policy-Bm5djPds.js → refund-cancel-policy-CnbrIqH0.js} +1 -1
  10. package/dist/chunks/{telemetry-client-CKCb9Gnf.js → telemetry-client-BRVJU-fZ.js} +1 -1
  11. package/dist/env.js +1 -1
  12. package/dist/i18n.js +1 -1
  13. package/dist/mq-apple-pay-checkout.js +1 -1
  14. package/dist/mq-appointment-checkout.js +1 -1
  15. package/dist/mq-chat-room.js +1 -1
  16. package/dist/mq-checkout.js +1 -1
  17. package/dist/mq-google-pay-checkout.js +1 -1
  18. package/dist/mq-immediate-videocall-checkout.js +1 -1
  19. package/dist/mq-my-appointments.js +1 -1
  20. package/dist/mq-schedule-success.js +2 -2
  21. package/dist/mq-schedule.d.ts +2 -2
  22. package/dist/mq-schedule.js +1 -1
  23. package/dist/mq-socket-provider.js +1 -1
  24. package/dist/mq-support-chat.js +1 -1
  25. package/dist/mq-videocall.js +1 -1
  26. package/dist/react/mq-apple-pay-checkout.d.ts +15 -0
  27. package/dist/react/mq-apple-pay-checkout.js +2 -0
  28. package/dist/react/mq-appointment-checkout.d.ts +17 -0
  29. package/dist/react/mq-appointment-checkout.js +2 -0
  30. package/dist/react/mq-chat-room.d.ts +19 -0
  31. package/dist/react/mq-chat-room.js +2 -0
  32. package/dist/react/mq-checkout.d.ts +18 -0
  33. package/dist/react/mq-checkout.js +2 -0
  34. package/dist/react/mq-google-pay-checkout.d.ts +15 -0
  35. package/dist/react/mq-google-pay-checkout.js +2 -0
  36. package/dist/react/mq-immediate-videocall-checkout.d.ts +16 -0
  37. package/dist/react/mq-immediate-videocall-checkout.js +2 -0
  38. package/dist/react/mq-my-appointments.d.ts +29 -0
  39. package/dist/react/mq-my-appointments.js +2 -0
  40. package/dist/react/mq-query-client-provider.d.ts +8 -0
  41. package/dist/react/mq-query-client-provider.js +2 -0
  42. package/dist/react/mq-schedule-success.d.ts +26 -0
  43. package/dist/react/mq-schedule-success.js +2 -0
  44. package/dist/react/mq-schedule.d.ts +31 -0
  45. package/dist/react/mq-schedule.js +2 -0
  46. package/dist/react/mq-socket-provider.d.ts +9 -0
  47. package/dist/react/mq-socket-provider.js +2 -0
  48. package/dist/react/mq-support-chat.d.ts +15 -0
  49. package/dist/react/mq-support-chat.js +2 -0
  50. package/dist/react/mq-theme-provider.d.ts +8 -0
  51. package/dist/react/mq-theme-provider.js +2 -0
  52. package/dist/react/mq-videocall.d.ts +25 -0
  53. package/dist/react/mq-videocall.js +2 -0
  54. package/dist/ui/mq-calendar.js +1 -1
  55. package/dist/ui/mq-clamped-text.js +1 -1
  56. package/dist/ui/mq-toast.js +1 -1
  57. package/package.json +25 -4
  58. package/dist/chunks/exports-XZaVrMLd.js +0 -1
  59. package/dist/chunks/index-BYHKNPG2.js +0 -1
@@ -1 +1 @@
1
- import{o as e,n as t,a as n,z as r,s as i,e as s,b as o,r as a,u as l,c,d as u,f as d,g as p,h,i as f}from"./external-zAbuzxDj.js";import{p as m}from"./parseISO-jT42c8Ob.js";import{f as g}from"./format-Cm3B1GMy.js";import{i as b}from"./isBefore-Cof0D841.js";import{env as y}from"../env.js";function _(r){return e({data:n(r),meta:e({current_page:t(),last_page:t(),per_page:t(),total:t()})})}var v=r.enum(["prescription","report","diagnosticTestPrescription"]),w=v.enum,E=r.enum(["published","draft"]);E.enum;var C=r.object({document_id:r.string().uuid(),document_type:v,name:r.string(),professional:r.object({speciality_id:r.number()}),status:E,url:r.string().url(),created_at:r.string()}),R=e({hash:i(),profile:e({first_name:i().nullable(),last_name:i().nullable(),birth_date:i().nullable(),gender:s(["male","female"]).nullable(),email:i().nullable(),phone_prefix:i().nullable(),phone:i().nullable(),billing:e({tax_id:i().nullable(),address:i().nullable(),country_code:i().nullable(),region:i().nullable(),postal_code:i().nullable()})})});function O(e){const t=e?.profile;return`${t?.first_name??""} ${t?.last_name??""}`.trim()}function S(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)}function A(e){return m(`${e.replace(" ","T")}Z`)}function T(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()));return g(t,"yyyy-MM-dd HH:mm:ss")}function j(e,t){try{const n=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"shortOffset"}).formatToParts(t);return n.find(e=>"timeZoneName"===e.type)?.value??""}catch{return""}}var x=r.enum(["pending","expired","accepted","inCall","declined","cancelled","finished","free_of_charge","owed","unpaid","reporting"]),P=x.enum,k=r.enum(["videocall","chat","phonecall"]),N=k.enum,U=r.object({id:r.string().uuid(),room_id:r.string(),channel:k,consultation_short_url:r.string().url().nullable(),call_id:r.string().url(),duration:r.number(),from:r.object({hash:r.string(),name:r.string().nullable(),avatar:r.string().url().nullable(),speciality:r.string().nullable(),collegiate_number:r.string().nullable(),is_dismissed:r.boolean(),languages:r.array(r.string()),description:r.string().nullable()}),to:r.object({id:r.number(),hash:r.string(),name:r.string().nullable(),avatar:r.string().url().nullable(),is_dismissed:r.boolean()}),speciality_id:r.number().nullable(),created_at:r.string(),status:x,seconds_to_open:r.number().nonnegative(),start_date:r.string(),started_at:r.string().nullable(),expires_at:r.string().nullable(),consultation_reason:r.string().nullable(),preconsultation_documents:r.array(r.object({file_path:r.string(),file_name:r.string(),id:r.string().uuid()})).nullable(),service_id:r.string().uuid().nullable(),price:r.number().nullable().optional(),currency:r.string().nullable().optional(),discount_amount:r.number().nullable().optional()}),D=r.enum(["appointment","chat","immediate"]),L=D.enum;function F(e){return 0===e.seconds_to_open}function B(e){if(!e)return!1;const t=new Date,n=A(e);return b(n,t)}r.object({appointmentId:r.string()});var I=U;r.object({callId:r.string()});var $=r.object({session_id:r.string(),session_token:r.string()});r.object({professional_hash:r.string(),consultation_id:r.string(),consultation_type:r.enum(["appointment"])}),r.object({professional_hash:r.string(),consultation_id:r.string(),consultation_type:r.enum(["appointment"])}),r.object({appointment_id:r.string()});var M=r.array(C);r.object({url:r.string().url()}),r.object({first_name:R.shape.profile.shape.first_name,last_name:R.shape.profile.shape.last_name,tax_id:R.shape.profile.shape.billing.shape.tax_id,birth_date:R.shape.profile.shape.birth_date,gender:R.shape.profile.shape.gender.optional(),email:R.shape.profile.shape.email,phone_prefix:R.shape.profile.shape.phone_prefix,phone:R.shape.profile.shape.phone,terms_accepted:r.boolean(),privacy_accepted:r.boolean()}),r.object({patient_hash:r.string(),page:r.number().optional(),per_page:r.number().optional()});var q=_(C),z=r.array(r.object({id:r.number(),name:r.string(),code:r.string()})),H=r.object({primary_color:r.string().nullable(),logo:r.string().nullable(),favicon:r.string().nullable(),support_professional:r.object({hash:r.string().nullable()}).optional(),home:r.object({title:r.string().nullable(),description:r.string().nullable(),image_url:r.string().nullable()}),appointments:r.object({reserve_conditions:r.string().nullable(),seconds_before_start_to_refund_on_cancel:r.number().nullable(),has_nps:r.boolean().optional(),has_chat_in_appointment:r.boolean().optional(),has_discount_coupons_show:r.boolean().optional()}),legal_consent:r.object({terms_url:r.string().nullable(),privacy_url:r.string().nullable()})});e({slot_id:i().uuid(),service_id:i().uuid(),specialty_id:i(),consultation_reason:i().optional(),preconsultation_documents:n(e({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var J=e({id:i(),percent_off:t(),code:i(),after_discount_amount:t().nullable()}),W=e({id:i(),percent_off:t(),code:i(),name:i().nullish()}),V=e({session_id:i(),payment_link:i().url()});e({video_call_schedule_id:i()});var K=V,X={Paid:"paid",Unpaid:"unpaid",Denied:"denied"},G=e({status:o(X),consultation_id:i(),consultation_type:i()});e({order_id:i(),validation_url:i().url()});var Z=a(l());e({order_id:i(),token:i()});var Q=e({data:e({status:o(X),consultation_id:i(),consultation_type:i().optional()})});e({order_id:i(),token:i()});var Y=e({data:e({status:o(X),consultation_id:i(),consultation_type:i().optional()})}),ee=s(["monday","tuesday","wednesday","thursday","friday","saturday","sunday","working_week","weekend","all_week"]);ee.enum;var te=e({days_of_week:ee,from_time:i(),to_time:i()});e({hash:i().uuid()});var ne=e({hash:i().uuid(),active_absence:e({id:i().uuid(),finishes_at:i()}).nullable(),avatar:i().url().nullable(),collegiate_number:i().nullable(),description:i().nullable(),is_available:c(),name:i(),overview:i().nullable(),schedule_description:i().nullable(),speciality_id:t().nullable(),status:s(["online","offline"]),title:i().nullable(),chat_schedule:e({channel:k,duration:t(),name:i(),timezone:i(),starts_at:i(),gaps:n(te)}).nullable()});function re(e){return e.active_absence?"absent":"online"===e.status?"online":"offline"}s(["online","offline","absent"]),e({roomId:t()});var ie=R;e({first_name:i(),last_name:i(),tax_id:i(),birth_date:i(),gender:s(["male","female"]),email:i(),phone_prefix:i(),phone:i(),terms_accepted:c(),privacy_accepted:c()}),e({terms_accepted:c(),privacy_accepted:c(),commercial_accepted:c()}),e({hash:i().uuid()});var se=e({id:t(),hash:i().uuid(),speciality_alias:i(),name:i(),avatar:i().url(),description:i(),collegiate_number:i(),languages:n(i()),centers:n(e({id:i().uuid(),name:i()}))});u([p(1),p(2),p(3)]);var oe={Sent:1,Received:2,Read:3},ae=e({roomId:t(),messageId:i().uuid(),string:i(),status:t(),senderType:s(["ordinary","system"]),fromUserHash:i().uuid(),auto:u([p(0),p(1)]),createdAt:i().nullable(),deletedAt:i().nullable(),time:t().nullable()}),le=e({file_name:i(),file_size:t(),url:i().url(),signed_url:i().url().nullable(),type:s(["uncategorized","voice_note"]),meta:e({duration:t()})}),ce=ae.extend({type:p("string"),attachment:d()}),ue=ae.extend({type:p("file"),attachment:le}),de=ae.extend({type:p("image"),attachment:le});e({roomId:t()});var pe=n(u([ce,ue,de]));e({roomId:t()});var he=e({unread_count:t()});e({professional_hash:i()});var fe=e({room_id:t()}),me=s(["available","reserved"]),ge=me.enum,be=e({id:i().uuid(),channel:k,duration:t(),starts_at:i(),finishes_at:i(),professional:e({id:i().uuid(),name:i()}),services:n(e({id:i().uuid(),name:i()})),speciality:e({id:t(),price:e({amount:t(),currency:i()}).nullish()}),status:me}),ye=r.array(r.object({id:r.string().uuid(),name:r.string(),code:r.string(),channel:k,price:r.object({amount:r.number(),currency:r.string()}).nullable()})),_e=r.array(r.object({id:r.string().uuid(),avatar:r.string().url().nullable(),description:r.string().nullable(),collegiate_number:r.string().nullable(),languages:r.array(r.string()),name:r.string(),slots:r.array(be),speciality:r.object({id:r.number()}),tax_id:r.string().nullable()}));r.object({speciality_id:r.number(),organization_schedule_service_id:r.string().uuid(),closest_slots_days:r.number().optional(),slots_per_day:r.number().optional()}),r.object({service_id:r.string().uuid(),professional_hash:r.string().uuid(),starts_at:r.string(),finishes_at:r.string(),rescheduling_appointment_id:r.string().uuid().optional()});var ve=r.array(be),we=r.array(r.object({id:r.number(),name:r.string(),code:r.string().nullish(),price:r.object({amount:r.number(),currency:r.string()}).nullable()}));r.object({slot_id:r.string().uuid(),service_id:r.string().uuid().optional(),speciality_id:r.number().optional()});var Ee=be;e({status:n(x).optional(),order:e({field:s(["starts_at"]).optional(),direction:s(["asc","desc"]).optional()}).optional(),page:t().optional(),per_page:t().optional()});var Ce=_(e({appointment:e({id:i().uuid(),url:i().url(),starts_at:i(),duration:t(),status:x,channel:k,expires_at:i().nullable(),service_id:i().uuid().nullable()}),room:e({id:t()}),price:e({amount:t(),currency:i()}).nullable(),patient:e({hash:i().uuid()}),slots:n(h()),professional:e({hash:i().uuid(),name:i(),avatar:i().url().optional(),description:i().optional(),languages:n(i()),collegiate_number:i().optional()}),speciality:e({id:t(),name:i()})}));e({slot_id:i().uuid(),service_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:n(e({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var Re=e({appointment:e({id:i().uuid()})});e({id:i().uuid()});var Oe=U,Se=e({file_path:i(),presigned_storage_url:i().url()});e({id:i().uuid(),slot_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:n(e({file_path:i(),file_name:i()})).optional()}),e({id:i().uuid()}),e({appointment_id:i().uuid(),consultation_reason:i().optional()}),e({appointment_id:i().uuid(),file_path:i(),file_name:i()}),e({appointment_id:i().uuid(),document_id:i().uuid()}),e({appointmentId:i().uuid()}),r.object({api_key:r.string(),token:r.string()});var Ae=r.object({access_token:r.string(),patient:r.object({hash:r.string(),country_code:r.string(),timezone:r.string(),first_name:r.string(),last_name:r.string(),name:r.string(),birth_date:r.string(),email:r.string().email(),language_code:r.string(),phone:r.string(),phone_prefix:r.string(),tax_id:r.string(),legal_consent:r.object({accepted_at:r.string().nullable(),last_version_at:r.string().nullable(),terms_url:r.string(),privacy_url:r.string(),has_commercial_communications:r.boolean(),organization_name:r.string()})})});e({consultation_id:i(),consultation_type:D,rating:t().int().min(1).max(5),comment:i().nullable().optional()});var Te=e({rating:t().int().optional(),comment:i().nullable().optional()}).passthrough();e({file:f(File)});var je=e({url:i().url()});function xe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Pe}=Object.prototype,{getPrototypeOf:ke}=Object,{iterator:Ne,toStringTag:Ue}=Symbol,De=(Le=Object.create(null),e=>{const t=Pe.call(e);return Le[t]||(Le[t]=t.slice(8,-1).toLowerCase())});var Le;const Fe=e=>(e=e.toLowerCase(),t=>De(t)===e),Be=e=>t=>typeof t===e,{isArray:Ie}=Array,$e=Be("undefined");function Me(e){return null!==e&&!$e(e)&&null!==e.constructor&&!$e(e.constructor)&&He(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qe=Fe("ArrayBuffer");const ze=Be("string"),He=Be("function"),Je=Be("number"),We=e=>null!==e&&"object"==typeof e,Ve=e=>{if("object"!==De(e))return!1;const t=ke(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Ue in e||Ne in e)},Ke=Fe("Date"),Xe=Fe("File"),Ge=Fe("Blob"),Ze=Fe("FileList"),Qe=Fe("URLSearchParams"),[Ye,et,tt,nt]=["ReadableStream","Request","Response","Headers"].map(Fe);function rt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),Ie(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Me(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let o;for(r=0;r<s;r++)o=i[r],t.call(null,e[o],o,e)}}function it(e,t){if(Me(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const st="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ot=e=>!$e(e)&&e!==st;const at=(lt="undefined"!=typeof Uint8Array&&ke(Uint8Array),e=>lt&&e instanceof lt);var lt;const ct=Fe("HTMLFormElement"),ut=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dt=Fe("RegExp"),pt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};rt(n,(n,i)=>{let s;!1!==(s=t(n,i,e))&&(r[i]=s||n)}),Object.defineProperties(e,r)};const ht=Fe("AsyncFunction"),ft=(mt="function"==typeof setImmediate,gt=He(st.postMessage),mt?setImmediate:gt?(bt=`axios@${Math.random()}`,yt=[],st.addEventListener("message",({source:e,data:t})=>{e===st&&t===bt&&yt.length&&yt.shift()()},!1),e=>{yt.push(e),st.postMessage(bt,"*")}):e=>setTimeout(e));var mt,gt,bt,yt;const _t="undefined"!=typeof queueMicrotask?queueMicrotask.bind(st):"undefined"!=typeof process&&process.nextTick||ft;var vt={isArray:Ie,isArrayBuffer:qe,isBuffer:Me,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||He(e.append)&&("formdata"===(t=De(e))||"object"===t&&He(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&qe(e.buffer),t},isString:ze,isNumber:Je,isBoolean:e=>!0===e||!1===e,isObject:We,isPlainObject:Ve,isEmptyObject:e=>{if(!We(e)||Me(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Ye,isRequest:et,isResponse:tt,isHeaders:nt,isUndefined:$e,isDate:Ke,isFile:Xe,isBlob:Ge,isRegExp:dt,isFunction:He,isStream:e=>We(e)&&He(e.pipe),isURLSearchParams:Qe,isTypedArray:at,isFileList:Ze,forEach:rt,merge:function e(){const{caseless:t}=ot(this)&&this||{},n={},r=(r,i)=>{const s=t&&it(n,i)||i;Ve(n[s])&&Ve(r)?n[s]=e(n[s],r):Ve(r)?n[s]=e({},r):Ie(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&rt(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(rt(t,(t,r)=>{n&&He(t)?e[r]=xe(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],r&&!r(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&ke(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:De,kindOfTest:Fe,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ie(e))return e;let t=e.length;if(!Je(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ne]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ct,hasOwnProperty:ut,hasOwnProp:ut,reduceDescriptors:pt,freezeMethods:e=>{pt(e,(t,n)=>{if(He(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];He(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ie(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:it,global:st,isContextDefined:ot,isSpecCompliantForm:function(e){return!!(e&&He(e.append)&&"FormData"===e[Ue]&&e[Ne])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(We(e)){if(t.indexOf(e)>=0)return;if(Me(e))return e;if(!("toJSON"in e)){t[r]=e;const i=Ie(e)?[]:{};return rt(e,(e,t)=>{const s=n(e,r+1);!$e(s)&&(i[t]=s)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:ht,isThenable:e=>e&&(We(e)||He(e))&&He(e.then)&&He(e.catch),setImmediate:ft,asap:_t,isIterable:e=>null!=e&&He(e[Ne])};function wt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}vt.inherits(wt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:vt.toJSONObject(this.config),code:this.code,status:this.status}}});const Et=wt.prototype,Ct={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ct[e]={value:e}}),Object.defineProperties(wt,Ct),Object.defineProperty(Et,"isAxiosError",{value:!0}),wt.from=(e,t,n,r,i,s)=>{const o=Object.create(Et);return vt.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),wt.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};function Rt(e){return vt.isPlainObject(e)||vt.isArray(e)}function Ot(e){return vt.endsWith(e,"[]")?e.slice(0,-2):e}function St(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ot(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const At=vt.toFlatObject(vt,{},null,function(e){return/^is[A-Z]/.test(e)});function Tt(e,t,n){if(!vt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=vt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!vt.isUndefined(t[e])})).metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&vt.isSpecCompliantForm(t);if(!vt.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(vt.isDate(e))return e.toISOString();if(vt.isBoolean(e))return e.toString();if(!a&&vt.isBlob(e))throw new wt("Blob is not supported. Use a Buffer instead.");return vt.isArrayBuffer(e)||vt.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(vt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(vt.isArray(e)&&function(e){return vt.isArray(e)&&!e.some(Rt)}(e)||(vt.isFileList(e)||vt.endsWith(n,"[]"))&&(a=vt.toArray(e)))return n=Ot(n),a.forEach(function(e,r){!vt.isUndefined(e)&&null!==e&&t.append(!0===o?St([n],r,s):null===o?n:n+"[]",l(e))}),!1;return!!Rt(e)||(t.append(St(i,n,s),l(e)),!1)}const u=[],d=Object.assign(At,{defaultVisitor:c,convertValue:l,isVisitable:Rt});if(!vt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!vt.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),vt.forEach(n,function(n,s){!0===(!(vt.isUndefined(n)||null===n)&&i.call(t,n,vt.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function jt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function xt(e,t){this._pairs=[],e&&Tt(e,this,t)}const Pt=xt.prototype;function kt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nt(e,t,n){if(!t)return e;const r=n&&n.encode||kt;vt.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(s=i?i(t,n):vt.isURLSearchParams(t)?t.toString():new xt(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}Pt.append=function(e,t){this._pairs.push([e,t])},Pt.toString=function(e){const t=e?function(t){return e.call(this,t,jt)}:jt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class InterceptorManager{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){vt.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:xt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Lt="undefined"!=typeof window&&"undefined"!=typeof document,Ft="object"==typeof navigator&&navigator||void 0,Bt=Lt&&(!Ft||["ReactNative","NativeScript","NS"].indexOf(Ft.product)<0),It="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,$t=Lt&&window.location.href||"http://localhost";var Mt={...Object.freeze({__proto__:null,hasBrowserEnv:Lt,hasStandardBrowserEnv:Bt,hasStandardBrowserWebWorkerEnv:It,navigator:Ft,origin:$t}),...Dt};function qt(e){function t(e,n,r,i){let s=e[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=e.length;if(s=!s&&vt.isArray(r)?r.length:s,a)return vt.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!o;r[s]&&vt.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],i)&&vt.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}(r[s])),!o}if(vt.isFormData(e)&&vt.isFunction(e.entries)){const n={};return vt.forEachEntry(e,(e,r)=>{t(function(e){return vt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const zt={transitional:Ut,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=vt.isObject(e);i&&vt.isHTMLForm(e)&&(e=new FormData(e));if(vt.isFormData(e))return r?JSON.stringify(qt(e)):e;if(vt.isArrayBuffer(e)||vt.isBuffer(e)||vt.isStream(e)||vt.isFile(e)||vt.isBlob(e)||vt.isReadableStream(e))return e;if(vt.isArrayBufferView(e))return e.buffer;if(vt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Tt(e,new Mt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Mt.isNode&&vt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=vt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Tt(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(vt.isString(e))try{return(t||JSON.parse)(e),vt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||zt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(vt.isResponse(e)||vt.isReadableStream(e))return e;if(e&&vt.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw wt.from(e,wt.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vt.forEach(["delete","get","head","post","put","patch"],e=>{zt.headers[e]={}});const Ht=vt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Jt=Symbol("internals");function Wt(e){return e&&String(e).trim().toLowerCase()}function Vt(e){return!1===e||null==e?e:vt.isArray(e)?e.map(Vt):String(e)}function Kt(e,t,n,r,i){return vt.isFunction(r)?r.call(this,t,n):(i&&(t=n),vt.isString(t)?vt.isString(r)?-1!==t.indexOf(r):vt.isRegExp(r)?r.test(t):void 0:void 0)}let Xt=class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=Wt(t);if(!i)throw new Error("header name must be a non-empty string");const s=vt.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Vt(e))}const s=(e,t)=>vt.forEach(e,(e,n)=>i(e,n,t));if(vt.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(vt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&Ht[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(vt.isObject(e)&&vt.isIterable(e)){let n,r,i={};for(const t of e){if(!vt.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?vt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=Wt(e)){const n=vt.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(vt.isFunction(t))return t.call(this,e,n);if(vt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wt(e)){const n=vt.findKey(this,e);return!(!n||void 0===this[n]||t&&!Kt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=Wt(e)){const i=vt.findKey(n,e);!i||t&&!Kt(0,n[i],i,t)||(delete n[i],r=!0)}}return vt.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Kt(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return vt.forEach(this,(r,i)=>{const s=vt.findKey(n,i);if(s)return t[s]=Vt(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();o!==i&&delete t[i],t[o]=Vt(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return vt.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&vt.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Jt]=this[Jt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Wt(e);t[r]||(!function(e,t){const n=vt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return vt.isArray(e)?e.forEach(r):r(e),this}};function Gt(e,t){const n=this||zt,r=t||n,i=Xt.from(r.headers);let s=r.data;return vt.forEach(e,function(e){s=e.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Zt(e){return!(!e||!e.__CANCEL__)}function Qt(e,t,n){wt.call(this,e??"canceled",wt.ERR_CANCELED,t,n),this.name="CanceledError"}function Yt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new wt("Request failed with status code "+n.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),vt.reduceDescriptors(Xt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),vt.freezeMethods(Xt),vt.inherits(Qt,wt,{__CANCEL__:!0});const en=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=r[o];i||(i=l),n[s]=a,r[s]=l;let u=o,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let n,r,i=0,s=1e3/t;const o=(t,s=Date.now())=>{i=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=s?o(e,t):(n=e,r||(r=setTimeout(()=>{r=null,o(n)},s-a)))},()=>n&&o(n)]}(n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,a=s-r,l=i(a);r=s;e({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})},n)},tn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},nn=e=>(...t)=>vt.asap(()=>e(...t));var rn=Mt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Mt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,sn=Mt.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];vt.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),vt.isString(r)&&o.push("path="+r),vt.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function on(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const an=e=>e instanceof Xt?{...e}:e;function ln(e,t){t=t||{};const n={};function r(e,t,n,r){return vt.isPlainObject(e)&&vt.isPlainObject(t)?vt.merge.call({caseless:r},e,t):vt.isPlainObject(t)?vt.merge({},t):vt.isArray(t)?t.slice():t}function i(e,t,n,i){return vt.isUndefined(t)?vt.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function s(e,t){if(!vt.isUndefined(t))return r(void 0,t)}function o(e,t){return vt.isUndefined(t)?vt.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,s){return s in t?r(n,i):s in e?r(void 0,n):void 0}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t,n)=>i(an(e),an(t),0,!0)};return vt.forEach(Object.keys({...e,...t}),function(r){const s=l[r]||i,o=s(e[r],t[r],r);vt.isUndefined(o)&&s!==a||(n[r]=o)}),n}var cn=e=>{const t=ln({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=t;if(t.headers=a=Xt.from(a),t.url=Nt(on(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),vt.isFormData(r))if(Mt.hasStandardBrowserEnv||Mt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(Mt.hasStandardBrowserEnv&&(i&&vt.isFunction(i)&&(i=i(t)),i||!1!==i&&rn(t.url))){const e=s&&o&&sn.read(o);e&&a.set(s,e)}return t};var un="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=cn(e);let i=r.data;const s=Xt.from(r.headers).normalize();let o,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Xt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Yt(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new wt("Request aborted",wt.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new wt("Network Error",wt.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Ut;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new wt(t,i.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,e,m)),m=null},void 0===i&&s.setContentType(null),"setRequestHeader"in m&&vt.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),vt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=en(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([a,c]=en(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new Qt(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===Mt.protocols.indexOf(b)?n(new wt("Unsupported protocol "+b+":",wt.ERR_BAD_REQUEST,e)):m.send(i||null)})};const dn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof wt?t:new Qt(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,i(new wt(`timeout ${t} of ms exceeded`,wt.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>vt.asap(o),a}},pn=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},hn=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},fn=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of hn(e))yield*pn(n,t)}(e,t);let s,o=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=o+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},mn="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,gn=mn&&"function"==typeof ReadableStream,bn=mn&&("function"==typeof TextEncoder?(yn=new TextEncoder,e=>yn.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var yn;const _n=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},vn=gn&&_n(()=>{let e=!1;const t=new Request(Mt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),wn=gn&&_n(()=>vt.isReadableStream(new Response("").body)),En={stream:wn&&(e=>e.body)};var Cn;mn&&(Cn=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!En[e]&&(En[e]=vt.isFunction(Cn[e])?t=>t[e]():(t,n)=>{throw new wt(`Response type '${e}' is not supported`,wt.ERR_NOT_SUPPORT,n)})}));const Rn=async(e,t)=>{const n=vt.toFiniteNumber(e.getContentLength());return n??(async e=>{if(null==e)return 0;if(vt.isBlob(e))return e.size;if(vt.isSpecCompliantForm(e)){const t=new Request(Mt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return vt.isArrayBufferView(e)||vt.isArrayBuffer(e)?e.byteLength:(vt.isURLSearchParams(e)&&(e+=""),vt.isString(e)?(await bn(e)).byteLength:void 0)})(t)};const On={http:null,xhr:un,fetch:mn&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=cn(e);c=c?(c+"").toLowerCase():"text";let h,f=dn([i,s&&s.toAbortSignal()],o);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(l&&vn&&"get"!==n&&"head"!==n&&0!==(g=await Rn(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(vt.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=tn(g,en(nn(l)));r=fn(n.body,65536,e,t)}}vt.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;h=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let s=await fetch(h,p);const o=wn&&("stream"===c||"response"===c);if(wn&&(a||o&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=s[t]});const t=vt.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&tn(t,en(nn(a),!0))||[];s=new Response(fn(s.body,65536,n,()=>{r&&r(),m&&m()}),e)}c=c||"text";let b=await En[vt.findKey(En,c)||"text"](s,e);return!o&&m&&m(),await new Promise((t,n)=>{Yt(t,n,{data:b,headers:Xt.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:h})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new wt("Network Error",wt.ERR_NETWORK,e,h),{cause:t.cause||t});throw wt.from(t,t&&t.code,e,h)}})};vt.forEach(On,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Sn=e=>`- ${e}`,An=e=>vt.isFunction(e)||null===e||!1===e;var Tn=e=>{e=vt.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!An(n)&&(r=On[(t=String(n)).toLowerCase()],void 0===r))throw new wt(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+s]=r}if(!r){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new wt("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Sn).join("\n"):" "+Sn(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function jn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qt(null,e)}function xn(e){jn(e),e.headers=Xt.from(e.headers),e.data=Gt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Tn(e.adapter||zt.adapter)(e).then(function(t){return jn(e),t.data=Gt.call(e,e.transformResponse,t),t.headers=Xt.from(t.headers),t},function(t){return Zt(t)||(jn(e),t&&t.response&&(t.response.data=Gt.call(e,e.transformResponse,t.response),t.response.headers=Xt.from(t.response.headers))),Promise.reject(t)})}const Pn="1.11.0",kn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{kn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Nn={};kn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Pn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,s)=>{if(!1===e)throw new wt(r(i," has been removed"+(t?" in "+t:"")),wt.ERR_DEPRECATED);return t&&!Nn[i]&&(Nn[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,s)}},kn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Un={assertOptions:function(e,t,n){if("object"!=typeof e)throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const t=e[s],n=void 0===t||o(t,s,e);if(!0!==n)throw new wt("option "+s+" must be "+n,wt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new wt("Unknown option "+s,wt.ERR_BAD_OPTION)}},validators:kn};const Dn=Un.validators;let Ln=class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ln(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Un.assertOptions(n,{silentJSONParsing:Dn.transitional(Dn.boolean),forcedJSONParsing:Dn.transitional(Dn.boolean),clarifyTimeoutError:Dn.transitional(Dn.boolean)},!1),null!=r&&(vt.isFunction(r)?t.paramsSerializer={serialize:r}:Un.assertOptions(r,{encode:Dn.function,serialize:Dn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Un.assertOptions(t,{baseUrl:Dn.spelling("baseURL"),withXsrfToken:Dn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=i&&vt.merge(i.common,i[t.method]);i&&vt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=Xt.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[xn.bind(this),void 0];for(e.unshift(...o),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=o.length;let p=t;for(d=0;d<u;){const e=o[d++],t=o[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{c=xn.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return Nt(on((e=ln(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};vt.forEach(["delete","get","head","options"],function(e){Ln.prototype[e]=function(t,n){return this.request(ln(n||{},{method:e,url:t,data:(n||{}).data}))}}),vt.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(ln(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ln.prototype[e]=t(),Ln.prototype[e+"Form"]=t(!0)});const Fn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fn).forEach(([e,t])=>{Fn[t]=e});const Bn=function e(t){const n=new Ln(t),r=xe(Ln.prototype.request,n);return vt.extend(r,Ln.prototype,n,{allOwnKeys:!0}),vt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ln(t,n))},r}(zt);Bn.Axios=Ln,Bn.CanceledError=Qt,Bn.CancelToken=class CancelToken{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Qt(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CancelToken(function(t){e=t}),cancel:e}}},Bn.isCancel=Zt,Bn.VERSION=Pn,Bn.toFormData=Tt,Bn.AxiosError=wt,Bn.Cancel=Bn.CanceledError,Bn.all=function(e){return Promise.all(e)},Bn.spread=function(e){return function(t){return e.apply(null,t)}},Bn.isAxiosError=function(e){return vt.isObject(e)&&!0===e.isAxiosError},Bn.mergeConfig=ln,Bn.AxiosHeaders=Xt,Bn.formToJSON=e=>qt(vt.isHTMLForm(e)?new FormData(e):e),Bn.getAdapter=Tn,Bn.HttpStatusCode=Fn,Bn.default=Bn;const{Axios:In,AxiosError:$n,CanceledError:Mn,isCancel:qn,CancelToken:zn,VERSION:Hn,all:Jn,Cancel:Wn,isAxiosError:Vn,spread:Kn,toFormData:Xn,AxiosHeaders:Gn,HttpStatusCode:Zn,formToJSON:Qn,getAdapter:Yn,mergeConfig:er}=Bn;var tr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointments(e){return this.httpClient.get("/appointments/v1",{params:e}).then(this.validate(Ce))}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(Oe))}async getDocumentsStorage(){return this.httpClient.get("/appointments/v1/documents/storage").then(e=>e.data).then(this.validate(Se))}async rescheduleAppointment(e){const{id:t,...n}=e;return this.httpClient.put(`/appointments/v1/${t}/reschedule`,n)}async cancelAppointment(e){return this.httpClient.put(`/appointments/v1/${e.id}/cancel`)}async updateAppointment(e){const{appointment_id:t,...n}=e;return this.httpClient.put(`/appointments/v1/${t}/update`,n)}async addDocument(e){const{appointment_id:t,...n}=e;return this.httpClient.post(`/appointments/v1/${t}/consultation-document`,n)}async deleteDocument(e){return this.httpClient.delete(`/appointments/v1/${e.appointment_id}/consultation-document/${e.document_id}`)}async reconnectAppointment(e){return this.httpClient.put(`/appointments/v1/${e.appointmentId}/reconnect`)}},nr=class{constructor(e,t){this.httpClient=e,this.validate=t}async loginToken(e){return this.httpClient.post("/login/v1/token",{token:e.token},{headers:{"x-api-key":e.api_key}}).then(this.validate(Ae))}};var rr=class{constructor(e,t){this.httpClient=e,this.validate=t}async postReview(e){return this.httpClient.post("/consultations/v1/review",e)}async getReview(e){return this.httpClient.get(`/consultations/v1/review/${e}`).then(e=>e.data).then(this.validate(Te))}},ir=class{constructor(e,t){this.httpClient=e,this.validate=t}async uploadFile(e){const t=new FormData;return t.append("file",e.file,e.file.name),this.httpClient.post("/documents/v1/upload-file",t,{headers:{"Content-Type":"multipart/form-data"}}).then(this.validate(je))}},sr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointment(e){return this.httpClient.get(`/flash/v1/appointments/${e.appointmentId}`).then(e=>e.data).then(this.validate(I))}async joinCall(e){return this.httpClient.get(`/flash/v1/calls/${e.callId}/join`).then(e=>e.data).then(this.validate($))}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(M))}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(q))}},or=class{constructor(e,t){this.httpClient=e,this.validate=t}async getOrganizationSpecialties(){return this.httpClient.get("/organizations/v1/specialities").then(e=>e.data).then(this.validate(z))}async getOrganizationSetup(){return this.httpClient.get("/organizations/v1/setup").then(e=>e.data).then(this.validate(H))}},ar=class{constructor(e,t){this.httpClient=e,this.validate=t}async createPaymentLink(e){const{specialty_id:t,...n}=e,r={...n,speciality_id:t};return this.httpClient.post("/payments/v1/schedule",r).then(e=>e.data).then(this.validate(V))}async createImmediateVideocallPaymentLink(e){return this.httpClient.post("/payments/v1/immediate-videocall",e).then(e=>e.data).then(this.validate(K))}async getConsultationCoupon(e,t){return this.httpClient.get(`/payments/v1/consultation-coupon/${encodeURIComponent(e)}`,{params:{amount:t}}).then(e=>e.data).then(this.validate(J))}async getAppointmentConsultationCoupon(e){return this.httpClient.get(`/payments/v1/appointment/${encodeURIComponent(e)}/consultation-coupon`).then(e=>e.data).then(this.validate(W))}async getPaymentSession(e){return this.httpClient.get(`/payments/v1/session/${e}`).then(e=>e.data).then(this.validate(G))}async validateApplePayMerchant(e){return this.httpClient.post("/payments/v1/apple-pay/validate-merchant",e).then(this.validate(Z))}async authorizeApplePay(e){return this.httpClient.post("/payments/v1/apple-pay/authorize",e).then(this.validate(Q))}async authorizeGooglePay(e){return this.httpClient.post("/payments/v1/google-pay/authorize",e).then(this.validate(Y))}},lr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getProfessional(e){return this.httpClient.get(`sdk/v1/professionals/${e.hash}`).then(e=>e.data).then(this.validate(ne))}async readAllMessages(e){return this.httpClient.put(`sdk/v1/rooms/${e.roomId}/messages/read`).then(e=>e.data)}},cr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getPatientProfile(){return this.httpClient.get("/profile/v1/patients").then(e=>e.data).then(this.validate(ie))}async getProfessionalPublicProfile(e){return this.httpClient.get(`/profile/v1/public/professionals/${e.hash}`).then(e=>e.data).then(this.validate(se))}async acceptLegalConsent(e){return this.httpClient.post("/profile/v1/legal-consent",e)}},ur=class{constructor(e,t){this.httpClient=e,this.validate=t}async getRoomMessages(e){return this.httpClient.get(`api/v1/rooms/${e.roomId}/messages`).then(e=>e.data).then(this.validate(pe))}async getUnreadMessagesCount(e){return this.httpClient.get(`chat/v1/${e.roomId}/unread-count`).then(e=>e.data).then(this.validate(he))}async createSupportRoom(e){return this.httpClient.post("chat/v1/support-room",e).then(e=>e.data).then(this.validate(fe))}},dr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getScheduleServices(){return this.httpClient.get("/schedules/v1/services").then(e=>e.data).then(this.validate(ye))}async getProfessionalsBySpecialtyAndService(e){return this.httpClient.get("/schedules/v1/professionals",{params:e}).then(e=>e.data).then(this.validate(_e))}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(ve))}async getScheduleServiceSpecialities(e){return this.httpClient.get(`/schedules/v1/services/${e}/specialities`).then(e=>e.data).then(this.validate(we))}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(Ee))}};var pr={development:"https://chat-dev.mediquo.com",production:"https://chat.mediquo.com"},hr=class{constructor({env:e="production",baseURL:t,debug:n}={}){const r=t??pr[e];var i;this.httpClient=(i=r,Bn.create({baseURL:i,headers:{"Content-Type":"application/json"}}));const s=(o={debug:n},e=>t=>{const n=e.safeParse(t.data);if(n.error&&o?.debug){const e=t.config?.url??"";console.warn(`[Validation Error]${e?` - URL: ${e}`:""}\n${r=n.error,r.issues.map(e=>`${e.path.join(".")}: ${e.message}`).join("\n")}`)}var r;return n.data??t.data});var o;this.flash=new sr(this.httpClient,s),this.auth=new nr(this.httpClient,s),this.appointments=new tr(this.httpClient,s),this.payments=new ar(this.httpClient,s),this.schedules=new dr(this.httpClient,s),this.organizations=new or(this.httpClient,s),this.profile=new cr(this.httpClient,s),this.professionals=new lr(this.httpClient,s),this.rooms=new ur(this.httpClient,s),this.documents=new ir(this.httpClient,s),this.consultations=new rr(this.httpClient,s)}setAuthToken(e){this.httpClient.defaults.headers.common.Authorization=`Bearer ${e}`}setApiKey(e){this.httpClient.defaults.headers.common["x-api-key"]=e}setLanguage(e){this.httpClient.defaults.headers.common["Accept-Language"]=e}};let fr=null,mr=null;const gr=new Proxy({},{get:(e,t)=>(fr&&mr===y.MODE||(fr=new hr({env:y.MODE,debug:"development"===y.MODE}),mr=y.MODE),fr)[t]});export{N as A,L as C,w as D,oe as M,X as P,ge as S,gr as a,re as b,A as c,B as d,P as e,F as f,j as g,T as h,Vn as i,O as j,S as k};
1
+ import{o as e,n as t,a as n,z as r,s as i,e as s,b as o,r as a,u as l,c,d as u,f as d,g as p,h,i as f}from"./external-zAbuzxDj.js";import{p as m}from"./parseISO-jT42c8Ob.js";import{f as g}from"./format-Cm3B1GMy.js";import{i as b}from"./isBefore-Cof0D841.js";import{env as y}from"../env.js";function _(r){return e({data:n(r),meta:e({current_page:t(),last_page:t(),per_page:t(),total:t()})})}var v=r.enum(["prescription","report","diagnosticTestPrescription"]),w=v.enum,E=r.enum(["published","draft"]);E.enum;var C=r.object({document_id:r.string().uuid(),document_type:v,name:r.string(),professional:r.object({speciality_id:r.number()}),status:E,url:r.string().url(),created_at:r.string()}),R=e({hash:i(),profile:e({first_name:i().nullable(),last_name:i().nullable(),birth_date:i().nullable(),gender:s(["male","female"]).nullable(),email:i().nullable(),phone_prefix:i().nullable(),phone:i().nullable(),billing:e({tax_id:i().nullable(),address:i().nullable(),country_code:i().nullable(),region:i().nullable(),postal_code:i().nullable()})})});function O(e){const t=e?.profile;return`${t?.first_name??""} ${t?.last_name??""}`.trim()}function S(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)}function A(e){return m(`${e.replace(" ","T")}Z`)}function T(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()));return g(t,"yyyy-MM-dd HH:mm:ss")}function j(e,t){try{const n=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"shortOffset"}).formatToParts(t);return n.find(e=>"timeZoneName"===e.type)?.value??""}catch{return""}}var x=r.enum(["pending","expired","accepted","inCall","declined","cancelled","finished","free_of_charge","owed","unpaid","reporting"]),P=x.enum,k=r.enum(["videocall","chat","phonecall"]),N=k.enum,U=r.object({id:r.string().uuid(),room_id:r.string(),channel:k,consultation_short_url:r.string().url().nullable(),call_id:r.string().url(),duration:r.number(),from:r.object({hash:r.string(),name:r.string().nullable(),avatar:r.string().url().nullable(),speciality:r.string().nullable(),collegiate_number:r.string().nullable(),is_dismissed:r.boolean(),languages:r.array(r.string()),description:r.string().nullable()}),to:r.object({id:r.number(),hash:r.string(),name:r.string().nullable(),avatar:r.string().url().nullable(),is_dismissed:r.boolean()}),speciality_id:r.number().nullable(),created_at:r.string(),status:x,seconds_to_open:r.number().nonnegative(),start_date:r.string(),started_at:r.string().nullable(),expires_at:r.string().nullable(),consultation_reason:r.string().nullable(),preconsultation_documents:r.array(r.object({file_path:r.string(),file_name:r.string(),id:r.string().uuid()})).nullable(),service_id:r.string().uuid().nullable(),price:r.number().nullable().optional(),currency:r.string().nullable().optional(),discount_amount:r.number().nullable().optional()}),D=r.enum(["appointment","chat","immediate"]),L=D.enum;function F(e){return 0===e.seconds_to_open}function B(e){if(!e)return!1;const t=new Date,n=A(e);return b(n,t)}r.object({appointmentId:r.string()});var I=U;r.object({callId:r.string()});var $=r.object({session_id:r.string(),session_token:r.string()});r.object({professional_hash:r.string(),consultation_id:r.string(),consultation_type:r.enum(["appointment"])}),r.object({professional_hash:r.string(),consultation_id:r.string(),consultation_type:r.enum(["appointment"])}),r.object({appointment_id:r.string()});var M=r.array(C);r.object({url:r.string().url()}),r.object({first_name:R.shape.profile.shape.first_name,last_name:R.shape.profile.shape.last_name,tax_id:R.shape.profile.shape.billing.shape.tax_id,birth_date:R.shape.profile.shape.birth_date,gender:R.shape.profile.shape.gender.optional(),email:R.shape.profile.shape.email,phone_prefix:R.shape.profile.shape.phone_prefix,phone:R.shape.profile.shape.phone,terms_accepted:r.boolean(),privacy_accepted:r.boolean()}),r.object({patient_hash:r.string(),page:r.number().optional(),per_page:r.number().optional()});var q=_(C),z=r.array(r.object({id:r.number(),name:r.string(),code:r.string()})),H=r.object({primary_color:r.string().nullable(),logo:r.string().nullable(),favicon:r.string().nullable(),support_professional:r.object({hash:r.string().nullable()}).optional(),home:r.object({title:r.string().nullable(),description:r.string().nullable(),image_url:r.string().nullable()}),appointments:r.object({reserve_conditions:r.string().nullable(),seconds_before_start_to_refund_on_cancel:r.number().nullable(),has_nps:r.boolean().optional(),has_chat_in_appointment:r.boolean().optional(),has_discount_coupons_show:r.boolean().optional()}),legal_consent:r.object({terms_url:r.string().nullable(),privacy_url:r.string().nullable()})});e({slot_id:i().uuid(),service_id:i().uuid(),specialty_id:i(),consultation_reason:i().optional(),preconsultation_documents:n(e({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var J=e({id:i(),percent_off:t(),code:i(),after_discount_amount:t().nullable()}),W=e({id:i(),percent_off:t(),code:i(),name:i().nullish()}),V=e({session_id:i(),payment_link:i().url()});e({video_call_schedule_id:i()});var K=V,X={Paid:"paid",Unpaid:"unpaid",Denied:"denied"},G=e({status:o(X),consultation_id:i(),consultation_type:i()});e({order_id:i(),validation_url:i().url()});var Z=a(l());e({order_id:i(),token:i()});var Q=e({data:e({status:o(X),consultation_id:i(),consultation_type:i().optional()})});e({order_id:i(),token:i()});var Y=e({data:e({status:o(X),consultation_id:i(),consultation_type:i().optional()})}),ee=s(["monday","tuesday","wednesday","thursday","friday","saturday","sunday","working_week","weekend","all_week"]);ee.enum;var te=e({days_of_week:ee,from_time:i(),to_time:i()});e({hash:i().uuid()});var ne=e({hash:i().uuid(),active_absence:e({id:i().uuid(),finishes_at:i()}).nullable(),avatar:i().url().nullable(),collegiate_number:i().nullable(),description:i().nullable(),is_available:c(),name:i(),overview:i().nullable(),schedule_description:i().nullable(),speciality_id:t().nullable(),status:s(["online","offline"]),title:i().nullable(),chat_schedule:e({channel:k,duration:t(),name:i(),timezone:i(),starts_at:i(),gaps:n(te)}).nullable()});function re(e){return e.active_absence?"absent":"online"===e.status?"online":"offline"}s(["online","offline","absent"]),e({roomId:t()});var ie=R;e({first_name:i(),last_name:i(),tax_id:i(),birth_date:i(),gender:s(["male","female"]),email:i(),phone_prefix:i(),phone:i(),terms_accepted:c(),privacy_accepted:c()}),e({terms_accepted:c(),privacy_accepted:c(),commercial_accepted:c()}),e({hash:i().uuid()});var se=e({id:t(),hash:i().uuid(),speciality_alias:i(),name:i(),avatar:i().url(),description:i(),collegiate_number:i(),languages:n(i()),centers:n(e({id:i().uuid(),name:i()}))});u([p(1),p(2),p(3)]);var oe={Sent:1,Received:2,Read:3},ae=e({roomId:t(),messageId:i().uuid(),string:i(),status:t(),senderType:s(["ordinary","system"]),fromUserHash:i().uuid(),auto:u([p(0),p(1)]),createdAt:i().nullable(),deletedAt:i().nullable(),time:t().nullable()}),le=e({file_name:i(),file_size:t(),url:i().url(),signed_url:i().url().nullable(),type:s(["uncategorized","voice_note"]),meta:e({duration:t()})}),ce=ae.extend({type:p("string"),attachment:d()}),ue=ae.extend({type:p("file"),attachment:le}),de=ae.extend({type:p("image"),attachment:le});e({roomId:t()});var pe=n(u([ce,ue,de]));e({roomId:t()});var he=e({unread_count:t()});e({professional_hash:i()});var fe=e({room_id:t()}),me=s(["available","reserved"]),ge=me.enum,be=e({id:i().uuid(),channel:k,duration:t(),starts_at:i(),finishes_at:i(),professional:e({id:i().uuid(),name:i()}),services:n(e({id:i().uuid(),name:i()})),speciality:e({id:t(),price:e({amount:t(),currency:i()}).nullish()}),status:me}),ye=r.array(r.object({id:r.string().uuid(),name:r.string(),code:r.string(),channel:k,price:r.object({amount:r.number(),currency:r.string()}).nullable()})),_e=r.array(r.object({id:r.string().uuid(),avatar:r.string().url().nullable(),description:r.string().nullable(),collegiate_number:r.string().nullable(),languages:r.array(r.string()),name:r.string(),slots:r.array(be),speciality:r.object({id:r.number()}),tax_id:r.string().nullable()}));r.object({speciality_id:r.number(),organization_schedule_service_id:r.string().uuid(),closest_slots_days:r.number().optional(),slots_per_day:r.number().optional()}),r.object({service_id:r.string().uuid(),professional_hash:r.string().uuid(),starts_at:r.string(),finishes_at:r.string(),rescheduling_appointment_id:r.string().uuid().optional()});var ve=r.array(be),we=r.array(r.object({id:r.number(),name:r.string(),code:r.string().nullish(),price:r.object({amount:r.number(),currency:r.string()}).nullable()}));r.object({slot_id:r.string().uuid(),service_id:r.string().uuid().optional(),speciality_id:r.number().optional()});var Ee=be;e({status:n(x).optional(),order:e({field:s(["starts_at"]).optional(),direction:s(["asc","desc"]).optional()}).optional(),page:t().optional(),per_page:t().optional()});var Ce=_(e({appointment:e({id:i().uuid(),url:i().url(),starts_at:i(),duration:t(),status:x,channel:k,expires_at:i().nullable(),service_id:i().uuid().nullable()}),room:e({id:t()}),price:e({amount:t(),currency:i()}).nullable(),patient:e({hash:i().uuid()}),slots:n(h()),professional:e({hash:i().uuid(),name:i(),avatar:i().url().optional(),description:i().optional(),languages:n(i()),collegiate_number:i().optional()}),speciality:e({id:t(),name:i()})}));e({slot_id:i().uuid(),service_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:n(e({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var Re=e({appointment:e({id:i().uuid()})});e({id:i().uuid()});var Oe=U,Se=e({file_path:i(),presigned_storage_url:i().url()});e({id:i().uuid(),slot_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:n(e({file_path:i(),file_name:i()})).optional()}),e({id:i().uuid()}),e({appointment_id:i().uuid(),consultation_reason:i().optional()}),e({appointment_id:i().uuid(),file_path:i(),file_name:i()}),e({appointment_id:i().uuid(),document_id:i().uuid()}),e({appointmentId:i().uuid()}),r.object({api_key:r.string(),token:r.string()});var Ae=r.object({access_token:r.string(),patient:r.object({hash:r.string(),country_code:r.string(),timezone:r.string(),first_name:r.string(),last_name:r.string(),name:r.string(),birth_date:r.string(),email:r.string().email(),language_code:r.string(),phone:r.string(),phone_prefix:r.string(),tax_id:r.string(),legal_consent:r.object({accepted_at:r.string().nullable(),last_version_at:r.string().nullable(),terms_url:r.string(),privacy_url:r.string(),has_commercial_communications:r.boolean(),organization_name:r.string()})})});e({consultation_id:i(),consultation_type:D,rating:t().int().min(1).max(5),comment:i().nullable().optional()});var Te=e({rating:t().int().optional(),comment:i().nullable().optional()}).passthrough();e({file:f(File)});var je=e({url:i().url()});function xe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Pe}=Object.prototype,{getPrototypeOf:ke}=Object,{iterator:Ne,toStringTag:Ue}=Symbol,De=(Le=Object.create(null),e=>{const t=Pe.call(e);return Le[t]||(Le[t]=t.slice(8,-1).toLowerCase())});var Le;const Fe=e=>(e=e.toLowerCase(),t=>De(t)===e),Be=e=>t=>typeof t===e,{isArray:Ie}=Array,$e=Be("undefined");function Me(e){return null!==e&&!$e(e)&&null!==e.constructor&&!$e(e.constructor)&&He(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qe=Fe("ArrayBuffer");const ze=Be("string"),He=Be("function"),Je=Be("number"),We=e=>null!==e&&"object"==typeof e,Ve=e=>{if("object"!==De(e))return!1;const t=ke(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Ue in e||Ne in e)},Ke=Fe("Date"),Xe=Fe("File"),Ge=Fe("Blob"),Ze=Fe("FileList"),Qe=Fe("URLSearchParams"),[Ye,et,tt,nt]=["ReadableStream","Request","Response","Headers"].map(Fe);function rt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),Ie(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Me(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let o;for(r=0;r<s;r++)o=i[r],t.call(null,e[o],o,e)}}function it(e,t){if(Me(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const st="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ot=e=>!$e(e)&&e!==st;const at=(lt="undefined"!=typeof Uint8Array&&ke(Uint8Array),e=>lt&&e instanceof lt);var lt;const ct=Fe("HTMLFormElement"),ut=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dt=Fe("RegExp"),pt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};rt(n,(n,i)=>{let s;!1!==(s=t(n,i,e))&&(r[i]=s||n)}),Object.defineProperties(e,r)};const ht=Fe("AsyncFunction"),ft=(mt="function"==typeof setImmediate,gt=He(st.postMessage),mt?setImmediate:gt?(bt=`axios@${Math.random()}`,yt=[],st.addEventListener("message",({source:e,data:t})=>{e===st&&t===bt&&yt.length&&yt.shift()()},!1),e=>{yt.push(e),st.postMessage(bt,"*")}):e=>setTimeout(e));var mt,gt,bt,yt;const _t="undefined"!=typeof queueMicrotask?queueMicrotask.bind(st):"undefined"!=typeof process&&process.nextTick||ft;var vt={isArray:Ie,isArrayBuffer:qe,isBuffer:Me,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||He(e.append)&&("formdata"===(t=De(e))||"object"===t&&He(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&qe(e.buffer),t},isString:ze,isNumber:Je,isBoolean:e=>!0===e||!1===e,isObject:We,isPlainObject:Ve,isEmptyObject:e=>{if(!We(e)||Me(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Ye,isRequest:et,isResponse:tt,isHeaders:nt,isUndefined:$e,isDate:Ke,isFile:Xe,isBlob:Ge,isRegExp:dt,isFunction:He,isStream:e=>We(e)&&He(e.pipe),isURLSearchParams:Qe,isTypedArray:at,isFileList:Ze,forEach:rt,merge:function e(){const{caseless:t}=ot(this)&&this||{},n={},r=(r,i)=>{const s=t&&it(n,i)||i;Ve(n[s])&&Ve(r)?n[s]=e(n[s],r):Ve(r)?n[s]=e({},r):Ie(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&rt(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(rt(t,(t,r)=>{n&&He(t)?e[r]=xe(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],r&&!r(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&ke(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:De,kindOfTest:Fe,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ie(e))return e;let t=e.length;if(!Je(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ne]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ct,hasOwnProperty:ut,hasOwnProp:ut,reduceDescriptors:pt,freezeMethods:e=>{pt(e,(t,n)=>{if(He(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];He(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ie(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:it,global:st,isContextDefined:ot,isSpecCompliantForm:function(e){return!!(e&&He(e.append)&&"FormData"===e[Ue]&&e[Ne])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(We(e)){if(t.indexOf(e)>=0)return;if(Me(e))return e;if(!("toJSON"in e)){t[r]=e;const i=Ie(e)?[]:{};return rt(e,(e,t)=>{const s=n(e,r+1);!$e(s)&&(i[t]=s)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:ht,isThenable:e=>e&&(We(e)||He(e))&&He(e.then)&&He(e.catch),setImmediate:ft,asap:_t,isIterable:e=>null!=e&&He(e[Ne])};function wt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}vt.inherits(wt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:vt.toJSONObject(this.config),code:this.code,status:this.status}}});const Et=wt.prototype,Ct={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ct[e]={value:e}}),Object.defineProperties(wt,Ct),Object.defineProperty(Et,"isAxiosError",{value:!0}),wt.from=(e,t,n,r,i,s)=>{const o=Object.create(Et);return vt.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),wt.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};function Rt(e){return vt.isPlainObject(e)||vt.isArray(e)}function Ot(e){return vt.endsWith(e,"[]")?e.slice(0,-2):e}function St(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ot(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const At=vt.toFlatObject(vt,{},null,function(e){return/^is[A-Z]/.test(e)});function Tt(e,t,n){if(!vt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=vt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!vt.isUndefined(t[e])})).metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&vt.isSpecCompliantForm(t);if(!vt.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(vt.isDate(e))return e.toISOString();if(vt.isBoolean(e))return e.toString();if(!a&&vt.isBlob(e))throw new wt("Blob is not supported. Use a Buffer instead.");return vt.isArrayBuffer(e)||vt.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(vt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(vt.isArray(e)&&function(e){return vt.isArray(e)&&!e.some(Rt)}(e)||(vt.isFileList(e)||vt.endsWith(n,"[]"))&&(a=vt.toArray(e)))return n=Ot(n),a.forEach(function(e,r){!vt.isUndefined(e)&&null!==e&&t.append(!0===o?St([n],r,s):null===o?n:n+"[]",l(e))}),!1;return!!Rt(e)||(t.append(St(i,n,s),l(e)),!1)}const u=[],d=Object.assign(At,{defaultVisitor:c,convertValue:l,isVisitable:Rt});if(!vt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!vt.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),vt.forEach(n,function(n,s){!0===(!(vt.isUndefined(n)||null===n)&&i.call(t,n,vt.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function jt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function xt(e,t){this._pairs=[],e&&Tt(e,this,t)}const Pt=xt.prototype;function kt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nt(e,t,n){if(!t)return e;const r=n&&n.encode||kt;vt.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(s=i?i(t,n):vt.isURLSearchParams(t)?t.toString():new xt(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}Pt.append=function(e,t){this._pairs.push([e,t])},Pt.toString=function(e){const t=e?function(t){return e.call(this,t,jt)}:jt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class InterceptorManager{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){vt.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:xt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Lt="undefined"!=typeof window&&"undefined"!=typeof document,Ft="object"==typeof navigator&&navigator||void 0,Bt=Lt&&(!Ft||["ReactNative","NativeScript","NS"].indexOf(Ft.product)<0),It="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,$t=Lt&&window.location.href||"http://localhost";var Mt={...Object.freeze({__proto__:null,hasBrowserEnv:Lt,hasStandardBrowserEnv:Bt,hasStandardBrowserWebWorkerEnv:It,navigator:Ft,origin:$t}),...Dt};function qt(e){function t(e,n,r,i){let s=e[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=e.length;if(s=!s&&vt.isArray(r)?r.length:s,a)return vt.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!o;r[s]&&vt.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],i)&&vt.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}(r[s])),!o}if(vt.isFormData(e)&&vt.isFunction(e.entries)){const n={};return vt.forEachEntry(e,(e,r)=>{t(function(e){return vt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const zt={transitional:Ut,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=vt.isObject(e);i&&vt.isHTMLForm(e)&&(e=new FormData(e));if(vt.isFormData(e))return r?JSON.stringify(qt(e)):e;if(vt.isArrayBuffer(e)||vt.isBuffer(e)||vt.isStream(e)||vt.isFile(e)||vt.isBlob(e)||vt.isReadableStream(e))return e;if(vt.isArrayBufferView(e))return e.buffer;if(vt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Tt(e,new Mt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Mt.isNode&&vt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=vt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Tt(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(vt.isString(e))try{return(t||JSON.parse)(e),vt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||zt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(vt.isResponse(e)||vt.isReadableStream(e))return e;if(e&&vt.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw wt.from(e,wt.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vt.forEach(["delete","get","head","post","put","patch"],e=>{zt.headers[e]={}});const Ht=vt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Jt=Symbol("internals");function Wt(e){return e&&String(e).trim().toLowerCase()}function Vt(e){return!1===e||null==e?e:vt.isArray(e)?e.map(Vt):String(e)}function Kt(e,t,n,r,i){return vt.isFunction(r)?r.call(this,t,n):(i&&(t=n),vt.isString(t)?vt.isString(r)?-1!==t.indexOf(r):vt.isRegExp(r)?r.test(t):void 0:void 0)}let Xt=class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=Wt(t);if(!i)throw new Error("header name must be a non-empty string");const s=vt.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Vt(e))}const s=(e,t)=>vt.forEach(e,(e,n)=>i(e,n,t));if(vt.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(vt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&Ht[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(vt.isObject(e)&&vt.isIterable(e)){let n,r,i={};for(const t of e){if(!vt.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?vt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=Wt(e)){const n=vt.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(vt.isFunction(t))return t.call(this,e,n);if(vt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wt(e)){const n=vt.findKey(this,e);return!(!n||void 0===this[n]||t&&!Kt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=Wt(e)){const i=vt.findKey(n,e);!i||t&&!Kt(0,n[i],i,t)||(delete n[i],r=!0)}}return vt.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Kt(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return vt.forEach(this,(r,i)=>{const s=vt.findKey(n,i);if(s)return t[s]=Vt(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();o!==i&&delete t[i],t[o]=Vt(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return vt.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&vt.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Jt]=this[Jt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Wt(e);t[r]||(!function(e,t){const n=vt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return vt.isArray(e)?e.forEach(r):r(e),this}};function Gt(e,t){const n=this||zt,r=t||n,i=Xt.from(r.headers);let s=r.data;return vt.forEach(e,function(e){s=e.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Zt(e){return!(!e||!e.__CANCEL__)}function Qt(e,t,n){wt.call(this,e??"canceled",wt.ERR_CANCELED,t,n),this.name="CanceledError"}function Yt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new wt("Request failed with status code "+n.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),vt.reduceDescriptors(Xt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),vt.freezeMethods(Xt),vt.inherits(Qt,wt,{__CANCEL__:!0});const en=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=r[o];i||(i=l),n[s]=a,r[s]=l;let u=o,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let n,r,i=0,s=1e3/t;const o=(t,s=Date.now())=>{i=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=s?o(e,t):(n=e,r||(r=setTimeout(()=>{r=null,o(n)},s-a)))},()=>n&&o(n)]}(n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,a=s-r,l=i(a);r=s;e({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})},n)},tn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},nn=e=>(...t)=>vt.asap(()=>e(...t));var rn=Mt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Mt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,sn=Mt.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];vt.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),vt.isString(r)&&o.push("path="+r),vt.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function on(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const an=e=>e instanceof Xt?{...e}:e;function ln(e,t){t=t||{};const n={};function r(e,t,n,r){return vt.isPlainObject(e)&&vt.isPlainObject(t)?vt.merge.call({caseless:r},e,t):vt.isPlainObject(t)?vt.merge({},t):vt.isArray(t)?t.slice():t}function i(e,t,n,i){return vt.isUndefined(t)?vt.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function s(e,t){if(!vt.isUndefined(t))return r(void 0,t)}function o(e,t){return vt.isUndefined(t)?vt.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,s){return s in t?r(n,i):s in e?r(void 0,n):void 0}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t,n)=>i(an(e),an(t),0,!0)};return vt.forEach(Object.keys({...e,...t}),function(r){const s=l[r]||i,o=s(e[r],t[r],r);vt.isUndefined(o)&&s!==a||(n[r]=o)}),n}var cn=e=>{const t=ln({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=t;if(t.headers=a=Xt.from(a),t.url=Nt(on(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),vt.isFormData(r))if(Mt.hasStandardBrowserEnv||Mt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(Mt.hasStandardBrowserEnv&&(i&&vt.isFunction(i)&&(i=i(t)),i||!1!==i&&rn(t.url))){const e=s&&o&&sn.read(o);e&&a.set(s,e)}return t};var un="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=cn(e);let i=r.data;const s=Xt.from(r.headers).normalize();let o,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Xt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Yt(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new wt("Request aborted",wt.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new wt("Network Error",wt.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Ut;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new wt(t,i.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,e,m)),m=null},void 0===i&&s.setContentType(null),"setRequestHeader"in m&&vt.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),vt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=en(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([a,c]=en(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new Qt(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===Mt.protocols.indexOf(b)?n(new wt("Unsupported protocol "+b+":",wt.ERR_BAD_REQUEST,e)):m.send(i||null)})};const dn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof wt?t:new Qt(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,i(new wt(`timeout ${t} of ms exceeded`,wt.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>vt.asap(o),a}},pn=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},hn=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},fn=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of hn(e))yield*pn(n,t)}(e,t);let s,o=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=o+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},mn="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,gn=mn&&"function"==typeof ReadableStream,bn=mn&&("function"==typeof TextEncoder?(yn=new TextEncoder,e=>yn.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var yn;const _n=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},vn=gn&&_n(()=>{let e=!1;const t=new Request(Mt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),wn=gn&&_n(()=>vt.isReadableStream(new Response("").body)),En={stream:wn&&(e=>e.body)};var Cn;mn&&(Cn=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!En[e]&&(En[e]=vt.isFunction(Cn[e])?t=>t[e]():(t,n)=>{throw new wt(`Response type '${e}' is not supported`,wt.ERR_NOT_SUPPORT,n)})}));const Rn=async(e,t)=>{const n=vt.toFiniteNumber(e.getContentLength());return n??(async e=>{if(null==e)return 0;if(vt.isBlob(e))return e.size;if(vt.isSpecCompliantForm(e)){const t=new Request(Mt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return vt.isArrayBufferView(e)||vt.isArrayBuffer(e)?e.byteLength:(vt.isURLSearchParams(e)&&(e+=""),vt.isString(e)?(await bn(e)).byteLength:void 0)})(t)};const On={http:null,xhr:un,fetch:mn&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=cn(e);c=c?(c+"").toLowerCase():"text";let h,f=dn([i,s&&s.toAbortSignal()],o);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(l&&vn&&"get"!==n&&"head"!==n&&0!==(g=await Rn(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(vt.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=tn(g,en(nn(l)));r=fn(n.body,65536,e,t)}}vt.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;h=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let s=await fetch(h,p);const o=wn&&("stream"===c||"response"===c);if(wn&&(a||o&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=s[t]});const t=vt.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&tn(t,en(nn(a),!0))||[];s=new Response(fn(s.body,65536,n,()=>{r&&r(),m&&m()}),e)}c=c||"text";let b=await En[vt.findKey(En,c)||"text"](s,e);return!o&&m&&m(),await new Promise((t,n)=>{Yt(t,n,{data:b,headers:Xt.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:h})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new wt("Network Error",wt.ERR_NETWORK,e,h),{cause:t.cause||t});throw wt.from(t,t&&t.code,e,h)}})};vt.forEach(On,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Sn=e=>`- ${e}`,An=e=>vt.isFunction(e)||null===e||!1===e;var Tn=e=>{e=vt.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!An(n)&&(r=On[(t=String(n)).toLowerCase()],void 0===r))throw new wt(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+s]=r}if(!r){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new wt("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Sn).join("\n"):" "+Sn(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function jn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qt(null,e)}function xn(e){jn(e),e.headers=Xt.from(e.headers),e.data=Gt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Tn(e.adapter||zt.adapter)(e).then(function(t){return jn(e),t.data=Gt.call(e,e.transformResponse,t),t.headers=Xt.from(t.headers),t},function(t){return Zt(t)||(jn(e),t&&t.response&&(t.response.data=Gt.call(e,e.transformResponse,t.response),t.response.headers=Xt.from(t.response.headers))),Promise.reject(t)})}const Pn="1.11.0",kn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{kn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Nn={};kn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Pn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,s)=>{if(!1===e)throw new wt(r(i," has been removed"+(t?" in "+t:"")),wt.ERR_DEPRECATED);return t&&!Nn[i]&&(Nn[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,s)}},kn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Un={assertOptions:function(e,t,n){if("object"!=typeof e)throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const t=e[s],n=void 0===t||o(t,s,e);if(!0!==n)throw new wt("option "+s+" must be "+n,wt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new wt("Unknown option "+s,wt.ERR_BAD_OPTION)}},validators:kn};const Dn=Un.validators;let Ln=class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ln(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Un.assertOptions(n,{silentJSONParsing:Dn.transitional(Dn.boolean),forcedJSONParsing:Dn.transitional(Dn.boolean),clarifyTimeoutError:Dn.transitional(Dn.boolean)},!1),null!=r&&(vt.isFunction(r)?t.paramsSerializer={serialize:r}:Un.assertOptions(r,{encode:Dn.function,serialize:Dn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Un.assertOptions(t,{baseUrl:Dn.spelling("baseURL"),withXsrfToken:Dn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=i&&vt.merge(i.common,i[t.method]);i&&vt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=Xt.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[xn.bind(this),void 0];for(e.unshift(...o),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=o.length;let p=t;for(d=0;d<u;){const e=o[d++],t=o[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{c=xn.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return Nt(on((e=ln(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};vt.forEach(["delete","get","head","options"],function(e){Ln.prototype[e]=function(t,n){return this.request(ln(n||{},{method:e,url:t,data:(n||{}).data}))}}),vt.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(ln(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ln.prototype[e]=t(),Ln.prototype[e+"Form"]=t(!0)});const Fn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fn).forEach(([e,t])=>{Fn[t]=e});const Bn=function e(t){const n=new Ln(t),r=xe(Ln.prototype.request,n);return vt.extend(r,Ln.prototype,n,{allOwnKeys:!0}),vt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ln(t,n))},r}(zt);Bn.Axios=Ln,Bn.CanceledError=Qt,Bn.CancelToken=class CancelToken{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Qt(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CancelToken(function(t){e=t}),cancel:e}}},Bn.isCancel=Zt,Bn.VERSION=Pn,Bn.toFormData=Tt,Bn.AxiosError=wt,Bn.Cancel=Bn.CanceledError,Bn.all=function(e){return Promise.all(e)},Bn.spread=function(e){return function(t){return e.apply(null,t)}},Bn.isAxiosError=function(e){return vt.isObject(e)&&!0===e.isAxiosError},Bn.mergeConfig=ln,Bn.AxiosHeaders=Xt,Bn.formToJSON=e=>qt(vt.isHTMLForm(e)?new FormData(e):e),Bn.getAdapter=Tn,Bn.HttpStatusCode=Fn,Bn.default=Bn;const{Axios:In,AxiosError:$n,CanceledError:Mn,isCancel:qn,CancelToken:zn,VERSION:Hn,all:Jn,Cancel:Wn,isAxiosError:Vn,spread:Kn,toFormData:Xn,AxiosHeaders:Gn,HttpStatusCode:Zn,formToJSON:Qn,getAdapter:Yn,mergeConfig:er}=Bn;var tr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointments(e){return this.httpClient.get("/appointments/v1",{params:e}).then(this.validate(Ce))}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(Oe))}async getDocumentsStorage(){return this.httpClient.get("/appointments/v1/documents/storage").then(e=>e.data).then(this.validate(Se))}async rescheduleAppointment(e){const{id:t,...n}=e;return this.httpClient.put(`/appointments/v1/${t}/reschedule`,n)}async cancelAppointment(e){return this.httpClient.put(`/appointments/v1/${e.id}/cancel`)}async updateAppointment(e){const{appointment_id:t,...n}=e;return this.httpClient.put(`/appointments/v1/${t}/update`,n)}async addDocument(e){const{appointment_id:t,...n}=e;return this.httpClient.post(`/appointments/v1/${t}/consultation-document`,n)}async deleteDocument(e){return this.httpClient.delete(`/appointments/v1/${e.appointment_id}/consultation-document/${e.document_id}`)}async reconnectAppointment(e){return this.httpClient.put(`/appointments/v1/${e.appointmentId}/reconnect`)}},nr=class{constructor(e,t){this.httpClient=e,this.validate=t}async loginToken(e){return this.httpClient.post("/login/v1/token",{token:e.token},{headers:{"x-api-key":e.api_key}}).then(this.validate(Ae))}};var rr=class{constructor(e,t){this.httpClient=e,this.validate=t}async postReview(e){return this.httpClient.post("/consultations/v1/review",e)}async getReview(e){return this.httpClient.get(`/consultations/v1/review/${e}`).then(e=>e.data).then(this.validate(Te))}},ir=class{constructor(e,t){this.httpClient=e,this.validate=t}async uploadFile(e){const t=new FormData;return t.append("file",e.file,e.file.name),this.httpClient.post("/documents/v1/upload-file",t,{headers:{"Content-Type":"multipart/form-data"}}).then(this.validate(je))}},sr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointment(e){return this.httpClient.get(`/flash/v1/appointments/${e.appointmentId}`).then(e=>e.data).then(this.validate(I))}async joinCall(e){return this.httpClient.get(`/flash/v1/calls/${e.callId}/join`).then(e=>e.data).then(this.validate($))}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(M))}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(q))}},or=class{constructor(e,t){this.httpClient=e,this.validate=t}async getOrganizationSpecialties(){return this.httpClient.get("/organizations/v1/specialities").then(e=>e.data).then(this.validate(z))}async getOrganizationSetup(){return this.httpClient.get("/organizations/v1/setup").then(e=>e.data).then(this.validate(H))}},ar=class{constructor(e,t){this.httpClient=e,this.validate=t}async createPaymentLink(e){const{specialty_id:t,...n}=e,r={...n,speciality_id:t};return this.httpClient.post("/payments/v1/schedule",r).then(e=>e.data).then(this.validate(V))}async createImmediateVideocallPaymentLink(e){return this.httpClient.post("/payments/v1/immediate-videocall",e).then(e=>e.data).then(this.validate(K))}async getConsultationCoupon(e,t){return this.httpClient.get(`/payments/v1/consultation-coupon/${encodeURIComponent(e)}`,{params:{amount:t}}).then(e=>e.data).then(this.validate(J))}async getAppointmentConsultationCoupon(e){return this.httpClient.get(`/payments/v1/appointment/${encodeURIComponent(e)}/consultation-coupon`).then(e=>e.data).then(this.validate(W))}async getPaymentSession(e){return this.httpClient.get(`/payments/v1/session/${e}`).then(e=>e.data).then(this.validate(G))}async validateApplePayMerchant(e){return this.httpClient.post("/payments/v1/apple-pay/validate-merchant",e).then(this.validate(Z))}async authorizeApplePay(e){return this.httpClient.post("/payments/v1/apple-pay/authorize",e).then(this.validate(Q))}async authorizeGooglePay(e){return this.httpClient.post("/payments/v1/google-pay/authorize",e).then(this.validate(Y))}},lr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getProfessional(e){return this.httpClient.get(`sdk/v1/professionals/${e.hash}`).then(e=>e.data).then(this.validate(ne))}async readAllMessages(e){return this.httpClient.put(`sdk/v1/rooms/${e.roomId}/messages/read`).then(e=>e.data)}},cr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getPatientProfile(){return this.httpClient.get("/profile/v1/patients").then(e=>e.data).then(this.validate(ie))}async getProfessionalPublicProfile(e){return this.httpClient.get(`/profile/v1/public/professionals/${e.hash}`).then(e=>e.data).then(this.validate(se))}async acceptLegalConsent(e){return this.httpClient.post("/profile/v1/legal-consent",e)}},ur=class{constructor(e,t){this.httpClient=e,this.validate=t}async getRoomMessages(e){return this.httpClient.get(`api/v1/rooms/${e.roomId}/messages`).then(e=>e.data).then(this.validate(pe))}async getUnreadMessagesCount(e){return this.httpClient.get(`chat/v1/${e.roomId}/unread-count`).then(e=>e.data).then(this.validate(he))}async createSupportRoom(e){return this.httpClient.post("chat/v1/support-room",e).then(e=>e.data).then(this.validate(fe))}},dr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getScheduleServices(){return this.httpClient.get("/schedules/v1/services").then(e=>e.data).then(this.validate(ye))}async getProfessionalsBySpecialtyAndService(e){return this.httpClient.get("/schedules/v1/professionals",{params:e}).then(e=>e.data).then(this.validate(_e))}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(ve))}async getScheduleServiceSpecialities(e){return this.httpClient.get(`/schedules/v1/services/${e}/specialities`).then(e=>e.data).then(this.validate(we))}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(Ee))}};var pr={development:"https://chat-dev.mediquo.com",production:"https://chat.mediquo.com"},hr=class{constructor({env:e="production",baseURL:t,debug:n}={}){const r=t??pr[e];var i;this.httpClient=(i=r,Bn.create({baseURL:i,headers:{"Content-Type":"application/json"}}));const s=(o={debug:n},e=>t=>{const n=e.safeParse(t.data);if(n.error&&o?.debug){const e=t.config?.url??"";console.warn(`[Validation Error]${e?` - URL: ${e}`:""}\n${r=n.error,r.issues.map(e=>`${e.path.join(".")}: ${e.message}`).join("\n")}`)}var r;return n.data??t.data});var o;this.flash=new sr(this.httpClient,s),this.auth=new nr(this.httpClient,s),this.appointments=new tr(this.httpClient,s),this.payments=new ar(this.httpClient,s),this.schedules=new dr(this.httpClient,s),this.organizations=new or(this.httpClient,s),this.profile=new cr(this.httpClient,s),this.professionals=new lr(this.httpClient,s),this.rooms=new ur(this.httpClient,s),this.documents=new ir(this.httpClient,s),this.consultations=new rr(this.httpClient,s)}setAuthToken(e){this.httpClient.defaults.headers.common.Authorization=`Bearer ${e}`}setApiKey(e){this.httpClient.defaults.headers.common["x-api-key"]=e}setLanguage(e){this.httpClient.defaults.headers.common["Accept-Language"]=e}};let fr=null,mr=null;const gr=new Proxy({},{get:(e,t)=>(fr&&mr===y.MODE||(fr=new hr({env:y.MODE,debug:"development"===y.MODE}),mr=y.MODE),fr)[t]});export{N as A,L as C,w as D,oe as M,X as P,ge as S,A as a,gr as b,B as c,P as d,T as e,O as f,j as g,S as h,Vn as i,F as j,re as k};
@@ -1 +1 @@
1
- import{P as n}from"./api-chat-client-BTBtu01T.js";function e(e,r,t){return e===n.Paid?{kind:"success",sessionId:t,reference:r}:e===n.Denied?{kind:"denied",sessionId:t}:{kind:"error",reason:"authorize"}}function r(n){const e=n.merchant_session;return null===e||"object"!=typeof e||Array.isArray(e)?n:e}function t(n){if("string"==typeof n)return n;if(null!==n&&"object"==typeof n&&"paymentData"in n){const e=n.paymentData;if("string"==typeof e)return e;if(null!=e)return JSON.stringify(e)}return JSON.stringify(n)}export{e as r,t as s,r as u};
1
+ import{P as n}from"./api-chat-client-C8SqZtCa.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
+ const e=new Set(["children","localName","ref","style","className"]),t=new WeakMap,n=(e,n,r,s,a)=>{const o=a?.[n];void 0===o?(e[n]=r,null==r&&n in HTMLElement.prototype&&e.removeAttribute(n)):r!==s&&((e,n,r)=>{let s=t.get(e);void 0===s&&t.set(e,s=new Map);let a=s.get(n);void 0!==r?void 0===a?(s.set(n,a={handleEvent:r}),e.addEventListener(n,a)):a.handleEvent=r:void 0!==a&&(s.delete(n),e.removeEventListener(n,a))})(e,o,r)},r=({react:t,tagName:r,elementClass:s,events:a,displayName:o})=>{const c=new Set(Object.keys(a??{})),l=t.forwardRef((o,l)=>{const u=t.useRef(new Map),i=t.useRef(null),d={},f={};for(const[t,n]of Object.entries(o))e.has(t)?d["className"===t?"class":t]=n:c.has(t)||t in s.prototype?f[t]=n:d[t]=n;return t.useLayoutEffect(()=>{if(null===i.current)return;const e=new Map;for(const t in f)n(i.current,t,o[t],u.current.get(t),a),u.current.delete(t),e.set(t,o[t]);for(const[e,t]of u.current)n(i.current,e,void 0,t,a);u.current=e}),t.useLayoutEffect(()=>{i.current?.removeAttribute("defer-hydration")},[]),d.suppressHydrationWarning=!0,t.createElement(r,{...d,ref:t.useCallback(e=>{i.current=e,"function"==typeof l?l(e):null!==l&&(l.current=e)},[l])})});return l.displayName=o??s.name,l};export{r as o};
@@ -0,0 +1 @@
1
+ import{_ as e,t}from"./custom-element-DA9Fxvxd.js";import{e as s}from"./provide-CfT7g_Zi.js";import{Q as o,c as i,s as a,M as r}from"./mutation-controller-OVT8NEt6.js";import{l as n}from"./parseISO-jT42c8Ob.js";import{m as l,s as d}from"./runtime-Bg1WXVCx.js";import{i as c,a as m,x as h,E as p}from"./lit-element-DiWJYFwC.js";import{n as g}from"./property-scuRaFcM.js";import{r as u}from"./state-LQivXIgA.js";import{n as v}from"./context-provider-CiMFpvDA.js";import{tokens as y}from"../theme.js";import{b,M as f}from"./api-chat-client-C8SqZtCa.js";import{xIcon as w}from"../ui/icons/x-icon.js";import"../ui/mq-avatar.js";import"../ui/mq-button.js";import"../ui/mq-skeleton.js";import{o as x}from"./if-defined-BYeVdwgd.js";import{chevronLeftIcon as k}from"../ui/icons/chevron-left-icon.js";import{e as $}from"./query-CeeutdfT.js";import{l as I,z}from"./external-zAbuzxDj.js";import{DownloadFileEvent as C}from"../events.js";import{checkDoubleIcon as T}from"../ui/icons/check-double-icon.js";import{checkIcon as D}from"../ui/icons/check-icon.js";import{getLocale as M}from"../i18n.js";import{S as q,a as S}from"./chunk-YTQUGGS3-DN-JZpgG.js";import{Q as j}from"./query-QJ1INUTG.js";import{e as P}from"./class-map-Co76I6aw.js";const _=v("apiKey"),A=v("token"),E=v("professionalHash"),R=v("roomId"),U=v("consultationId"),B=v("consultationType");class MqChatRoomCloseEvent extends Event{static{this.eventName="mq-chat-room-close"}constructor(){super(MqChatRoomCloseEvent.eventName,{bubbles:!0,composed:!0})}}class MqChatRoomProfileEvent extends Event{static{this.eventName="mq-chat-room-profile"}constructor(){super(MqChatRoomProfileEvent.eventName,{bubbles:!0,composed:!0})}}function H(e,t,s){return{queryKey:["professionals",t.hash],queryFn:()=>e.professionals.getProfessional(t),staleTime:0,...s}}const N=c`header{padding:var(--size-3) var(--size-4);background-color:var(--color-background-primary);display:flex;justify-content:space-between;gap:var(--size-1)}.left-side{display:flex;flex:1;min-width:0;align-items:center;gap:var(--size-3)}.left-side mq-avatar{flex-shrink:0}.info{min-width:0}.ghost-btn{text-align:left;background:0 0;border:none;padding:0;cursor:pointer}.right-side{display:flex;align-items:center}.name{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold);margin:0;color:var(--color-background);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.specialty{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;color:var(--color-white);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.name-skeleton{margin-bottom:var(--size-1)}.profile-title{font-family:var(--font-body);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-medium);margin:0;color:var(--color-white)}`;let K=class ChatRoomHeader extends m{constructor(){super(...arguments),this.hideCloseButton=!1,this.getProfessionalQuery=new o(this,()=>H(b,{hash:this.professionalHash}))}static{this.styles=N}handleClose(){this.dispatchEvent(new MqChatRoomCloseEvent)}handleClickProfile(){this.dispatchEvent(new MqChatRoomProfileEvent)}renderProfile(){return h`<div class="left-side"><mq-button type="button" size="icon-md" variant="ghost-inverted" @click="${()=>{this.dispatchEvent(new CustomEvent("goto-chat",{bubbles:!0,composed:!0}))}}">${k({size:24})}</mq-button><p class="profile-title">${l("Perfil de profesional")}</p></div>`}renderChat(){return h`${this.getProfessionalQuery.render({complete:e=>h`<button type="button" class="left-side ghost-btn" @click="${this.handleClickProfile}"><mq-avatar src="${x(e.avatar??void 0)}" alt="User Avatar" fallback="John Doe" size="sm"></mq-avatar><div class="info"><p class="name">${e.name}</p><p class="specialty">${e.title}</p></div></button>`,pending:()=>h`<div class="left-side"><mq-skeleton width="45px" height="45px" border-radius="full"></mq-skeleton><div><mq-skeleton class="name-skeleton" height="14px" width="120px"></mq-skeleton><mq-skeleton height="14px" width="100px"></mq-skeleton></div></div>`})}`}render(){return h`<header>${"profile"===this.view?this.renderProfile():this.renderChat()}<div class="right-side">${this.hideCloseButton?p:h`<mq-button type="button" size="icon-md" variant="ghost-inverted" @click="${this.handleClose}">${w({size:24})}</mq-button>`}</div></header>`}};e([g({type:String})],K.prototype,"professionalHash",void 0),e([g({type:Boolean})],K.prototype,"hideCloseButton",void 0),e([g({type:String})],K.prototype,"view",void 0),K=e([n(),t("chat-room-header")],K);const L=/(https?:\/\/[^\s,;:!)\]}\]]+|www\.[^\s,;:!)\]}\]]+|[a-zA-Z0-9][-a-zA-Z0-9]*(?:\.[a-zA-Z0-9][-a-zA-Z0-9]*)+(?:\/[^\s,;:!)\]}\]]*|(?:\?|#|&)[^\s,;:!)\]}\]]*)?)/gi;function F(e){return e.split(L).map((e,t)=>{if(t%2==1){const t=e.startsWith("http")?e:`https://${e}`;return h`<a href="${t}" target="_blank" rel="noopener noreferrer" class="message-link">${e}</a>`}return e})}let O=class TextMessageBubble extends m{static{this.styles=[c`:host{display:block}.message-bubble{padding:var(--size-2_5) var(--size-4);border-radius:var(--border-radius-lg);word-wrap:break-word;font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal)}.message-bubble.received{background-color:var(--chat-received-message-background);color:var(--chat-received-message-foreground);border-bottom-left-radius:0}.message-bubble.sent{background-color:var(--chat-sent-message-background);color:var(--chat-sent-message-foreground);border-bottom-right-radius:0}.message-content{white-space:pre-wrap}.message-paragraph{margin:0 0 var(--size-3) 0}.message-paragraph:last-child{margin-bottom:0}.message-bubble.received .message-content a.message-link,.message-bubble.sent .message-content a.message-link{color:var(--color-primary-link-default);text-decoration:underline}.message-bubble.received .message-content a.message-link:hover,.message-bubble.sent .message-content a.message-link:hover{opacity:.8}`]}formatMessageContent(e){const t=e.split("\n\n").filter(e=>e.trim());if(t.length<=1)return h`<div class="message-content">${F(e)}</div>`;const s=t.map(e=>h`<div class="message-paragraph">${F(e.trim())}</div>`);return h`<div class="message-content">${s}</div>`}render(){return h`<div class="message-bubble ${this.kind}">${this.formatMessageContent(this.message.string)}</div>`}};e([g({type:Object})],O.prototype,"message",void 0),e([g({type:String})],O.prototype,"kind",void 0),O=e([t("text-message-bubble")],O);const Q=c`:host{display:block}.message-bubble{padding:var(--size-2);border-radius:var(--border-radius-lg);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);overflow:hidden}.message-bubble.received{background-color:var(--chat-received-message-background);border-bottom-left-radius:0}.message-bubble.sent{background-color:var(--chat-sent-message-background);border-bottom-right-radius:0}.image-content{display:block;width:229px;height:229px;object-fit:cover;border-radius:var(--border-radius-md)}.image-placeholder{display:flex;align-items:center;justify-content:center;width:100%;max-width:300px;height:200px;background-color:var(--color-gray-light);border-radius:var(--border-radius-md);color:var(--chat-sent-message-foreground);font-size:var(--text-sm)}.image-content{cursor:pointer;transition:opacity .2s ease}.image-content:hover{opacity:.9}.preview-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:var(--dialog-underlay);display:flex;align-items:center;justify-content:center;z-index:1000;cursor:pointer;opacity:0;transition:opacity var(--dialog-transition-duration) ease}.preview-overlay.open{opacity:1}.preview-image{position:fixed;z-index:1000;inset:var(--mq-safe-top,0) var(--mq-safe-right,0) var(--mq-safe-bottom,0) var(--mq-safe-left,0);max-width:calc(100% - var(--mq-safe-left,4px) - var(--mq-safe-right,4px));max-height:calc(100% - var(--mq-safe-top,4px) - var(--mq-safe-bottom,4px));margin:auto;object-fit:contain;cursor:default;box-shadow:var(--dialog-shadow);transform:scale(.95);transition:transform var(--dialog-transition-duration) ease}.preview-overlay.open .preview-image{transform:scale(1)}.preview-close{z-index:1001;display:inline-flex;align-items:center;justify-content:center;height:var(--size-10);width:var(--size-10);position:absolute;top:var(--mq-safe-top,4px);right:var(--mq-safe-right,4px);background:rgba(255,255,255,.3);border:none;color:var(--color-neutrals-text-default);font-size:var(--text-xl);padding:var(--size-2) var(--size-3);border-radius:var(--border-radius-md);cursor:pointer;transition:background var(--dialog-transition-duration) ease}.preview-close:hover{background:var(--dialog-close-hover-bg)}`;let V=class ImageMessageBubble extends m{constructor(){super(...arguments),this.showPreview=!1,this.isPreviewRendered=!1,this.isPreviewActive=!1,this.closeTimer=null}static{this.styles=Q}handleImageError(e){const t=e.target;t.style.display="none";const s=t.nextElementSibling;s&&(s.style.display="flex")}handleImageLoad(e){const t=e.target.nextElementSibling;t&&(t.style.display="none")}handleImageClick(){this.showPreview=!0,this.isPreviewRendered=!0,this.updateComplete.then(()=>{requestAnimationFrame(()=>{this.isPreviewActive=!0})})}handleImageKeyDown(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleImageClick())}handleClosePreview(e){e&&e.stopPropagation(),this.isPreviewActive=!1,this.closeTimer&&window.clearTimeout(this.closeTimer),this.closeTimer=window.setTimeout(()=>{this.isPreviewRendered=!1,this.showPreview=!1,this.closeTimer=null},200)}handleOverlayClick(e){e.target===e.currentTarget&&this.handleClosePreview()}handleOverlayKeyDown(e){"Enter"!==e.key&&" "!==e.key||e.target===e.currentTarget&&(e.preventDefault(),this.handleClosePreview())}handleKeyDown(e){"Escape"===e.key&&this.showPreview&&(e.preventDefault(),this.handleClosePreview())}handlePreviewImageKeyDown(e){e.stopPropagation()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeyDown.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeyDown.bind(this)),this.closeTimer&&(window.clearTimeout(this.closeTimer),this.closeTimer=null)}render(){const e=this.message.attachment.signed_url??this.message.attachment.url;return h`<div class="message-bubble ${this.kind}"><img class="image-content" src="${e}" width="229" height="229" alt="Shared attachment" @error="${this.handleImageError}" @load="${this.handleImageLoad}" @click="${this.handleImageClick}" @keydown="${this.handleImageKeyDown}" tabindex="0"><div class="image-placeholder" style="display:none">Image unavailable</div></div>${this.showPreview&&this.isPreviewRendered?h`<div class="preview-overlay ${this.isPreviewActive?"open":""}" @click="${this.handleOverlayClick}" @keydown="${this.handleOverlayKeyDown}" tabindex="0"><button class="preview-close" @click="${this.handleClosePreview}" aria-label="Close preview">${w({size:24})}</button> <img class="preview-image" src="${e}" alt="Shared attachment preview" @click="${e=>e.stopPropagation()}" @keydown="${this.handlePreviewImageKeyDown}" tabindex="0"></div>`:""}`}};e([g({type:Object})],V.prototype,"message",void 0),e([g({type:String})],V.prototype,"kind",void 0),e([i({context:A})],V.prototype,"token",void 0),e([u()],V.prototype,"showPreview",void 0),e([u()],V.prototype,"isPreviewRendered",void 0),e([u()],V.prototype,"isPreviewActive",void 0),V=e([t("image-message-bubble")],V);const Y=c`:host{background-color:var(--chat-system-message-background);color:var(--chat-system-message-foreground);display:block;padding:var(--size-2_5) var(--size-4);border-radius:var(--border-radius-lg);font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal)}a.message-link{color:var(--color-primary-link-default);text-decoration:underline}a.message-link:hover{opacity:.8}`;let Z=class SystemMessageBubble extends m{static{this.styles=Y}render(){return h`<div class="system-message-bubble">${F(this.message.string)}</div>`}};e([g({type:Object})],Z.prototype,"message",void 0),Z=e([t("system-message-bubble")],Z);const J=c`:host{display:block}.message-bubble{display:inline-block;padding:var(--size-2_5) var(--size-4);border-radius:var(--border-radius-lg);word-wrap:break-word;font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);text-decoration:underline;color:var(--color-primary-link-default);border:none;cursor:pointer;text-align:left}.message-bubble:hover:not(:disabled){opacity:.8}.message-bubble:disabled{opacity:.5;cursor:not-allowed}.message-bubble.received{background-color:var(--chat-received-message-background);border-bottom-left-radius:0}.message-bubble.sent{background-color:var(--chat-sent-message-background);border-bottom-right-radius:0}.message-content{white-space:pre-wrap}.message-paragraph{margin:0 0 var(--size-3) 0}.message-paragraph:last-child{margin-bottom:0}`;let G=class FileMessageBubble extends m{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=J}formatMessageContent(e){const t=e.split("\n\n").filter(e=>e.trim());if(t.length<=1)return h`<div class="message-content">${e}</div>`;const s=t.map(e=>h`<div class="message-paragraph">${e.trim()}</div>`);return h`<div class="message-content">${s}</div>`}async handleDownload(){if(this.isDownloading)return;const e=this.message.attachment.url;try{this.isDownloading=!0;const t=await fetch(e,{headers:{Authorization:`Bearer ${this.token}`}});if(!t.ok)throw new Error(`Failed to fetch file: ${t.statusText}`);const s=await t.blob(),o=new FileReader;o.onloadend=()=>{const e=o.result,t=new C({url:e,filename:this.message.attachment.file_name});this.dispatchEvent(t),this.isDownloading=!1},o.onerror=()=>{I.error("Error reading file as data URL"),this.isDownloading=!1},o.readAsDataURL(s)}catch(e){I.error("Error downloading file:",e),this.isDownloading=!1}}render(){return h`<button type="button" @click="${this.handleDownload}" class="message-bubble ${this.kind}" ?disabled="${this.isDownloading}">${this.formatMessageContent(this.message.attachment.file_name)}</button>`}};e([g({type:Object})],G.prototype,"message",void 0),e([g({type:String})],G.prototype,"kind",void 0),e([i({context:A})],G.prototype,"token",void 0),e([u()],G.prototype,"isDownloading",void 0),G=e([t("file-message-bubble")],G);var W=z.enum(["ordinary","system"]).enum;let X=class MessageBubble extends m{constructor(){super(...arguments),this.showTimestamp=!0}static{this.styles=[c`:host{display:block}.timestamp{font-family:var(--font-body);font-size:var(--text-xs);color:var(--color-gray-medium);font-weight:var(--font-weight-normal);text-align:left;display:flex;align-items:center;gap:var(--size-1)}.timestamp.sent{text-align:right;justify-content:flex-end}.status-icon{width:12px;height:12px}.status-icon.read{color:var(--color-primary)}`]}formatTimestamp(e){if(!e)return"";try{const t=new Date(e);return new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1}).format(t)}catch{return e}}renderStatusIcon(){switch(this.message.status){case f.Sent:return D({size:12,color:"currentColor"});case f.Received:return T({size:12,color:"currentColor"});case f.Read:return T({size:12,color:"currentColor",className:"read"});default:return null}}renderBubbleContent(){switch(this.message.type){case"image":return h`<image-message-bubble .message="${this.message}" .kind="${this.kind}"></image-message-bubble>`;case"file":return h`<file-message-bubble .message="${this.message}" .kind="${this.kind}"></file-message-bubble>`;default:return h`<text-message-bubble .message="${this.message}" .kind="${this.kind}"></text-message-bubble>`}}render(){if(this.message.senderType===W.system)return h`<system-message-bubble .message="${this.message}"></system-message-bubble>`;const e=this.message.createdAt?new Date(this.message.createdAt):this.message.time?new Date(this.message.time):null;return h`${this.renderBubbleContent()} ${this.showTimestamp&&e?h`<div class="timestamp ${this.kind}">${this.formatTimestamp(e.toISOString())} ${"sent"===this.kind?h`<span class="status-icon ${this.message.status===f.Read?"read":""}">${this.renderStatusIcon()}</span>`:""}</div>`:""}`}};e([g({type:String})],X.prototype,"kind",void 0),e([g({type:Object})],X.prototype,"message",void 0),e([g({type:Boolean})],X.prototype,"showTimestamp",void 0),X=e([t("message-bubble")],X);let ee=class DateBanner extends m{constructor(){super(...arguments),this.date=""}static{this.styles=[y,c`:host{display:block;margin-bottom:var(--size-2)}.date-banner{display:flex;align-items:center;justify-content:center;position:relative}.date-text{background-color:var(--color-gray-light);color:var(--color-gray-darker);font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);padding:var(--size-1) var(--size-2);border-radius:var(--border-radius-2xl);white-space:nowrap}`]}formatDate(e){const t=M().replace("_","-"),s=new Date(e),o=new Date,i=new Date(o);i.setDate(i.getDate()-1);const a=new Date(s.getFullYear(),s.getMonth(),s.getDate()),r=new Date(o.getFullYear(),o.getMonth(),o.getDate()),n=new Date(i.getFullYear(),i.getMonth(),i.getDate());return a.getTime()===r.getTime()?l("Hoy"):a.getTime()===n.getTime()?l("Ayer"):s.toLocaleDateString(t,{dateStyle:"medium"})}render(){return h`<div class="date-banner"><span class="date-text">${this.formatDate(this.date)}</span></div>`}};function te(e){return e.createdAt?new Date(e.createdAt):e.time?new Date(e.time):new Date}e([g({type:String})],ee.prototype,"date",void 0),ee=e([n(),t("date-banner")],ee);let se=class MessagesList extends m{constructor(){super(...arguments),this.messages=[]}static{this.styles=[y,c`:host{display:block;width:100%;height:100%;overflow-y:auto;overflow-x:hidden}.messages-container{display:flex;flex-direction:column;padding:var(--size-4);gap:var(--size-1);background-color:var(--color-white);padding-bottom:var(--size-4)}.message-wrapper{display:flex;width:100%}.message-wrapper.received{justify-content:flex-start}.message-wrapper.sent{justify-content:flex-end}.message-wrapper.system{justify-content:center}message-bubble{max-width:70%}`]}scrollToBottom(){requestAnimationFrame(()=>{const e=this.messagesContainerEnd;e&&e.scrollIntoView({behavior:"instant",block:"end"})})}shouldShowMessageTimestamp(e,t){if(e.senderType===W.system)return!1;if(!t)return!0;if(t.senderType!==e.senderType)return!0;if(t.senderType===W.ordinary&&e.senderType===W.ordinary&&t.fromUserHash!==e.fromUserHash)return!0;return(te(t).getTime()-te(e).getTime())/6e4>1}groupMessagesByDate(e){const t=[];let s=null;return e.forEach((o,i)=>{const a=te(o),r=a?.toDateString();r!==s&&(t.push({type:"date",data:a.toDateString()}),s=r??null);const n=e[i+1],l=this.shouldShowMessageTimestamp(o,n);t.push({type:"message",data:o,showTimestamp:l})}),t}firstUpdated(){this.scrollToBottom()}willUpdate(e){e.has("messages")&&this.scrollToBottom()}render(){const e=this.groupMessagesByDate(this.messages),t=e.map((t,s)=>{if("date"===t.type)return h`<date-banner .date="${t.data}"></date-banner>`;const o=this.professionalHash!==t.data.fromUserHash,i=t.data.senderType===W.system?"system":o?"sent":"received";return h`<div class="message-wrapper ${i}"><message-bubble .message="${t.data}" .kind="${i}" .showTimestamp="${t.showTimestamp||"date"===e[s+1]?.type}"></message-bubble></div>`});return h`<div class="messages-container">${t}<div class="messages-container-end"></div></div>`}};e([g({type:Array})],se.prototype,"messages",void 0),e([g({type:String})],se.prototype,"professionalHash",void 0),e([$(".messages-container-end")],se.prototype,"messagesContainerEnd",void 0),se=e([t("messages-list")],se);let oe=class MessageBubbleSkeleton extends m{constructor(){super(...arguments),this.variant="patient",this.height="md",this.showTimestamp=!0}static{this.styles=[c`:host{display:block}.message-bubble{padding:var(--size-4);border-radius:var(--border-radius-lg);margin-bottom:var(--size-1);position:relative;overflow:hidden}.message-bubble.doctor{background-color:var(--color-gray-light);border-bottom-left-radius:0}.message-bubble.patient{background-color:var(--color-background-primary-light);border-bottom-right-radius:0}:host([height=sm]) .message-bubble{height:var(--size-8)}:host([height=md]) .message-bubble{height:var(--size-12)}`]}render(){return h`<div class="message-bubble ${this.variant}"></div>${this.showTimestamp?h`<div class="timestamp-skeleton ${this.variant}"></div>`:""}`}};e([g({type:String})],oe.prototype,"variant",void 0),e([g({type:String})],oe.prototype,"height",void 0),e([g({type:Boolean})],oe.prototype,"showTimestamp",void 0),oe=e([t("message-bubble-skeleton")],oe);let ie=class MessagesSkeleton extends m{constructor(){super(...arguments),this.messageCount=6}static{this.styles=[y,c`:host{display:block;width:100%;height:100%;overflow:hidden}.messages-container{display:flex;flex-direction:column;padding:var(--size-4);gap:var(--size-3);max-width:100%;height:100%;background-color:var(--color-white)}.message-wrapper{display:flex;width:100%}.message-wrapper.doctor{justify-content:flex-start}.message-wrapper.patient{justify-content:flex-end}message-bubble-skeleton{max-width:85%;min-width:60%;width:100%}`]}getSkeletonHeight(e){const t=["sm","md","sm","md","sm","md"];return t[e%t.length]}getSkeletonVariant(e){const t=["doctor","patient","doctor","doctor","patient","doctor","patient"];return t[e%t.length]}renderSkeletonMessages(){return Array.from({length:this.messageCount},(e,t)=>{const s=this.getSkeletonVariant(t),o=this.getSkeletonHeight(t);return h`<div class="message-wrapper ${s}"><message-bubble-skeleton variant="${s}" height="${o}" ?showTimestamp="${t===this.messageCount-1||Math.random()>.7}"></message-bubble-skeleton></div>`})}render(){return h`<div class="messages-container">${this.renderSkeletonMessages()}</div>`}};e([g({type:Number})],ie.prototype,"messageCount",void 0),ie=e([t("messages-skeleton")],ie);var ae=class{constructor(e,t){this.host=e,this.listeners=[],this.host.addController(this),this.socketContext=new a(this.host,{context:q,subscribe:!0,callback:e=>{if(e&&(this.socket=e,t?.listeners)){this.listeners=t.listeners;for(const e of this.listeners)this.socket?.on(e.eventName,e.callback)}}})}hostConnected(){}hostDisconnected(){for(const e of this.listeners)this.socket?.off(e.eventName,e.callback)}};function re(e,t){return{queryKey:["rooms",t.roomId],queryFn:()=>e.rooms.getRoomMessages(t),staleTime:0}}class OptimisticUpdatesController{constructor(e){this.host=e,this.queryClientContext=new a(this.host,{context:j,subscribe:!0,callback:e=>{e&&(this.queryClient=e)}}),this.host.addController(this)}hostConnected(){}appendMessageToRoom(e,t){const s=re(b,{roomId:t}).queryKey;this.queryClient?.setQueriesData({queryKey:s,exact:!0},t=>[...t??[],e])}deleteMessage(e,t){if(!this.queryClient)return;const s=re(b,{roomId:t}).queryKey;this.queryClient.setQueryData(s,t=>(t??[]).map(t=>t.messageId===e?{...t,deletedAt:(new Date).toISOString(),string:l("Este mensaje fue eliminado")}:t))}updateMessageStatus({messageId:e,status:t,roomId:s}){if(!this.queryClient)return;const o=re(b,{roomId:s}).queryKey;this.queryClient.setQueryData(o,s=>(s??[]).map(s=>s.messageId===e?{...s,status:t}:s))}}let ne=class ChatRoomMessages extends m{constructor(){super(...arguments),this.getRoomMessagesQuery=new o(this,()=>re(b,{roomId:this.roomId})),this.optimisticUpdatesController=new OptimisticUpdatesController(this),this.onMessageReceived=e=>{if(e.roomId!==this.roomId)return;const t=function(e){const t={roomId:"string"==typeof e.roomId?Number.parseInt(e.roomId,10):e.roomId,messageId:e.messageId,status:e.status,senderType:e.senderType,fromUserHash:e.fromUserHash,time:e.time,createdAt:e.time?new Date(e.time).toISOString():null,deletedAt:null};switch(e.type){case"string":return{...t,type:"string",string:e.string,auto:e.auto?1:0,attachment:null};case"image":return{...t,type:"image",string:e.fileName||"",auto:0,attachment:{file_name:e.fileName,file_size:e.fileSize,url:e.imageUrl,type:"uncategorized",meta:{duration:0},signed_url:e.imageUrl}};case"file":return{...t,type:"file",string:e.fileName||"",auto:0,attachment:{file_name:e.fileName,file_size:e.fileSize,url:e.fileUrl,type:"uncategorized",meta:{duration:0},signed_url:e.fileUrl}};default:return{...t,type:"string",string:"",auto:0,attachment:null}}}(e);this.optimisticUpdatesController.appendMessageToRoom(t,t.roomId),t.roomId===this.roomId&&e.fromUserHash===this.professionalHash&&this._socketController.socket?.emit(S.messageStatus,e.messageId,this.roomId,f.Read)},this.onMessageDeleted=e=>{e.room_id===this.roomId&&this.optimisticUpdatesController.deleteMessage(e.message_id,e.room_id)},this.onMessageStatusUpdated=e=>{e.roomId===this.roomId&&this.optimisticUpdatesController.updateMessageStatus({messageId:e.messageId,status:e.status,roomId:e.roomId})},this._socketController=new ae(this,{listeners:[{eventName:S.message,callback:this.onMessageReceived},{eventName:S.message_deleted,callback:this.onMessageDeleted},{eventName:S.messageStatus,callback:this.onMessageStatusUpdated}]})}static{this.styles=[y,c`:host{display:block;width:100%;height:100%}`]}render(){return this.getRoomMessagesQuery.render({pending:()=>h`<messages-skeleton messageCount="8"></messages-skeleton>`,complete:e=>h`<messages-list .messages="${e}" .professionalHash="${this.professionalHash}"></messages-list>`})}};e([g({type:Number})],ne.prototype,"roomId",void 0),e([g({type:String})],ne.prototype,"professionalHash",void 0),ne=e([t("chat-room-messages")],ne);var le=class{constructor(e){this.string=e.string,this.roomId=e.roomId,this.messageId=e.messageId,this.type=e.type,this.fileName=e.fileName,this.autoMessage=e.autoMessage,this.senderType=e.senderType,this.attachmentType=e.attachmentType,this.consultationId=e.consultationId,this.consultationType=e.consultationType}toSocketMessage(){return[S.message,this.string,this.roomId,this.messageId,this.type,this.fileName,this.autoMessage,this.senderType,this.attachmentType,this.consultationId,this.consultationType]}},de=class extends le{constructor(e){super({roomId:e.roomId,messageId:e.messageId,string:e.string,type:"string",fileName:null,autoMessage:!1,senderType:W.ordinary,attachmentType:"uncategorized",consultationId:e.consultationId,consultationType:e.consultationType})}},ce=class extends le{constructor(e){super({roomId:e.roomId,messageId:e.messageId,string:e.base64Attachment,fileName:e.fileName,type:e.type,autoMessage:!1,senderType:W.ordinary,attachmentType:"uncategorized",consultationId:e.consultationId,consultationType:e.consultationType})}};async function me(e){return await Promise.all(e.map(async e=>{const t=await function(e){return new Promise((t,s)=>{const o=new FileReader;o.onload=()=>{const i=o.result.split(",")[1];i?t(i):s(new Error(`Invalid data URL format for file: ${e.name}`))},o.onerror=()=>{s(new Error(`Failed to read file: ${e.name}`))},o.readAsDataURL(e)})}(e);return{name:e.name,size:e.size,type:e.type,base64:t}}))}const he=c`:host{display:block;position:absolute;bottom:0;padding:var(--size-2) var(--size-2);background:#fff}.footer-container{display:flex;align-items:center;gap:var(--size-1);max-width:100%}.input-container{flex:1;position:relative;display:flex;align-items:center;border:1px solid var(--color-neutrals-border-disabled);border-radius:var(--border-radius-2xl);padding:0 var(--size-1);overflow:hidden}.input-container:focus-within{border-color:var(--color-primary)}.message-input{flex:1;border:none;outline:0;background:0 0;font-family:var(--font-body);font-size:var(--text-base);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);padding-left:var(--sp-2)}.message-input::placeholder{color:var(--color-neutrals-text-medium)}.attachment-icon{width:var(--size-5);height:var(--size-5);color:var(--color-primary)}.send-icon{width:var(--size-5);height:var(--size-5);color:var(--color-primary)}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.send-button{color:var(--color-neutrals-link-disabled);background:0 0;border:none;padding:var(--size-2);border-radius:var(--border-radius-md);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color .2s ease}.send-button:hover:not(.disabled){background:var(--color-primary-light)}.send-button:active:not(.disabled){background-color:var(--color-neutrals-background-active)}.send-button.disabled{cursor:not-allowed;opacity:.4}.send-button.disabled .send-icon{color:var(--color-neutrals-text-disabled)}`;let pe=class ChatRoomFooter extends m{constructor(){super(...arguments),this.isTyping=!1,this.typingTimeoutId=null,this.inputValue="",this.socketController=new ae(this)}static{this.styles=[he]}handleInputChange(e){const t=e.target;this.inputValue=t.value,this.isTyping||(this.socketController.socket?.emit(S.typing,this.roomId),this.isTyping=!0),this.typingTimeoutId&&clearTimeout(this.typingTimeoutId),this.typingTimeoutId=setTimeout(()=>{this.isTyping&&(this.socketController.socket?.emit(S.stop_typing,this.roomId),this.isTyping=!1)},1500)}handleKeyDown(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),this.handleSendMessage())}async handleAttachment(e){const t=e.target.files;if(!t||0===t.length)return;const s=t.item(0);if(s)try{const e=(await me([s]))[0];if(!e)return void I.error("Error converting file to base64");const t=e?.type.includes("image")?"image":"file",o=crypto.randomUUID(),i=s.name,a=new ce({type:t,base64Attachment:e.base64,fileName:i,roomId:this.roomId,messageId:o,consultationId:this.consultationId,consultationType:this.consultationType});this.socketController.socket?.emit(...a.toSocketMessage())}catch(e){I.error("Error converting files to base64:",e)}}handleAttachmentClick(){this.attachmentInput.click()}handleSendMessage(){const e=this.inputValue.trim();if(!e)return;const t=crypto.randomUUID();this.isTyping&&(this.socketController.socket?.emit(S.stop_typing,this.roomId),this.isTyping=!1,this.typingTimeoutId&&clearTimeout(this.typingTimeoutId));const s=new de({messageId:t,string:e,roomId:this.roomId,consultationId:this.consultationId,consultationType:this.consultationType});this.socketController.socket?.emit(...s.toSocketMessage()),this.inputValue=""}disconnectedCallback(){this.isTyping&&(this.socketController.socket?.emit(S.stop_typing,this.roomId),this.typingTimeoutId&&clearTimeout(this.typingTimeoutId))}render(){const e=this.inputValue.trim().length>0;return h`<div class="footer-container"><div class="input-container"><input class="message-input" type="text" placeholder="${l("Escribe aquí...")}" .value="${this.inputValue}" @input="${this.handleInputChange}" @keydown="${this.handleKeyDown}"><div><input class="attachment-input sr-only" type="file" accept="image/jpeg,image/jpg,image/png,image/gif,image/bmp,image/tiff,application/pdf,text/*,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,audio/*,video/*" @change="${this.handleAttachment}"><mq-button variant="ghost" size="icon-sm" @click="${this.handleAttachmentClick}" title="${l("Adjuntar archivo")}">${h`<svg class="attachment-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>`}</mq-button></div></div><button class="send-button ${e?"":"disabled"}" @click="${this.handleSendMessage}" ?disabled="${!e}" title="${l("Enviar mensaje")}">${h`<svg class="send-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 2L11 13"/><path d="M22 2L15 22L11 13L2 9L22 2z"/></svg>`}</button></div>`}};e([i({context:U})],pe.prototype,"consultationId",void 0),e([i({context:B})],pe.prototype,"consultationType",void 0),e([g({type:Number})],pe.prototype,"roomId",void 0),e([u()],pe.prototype,"inputValue",void 0),e([$(".attachment-input")],pe.prototype,"attachmentInput",void 0),pe=e([t("chat-room-footer")],pe);const ge=e=>({all_week:!0,monday:1===e,tuesday:2===e,wednesday:3===e,thursday:4===e,friday:5===e,saturday:6===e,sunday:7===e,working_week:e>=1&&e<=5,weekend:0===e||6===e});function ue(e,t){const s=ge(6===e?0:e+1);return t.some(e=>{const t=e.days_of_week;return!0===s[t]})}let ve=class AvailabilitySection extends m{constructor(){super(...arguments),this.gaps=[],this.selectedDay=function(){const e=(new Date).getDay();return 0===e?6:e-1}()}static{this.styles=c`:host{display:flex;flex-direction:column;gap:var(--size-3)}.availability-header{font-family:var(--font-body);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-normal);color:var(--color-primary);text-align:center;margin:0;margin-bottom:var(--size-4) 0}.availability-days{display:flex;flex-direction:row;justify-content:center;gap:var(--size-1);overflow-x:auto;padding-bottom:var(--size-4)}.availability-button{outline:0;border:1px solid var(--color-gray-medium);background:0 0;color:var(--color-gray-medium);cursor:pointer;height:var(--size-9);width:var(--size-10);border-radius:var(--border-radius-sm);text-transform:capitalize;font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium)}.availability-button:hover{background-color:color-mix(in srgb,var(--color-gray-light) 50%,transparent)}.availability-button:focus{background-color:color-mix(in srgb,var(--color-gray-light) 50%,transparent)}.availability-button.active{background:var(--color-primary);color:var(--color-white);border:none}.availability-button:disabled{opacity:.5;cursor:not-allowed;background-color:var(--color-gray-light)}.time-title{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);color:var(--color-gray-dark);margin:0;margin-bottom:var(--size-1)}.time-entries{display:flex;flex-direction:column;gap:var(--size-1);margin-bottom:var(--size-6)}.time-entry{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);color:var(--color-gray-medium);margin:0}`}updated(e){e.has("gaps")&&(void 0===this.selectedDay||ue(this.selectedDay,this.gaps)||(this.selectedDay=void 0))}render(){const e=[{shortLabel:l("Lu"),label:l("Lunes"),key:"monday",disabled:!ue(0,this.gaps)},{shortLabel:l("Ma"),label:l("Martes"),key:"tuesday",disabled:!ue(1,this.gaps)},{shortLabel:l("Mi"),label:l("Miércoles"),key:"wednesday",disabled:!ue(2,this.gaps)},{shortLabel:l("Ju"),label:l("Jueves"),key:"thursday",disabled:!ue(3,this.gaps)},{shortLabel:l("Vi"),label:l("Viernes"),key:"friday",disabled:!ue(4,this.gaps)},{shortLabel:l("Sa"),label:l("Sábado"),key:"saturday",disabled:!ue(5,this.gaps)},{shortLabel:l("Do"),label:l("Domingo"),key:"sunday",disabled:!ue(6,this.gaps)}];return h`<h2 class="availability-header">${l("Disponibilidad")}</h2><div class="availability-days">${e.map((e,t)=>h`<button type="button" class="availability-button ${P({active:this.selectedDay===t&&!e.disabled})}" ?disabled="${e.disabled}" @click="${()=>{e.disabled||(this.selectedDay=t)}}">${e.shortLabel}</button>`)}</div>${void 0===this.selectedDay||e[this.selectedDay]?.disabled?"":(()=>{const t=function(e,t){const s=ge(6===e?0:e+1);return t.filter(e=>{const t=e.days_of_week;return!0===s[t]}).map(e=>({from_time:e.from_time,to_time:e.to_time}))}(this.selectedDay,this.gaps);return h`<div class="availability-time"><p class="time-title">${e[this.selectedDay]?.label}</p><div class="time-entries">${t.length>0?t.map(e=>h`<p class="time-entry">${l("De")} ${e.from_time} ${l("a")} ${e.to_time}</p>`):h`<p class="time-entry">${l("No hay horarios disponibles")}</p>`}</div></div>`})()}`}};e([g({type:Array})],ve.prototype,"gaps",void 0),e([u()],ve.prototype,"selectedDay",void 0),ve=e([n(),t("availability-section")],ve);const ye=c`:host{display:flex;flex-direction:column;height:100%;overflow-y:auto;background-color:var(--color-white)}.profile-container{padding:var(--size-6);display:flex;flex-direction:column}.profile-header{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:var(--size-6);border-bottom:1px solid var(--color-gray-medium);margin-bottom:var(--size-6)}.profile-avatar{margin-bottom:var(--size-2)}.profile-name{font-family:var(--font-body);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-medium);color:var(--color-text-primary);margin:var(--size-4) 0}.profile-specialty{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);color:var(--color-text-icons--secondary);margin:0;margin-bottom:var(--size-2);text-transform:uppercase}.profile-collegiate{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);color:var(--color-gray-medium);text-transform:uppercase;margin:0}.description-header{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-medium);color:var(--color-primary);margin:0;margin-bottom:var(--size-3)}.description-text{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-foreground);margin:0}`;let be=class ChatRoomProfile extends m{constructor(){super(...arguments),this.getProfessionalQuery=new o(this,()=>H(b,{hash:this.professionalHash}))}static{this.styles=[y,ye]}renderProfile(e){return h`<div class="profile-container"><div class="profile-header"><mq-avatar class="profile-avatar" src="${e.avatar||""}" fallback="${e.name}" alt="${e.name}'s profile picture" size="xl"></mq-avatar><div><h1 class="profile-name">${e.name}</h1>${e.title?h`<p class="profile-specialty">${e.title}</p>`:""} ${e.collegiate_number?h`<p class="profile-collegiate">${l(d`Nº COL. ${e.collegiate_number}`)}</p>`:""}</div></div>${e.chat_schedule&&e.chat_schedule.gaps.length>0?h`<availability-section .gaps="${e.chat_schedule.gaps}"></availability-section>`:p} ${e.description||e.overview?h`<div><h2 class="description-header">${l("Descripción")}</h2><p class="description-text">${e.description||e.overview}</p></div>`:""}</div>`}render(){return this.getProfessionalQuery.render({pending:()=>h``,complete:e=>this.renderProfile(e)})}};function fe(e,t,s){return{queryKey:["unread-messages",t],queryFn:()=>e.rooms.getUnreadMessagesCount(t),staleTime:0,...s}}e([g({type:String})],be.prototype,"professionalHash",void 0),be=e([n(),t("chat-room-profile")],be);const we=c`.root{display:flex;flex-direction:column;height:100%;overflow:hidden}chat-room-header{flex-shrink:0}chat-room-messages{flex:1;overflow-y:auto;overflow-x:hidden}chat-room-footer{position:sticky;bottom:0;left:0;right:0;flex-shrink:0}`;let xe=class MqChatRoom extends m{constructor(){super(...arguments),this.consultationId=void 0,this.consultationType=void 0,this.readonly=!1,this.hideCloseButton=!1,this.view="chat",this.socketController=new ae(this),this.readAllMessagesMutation=new r(this,{mutationFn:()=>b.professionals.readAllMessages({roomId:this.roomId}),onSuccess:()=>{this.queryClientContext?.invalidateQueries({queryKey:fe(b,{roomId:this.roomId}).queryKey})}})}static{this.styles=[y,we]}willUpdate(e){e.has("apiKey")&&this.apiKey&&b.setApiKey(this.apiKey),e.has("token")&&b.setAuthToken(this.token),e.has("roomId")&&(this.socketController.socket?.emit(S.joinRoom,this.roomId),this.readAllMessagesMutation.run(void 0))}render(){return h`<div class="root"><chat-room-header .professionalHash="${this.professionalHash}" .view="${this.view}" .hideCloseButton="${this.hideCloseButton}" @mq-chat-room-profile="${()=>{this.view="profile"}}" @goto-chat="${()=>{this.view="chat"}}"></chat-room-header>${"chat"===this.view?h`<chat-room-messages .roomId="${this.roomId}" .professionalHash="${this.professionalHash}"></chat-room-messages>${this.readonly?p:h`<chat-room-footer .roomId="${this.roomId}"></chat-room-footer>`}`:h`<chat-room-profile .professionalHash="${this.professionalHash}" @mq-chat-room-chat="${()=>{this.view="chat"}}"></chat-room-profile>`}</div>`}};e([s({context:_}),g({type:String,attribute:"api-key"})],xe.prototype,"apiKey",void 0),e([s({context:A}),g({type:String,attribute:"token"})],xe.prototype,"token",void 0),e([s({context:E}),g({type:String,attribute:"professional-hash"})],xe.prototype,"professionalHash",void 0),e([s({context:R}),g({type:Number,attribute:"room-id"})],xe.prototype,"roomId",void 0),e([s({context:U}),g({type:String,attribute:"consultation-id"})],xe.prototype,"consultationId",void 0),e([s({context:B}),g({type:String,attribute:"consultation-type"})],xe.prototype,"consultationType",void 0),e([g({type:Boolean,reflect:!0})],xe.prototype,"readonly",void 0),e([g({type:Boolean,attribute:"hide-close-button"})],xe.prototype,"hideCloseButton",void 0),e([u()],xe.prototype,"view",void 0),e([i({context:j,subscribe:!0})],xe.prototype,"queryClientContext",void 0),xe=e([n(),t("mq-chat-room")],xe);export{xe as M,H as a,MqChatRoomCloseEvent as b,MqChatRoomProfileEvent as c,fe as g};
@@ -1 +1 @@
1
- import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{E as s,i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as r}from"./property-scuRaFcM.js";import{r as l}from"./state-LQivXIgA.js";import{e as a}from"./class-map-Co76I6aw.js";import{i as d,t as c,e as p}from"./directive-2EDmOukv.js";import{o as v}from"./style-map-CIdqdn7C.js";import"../ui/mq-text-button.js";const u=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),u(t,e);return!0},m=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},b=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),g(e)}};function x(t){void 0!==this._$AN?(m(this),this._$AM=t,b(this)):this._$AM=t}function $(t,e=!1,s=0){const i=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(i))for(let t=s;t<i.length;t++)u(i[t],!1),m(i[t]);else null!=i&&(u(i,!1),m(i));else u(this,t)}const g=t=>{t.type==c.CHILD&&(t._$AP??=$,t._$AQ??=x)};class f extends d{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),b(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(u(this,t),m(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class h{}const _=new WeakMap,A=p(class extends f{render(t){return s}update(t,[e]){const i=e!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),s}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let s=_.get(e);void 0===s&&(s=new WeakMap,_.set(e,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?_.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),y=i`:host{display:flex;flex-direction:column;gap:var(--sp-1)}.text{margin:0}.text.is-clamped{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.toggle{align-self:flex-start}`;let w=class MqClampedText extends o{constructor(){super(...arguments),this.lines=2,this.expandLabel="",this.collapseLabel="",this.expanded=!1,this.overflowing=!1,this.textRef=new h,this.measure=()=>{const t=this.textRef.value;if(!t||this.expanded)return;const e=t.scrollHeight-t.clientHeight>1;e!==this.overflowing&&(this.overflowing=e)}}static{this.styles=y}updated(){const t=this.textRef.value;t&&!this.resizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.measure()),this.resizeObserver.observe(t)),this.measure()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}render(){return n`<div ${A(this.textRef)} class="text ${a({"is-clamped":!this.expanded})}" style="${v({"-webkit-line-clamp":this.expanded?"":String(this.lines)})}"><slot @slotchange="${this.measure}"></slot></div>${this.expanded||this.overflowing?n`<mq-text-button class="toggle" type="button" size="sm" fontWeight="normal" underlined @click="${()=>{this.expanded=!this.expanded}}">${this.expanded?this.collapseLabel:this.expandLabel}</mq-text-button>`:s}`}};t([r({type:Number})],w.prototype,"lines",void 0),t([r({type:String,attribute:"expand-label"})],w.prototype,"expandLabel",void 0),t([r({type:String,attribute:"collapse-label"})],w.prototype,"collapseLabel",void 0),t([l()],w.prototype,"expanded",void 0),t([l()],w.prototype,"overflowing",void 0),w=t([e("mq-clamped-text")],w);export{w as M,f};
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{E as s,i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as r}from"./property-scuRaFcM.js";import{r as l}from"./state-LQivXIgA.js";import{e as a}from"./class-map-Co76I6aw.js";import{i as d,t as c,e as p}from"./directive-2EDmOukv.js";import{o as v}from"./style-map-CIdqdn7C.js";import"../ui/mq-text-button.js";const u=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),u(t,e);return!0},m=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},x=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),g(e)}};function $(t){void 0!==this._$AN?(m(this),this._$AM=t,x(this)):this._$AM=t}function b(t,e=!1,s=0){const i=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(i))for(let t=s;t<i.length;t++)u(i[t],!1),m(i[t]);else null!=i&&(u(i,!1),m(i));else u(this,t)}const g=t=>{t.type==c.CHILD&&(t._$AP??=b,t._$AQ??=$)};class f extends d{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),x(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(u(this,t),m(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class h{}const _=new WeakMap,A=p(class extends f{render(t){return s}update(t,[e]){const i=e!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),s}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let s=_.get(e);void 0===s&&(s=new WeakMap,_.set(e,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?_.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),y=i`:host{display:flex;flex-direction:column;gap:var(--sp-1)}.text{margin:0}.text.is-clamped{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.toggle{align-self:flex-start}`;let w=class MqClampedText extends o{constructor(){super(...arguments),this.lines=2,this.expandLabel="",this.collapseLabel="",this.expanded=!1,this.overflowing=!1,this.textRef=new h,this.measure=()=>{const t=this.textRef.value;if(!t||this.expanded)return;const e=t.scrollHeight-t.clientHeight>1;e!==this.overflowing&&(this.overflowing=e)}}static{this.styles=y}updated(){const t=this.textRef.value;t&&!this.resizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.measure()),this.resizeObserver.observe(t)),this.measure()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}render(){return n`<div ${A(this.textRef)} class="text ${a({"is-clamped":!this.expanded})}" style="${v({"-webkit-line-clamp":this.expanded?"":String(this.lines)})}"><slot @slotchange="${this.measure}"></slot></div>${this.expanded||this.overflowing?n`<mq-text-button class="toggle" type="button" size="sm" fontWeight="normal" underlined @click="${()=>{this.expanded=!this.expanded}}">${this.expanded?this.collapseLabel:this.expandLabel}</mq-text-button>`:s}`}};t([r({type:Number})],w.prototype,"lines",void 0),t([r({type:String,attribute:"expand-label"})],w.prototype,"expandLabel",void 0),t([r({type:String,attribute:"collapse-label"})],w.prototype,"collapseLabel",void 0),t([l()],w.prototype,"expanded",void 0),t([l()],w.prototype,"overflowing",void 0),w=t([e("mq-clamped-text")],w);export{w as M,f};
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as a}from"./runtime-Bg1WXVCx.js";import{t as r,c as n,n as s,g as o,p as i,a as l,s as d,l as c}from"./parseISO-jT42c8Ob.js";import{i as v,a as h,x as u}from"./lit-element-DiWJYFwC.js";import{n as p}from"./property-scuRaFcM.js";import{r as g}from"./state-LQivXIgA.js";import{e as m}from"./class-map-Co76I6aw.js";import{chevronLeftIcon as y}from"../ui/icons/chevron-left-icon.js";import{chevronRightIcon as b}from"../ui/icons/chevron-right-icon.js";import{spinnerIcon as f}from"../ui/icons/spinner-icon.js";import{i as D}from"./isSameDay-DPfclwIL.js";import{i as k}from"./isBefore-Cof0D841.js";function w(t,e,a){const s=r(t,a?.in);if(isNaN(e))return n(t,NaN);if(!e)return s;const o=s.getDate(),i=n(t,s.getTime());i.setMonth(s.getMonth()+e+1,0);return o>=i.getDate()?i:(s.setFullYear(i.getFullYear(),i.getMonth(),o),s)}function M(t,e){const a=r(t,e?.in),n=a.getMonth();return a.setFullYear(a.getFullYear(),n+1,0),a.setHours(23,59,59,999),a}function S(t,e){const{start:a,end:r}=function(t,e){const[a,r]=s(t,e.start,e.end);return{start:a,end:r}}(e?.in,t);let o=+a>+r;const i=o?+a:+r,l=o?r:a;l.setHours(0,0,0,0);const d=[];for(;+l<=i;)d.push(n(a,l)),l.setDate(l.getDate()+1),l.setHours(0,0,0,0);return o?d.reverse():d}function x(t,e){const a=r(t,e?.in);return a.setDate(1),a.setHours(0,0,0,0),a}function E(t,e){const a=o(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,s=r(t,e?.in),i=s.getDay(),l=6+(i<n?-7:0)-(i-n);return s.setDate(s.getDate()+l),s.setHours(23,59,59,999),s}function j(t,e){return+r(t)>+r(e)}function $(t,e){return D(n(t,t),function(t){return n(t,Date.now())}(t))}const N=v`:host{display:block;font-family:var(--font-body)}.calendar{background:var(--color-card);border-radius:var(--border-radius-lg);user-select:none}.calendar-header{display:flex;align-items:center;justify-content:space-between;background:var(--color-primary-background-extraWeak);padding:var(--sp-4);border-radius:var(--border-radius-lg) var(--border-radius-lg) 0 0}.calendar-header-title{font-family:var(--font-titles);font-size:var(--text-lg);font-weight:var(--font-weight-bold);color:var(--color-gray-darkest)}.calendar-body{position:relative;transition:opacity .2s}.calendar-body.loading{opacity:.4;pointer-events:none}.calendar-nav{display:flex;gap:var(--sp-2)}.calendar-nav-button{display:flex;align-items:center;justify-content:center;width:var(--size-8);height:var(--size-8);border:none;background:0 0;border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .2s;color:var(--color-gray-darkest);padding:0}.calendar-nav-button:hover{background:var(--color-background-primary-light)}.calendar-nav-button:disabled{opacity:.3;cursor:not-allowed}.calendar-weekdays{display:grid;grid-template-columns:repeat(7,var(--sp-11));justify-content:space-between;padding:var(--sp-4) var(--sp-4) var(--sp-2) var(--sp-4)}.calendar-weekday{text-align:center;font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-gray-darkest);padding:var(--sp-2)}.calendar-days{display:grid;gap:var(--sp-1);grid-template-columns:repeat(7,var(--sp-11));justify-content:space-between;padding:0 var(--sp-4) var(--sp-4) var(--sp-4)}.calendar-day{width:var(--sp-11);height:var(--sp-11);display:flex;align-items:center;justify-content:center;border:none;background:0 0;border-radius:var(--border-radius-full);cursor:pointer;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);color:var(--color-gray-darkest);transition:all .2s;padding:0;position:relative}.calendar-day:hover:not(:disabled):not(.other-month){background:var(--color-gray-lighter)}.calendar-day.other-month{color:var(--color-gray-medium);background:0 0}.calendar-day:disabled{color:var(--color-gray-medium);background:0 0;cursor:not-allowed}.calendar-day.available:not(.selected){background:var(--color-primary);color:var(--color-white);font-weight:var(--font-weight-semibold)}.calendar-day.available:hover:not(:disabled):not(.selected){background:var(--color-primary-dark)}.calendar-day.selected{background:var(--color-primary);color:var(--color-white);font-weight:var(--font-weight-bold)}.calendar-day.selected:hover:not(:disabled){background:var(--color-primary-dark)}.calendar-day-empty{width:var(--sp-11);height:var(--sp-11)}.calendar-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:10}@media (min-width:640px){.calendar-weekdays{gap:var(--sp-2)}.calendar-days{gap:var(--sp-2)}}@media (min-width:768px){.calendar-weekdays{gap:var(--sp-3)}.calendar-days{gap:var(--sp-3)}}@media (min-width:1024px){.calendar-weekdays{gap:var(--sp-4)}.calendar-days{gap:var(--sp-4)}}`;class DateSelectEvent extends Event{static{this.eventName="date-select"}constructor(t){super(DateSelectEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class PrevMonthEvent extends Event{static{this.eventName="prev-month"}constructor(t){super(PrevMonthEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class NextMonthEvent extends Event{static{this.eventName="next-month"}constructor(t){super(NextMonthEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let C=class MqCalendar extends h{constructor(){super(...arguments),this.locale="es-ES",this.isLoading=!1,this.handlePrevMonth=()=>{const t=this.getCurrentMonthDate(),e=w(t,-1,a);var a;this.dispatchEvent(new PrevMonthEvent({currentMonth:e.toISOString()}))},this.handleNextMonth=()=>{const t=w(this.getCurrentMonthDate(),1);this.dispatchEvent(new NextMonthEvent({currentMonth:t.toISOString()}))},this.handleDayClick=t=>{t.isDisabled||(this.selectedDate=t.date,this.value=t.date.toISOString(),this.dispatchEvent(new DateSelectEvent({date:t.date.toISOString()})),this.requestUpdate())}}static{this.styles=[N]}connectedCallback(){super.connectedCallback(),this.value&&(this.selectedDate=i(this.value))}getMonthYear(){const t=this.getCurrentMonthDate();return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(t)}getCurrentMonthDate(){return this.currentMonth?i(this.currentMonth):new Date}getWeekdays(){const t=l(new Date(2024,0,1),{weekStartsOn:1}),e=S({start:t,end:E(t,{weekStartsOn:1})}),a=new Intl.DateTimeFormat(this.locale,{weekday:"narrow"});return e.map(t=>a.format(t).toUpperCase())}getDaysInMonth(){const t=this.getCurrentMonthDate(),e=x(t),a=M(t);return S({start:l(e,{weekStartsOn:1}),end:E(a,{weekStartsOn:1})}).map(e=>{const a=function(t,e,a){const[r,n]=s(a?.in,t,e);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}(e,t);return this.createCalendarDay(e,a)})}createCalendarDay(t,e){const a=d(t),r=$(a),n=this.isDateAvailable(a);return{date:a,isCurrentMonth:e,isToday:r,isDisabled:this.isDateDisabled(a,n),isSelected:!!this.selectedDate&&D(a,this.selectedDate),isAvailable:n}}isDateAvailable(t){if(!this.availableDays||0===this.availableDays.length)return!1;const e=d(t);return this.availableDays.some(t=>{const a=d(i(t));return D(e,a)})}isDateDisabled(t,e){const a=d(t);if(this.availableDays&&this.availableDays.length>0)return!e;if(this.minDate){const t=d(i(this.minDate));if(k(a,t))return!0}if(this.maxDate){if(j(a,d(i(this.maxDate))))return!0}return!1}render(){const t=this.getDaysInMonth(),e=this.getWeekdays();return u`<div class="calendar"><div class="calendar-header"><button class="calendar-nav-button" @click="${this.handlePrevMonth}" aria-label="${a("Mes anterior")}">${y({size:24})}</button><div class="calendar-header-title">${this.getMonthYear()}</div><button class="calendar-nav-button" @click="${this.handleNextMonth}" aria-label="${a("Mes siguiente")}">${b({size:24})}</button></div><div class="calendar-body ${this.isLoading?"loading":""}"><div class="calendar-weekdays">${e.map(t=>u`<div class="calendar-weekday">${t}</div>`)}</div><div class="calendar-days">${t.map(t=>t.isCurrentMonth?u`<button class="${m({"calendar-day":!0,"other-month":!t.isCurrentMonth,today:t.isToday,selected:t.isSelected,available:t.isAvailable})}" ?disabled="${t.isDisabled||this.isLoading}" @click="${()=>this.handleDayClick(t)}" aria-label="${t.date.toLocaleDateString(this.locale)}">${t.date.getDate()}</button>`:u`<div class="calendar-day-empty"></div>`)}</div>${this.isLoading?u`<div class="calendar-spinner">${f({size:40,color:"var(--color-primary)"})}</div>`:""}</div></div>`}};t([p({type:String})],C.prototype,"locale",void 0),t([p({type:String,attribute:"min-date"})],C.prototype,"minDate",void 0),t([p({type:String,attribute:"max-date"})],C.prototype,"maxDate",void 0),t([p({type:String})],C.prototype,"value",void 0),t([p({type:Boolean,attribute:"is-loading"})],C.prototype,"isLoading",void 0),t([p({type:String,attribute:"current-month"})],C.prototype,"currentMonth",void 0),t([p({type:Array,attribute:"available-days"})],C.prototype,"availableDays",void 0),t([g()],C.prototype,"selectedDate",void 0),C=t([c(),e("mq-calendar")],C);export{DateSelectEvent as D,C as M,NextMonthEvent as N,PrevMonthEvent as P,M as e,j as i,x as s};
@@ -1 +1 @@
1
- import{_ as t,t as o}from"./custom-element-DA9Fxvxd.js";import{m as C}from"./runtime-Bg1WXVCx.js";import{l as a}from"./parseISO-jT42c8Ob.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);
1
+ import{_ as t,t as o}from"./custom-element-DA9Fxvxd.js";import{m as C}from"./runtime-Bg1WXVCx.js";import{l as a}from"./parseISO-jT42c8Ob.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 s=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})],s.prototype,"background",void 0),t([i()],s.prototype,"variant",void 0),t([i({type:Boolean,attribute:"show-mediquo-branding"})],s.prototype,"showMediquoBranding",void 0),s=t([a(),o("mq-layout")],s);
@@ -1 +1 @@
1
- import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as n}from"./parseISO-jT42c8Ob.js";import{g as o}from"./api-chat-client-BTBtu01T.js";import{a as r}from"./telemetry-client-CKCb9Gnf.js";import{i as a,a as s,E as l,x as p}from"./lit-element-DiWJYFwC.js";import{n as m}from"./property-scuRaFcM.js";import{e as c}from"./class-map-Co76I6aw.js";import{getLocale as h}from"../i18n.js";import{briefcaseIcon as d}from"../ui/icons/briefcase-icon.js";import{calendarIcon as u}from"../ui/icons/calendar-icon.js";import{clockIcon as f}from"../ui/icons/clock-icon.js";import{messageBubbleIcon as v}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as w}from"../ui/icons/phone-icon.js";const y=a`.appointment-details{display:flex;flex-direction:column;gap:var(--sp-3)}.detail-row{display:inline-flex;width:fit-content;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.detail-row.full-width{width:100%}:host([strike-through]) .detail-row span{text-decoration:line-through}@media (min-width:768px){.appointment-details.wide{flex-direction:row;flex-wrap:wrap}}`;let g=class AppointmentDetails extends s{constructor(){super(...arguments),this.channel=void 0,this.variant="default",this.strikeThrough=!1,this.timezone=void 0,this._appointmentChannelToLabel=t=>{switch(t){case"videocall":return i("Videoconsulta");case"chat":return i("Chat");case"phonecall":return i("Consulta telefónica");default:return""}},this._appointmentChannelToIcon=t=>{switch(t){case"videocall":return d({size:24});case"chat":return v({size:24});case"phonecall":return w({size:24});default:return l}}}static{this.styles=y}render(){const t=h().replace("_","-"),e=new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",...this.timezone?{timeZone:this.timezone}:{}}),i=new Intl.DateTimeFormat(t,{timeStyle:"short",...this.timezone?{timeZone:this.timezone}:{}}),n=new Date(this.startsAt),a=r(n,this.duration),s=e.format(n),m=i.format(n),d=i.format(a),v=this.timezone?o(this.timezone,n):"";return p`<div class="${c({"appointment-details":!0,wide:"wide"===this.variant})}"><div class="detail-row">${u({size:24})} <span>${s}</span></div><div class="detail-row">${f({size:24})} <span>${m} - ${d}${v?` (${v})`:""}</span></div>${this.channel?p`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:l}</div>`}};function j(t){return t/100}function x(t,e){const i=e.replaceAll("_","-");return new Intl.NumberFormat(i,{style:"currency",currency:t.currency}).format(j(t.amount))}function z(t){return null!=t&&t.amount>0}t([m({type:String})],g.prototype,"startsAt",void 0),t([m({type:Number})],g.prototype,"duration",void 0),t([m({type:String})],g.prototype,"channel",void 0),t([m({type:String})],g.prototype,"variant",void 0),t([m({type:Boolean,attribute:"strike-through"})],g.prototype,"strikeThrough",void 0),t([m({type:String})],g.prototype,"timezone",void 0),g=t([n(),e("appointment-details")],g);export{g as A,j as c,x as f,z as h};
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as n}from"./parseISO-jT42c8Ob.js";import{g as o}from"./api-chat-client-C8SqZtCa.js";import{a as r}from"./telemetry-client-BRVJU-fZ.js";import{i as a,a as s,E as l,x as p}from"./lit-element-DiWJYFwC.js";import{n as m}from"./property-scuRaFcM.js";import{e as c}from"./class-map-Co76I6aw.js";import{getLocale as h}from"../i18n.js";import{briefcaseIcon as d}from"../ui/icons/briefcase-icon.js";import{calendarIcon as u}from"../ui/icons/calendar-icon.js";import{clockIcon as f}from"../ui/icons/clock-icon.js";import{messageBubbleIcon as v}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as w}from"../ui/icons/phone-icon.js";const y=a`.appointment-details{display:flex;flex-direction:column;gap:var(--sp-3)}.detail-row{display:inline-flex;width:fit-content;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.detail-row.full-width{width:100%}:host([strike-through]) .detail-row span{text-decoration:line-through}@media (min-width:768px){.appointment-details.wide{flex-direction:row;flex-wrap:wrap}}`;let g=class AppointmentDetails extends s{constructor(){super(...arguments),this.channel=void 0,this.variant="default",this.strikeThrough=!1,this.timezone=void 0,this._appointmentChannelToLabel=t=>{switch(t){case"videocall":return i("Videoconsulta");case"chat":return i("Chat");case"phonecall":return i("Consulta telefónica");default:return""}},this._appointmentChannelToIcon=t=>{switch(t){case"videocall":return d({size:24});case"chat":return v({size:24});case"phonecall":return w({size:24});default:return l}}}static{this.styles=y}render(){const t=h().replace("_","-"),e=new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",...this.timezone?{timeZone:this.timezone}:{}}),i=new Intl.DateTimeFormat(t,{timeStyle:"short",...this.timezone?{timeZone:this.timezone}:{}}),n=new Date(this.startsAt),a=r(n,this.duration),s=e.format(n),m=i.format(n),d=i.format(a),v=this.timezone?o(this.timezone,n):"";return p`<div class="${c({"appointment-details":!0,wide:"wide"===this.variant})}"><div class="detail-row">${u({size:24})} <span>${s}</span></div><div class="detail-row">${f({size:24})} <span>${m} - ${d}${v?` (${v})`:""}</span></div>${this.channel?p`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:l}</div>`}};function j(t){return t/100}function x(t,e){const i=e.replaceAll("_","-");return new Intl.NumberFormat(i,{style:"currency",currency:t.currency}).format(j(t.amount))}function z(t){return null!=t&&t.amount>0}t([m({type:String})],g.prototype,"startsAt",void 0),t([m({type:Number})],g.prototype,"duration",void 0),t([m({type:String})],g.prototype,"channel",void 0),t([m({type:String})],g.prototype,"variant",void 0),t([m({type:Boolean,attribute:"strike-through"})],g.prototype,"strikeThrough",void 0),t([m({type:String})],g.prototype,"timezone",void 0),g=t([n(),e("appointment-details")],g);export{g as A,j as c,x as f,z as h};
@@ -1 +1 @@
1
- import{c as e}from"./api-chat-client-BTBtu01T.js";import{t}from"./parseISO-jT42c8Ob.js";function n(e,n,r){const s=function(e,n){return+t(e)-+t(n)}(e,n)/1e3;return(c=r?.roundingMethod,e=>{const t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(s);var c}function r(e){return{queryKey:["schedule-services"],queryFn:()=>e.schedules.getScheduleServices()}}function s(t){const{startsAtIso:r,refundPolicySeconds:s,now:c=new Date}=t,o=n(e(r),c);return!(o<0)&&(null==s||o>=s)}export{s as c,r as g};
1
+ import{a as e}from"./api-chat-client-C8SqZtCa.js";import{t}from"./parseISO-jT42c8Ob.js";function n(e,n,r){const s=function(e,n){return+t(e)-+t(n)}(e,n)/1e3;return(c=r?.roundingMethod,e=>{const t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(s);var c}function r(e){return{queryKey:["schedule-services"],queryFn:()=>e.schedules.getScheduleServices()}}function s(t){const{startsAtIso:r,refundPolicySeconds:s,now:c=new Date}=t,o=n(e(r),c);return!(o<0)&&(null==s||o>=s)}export{s as c,r as g};
@@ -1 +1 @@
1
- import{c as t,t as e,l as a}from"./parseISO-jT42c8Ob.js";import{_ as i,t as n}from"./custom-element-DA9Fxvxd.js";import{m as o,s}from"./runtime-Bg1WXVCx.js";import{i as r,a as p,x as l,E as c}from"./lit-element-DiWJYFwC.js";import{n as d}from"./property-scuRaFcM.js";import{r as u}from"./state-LQivXIgA.js";import{getLocale as _}from"../i18n.js";import{chevronDownIcon as h}from"../ui/icons/chevron-down-icon.js";import"../ui/mq-text-button.js";import"../ui/mq-avatar.js";function y(a,i,n){return function(a,i){return t(a,+e(a)+i)}(a,1e3*i)}function v(t,e){return{queryKey:["organization-specialties"],queryFn:()=>t.organizations.getOrganizationSpecialties(),...e}}const m=r`.header{display:flex;align-items:center;gap:var(--sp-4);margin-bottom:0}.header.expanded{margin-bottom:var(--sp-4)}@media (max-width:768px){.header{--avatar-size-lg:var(--avatar-size-md)}}.professional-info{flex:1}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutral-link-dark);margin:0}.professional-specialty{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-neutral-text-default);margin:0}.collegiate-number{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);color:var(--color-neutrals-text-medium);margin:0;text-transform:uppercase}.languages{display:flex;flex-wrap:wrap;gap:var(--sp-3)}.language-pill{display:inline-block;background-color:#e5e5e5;color:var(--colors-neutral-text-default);font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);padding:var(--sp-1) var(--sp-2);border-radius:26px;text-transform:uppercase}.description{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);margin-bottom:0;color:var(--color-neutrals-text-medium)}.icon{transition:transform .1s ease-in-out}.rotate-180{transform:rotate(180deg)}.details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease-out;overflow:hidden}.details[data-expanded=true]{grid-template-rows:1fr}.details-content{overflow:hidden}.details-content>:not(:first-child){margin-top:var(--sp-3)}@media (min-width:769px){:host([always-expanded-on-desktop]) .details{grid-template-rows:1fr}:host([always-expanded-on-desktop]) mq-text-button{display:none}:host([always-expanded-on-desktop]) .header{margin-bottom:var(--sp-4)}}`;let g=class ProfessionalOverview extends p{constructor(){super(...arguments),this.alwaysExpandedOnDesktop=!1,this.detailsExpanded=!1}static{this.styles=m}render(){const t=_().replace("_","-"),e=this.languages.map(e=>l`<span class="language-pill">${new Intl.DisplayNames(t,{type:"language"}).of(e)}</span>`);return l`<div class="header ${this.detailsExpanded?"expanded":""}"><mq-avatar src="${this.avatar}" fallback="${this.name}" alt="${this.name}" size="lg"></mq-avatar><div class="professional-info"><h2 class="professional-name">${this.name}</h2>${this.specialtyName?l`<p class="professional-specialty">${this.specialtyName}</p>`:c}<mq-text-button type="button" size="sm" fontWeight="bold" @click="${()=>{this.detailsExpanded=!this.detailsExpanded}}">${this.detailsExpanded?o("Ocultar detalles"):o("Ver detalles")} ${h({size:24,className:"icon "+(this.detailsExpanded?"rotate-180":"")})}</mq-text-button></div></div><div class="details" data-expanded="${this.detailsExpanded}"><div class="details-content"><div class="languages">${e}</div>${this.collegiateNumber?l`<p class="collegiate-number">${o(s`Nº COL. ${this.collegiateNumber}`)}</p>`:c}<p class="description">${this.description}</p></div></div>`}};i([d({type:String})],g.prototype,"name",void 0),i([d({type:String})],g.prototype,"specialtyName",void 0),i([d({type:String})],g.prototype,"collegiateNumber",void 0),i([d({type:String})],g.prototype,"description",void 0),i([d({type:Array})],g.prototype,"languages",void 0),i([d({type:String})],g.prototype,"avatar",void 0),i([d({type:Boolean,reflect:!0,attribute:"always-expanded-on-desktop"})],g.prototype,"alwaysExpandedOnDesktop",void 0),i([u()],g.prototype,"detailsExpanded",void 0),g=i([a(),n("professional-overview")],g);var f={digestive_system:{de_DE:"Verdauungssystem",en_US:"Digestive System",es_ES:"Aparato Digestivo",ca_ES:"Aparell Digestiu",pt_PT:"Aparelho Digestivo"},orthopedic_surgery_traumatology:{de_DE:"Traumatologie und Orthopädische Chirurgie",en_US:"Traumatology and Orthopedic Surgery",es_ES:"Traumatología y Cirugía Ortopédica",ca_ES:"Traumatologia i Cirurgia Ortopèdica",pt_PT:"Traumatologia e Cirurgia Ortopédica"},gynecology:{de_DE:"Gynäkologie",en_US:"Gynecology",es_ES:"Ginecología",ca_ES:"Ginecologia",pt_PT:"Ginecologia"},endocrinology:{de_DE:"Endokrinologie",en_US:"Endocrinology",es_ES:"Endocrinología",ca_ES:"Endocrinologia",pt_PT:"Endocrinologia"},psychiatry:{de_DE:"Psychiatrie",en_US:"Psychiatry",es_ES:"Psiquiatría",ca_ES:"Psiquiatria",pt_PT:"Psiquiatria"}},x={videocall:{de_DE:"Videosprechstunde",en_US:"Videocall",es_ES:"Videoconsulta",ca_ES:"Videoconsulta",pt_PT:"Videoconsulta"},phonecall:{de_DE:"Telefonische Behandlung",en_US:"Phone consultation",es_ES:"Consulta telefónica",ca_ES:"Consulta telefònica",pt_PT:"Consulta telefónica"}},b={de_DE:"Konsultationspreis",en_US:"Consultation price",es_ES:"Precio de consulta",ca_ES:"Preu de consulta",pt_PT:"Preço da consulta"},w={videocall:"videocall",phonecall:"phonecall",adeslas_videocall:"videocall",adeslas_prod_videocall:"videocall",adeslas_phonecall:"phonecall",adeslas_prod_phonecall:"phonecall"};function E(t,e,a){if(!t)return a??"";const i=w[t];return i?x[i][e]:a??b[e]}var S={consulta_telefonica:"phonecall",videoconsulta:"videocall"},k={"aparato-digestivo":"digestive_system","cirugia-ortopedica-y-traumatologia":"orthopedic_surgery_traumatology",ginecologia:"gynecology",endocrinologia:"endocrinology",psiquiatria:"psychiatry"};function T(t,e,a){const i=a?.trim();if(i)return i;const n=f[t]?.[e];return void 0!==n?n:t}function P(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function q(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function $(t,e){return{action_type:"event",event_type:"modify appoinment button click",patient_hash:t,id_appointment:e}}function D(t,e){return{action_type:"event",event_type:"cancel appoinment button click",patient_hash:t,id_appointment:e}}function z(t,e){return{action_type:"event",event_type:"view appointment document list button click",patient_hash:t,id_appointment:e}}function C(t,e){return{action_type:"event",event_type:"repeat appointment button click",patient_hash:t,id_appointment:e}}function O(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function j(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function K(t,e){return{action_type:"event",event_type:"add to calendar button click",patient_hash:t,id_appointment:e}}function N(t,e){return{action_type:"pageview",event_type:"appointment success page view",patient_hash:t,id_appointment:e}}function U(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function A(t,e){return{action_type:"event",event_type:"update documentation",patient_hash:t,id_appointment:e}}function V(t,e){return{action_type:"pageview",event_type:"documentation page view",patient_hash:t,id_appointment:e}}function G(t,e,a){return{action_type:"event",event_type:"find availability button click",patient_hash:t,speciality_id:e,service_id:a}}function B(t,e,a,i,n,o,s){return{action_type:"debug",event_type:"find availability result",patient_hash:t,speciality_id:e,service_id:a,first_slot_date:i,first_slot_professional_hash:n,total_professionals:o,total_slots:s}}function H(t,e,a,i,n){return{action_type:"event",event_type:"professional schedule slot button click",patient_hash:t,professional_hash:e,start_date:a,speciality_id:i,service_id:n}}function I(t,e,a,i){return{action_type:"event",event_type:"professional availability button click",patient_hash:t,professional_hash:e,speciality_id:a,service_id:i}}function M(t,e,a,i,n){return{action_type:"event",event_type:"confirm appointment button click",patient_hash:t,professional_hash:e,start_date:a,speciality_id:i,service_id:n}}function F(t){return{action_type:"pageview",event_type:"select professional step page view",patient_hash:t}}function J(t,e){return{action_type:"pageview",event_type:"not time yet pageview",patient_hash:t,id_appointment:e}}function L(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function W(t,e){return{action_type:"pageview",event_type:"waiting room pageview",patient_hash:t,id_appointment:e}}function Q(t,e){return{action_type:"pageview",event_type:"videocall pageview",patient_hash:t,id_appointment:e}}class HttpTransport{endpoint;apiKey;constructor(t,e){this.endpoint=t,this.apiKey=e}send(t){fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.apiKey},body:JSON.stringify(t)}).catch(()=>{})}}class MediquoTelemetryClient{_apiKey=null;_transport=null;setApiKey(t){this._apiKey=t,this._buildTransport()}track(t){null!==this._transport&&this._transport.send(t)}_buildTransport(){null!==this._apiKey&&(this._transport=new HttpTransport("https://tracking.____.mediquo.com/sdk",this._apiKey))}}const R=new class AppTelemetryClient extends MediquoTelemetryClient{track(t){}};export{H as A,I as B,B as C,F as D,g as P,S,y as a,N as b,T as c,K as d,O as e,j as f,v as g,$ as h,D as i,C as j,P as k,z as l,q as m,L as n,W as o,Q as p,V as q,A as r,U as s,R as t,k as u,J as v,E as w,M as x,G as y,f as z};
1
+ import{c as t,t as e,l as a}from"./parseISO-jT42c8Ob.js";import{_ as i,t as n}from"./custom-element-DA9Fxvxd.js";import{m as o,s}from"./runtime-Bg1WXVCx.js";import{i as r,a as p,x as l,E as c}from"./lit-element-DiWJYFwC.js";import{n as d}from"./property-scuRaFcM.js";import{r as u}from"./state-LQivXIgA.js";import{getLocale as _}from"../i18n.js";import{chevronDownIcon as h}from"../ui/icons/chevron-down-icon.js";import"../ui/mq-text-button.js";import"../ui/mq-avatar.js";function y(a,i,n){return function(a,i){return t(a,+e(a)+i)}(a,1e3*i)}function v(t,e){return{queryKey:["organization-specialties"],queryFn:()=>t.organizations.getOrganizationSpecialties(),...e}}const m=r`.header{display:flex;align-items:center;gap:var(--sp-4);margin-bottom:0}.header.expanded{margin-bottom:var(--sp-4)}@media (max-width:768px){.header{--avatar-size-lg:var(--avatar-size-md)}}.professional-info{flex:1}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutral-link-dark);margin:0}.professional-specialty{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-neutral-text-default);margin:0}.collegiate-number{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);color:var(--color-neutrals-text-medium);margin:0;text-transform:uppercase}.languages{display:flex;flex-wrap:wrap;gap:var(--sp-3)}.language-pill{display:inline-block;background-color:#e5e5e5;color:var(--colors-neutral-text-default);font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);padding:var(--sp-1) var(--sp-2);border-radius:26px;text-transform:uppercase}.description{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);margin-bottom:0;color:var(--color-neutrals-text-medium)}.icon{transition:transform .1s ease-in-out}.rotate-180{transform:rotate(180deg)}.details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease-out;overflow:hidden}.details[data-expanded=true]{grid-template-rows:1fr}.details-content{overflow:hidden}.details-content>:not(:first-child){margin-top:var(--sp-3)}@media (min-width:769px){:host([always-expanded-on-desktop]) .details{grid-template-rows:1fr}:host([always-expanded-on-desktop]) mq-text-button{display:none}:host([always-expanded-on-desktop]) .header{margin-bottom:var(--sp-4)}}`;let g=class ProfessionalOverview extends p{constructor(){super(...arguments),this.alwaysExpandedOnDesktop=!1,this.detailsExpanded=!1}static{this.styles=m}render(){const t=_().replace("_","-"),e=this.languages.map(e=>l`<span class="language-pill">${new Intl.DisplayNames(t,{type:"language"}).of(e)}</span>`);return l`<div class="header ${this.detailsExpanded?"expanded":""}"><mq-avatar src="${this.avatar}" fallback="${this.name}" alt="${this.name}" size="lg"></mq-avatar><div class="professional-info"><h2 class="professional-name">${this.name}</h2>${this.specialtyName?l`<p class="professional-specialty">${this.specialtyName}</p>`:c}<mq-text-button type="button" size="sm" fontWeight="bold" @click="${()=>{this.detailsExpanded=!this.detailsExpanded}}">${this.detailsExpanded?o("Ocultar detalles"):o("Ver detalles")} ${h({size:24,className:"icon "+(this.detailsExpanded?"rotate-180":"")})}</mq-text-button></div></div><div class="details" data-expanded="${this.detailsExpanded}"><div class="details-content"><div class="languages">${e}</div>${this.collegiateNumber?l`<p class="collegiate-number">${o(s`Nº COL. ${this.collegiateNumber}`)}</p>`:c}<p class="description">${this.description}</p></div></div>`}};i([d({type:String})],g.prototype,"name",void 0),i([d({type:String})],g.prototype,"specialtyName",void 0),i([d({type:String})],g.prototype,"collegiateNumber",void 0),i([d({type:String})],g.prototype,"description",void 0),i([d({type:Array})],g.prototype,"languages",void 0),i([d({type:String})],g.prototype,"avatar",void 0),i([d({type:Boolean,reflect:!0,attribute:"always-expanded-on-desktop"})],g.prototype,"alwaysExpandedOnDesktop",void 0),i([u()],g.prototype,"detailsExpanded",void 0),g=i([a(),n("professional-overview")],g);var f={digestive_system:{de_DE:"Verdauungssystem",en_US:"Digestive System",es_ES:"Aparato Digestivo",ca_ES:"Aparell Digestiu",pt_PT:"Aparelho Digestivo"},orthopedic_surgery_traumatology:{de_DE:"Traumatologie und Orthopädische Chirurgie",en_US:"Traumatology and Orthopedic Surgery",es_ES:"Traumatología y Cirugía Ortopédica",ca_ES:"Traumatologia i Cirurgia Ortopèdica",pt_PT:"Traumatologia e Cirurgia Ortopédica"},gynecology:{de_DE:"Gynäkologie",en_US:"Gynecology",es_ES:"Ginecología",ca_ES:"Ginecologia",pt_PT:"Ginecologia"},endocrinology:{de_DE:"Endokrinologie",en_US:"Endocrinology",es_ES:"Endocrinología",ca_ES:"Endocrinologia",pt_PT:"Endocrinologia"},psychiatry:{de_DE:"Psychiatrie",en_US:"Psychiatry",es_ES:"Psiquiatría",ca_ES:"Psiquiatria",pt_PT:"Psiquiatria"}},x={videocall:{de_DE:"Videosprechstunde",en_US:"Videocall",es_ES:"Videoconsulta",ca_ES:"Videoconsulta",pt_PT:"Videoconsulta"},phonecall:{de_DE:"Telefonische Behandlung",en_US:"Phone consultation",es_ES:"Consulta telefónica",ca_ES:"Consulta telefònica",pt_PT:"Consulta telefónica"}},b={de_DE:"Konsultationspreis",en_US:"Consultation price",es_ES:"Precio de consulta",ca_ES:"Preu de consulta",pt_PT:"Preço da consulta"},w={videocall:"videocall",phonecall:"phonecall",adeslas_videocall:"videocall",adeslas_prod_videocall:"videocall",adeslas_phonecall:"phonecall",adeslas_prod_phonecall:"phonecall"};function E(t,e,a){if(!t)return a??"";const i=w[t];return i?x[i][e]:a??b[e]}var S={consulta_telefonica:"phonecall",videoconsulta:"videocall"},k={"aparato-digestivo":"digestive_system","cirugia-ortopedica-y-traumatologia":"orthopedic_surgery_traumatology",ginecologia:"gynecology",endocrinologia:"endocrinology",psiquiatria:"psychiatry"};function T(t,e,a){const i=a?.trim();if(i)return i;const n=f[t]?.[e];return void 0!==n?n:t}function P(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function q(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function $(t,e){return{action_type:"event",event_type:"modify appoinment button click",patient_hash:t,id_appointment:e}}function D(t,e){return{action_type:"event",event_type:"cancel appoinment button click",patient_hash:t,id_appointment:e}}function z(t,e){return{action_type:"event",event_type:"view appointment document list button click",patient_hash:t,id_appointment:e}}function C(t,e){return{action_type:"event",event_type:"repeat appointment button click",patient_hash:t,id_appointment:e}}function O(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function j(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function K(t,e){return{action_type:"event",event_type:"add to calendar button click",patient_hash:t,id_appointment:e}}function N(t,e){return{action_type:"pageview",event_type:"appointment success page view",patient_hash:t,id_appointment:e}}function U(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function A(t,e){return{action_type:"event",event_type:"update documentation",patient_hash:t,id_appointment:e}}function V(t,e){return{action_type:"pageview",event_type:"documentation page view",patient_hash:t,id_appointment:e}}function G(t,e,a){return{action_type:"event",event_type:"find availability button click",patient_hash:t,speciality_id:e,service_id:a}}function B(t,e,a,i,n,o,s){return{action_type:"debug",event_type:"find availability result",patient_hash:t,speciality_id:e,service_id:a,first_slot_date:i,first_slot_professional_hash:n,total_professionals:o,total_slots:s}}function H(t,e,a,i,n){return{action_type:"event",event_type:"professional schedule slot button click",patient_hash:t,professional_hash:e,start_date:a,speciality_id:i,service_id:n}}function I(t,e,a,i){return{action_type:"event",event_type:"professional availability button click",patient_hash:t,professional_hash:e,speciality_id:a,service_id:i}}function M(t,e,a,i,n){return{action_type:"event",event_type:"confirm appointment button click",patient_hash:t,professional_hash:e,start_date:a,speciality_id:i,service_id:n}}function F(t){return{action_type:"pageview",event_type:"select professional step page view",patient_hash:t}}function J(t,e){return{action_type:"pageview",event_type:"not time yet pageview",patient_hash:t,id_appointment:e}}function L(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function W(t,e){return{action_type:"pageview",event_type:"waiting room pageview",patient_hash:t,id_appointment:e}}function Q(t,e){return{action_type:"pageview",event_type:"videocall pageview",patient_hash:t,id_appointment:e}}class HttpTransport{endpoint;apiKey;constructor(t,e){this.endpoint=t,this.apiKey=e}send(t){fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.apiKey},body:JSON.stringify(t)}).catch(()=>{})}}class MediquoTelemetryClient{_apiKey=null;_transport=null;setApiKey(t){this._apiKey=t,this._buildTransport()}track(t){null!==this._transport&&this._transport.send(t)}_buildTransport(){null!==this._apiKey&&(this._transport=new HttpTransport("https://tracking.____.mediquo.com/sdk",this._apiKey))}}const R=new class AppTelemetryClient extends MediquoTelemetryClient{track(t){}};export{Q as A,V as B,A as C,U as D,g as P,S,y as a,N as b,T as c,K as d,O as e,j as f,v as g,$ as h,D as i,C as j,P as k,z as l,q as m,k as n,E as o,G as p,f as q,H as r,M as s,R as t,I as u,B as v,F as w,J as x,L as y,W as z};