import{F as I,r as R,R as B}from"./FormRunner.ed9bba73.js";import{d as P,eB as q,eA as x,G as D,J as p,H as y,u as d,b as a,ev as c,f as E,c as F,eE as S,eF as K,e as i,v as L}from"./outputWidgets.0277cbbd.js";import{u as h}from"./uuid.c1cff8f3.js";import{a as N}from"./asyncComputed.d55fcd20.js";import{g as A}from"./api.d4152e54.js";import{L as C}from"./CircularLoading.90f9b4f8.js";import"./url.044e3d41.js";import"./Passwordless.887b0509.js";import"./index.f8936078.js";import"./pubsub.9dc2e6ac.js";import"./icons.4110f4c3.js";import"./PlayerNavbar.1c5c7209.js";import"./ActionButton.f2966625.js";import"./WidgetsFrame.eec3aa14.js";import"./index.c325e26c.js";import"./Base.b6a7a457.js";import"./Link.d17adb86.js";import"./Paragraph.11321d3e.js";import"./Text.c62153b6.js";import"./Title.e05b5b52.js";import"./Card.7ed4e7f5.js";import"./TabPane.7a361e44.js";import"./hasIn.30cc1d4f.js";import"./runnerData.a9057f6a.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]="c5c16b77-ec31-4c0a-8e2d-b81cb3d1f00b",o._sentryDebugIdIdentifier="sentry-dbid-c5c16b77-ec31-4c0a-8e2d-b81cb3d1f00b")}catch{}})();const u=o=>(S("data-v-485e3719"),o=o(),K(),o),T={key:0,class:"loading"},V={key:1,class:"error"},G=u(()=>i("h1",null,"Oops! Something went wrong",-1)),H=u(()=>i("p",null,"An unknown error ocurred. Please try again or contact support.",-1)),J=[G,H],O={key:2,class:"form"},j={key:3,class:"error not-found",style:{height:"100vh"}},z=u(()=>i("h1",null,"Page not found",-1)),M=u(()=>i("p",null,"The page you requested could not be found.",-1)),Q=[z,M],U=P({__name:"Player",setup(o){const t=q(),l=x(),m=D({playerKey:h()});p(t,()=>w());function v(e,s){R("player",l,e,s)}const b=({path:e})=>{l.push({name:"player",query:t.query,params:{path:e.split("/")}})},_=async()=>{m.playerKey=h()};p([()=>t.path,()=>t.query],()=>_());const{loading:g,result:r,error:k,refetch:w}=N(()=>{var e;return A((e=t.path.slice(1))!=null?e:"")}),f=y(()=>n.value?B.create(n.value.id):null),n=y(()=>{var e,s;return(s=(e=r.value)==null?void 0:e.form)!=null?s: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,s)=>d(g)?(a(),c("div",T,[E(C)])):d(k)?(a(),c("div",V,J)):n.value&&f.value?(a(),c("div",O,[(a(),F(I,{key:m.playerKey,class:"player",form:n.value,"is-preview":!1,params:d(t).query,broker:f.value,"enable-auto-focus":!0,onNavigate:b,onLogout:_,onRedirect:v},null,8,["form","params","broker"]))])):(a(),c("div",j,Q))}});const be=L(U,[["__scopeId","data-v-485e3719"]]);export{be as default};
//# sourceMappingURL=Player.b957ddea.js.map
