import{d as k,r as B,o as A,b as n,c as l,w as p,f as I,as as P,eH as S,eA as C,f2 as D,u as y,bG as E,f8 as N,x as h,eE as x,ey as g,e as v,ew as c,eF as b,eG as V,aE as w,n as q,p as F}from"./outputWidgets.6e1c5425.js";import{S as L}from"./Steps.3b1b1a45.js";import{W as $}from"./WidgetsFrame.89e32c21.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]="0c7a9407-5862-4305-9694-8d9ea057bd9f",o._sentryDebugIdIdentifier="sentry-dbid-0c7a9407-5862-4305-9694-8d9ea057bd9f")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(o,{emit:t}){const d=o,u=B(null);return A(()=>{u.value&&d.action.setElement(u.value)}),(r,i)=>(n(),l(y(N),null,{default:p(()=>[I(y(E),{ref_key:"element",ref:u,class:C(["next-button",r.disabled?"disabled":""]),loading:r.loading,disabled:r.disabled,onClick:i[0]||(i[0]=f=>t("click")),onKeydown:i[1]||(i[1]=D(f=>t("click"),["enter"]))},{default:p(()=>[P(S(r.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}});const G=h(K,[["__scopeId","data-v-e711f126"]]),M={class:"form"},O={class:"form-wrapper"},z={key:0,class:"buttons"},H=k({__name:"WidgetPreview",setup(o){const t=x(),d=B([]);function u(e){return q[e]||F[e]||null}function r(e){try{const s=JSON.parse(e);if(s.component=u(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 f(){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(),l($,{"main-color":"#d14056",class:"preview",theme:"#fbfbfb",runtime:"form","font-family":"Inter"},{default:p(()=>[f()?(n(),l(L,{key:0,"steps-info":{current:2,total:3}})):g("",!0),v("div",M,[v("div",O,[(n(!0),c(w,null,b(i(),(a,W)=>(n(),c("div",{key:W,class:"widget"},[(n(),l(V(a.component),{"user-props":a.userProps,value:a.userProps.value,errors:d.value},null,8,["user-props","value","errors"]))]))),128))]),m().length?(n(),c("div",z,[(n(!0),c(w,null,b(m(),a=>(n(),l(G,{key:a,"display-name":_(a).name,action:_(a)},null,8,["display-name","action"]))),128))])):g("",!0)])]),_:1}))}});const Q=h(H,[["__scopeId","data-v-5ba90560"]]);export{Q as default};
//# sourceMappingURL=WidgetPreview.5f9e1d3b.js.map
