import{r as b,m as B}from"./index.1a3a4850.js";import{u as k}from"./uuid.b1ea1ffc.js";import{F as S,R as E}from"./broker.2019863b.js";import{d as F,ey as K,ex as N,E as C,G as m,F as f,bu as u,b as s,c as n,e as L,u as w,eB as T,eC as V,er as i,t as A}from"./registerWidgets.2d3a9fa1.js";import{D as G,m as O}from"./DashPlayer.2612053a.js";import{a as j}from"./asyncComputed.da67dddd.js";import{L as z}from"./CircularLoading.7f8cdc69.js";import"./passwordlessManager.7fdb47fd.js";import"./pubsub.f5cc447b.js";import"./storage.2f9edc3d.js";import"./Passwordless.f47b04f0.js";import"./icons.ef35efa7.js";import"./executeJs.76e35dd0.js";import"./PlayerNavbar.fdd6bac1.js";import"./Steps.27fe6056.js";import"./Modal.0a34e3f8.js";import"./WidgetsFrame.c6f4d7d9.js";import"./ActionButton.vue_vue_type_script_setup_true_lang.d48002ff.js";import"./lottie.8f8e4fb5.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="fc96acd8-8056-4f9f-a862-559243188d6d",o._sentryDebugIdIdentifier="sentry-dbid-fc96acd8-8056-4f9f-a862-559243188d6d")}catch{}})();const d=o=>(T("data-v-b3aa3ca3"),o=o(),V(),o),H={key:0,class:"loading"},J={key:1,class:"error"},M=d(()=>i("h1",null,"Oops! Something went wrong",-1)),Q=d(()=>i("p",null,"An unknown error ocurred. Please try again or contact support.",-1)),U=[M,Q],W={key:2,class:"form"},X={key:3,class:"dash-wrapper"},Y={key:4,class:"error not-found"},Z=d(()=>i("h1",null,"Page not found",-1)),$=d(()=>i("p",null,"The page you requested could not be found.",-1)),ee=[Z,$],ae=F({__name:"Player",setup(o){const a=K(),l=N(),p=C({playerKey:k()});m(a,()=>D());function I(e,t){b("player",l,e,t)}const y=({path:e})=>{l.push({name:"player",query:a.query,params:{path:e.split("/")}})},_=async()=>{p.playerKey=k()};m([()=>a.path,()=>a.query],()=>_());const{loading:P,result:r,error:R,refetch:D}=j(()=>{var e;return B((e=a.path.slice(1))!=null?e:"")}),h=f(()=>c.value?E.create({formPath:c.value.path}):null),c=f(()=>{var e,t;return(t=(e=r.value)==null?void 0:e.form)!=null?t:null}),v=f(()=>{var t,g;if(!((t=r.value)!=null&&t.dash))return null;const e=O((g=r.value)==null?void 0:g.dash);return e.onRedirect(({url:q,queryParams:x})=>b("player",l,q,x)),e});return m(r,()=>{var e;!r.value||(r.value.form?document.title=(e=r.value.form.welcomeTitle)!=null?e:r.value.form.title:r.value.dash&&(document.title=r.value.dash.title))}),(e,t)=>u(P)?(s(),n("div",H,[L(z)])):u(R)?(s(),n("div",J,U)):c.value&&h.value?(s(),n("div",W,[(s(),w(S,{key:p.playerKey,class:"player",form:c.value,"is-preview":!1,params:u(a).query,broker:h.value,"enable-auto-focus":!0,onNavigate:y,onLogout:_,onRedirect:I},null,8,["form","params","broker"]))])):v.value?(s(),n("div",X,[(s(),w(G,{key:p.playerKey,class:"player","is-preview":!1,params:u(a).query,"dash-player-service":v.value,onNavigate:y},null,8,["params","dash-player-service"]))])):(s(),n("div",Y,ee))}});const ke=A(ae,[["__scopeId","data-v-b3aa3ca3"]]);export{ke as default};
//# sourceMappingURL=Player.8a6474a3.js.map
