import{e as k,r as B,Q as I,n as u,g as n,p as b,bV as S,w as p,v as V,q as x,t as A,I as C,bW as D,B as N,aO as W,ak as P,j as g,k as v,f,M as _,X as w,V as q,b4 as E,b5 as L}from"./jwt-decode.esm-BYfS37aG.js";import{S as $}from"./Steps-fw8in-jn.js";import{W as F}from"./PlayerConfigProvider-9KPuGDRT.js";import"./index-Bpjq9G-y.js";import"./colorHelpers-Dr5wl109.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="01cf0b3f-e37b-4b0b-93cb-a4878fa20539",t._sentryDebugIdIdentifier="sentry-dbid-01cf0b3f-e37b-4b0b-93cb-a4878fa20539")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(t,{emit:s}){const c=t,i=B(null);I(()=>{i.value&&c.action.setElement(i.value)});const l=s;return(m,o)=>(n(),u(b(S),null,{default:p(()=>[V(b(N),{ref_key:"element",ref:i,class:C(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:o[0]||(o[0]=d=>l("click")),onKeydown:o[1]||(o[1]=D(d=>l("click"),["enter"]))},{default:p(()=>[x(A(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),M=W(K,[["__scopeId","data-v-aea27bb7"]]),O={class:"form"},j={class:"form-wrapper"},z={key:0,class:"buttons"},J=k({__name:"WidgetPreview",setup(t){const s=P(),c=B([]);function i(e){return E[e]||L[e]||null}function l(e){try{const r=JSON.parse(e);if(r.component=i(r.type),!r.component)throw new Error(`Widget ${r.type} not found`);return r.component?r:null}catch{return null}}function m(){const e=s.query.widget;return Array.isArray(e)?e.map(l).filter(Boolean):[l(e)]}function o(){return s.query.steps==="true"}function d(){const e=s.query.button;return e?Array.isArray(e)?e:[e]:[]}const y=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,r)=>(n(),u(F,{"main-color":"var(--ac-brand-primary)",class:"preview",background:"var(--ac-bg-secondary)","font-family":"Inter",locale:"en"},{default:p(()=>[o()?(n(),u($,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):g("",!0),v("div",O,[v("div",j,[(n(!0),f(_,null,w(m(),(a,h)=>(n(),f("div",{key:h,class:"widget"},[(n(),u(q(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:c.value},null,8,["user-props","value","errors"]))]))),128))]),d().length?(n(),f("div",z,[(n(!0),f(_,null,w(d(),a=>(n(),u(M,{key:a,"display-name":y(a).name,action:y(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}}),T=W(J,[["__scopeId","data-v-ee9ec43e"]]);export{T as default};
//# sourceMappingURL=WidgetPreview-ByG5hVed.js.map
