synapse-react-client 3.3.6 → 3.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
20
20
  return __privateGet(obj, member, getter);
21
21
  }
22
22
  });
23
- /*! SRC v3.3.6 */
23
+ /*! SRC v3.3.8 */
24
24
 
25
25
  var _focused, _cleanup, _setup, _a2, _online, _cleanup2, _setup2, _b, _gcTimeout, _c, _initialState, _revertState, _cache, _promise, _retryer, _observers, _defaultOptions, _abortSignalConsumed, _Query_instances, setOptions_fn, dispatch_fn, _d, _queries, _e2, _observers2, _defaultOptions2, _mutationCache, _retryer2, _Mutation_instances, dispatch_fn2, _f, _mutations, _mutationId, _resuming, _g, _queryCache, _mutationCache2, _defaultOptions3, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h, _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _QueryObserver_instances, executeFetch_fn, updateStaleTimeout_fn, computeRefetchInterval_fn, updateRefetchInterval_fn, updateTimers_fn, clearStaleTimeout_fn, clearRefetchInterval_fn, updateQuery_fn, notify_fn, _i, _client2, _result, _queries2, _observers3, _options, _combinedResult, _QueriesObserver_instances, setResult_fn, combineResult_fn, findMatchingObservers_fn, onUpdate_fn, notify_fn2, _j, _client3, _currentResult2, _currentMutation, _mutateOptions, _MutationObserver_instances, updateResult_fn, notify_fn3, _k, _l;
26
26
  function _interopNamespaceDefault(e2) {
@@ -7647,7 +7647,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
7647
7647
  const functionName = getFunctionComponentName(innerType);
7648
7648
  return outerType.displayName || (functionName !== "" ? `${wrapperName}(${functionName})` : wrapperName);
7649
7649
  }
7650
- function getDisplayName$2(Component) {
7650
+ function getDisplayName$3(Component) {
7651
7651
  if (Component == null) {
7652
7652
  return void 0;
7653
7653
  }
@@ -7669,9 +7669,9 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
7669
7669
  }
7670
7670
  return void 0;
7671
7671
  }
7672
- const getDisplayName$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7672
+ const getDisplayName$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7673
7673
  __proto__: null,
7674
- default: getDisplayName$2,
7674
+ default: getDisplayName$3,
7675
7675
  getFunctionName
7676
7676
  }, Symbol.toStringTag, { value: "Module" }));
7677
7677
  const _excluded$24 = ["ownerState"], _excluded2$k = ["variants"], _excluded3$8 = ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"];
@@ -7866,7 +7866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
7866
7866
  displayName = `${componentName}${capitalize$1(componentSlot || "")}`;
7867
7867
  }
7868
7868
  if (displayName === void 0) {
7869
- displayName = `Styled(${getDisplayName$2(tag)})`;
7869
+ displayName = `Styled(${getDisplayName$3(tag)})`;
7870
7870
  }
7871
7871
  Component.displayName = displayName;
7872
7872
  }
@@ -9872,7 +9872,7 @@ Please use another name.` : formatMuiErrorMessage$1(18));
9872
9872
  const require$$1 = /* @__PURE__ */ getAugmentedNamespace(styledEngine);
9873
9873
  const require$$4 = /* @__PURE__ */ getAugmentedNamespace(deepmerge);
9874
9874
  const require$$5 = /* @__PURE__ */ getAugmentedNamespace(capitalize);
9875
- const require$$6 = /* @__PURE__ */ getAugmentedNamespace(getDisplayName$1);
9875
+ const require$$6 = /* @__PURE__ */ getAugmentedNamespace(getDisplayName$2);
9876
9876
  const require$$7 = /* @__PURE__ */ getAugmentedNamespace(createTheme$2);
9877
9877
  const require$$8 = /* @__PURE__ */ getAugmentedNamespace(styleFunctionSx);
9878
9878
  var _interopRequireDefault$c = interopRequireDefaultExports;
@@ -39915,6 +39915,7 @@ Please use another name.` : formatMuiErrorMessage$1(18));
39915
39915
  }) => {
39916
39916
  return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]);
39917
39917
  };
39918
+ var defaultThrowOnError = (_error, query) => typeof query.state.data === "undefined";
39918
39919
  var ensureStaleTime = (defaultedOptions) => {
39919
39920
  if (defaultedOptions.suspense) {
39920
39921
  if (typeof defaultedOptions.staleTime !== "number") {
@@ -40063,6 +40064,17 @@ Please use another name.` : formatMuiErrorMessage$1(18));
40063
40064
  function useQuery(options2, queryClient) {
40064
40065
  return useBaseQuery(options2, QueryObserver);
40065
40066
  }
40067
+ function useSuspenseQuery(options2, queryClient) {
40068
+ return useBaseQuery(
40069
+ {
40070
+ ...options2,
40071
+ enabled: true,
40072
+ suspense: true,
40073
+ throwOnError: defaultThrowOnError
40074
+ },
40075
+ QueryObserver
40076
+ );
40077
+ }
40066
40078
  function useMutation(options2, queryClient) {
40067
40079
  const client = useQueryClient();
40068
40080
  const [observer] = React__namespace.useState(
@@ -40705,6 +40717,7 @@ Please use another name.` : formatMuiErrorMessage$1(18));
40705
40717
  FeatureFlagEnum2["DESCRIPTION_FIELD"] = "DESCRIPTION_FIELD";
40706
40718
  FeatureFlagEnum2["VIRTUALTABLE_SUPPORT"] = "VIRTUALTABLE_SUPPORT";
40707
40719
  FeatureFlagEnum2["JSONSCHEMA_VALIDATION_STATUS"] = "JSONSCHEMA_VALIDATION_STATUS";
40720
+ FeatureFlagEnum2["REACT_ENTITY_ACL_EDITOR"] = "REACT_ENTITY_ACL_EDITOR";
40708
40721
  return FeatureFlagEnum2;
40709
40722
  })(FeatureFlagEnum || {});
40710
40723
  var S3_FILE_HANDLE_CONCRETE_TYPE_VALUE = "org.sagebionetworks.repo.model.file.S3FileHandle";
@@ -40848,6 +40861,26 @@ Please use another name.` : formatMuiErrorMessage$1(18));
40848
40861
  RestrictionLevel2["CONTROLLED_BY_ACT"] = "CONTROLLED_BY_ACT";
40849
40862
  return RestrictionLevel2;
40850
40863
  })(RestrictionLevel || {});
40864
+ var SearchFieldName = /* @__PURE__ */ ((SearchFieldName2) => {
40865
+ SearchFieldName2["ID"] = "Id";
40866
+ SearchFieldName2["NAME"] = "Name";
40867
+ SearchFieldName2["DESCRIPTION"] = "Description";
40868
+ SearchFieldName2["ENTITY_TYPE"] = "EntityType";
40869
+ SearchFieldName2["MODIFIED_BY"] = "ModifiedBy";
40870
+ SearchFieldName2["MODIFIED_ON"] = "ModifiedOn";
40871
+ SearchFieldName2["CREATED_BY"] = "CreatedBy";
40872
+ SearchFieldName2["CREATED_ON"] = "CreatedOn";
40873
+ SearchFieldName2["CONSORTIUM"] = "Consortium";
40874
+ SearchFieldName2["DIAGNOSIS"] = "Diagnosis";
40875
+ SearchFieldName2["ORGAN"] = "Organ";
40876
+ SearchFieldName2["TISSUE"] = "Tissue";
40877
+ return SearchFieldName2;
40878
+ })(SearchFieldName || {});
40879
+ var SearchFacetSort = /* @__PURE__ */ ((SearchFacetSort2) => {
40880
+ SearchFacetSort2["ALPHA"] = "ALPHA";
40881
+ SearchFacetSort2["COUNT"] = "COUNT";
40882
+ return SearchFacetSort2;
40883
+ })(SearchFacetSort || {});
40851
40884
  var SubscriptionObjectType = /* @__PURE__ */ ((SubscriptionObjectType2) => {
40852
40885
  SubscriptionObjectType2["FORUM"] = "FORUM";
40853
40886
  SubscriptionObjectType2["THREAD"] = "THREAD";
@@ -46405,7 +46438,7 @@ Please use another name.` : formatMuiErrorMessage$1(18));
46405
46438
  lightPrimary: { ...generatePalette("#f8f9fa"), contrastText: "#164B6E" },
46406
46439
  light: { ...generatePalette("#f8f9fa"), contrastText: "#22252a" },
46407
46440
  // grey-1000
46408
- success: { main: "#32a330" },
46441
+ success: { main: "#32a330", contrastText: "#ffffff" },
46409
46442
  info: { main: "#017fa5" },
46410
46443
  warning: { main: "#cc9f00" },
46411
46444
  error: { main: "#c13415" },
@@ -49514,6 +49547,44 @@ Please use another name.` : formatMuiErrorMessage$1(18));
49514
49547
  } else return void 0;
49515
49548
  }
49516
49549
  }
49550
+ function useGetEntityBundleQueryOptions(entityId, version2, bundleRequest = ALL_ENTITY_BUNDLE_FIELDS) {
49551
+ const { accessToken, keyFactory } = useSynapseContext();
49552
+ return {
49553
+ queryKey: keyFactory.getEntityBundleQueryKey(
49554
+ entityId,
49555
+ version2,
49556
+ bundleRequest
49557
+ ),
49558
+ queryFn: () => SynapseClient.getEntityBundleV2(
49559
+ entityId,
49560
+ bundleRequest,
49561
+ version2,
49562
+ accessToken
49563
+ )
49564
+ };
49565
+ }
49566
+ function useGetEntityBundle(entityId, version2, bundleRequest = ALL_ENTITY_BUNDLE_FIELDS, options2) {
49567
+ const queryOptions = useGetEntityBundleQueryOptions(
49568
+ entityId,
49569
+ version2,
49570
+ bundleRequest
49571
+ );
49572
+ return useQuery({
49573
+ ...options2,
49574
+ ...queryOptions
49575
+ });
49576
+ }
49577
+ function useSuspenseGetEntityBundle(entityId, version2, bundleRequest = ALL_ENTITY_BUNDLE_FIELDS, options2) {
49578
+ const queryOptions = useGetEntityBundleQueryOptions(
49579
+ entityId,
49580
+ version2,
49581
+ bundleRequest
49582
+ );
49583
+ return useSuspenseQuery({
49584
+ ...options2,
49585
+ ...queryOptions
49586
+ });
49587
+ }
49517
49588
  function useGetEntity(entityId, versionNumber, options2) {
49518
49589
  const { accessToken, keyFactory } = useSynapseContext();
49519
49590
  return useQuery({
@@ -49735,6 +49806,37 @@ Please use another name.` : formatMuiErrorMessage$1(18));
49735
49806
  queryFn: () => SynapseClient.getEntityPermissions(entityId, accessToken)
49736
49807
  });
49737
49808
  }
49809
+ const onMutateEntityAclSuccess = async (entityId, updatedACL, queryClient, keyFactory) => {
49810
+ const entityAclQueryKey = keyFactory.getEntityACLQueryKey(entityId);
49811
+ if (updatedACL) {
49812
+ queryClient.setQueryData(entityAclQueryKey, updatedACL);
49813
+ }
49814
+ await invalidateAllQueriesForEntity(
49815
+ queryClient,
49816
+ keyFactory,
49817
+ entityId,
49818
+ entityAclQueryKey
49819
+ );
49820
+ };
49821
+ function useCreateEntityACL(options2) {
49822
+ const queryClient = useQueryClient();
49823
+ const { accessToken, keyFactory } = useSynapseContext();
49824
+ return useMutation({
49825
+ ...options2,
49826
+ mutationFn: (acl) => SynapseClient.createEntityACL(acl, accessToken),
49827
+ onSuccess: async (updatedACL, variables, ctx) => {
49828
+ await onMutateEntityAclSuccess(
49829
+ updatedACL.id,
49830
+ updatedACL,
49831
+ queryClient,
49832
+ keyFactory
49833
+ );
49834
+ if (options2 == null ? void 0 : options2.onSuccess) {
49835
+ await options2.onSuccess(updatedACL, variables, ctx);
49836
+ }
49837
+ }
49838
+ });
49839
+ }
49738
49840
  function useUpdateEntityACL(options2) {
49739
49841
  const queryClient = useQueryClient();
49740
49842
  const { accessToken, keyFactory } = useSynapseContext();
@@ -49742,13 +49844,11 @@ Please use another name.` : formatMuiErrorMessage$1(18));
49742
49844
  ...options2,
49743
49845
  mutationFn: (acl) => SynapseClient.updateEntityACL(acl, accessToken),
49744
49846
  onSuccess: async (updatedACL, variables, ctx) => {
49745
- const entityAclQueryKey = keyFactory.getEntityACLQueryKey(updatedACL.id);
49746
- queryClient.setQueryData(entityAclQueryKey, updatedACL);
49747
- await invalidateAllQueriesForEntity(
49748
- queryClient,
49749
- keyFactory,
49847
+ await onMutateEntityAclSuccess(
49750
49848
  updatedACL.id,
49751
- entityAclQueryKey
49849
+ updatedACL,
49850
+ queryClient,
49851
+ keyFactory
49752
49852
  );
49753
49853
  if (options2 == null ? void 0 : options2.onSuccess) {
49754
49854
  await options2.onSuccess(updatedACL, variables, ctx);
@@ -49756,6 +49856,40 @@ Please use another name.` : formatMuiErrorMessage$1(18));
49756
49856
  }
49757
49857
  });
49758
49858
  }
49859
+ function useDeleteEntityACL(options2) {
49860
+ const queryClient = useQueryClient();
49861
+ const { accessToken, keyFactory } = useSynapseContext();
49862
+ return useMutation({
49863
+ ...options2,
49864
+ mutationFn: (entityId) => SynapseClient.deleteEntityACL(entityId, accessToken),
49865
+ onSuccess: async (result, entityId, ctx) => {
49866
+ await onMutateEntityAclSuccess(entityId, null, queryClient, keyFactory);
49867
+ if (options2 == null ? void 0 : options2.onSuccess) {
49868
+ await options2.onSuccess(result, entityId, ctx);
49869
+ }
49870
+ }
49871
+ });
49872
+ }
49873
+ function useGetEntityBenefactorACLQueryOptions(entityId) {
49874
+ const opts = useGetEntityBundleQueryOptions(
49875
+ entityId,
49876
+ void 0,
49877
+ {
49878
+ includeBenefactorACL: true
49879
+ }
49880
+ );
49881
+ return {
49882
+ ...opts,
49883
+ select: (data) => data.benefactorAcl
49884
+ };
49885
+ }
49886
+ function useSuspenseGetEntityBenefactorACL(entityId, options2) {
49887
+ const queryOptions = useGetEntityBenefactorACLQueryOptions(entityId);
49888
+ return useSuspenseQuery({
49889
+ ...options2,
49890
+ ...queryOptions
49891
+ });
49892
+ }
49759
49893
  function useUpdateTableColumns(options2) {
49760
49894
  const queryClient = useQueryClient();
49761
49895
  const { accessToken, keyFactory } = useSynapseContext();
@@ -49798,23 +49932,6 @@ Please use another name.` : formatMuiErrorMessage$1(18));
49798
49932
  queryFn: () => SynapseClient.getSchemaValidationResults(entityId, accessToken)
49799
49933
  });
49800
49934
  }
49801
- function useGetEntityBundle(entityId, version2, bundleRequest = ALL_ENTITY_BUNDLE_FIELDS, options2) {
49802
- const { accessToken, keyFactory } = useSynapseContext();
49803
- return useQuery({
49804
- ...options2,
49805
- queryKey: keyFactory.getEntityBundleQueryKey(
49806
- entityId,
49807
- version2,
49808
- bundleRequest
49809
- ),
49810
- queryFn: () => SynapseClient.getEntityBundleV2(
49811
- entityId,
49812
- bundleRequest,
49813
- version2,
49814
- accessToken
49815
- )
49816
- });
49817
- }
49818
49935
  function useGetEntityActionsRequired(entityId, options2) {
49819
49936
  const { accessToken, keyFactory } = useSynapseContext();
49820
49937
  return useQuery({
@@ -50982,12 +51099,14 @@ Please use another name.` : formatMuiErrorMessage$1(18));
50982
51099
  useCreateAccessRequirement,
50983
51100
  useCreateAccessRequirementACL,
50984
51101
  useCreateEntity,
51102
+ useCreateEntityACL,
50985
51103
  useCreateLockAccessRequirement,
50986
51104
  useCreateOAuthClient,
50987
51105
  useCreateTeam,
50988
51106
  useCreateWikiPage,
50989
51107
  useDeleteAccessRequirementACL,
50990
51108
  useDeleteEntity,
51109
+ useDeleteEntityACL,
50991
51110
  useDeleteOAuthClient,
50992
51111
  useDeleteTeamMembership,
50993
51112
  useDisableTwoFactorAuth,
@@ -51018,6 +51137,7 @@ Please use another name.` : formatMuiErrorMessage$1(18));
51018
51137
  useGetEntityActionsRequired,
51019
51138
  useGetEntityAlias,
51020
51139
  useGetEntityBundle,
51140
+ useGetEntityBundleQueryOptions,
51021
51141
  useGetEntityChallenge,
51022
51142
  useGetEntityChildren,
51023
51143
  useGetEntityChildrenInfinite,
@@ -51091,6 +51211,9 @@ Please use another name.` : formatMuiErrorMessage$1(18));
51091
51211
  useSortAccessRequirementIdsByCompletion,
51092
51212
  useStartTwoFactorEnrollment,
51093
51213
  useSubmitDataAccessRequest,
51214
+ useSuspenseGetCurrentUserProfile,
51215
+ useSuspenseGetEntityBenefactorACL,
51216
+ useSuspenseGetEntityBundle,
51094
51217
  useUpdateAccessRequirement,
51095
51218
  useUpdateAccessRequirementACL,
51096
51219
  useUpdateDataAccessRequest,
@@ -53521,9 +53644,6 @@ Please use another name.` : formatMuiErrorMessage$1(18));
53521
53644
  return response.responseBody;
53522
53645
  };
53523
53646
  const getQueryTableAsyncJobResults = async (queryBundleRequest, accessToken, setCurrentAsyncStatus) => {
53524
- console.log(
53525
- `Querying ${getEndpoint(BackendDestinationEnum.PORTAL_ENDPOINT)}Synapse:${queryBundleRequest.entityId}`
53526
- );
53527
53647
  const asyncJobId = await doPost(
53528
53648
  TABLE_QUERY_ASYNC_START(queryBundleRequest.entityId),
53529
53649
  queryBundleRequest,
@@ -53864,6 +53984,14 @@ Please use another name.` : formatMuiErrorMessage$1(18));
53864
53984
  );
53865
53985
  return batchResult.results[0];
53866
53986
  };
53987
+ const createEntityACL = (acl, accessToken = void 0) => {
53988
+ return doPost(
53989
+ ENTITY_ACL(acl.id),
53990
+ acl,
53991
+ accessToken,
53992
+ BackendDestinationEnum.REPO_ENDPOINT
53993
+ );
53994
+ };
53867
53995
  const updateEntityACL = (acl, accessToken = void 0) => {
53868
53996
  return doPut(
53869
53997
  ENTITY_ACL(acl.id),
@@ -53872,6 +54000,13 @@ Please use another name.` : formatMuiErrorMessage$1(18));
53872
54000
  BackendDestinationEnum.REPO_ENDPOINT
53873
54001
  );
53874
54002
  };
54003
+ const deleteEntityACL = (id2, accessToken = void 0) => {
54004
+ return doDelete(
54005
+ ENTITY_ACL(id2),
54006
+ accessToken,
54007
+ BackendDestinationEnum.REPO_ENDPOINT
54008
+ );
54009
+ };
53875
54010
  const updateEntity = (entity2, accessToken = void 0, newVersion) => {
53876
54011
  let url = `/repo/v1/entity/${entity2.id}`;
53877
54012
  if (newVersion) url += "?newVersion=true";
@@ -56020,6 +56155,7 @@ Please use another name.` : formatMuiErrorMessage$1(18));
56020
56155
  createAccessRequirementAcl,
56021
56156
  createColumnModels,
56022
56157
  createEntity,
56158
+ createEntityACL,
56023
56159
  createEvaluation,
56024
56160
  createEvaluationRound,
56025
56161
  createFormData,
@@ -56043,6 +56179,7 @@ Please use another name.` : formatMuiErrorMessage$1(18));
56043
56179
  deleteDownloadListFiles,
56044
56180
  deleteEmail,
56045
56181
  deleteEntity,
56182
+ deleteEntityACL,
56046
56183
  deleteEvaluation,
56047
56184
  deleteEvaluationRound,
56048
56185
  deleteFormData,
@@ -56269,13 +56406,26 @@ Please use another name.` : formatMuiErrorMessage$1(18));
56269
56406
  queryFn: () => SynapseClient.getNotificationEmail(accessToken)
56270
56407
  });
56271
56408
  }
56272
- function useGetCurrentUserProfile(options2) {
56409
+ function useGetCurrentUserProfileQueryOptions() {
56273
56410
  const { accessToken, keyFactory } = useSynapseContext();
56274
56411
  const queryKey = keyFactory.getCurrentUserProfileQueryKey();
56275
- return useQuery({
56276
- ...options2,
56412
+ return {
56277
56413
  queryKey,
56278
56414
  queryFn: () => SynapseClient.getUserProfile(accessToken)
56415
+ };
56416
+ }
56417
+ function useGetCurrentUserProfile(options2) {
56418
+ const queryOptions = useGetCurrentUserProfileQueryOptions();
56419
+ return useQuery({
56420
+ ...options2,
56421
+ ...queryOptions
56422
+ });
56423
+ }
56424
+ function useSuspenseGetCurrentUserProfile(options2) {
56425
+ const queryOptions = useGetCurrentUserProfileQueryOptions();
56426
+ return useSuspenseQuery({
56427
+ ...options2,
56428
+ ...queryOptions
56279
56429
  });
56280
56430
  }
56281
56431
  const ALL_USER_BUNDLE_FIELDS = USER_BUNDLE_MASK_USER_PROFILE | USER_BUNDLE_MASK_ORCID | USER_BUNDLE_MASK_VERIFICATION_SUBMISSION | USER_BUNDLE_MASK_IS_CERTIFIED | USER_BUNDLE_MASK_IS_VERIFIED | USER_BUNDLE_MASK_IS_ACT_MEMBER | USER_BUNDLE_MASK_IS_AR_REVIEWER;
@@ -93763,11 +93913,16 @@ ${e2.message}`);
93763
93913
  return queryRequestClone;
93764
93914
  }
93765
93915
  function useTableQueryReducer(initQueryRequest, requireConfirmationOnChange, onQueryChange) {
93916
+ const [resetDebounceCounter, setResetDebounceCounter] = React$2.useState(0);
93766
93917
  const [commitAfterDebounce, setCommitAfterDebounce] = React$2.useState(false);
93767
93918
  const [state, dispatch2] = React$2.useReducer(
93768
93919
  (prevState, action) => {
93769
93920
  let updatedNextQueryRequest = prevState.nextQueryRequest;
93770
93921
  switch (action.type) {
93922
+ case "resetDebounce": {
93923
+ setResetDebounceCounter((v2) => v2 + 1);
93924
+ return prevState;
93925
+ }
93771
93926
  case "setQuery": {
93772
93927
  updatedNextQueryRequest = getQueryFromSetStateAction(
93773
93928
  action,
@@ -93896,15 +94051,27 @@ ${e2.message}`);
93896
94051
  }
93897
94052
  },
93898
94053
  // nextQueryRequest MUST be included in the dependencies to ensure the debounce resets when it changes
93899
- [state.nextQueryRequest, commitAfterDebounce, setCommitAfterDebounce],
94054
+ [
94055
+ state.nextQueryRequest,
94056
+ commitAfterDebounce,
94057
+ setCommitAfterDebounce,
94058
+ resetDebounceCounter
94059
+ ],
93900
94060
  DEBOUNCE_DELAY_MS
93901
94061
  );
93902
- return {
93903
- currentQueryRequest: state.currentQueryRequest,
93904
- nextQueryRequest: state.nextQueryRequest,
93905
- isConfirmingChange: state.isConfirmingChange,
93906
- dispatch: dispatch2
93907
- };
94062
+ return React$2.useMemo(
94063
+ () => ({
94064
+ currentQueryRequest: state.currentQueryRequest,
94065
+ nextQueryRequest: state.nextQueryRequest,
94066
+ isConfirmingChange: state.isConfirmingChange,
94067
+ dispatch: dispatch2
94068
+ }),
94069
+ [
94070
+ state.currentQueryRequest,
94071
+ state.isConfirmingChange,
94072
+ state.nextQueryRequest
94073
+ ]
94074
+ );
93908
94075
  }
