import{e as k,r as B,n as x,q as u,g as n,s as g,bU as I,x as p,v as S,T as A,U as C,F as D,bV as N,B as P,as as W,W as V,j as v,k as b,f,X as _,Y as w,aQ as q,aL as E,aM as L}from"./jwt-decode.esm-TBTnMpAQ.js";import{S as F}from"./Steps-IxXuQn0c.js";import{W as $}from"./PlayerConfigProvider-BmiKrYsz.js";import"./index-BsqwB0qP.js";import"./colorHelpers-BMn7fztv.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]="5063547f-6914-4d7d-85f3-75de96cfb1d0",t._sentryDebugIdIdentifier="sentry-dbid-5063547f-6914-4d7d-85f3-75de96cfb1d0")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(t,{emit:s}){const d=t,i=B(null);x(()=>{i.value&&d.action.setElement(i.value)});const l=s;return(m,o)=>(n(),u(g(I),null,{default:p(()=>[S(g(P),{ref_key:"element",ref:i,class:D(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:o[0]||(o[0]=c=>l("click")),onKeydown:o[1]||(o[1]=N(c=>l("click"),["enter"]))},{default:p(()=>[A(C(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),M=W(K,[["__scopeId","data-v-aea27bb7"]]),O={class:"form"},U={class:"form-wrapper"},j={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(t){const s=V(),d=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 c(){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($,{"main-color":"var(--ac-brand-primary)",class:"preview",background:"var(--ac-bg-secondary)","font-family":"Inter",locale:"en"},{default:p(()=>[o()?(n(),u(F,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):v("",!0),b("div",O,[b("div",U,[(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:d.value},null,8,["user-props","value","errors"]))]))),128))]),c().length?(n(),f("div",j,[(n(!0),f(_,null,w(c(),a=>(n(),u(M,{key:a,"display-name":y(a).name,action:y(a)},null,8,["display-name","action"]))),128))])):v("",!0)])]),_:1}))}}),Y=W(z,[["__scopeId","data-v-ee9ec43e"]]);export{Y as default};
//# sourceMappingURL=WidgetPreview-DNgnls4i.js.map
