import{F as I,r as R,R as B}from"./FormRunner.c1657120.js";import{d as P,eB as q,eA as x,G as D,J as l,H as y,u as p,b as s,ev as i,f as E,c as F,eE as S,eF as K,e as u,v as L}from"./outputWidgets.2096912b.js";import{u as h}from"./uuid.12f2c448.js";import{a as N}from"./asyncComputed.7ba20277.js";import{g as A}from"./api.38e548ad.js";import{L as C}from"./CircularLoading.f0ebef12.js";import"./url.9f77d2c5.js";import"./Passwordless.77d48eb2.js";import"./index.67bc0b05.js";import"./pubsub.29d64bef.js";import"./icons.e6f1393c.js";import"./PlayerNavbar.ffda94a6.js";import"./ActionButton.5fccedc5.js";import"./WidgetsFrame.a73bc419.js";import"./index.7a08a9c6.js";import"./Base.33ff443a.js";import"./Link.e331be66.js";import"./Paragraph.144ab0b0.js";import"./Text.2528d1f7.js";import"./Title.5e6ffead.js";import"./Card.cb6747cd.js";import"./TabPane.e041af71.js";import"./hasIn.3063693a.js";import"./runnerData.2ceceae0.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]="669d6f2d-e323-45ad-9513-b49a69d1175c",o._sentryDebugIdIdentifier="sentry-dbid-669d6f2d-e323-45ad-9513-b49a69d1175c")}catch{}})();const c=o=>(S("data-v-485e3719"),o=o(),K(),o),T={key:0,class:"loading"},V={key:1,class:"error"},G=c(()=>u("h1",null,"Oops! Something went wrong",-1)),H=c(()=>u("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=c(()=>u("h1",null,"Page not found",-1)),M=c(()=>u("p",null,"The page you requested could not be found.",-1)),Q=[z,M],U=P({__name:"Player",setup(o){const t=q(),d=x(),m=D({playerKey:h()});l(t,()=>w());function v(e,a){R("player",d,e,a)}const g=({path:e})=>{d.push({name:"player",query:t.query,params:{path:e.split("/")}})},_=async()=>{m.playerKey=h()};l([()=>t.path,()=>t.query],()=>_());const{loading:b,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,a;return(a=(e=r.value)==null?void 0:e.form)!=null?a:null});return l(r,()=>{var e;!r.value||r.value.form&&(document.title=(e=r.value.form.welcomeTitle)!=null?e:r.value.form.title)}),(e,a)=>p(b)?(s(),i("div",T,[E(C)])):p(k)?(s(),i("div",V,J)):n.value&&f.value?(s(),i("div",O,[(s(),F(I,{key:m.playerKey,class:"player",form:n.value,"is-preview":!1,params:p(t).query,broker:f.value,"enable-auto-focus":!0,onNavigate:g,onLogout:_,onRedirect:v},null,8,["form","params","broker"]))])):(s(),i("div",j,Q))}});const ge=L(U,[["__scopeId","data-v-485e3719"]]);export{ge as default};
//# sourceMappingURL=Player.d1757f2e.js.map
