System.register(["../../../../common/preload-helper-legacy.CIXZiioE.js","../../index-legacy.Bb8z3cGQ.js","../../../../common/GroupControl.vue_vue_type_style_index_0_scoped_ac0e52be_lang-legacy.BhDSN6Mf.js","../../../../common/DnDDataTableControl.vue_vue_type_style_index_0_scoped_0b913e4f_lang-legacy.D1tDIuyM.js","../../../../common/GroupConditionalControl.vue_vue_type_style_index_0_scoped_96558d5e_lang-legacy.CHJO3hx-.js","../../../../common/LabelControl.vue_vue_type_script_setup_true_lang-legacy.9mLv6sKk.js","../../../../common/OptionsControl.vue_vue_type_style_index_0_scoped_a595eea6_lang-legacy.BOGbhEW3.js","../../../../common/index-legacy.BpZDMFyf.js","../../../../common/index-legacy.Ccwy_0FI.js","../../../../common/index-legacy.CO4MsCT9.js","../../../../common/motion-legacy.C4TziduP.js","../../../../common/index-legacy.M32zB8dq.js","../../../../common/useState-legacy.C_VuFIfe.js","../../../../common/warning-legacy.BXrMpzCz.js","../../../../common/compact-item-legacy.EWjDRkhe.js","../../../../common/createContext-legacy.DxkS4L9s.js","../../../../common/useMergedState-legacy.CSXWBAdW.js","../../../../common/KeyCode-legacy.Cey0FNFJ.js","../../../../common/ActionButton-legacy.D-ux39fB.js"],function(e,n){"use strict";var l,o,t,a,c,s,u,i,r,m,_,d,p,y,g,v,b,j,w,f;return{setters:[e=>{l=e.d,o=e.ar,t=e.A,a=e.bn,c=e.bo,s=e.bp,u=e.h,i=e.a9,r=e.bq,m=e.bu,_=e.a4,d=e.bs,p=e.br,y=e.bw},e=>{g=e.g,v=e.p,b=e.t},null,null,null,e=>{j=e._},null,e=>{w=e.B},e=>{f=e.A},null,null,null,null,null,null,null,null,null,null],execute:function(){const n={key:0,class:"wwp-row-handle"},x={class:"wwp-left-content"},k={class:"wwp-right-content"},C=["innerHTML"],h={key:1,class:"wwp-button-control"},T=["id","href","target"],A=["id","type"];e("default",l({__name:"ButtonControl",props:{params:{type:Object,required:!0}},setup(e){const l=e,{params:D}=o(l),q=D.value,B=t(!!q.link),L=t(q.external?"_blank":"_self"),M=t(!0),S=t(!1);"submit"!==q.action&&"button"!==q.action||(M.value=!1),B.value&&(M.value=!1);const G=g("confirmText",wp.i18n.__("Are you sure want to clear the cache?","woocommerce-wholesale-prices")),H=e=>{S.value=!0;try{b({action:e}),setTimeout(()=>{S.value=!1},1e3)}catch(n){console.error(n)}};return(e,l)=>{var o,t;return M.value?(a(),c("div",n,[s("div",x,[u(i(j),{params:i(q)},null,8,["params"])]),s("div",k,[i(q).confirmation?(a(),r(i(f),{key:0,title:i(G),onConfirm:l[0]||(l[0]=e=>H(i(q).action))},{default:m(()=>[u(i(w),{class:"wpp-action-btn",type:"primary",loading:S.value},{default:m(()=>[_(d(i(q).button_label),1)]),_:1},8,["loading"])]),_:1},8,["title"])):(a(),r(i(w),{key:1,class:"wpp-action-btn",type:"primary",loading:S.value,onClick:l[1]||(l[1]=e=>H(i(q).action))},{default:m(()=>[_(d(i(q).button_label),1)]),_:1},8,["loading"])),"undefined"!==i(q).description?(a(),c("p",{key:2,innerHTML:i(v)(null!==(o=null===(t=i(q))||void 0===t?void 0:t.description)&&void 0!==o?o:"")},null,8,C)):p("",!0)])])):(a(),c("div",h,[s("div",{class:y(i(q).classes)},[B.value?(a(),c("a",{key:0,id:i(q).id,href:i(q).link,target:L.value},d(i(q).button_label),9,T)):(a(),c("button",{key:1,id:i(q).id,type:i(q).action},d(i(q).button_label),9,A))],2)]))}}}))}}});
