var Oo=Object.defineProperty;var Do=(n,e,t)=>e in n?Oo(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>(Do(n,typeof e!="symbol"?e+"":e,t),t);import{m as Po,c as xo,e as Ao,a as Fo,d as Io,b as No,i as Vo,f as Mo,r as Ro,g as jn,h as jo,j as me,k as A,l as ae,o as rt,E as K,n as tn,p as I,q as $,s as Ut,V as Lo,_ as ye,w as D,t as k,u as qo,v as $o,x as Wi,y as Ho,z as Ne,A as _,B as y,C as E,D as U,F as j,G as it,H as re,I as Bi,J as Ve,K as Me,L as Ct,M as Qi,N as Et,O as Uo,P as ge,Q as zo,R as Tt,S as vt,T as le,U as Ge,W as lr,X as nn,Y as rn,Z as cr,$ as Ie,a0 as zt,a1 as z,a2 as ur,a3 as fr,a4 as Yi,a5 as Ln,a6 as Gi,a7 as Ji,a8 as Wo,a9 as Bo,aa as Ki,ab as Qo,ac as Yo,ad as Go,ae as Jo,af as Xi,ag as Ko,ah as Xo,ai as Zo,aj as $r,ak as ea,al as gn,am as ta,an as Hr,ao as na,ap as Ur,aq as ra,ar as ia,as as sa,at as oa,au as aa,av as It,aw as la,ax as ca,ay as ua,az as fa,aA as da,aB as ha,aC as zr,aD as pa,aE as ma,aF as ya,aG as qn,aH as ga,aI as va,aJ as ba,aK as wa,aL as _a,aM as ka,aN as Sa,aO as Ca,aP as Ea,aQ as Ta,aR as Oa,aS as Da,aT as Pa,aU as Wr,aV as xa,aW as Aa}from"./dashboard-practitioner-37738ba3.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="3d63cf82-f5d5-4dcf-801b-3aadbf1a0bf7",n._sentryDebugIdIdentifier="sentry-dbid-3d63cf82-f5d5-4dcf-801b-3aadbf1a0bf7")}catch{}})();(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();const Fa={defaults:{VAppBar:{flat:!0},VAutocomplete:{variant:"filled"},VBanner:{color:"primary"},VBottomSheet:{contentClass:"rounded-t-xl overflow-hidden"},VBtn:{color:"primary",rounded:"xl"},VBtnGroup:{rounded:"xl",VBtn:{rounded:null}},VCard:{rounded:"lg"},VCheckbox:{color:"secondary",inset:!0},VChip:{rounded:"sm"},VCombobox:{variant:"filled"},VNavigationDrawer:{},VSelect:{variant:"filled"},VSlider:{color:"primary"},VTabs:{color:"primary"},VTextarea:{variant:"filled"},VTextField:{variant:"filled"},VToolbar:{VBtn:{color:null}}},icons:{defaultSet:"mdi",sets:{mdi:Po}},theme:{themes:{light:{colors:{primary:"#6750a4",secondary:"#b4b0bb",tertiary:"#7d5260",error:"#b3261e",surface:"#fffbfe"}}}}},Ia={badge:"Badge",open:"Ouvrir",close:"Fermer",dismiss:"Dismiss",confirmEdit:{ok:"OK",cancel:"Annuler"},dataIterator:{noResultsText:"Aucun enregistrement correspondant trouvé",loadingText:"Chargement de l'élément..."},dataTable:{itemsPerPageText:"Lignes par page :",ariaLabel:{sortDescending:"Tri décroissant.",sortAscending:"Tri croissant.",sortNone:"Non trié.",activateNone:"Activer pour supprimer le tri.",activateDescending:"Activer pour trier par ordre décroissant.",activateAscending:"Activer pour trier par ordre croissant."},sortBy:"Trier par"},dataFooter:{itemsPerPageText:"Éléments par page :",itemsPerPageAll:"Tous",nextPage:"Page suivante",prevPage:"Page précédente",firstPage:"Première page",lastPage:"Dernière page",pageText:"{0}-{1} de {2}"},dateRangeInput:{divider:"à "},datePicker:{itemsSelected:"{0} selected",range:{title:"Sélectionner des dates",header:"Entrer des dates"},title:"Sélectionner une date",header:"Entrer une date",input:{placeholder:"Entrer une date"}},noDataText:"Aucune donnée disponible",carousel:{prev:"Visuel précédent",next:"Visuel suivant",ariaLabel:{delimiter:"Diapositive {0} de {1}"}},calendar:{moreEvents:"{0} de plus",today:"Aujourd'hui"},input:{clear:"Vider {0}",prependAction:"{0} action avant",appendAction:"{0} action après",otp:"Caractère {0} du mot de passe à usage unique"},fileInput:{counter:"{0} fichier(s)",counterSize:"{0} fichier(s) ({1} au total)"},fileUpload:{title:"Drag and drop files here",divider:"or",browse:"Browse Files"},timePicker:{am:"AM",pm:"PM",title:"Select Time"},pagination:{ariaLabel:{root:"Navigation de pagination",next:"Page suivante",previous:"Page précédente",page:"Aller à la page {0}",currentPage:"Page actuelle, Page {0}",first:"Première page",last:"Dernière page"}},stepper:{next:"Suivant",prev:"Précédent"},rating:{ariaLabel:{item:"Note de {0} sur {1}"}},loading:"Chargement...",infiniteScroll:{loadMore:"Charger plus",empty:"Aucune donnée supplémentaire"}},Na={dark:!1,colors:{primary:"#256c68","primary-200":"#EAFFFA",secondary:"#12c29b","secondary-lighten-3":"#dff4ef",accent:"#f3cc71","accent-lighten-1":"#f3d98c","accent-lighten-2":"#fff2d5",accent2:"#ff958a",surface:"#ebfffe","surface-lighten-1":"#E5F6EB","surface-lighten-2":"#EEFFEF","surface-blue":"#eef1fa",background:"#fff","on-secondary":"#fff","on-accent":"#fff","on-accent2":"#12372f",gray:"#aaa1a1","gray-100":"#FAFAFC","gray-80":"#616161",green:"#00D575","green-100":"#86A4A2","green-200":"#458181","gray-50":"#99A4AA","gray-200":"#E4EDEA","gray-20":"#F5F5F5","gray-300":"#636D79",blue:"#1a73e9","aero-blue":"#C4FFF2","dark-green":"#004838","jade-green":"#33CC99","gray-ligth":"#C2C2C2","pale-green":"#F4FBF7","pale-mind-green":"#E3F3E8",teal:"#007058","teal-green":"#029978",darkgray:"#c1c1c1","bright-red":"#FF5353","light-pink":"#FFE8E8","bright-orange":"#EE720D","yellow-light":"#FEE29F",yellow:"#D6B25D","yellow-dark":"#443513","yellow-ligth":"#FFFBF1",orange:"#FEB23E","gray-70":"#757575",danger:"#8C1F1F","orange-pure":"#F4511E","blue-07":"#0A5BC7","grey-darken":"#424242"}},Va=xo({blueprint:Fa,theme:{defaultTheme:"holitimeLightTheme",themes:{holitimeLightTheme:Na},variations:{colors:["primary","secondary"],lighten:2,darken:2}},defaults:{VBtn:{variant:"flat",rounded:"xl"},VTextField:{variant:"outlined",rounded:!0},VAutocomplete:{variant:"outlined",rounded:!0,autoSelectFirst:!0},VCombobox:{variant:"outlined",rounded:!0},VSelect:{variant:"outlined",rounded:!0},VTextarea:{variant:"outlined"},VCard:{elevation:1}},locale:{messages:{fr:Ia,en:Ao},locale:"fr",fallback:"en"},components:Fo,directives:Io}),Ma=No();function Ra(n){Vo({app:n,dsn:"https://[email protected]/4506855235518464",integrations:[Mo({router:jn}),Ro({maskAllText:!1,maskAllInputs:!1,blockAllMedia:!1,networkDetailAllowUrls:[/\/.+/]})],tracesSampleRate:1,tracePropagationTargets:["localhost",/^https:\/\/api\.holitime\.org/],replaysSessionSampleRate:.1,replaysOnErrorSampleRate:1,environment:"production"}),n.use(Va).use(jn).use(Ma).use(jo)}const ja=me({__name:"Message",setup(n){const e=A(!1),t=A(""),r=A("info"),i=ae(()=>{switch(r.value){case"success":return"$success";case"info":return"$info";case"warning":return"$warning";case"error":return"$error";default:return"$info"}}),s=({text:o,severity:a})=>{e.value=!0,t.value=o,r.value=a,setTimeout(()=>{e.value=!1},6e3)};return rt(()=>{K.on("message",s)}),tn(()=>{K.off("message",s)}),(o,a)=>(I(),$(Lo,{class:Ut({wrapper:!0,visible:e.value}),color:r.value,text:t.value,icon:i.value,density:"comfortable"},null,8,["class","color","text","icon"]))}});const La=ye(ja,[["__scopeId","data-v-132a0f1a"]]),qa=me({__name:"LoadingBackdrop",setup(n){const e=A(!1),t=({active:r})=>{e.value=r};return rt(()=>{K.on("loading",t)}),tn(()=>{K.off("loading",t)}),(r,i)=>(I(),$($o,{persistent:"",modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=s=>e.value=s),class:"d-flex align-center justify-center"},{default:D(()=>[k(qo,{indeterminate:"",color:"primary",size:"54"})]),_:1},8,["modelValue"]))}}),$a=me({__name:"ConfirmDialog",setup(n){const{xs:e}=Wi(),t=A(!1),r=A(""),i=A(""),s=Ho({onConfirm:()=>{},onCancel:()=>{}}),o=A(),a=A(),l=A(!1),c=A(!1);rt(()=>{const d=p=>{r.value=p.title,i.value=p.message,s.onConfirm=p.optionsConfirm.onConfirm,s.onCancel=p.optionsConfirm.onCancel,o.value=p.cancelBtnLabel,a.value=p.confirmBtnLabel,t.value=!0,l.value=p.mandatory,c.value=p.onlyConfirmAction};K.on("confirm",d),K.on("close-confirm",f)});const f=()=>{t.value=!1};tn(()=>{K.off("confirm",h),K.off("close-confirm",f)});const h=()=>{s.onConfirm(),t.value=!1},u=()=>{s.onCancel(),t.value=!1};return(d,p)=>(I(),$(Me,{modelValue:t.value,"onUpdate:modelValue":p[0]||(p[0]=b=>t.value=b),persistent:"","min-width":_(e)?300:500,width:"fit-content",transition:"dialog-top-transition"},{default:D(()=>[k(Ve,{class:"bg-white"},{default:D(()=>[k(Ne,{class:Ut(["d-flex pa-4 text-wrap w-full align-center bg-surface-lighten-1 text-primary",[_(e)?"justify-space-between":"justify-center"]])},{default:D(()=>[y("span",null,E(r.value),1),l.value?j("",!0):(I(),$(U,{key:0,class:Ut(["mr-2",{"close-icon":!_(e)}]),variant:"text",icon:"mdi-close",onClick:u},null,8,["class"]))]),_:1},8,["class"]),k(it,{class:"pa-4 text-center"},{default:D(()=>[re(E(i.value),1)]),_:1}),k(Bi,{class:"d-flex justify-end align-center flex-wrap pa-4 pt-2"},{default:D(()=>[c.value?j("",!0):(I(),$(U,{key:0,class:"px-6",variant:"outlined",color:"black",text:o.value??d.$t("confirmDialog.cancelBtn"),onClick:u},null,8,["text"])),k(U,{class:"px-6",variant:"flat",color:"blue-darken-1",text:a.value??d.$t("confirmDialog.confirmBtn"),onClick:h},null,8,["text"])]),_:1})]),_:1})]),_:1},8,["modelValue","min-width"]))}});const Ha=ye($a,[["__scopeId","data-v-e39fdf72"]]),Br=Ct(),$n=Qi("askPractitionerConsultationStore",()=>{const n=A([]),e=A([]),t=A(!1),r=async()=>{if(Et().isLogged)try{if(t.value)return;t.value=!0;const l=await Br.get("/appointment-notification/practician");if(l.status!=200)throw Error(JSON.stringify(l.data));n.value=l.data.map(c=>({id:c.id,appointmentReason:c.appointmentReason,customerName:c.customerName,date:Uo(ge(c.date).format("ddd D MMM")),duration:zo(""+c.duration),price:""+c.price+" €",time:ge(c.date).format("HH:mm").replace(":","h"),note:c.comment,photo:c.customerPicture})),0<n.value.length&&K.emit("open-practitioner-ask-presence-dialog")}catch(l){console.error(l)}finally{(!n.value||!n.value.length)&&K.emit("close-practitioner-ask-presence-dialog"),t.value=!1}},i=async a=>{const l=n.value.findIndex(c=>c.id===a);n.value.splice(l,1)},s=async(a,l)=>{const c=n.value.findIndex(f=>f.id===a);n.value.splice(c,1);try{const f=await Br.post(`/opinion/absence-protest/${a}`,l);if(f.status!=200)throw Error(JSON.stringify(f.data))}catch(f){console.error(f)}};async function o(){await r(),setInterval(r,5*60*1e3)}return{fetchConsultations:r,consultations:n,startLoop:o,allConsultationForAbsence:e,sendDataForAbsence:i,contesterForAbsence:s}}),Ua={props:{dialog:Boolean},emits:["update:dialog","close"],setup(n,{emit:e}){const{t}=Tt(),r=Ct(),i=A(!1),s=A(1),o=A(""),a=A(null),l=A(""),c=O=>{i.value=!0,a.value=O},f=A(0),h=ae(()=>u.consultations),u=$n(),d=O=>{e("update:dialog",O)},p=()=>{d(!1)},b=A(!1),m=async()=>{if(l.value="",a.value===null)return l.value="Veuillez sélectionner une option.",!1;a.value==="absent"?await w():await v()},v=async()=>{le.start();try{await r.post(`/appointment-notification/${h.value[s.value-1].id}/confirmed`,{comment:o.value},{headers:{"Content-Type":"application/json"}}),a.value=null,o.value="",i.value=!1}catch(O){Ge.error(t("common.error.errorHasOccurred")),console.error(O)}await u.fetchConsultations(),le.stop()},w=async()=>{le.start();try{await r.post(`/appointment-notification/${h.value[s.value-1].id}/unconfirmed`,{comment:o.value},{headers:{"Content-Type":"application/json"}}),a.value=null,o.value="",i.value=!1}catch(O){Ge.error(t("common.error.errorHasOccurred")),console.error(O)}await u.fetchConsultations(),le.stop()},S=async()=>{};return vt(()=>n.dialog,async O=>{O&&await S()},{immediate:!0}),{t,updateDialog:d,toggleDialog:p,confirmPatientPresence:v,confirmPatientAbsence:w,dialogAskPractitionerConsultationStore:u,onOpen:S,consultations:h,page:s,comment:o,toggleChoice:c,choice:a,isValidForm:b,onSubmit:m,selectOptionMsg:l,commentRules:[O=>O.length<=300||t("300_caracteres")],commentKey:f,displayNoteField:i}}};const za={class:"dialog-header"},Wa={class:"text-center"},Ba=["innerHTML"],Qa={class:"d-flex flex-column ga-3"},Ya={style:{"background-color":"#f3fcfa"},class:"pa-5 d-flex flex-column ga-2 rounded-lg"},Ga={class:"d-flex flex-column ga-2"},Ja={class:"d-flex justify-space-between"},Ka={class:"text-teal font-weight-bold"},Xa={class:"d-flex justify-space-between"},Za={class:"text-teal font-weight-bold"},el={class:"d-flex flex-column ga-2"},tl={class:"d-flex justify-space-between"},nl={class:"text-teal font-weight-bold"},rl={class:"d-flex justify-space-between"},il={class:"text-teal font-weight-bold"},sl={class:"d-flex flex-column ga-2"},ol={class:"d-flex justify-space-between"},al={class:"text-teal font-weight-bold"},ll={class:"d-flex flex-column ga-3 mt-3"},cl={class:"text-center d-flex flex-column ga-3"},ul={class:"font-weight-bold"},fl={class:"d-sm-flex ga-2 justify-center w-sm-75 mx-auto"},dl={key:0,class:"text-red"},hl={class:"mb-2"},pl=["innerHTML"],ml={class:"dialog-text"},yl={class:"d-flex justify-end"};function gl(n,e,t,r,i,s){return I(),$(Me,{"model-value":t.dialog,"onUpdate:modelValue":r.updateDialog,persistent:"","max-width":"600",transition:"dialog-top-transition",class:"blur-background"},{default:D(()=>[k(Ve,{elevation:"24",class:"border-radius-none"},{default:D(()=>[k(Ne,{class:"d-flex pa-1 justify-center w-full align-center bg-surface-lighten-1 text-primary"},{default:D(()=>[y("span",za,E(n.$t("dashboard.consultationDialog.title")),1),k(U,{onClick:e[0]||(e[0]=o=>n.$emit("close")),variant:"text",icon:"",style:{position:"absolute",right:"10px"},density:"compact"},{default:D(()=>[k(lr,null,{default:D(()=>[re("mdi-close-circle-outline")]),_:1})]),_:1})]),_:1}),k(nn,{onSubmit:rn(r.onSubmit,["prevent"])},{default:D(()=>[k(it,{class:"text-gray-80"},{default:D(()=>[y("div",Wa,[r.consultations.length>1?(I(),$(cr,{key:0,"active-color":"secondary",density:"compact",color:"primary",modelValue:r.page,"onUpdate:modelValue":e[1]||(e[1]=o=>r.page=o),length:r.consultations.length,"total-visible":5},null,8,["modelValue","length"])):j("",!0)]),y("div",{style:{color:"#757575"},class:"d-flex justify-center text-center avis-title",innerHTML:n.$t("dashboard.avisConsultationDialog.recap",{date:r.consultations[r.page-1].date})},null,8,Ba),y("div",Qa,[y("div",Ya,[y("div",Ga,[y("div",Ja,[y("span",null,E(n.$t("dashboard.consultationDialog.fullName"))+":",1),y("span",Ka,E(r.consultations[r.page-1].customerName),1)]),y("div",Xa,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.reason"))+":",1),y("span",Za,E(r.consultations[r.page-1].appointmentReason),1)])]),k(Ie),y("div",el,[y("div",tl,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.duration"))+":",1),y("span",nl,E(r.consultations[r.page-1].duration),1)]),y("div",rl,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.price"))+":",1),y("span",il,E(r.consultations[r.page-1].price),1)])]),k(Ie),y("div",sl,[y("div",ol,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.time"))+":",1),y("span",al,E(r.consultations[r.page-1].time),1)])])])]),y("div",ll,[y("div",cl,[y("span",ul,E(n.$t("dashboard.consultationDialog.confirm")),1),y("div",null,[y("div",fl,[k(U,{class:"w-sm-50 w-100",onClick:e[2]||(e[2]=o=>r.toggleChoice("absent")),color:r.choice==="absent"?"red":"#F3D0D0"},{default:D(()=>[y("span",{style:zt({color:r.choice==="absent"?"white":"#A82525"})},E(n.$t("dashboard.consultationDialog.absent")),5)]),_:1},8,["color"]),k(U,{block:"",class:"w-sm-50 w-100 mt-2 mt-sm-0",onClick:e[3]||(e[3]=o=>r.toggleChoice("present")),color:r.choice==="present"?"primary":"#C2ECE2"},{default:D(()=>[y("span",{style:zt({color:r.choice==="present"?"white":"#004838"})},E(n.$t("dashboard.consultationDialog.present")),5)]),_:1},8,["color"])]),r.selectOptionMsg&&!r.choice?(I(),z("span",dl,E(r.selectOptionMsg),1)):j("",!0)])]),r.displayNoteField?(I(),z(ur,{key:0},[y("div",hl,[y("label",{innerHTML:n.$t("dashboard.consultationDialog.note")},null,8,pl),(I(),$(fr,{id:n.$t("dashboard.consultationDialog.note"),key:r.commentKey,modelValue:r.comment,"onUpdate:modelValue":e[4]||(e[4]=o=>r.comment=o),outlined:"","persistent-hint":"",class:"w-full mt-2 custom-textarea",rows:"5",rules:r.commentRules,hint:n.$t("dashboard.avisConsultationDialog.avis_feedback")},null,8,["id","modelValue","rules","hint"]))]),y("span",ml,E(n.$t("dashboard.consultationDialog.modifyChoiceInfo")),1)],64)):j("",!0),y("div",yl,[k(U,{class:"",color:"secondary",type:"submit"},{default:D(()=>[re(E(n.$t("dashboard.appointmentMissingDialog.save")),1)]),_:1})])])]),_:1})]),_:1},8,["onSubmit"])]),_:1})]),_:1},8,["model-value","onUpdate:modelValue"])}const vl=ye(Ua,[["render",gl],["__scopeId","data-v-68290444"]]),bl=["width","height"],wl=["fill"],_l=me({__name:"DownIcon",props:{height:{type:Number,default:21},width:{type:Number,default:24},color:{type:String,default:"#9E9E9E"}},setup(n){return(e,t)=>(I(),z("svg",{width:n.width,height:n.height,viewBox:"0 0 24 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[y("path",{d:"M23.3146 12.1875L22.0646 2.1875C21.9885 1.58321 21.6943 1.0275 21.2375 0.624716C20.7806 0.221935 20.1924 -0.000208915 19.5833 1.4743e-07H1.66667C1.22464 1.4743e-07 0.800716 0.175595 0.488155 0.488155C0.175595 0.800716 0 1.22464 0 1.66667V10.8333C0 11.2754 0.175595 11.6993 0.488155 12.0118C0.800716 12.3244 1.22464 12.5 1.66667 12.5H6.15208L10.0875 20.3729C10.1568 20.5114 10.2633 20.6278 10.395 20.7091C10.5267 20.7904 10.6785 20.8334 10.8333 20.8333C11.9384 20.8333 12.9982 20.3943 13.7796 19.6129C14.561 18.8315 15 17.7717 15 16.6667V15H20.8333C21.1881 15.0001 21.5388 14.9247 21.8622 14.7789C22.1856 14.633 22.4742 14.4199 22.7089 14.1539C22.9436 13.8879 23.119 13.575 23.2234 13.2359C23.3279 12.8969 23.3589 12.5395 23.3146 12.1875ZM5.83333 10.8333H1.66667V1.66667H5.83333V10.8333ZM21.4583 13.051C21.3807 13.1404 21.2846 13.2119 21.1767 13.2606C21.0689 13.3093 20.9517 13.3341 20.8333 13.3333H14.1667C13.9457 13.3333 13.7337 13.4211 13.5774 13.5774C13.4211 13.7337 13.3333 13.9457 13.3333 14.1667V16.6667C13.3335 17.2447 13.1334 17.8049 12.767 18.2519C12.4007 18.699 11.8907 19.0053 11.324 19.1188L7.5 11.4698V1.66667H19.5833C19.7864 1.6666 19.9824 1.74065 20.1347 1.87491C20.287 2.00917 20.385 2.1944 20.4104 2.39583L21.6604 12.3958C21.676 12.5132 21.6661 12.6325 21.6312 12.7456C21.5963 12.8587 21.5373 12.9629 21.4583 13.051Z",fill:n.color},null,8,wl)],8,bl))}}),kl=["width","height"],Sl=["fill"],Cl=me({__name:"UpIcon",props:{width:{type:Number,default:24},height:{type:Number,default:21},color:{type:String,default:"#9E9E9E"}},setup(n){return(e,t)=>(I(),z("svg",{width:n.width,height:n.height,viewBox:"0 0 24 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[y("path",{d:"M22.7083 6.67917C22.4737 6.41325 22.1851 6.20031 21.8619 6.05448C21.5386 5.90865 21.188 5.83326 20.8333 5.83333H15V4.16667C15 3.0616 14.561 2.00179 13.7796 1.22039C12.9982 0.438987 11.9384 2.13648e-07 10.8333 2.13648e-07C10.6785 -0.000110625 10.5267 0.0429074 10.395 0.124231C10.2633 0.205554 10.1568 0.321967 10.0875 0.460417L6.15208 8.33333H1.66667C1.22464 8.33333 0.800716 8.50893 0.488155 8.82149C0.175595 9.13405 0 9.55797 0 10V19.1667C0 19.6087 0.175595 20.0326 0.488155 20.3452C0.800716 20.6577 1.22464 20.8333 1.66667 20.8333H19.5833C20.1924 20.8335 20.7806 20.6114 21.2375 20.2086C21.6943 19.8058 21.9885 19.2501 22.0646 18.6458L23.3146 8.64583C23.3589 8.29377 23.3277 7.93632 23.2232 7.59723C23.1187 7.25813 22.9432 6.94518 22.7083 6.67917ZM1.66667 10H5.83333V19.1667H1.66667V10ZM21.6604 8.4375L20.4104 18.4375C20.385 18.6389 20.287 18.8242 20.1347 18.9584C19.9824 19.0927 19.7864 19.1667 19.5833 19.1667H7.5V9.36354L11.324 1.71458C11.8907 1.82802 12.4007 2.13433 12.767 2.5814C13.1334 3.02847 13.3335 3.58867 13.3333 4.16667V6.66667C13.3333 6.88768 13.4211 7.09964 13.5774 7.25592C13.7337 7.4122 13.9457 7.5 14.1667 7.5H20.8333C20.9516 7.49996 21.0685 7.52509 21.1763 7.57371C21.2841 7.62234 21.3803 7.69335 21.4585 7.78203C21.5368 7.8707 21.5952 7.97502 21.63 8.08803C21.6648 8.20105 21.6752 8.32017 21.6604 8.4375Z",fill:n.color},null,8,Sl)],8,kl))}}),El={components:{DownIcon:_l,UpIcon:Cl},props:{dialogAvis:Boolean},emits:["update:dialogAvis","close"],setup(n,{emit:e}){const{t}=Tt(),r=Ct(),i=Yi(),s=A(!1),o=A(1),a=A(!1),l=A(""),c=A(0),f=ae(()=>i.consultations),h=ae(()=>i.consultations),u=G=>{e("update:dialogAvis",G)},d=A(null),p=G=>{G?l.value="Je suis satisfait !!":l.value="Je ne suis pas satisfait !",s.value=!0,d.value=G},b=()=>{u(!1)},m=()=>{u(!1)},v=async G=>{if(l.value="",!a.value)return!1;if(d.value===null)return l.value="Veuillez indiquer votre avis en sélectionnant une option.",!1;le.start();try{await r.post(`/opinion/opinion/${G}`,{opinion:L.value,thumbUp:d.value},{headers:{"Content-Type":"application/json"}}),d.value=null}catch(mn){Ge.error(t("common.error.errorHasOccurred")),console.error(mn)}if(!Et().user.token){le.stop();return}L.value="",s.value=!1,await i.fetchConsultations(),le.stop()},w=A(!1),S=A(!1),T=()=>{S.value&&(S.value=!1),w.value=!w.value},O=()=>{w.value&&(w.value=!1),S.value=!S.value},L=A("");return{t,consultations:f,sendReview:v,dialogAvisConsultationStore:i,updateDialogAvis:u,toggleDialog:b,validate:m,page:o,like:w,dislike:S,toggleLike:T,toggleDislike:O,consultationLists:h,commentRules:[G=>G.length<=300||t("300_caracteres")],comment:L,toggleThumbUp:p,thumbUp:d,isValidForm:a,selectOptionMsg:l,consultationKey:c,displayNoteField:s}}};const Tl={class:"dialog-header font-weight-bold"},Ol={key:0,class:"text-center"},Dl=["innerHTML"],Pl={style:{"background-color":"#f3fcfa"},class:"pa-5 d-flex flex-column ga-5 rounded-lg"},xl={class:"d-flex flex-column ga-2"},Al={class:"d-flex justify-space-between"},Fl={class:"text-teal font-weight-bold"},Il={class:"d-flex justify-space-between"},Nl={class:"text-teal font-weight-bold"},Vl={class:"d-flex flex-column ga-2"},Ml={class:"d-flex justify-space-between"},Rl={class:"text-teal font-weight-bold"},jl={class:"d-flex justify-space-between"},Ll={class:"text-teal font-weight-bold"},ql={class:"d-flex flex-column ga-2"},$l={class:"d-flex justify-space-between"},Hl={class:"text-teal font-weight-bold"},Ul={class:"mt-4 text-center"},zl={class:"confirm-title"},Wl={class:"d-flex justify-center mt-2 ga-2"},Bl={class:"d-sm-flex ga-sm-2 mt-5"};function Ql(n,e,t,r,i,s){const o=Ln("up-icon"),a=Ln("DownIcon");return I(),$(Me,{"model-value":t.dialogAvis,"onUpdate:modelValue":r.updateDialogAvis,persistent:"","max-width":"600",transition:"dialog-top-transition",class:"blur-background"},{default:D(()=>[k(Ve,{elevation:"24",class:"border-radius-none",rounded:"xl"},{default:D(()=>[k(Ne,{class:"d-flex pa-1 justify-center w-full align-center bg-surface-lighten-1 text-primary"},{default:D(()=>[y("span",Tl,E(n.$t("dashboard.avisConsultationDialog.title")),1),k(U,{onClick:e[0]||(e[0]=l=>n.$emit("close")),variant:"text",icon:"",style:{position:"absolute",right:"10px"},density:"compact"},{default:D(()=>[k(lr,null,{default:D(()=>[re("mdi-close-circle-outline")]),_:1})]),_:1})]),_:1}),r.consultations.length?(I(),$(it,{key:0},{default:D(()=>[r.consultations.length>1?(I(),z("div",Ol,[k(cr,{"active-color":"secondary",density:"compact",color:"primary",modelValue:r.page,"onUpdate:modelValue":e[1]||(e[1]=l=>r.page=l),length:r.consultations.length,"total-visible":5},null,8,["modelValue","length"])])):j("",!0),y("div",{style:{color:"#757575"},class:"d-flex justify-center text-center avis-title",innerHTML:n.$t("dashboard.avisConsultationDialog.recap",{date:r.consultations[r.page-1].date})},null,8,Dl),k(nn,{modelValue:r.isValidForm,"onUpdate:modelValue":e[6]||(e[6]=l=>r.isValidForm=l),onSubmit:e[7]||(e[7]=rn(l=>r.sendReview(r.consultations[r.page-1].id),["prevent"]))},{default:D(()=>[y("div",Pl,[y("div",xl,[y("div",Al,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.fullName"))+":",1),y("span",Fl,E(r.consultations[r.page-1].practitionerName),1)]),y("div",Il,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.reason"))+":",1),y("span",Nl,E(r.consultations[r.page-1].appointmentReason),1)])]),k(Ie),y("div",Vl,[y("div",Ml,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.duration"))+":",1),y("span",Rl,E(r.consultations[r.page-1].duration),1)]),y("div",jl,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.price"))+":",1),y("span",Ll,E(r.consultations[r.page-1].price),1)])]),k(Ie),y("div",ql,[y("div",$l,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.time"))+":",1),y("span",Hl,E(r.consultations[r.page-1].time),1)])])]),y("div",Ul,[y("div",zl,E(n.$t("dashboard.avisConsultationDialog.confirm")),1),y("div",Wl,[k(U,{density:"comfortable",onClick:e[2]||(e[2]=()=>r.toggleThumbUp(!0)),icon:"",color:r.thumbUp?"#12C29B33":"#EDEDED",class:"text-white d-flex align-center"},{default:D(()=>[k(o,{color:r.thumbUp?"#007058":"#9E9E9E"},null,8,["color"])]),_:1},8,["color"]),k(U,{onClick:e[3]||(e[3]=()=>r.toggleThumbUp(!1)),icon:"",density:"comfortable",color:r.thumbUp===!1?"#FF000033":"#EDEDED",class:"text-white d-flex align-center"},{default:D(()=>[k(a,{color:r.thumbUp===!1?"#A82525":"#9E9E9E"},null,8,["color"])]),_:1},8,["color"])]),r.selectOptionMsg?(I(),z("div",{key:0,class:Ut(["mb-2",r.thumbUp===!1?"text-red":"text-secondary"])},E(r.selectOptionMsg),3)):j("",!0)]),y("div",null,[y("label",null,E(n.$t("dashboard.avisConsultationDialog.note")),1),(I(),$(fr,{id:n.$t("dashboard.avisConsultationDialog.note"),key:r.consultationKey,modelValue:r.comment,"onUpdate:modelValue":e[4]||(e[4]=l=>r.comment=l),placeholder:n.$t("dashboard.avisConsultationDialog.placeholder"),"persistent-hint":"",outlined:"",class:"w-full mt-2",rows:"5",rules:r.commentRules,hint:n.$t("dashboard.avisConsultationDialog.avis_feedback")},null,8,["id","modelValue","placeholder","rules","hint"]))]),y("div",Bl,[k(U,{onClick:e[5]||(e[5]=l=>n.$emit("close")),color:"#E0E0E0",class:"w-sm-50 w-100"},{default:D(()=>[re(E(n.$t("cancel_btn")),1)]),_:1}),k(U,{class:"w-sm-50 w-100 mt-2 mt-sm-0",color:"secondary",type:"submit"},{default:D(()=>[re(E(n.$t("dashboard.avisConsultationDialog.soumettre")),1)]),_:1})])]),_:1},8,["modelValue"])]),_:1})):j("",!0)]),_:1})]),_:1},8,["model-value","onUpdate:modelValue"])}const Yl=ye(El,[["render",Ql],["__scopeId","data-v-76752a4b"]]),Gl={props:{dialog:Boolean},emits:["update:dialog"],setup(n,{emit:e}){const{t}=Tt(),r=Ct(),i=A(1),s=A(!1),o=Gi(),a=A(0),l=A(!1),c=O=>{e("update:dialog",O)},f=()=>{c(!1)},h=()=>{c(!1)},u=ae(()=>o.consultations),d=A(null),p=A(""),b=async O=>{le.start();try{await r.post(`/opinion/absence-confirm/${O}`,{headers:{"Content-Type":"application/json"}}),d.value=null,w.value=""}catch(L){Ge.error(t("common.error.errorHasOccurred")),console.error(L)}s.value=!1,await o.fetchConsultations(),le.stop()},m=async(O,L)=>{le.start();try{await r.post(`/opinion/absence-protest/${O}`,{commentPatient:L}),d.value=null,w.value=""}catch(q){Ge.error(t("common.error.errorHasOccurred")),console.error(q)}await o.fetchConsultations(),s.value=!1,le.stop()},v=[O=>O.length<=300||t("300_caracteres")],w=A("");return{t,consultations:u,dialogYouAbsenceStore:o,updateDialogAppointment:c,toggleDialog:f,validate:h,confirmAbsence:b,disputeAbsence:m,page:i,commentRules:v,note:w,choice:d,onSubmit:async()=>{if(p.value="",!l.value)return!1;if(!d.value){p.value="Veuillez sélectionner une option.";return}d.value==="confirm"?await b(u.value[i.value-1].id):await m(u.value[i.value-1].id,w.value)},toggleChoice:O=>{s.value=!0,d.value=O},isValidForm:l,choiceMsg:p,consultationNote:a,displayNoteField:s}}};const Jl={class:"font-weight-bold"},Kl={key:0,class:"text-center"},Xl=["innerHTML"],Zl={style:{"background-color":"#f3fcfa"},class:"pa-5 d-flex flex-column ga-2 rounded-lg"},ec={class:"d-flex flex-column ga-2"},tc={class:"d-flex justify-space-between"},nc={class:"text-teal font-weight-bold"},rc={class:"d-flex justify-space-between"},ic={class:"text-teal font-weight-bold"},sc={class:"d-flex flex-column ga-2"},oc={class:"d-flex justify-space-between"},ac={class:"text-teal font-weight-bold"},lc={class:"d-flex justify-space-between"},cc={class:"text-teal font-weight-bold"},uc={class:"d-flex justify-space-between"},fc={class:"text-teal font-weight-bold"},dc={class:"d-flex flex-column ga-4 mt-3"},hc={class:"text-center text-gray-80 font-weight-medium"},pc={class:"d-sm-flex ga-3 px-6"},mc={key:0,class:"text-center text-red mt-1"},yc={key:1,class:"mt-3"},gc=["innerHTML"],vc={class:"d-flex justify-end pa-4"};function bc(n,e,t,r,i,s){return I(),$(Me,{"model-value":t.dialog,"onUpdate:modelValue":r.updateDialogAppointment,persistent:"","max-width":"600",transition:"dialog-top-transition"},{default:D(()=>[k(Ve,null,{default:D(()=>[k(Ne,{class:"d-flex pa-1 justify-center w-full align-center bg-surface-lighten-1 text-primary"},{default:D(()=>[y("span",Jl,E(n.$t("dashboard.appointmentMissingDialog.title")),1),y("img",{style:{position:"absolute",right:"10px"},class:"cursor-pointer mr-2",onClick:e[0]||(e[0]=(...o)=>r.validate&&r.validate(...o)),src:Ji})]),_:1}),k(nn,{modelValue:r.isValidForm,"onUpdate:modelValue":e[5]||(e[5]=o=>r.isValidForm=o),onSubmit:rn(r.onSubmit,["prevent"])},{default:D(()=>[r.consultations.length?(I(),$(it,{key:0},{default:D(()=>[r.consultations.length>1?(I(),z("div",Kl,[k(cr,{"active-color":"secondary",density:"compact",color:"primary",modelValue:r.page,"onUpdate:modelValue":e[1]||(e[1]=o=>r.page=o),length:r.consultations.length,"total-visible":5},null,8,["modelValue","length"])])):j("",!0),y("div",{style:{color:"#757575"},class:"d-flex justify-center text-center abscence-title",innerHTML:n.$t("dashboard.avisConsultationDialog.recap",{date:r.consultations[r.page-1].date})},null,8,Xl),y("div",Zl,[y("div",ec,[y("div",tc,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.fullName"))+":",1),y("span",nc,E(r.consultations[r.page-1].practitionerName),1)]),y("div",rc,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.reason"))+":",1),y("span",ic,E(r.consultations[r.page-1].appointmentReason),1)])]),k(Ie),y("div",sc,[y("div",oc,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.duration"))+":",1),y("span",ac,E(r.consultations[r.page-1].duration),1)]),y("div",lc,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.price"))+":",1),y("span",cc,E(r.consultations[r.page-1].price),1)])]),k(Ie),y("div",null,[y("div",uc,[y("span",null,E(n.$t("dashboard.avisConsultationDialog.time"))+":",1),y("span",fc,E(r.consultations[r.page-1].time),1)])])]),y("div",dc,[y("div",hc,E(n.$t("dashboard.avisConsultationDialog.confirmAbscenceTitle")),1),y("div",null,[y("div",pc,[k(U,{class:"w-sm-50 w-100",color:r.choice==="dispute"?"red":"#F3D0D0",onClick:e[2]||(e[2]=o=>r.toggleChoice("dispute"))},{default:D(()=>[y("span",{style:zt({color:r.choice==="dispute"?"white":"#A82525"})},E(n.$t("dashboard.appointmentMissingDialog.dispute")),5)]),_:1},8,["color"]),k(U,{class:"w-sm-50 w-100 mt-sm-0 mt-3",color:r.choice==="confirm"?"primary":"#C2ECE2",onClick:e[3]||(e[3]=o=>r.toggleChoice("confirm"))},{default:D(()=>[y("span",{style:zt({color:r.choice==="confirm"?"white":"#004838"})},E(n.$t("dashboard.appointmentMissingDialog.confirm")),5)]),_:1},8,["color"])]),r.choiceMsg?(I(),z("div",mc,E(r.choiceMsg),1)):j("",!0)])]),r.displayNoteField?(I(),z("div",yc,[y("label",null,E(n.$t("dashboard.avisConsultationDialog.note")),1),(I(),$(fr,{id:n.$t("dashboard.avisConsultationDialog.note"),key:r.consultationNote,modelValue:r.note,"onUpdate:modelValue":e[4]||(e[4]=o=>r.note=o),placeholder:n.$t("dashboard.appointmentMissingDialog.note"),"persistent-hint":"",outlined:"",class:"w-full mt-2",rows:"5",rules:r.commentRules,hint:n.$t("dashboard.avisConsultationDialog.avis_feedback")},null,8,["id","modelValue","placeholder","rules","hint"]))])):j("",!0)]),_:1})):j("",!0),k(Wo,{cols:"12"},{default:D(()=>[y("span",{class:"mr-auto dialog-text",innerHTML:n.$t("dashboard.appointmentMissingDialog.modifyChoiceInfo")},null,8,gc)]),_:1}),y("div",vc,[k(U,{class:"",color:"secondary",type:"submit"},{default:D(()=>[re(E(n.$t("dashboard.appointmentMissingDialog.save")),1)]),_:1})])]),_:1},8,["modelValue","onSubmit"])]),_:1})]),_:1},8,["model-value","onUpdate:modelValue"])}const wc=ye(Gl,[["render",bc],["__scopeId","data-v-67c01628"]]);const _c={__name:"AppointmentCanceledDialog",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(n){const{xs:e}=Wi(),t=Bo(n,"modelValue"),r=()=>{t.value=!1};return(i,s)=>(I(),$(Me,{modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=o=>t.value=o),persistent:"","min-width":_(e)?0:500,width:"fit-content",transition:"dialog-top-transition"},{default:D(()=>[k(Ve,{class:"bg-white"},{default:D(()=>[k(Ne,{class:"d-flex pa-4 justify-center w-full align-center bg-surface-lighten-1 text-primary"},{default:D(()=>[y("span",null,E(i.$t("tmpAppointmentDialog.titleAppointmentCanceled")),1),k(U,{class:"close-icon mr-2",variant:"text",icon:"mdi-close",onClick:r})]),_:1}),k(it,{class:"pa-4 text-center"},{default:D(()=>[re(E(i.$t("tmpAppointmentDialog.messageAppointmentCanceled")),1)]),_:1}),k(Bi,{class:"d-flex justify-center align-center pa-4 pt-2"},{default:D(()=>[k(U,{class:"px-6",variant:"flat",color:"blue-darken-1",text:i.$t("confirmDialog.confirmBtn"),onClick:r},null,8,["text"])]),_:1})]),_:1})]),_:1},8,["modelValue","min-width"]))}},kc=ye(_c,[["__scopeId","data-v-bad96da7"]]),Sc={class:"version-chip"},Cc=me({__name:"VersionChip",setup(n){A(""),Ct();const e=ae(()=>"v4.7.0");return rt(async()=>!1),(t,r)=>(I(),z("div",Sc,E(e.value),1))}});const Ec=ye(Cc,[["__scopeId","data-v-e35b0e37"]]),Tc="/assets/onboarding-alert-a728755b.jpg",Oc={class:"font-weight-bold title"},Dc={class:"px-5 d-flex flex-column ga-4"},Pc={class:"start"},xc={class:"start-desc"},Ac={class:"px-5 py-5"},Fc={class:"d-sm-flex ga-sm-2"},Ic={class:"font-weight-bold",style:{color:"#757575"}},Nc=me({__name:"AlertCloseOnboarding",props:{display:Boolean},emits:["confirmDelete","cancel"],setup(n,{emit:e}){const t=Ki();Tt();const r=async()=>{await t.resetOnboarding(),t.visible==!1,await t.toggleOnboarding(!0),t.leave=!0},i=()=>{t.onboardingAlert=!1,setTimeout(()=>t.visible=!0,300)},s=async()=>{t.continueLater=!0,t.visible=!1,t.onboardingAlert=!1,await t.toggleOnboarding(!0),t.leave=!0};return(o,a)=>(I(),$(Me,{persistent:"","model-value":n.display,width:"650"},{default:D(()=>[k(Ve,{disabled:_(t).loading,"max-width":"450",color:"white",transition:"dialog-top-transition"},{default:D(()=>[k(Ne,{class:"py-3 d-flex justify-center w-full align-center bg-surface-lighten-1"},{default:D(()=>[y("span",Oc,E(o.$t("onboarding.discoverHolitime")),1),y("img",{style:{position:"absolute",right:"10px"},class:"cursor-pointer mr-2",onClick:a[0]||(a[0]=()=>i()),src:Ji})]),_:1}),y("div",null,[k(Qo,{eager:"",src:Tc}),y("div",Dc,[y("p",Pc,E(o.$t("onboarding.modalAlertTitle")),1),y("p",xc,E(o.$t("onboarding.modalAlertDesc")),1)])]),y("div",Ac,[y("div",Fc,[k(U,{color:"#E0E0E0",class:"w-sm-50 w-100",onClick:a[1]||(a[1]=()=>r())},{default:D(()=>[y("span",Ic,E(o.$t("onboarding.noLongerDisplay")),1)]),_:1}),k(U,{color:"#12C29B",class:"w-sm-50 w-100 mt-sm-0 mt-2 text-white",onClick:a[2]||(a[2]=()=>s())},{default:D(()=>[re(E(o.$t("onboarding.continueLater")),1)]),_:1})])])]),_:1},8,["disabled"])]),_:1},8,["model-value"]))}});const Vc=ye(Nc,[["__scopeId","data-v-7fbe81e7"]]),Re=n=>(va("data-v-67fe5ef8"),n=n(),ba(),n),Mc={class:"title-modal font-weight-bold"},Rc={key:0,class:"my-2"},jc={class:"font-weight-bold d-flex align-center ga-3"},Lc={key:2},qc=Re(()=>y("label",null,"Sélection patient",-1)),$c={class:"d-flex ga-2"},Hc={key:0},Uc={key:0,class:"pa-4"},zc={class:"label-custom"},Wc={class:"my-2"},Bc={class:"text-caption"},Qc={key:4,style:{"font-size":"0.8em"},class:"text-red text-center font-italic"},Yc={class:"d-flex ga-2"},Gc={class:"w-100"},Jc=Re(()=>y("label",null,"Date",-1)),Kc={class:"d-sm-flex align-center ga-2 mt-2"},Xc={class:"w-sm-50"},Zc=Re(()=>y("label",null,"De",-1)),eu={class:"w-sm-50 mt-2 mt-sm-0"},tu=Re(()=>y("label",null,"À",-1)),nu={class:"text-desabled"},ru={key:5,class:"my-2"},iu=Re(()=>y("label",null,"Sélection adresse",-1)),su={key:0},ou={key:1,class:"text-black align-self-center"},au={class:"my-2"},lu={for:""},cu={class:"remote-wrapper d-flex align-center justify-start ga-4"},uu={key:7,class:"mb-2"},fu={key:0},du={key:8,class:"mb-2"},hu=["href"],pu=Re(()=>y("label",null,"Description",-1)),mu={class:"d-flex flex-column flex-sm-row ga-2 mt-4"},yu=Re(()=>y("span",{style:{color:"#757575","font-weight":"700"}},"Annuler",-1)),gu=me({__name:"DialogAppointment",setup(n){const{required:e}=Yo(),{t}=Tt(),r=Et(),i=Go(),s=Jo(),o=Xi(),a=Ko(),l=Xo(),c=new Date().toISOString().split("T")[0],f=A(""),h=A(""),u=A(!1),d=ae(()=>[C=>!!C||t("login.error.emailRequired"),C=>/.+@.+\..+/.test(C)||t("login.error.emailInvalid")]),p=Zo(),{isLoading:b,patients:m,isLoadingMore:v}=$r(p),w=A(""),S=A(null),T=A(null),O=ya(C=>{q(C)},500),L=C=>{var ee;const P=(ee=C.clipboardData)==null?void 0:ee.getData("text");P&&(w.value=P,S.value&&clearTimeout(S.value),q(P))},q=async C=>{if(w.value=C||"",!C||!C.trim()){T.value=null,o.selectedPatient=null,await X({refresh:!0,append:!1});return}T.value&&C===`${T.value.firstName} ${T.value.lastName}`||await X({refresh:!0,append:!1})},G=C=>{if(!C){w.value="",o.selectedPatient=null,T.value=null;return}w.value=`${C.firstName} ${C.lastName}`;const P={firstName:C.firstName,lastName:C.lastName,email:C.email,phoneNumber:C.phone};o.selectedPatient=P,T.value=C,qn(()=>{const ee=document.querySelector(".v-autocomplete input");ee&&(ee.value=w.value)})},X=async(C={refresh:!1,append:!1})=>{try{await p.fetchPatients({search:w.value,refresh:C.refresh,append:C.append})}catch(P){console.error("Error fetching patients:",P)}};function mn(C){C&&p.hasMore&&X({refresh:!1,append:!0})}const po=C=>{C===null&&(o.selectedAppointmentReason=o.fileteredAppointmentReason[0]),o.selectedAppointmentReason=o.fileteredAppointmentReason.find(P=>P.profile.id==C.id)},Le=A("");vt(()=>Le.value,()=>{d.value.map(P=>P(Le.value)).filter(P=>P!==!0).length>0?o.newPatientEmail="":o.newPatientEmail=Le.value.toLowerCase()}),vt(()=>o.isOpen,()=>{Le.value=o.newPatientEmail;const C=o.selectedDate?ge(o.selectedDate):ge();o.startHour=C.hour(),o.startMinute=C.minute(),a.fillPatients()});function mo(C){return C?[]:["Une option doit être sélectionnée."]}const yo=async()=>{if(!Fr.value)return Ge.error(t("dashboard.appointment.dialogPopup.enterAddress")),!1;if(!o.isEditing&&!ko.value||!Ir.value)return!1;if(o.isNewPatient){if(h.value&&!u.value)return!1;o.newPatientPhone=f.value}if(o.isEditing)o.updateAppointment();else if(await o.createAppointment(),o.isNewPatient){const C={id:"",firstName:o.newPatientFirstName,lastName:o.newPatientLastName,email:o.newPatientEmail,phoneNumber:o.newPatientPhone||"",fullName:`${o.newPatientFirstName} ${o.newPatientLastName}`,emailConfirmed:!1,avatar:"",language:"fr",publicName:`${o.newPatientFirstName} ${o.newPatientLastName}`,passwordSet:!1};a.patients.push(C),a.patients.sort((P,ee)=>P.fullName.localeCompare(ee.fullName))}};rt(async()=>{(!i.addresses||!i.addresses.length)&&i.initAddresses(),(!s.profiles||!s.profiles.length)&&await s.initProfiles(),o.selectedProfile=s.profiles[0],l.appointmentReasons||await l.refreshAppointmentReasons(),o.isEditing?o.selectedPatient&&(T.value=o.selectedPatient):(X({refresh:!0,append:!1}),o.selectedAppointmentReason=o.fileteredAppointmentReason[0])});const Ar=A(null),go=()=>{o.isNewPatient=!1},vo=async()=>{T.value=null,w.value="",await X({refresh:!0,append:!1})},bo=()=>{o.isNewPatient=!0,qn(()=>{const C=Ar.value.querySelector("input:not([type=hidden]),textarea:not([type=hidden])");C&&setTimeout(()=>{C.focus()},0)})},{selectedAddress:Fr,selectedAppointmentReason:wo,selectedDate:Ir,acceptRemote:_o}=$r(o),ko=ae(()=>o.selectedPatient&&o.selectedPatient.email&&o.selectedPatient.firstName&&o.selectedPatient.lastName&&(Fr.value||i.addresses.length>0)&&wo.value&&!!Ir.value&&_o.value);ae(()=>!o.selectedDate||!o.selectedStartTime?!1:ge(`${o.selectedDate.format("YYYY-MM-DD")} ${o.selectedStartTime}`,"YYYY-MM-DD HH:mm").isAfter(ge())),o.$subscribe((C,P)=>{P.selectedAddress||(P.selectedAddress=i.addresses[0])});const So=()=>{ga.confirm({title:t("dashboard.appointment.dialogPopup.confirmDeleteAppointment"),message:t("dashboard.appointment.dialogPopup.confirmDeleteAppointmentQuetion"),optionsConfirm:{onCancel(){},onConfirm(){a.handleDeleteAppointment(o.id)}}})},Co=()=>{const C=o.selectedAppointmentReason?o.selectedAppointmentReason.duration:null;C&&(o.selectedEndTime=ge(o.selectedDate+" "+o.selectedStartTime,"YYYY-MM-DD H:mm").add(C,"minutes").format("YYYY-MM-DD HH:mm").split(" ")[1])},Eo=ae(()=>{var Oe;const C=(Oe=o.selectedAppointmentReason)==null?void 0:Oe.duration,P=Number(o.startHour),ee=Number(o.startMinute);return ge().hour(P).minute(ee).add(C,"minute").format("HH:mm")}),To=async C=>{u.value=C.valid,f.value=C.number};return ae(()=>{if(!w.value)return a.patients;const C=w.value.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/-/g," ").replace(/\s+/g," ").trim();return a.patients.filter(P=>{const ee=lt=>lt?lt.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/-/g," ").replace(/\s+/g," ").trim():"",at=ee(P.fullName),Oe=P.fullName?ee(P.fullName.split(" ").reverse().join(" ")):"",Ft=ee(P.email);return at.includes(C)||Oe.includes(C)||Ft.includes(C)})}),(C,P)=>(I(),$(Me,{"model-value":_(o).isOpen,persistent:"",transition:"dialog-top-transition",width:"550"},{default:D(()=>[k(Ve,{class:"bg-white"},{default:D(()=>[k(Ne,{class:"d-flex justify-center w-full align-center bg-surface-lighten-1 text-primary"},{default:D(()=>[y("span",Mc,E(_(o).isEditing?C.$t("dashboard.appointment.dialogPopup.titleEdit"):C.$t("dashboard.appointment.dialogPopup.titleCreate")),1),k(ea,{size:"24",onClick:P[0]||(P[0]=()=>_(o).toggleDialog()),class:"mr-4 close-icon cursor-pointer"})]),_:1}),k(Ie),k(it,{class:"d-flex flex-column ga-2 px-12 xxs-padding"},{default:D(()=>[k(nn,{ref:"form",onSubmit:rn(yo,["prevent"])},{default:D(()=>{var ee,at,Oe,Ft,lt,Nr,Vr,Mr,Rr,jr,Lr,qr;return[1<_(s).profiles.length?(I(),z("div",Rc,[y("label",null,E(C.$t("dashboard.appointment.dialogPopup.labelProfile")),1),k(gn,{modelValue:_(o).selectedProfile,"onUpdate:modelValue":[P[1]||(P[1]=F=>_(o).selectedProfile=F),po],"auto-select-first":!1,"custom-filter":()=>!0,items:_(s).profiles,clearable:"","item-title":"mainDiscipline.name","item-value":"mainDiscipline.name","return-object":"","validate-on":"lazy",density:"compact",rules:_(e),"hide-details":"",rounded:"lg",placeholder:"selection de profile"},null,8,["modelValue","items","rules"])])):j("",!0),_(o).isNewPatient&&!_(o).isEditing?(I(),$(U,{key:1,onClick:go,variant:"text",block:"",density:"comfortable"},{default:D(()=>[y("div",jc,[y("span",null,E(C.$t("dashboard.appointment.dialogPopup.selectOlderPatient")),1)])]),_:1})):j("",!0),_(o).isNewPatient?j("",!0):(I(),z("div",Lc,[qc,y("div",$c,[k(ta,{modelValue:T.value,"onUpdate:modelValue":[P[2]||(P[2]=F=>T.value=F),G],items:_(m),placeholder:C.$t("dashboard.appointment.dialogPopup.placeholderNamePatient"),"auto-select-first":!1,"item-title":F=>F?`${F.firstName} ${F.lastName}`:"","item-value":"id","return-object":"",variant:"outlined",density:"compact",rounded:"lg",clearable:"","no-filter":"","search-input":w.value,"onUpdate:searchInput":P[3]||(P[3]=F=>w.value=F),"onUpdate:search":_(O),"onClick:clear":vo,onPaste:L,"error-messages":_(a).errorMessage("owner"),rules:_(e),"hide-details":"auto","no-data-text":_(b)?C.$t("dashboard.appointment.dialogPopup.searching"):C.$t("dashboard.appointment.dialogPopup.noDataAvailable"),disabled:_(o).isEditing},{"append-inner":D(({isActive:F})=>[Hr(k(U,{loading:_(b)||_(v),variant:"text",icon:"mdi-loading",size:"small",disabled:""},null,8,["loading"]),[[na,(_(b)||_(v))&&F]])]),item:D(({item:F,props:yn})=>[k(Ur,ra(yn,{title:F.raw.firstName+" "+F.raw.lastName,subtitle:F.raw.email}),{prepend:D(()=>[F.raw.firstName?(I(),$(ia,{key:0,color:"surface-variant",size:"33"},{default:D(()=>[re(E(F.raw.firstName.slice(0,1)),1)]),_:2},1024)):j("",!0)]),_:2},1040,["title","subtitle"])]),"append-item":D(()=>[_(m).length?(I(),z(ur,{key:0},[_(b)?j("",!0):Hr((I(),z("div",Hc,[_(v)?(I(),z("div",Uc,[k(sa)])):j("",!0)])),[[oa,mn]])],64)):j("",!0)]),_:1},8,["modelValue","items","placeholder","item-title","search-input","onUpdate:search","error-messages","rules","no-data-text","disabled"]),!_(o).isNewPatient&&!_(o).isEditing?(I(),$(U,{key:0,onClick:P[4]||(P[4]=()=>bo()),color:"#12C29B",icon:"",size:"small"},{default:D(()=>[k(lr,{color:"white"},{default:D(()=>[re("mdi-plus")]),_:1})]),_:1})):j("",!0)])])),_(o).isNewPatient&&!_(o).isEditing?(I(),$(aa,{key:3},{default:D(()=>[y("form",{ref_key:"formNewPatient",ref:Ar,class:"mb-2 d-flex flex-column ga-1"},[y("div",null,[y("label",null,E(`${C.$t("dashboard.appointment.dialogPopup.firstName")}*`),1),k(It,{modelValue:_(o).newPatientFirstName,"onUpdate:modelValue":P[5]||(P[5]=F=>_(o).newPatientFirstName=F),"hide-details":"","error-messages":_(a).errorMessage("firstNamePatient"),density:"compact",clearable:"",rules:_(e),rounded:"lg",placeholder:C.$t("dashboard.appointment.dialogPopup.firstName")},null,8,["modelValue","error-messages","rules","placeholder"])]),y("div",null,[y("label",null,E(`${C.$t("dashboard.appointment.dialogPopup.lastName")}*`),1),k(It,{modelValue:_(o).newPatientLastName,"onUpdate:modelValue":P[6]||(P[6]=F=>_(o).newPatientLastName=F),"hide-details":"","error-messages":_(a).errorMessage("lastNamePatient"),density:"compact",clearable:"",rules:_(e),rounded:"lg",placeholder:C.$t("dashboard.appointment.dialogPopup.lastName")},null,8,["modelValue","error-messages","rules","placeholder"])]),y("div",null,[y("label",null,E(`${C.$t("Email")}*`),1),k(It,{modelValue:Le.value,"onUpdate:modelValue":P[7]||(P[7]=F=>Le.value=F),"hide-details":"","error-messages":_(a).errorMessage("emailPatient"),density:"compact",clearable:"",rules:d.value,rounded:"lg",placeholder:C.$t("Email")},null,8,["modelValue","error-messages","rules","placeholder"])]),y("div",null,[y("label",zc,E(_(t)("dashboard.account.phoneNumber")),1),k(la,{modelValue:h.value,"onUpdate:modelValue":P[8]||(P[8]=F=>h.value=F),label:C.$t("accountForm.phone.label"),"show-dial-code":!1,rounded:"",onChange:To,onValide:P[9]||(P[9]=F=>u.value=F)},null,8,["modelValue","label"])])],512)]),_:1})):j("",!0),y("div",Wc,[y("label",null,E(C.$t("dashboard.appointment.dialogPopup.placeholderSelectMotive")),1),k(gn,{modelValue:_(o).selectedAppointmentReason,"onUpdate:modelValue":[P[10]||(P[10]=F=>_(o).selectedAppointmentReason=F),Co],items:_(o).fileteredAppointmentReason,rounded:"lg",density:"compact","item-title":"label","item-value":"id","return-object":"","error-messages":mo(_(o).selectedAppointmentReason),"hide-details":"auto",placeholder:"Sélectionner un motif"},{item:D(({props:F,item:yn})=>[k(Ur,ca(ua(F)),{default:D(()=>[y("div",Bc,E(C.$t("dashboard.time-slot.dialogTimeSlot.duration",{duration:yn.raw.duration})),1)]),_:2},1040)]),_:1},8,["modelValue","items","error-messages"])]),_(o).fileteredAppointmentReason.length?j("",!0):(I(),z("span",Qc,E(C.$t("dashboard.time-slot.dialogTimeSlot.messageErrorForMotif")),1)),y("div",Yc,[y("div",Gc,[Jc,k(_(fa),{"prepend-icon":"",modelValue:_(o).selectedDate,"onUpdate:modelValue":P[11]||(P[11]=F=>_(o).selectedDate=F),"append-inner-icon":"mdi-calendar",placeholder:C.$t("dashboard.time-slot.dialogVacation.datePlaceholder"),density:"compact",rounded:"lg","hide-details":"auto","hide-actions":"",variant:"outlined",min:_(c),rules:_(e)},null,8,["modelValue","placeholder","min","rules"])])]),y("div",Kc,[y("div",Xc,[Zc,k(da,{class:"w-100",hour:_(o).startHour,"onUpdate:hour":P[12]||(P[12]=F=>_(o).startHour=F),minute:_(o).startMinute,"onUpdate:minute":P[13]||(P[13]=F=>_(o).startMinute=F)},null,8,["hour","minute"])]),y("div",eu,[tu,y("div",nu,E(Eo.value),1)])]),_(i).addresses.length>1?(I(),z("div",ru,[iu,k(gn,{modelValue:_(o).selectedAddress,"onUpdate:modelValue":P[14]||(P[14]=F=>_(o).selectedAddress=F),class:"flex-grow-1","hide-details":"",density:"compact","item-title":"formattedAddress","item-value":"formattedAddress","return-object":"",items:_(i).addresses,rounded:"lg"},{selection:D(({item:F})=>[F.title.length<50?(I(),z("span",su,E(F.title),1)):(I(),z("span",ou,E(F.title.slice(0,50))+" ... ",1))]),_:1},8,["modelValue","items"])])):j("",!0),y("div",au,[y("label",lu,E(C.$t("dashboard.appointment.dialogPopup.modality")),1),y("div",cu,[k(ha,{class:"mx-auto ga-2 flex accept-remote items-center",inline:"","hide-details":"",modelValue:_(o).acceptRemote,"onUpdate:modelValue":P[15]||(P[15]=F=>_(o).acceptRemote=F)},{default:D(()=>[k(zr,{color:"secondary",label:C.$t("dashboard.time-slot.in-person"),value:"in-person"},null,8,["label"]),k(zr,{color:"secondary",label:C.$t("dashboard.time-slot.remote"),value:"remote"},null,8,["label"])]),_:1},8,["modelValue"])])]),_(o).acceptRemote=="remote"&&((at=(ee=_(r))==null?void 0:ee.user)!=null&&at.hasVisioToolFeature)?(I(),$(pa,{key:6,modelValue:_(o).useInternalVisioTool,"onUpdate:modelValue":P[16]||(P[16]=F=>_(o).useInternalVisioTool=F),label:C.$t("dashboard.appointment.dialogPopup.useInternalVisioTool"),"hide-details":""},null,8,["modelValue","label"])):j("",!0),_(o).acceptRemote=="remote"?(I(),z("div",uu,[(Ft=(Oe=_(r))==null?void 0:Oe.user)!=null&&Ft.hasVisioToolFeature&&!_(o).useInternalVisioTool||(Nr=(lt=_(r))==null?void 0:lt.user)!=null&&Nr.hasVisioToolFeature&&_(o).isEditing&&_(o).remoteAppointmentLink&&_(o).remoteAppointmentLink.includes("/appointment/")||!((Mr=(Vr=_(r))==null?void 0:Vr.user)!=null&&Mr.hasVisioToolFeature)&&!_(o).isEditing?(I(),z("label",fu,E(C.$t("dashboard.appointment.dialogPopup.remoteAppointmentLink")),1)):j("",!0),!((jr=(Rr=_(r))==null?void 0:Rr.user)!=null&&jr.hasVisioToolFeature)||!_(o).useInternalVisioTool?(I(),$(It,{key:1,modelValue:_(o).remoteAppointmentLink,"onUpdate:modelValue":P[17]||(P[17]=F=>_(o).remoteAppointmentLink=F),"hide-details":"auto","error-messages":_(a).errorMessage("meetingLink"),density:"compact",rounded:"lg",clearable:""},null,8,["modelValue","error-messages"])):j("",!0)])):j("",!0),_(o).acceptRemote=="remote"&&((qr=(Lr=_(r))==null?void 0:Lr.user)!=null&&qr.hasVisioToolFeature)&&_(o).useInternalVisioTool&&_(o).isEditing&&_(o).remoteAppointmentLink&&_(o).remoteAppointmentLink.includes("/appointment/")?(I(),z("div",du,[y("a",{href:_(o).remoteAppointmentLink,target:"_blank"},E(_(o).remoteAppointmentLink),9,hu)])):j("",!0),y("div",null,[pu,k(ma,{content:_(o).description,"onUpdate:content":P[18]||(P[18]=F=>_(o).description=F),contentType:"html",placeholder:C.$t("dashboard.appointment.dialogPopup.placeholderDescription"),toolbar:[["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],["link"]],rules:[],"error-messages":[],color:"secondary"},null,8,["content","placeholder"])]),y("div",mu,[_(o).isEditing?(I(),$(U,{key:0,class:"w-sm-50 w-100",color:"red-darken-1",onClick:So},{default:D(()=>[re(E(C.$t("common.delete")),1)]),_:1})):(I(),$(U,{key:1,onClick:P[19]||(P[19]=()=>_(o).toggleDialog()),color:"#E0E0E0",class:"w-sm-50 w-100 mb-2 mb-sm-0"},{default:D(()=>[yu]),_:1})),k(U,{class:"w-sm-50 w-100",variant:"flat",color:"secondary",loading:_(a).loading,type:"submit"},{default:D(()=>[re(E(C.$t("common.save")),1)]),_:1},8,["loading"])])]}),_:1},512)]),_:1})]),_:1})]),_:1},8,["model-value"]))}});const vu=ye(gu,[["__scopeId","data-v-67fe5ef8"]]),bu=new Set(["title","titleTemplate","script","style","noscript"]),Mt=new Set(["base","meta","link","style","script","noscript"]),wu=new Set(["title","titleTemplate","templateParams","base","htmlAttrs","bodyAttrs","meta","link","style","script","noscript"]),_u=new Set(["base","title","titleTemplate","bodyAttrs","htmlAttrs","templateParams"]),Zi=new Set(["tagPosition","tagPriority","tagDuplicateStrategy","children","innerHTML","textContent","processTemplateParams"]),ku=typeof window<"u";function Wt(n){let e=9;for(let t=0;t<n.length;)e=Math.imul(e^n.charCodeAt(t++),9**9);return((e^e>>>9)+65536).toString(16).substring(1,8).toLowerCase()}function Hn(n){if(n._h)return n._h;if(n._d)return Wt(n._d);let e=`${n.tag}:${n.textContent||n.innerHTML||""}:`;for(const t in n.props)e+=`${t}:${String(n.props[t])},`;return Wt(e)}function Su(n,e){return n instanceof Promise?n.then(e):e(n)}function Un(n,e,t,r){const i=r||ts(typeof e=="object"&&typeof e!="function"&&!(e instanceof Promise)?{...e}:{[n==="script"||n==="noscript"||n==="style"?"innerHTML":"textContent"]:e},n==="templateParams"||n==="titleTemplate");if(i instanceof Promise)return i.then(o=>Un(n,e,t,o));const s={tag:n,props:i};for(const o of Zi){const a=s.props[o]!==void 0?s.props[o]:t[o];a!==void 0&&((!(o==="innerHTML"||o==="textContent"||o==="children")||bu.has(s.tag))&&(s[o==="children"?"innerHTML":o]=a),delete s.props[o])}return s.props.body&&(s.tagPosition="bodyClose",delete s.props.body),s.tag==="script"&&typeof s.innerHTML=="object"&&(s.innerHTML=JSON.stringify(s.innerHTML),s.props.type=s.props.type||"application/json"),Array.isArray(s.props.content)?s.props.content.map(o=>({...s,props:{...s.props,content:o}})):s}function Cu(n,e){var r;const t=n==="class"?" ":";";return e&&typeof e=="object"&&!Array.isArray(e)&&(e=Object.entries(e).filter(([,i])=>i).map(([i,s])=>n==="style"?`${i}:${s}`:i)),(r=String(Array.isArray(e)?e.join(t):e))==null?void 0:r.split(t).filter(i=>!!i.trim()).join(t)}function es(n,e,t,r){for(let i=r;i<t.length;i+=1){const s=t[i];if(s==="class"||s==="style"){n[s]=Cu(s,n[s]);continue}if(n[s]instanceof Promise)return n[s].then(o=>(n[s]=o,es(n,e,t,i)));if(!e&&!Zi.has(s)){const o=String(n[s]),a=s.startsWith("data-");o==="true"||o===""?n[s]=a?"true":!0:n[s]||(a&&o==="false"?n[s]="false":delete n[s])}}}function ts(n,e=!1){const t=es(n,e,Object.keys(n),0);return t instanceof Promise?t.then(()=>n):n}const Eu=10;function ns(n,e,t){for(let r=t;r<e.length;r+=1){const i=e[r];if(i instanceof Promise)return i.then(s=>(e[r]=s,ns(n,e,r)));Array.isArray(i)?n.push(...i):n.push(i)}}function Tu(n){const e=[],t=n.resolvedInput;for(const i in t){if(!Object.prototype.hasOwnProperty.call(t,i))continue;const s=t[i];if(!(s===void 0||!wu.has(i))){if(Array.isArray(s)){for(const o of s)e.push(Un(i,o,n));continue}e.push(Un(i,s,n))}}if(e.length===0)return[];const r=[];return Su(ns(r,e,0),()=>r.map((i,s)=>(i._e=n._i,n.mode&&(i._m=n.mode),i._p=(n._i<<Eu)+s,i)))}const Qr=new Set(["onload","onerror","onabort","onprogress","onloadstart"]),Yr={base:-10,title:10},Gr={critical:-80,high:-10,low:20};function Bt(n){const e=n.tagPriority;if(typeof e=="number")return e;let t=100;return n.tag==="meta"?n.props["http-equiv"]==="content-security-policy"?t=-30:n.props.charset?t=-20:n.props.name==="viewport"&&(t=-15):n.tag==="link"&&n.props.rel==="preconnect"?t=20:n.tag in Yr&&(t=Yr[n.tag]),e&&e in Gr?t+Gr[e]:t}const Ou=[{prefix:"before:",offset:-1},{prefix:"after:",offset:1}],Du=["name","property","http-equiv"];function rs(n){const{props:e,tag:t}=n;if(_u.has(t))return t;if(t==="link"&&e.rel==="canonical")return"canonical";if(e.charset)return"charset";if(e.id)return`${t}:id:${e.id}`;for(const r of Du)if(e[r]!==void 0)return`${t}:${r}:${e[r]}`;return!1}const ve="%separator";function Pu(n,e){var r;let t;if(e==="s"||e==="pageTitle")t=n.pageTitle;else if(e.includes(".")){const i=e.indexOf(".");t=(r=n[e.substring(0,i)])==null?void 0:r[e.substring(i+1)]}else t=n[e];return t!==void 0?(t||"").replace(/"/g,'\\"'):void 0}const xu=new RegExp(`${ve}(?:\\s*${ve})*`,"g");function Nt(n,e,t){if(typeof n!="string"||!n.includes("%"))return n;let r=n;try{r=decodeURI(n)}catch{}const i=r.match(/%\w+(?:\.\w+)?/g);if(!i)return n;const s=n.includes(ve);return n=n.replace(/%\w+(?:\.\w+)?/g,o=>{if(o===ve||!i.includes(o))return o;const a=Pu(e,o.slice(1));return a!==void 0?a:o}).trim(),s&&(n.endsWith(ve)&&(n=n.slice(0,-ve.length)),n.startsWith(ve)&&(n=n.slice(ve.length)),n=n.replace(xu,t).trim()),n}function Jr(n,e){return n==null?e||null:typeof n=="function"?n(e):n}async function Au(n,e={}){const t=e.document||n.resolvedOptions.document;if(!t||!n.dirty)return;const r={shouldRender:!0,tags:[]};if(await n.hooks.callHook("dom:beforeRender",r),!!r.shouldRender)return n._domUpdatePromise||(n._domUpdatePromise=new Promise(async i=>{var h;const s=(await n.resolveTags()).map(u=>({tag:u,id:Mt.has(u.tag)?Hn(u):u.tag,shouldRender:!0}));let o=n._dom;if(!o){o={elMap:{htmlAttrs:t.documentElement,bodyAttrs:t.body}};const u=new Set;for(const d of["body","head"]){const p=(h=t[d])==null?void 0:h.children;for(const b of p){const m=b.tagName.toLowerCase();if(!Mt.has(m))continue;const v={tag:m,props:await ts(b.getAttributeNames().reduce((O,L)=>({...O,[L]:b.getAttribute(L)}),{})),innerHTML:b.innerHTML},w=rs(v);let S=w,T=1;for(;S&&u.has(S);)S=`${w}:${T++}`;S&&(v._d=S,u.add(S)),o.elMap[b.getAttribute("data-hid")||Hn(v)]=b}}}o.pendingSideEffects={...o.sideEffects},o.sideEffects={};function a(u,d,p){const b=`${u}:${d}`;o.sideEffects[b]=p,delete o.pendingSideEffects[b]}function l({id:u,$el:d,tag:p}){const b=p.tag.endsWith("Attrs");if(o.elMap[u]=d,b||(p.textContent&&p.textContent!==d.textContent&&(d.textContent=p.textContent),p.innerHTML&&p.innerHTML!==d.innerHTML&&(d.innerHTML=p.innerHTML),a(u,"el",()=>{var m;(m=o.elMap[u])==null||m.remove(),delete o.elMap[u]})),p._eventHandlers)for(const m in p._eventHandlers)Object.prototype.hasOwnProperty.call(p._eventHandlers,m)&&d.getAttribute(`data-${m}`)!==""&&((p.tag==="bodyAttrs"?t.defaultView:d).addEventListener(m.substring(2),p._eventHandlers[m].bind(d)),d.setAttribute(`data-${m}`,""));for(const m in p.props){if(!Object.prototype.hasOwnProperty.call(p.props,m))continue;const v=p.props[m],w=`attr:${m}`;if(m==="class"){if(!v)continue;for(const S of v.split(" "))b&&a(u,`${w}:${S}`,()=>d.classList.remove(S)),!d.classList.contains(S)&&d.classList.add(S)}else if(m==="style"){if(!v)continue;for(const S of v.split(";")){const T=S.indexOf(":"),O=S.substring(0,T).trim(),L=S.substring(T+1).trim();a(u,`${w}:${O}`,()=>{d.style.removeProperty(O)}),d.style.setProperty(O,L)}}else d.getAttribute(m)!==v&&d.setAttribute(m,v===!0?"":String(v)),b&&a(u,w,()=>d.removeAttribute(m))}}const c=[],f={bodyClose:void 0,bodyOpen:void 0,head:void 0};for(const u of s){const{tag:d,shouldRender:p,id:b}=u;if(p){if(d.tag==="title"){t.title=d.textContent;continue}u.$el=u.$el||o.elMap[b],u.$el?l(u):Mt.has(d.tag)&&c.push(u)}}for(const u of c){const d=u.tag.tagPosition||"head";u.$el=t.createElement(u.tag.tag),l(u),f[d]=f[d]||t.createDocumentFragment(),f[d].appendChild(u.$el)}for(const u of s)await n.hooks.callHook("dom:renderTag",u,t,a);f.head&&t.head.appendChild(f.head),f.bodyOpen&&t.body.insertBefore(f.bodyOpen,t.body.firstChild),f.bodyClose&&t.body.appendChild(f.bodyClose);for(const u in o.pendingSideEffects)o.pendingSideEffects[u]();n._dom=o,await n.hooks.callHook("dom:rendered",{renders:s}),i()}).finally(()=>{n._domUpdatePromise=void 0,n.dirty=!1})),n._domUpdatePromise}function Fu(n,e={}){const t=e.delayFn||(r=>setTimeout(r,10));return n._domDebouncedUpdatePromise=n._domDebouncedUpdatePromise||new Promise(r=>t(()=>Au(n,e).then(()=>{delete n._domDebouncedUpdatePromise,r()})))}function Iu(n){return e=>{var r,i;const t=((i=(r=e.resolvedOptions.document)==null?void 0:r.head.querySelector('script[id="unhead:payload"]'))==null?void 0:i.innerHTML)||!1;return t&&e.push(JSON.parse(t)),{mode:"client",hooks:{"entries:updated":s=>{Fu(s,n)}}}}}function zn(n,e={},t){for(const r in n){const i=n[r],s=t?`${t}:${r}`:r;typeof i=="object"&&i!==null?zn(i,e,s):typeof i=="function"&&(e[s]=i)}return e}const Nu={run:n=>n()},Vu=()=>Nu,is=typeof console.createTask<"u"?console.createTask:Vu;function Mu(n,e){const t=e.shift(),r=is(t);return n.reduce((i,s)=>i.then(()=>r.run(()=>s(...e))),Promise.resolve())}function Ru(n,e){const t=e.shift(),r=is(t);return Promise.all(n.map(i=>r.run(()=>i(...e))))}function vn(n,e){for(const t of[...n])t(e)}class ju{constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(e,t,r={}){if(!e||typeof t!="function")return()=>{};const i=e;let s;for(;this._deprecatedHooks[e];)s=this._deprecatedHooks[e],e=s.to;if(s&&!r.allowDeprecated){let o=s.message;o||(o=`${i} hook has been deprecated`+(s.to?`, please use ${s.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(o)||(console.warn(o),this._deprecatedMessages.add(o))}if(!t.name)try{Object.defineProperty(t,"name",{get:()=>"_"+e.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[e]=this._hooks[e]||[],this._hooks[e].push(t),()=>{t&&(this.removeHook(e,t),t=void 0)}}hookOnce(e,t){let r,i=(...s)=>(typeof r=="function"&&r(),r=void 0,i=void 0,t(...s));return r=this.hook(e,i),r}removeHook(e,t){if(this._hooks[e]){const r=this._hooks[e].indexOf(t);r!==-1&&this._hooks[e].splice(r,1),this._hooks[e].length===0&&delete this._hooks[e]}}deprecateHook(e,t){this._deprecatedHooks[e]=typeof t=="string"?{to:t}:t;const r=this._hooks[e]||[];delete this._hooks[e];for(const i of r)this.hook(e,i)}deprecateHooks(e){Object.assign(this._deprecatedHooks,e);for(const t in e)this.deprecateHook(t,e[t])}addHooks(e){const t=zn(e),r=Object.keys(t).map(i=>this.hook(i,t[i]));return()=>{for(const i of r.splice(0,r.length))i()}}removeHooks(e){const t=zn(e);for(const r in t)this.removeHook(r,t[r])}removeAllHooks(){for(const e in this._hooks)delete this._hooks[e]}callHook(e,...t){return t.unshift(e),this.callHookWith(Mu,e,...t)}callHookParallel(e,...t){return t.unshift(e),this.callHookWith(Ru,e,...t)}callHookWith(e,t,...r){const i=this._before||this._after?{name:t,args:r,context:{}}:void 0;this._before&&vn(this._before,i);const s=e(t in this._hooks?[...this._hooks[t]]:[],r);return s instanceof Promise?s.finally(()=>{this._after&&i&&vn(this._after,i)}):(this._after&&i&&vn(this._after,i),s)}beforeEach(e){return this._before=this._before||[],this._before.push(e),()=>{if(this._before!==void 0){const t=this._before.indexOf(e);t!==-1&&this._before.splice(t,1)}}}afterEach(e){return this._after=this._after||[],this._after.push(e),()=>{if(this._after!==void 0){const t=this._after.indexOf(e);t!==-1&&this._after.splice(t,1)}}}}function Lu(){return new ju}const qu=new Set(["templateParams","htmlAttrs","bodyAttrs"]),$u={hooks:{"tag:normalise":({tag:n})=>{n.props.hid&&(n.key=n.props.hid,delete n.props.hid),n.props.vmid&&(n.key=n.props.vmid,delete n.props.vmid),n.props.key&&(n.key=n.props.key,delete n.props.key);const e=rs(n);e&&!e.startsWith("meta:og:")&&!e.startsWith("meta:twitter:")&&delete n.key;const t=e||(n.key?`${n.tag}:${n.key}`:!1);t&&(n._d=t)},"tags:resolve":n=>{const e=Object.create(null);for(const r of n.tags){const i=(r.key?`${r.tag}:${r.key}`:r._d)||Hn(r),s=e[i];if(s){let a=r==null?void 0:r.tagDuplicateStrategy;if(!a&&qu.has(r.tag)&&(a="merge"),a==="merge"){const l=s.props;l.style&&r.props.style&&(l.style[l.style.length-1]!==";"&&(l.style+=";"),r.props.style=`${l.style} ${r.props.style}`),l.class&&r.props.class?r.props.class=`${l.class} ${r.props.class}`:l.class&&(r.props.class=l.class),e[i].props={...l,...r.props};continue}else if(r._e===s._e){s._duped=s._duped||[],r._d=`${s._d}:${s._duped.length+1}`,s._duped.push(r);continue}else if(Bt(r)>Bt(s))continue}if(!(r.innerHTML||r.textContent||Object.keys(r.props).length!==0)&&Mt.has(r.tag)){delete e[i];continue}e[i]=r}const t=[];for(const r in e){const i=e[r],s=i._duped;t.push(i),s&&(delete i._duped,t.push(...s))}n.tags=t,n.tags=n.tags.filter(r=>!(r.tag==="meta"&&(r.props.name||r.props.property)&&!r.props.content))}}},Hu=new Set(["script","link","bodyAttrs"]),Uu=n=>({hooks:{"tags:resolve":e=>{for(const t of e.tags){if(!Hu.has(t.tag))continue;const r=t.props;for(const i in r){if(i[0]!=="o"||i[1]!=="n"||!Object.prototype.hasOwnProperty.call(r,i))continue;const s=r[i];typeof s=="function"&&(n.ssr&&Qr.has(i)?r[i]=`this.dataset.${i}fired = true`:delete r[i],t._eventHandlers=t._eventHandlers||{},t._eventHandlers[i]=s)}n.ssr&&t._eventHandlers&&(t.props.src||t.props.href)&&(t.key=t.key||Wt(t.props.src||t.props.href))}},"dom:renderTag":({$el:e,tag:t})=>{var i,s;const r=e==null?void 0:e.dataset;if(r)for(const o in r){if(!o.endsWith("fired"))continue;const a=o.slice(0,-5);Qr.has(a)&&((s=(i=t._eventHandlers)==null?void 0:i[a])==null||s.call(e,new Event(a.substring(2))))}}}}),zu=new Set(["link","style","script","noscript"]),Wu={hooks:{"tag:normalise":({tag:n})=>{n.key&&zu.has(n.tag)&&(n.props["data-hid"]=n._h=Wt(n.key))}}},Bu={mode:"server",hooks:{"tags:beforeResolve":n=>{const e={};let t=!1;for(const r of n.tags)r._m!=="server"||r.tag!=="titleTemplate"&&r.tag!=="templateParams"&&r.tag!=="title"||(e[r.tag]=r.tag==="title"||r.tag==="titleTemplate"?r.textContent:r.props,t=!0);t&&n.tags.push({tag:"script",innerHTML:JSON.stringify(e),props:{id:"unhead:payload",type:"application/json"}})}}},Qu={hooks:{"tags:resolve":n=>{var e;for(const t of n.tags)if(typeof t.tagPriority=="string")for(const{prefix:r,offset:i}of Ou){if(!t.tagPriority.startsWith(r))continue;const s=t.tagPriority.substring(r.length),o=(e=n.tags.find(a=>a._d===s))==null?void 0:e._p;if(o!==void 0){t._p=o+i;break}}n.tags.sort((t,r)=>{const i=Bt(t),s=Bt(r);return i<s?-1:i>s?1:t._p-r._p})}}},Yu={meta:"content",link:"href",htmlAttrs:"lang"},Gu=["innerHTML","textContent"],Ju=n=>({hooks:{"tags:resolve":e=>{var o;const{tags:t}=e;let r;for(let a=0;a<t.length;a+=1)t[a].tag==="templateParams"&&(r=e.tags.splice(a,1)[0].props,a-=1);const i=r||{},s=i.separator||"|";delete i.separator,i.pageTitle=Nt(i.pageTitle||((o=t.find(a=>a.tag==="title"))==null?void 0:o.textContent)||"",i,s);for(const a of t){if(a.processTemplateParams===!1)continue;const l=Yu[a.tag];if(l&&typeof a.props[l]=="string")a.props[l]=Nt(a.props[l],i,s);else if(a.processTemplateParams||a.tag==="titleTemplate"||a.tag==="title")for(const c of Gu)typeof a[c]=="string"&&(a[c]=Nt(a[c],i,s))}n._templateParams=i,n._separator=s},"tags:afterResolve":({tags:e})=>{let t;for(let r=0;r<e.length;r+=1){const i=e[r];i.tag==="title"&&i.processTemplateParams!==!1&&(t=i)}t!=null&&t.textContent&&(t.textContent=Nt(t.textContent,n._templateParams,n._separator))}}}),Ku={hooks:{"tags:resolve":n=>{const{tags:e}=n;let t,r;for(let i=0;i<e.length;i+=1){const s=e[i];s.tag==="title"?t=s:s.tag==="titleTemplate"&&(r=s)}if(r&&t){const i=Jr(r.textContent,t.textContent);i!==null?t.textContent=i||t.textContent:n.tags.splice(n.tags.indexOf(t),1)}else if(r){const i=Jr(r.textContent);i!==null&&(r.textContent=i,r.tag="title",r=void 0)}r&&n.tags.splice(n.tags.indexOf(r),1)}}},Xu={hooks:{"tags:afterResolve":n=>{for(const e of n.tags)typeof e.innerHTML=="string"&&(e.innerHTML&&(e.props.type==="application/ld+json"||e.props.type==="application/json")?e.innerHTML=e.innerHTML.replace(/</g,"\\u003C"):e.innerHTML=e.innerHTML.replace(new RegExp(`</${e.tag}`,"g"),`<\\/${e.tag}`))}}};let ss;function Zu(n={}){const e=ef(n);return e.use(Iu()),ss=e}function Kr(n,e){return!n||n==="server"&&e||n==="client"&&!e}function ef(n={}){const e=Lu();e.addHooks(n.hooks||{}),n.document=n.document||(ku?document:void 0);const t=!n.document,r=()=>{a.dirty=!0,e.callHook("entries:updated",a)};let i=0,s=[];const o=[],a={plugins:o,dirty:!1,resolvedOptions:n,hooks:e,headEntries(){return s},use(l){const c=typeof l=="function"?l(a):l;(!c.key||!o.some(f=>f.key===c.key))&&(o.push(c),Kr(c.mode,t)&&e.addHooks(c.hooks||{}))},push(l,c){c==null||delete c.head;const f={_i:i++,input:l,...c};return Kr(f.mode,t)&&(s.push(f),r()),{dispose(){s=s.filter(h=>h._i!==f._i),r()},patch(h){for(const u of s)u._i===f._i&&(u.input=f.input=h);r()}}},async resolveTags(){const l={tags:[],entries:[...s]};await e.callHook("entries:resolve",l);for(const c of l.entries){const f=c.resolvedInput||c.input;if(c.resolvedInput=await(c.transform?c.transform(f):f),c.resolvedInput)for(const h of await Tu(c)){const u={tag:h,entry:c,resolvedOptions:a.resolvedOptions};await e.callHook("tag:normalise",u),l.tags.push(u.tag)}}return await e.callHook("tags:beforeResolve",l),await e.callHook("tags:resolve",l),await e.callHook("tags:afterResolve",l),l.tags},ssr:t};return[$u,Bu,Uu,Wu,Qu,Ju,Ku,Xu,...(n==null?void 0:n.plugins)||[]].forEach(l=>a.use(l)),a.hooks.callHook("init",a),a}function tf(){return ss}const nf=wa[0]==="3";function rf(n){return typeof n=="function"?n():_(n)}function Qt(n){if(n instanceof Promise||n instanceof Date||n instanceof RegExp)return n;const e=rf(n);if(!n||!e)return e;if(Array.isArray(e))return e.map(t=>Qt(t));if(typeof e=="object"){const t={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r==="titleTemplate"||r[0]==="o"&&r[1]==="n"){t[r]=_(e[r]);continue}t[r]=Qt(e[r])}return t}return e}const sf={hooks:{"entries:resolve":n=>{for(const e of n.entries)e.resolvedInput=Qt(e.input)}}},os="usehead";function of(n){return{install(t){nf&&(t.config.globalProperties.$unhead=n,t.config.globalProperties.$head=n,t.provide(os,n))}}.install}function af(n={}){n.domDelayFn=n.domDelayFn||(t=>qn(()=>setTimeout(()=>t(),0)));const e=Zu(n);return e.use(sf),e.install=of(e),e}const Xr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Zr="__unhead_injection_handler__";function lf(){if(Zr in Xr)return Xr[Zr]();const n=_a(os);return n||tf()}function cf(n,e={}){const t=e.head||lf();if(t)return t.ssr?t.push(n,e):uf(t,n,e)}function uf(n,e,t={}){const r=A(!1),i=A({});ka(()=>{i.value=r.value?{}:Qt(e)});const s=n.push(i.value,t);return vt(i,a=>{s.patch(a)}),Ea()&&(tn(()=>{s.dispose()}),Sa(()=>{r.value=!0}),Ca(()=>{r.value=!1})),s}const ff=me({__name:"App",setup(n){const e=Xi(),t=Ta(),r=()=>{t.name!=="PractitionerPublicProfile"&&cf({title:t.meta.title||"Holitime : Trouvez les meilleurs thérapeutes en médecine douce et alternative autour de vous",meta:[{name:"description",content:t.meta.description||"Trouvez facilement les meilleurs ostéopathes, acupuncteurs, psychologues,kinésithérapeutes,réflexologues, hypnothérapeutes, sophrologues et médecins nutritionnistes autour de vous"},{property:"og:title",content:t.meta.title||"Holitime : Trouvez les meilleurs thérapeutes en médecine douce et alternative autour de vous"},{property:"og:description",content:t.meta.description||"Trouvez facilement les meilleurs ostéopathes, acupuncteurs, psychologues,kinésithérapeutes,réflexologues, hypnothérapeutes, sophrologues et médecins nutritionnistes autour de vous"},{name:"twitter:title",content:t.meta.title||"Holitime : Trouvez les meilleurs thérapeutes en médecine douce et alternative autour de vous"},{name:"twitter:description",content:t.meta.description||"Trouvez facilement les meilleurs ostéopathes, acupuncteurs, psychologues,kinésithérapeutes,réflexologues, hypnothérapeutes, sophrologues et médecins nutritionnistes autour de vous"},{name:"twitter:image:alt",content:t.meta.title||"Holitime : Trouvez les meilleurs thérapeutes en médecine douce et alternative autour de vous"}]})};vt(()=>t.fullPath,()=>r());const i=Oa(),s=Ki();A(null);const o=Da(),a=Et(),l=$n(),c=Gi();rt(async()=>{a.isLogged&&(await f(),a.user.profilType==="patient"||i.navRole==="patient"?i.navRole="patient":i.navRole="praticien")});const f=async()=>{a.user.profilType==="practitioner"&&await $n().startLoop(),(a.user.profilType==="patient"||a.user.profilType==="practitioner")&&(await Yi().startLoop(),await c.startLoop())},h=A(!0);function u(){h.value=!0}function d(){h.value=!1}K.on("open-practitioner-ask-presence-dialog",u),K.on("close-practitioner-ask-presence-dialog",d);const p=A(!1);function b(){p.value=!0}function m(){p.value=!1}K.on("open-dialog-avis-consultation",b),K.on("close-dialog-avis-consultation",m);const v=A(!1);function w(){v.value=!0}function S(){v.value=!1}K.on("open-dialog-your-absence",w),K.on("close-dialog-your-absence",S);const T=A(!1),O=async()=>{K.emit("close-confirm"),await jn.push({name:"PractitionerPublicProfile",params:{discipline:o.publicProfileParams.discipline,city:o.publicProfileParams.city,practitionerSlug:o.publicProfileParams.practitionerSlug},query:{...o.publicProfileParams.query}}),T.value=!0};return K.on("tmp-appointment-canceled",O),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?a.isPageVisible=!1:a.isPageVisible=!0}),(L,q)=>{const G=Ln("router-view");return I(),z(ur,null,[k(Pa,{defaults:{VApp:{style:"font-family: Poppins, sans-serif;"},VHeading:{style:"font-family: Poppins, sans-serif;"},VBtn:{style:"font-family: Poppins, sans-serif;"}}},{default:D(()=>[k(qa),k(La),k(Ha),k(G),_(a).isLogged&&_(l).consultations.length?(I(),$(vl,{key:0,dialog:h.value,"onUpdate:dialog":q[0]||(q[0]=X=>h.value=X),onClose:d},null,8,["dialog"])):j("",!0),k(Yl,{dialogAvis:p.value,"onUpdate:dialogAvis":q[1]||(q[1]=X=>p.value=X),onClose:m},null,8,["dialogAvis"]),_(c).consultations.length?(I(),$(wc,{key:1,dialog:v.value,"onUpdate:dialog":q[2]||(q[2]=X=>v.value=X)},null,8,["dialog"])):j("",!0),k(kc,{modelValue:T.value,"onUpdate:modelValue":q[3]||(q[3]=X=>T.value=X)},null,8,["modelValue"]),k(Ec)]),_:1}),k(Vc,{display:_(s).onboardingAlert},null,8,["display"]),_(e).isOpen?(I(),$(vu,{key:0})):j("",!0)],64)}}});function df(n,e){if(!!!n)throw new Error(e)}class Dp{constructor(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Pp{constructor(e,t,r,i,s,o){this.kind=e,this.start=t,this.end=r,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const as={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},hf=new Set(Object.keys(as));function ei(n){const e=n==null?void 0:n.kind;return typeof e=="string"&&hf.has(e)}var Ae;(function(n){n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription"})(Ae||(Ae={}));var R;(function(n){n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(R||(R={}));function Wn(n){return n===9||n===32}function pf(n){return n>=48&&n<=57}function ls(n){return n>=97&&n<=122||n>=65&&n<=90}function xp(n){return ls(n)||n===95}function Ap(n){return ls(n)||pf(n)||n===95}function Fp(n){var e;let t=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<n.length;++o){var s;const a=n[o],l=mf(a);l!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&l<t&&(t=l))}return n.map((o,a)=>a===0?o:o.slice(t)).slice((e=r)!==null&&e!==void 0?e:0,i+1)}function mf(n){let e=0;for(;e<n.length&&Wn(n.charCodeAt(e));)++e;return e}function yf(n,e){const t=n.replace(/"""/g,'\\"""'),r=t.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(d=>d.length===0||Wn(d.charCodeAt(0))),o=t.endsWith('\\"""'),a=n.endsWith('"')&&!o,l=n.endsWith("\\"),c=a||l,f=!(e!=null&&e.minimize)&&(!i||n.length>70||c||s||o);let h="";const u=i&&Wn(n.charCodeAt(0));return(f&&!u||s)&&(h+=`
`),h+=t,(f||c)&&(h+=`
`),'"""'+h+'"""'}const gf=10,cs=2;function vf(n){return sn(n,[])}function sn(n,e){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return bf(n,e);default:return String(n)}}function bf(n,e){if(n===null)return"null";if(e.includes(n))return"[Circular]";const t=[...e,n];if(wf(n)){const r=n.toJSON();if(r!==n)return typeof r=="string"?r:sn(r,t)}else if(Array.isArray(n))return kf(n,t);return _f(n,t)}function wf(n){return typeof n.toJSON=="function"}function _f(n,e){const t=Object.entries(n);return t.length===0?"{}":e.length>cs?"["+Sf(n)+"]":"{ "+t.map(([i,s])=>i+": "+sn(s,e)).join(", ")+" }"}function kf(n,e){if(n.length===0)return"[]";if(e.length>cs)return"[Array]";const t=Math.min(gf,n.length),r=n.length-t,i=[];for(let s=0;s<t;++s)i.push(sn(n[s],e));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function Sf(n){const e=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if(e==="Object"&&typeof n.constructor=="function"){const t=n.constructor.name;if(typeof t=="string"&&t!=="")return t}return e}function Cf(n){return`"${n.replace(Ef,Tf)}"`}const Ef=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Tf(n){return Of[n.charCodeAt(0)]}const Of=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],dr=Object.freeze({});function ue(n,e,t=as){const r=new Map;for(const v of Object.values(R))r.set(v,Df(e,v));let i,s=Array.isArray(n),o=[n],a=-1,l=[],c=n,f,h;const u=[],d=[];do{a++;const v=a===o.length,w=v&&l.length!==0;if(v){if(f=d.length===0?void 0:u[u.length-1],c=h,h=d.pop(),w)if(s){c=c.slice();let T=0;for(const[O,L]of l){const q=O-T;L===null?(c.splice(q,1),T++):c[q]=L}}else{c={...c};for(const[T,O]of l)c[T]=O}a=i.index,o=i.keys,l=i.edits,s=i.inArray,i=i.prev}else if(h){if(f=s?a:o[a],c=h[f],c==null)continue;u.push(f)}let S;if(!Array.isArray(c)){var p,b;ei(c)||df(!1,`Invalid AST Node: ${vf(c)}.`);const T=v?(p=r.get(c.kind))===null||p===void 0?void 0:p.leave:(b=r.get(c.kind))===null||b===void 0?void 0:b.enter;if(S=T==null?void 0:T.call(e,c,f,h,u,d),S===dr)break;if(S===!1){if(!v){u.pop();continue}}else if(S!==void 0&&(l.push([f,S]),!v))if(ei(S))c=S;else{u.pop();continue}}if(S===void 0&&w&&l.push([f,c]),v)u.pop();else{var m;i={inArray:s,index:a,keys:o,edits:l,prev:i},s=Array.isArray(c),o=s?c:(m=t[c.kind])!==null&&m!==void 0?m:[],a=-1,l=[],h&&d.push(h),h=c}}while(i!==void 0);return l.length!==0?l[l.length-1][1]:n}function Df(n,e){const t=n[e];return typeof t=="object"?t:typeof t=="function"?{enter:t,leave:void 0}:{enter:n.enter,leave:n.leave}}function Pf(n){return ue(n,Af)}const xf=80,Af={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>x(n.definitions,`
`)},OperationDefinition:{leave(n){const e=V("(",x(n.variableDefinitions,", "),")"),t=x([n.operation,x([n.name,e]),x(n.directives," ")]," ");return(t==="query"?"":t+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:e,defaultValue:t,directives:r})=>n+": "+e+V(" = ",t)+V(" ",x(r," "))},SelectionSet:{leave:({selections:n})=>oe(n)},Field:{leave({alias:n,name:e,arguments:t,directives:r,selectionSet:i}){const s=V("",n,": ")+e;let o=s+V("(",x(t,", "),")");return o.length>xf&&(o=s+V(`(
`,Rt(x(t,`
`)),`
)`)),x([o,x(r," "),i]," ")}},Argument:{leave:({name:n,value:e})=>n+": "+e},FragmentSpread:{leave:({name:n,directives:e})=>"..."+n+V(" ",x(e," "))},InlineFragment:{leave:({typeCondition:n,directives:e,selectionSet:t})=>x(["...",V("on ",n),x(e," "),t]," ")},FragmentDefinition:{leave:({name:n,typeCondition:e,variableDefinitions:t,directives:r,selectionSet:i})=>`fragment ${n}${V("(",x(t,", "),")")} on ${e} ${V("",x(r," ")," ")}`+i},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:e})=>e?yf(n):Cf(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+x(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+x(n,", ")+"}"},ObjectField:{leave:({name:n,value:e})=>n+": "+e},Directive:{leave:({name:n,arguments:e})=>"@"+n+V("(",x(e,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:e,operationTypes:t})=>V("",n,`
`)+x(["schema",x(e," "),oe(t)]," ")},OperationTypeDefinition:{leave:({operation:n,type:e})=>n+": "+e},ScalarTypeDefinition:{leave:({description:n,name:e,directives:t})=>V("",n,`
`)+x(["scalar",e,x(t," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:r,fields:i})=>V("",n,`
`)+x(["type",e,V("implements ",x(t," & ")),x(r," "),oe(i)]," ")},FieldDefinition:{leave:({description:n,name:e,arguments:t,type:r,directives:i})=>V("",n,`
`)+e+(ti(t)?V(`(
`,Rt(x(t,`
`)),`
)`):V("(",x(t,", "),")"))+": "+r+V(" ",x(i," "))},InputValueDefinition:{leave:({description:n,name:e,type:t,defaultValue:r,directives:i})=>V("",n,`
`)+x([e+": "+t,V("= ",r),x(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:e,interfaces:t,directives:r,fields:i})=>V("",n,`
`)+x(["interface",e,V("implements ",x(t," & ")),x(r," "),oe(i)]," ")},UnionTypeDefinition:{leave:({description:n,name:e,directives:t,types:r})=>V("",n,`
`)+x(["union",e,x(t," "),V("= ",x(r," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:e,directives:t,values:r})=>V("",n,`
`)+x(["enum",e,x(t," "),oe(r)]," ")},EnumValueDefinition:{leave:({description:n,name:e,directives:t})=>V("",n,`
`)+x([e,x(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:e,directives:t,fields:r})=>V("",n,`
`)+x(["input",e,x(t," "),oe(r)]," ")},DirectiveDefinition:{leave:({description:n,name:e,arguments:t,repeatable:r,locations:i})=>V("",n,`
`)+"directive @"+e+(ti(t)?V(`(
`,Rt(x(t,`
`)),`
)`):V("(",x(t,", "),")"))+(r?" repeatable":"")+" on "+x(i," | ")},SchemaExtension:{leave:({directives:n,operationTypes:e})=>x(["extend schema",x(n," "),oe(e)]," ")},ScalarTypeExtension:{leave:({name:n,directives:e})=>x(["extend scalar",n,x(e," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:r})=>x(["extend type",n,V("implements ",x(e," & ")),x(t," "),oe(r)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:e,directives:t,fields:r})=>x(["extend interface",n,V("implements ",x(e," & ")),x(t," "),oe(r)]," ")},UnionTypeExtension:{leave:({name:n,directives:e,types:t})=>x(["extend union",n,x(e," "),V("= ",x(t," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:e,values:t})=>x(["extend enum",n,x(e," "),oe(t)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:e,fields:t})=>x(["extend input",n,x(e," "),oe(t)]," ")}};function x(n,e=""){var t;return(t=n==null?void 0:n.filter(r=>r).join(e))!==null&&t!==void 0?t:""}function oe(n){return V(`{
`,Rt(x(n,`
`)),`
}`)}function V(n,e,t=""){return e!=null&&e!==""?n+e+t:""}function Rt(n){return V(" ",n.replace(/\n/g,`
`))}function ti(n){var e;return(e=n==null?void 0:n.some(t=>t.includes(`
`)))!==null&&e!==void 0?e:!1}var Bn=function(n,e){return Bn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},Bn(n,e)};function je(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Bn(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ni=function(){return ni=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},ni.apply(this,arguments)};function Ff(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(f){try{c(r.next(f))}catch(h){o(h)}}function l(f){try{c(r.throw(f))}catch(h){o(h)}}function c(f){f.done?s(f.value):i(f.value).then(a,l)}c((r=r.apply(n,e||[])).next())})}function us(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(f){return l([c,f])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(n,t)}catch(f){c=[6,f],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Je(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function bt(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function wt(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))}function We(n){return this instanceof We?(this.v=n,this):new We(n)}function If(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(d){return function(p){return Promise.resolve(p).then(d,h)}}function a(d,p){r[d]&&(i[d]=function(b){return new Promise(function(m,v){s.push([d,b,m,v])>1||l(d,b)})},p&&(i[d]=p(i[d])))}function l(d,p){try{c(r[d](p))}catch(b){u(s[0][3],b)}}function c(d){d.value instanceof We?Promise.resolve(d.value.v).then(f,h):u(s[0][2],d)}function f(d){l("next",d)}function h(d){l("throw",d)}function u(d,p){d(p),s.shift(),s.length&&l(s[0][0],s[0][1])}}function Nf(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Je=="function"?Je(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(a,l){o=n[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}}function W(n){return typeof n=="function"}function hr(n){var e=function(r){Error.call(r),r.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var bn=hr(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
`+t.map(function(r,i){return i+1+") "+r.toString()}).join(`
`):"",this.name="UnsubscriptionError",this.errors=t}});function Qn(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var on=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var e,t,r,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Je(o),l=a.next();!l.done;l=a.next()){var c=l.value;c.remove(this)}}catch(b){e={error:b}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var f=this.initialTeardown;if(W(f))try{f()}catch(b){s=b instanceof bn?b.errors:[b]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var u=Je(h),d=u.next();!d.done;d=u.next()){var p=d.value;try{ri(p)}catch(b){s=s??[],b instanceof bn?s=wt(wt([],bt(s)),bt(b.errors)):s.push(b)}}}catch(b){r={error:b}}finally{try{d&&!d.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}if(s)throw new bn(s)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)ri(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Qn(t,e)},n.prototype.remove=function(e){var t=this._finalizers;t&&Qn(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}(),fs=on.EMPTY;function ds(n){return n instanceof on||n&&"closed"in n&&W(n.remove)&&W(n.add)&&W(n.unsubscribe)}function ri(n){W(n)?n():n.unsubscribe()}var hs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Yn={setTimeout:function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=Yn.delegate;return i!=null&&i.setTimeout?i.setTimeout.apply(i,wt([n,e],bt(t))):setTimeout.apply(void 0,wt([n,e],bt(t)))},clearTimeout:function(n){var e=Yn.delegate;return((e==null?void 0:e.clearTimeout)||clearTimeout)(n)},delegate:void 0};function ps(n){Yn.setTimeout(function(){throw n})}function ii(){}function jt(n){n()}var pr=function(n){je(e,n);function e(t){var r=n.call(this)||this;return r.isStopped=!1,t?(r.destination=t,ds(t)&&t.add(r)):r.destination=jf,r}return e.create=function(t,r,i){return new _t(t,r,i)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(on),Vf=Function.prototype.bind;function wn(n,e){return Vf.call(n,e)}var Mf=function(){function n(e){this.partialObserver=e}return n.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(r){Vt(r)}},n.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(r){Vt(r)}else Vt(e)},n.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Vt(t)}},n}(),_t=function(n){je(e,n);function e(t,r,i){var s=n.call(this)||this,o;if(W(t)||!t)o={next:t??void 0,error:r??void 0,complete:i??void 0};else{var a;s&&hs.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=function(){return s.unsubscribe()},o={next:t.next&&wn(t.next,a),error:t.error&&wn(t.error,a),complete:t.complete&&wn(t.complete,a)}):o=t}return s.destination=new Mf(o),s}return e}(pr);function Vt(n){ps(n)}function Rf(n){throw n}var jf={closed:!0,next:ii,error:Rf,complete:ii},mr=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function yr(n){return n}function Lf(n){return n.length===0?yr:n.length===1?n[0]:function(t){return n.reduce(function(r,i){return i(r)},t)}}var B=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,r){var i=this,s=$f(e)?e:new _t(e,t,r);return jt(function(){var o=i,a=o.operator,l=o.source;s.add(a?a.call(s,l):l?i._subscribe(s):i._trySubscribe(s))}),s},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var r=this;return t=si(t),new t(function(i,s){var o=new _t({next:function(a){try{e(a)}catch(l){s(l),o.unsubscribe()}},error:s,complete:i});r.subscribe(o)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[mr]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Lf(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=si(e),new e(function(r,i){var s;t.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},n.create=function(e){return new n(e)},n}();function si(n){var e;return(e=n??hs.Promise)!==null&&e!==void 0?e:Promise}function qf(n){return n&&W(n.next)&&W(n.error)&&W(n.complete)}function $f(n){return n&&n instanceof pr||qf(n)&&ds(n)}function Hf(n){return W(n==null?void 0:n.lift)}function fe(n){return function(e){if(Hf(e))return e.lift(function(t){try{return n(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Se(n,e,t,r,i){return new Uf(n,e,t,r,i)}var Uf=function(n){je(e,n);function e(t,r,i,s,o,a){var l=n.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=r?function(c){try{r(c)}catch(f){t.error(f)}}:n.prototype._next,l._error=s?function(c){try{s(c)}catch(f){t.error(f)}finally{this.unsubscribe()}}:n.prototype._error,l._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;n.prototype.unsubscribe.call(this),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(pr),zf=hr(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),st=function(n){je(e,n);function e(){var t=n.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var r=new oi(this,this);return r.operator=t,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new zf},e.prototype.next=function(t){var r=this;jt(function(){var i,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=Je(r.currentObservers),a=o.next();!a.done;a=o.next()){var l=a.value;l.next(t)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var r=this;jt(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var i=r.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;jt(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var r=t.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var r=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?fs:(this.currentObservers=null,a.push(t),new on(function(){r.currentObservers=null,Qn(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var r=this,i=r.hasError,s=r.thrownError,o=r.isStopped;i?t.error(s):o&&t.complete()},e.prototype.asObservable=function(){var t=new B;return t.source=this,t},e.create=function(t,r){return new oi(t,r)},e}(B),oi=function(n){je(e,n);function e(t,r){var i=n.call(this)||this;return i.destination=t,i.source=r,i}return e.prototype.next=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,t)},e.prototype.error=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,t)},e.prototype.complete=function(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)},e.prototype._subscribe=function(t){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&i!==void 0?i:fs},e}(st),Wf=function(n){je(e,n);function e(t){var r=n.call(this)||this;return r._value=t,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var r=n.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},e.prototype.getValue=function(){var t=this,r=t.hasError,i=t.thrownError,s=t._value;if(r)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e}(st),ms={now:function(){return(ms.delegate||Date).now()},delegate:void 0},Bf=function(n){je(e,n);function e(t,r,i){t===void 0&&(t=1/0),r===void 0&&(r=1/0),i===void 0&&(i=ms);var s=n.call(this)||this;return s._bufferSize=t,s._windowTime=r,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=r===1/0,s._bufferSize=Math.max(1,t),s._windowTime=Math.max(1,r),s}return e.prototype.next=function(t){var r=this,i=r.isStopped,s=r._buffer,o=r._infiniteTimeWindow,a=r._timestampProvider,l=r._windowTime;i||(s.push(t),!o&&s.push(a.now()+l)),this._trimBuffer(),n.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(t),i=this,s=i._infiniteTimeWindow,o=i._buffer,a=o.slice(),l=0;l<a.length&&!t.closed;l+=s?1:2)t.next(a[l]);return this._checkFinalizedStatuses(t),r},e.prototype._trimBuffer=function(){var t=this,r=t._bufferSize,i=t._timestampProvider,s=t._buffer,o=t._infiniteTimeWindow,a=(o?1:2)*r;if(r<1/0&&a<s.length&&s.splice(0,s.length-a),!o){for(var l=i.now(),c=0,f=1;f<s.length&&s[f]<=l;f+=2)c=f;c&&s.splice(0,c+1)}},e}(st),Yt=new B(function(n){return n.complete()});function Qf(n){return n&&W(n.schedule)}function Yf(n){return n[n.length-1]}function ys(n){return Qf(Yf(n))?n.pop():void 0}var gs=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function vs(n){return W(n==null?void 0:n.then)}function bs(n){return W(n[mr])}function ws(n){return Symbol.asyncIterator&&W(n==null?void 0:n[Symbol.asyncIterator])}function _s(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Gf(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ks=Gf();function Ss(n){return W(n==null?void 0:n[ks])}function Cs(n){return If(this,arguments,function(){var t,r,i,s;return us(this,function(o){switch(o.label){case 0:t=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,We(t.read())];case 3:return r=o.sent(),i=r.value,s=r.done,s?[4,We(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,We(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function Es(n){return W(n==null?void 0:n.getReader)}function Ee(n){if(n instanceof B)return n;if(n!=null){if(bs(n))return Jf(n);if(gs(n))return Kf(n);if(vs(n))return Xf(n);if(ws(n))return Ts(n);if(Ss(n))return Zf(n);if(Es(n))return ed(n)}throw _s(n)}function Jf(n){return new B(function(e){var t=n[mr]();if(W(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Kf(n){return new B(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function Xf(n){return new B(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,ps)})}function Zf(n){return new B(function(e){var t,r;try{for(var i=Je(n),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}e.complete()})}function Ts(n){return new B(function(e){td(n,e).catch(function(t){return e.error(t)})})}function ed(n){return Ts(Cs(n))}function td(n,e){var t,r,i,s;return Ff(this,void 0,void 0,function(){var o,a;return us(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),t=Nf(n),l.label=1;case 1:return[4,t.next()];case 2:if(r=l.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=l.sent(),i={error:a},[3,11];case 6:return l.trys.push([6,,9,10]),r&&!r.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function we(n,e,t,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var s=e.schedule(function(){t(),i?n.add(this.schedule(null,r)):this.unsubscribe()},r);if(n.add(s),!i)return s}function Os(n,e){return e===void 0&&(e=0),fe(function(t,r){t.subscribe(Se(r,function(i){return we(r,n,function(){return r.next(i)},e)},function(){return we(r,n,function(){return r.complete()},e)},function(i){return we(r,n,function(){return r.error(i)},e)}))})}function Ds(n,e){return e===void 0&&(e=0),fe(function(t,r){r.add(n.schedule(function(){return t.subscribe(r)},e))})}function nd(n,e){return Ee(n).pipe(Ds(e),Os(e))}function rd(n,e){return Ee(n).pipe(Ds(e),Os(e))}function id(n,e){return new B(function(t){var r=0;return e.schedule(function(){r===n.length?t.complete():(t.next(n[r++]),t.closed||this.schedule())})})}function sd(n,e){return new B(function(t){var r;return we(t,e,function(){r=n[ks](),we(t,e,function(){var i,s,o;try{i=r.next(),s=i.value,o=i.done}catch(a){t.error(a);return}o?t.complete():t.next(s)},0,!0)}),function(){return W(r==null?void 0:r.return)&&r.return()}})}function Ps(n,e){if(!n)throw new Error("Iterable cannot be null");return new B(function(t){we(t,e,function(){var r=n[Symbol.asyncIterator]();we(t,e,function(){r.next().then(function(i){i.done?t.complete():t.next(i.value)})},0,!0)})})}function od(n,e){return Ps(Cs(n),e)}function ad(n,e){if(n!=null){if(bs(n))return nd(n,e);if(gs(n))return id(n,e);if(vs(n))return rd(n,e);if(ws(n))return Ps(n,e);if(Ss(n))return sd(n,e);if(Es(n))return od(n,e)}throw _s(n)}function Pe(n,e){return e?ad(n,e):Ee(n)}function De(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=ys(n);return Pe(n,t)}function xs(n,e){var t=W(n)?n:function(){return n},r=function(i){return i.error(t())};return new B(e?function(i){return e.schedule(r,0,i)}:r)}var ai;(function(n){n.NEXT="N",n.ERROR="E",n.COMPLETE="C"})(ai||(ai={}));var _n=function(){function n(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue=e==="N"}return n.prototype.observe=function(e){return ld(this,e)},n.prototype.do=function(e,t,r){var i=this,s=i.kind,o=i.value,a=i.error;return s==="N"?e==null?void 0:e(o):s==="E"?t==null?void 0:t(a):r==null?void 0:r()},n.prototype.accept=function(e,t,r){var i;return W((i=e)===null||i===void 0?void 0:i.next)?this.observe(e):this.do(e,t,r)},n.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,i=e.error,s=t==="N"?De(r):t==="E"?xs(function(){return i}):t==="C"?Yt:0;if(!s)throw new TypeError("Unexpected notification kind "+t);return s},n.createNext=function(e){return new n("N",e)},n.createError=function(e){return new n("E",void 0,e)},n.createComplete=function(){return n.completeNotification},n.completeNotification=new n("C"),n}();function ld(n,e){var t,r,i,s=n,o=s.kind,a=s.value,l=s.error;if(typeof o!="string")throw new TypeError('Invalid notification, missing "kind"');o==="N"?(t=e.next)===null||t===void 0||t.call(e,a):o==="E"?(r=e.error)===null||r===void 0||r.call(e,l):(i=e.complete)===null||i===void 0||i.call(e)}var cd=hr(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function ud(n,e){var t=typeof e=="object";return new Promise(function(r,i){var s=!1,o;n.subscribe({next:function(a){o=a,s=!0},error:i,complete:function(){s?r(o):t?r(e.defaultValue):i(new cd)}})})}function Fe(n,e){return fe(function(t,r){var i=0;t.subscribe(Se(r,function(s){r.next(n.call(e,s,i++))}))})}function fd(n,e,t,r,i,s,o,a){var l=[],c=0,f=0,h=!1,u=function(){h&&!l.length&&!c&&e.complete()},d=function(b){return c<r?p(b):l.push(b)},p=function(b){s&&e.next(b),c++;var m=!1;Ee(t(b,f++)).subscribe(Se(e,function(v){i==null||i(v),s?d(v):e.next(v)},function(){m=!0},void 0,function(){if(m)try{c--;for(var v=function(){var w=l.shift();o?we(e,o,function(){return p(w)}):p(w)};l.length&&c<r;)v();u()}catch(w){e.error(w)}}))};return n.subscribe(Se(e,d,function(){h=!0,u()})),function(){a==null||a()}}function $e(n,e,t){return t===void 0&&(t=1/0),W(e)?$e(function(r,i){return Fe(function(s,o){return e(r,s,i,o)})(Ee(n(r,i)))},t):(typeof e=="number"&&(t=e),fe(function(r,i){return fd(r,i,n,t)}))}function dd(n){return n===void 0&&(n=1/0),$e(yr,n)}function hd(){return dd(1)}function kn(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return hd()(Pe(n,ys(n)))}function pd(n,e){return fe(function(t,r){var i=0;t.subscribe(Se(r,function(s){return n.call(e,s,i++)&&r.next(s)}))})}function Lt(n){return fe(function(e,t){var r=null,i=!1,s;r=e.subscribe(Se(t,void 0,void 0,function(o){s=Ee(n(o,Lt(n)(e))),r?(r.unsubscribe(),r=null,s.subscribe(t)):i=!0})),i&&(r.unsubscribe(),r=null,s.subscribe(t))})}function md(n){return fe(function(e,t){try{e.subscribe(t)}finally{t.add(n)}})}function yd(){return fe(function(n,e){n.subscribe(Se(e,function(t){e.next(_n.createNext(t))},function(){e.next(_n.createComplete()),e.complete()},function(t){e.next(_n.createError(t)),e.complete()}))})}function Gt(n){n===void 0&&(n={});var e=n.connector,t=e===void 0?function(){return new st}:e,r=n.resetOnError,i=r===void 0?!0:r,s=n.resetOnComplete,o=s===void 0?!0:s,a=n.resetOnRefCountZero,l=a===void 0?!0:a;return function(c){var f,h,u,d=0,p=!1,b=!1,m=function(){h==null||h.unsubscribe(),h=void 0},v=function(){m(),f=u=void 0,p=b=!1},w=function(){var S=f;v(),S==null||S.unsubscribe()};return fe(function(S,T){d++,!b&&!p&&m();var O=u=u??t();T.add(function(){d--,d===0&&!b&&!p&&(h=Sn(w,l))}),O.subscribe(T),!f&&d>0&&(f=new _t({next:function(L){return O.next(L)},error:function(L){b=!0,m(),h=Sn(v,i,L),O.error(L)},complete:function(){p=!0,m(),h=Sn(v,o),O.complete()}}),Ee(S).subscribe(f))})(c)}}function Sn(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];if(e===!0){n();return}if(e!==!1){var i=new _t({next:function(){i.unsubscribe(),n()}});return Ee(e.apply(void 0,wt([],bt(t)))).subscribe(i)}}function gd(n,e,t){var r,i,s,o,a=!1;return n&&typeof n=="object"?(r=n.bufferSize,o=r===void 0?1/0:r,i=n.windowTime,e=i===void 0?1/0:i,s=n.refCount,a=s===void 0?!1:s,t=n.scheduler):o=n??1/0,Gt({connector:function(){return new Bf(o,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}function Jt(n,e,t){var r=W(n)||e||t?{next:n,error:e,complete:t}:n;return r?fe(function(i,s){var o;(o=r.subscribe)===null||o===void 0||o.call(r);var a=!0;i.subscribe(Se(s,function(l){var c;(c=r.next)===null||c===void 0||c.call(r,l),s.next(l)},function(){var l;a=!1,(l=r.complete)===null||l===void 0||l.call(r),s.complete()},function(l){var c;a=!1,(c=r.error)===null||c===void 0||c.call(r,l),s.error(l)},function(){var l,c;a&&((l=r.unsubscribe)===null||l===void 0||l.call(r)),(c=r.finalize)===null||c===void 0||c.call(r)}))}):yr}const vd=!1;function be(n){try{return n()}catch{}}const Gn=be(()=>globalThis)||be(()=>window)||be(()=>self)||be(()=>global)||be(function(){return be.constructor("return this")()}),gr="4.0.4",li=new Map;function As(n){const e=li.get(n)||1;return li.set(n,e+1),`${n}:${e}:${Math.random().toString(36).slice(2)}`}function bd(n,e=0){const t=As("stringifyForDisplay");return JSON.stringify(n,(r,i)=>i===void 0?t:i,e).split(JSON.stringify(t)).join("<undefined>")}const ci="Invariant Violation";class vr extends Error{constructor(e=ci){super(e),this.name=ci,Object.setPrototypeOf(this,vr.prototype)}}const Fs=["debug","log","warn","error","silent"];let wd=Fs.indexOf("silent");function M(n,...e){if(!n)throw se(...e)}function an(n){return function(e,...t){if(Fs.indexOf(n)>=wd){const r=console[n]||console.log;if(typeof e=="number"){const i=e;e=Is(i),e||(e=Ns(i,t),t=[])}r(e,...t)}}}M.debug=an("debug");M.log=an("log");M.warn=an("warn");M.error=an("error");function se(n,...e){return new vr(Is(n,e)||Ns(n,e))}const ui=Symbol.for("ApolloErrorMessageHandler_"+gr);function Jn(n){if(typeof n=="string")return n;try{return bd(n,2).slice(0,1e3)}catch{return"<non-serializable>"}}function Is(n,e=[]){if(n)return Gn[ui]&&Gn[ui](n,e.map(Jn))}function Ns(n,e=[]){if(n)return typeof n=="string"?e.reduce((t,r)=>t.replace(/%[sdfo]/,Jn(r)),n):`An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#${encodeURIComponent(JSON.stringify({version:gr,message:n,args:e.map(Jn)}))}`}function Ke(n,e,t,r){if(t.kind===R.INT||t.kind===R.FLOAT)n[e.value]=Number(t.value);else if(t.kind===R.BOOLEAN||t.kind===R.STRING)n[e.value]=t.value;else if(t.kind===R.OBJECT){const i={};t.fields.map(s=>Ke(i,s.name,s.value,r)),n[e.value]=i}else if(t.kind===R.VARIABLE){const i=(r||{})[t.name.value];n[e.value]=i}else if(t.kind===R.LIST)n[e.value]=t.values.map(i=>{const s={};return Ke(s,e,i,r),s[e.value]});else if(t.kind===R.ENUM)n[e.value]=t.value;else if(t.kind===R.NULL)n[e.value]=null;else throw se(19,e.value,t.kind)}function br(n,e){if(n.arguments&&n.arguments.length){const t={};return n.arguments.forEach(({name:r,value:i})=>Ke(t,r,i,e)),t}return null}function _d(){}class Kn{constructor(e=1/0,t=_d){this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}get size(){return this.map.size}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:r,newer:i}=t;i&&(i.older=r),r&&(r.newer=i),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=i)}return t}set(e,t){let r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(e){const t=this.map.get(e);return t?(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0):!1}}function Xn(){}const kd=Xn,Sd=typeof WeakRef<"u"?WeakRef:function(n){return{deref:()=>n}},Cd=typeof WeakMap<"u"?WeakMap:Map,Ed=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:Xn,unregister:Xn}},Td=10024;class kt{constructor(e=1/0,t=kd){this.max=e,this.dispose=t,this.map=new Cd,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const r=this.unfinalizedNodes.values();for(let i=0;i<Td;i++){const s=r.next().value;if(!s)break;this.unfinalizedNodes.delete(s);const o=s.key;delete s.key,s.keyRef=new Sd(o),this.registry.register(o,s,s)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new Ed(this.deleteNode.bind(this))}has(e){return this.map.has(e)}get(e){const t=this.getNode(e);return t&&t.value}getNode(e){const t=this.map.get(e);if(t&&t!==this.newest){const{older:r,newer:i}=t;i&&(i.older=r),r&&(r.newer=i),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=i)}return t}set(e,t){let r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.scheduleFinalization(r),this.map.set(e,r),this.size++,r.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(e){e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.size--;const t=e.key||e.keyRef&&e.keyRef.deref();this.dispose(e.value,t),e.keyRef?this.registry.unregister(e):this.unfinalizedNodes.delete(e),t&&this.map.delete(t)}delete(e){const t=this.map.get(e);return t?(this.deleteNode(t),!0):!1}scheduleFinalization(e){this.unfinalizedNodes.add(e),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}const Od=()=>Object.create(null),{forEach:Dd,slice:fi}=Array.prototype,{hasOwnProperty:Pd}=Object.prototype;class Te{constructor(e=!0,t=Od){this.weakness=e,this.makeData=t}lookup(){return this.lookupArray(arguments)}lookupArray(e){let t=this;return Dd.call(e,r=>t=t.getChildTrie(r)),Pd.call(t,"data")?t.data:t.data=this.makeData(fi.call(e))}peek(){return this.peekArray(arguments)}peekArray(e){let t=this;for(let r=0,i=e.length;t&&r<i;++r){const s=t.mapFor(e[r],!1);t=s&&s.get(e[r])}return t&&t.data}remove(){return this.removeArray(arguments)}removeArray(e){let t;if(e.length){const r=e[0],i=this.mapFor(r,!1),s=i&&i.get(r);s&&(t=s.removeArray(fi.call(e,1)),!s.data&&!s.weak&&!(s.strong&&s.strong.size)&&i.delete(r))}else t=this.data,delete this.data;return t}getChildTrie(e){const t=this.mapFor(e,!0);let r=t.get(e);return r||t.set(e,r=new Te(this.weakness,this.makeData)),r}mapFor(e,t){return this.weakness&&xd(e)?this.weak||(t?this.weak=new WeakMap:void 0):this.strong||(t?this.strong=new Map:void 0)}}function xd(n){switch(typeof n){case"object":if(n===null)break;case"function":return!0}return!1}let Z=null;const di={};let Ad=1;const Fd=()=>class{constructor(){this.id=["slot",Ad++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=Z;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===di)break;return e!==Z&&(Z.slots[this.id]=t),!0}return Z&&(Z.slots[this.id]=di),!1}getValue(){if(this.hasValue())return Z.slots[this.id]}withValue(e,t,r,i){const s={__proto__:null,[this.id]:e},o=Z;Z={parent:o,slots:s};try{return t.apply(i,r)}finally{Z=o}}static bind(e){const t=Z;return function(){const r=Z;try{return Z=t,e.apply(this,arguments)}finally{Z=r}}}static noContext(e,t,r){if(Z){const i=Z;try{return Z=null,e.apply(r,t)}finally{Z=i}}else return e.apply(r,t)}};function hi(n){try{return n()}catch{}}const Cn="@wry/context:Slot",Id=hi(()=>globalThis)||hi(()=>global)||Object.create(null),pi=Id,wr=pi[Cn]||Array[Cn]||function(n){try{Object.defineProperty(pi,Cn,{value:n,enumerable:!1,writable:!1,configurable:!0})}finally{return n}}(Fd()),ln=new wr,{hasOwnProperty:Nd}=Object.prototype,_r=Array.from||function(n){const e=[];return n.forEach(t=>e.push(t)),e};function Kt(n){const{unsubscribe:e}=n;typeof e=="function"&&(n.unsubscribe=void 0,e())}const St=[],Vd=100;function Xe(n,e){if(!n)throw new Error(e||"assertion failure")}function Vs(n,e){const t=n.length;return t>0&&t===e.length&&n[t-1]===e[t-1]}function Ms(n){switch(n.length){case 0:throw new Error("unknown value");case 1:return n[0];case 2:throw n[1]}}function Rs(n){return n.slice(0)}class cn{constructor(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++cn.count}peek(){if(this.value.length===1&&!Ce(this))return mi(this),this.value[0]}recompute(e){return Xe(!this.recomputing,"already recomputing"),mi(this),Ce(this)?Md(this,e):Ms(this.value)}setDirty(){this.dirty||(this.dirty=!0,js(this),Kt(this))}dispose(){this.setDirty(),Us(this),kr(this,(e,t)=>{e.setDirty(),zs(e,this)})}forget(){this.dispose()}dependOn(e){e.add(this),this.deps||(this.deps=St.pop()||new Set),this.deps.add(e)}forgetDeps(){this.deps&&(_r(this.deps).forEach(e=>e.delete(this)),this.deps.clear(),St.push(this.deps),this.deps=null)}}cn.count=0;function mi(n){const e=ln.getValue();if(e)return n.parents.add(e),e.childValues.has(n)||e.childValues.set(n,[]),Ce(n)?qs(e,n):$s(e,n),e}function Md(n,e){return Us(n),ln.withValue(n,Rd,[n,e]),Ld(n,e)&&jd(n),Ms(n.value)}function Rd(n,e){n.recomputing=!0;const{normalizeResult:t}=n;let r;t&&n.value.length===1&&(r=Rs(n.value)),n.value.length=0;try{if(n.value[0]=n.fn.apply(null,e),t&&r&&!Vs(r,n.value))try{n.value[0]=t(n.value[0],r[0])}catch{}}catch(i){n.value[1]=i}n.recomputing=!1}function Ce(n){return n.dirty||!!(n.dirtyChildren&&n.dirtyChildren.size)}function jd(n){n.dirty=!1,!Ce(n)&&Ls(n)}function js(n){kr(n,qs)}function Ls(n){kr(n,$s)}function kr(n,e){const t=n.parents.size;if(t){const r=_r(n.parents);for(let i=0;i<t;++i)e(r[i],n)}}function qs(n,e){Xe(n.childValues.has(e)),Xe(Ce(e));const t=!Ce(n);if(!n.dirtyChildren)n.dirtyChildren=St.pop()||new Set;else if(n.dirtyChildren.has(e))return;n.dirtyChildren.add(e),t&&js(n)}function $s(n,e){Xe(n.childValues.has(e)),Xe(!Ce(e));const t=n.childValues.get(e);t.length===0?n.childValues.set(e,Rs(e.value)):Vs(t,e.value)||n.setDirty(),Hs(n,e),!Ce(n)&&Ls(n)}function Hs(n,e){const t=n.dirtyChildren;t&&(t.delete(e),t.size===0&&(St.length<Vd&&St.push(t),n.dirtyChildren=null))}function Us(n){n.childValues.size>0&&n.childValues.forEach((e,t)=>{zs(n,t)}),n.forgetDeps(),Xe(n.dirtyChildren===null)}function zs(n,e){e.parents.delete(n),n.childValues.delete(e),Hs(n,e)}function Ld(n,e){if(typeof n.subscribe=="function")try{Kt(n),n.unsubscribe=n.subscribe.apply(null,e)}catch{return n.setDirty(),!1}return!0}const qd={setDirty:!0,dispose:!0,forget:!0};function Ws(n){const e=new Map,t=n&&n.subscribe;function r(i){const s=ln.getValue();if(s){let o=e.get(i);o||e.set(i,o=new Set),s.dependOn(o),typeof t=="function"&&(Kt(o),o.unsubscribe=t(i))}}return r.dirty=function(s,o){const a=e.get(s);if(a){const l=o&&Nd.call(qd,o)?o:"setDirty";_r(a).forEach(c=>c[l]()),e.delete(s),Kt(a)}},r}let yi;function $d(...n){return(yi||(yi=new Te(typeof WeakMap=="function"))).lookupArray(n)}const En=new Set;function Ze(n,{max:e=Math.pow(2,16),keyArgs:t,makeCacheKey:r=$d,normalizeResult:i,subscribe:s,cache:o=Kn}=Object.create(null)){const a=typeof o=="function"?new o(e,u=>u.dispose()):o,l=function(){const u=r.apply(null,t?t.apply(null,arguments):arguments);if(u===void 0)return n.apply(null,arguments);let d=a.get(u);d||(a.set(u,d=new cn(n)),d.normalizeResult=i,d.subscribe=s,d.forget=()=>a.delete(u));const p=d.recompute(Array.prototype.slice.call(arguments));return a.set(u,d),En.add(a),ln.hasValue()||(En.forEach(b=>b.clean()),En.clear()),p};Object.defineProperty(l,"size",{get:()=>a.size,configurable:!1,enumerable:!1}),Object.freeze(l.options={max:e,keyArgs:t,makeCacheKey:r,normalizeResult:i,subscribe:s,cache:a});function c(u){const d=u&&a.get(u);d&&d.setDirty()}l.dirtyKey=c,l.dirty=function(){c(r.apply(null,arguments))};function f(u){const d=u&&a.get(u);if(d)return d.peek()}l.peekKey=f,l.peek=function(){return f(r.apply(null,arguments))};function h(u){return u?a.delete(u):!1}return l.forgetKey=h,l.forget=function(){return h(r.apply(null,arguments))},l.makeCacheKey=r,l.getKey=t?function(){return r.apply(null,t.apply(null,arguments))}:r,Object.freeze(l)}const Hd=Symbol.for("apollo.cacheSize"),he={...Gn[Hd]};function et(n,e){var t;return((t=n.definitions.find(r=>r.kind==="OperationDefinition"&&!!r.name))==null?void 0:t.name.value)??e}const _e=Ze((n,e)=>{M(n&&n.kind==="Document",1);const t=n.definitions.filter(r=>r.kind==="OperationDefinition");e&&M(t.length==1&&t[0].operation===e,4,e,e,t[0].operation),ue(n,{Field(r,i,s,o){var a;if(r.alias&&(r.alias.value==="__typename"||r.alias.value.startsWith("__ac_"))&&r.alias.value!==r.name.value){let l=n,c=[];for(const f of o)l=l[f],l.kind===R.FIELD&&c.push(((a=l.alias)==null?void 0:a.value)||l.name.value);throw c.splice(-1,1,r.name.value),se(5,r.alias.value,c.join("."),t[0].operation,et(n,"(anonymous)"))}}})},{max:he.checkDocument||2e3,cache:kt});function ie(...n){const e={};return n.forEach(t=>{t&&Object.keys(t).forEach(r=>{const i=t[r];i!==void 0&&(e[r]=i)})}),e}function Ot(n=[]){const e={};return n.forEach(t=>{e[t.name.value]=t}),e}function ne(n){return n!==null&&typeof n=="object"}const{hasOwnProperty:Ud}=Object.prototype,zd=function(n,e,t){return this.merge(n[t],e[t])};class tt{constructor(e=zd){g(this,"reconciler");g(this,"isObject",ne);g(this,"pastCopies",new Set);this.reconciler=e}merge(e,t,...r){return ne(t)&&ne(e)?(Object.keys(t).forEach(i=>{if(Ud.call(e,i)){const s=e[i];if(t[i]!==s){const o=this.reconciler(e,t,i,...r);o!==s&&(e=this.shallowCopyForMerge(e),e[i]=o)}}else e=this.shallowCopyForMerge(e),e[i]=t[i]}),e):t}shallowCopyForMerge(e){return ne(e)&&(this.pastCopies.has(e)||(Array.isArray(e)?e=e.slice(0):e={__proto__:Object.getPrototypeOf(e),...e},this.pastCopies.add(e))),e}}function Sr(n){const e={},t=n&&n.variableDefinitions;return t&&t.length&&t.forEach(r=>{r.defaultValue&&Ke(e,r.variable.name,r.defaultValue)}),e}function un(n,e){switch(n.kind){case"InlineFragment":return n;case"FragmentSpread":{const t=n.name.value;if(typeof e=="function")return e(t);const r=e&&e[t];return M(r,9,t),r||null}default:return null}}function Wd(n,e){let t=e;const r=[];return n.definitions.forEach(s=>{if(s.kind==="OperationDefinition")throw se(10,s.operation,s.name?` named '${s.name.value}'`:"");s.kind==="FragmentDefinition"&&r.push(s)}),typeof t>"u"&&(M(r.length===1,11,r.length),t=r[0].name.value),{...n,definitions:[{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:t}}]}},...n.definitions]}}function Bd(n){M(n.kind==="Document",6),M(n.definitions.length<=1,7);const e=n.definitions[0];return M(e.kind==="FragmentDefinition",8),e}function Dt(n){return n.definitions.filter(e=>e.kind==="FragmentDefinition")}function Bs(n){_e(n);let e;for(let t of n.definitions){if(t.kind==="OperationDefinition")return t;t.kind==="FragmentDefinition"&&!e&&(e=t)}if(e)return e;throw se(12)}function pe(n){return _e(n),n.definitions.filter(e=>e.kind==="OperationDefinition")[0]}function Qd(n){const e=pe(n);return M(e&&e.operation==="query",13),e}const Tn=new WeakSet;function Qs(n){n.size<=(n.max||-1)||Tn.has(n)||(Tn.add(n),setTimeout(()=>{n.clean(),Tn.delete(n)},100))}const Ys=function(n,e){const t=new kt(n,e);return t.set=function(r,i){const s=kt.prototype.set.call(this,r,i);return Qs(this),s},t},Yd=function(n,e){const t=new Kn(n,e);return t.set=function(r,i){const s=Kn.prototype.set.call(this,r,i);return Qs(this),s},t},ke=Object.assign(function(e){return JSON.stringify(e,Gd)},{reset(){ft=new Yd(he.canonicalStringify||1e3)}});let ft;ke.reset();function Gd(n,e){if(e&&typeof e=="object"){const t=Object.getPrototypeOf(e);if(t===Object.prototype||t===null){const r=Object.keys(e);if(r.every(Jd))return e;const i=JSON.stringify(r);let s=ft.get(i);if(!s){r.sort();const a=JSON.stringify(r);s=ft.get(a)||r,ft.set(i,s),ft.set(a,s)}const o=Object.create(t);return s.forEach(a=>{o[a]=e[a]}),o}}return e}function Jd(n,e,t){return e===0||t[e-1]<=n}const Kd=["connection","include","skip","client","rest","export","nonreactive"];let ct=ke;const Gs=Object.assign(function(n,e,t){if(e&&t&&t.connection&&t.connection.key){if(t.connection.filter&&t.connection.filter.length>0){const i=t.connection.filter?t.connection.filter:[];i.sort();const s={};i.forEach(a=>{s[a]=e[a]});const o=ct(s);if(o!=="{}")return`${t.connection.key}(${o})`}return t.connection.key}let r=n;if(e){const i=ct(e);i!=="{}"&&(r+=`(${i})`)}return t&&Object.keys(t).forEach(i=>{Kd.indexOf(i)===-1&&(t[i]&&Object.keys(t[i]).length?r+=`@${i}(${ct(t[i])})`:r+=`@${i}`)}),r},{setStringify(n){const e=ct;return ct=n,e}});function He(n){var e;return!!((e=n.errors)!=null&&e.length)}function dt(n,e,t){const r=new Set(n),i=r.size;return ue(e,{Directive(s){if(r.delete(s.name.value)&&(!t||!r.size))return dr}}),t?!r.size:r.size<i}function Xd(n){let e=!1;return ue(n,{Directive:{enter(t){if(t.name.value==="client"&&t.arguments&&(e=t.arguments.some(r=>r.name.value==="always"&&r.value.kind==="BooleanValue"&&r.value.value===!0),e))return dr}}}),e}const Y=Array.isArray;function Zd(n){return ne(n)&&n.kind==="Document"&&Array.isArray(n.definitions)}function Pt(n){return n.kind==="Field"}function Cr(n){return Array.isArray(n)&&n.length>0}function Be(n){return{__ref:String(n)}}function eh(n){let e=n[0]||{};const t=n.length;if(t>1){const r=new tt;for(let i=1;i<t;++i)e=r.merge(e,n[i])}return e}function On(n,e){return ie(n,e,e.variables&&{variables:ie({...n&&n.variables,...e.variables})})}function th(n){return n.catch(()=>{}),n}function nh(n,e){_e(e);const t=gi(""),r=gi(""),i=m=>{for(let v=0,w;v<m.length&&(w=m[v]);++v)if(!Y(w)){if(w.kind===R.OPERATION_DEFINITION)return t(w.name&&w.name.value);if(w.kind===R.FRAGMENT_DEFINITION)return r(w.name.value)}return M.error(14),null};let s=0;for(let m=e.definitions.length-1;m>=0;--m)e.definitions[m].kind===R.OPERATION_DEFINITION&&++s;const o=rh(n),a=m=>Cr(m)&&m.map(o).some(v=>v&&v.remove),l=new Map;let c=!1;const f={enter(m){if(a(m.directives))return c=!0,null}},h=ue(e,{Field:f,InlineFragment:f,VariableDefinition:{enter(){return!1}},Variable:{enter(m,v,w,S,T){const O=i(T);O&&O.variables.add(m.name.value)}},FragmentSpread:{enter(m,v,w,S,T){if(a(m.directives))return c=!0,null;const O=i(T);O&&O.fragmentSpreads.add(m.name.value)}},FragmentDefinition:{enter(m,v,w,S){l.set(JSON.stringify(S),m)},leave(m,v,w,S){const T=l.get(JSON.stringify(S));if(m===T)return m;if(s>0&&m.selectionSet.selections.every(O=>O.kind===R.FIELD&&O.name.value==="__typename"))return r(m.name.value).removed=!0,c=!0,null}},Directive:{leave(m){if(o(m))return c=!0,null}}});if(!c)return e;const u=m=>(m.transitiveVars||(m.transitiveVars=new Set(m.variables),m.removed||m.fragmentSpreads.forEach(v=>{u(r(v)).transitiveVars.forEach(w=>{m.transitiveVars.add(w)})})),m),d=new Set;h.definitions.forEach(m=>{m.kind===R.OPERATION_DEFINITION?u(t(m.name&&m.name.value)).fragmentSpreads.forEach(v=>{d.add(v)}):m.kind===R.FRAGMENT_DEFINITION&&s===0&&!r(m.name.value).removed&&d.add(m.name.value)}),d.forEach(m=>{u(r(m)).fragmentSpreads.forEach(v=>{d.add(v)})});const p=m=>!!(!d.has(m)||r(m).removed),b={enter(m){if(p(m.name.value))return null}};return ih(ue(h,{FragmentSpread:b,FragmentDefinition:b,OperationDefinition:{leave(m){if(m.variableDefinitions){const v=u(t(m.name&&m.name.value)).transitiveVars;if(v.size<m.variableDefinitions.length)return{...m,variableDefinitions:m.variableDefinitions.filter(w=>v.has(w.variable.name.value))}}}}}))}function gi(n){const e=new Map;return function(r=n){let i=e.get(r);return i||e.set(r,i={variables:new Set,fragmentSpreads:new Set}),i}}function rh(n){const e=new Map,t=new Map;return n.forEach(r=>{r&&(r.name?e.set(r.name,r):r.test&&t.set(r.test,r))}),r=>{let i=e.get(r.name.value);return!i&&t.size&&t.forEach((s,o)=>{o(r)&&(i=s)}),i}}function Js(n,e){return!n||n.selectionSet.selections.every(t=>t.kind===R.FRAGMENT_SPREAD&&Js(e[t.name.value],e))}function ih(n){return Js(pe(n)||Bd(n),Ot(Dt(n)))?null:n}function sh(n){return ue(n,{FragmentSpread(e){var t;if(!((t=e.directives)!=null&&t.some(({name:r})=>r.value==="unmask")))return null}})}function ot(n){return n.alias?n.alias.value:n.name.value}function fn({directives:n},e){return!n||!n.length?!0:ah(n).every(({directive:t,ifArgument:r})=>{let i=!1;return r.value.kind==="Variable"?(i=e&&e[r.value.name.value],M(i!==void 0,15,t.name.value)):i=r.value.value,t.name.value==="skip"?!i:i})}function oh({name:{value:n}}){return n==="skip"||n==="include"}function ah(n){const e=[];return n&&n.length&&n.forEach(t=>{if(!oh(t))return;const r=t.arguments,i=t.name.value;M(r&&r.length===1,16,i);const s=r[0];M(s.name&&s.name.value==="if",17,i);const o=s.value;M(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),18,i),e.push({directive:t,ifArgument:s})}),e}function lh(n,e){let t=null;n.directives&&(t={},n.directives.forEach(i=>{t[i.name.value]={},i.arguments&&i.arguments.forEach(({name:s,value:o})=>Ke(t[i.name.value],s,o,e))}));let r=null;return n.arguments&&n.arguments.length&&(r={},n.arguments.forEach(({name:i,value:s})=>Ke(r,i,s,e))),Gs(n.name.value,r,t)}function qt(n){const e={data:n.data};return n.error&&(e.error=n.error),e}function Zn(n,e=()=>{}){return t=>new B(r=>{let i=e();return t.subscribe({next(s){let o;try{o=n(s,i)}catch(a){r.error(a)}o!==void 0&&r.next(o)},error(s){r.error(s)},complete(){r.complete()}})})}const{toString:vi,hasOwnProperty:ch}=Object.prototype,bi=Function.prototype.toString,er=new Map;function Q(n,e){try{return tr(n,e)}finally{er.clear()}}function tr(n,e){if(n===e)return!0;const t=vi.call(n),r=vi.call(e);if(t!==r)return!1;switch(t){case"[object Array]":if(n.length!==e.length)return!1;case"[object Object]":{if(_i(n,e))return!0;const i=wi(n),s=wi(e),o=i.length;if(o!==s.length)return!1;for(let a=0;a<o;++a)if(!ch.call(e,i[a]))return!1;for(let a=0;a<o;++a){const l=i[a];if(!tr(n[l],e[l]))return!1}return!0}case"[object Error]":return n.name===e.name&&n.message===e.message;case"[object Number]":if(n!==n)return e!==e;case"[object Boolean]":case"[object Date]":return+n==+e;case"[object RegExp]":case"[object String]":return n==`${e}`;case"[object Map]":case"[object Set]":{if(n.size!==e.size)return!1;if(_i(n,e))return!0;const i=n.entries(),s=t==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[a,l]=o.value;if(!e.has(a)||s&&!tr(l,e.get(a)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":n=new Uint8Array(n),e=new Uint8Array(e);case"[object DataView]":{let i=n.byteLength;if(i===e.byteLength)for(;i--&&n[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=bi.call(n);return i!==bi.call(e)?!1:!dh(i,fh)}}return!1}function wi(n){return Object.keys(n).filter(uh,n)}function uh(n){return this[n]!==void 0}const fh="{ [native code] }";function dh(n,e){const t=n.length-e.length;return t>=0&&n.indexOf(e,t)===t}function _i(n,e){let t=er.get(n);if(t){if(t.has(e))return!0}else er.set(n,t=new Set);return t.add(e),!1}function Ks(n,{data:e,...t},{data:r,...i},s){return Q(t,i)&&$t(Bs(n).selectionSet,e,r,{fragmentMap:Ot(Dt(n)),variables:s})}function $t(n,e,t,r){if(e===t)return!0;const i=new Set;return n.selections.every(s=>{if(i.has(s)||(i.add(s),!fn(s,r.variables))||ki(s))return!0;if(Pt(s)){const o=ot(s),a=e&&e[o],l=t&&t[o],c=s.selectionSet;if(!c)return Q(a,l);const f=Array.isArray(a),h=Array.isArray(l);if(f!==h)return!1;if(f&&h){const u=a.length;if(l.length!==u)return!1;for(let d=0;d<u;++d)if(!$t(c,a[d],l[d],r))return!1;return!0}return $t(c,a,l,r)}else{const o=un(s,r.fragmentMap);if(o)return ki(o)?!0:$t(o.selectionSet,e,t,r)}})}function ki(n){return!!n.directives&&n.directives.some(hh)}function hh(n){return n.name.value==="nonreactive"}class ph{constructor(){g(this,"startRequest")}isIncrementalResult(e){return!1}prepareRequest(e){return M(!dt(["defer"],e.query),64),e}extractErrors(){}}function mh(n,{client:e}){const t={query:n.query,variables:n.variables||{},extensions:n.extensions||{},operationName:et(n.query),operationType:pe(n.query).operation};let r={...n.context};const i=o=>{typeof o=="function"?r={...r,...o(s())}:r={...r,...o}},s=()=>Object.freeze({...r});return Object.defineProperty(t,"setContext",{enumerable:!1,value:i}),Object.defineProperty(t,"getContext",{enumerable:!1,value:s}),Object.defineProperty(t,"client",{enumerable:!1,value:e}),t}function yh(n,e){const t={...n},r=new Set(Object.keys(n));return ue(e,{Variable(i,s,o){o&&o.kind!=="VariableDefinition"&&r.delete(i.name.value)}}),r.forEach(i=>{delete t[i]}),t}class te{constructor(e){g(this,"left");g(this,"right");e&&(this.request=e)}static empty(){return new te(()=>Yt)}static from(e){if(e.length===0)return te.empty();const[t,...r]=e;return t.concat(...r)}static split(e,t,r=new te((i,s)=>s(i))){const i=new te((s,o)=>e(s)?t.request(s,o):r.request(s,o));return Object.assign(i,{left:t,right:r})}static execute(e,t,r){return e.request(mh(t,r),()=>Yt)}static concat(...e){return te.from(e)}split(e,t,r){return this.concat(te.split(e,t,r))}concat(...e){return e.length===0?this:e.reduce(this.combine.bind(this),this)}combine(e,t){const r=new te((i,s)=>e.request(i,o=>t.request(o,s)));return Object.assign(r,{left:e,right:t})}request(e,t){throw se(63)}}const nr=te.execute;function gh(n){return n}class de{constructor(e,t={}){g(this,"transform");g(this,"cached");g(this,"resultCache",new WeakSet);g(this,"left");g(this,"right");this.transform=e,t.getCacheKey&&(this.getCacheKey=t.getCacheKey),this.cached=t.cache!==!1,this.resetCache()}getCacheKey(e){return[e]}static identity(){return new de(gh,{cache:!1})}static split(e,t,r=de.identity()){return Object.assign(new de(i=>(e(i)?t:r).transformDocument(i),{cache:!1}),{left:t,right:r})}resetCache(){if(this.cached){const e=new Te;this.performWork=Ze(de.prototype.performWork.bind(this),{makeCacheKey:t=>{const r=this.getCacheKey(t);if(r)return M(Array.isArray(r),20),e.lookupArray(r)},max:he["documentTransform.cache"],cache:kt})}}performWork(e){return _e(e),this.transform(e)}transformDocument(e){if(this.resultCache.has(e))return e;const t=this.performWork(e);return this.resultCache.add(t),t}concat(e){return Object.assign(new de(t=>e.transformDocument(this.transformDocument(t)),{cache:!1}),{left:this,right:e})}}let Dn;const Qe=Object.assign(n=>{let e=Dn.get(n);return e||(e=Pf(n),Dn.set(n,e)),e},{reset(){Dn=new Ys(he.print||2e3)}});Qe.reset();function H(n){return!!(n&&typeof n=="object"&&typeof n.__ref=="string")}const Si={kind:R.FIELD,name:{kind:R.NAME,value:"__typename"}},Xs=Object.assign(function(n){return ue(n,{SelectionSet:{enter(e,t,r){if(r&&r.kind===R.OPERATION_DEFINITION)return;const{selections:i}=e;if(!i||i.some(a=>a.kind===R.FIELD&&(a.name.value==="__typename"||a.name.value.lastIndexOf("__",0)===0)))return;const o=r;if(!(o.kind===R.FIELD&&o.directives&&o.directives.some(a=>a.name.value==="export")))return{...e,selections:[...i,Si]}}}})},{added(n){return n===Si}});function Zs(n,e){var t;return((t=pe(n))==null?void 0:t.operation)===e}function vh(n){return Zs(n,"mutation")}function bh(n){return Zs(n,"subscription")}function wh(n){return n===7||n===8}function rr(n){return!wh(n)}class _h{constructor(){g(this,"assumeImmutableResults",!1);g(this,"getFragmentDoc",Ze(Wd,{max:he["cache.fragmentQueryDocuments"]||1e3,cache:kt}))}lookupFragment(e){return null}batch(e){const t=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0;let r;return this.performTransaction(()=>r=e.update(this),t),r}recordOptimisticTransaction(e,t){this.performTransaction(e,t)}transformDocument(e){return e}transformForLink(e){return e}identify(e){}gc(){return[]}modify(e){return!1}readQuery(e,t=!!e.optimistic){return this.read({...e,rootId:e.id||"ROOT_QUERY",optimistic:t})}watchFragment(e){const{fragment:t,fragmentName:r,from:i,optimistic:s=!0,...o}=e,a=this.getFragmentDoc(t,r),l=typeof i>"u"||typeof i=="string"?i:this.identify(i),c={...o,returnPartialData:!0,id:l,query:a,optimistic:s};let f;return new B(h=>this.watch({...c,immediate:!0,callback:u=>{let d=u.result;if(d===null&&(d={}),f&&Ks(a,{data:f.result},{data:d},e.variables))return;const p={data:d,dataState:u.complete?"complete":"partial",complete:!!u.complete};u.missing&&(p.missing=u.missing.missing),f={...u,result:d},h.next(p)}}))}readFragment(e,t=!!e.optimistic){return this.read({...e,query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t})}writeQuery({id:e,data:t,...r}){return this.write(Object.assign(r,{dataId:e||"ROOT_QUERY",result:t}))}writeFragment({id:e,data:t,fragment:r,fragmentName:i,...s}){return this.write(Object.assign(s,{query:this.getFragmentDoc(r,i),dataId:e,result:t}))}updateQuery(e,t){return this.batch({update(r){const i=r.readQuery(e),s=t(i);return s==null?i:(r.writeQuery({...e,data:s}),s)}})}updateFragment(e,t){return this.batch({update(r){const i=r.readFragment(e),s=t(i);return s==null?i:(r.writeFragment({...e,data:s}),s)}})}}class Er extends Error{constructor(t,r,i,s){super(t);g(this,"message");g(this,"path");g(this,"query");g(this,"variables");g(this,"missing");if(this.message=t,this.path=r,this.query=i,this.variables=s,this.name="MissingFieldError",Array.isArray(this.path)){this.missing=this.message;for(let o=this.path.length-1;o>=0;--o)this.missing={[this.path[o]]:this.missing}}else this.missing=this.path;this.__proto__=Er.prototype}}const{hasOwnProperty:J}=Object.prototype;function eo({__typename:n,id:e,_id:t},r){if(typeof n=="string"&&(r&&(r.keyObject=e!=null?{id:e}:t!=null?{_id:t}:void 0),e==null&&t!=null&&(e=t),e!=null))return`${n}:${typeof e=="number"||typeof e=="string"?e:JSON.stringify(e)}`}const kh={dataIdFromObject:eo,resultCaching:!0};function Sh(n){return ie(kh,n)}const to=/^[_a-z][_0-9a-z]*/i;function nt(n){const e=n.match(to);return e?e[0]:n}function ir(n,e,t){return ne(e)?Y(e)?e.every(r=>ir(n,r,t)):n.selections.every(r=>{if(Pt(r)&&fn(r,t)){const i=ot(r);return J.call(e,i)&&(!r.selectionSet||ir(r.selectionSet,e[i],t))}return!0}):!1}function Ue(n){return ne(n)&&!H(n)&&!Y(n)}function Ch(){return new tt}function no(n,e){const t=Ot(Dt(n));return{fragmentMap:t,lookupFragment(r){let i=t[r];return!i&&e&&(i=e.lookup(r)),i||null}}}const Ht={},Pn=()=>Ht,Ci={};class dn{constructor(e,t){g(this,"policies");g(this,"group");g(this,"data",{});g(this,"rootIds",{});g(this,"refs",{});g(this,"getFieldValue",(e,t)=>H(e)?this.get(e.__ref,t):e&&e[t]);g(this,"canRead",e=>H(e)?this.has(e.__ref):typeof e=="object");g(this,"toReference",(e,t)=>{if(typeof e=="string")return Be(e);if(H(e))return e;const[r]=this.policies.identify(e);if(r){const i=Be(r);return t&&this.merge(r,e),i}});this.policies=e,this.group=t}toObject(){return{...this.data}}has(e){return this.lookup(e,!0)!==void 0}get(e,t){if(this.group.depend(e,t),J.call(this.data,e)){const r=this.data[e];if(r&&J.call(r,t))return r[t]}if(t==="__typename"&&J.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof ce)return this.parent.get(e,t)}lookup(e,t){if(t&&this.group.depend(e,"__exists"),J.call(this.data,e))return this.data[e];if(this instanceof ce)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return{}}merge(e,t){let r;H(e)&&(e=e.__ref),H(t)&&(t=t.__ref);const i=typeof e=="string"?this.lookup(r=e):e,s=typeof t=="string"?this.lookup(r=t):t;if(!s)return;M(typeof r=="string",95);const o=new tt(Oh).merge(i,s);if(this.data[r]=o,o!==i&&(delete this.refs[r],this.group.caching)){const a={};i||(a.__exists=1),Object.keys(s).forEach(l=>{if(!i||i[l]!==o[l]){a[l]=1;const c=nt(l);c!==l&&!this.policies.hasKeyArgs(o.__typename,c)&&(a[c]=1),o[l]===void 0&&!(this instanceof ce)&&delete o[l]}}),a.__typename&&!(i&&i.__typename)&&this.policies.rootTypenamesById[r]===o.__typename&&delete a.__typename,Object.keys(a).forEach(l=>this.group.dirty(r,l))}}modify(e,t,r){const i=this.lookup(e);if(i){const s={};let o=!1,a=!0;const l={DELETE:Ht,INVALIDATE:Ci,isReference:H,toReference:this.toReference,canRead:this.canRead,readField:(c,f)=>this.policies.readField(typeof c=="string"?{fieldName:c,from:f||Be(e)}:c,{store:this})};if(Object.keys(i).forEach(c=>{const f=nt(c);let h=i[c];if(h===void 0)return;const u=typeof t=="function"?t:t[c]||(r?void 0:t[f]);if(u){let d=u===Pn?Ht:u(h,{...l,fieldName:f,storeFieldName:c,storage:this.getStorage(e,c)});d===Ci?this.group.dirty(e,c):(d===Ht&&(d=void 0),d!==h&&(s[c]=d,o=!0,h=d))}h!==void 0&&(a=!1)}),o)return this.merge(e,s),a&&(this instanceof ce?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1}delete(e,t,r){const i=this.lookup(e);if(i){const s=this.getFieldValue(i,"__typename"),o=t&&r?this.policies.getStoreFieldName({typename:s,fieldName:t,args:r}):t;return this.modify(e,o?{[o]:Pn}:Pn,!!r)}return!1}evict(e,t){let r=!1;return e.id&&(J.call(this.data,e.id)&&(r=this.delete(e.id,e.fieldName,e.args)),this instanceof ce&&this!==t&&(r=this.parent.evict(e,t)||r),(e.fieldName||r)&&this.group.dirty(e.id,e.fieldName||"__exists")),r}clear(){this.replace(null)}extract(){const e=this.toObject(),t=[];return this.getRootIdSet().forEach(r=>{J.call(this.policies.rootTypenamesById,r)||t.push(r)}),t.length&&(e.__META={extraRootIds:t.sort()}),e}replace(e){if(Object.keys(this.data).forEach(t=>{e&&J.call(e,t)||this.delete(t)}),e){const{__META:t,...r}=e;Object.keys(r).forEach(i=>{this.merge(i,r[i])}),t&&t.extraRootIds.forEach(this.retain,this)}}retain(e){return this.rootIds[e]=(this.rootIds[e]||0)+1}release(e){if(this.rootIds[e]>0){const t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0}getRootIdSet(e=new Set){return Object.keys(this.rootIds).forEach(e.add,e),this instanceof ce?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e}gc(){const e=this.getRootIdSet(),t=this.toObject();e.forEach(i=>{J.call(t,i)&&(Object.keys(this.findChildRefIds(i)).forEach(e.add,e),delete t[i])});const r=Object.keys(t);if(r.length){let i=this;for(;i instanceof ce;)i=i.parent;r.forEach(s=>i.delete(s))}return r}findChildRefIds(e){if(!J.call(this.refs,e)){const t=this.refs[e]={},r=this.data[e];if(!r)return t;const i=new Set([r]);i.forEach(s=>{H(s)&&(t[s.__ref]=!0),ne(s)&&Object.keys(s).forEach(o=>{const a=s[o];ne(a)&&i.add(a)})})}return this.refs[e]}makeCacheKey(){return this.group.keyMaker.lookupArray(arguments)}get supportsResultCaching(){return this.group.caching}}class ro{constructor(e,t=null){g(this,"caching");g(this,"parent");g(this,"d",null);g(this,"keyMaker");this.caching=e,this.parent=t,this.resetCaching()}resetCaching(){this.d=this.caching?Ws():null,this.keyMaker=new Te}depend(e,t){if(this.d){this.d(xn(e,t));const r=nt(t);r!==t&&this.d(xn(e,r)),this.parent&&this.parent.depend(e,t)}}dirty(e,t){this.d&&this.d.dirty(xn(e,t),t==="__exists"?"forget":"setDirty")}}function xn(n,e){return e+"#"+n}function Ei(n,e){pt(n)&&n.group.depend(e,"__exists")}class Eh extends dn{constructor({policies:t,resultCaching:r=!0,seed:i}){super(t,new ro(r));g(this,"stump",new Th(this));g(this,"storageTrie",new Te);i&&this.replace(i)}addLayer(t,r){return this.stump.addLayer(t,r)}removeLayer(){return this}getStorage(){return this.storageTrie.lookupArray(arguments)}}dn.Root=Eh;class ce extends dn{constructor(t,r,i,s){super(r.policies,s);g(this,"id");g(this,"parent");g(this,"replay");g(this,"group");this.id=t,this.parent=r,this.replay=i,this.group=s,i(this)}addLayer(t,r){return new ce(t,this,r,this.group)}removeLayer(t){const r=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach(i=>{const s=this.data[i],o=r.lookup(i);o?s?s!==o&&Object.keys(s).forEach(a=>{Q(s[a],o[a])||this.group.dirty(i,a)}):(this.group.dirty(i,"__exists"),Object.keys(o).forEach(a=>{this.group.dirty(i,a)})):this.delete(i)}),r):r===this.parent?this:r.addLayer(this.id,this.replay)}toObject(){return{...this.parent.toObject(),...this.data}}findChildRefIds(t){const r=this.parent.findChildRefIds(t);return J.call(this.data,t)?{...r,...super.findChildRefIds(t)}:r}getStorage(...t){let r=this.parent;for(;r.parent;)r=r.parent;return r.getStorage(...t)}}class Th extends ce{constructor(e){super("EntityStore.Stump",e,()=>{},new ro(e.group.caching,e.group))}removeLayer(){return this}merge(e,t){return this.parent.merge(e,t)}}function Oh(n,e,t){const r=n[t],i=e[t];return Q(r,i)?r:i}function pt(n){return!!(n&&n.supportsResultCaching)}const io=new wr;function Dh(n){var r,i;const e=(r=n.directives)==null?void 0:r.find(({name:s})=>s.value==="unmask");if(!e)return"mask";const t=(i=e.arguments)==null?void 0:i.find(({name:s})=>s.value==="mode");return t&&"value"in t.value&&t.value.value==="migrate"?"migrate":"unmask"}function so(n,e,t){return io.withValue(!0,()=>ht(n,e,t,!1))}function Ph(n,e){if(e.has(n))return e.get(n);const t=Array.isArray(n)?[]:{};return e.set(n,t),t}function ht(n,e,t,r,i){const{knownChanged:s}=t,o=Ph(n,t.mutableTargets);if(Array.isArray(n)){for(const[a,l]of Array.from(n.entries())){if(l===null){o[a]=null;continue}const c=ht(l,e,t,r);s.has(c)&&s.add(o),o[a]=c}return s.has(o)?o:n}for(const a of e.selections){let l;if(r&&s.add(o),a.kind===R.FIELD){const c=ot(a),f=a.selectionSet;if(l=o[c]||n[c],l===void 0)continue;if(f&&l!==null){const h=ht(n[c],f,t,r);s.has(h)&&(l=h)}o[c]=l}if(a.kind===R.INLINE_FRAGMENT&&(!a.typeCondition||t.cache.fragmentMatches(a,n.__typename))&&(l=ht(n,a.selectionSet,t,r)),a.kind===R.FRAGMENT_SPREAD){const c=a.name.value,f=t.fragmentMap[c]||(t.fragmentMap[c]=t.cache.lookupFragment(c));M(f,39,c);const h=Dh(a);h!=="mask"&&(l=ht(n,f.selectionSet,t,h==="migrate"))}s.has(l)&&s.add(o)}return"__typename"in n&&!("__typename"in o)&&(o.__typename=n.__typename),Object.keys(o).length!==Object.keys(n).length&&s.add(o),s.has(o)?o:n}function xh(n,e,t,r){const i=e.definitions.filter(o=>o.kind===R.FRAGMENT_DEFINITION);typeof r>"u"&&(M(i.length===1,41,i.length),r=i[0].name.value);const s=i.find(o=>o.name.value===r);return M(!!s,42,r),n==null||Q(n,{})?n:so(n,s.selectionSet,{operationType:"fragment",operationName:s.name.value,fragmentMap:Ot(Dt(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}function Ah(n,e,t){var i;const r=pe(e);return M(r,43),n==null?n:so(n,r.selectionSet,{operationType:r.operation,operationName:(i=r.name)==null?void 0:i.value,fragmentMap:Ot(Dt(e)),cache:t,mutableTargets:new WeakMap,knownChanged:new WeakSet})}const Ti={};function Tr(n){const e=JSON.stringify(n);return Ti[e]||(Ti[e]={})}function Oi(n){const e=Tr(n);return e.keyFieldsFn||(e.keyFieldsFn=(t,r)=>{const i=(o,a)=>r.readField(a,o),s=r.keyObject=Or(n,o=>{let a=Ye(r.storeObject,o,i);return a===void 0&&t!==r.storeObject&&J.call(t,o[0])&&(a=Ye(t,o,ao)),M(a!==void 0,98,o.join("."),t),a});return`${r.typename}:${JSON.stringify(s)}`})}function Di(n){const e=Tr(n);return e.keyArgsFn||(e.keyArgsFn=(t,{field:r,variables:i,fieldName:s})=>{const o=Or(n,l=>{const c=l[0],f=c.charAt(0);if(f==="@"){if(r&&Cr(r.directives)){const h=c.slice(1),u=r.directives.find(p=>p.name.value===h),d=u&&br(u,i);return d&&Ye(d,l.slice(1))}return}if(f==="$"){const h=c.slice(1);if(i&&J.call(i,h)){const u=l.slice(0);return u[0]=h,Ye(i,u)}return}if(t)return Ye(t,l)}),a=JSON.stringify(o);return(t||a!=="{}")&&(s+=":"+a),s})}function Or(n,e){const t=new tt;return oo(n).reduce((r,i)=>{let s=e(i);if(s!==void 0){for(let o=i.length-1;o>=0;--o)s={[i[o]]:s};r=t.merge(r,s)}return r},{})}function oo(n){const e=Tr(n);if(!e.paths){const t=e.paths=[],r=[];n.forEach((i,s)=>{Y(i)?(oo(i).forEach(o=>t.push(r.concat(o))),r.length=0):(r.push(i),Y(n[s+1])||(t.push(r.slice(0)),r.length=0))})}return e.paths}function ao(n,e){return n[e]}function Ye(n,e,t){return t=t||ao,lo(e.reduce(function r(i,s){return Y(i)?i.map(o=>r(o,s)):i&&t(i,s)},n))}function lo(n){return ne(n)?Y(n)?n.map(lo):Or(Object.keys(n).sort(),e=>Ye(n,e)):n}const co=new wr,Pi=new WeakMap;function mt(n){let e=Pi.get(n);return e||Pi.set(n,e={vars:new Set,dep:Ws()}),e}function xi(n){mt(n).vars.forEach(e=>e.forgetCache(n))}function Fh(n){mt(n).vars.forEach(e=>e.attachCache(n))}function Ih(n){const e=new Set,t=new Set,r=function(s){if(arguments.length>0){if(n!==s){n=s,e.forEach(a=>{mt(a).dep.dirty(r),Nh(a)});const o=Array.from(t);t.clear(),o.forEach(a=>a(n))}}else{const o=co.getValue();o&&(i(o),mt(o).dep(r))}return n};r.onNextChange=s=>(t.add(s),()=>{t.delete(s)});const i=r.attachCache=s=>(e.add(s),mt(s).vars.add(r),r);return r.forgetCache=s=>e.delete(s),r}function Nh(n){n.broadcastWatches&&n.broadcastWatches()}function sr(n){return n.args!==void 0?n.args:n.field?br(n.field,n.variables):null}const Vh=()=>{},Ai=(n,e)=>e.fieldName,Fi=(n,e,{mergeObjects:t})=>t(n,e),Ii=(n,e)=>e;class Mh{constructor(e){g(this,"config");g(this,"typePolicies",{});g(this,"toBeAdded",{});g(this,"supertypeMap",new Map);g(this,"fuzzySubtypes",new Map);g(this,"cache");g(this,"rootIdsByTypename",{});g(this,"rootTypenamesById",{});g(this,"usingPossibleTypes",!1);this.config=e,this.config={dataIdFromObject:eo,...e},this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}identify(e,t){var f;const r=this,i=t&&(t.typename||((f=t.storeObject)==null?void 0:f.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];const s=t&&t.storeObject||e,o={...t,typename:i,storeObject:s,readField:t&&t.readField||((...h)=>{const u=Dr(h,s);return r.readField(u,{store:r.cache.data,variables:u.variables})})};let a;const l=i&&this.getTypePolicy(i);let c=l&&l.keyFn||this.config.dataIdFromObject;return io.withValue(!0,()=>{for(;c;){const h=c({...e,...s},o);if(Y(h))c=Oi(h);else{a=h;break}}}),a=a?String(a):void 0,o.keyObject?[a,o.keyObject]:[a]}addTypePolicies(e){Object.keys(e).forEach(t=>{const{queryType:r,mutationType:i,subscriptionType:s,...o}=e[t];r&&this.setRootTypename("Query",t),i&&this.setRootTypename("Mutation",t),s&&this.setRootTypename("Subscription",t),J.call(this.toBeAdded,t)?this.toBeAdded[t].push(o):this.toBeAdded[t]=[o]})}updateTypePolicy(e,t,r){const i=this.getTypePolicy(e),{keyFields:s,fields:o}=t;function a(l,c){l.merge=typeof c=="function"?c:c===!0?Fi:c===!1?Ii:l.merge}a(i,t.merge),i.keyFn=s===!1?Vh:Y(s)?Oi(s):typeof s=="function"?s:i.keyFn,o&&Object.keys(o).forEach(l=>{let c=r[l];(!c||(c==null?void 0:c.typename)!==e)&&(c=r[l]={typename:e});const f=o[l];if(typeof f=="function")c.read=f;else{const{keyArgs:h,read:u,merge:d}=f;c.keyFn=h===!1?Ai:Y(h)?Di(h):typeof h=="function"?h:c.keyFn,typeof u=="function"&&(c.read=u),a(c,d)}c.read&&c.merge&&(c.keyFn=c.keyFn||Ai)})}setRootTypename(e,t=e){const r="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[r];t!==i&&(M(!i||i===e,99,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)}addPossibleTypes(e){this.usingPossibleTypes=!0,Object.keys(e).forEach(t=>{this.getSupertypeSet(t,!0),e[t].forEach(r=>{this.getSupertypeSet(r,!0).add(t);const i=r.match(to);(!i||i[0]!==r)&&this.fuzzySubtypes.set(r,new RegExp(r))})})}getTypePolicy(e){if(!J.call(this.typePolicies,e)){const r=this.typePolicies[e]={};r.fields={};let i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach((s,o)=>{if(s.test(e)){const a=this.supertypeMap.get(o);a&&a.forEach(l=>i.add(l))}})),i&&i.size&&i.forEach(s=>{const{fields:o,...a}=this.getTypePolicy(s);Object.assign(r,a),Object.assign(r.fields,o)})}const t=this.toBeAdded[e];return t&&t.length&&t.splice(0).forEach(r=>{this.updateTypePolicy(e,r,this.typePolicies[e].fields)}),this.typePolicies[e]}getFieldPolicy(e,t){if(e)return this.getTypePolicy(e).fields[t]}getSupertypeSet(e,t){let r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r}fragmentMatches(e,t,r,i){if(!e.typeCondition)return!0;if(!t)return!1;const s=e.typeCondition.name.value;if(t===s)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(s)){const o=this.getSupertypeSet(t,!0),a=[o],l=f=>{const h=this.getSupertypeSet(f,!1);h&&h.size&&a.indexOf(h)<0&&a.push(h)};let c=!!(r&&this.fuzzySubtypes.size);for(let f=0;f<a.length;++f){const h=a[f];if(h.has(s))return o.has(s)||o.add(s),!0;h.forEach(l),c&&f===a.length-1&&ir(e.selectionSet,r,i)&&(c=!1,this.fuzzySubtypes.forEach((u,d)=>{const p=t.match(u);p&&p[0]===t&&l(d)}))}}return!1}hasKeyArgs(e,t){const r=this.getFieldPolicy(e,t);return!!(r&&r.keyFn)}getStoreFieldName(e){const{typename:t,fieldName:r}=e,i=this.getFieldPolicy(t,r);let s,o=i&&i.keyFn;if(o&&t){const a={typename:t,fieldName:r,field:e.field||null,variables:e.variables},l=sr(e);for(;o;){const c=o(l,a);if(Y(c))o=Di(c);else{s=c||r;break}}}return s===void 0&&(s=e.field?lh(e.field,e.variables):Gs(r,sr(e))),s===!1?r:r===nt(s)?s:r+":"+s}readField(e,t){const r=e.from;if(!r||!(e.field||e.fieldName))return;if(e.typename===void 0){const f=t.store.getFieldValue(r,"__typename");f&&(e.typename=f)}const s=this.getStoreFieldName(e),o=nt(s),a=t.store.getFieldValue(r,s),l=this.getFieldPolicy(e.typename,o),c=l&&l.read;if(c){const f=Ni(this,r,e,t,t.store.getStorage(H(r)?r.__ref:r,s));return co.withValue(this.cache,c,[a,f])}return a}getReadFunction(e,t){const r=this.getFieldPolicy(e,t);return r&&r.read}getMergeFunction(e,t,r){let i=this.getFieldPolicy(e,t),s=i&&i.merge;return!s&&r&&(i=this.getTypePolicy(r),s=i&&i.merge),s}runMergeFunction(e,t,{field:r,typename:i,merge:s},o,a){return s===Fi?uo(o.store)(e,t):s===Ii?t:(o.overwrite&&(e=void 0),s(e,t,Ni(this,void 0,{typename:i,fieldName:r.name.value,field:r,variables:o.variables},o,a||{})))}}function Ni(n,e,t,r,i){const s=n.getStoreFieldName(t),o=nt(s),a=t.variables||r.variables,{toReference:l,canRead:c}=r.store;return{args:sr(t),field:t.field||null,fieldName:o,storeFieldName:s,variables:a,isReference:H,toReference:l,storage:i,cache:n.cache,canRead:c,readField(...f){return n.readField(Dr(f,e,a),r)},mergeObjects:uo(r.store)}}function Dr(n,e,t){const{0:r,1:i,length:s}=n;let o;return typeof r=="string"?o={fieldName:r,from:s>1?i:e}:(o={...r},J.call(o,"from")||(o.from=e)),o.variables===void 0&&(o.variables=t),o}function uo(n){return function(t,r){if(Y(t)||Y(r))throw se(102);if(ne(t)&&ne(r)){const i=n.getFieldValue(t,"__typename"),s=n.getFieldValue(r,"__typename");if(i&&s&&i!==s)return r;if(H(t)&&Ue(r))return n.merge(t.__ref,r),t;if(Ue(t)&&H(r))return n.merge(t,r.__ref),r;if(Ue(t)&&Ue(r))return{...t,...r}}return r}}function Vi(n){return[n.selectionSet,n.objectOrReference,n.context]}class Rh{constructor(e){g(this,"executeSelectionSet");g(this,"executeSubSelectedArray");g(this,"config");g(this,"knownResults",new WeakMap);this.config=e,this.executeSelectionSet=Ze(t=>{const r=Vi(t),i=this.executeSelectionSet.peek(...r);return i||(Ei(t.context.store,t.enclosingRef.__ref),this.execSelectionSetImpl(t))},{max:he["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Vi,makeCacheKey(t,r,i){if(pt(i.store))return i.store.makeCacheKey(t,H(r)?r.__ref:r,i.varString)}}),this.executeSubSelectedArray=Ze(t=>(Ei(t.context.store,t.enclosingRef.__ref),this.execSubSelectedArrayImpl(t)),{max:he["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey({field:t,array:r,context:i}){if(pt(i.store))return i.store.makeCacheKey(t,r,i.varString)}})}diffQueryAgainstStore({store:e,query:t,rootId:r="ROOT_QUERY",variables:i,returnPartialData:s=!0}){const o=this.config.cache.policies;i={...Sr(Qd(t)),...i};const a=Be(r),l=this.executeSelectionSet({selectionSet:Bs(t).selectionSet,objectOrReference:a,enclosingRef:a,context:{store:e,query:t,policies:o,variables:i,varString:ke(i),...no(t,this.config.fragments)}});let c;l.missing&&(c=new Er(jh(l.missing),l.missing,t,i));const f=!c,{result:h}=l;return{result:f||s?Object.keys(h).length===0?null:h:null,complete:f,missing:c}}isFresh(e,t,r,i){if(pt(i.store)&&this.knownResults.get(e)===r){const s=this.executeSelectionSet.peek(r,t,i);if(s&&e===s.result)return!0}return!1}execSelectionSetImpl({selectionSet:e,objectOrReference:t,enclosingRef:r,context:i}){if(H(t)&&!i.policies.rootTypenamesById[t.__ref]&&!i.store.has(t.__ref))return{result:{},missing:`Dangling reference to missing ${t.__ref} object`};const{variables:s,policies:o,store:a}=i,l=a.getFieldValue(t,"__typename"),c=[];let f;const h=new tt;typeof l=="string"&&!o.rootIdsByTypename[l]&&c.push({__typename:l});function u(v,w){return v.missing&&(f=h.merge(f,{[w]:v.missing})),v.result}const d=new Set(e.selections);d.forEach(v=>{if(fn(v,s))if(Pt(v)){let w=o.readField({fieldName:v.name.value,field:v,variables:i.variables,from:t},i);const S=ot(v);w===void 0?Xs.added(v)||(f=h.merge(f,{[S]:`Can't find field '${v.name.value}' on ${H(t)?t.__ref+" object":"object "+JSON.stringify(t,null,2)}`})):Y(w)?w.length>0&&(w=u(this.executeSubSelectedArray({field:v,array:w,enclosingRef:r,context:i}),S)):v.selectionSet&&w!=null&&(w=u(this.executeSelectionSet({selectionSet:v.selectionSet,objectOrReference:w,enclosingRef:H(w)?w:r,context:i}),S)),w!==void 0&&c.push({[S]:w})}else{const w=un(v,i.lookupFragment);if(!w&&v.kind===R.FRAGMENT_SPREAD)throw se(103,v.name.value);w&&o.fragmentMatches(w,l)&&w.selectionSet.selections.forEach(d.add,d)}});const b={result:eh(c),missing:f},m=b;return m.result&&this.knownResults.set(m.result,e),m}execSubSelectedArrayImpl({field:e,array:t,enclosingRef:r,context:i}){let s,o=new tt;function a(l,c){return l.missing&&(s=o.merge(s,{[c]:l.missing})),l.result}return e.selectionSet&&(t=t.filter(i.store.canRead)),t=t.map((l,c)=>l===null?null:Y(l)?a(this.executeSubSelectedArray({field:e,array:l,enclosingRef:r,context:i}),c):e.selectionSet?a(this.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:l,enclosingRef:H(l)?l:r,context:i}),c):l),{result:t,missing:s}}}function jh(n){try{JSON.stringify(n,(e,t)=>{if(typeof t=="string")throw t;return t})}catch(e){return e}}function An(n,e,t){const r=`${e}${t}`;let i=n.flavors.get(r);return i||n.flavors.set(r,i=n.clientOnly===e&&n.deferred===t?n:{...n,clientOnly:e,deferred:t}),i}class Lh{constructor(e,t,r){g(this,"cache");g(this,"reader");g(this,"fragments");this.cache=e,this.reader=t,this.fragments=r}writeToStore(e,{query:t,result:r,dataId:i,variables:s,overwrite:o}){const a=pe(t),l=Ch();s={...Sr(a),...s};const c={store:e,written:{},merge(h,u){return l.merge(h,u)},variables:s,varString:ke(s),...no(t,this.fragments),overwrite:!!o,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map},f=this.processSelectionSet({result:r||{},dataId:i,selectionSet:a.selectionSet,mergeTree:{map:new Map},context:c});if(!H(f))throw se(105,r);return c.incomingById.forEach(({storeObject:h,mergeTree:u,fieldNodeSet:d},p)=>{const b=Be(p);if(u&&u.map.size){const m=this.applyMerges(u,b,h,c);if(H(m))return;h=m}e.merge(p,h)}),e.retain(f.__ref),f}processSelectionSet({dataId:e,result:t,selectionSet:r,context:i,mergeTree:s}){const{policies:o}=this.cache;let a={};const l=e&&o.rootTypenamesById[e]||ar(t,r,i.fragmentMap)||e&&i.store.get(e,"__typename");typeof l=="string"&&(a.__typename=l);const c=(...h)=>{const u=Dr(h,a,i.variables);if(H(u.from)){const d=i.incomingById.get(u.from.__ref);if(d){const p=o.readField({...u,from:d.storeObject},i);if(p!==void 0)return p}}return o.readField(u,i)},f=new Set;this.flattenFields(r,t,i,l).forEach((h,u)=>{const d=ot(u),p=t[d];if(f.add(u),p!==void 0){const b=o.getStoreFieldName({typename:l,fieldName:u.name.value,field:u,variables:h.variables}),m=Mi(s,b);let v=this.processFieldValue(p,u,u.selectionSet?An(h,!1,!1):h,m),w;u.selectionSet&&(H(v)||Ue(v))&&(w=c("__typename",v));const S=o.getMergeFunction(l,u.name.value,w);S?m.info={field:u,typename:l,merge:S}:Ri(s,b),a=h.merge(a,{[b]:v})}});try{const[h,u]=o.identify(t,{typename:l,selectionSet:r,fragmentMap:i.fragmentMap,storeObject:a,readField:c});e=e||h,u&&(a=i.merge(a,u))}catch(h){if(!e)throw h}if(typeof e=="string"){const h=Be(e),u=i.written[e]||(i.written[e]=[]);if(u.indexOf(r)>=0||(u.push(r),this.reader&&this.reader.isFresh(t,h,r,i)))return h;const d=i.incomingById.get(e);return d?(d.storeObject=i.merge(d.storeObject,a),d.mergeTree=or(d.mergeTree,s),f.forEach(p=>d.fieldNodeSet.add(p))):i.incomingById.set(e,{storeObject:a,mergeTree:Xt(s)?void 0:s,fieldNodeSet:f}),h}return a}processFieldValue(e,t,r,i){return!t.selectionSet||e===null?e:Y(e)?e.map((s,o)=>{const a=this.processFieldValue(s,t,r,Mi(i,o));return Ri(i,o),a}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:i})}flattenFields(e,t,r,i=ar(t,e,r.fragmentMap)){const s=new Map,{policies:o}=this.cache,a=new Te(!1);return function l(c,f){const h=a.lookup(c,f.clientOnly,f.deferred);h.visited||(h.visited=!0,c.selections.forEach(u=>{if(!fn(u,r.variables))return;let{clientOnly:d,deferred:p}=f;if(!(d&&p)&&Cr(u.directives)&&u.directives.forEach(b=>{const m=b.name.value;if(m==="client"&&(d=!0),m==="defer"){const v=br(b,r.variables);(!v||v.if!==!1)&&(p=!0)}}),Pt(u)){const b=s.get(u);b&&(d=d&&b.clientOnly,p=p&&b.deferred),s.set(u,An(r,d,p))}else{const b=un(u,r.lookupFragment);if(!b&&u.kind===R.FRAGMENT_SPREAD)throw se(107,u.name.value);b&&o.fragmentMatches(b,i,t,r.variables)&&l(b.selectionSet,An(r,d,p))}}))}(e,r),s}applyMerges(e,t,r,i,s){if(e.map.size&&!H(r)){const o=!Y(r)&&(H(t)||Ue(t))?t:void 0,a=r;o&&!s&&(s=[H(o)?o.__ref:o]);let l;const c=(f,h)=>Y(f)?typeof h=="number"?f[h]:void 0:i.store.getFieldValue(f,String(h));e.map.forEach((f,h)=>{const u=c(o,h),d=c(a,h);if(d===void 0)return;s&&s.push(h);const p=this.applyMerges(f,u,d,i,s);p!==d&&(l=l||new Map,l.set(h,p)),s&&M(s.pop()===h)}),l&&(r=Y(a)?a.slice(0):{...a},l.forEach((f,h)=>{r[h]=f}))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,i,s&&i.store.getStorage(...s)):r}}const fo=[];function Mi({map:n},e){return n.has(e)||n.set(e,fo.pop()||{map:new Map}),n.get(e)}function or(n,e){if(n===e||!e||Xt(e))return n;if(!n||Xt(n))return e;const t=n.info&&e.info?{...n.info,...e.info}:n.info||e.info,r=n.map.size&&e.map.size,i=r?new Map:n.map.size?n.map:e.map,s={info:t,map:i};if(r){const o=new Set(e.map.keys());n.map.forEach((a,l)=>{s.map.set(l,or(a,e.map.get(l))),o.delete(l)}),o.forEach(a=>{s.map.set(a,or(e.map.get(a),n.map.get(a)))})}return s}function Xt(n){return!n||!(n.info||n.map.size)}function Ri({map:n},e){const t=n.get(e);t&&Xt(t)&&(fo.push(t),n.delete(e))}function ar(n,e,t){let r;for(const i of e.selections)if(Pt(i)){if(i.name.value==="__typename")return n[ot(i)]}else r?r.push(i):r=[i];if(typeof n.__typename=="string")return n.__typename;if(r)for(const i of r){const s=ar(n,un(i,t).selectionSet,t);if(typeof s=="string")return s}}class qh extends _h{constructor(t={}){super();g(this,"data");g(this,"optimisticData");g(this,"config");g(this,"watches",new Set);g(this,"storeReader");g(this,"storeWriter");g(this,"addTypenameTransform",new de(Xs));g(this,"maybeBroadcastWatch");g(this,"assumeImmutableResults",!0);g(this,"policies");g(this,"makeVar",Ih);g(this,"txCount",0);this.config=Sh(t),this.policies=new Mh({cache:this,dataIdFromObject:this.config.dataIdFromObject,possibleTypes:this.config.possibleTypes,typePolicies:this.config.typePolicies}),this.init()}init(){const t=this.data=new dn.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()}resetResultCache(){const{fragments:t}=this.config;this.addTypenameTransform.resetCache(),t==null||t.resetCaches(),this.storeWriter=new Lh(this,this.storeReader=new Rh({cache:this,fragments:t}),t),this.maybeBroadcastWatch=Ze((r,i)=>this.broadcastWatch(r,i),{max:he["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:r=>{const i=r.optimistic?this.optimisticData:this.data;if(pt(i)){const{optimistic:s,id:o,variables:a}=r;return i.makeCacheKey(r.query,r.callback,ke({optimistic:s,id:o,variables:a}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(r=>r.resetCaching())}restore(t){return this.init(),t&&this.data.replace(t),this}extract(t=!1){return(t?this.optimisticData:this.data).extract()}read(t){const{returnPartialData:r=!1}=t;return this.storeReader.diffQueryAgainstStore({...t,store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r}).result}write(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}}modify(t){if(J.call(t,"id")&&!t.id)return!1;const r=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,r.modify(t.id||"ROOT_QUERY",t.fields,!1)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}}diff(t){return this.storeReader.diffQueryAgainstStore({...t,store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config})}watch(t){return this.watches.size||Fh(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),()=>{this.watches.delete(t)&&!this.watches.size&&xi(this),this.maybeBroadcastWatch.forget(t)}}gc(t){ke.reset(),Qe.reset();const r=this.optimisticData.gc();return t&&!this.txCount&&t.resetResultCache&&this.resetResultCache(),r}retain(t,r){return(r?this.optimisticData:this.data).retain(t)}release(t,r){return(r?this.optimisticData:this.data).release(t)}identify(t){if(H(t))return t.__ref;try{return this.policies.identify(t)[0]}catch{}}evict(t){if(!t.id){if(J.call(t,"id"))return!1;t={...t,id:"ROOT_QUERY"}}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}}reset(t){return this.init(),ke.reset(),t&&t.discardWatches?(this.watches.forEach(r=>this.maybeBroadcastWatch.forget(r)),this.watches.clear(),xi(this)):this.broadcastWatches(),Promise.resolve()}removeOptimistic(t){const r=this.optimisticData.removeLayer(t);r!==this.optimisticData&&(this.optimisticData=r,this.broadcastWatches())}batch(t){const{update:r,optimistic:i=!0,removeOptimistic:s,onWatchUpdated:o}=t;let a;const l=f=>{const{data:h,optimisticData:u}=this;++this.txCount,f&&(this.data=this.optimisticData=f);try{return a=r(this)}finally{--this.txCount,this.data=h,this.optimisticData=u}},c=new Set;return o&&!this.txCount&&this.broadcastWatches({...t,onWatchUpdated(f){return c.add(f),!1}}),typeof i=="string"?this.optimisticData=this.optimisticData.addLayer(i,l):i===!1?l(this.data):l(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),o&&c.size?(this.broadcastWatches({...t,onWatchUpdated(f,h){const u=o.call(this,f,h);return u!==!1&&c.delete(f),u}}),c.size&&c.forEach(f=>this.maybeBroadcastWatch.dirty(f))):this.broadcastWatches(t),a}performTransaction(t,r){return this.batch({update:t,optimistic:r||r!==null})}transformDocument(t){return this.addTypenameTransform.transformDocument(this.addFragmentsToDocument(t))}fragmentMatches(t,r){return this.policies.fragmentMatches(t,r)}lookupFragment(t){var r;return((r=this.config.fragments)==null?void 0:r.lookup(t))||null}broadcastWatches(t){this.txCount||this.watches.forEach(r=>this.maybeBroadcastWatch(r,t))}addFragmentsToDocument(t){const{fragments:r}=this.config;return r?r.transform(t):t}broadcastWatch(t,r){const{lastDiff:i}=t,s=this.diff(t);r&&(t.optimistic&&typeof r.optimistic=="string"&&(s.fromOptimisticTransaction=!0),r.onWatchUpdated&&r.onWatchUpdated.call(this,t,s,i)===!1)||(!i||!Q(i.result,s.result))&&t.callback(t.lastDiff=s,i)}}function xt(n,e){return typeof n=="object"&&n!==null&&n[Symbol.for("apollo.error")]===e}function At(n){Object.defineProperty(n,Symbol.for("apollo.error"),{value:n.name,enumerable:!1,writable:!1,configurable:!1})}function ji(n){return n.map(e=>e.message||"Error message not found.").join(`
`)}const yt=class yt extends Error{constructor(t){super(yt.formatMessage(t,{defaultFormatMessage:ji}));g(this,"errors");this.name="CombinedProtocolErrors",this.errors=t,At(this),Object.setPrototypeOf(this,yt.prototype)}static is(t){return xt(t,"CombinedProtocolErrors")}};g(yt,"formatMessage",ji);let Zt=yt;function $h(n){return n!==null&&typeof n=="object"&&typeof n.message=="string"&&typeof n.name=="string"&&(typeof n.stack=="string"||typeof n.stack>"u")}class Pr extends Error{static is(e){return xt(e,"UnconventionalError")}constructor(e){super("An error of unexpected shape occurred.",{cause:e}),this.name="UnconventionalError",At(this),Object.setPrototypeOf(this,Pr.prototype)}}function Li(n){return n.filter(e=>e).map(e=>e.message||"Error message not found.").join(`
`)}const gt=class gt extends Error{constructor(t,r=t.errors||[]){super(gt.formatMessage(r,{result:t,defaultFormatMessage:Li}));g(this,"errors");g(this,"data");g(this,"extensions");this.errors=r,this.data=t.data,this.extensions=t.extensions,this.name="CombinedGraphQLErrors",At(this),Object.setPrototypeOf(this,gt.prototype)}static is(t){return xt(t,"CombinedGraphQLErrors")}};g(gt,"formatMessage",Li);let xe=gt;const Hh=new WeakSet;function Uh(n){Hh.add(n)}class hn extends Error{constructor(t,r){super(t);g(this,"response");g(this,"statusCode");g(this,"bodyText");this.name="ServerError",this.response=r.response,this.statusCode=r.response.status,this.bodyText=r.bodyText,At(this),Object.setPrototypeOf(this,hn.prototype)}static is(t){return xt(t,"ServerError")}}class pn extends Error{constructor(t,r){super(t instanceof Error?t.message:"Could not parse server response",{cause:t});g(this,"response");g(this,"statusCode");g(this,"bodyText");this.name="ServerParseError",this.response=r.response,this.statusCode=r.response.status,this.bodyText=r.bodyText,At(this),Object.setPrototypeOf(this,pn.prototype)}static is(t){return xt(t,"ServerParseError")}}const en=Symbol();function zh(n){return"extensions"in n?Zt.is(n.extensions[en]):!1}function Wh(n){return $h(n)?n:typeof n=="string"?new Error(n,{cause:n}):new Pr(n)}var N;(function(n){n[n.loading=1]="loading",n[n.setVariables=2]="setVariables",n[n.fetchMore=3]="fetchMore",n[n.refetch=4]="refetch",n[n.poll=6]="poll",n[n.ready=7]="ready",n[n.error=8]="error",n[n.streaming=9]="streaming"})(N||(N={}));const{assign:qi,hasOwnProperty:Np}=Object,qe={loading:!0,networkStatus:N.loading,data:void 0,dataState:"empty",partial:!0},Fn={loading:!1,networkStatus:N.ready,data:void 0,dataState:"empty",partial:!0};var Ep;class In{constructor({queryManager:e,options:t,transformedQuery:r=e.transform(t.query)}){g(this,"options");g(this,"queryName");g(this,"_lastWrite");g(this,"unsubscribeFromCache");g(this,"input");g(this,"subject");g(this,"isTornDown");g(this,"queryManager");g(this,"subscriptions",new Set);g(this,"waitForNetworkResult");g(this,"lastQuery");g(this,"linkSubscription");g(this,"pollingInfo");g(this,"subscribe");g(this,"pipe");g(this,Ep);g(this,"@@observable");g(this,"stableLastResult");g(this,"didWarnCacheOnlyPolling",!1);g(this,"dirty",!1);g(this,"notifyTimeout");g(this,"activeOperations",new Set);g(this,"operator",Zn(e=>{const{query:t,variables:r,meta:i}=e;if(e.source==="setResult")return{query:t,variables:r,result:e.value,meta:i};if(e.kind==="C"||!ut(e,this))return;let s;const o=this.subject.getValue();if(e.source==="cache"){if(s=e.value,s.networkStatus===N.ready&&s.partial&&(!this.options.returnPartialData||o.result.networkStatus===N.error)&&this.options.fetchPolicy!=="cache-only")return}else if(e.source==="network")this.waitForNetworkResult&&(this.waitForNetworkResult=!1,this.resubscribeCache()),s=e.kind==="E"?{...ut(o,e)?o.result:{data:void 0,dataState:"empty",partial:!0},error:e.error,networkStatus:N.error,loading:!1}:e.value,e.kind==="E"&&s.dataState==="streaming"&&(s.dataState="complete"),s.error&&(i.shouldEmit=1);else if(e.source==="newNetworkStatus"){const a=ut(o,e)?o.result:this.getInitialResult(i.fetchPolicy),{resetError:l}=e.value,c=l?void 0:a.error,f=c?N.error:N.ready;s={...a,error:c,networkStatus:f}}return M(s),s.error||delete s.error,s.networkStatus=this.calculateNetworkStatus(s.networkStatus),s.loading=rr(s.networkStatus),s=this.maskResult(s),{query:t,variables:r,result:s,meta:i}}));this.queryManager=e,this.waitForNetworkResult=t.fetchPolicy==="network-only",this.isTornDown=!1,this.subscribeToMore=this.subscribeToMore.bind(this),this.maskResult=this.maskResult.bind(this);const{watchQuery:{fetchPolicy:i="cache-first"}={}}=e.defaultOptions,{fetchPolicy:s=i,initialFetchPolicy:o=s==="standby"?i:s}=t;this.lastQuery=r,this.options={...t,initialFetchPolicy:o,fetchPolicy:s,variables:this.getVariablesWithDefaults(t.variables)},this.initializeObservablesQueue(),this["@@observable"]=()=>this,Symbol.observable&&(this[Symbol.observable]=()=>this);const a=pe(this.query);this.queryName=a&&a.name&&a.name.value}get query(){return this.lastQuery}get variables(){return this.options.variables}get networkStatus(){return this.subject.getValue().result.networkStatus}initializeObservablesQueue(){this.subject=new Wf({query:this.query,variables:this.variables,result:qe,meta:{}});const e=this.subject.pipe(Jt({subscribe:()=>{this.subject.observed||(this.reobserve(),setTimeout(()=>this.updatePolling()))},unsubscribe:()=>{this.subject.observed||this.tearDownQuery()}}),Zn(({query:t,variables:r,result:i,meta:s},o)=>{const{shouldEmit:a}=s;if(i===qe&&(o.previous=void 0,o.previousVariables=void 0),this.options.fetchPolicy==="standby"||a===2)return;if(a===1)return f();const{previous:l,previousVariables:c}=o;if(l){const h=this.queryManager.getDocumentInfo(t),u=this.queryManager.dataMasking,d=u?h.nonReactiveQuery:t;if((u||h.hasNonreactiveDirective?Ks(d,l,i,r):Q(l,i))&&Q(c,r))return}if(a===3&&(!this.options.notifyOnNetworkStatusChange||Q(l,i)))return;return f();function f(){return o.previous=i,o.previousVariables=r,i}},()=>({})));this.pipe=e.pipe.bind(e),this.subscribe=e.subscribe.bind(e),this.input=new st,this.input.complete=()=>{},this.input.pipe(this.operator).subscribe(this.subject)}getCacheDiff({optimistic:e=!0}={}){return this.queryManager.cache.diff({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:e})}getInitialResult(e){const t=this.queryManager.prioritizeCacheValues?"cache-first":e||this.options.fetchPolicy,r=()=>{const i=this.getCacheDiff(),s=this.options.returnPartialData||i.complete?i.result??void 0:void 0;return this.maskResult({data:s,dataState:i.complete?"complete":s===void 0?"empty":"partial",loading:!i.complete,networkStatus:i.complete?N.ready:N.loading,partial:!i.complete})};switch(t){case"cache-only":return{...r(),loading:!1,networkStatus:N.ready};case"cache-first":return r();case"cache-and-network":return{...r(),loading:!0,networkStatus:N.loading};case"standby":return Fn;default:return qe}}resubscribeCache(){var l;const{variables:e,fetchPolicy:t}=this.options,r=this.query,i=t==="standby"||t==="no-cache"||this.waitForNetworkResult,s=!ut({query:r,variables:e},this.unsubscribeFromCache)&&!this.waitForNetworkResult;if((i||s)&&((l=this.unsubscribeFromCache)==null||l.call(this)),i||!s)return;const o={query:r,variables:e,optimistic:!0,watcher:this,callback:c=>{const f=this.queryManager.getDocumentInfo(r);if((f.hasClientExports||f.hasForcedResolvers)&&(o.lastDiff=void 0),o.lastOwnDiff===c)return;const{result:h}=this.subject.getValue();!c.complete&&(h.error||h===qe||h===Fn)||Q(h.data,c.result)||this.scheduleNotify()}},a=this.queryManager.cache.watch(o);this.unsubscribeFromCache=Object.assign(()=>{this.unsubscribeFromCache=void 0,a()},{query:r,variables:e})}getCurrentResult(){const{result:e}=this.subject.getValue();let t=e.networkStatus===N.error||this.hasObservers()||this.options.fetchPolicy==="no-cache"?e:this.getInitialResult();return t===qe&&(t=this.getInitialResult()),Q(this.stableLastResult,t)||(this.stableLastResult=t),this.stableLastResult}refetch(e){const{fetchPolicy:t}=this.options,r={pollInterval:0};return t==="no-cache"?r.fetchPolicy="no-cache":r.fetchPolicy="network-only",e&&!Q(this.variables,e)&&(r.variables=this.options.variables=this.getVariablesWithDefaults({...this.variables,...e})),this._lastWrite=void 0,this._reobserve(r,{newNetworkStatus:N.refetch})}fetchMore({query:e,variables:t,context:r,errorPolicy:i,updateQuery:s}){M(this.options.fetchPolicy!=="cache-only",78,et(this.query,"(anonymous)"));const o={...ie(this.options,{errorPolicy:"none"},{query:e,context:r,errorPolicy:i}),variables:e?t:{...this.variables,...t},fetchPolicy:"no-cache",notifyOnNetworkStatusChange:this.options.notifyOnNetworkStatusChange};o.query=this.transformDocument(o.query),this.lastQuery=e?this.transformDocument(this.options.query):o.query;let a=!1;const l=this.options.fetchPolicy!=="no-cache";l||M(s,79);const{finalize:c,pushNotification:f}=this.pushOperation(N.fetchMore);return f({source:"newNetworkStatus",kind:"N",value:{}},{shouldEmit:3}),this.queryManager.fetchQuery(o,N.fetchMore).then(h=>{if(c(),l)this.queryManager.cache.batch({update:u=>{s?u.updateQuery({query:this.query,variables:this.variables,returnPartialData:!0,optimistic:!1},d=>s(d,{fetchMoreResult:h.data,variables:o.variables})):u.writeQuery({query:o.query,variables:o.variables,data:h.data})},onWatchUpdated:u=>{u.watcher===this&&(a=!0)}});else{const u=this.getCurrentResult(),d=s(u.data,{fetchMoreResult:h.data,variables:o.variables});f({kind:"N",value:{...u,networkStatus:N.ready,loading:!1,data:d,dataState:u.dataState==="streaming"?"streaming":"complete"},source:"network"})}return this.maskResult(h)}).finally(()=>{c(),l&&!a&&f({kind:"N",source:"newNetworkStatus",value:{}},{shouldEmit:1})})}subscribeToMore(e){const t=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:r=>{const{updateQuery:i,onError:s}=e,{error:o}=r;if(o){s?s(o):M.error(80,o);return}i&&this.updateQuery((a,l)=>i(a,{subscriptionData:r,...l}))}});return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)&&t.unsubscribe()}}applyOptions(e){const t=ie(this.options,e||{});qi(this.options,t),this.updatePolling()}async setVariables(e){return e=this.getVariablesWithDefaults(e),Q(this.variables,e)?qt(this.getCurrentResult()):(this.options.variables=e,this.hasObservers()?this._reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},{newNetworkStatus:N.setVariables}):qt(this.getCurrentResult()))}updateQuery(e){const{queryManager:t}=this,{result:r,complete:i}=this.getCacheDiff({optimistic:!1}),s=e(r,{variables:this.variables,complete:!!i,previousData:r});s&&(t.cache.writeQuery({query:this.options.query,data:s,variables:this.variables}),t.broadcastQueries())}startPolling(e){this.options.pollInterval=e,this.updatePolling()}stopPolling(){this.options.pollInterval=0,this.updatePolling()}applyNextFetchPolicy(e,t){if(t.nextFetchPolicy){const{fetchPolicy:r="cache-first",initialFetchPolicy:i=r}=t;r==="standby"||(typeof t.nextFetchPolicy=="function"?t.fetchPolicy=t.nextFetchPolicy.call(t,r,{reason:e,options:t,observable:this,initialFetchPolicy:i}):e==="variables-changed"?t.fetchPolicy=i:t.fetchPolicy=t.nextFetchPolicy)}return t.fetchPolicy}fetch(e,t,r,i){const s=this.options.fetchPolicy;e.context??(e.context={});let o=!1;const a=()=>{o=!0},l=m=>new B(v=>{try{return m.subscribe({next(w){o=!0,v.next(w)},error:w=>v.error(w),complete:()=>v.complete()})}finally{o||(d.override=t,this.input.next({kind:"N",source:"newNetworkStatus",value:{resetError:!0},query:h,variables:u,meta:{shouldEmit:3,fetchPolicy:s}}))}});let{observable:c,fromLink:f}=this.queryManager.fetchObservableWithInfo(e,{networkStatus:t,query:r,onCacheHit:a,fetchQueryOperator:l,observableQuery:this});const{query:h,variables:u}=this,d={abort:()=>{b.unsubscribe()},query:h,variables:u};this.activeOperations.add(d);let p=t==N.refetch||t==N.setVariables;c=c.pipe(i,Gt());const b=c.pipe(Jt({next:m=>{m.source==="newNetworkStatus"||m.kind==="N"&&m.value.loading?d.override=t:delete d.override},finalize:()=>this.activeOperations.delete(d)})).subscribe({next:m=>{const v={};p&&m.kind==="N"&&"loading"in m.value&&!m.value.loading&&(p=!1,v.shouldEmit=1),this.input.next({...m,query:h,variables:u,meta:v})}});return{fromLink:f,subscription:b,observable:c}}updatePolling(){if(this.queryManager.ssrMode)return;const{pollingInfo:e,options:{fetchPolicy:t,pollInterval:r}}=this;if(!r||!this.hasObservers()||t==="cache-only"){this.cancelPolling();return}if((e==null?void 0:e.interval)===r)return;const i=e||(this.pollingInfo={});i.interval=r;const s=()=>{var a,l;this.pollingInfo&&(!rr(this.networkStatus)&&!((l=(a=this.options).skipPollAttempt)!=null&&l.call(a))?this._reobserve({fetchPolicy:this.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},{newNetworkStatus:N.poll}).then(o,o):o())},o=()=>{const a=this.pollingInfo;a&&(clearTimeout(a.timeout),a.timeout=setTimeout(s,a.interval))};o()}cancelPolling(){this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),delete this.pollingInfo)}reobserve(e){return this._reobserve(e)}_reobserve(e,t){this.isTornDown=!1;let{newNetworkStatus:r}=t||{};this.queryManager.obsQueries.add(this);const i=r===N.refetch||r===N.poll,s=this.variables,o=this.options.fetchPolicy,a=ie(this.options,e||{}),l=i?a:qi(this.options,a),c=this.transformDocument(l.query);this.lastQuery=c,e&&"variables"in e&&(l.variables=this.getVariablesWithDefaults(e.variables)),i||(this.updatePolling(),e&&e.variables&&!Q(e.variables,s)&&l.fetchPolicy!=="standby"&&(l.fetchPolicy===o||typeof l.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",l),r===void 0&&(r=N.setVariables)));const f=this.networkStatus;r||(r=N.loading,f!==N.loading&&(e!=null&&e.variables)&&!Q(e.variables,s)&&(r=N.setVariables),l.fetchPolicy==="standby"&&(r=N.ready)),l.fetchPolicy==="standby"&&this.cancelPolling(),this.resubscribeCache();const{promise:h,operator:u}=Bh(v=>{switch(v.kind){case"E":throw v.error;case"N":if(v.source!=="newNetworkStatus"&&!v.value.loading)return v.value}},l.fetchPolicy==="standby"?{data:void 0}:void 0),{subscription:d,observable:p,fromLink:b}=this.fetch(l,r,c,u);!i&&(b||!this.linkSubscription)&&(this.linkSubscription&&this.linkSubscription.unsubscribe(),this.linkSubscription=d);const m=Object.assign(th(h.then(v=>qt(this.maskResult(v))).finally(()=>{!this.hasObservers()&&this.activeOperations.size===0&&this.tearDownQuery()})),{retain:()=>{const v=p.subscribe({}),w=()=>v.unsubscribe();return h.then(w,w),m}});return m}hasObservers(){return this.subject.observed}stop(){this.subject.complete(),this.initializeObservablesQueue(),this.tearDownQuery()}tearDownQuery(){var e;this.isTornDown||(this.resetNotifications(),(e=this.unsubscribeFromCache)==null||e.call(this),this.linkSubscription&&(this.linkSubscription.unsubscribe(),delete this.linkSubscription),this.stopPolling(),this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions.clear(),this.queryManager.obsQueries.delete(this),this.isTornDown=!0,this.abortActiveOperations(),this._lastWrite=void 0)}transformDocument(e){return this.queryManager.transform(e)}maskResult(e){const t=this.queryManager.maskOperation({document:this.query,data:e.data,fetchPolicy:this.options.fetchPolicy,cause:this});return t===e.data?e:{...e,data:t}}resetNotifications(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0),this.dirty=!1}scheduleNotify(){this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(()=>this.notify(!0),0)))}notify(e=!1){if(!e){const r=this.queryManager.getDocumentInfo(this.query);if(r.hasClientExports||r.hasForcedResolvers)return}const{dirty:t}=this;if(this.resetNotifications(),t&&(this.options.fetchPolicy=="cache-only"||this.options.fetchPolicy=="cache-and-network"||!this.activeOperations.size)){const r=this.getCacheDiff();Q(r.result,this.getCacheDiff({optimistic:!1}).result)?this.reobserveCacheFirst():this.input.next({kind:"N",value:{data:r.result,dataState:r.complete?"complete":r.result?"partial":"empty",networkStatus:N.ready,loading:!1,error:void 0,partial:!r.complete},source:"cache",query:this.query,variables:this.variables,meta:{}})}}pushOperation(e){let t=!1;const{query:r,variables:i}=this,s=()=>{this.activeOperations.delete(o)},o={override:e,abort:()=>{t=!0,s()},query:r,variables:i};return this.activeOperations.add(o),{finalize:s,pushNotification:(a,l)=>{t||this.input.next({...a,query:r,variables:i,meta:{...l}})}}}calculateNetworkStatus(e){if(e===N.streaming)return e;const t=Array.from(this.activeOperations.values()).findLast(r=>ut(r,this)&&r.override!==void 0);return(t==null?void 0:t.override)??e}abortActiveOperations(){this.activeOperations.forEach(e=>e.abort())}reset(){const e=this.options.fetchPolicy==="cache-only";this.setResult(e?Fn:qe,{shouldEmit:e?1:2}),this.abortActiveOperations()}setResult(e,t){this.input.next({source:"setResult",kind:"N",value:e,query:this.query,variables:this.variables,meta:{...t}})}reobserveCacheFirst(){const{fetchPolicy:e,nextFetchPolicy:t}=this.options;e==="cache-and-network"||e==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy(r,i){return this.nextFetchPolicy=t,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(r,i):e}}):this.reobserve()}getVariablesWithDefaults(e){return this.queryManager.getVariables(this.query,e)}}Ep=Symbol.observable;function ut(n,e){return!!(n&&e&&n.query===e.query&&Q(n.variables,e.variables))}function Bh(n,e){let t=e,r,i;const s=new Promise((a,l)=>{r=a,i=l}),o=Jt({next(a){try{const l=n(a);l!==void 0&&(t=l)}catch(l){i(l)}},finalize:()=>{if(t)r(t);else{const a="The operation was aborted.",l="AbortError";i(typeof DOMException<"u"?new DOMException(a,l):Object.assign(new Error(a),{name:l}))}}});return{promise:s,operator:o}}const $i={},ze=new WeakMap;function Nn(n,e){const t=n[e];typeof t=="function"&&(n[e]=function(){return ze.set(n,(ze.get(n)+1)%1e15),t.apply(this,arguments)})}const Hi=new WeakMap;class Vn{constructor(e,t){g(this,"lastRequestId",1);g(this,"cache");g(this,"queryManager");g(this,"id");g(this,"observableQuery");g(this,"incremental");g(this,"_lastWrite");const r=this.cache=e.cache,i=(Hi.get(e)||0)+1;Hi.set(e,i),this.id=i+"",this.observableQuery=t,this.queryManager=e,ze.has(r)||(ze.set(r,0),Nn(r,"evict"),Nn(r,"modify"),Nn(r,"reset"))}get lastWrite(){return(this.observableQuery||this)._lastWrite}set lastWrite(e){(this.observableQuery||this)._lastWrite=e}resetLastWrite(){this.lastWrite=void 0}shouldWrite(e,t){const{lastWrite:r}=this;return!(r&&r.dmCount===ze.get(this.cache)&&Q(t,r.variables)&&Q(e.data,r.result.data))}get hasNext(){return this.incremental?this.incremental.hasNext:!1}maybeHandleIncrementalResult(e,t,r){const{incrementalHandler:i}=this.queryManager;return i.isIncrementalResult(t)?(this.incremental||(this.incremental=i.startRequest({query:r})),this.incremental.handle(e,t)):t}markQueryResult(e,{document:t,variables:r,errorPolicy:i,cacheWriteBehavior:s}){var f;const o={query:t,variables:r,returnPartialData:!0,optimistic:!0};(f=this.observableQuery)==null||f.resetNotifications();const a=s===0,l=a?void 0:this.cache.diff(o);let c=this.maybeHandleIncrementalResult(l==null?void 0:l.result,e,t);return a||(Mn(c,i)?this.cache.batch({onWatchUpdated:(h,u)=>{h.watcher===this.observableQuery&&(h.lastOwnDiff=u)},update:h=>{if(this.shouldWrite(c,r))h.writeQuery({query:t,data:c.data,variables:r,overwrite:s===1}),this.lastWrite={result:c,variables:r,dmCount:ze.get(this.cache)};else if(l&&l.complete){c={...c,data:l.result};return}const u=h.diff(o);u.complete&&(c={...c,data:u.result})}}):this.lastWrite=void 0),c}markMutationResult(e,t,r=this.cache){const i=[],s=t.cacheWriteBehavior===0;let o=this.maybeHandleIncrementalResult(s?void 0:r.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}).result,e,t.document);if(t.errorPolicy==="ignore"&&(o={...o,errors:[]}),He(o)&&t.errorPolicy==="none")return Promise.resolve(o);const a=()=>({...o,dataState:this.hasNext?"streaming":"complete"});if(!s&&Mn(o,t.errorPolicy)){i.push({result:o.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables});const{updateQueries:c}=t;c&&this.queryManager.getObservableQueries("all").forEach(f=>{const h=f&&f.queryName;if(!h||!Object.hasOwnProperty.call(c,h))return;const u=c[h],{query:d,variables:p}=f,{result:b,complete:m}=f.getCacheDiff({optimistic:!1});if(m&&b){const v=u(b,{mutationResult:a(),queryName:d&&et(d)||void 0,queryVariables:p});v&&i.push({result:v,dataId:"ROOT_QUERY",query:d,variables:p})}})}let l=t.refetchQueries;if(typeof l=="function"&&(l=l(a())),i.length>0||(l||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){const c=[];if(this.queryManager.refetchQueries({updateCache:f=>{s||i.forEach(u=>f.write(u));const{update:h}=t;if(h){if(!s){const u=f.diff({id:"ROOT_MUTATION",query:this.queryManager.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});u.complete&&(o={...o,data:u.result})}this.hasNext||h(f,o,{context:t.context,variables:t.variables})}!s&&!t.keepRootFields&&!this.hasNext&&f.modify({id:"ROOT_MUTATION",fields(u,{fieldName:d,DELETE:p}){return d==="__typename"?u:p}})},include:l,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(f=>c.push(f)),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(c).then(()=>o)}return Promise.resolve(o)}markMutationOptimistic(e,t){const r=typeof e=="function"?e(t.variables,{IGNORE:$i}):e;return r===$i?!1:(this.cache.recordOptimisticTransaction(i=>{try{this.markMutationResult({data:r},t,i)}catch(s){M.error(s)}},this.id),!0)}markSubscriptionResult(e,{document:t,variables:r,errorPolicy:i,cacheWriteBehavior:s}){s!==0&&(Mn(e,i)&&this.cache.write({query:t,result:e.data,dataId:"ROOT_SUBSCRIPTION",variables:r}),this.queryManager.broadcastQueries())}}function Mn(n,e="none"){const t=e==="ignore"||e==="all";let r=!He(n);return!r&&t&&n.data&&(r=!0),r}class Qh{constructor(e){g(this,"defaultOptions");g(this,"client");g(this,"clientOptions");g(this,"assumeImmutableResults");g(this,"documentTransform");g(this,"ssrMode");g(this,"defaultContext");g(this,"dataMasking");g(this,"incrementalHandler");g(this,"localState");g(this,"queryDeduplication");g(this,"prioritizeCacheValues",!1);g(this,"onBroadcast");g(this,"mutationStore");g(this,"obsQueries",new Set);g(this,"fetchCancelFns",new Map);g(this,"transformCache",new Ys(he["queryManager.getDocumentInfo"]||2e3));g(this,"requestIdCounter",1);g(this,"inFlightLinkObservables",new Te(!1));g(this,"noCacheWarningsByCause",new WeakSet);const t=new de(i=>this.cache.transformDocument(i),{cache:!1});this.client=e.client,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientOptions=e.clientOptions,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking,this.localState=e.localState,this.incrementalHandler=e.incrementalHandler;const r=e.documentTransform;this.documentTransform=r?t.concat(r).concat(t):t,this.defaultContext=e.defaultContext||{},(this.onBroadcast=e.onBroadcast)&&(this.mutationStore={})}get link(){return this.client.link}get cache(){return this.client.cache}stop(){this.obsQueries.forEach(e=>e.stop()),this.cancelPendingFetches(se(83))}cancelPendingFetches(e){this.fetchCancelFns.forEach(t=>t(e)),this.fetchCancelFns.clear()}async mutate({mutation:e,variables:t,optimisticResponse:r,updateQueries:i,refetchQueries:s=[],awaitRefetchQueries:o=!1,update:a,onQueryUpdated:l,fetchPolicy:c,errorPolicy:f,keepRootFields:h,context:u}){const d=new Vn(this);e=this.cache.transformForLink(this.transform(e));const{hasClientExports:p}=this.getDocumentInfo(e);t=this.getVariables(e,t),p&&(t=await this.localState.getExportedVariables({client:this.client,document:e,variables:t,context:u}));const b=this.mutationStore&&(this.mutationStore[d.id]={mutation:e,variables:t,loading:!0,error:null}),m=r&&d.markMutationOptimistic(r,{document:e,variables:t,cacheWriteBehavior:c==="no-cache"?0:2,errorPolicy:f,context:u,updateQueries:i,update:a,keepRootFields:h});return this.broadcastQueries(),new Promise((v,w)=>{const S={};return this.getObservableFromLink(e,{...u,optimisticResponse:m?r:void 0},t,{},!1).observable.pipe(Ui(),$e(T=>{const O={...T};return Pe(d.markMutationResult(O,{document:e,variables:t,cacheWriteBehavior:c==="no-cache"?0:2,errorPolicy:f,context:u,update:a,updateQueries:i,awaitRefetchQueries:o,refetchQueries:s,removeOptimistic:m?d.id:void 0,onQueryUpdated:l,keepRootFields:h}))})).pipe(Fe(T=>{if(He(T)&&f==="none")throw new xe(T);return b&&(b.loading=!1,b.error=null),T})).subscribe({next:T=>{if(this.broadcastQueries(),!d.hasNext){const O={data:this.maskOperation({document:e,data:T.data,fetchPolicy:c,cause:S})};He(T)&&(O.error=new xe(T)),Object.keys(T.extensions||{}).length&&(O.extensions=T.extensions),v(O)}},error:T=>{if(b&&(b.loading=!1,b.error=T),m&&this.cache.removeOptimistic(d.id),this.broadcastQueries(),f==="ignore")return v({data:void 0});if(f==="all")return v({data:void 0,error:T});w(T)}})})}fetchQuery(e,t){return _e(e.query,Ae.QUERY),(async()=>ud(this.fetchObservableWithInfo(e,{networkStatus:t}).observable.pipe(Zn(r=>{switch(r.kind){case"E":throw r.error;case"N":if(r.source!=="newNetworkStatus")return qt(r.value)}})),{defaultValue:{data:void 0}}))()}transform(e){return this.documentTransform.transformDocument(e)}getDocumentInfo(e){const{transformCache:t}=this;if(!t.has(e)){const i=pe(e),s={hasClientExports:dt(["client","export"],e,!0),hasForcedResolvers:Xd(e),hasNonreactiveDirective:dt(["nonreactive"],e),hasIncrementalDirective:dt(["defer"],e),nonReactiveQuery:Yh(e),clientQuery:dt(["client"],e)?e:null,serverQuery:nh([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),operationType:i==null?void 0:i.operation,defaultVars:Sr(i),asQuery:{...e,definitions:e.definitions.map(o=>o.kind==="OperationDefinition"&&o.operation!=="query"?{...o,operation:"query"}:o)}};t.set(e,s)}const r=t.get(e);if(r.violation)throw r.violation;return r}getVariables(e,t){const r=this.getDocumentInfo(e).defaultVars,i=Object.entries(t??{}).map(([s,o])=>[s,o===void 0?r[s]:o]);return{...r,...Object.fromEntries(i)}}watchQuery(e){_e(e.query,Ae.QUERY);const t=this.transform(e.query);return e={...e,variables:this.getVariables(t,e.variables)},typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!0),new In({queryManager:this,options:e,transformedQuery:t})}query(e){const t=this.transform(e.query);return this.fetchQuery({...e,query:t}).then(r=>({...r,data:this.maskOperation({document:t,data:r==null?void 0:r.data,fetchPolicy:e.fetchPolicy})}))}generateRequestId(){return this.requestIdCounter++}clearStore(e={discardWatches:!0}){return this.cancelPendingFetches(se(85)),this.obsQueries.forEach(t=>{t.reset()}),this.mutationStore&&(this.mutationStore={}),this.cache.reset(e)}getObservableQueries(e="active"){const t=new Set,r=new Map,i=new Map,s=new Set;return Array.isArray(e)&&e.forEach(o=>{if(typeof o=="string")r.set(o,o),i.set(o,!1);else if(Zd(o)){const a=Qe(this.transform(o));r.set(a,et(o)),i.set(a,!1)}else ne(o)&&o.query&&s.add(o)}),this.obsQueries.forEach(o=>{const a=Qe(this.transform(o.options.query));if(e==="all"){t.add(o);return}const{queryName:l,options:{fetchPolicy:c}}=o;e==="active"&&c==="standby"||(e==="active"||l&&i.has(l)||a&&i.has(a))&&(t.add(o),l&&i.set(l,!0),a&&i.set(a,!0))}),s.size&&s.forEach(o=>{const a=new In({queryManager:this,options:{...o,fetchPolicy:"network-only"}});t.add(a)}),t}refetchObservableQueries(e=!1){const t=[];return this.getObservableQueries(e?"all":"active").forEach(r=>{const{fetchPolicy:i}=r.options;(e||i!=="standby")&&i!=="cache-only"&&t.push(r.refetch())}),this.broadcastQueries(),Promise.all(t)}startGraphQLSubscription(e){let{query:t,variables:r}=e;const{fetchPolicy:i,errorPolicy:s="none",context:o={},extensions:a={}}=e;_e(t,Ae.SUBSCRIPTION),t=this.transform(t),r=this.getVariables(t,r);let l;const c=(this.getDocumentInfo(t).hasClientExports?Pe(this.localState.getExportedVariables({client:this.client,document:t,variables:r,context:o})):De(r)).pipe($e(f=>{const{observable:h,restart:u}=this.getObservableFromLink(t,o,f,a),d=new Vn(this);return l=u,h.pipe(Fe(p=>{d.markSubscriptionResult(p,{document:t,variables:f,errorPolicy:s,cacheWriteBehavior:i==="no-cache"?0:2});const b={data:p.data??void 0};return He(p)?b.error=new xe(p):zh(p)&&(b.error=p.extensions[en],delete p.extensions[en]),p.extensions&&Object.keys(p.extensions).length&&(b.extensions=p.extensions),b.error&&s==="none"&&(b.data=void 0),s==="ignore"&&delete b.error,b}),Lt(p=>De(s==="ignore"?{data:void 0}:{data:void 0,error:p})),pd(p=>!!(p.data||p.error)))}));return Object.assign(c,{restart:()=>l==null?void 0:l()})}broadcastQueries(){this.onBroadcast&&this.onBroadcast(),this.obsQueries.forEach(e=>e.notify())}getObservableFromLink(e,t,r,i,s=(t==null?void 0:t.queryDeduplication)??this.queryDeduplication){let o={};const{serverQuery:a,clientQuery:l,operationType:c,hasIncrementalDirective:f}=this.getDocumentInfo(e),h=et(e),u={client:this.client};if(a){const{inFlightLinkObservables:d,link:p}=this;try{let m=function(v){return new B(w=>{function S(){return v.subscribe({next:w.next.bind(w),complete:w.complete.bind(w),error:w.error.bind(w)})}let T=S();return o.restart||(o.restart=()=>{T.unsubscribe(),T=S()}),()=>{T.unsubscribe(),o.restart=void 0}})};const b=this.incrementalHandler.prepareRequest({query:a,variables:r,context:{...this.defaultContext,...t,queryDeduplication:s},extensions:i});if(t=b.context,s){const v=Qe(a),w=ke(r);o=d.lookup(v,w),o.observable||(o.observable=nr(p,b,u).pipe(m,md(()=>{d.peek(v,w)===o&&d.remove(v,w)}),c===Ae.SUBSCRIPTION?Gt():gd({refCount:!0})))}else o.observable=nr(p,b,u).pipe(m)}catch(b){o.observable=xs(()=>b)}}else o.observable=De({data:{}});if(l){const{operation:d}=pe(e);M(!f,90,d[0].toUpperCase()+d.slice(1),h??"(anonymous)"),o.observable=o.observable.pipe($e(p=>Pe(this.localState.execute({client:this.client,document:l,remoteResult:p,context:t,variables:r}))))}return{restart:()=>{var d;return(d=o.restart)==null?void 0:d.call(o)},observable:o.observable.pipe(Lt(d=>{throw d=Wh(d),Uh(d),d}))}}getResultsFromLink(e,{queryInfo:t,cacheWriteBehavior:r,observableQuery:i}){const s=t.lastRequestId=this.generateRequestId(),{errorPolicy:o}=e,a=this.cache.transformForLink(e.query);return this.getObservableFromLink(a,e.context,e.variables).observable.pipe(Fe(l=>{const c=t.markQueryResult(l,{...e,document:a,cacheWriteBehavior:r}),f=He(c);if(f&&o==="none")throw t.resetLastWrite(),i==null||i.resetNotifications(),new xe(c);const h={data:c.data,...t.hasNext?{loading:!0,networkStatus:N.streaming,dataState:"streaming",partial:!0}:{dataState:c.data?"complete":"empty",loading:!1,networkStatus:N.ready,partial:!c.data}};return f&&(o==="none"&&(h.data=void 0,h.dataState="empty"),o!=="ignore"&&(h.error=new xe(c),h.dataState!=="streaming"&&(h.networkStatus=N.error))),h}),Lt(l=>{if(s>=t.lastRequestId&&o==="none")throw t.resetLastWrite(),i==null||i.resetNotifications(),l;const c={data:void 0,dataState:"empty",loading:!1,networkStatus:N.ready,partial:!0};return o!=="ignore"&&(c.error=l,c.networkStatus=N.error),De(c)}))}fetchObservableWithInfo(e,{networkStatus:t=N.loading,query:r=e.query,fetchQueryOperator:i=a=>a,onCacheHit:s=()=>{},observableQuery:o}){const a=this.getVariables(r,e.variables),l=this.defaultOptions.watchQuery;let{fetchPolicy:c=l&&l.fetchPolicy||"cache-first",errorPolicy:f=l&&l.errorPolicy||"none",returnPartialData:h=!1,notifyOnNetworkStatusChange:u=!0,context:d={}}=e;this.prioritizeCacheValues&&(c==="network-only"||c==="cache-and-network")&&(c="cache-first");const p=Object.assign({},e,{query:r,variables:a,fetchPolicy:c,errorPolicy:f,returnPartialData:h,notifyOnNetworkStatusChange:u,context:d}),b=new Vn(this,o),m=O=>{p.variables=O;const L=c==="no-cache"?0:t===N.refetch&&p.refetchWritePolicy!=="merge"?1:2,q=this.fetchQueryByPolicy(p,{queryInfo:b,cacheWriteBehavior:L,onCacheHit:s,observableQuery:o});return q.observable=q.observable.pipe(i),p.fetchPolicy!=="standby"&&(o==null||o.applyNextFetchPolicy("after-fetch",e)),q},v=()=>{this.fetchCancelFns.delete(b.id)};this.fetchCancelFns.set(b.id,O=>{w.next({kind:"E",error:O,source:"network"})});const w=new st;let S,T;if(this.getDocumentInfo(p.query).hasClientExports)S=Pe(this.localState.getExportedVariables({client:this.client,document:p.query,variables:p.variables,context:p.context})).pipe($e(O=>m(O).observable)),T=!0;else{const O=m(p.variables);T=O.fromLink,S=O.observable}return{observable:new B(O=>{O.add(v),S.subscribe(O),w.subscribe(O)}).pipe(Gt()),fromLink:T}}refetchQueries({updateCache:e,include:t,optimistic:r=!1,removeOptimistic:i=r?As("refetchQueries"):void 0,onQueryUpdated:s}){const o=new Map;t&&this.getObservableQueries(t).forEach(l=>{if(l.options.fetchPolicy==="cache-only")return;const c=l.getCurrentResult();o.set(l,{oq:l,lastDiff:{result:c==null?void 0:c.data,complete:!(c!=null&&c.partial)}})});const a=new Map;if(e){const l=new Set;this.cache.batch({update:e,optimistic:r&&i||!1,removeOptimistic:i,onWatchUpdated(c,f,h){const u=c.watcher;if(u instanceof In&&!l.has(u)){if(l.add(u),s){o.delete(u);let d=s(u,f,h);return d===!0&&(d=u.refetch().retain()),d!==!1&&a.set(u,d),d}s!==null&&u.options.fetchPolicy!=="cache-only"&&o.set(u,{oq:u,lastDiff:h,diff:f})}}})}return o.size&&o.forEach(({oq:l,lastDiff:c,diff:f})=>{let h;s&&(f||(f=l.getCacheDiff()),h=s(l,f,c)),(!s||h===!0)&&(h=l.refetch().retain()),h!==!1&&a.set(l,h)}),i&&this.cache.removeOptimistic(i),a}maskOperation(e){const{document:t,data:r}=e;return this.dataMasking?Ah(r,t,this.cache):r}maskFragment(e){const{data:t,fragment:r,fragmentName:i}=e;return this.dataMasking?xh(t,r,this.cache,i):t}fetchQueryByPolicy({query:e,variables:t,fetchPolicy:r,errorPolicy:i,returnPartialData:s,context:o},{cacheWriteBehavior:a,onCacheHit:l,queryInfo:c,observableQuery:f}){const h=()=>this.cache.diff({query:e,variables:t,returnPartialData:!0,optimistic:!0}),u=(p,b)=>{const m=p.result,v=S=>(!p.complete&&!s&&(S=void 0),{data:S,dataState:p.complete?"complete":S?"partial":"empty",loading:rr(b),networkStatus:b,partial:!p.complete}),w=S=>De({kind:"N",value:v(S),source:"cache"});return(p.complete||s)&&this.getDocumentInfo(e).hasForcedResolvers?(l(),Pe(this.localState.execute({client:this.client,document:e,remoteResult:m?{data:m}:void 0,context:o,variables:t,onlyRunForcedResolvers:!0,returnPartialData:!0}).then(S=>({kind:"N",value:v(S.data||void 0),source:"cache"})))):i==="none"&&b===N.refetch&&p.missing?w(void 0):w(m||void 0)},d=()=>this.getResultsFromLink({query:e,variables:t,context:o,fetchPolicy:r,errorPolicy:i},{cacheWriteBehavior:a,queryInfo:c,observableQuery:f}).pipe(Ui(),yd(),Fe(p=>({...p,source:"network"})));switch(r){default:case"cache-first":{const p=h();return p.complete?{fromLink:!1,observable:u(p,N.ready)}:s?{fromLink:!0,observable:kn(u(p,N.loading),d())}:{fromLink:!0,observable:d()}}case"cache-and-network":{const p=h();return p.complete||s?{fromLink:!0,observable:kn(u(p,N.loading),d())}:{fromLink:!0,observable:d()}}case"cache-only":return{fromLink:!1,observable:kn(u(h(),N.ready))};case"network-only":return{fromLink:!0,observable:d()};case"no-cache":return{fromLink:!0,observable:d()};case"standby":return{fromLink:!1,observable:Yt}}}}function Ui(){let n=!1;return Jt({next(){n=!0},complete(){M(n,94)}})}function Yh(n){return ue(n,{FragmentSpread:e=>{var t;if(!((t=e.directives)!=null&&t.some(r=>r.name.value==="unmask")))return{...e,directives:[...e.directives||[],{kind:R.DIRECTIVE,name:{kind:R.NAME,value:"nonreactive"}}]}}})}class Gh{constructor(e){g(this,"link");g(this,"cache");g(this,"disableNetworkFetches");g(this,"version");g(this,"queryDeduplication");g(this,"defaultOptions");g(this,"devtoolsConfig");g(this,"queryManager");g(this,"devToolsHookCb");g(this,"resetStoreCallbacks",[]);g(this,"clearStoreCallbacks",[]);g(this,"reFetchObservableQueries");g(this,"maskedFragmentTransform",new de(sh));const{cache:t,documentTransform:r,ssrMode:i=!1,ssrForceFetchDelay:s=0,queryDeduplication:o=!0,defaultOptions:a,defaultContext:l,assumeImmutableResults:c=t.assumeImmutableResults,localState:f,devtools:h,dataMasking:u,link:d,incrementalHandler:p=new ph}=e;this.link=d,this.cache=t,this.queryDeduplication=o,this.defaultOptions=a||{},this.devtoolsConfig={...h,enabled:(h==null?void 0:h.enabled)??vd},this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.refetchObservableQueries=this.refetchObservableQueries.bind(this),this.version=gr,this.queryManager=new Qh({client:this,defaultOptions:this.defaultOptions,defaultContext:l,documentTransform:r,queryDeduplication:o,ssrMode:i,dataMasking:!!u,clientOptions:e,incrementalHandler:p,assumeImmutableResults:c,onBroadcast:this.devtoolsConfig.enabled?()=>{this.devToolsHookCb&&this.devToolsHookCb()}:void 0,localState:f}),this.prioritizeCacheValues=i||s>0,s&&setTimeout(()=>{this.prioritizeCacheValues=!1},s),this.devtoolsConfig.enabled&&this.connectToDevTools()}set prioritizeCacheValues(e){this.queryManager.prioritizeCacheValues=e}get prioritizeCacheValues(){return this.queryManager.prioritizeCacheValues}connectToDevTools(){if(typeof window>"u")return;const e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}get documentTransform(){return this.queryManager.documentTransform}get localState(){return this.queryManager.localState}set localState(e){this.queryManager.localState=e}stop(){this.queryManager.stop()}watchQuery(e){return this.defaultOptions.watchQuery&&(e=On(this.defaultOptions.watchQuery,e)),this.queryManager.watchQuery(e)}query(e){return this.defaultOptions.query&&(e=On(this.defaultOptions.query,e)),this.queryManager.query(e)}mutate(e){const t=On(ie({fetchPolicy:"network-only",errorPolicy:"none"},this.defaultOptions.mutate),e);return _e(t.mutation,Ae.MUTATION),this.queryManager.mutate(t)}subscribe(e){const t={},r=this.queryManager.startGraphQLSubscription(e),i=r.pipe(Fe(s=>({...s,data:this.queryManager.maskOperation({document:e.query,data:s.data,fetchPolicy:e.fetchPolicy,cause:t})})));return Object.assign(i,{restart:r.restart})}readQuery(e,t=!1){return this.cache.readQuery({...e,query:this.transform(e.query)},t)}watchFragment(e){const t=this.queryManager.dataMasking;return this.cache.watchFragment({...e,fragment:this.transform(e.fragment,t)}).pipe(Fe(r=>r))}readFragment(e,t=!1){return this.cache.readFragment({...e,fragment:this.transform(e.fragment)},t)}writeQuery(e){const t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t}writeFragment(e){const t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t}__actionHookForDevTools(e){this.devToolsHookCb=e}__requestRaw(e){return nr(this.link,e,{client:this})}resetStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!1})).then(()=>Promise.all(this.resetStoreCallbacks.map(e=>e()))).then(()=>this.refetchObservableQueries())}clearStore(){return Promise.resolve().then(()=>this.queryManager.clearStore({discardWatches:!0})).then(()=>Promise.all(this.clearStoreCallbacks.map(e=>e())))}onResetStore(e){return this.resetStoreCallbacks.push(e),()=>{this.resetStoreCallbacks=this.resetStoreCallbacks.filter(t=>t!==e)}}onClearStore(e){return this.clearStoreCallbacks.push(e),()=>{this.clearStoreCallbacks=this.clearStoreCallbacks.filter(t=>t!==e)}}refetchObservableQueries(e){return this.queryManager.refetchObservableQueries(e)}refetchQueries(e){const t=this.queryManager.refetchQueries(e),r=[],i=[];t.forEach((o,a)=>{r.push(a),i.push(o)});const s=Promise.all(i);return s.queries=r,s.results=i,s.catch(o=>{}),s}getObservableQueries(e="active"){return this.queryManager.getObservableQueries(e)}extract(e){return this.cache.extract(e)}restore(e){return this.cache.restore(e)}setLink(e){this.link=e}get defaultContext(){return this.queryManager.defaultContext}transform(e,t=!1){const r=this.queryManager.transform(e);return t?this.maskedFragmentTransform.transformDocument(r):r}}const{hasOwnProperty:zi}=Object.prototype;function Jh(n){return ne(n)&&"payload"in n}async function*Kh(n){var u;const e=new TextDecoder("utf-8"),t=(u=n.headers)==null?void 0:u.get("content-type"),r=t==null?void 0:t.match(/;\s*boundary=(?:'([^']+)'|"([^"]+)"|([^"'].+?))\s*(?:;|$)/i),i=`\r
--`+((r==null?void 0:r.findLast(d=>!!d))||"-");let s="";M(n.body&&typeof n.body.getReader=="function",60);const a=n.body.getReader();let l=!1,c=!1,f;const h=()=>c&&s[0]=="-"&&s[1]=="-";try{for(;!l;){({value:f,done:l}=await a.read());const d=typeof f=="string"?f:e.decode(f),p=s.length-i.length+1;s+=d;let b=s.indexOf(i,p);for(;b>-1&&!h();){c=!0;let m;[m,s]=[s.slice(0,b),s.slice(b+i.length)];const v=m.indexOf(`\r
\r
`),S=Zh(m.slice(0,v))["content-type"];if(S&&S.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");const T=m.slice(v);T&&(yield T),b=s.indexOf(i)}if(h())return}throw new Error("premature end of multipart body")}finally{a.cancel()}}async function Xh(n,e){for await(const t of Kh(n)){const r=ho(n,t);if(Object.keys(r).length!=0)if(Jh(r)){if(Object.keys(r).length===1&&r.payload===null)return;let i={...r.payload};"errors"in r&&(i.extensions={...i.extensions,[en]:new Zt(r.errors??[])}),e(i)}else e(r)}}function Zh(n){const e={};return n.split(`
`).forEach(t=>{const r=t.indexOf(":");if(r>-1){const i=t.slice(0,r).trim().toLowerCase(),s=t.slice(r+1).trim();e[i]=s}}),e}function ho(n,e){if(n.status>=300)throw new hn(`Response not successful: Received status code ${n.status}`,{response:n,bodyText:e});try{return JSON.parse(e)}catch(t){throw new pn(t,{response:n,bodyText:e})}}function ep(n,e){try{return JSON.parse(e)}catch(t){throw new pn(t,{response:n,bodyText:e})}}function tp(n,e){const t=n.headers.get("content-type");return t!=null&&t.includes("application/graphql-response+json")?ep(n,e):ho(n,e)}function np(n){return e=>e.text().then(t=>{const r=tp(e,t);if(!Array.isArray(r)&&!zi.call(r,"data")&&!zi.call(r,"errors"))throw new hn(`Server response was malformed for query '${Array.isArray(n)?n.map(i=>i.operationName):n.operationName}'.`,{response:e,bodyText:t});return r})}const rp={includeQuery:!0,includeExtensions:!0,preserveHeaderCase:!1},ip={accept:"application/graphql-response+json,application/json;q=0.9","content-type":"application/json"},sp={method:"POST"},op={http:rp,headers:ip,options:sp},ap=(n,e)=>e(n);function lp(n,e,...t){let r={},i={};t.forEach(f=>{var h;r={...r,...f.options,headers:{...r.headers,...f.headers}},f.credentials&&(r.credentials=f.credentials),r.headers.accept=(((h=f.http)==null?void 0:h.accept)||[]).concat(r.headers.accept).join(","),i={...i,...f.http}}),r.headers=cp(r.headers,i.preserveHeaderCase);const{operationName:s,extensions:o,variables:a,query:l}=n,c={operationName:s,variables:a};return i.includeExtensions&&Object.keys(o||{}).length&&(c.extensions=o),i.includeQuery&&(c.query=e(l,Qe)),{options:r,body:c}}function cp(n,e){if(!e){const i={};return Object.keys(Object(n)).forEach(s=>{i[s.toLowerCase()]=n[s]}),i}const t={};Object.keys(Object(n)).forEach(i=>{t[i.toLowerCase()]={originalName:i,value:n[i]}});const r={};return Object.keys(t).forEach(i=>{r[t[i].originalName]=t[i].value}),r}const up=(n,e)=>{const r=n.getContext().uri;return r||(typeof e=="function"?e(n):e||"/graphql")};function fp(n,e){const t=[],r=(c,f)=>{t.push(`${c}=${encodeURIComponent(f)}`)};if("query"in e&&r("query",e.query),e.operationName&&r("operationName",e.operationName),e.variables){let c;try{c=JSON.stringify(e.variables)}catch(f){return{parseError:f}}r("variables",c)}if(e.extensions){let c;try{c=JSON.stringify(e.extensions)}catch(f){return{parseError:f}}r("extensions",c)}let i="",s=n;const o=n.indexOf("#");o!==-1&&(i=n.substr(o),s=n.substr(0,o));const a=s.indexOf("?")===-1?"?":"&";return{newURI:s+a+t.join("&")+i}}const dp=be(()=>fetch);function hp(){}class pp extends te{constructor(e={}){let{uri:t="/graphql",fetch:r,print:i=ap,includeExtensions:s,preserveHeaderCase:o,useGETForQueries:a,includeUnusedVariables:l=!1,...c}=e;const f={http:ie({includeExtensions:s,preserveHeaderCase:o}),options:c.fetchOptions,credentials:c.credentials,headers:c.headers};super(h=>{let u=up(h,t);const d=h.getContext(),p={...d.http};bh(h.query)&&(p.accept=["multipart/mixed;boundary=graphql;subscriptionSpec=1.0",...p.accept||[]]);const b={http:p,options:d.fetchOptions,credentials:d.credentials,headers:d.headers},{options:m,body:v}=lp(h,i,op,f,b);v.variables&&!l&&(v.variables=yh(v.variables,h.query));let w=new AbortController,S=()=>{w=void 0};if(m.signal){const T=m.signal,O=()=>{w==null||w.abort(T.reason)};T.addEventListener("abort",O,{once:!0}),S=()=>{w==null||w.signal.removeEventListener("abort",S),w=void 0,T.removeEventListener("abort",O),S=hp},w.signal.addEventListener("abort",S,{once:!0})}return m.signal=w.signal,a&&!vh(h.query)&&(m.method="GET"),new B(T=>{if(m.method==="GET"){const{newURI:q,parseError:G}=fp(u,v);if(G)throw G;u=q}else m.body=JSON.stringify(v);const O=r||be(()=>fetch)||dp,L=T.next.bind(T);return O(u,m).then(q=>{var X;h.setContext({response:q});const G=(X=q.headers)==null?void 0:X.get("content-type");return G!==null&&/^multipart\/mixed/i.test(G)?Xh(q,L):np(h)(q).then(L)}).then(()=>{S(),T.complete()}).catch(q=>{S(),T.error(q)}),()=>{w&&w.abort()}})})}}class mp extends te{constructor(e={}){super((t,r)=>{const i=t.client,s=i.queryManager.clientOptions,o=t.getContext();{const{name:a,version:l,transport:c="headers"}=ie({},s.clientAwareness,e.clientAwareness,o.clientAwareness);c==="headers"&&t.setContext(({headers:f,extensions:h})=>({headers:ie({"apollographql-client-name":a,"apollographql-client-version":l},f)}))}{const{transport:a="extensions"}=ie({},s.enhancedClientAwareness,e.enhancedClientAwareness);a==="extensions"&&(t.extensions=ie({clientLibrary:{name:"@apollo/client",version:i.version}},t.extensions))}return r(t)})}}class yp extends te{constructor(e={}){const{left:t,right:r,request:i}=te.from([new mp(e),new pp(e)]);super(i),Object.assign(this,{left:t,right:r})}}const gp=(n={})=>new yp(n);function vp(n){return new bp((e,t)=>n(t,e))}class bp extends te{constructor(e){super((t,r)=>{const{...i}=t;return Object.defineProperty(i,"client",{enumerable:!1,value:t.client}),new B(s=>{let o=!1;return Promise.resolve(i).then(a=>e(t.getContext(),a)).then(t.setContext).then(()=>{o||r(t).subscribe(s)}).catch(s.error.bind(s)),()=>{o=!0}})})}}const wp=Qi("auth",{state:()=>({token:Wr("auth_token",""),user:Wr("user_info",null),apolloClient:null}),getters:{isAuthenticated:n=>!!n.token,getApolloClient:n=>(n.apolloClient||(n.apolloClient=Rn(n.token)),n.apolloClient)},actions:{setToken(n){this.token=n,this.apolloClient=Rn(n)},setUser(n){this.user=n},logout(){this.token="",this.user=null,this.apolloClient=null},initializeApolloClient(){this.token&&(this.apolloClient=Rn(this.token))}}});function Rn(n){const e=gp({uri:"https://wiki.holitime.org/graphql"}),t=vp((r,{headers:i})=>({headers:{...i,authorization:n?`Bearer ${n}`:""}}));return new Gh({link:t.concat(e),cache:new qh,defaultOptions:{watchQuery:{errorPolicy:"all"},query:{errorPolicy:"all"}}})}const xr=xa(ff),_p=af();Ra(xr);const kp=Aa();kp.initialize("AIzaSyC1nASQFlMZvAc93aRuW4r2OVRGJkT6zhQ");const Sp=Et();Sp.init();const Cp=wp();Cp.initializeApolloClient();xr.use(_p);xr.mount("#app");export{R as K,Dp as L,Ae as O,Pp as T,ni as _,wp as a,xp as b,Ap as c,Fp as d,vf as e,df as f,$n as g,pf as i,cf as u};
//# sourceMappingURL=index-091aa7bb.js.map