93909
94076
  const DEBOUNCE_DELAY_MS = 750;
93910
94077
  function useImmutableTableQuery(options2) {
@@ -94081,9 +94248,13 @@ ${e2.message}`);
94081
94248
  const commitChanges = React$2.useCallback(() => {
94082
94249
  dispatch2({ type: "commitChanges" });
94083
94250
  }, [dispatch2]);
94251
+ const resetDebounceTimer = React$2.useCallback(() => {
94252
+ dispatch2({ type: "resetDebounce" });
94253
+ }, [dispatch2]);
94084
94254
  return {
94085
94255
  entityId,
94086
94256
  commitChanges,
94257
+ resetDebounceTimer,
94087
94258
  currentQueryRequest,
94088
94259
  nextQueryRequest,
94089
94260
  versionNumber,
@@ -94335,7 +94506,8 @@ ${e2.message}`);
94335
94506
  nextQueryRequest,
94336
94507
  currentQueryRequest,
94337
94508
  addValueToSelectedFacet: addValueToSelectedFacet2,
94338
- setRangeFacetValue: setRangeFacetValue2
94509
+ setRangeFacetValue: setRangeFacetValue2,
94510
+ resetDebounceTimer
94339
94511
  } = immutableTableQueryResult;
94340
94512
  const lastQueryRequest = React$2.useMemo(() => {
94341
94513
  return getCurrentQueryRequest();
@@ -94437,6 +94609,7 @@ ${e2.message}`);
94437
94609
  addValueToSelectedFacet: addValueToSelectedFacet2,
94438
94610
  combineRangeFacetConfig,
94439
94611
  setRangeFacetValue: setRangeFacetValue2,
94612
+ resetDebounceTimer,
94440
94613
  ...paginationControls
94441
94614
  });
94442
94615
  const { children: children2 } = props;
@@ -94524,650 +94697,6 @@ ${e2.message}`);
94524
94697
  )
94525
94698
  ] });
94526
94699
  };
