"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/toConsumableArray"),r=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),a=require("react"),u=require("../utils.js"),n=require("./sharedHooks.js"),s=require("../../../../clients/jsonApi/index.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(e),o=i(r),p=i(t);exports.usePublishTemplate=function(){var e=n.useGet("get"),r=n.useGet("set");return a.useCallback(function(){var t=o.default(p.default.mark((function t(a,n,i){var o,c,d,f;return p.default.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=i.rigIds,c=i.programIds,d=n.trim(),t.t0=u.dataFormatter,t.next=5,s.publishAppSettingsTemplate(e().appKey,a,{name:d,metadata:{rigIds:o,programIds:c}});case 5:t.t1=t.sent,f=t.t0.deserialize.call(t.t0,t.t1),r((function(e){var r=e.loadedTemplates;return{loadedTemplates:[].concat(l.default(r),[f])}}));case 8:case"end":return t.stop()}}),t)})));return function(e,r,a){return t.apply(this,arguments)}}(),[e,r])};
//# sourceMappingURL=usePublishTemplate.js.map
