import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/regenerator";import{useCallback as t}from"react";import{findTemplate as o,setBusy as n,getUpdatedTemplates as s}from"../utils.js";import{Action as a}from"../../types.js";import{useGet as i}from"./sharedHooks.js";import{shareAppSettingsTemplate as c}from"../../../../clients/jsonApi/index.js";import"../../../../utils/index.js";import{showSuccessNotification as p}from"../../../../utils/notificationToasts.js";var m=function(){var m=i("get"),u=i("set");return t(function(){var t=r(e.mark((function r(t,i){var l,f,d;return e.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l=n(u,t,a.Share),r.prev=1,f=s(m,t,{shared_with:i}),u({loadedTemplates:f}),r.next=6,c(m().appKey,t,i);case 6:d=o(m,t),p('"'.concat(null==d?void 0:d.name,'" was successfully shared.')),r.next=13;break;case 10:r.prev=10,r.t0=r.catch(1),console.error(r.t0);case 13:l();case 14:case"end":return r.stop()}}),r,null,[[1,10]])})));return function(r,e){return t.apply(this,arguments)}}(),[m,u])};export{m as useShareTemplate};
//# sourceMappingURL=useShareTemplate.js.map