94527
- var resizeObservers = [];
94528
- var hasActiveObservations = function() {
94529
- return resizeObservers.some(function(ro) {
94530
- return ro.activeTargets.length > 0;
94531
- });
94532
- };
94533
- var hasSkippedObservations = function() {
94534
- return resizeObservers.some(function(ro) {
94535
- return ro.skippedTargets.length > 0;
94536
- });
94537
- };
94538
- var msg = "ResizeObserver loop completed with undelivered notifications.";
94539
- var deliverResizeLoopError = function() {
94540
- var event;
94541
- if (typeof ErrorEvent === "function") {
94542
- event = new ErrorEvent("error", {
94543
- message: msg
94544
- });
94545
- } else {
94546
- event = document.createEvent("Event");
94547
- event.initEvent("error", false, false);
94548
- event.message = msg;
94549
- }
94550
- window.dispatchEvent(event);
94551
- };
94552
- var ResizeObserverBoxOptions;
94553
- (function(ResizeObserverBoxOptions2) {
94554
- ResizeObserverBoxOptions2["BORDER_BOX"] = "border-box";
94555
- ResizeObserverBoxOptions2["CONTENT_BOX"] = "content-box";
94556
- ResizeObserverBoxOptions2["DEVICE_PIXEL_CONTENT_BOX"] = "device-pixel-content-box";
94557
- })(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {}));
94558
- var freeze = function(obj) {
94559
- return Object.freeze(obj);
94560
- };
94561
- var ResizeObserverSize = /* @__PURE__ */ function() {
94562
- function ResizeObserverSize2(inlineSize, blockSize) {
94563
- this.inlineSize = inlineSize;
94564
- this.blockSize = blockSize;
94565
- freeze(this);
94566
- }
94567
- return ResizeObserverSize2;
94568
- }();
94569
- var DOMRectReadOnly$1 = function() {
94570
- function DOMRectReadOnly2(x2, y2, width2, height2) {
94571
- this.x = x2;
94572
- this.y = y2;
94573
- this.width = width2;
94574
- this.height = height2;
94575
- this.top = this.y;
94576
- this.left = this.x;
94577
- this.bottom = this.top + this.height;
94578
- this.right = this.left + this.width;
94579
- return freeze(this);
94580
- }
94581
- DOMRectReadOnly2.prototype.toJSON = function() {
94582
- var _a3 = this, x2 = _a3.x, y2 = _a3.y, top2 = _a3.top, right2 = _a3.right, bottom2 = _a3.bottom, left2 = _a3.left, width2 = _a3.width, height2 = _a3.height;
94583
- return { x: x2, y: y2, top: top2, right: right2, bottom: bottom2, left: left2, width: width2, height: height2 };
94584
- };
94585
- DOMRectReadOnly2.fromRect = function(rectangle) {
94586
- return new DOMRectReadOnly2(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
94587
- };
94588
- return DOMRectReadOnly2;
94589
- }();
94590
- var isSVG = function(target) {
94591
- return target instanceof SVGElement && "getBBox" in target;
94592
- };
94593
- var isHidden = function(target) {
94594
- if (isSVG(target)) {
94595
- var _a3 = target.getBBox(), width2 = _a3.width, height2 = _a3.height;
94596
- return !width2 && !height2;
94597
- }
94598
- var _b2 = target, offsetWidth = _b2.offsetWidth, offsetHeight = _b2.offsetHeight;
94599
- return !(offsetWidth || offsetHeight || target.getClientRects().length);
94600
- };
94601
- var isElement$1 = function(obj) {
94602
- var _a3;
94603
- if (obj instanceof Element) {
94604
- return true;
94605
- }
94606
- var scope2 = (_a3 = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a3 === void 0 ? void 0 : _a3.defaultView;
94607
- return !!(scope2 && obj instanceof scope2.Element);
94608
- };
94609
- var isReplacedElement = function(target) {
94610
- switch (target.tagName) {
94611
- case "INPUT":
94612
- if (target.type !== "image") {
94613
- break;
94614
- }
94615
- case "VIDEO":
94616
- case "AUDIO":
94617
- case "EMBED":
94618
- case "OBJECT":
94619
- case "CANVAS":
94620
- case "IFRAME":
94621
- case "IMG":
94622
- return true;
94623
- }
94624
- return false;
94625
- };
94626
- var global$1 = typeof window !== "undefined" ? window : {};
94627
- var cache = /* @__PURE__ */ new WeakMap();
94628
- var scrollRegexp = /auto|scroll/;
94629
- var verticalRegexp = /^tb|vertical/;
94630
- var IE = /msie|trident/i.test(global$1.navigator && global$1.navigator.userAgent);
94631
- var parseDimension = function(pixel) {
94632
- return parseFloat(pixel || "0");
94633
- };
94634
- var size$1 = function(inlineSize, blockSize, switchSizes) {
94635
- if (inlineSize === void 0) {
94636
- inlineSize = 0;
94637
- }
94638
- if (blockSize === void 0) {
94639
- blockSize = 0;
94640
- }
94641
- if (switchSizes === void 0) {
94642
- switchSizes = false;
94643
- }
94644
- return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
94645
- };
94646
- var zeroBoxes = freeze({
94647
- devicePixelContentBoxSize: size$1(),
94648
- borderBoxSize: size$1(),
94649
- contentBoxSize: size$1(),
94650
- contentRect: new DOMRectReadOnly$1(0, 0, 0, 0)
94651
- });
94652
- var calculateBoxSizes = function(target, forceRecalculation) {
94653
- if (forceRecalculation === void 0) {
94654
- forceRecalculation = false;
94655
- }
94656
- if (cache.has(target) && !forceRecalculation) {
94657
- return cache.get(target);
94658
- }
94659
- if (isHidden(target)) {
94660
- cache.set(target, zeroBoxes);
94661
- return zeroBoxes;
94662
- }
94663
- var cs = getComputedStyle(target);
94664
- var svg2 = isSVG(target) && target.ownerSVGElement && target.getBBox();
94665
- var removePadding = !IE && cs.boxSizing === "border-box";
94666
- var switchSizes = verticalRegexp.test(cs.writingMode || "");
94667
- var canScrollVertically = !svg2 && scrollRegexp.test(cs.overflowY || "");
94668
- var canScrollHorizontally = !svg2 && scrollRegexp.test(cs.overflowX || "");
94669
- var paddingTop = svg2 ? 0 : parseDimension(cs.paddingTop);
94670
- var paddingRight = svg2 ? 0 : parseDimension(cs.paddingRight);
94671
- var paddingBottom = svg2 ? 0 : parseDimension(cs.paddingBottom);
94672
- var paddingLeft = svg2 ? 0 : parseDimension(cs.paddingLeft);
94673
- var borderTop2 = svg2 ? 0 : parseDimension(cs.borderTopWidth);
94674
- var borderRight2 = svg2 ? 0 : parseDimension(cs.borderRightWidth);
94675
- var borderBottom2 = svg2 ? 0 : parseDimension(cs.borderBottomWidth);
94676
- var borderLeft2 = svg2 ? 0 : parseDimension(cs.borderLeftWidth);
94677
- var horizontalPadding = paddingLeft + paddingRight;
94678
- var verticalPadding = paddingTop + paddingBottom;
94679
- var horizontalBorderArea = borderLeft2 + borderRight2;
94680
- var verticalBorderArea = borderTop2 + borderBottom2;
94681
- var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight;
94682
- var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth;
94683
- var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0;
94684
- var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0;
94685
- var contentWidth = svg2 ? svg2.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness;
94686
- var contentHeight = svg2 ? svg2.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness;
94687
- var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea;
94688
- var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea;
94689
- var boxes = freeze({
94690
- devicePixelContentBoxSize: size$1(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),
94691
- borderBoxSize: size$1(borderBoxWidth, borderBoxHeight, switchSizes),
94692
- contentBoxSize: size$1(contentWidth, contentHeight, switchSizes),
94693
- contentRect: new DOMRectReadOnly$1(paddingLeft, paddingTop, contentWidth, contentHeight)
94694
- });
94695
- cache.set(target, boxes);
94696
- return boxes;
94697
- };
94698
- var calculateBoxSize = function(target, observedBox, forceRecalculation) {
94699
- var _a3 = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a3.borderBoxSize, contentBoxSize = _a3.contentBoxSize, devicePixelContentBoxSize = _a3.devicePixelContentBoxSize;
94700
- switch (observedBox) {
94701
- case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
94702
- return devicePixelContentBoxSize;
94703
- case ResizeObserverBoxOptions.BORDER_BOX:
94704
- return borderBoxSize;
94705
- default:
94706
- return contentBoxSize;
94707
- }
94708
- };
94709
- var ResizeObserverEntry = /* @__PURE__ */ function() {
94710
- function ResizeObserverEntry2(target) {
94711
- var boxes = calculateBoxSizes(target);
94712
- this.target = target;
94713
- this.contentRect = boxes.contentRect;
94714
- this.borderBoxSize = freeze([boxes.borderBoxSize]);
94715
- this.contentBoxSize = freeze([boxes.contentBoxSize]);
94716
- this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
94717
- }
94718
- return ResizeObserverEntry2;
94719
- }();
94720
- var calculateDepthForNode = function(node2) {
94721
- if (isHidden(node2)) {
94722
- return Infinity;
94723
- }
94724
- var depth = 0;
94725
- var parent2 = node2.parentNode;
94726
- while (parent2) {
94727
- depth += 1;
94728
- parent2 = parent2.parentNode;
94729
- }
94730
- return depth;
94731
- };
94732
- var broadcastActiveObservations = function() {
94733
- var shallowestDepth = Infinity;
94734
- var callbacks2 = [];
94735
- resizeObservers.forEach(function processObserver(ro) {
94736
- if (ro.activeTargets.length === 0) {
94737
- return;
94738
- }
94739
- var entries = [];
94740
- ro.activeTargets.forEach(function processTarget(ot) {
94741
- var entry = new ResizeObserverEntry(ot.target);
94742
- var targetDepth = calculateDepthForNode(ot.target);
94743
- entries.push(entry);
94744
- ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);
94745
- if (targetDepth < shallowestDepth) {
94746
- shallowestDepth = targetDepth;
94747
- }
94748
- });
94749
- callbacks2.push(function resizeObserverCallback() {
94750
- ro.callback.call(ro.observer, entries, ro.observer);
94751
- });
94752
- ro.activeTargets.splice(0, ro.activeTargets.length);
94753
- });
94754
- for (var _i2 = 0, callbacks_1 = callbacks2; _i2 < callbacks_1.length; _i2++) {
94755
- var callback = callbacks_1[_i2];
94756
- callback();
94757
- }
94758
- return shallowestDepth;
94759
- };
94760
- var gatherActiveObservationsAtDepth = function(depth) {
94761
- resizeObservers.forEach(function processObserver(ro) {
94762
- ro.activeTargets.splice(0, ro.activeTargets.length);
94763
- ro.skippedTargets.splice(0, ro.skippedTargets.length);
94764
- ro.observationTargets.forEach(function processTarget(ot) {
94765
- if (ot.isActive()) {
94766
- if (calculateDepthForNode(ot.target) > depth) {
94767
- ro.activeTargets.push(ot);
94768
- } else {
94769
- ro.skippedTargets.push(ot);
94770
- }
94771
- }
94772
- });
94773
- });
94774
- };
94775
- var process = function() {
94776
- var depth = 0;
94777
- gatherActiveObservationsAtDepth(depth);
94778
- while (hasActiveObservations()) {
94779
- depth = broadcastActiveObservations();
94780
- gatherActiveObservationsAtDepth(depth);
94781
- }
94782
- if (hasSkippedObservations()) {
94783
- deliverResizeLoopError();
94784
- }
94785
- return depth > 0;
94786
- };
94787
- var trigger;
94788
- var callbacks = [];
94789
- var notify = function() {
94790
- return callbacks.splice(0).forEach(function(cb) {
94791
- return cb();
94792
- });
94793
- };
94794
- var queueMicroTask = function(callback) {
94795
- if (!trigger) {
94796
- var toggle_1 = 0;
94797
- var el_1 = document.createTextNode("");
94798
- var config2 = { characterData: true };
94799
- new MutationObserver(function() {
94800
- return notify();
94801
- }).observe(el_1, config2);
94802
- trigger = function() {
94803
- el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
94804
- };
94805
- }
94806
- callbacks.push(callback);
94807
- trigger();
94808
- };
94809
- var queueResizeObserver = function(cb) {
94810
- queueMicroTask(function ResizeObserver2() {
94811
- requestAnimationFrame(cb);
94812
- });
94813
- };
94814
- var watching = 0;
94815
- var isWatching = function() {
94816
- return !!watching;
94817
- };
94818
- var CATCH_PERIOD = 250;
94819
- var observerConfig = { attributes: true, characterData: true, childList: true, subtree: true };
94820
- var events = [
94821
- "resize",
94822
- "load",
94823
- "transitionend",
94824
- "animationend",
94825
- "animationstart",
94826
- "animationiteration",
94827
- "keyup",
94828
- "keydown",
94829
- "mouseup",
94830
- "mousedown",
94831
- "mouseover",
94832
- "mouseout",
94833
- "blur",
94834
- "focus"
94835
- ];
94836
- var time = function(timeout2) {
94837
- if (timeout2 === void 0) {
94838
- timeout2 = 0;
94839
- }
94840
- return Date.now() + timeout2;
94841
- };
94842
- var scheduled = false;
94843
- var Scheduler = function() {
94844
- function Scheduler2() {
94845
- var _this = this;
94846
- this.stopped = true;
94847
- this.listener = function() {
94848
- return _this.schedule();
94849
- };
94850
- }
94851
- Scheduler2.prototype.run = function(timeout2) {
94852
- var _this = this;
94853
- if (timeout2 === void 0) {
94854
- timeout2 = CATCH_PERIOD;
94855
- }
94856
- if (scheduled) {
94857
- return;
94858
- }
94859
- scheduled = true;
94860
- var until = time(timeout2);
94861
- queueResizeObserver(function() {
94862
- var elementsHaveResized = false;
94863
- try {
94864
- elementsHaveResized = process();
94865
- } finally {
94866
- scheduled = false;
94867
- timeout2 = until - time();
94868
- if (!isWatching()) {
94869
- return;
94870
- }
94871
- if (elementsHaveResized) {
94872
- _this.run(1e3);
94873
- } else if (timeout2 > 0) {
94874
- _this.run(timeout2);
94875
- } else {
94876
- _this.start();
94877
- }
94878
- }
94879
- });
94880
- };
94881
- Scheduler2.prototype.schedule = function() {
94882
- this.stop();
94883
- this.run();
94884
- };
94885
- Scheduler2.prototype.observe = function() {
94886
- var _this = this;
94887
- var cb = function() {
94888
- return _this.observer && _this.observer.observe(document.body, observerConfig);
94889
- };
94890
- document.body ? cb() : global$1.addEventListener("DOMContentLoaded", cb);
94891
- };
94892
- Scheduler2.prototype.start = function() {
94893
- var _this = this;
94894
- if (this.stopped) {
94895
- this.stopped = false;
94896
- this.observer = new MutationObserver(this.listener);
94897
- this.observe();
94898
- events.forEach(function(name) {
94899
- return global$1.addEventListener(name, _this.listener, true);
94900
- });
94901
- }
94902
- };
94903
- Scheduler2.prototype.stop = function() {
94904
- var _this = this;
94905
- if (!this.stopped) {
94906
- this.observer && this.observer.disconnect();
94907
- events.forEach(function(name) {
94908
- return global$1.removeEventListener(name, _this.listener, true);
94909
- });
94910
- this.stopped = true;
94911
- }
94912
- };
94913
- return Scheduler2;
94914
- }();
94915
- var scheduler = new Scheduler();
94916
- var updateCount = function(n2) {
94917
- !watching && n2 > 0 && scheduler.start();
94918
- watching += n2;
94919
- !watching && scheduler.stop();
94920
- };
94921
- var skipNotifyOnElement = function(target) {
94922
- return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === "inline";
94923
- };
94924
- var ResizeObservation = function() {
94925
- function ResizeObservation2(target, observedBox) {
94926
- this.target = target;
94927
- this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX;
94928
- this.lastReportedSize = {
94929
- inlineSize: 0,
94930
- blockSize: 0
94931
- };
94932
- }
94933
- ResizeObservation2.prototype.isActive = function() {
94934
- var size2 = calculateBoxSize(this.target, this.observedBox, true);
94935
- if (skipNotifyOnElement(this.target)) {
94936
- this.lastReportedSize = size2;
94937
- }
94938
- if (this.lastReportedSize.inlineSize !== size2.inlineSize || this.lastReportedSize.blockSize !== size2.blockSize) {
94939
- return true;
94940
- }
94941
- return false;
94942
- };
94943
- return ResizeObservation2;
94944
- }();
94945
- var ResizeObserverDetail = /* @__PURE__ */ function() {
94946
- function ResizeObserverDetail2(resizeObserver, callback) {
94947
- this.activeTargets = [];
94948
- this.skippedTargets = [];
94949
- this.observationTargets = [];
94950
- this.observer = resizeObserver;
94951
- this.callback = callback;
94952
- }
94953
- return ResizeObserverDetail2;
94954
- }();
94955
- var observerMap = /* @__PURE__ */ new WeakMap();
94956
- var getObservationIndex = function(observationTargets, target) {
94957
- for (var i2 = 0; i2 < observationTargets.length; i2 += 1) {
94958
- if (observationTargets[i2].target === target) {
94959
- return i2;
94960
- }
94961
- }
94962
- return -1;
94963
- };
94964
- var ResizeObserverController = function() {
94965
- function ResizeObserverController2() {
94966
- }
94967
- ResizeObserverController2.connect = function(resizeObserver, callback) {
94968
- var detail = new ResizeObserverDetail(resizeObserver, callback);
94969
- observerMap.set(resizeObserver, detail);
94970
- };
94971
- ResizeObserverController2.observe = function(resizeObserver, target, options2) {
94972
- var detail = observerMap.get(resizeObserver);
94973
- var firstObservation = detail.observationTargets.length === 0;
94974
- if (getObservationIndex(detail.observationTargets, target) < 0) {
94975
- firstObservation && resizeObservers.push(detail);
94976
- detail.observationTargets.push(new ResizeObservation(target, options2 && options2.box));
94977
- updateCount(1);
94978
- scheduler.schedule();
94979
- }
94980
- };
94981
- ResizeObserverController2.unobserve = function(resizeObserver, target) {
94982
- var detail = observerMap.get(resizeObserver);
94983
- var index2 = getObservationIndex(detail.observationTargets, target);
94984
- var lastObservation = detail.observationTargets.length === 1;
94985
- if (index2 >= 0) {
94986
- lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);
94987
- detail.observationTargets.splice(index2, 1);
94988
- updateCount(-1);
94989
- }
94990
- };
94991
- ResizeObserverController2.disconnect = function(resizeObserver) {
94992
- var _this = this;
94993
- var detail = observerMap.get(resizeObserver);
94994
- detail.observationTargets.slice().forEach(function(ot) {
94995
- return _this.unobserve(resizeObserver, ot.target);
94996
- });
94997
- detail.activeTargets.splice(0, detail.activeTargets.length);
94998
- };
94999
- return ResizeObserverController2;
95000
- }();
95001
- var ResizeObserver$2 = function() {
95002
- function ResizeObserver2(callback) {
95003
- if (arguments.length === 0) {
95004
- throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
95005
- }
95006
- if (typeof callback !== "function") {
95007
- throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
95008
- }
95009
- ResizeObserverController.connect(this, callback);
95010
- }
95011
- ResizeObserver2.prototype.observe = function(target, options2) {
95012
- if (arguments.length === 0) {
95013
- throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
95014
- }
95015
- if (!isElement$1(target)) {
95016
- throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
95017
- }
95018
- ResizeObserverController.observe(this, target, options2);
95019
- };
95020
- ResizeObserver2.prototype.unobserve = function(target) {
95021
- if (arguments.length === 0) {
95022
- throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
95023
- }
95024
- if (!isElement$1(target)) {
95025
- throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
95026
- }
95027
- ResizeObserverController.unobserve(this, target);
95028
- };
95029
- ResizeObserver2.prototype.disconnect = function() {
95030
- ResizeObserverController.disconnect(this);
95031
- };
95032
- ResizeObserver2.toString = function() {
95033
- return "function ResizeObserver () { [polyfill code] }";
95034
- };
95035
- return ResizeObserver2;
95036
- }();
95037
- const usePassiveLayoutEffect = React$2[typeof document !== "undefined" && document.createElement !== void 0 ? "useLayoutEffect" : "useEffect"];
95038
- const useLatest = (current) => {
95039
- const storedValue = React__namespace.useRef(current);
95040
- React__namespace.useEffect(() => {
95041
- storedValue.current = current;
95042
- });
95043
- return storedValue;
95044
- };
95045
- const ResizeObserver$1 = typeof window !== "undefined" && "ResizeObserver" in window ? (
95046
- // @ts-ignore
95047
- window.ResizeObserver
95048
- ) : ResizeObserver$2;
95049
- function _ref$1() {
95050
- }
95051
- function useResizeObserver(target, callback) {
95052
- const resizeObserver = getResizeObserver();
95053
- const storedCallback = useLatest(callback);
95054
- usePassiveLayoutEffect(() => {
95055
- let didUnsubscribe = false;
95056
- const targetEl = target && "current" in target ? target.current : target;
95057
- if (!targetEl) return _ref$1;
95058
- function cb(entry, observer) {
95059
- if (didUnsubscribe) return;
95060
- storedCallback.current(entry, observer);
95061
- }
95062
- resizeObserver.subscribe(targetEl, cb);
95063
- return () => {
95064
- didUnsubscribe = true;
95065
- resizeObserver.unsubscribe(targetEl, cb);
95066
- };
95067
- }, [target, resizeObserver, storedCallback]);
95068
- return resizeObserver.observer;
95069
- }
95070
- function createResizeObserver() {
95071
- let ticking = false;
95072
- let allEntries = [];
95073
- const callbacks2 = /* @__PURE__ */ new Map();
95074
- const observer = new ResizeObserver$1((entries, obs) => {
95075
- allEntries = allEntries.concat(entries);
95076
- function _ref22() {
95077
- const triggered = /* @__PURE__ */ new Set();
95078
- for (let i2 = 0; i2 < allEntries.length; i2++) {
95079
- if (triggered.has(allEntries[i2].target)) continue;
95080
- triggered.add(allEntries[i2].target);
95081
- const cbs = callbacks2.get(allEntries[i2].target);
95082
- cbs === null || cbs === void 0 ? void 0 : cbs.forEach((cb) => cb(allEntries[i2], obs));
95083
- }
95084
- allEntries = [];
95085
- ticking = false;
95086
- }
95087
- if (!ticking) {
95088
- window.requestAnimationFrame(_ref22);
95089
- }
95090
- ticking = true;
95091
- });
95092
- return {
95093
- observer,
95094
- subscribe(target, callback) {
95095
- var _callbacks$get;
95096
- observer.observe(target);
95097
- const cbs = (_callbacks$get = callbacks2.get(target)) !== null && _callbacks$get !== void 0 ? _callbacks$get : [];
95098
- cbs.push(callback);
95099
- callbacks2.set(target, cbs);
95100
- },
95101
- unsubscribe(target, callback) {
95102
- var _callbacks$get2;
95103
- const cbs = (_callbacks$get2 = callbacks2.get(target)) !== null && _callbacks$get2 !== void 0 ? _callbacks$get2 : [];
95104
- if (cbs.length === 1) {
95105
- observer.unobserve(target);
95106
- callbacks2.delete(target);
95107
- return;
95108
- }
95109
- const cbIndex = cbs.indexOf(callback);
95110
- if (cbIndex !== -1) cbs.splice(cbIndex, 1);
95111
- callbacks2.set(target, cbs);
95112
- }
95113
- };
95114
- }
95115
- let _resizeObserver;
95116
- const getResizeObserver = () => !_resizeObserver ? _resizeObserver = createResizeObserver() : _resizeObserver;
95117
- function ExpandCollapseButton(props) {
95118
- const { isExpanded, ...buttonProps } = props;
95119
- return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { ...buttonProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
95120
- IconSvg,
95121
- {
95122
- icon: isExpanded ? "minusBoxOutline" : "addBoxOutline",
95123
- sx: {
95124
- color: "grey.600",
95125
- height: "16px",
95126
- verticalAlign: "top",
95127
- "&:hover": {
95128
- color: "grey.700"
95129
- }
95130
- }
95131
- }
95132
- ) });
95133
- }
95134
- function ExpandableTableDataCell(props) {
95135
- const [isExpanded, setIsExpanded] = React$2.useState(false);
95136
- const [isOverflowingWhenNotExpanded, setIsOverflowingWhenNotExpanded] = React$2.useState(false);
95137
- const tdRef = React$2.useRef(null);
95138
- useResizeObserver(tdRef, ({ target }) => {
95139
- if (!isExpanded) {
95140
- if (target) {
95141
- const contentElement = target.getElementsByTagName("p")[0];
95142
- if (contentElement) {
95143
- setIsOverflowingWhenNotExpanded(
95144
- contentElement.scrollHeight > contentElement.clientHeight || contentElement.scrollWidth > contentElement.clientWidth
95145
- );
95146
- }
95147
- }
95148
- }
95149
- });
95150
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(
95151
- "td",
95152
- {
95153
- ...props,
95154
- className: `ExpandableTableData ${props.className ? props.className : ""}`,
95155
- "aria-expanded": isExpanded,
95156
- ref: tdRef,
95157
- children: [
95158
- isOverflowingWhenNotExpanded && /* @__PURE__ */ jsxRuntimeExports.jsx(
95159
- ExpandCollapseButton,
95160
- {
95161
- isExpanded,
95162
- className: "ExpandableTableData__expandButton",
95163
- onClick: () => setIsExpanded(!isExpanded)
95164
- }
95165
- ),
95166
- props.children
95167
- ]
95168
- }
95169
- );
95170
- }
95171
94700
  /**
95172
94701
  * table-core
95173
94702
  *
@@ -99521,7 +99050,7 @@ ${e2.message}`);
99521
99050
  })(typeof window === "object" ? window : commonjsGlobal);
99522
99051
  })(uaParser, uaParser.exports);
99523
99052
  var uaParserExports = uaParser.exports;
99524
- function DirectDownloadIcon(props) {
99053
+ const DirectDownloadIcon = React$2.forwardRef(function DirectDownloadIcon2(props, ref2) {
99525
99054
  const {
99526
99055
  isExternalFile,
99527
99056
  onClick,
@@ -99537,6 +99066,7 @@ ${e2.message}`);
99537
99066
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
99538
99067
  "button",
99539
99068
  {
99069
+ ref: ref2,
99540
99070
  className: "btn-download-icon",
99541
99071
  onClick: (event) => {
99542
99072
  if (onClick) {
@@ -99561,6 +99091,7 @@ ${e2.message}`);
99561
99091
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
99562
99092
  "button",
99563
99093
  {
99094
+ ref: ref2,
99564
99095
  className: "btn-download-icon",
99565
99096
  onClick: (event) => {
99566
99097
  getDownloadLink();
@@ -99574,7 +99105,7 @@ ${e2.message}`);
99574
99105
  );
99575
99106
  }
99576
99107
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
99577
- }
99108
+ });
99578
99109
  function DirectDownload(props) {
99579
99110
  var _a3;
99580
99111
  const { accessToken } = useSynapseContext();
@@ -99677,7 +99208,7 @@ ${e2.message}`);
99677
99208
  title: isExternalFile ? "Navigate to external link" : "Download this file individually",
99678
99209
  enterNextDelay: TOOLTIP_DELAY_SHOW,
99679
99210
  placement: "left",
99680
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
99211
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
99681
99212
  DirectDownloadIcon,
99682
99213
  {
99683
99214
  isExternalFile,
@@ -99690,7 +99221,7 @@ ${e2.message}`);
99690
99221
  fileName,
99691
99222
  iconSvgPropOverrides
99692
99223
  }
99693
- ) })
99224
+ )
99694
99225
  }
99695
99226
  );
99696
99227
  }
@@ -102282,7 +101813,7 @@ ${e2.message}`);
102282
101813
  function _EMOTION_STRINGIFIED_CSS_ERROR__$2() {
102283
101814
  return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
102284
101815
  }
102285
- var _ref = dist$1.process.env.NODE_ENV === "production" ? {
101816
+ var _ref$1 = dist$1.process.env.NODE_ENV === "production" ? {
102286
101817
  name: "7pg0cj-a11yText",
102287
101818
  styles: "label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"
102288
101819
  } : {
@@ -102293,7 +101824,7 @@ ${e2.message}`);
102293
101824
  };
102294
101825
  var A11yText = function A11yText2(props) {
102295
101826
  return jsx("span", _extends$3({
102296
- css: _ref
101827
+ css: _ref$1
102297
101828
  }, props));
102298
101829
  };
102299
101830
  var A11yText$1 = A11yText;
@@ -104575,23 +104106,25 @@ ${e2.message}`);
104575
104106
  }, baseSelectProps));
104576
104107
  });
104577
104108
  var StateManagedSelect$1 = StateManagedSelect;
104109
+ const AUTHENTICATED_GROUP_DISPLAY_TEXT = "All registered Synapse users";
104110
+ const PUBLIC_GROUP_DISPLAY_TEXT = "Anyone on the web";
104578
104111
  function TeamBadge(props) {
104579
104112
  const { teamId } = props;
104580
104113
  let { teamName, disableHref } = props;
104581
104114
  let icon = "team";
104582
104115
  if (teamId == AUTHENTICATED_PRINCIPAL_ID) {
104583
104116
  icon = "public";
104584
- teamName = "All registered Synapse users";
104117
+ teamName = AUTHENTICATED_GROUP_DISPLAY_TEXT;
104585
104118
  disableHref = true;
104586
104119
  }
104587
104120
  if (teamId == PUBLIC_PRINCIPAL_ID) {
104588
104121
  icon = "public";
104589
- teamName = "Anyone on the web";
104122
+ teamName = PUBLIC_GROUP_DISPLAY_TEXT;
104590
104123
  disableHref = true;
104591
104124
  }
104592
- const Tag = disableHref ? "span" : "a";
104593
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
104594
- /* @__PURE__ */ jsxRuntimeExports.jsx(IconSvg, { icon }),
104125
+ const Tag = disableHref ? "span" : Link;
104126
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { component: "span", display: "inline-flex", alignItems: "center", children: [
104127
+ /* @__PURE__ */ jsxRuntimeExports.jsx(IconSvg, { icon, fontSize: "small" }),
104595
104128
  /* @__PURE__ */ jsxRuntimeExports.jsx(
104596
104129
  Tag,
104597
104130
  {
@@ -109449,7 +108982,7 @@ ${e2.message}`);
109449
108982
  addValueToSelectedFacet: addValueToSelectedFacet2,
109450
108983
  removeSelectedFacet: removeSelectedFacet2,
109451
108984
  removeValueFromSelectedFacet: removeValueFromSelectedFacet2,
109452
- executeQueryRequest
108985
+ resetDebounceTimer
109453
108986
  } = useQueryContext();
109454
108987
  const data = useAtomValue(tableQueryDataAtom);
109455
108988
  const { getColumnDisplayName } = useQueryVisualizationContext();
@@ -109534,12 +109067,7 @@ ${e2.message}`);
109534
109067
  dropdownType,
109535
109068
  hideCollapsible,
109536
109069
  onHoverOverValue: () => {
109537
- executeQueryRequest(
109538
- (request) => {
109539
- return cloneDeep$3(request);
109540
- },
109541
- { debounce: true }
109542
- );
109070
+ resetDebounceTimer();
109543
109071
  },
109544
109072
  onAddValueToSelection: (value) => {
109545
109073
  addValueToSelectedFacet2(
@@ -112884,6 +112412,23 @@ ${e2.message}`);
112884
112412
  }
112885
112413
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: String(value) });
112886
112414
  }
112415
+ function ExpandCollapseButton(props) {
112416
+ const { isExpanded, ...buttonProps } = props;
112417
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("button", { ...buttonProps, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
112418
+ IconSvg,
112419
+ {
112420
+ icon: isExpanded ? "minusBoxOutline" : "addBoxOutline",
112421
+ sx: {
112422
+ color: "grey.600",
112423
+ height: "16px",
112424
+ verticalAlign: "top",
112425
+ "&:hover": {
112426
+ color: "grey.700"
112427
+ }
112428
+ }
112429
+ }
112430
+ ) });
112431
+ }
112887
112432
  function JSONArrayRenderer(props) {
112888
112433
  const { value } = props;
112889
112434
  const [expanded, setExpanded] = React$2.useState(false);
@@ -114626,21 +114171,22 @@ ${e2.message}`);
114626
114171
  }
114627
114172
  });
114628
114173
  const getEntityOrRowId = (props) => {
114629
- var _a3;
114174
+ var _a3, _b2;
114630
114175
  const { row, table: table2 } = props;
114631
- const rowEntityIDColumnIndex = table2.options.meta.rowEntityIDColumnIndex;
114632
- const entityId = rowEntityIDColumnIndex !== void 0 ? row.original.values[rowEntityIDColumnIndex] : (_a3 = row.original.rowId) == null ? void 0 : _a3.toString();
114176
+ const rowEntityIDColumnIndex = (_a3 = table2.options.meta) == null ? void 0 : _a3.rowEntityIDColumnIndex;
114177
+ const entityId = rowEntityIDColumnIndex !== void 0 ? row.original.values[rowEntityIDColumnIndex] : (_b2 = row.original.rowId) == null ? void 0 : _b2.toString();
114633
114178
  return entityId;
114634
114179
  };
114635
114180
  const isRowEntityColumn = (props) => {
114181
+ var _a3;
114636
114182
  const { table: table2 } = props;
114637
- return table2.options.meta.rowEntityVersionColumnIndex !== void 0;
114183
+ return ((_a3 = table2.options.meta) == null ? void 0 : _a3.rowEntityVersionColumnIndex) !== void 0;
114638
114184
  };
114639
114185
  const getEntityOrRowVersion = (props) => {
114640
- var _a3;
114186
+ var _a3, _b2;
114641
114187
  const { row, table: table2 } = props;
114642
- const rowEntityVersionColumnIndex = table2.options.meta.rowEntityVersionColumnIndex;
114643
- const versionNumber = rowEntityVersionColumnIndex !== void 0 ? row.original.values[rowEntityVersionColumnIndex] : (_a3 = row.original.versionNumber) == null ? void 0 : _a3.toString();
114188
+ const rowEntityVersionColumnIndex = (_a3 = table2.options.meta) == null ? void 0 : _a3.rowEntityVersionColumnIndex;
114189
+ const versionNumber = rowEntityVersionColumnIndex !== void 0 ? row.original.values[rowEntityVersionColumnIndex] : (_b2 = row.original.versionNumber) == null ? void 0 : _b2.toString();
114644
114190
  return versionNumber;
114645
114191
  };
114646
114192
  function AccessCell(props) {
@@ -114886,6 +114432,762 @@ ${e2.message}`);
114886
114432
  dataHasBeenPrefetched: !isLoadingEntityData && !isLoadingFileHandleData && !isLoadingUserGroupData
114887
114433
  };
114888
114434
  }
114435
+ const StyledTableContainer = styled(Box)(({ theme: theme3, density = "default" }) => ({
114436
+ overflow: "auto",
114437
+ paddingLeft: "2px",
114438
+ th: {
114439
+ height: "38px",
114440
+ backgroundColor: theme3.palette.grey[200],
114441
+ borderRight: "1px solid",
114442
+ borderColor: theme3.palette.grey[400]
114443
+ },
114444
+ ["th:first-of-type"]: {
114445
+ paddingLeft: "10px"
114446
+ },
114447
+ ["td:first-of-type"]: {
114448
+ paddingLeft: "10px"
114449
+ },
114450
+ ["tr:nth-of-type(2n)"]: {
114451
+ backgroundColor: theme3.palette.grey[100]
114452
+ },
114453
+ ["th,td"]: {
114454
+ position: "relative",
114455
+ paddingLeft: theme3.spacing(density === "compact" ? 0 : 1),
114456
+ paddingRight: theme3.spacing(density === "compact" ? 0 : 1)
114457
+ },
114458
+ td: {
114459
+ paddingTop: theme3.spacing(density === "compact" ? 0 : 1),
114460
+ paddingBottom: theme3.spacing(density === "compact" ? 0 : 1)
114461
+ },
114462
+ ".resizer": {
114463
+ position: "absolute",
114464
+ right: 0,
114465
+ top: 0,
114466
+ height: "100%",
114467
+ width: "3px",
114468
+ padding: 0,
114469
+ background: "rgba(0, 0, 0, 0.5)",
114470
+ cursor: "col-resize",
114471
+ userSelect: "none",
114472
+ touchAction: "none"
114473
+ },
114474
+ ".resizer.isResizing": {
114475
+ background: theme3.palette.primary.main,
114476
+ opacity: 1
114477
+ },
114478
+ "@media (hover: hover)": {
114479
+ ".resizer": {
114480
+ opacity: 0,
114481
+ "*:hover > .resizer": {
114482
+ opacity: 1
114483
+ }
114484
+ }
114485
+ }
114486
+ }));
114487
+ function getColumnSizeCssVariable(columnId) {
114488
+ return `--col-${columnId}-size`;
114489
+ }
114490
+ function getHeaderSizeCssVariable(headerId) {
114491
+ return `--header-${headerId}-size`;
114492
+ }
114493
+ var resizeObservers = [];
114494
+ var hasActiveObservations = function() {
114495
+ return resizeObservers.some(function(ro) {
114496
+ return ro.activeTargets.length > 0;
114497
+ });
114498
+ };
114499
+ var hasSkippedObservations = function() {
114500
+ return resizeObservers.some(function(ro) {
114501
+ return ro.skippedTargets.length > 0;
114502
+ });
114503
+ };
114504
+ var msg = "ResizeObserver loop completed with undelivered notifications.";
114505
+ var deliverResizeLoopError = function() {
114506
+ var event;
114507
+ if (typeof ErrorEvent === "function") {
114508
+ event = new ErrorEvent("error", {
114509
+ message: msg
114510
+ });
114511
+ } else {
114512
+ event = document.createEvent("Event");
114513
+ event.initEvent("error", false, false);
114514
+ event.message = msg;
114515
+ }
114516
+ window.dispatchEvent(event);
114517
+ };
114518
+ var ResizeObserverBoxOptions;
114519
+ (function(ResizeObserverBoxOptions2) {
114520
+ ResizeObserverBoxOptions2["BORDER_BOX"] = "border-box";
114521
+ ResizeObserverBoxOptions2["CONTENT_BOX"] = "content-box";
114522
+ ResizeObserverBoxOptions2["DEVICE_PIXEL_CONTENT_BOX"] = "device-pixel-content-box";
114523
+ })(ResizeObserverBoxOptions || (ResizeObserverBoxOptions = {}));
114524
+ var freeze = function(obj) {
114525
+ return Object.freeze(obj);
114526
+ };
114527
+ var ResizeObserverSize = /* @__PURE__ */ function() {
114528
+ function ResizeObserverSize2(inlineSize, blockSize) {
114529
+ this.inlineSize = inlineSize;
114530
+ this.blockSize = blockSize;
114531
+ freeze(this);
114532
+ }
114533
+ return ResizeObserverSize2;
114534
+ }();
114535
+ var DOMRectReadOnly$1 = function() {
114536
+ function DOMRectReadOnly2(x2, y2, width2, height2) {
114537
+ this.x = x2;
114538
+ this.y = y2;
114539
+ this.width = width2;
114540
+ this.height = height2;
114541
+ this.top = this.y;
114542
+ this.left = this.x;
114543
+ this.bottom = this.top + this.height;
114544
+ this.right = this.left + this.width;
114545
+ return freeze(this);
114546
+ }
114547
+ DOMRectReadOnly2.prototype.toJSON = function() {
114548
+ var _a3 = this, x2 = _a3.x, y2 = _a3.y, top2 = _a3.top, right2 = _a3.right, bottom2 = _a3.bottom, left2 = _a3.left, width2 = _a3.width, height2 = _a3.height;
114549
+ return { x: x2, y: y2, top: top2, right: right2, bottom: bottom2, left: left2, width: width2, height: height2 };
114550
+ };
114551
+ DOMRectReadOnly2.fromRect = function(rectangle) {
114552
+ return new DOMRectReadOnly2(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
114553
+ };
114554
+ return DOMRectReadOnly2;
114555
+ }();
114556
+ var isSVG = function(target) {
114557
+ return target instanceof SVGElement && "getBBox" in target;
114558
+ };
114559
+ var isHidden = function(target) {
114560
+ if (isSVG(target)) {
114561
+ var _a3 = target.getBBox(), width2 = _a3.width, height2 = _a3.height;
114562
+ return !width2 && !height2;
114563
+ }
114564
+ var _b2 = target, offsetWidth = _b2.offsetWidth, offsetHeight = _b2.offsetHeight;
114565
+ return !(offsetWidth || offsetHeight || target.getClientRects().length);
114566
+ };
114567
+ var isElement$1 = function(obj) {
114568
+ var _a3;
114569
+ if (obj instanceof Element) {
114570
+ return true;
114571
+ }
114572
+ var scope2 = (_a3 = obj === null || obj === void 0 ? void 0 : obj.ownerDocument) === null || _a3 === void 0 ? void 0 : _a3.defaultView;
114573
+ return !!(scope2 && obj instanceof scope2.Element);
114574
+ };
114575
+ var isReplacedElement = function(target) {
114576
+ switch (target.tagName) {
114577
+ case "INPUT":
114578
+ if (target.type !== "image") {
114579
+ break;
114580
+ }
114581
+ case "VIDEO":
114582
+ case "AUDIO":
114583
+ case "EMBED":
114584
+ case "OBJECT":
114585
+ case "CANVAS":
114586
+ case "IFRAME":
114587
+ case "IMG":
114588
+ return true;
114589
+ }
114590
+ return false;
114591
+ };
114592
+ var global$1 = typeof window !== "undefined" ? window : {};
114593
+ var cache = /* @__PURE__ */ new WeakMap();
114594
+ var scrollRegexp = /auto|scroll/;
114595
+ var verticalRegexp = /^tb|vertical/;
114596
+ var IE = /msie|trident/i.test(global$1.navigator && global$1.navigator.userAgent);
114597
+ var parseDimension = function(pixel) {
114598
+ return parseFloat(pixel || "0");
114599
+ };
114600
+ var size$1 = function(inlineSize, blockSize, switchSizes) {
114601
+ if (inlineSize === void 0) {
114602
+ inlineSize = 0;
114603
+ }
114604
+ if (blockSize === void 0) {
114605
+ blockSize = 0;
114606
+ }
114607
+ if (switchSizes === void 0) {
114608
+ switchSizes = false;
114609
+ }
114610
+ return new ResizeObserverSize((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
114611
+ };
114612
+ var zeroBoxes = freeze({
114613
+ devicePixelContentBoxSize: size$1(),
114614
+ borderBoxSize: size$1(),
114615
+ contentBoxSize: size$1(),
114616
+ contentRect: new DOMRectReadOnly$1(0, 0, 0, 0)
114617
+ });
114618
+ var calculateBoxSizes = function(target, forceRecalculation) {
114619
+ if (forceRecalculation === void 0) {
114620
+ forceRecalculation = false;
114621
+ }
114622
+ if (cache.has(target) && !forceRecalculation) {
114623
+ return cache.get(target);
114624
+ }
114625
+ if (isHidden(target)) {
114626
+ cache.set(target, zeroBoxes);
114627
+ return zeroBoxes;
114628
+ }
114629
+ var cs = getComputedStyle(target);
114630
+ var svg2 = isSVG(target) && target.ownerSVGElement && target.getBBox();
114631
+ var removePadding = !IE && cs.boxSizing === "border-box";
114632
+ var switchSizes = verticalRegexp.test(cs.writingMode || "");
114633
+ var canScrollVertically = !svg2 && scrollRegexp.test(cs.overflowY || "");
114634
+ var canScrollHorizontally = !svg2 && scrollRegexp.test(cs.overflowX || "");
114635
+ var paddingTop = svg2 ? 0 : parseDimension(cs.paddingTop);
114636
+ var paddingRight = svg2 ? 0 : parseDimension(cs.paddingRight);
114637
+ var paddingBottom = svg2 ? 0 : parseDimension(cs.paddingBottom);
114638
+ var paddingLeft = svg2 ? 0 : parseDimension(cs.paddingLeft);
114639
+ var borderTop2 = svg2 ? 0 : parseDimension(cs.borderTopWidth);
114640
+ var borderRight2 = svg2 ? 0 : parseDimension(cs.borderRightWidth);
114641
+ var borderBottom2 = svg2 ? 0 : parseDimension(cs.borderBottomWidth);
114642
+ var borderLeft2 = svg2 ? 0 : parseDimension(cs.borderLeftWidth);
114643
+ var horizontalPadding = paddingLeft + paddingRight;
114644
+ var verticalPadding = paddingTop + paddingBottom;
114645
+ var horizontalBorderArea = borderLeft2 + borderRight2;
114646
+ var verticalBorderArea = borderTop2 + borderBottom2;
114647
+ var horizontalScrollbarThickness = !canScrollHorizontally ? 0 : target.offsetHeight - verticalBorderArea - target.clientHeight;
114648
+ var verticalScrollbarThickness = !canScrollVertically ? 0 : target.offsetWidth - horizontalBorderArea - target.clientWidth;
114649
+ var widthReduction = removePadding ? horizontalPadding + horizontalBorderArea : 0;
114650
+ var heightReduction = removePadding ? verticalPadding + verticalBorderArea : 0;
114651
+ var contentWidth = svg2 ? svg2.width : parseDimension(cs.width) - widthReduction - verticalScrollbarThickness;
114652
+ var contentHeight = svg2 ? svg2.height : parseDimension(cs.height) - heightReduction - horizontalScrollbarThickness;
114653
+ var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea;
114654
+ var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea;
114655
+ var boxes = freeze({
114656
+ devicePixelContentBoxSize: size$1(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),
114657
+ borderBoxSize: size$1(borderBoxWidth, borderBoxHeight, switchSizes),
114658
+ contentBoxSize: size$1(contentWidth, contentHeight, switchSizes),
114659
+ contentRect: new DOMRectReadOnly$1(paddingLeft, paddingTop, contentWidth, contentHeight)
114660
+ });
114661
+ cache.set(target, boxes);
114662
+ return boxes;
114663
+ };
114664
+ var calculateBoxSize = function(target, observedBox, forceRecalculation) {
114665
+ var _a3 = calculateBoxSizes(target, forceRecalculation), borderBoxSize = _a3.borderBoxSize, contentBoxSize = _a3.contentBoxSize, devicePixelContentBoxSize = _a3.devicePixelContentBoxSize;
114666
+ switch (observedBox) {
114667
+ case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:
114668
+ return devicePixelContentBoxSize;
114669
+ case ResizeObserverBoxOptions.BORDER_BOX:
114670
+ return borderBoxSize;
114671
+ default:
114672
+ return contentBoxSize;
114673
+ }
114674
+ };
114675
+ var ResizeObserverEntry = /* @__PURE__ */ function() {
114676
+ function ResizeObserverEntry2(target) {
114677
+ var boxes = calculateBoxSizes(target);
114678
+ this.target = target;
114679
+ this.contentRect = boxes.contentRect;
114680
+ this.borderBoxSize = freeze([boxes.borderBoxSize]);
114681
+ this.contentBoxSize = freeze([boxes.contentBoxSize]);
114682
+ this.devicePixelContentBoxSize = freeze([boxes.devicePixelContentBoxSize]);
114683
+ }
114684
+ return ResizeObserverEntry2;
114685
+ }();
114686
+ var calculateDepthForNode = function(node2) {
114687
+ if (isHidden(node2)) {
114688
+ return Infinity;
114689
+ }
114690
+ var depth = 0;
114691
+ var parent2 = node2.parentNode;
114692
+ while (parent2) {
114693
+ depth += 1;
114694
+ parent2 = parent2.parentNode;
114695
+ }
114696
+ return depth;
114697
+ };
114698
+ var broadcastActiveObservations = function() {
114699
+ var shallowestDepth = Infinity;
114700
+ var callbacks2 = [];
114701
+ resizeObservers.forEach(function processObserver(ro) {
114702
+ if (ro.activeTargets.length === 0) {
114703
+ return;
114704
+ }
114705
+ var entries = [];
114706
+ ro.activeTargets.forEach(function processTarget(ot) {
114707
+ var entry = new ResizeObserverEntry(ot.target);
114708
+ var targetDepth = calculateDepthForNode(ot.target);
114709
+ entries.push(entry);
114710
+ ot.lastReportedSize = calculateBoxSize(ot.target, ot.observedBox);
114711
+ if (targetDepth < shallowestDepth) {
114712
+ shallowestDepth = targetDepth;
114713
+ }
114714
+ });
114715
+ callbacks2.push(function resizeObserverCallback() {
114716
+ ro.callback.call(ro.observer, entries, ro.observer);
114717
+ });
114718
+ ro.activeTargets.splice(0, ro.activeTargets.length);
114719
+ });
114720
+ for (var _i2 = 0, callbacks_1 = callbacks2; _i2 < callbacks_1.length; _i2++) {
114721
+ var callback = callbacks_1[_i2];
114722
+ callback();
114723
+ }
114724
+ return shallowestDepth;
114725
+ };
114726
+ var gatherActiveObservationsAtDepth = function(depth) {
114727
+ resizeObservers.forEach(function processObserver(ro) {
114728
+ ro.activeTargets.splice(0, ro.activeTargets.length);
114729
+ ro.skippedTargets.splice(0, ro.skippedTargets.length);
114730
+ ro.observationTargets.forEach(function processTarget(ot) {
114731
+ if (ot.isActive()) {
114732
+ if (calculateDepthForNode(ot.target) > depth) {
114733
+ ro.activeTargets.push(ot);
114734
+ } else {
114735
+ ro.skippedTargets.push(ot);
114736
+ }
114737
+ }
114738
+ });
114739
+ });
114740
+ };
114741
+ var process = function() {
114742
+ var depth = 0;
114743
+ gatherActiveObservationsAtDepth(depth);
114744
+ while (hasActiveObservations()) {
114745
+ depth = broadcastActiveObservations();
114746
+ gatherActiveObservationsAtDepth(depth);
114747
+ }
114748
+ if (hasSkippedObservations()) {
114749
+ deliverResizeLoopError();
114750
+ }
114751
+ return depth > 0;
114752
+ };
114753
+ var trigger;
114754
+ var callbacks = [];
114755
+ var notify = function() {
114756
+ return callbacks.splice(0).forEach(function(cb) {
114757
+ return cb();
114758
+ });
114759
+ };
114760
+ var queueMicroTask = function(callback) {
114761
+ if (!trigger) {
114762
+ var toggle_1 = 0;
114763
+ var el_1 = document.createTextNode("");
114764
+ var config2 = { characterData: true };
114765
+ new MutationObserver(function() {
114766
+ return notify();
114767
+ }).observe(el_1, config2);
114768
+ trigger = function() {
114769
+ el_1.textContent = "".concat(toggle_1 ? toggle_1-- : toggle_1++);
114770
+ };
114771
+ }
114772
+ callbacks.push(callback);
114773
+ trigger();
114774
+ };
114775
+ var queueResizeObserver = function(cb) {
114776
+ queueMicroTask(function ResizeObserver2() {
114777
+ requestAnimationFrame(cb);
114778
+ });
114779
+ };
114780
+ var watching = 0;
114781
+ var isWatching = function() {
114782
+ return !!watching;
114783
+ };
114784
+ var CATCH_PERIOD = 250;
114785
+ var observerConfig = { attributes: true, characterData: true, childList: true, subtree: true };
114786
+ var events = [
114787
+ "resize",
114788
+ "load",
114789
+ "transitionend",
114790
+ "animationend",
114791
+ "animationstart",
114792
+ "animationiteration",
114793
+ "keyup",
114794
+ "keydown",
114795
+ "mouseup",
114796
+ "mousedown",
114797
+ "mouseover",
114798
+ "mouseout",
114799
+ "blur",
114800
+ "focus"
114801
+ ];
114802
+ var time = function(timeout2) {
114803
+ if (timeout2 === void 0) {
114804
+ timeout2 = 0;
114805
+ }
114806
+ return Date.now() + timeout2;
114807
+ };
114808
+ var scheduled = false;
114809
+ var Scheduler = function() {
114810
+ function Scheduler2() {
114811
+ var _this = this;
114812
+ this.stopped = true;
114813
+ this.listener = function() {
114814
+ return _this.schedule();
114815
+ };
114816
+ }
114817
+ Scheduler2.prototype.run = function(timeout2) {
114818
+ var _this = this;
114819
+ if (timeout2 === void 0) {
114820
+ timeout2 = CATCH_PERIOD;
114821
+ }
114822
+ if (scheduled) {
114823
+ return;
114824
+ }
114825
+ scheduled = true;
114826
+ var until = time(timeout2);
114827
+ queueResizeObserver(function() {
114828
+ var elementsHaveResized = false;
114829
+ try {
114830
+ elementsHaveResized = process();
114831
+ } finally {
114832
+ scheduled = false;
114833
+ timeout2 = until - time();
114834
+ if (!isWatching()) {
114835
+ return;
114836
+ }
114837
+ if (elementsHaveResized) {
114838
+ _this.run(1e3);
114839
+ } else if (timeout2 > 0) {
114840
+ _this.run(timeout2);
114841
+ } else {
114842
+ _this.start();
114843
+ }
114844
+ }
114845
+ });
114846
+ };
114847
+ Scheduler2.prototype.schedule = function() {
114848
+ this.stop();
114849
+ this.run();
114850
+ };
114851
+ Scheduler2.prototype.observe = function() {
114852
+ var _this = this;
114853
+ var cb = function() {
114854
+ return _this.observer && _this.observer.observe(document.body, observerConfig);
114855
+ };
114856
+ document.body ? cb() : global$1.addEventListener("DOMContentLoaded", cb);
114857
+ };
114858
+ Scheduler2.prototype.start = function() {
114859
+ var _this = this;
114860
+ if (this.stopped) {
114861
+ this.stopped = false;
114862
+ this.observer = new MutationObserver(this.listener);
114863
+ this.observe();
114864
+ events.forEach(function(name) {
114865
+ return global$1.addEventListener(name, _this.listener, true);
114866
+ });
114867
+ }
114868
+ };
114869
+ Scheduler2.prototype.stop = function() {
114870
+ var _this = this;
114871
+ if (!this.stopped) {
114872
+ this.observer && this.observer.disconnect();
114873
+ events.forEach(function(name) {
114874
+ return global$1.removeEventListener(name, _this.listener, true);
114875
+ });
114876
+ this.stopped = true;
114877
+ }
114878
+ };
114879
+ return Scheduler2;
114880
+ }();
114881
+ var scheduler = new Scheduler();
114882
+ var updateCount = function(n2) {
114883
+ !watching && n2 > 0 && scheduler.start();
114884
+ watching += n2;
114885
+ !watching && scheduler.stop();
114886
+ };
114887
+ var skipNotifyOnElement = function(target) {
114888
+ return !isSVG(target) && !isReplacedElement(target) && getComputedStyle(target).display === "inline";
114889
+ };
114890
+ var ResizeObservation = function() {
114891
+ function ResizeObservation2(target, observedBox) {
114892
+ this.target = target;
114893
+ this.observedBox = observedBox || ResizeObserverBoxOptions.CONTENT_BOX;
114894
+ this.lastReportedSize = {
114895
+ inlineSize: 0,
114896
+ blockSize: 0
114897
+ };
114898
+ }
114899
+ ResizeObservation2.prototype.isActive = function() {
114900
+ var size2 = calculateBoxSize(this.target, this.observedBox, true);
114901
+ if (skipNotifyOnElement(this.target)) {
114902
+ this.lastReportedSize = size2;
114903
+ }
114904
+ if (this.lastReportedSize.inlineSize !== size2.inlineSize || this.lastReportedSize.blockSize !== size2.blockSize) {
114905
+ return true;
114906
+ }
114907
+ return false;
114908
+ };
114909
+ return ResizeObservation2;
114910
+ }();
114911
+ var ResizeObserverDetail = /* @__PURE__ */ function() {
114912
+ function ResizeObserverDetail2(resizeObserver, callback) {
114913
+ this.activeTargets = [];
114914
+ this.skippedTargets = [];
114915
+ this.observationTargets = [];
114916
+ this.observer = resizeObserver;
114917
+ this.callback = callback;
114918
+ }
114919
+ return ResizeObserverDetail2;
114920
+ }();
114921
+ var observerMap = /* @__PURE__ */ new WeakMap();
114922
+ var getObservationIndex = function(observationTargets, target) {
114923
+ for (var i2 = 0; i2 < observationTargets.length; i2 += 1) {
114924
+ if (observationTargets[i2].target === target) {
114925
+ return i2;
114926
+ }
114927
+ }
114928
+ return -1;
114929
+ };
114930
+ var ResizeObserverController = function() {
114931
+ function ResizeObserverController2() {
114932
+ }
114933
+ ResizeObserverController2.connect = function(resizeObserver, callback) {
114934
+ var detail = new ResizeObserverDetail(resizeObserver, callback);
114935
+ observerMap.set(resizeObserver, detail);
114936
+ };
114937
+ ResizeObserverController2.observe = function(resizeObserver, target, options2) {
114938
+ var detail = observerMap.get(resizeObserver);
114939
+ var firstObservation = detail.observationTargets.length === 0;
114940
+ if (getObservationIndex(detail.observationTargets, target) < 0) {
114941
+ firstObservation && resizeObservers.push(detail);
114942
+ detail.observationTargets.push(new ResizeObservation(target, options2 && options2.box));
114943
+ updateCount(1);
114944
+ scheduler.schedule();
114945
+ }
114946
+ };
114947
+ ResizeObserverController2.unobserve = function(resizeObserver, target) {
114948
+ var detail = observerMap.get(resizeObserver);
114949
+ var index2 = getObservationIndex(detail.observationTargets, target);
114950
+ var lastObservation = detail.observationTargets.length === 1;
114951
+ if (index2 >= 0) {
114952
+ lastObservation && resizeObservers.splice(resizeObservers.indexOf(detail), 1);
114953
+ detail.observationTargets.splice(index2, 1);
114954
+ updateCount(-1);
114955
+ }
114956
+ };
114957
+ ResizeObserverController2.disconnect = function(resizeObserver) {
114958
+ var _this = this;
114959
+ var detail = observerMap.get(resizeObserver);
114960
+ detail.observationTargets.slice().forEach(function(ot) {
114961
+ return _this.unobserve(resizeObserver, ot.target);
114962
+ });
114963
+ detail.activeTargets.splice(0, detail.activeTargets.length);
114964
+ };
114965
+ return ResizeObserverController2;
114966
+ }();
114967
+ var ResizeObserver$2 = function() {
114968
+ function ResizeObserver2(callback) {
114969
+ if (arguments.length === 0) {
114970
+ throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
114971
+ }
114972
+ if (typeof callback !== "function") {
114973
+ throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
114974
+ }
114975
+ ResizeObserverController.connect(this, callback);
114976
+ }
114977
+ ResizeObserver2.prototype.observe = function(target, options2) {
114978
+ if (arguments.length === 0) {
114979
+ throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
114980
+ }
114981
+ if (!isElement$1(target)) {
114982
+ throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
114983
+ }
114984
+ ResizeObserverController.observe(this, target, options2);
114985
+ };
114986
+ ResizeObserver2.prototype.unobserve = function(target) {
114987
+ if (arguments.length === 0) {
114988
+ throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
114989
+ }
114990
+ if (!isElement$1(target)) {
114991
+ throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
114992
+ }
114993
+ ResizeObserverController.unobserve(this, target);
114994
+ };
114995
+ ResizeObserver2.prototype.disconnect = function() {
114996
+ ResizeObserverController.disconnect(this);
114997
+ };
114998
+ ResizeObserver2.toString = function() {
114999
+ return "function ResizeObserver () { [polyfill code] }";
115000
+ };
115001
+ return ResizeObserver2;
115002
+ }();
115003
+ const usePassiveLayoutEffect = React$2[typeof document !== "undefined" && document.createElement !== void 0 ? "useLayoutEffect" : "useEffect"];
115004
+ const useLatest = (current) => {
115005
+ const storedValue = React__namespace.useRef(current);
115006
+ React__namespace.useEffect(() => {
115007
+ storedValue.current = current;
115008
+ });
115009
+ return storedValue;
115010
+ };
115011
+ const ResizeObserver$1 = typeof window !== "undefined" && "ResizeObserver" in window ? (
115012
+ // @ts-ignore
115013
+ window.ResizeObserver
115014
+ ) : ResizeObserver$2;
115015
+ function _ref() {
115016
+ }
115017
+ function useResizeObserver(target, callback) {
115018
+ const resizeObserver = getResizeObserver();
115019
+ const storedCallback = useLatest(callback);
115020
+ usePassiveLayoutEffect(() => {
115021
+ let didUnsubscribe = false;
115022
+ const targetEl = target && "current" in target ? target.current : target;
115023
+ if (!targetEl) return _ref;
115024
+ function cb(entry, observer) {
115025
+ if (didUnsubscribe) return;
115026
+ storedCallback.current(entry, observer);
115027
+ }
115028
+ resizeObserver.subscribe(targetEl, cb);
115029
+ return () => {
115030
+ didUnsubscribe = true;
115031
+ resizeObserver.unsubscribe(targetEl, cb);
115032
+ };
115033
+ }, [target, resizeObserver, storedCallback]);
115034
+ return resizeObserver.observer;
115035
+ }
115036
+ function createResizeObserver() {
115037
+ let ticking = false;
115038
+ let allEntries = [];
115039
+ const callbacks2 = /* @__PURE__ */ new Map();
115040
+ const observer = new ResizeObserver$1((entries, obs) => {
115041
+ allEntries = allEntries.concat(entries);
115042
+ function _ref22() {
115043
+ const triggered = /* @__PURE__ */ new Set();
115044
+ for (let i2 = 0; i2 < allEntries.length; i2++) {
115045
+ if (triggered.has(allEntries[i2].target)) continue;
115046
+ triggered.add(allEntries[i2].target);
115047
+ const cbs = callbacks2.get(allEntries[i2].target);
115048
+ cbs === null || cbs === void 0 ? void 0 : cbs.forEach((cb) => cb(allEntries[i2], obs));
115049
+ }
115050
+ allEntries = [];
115051
+ ticking = false;
115052
+ }
115053
+ if (!ticking) {
115054
+ window.requestAnimationFrame(_ref22);
115055
+ }
115056
+ ticking = true;
115057
+ });
115058
+ return {
115059
+ observer,
115060
+ subscribe(target, callback) {
115061
+ var _callbacks$get;
115062
+ observer.observe(target);
115063
+ const cbs = (_callbacks$get = callbacks2.get(target)) !== null && _callbacks$get !== void 0 ? _callbacks$get : [];
115064
+ cbs.push(callback);
115065
+ callbacks2.set(target, cbs);
115066
+ },
115067
+ unsubscribe(target, callback) {
115068
+ var _callbacks$get2;
115069
+ const cbs = (_callbacks$get2 = callbacks2.get(target)) !== null && _callbacks$get2 !== void 0 ? _callbacks$get2 : [];
115070
+ if (cbs.length === 1) {
115071
+ observer.unobserve(target);
115072
+ callbacks2.delete(target);
115073
+ return;
115074
+ }
115075
+ const cbIndex = cbs.indexOf(callback);
115076
+ if (cbIndex !== -1) cbs.splice(cbIndex, 1);
115077
+ callbacks2.set(target, cbs);
115078
+ }
115079
+ };
115080
+ }
115081
+ let _resizeObserver;
115082
+ const getResizeObserver = () => !_resizeObserver ? _resizeObserver = createResizeObserver() : _resizeObserver;
115083
+ function ExpandableTableDataCell(props) {
115084
+ const [isExpanded, setIsExpanded] = React$2.useState(false);
115085
+ const [isOverflowingWhenNotExpanded, setIsOverflowingWhenNotExpanded] = React$2.useState(false);
115086
+ const tdRef = React$2.useRef(null);
115087
+ useResizeObserver(tdRef, ({ target }) => {
115088
+ if (!isExpanded) {
115089
+ if (target) {
115090
+ const contentElement = target.getElementsByTagName("p")[0];
115091
+ if (contentElement) {
115092
+ setIsOverflowingWhenNotExpanded(
115093
+ contentElement.scrollHeight > contentElement.clientHeight || contentElement.scrollWidth > contentElement.clientWidth
115094
+ );
115095
+ }
115096
+ }
115097
+ }
115098
+ });
115099
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
115100
+ "td",
115101
+ {
115102
+ ...props,
115103
+ className: `ExpandableTableData ${props.className ? props.className : ""}`,
115104
+ "aria-expanded": isExpanded,
115105
+ ref: tdRef,
115106
+ children: [
115107
+ isOverflowingWhenNotExpanded && /* @__PURE__ */ jsxRuntimeExports.jsx(
115108
+ ExpandCollapseButton,
115109
+ {
115110
+ isExpanded,
115111
+ className: "ExpandableTableData__expandButton",
115112
+ onClick: () => setIsExpanded(!isExpanded)
115113
+ }
115114
+ ),
115115
+ props.children
115116
+ ]
115117
+ }
115118
+ );
115119
+ }
115120
+ function CellRenderer(cell) {
115121
+ var _a3, _b2, _c2;
115122
+ const getWrapInExpandableTd = (_a3 = cell.getContext().table.options.meta) == null ? void 0 : _a3.getWrapInExpandableTd;
115123
+ const wrapInExpandableTd = getWrapInExpandableTd && getWrapInExpandableTd(cell);
115124
+ const TableDataCellElement = wrapInExpandableTd ? ExpandableTableDataCell : "td";
115125
+ const renderPlaceholderData = (_b2 = cell.getContext().table.options.meta) == null ? void 0 : _b2.renderPlaceholderData;
115126
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
115127
+ TableDataCellElement,
115128
+ {
115129
+ style: {
115130
+ width: `calc(var(${getColumnSizeCssVariable(cell.column.id)}) * 1px)`,
115131
+ textAlign: (_c2 = cell.column.columnDef.meta) == null ? void 0 : _c2.textAlign
115132
+ },
115133
+ children: renderPlaceholderData ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { width: "80%", height: "20px" }) }) : flexRender(cell.column.columnDef.cell, cell.getContext())
115134
+ },
115135
+ cell.id
115136
+ );
115137
+ }
115138
+ function TableBody(props) {
115139
+ const { table: table2 } = props;
115140
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: table2.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: row.getVisibleCells().map(CellRenderer) }, row.id)) });
115141
+ }
115142
+ const MemoizedTableBody = React$2.memo(TableBody, (prev2, next2) => {
115143
+ return prev2.table.options.data === next2.table.options.data;
115144
+ });
115145
+ function StyledTanStackTable(props) {
115146
+ const { table: table2, styledTableContainerProps, fullWidth = true } = props;
115147
+ const columnSizeVars = React$2.useMemo(() => {
115148
+ const headers = table2.getFlatHeaders();
115149
+ const colSizes = {};
115150
+ for (let i2 = 0; i2 < headers.length; i2++) {
115151
+ const header = headers[i2];
115152
+ colSizes[getHeaderSizeCssVariable(header.id)] = header.getSize();
115153
+ colSizes[getColumnSizeCssVariable(header.column.id)] = header.column.getSize();
115154
+ }
115155
+ return colSizes;
115156
+ }, [table2.getState().columnSizingInfo, table2.getState().columnSizing]);
115157
+ const tableWidth = fullWidth ? "100%" : table2.getTotalSize();
115158
+ const TableBodyElement = table2.getState().columnSizingInfo.isResizingColumn ? MemoizedTableBody : TableBody;
115159
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledTableContainer, { ...styledTableContainerProps, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("table", { style: { ...columnSizeVars, width: tableWidth }, children: [
115160
+ /* @__PURE__ */ jsxRuntimeExports.jsx("thead", { children: table2.getHeaderGroups().map((headerGroup) => {
115161
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
115162
+ "th",
115163
+ {
115164
+ colSpan: header.colSpan,
115165
+ style: {
115166
+ width: `calc(var(${getHeaderSizeCssVariable(
115167
+ header.id
115168
+ )}) * 1px)`
115169
+ },
115170
+ children: [
115171
+ header.isPlaceholder ? null : flexRender(
115172
+ header.column.columnDef.header,
115173
+ header.getContext()
115174
+ ),
115175
+ header.column.getCanResize() && /* @__PURE__ */ jsxRuntimeExports.jsx(
115176
+ "div",
115177
+ {
115178
+ className: `resizer ${header.column.getIsResizing() ? "isResizing" : ""}`,
115179
+ onMouseDown: header.getResizeHandler(),
115180
+ onTouchStart: header.getResizeHandler()
115181
+ }
115182
+ )
115183
+ ]
115184
+ },
115185
+ header.id
115186
+ )) }, headerGroup.id);
115187
+ }) }),
115188
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TableBodyElement, { table: table2 })
115189
+ ] }) });
115190
+ }
114889
115191
  const columnHelper$3 = createColumnHelper();
114890
115192
  function SynapseTable(props) {
114891
115193
  var _a3, _b2, _c2, _d2;
@@ -114965,14 +115267,16 @@ ${e2.message}`);
114965
115267
  ]
