"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),n=require("react"),o=require("../../types.js"),a=require("../utils.js"),u=require("./sharedHooks.js");require("../../../../utils/index.js");var c=require("../../../../utils/notificationToasts.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=i(e),f=i(t),l=i(r);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){s.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}exports.useMoveToFolder=function(){var e=u.useGet("set"),t=u.useGet("get");return n.useCallback(function(){var r=f.default(l.default.mark((function r(n,u){var i;return l.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,a.updateTemplate(t,e,n,(function(e){return{metadata:d(d({},e.metadata),{},{folderPath:u})}}),o.Action.UpdateMetadata);case 2:(i=r.sent)&&c.showSuccessNotification(u?'"'.concat(i.name,'" was moved to "').concat(u,'" folder'):'"'.concat(i.name,'" was moved out of the folder'));case 4:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),[t,e])};
//# sourceMappingURL=useMoveToFolder.js.map
