import{a as k,r as B,D as S,p as u,e as n,u as b,bP as D,w as p,j as I,S as N,U as P,E as x,b6 as A,B as C,aN as h,ac as E,g,h as _,b as f,M as v,W as w,R as V,a_ as q,a$ as $}from"./jwt-decode.esm-1629-i6Y.js";import{S as L}from"./Steps-DWBLG1Jm.js";import{W as F}from"./PlayerConfigProvider-VuTFam0u.js";import"./index-Rgw42xFd.js";import"./colorHelpers-BQ7V1LXl.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]="d8ae407d-7e1c-4b98-b5ab-6066953b8587",t._sentryDebugIdIdentifier="sentry-dbid-d8ae407d-7e1c-4b98-b5ab-6066953b8587")}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);S(()=>{i.value&&d.action.setElement(i.value)});const l=s;return(m,o)=>(n(),u(b(D),null,{default:p(()=>[I(b(C),{ref_key:"element",ref:i,class:x(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:o[0]||(o[0]=c=>l("click")),onKeydown:o[1]||(o[1]=A(c=>l("click"),["enter"]))},{default:p(()=>[N(P(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}}),M=h(K,[["__scopeId","data-v-aea27bb7"]]),O={class:"form"},R={class:"form-wrapper"},j={key:0,class:"buttons"},z=k({__name:"WidgetPreview",setup(t){const s=E(),d=B([]);function i(e){return q[e]||$[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(F,{"main-color":"#d14056",class:"preview",background:"#fbfbfb","font-family":"Inter",locale:"en"},{default:p(()=>[o()?(n(),u(L,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):g("",!0),_("div",O,[_("div",R,[(n(!0),f(v,null,w(m(),(a,W)=>(n(),f("div",{key:W,class:"widget"},[(n(),u(V(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(v,null,w(c(),a=>(n(),u(M,{key:a,"display-name":y(a).name,action:y(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}}),T=h(z,[["__scopeId","data-v-d3d01da6"]]);export{T as default};
//# sourceMappingURL=WidgetPreview-COYA_Rrk.js.map