114966
115268
  );
114967
115269
  const columnVisibility = React$2.useMemo(
114968
- () => ((data == null ? void 0 : data.selectColumns) ?? []).reduce((prev2, curr) => {
115270
+ () => selectColumns.reduce((prev2, curr) => {
114969
115271
  return {
114970
115272
  ...prev2,
114971
115273
  [curr.name]: columnsToShowInTable.includes(curr.name)
114972
115274
  };
114973
115275
  }, prependColumnVisibility),
114974
- [columnsToShowInTable, data == null ? void 0 : data.selectColumns, prependColumnVisibility]
115276
+ [columnsToShowInTable, selectColumns, prependColumnVisibility]
114975
115277
  );
115278
+ const { dataHasBeenPrefetched } = usePrefetchTableData();
115279
+ const renderTableDataPlaceholder = !dataHasBeenPrefetched;
114976
115280
  const table2 = useReactTable({
114977
115281
  data: ((_c2 = data == null ? void 0 : data.queryResult) == null ? void 0 : _c2.queryResults.rows) ?? [],
114978
115282
  columns: columns2,
@@ -114989,10 +115293,19 @@ ${e2.message}`);
114989
115293
  meta: {
114990
115294
  // make the rowEntityIDColumnIndex available to all cell renderers
114991
115295
  rowEntityIDColumnIndex,
114992
- rowEntityVersionColumnIndex
115296
+ rowEntityVersionColumnIndex,
115297
+ renderPlaceholderData: renderTableDataPlaceholder,
115298
+ getWrapInExpandableTd: (cell) => {
115299
+ const selectColumn = selectColumns.find(
115300
+ (cm) => cm.name === cell.column.id
115301
+ );
115302
+ return Boolean(
115303
+ selectColumn && /* JSON handles its own overflow*/
115304
+ selectColumn.columnType !== ColumnTypeEnum.JSON
115305
+ );
115306
+ }
114993
115307
  }
114994
115308
  });
114995
- const { dataHasBeenPrefetched } = usePrefetchTableData();
114996
115309
  if (!data && isLoadingNewBundle) {
114997
115310
  return loadingScreen;
114998
115311
  } else if (!data) {
@@ -115013,59 +115326,15 @@ ${e2.message}`);
115013
115326
  }
115014
115327
  ),
115015
115328
  /* @__PURE__ */ jsxRuntimeExports.jsx(
115016
- "div",
115329
+ StyledTanStackTable,
115017
115330
  {
115018
- className: "SynapseTable SRC-overflowAuto",
115019
- "data-testid": "SynapseTable",
115020
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs("table", { style: { width: table2.getTotalSize() }, children: [
115021
- /* @__PURE__ */ jsxRuntimeExports.jsx("thead", { children: table2.getHeaderGroups().map((headerGroup) => {
115022
- return /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
115023
- "th",
115024
- {
115025
- colSpan: header.colSpan,
115026
- style: { width: header.getSize() },
115027
- children: [
115028
- header.isPlaceholder ? null : flexRender(
115029
- header.column.columnDef.header,
115030
- header.getContext()
115031
- ),
115032
- header.column.getCanResize() && /* @__PURE__ */ jsxRuntimeExports.jsx(
115033
- "div",
115034
- {
115035
- className: `resizer ${header.column.getIsResizing() ? "isResizing" : ""}`,
115036
- onMouseDown: header.getResizeHandler(),
115037
- onTouchStart: header.getResizeHandler()
115038
- }
115039
- )
115040
- ]
115041
- },
115042
- header.id
115043
- )) }, headerGroup.id);
115044
- }) }),
115045
- /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: table2.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: row.getVisibleCells().map((cell) => {
115046
- var _a4;
115047
- const selectColumn = selectColumns.find(
115048
- (cm) => cm.name === cell.column.id
115049
- );
115050
- const shouldWrapInExpandable = selectColumn && selectColumn.columnType !== ColumnTypeEnum.JSON;
115051
- const TableDataCellElement = shouldWrapInExpandable ? ExpandableTableDataCell : "td";
115052
- const renderPlaceholder = !dataHasBeenPrefetched;
115053
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
115054
- TableDataCellElement,
115055
- {
115056
- style: {
115057
- width: cell.column.getSize(),
115058
- textAlign: (_a4 = cell.column.columnDef.meta) == null ? void 0 : _a4.textAlign
115059
- },
115060
- children: renderPlaceholder ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { width: "80%", height: "20px" }) }) : flexRender(
115061
- cell.column.columnDef.cell,
115062
- cell.getContext()
115063
- )
115064
- },
115065
- cell.id
115066
- );
115067
- }) }, row.id)) })
115068
- ] })
115331
+ styledTableContainerProps: {
115332
+ className: "SynapseTable",
115333
+ ["data-testid"]: "SynapseTable",
115334
+ density: "default"
115335
+ },
115336
+ table: table2,
115337
+ fullWidth: false
115069
115338
  }
