"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("react");require("../clients/subscriptions/constants.js"),require("@babel/runtime/helpers/slicedToArray"),require("@babel/runtime/helpers/asyncToGenerator"),require("@babel/runtime/regenerator"),require("querystring"),require("uuid/v1"),require("lodash"),require("../clients/subscriptions.v1.js"),require("../clients/jsonApi/index.js"),require("../clients/subscriptions/subscriptions-client.factory.js"),require("immutable"),require("query-string"),require("../constants/goals.js"),require("../constants/segment.js"),require("../constants/alerts.js"),require("../constants/apps.js"),require("../constants/drillstring.js"),require("../constants/completion.js"),require("../constants/appPackages.js"),require("../constants/notifications.js"),require("../constants/feed.js"),require("../constants/bha.js"),require("../constants/corvaCompanyId.js"),require("../components/GradientManager/configuration/constants.js"),require("../utils/index.js"),require("uuid"),require("jsona"),require("../utils/env.js"),require("../components/StatusBadge/constants.js"),require("@babel/runtime/helpers/toConsumableArray"),require("lodash/set"),require("lodash/get"),require("lodash/unset"),require("moment"),require("../clients/api/apiCore.js"),require("../clients/constants.js"),require("../clients/sso/auth0.js"),require("../clients/sso/oauth2.js"),require("../clients/api/rateLimiter.js"),require("lodash/isEmpty"),require("lodash/sortBy"),require("../constants/streamSourceType.js"),require("../components/DevCenter/DevCenterAppContainer/components/CommentsSwitch/CommentsSwitchContext.js"),require("../componentsV2/AppCommonsProvider/AppCommonsProvider.js");var t=require("../componentsV2/AppCommonsProvider/AppCommonsContext.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../componentsV2/AppSettings/AppSettingsPinningContext.js");var n=s(e);function i(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,s)}return t}function o(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?i(Object(t),!0).forEach((function(r){n.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}exports.useGlobalOffsetWellsSync=function(e,s,n){var i=t.useAppCommons(),u=null==i?void 0:i.globalOffsetWells,c=null==i?void 0:i.globalOffsetWellsVersion,a=r.useRef();r.useEffect((function(){if(u&&Array.isArray(u)&&void 0!==c)if(void 0!==a.current){if(a.current!==c){a.current=c;var r=u.slice(0,n),t=r.map((function(e){return e.id}));s(o(o({},e||{}),{},{selectedWellIds:t}),r)}}else a.current=c}),[c,u,n,e,s])};
//# sourceMappingURL=useGlobalOffsetWellsSync.js.map
