import{d as k,r as B,U as x,o as n,a as u,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.fbcfeaec.js";import{S as $}from"./Steps.c40d0887.js";import{W as F}from"./PlayerConfigProvider.372cc58b.js";import"./index.900c7d37.js";import"./colorHelpers.0cd68eec.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]="c6d141cd-0f09-436b-a7be-3c40593450ac",t._sentryDebugIdIdentifier="sentry-dbid-c6d141cd-0f09-436b-a7be-3c40593450ac")}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,r)=>(n(),u(_(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:r[0]||(r[0]=c=>l("click")),onKeydown:r[1]||(r[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(),d=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 r(){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(),u(F,{"main-color":"#d14056",class:"preview",background:"#fbfbfb","font-family":"Inter",locale:"en"},{default:p(()=>[r()?(n(),u($,{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(),(a,W)=>(n(),f("div",{key:W,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",Y,[(n(!0),f(w,null,v(c(),a=>(n(),u(z,{key:a,"display-name":y(a).name,action:y(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}});const Q=h(J,[["__scopeId","data-v-d3d01da6"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview.793c24a7.js.map