115070
115339
  ),
115071
115340
  /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { mt: 2, textAlign: "right" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TablePagination, {}) })
@@ -115981,6 +116250,952 @@ ${e2.message}`);
115981
116250
  )
115982
116251
  ] });
115983
116252
  };
116253
+ const OpenDataContainer = styled(Box, {
116254
+ label: "OpenDataContainer"
116255
+ })(({ theme: theme3 }) => ({
116256
+ background: theme3.palette.grey[100],
116257
+ padding: `${theme3.spacing(2.5)} ${theme3.spacing(4)}`,
116258
+ border: `1px solid ${theme3.palette.grey[300]}`,
116259
+ borderRadius: "3px",
116260
+ marginBottom: theme3.spacing(2)
116261
+ }));
116262
+ function OpenData(props) {
116263
+ const { isOpenData, isPublic: isPublic2, currentUserCanUpdateSharingSettings } = props;
116264
+ if (isOpenData && isPublic2) {
116265
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(OpenDataContainer, { display: "flex", gap: 1, children: [
116266
+ /* @__PURE__ */ jsxRuntimeExports.jsx(IconSvg, { icon: "checkCircle", color: "success", wrap: false }),
116267
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
116268
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", color: "text.secondary", children: /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "This is anonymous access data." }) }),
116269
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", color: "text.secondary", children: "Anyone can download it, even if they aren’t logged in to Synapse." })
116270
+ ] })
116271
+ ] });
116272
+ } else if (isOpenData && !isPublic2 && currentUserCanUpdateSharingSettings) {
116273
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(OpenDataContainer, { children: [
116274
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", color: "text.secondary", children: /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "This is not anonymous access data." }) }),
116275
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", color: "text.secondary", children: "You must grant public access for all users to be able to anonymously download it." })
116276
+ ] });
116277
+ } else if (!isOpenData && isPublic2 && currentUserCanUpdateSharingSettings) {
116278
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(OpenDataContainer, { children: [
116279
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", color: "text.secondary", children: /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Users must be logged in to download public access data." }) }),
116280
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", color: "text.secondary", children: "This data is publicly viewable, but only registered and logged-in users can download it." })
116281
+ ] });
116282
+ }
116283
+ return null;
116284
+ }
116285
+ const CUSTOM_VALUE = "CUSTOM";
116286
+ const CUSTOM_TEXT = "Custom";
116287
+ const PermissionLevelMenu = (props) => {
116288
+ const { currentAccessType, availablePermissionLevels: availablePermissionLevels2, onChange } = props;
116289
+ const selectedPermissionLevel = getPermissionLevelFromAccessType(currentAccessType);
116290
+ const isCustomPermissionSelected = selectedPermissionLevel == null;
116291
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
116292
+ TextField$1,
116293
+ {
116294
+ value: isCustomPermissionSelected ? CUSTOM_VALUE : selectedPermissionLevel,
116295
+ onChange: (e2) => {
116296
+ const accessType = getAccessTypeFromPermissionLevel(
116297
+ e2.target.value
116298
+ );
116299
+ onChange(accessType || currentAccessType);
116300
+ },
116301
+ fullWidth: true,
116302
+ select: true,
116303
+ SelectProps: {
116304
+ renderValue: (selected) => {
116305
+ if (selected == CUSTOM_VALUE) {
116306
+ return CUSTOM_TEXT;
116307
+ }
116308
+ return permissionLevelToLabel[selected];
116309
+ }
116310
+ },
116311
+ size: "small",
116312
+ children: [
116313
+ Object.values(availablePermissionLevels2).map((permissionLevel) => {
116314
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { value: permissionLevel, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "smallText1", noWrap: true, children: permissionLevelToLabel[permissionLevel] }) }, permissionLevel);
116315
+ }),
116316
+ isCustomPermissionSelected && /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { value: CUSTOM_VALUE, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "smallText1", noWrap: true, children: CUSTOM_TEXT }) })
116317
+ ]
116318
+ }
116319
+ );
116320
+ };
116321
+ function ReadOnlyPermissionLevel(props) {
116322
+ const { accessType } = props;
116323
+ return permissionLevelToLabel[getPermissionLevelFromAccessType(accessType)] || "Custom";
116324
+ }
116325
+ const REMOVE_BUTTON_LABEL = "Remove from AR Permissions";
116326
+ const ResourceAccessItem = (props) => {
116327
+ const {
116328
+ resourceAccess,
116329
+ availablePermissionLevels: availablePermissionLevels2,
116330
+ canChangePermission,
116331
+ showDeleteButton,
116332
+ onChange,
116333
+ onRemove: onRemove2,
116334
+ displayedPermissionLevelOverride
116335
+ } = props;
116336
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
116337
+ Stack$6,
116338
+ {
116339
+ direction: "row",
116340
+ justifyContent: "space-between",
116341
+ alignItems: "center",
116342
+ gap: "10px",
116343
+ py: "6px",
116344
+ role: "row",
116345
+ children: [
116346
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { fontSize: "16px", lineHeight: "20px", children: /* @__PURE__ */ jsxRuntimeExports.jsx(UserOrTeamBadge, { principalId: resourceAccess.principalId }) }),
116347
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
116348
+ Stack$6,
116349
+ {
116350
+ direction: "row",
116351
+ gap: "10px",
116352
+ alignItems: "center",
116353
+ width: "200px",
116354
+ flexShrink: 0,
116355
+ children: [
116356
+ canChangePermission ? /* @__PURE__ */ jsxRuntimeExports.jsx(
116357
+ PermissionLevelMenu,
116358
+ {
116359
+ currentAccessType: resourceAccess.accessType,
116360
+ availablePermissionLevels: availablePermissionLevels2,
116361
+ onChange
116362
+ }
116363
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "smallText1", flexGrow: 1, children: displayedPermissionLevelOverride ?? /* @__PURE__ */ jsxRuntimeExports.jsx(
116364
+ ReadOnlyPermissionLevel,
116365
+ {
116366
+ accessType: resourceAccess.accessType
116367
+ }
116368
+ ) }),
116369
+ showDeleteButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
116370
+ IconSvgButton,
116371
+ {
116372
+ "aria-label": REMOVE_BUTTON_LABEL,
116373
+ onClick: () => onRemove2(),
116374
+ icon: "delete",
116375
+ sx: {
116376
+ "&:hover": {
116377
+ color: "error.main"
116378
+ }
116379
+ }
116380
+ }
116381
+ )
116382
+ ]
116383
+ }
116384
+ )
116385
+ ]
116386
+ }
116387
+ ) });
116388
+ };
116389
+ const SkeletonParagraph = ({
116390
+ numRows = 5,
116391
+ rowHeight,
116392
+ className
116393
+ }) => {
116394
+ const [skeletons, setSkeletons] = React$2.useState([]);
116395
+ React$2.useEffect(() => {
116396
+ const elements = [];
116397
+ times$2(numRows, (i2) => {
116398
+ elements.push(
116399
+ /* @__PURE__ */ jsxRuntimeExports.jsx(React$2.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
116400
+ Skeleton,
116401
+ {
116402
+ height: rowHeight,
116403
+ width: i2 === numRows - 1 ? "35%" : "100%"
116404
+ }
116405
+ ) }, i2)
116406
+ );
116407
+ });
116408
+ setSkeletons(elements);
116409
+ }, [numRows, rowHeight]);
116410
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className, children: skeletons });
116411
+ };
116412
+ function AclEditorSkeleton() {
116413
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack$6, { gap: 2, role: "progressbar", children: [
116414
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 50, width: 200 }),
116415
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SkeletonParagraph, { numRows: 2 }),
116416
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SkeletonTable, { numCols: 2, numRows: 4, rowHeight: "30px" }),
116417
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { height: 50, width: 100 }),
116418
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SkeletonParagraph, { numRows: 2 })
116419
+ ] });
116420
+ }
116421
+ const ADD_PRINCIPAL_TO_ACL_COMBOBOX_LABEL = "Add a user or team";
116422
+ const ADD_PUBLIC_PRINCIPALS_BUTTON_TEXT = "Make Public";
116423
+ const REMOVE_PUBLIC_PRINCIPALS_BUTTON_TEXT = "Remove Public Access";
116424
+ const NOTIFY_NEW_ACL_USERS_CHECKBOX_LABEL = "Notify people via email";
116425
+ function AclEditor(props) {
116426
+ const {
116427
+ resourceAccessList,
116428
+ availablePermissionLevels: availablePermissionLevels2,
116429
+ canEdit,
116430
+ canRemoveEntry = canEdit,
116431
+ isLoading = false,
116432
+ emptyText,
116433
+ onAddPrincipalToAcl,
116434
+ updateResourceAccessItem,
116435
+ removeResourceAccessItem,
116436
+ showAddRemovePublicButton,
116437
+ showNotifyCheckbox,
116438
+ notifyCheckboxValue,
116439
+ onNotifyCheckboxChange = noop$9,
116440
+ displayedPermissionLevelOverride
116441
+ } = props;
116442
+ if (isLoading) {
116443
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AclEditorSkeleton, {});
116444
+ }
116445
+ const resourceAccessListCurrentlyIncludesPublic = Boolean(
116446
+ resourceAccessList.find(
116447
+ (resourceAccess) => PUBLIC_PRINCIPAL_IDS.includes(resourceAccess.principalId)
116448
+ )
116449
+ );
116450
+ const addOrRemovePublicButtonProps = resourceAccessListCurrentlyIncludesPublic ? {
116451
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(IconSvg, { icon: "close", wrap: false }),
116452
+ children: REMOVE_PUBLIC_PRINCIPALS_BUTTON_TEXT,
116453
+ onClick: () => {
116454
+ PUBLIC_PRINCIPAL_IDS.forEach((publicId) => {
116455
+ removeResourceAccessItem(publicId);
116456
+ });
116457
+ }
116458
+ } : {
116459
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(IconSvg, { icon: "public", wrap: false }),
116460
+ children: ADD_PUBLIC_PRINCIPALS_BUTTON_TEXT,
116461
+ onClick: () => {
116462
+ onAddPrincipalToAcl(PUBLIC_PRINCIPAL_ID);
116463
+ onAddPrincipalToAcl(AUTHENTICATED_PRINCIPAL_ID);
116464
+ }
116465
+ };
116466
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
116467
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { mb: "30px", children: [
116468
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "headline3", mb: "10px", children: "Users and Teams with Permissions" }),
116469
+ resourceAccessList.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1Italic", children: emptyText }) : /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionGroup, { children: resourceAccessList.map((resourceAccess) => {
116470
+ const canChangePermission = typeof canEdit === "function" ? canEdit(resourceAccess) : canEdit;
116471
+ const canDelete = typeof canRemoveEntry === "function" ? canRemoveEntry(resourceAccess) : canRemoveEntry;
116472
+ const permissionLevelOverride = displayedPermissionLevelOverride ? displayedPermissionLevelOverride(resourceAccess) : void 0;
116473
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Collapse$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
116474
+ ResourceAccessItem,
116475
+ {
116476
+ resourceAccess,
116477
+ availablePermissionLevels: availablePermissionLevels2,
116478
+ canChangePermission,
116479
+ displayedPermissionLevelOverride: permissionLevelOverride,
116480
+ showDeleteButton: canDelete,
116481
+ onChange: (accessType) => updateResourceAccessItem(
116482
+ resourceAccess.principalId,
116483
+ accessType
116484
+ ),
116485
+ onRemove: () => removeResourceAccessItem(resourceAccess.principalId)
116486
+ }
116487
+ ) }, resourceAccess.principalId);
116488
+ }) })
116489
+ ] }),
116490
+ canEdit && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
116491
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "headline3", mb: "10px", children: "Add More" }),
116492
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
116493
+ Typography,
116494
+ {
116495
+ sx: {
116496
+ variant: "body1",
116497
+ lineHeight: "20px",
116498
+ fontStyle: "italic",
116499
+ color: "text.secondary"
116500
+ },
116501
+ mb: "20px",
116502
+ children: "Search for a username or team to add. You can search by username, first or last names, or team name."
116503
+ }
116504
+ ),
116505
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
116506
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
116507
+ Typography,
116508
+ {
116509
+ component: "label",
116510
+ variant: "smallText2",
116511
+ htmlFor: "reviewer-search",
116512
+ children: ADD_PRINCIPAL_TO_ACL_COMBOBOX_LABEL
116513
+ }
116514
+ ),
116515
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
116516
+ UserSearchBoxV2,
116517
+ {
116518
+ value: null,
116519
+ inputId: "reviewer-search",
116520
+ placeholder: "Username, name (first and last) or team name.",
116521
+ onChange: (id2) => {
116522
+ const parsedId = parseInt(id2 || "");
116523
+ if (parsedId) {
116524
+ onAddPrincipalToAcl(parsedId);
116525
+ }
116526
+ }
116527
+ }
116528
+ )
116529
+ ] }),
116530
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { display: "flex", justifyContent: "space-between", gap: 2, children: [
116531
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { children: showAddRemovePublicButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
116532
+ Button,
116533
+ {
116534
+ size: "small",
116535
+ variant: "outlined",
116536
+ ...addOrRemovePublicButtonProps
116537
+ }
116538
+ ) }),
116539
+ showNotifyCheckbox && /* @__PURE__ */ jsxRuntimeExports.jsx(
116540
+ Tooltip,
116541
+ {
116542
+ title: "Select to notify newly added people that this item has been shared with them",
116543
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
116544
+ FormControlLabel,
116545
+ {
116546
+ sx: { mr: 0 },
116547
+ control: /* @__PURE__ */ jsxRuntimeExports.jsx(
116548
+ Checkbox$1,
116549
+ {
116550
+ value: notifyCheckboxValue,
116551
+ onChange: () => onNotifyCheckboxChange(!notifyCheckboxValue)
116552
+ }
116553
+ ),
116554
+ label: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "smallText1", children: NOTIFY_NEW_ACL_USERS_CHECKBOX_LABEL })
116555
+ }
116556
+ )
116557
+ }
116558
+ )
116559
+ ] })
116560
+ ] }),
116561
+ !canEdit && /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", children: "You do not have sufficient privileges to modify the sharing settings." })
116562
+ ] });
116563
+ }
116564
+ function compareResourceAccessAndUserGroupHeader(a2, b2) {
116565
+ let CompareResult;
116566
+ ((CompareResult2) => {
116567
+ CompareResult2[CompareResult2["A_FIRST"] = -1] = "A_FIRST";
116568
+ CompareResult2[CompareResult2["B_FIRST"] = 1] = "B_FIRST";
116569
+ })(CompareResult || (CompareResult = {}));
116570
+ const hasChangePermissionA = a2.resourceAccess.accessType.includes(
116571
+ ACCESS_TYPE.CHANGE_PERMISSIONS
116572
+ );
116573
+ const hasChangePermissionB = b2.resourceAccess.accessType.includes(
116574
+ ACCESS_TYPE.CHANGE_PERMISSIONS
116575
+ );
116576
+ if (hasChangePermissionA && !hasChangePermissionB)
116577
+ return -1;
116578
+ if (!hasChangePermissionA && hasChangePermissionB)
116579
+ return 1;
116580
+ if (a2.resourceAccess.principalId === AUTHENTICATED_PRINCIPAL_ID && b2.resourceAccess.principalId !== AUTHENTICATED_PRINCIPAL_ID)
116581
+ return -1;
116582
+ if (a2.resourceAccess.principalId !== AUTHENTICATED_PRINCIPAL_ID && b2.resourceAccess.principalId === AUTHENTICATED_PRINCIPAL_ID)
116583
+ return 1;
116584
+ if (a2.resourceAccess.principalId === PUBLIC_PRINCIPAL_ID && b2.resourceAccess.principalId !== PUBLIC_PRINCIPAL_ID)
116585
+ return -1;
116586
+ if (a2.resourceAccess.principalId !== PUBLIC_PRINCIPAL_ID && b2.resourceAccess.principalId === PUBLIC_PRINCIPAL_ID)
116587
+ return 1;
116588
+ return a2.userGroupHeader.userName.localeCompare(b2.userGroupHeader.userName);
116589
+ }
116590
+ function useSortResourceAccessList(resourceAccessList) {
116591
+ const principalIdsOnResourceAccessList = React$2.useMemo(
116592
+ () => resourceAccessList.map((ra) => ra.principalId),
116593
+ [resourceAccessList]
116594
+ );
116595
+ const {
116596
+ data: userGroupHeadersOnResourceAccessList,
116597
+ isLoading,
116598
+ error: error2
116599
+ } = useGetUserGroupHeaders(principalIdsOnResourceAccessList.map(String), {
116600
+ enabled: principalIdsOnResourceAccessList.length > 0
116601
+ });
116602
+ React$2.useEffect(() => {
116603
+ if (error2) {
116604
+ console.error("Error fetching user group headers: ", error2);
116605
+ }
116606
+ }, [error2]);
116607
+ const sortedResourceAccessList = React$2.useMemo(() => {
116608
+ if (!userGroupHeadersOnResourceAccessList) {
116609
+ return null;
116610
+ }
116611
+ const joinedWithUserGroupHeaders = resourceAccessList.map(
116612
+ (ral) => ({
116613
+ resourceAccess: ral,
116614
+ userGroupHeader: userGroupHeadersOnResourceAccessList.find(
116615
+ (ugh) => String(ugh.ownerId) === String(ral.principalId)
116616
+ )
116617
+ })
116618
+ );
116619
+ const allEntriesHaveUserGroupHeader = joinedWithUserGroupHeaders.every(
116620
+ (obj) => Boolean(obj.userGroupHeader)
116621
+ );
116622
+ if (!allEntriesHaveUserGroupHeader) {
116623
+ console.warn(
116624
+ "Some ACL entries do not have a corresponding UserGroupHeader. The ResourceAccess list will not be sorted. Missing entries: ",
116625
+ joinedWithUserGroupHeaders.filter((obj) => !obj.userGroupHeader)
116626
+ );
116627
+ return null;
116628
+ }
116629
+ return joinedWithUserGroupHeaders.toSorted(compareResourceAccessAndUserGroupHeader).map((obj) => obj.resourceAccess);
116630
+ }, [resourceAccessList, userGroupHeadersOnResourceAccessList]);
116631
+ return {
116632
+ sortedResourceAccessList,
116633
+ isLoading
116634
+ };
116635
+ }
116636
+ const PRINCIPAL_ALREADY_ADDED_ERROR_MESSAGE = "User or team already has permissions.";
116637
+ const EMPTY_ARRAY$2 = [];
116638
+ function useUpdateAcl(options2 = {}) {
116639
+ const {
116640
+ initialResourceAccessList = EMPTY_ARRAY$2,
116641
+ onChange = noop$9,
116642
+ onError = noop$9
116643
+ } = options2;
116644
+ const [isDirty2, setIsDirty] = React$2.useState(false);
116645
+ const [resourceAccessList, setResourceAccessList] = React$2.useState(initialResourceAccessList);
116646
+ const [hasSorted, setHasSorted] = React$2.useState(false);
116647
+ const { sortedResourceAccessList, isLoading: isLoadingSortedList } = useSortResourceAccessList(resourceAccessList);
116648
+ React$2.useEffect(() => {
116649
+ if (!isDirty2 && !isLoadingSortedList && !hasSorted && sortedResourceAccessList != null) {
116650
+ setResourceAccessList(sortedResourceAccessList);
116651
+ setHasSorted(true);
116652
+ }
116653
+ }, [hasSorted, isDirty2, isLoadingSortedList, sortedResourceAccessList]);
116654
+ React$2.useEffect(() => {
116655
+ onChange(resourceAccessList);
116656
+ }, [resourceAccessList]);
116657
+ const addResourceAccessItem = React$2.useCallback(
116658
+ (principalId, accessTypes) => {
116659
+ setIsDirty(true);
116660
+ if (principalId) {
116661
+ setResourceAccessList((resourceAccessList2) => {
116662
+ const alreadyReviewer = resourceAccessList2.some(
116663
+ (resourceAccess) => resourceAccess.principalId === principalId
116664
+ );
116665
+ if (alreadyReviewer) {
116666
+ onError(PRINCIPAL_ALREADY_ADDED_ERROR_MESSAGE);
116667
+ } else {
116668
+ const newResourceAccess = {
116669
+ principalId,
116670
+ accessType: accessTypes
116671
+ };
116672
+ return [...resourceAccessList2, newResourceAccess];
116673
+ }
116674
+ return resourceAccessList2;
116675
+ });
116676
+ }
116677
+ },
116678
+ [onError]
116679
+ );
116680
+ const updateResourceAccessItem = React$2.useCallback(
116681
+ (principalId, accessType) => {
116682
+ setIsDirty(true);
116683
+ setResourceAccessList(
116684
+ (resourceAccessList2) => resourceAccessList2.map((resourceAccess) => {
116685
+ return resourceAccess.principalId === principalId ? { ...resourceAccess, accessType } : resourceAccess;
116686
+ })
116687
+ );
116688
+ },
116689
+ []
116690
+ );
116691
+ const removeResourceAccessItem = React$2.useCallback((principalId) => {
116692
+ setIsDirty(true);
116693
+ setResourceAccessList(
116694
+ (resourceAccessList2) => resourceAccessList2.filter(
116695
+ (raListItem) => raListItem.principalId !== principalId
116696
+ )
116697
+ );
116698
+ }, []);
116699
+ const resetDirtyState = React$2.useCallback(() => {
116700
+ setIsDirty(false);
116701
+ }, []);
116702
+ return {
116703
+ resourceAccessList,
116704
+ setResourceAccessList,
116705
+ addResourceAccessItem,
116706
+ updateResourceAccessItem,
116707
+ removeResourceAccessItem,
116708
+ resetDirtyState
116709
+ };
116710
+ }
116711
+ function InheritanceMessage(props) {
116712
+ const { isProject, isInherited, benefactorId } = props;
116713
+ let content2 = "";
116714
+ if (isProject) {
116715
+ content2 = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "The sharing settings shown below apply to this project and are inherited by all project contents unless local sharing settings have been set." });
116716
+ }
116717
+ if (isInherited) {
116718
+ content2 = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
116719
+ "The sharing settings shown below are currently being inherited",
116720
+ " ",
116721
+ benefactorId ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
116722
+ "from ",
116723
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EntityLink, { entity: benefactorId }),
116724
+ " "
116725
+ ] }) : "",
116726
+ "and cannot be modified here."
116727
+ ] });
116728
+ } else {
116729
+ content2 = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
116730
+ "The local sharing settings shown below are ",
116731
+ /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "not" }),
116732
+ " being inherited from a parent resource."
116733
+ ] });
116734
+ }
116735
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", fontStyle: "italic", color: "text.secondary", children: content2 });
116736
+ }
116737
+ const CREATE_LOCAL_SHARING_SETTINGS = "Create local sharing settings";
116738
+ const DELETE_LOCAL_SHARING_SETTINGS = "Delete local sharing settings";
116739
+ function CreateOrDeleteLocalSharingSettingsButton(props) {
116740
+ const { isInherited, setIsInherited } = props;
116741
+ if (!isInherited) {
116742
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
116743
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", mt: 2, mb: 1, children: "The sharing settings will be inherited from the parent folder or project if local sharing settings are deleted." }),
116744
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
116745
+ Button,
116746
+ {
116747
+ variant: "outlined",
116748
+ size: "small",
116749
+ color: "error",
116750
+ onClick: () => setIsInherited(true),
116751
+ children: DELETE_LOCAL_SHARING_SETTINGS
116752
+ }
116753
+ )
116754
+ ] });
116755
+ }
116756
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
116757
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", mt: 2, mb: 1, children: "Sharing settings are initially inherited from the parent folder or project by default. To customize settings for a specific file, folder, or table, you must create and adjust local sharing settings." }),
116758
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
116759
+ Button,
116760
+ {
116761
+ variant: "contained",
116762
+ size: "small",
116763
+ color: "success",
116764
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(IconSvg, { icon: "add", wrap: false }),
116765
+ onClick: () => setIsInherited(false),
116766
+ children: CREATE_LOCAL_SHARING_SETTINGS
116767
+ }
116768
+ )
116769
+ ] });
116770
+ }
116771
+ function sortResourceAccessList(resourceAccessList) {
116772
+ const clone = cloneDeep$3(resourceAccessList);
116773
+ clone.sort((a2, b2) => b2.principalId - a2.principalId);
116774
+ clone.forEach((ra) => ra.accessType.sort());
116775
+ return clone;
116776
+ }
116777
+ function resourceAccessListIsEqual(a2, b2) {
116778
+ const aSorted = sortResourceAccessList(a2);
116779
+ const bSorted = sortResourceAccessList(b2);
116780
+ return isEqual$6(aSorted, bSorted);
116781
+ }
116782
+ function shouldNotifyUserInNewResourceAccess(principalId, initialResourceAccessList, userGroupHeader, currentUserId) {
116783
+ const isInInitialResourceAccess = initialResourceAccessList.some(
116784
+ (initialResourceAccess) => principalId === initialResourceAccess.principalId
116785
+ );
116786
+ const isIndividual = userGroupHeader.isIndividual;
116787
+ const isCurrentUser = String(principalId) === currentUserId;
116788
+ const isPublic2 = PUBLIC_PRINCIPAL_IDS.includes(principalId);
116789
+ return !isInInitialResourceAccess && // Is not in the initial list
116790
+ isIndividual && // Is an individual, not a team (SWC-1195)
116791
+ !isCurrentUser && // do not notify the current user (SWC-5576)
116792
+ !isPublic2;
116793
+ }
116794
+ function useNotifyNewACLUsers(options2) {
116795
+ const { subject, body, initialResourceAccessList, newResourceAccessList } = options2;
116796
+ const { data: currentUserProfile, isLoading: isLoadingCurrentUserProfile } = useGetCurrentUserProfile();
116797
+ const { data: userGroupHeaders, isLoading: isLoadingUserGroupHeaders } = useGetUserGroupHeaders(
116798
+ newResourceAccessList.map((ra) => String(ra.principalId))
116799
+ );
116800
+ const isLoading = isLoadingCurrentUserProfile || isLoadingUserGroupHeaders;
116801
+ const { mutate: sendMessage2, isPending } = useSendMessage({
116802
+ onError: (error2) => {
116803
+ displayToast(`New users couldn't be notified: ${error2.reason}`);
116804
+ }
116805
+ });
116806
+ const sendNotification = React$2.useCallback(() => {
116807
+ if (isLoading) {
116808
+ console.error(
116809
+ "Attempted to send notification before user profile or user group headers were loaded. This should never happen."
116810
+ );
116811
+ return;
116812
+ }
116813
+ const usersToNotify = newResourceAccessList.filter((newResourceAccess) => {
116814
+ const userGroupHeader = userGroupHeaders.find(
116815
+ (ugh) => ugh.ownerId === String(newResourceAccess.principalId)
116816
+ );
116817
+ return shouldNotifyUserInNewResourceAccess(
116818
+ newResourceAccess.principalId,
116819
+ initialResourceAccessList,
116820
+ userGroupHeader,
116821
+ currentUserProfile.ownerId
116822
+ );
116823
+ }).map((ra) => String(ra.principalId));
116824
+ if (usersToNotify.length > 0) {
116825
+ sendMessage2({
116826
+ subject,
116827
+ body,
116828
+ recipients: usersToNotify
116829
+ });
116830
+ }
116831
+ }, [
116832
+ body,
116833
+ currentUserProfile,
116834
+ initialResourceAccessList,
116835
+ isLoading,
116836
+ newResourceAccessList,
116837
+ sendMessage2,
116838
+ subject,
116839
+ userGroupHeaders
116840
+ ]);
116841
+ return {
116842
+ sendNotification,
116843
+ isPending,
116844
+ isLoading
116845
+ };
116846
+ }
116847
+ function getUserName(userName, inParens) {
116848
+ if (userName != null) {
116849
+ if (inParens) {
116850
+ return ` (${userName})`;
116851
+ }
116852
+ return userName;
116853
+ }
116854
+ return "";
116855
+ }
116856
+ function getDisplayName$1(firstName, lastName, userName) {
116857
+ let displayName = "";
116858
+ let hasDisplayName = false;
116859
+ if (firstName) {
116860
+ displayName += firstName.trim();
116861
+ hasDisplayName = true;
116862
+ }
116863
+ if (lastName) {
116864
+ displayName += " " + lastName.trim();
116865
+ hasDisplayName = true;
116866
+ }
116867
+ displayName += getUserName(userName, hasDisplayName);
116868
+ return displayName;
116869
+ }
116870
+ function getDisplayNameFromProfile(userProfile) {
116871
+ return getDisplayName$1(
116872
+ userProfile.firstName,
116873
+ userProfile.lastName,
116874
+ userProfile.userName
116875
+ );
116876
+ }
116877
+ const availablePermissionLevels$1 = [
116878
+ "CAN_VIEW",
116879
+ "CAN_DOWNLOAD",
116880
+ "CAN_EDIT",
116881
+ "CAN_EDIT_DELETE",
116882
+ "CAN_ADMINISTER"
116883
+ ];
116884
+ function getSubject(entityName) {
116885
+ return `${entityName} (shared on Synapse)`;
116886
+ }
116887
+ function getBody(profile, entityId) {
116888
+ return `${getDisplayNameFromProfile(
116889
+ profile
116890
+ )} has shared an item with you on Synapse:
116891
+ ${getEndpoint(
116892
+ BackendDestinationEnum.PORTAL_ENDPOINT
116893
+ )}Synapse:${entityId}`;
116894
+ }
116895
+ function getCanEditResourceAccess(canEdit, isInherited, ownProfile) {
116896
+ if (!canEdit || isInherited) {
116897
+ return false;
116898
+ }
116899
+ return (resourceAccess) => {
116900
+ const isSelf = ownProfile.ownerId === String(resourceAccess.principalId);
116901
+ const isPublicGroup = resourceAccess.principalId === PUBLIC_PRINCIPAL_ID;
116902
+ if (isSelf || isPublicGroup) {
116903
+ return false;
116904
+ }
116905
+ return true;
116906
+ };
116907
+ }
116908
+ function getCanDeleteResourceAccess(canEdit, isInherited, ownProfile) {
116909
+ if (!canEdit || isInherited) {
116910
+ return false;
116911
+ }
116912
+ return (resourceAccess) => {
116913
+ const isSelf = ownProfile.ownerId === String(resourceAccess.principalId);
116914
+ if (isSelf) {
116915
+ return false;
116916
+ }
116917
+ return canEdit;
116918
+ };
116919
+ }
116920
+ function getDisplayedPermissionLevelOverride(isOpenData) {
116921
+ return (resourceAccess) => {
116922
+ if (resourceAccess.principalId === PUBLIC_PRINCIPAL_ID) {
116923
+ return isOpenData ? permissionLevelToLabel["CAN_DOWNLOAD"] : permissionLevelToLabel["CAN_VIEW"];
116924
+ }
116925
+ return void 0;
116926
+ };
116927
+ }
116928
+ const EntityAclEditor = React$2.forwardRef(function EntityAclEditor2(props, ref2) {
116929
+ const { entityId, onCanSaveChange, onUpdateSuccess } = props;
116930
+ const { data: ownProfile } = useSuspenseGetCurrentUserProfile();
116931
+ const { data: entityBundle } = useSuspenseGetEntityBundle(
116932
+ entityId,
116933
+ void 0,
116934
+ ALL_ENTITY_BUNDLE_FIELDS,
116935
+ { staleTime: Infinity }
116936
+ );
116937
+ const isProject = EntityType.PROJECT == entityBundle.entityType;
116938
+ const { data: parentAcl } = useSuspenseGetEntityBenefactorACL(
116939
+ entityBundle.entity.parentId,
116940
+ {
116941
+ staleTime: Infinity
116942
+ }
116943
+ );
116944
+ const originalResourceAccess = entityBundle.benefactorAcl.resourceAccess;
116945
+ const parentResourceAccess = React$2.useMemo(
116946
+ () => (parentAcl == null ? void 0 : parentAcl.resourceAccess) ?? [],
116947
+ [parentAcl]
116948
+ );
116949
+ const canEdit = entityBundle.permissions.canChangePermissions;
116950
+ const isOpenData = entityBundle.permissions.isEntityOpenData;
116951
+ const originalIsInherited = !(entityBundle.benefactorAcl.id == entityId);
116952
+ const [updatedIsInherited, setUpdatedIsInherited] = React$2.useState(originalIsInherited);
116953
+ const [notifyNewAdditions, setNotifyNewAdditions] = React$2.useState(false);
116954
+ const [error2, setError] = React$2.useState();
116955
+ const {
116956
+ resourceAccessList: updatedResourceAccessList,
116957
+ setResourceAccessList,
116958
+ addResourceAccessItem,
116959
+ updateResourceAccessItem,
116960
+ removeResourceAccessItem,
116961
+ resetDirtyState
116962
+ } = useUpdateAcl({ initialResourceAccessList: originalResourceAccess });
116963
+ React$2.useEffect(() => {
116964
+ if (originalResourceAccess) {
116965
+ resetDirtyState();
116966
+ setResourceAccessList([...originalResourceAccess]);
116967
+ }
116968
+ }, [originalResourceAccess, resetDirtyState, setResourceAccessList]);
116969
+ React$2.useEffect(() => {
116970
+ resetDirtyState();
116971
+ setUpdatedIsInherited(originalIsInherited);
116972
+ }, [originalIsInherited, resetDirtyState]);
116973
+ React$2.useEffect(() => {
116974
+ if (originalIsInherited == updatedIsInherited) {
116975
+ setResourceAccessList(originalResourceAccess);
116976
+ } else if (updatedIsInherited) {
116977
+ setResourceAccessList(parentResourceAccess);
116978
+ } else ;
116979
+ resetDirtyState();
116980
+ }, [
116981
+ originalIsInherited,
116982
+ originalResourceAccess,
116983
+ parentResourceAccess,
116984
+ resetDirtyState,
116985
+ setResourceAccessList,
116986
+ updatedIsInherited
116987
+ ]);
116988
+ const isPublic2 = updatedResourceAccessList.some(
116989
+ (ra) => [
116990
+ AUTHENTICATED_PRINCIPAL_ID,
116991
+ PUBLIC_PRINCIPAL_ID,
116992
+ ANONYMOUS_PRINCIPAL_ID
116993
+ ].includes(ra.principalId)
116994
+ );
116995
+ const {
116996
+ sendNotification,
116997
+ isLoading: isLoadingSendMessageToNewACLUsers,
116998
+ isPending: isPendingSendMessageToNewACLUsers
116999
+ } = useNotifyNewACLUsers({
117000
+ subject: getSubject(entityBundle.entity.name || ""),
117001
+ body: getBody(ownProfile, entityId),
117002
+ initialResourceAccessList: originalResourceAccess,
117003
+ newResourceAccessList: updatedResourceAccessList
117004
+ });
117005
+ const mutationOptions = {
117006
+ onSuccess: () => {
117007
+ if (notifyNewAdditions) {
117008
+ sendNotification();
117009
+ }
117010
+ onUpdateSuccess();
117011
+ },
117012
+ onError: (e2) => {
117013
+ setError(e2);
117014
+ }
117015
+ };
117016
+ const { mutate: createAcl, isPending: isPendingCreateAcl } = useCreateEntityACL(mutationOptions);
117017
+ const { mutate: updateAcl, isPending: isPendingUpdateAcl } = useUpdateEntityACL(mutationOptions);
117018
+ const { mutate: deleteAcl, isPending: isPendingDeleteAcl } = useDeleteEntityACL(mutationOptions);
117019
+ const isPending = isPendingCreateAcl || isPendingUpdateAcl || isPendingDeleteAcl || isPendingSendMessageToNewACLUsers;
117020
+ const hasAclChanged = React$2.useMemo(() => {
117021
+ return originalIsInherited != updatedIsInherited || !resourceAccessListIsEqual(
117022
+ originalResourceAccess,
117023
+ updatedResourceAccessList
117024
+ );
117025
+ }, [
117026
+ originalResourceAccess,
117027
+ originalIsInherited,
117028
+ updatedIsInherited,
117029
+ updatedResourceAccessList
117030
+ ]);
117031
+ const canSave = hasAclChanged || isLoadingSendMessageToNewACLUsers || isPending;
117032
+ React$2.useEffect(() => {
117033
+ onCanSaveChange(canSave);
117034
+ }, [onCanSaveChange, canSave]);
117035
+ React$2.useImperativeHandle(
117036
+ ref2,
117037
+ () => {
117038
+ return {
117039
+ save() {
117040
+ if (canSave) {
117041
+ if (originalIsInherited != updatedIsInherited) {
117042
+ if (updatedIsInherited) {
117043
+ deleteAcl(entityId);
117044
+ } else {
117045
+ createAcl({
117046
+ id: entityId,
117047
+ resourceAccess: updatedResourceAccessList
117048
+ });
117049
+ }
117050
+ } else {
117051
+ updateAcl({
117052
+ // ensure we get all fields from the original ACL, including the etag
117053
+ ...entityBundle.accessControlList,
117054
+ resourceAccess: updatedResourceAccessList
117055
+ });
117056
+ }
117057
+ } else {
117058
+ console.error("EntityAclEditor: save() called but canSave is false");
117059
+ }
117060
+ }
117061
+ };
117062
+ },
117063
+ [
117064
+ canSave,
117065
+ createAcl,
117066
+ deleteAcl,
117067
+ entityBundle,
117068
+ entityId,
117069
+ originalIsInherited,
117070
+ updateAcl,
117071
+ updatedIsInherited,
117072
+ updatedResourceAccessList
117073
+ ]
117074
+ );
117075
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack$6, { gap: 2, children: [
117076
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
117077
+ OpenData,
117078
+ {
117079
+ isOpenData,
117080
+ isPublic: isPublic2,
117081
+ currentUserCanUpdateSharingSettings: canEdit
117082
+ }
117083
+ ),
117084
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
117085
+ InheritanceMessage,
117086
+ {
117087
+ isProject,
117088
+ isInherited: updatedIsInherited,
117089
+ benefactorId: updatedIsInherited ? parentAcl == null ? void 0 : parentAcl.id : entityId
117090
+ }
117091
+ ),
117092
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
117093
+ AclEditor,
117094
+ {
117095
+ canEdit: getCanEditResourceAccess(
117096
+ canEdit,
117097
+ updatedIsInherited,
117098
+ ownProfile
117099
+ ),
117100
+ canRemoveEntry: getCanDeleteResourceAccess(
117101
+ canEdit,
117102
+ updatedIsInherited,
117103
+ ownProfile
117104
+ ),
117105
+ resourceAccessList: updatedResourceAccessList,
117106
+ availablePermissionLevels: availablePermissionLevels$1,
117107
+ emptyText: (
117108
+ /* This should never happen */
117109
+ ""
117110
+ ),
117111
+ displayedPermissionLevelOverride: getDisplayedPermissionLevelOverride(
117112
+ isOpenData
117113
+ ),
117114
+ onAddPrincipalToAcl: (id2) => {
117115
+ if (id2 === PUBLIC_PRINCIPAL_ID) {
117116
+ addResourceAccessItem(
117117
+ id2,
117118
+ getAccessTypeFromPermissionLevel("CAN_VIEW")
117119
+ );
117120
+ } else {
117121
+ addResourceAccessItem(
117122
+ id2,
117123
+ getAccessTypeFromPermissionLevel("CAN_DOWNLOAD")
117124
+ );
117125
+ }
117126
+ },
117127
+ updateResourceAccessItem,
117128
+ removeResourceAccessItem,
117129
+ showNotifyCheckbox: true,
117130
+ notifyCheckboxValue: notifyNewAdditions,
117131
+ onNotifyCheckboxChange: setNotifyNewAdditions,
117132
+ showAddRemovePublicButton: true
117133
+ }
117134
+ ),
117135
+ !isProject && entityBundle.permissions.canEnableInheritance && /* @__PURE__ */ jsxRuntimeExports.jsx(
117136
+ CreateOrDeleteLocalSharingSettingsButton,
117137
+ {
117138
+ isInherited: updatedIsInherited,
117139
+ setIsInherited: setUpdatedIsInherited
117140
+ }
117141
+ ),
117142
+ error2 && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { severity: "error", children: error2.message })
117143
+ ] });
117144
+ });
117145
+ const EntityAclEditorWithSuspense = React$2.forwardRef(
117146
+ function EntityAclEditorWithSuspense2(props, ref2) {
117147
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(SynapseErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(React$2.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(AclEditorSkeleton, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsx(EntityAclEditor, { ...props, ref: ref2 }) }) });
117148
+ }
117149
+ );
117150
+ const ENTITY_SHARING_SETTINGS_HELP_MARKDOWN = `Sharing settings determine who can access your content, and what kind of access they have. Choose people/teams and define their level of access below.
117151
+
117152
+ _Only Administrators can add, delete, or change access levels for other people._`;
117153
+ const ENTITY_SHARING_SETTINGS_HELP_URL = "https://help.synapse.org/docs/Sharing-Settings,-Permissions,-and-Conditions-for-Use.2024276030.html";
117154
+ function EntityAclEditorModal(props) {
117155
+ var _a3;
117156
+ const { entityId, open, onUpdateSuccess = noop$9, onClose } = props;
117157
+ const [isDirty2, setIsDirty] = React$2.useState(false);
117158
+ const entityAclEditorRef = React$2.useRef(null);
117159
+ const { data: entityBundle } = useGetEntityBundle(entityId);
117160
+ const entityTypeDisplay = (entityBundle == null ? void 0 : entityBundle.entityType) ? entityTypeToFriendlyName(entityBundle == null ? void 0 : entityBundle.entityType) : "";
117161
+ const canEdit = (_a3 = entityBundle == null ? void 0 : entityBundle.permissions) == null ? void 0 : _a3.canChangePermissions;
117162
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
117163
+ ConfirmationDialog,
117164
+ {
117165
+ title: `${entityTypeDisplay} Sharing Settings`.trim(),
117166
+ onCancel: onClose,
117167
+ open,
117168
+ maxWidth: "md",
117169
+ titleHelpPopoverProps: {
117170
+ markdownText: ENTITY_SHARING_SETTINGS_HELP_MARKDOWN,
117171
+ helpUrl: ENTITY_SHARING_SETTINGS_HELP_URL
117172
+ },
117173
+ content: /* @__PURE__ */ jsxRuntimeExports.jsx(
117174
+ EntityAclEditorWithSuspense,
117175
+ {
117176
+ ref: entityAclEditorRef,
117177
+ entityId,
117178
+ onCanSaveChange: (isDirty22) => setIsDirty(isDirty22),
117179
+ onUpdateSuccess: () => {
117180
+ displayToast(
117181
+ "Permissions were successfully saved to Synapse",
117182
+ "info"
117183
+ );
117184
+ onUpdateSuccess();
117185
+ onClose();
117186
+ }
117187
+ }
117188
+ ),
117189
+ onConfirm: () => {
117190
+ entityAclEditorRef.current.save();
117191
+ },
117192
+ confirmButtonProps: {
117193
+ children: canEdit ? "Save" : "OK",
117194
+ disabled: !isDirty2
117195
+ }
117196
+ }
117197
+ );
117198
+ }
115984
117199
  const DEFAULT_ON_VIEW_SHARING_SETTINGS_CLICKED = (benefactorEntityId) => window.open(
115985
117200
  `https://www.synapse.org/Synapse:${benefactorEntityId}`,
115986
117201
  "_blank"
@@ -116000,7 +117215,11 @@ ${e2.message}`);
116000
117215
  includeEntity: true,
116001
117216
  includePermissions: true
116002
117217
  });
117218
+ const [showSharingSettings, setShowSharingSettings] = React$2.useState(false);
116003
117219
  const hasDownloadPermission = Boolean(entityBundle == null ? void 0 : entityBundle.permissions.canDownload);
117220
+ const useReactACLEditor = useGetFeatureFlag(
117221
+ FeatureFlagEnum.REACT_ENTITY_ACL_EDITOR
117222
+ );
116004
117223
  if (isError) {
116005
117224
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { severity: "error", children: error2.reason });
116006
117225
  }
@@ -116019,12 +117238,20 @@ ${e2.message}`);
116019
117238
  count: count2,
