import{d as l,aX as g,aJ as A,aM as y,aE as h,c as _,b,h as S,m as j,aI as k,aY as C,a as B,s as E}from"./index-BKaqQGb-.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-fQa65UMX.js";const F=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=E(),f=(e,t)=>S(e,{...j(i),...t}),n=g(),c=n.kind==="form"&&n.parent?n.parent:n,u=k(),m=C((e,t,a)=>{if(Array.isArray(e[t])&&Array.isArray(a))return e[t]=a,!0});function o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return o(e)&&o(t)?m({...t},e):t}const d=A(()=>y(f(s.config.expression),e=>{for(const t of Object.keys(e)){const a=p(c.getAt(t),e[t]);c.setAt(t,a)}return h(u,s.config.onSuccess)}));return(e,t)=>(B(),_(I,{"action-id":r.buttonId,effect:b(d)},null,8,["action-id","effect"]))}});export{F as default};
