import{F as I,r as R,g as B,R as P}from"./FormRunner.91c833a7.js";import{d as q,eB as x,eA as F,F as D,H as p,G as y,u as d,b as s,ev as c,f as E,c as S,eE as K,eF as L,e as u,v as N}from"./outputWidgets.781e41f9.js";import{u as h}from"./uuid.d8173418.js";import{a as A}from"./asyncComputed.d06d5356.js";import{L as C}from"./CircularLoading.091d9b3b.js";import"./url.a0d7eae0.js";import"./index.dbc12d17.js";import"./pubsub.2273fc34.js";import"./icons.0ffc383b.js";import"./PlayerNavbar.a8bfaff8.js";import"./ActionButton.3612b79f.js";import"./WidgetsFrame.0130ea36.js";import"./index.b7e930e8.js";import"./Card.7e708e2a.js";import"./TabPane.6d00c211.js";import"./hasIn.205b6afa.js";import"./index.1ca3acf8.js";import"./Text.6168f33a.js";import"./Link.77931b3a.js";import"./Title.bf1f8106.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="fd6b965e-5524-420a-a67c-c1e07208cac3",o._sentryDebugIdIdentifier="sentry-dbid-fd6b965e-5524-420a-a67c-c1e07208cac3")}catch{}})();const i=o=>(K("data-v-485e3719"),o=o(),L(),o),T={key:0,class:"loading"},V={key:1,class:"error"},G=i(()=>u("h1",null,"Oops! Something went wrong",-1)),H=i(()=>u("p",null,"An unknown error ocurred. Please try again or contact support.",-1)),O=[G,H],j={key:2,class:"form"},z={key:3,class:"error not-found",style:{height:"100vh"}},J=i(()=>u("h1",null,"Page not found",-1)),M=i(()=>u("p",null,"The page you requested could not be found.",-1)),Q=[J,M],U=q({__name:"Player",setup(o){const t=x(),l=F(),m=D({playerKey:h()});p(t,()=>w());function v(e,a){R("player",l,e,a)}const g=({path:e})=>{l.push({name:"player",query:t.query,params:{path:e.split("/")}})},_=async()=>{m.playerKey=h()};p([()=>t.path,()=>t.query],()=>_());const{loading:b,result:r,error:k,refetch:w}=A(()=>{var e;return B((e=t.path.slice(1))!=null?e:"")}),f=y(()=>n.value?P.create(n.value.id):null),n=y(()=>{var e,a;return(a=(e=r.value)==null?void 0:e.form)!=null?a:null});return p(r,()=>{var e;!r.value||r.value.form&&(document.title=(e=r.value.form.welcomeTitle)!=null?e:r.value.form.title)}),(e,a)=>d(b)?(s(),c("div",T,[E(C)])):d(k)?(s(),c("div",V,O)):n.value&&f.value?(s(),c("div",j,[(s(),S(I,{key:m.playerKey,class:"player",form:n.value,"is-preview":!1,params:d(t).query,broker:f.value,"enable-auto-focus":!0,onNavigate:g,onLogout:_,onRedirect:v},null,8,["form","params","broker"]))])):(s(),c("div",z,Q))}});const fe=N(U,[["__scopeId","data-v-485e3719"]]);export{fe as default};
//# sourceMappingURL=Player.27e18a9e.js.map