116020
117239
  actionNode: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
116021
117240
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "smallText1", sx: { mb: 1, color: "grey.700" }, children: "Contact an administrator to request download permission" }),
117241
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
117242
+ EntityAclEditorModal,
117243
+ {
117244
+ entityId,
117245
+ open: showSharingSettings,
117246
+ onClose: () => setShowSharingSettings(false)
117247
+ }
117248
+ ),
116022
117249
  /* @__PURE__ */ jsxRuntimeExports.jsx(
116023
117250
  Button,
116024
117251
  {
116025
117252
  variant: "outlined",
116026
117253
  onClick: () => {
116027
- onViewSharingSettingsClicked(entityId);
117254
+ useReactACLEditor ? setShowSharingSettings(true) : onViewSharingSettingsClicked(entityId);
116028
117255
  },
116029
117256
  disabled: hasDownloadPermission,
116030
117257
  children: hasDownloadPermission ? "Complete" : "View Sharing Settings"
@@ -117296,29 +118523,6 @@ query = syn.tableQuery("${clientSql}")${"\n"}query.asDataFrame()`
117296
118523
  }
117297
118524
  );
117298
118525
  }
117299
- const SkeletonParagraph = ({
117300
- numRows = 5,
117301
- rowHeight,
117302
- className
117303
- }) => {
117304
- const [skeletons, setSkeletons] = React$2.useState([]);
117305
- React$2.useEffect(() => {
117306
- const elements = [];
117307
- times$2(numRows, (i2) => {
117308
- elements.push(
117309
- /* @__PURE__ */ jsxRuntimeExports.jsx(React$2.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
117310
- Skeleton,
117311
- {
117312
- height: rowHeight,
117313
- width: i2 === numRows - 1 ? "35%" : "100%"
117314
- }
117315
- ) }, i2)
117316
- );
117317
- });
117318
- setSkeletons(elements);
117319
- }, [numRows, rowHeight]);
117320
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className, children: skeletons });
117321
- };
117322
118526
  function useExportToCavatica(queryBundleRequest, selectColumns, fileIdColumnName = "id", fileNameColumnName = "name", fileVersionColumnName = "currentVersion") {
117323
118527
  const { accessToken } = useSynapseContext();
117324
118528
  const separator = ",";
@@ -123241,7 +124445,7 @@ query = syn.tableQuery("${clientSql}")${"\n"}query.asDataFrame()`
123241
124445
  } = props;
123242
124446
  return /* @__PURE__ */ jsxRuntimeExports.jsx(DialogTitle, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack$6, { direction: "row", alignItems: "center", gap: "5px", children: [
123243
124447
  title2,
123244
- titleHelpPopoverProps && /* @__PURE__ */ jsxRuntimeExports.jsx(HelpPopover, { ...titleHelpPopoverProps }),
124448
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { component: "span", fontSize: "14px", children: titleHelpPopoverProps && /* @__PURE__ */ jsxRuntimeExports.jsx(HelpPopover, { ...titleHelpPopoverProps }) }),
123245
124449
  /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { flexGrow: 1 } }),
123246
124450
  hasCloseButton && /* @__PURE__ */ jsxRuntimeExports.jsx(CloseButton, { onClick: () => onCancel() })
123247
124451
  ] }) });
