import t from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/slicedToArray";import i from"@babel/runtime/regenerator";import{useState as e,useEffect as s}from"react";import"lodash";import"@babel/runtime/helpers/toConsumableArray";import"@babel/runtime/helpers/defineProperty";import"uuid";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../../clients/jsonApi/index.js";import"../../../../clients/subscriptions/constants.js";import"../../../../clients/subscriptions.v1.js";import"../../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../../clients/api/apiCore.js";import"../../../../clients/constants.js";import"../../../../clients/sso/auth0.js";import"../../../../clients/sso/oauth2.js";import"../../../../clients/api/rateLimiter.js";import{fetchCompanies as o}from"../../api/companies/fetchCompanies.js";import"../../constants.js";import"../../api/shared/dataFormatter.js";var n=function(n){var p=e(null),a=r(p,2),m=a[0],c=a[1];return s((function(){function r(){return(r=t(i.mark((function t(){var r,e,s;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!n){t.next=6;break}return t.next=3,o();case 3:t.t0=t.sent,t.next=7;break;case 6:t.t0=[];case 7:e=t.t0,s=(null===(r=e.find((function(t){return t.id===n})))||void 0===r?void 0:r.provider)||null,c(s);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}c(null),function(){r.apply(this,arguments)}()}),[n]),[m]};export{n as useCompanyProvider};
//# sourceMappingURL=useCompanyProvider.js.map
