import{d as k,r as B,o as A,b as n,c as l,w as p,f as C,ar as D,eD as I,ez as P,f0 as S,u as y,bV as N,f1 as V,v as h,eB as x,ex as b,e as g,ev as c,eC as v,eQ as q,a$ as w,n as E,p as $}from"./outputWidgets.83ad65aa.js";import{S as L}from"./Steps.f845ba67.js";import{W as F}from"./WidgetsFrame.8301aa17.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="d238cc84-a7dd-4b93-965b-bba5d07b2e94",r._sentryDebugIdIdentifier="sentry-dbid-d238cc84-a7dd-4b93-965b-bba5d07b2e94")}catch{}})();const K=k({__name:"ActionButton",props:{action:{},displayName:{},disabled:{type:Boolean},loading:{type:Boolean}},emits:["click"],setup(r,{emit:t}){const d=r,u=B(null);return A(()=>{u.value&&d.action.setElement(u.value)}),(o,i)=>(n(),l(y(V),null,{default:p(()=>[C(y(N),{ref_key:"element",ref:u,class:P(["next-button",o.disabled?"disabled":""]),loading:o.loading,disabled:o.disabled,onClick:i[0]||(i[0]=f=>t("click")),onKeydown:i[1]||(i[1]=S(f=>t("click"),["enter"]))},{default:p(()=>[D(I(o.displayName),1)]),_:1},8,["loading","disabled","class"])]),_:1}))}});const z=h(K,[["__scopeId","data-v-e711f126"]]),M={class:"form"},O={class:"form-wrapper"},J={key:0,class:"buttons"},Q=k({__name:"WidgetPreview",setup(r){const t=x(),d=B([]);function u(e){return E[e]||$[e]||null}function o(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(o).filter(Boolean):[o(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(F,{"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}})):b("",!0),g("div",M,[g("div",O,[(n(!0),c(w,null,v(i(),(a,W)=>(n(),c("div",{key:W,class:"widget"},[(n(),l(q(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",J,[(n(!0),c(w,null,v(m(),a=>(n(),l(z,{key:a,"display-name":_(a).name,action:_(a)},null,8,["display-name","action"]))),128))])):b("",!0)])]),_:1}))}});const H=h(Q,[["__scopeId","data-v-ef293d5b"]]);export{H as default};
//# sourceMappingURL=WidgetPreview.294c6665.js.map
