import{d as k,r as B,U as x,o as n,a as d,b as p,f as A,g as D,t as I,ez as N,fn as P,u as _,bY as S,fm as C,_ as h,eA as V,h as g,e as b,ac as f,eB as v,eD as q,aY as w,L as E,N as L}from"./jwt-decode.esm.7c9b757c.js";import{S as $}from"./Steps.d5e9e2f9.js";import{W as F}from"./PlayerConfigProvider.be4efc80.js";import"./index.c68b675a.js";import"./colorHelpers.b8c57893.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]="7bff507e-2264-4841-9be5-47de8d964e8d",t._sentryDebugIdIdentifier="sentry-dbid-7bff507e-2264-4841-9be5-47de8d964e8d")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(t,{emit:s}){const u=t,i=B(null);x(()=>{i.value&&u.action.setElement(i.value)});const l=s;return(m,a)=>(n(),d(_(C),null,{default:p(()=>[A(_(S),{ref_key:"element",ref:i,class:N(["next-button",t.disabled?"disabled":""]),loading:t.loading,disabled:t.disabled,onClick:a[0]||(a[0]=c=>l("click")),onKeydown:a[1]||(a[1]=P(c=>l("click"),["enter"]))},{default:p(()=>[D(I(t.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}});const z=h(K,[["__scopeId","data-v-aea27bb7"]]),M={class:"form"},O={class:"form-wrapper"},Y={key:0,class:"buttons"},J=k({__name:"WidgetPreview",setup(t){const s=V(),u=B([]);function i(e){return E[e]||L[e]||null}function l(e){try{const o=JSON.parse(e);if(o.component=i(o.type),!o.component)throw new Error(`Widget ${o.type} not found`);return o.component?o:null}catch{return null}}function m(){const e=s.query.widget;return Array.isArray(e)?e.map(l).filter(Boolean):[l(e)]}function a(){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,o)=>(n(),d(F,{"main-color":"#d14056",class:"preview",background:"#fbfbfb","font-family":"Inter",locale:"en"},{default:p(()=>[a()?(n(),d($,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):g("",!0),b("div",M,[b("div",O,[(n(!0),f(w,null,v(m(),(r,W)=>(n(),f("div",{key:W,class:"widget"},[(n(),d(q(r.component),{"user-props":r.userProps,value:r.userProps.value,errors:u.value},null,8,["user-props","value","errors"]))]))),128))]),c().length?(n(),f("div",Y,[(n(!0),f(w,null,v(c(),r=>(n(),d(z,{key:r,"display-name":y(r).name,action:y(r)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}});const Q=h(J,[["__scopeId","data-v-d3d01da6"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview.554e95d3.js.map