@@ -124301,13 +125505,13 @@ query = syn.tableQuery("${clientSql}")${"\n"}query.asDataFrame()`
124301
125505
  }
124302
125506
  ) }, requester.userId))
124303
125507
  ] }),
124304
- /* @__PURE__ */ jsxRuntimeExports.jsx("td", { children: item.accessRequirementReviewerIds.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(UserOrTeamBadge, { principalId: ACT_TEAM_ID }) : item.accessRequirementReviewerIds.map((reviewerId2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
125508
+ /* @__PURE__ */ jsxRuntimeExports.jsx("td", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Stack$6, { gap: 1, children: item.accessRequirementReviewerIds.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(UserOrTeamBadge, { principalId: ACT_TEAM_ID }) : item.accessRequirementReviewerIds.map((reviewerId2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
124305
125509
  UserOrTeamBadge,
124306
125510
  {
124307
125511
  principalId: reviewerId2
124308
125512
  },
124309
125513
  reviewerId2
124310
- )) }),
125514
+ )) }) }),
124311
125515
  /* @__PURE__ */ jsxRuntimeExports.jsx("td", { children: formatDate(dayjs(item.createdOn)) })
124312
125516
  ] }, item.id);
124313
125517
  }) })
@@ -153147,72 +154351,6 @@ query = syn.tableQuery("${clientSql}")${"\n"}query.asDataFrame()`
153147
154351
  });
153148
154352
  return { table: table2, isLoading, hasNextPage: hasNextPage2, fetchNextPage };
153149
154353
  }
153150
- const StyledTableContainer = styled(Box)(({ theme: theme3, density = "default" }) => ({
153151
- overflow: "auto",
153152
- paddingLeft: "2px",
153153
- th: {
153154
- height: "38px",
153155
- backgroundColor: theme3.palette.grey[200]
153156
- },
153157
- ["th:first-of-type"]: {
153158
- paddingLeft: "10px"
153159
- },
153160
- ["td:first-of-type"]: {
153161
- paddingLeft: "10px"
153162
- },
153163
- ["tr:nth-of-type(2n)"]: {
153164
- backgroundColor: theme3.palette.grey[100]
153165
- },
153166
- ["th,td"]: {
153167
- paddingLeft: theme3.spacing(density === "compact" ? 0 : 1),
153168
- paddingRight: theme3.spacing(density === "compact" ? 0 : 1)
153169
- },
153170
- td: {
153171
- paddingTop: theme3.spacing(density === "compact" ? 0 : 1),
153172
- paddingBottom: theme3.spacing(density === "compact" ? 0 : 1)
153173
- }
153174
- }));
153175
- function StyledTanStackTable(props) {
153176
- const { table: table2, styledTableContainerProps } = props;
153177
- return /* @__PURE__ */ jsxRuntimeExports.jsx(StyledTableContainer, { ...styledTableContainerProps, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("table", { style: { width: "100%" }, children: [
153178
- /* @__PURE__ */ jsxRuntimeExports.jsx("thead", { children: table2.getHeaderGroups().map((headerGroup) => {
153179
- return /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
153180
- "th",
153181
- {
153182
- colSpan: header.colSpan,
153183
- style: { width: header.getSize() },
153184
- children: [
153185
- header.isPlaceholder ? null : flexRender(
153186
- header.column.columnDef.header,
153187
- header.getContext()
153188
- ),
153189
- header.column.getCanResize() && /* @__PURE__ */ jsxRuntimeExports.jsx(
153190
- "div",
153191
- {
153192
- className: `resizer ${header.column.getIsResizing() ? "isResizing" : ""}`,
153193
- onMouseDown: header.getResizeHandler(),
153194
- onTouchStart: header.getResizeHandler()
153195
- }
153196
- )
153197
- ]
153198
- },
153199
- header.id
153200
- )) }, headerGroup.id);
153201
- }) }),
153202
- /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: table2.getRowModel().rows.map((row) => /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: row.getVisibleCells().map((cell) => {
153203
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
153204
- "td",
153205
- {
153206
- style: {
153207
- width: cell.column.getSize()
153208
- },
153209
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
153210
- },
153211
- cell.id
153212
- );
153213
- }) }, row.id)) })
153214
- ] }) });
153215
- }
153216
154354
  function AccessRequirementTable(props) {
153217
154355
  const {
153218
154356
  nameOrID,
@@ -153912,7 +155050,7 @@ query = syn.tableQuery("${clientSql}")${"\n"}query.asDataFrame()`
153912
155050
  parseInt(submission == null ? void 0 : submission.accessRequirementId),
153913
155051
  { enabled: !!submission }
153914
155052
  );
153915
- const { data: acl } = useGetAccessRequirementACL(
155053
+ const { data: acl, isLoading: isLoadingACL } = useGetAccessRequirementACL(
153916
155054
  submission == null ? void 0 : submission.accessRequirementId,
153917
155055
  { enabled: !!submission, throwOnError: true }
153918
155056
  );
@@ -153923,6 +155061,7 @@ query = syn.tableQuery("${clientSql}")${"\n"}query.asDataFrame()`
153923
155061
  newState: SubmissionState.APPROVED
153924
155062
  });
153925
155063
  }
155064
+ const reviewerIds = acl == null ? void 0 : acl.resourceAccess.filter((ra) => ra.accessType.includes(ACCESS_TYPE.REVIEW_SUBMISSIONS)).map((ra) => ra.principalId);
153926
155065
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "SubmissionPage", children: [
153927
155066
  /* @__PURE__ */ jsxRuntimeExports.jsx(
153928
155067
  ApproveConfirmationModal,
@@ -153982,15 +155121,13 @@ query = syn.tableQuery("${clientSql}")${"\n"}query.asDataFrame()`
153982
155121
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "smallText1", children: (accessRequirement == null ? void 0 : accessRequirement.name) ?? /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { width: 100 }) }),
153983
155122
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
153984
155123
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "dataFieldKey", children: "Assigned Reviewer" }),
153985
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "smallText1", children: acl !== void 0 ? acl !== null ? acl.resourceAccess.map((ra) => {
153986
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
153987
- UserOrTeamBadge,
153988
- {
153989
- principalId: ra.principalId
153990
- },
153991
- ra.principalId
153992
- );
153993
- }) : /* @__PURE__ */ jsxRuntimeExports.jsx(UserOrTeamBadge, { principalId: ACT_TEAM_ID }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { width: 100 }) }),
155124
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { variant: "smallText1", children: [
155125
+ isLoadingACL && /* @__PURE__ */ jsxRuntimeExports.jsx(Skeleton, { width: 100 }),
155126
+ !isLoadingACL && !isEmpty$1(reviewerIds) && reviewerIds.map((id2) => {
155127
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(UserOrTeamBadge, { principalId: id2 }, id2);
155128
+ }),
155129
+ !isLoadingACL && isEmpty$1(reviewerIds) && /* @__PURE__ */ jsxRuntimeExports.jsx(UserOrTeamBadge, { principalId: ACT_TEAM_ID })
155130
+ ] }),
153994
155131
  /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
153995
155132
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "dataFieldKey", children: "Conditions" }),
153996
155133
  accessRequirement ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "smallText1", component: "div", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { children: [
@@ -161608,7 +162745,7 @@ dl_list_file_entities = syn.get_download_list()`;
161608
162745
  (selectColumn) => selectColumn.name == "N_UNIQUE_USERS"
161609
162746
  );
161610
162747
  const egressSizeColIndex = headers == null ? void 0 : headers.findIndex(
161611
- (selectColumn) => selectColumn.name == "TOTAL_DATA_SIZE_GIB"
162748
+ (selectColumn) => selectColumn.name == "ESTIMATED_PROJECT_SIZE_IN_GIB"
161612
162749
  );
161613
162750
  if (!rowSet || rowSet.rows.length == 0) {
161614
162751
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
@@ -161626,7 +162763,7 @@ dl_list_file_entities = syn.get_download_list()`;
161626
162763
  children: [
161627
162764
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", sx: { ml: "15px" }, children: "Rank" }),
161628
162765
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", children: "Project" }),
161629
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", children: "Data Downloaded" }),
162766
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", children: "Project Data" }),
161630
162767
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", children: "Unique Teams" }),
161631
162768
  /* @__PURE__ */ jsxRuntimeExports.jsx(Box, {})
161632
162769
  ]
@@ -162047,38 +163184,7 @@ dl_list_file_entities = syn.get_download_list()`;
162047
163184
  }
162048
163185
  );
162049
163186
  };
162050
- const calculateOpacity = (rect) => {
162051
- const viewportHeight = window.innerHeight;
162052
- const elementCenterY = rect.top + rect.height / 2;
162053
- const middleRangeStart = viewportHeight * 0.4;
162054
- const middleRangeEnd = viewportHeight * 0.6;
162055
- if (elementCenterY <= middleRangeEnd) {
162056
- return 1;
162057
- } else {
162058
- const distanceToMiddle = Math.min(
162059
- Math.abs(elementCenterY - middleRangeStart),
162060
- Math.abs(elementCenterY - middleRangeEnd)
162061
- );
162062
- const maxDistance = viewportHeight / 4;
162063
- return Math.max(0, 1 - distanceToMiddle / maxDistance);
162064
- }
162065
- };
162066
- function useScrollFadeTransition() {
162067
- const ref2 = React$2.useRef(null);
162068
- const [opacity, setOpacity] = React$2.useState(1);
162069
- React$2.useEffect(() => {
162070
- const handleScroll = () => {
162071
- const rect = ref2.current.getBoundingClientRect();
162072
- setOpacity(calculateOpacity(rect));
162073
- };
162074
- if (ref2) {
162075
- window.addEventListener("scroll", handleScroll);
162076
- handleScroll();
162077
- }
162078
- return () => window.removeEventListener("scroll", handleScroll);
162079
- }, [ref2]);
162080
- return { ref: ref2, opacity };
162081
- }
163187
+ const transitionTimeoutMs = 320;
162082
163188
  const mobileViewSxProps = {
162083
163189
  display: "flex",
162084
163190
  justifyContent: "center",
@@ -162099,7 +163205,7 @@ dl_list_file_entities = syn.get_download_list()`;
162099
163205
  }) => {
162100
163206
  const theme3 = useTheme$1();
162101
163207
  const isMobileView = useMediaQuery(theme3.breakpoints.down("sm"));
162102
- const { ref: ref2, opacity } = useScrollFadeTransition();
163208
+ const [ref2, inView] = useInView({ threshold: 0.3, triggerOnce: true });
162103
163209
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
162104
163210
  Box,
162105
163211
  {
@@ -162212,16 +163318,15 @@ dl_list_file_entities = syn.get_download_list()`;
162212
163318
  sx: {
162213
163319
  display: { xs: "none", md: "block" },
162214
163320
  justifySelf: "end",
162215
- alignSelf: "end",
162216
- opacity
163321
+ alignSelf: "end"
162217
163322
  },
162218
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(
163323
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Fade, { in: inView, timeout: transitionTimeoutMs, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Slide, { direction: "left", timeout: transitionTimeoutMs, in: inView, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
162219
163324
  ImageFromSynapseTable,
162220
163325
  {
162221
163326
  tableId,
162222
163327
  fileHandleId: imageFileHandleId
162223
163328
  }
162224
- )
163329
+ ) }) }) }) })
162225
163330
  }
162226
163331
  )
162227
163332
  ]
@@ -162538,11 +163643,7 @@ dl_list_file_entities = syn.get_download_list()`;
162538
163643
  SynapsePlanContent,
162539
163644
  {
162540
163645
  category: "Explore Data",
162541
- items: [
162542
- "<100 GB of content",
162543
- "Sage Managed Individual Storage",
162544
- "4TB/year of data egress"
162545
- ]
163646
+ items: ["<100 GB of content", "Sage Managed Individual Storage"]
162546
163647
  }
162547
163648
  ),
162548
163649
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -162574,11 +163675,7 @@ dl_list_file_entities = syn.get_download_list()`;
162574
163675
  SynapsePlanContent,
162575
163676
  {
162576
163677
  category: "Explore More Data",
162577
- items: [
162578
- "<500 GB of content",
162579
- "Secure cloud storage",
162580
- "<20 TB/year of data egress"
162581
- ]
163678
+ items: ["<500 GB of content", "Secure cloud storage"]
162582
163679
  }
162583
163680
  ),
162584
163681
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -163216,19 +164313,101 @@ dl_list_file_entities = syn.get_download_list()`;
163216
164313
  width: "16px",
163217
164314
  transition: "fill 1s ease-in-out"
163218
164315
  }));
164316
+ const searchValues = [
164317
+ "Alzheimer's Disease",
164318
+ "Neurofibromatosis mouse models",
164319
+ "Cancer",
164320
+ "UK Biobank",
164321
+ "Single-cell analysis of breast cancer",
164322
+ "ROSMAP Religious Orders Study and Memory and Aging Project",
164323
+ "Retinal regeneration studies",
164324
+ "Machine Learning datasets"
164325
+ ];
164326
+ const projectKeyValue = {
164327
+ key: "node_type",
164328
+ value: "project",
164329
+ not: false
164330
+ };
164331
+ const SynapseSearchChips = ({ gotoPlace }) => {
164332
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: searchValues.map((value) => {
164333
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
164334
+ Chip,
164335
+ {
164336
+ label: /* @__PURE__ */ jsxRuntimeExports.jsx(
164337
+ Typography,
164338
+ {
164339
+ variant: "body1",
164340
+ sx: {
164341
+ fontSize: "18px",
164342
+ fontWeight: 400,
164343
+ p: "10px"
164344
+ },
164345
+ children: value
164346
+ }
164347
+ ),
164348
+ onClick: () => {
164349
+ const searchQuery = {
164350
+ queryTerm: [value],
164351
+ booleanQuery: value == "Cancer" ? [projectKeyValue] : void 0,
164352
+ // match existing facet options in SWC search
164353
+ facetOptions: [
164354
+ {
164355
+ name: SearchFieldName.ENTITY_TYPE,
164356
+ maxResultCount: 300,
164357
+ sortType: SearchFacetSort.COUNT
164358
+ },
164359
+ {
164360
+ name: SearchFieldName.CONSORTIUM,
164361
+ maxResultCount: 300,
164362
+ sortType: SearchFacetSort.COUNT
164363
+ },
164364
+ {
164365
+ name: SearchFieldName.MODIFIED_ON,
164366
+ maxResultCount: 300,
164367
+ sortType: SearchFacetSort.COUNT
164368
+ },
164369
+ {
164370
+ name: SearchFieldName.MODIFIED_BY,
164371
+ maxResultCount: 300,
164372
+ sortType: SearchFacetSort.COUNT
164373
+ },
164374
+ {
164375
+ name: SearchFieldName.CREATED_ON,
164376
+ maxResultCount: 300,
164377
+ sortType: SearchFacetSort.COUNT
164378
+ },
164379
+ {
164380
+ name: SearchFieldName.TISSUE,
164381
+ maxResultCount: 300,
164382
+ sortType: SearchFacetSort.COUNT
164383
+ },
164384
+ {
164385
+ name: SearchFieldName.CREATED_BY,
164386
+ maxResultCount: 300,
164387
+ sortType: SearchFacetSort.COUNT
164388
+ }
164389
+ ],
164390
+ start: 0,
164391
+ size: 30
164392
+ };
164393
+ gotoPlace(`/Search:${JSON.stringify(searchQuery)}`);
164394
+ },
164395
+ variant: "outlined",
164396
+ sx: {
164397
+ color: "secondary.600",
164398
+ backgroundColor: "secondary.100",
164399
+ borderWidth: "0px",
164400
+ "&:hover": { backgroundColor: "#B5D3CE !important" }
164401
+ }
164402
+ },
164403
+ value
164404
+ );
164405
+ }) });
164406
+ };
163219
164407
  const synapseInActionTable = "syn61670075";
163220
164408
  const past30DaysDownloadMetricsTable = "syn61597084";
163221
164409
  const generalStatsMetricsTable = "syn61588163";
163222
164410
  const featuredDatasetsTable = "syn61609402";
163223
- const popularSearches = [
163224
- "Alzheimer's Disease",
163225
- "Parkinson",
163226
- "Neurofibromatosis",
163227
- "HTAN",
163228
- "ukb-ppp",
163229
- "ROSMAP",
163230
- "GENIE"
163231
- ];
163232
164411
  const darkTextColor = "#22252A";
163233
164412
  const homepageBodyText = {
163234
164413
  fontSize: "24px",
@@ -163409,120 +164588,102 @@ dl_list_file_entities = syn.get_download_list()`;
163409
164588
  mt: "30px",
163410
164589
  flexWrap: "wrap"
163411
164590
  },
163412
- children: popularSearches.map((value) => {
163413
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
163414
- Chip,
163415
- {
163416
- label: /* @__PURE__ */ jsxRuntimeExports.jsx(
163417
- Typography,
163418
- {
163419
- variant: "body1",
163420
- sx: {
163421
- fontSize: "18px",
163422
- fontWeight: 400,
163423
- p: "10px"
163424
- },
163425
- children: value
163426
- }
163427
- ),
163428
- onClick: () => gotoPlace(`/Search:${encodeURIComponent(value)}`),
163429
- variant: "outlined",
163430
- sx: {
163431
- color: "secondary.600",
163432
- backgroundColor: "secondary.100",
163433
- borderWidth: "0px",
163434
- "&:hover": { backgroundColor: "#B5D3CE !important" }
163435
- }
163436
- },
163437
- value
163438
- );
163439
- })
164591
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(SynapseSearchChips, { gotoPlace })
163440
164592
  }
163441
164593
  ),
163442
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
164594
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
163443
164595
  Box,
163444
164596
  {
163445
164597
  sx: {
163446
- display: { xs: "relative", lg: "grid" },
163447
- gridTemplateColumns: "50% 50%",
163448
164598
  backgroundColor: "#F5F9F9",
163449
- mt: { xs: "50px", md: "100px" },
163450
- height: { lg: "608px" }
163451
- //force container to the same height as the image
164599
+ mt: { xs: "50px", md: "100px" }
163452
164600
  },
163453
- children: [
163454
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
163455
- Box,
163456
- {
163457
- sx: {
163458
- p: { xs: "25px", lg: "70px 0px 25px 60px" },
163459
- svg: {
163460
- maxWidth: "100%"
163461
- },
163462
- display: "flex",
163463
- flexDirection: "column",
163464
- alignItems: {
163465
- xs: "center",
163466
- md: "flex-start"
163467
- }
163468
- },
163469
- ref: ref2,
163470
- children: [
163471
- /* @__PURE__ */ jsxRuntimeExports.jsx(SageFullLogo, { width: 350 }),
163472
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
163473
- Typography,
163474
- {
163475
- variant: "headline2",
163476
- sx: {
163477
- ...defaultHomepageText,
163478
- fontSize: {
163479
- xs: "24px",
163480
- md: "40px"
163481
- },
163482
- lineHeight: {
163483
- xs: "140%",
163484
- md: "60px"
163485
- },
163486
- maxWidth: "600px",
163487
- color: "secondary.600",
163488
- mt: "20px",
163489
- fontWeight: 400,
163490
- mb: "35px",
163491
- textAlign: {
163492
- xs: "center",
163493
- md: "left"
163494
- }
164601
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
164602
+ Box,
164603
+ {
164604
+ sx: {
164605
+ display: { xs: "relative", lg: "grid" },
164606
+ maxWidth: "1500px",
164607
+ gridTemplateColumns: "50% 50%",
164608
+ margin: "auto",
164609
+ height: { lg: "608px" }
164610
+ //force container to the same height as the image
164611
+ },
164612
+ children: [
164613
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
164614
+ Box,
164615
+ {
164616
+ sx: {
164617
+ p: { xs: "25px", lg: "70px 0px 25px 60px" },
164618
+ svg: {
164619
+ maxWidth: "100%"
163495
164620
  },
163496
- children: [
163497
- "Created by ",
163498
- /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Sage Bionetworks" }),
163499
- ", Synapse empowers biomedical researchers with tools for open science and collaboration, forging a path to optimal human health."
163500
- ]
163501
- }
163502
- ),
163503
- /* @__PURE__ */ jsxRuntimeExports.jsx(
163504
- Button,
163505
- {
163506
- size: "large",
163507
- variant: "contained",
163508
- color: "secondary",
163509
- href: "https://www.sagebionetworks.org",
163510
- target: "_blank",
163511
- sx: {
163512
- p: "5px 25px",
163513
- width: {
163514
- xs: "100%",
163515
- md: "auto"
164621
+ display: "flex",
164622
+ flexDirection: "column",
164623
+ alignItems: {
164624
+ xs: "center",
164625
+ md: "flex-start"
164626
+ }
164627
+ },
164628
+ ref: ref2,
164629
+ children: [
164630
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SageFullLogo, { width: 350 }),
164631
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
164632
+ Typography,
164633
+ {
164634
+ variant: "headline2",
164635
+ sx: {
164636
+ ...defaultHomepageText,
164637
+ fontSize: {
164638
+ xs: "24px",
164639
+ md: "40px"
164640
+ },
164641
+ lineHeight: {
164642
+ xs: "140%",
164643
+ md: "60px"
164644
+ },
164645
+ maxWidth: "600px",
164646
+ color: "secondary.600",
164647
+ mt: "20px",
164648
+ fontWeight: 400,
164649
+ mb: "35px",
164650
+ textAlign: {
164651
+ xs: "center",
164652
+ md: "left"
164653
+ }
164654
+ },
164655
+ children: [
164656
+ "Created by ",
164657
+ /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Sage Bionetworks" }),
164658
+ ", Synapse empowers biomedical researchers with tools for open science and collaboration, forging a path to optimal human health."
164659
+ ]
163516
164660
  }
163517
- },
163518
- children: "About Sage Bionetworks"
163519
- }
163520
- )
163521
- ]
163522
- }
163523
- ),
163524
- isDesktopView && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { height: "100%", justifySelf: "end" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef$w, {}) })
163525
- ]
164661
+ ),
164662
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
164663
+ Button,
164664
+ {
164665
+ size: "large",
164666
+ variant: "contained",
164667
+ color: "secondary",
164668
+ href: "https://www.sagebionetworks.org",
164669
+ target: "_blank",
164670
+ sx: {
164671
+ p: "5px 25px",
164672
+ width: {
164673
+ xs: "100%",
164674
+ md: "auto"
164675
+ }
164676
+ },
164677
+ children: "About Sage Bionetworks"
164678
+ }
164679
+ )
164680
+ ]
164681
+ }
164682
+ ),
164683
+ isDesktopView && /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { sx: { height: "100%", justifySelf: "end" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ForwardRef$w, {}) })
164684
+ ]
164685
+ }
164686
+ )
163526
164687
  }
