System.register(["./preload-helper-legacy.CIXZiioE.js","../apps/settings/index-legacy.CKwsq3d1.js","./settings-store-legacy.BzmgUa8U.js","./ChildTabs.vue_vue_type_script_setup_true_lang-legacy.BY_3U6wx.js","../apps/settings/upgrade/LicenseInterstitial-legacy.BIKxCgXs.js","./index-legacy.Byn8FqiS.js","./index-legacy.BpZDMFyf.js","./index-legacy.B4qadHsq.js"],function(e,t){"use strict";var a,l,n,s,i,u,r,o,c,d,p,b,v,g,y,_,f,h,m,j,w,k,x,C,S,T,O,K,U,A,D,E,F;return{setters:[e=>{a=e.d,l=e.bm,n=e.A,s=e.bn,i=e.bo,u=e.h,r=e.bu,o=e.a9,c=e.aa,d=e.by,p=e.bq,b=e.bw,v=e.a4,g=e.bs,y=e.bC,_=e.bz,f=e.bJ},e=>{h=e.a,m=e.b,j=e.c,w=e.g,k=e.l,x=e._,C=e.s,S=e.e},e=>{T=e.u},e=>{O=e._},e=>{K=e.default},e=>{U=e.T,A=e.A},e=>{D=e.B},e=>{E=e.F,F=e.M}],execute:function(){e("_",a({__name:"ParentTabs",setup(e){var t,a;const J=T(),{isLoading:L,showPopup:P,componentUpgrade:q}=l(J),z=h.settings.tabs,B=n([]),I=m("tab"),M=j(I,z),N=n(null!==(t=null===(a=Object.values(z))||void 0===a?void 0:a[0])&&void 0!==t?t:""),G=n(null!=M?M:N.value.key),H=e=>{Object.entries(e).forEach(([e,t])=>{B.value[e]=t})},Q=async e=>{e.preventDefault(),L.value=!0;const t=[];for(const[l,n]of Object.entries(B.value)){let e=n;"object"==typeof n&&null!==n&&(e=JSON.stringify(n)),t.push({key:l,value:e})}try{C(t),setTimeout(()=>{L.value=!1},1e3)}catch(a){console.error(a)}},R=()=>{P.value=!1};return(e,t)=>(s(),i(c,null,[u(o(E),{id:"wwp-admin-tab-settings",method:"post",onSubmit:Q},{default:r(()=>[u(o(U),{activeKey:G.value,"onUpdate:activeKey":t[0]||(t[0]=e=>G.value=e),"destroy-inactive-tab-pane":!0,onChange:t[1]||(t[1]=e=>{return t=G.value,S("tab",t),void S("tab-child","");var t})},{rightExtra:r(()=>[u(o(D),{type:"primary","html-type":"submit",class:"wwp-settings-save-btn",loading:o(L)},{default:r(()=>[v(g(o(w)("submitText",o(wp.i18n.__)("Save Changes","woocommerce-wholesale-prices"))),1)]),_:1},8,["loading"])]),default:r(()=>[(s(!0),i(c,null,d(o(z),(e,t)=>(s(),p(o(A),{key:t,class:b("wwp-parent-tab"),tab:e.label},{default:r(()=>[null!=e&&e.interstitial?(s(),p(K,{key:0,"interstitial-details":e.interstitial_details},null,8,["interstitial-details"])):(s(),p(O,{key:1,"parent-tab":t.toString(),"parent-data":e.child,onFieldData:H},null,8,["parent-tab","parent-data"]))]),_:2},1032,["tab"]))),128))]),_:1},8,["activeKey"])]),_:1}),u(o(F),{open:o(P),"onUpdate:open":t[2]||(t[2]=e=>f(P)?P.value=e:null),centered:"",title:null,footer:null,onCancel:R},{default:r(()=>[(s(),p(y,null,{fallback:r(()=>[u(x)]),default:r(()=>[(s(),p(_(o(k)(o(q)))))]),_:1}))]),_:1},8,["open"])],64))}}))}}});
