import{d as k,f as B,J as A,o as n,c as u,w as f,b as I,az as P,eb as S,ec as C,ef as D,u as y,bM as N,f1 as x,Q as W,e4 as V,F as g,a as b,K as d,ea as v,ei as q,aL as w,v as E,x as L}from"./index.fd66f361.js";import{S as F}from"./Steps.9f66c99c.js";import{W as K}from"./PlayerConfigProvider.6c23896e.js";import"./index.54e9a548.js";import"./colorHelpers.ffad89ea.js";import"./index.19aeeb1f.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="24c53d51-738f-47b1-98c3-72750976ac15",o._sentryDebugIdIdentifier="sentry-dbid-24c53d51-738f-47b1-98c3-72750976ac15")}catch{}})();const $=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(o,{emit:t}){const c=o,l=B(null);return A(()=>{l.value&&c.action.setElement(l.value)}),(r,i)=>(n(),u(y(x),null,{default:f(()=>[I(y(N),{ref_key:"element",ref:l,class:C(["next-button",r.disabled?"disabled":""]),loading:r.loading,disabled:r.disabled,onClick:i[0]||(i[0]=p=>t("click")),onKeydown:i[1]||(i[1]=D(p=>t("click"),["enter"]))},{default:f(()=>[P(S(r.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}});const M=W($,[["__scopeId","data-v-aea27bb7"]]),z={class:"form"},J={class:"form-wrapper"},O={key:0,class:"buttons"},Q=k({__name:"WidgetPreview",setup(o){const t=V(),c=B([]);function l(e){return E[e]||L[e]||null}function r(e){try{const s=JSON.parse(e);if(s.component=l(s.type),!s.component)throw new Error(`Widget ${s.type} not found`);return s.component?s:null}catch{return null}}function i(){const e=t.query.widget;return Array.isArray(e)?e.map(r).filter(Boolean):[r(e)]}function p(){return t.query.steps==="true"}function m(){const e=t.query.button;return e?Array.isArray(e)?e:[e]:[]}const _=e=>({name:e,isDefault:!1,isFocused:!1,focusOnButton:()=>{},addKeydownListener:()=>{},setElement:()=>{}});return(e,s)=>(n(),u(K,{"main-color":"#d14056",class:"preview",background:"#fbfbfb","font-family":"Inter",locale:"en"},{default:f(()=>[p()?(n(),u(F,{key:0,class:"steps","steps-info":{current:1,total:3},"is-preview":""})):g("",!0),b("div",z,[b("div",J,[(n(!0),d(w,null,v(i(),(a,h)=>(n(),d("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))]),m().length?(n(),d("div",O,[(n(!0),d(w,null,v(m(),a=>(n(),u(M,{key:a,"display-name":_(a).name,action:_(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}});const X=W(Q,[["__scopeId","data-v-e1ac7894"]]);export{X as default};
//# sourceMappingURL=WidgetPreview.c2fb0edc.js.map