163527
164688
  ),
163528
164689
  inView && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
@@ -163569,7 +164730,7 @@ dl_list_file_entities = syn.get_download_list()`;
163569
164730
  }
163570
164731
  }
163571
164732
  ),
163572
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
164733
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
163573
164734
  Box,
163574
164735
  {
163575
164736
  sx: {
@@ -163585,62 +164746,71 @@ dl_list_file_entities = syn.get_download_list()`;
163585
164746
  },
163586
164747
  pb: "5px"
163587
164748
  },
163588
- children: [
163589
- /* @__PURE__ */ jsxRuntimeExports.jsx(
163590
- Typography,
163591
- {
163592
- variant: "headline1",
163593
- sx: {
163594
- ...h2Sx,
163595
- textAlign: "center",
163596
- mt: "100px",
163597
- mb: "10px",
163598
- color: "white"
163599
- },
163600
- children: "Synapse by the numbers"
163601
- }
163602
- ),
163603
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
163604
- Typography,
163605
- {
163606
- variant: "body1",
163607
- sx: {
163608
- ...homepageBodyText,
163609
- textAlign: "center",
163610
- mb: "70px",
163611
- color: "white"
163612
- },
163613
- children: [
163614
- /* @__PURE__ */ jsxRuntimeExports.jsx(BlinkingLiveIcon, { sx: { pt: "7px" } }),
163615
- " Live"
163616
- ]
163617
- }
163618
- ),
163619
- /* @__PURE__ */ jsxRuntimeExports.jsx(SynapseByTheNumbers, { metricsTable: generalStatsMetricsTable }),
163620
- /* @__PURE__ */ jsxRuntimeExports.jsx(
163621
- Typography,
163622
- {
163623
- variant: "headline2",
163624
- sx: {
163625
- ...defaultHomepageText,
163626
- textAlign: "center",
163627
- fontSize: "36px",
163628
- lineHeight: "40px",
163629
- mt: "60px",
163630
- mb: "25px",
163631
- color: "white",
163632
- fontWeight: 400
163633
- },
163634
- children: "Projects trending this month"
163635
- }
163636
- ),
163637
- /* @__PURE__ */ jsxRuntimeExports.jsx(
163638
- SynapseTrendingProjects,
163639
- {
163640
- past30DaysDownloadMetricsTable
163641
- }
163642
- )
163643
- ]
164749
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
164750
+ Box,
164751
+ {
164752
+ sx: {
164753
+ margin: "auto",
164754
+ maxWidth: "1500px"
164755
+ },
164756
+ children: [
164757
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
164758
+ Typography,
164759
+ {
164760
+ variant: "headline1",
164761
+ sx: {
164762
+ ...h2Sx,
164763
+ textAlign: "center",
164764
+ mt: "100px",
164765
+ mb: "10px",
164766
+ color: "white"
164767
+ },
164768
+ children: "Synapse by the numbers"
164769
+ }
164770
+ ),
164771
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
164772
+ Typography,
164773
+ {
164774
+ variant: "body1",
164775
+ sx: {
164776
+ ...homepageBodyText,
164777
+ textAlign: "center",
164778
+ mb: "70px",
164779
+ color: "white"
164780
+ },
164781
+ children: [
164782
+ /* @__PURE__ */ jsxRuntimeExports.jsx(BlinkingLiveIcon, { sx: { pt: "7px" } }),
164783
+ " Live"
164784
+ ]
164785
+ }
164786
+ ),
164787
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SynapseByTheNumbers, { metricsTable: generalStatsMetricsTable }),
164788
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
164789
+ Typography,
164790
+ {
164791
+ variant: "headline2",
164792
+ sx: {
164793
+ ...defaultHomepageText,
164794
+ textAlign: "center",
164795
+ fontSize: "36px",
164796
+ lineHeight: "40px",
164797
+ mt: "60px",
164798
+ mb: "25px",
164799
+ color: "white",
164800
+ fontWeight: 400
164801
+ },
164802
+ children: "Projects trending this month"
164803
+ }
164804
+ ),
164805
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
164806
+ SynapseTrendingProjects,
164807
+ {
164808
+ past30DaysDownloadMetricsTable
164809
+ }
164810
+ )
164811
+ ]
164812
+ }
164813
+ )
163644
164814
  }
163645
164815
  ),
163646
164816
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -164194,7 +165364,7 @@ dl_list_file_entities = syn.get_download_list()`;
164194
165364
  {
164195
165365
  className: "synapseIcon",
164196
165366
  rel: "noopener noreferrer",
164197
- onClick: () => gotoPlace("/Home:0"),
165367
+ onClick: () => gotoPlace("/Home:x"),
164198
165368
  "aria-label": "Synapse Home",
164199
165369
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(SynapseIconWhite, {})
164200
165370
  }
@@ -176751,294 +177921,6 @@ dl_list_file_entities = syn.get_download_list()`;
176751
177921
  }
176752
177922
  );
176753
177923
  }
176754
- function compareResourceAccessAndUserGroupHeader(a2, b2) {
176755
- let CompareResult;
176756
- ((CompareResult2) => {
176757
- CompareResult2[CompareResult2["A_FIRST"] = -1] = "A_FIRST";
176758
- CompareResult2[CompareResult2["B_FIRST"] = 1] = "B_FIRST";
176759
- })(CompareResult || (CompareResult = {}));
176760
- const hasChangePermissionA = a2.resourceAccess.accessType.includes(
176761
- ACCESS_TYPE.CHANGE_PERMISSIONS
176762
- );
176763
- const hasChangePermissionB = b2.resourceAccess.accessType.includes(
176764
- ACCESS_TYPE.CHANGE_PERMISSIONS
176765
- );
176766
- if (hasChangePermissionA && !hasChangePermissionB)
176767
- return -1;
176768
- if (!hasChangePermissionA && hasChangePermissionB)
176769
- return 1;
176770
- if (a2.resourceAccess.principalId === AUTHENTICATED_PRINCIPAL_ID && b2.resourceAccess.principalId !== AUTHENTICATED_PRINCIPAL_ID)
176771
- return -1;
176772
- if (a2.resourceAccess.principalId !== AUTHENTICATED_PRINCIPAL_ID && b2.resourceAccess.principalId === AUTHENTICATED_PRINCIPAL_ID)
176773
- return 1;
176774
- if (a2.resourceAccess.principalId === PUBLIC_PRINCIPAL_ID && b2.resourceAccess.principalId !== PUBLIC_PRINCIPAL_ID)
176775
- return -1;
176776
- if (a2.resourceAccess.principalId !== PUBLIC_PRINCIPAL_ID && b2.resourceAccess.principalId === PUBLIC_PRINCIPAL_ID)
176777
- return 1;
176778
- return a2.userGroupHeader.userName.localeCompare(b2.userGroupHeader.userName);
176779
- }
176780
- function useSortResourceAccessList(resourceAccessList) {
176781
- const principalIdsOnResourceAccessList = React$2.useMemo(
176782
- () => resourceAccessList.map((ra) => ra.principalId),
176783
- [resourceAccessList]
176784
- );
176785
- const {
176786
- data: userGroupHeadersOnResourceAccessList,
176787
- isLoading,
176788
- error: error2
176789
- } = useGetUserGroupHeaders(principalIdsOnResourceAccessList.map(String));
176790
- React$2.useEffect(() => {
176791
- if (error2) {
176792
- console.error("Error fetching user group headers: ", error2);
176793
- }
176794
- }, [error2]);
176795
- const sortedResourceAccessList = React$2.useMemo(() => {
176796
- if (!userGroupHeadersOnResourceAccessList) {
176797
- return resourceAccessList;
176798
- }
176799
- const joinedWithUserGroupHeaders = resourceAccessList.map(
176800
- (ral) => ({
176801
- resourceAccess: ral,
176802
- userGroupHeader: userGroupHeadersOnResourceAccessList.find(
176803
- (ugh) => String(ugh.ownerId) === String(ral.principalId)
176804
- )
176805
- })
176806
- );
176807
- const allEntriesHaveUserGroupHeader = joinedWithUserGroupHeaders.every(
176808
- (obj) => Boolean(obj.userGroupHeader)
176809
- );
176810
- if (!allEntriesHaveUserGroupHeader) {
176811
- console.warn(
176812
- "Some ACL entries do not have a corresponding UserGroupHeader. The ResourceAccess list will not be sorted. Missing entries: ",
176813
- joinedWithUserGroupHeaders.filter((obj) => !obj.userGroupHeader)
176814
- );
176815
- return resourceAccessList;
176816
- }
176817
- return joinedWithUserGroupHeaders.toSorted(compareResourceAccessAndUserGroupHeader).map((obj) => obj.resourceAccess);
176818
- }, [resourceAccessList, userGroupHeadersOnResourceAccessList]);
176819
- return {
176820
- sortedResourceAccessList,
176821
- isLoading
176822
- };
176823
- }
176824
- const PRINCIPAL_ALREADY_ADDED_ERROR_MESSAGE = "User or team already has permissions.";
176825
- function useUpdateAcl(options2) {
176826
- const { onChange = noop$9, onError = noop$9 } = options2;
176827
- const [isDirty2, setIsDirty] = React$2.useState(false);
176828
- const [resourceAccessList, setResourceAccessList] = React$2.useState([]);
176829
- const [hasSorted, setHasSorted] = React$2.useState(false);
176830
- const { sortedResourceAccessList, isLoading: isLoadingSortedList } = useSortResourceAccessList(resourceAccessList);
176831
- React$2.useEffect(() => {
176832
- if (!isDirty2 && !isLoadingSortedList && !hasSorted) {
176833
- setResourceAccessList(sortedResourceAccessList);
176834
- setHasSorted(true);
176835
- }
176836
- }, [hasSorted, isDirty2, isLoadingSortedList, sortedResourceAccessList]);
176837
- React$2.useEffect(() => {
176838
- onChange(resourceAccessList);
176839
- }, [resourceAccessList]);
176840
- const addResourceAccessItem = (newReviewerId, accessTypes) => {
176841
- setIsDirty(true);
176842
- if (newReviewerId) {
176843
- const alreadyReviewer = resourceAccessList.some(
176844
- (resourceAccess) => resourceAccess.principalId === Number(newReviewerId)
176845
- );
176846
- if (alreadyReviewer) {
176847
- onError(PRINCIPAL_ALREADY_ADDED_ERROR_MESSAGE);
176848
- } else {
176849
- const newResourceAccess = {
176850
- principalId: Number(newReviewerId),
176851
- accessType: accessTypes
176852
- };
176853
- const updatedResourceAccessList = [
176854
- ...resourceAccessList,
176855
- newResourceAccess
176856
- ];
176857
- setResourceAccessList(updatedResourceAccessList);
176858
- }
176859
- }
176860
- };
176861
- const updateResourceAccessItem = (principalId, accessType) => {
176862
- setIsDirty(true);
176863
- const updatedResourceAccessList = resourceAccessList.map((resourceAccess) => {
176864
- return resourceAccess.principalId === principalId ? { ...resourceAccess, accessType } : resourceAccess;
176865
- });
176866
- setResourceAccessList(updatedResourceAccessList);
176867
- };
176868
- const removeResourceAccessItem = (principalId) => {
176869
- setIsDirty(true);
176870
- const updatedResourceAccessList = resourceAccessList.filter(
176871
- (raListItem) => raListItem.principalId !== principalId
176872
- );
176873
- setResourceAccessList(updatedResourceAccessList);
176874
- };
176875
- return {
176876
- resourceAccessList,
176877
- setResourceAccessList,
176878
- addResourceAccessItem,
176879
- updateResourceAccessItem,
176880
- removeResourceAccessItem
176881
- };
176882
- }
176883
- const PermissionLevelMenu = (props) => {
176884
- const { currentAccessType, availablePermissionLevels: availablePermissionLevels2, onChange } = props;
176885
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
176886
- TextField$1,
176887
- {
176888
- value: getPermissionLevelFromAccessType(currentAccessType) || null,
176889
- onChange: (e2) => {
176890
- const accessType = getAccessTypeFromPermissionLevel(
176891
- e2.target.value
176892
- );
176893
- if (!accessType) {
176894
- console.error(
176895
- `ACCESS_TYPE[] not found for PermissionLevel: ${e2.target.value}`
176896
- );
176897
- }
176898
- onChange(accessType || null);
176899
- },
176900
- fullWidth: true,
176901
- select: true,
176902
- SelectProps: {
176903
- renderValue: (selected) => permissionLevelToLabel[selected]
176904
- },
176905
- size: "small",
176906
- children: Object.values(availablePermissionLevels2).map((permissionLevel) => {
176907
- return /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { value: permissionLevel, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "smallText1", noWrap: true, children: permissionLevelToLabel[permissionLevel] }) }, permissionLevel);
176908
- })
176909
- }
176910
- );
176911
- };
176912
- function ReadOnlyPermissionLevel(props) {
176913
- const { accessType } = props;
176914
- return permissionLevelToLabel[getPermissionLevelFromAccessType(accessType)];
176915
- }
176916
- const REMOVE_BUTTON_LABEL = "Remove from AR Permissions";
176917
- const ResourceAccessItem = (props) => {
176918
- const {
176919
- resourceAccess,
176920
- availablePermissionLevels: availablePermissionLevels2,
176921
- isInEditMode,
176922
- onChange,
176923
- onRemove: onRemove2
176924
- } = props;
176925
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
176926
- Stack$6,
176927
- {
176928
- direction: "row",
176929
- justifyContent: "space-between",
176930
- alignItems: "center",
176931
- gap: "10px",
176932
- py: "6px",
176933
- role: "row",
176934
- children: [
176935
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { fontSize: "16px", lineHeight: "20px", children: /* @__PURE__ */ jsxRuntimeExports.jsx(UserOrTeamBadge, { principalId: resourceAccess.principalId }) }),
176936
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Stack$6, { direction: "row", gap: "10px", alignItems: "center", width: "225px", children: [
176937
- !isInEditMode && /* @__PURE__ */ jsxRuntimeExports.jsx(ReadOnlyPermissionLevel, { accessType: resourceAccess.accessType }),
176938
- isInEditMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
176939
- /* @__PURE__ */ jsxRuntimeExports.jsx(
176940
- PermissionLevelMenu,
176941
- {
176942
- currentAccessType: resourceAccess.accessType,
176943
- availablePermissionLevels: availablePermissionLevels2,
176944
- onChange
176945
- }
176946
- ),
176947
- /* @__PURE__ */ jsxRuntimeExports.jsx(
176948
- IconSvgButton,
176949
- {
176950
- "aria-label": REMOVE_BUTTON_LABEL,
176951
- onClick: () => onRemove2(),
176952
- icon: "delete",
176953
- sx: {
176954
- "&:hover": {
176955
- color: "error.main"
176956
- }
176957
- }
176958
- }
176959
- )
176960
- ] })
176961
- ] })
176962
- ]
176963
- }
176964
- ) });
176965
- };
176966
- function AclEditor(props) {
176967
- const {
176968
- isInEditMode,
176969
- isLoading,
176970
- resourceAccessList,
176971
- availablePermissionLevels: availablePermissionLevels2,
176972
- emptyText,
176973
- onAddPrincipalToAcl,
176974
- updateResourceAccessItem,
176975
- removeResourceAccessItem
176976
- } = props;
176977
- if (isLoading) {
176978
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { display: "flex", justifyContent: "center", height: "150px", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SynapseSpinner, { size: 50 }) });
176979
- }
176980
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
176981
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { mb: "30px", children: [
176982
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "headline3", mb: "10px", children: "Users and Teams with Permissions" }),
176983
- resourceAccessList.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1Italic", children: emptyText }) : /* @__PURE__ */ jsxRuntimeExports.jsx(TransitionGroup, { children: resourceAccessList.map((resourceAccess) => {
176984
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Collapse$1, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
176985
- ResourceAccessItem,
176986
- {
176987
- resourceAccess,
176988
- availablePermissionLevels: availablePermissionLevels2,
176989
- isInEditMode,
176990
- onChange: (accessType) => updateResourceAccessItem(
176991
- resourceAccess.principalId,
176992
- accessType
176993
- ),
176994
- onRemove: () => removeResourceAccessItem(resourceAccess.principalId)
176995
- },
176996
- resourceAccess.principalId
176997
- ) }, resourceAccess.principalId);
176998
- }) })
176999
- ] }),
177000
- isInEditMode && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
177001
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "headline3", mb: "10px", children: "Add More" }),
177002
- /* @__PURE__ */ jsxRuntimeExports.jsx(
177003
- Typography,
177004
- {
177005
- sx: {
177006
- variant: "body1",
177007
- lineHeight: "20px",
177008
- fontStyle: "italic",
177009
- color: "grey.900"
177010
- },
177011
- mb: "20px",
177012
- children: "Search for a username or team to add. You can search by username, first or last names, or team name"
177013
- }
177014
- ),
177015
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
177016
- /* @__PURE__ */ jsxRuntimeExports.jsx(
177017
- Typography,
177018
- {
177019
- component: "label",
177020
- variant: "smallText2",
177021
- htmlFor: "reviewer-search",
177022
- children: "Add a user or team"
177023
- }
177024
- ),
177025
- /* @__PURE__ */ jsxRuntimeExports.jsx(
177026
- UserSearchBoxV2,
177027
- {
177028
- value: null,
177029
- inputId: "reviewer-search",
177030
- placeholder: "Username, name (first and last) or team name.",
177031
- onChange: (id2) => {
177032
- if (id2) {
177033
- onAddPrincipalToAcl(id2);
177034
- }
177035
- }
177036
- }
177037
- )
177038
- ] })
177039
- ] })
177040
- ] });
177041
- }
177042
177924
  const textSx = {
177043
177925
  variant: "body1",
177044
177926
  lineHeight: "20px",
@@ -177071,13 +177953,15 @@ dl_list_file_entities = syn.get_download_list()`;
177071
177953
  setResourceAccessList,
177072
177954
  addResourceAccessItem,
177073
177955
  updateResourceAccessItem,
177074
- removeResourceAccessItem
177956
+ removeResourceAccessItem,
177957
+ resetDirtyState
177075
177958
  } = useUpdateAcl({
177076
177959
  onChange: () => setError(null),
177077
177960
  onError: setError
177078
177961
  });
177079
177962
  React$2.useEffect(() => {
177080
177963
  if (originalAcl) {
177964
+ resetDirtyState();
177081
177965
  setResourceAccessList(originalAcl.resourceAccess);
177082
177966
  }
177083
177967
  }, [originalAcl, setResourceAccessList]);
@@ -177146,11 +178030,13 @@ dl_list_file_entities = syn.get_download_list()`;
177146
178030
  resourceAccessList,
177147
178031
  availablePermissionLevels,
177148
178032
  isLoading: isLoadingOriginalAcl,
177149
- isInEditMode: true,
178033
+ canEdit: true,
177150
178034
  emptyText: EMPTY_RESOURCE_ACCESS_LIST_TEXT,
177151
178035
  onAddPrincipalToAcl: (id2) => addResourceAccessItem(id2, [ACCESS_TYPE.REVIEW_SUBMISSIONS]),
177152
178036
  updateResourceAccessItem,
177153
- removeResourceAccessItem
178037
+ removeResourceAccessItem,
178038
+ showAddRemovePublicButton: false,
178039
+ showNotifyCheckbox: false
177154
178040
  }
177155
178041
  ),
177156
178042
  error2 && /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { severity: "error", children: error2 })
@@ -178704,7 +179590,9 @@ dl_list_file_entities = syn.get_download_list()`;
178704
179590
  }(React$2.Component);
178705
179591
  a.defaultProps = { disabled: false, offColor: "#888", onColor: "#080", offHandleColor: "#fff", onHandleColor: "#fff", uncheckedIcon: n, checkedIcon: o, boxShadow: null, activeBoxShadow: "0 0 2px 3px #3bf", height: 28, width: 56 };
178706
179592
  const experimentalModeText = "This mode gives you early access to features that are still in development. Please note that we do not guarantee an absence of errors, and that the data created using these features may be lost during product upgrade.";
178707
- const ExperimentalMode = () => {
179593
+ const ExperimentalMode = ({
179594
+ onExperimentalModeToggle
179595
+ }) => {
178708
179596
  const [isExperimentalModeOn, setIsExperimentalModeOn] = React$2.useState(false);
178709
179597
  const cookies2 = new UniversalCookies();
178710
179598
  let mounted = true;
@@ -178722,10 +179610,16 @@ dl_list_file_entities = syn.get_download_list()`;
178722
179610
  const createExperimentalModeCookie = () => {
178723
179611
  cookies2.set(EXPERIMENTAL_MODE_COOKIE, { path: "/" });
178724
179612
  setIsExperimentalModeOn(true);
179613
+ if (onExperimentalModeToggle) {
179614
+ onExperimentalModeToggle(true);
179615
+ }
178725
179616
  };
178726
179617
  const deleteExperimentalModeCookie = () => {
178727
179618
  document.cookie = `${EXPERIMENTAL_MODE_COOKIE}= ; expires = Thu, 01 Jan 1970 00:00:00 GMT`;
178728
179619
  setIsExperimentalModeOn(false);
179620
+ if (onExperimentalModeToggle) {
179621
+ onExperimentalModeToggle(false);
179622
+ }
178729
179623
  };
178730
179624
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center" }, children: [
178731
179625
  /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { variant: "body1", children: "Experimental Mode" }),
@@ -178758,7 +179652,7 @@ dl_list_file_entities = syn.get_download_list()`;
178758
179652
  srcVersion,
178759
179653
  repoVersion,
178760
179654
  gotoPlace,
178761
- reportViolationCallback
179655
+ onExperimentalModeToggle
178762
179656
  }) => {
178763
179657
  const { accessToken } = useSynapseContext();
178764
179658
  const registrationUrl = useOneSageURL("/register1");
@@ -178901,10 +179795,12 @@ dl_list_file_entities = syn.get_download_list()`;
178901
179795
  },
178902
179796
  {
178903
179797
  text: "Report Violations",
178904
- props: { onClick: reportViolationCallback }
179798
+ props: {
179799
+ href: "https://sagebionetworks.jira.com/servicedesk/customer/portal/20"
179800
+ }
178905
179801
  },
178906
179802
  {
178907
- text: "Privacy & Terms of Service",
179803
+ text: "Trust Center",
178908
179804
  props: { href: "https://sagebionetworks.org/trust-center" }
178909
179805
  }
178910
179806
  ]
@@ -179099,7 +179995,7 @@ dl_list_file_entities = syn.get_download_list()`;
179099
179995
  ]
179100
179996
  }
179101
179997
  ),
179102
- /* @__PURE__ */ jsxRuntimeExports.jsx(ExperimentalMode, {})
179998
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ExperimentalMode, { onExperimentalModeToggle })
179103
179999
  ]
179104
180000
  }
179105
180001
  )
@@ -179304,7 +180200,7 @@ dl_list_file_entities = syn.get_download_list()`;
179304
180200
  )
179305
180201
  ] });
179306
180202
  };
179307
- const version = "3.3.6";
180203
+ const version = "3.3.8";
179308
180204
  const SynapseEnums = {
179309
180205
  BackendDestinationEnum
179310
180206
  };
@@ -179388,7 +180284,8 @@ dl_list_file_entities = syn.get_download_list()`;
179388
180284
  CreateOrUpdateAccessRequirementWizard,
179389
180285
  GoogleAnalytics,
179390
180286
  CookiesNotification,
179391
- getCurrentCookiePreferences
180287
+ getCurrentCookiePreferences,
180288
+ EntityAclEditorModal
179392
180289
  };
179393
180290
  const SynapseReactClientVersion = version;
179394
180291
  exports2.HttpClient = HttpClient;