@commercetools-frontend-extensions/delete-resources-modal 0.0.0-canary-20250904080402 → 0.0.0-canary-20251211142708

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.
Files changed (25) hide show
  1. package/dist/commercetools-frontend-extensions-delete-resources-modal.cjs.dev.js +1521 -44
  2. package/dist/commercetools-frontend-extensions-delete-resources-modal.cjs.prod.js +1512 -44
  3. package/dist/commercetools-frontend-extensions-delete-resources-modal.esm.js +1510 -43
  4. package/dist/declarations/src/@types/index.d.ts +0 -2
  5. package/dist/{es-851a6220.cjs.prod.js → es-2e0af6bc.cjs.dev.js} +2 -2
  6. package/dist/{es-062c28be.esm.js → es-332b4647.esm.js} +2 -2
  7. package/dist/{es-87e55458.cjs.dev.js → es-64fd0c08.cjs.prod.js} +2 -2
  8. package/dist/{fr-FR-583a5353.cjs.prod.js → fr-FR-90c7194f.cjs.prod.js} +2 -2
  9. package/dist/{fr-FR-db35778a.cjs.dev.js → fr-FR-c9dc1e0d.cjs.dev.js} +2 -2
  10. package/dist/{fr-FR-3683a6e7.esm.js → fr-FR-f2953298.esm.js} +2 -2
  11. package/package.json +25 -25
  12. package/dist/active-drag-drop-area-3b6d466e.cjs.dev.js +0 -54
  13. package/dist/active-drag-drop-area-7ce4ad2e.cjs.prod.js +0 -54
  14. package/dist/active-drag-drop-area-93f30ab1.esm.js +0 -52
  15. package/dist/declarations/src/@types/file-upload.d.ts +0 -45
  16. package/dist/declarations/src/@types/import-container.d.ts +0 -4
  17. package/dist/enabled-drop-area-0f095b72.esm.js +0 -69
  18. package/dist/enabled-drop-area-2385b046.cjs.dev.js +0 -71
  19. package/dist/enabled-drop-area-eda91d8b.cjs.prod.js +0 -71
  20. package/dist/file-dropped-area-9eaa8d48.cjs.dev.js +0 -74
  21. package/dist/file-dropped-area-b9ef2b25.cjs.prod.js +0 -74
  22. package/dist/file-dropped-area-e1c05dd9.esm.js +0 -72
  23. package/dist/index-38fb081c.cjs.dev.js +0 -1822
  24. package/dist/index-787342c4.cjs.prod.js +0 -1810
  25. package/dist/index-a5c6573b.esm.js +0 -1792
@@ -1,44 +1,1511 @@
1
- export { D as default } from './index-a5c6573b.esm.js';
2
- import '@babel/runtime-corejs3/core-js-stable/object/keys';
3
- import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
4
- import '@babel/runtime-corejs3/core-js-stable/instance/filter';
5
- import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
6
- import '@babel/runtime-corejs3/core-js-stable/instance/for-each';
7
- import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
8
- import '@babel/runtime-corejs3/core-js-stable/object/define-properties';
9
- import '@babel/runtime-corejs3/core-js-stable/object/define-property';
10
- import '@babel/runtime-corejs3/helpers/defineProperty';
11
- import 'react-intl';
12
- import '@commercetools-frontend/application-shell-connectors';
13
- import '@babel/runtime-corejs3/helpers/slicedToArray';
14
- import 'react';
15
- import '@commercetools-frontend/sdk';
16
- import '@commercetools-frontend/constants';
17
- import 'pluralize';
18
- import '@babel/runtime-corejs3/core-js-stable/instance/every';
19
- import '@babel/runtime-corejs3/core-js-stable/reflect/construct';
20
- import '@babel/runtime-corejs3/helpers/createClass';
21
- import '@babel/runtime-corejs3/helpers/classCallCheck';
22
- import '@babel/runtime-corejs3/helpers/possibleConstructorReturn';
23
- import '@babel/runtime-corejs3/helpers/getPrototypeOf';
24
- import '@babel/runtime-corejs3/helpers/inherits';
25
- import '@babel/runtime-corejs3/helpers/wrapNativeSuper';
26
- import '@babel/runtime-corejs3/core-js-stable/json/stringify';
27
- import '@babel/runtime-corejs3/core-js-stable/promise';
28
- import '@babel/runtime-corejs3/core-js-stable/array/is-array';
29
- import '@babel/runtime-corejs3/core-js-stable/instance/find';
30
- import '@babel/runtime-corejs3/core-js-stable/instance/map';
31
- import 'papaparse';
32
- import '@emotion/react/jsx-runtime';
33
- import '@commercetools-frontend/application-components';
34
- import '@commercetools-frontend/fullstory';
35
- import '@commercetools-frontend/ui-kit';
36
- import '@babel/runtime-corejs3/core-js-stable/instance/some';
37
- import 'react-dropzone';
38
- import '@commercetools-frontend/actions-global';
39
- import '@emotion/styled/base';
1
+ import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
2
+ import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
3
+ import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
4
+ import _Object$getOwnPropertyDescriptor from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor';
5
+ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
6
+ import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
7
+ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
8
+ import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
9
+ import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
10
+ import { defineMessages, useIntl, FormattedMessage, IntlProvider } from 'react-intl';
11
+ import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
12
+ import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
13
+ import React, { useContext, useState, useEffect } from 'react';
14
+ import { deleteImportContainer, EnabledDropArea, FileDroppedArea, ActiveDragDropArea, useFileUpload, getRowCount, toBytes, hasSingleKeyColumn, countUniqueResourcesInCsv, isAbortError, HttpError, IMPORT_MAX_FILE_SIZE_MB, IMPORT_LEGACY_MAX_FILE_SIZE_MB, IMPORT_MAX_ITEM_COUNT, IMPORT_LEGACY_MAX_ROW_COUNT, FileDropArea as FileDropArea$1, UploadingModal, mapFileUploadErrorsToUploadFileErrorRows, processFileImportJob, processUploadedFile } from '@commercetools-frontend-extensions/operations';
15
+ import { jsx, jsxs } from '@emotion/react/jsx-runtime';
16
+ import { FormDialog, InfoDialog } from '@commercetools-frontend/application-components';
17
+ import { Masking } from '@commercetools-frontend/fullstory';
18
+ import { Spacings, Text, Link, usePaginationState, DataTable, PageNavigator, Stamp, SecondaryButton, PrimaryButton, ImportIcon, WarningIcon, Card, BinLinearIcon } from '@commercetools-frontend/ui-kit';
19
+ import { useShowNotification } from '@commercetools-frontend/actions-global';
20
+ import { DOMAINS } from '@commercetools-frontend/constants';
21
+ import _Reflect$construct from '@babel/runtime-corejs3/core-js-stable/reflect/construct';
22
+ import _createClass from '@babel/runtime-corejs3/helpers/esm/createClass';
23
+ import _classCallCheck from '@babel/runtime-corejs3/helpers/esm/classCallCheck';
24
+ import _possibleConstructorReturn from '@babel/runtime-corejs3/helpers/esm/possibleConstructorReturn';
25
+ import _getPrototypeOf from '@babel/runtime-corejs3/helpers/esm/getPrototypeOf';
26
+ import _inherits from '@babel/runtime-corejs3/helpers/esm/inherits';
27
+ import _wrapNativeSuper from '@babel/runtime-corejs3/helpers/esm/wrapNativeSuper';
28
+ import { useFeatureToggle } from '@commercetools-frontend/application-shell';
29
+ import { reportErrorToSentry } from '@commercetools-frontend/sentry';
30
+ import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
40
31
  import '@emotion/react';
41
- import '@commercetools-frontend/sentry';
42
- import '@commercetools-frontend/application-shell';
43
- import '@babel/runtime-corejs3/core-js-stable/instance/slice';
44
- import '@commercetools-frontend/i18n';
32
+ import { parseChunkImport, mapLocaleToIntlLocale } from '@commercetools-frontend/i18n';
33
+
34
+ function ownKeys$7(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
35
+ function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
36
+ function reducer(state, action) {
37
+ if (action.type === 'setCurrentStep') return _objectSpread$7(_objectSpread$7({}, state), {}, {
38
+ currentStep: action.currentStep,
39
+ progress: 0
40
+ });
41
+ if (action.type === 'setContainerKey') return _objectSpread$7(_objectSpread$7({}, state), {}, {
42
+ containerKey: action.containerKey
43
+ });
44
+ if (action.type === 'cancelImport') return _objectSpread$7(_objectSpread$7({}, state), {}, {
45
+ currentStep: 'upload',
46
+ containerKey: undefined,
47
+ droppedFile: undefined,
48
+ dropAreaState: 'ready-for-drop',
49
+ progress: 0,
50
+ jobId: undefined,
51
+ totalResourceCount: undefined,
52
+ validationProcessed: undefined,
53
+ isValidating: false
54
+ });
55
+ if (action.type === 'uploadNewFile') return _objectSpread$7(_objectSpread$7({}, state), {}, {
56
+ currentStep: 'upload',
57
+ containerKey: undefined,
58
+ droppedFile: undefined,
59
+ dropAreaState: 'ready-for-drop',
60
+ progress: 0,
61
+ jobId: undefined,
62
+ totalResourceCount: undefined,
63
+ validationProcessed: undefined,
64
+ isValidating: false
65
+ });
66
+ if (action.type === 'setDroppedFile') {
67
+ return _objectSpread$7(_objectSpread$7({}, state), {}, {
68
+ droppedFile: action.droppedFile
69
+ });
70
+ }
71
+ if (action.type === 'setAbortController') {
72
+ return _objectSpread$7(_objectSpread$7({}, state), {}, {
73
+ abortController: action.abortController
74
+ });
75
+ }
76
+ if (action.type === 'setProgress') {
77
+ return _objectSpread$7(_objectSpread$7({}, state), {}, {
78
+ progress: action.progress
79
+ });
80
+ }
81
+ if (action.type === 'setUploadFileResponse') {
82
+ return _objectSpread$7(_objectSpread$7({}, state), {}, {
83
+ uploadFileResponse: action.uploadFileResponse
84
+ });
85
+ }
86
+ if (action.type === 'setFileUploadErrors') {
87
+ return _objectSpread$7(_objectSpread$7({}, state), {}, {
88
+ fileUploadErrors: action.fileUploadErrors
89
+ });
90
+ }
91
+ if (action.type === 'setJobId') {
92
+ return _objectSpread$7(_objectSpread$7({}, state), {}, {
93
+ jobId: action.jobId
94
+ });
95
+ }
96
+ if (action.type === 'setTotalResourceCount') {
97
+ return _objectSpread$7(_objectSpread$7({}, state), {}, {
98
+ totalResourceCount: action.totalResourceCount
99
+ });
100
+ }
101
+ if (action.type === 'setValidationProgress') {
102
+ return _objectSpread$7(_objectSpread$7({}, state), {}, {
103
+ validationProcessed: action.processed,
104
+ isValidating: action.isValidating
105
+ });
106
+ }
107
+ throw new Error(getUnknownActionError(action));
108
+ }
109
+ function getUnknownActionError(actionType) {
110
+ return `Unkown type: ${actionType}`;
111
+ }
112
+ const initialState = {
113
+ currentStep: 'upload',
114
+ abortController: new AbortController(),
115
+ dropAreaState: 'ready-for-drop',
116
+ containerKey: undefined,
117
+ progress: 0,
118
+ uploadFileResponse: undefined,
119
+ fileUploadErrors: []
120
+ };
121
+ const initialActions = {
122
+ setCurrentStep(_currentStep) {
123
+ /**/
124
+ },
125
+ cancelImport() {
126
+ /**/
127
+ },
128
+ uploadNewFile() {
129
+ /**/
130
+ },
131
+ setDroppedFile(_nextDroppedFile) {
132
+ /**/
133
+ },
134
+ setUploadFileResponse(_uploadFileResponse) {
135
+ /**/
136
+ },
137
+ setFileUploadErrors(_fileUploadErrors) {
138
+ /**/
139
+ },
140
+ setContainerKey(_containerKey) {
141
+ /**/
142
+ },
143
+ setAbortController(_abortController) {
144
+ /**/
145
+ },
146
+ setProgress(_progress) {
147
+ /**/
148
+ },
149
+ setJobId(_jobId) {
150
+ /**/
151
+ },
152
+ setTotalResourceCount(_totalResourceCount) {
153
+ /**/
154
+ },
155
+ setValidationProgress(_params) {
156
+ /**/
157
+ }
158
+ };
159
+
160
+ const DeleteResourcesContext = /*#__PURE__*/React.createContext({
161
+ state: initialState,
162
+ actions: initialActions,
163
+ resourceType: 'product',
164
+ onClose: () => {}
165
+ });
166
+ const DeleteResourcesProvider = props => {
167
+ const _useApplicationContex = useApplicationContext(context => ({
168
+ projectKey: context.project?.key
169
+ })),
170
+ projectKey = _useApplicationContex.projectKey;
171
+ const _React$useReducer = React.useReducer(reducer, initialState),
172
+ _React$useReducer2 = _slicedToArray(_React$useReducer, 2),
173
+ state = _React$useReducer2[0],
174
+ dispatch = _React$useReducer2[1];
175
+ const setCurrentStep = currentStep => dispatch({
176
+ type: 'setCurrentStep',
177
+ currentStep
178
+ });
179
+ const setContainerKey = containerKey => dispatch({
180
+ type: 'setContainerKey',
181
+ containerKey
182
+ });
183
+ const cancelImport = () => dispatch({
184
+ type: 'cancelImport'
185
+ });
186
+ const uploadNewFile = () => dispatch({
187
+ type: 'uploadNewFile'
188
+ });
189
+ const setDroppedFile = droppedFile => dispatch({
190
+ type: 'setDroppedFile',
191
+ droppedFile: droppedFile
192
+ });
193
+ const setFileUploadErrors = fileUploadErrors => {
194
+ dispatch({
195
+ type: 'setFileUploadErrors',
196
+ fileUploadErrors
197
+ });
198
+ };
199
+ const setAbortController = abortController => dispatch({
200
+ type: 'setAbortController',
201
+ abortController: abortController
202
+ });
203
+ const setProgress = progress => dispatch({
204
+ type: 'setProgress',
205
+ progress
206
+ });
207
+ const setUploadFileResponse = uploadFileResponse => {
208
+ dispatch({
209
+ type: 'setUploadFileResponse',
210
+ uploadFileResponse
211
+ });
212
+ };
213
+ const setJobId = jobId => dispatch({
214
+ type: 'setJobId',
215
+ jobId
216
+ });
217
+ const setTotalResourceCount = totalResourceCount => dispatch({
218
+ type: 'setTotalResourceCount',
219
+ totalResourceCount
220
+ });
221
+ const setValidationProgress = _ref => {
222
+ let processed = _ref.processed,
223
+ isValidating = _ref.isValidating;
224
+ return dispatch({
225
+ type: 'setValidationProgress',
226
+ processed,
227
+ isValidating
228
+ });
229
+ };
230
+ const actions = {
231
+ setCurrentStep,
232
+ cancelImport,
233
+ uploadNewFile,
234
+ setDroppedFile,
235
+ setUploadFileResponse,
236
+ setFileUploadErrors,
237
+ setContainerKey,
238
+ setAbortController,
239
+ setProgress,
240
+ setJobId,
241
+ setTotalResourceCount,
242
+ setValidationProgress
243
+ };
244
+ const handleClose = function () {
245
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
246
+ if (state.abortController) state.abortController.abort();
247
+ if (typeof props.onClose === 'function') props.onClose();
248
+ // Removes the associated import container when the import is closed
249
+ if (options.shouldDeleteImportContainer && projectKey && state.containerKey) deleteImportContainer({
250
+ projectKey,
251
+ importContainerKey: state.containerKey
252
+ });
253
+ };
254
+ return jsx(DeleteResourcesContext.Provider, {
255
+ value: {
256
+ resourceType: props.resourceType,
257
+ state,
258
+ onClose: handleClose,
259
+ actions
260
+ },
261
+ children: props.children
262
+ });
263
+ };
264
+
265
+ function getDropArea(_ref) {
266
+ let dropAreaState = _ref.dropAreaState,
267
+ isFileDropped = _ref.isFileDropped,
268
+ fileName = _ref.fileName,
269
+ messages = _ref.messages;
270
+ if (dropAreaState === 'ready-for-drop') {
271
+ return jsx(EnabledDropArea, {
272
+ dragAndDropText: messages.dragAndDropCSV,
273
+ orText: messages.or,
274
+ browseFileText: messages.browseButton
275
+ });
276
+ }
277
+ if (dropAreaState === 'file-dropped') {
278
+ return jsx(FileDroppedArea, {
279
+ fileName: fileName,
280
+ chooseFileLabel: messages.chooseFile
281
+ });
282
+ }
283
+ if (dropAreaState === 'active-drag') {
284
+ return jsx(ActiveDragDropArea, {
285
+ isFileDropped: isFileDropped,
286
+ fileName: fileName,
287
+ chooseFileLabel: messages.chooseFile,
288
+ dragAndDropText: messages.dragAndDropCSV,
289
+ orText: messages.or,
290
+ browseFileText: messages.browseButton
291
+ });
292
+ }
293
+ return fallbackDropArea(dropAreaState, fileName, messages);
294
+ }
295
+ function fallbackDropArea(_dropAreaState, fileName, messages) {
296
+ return jsx(FileDroppedArea, {
297
+ fileName: fileName,
298
+ chooseFileLabel: messages.chooseFile
299
+ });
300
+ }
301
+ function getDropAreaState(flags) {
302
+ if (flags.isDragActive) {
303
+ return 'active-drag';
304
+ }
305
+ if (flags.isReady) {
306
+ return 'file-dropped';
307
+ }
308
+ return 'ready-for-drop';
309
+ }
310
+
311
+ var messages$5 = defineMessages({
312
+ dragAndDropCSV: {
313
+ id: 'DeleteResourcesModal.dragAndDropCSV',
314
+ description: 'The message telling the user to drag and drop CSV file in the file drop area',
315
+ defaultMessage: 'Drag and drop CSV'
316
+ },
317
+ or: {
318
+ id: 'DeleteResourcesModal.or',
319
+ description: 'The word "or" in the drag and drop message',
320
+ defaultMessage: 'or'
321
+ },
322
+ browseButton: {
323
+ id: 'DeleteResourcesModal.browseFile',
324
+ defaultMessage: 'Browse file'
325
+ },
326
+ uploadAndPreview: {
327
+ id: 'DeleteResourcesModal.uploadAndPreview',
328
+ description: 'Label for the button that uploads the file and shows the preview',
329
+ defaultMessage: 'Upload and preview'
330
+ },
331
+ chooseFile: {
332
+ id: 'DeleteResourcesModal.chooseFile',
333
+ description: 'Label for a button on the file upload page, shown on ready to upload state',
334
+ defaultMessage: 'Choose file'
335
+ },
336
+ fileUploadFailed: {
337
+ id: 'DeleteResourcesModal.fileUploadFailed',
338
+ description: 'A title on the file upload page, shown on file upload error state',
339
+ defaultMessage: 'File upload failed'
340
+ },
341
+ fileFormatNotSupported: {
342
+ id: 'DeleteResourcesModal.fileFormatNotSupported',
343
+ description: 'Error message displayed when a user drags and drops a non-CSV file',
344
+ defaultMessage: 'Invalid file format: The file is not in CSV format and cannot be processed.'
345
+ },
346
+ tooManyFilesError: {
347
+ id: 'DeleteResourcesModal.tooManyFilesError',
348
+ description: 'Error message displayed when a user drags and drops multiple files at once',
349
+ defaultMessage: 'Multiple files detected: You can only drag and drop one file at a time.'
350
+ },
351
+ genericError: {
352
+ id: 'DeleteResourcesModal.genericError',
353
+ description: 'Default error message for unexpected file upload issues (for unhandled cases)',
354
+ defaultMessage: 'Error occurred: Please try uploading the file again or contact our support team for assistance.'
355
+ },
356
+ dataType: {
357
+ id: 'DeleteResourcesModal.dataType',
358
+ description: 'Label for the data type selection dropdown',
359
+ defaultMessage: 'Data type'
360
+ },
361
+ instructions: {
362
+ id: 'DeleteResourcesModal.instructions',
363
+ description: 'Label for the instructions section',
364
+ defaultMessage: 'Instructions'
365
+ }
366
+ });
367
+
368
+ function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
369
+ function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function () { return !!t; })(); }
370
+ let MissingDeleteResourcesProviderError = /*#__PURE__*/function (_Error) {
371
+ function MissingDeleteResourcesProviderError() {
372
+ var _this;
373
+ _classCallCheck(this, MissingDeleteResourcesProviderError);
374
+ _this = _callSuper$1(this, MissingDeleteResourcesProviderError, ['useDeleteResourcesProviderError must be used within MissingDeleteResourcesProviderError']);
375
+ _this.name = 'MissingDeleteResourcesProviderError';
376
+ return _this;
377
+ }
378
+ _inherits(MissingDeleteResourcesProviderError, _Error);
379
+ return _createClass(MissingDeleteResourcesProviderError);
380
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
381
+
382
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
383
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
384
+ let UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
385
+ function UnexpectedResourceTypeError(resourceType) {
386
+ var _this;
387
+ _classCallCheck(this, UnexpectedResourceTypeError);
388
+ _this = _callSuper(this, UnexpectedResourceTypeError, [`Unexpected resource type "${resourceType}"`]);
389
+ _this.name = 'UnexpectedResourceTypeError';
390
+ return _this;
391
+ }
392
+ _inherits(UnexpectedResourceTypeError, _Error);
393
+ return _createClass(UnexpectedResourceTypeError);
394
+ }(/*#__PURE__*/_wrapNativeSuper(Error));
395
+
396
+ const useDeleteResourcesContext = () => {
397
+ const context = useContext(DeleteResourcesContext);
398
+ if (!context) {
399
+ throw new MissingDeleteResourcesProviderError();
400
+ }
401
+ return context;
402
+ };
403
+
404
+ var messages$4 = defineMessages({
405
+ fileSizeExceededTitle: {
406
+ id: 'DeleteResourcesModal.sizeExceededTitle',
407
+ defaultMessage: 'File size exceeded'
408
+ },
409
+ fileSizeExceededDescription: {
410
+ id: 'DeleteResourcesModal.sizeExceededDescription',
411
+ description: 'Error description when the file size exceeds the allowable limit',
412
+ defaultMessage: 'The file exceeds the maximum allowed size of {fileSizeLimit} MB'
413
+ },
414
+ rowLimitExceededTitle: {
415
+ id: 'DeleteResourcesModal.rowLimitExceededTitle',
416
+ defaultMessage: 'Row limit exceeded'
417
+ },
418
+ rowLimitExceededDescription: {
419
+ id: 'DeleteResourcesModal.rowLimitExceededDescription',
420
+ description: 'Error description when the file contains more rows than the allowable maximum',
421
+ defaultMessage: 'The file contains more than the allowable maximum of {rowLimit} rows'
422
+ },
423
+ dropAreaNotEnoughRowsTitle: {
424
+ id: 'DeleteResourcesModal.dropAreaNotEnoughRowsTitle',
425
+ description: 'Error title shown when the uploaded CSV file does not contain a header and at least one row of data',
426
+ defaultMessage: 'Invalid CSV file'
427
+ },
428
+ dropAreaNotEnoughRowsDescription: {
429
+ id: 'DeleteResourcesModal.dropAreaNotEnoughRowsDescription',
430
+ description: 'Error description shown when the uploaded CSV file does not contain a header and at least one row of data',
431
+ defaultMessage: 'Make sure the file contains a header and at least one row of data'
432
+ },
433
+ unexpectedError: {
434
+ id: 'DeleteResourcesModal.unexpectedError',
435
+ description: 'Generic notification message when file upload fails',
436
+ defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
437
+ },
438
+ missingRequiredField: {
439
+ id: 'DeleteResourcesModal.missingRequiredField',
440
+ description: 'Error message displayed when a required field is missing',
441
+ defaultMessage: 'Missing required field'
442
+ },
443
+ missingKeyError: {
444
+ id: 'DeleteResourcesModal.missingKeyError',
445
+ description: 'Error message displayed when the uploaded file is missing the key field',
446
+ defaultMessage: "The 'key' field is missing or incomplete in some rows. Please ensure every row has a 'key' value."
447
+ },
448
+ csvFormatErrorTitle: {
449
+ id: 'DeleteResourcesModal.csvFormatErrorTitle',
450
+ description: 'Error title shown when the uploaded CSV file is not formatted correctly',
451
+ defaultMessage: 'Invalid CSV file'
452
+ },
453
+ csvFormatErrorDescription: {
454
+ id: 'UnpublishProductsModal.csvFormatErrorDescription',
455
+ description: 'Error message displayed when the CSV file is not formatted correctly',
456
+ defaultMessage: "Your CSV file is not formatted correctly. Make sure the file contains only one column named 'key', which includes the product keys"
457
+ }
458
+ });
459
+
460
+ function ownKeys$6(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
461
+ function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$6(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$6(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
462
+ const FILE_IMPORT_JOB_FLOW = 'fileImportJobFlow';
463
+ const DEFAULT_SHORT_LIVED_FLAGS = {
464
+ [FILE_IMPORT_JOB_FLOW]: false
465
+ };
466
+ const DEFAULT_LONG_LIVED_FLAGS = {};
467
+ _objectSpread$6(_objectSpread$6({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
468
+
469
+ const DOCUMENTATION_LINKS = {
470
+ product: 'https://docs.commercetools.com/merchant-center/product-list#bulk-delete-via-csv-import'
471
+ };
472
+ const TEMPLATE_DOWNLOAD_LINKS = {
473
+ product: 'https://docs.commercetools.com/merchant-center/downloads/product_delete_import_template.csv'
474
+ };
475
+
476
+ const useUpload = () => {
477
+ const intl = useIntl();
478
+ const _useApplicationContex = useApplicationContext(context => ({
479
+ projectKey: context.project?.key
480
+ })),
481
+ projectKey = _useApplicationContex.projectKey;
482
+ const _useDeleteResourcesCo = useDeleteResourcesContext(),
483
+ resourceType = _useDeleteResourcesCo.resourceType,
484
+ state = _useDeleteResourcesCo.state,
485
+ actions = _useDeleteResourcesCo.actions;
486
+ const showNotification = useShowNotification();
487
+ const isFileImportJobFlowEnabled = useFeatureToggle(FILE_IMPORT_JOB_FLOW);
488
+ const _useFileUpload = useFileUpload({
489
+ projectKey: projectKey,
490
+ useJobBasedFlow: isFileImportJobFlowEnabled
491
+ }),
492
+ upload = _useFileUpload.upload;
493
+ const isFileValid = async file => {
494
+ const errors = [];
495
+ const maxFileSizeMB = isFileImportJobFlowEnabled ? IMPORT_MAX_FILE_SIZE_MB : IMPORT_LEGACY_MAX_FILE_SIZE_MB;
496
+ const maxItemCount = isFileImportJobFlowEnabled ? IMPORT_MAX_ITEM_COUNT : IMPORT_LEGACY_MAX_ROW_COUNT;
497
+ const rowCount = await getRowCount(file);
498
+ if (rowCount < 1) errors.push({
499
+ title: intl.formatMessage(messages$4.dropAreaNotEnoughRowsTitle),
500
+ description: intl.formatMessage(messages$4.dropAreaNotEnoughRowsDescription)
501
+ });
502
+ if (file.size > toBytes(maxFileSizeMB)) errors.push({
503
+ title: intl.formatMessage(messages$4.fileSizeExceededTitle),
504
+ description: intl.formatMessage(messages$4.fileSizeExceededDescription, {
505
+ fileSizeLimit: intl.formatNumber(maxFileSizeMB)
506
+ })
507
+ });
508
+ if (!(await hasSingleKeyColumn(file))) {
509
+ errors.push({
510
+ title: intl.formatMessage(messages$4.csvFormatErrorTitle),
511
+ description: intl.formatMessage(messages$4.csvFormatErrorDescription)
512
+ });
513
+ }
514
+ if (rowCount > maxItemCount) errors.push({
515
+ title: intl.formatMessage(messages$4.rowLimitExceededTitle),
516
+ description: intl.formatMessage(messages$4.rowLimitExceededDescription, {
517
+ rowLimit: intl.formatNumber(maxItemCount)
518
+ })
519
+ });
520
+ if (errors.length > 0) {
521
+ actions.setFileUploadErrors(errors);
522
+ actions.setCurrentStep('upload-error');
523
+ return false;
524
+ }
525
+ if (isFileImportJobFlowEnabled) {
526
+ const resourceCount = await countUniqueResourcesInCsv(file);
527
+ actions.setTotalResourceCount(resourceCount);
528
+ }
529
+ return true;
530
+ };
531
+ const handleUploadError = error => {
532
+ if (isAbortError(error)) {
533
+ actions.cancelImport();
534
+ return;
535
+ }
536
+ if (error instanceof HttpError) {
537
+ actions.setValidationProgress({
538
+ processed: 0,
539
+ isValidating: false
540
+ });
541
+ if (error.errorData?.code === 'MISSING_KEY_ERROR') {
542
+ actions.setFileUploadErrors([{
543
+ title: intl.formatMessage(messages$4.missingRequiredField),
544
+ description: intl.formatMessage(messages$4.missingKeyError)
545
+ }]);
546
+ actions.setCurrentStep('upload-error');
547
+ } else if (error.errorData?.invalid > 0) {
548
+ actions.setUploadFileResponse(error.errorData);
549
+ actions.setCurrentStep('upload-error');
550
+ } else {
551
+ actions.cancelImport();
552
+ showNotification({
553
+ kind: 'error',
554
+ domain: DOMAINS.PAGE,
555
+ text: intl.formatMessage(messages$4.unexpectedError)
556
+ });
557
+ }
558
+ } else {
559
+ actions.cancelImport();
560
+ showNotification({
561
+ kind: 'error',
562
+ domain: DOMAINS.PAGE,
563
+ text: String(error)
564
+ });
565
+ reportErrorToSentry(new Error('Upload File Error: An unexpected issue occurred while uploading the file'), {
566
+ extra: {
567
+ error,
568
+ fileSizeInBytes: state.droppedFile?.size
569
+ }
570
+ });
571
+ }
572
+ };
573
+ const handleUploadAndValidation = async () => {
574
+ if (!state.droppedFile) return;
575
+ const canUpload = await isFileValid(state.droppedFile);
576
+ if (!canUpload) return;
577
+ const abortController = new AbortController();
578
+ actions.setAbortController(abortController);
579
+ actions.setCurrentStep('uploading');
580
+ await upload({
581
+ file: state.droppedFile,
582
+ resourceType,
583
+ settings: {
584
+ format: 'CSV'
585
+ },
586
+ abortSignal: abortController.signal,
587
+ onSuccess: result => {
588
+ actions.setValidationProgress({
589
+ processed: 0,
590
+ isValidating: false
591
+ });
592
+ actions.setContainerKey(result.containerKey);
593
+ if (result.jobId) {
594
+ actions.setJobId(result.jobId);
595
+ }
596
+ const fileUploadResponse = {
597
+ results: result.summary.results,
598
+ invalid: result.summary.invalid,
599
+ valid: result.summary.valid,
600
+ fileName: state.droppedFile?.name || '',
601
+ itemsCount: result.summary.total,
602
+ rowsCount: result.summary.total,
603
+ columnsCount: result.summary.fieldsCount,
604
+ fields: result.summary.fields,
605
+ ignoredFields: result.summary.ignoredFields
606
+ };
607
+ actions.setUploadFileResponse(fileUploadResponse);
608
+ if (result.summary.invalid > 0) {
609
+ actions.setCurrentStep('upload-error');
610
+ } else {
611
+ actions.setCurrentStep('upload-preview');
612
+ }
613
+ },
614
+ onProgress: progress => {
615
+ actions.setProgress(progress);
616
+ },
617
+ onValidationProgress: job => {
618
+ const processed = job.summary?.total ?? 0;
619
+ actions.setValidationProgress({
620
+ processed,
621
+ isValidating: true
622
+ });
623
+ },
624
+ onError: handleUploadError
625
+ });
626
+ };
627
+ return {
628
+ handleUploadAndValidation
629
+ };
630
+ };
631
+
632
+ const FileDropArea = () => {
633
+ const intl = useIntl();
634
+ const _useDeleteResourcesCo = useDeleteResourcesContext(),
635
+ state = _useDeleteResourcesCo.state,
636
+ actions = _useDeleteResourcesCo.actions;
637
+ const showNotification = useShowNotification();
638
+ const onDrop = React.useCallback(_ref => {
639
+ let _ref2 = _slicedToArray(_ref, 1),
640
+ file = _ref2[0];
641
+ if (!file) return;
642
+ actions.setDroppedFile(file);
643
+ }, [actions]);
644
+ const handleDropRejected = React.useCallback(errorType => {
645
+ const errorMessageMap = {
646
+ 'too-many-files': messages$5.tooManyFilesError,
647
+ 'invalid-type': messages$5.fileFormatNotSupported,
648
+ generic: messages$5.genericError
649
+ };
650
+ showNotification({
651
+ kind: 'error',
652
+ domain: DOMAINS.PAGE,
653
+ text: intl.formatMessage(errorMessageMap[errorType])
654
+ });
655
+ }, [intl, showNotification]);
656
+ const getState = React.useCallback(isDragActive => getDropAreaState({
657
+ isReady: Boolean(state.droppedFile),
658
+ isDragActive
659
+ }), [state.droppedFile]);
660
+ return jsx(FileDropArea$1, {
661
+ onDrop: onDrop,
662
+ onDropRejected: handleDropRejected,
663
+ accept: {
664
+ 'text/csv': ['.csv']
665
+ },
666
+ getDropAreaState: getState,
667
+ children: dropAreaState => getDropArea({
668
+ dropAreaState,
669
+ isFileDropped: Boolean(state.droppedFile),
670
+ fileName: state.droppedFile?.name,
671
+ messages: {
672
+ dragAndDropCSV: intl.formatMessage(messages$5.dragAndDropCSV),
673
+ or: intl.formatMessage(messages$5.or),
674
+ browseButton: intl.formatMessage(messages$5.browseButton),
675
+ chooseFile: intl.formatMessage(messages$5.chooseFile)
676
+ }
677
+ })
678
+ });
679
+ };
680
+
681
+ var sharedMessages = defineMessages({
682
+ deleteModalTitle: {
683
+ id: 'DeleteResourcesModal.deleteModalTitle',
684
+ description: 'The title of the modal',
685
+ defaultMessage: 'Bulk delete via CSV'
686
+ },
687
+ startBulkDelete: {
688
+ id: 'DeleteResourcesModal.startBulkDelete',
689
+ description: 'Start bulk delete button',
690
+ defaultMessage: 'Start bulk delete'
691
+ },
692
+ cancel: {
693
+ id: 'DeleteResourcesModal.cancel',
694
+ description: 'The label for the cancel button',
695
+ defaultMessage: 'Cancel'
696
+ },
697
+ product: {
698
+ id: 'DeleteResourcesModal.product',
699
+ description: 'Label for the product resource type',
700
+ defaultMessage: 'product'
701
+ },
702
+ products: {
703
+ id: 'DeleteResourcesModal.products',
704
+ description: 'Plural form of product',
705
+ defaultMessage: 'products'
706
+ },
707
+ inventory: {
708
+ id: 'DeleteResourcesModal.inventory',
709
+ description: 'Label for the inventory entry resource type',
710
+ defaultMessage: 'inventory entry'
711
+ },
712
+ inventories: {
713
+ id: 'DeleteResourcesModal.inventories',
714
+ description: 'Plural form of inventory entry',
715
+ defaultMessage: 'inventory entries'
716
+ },
717
+ category: {
718
+ id: 'DeleteResourcesModal.category',
719
+ description: 'Label for the category resource type',
720
+ defaultMessage: 'category'
721
+ },
722
+ categories: {
723
+ id: 'DeleteResourcesModal.categories',
724
+ description: 'Plural form of category',
725
+ defaultMessage: 'categories'
726
+ },
727
+ customer: {
728
+ id: 'DeleteResourcesModal.customer',
729
+ description: 'Label for the customer resource type',
730
+ defaultMessage: 'customer'
731
+ },
732
+ customers: {
733
+ id: 'DeleteResourcesModal.customers',
734
+ description: 'Plural form of customer',
735
+ defaultMessage: 'customers'
736
+ },
737
+ order: {
738
+ id: 'DeleteResourcesModal.order',
739
+ description: 'Label for the order resource type',
740
+ defaultMessage: 'order'
741
+ },
742
+ orders: {
743
+ id: 'DeleteResourcesModal.orders',
744
+ description: 'Plural form of order',
745
+ defaultMessage: 'orders'
746
+ },
747
+ price: {
748
+ id: 'DeleteResourcesModal.price',
749
+ description: 'Label for the price resource type',
750
+ defaultMessage: 'price'
751
+ },
752
+ prices: {
753
+ id: 'DeleteResourcesModal.prices',
754
+ description: 'Plural form of price',
755
+ defaultMessage: 'prices'
756
+ },
757
+ 'product-draft': {
758
+ id: 'DeleteResourcesModal.product-draft',
759
+ description: 'Label for the product-draft resource type',
760
+ defaultMessage: 'product draft'
761
+ },
762
+ 'product-drafts': {
763
+ id: 'DeleteResourcesModal.product-drafts',
764
+ description: 'Plural form of product draft',
765
+ defaultMessage: 'product drafts'
766
+ },
767
+ 'product-type': {
768
+ id: 'DeleteResourcesModal.product-type',
769
+ description: 'Label for the product-type resource type',
770
+ defaultMessage: 'product type'
771
+ },
772
+ 'product-types': {
773
+ id: 'DeleteResourcesModal.product-types',
774
+ description: 'Plural form of product type',
775
+ defaultMessage: 'product types'
776
+ },
777
+ 'product-variant': {
778
+ id: 'DeleteResourcesModal.product-variant',
779
+ description: 'Label for the product-variant resource type',
780
+ defaultMessage: 'product variant'
781
+ },
782
+ 'product-variants': {
783
+ id: 'DeleteResourcesModal.product-variants',
784
+ description: 'Plural form of product variant',
785
+ defaultMessage: 'product variants'
786
+ },
787
+ 'product-variant-patch': {
788
+ id: 'DeleteResourcesModal.product-variant-patch',
789
+ description: 'Label for the product-variant-patch resource type',
790
+ defaultMessage: 'product variant patch'
791
+ },
792
+ 'product-variant-patches': {
793
+ id: 'DeleteResourcesModal.product-variant-patches',
794
+ description: 'Plural form of product variant patch',
795
+ defaultMessage: 'product variant patches'
796
+ },
797
+ 'standalone-price': {
798
+ id: 'DeleteResourcesModal.standalone-price',
799
+ description: 'Label for the standalone-price resource type',
800
+ defaultMessage: 'standalone price'
801
+ },
802
+ 'standalone-prices': {
803
+ id: 'DeleteResourcesModal.standalone-prices',
804
+ description: 'Plural form of standalone price',
805
+ defaultMessage: 'standalone prices'
806
+ },
807
+ 'discount-code': {
808
+ id: 'DeleteResourcesModal.discount-code',
809
+ description: 'Label for the discount-code resource type',
810
+ defaultMessage: 'discount code'
811
+ },
812
+ 'discount-codes': {
813
+ id: 'DeleteResourcesModal.discount-codes',
814
+ description: 'Plural form of discount code',
815
+ defaultMessage: 'discount codes'
816
+ },
817
+ unknownResourceType: {
818
+ id: 'DeleteResourcesModal.unknown-resource-type',
819
+ description: 'Label for the unknown resource type',
820
+ defaultMessage: 'unknown resource type'
821
+ }
822
+ });
823
+
824
+ var messages$3 = defineMessages({
825
+ fileUploadInstruction: {
826
+ id: 'DeleteResourcesModal.fileUploadInstruction',
827
+ description: 'Instructions for uploading a CSV file with resource keys to delete',
828
+ defaultMessage: "The CSV file must contain the {resourceType} keys to be deleted under the header 'key'."
829
+ },
830
+ fileUploadInstructionForMaxFileSize: {
831
+ id: 'DeleteResourcesModal.fileUploadInstructionForMaxFileSize',
832
+ description: 'Instructions for uploading a CSV file with a max file size',
833
+ defaultMessage: 'Maximum file size is {maxFileSize} MB with a limit of {maxRowCount} rows. Download <csvTemplateLink>the CSV template</csvTemplateLink> or refer to <documentationLink>the documentation</documentationLink>.'
834
+ },
835
+ unpublishNote: {
836
+ id: 'DeleteResourcesModal.unpublishNote',
837
+ description: 'Note to unpublish products before deleting them',
838
+ defaultMessage: 'Please note that published products <b>must be unpublished</b> before they can be deleted.'
839
+ }
840
+ });
841
+
842
+ function resourceTypeToMessage(resourceType) {
843
+ const resourceTypeMap = {
844
+ category: sharedMessages.category,
845
+ product: sharedMessages.product,
846
+ 'product-type': sharedMessages['product-type'],
847
+ order: sharedMessages.order,
848
+ customer: sharedMessages.customer,
849
+ 'discount-code': sharedMessages['discount-code'],
850
+ inventory: sharedMessages.inventory,
851
+ // TODO: remove `inventory` after aligning the resource type names in the file upload API
852
+ 'inventory-entry': sharedMessages.inventory,
853
+ 'order-patch': sharedMessages['order-patch'],
854
+ price: sharedMessages.price,
855
+ 'product-draft': sharedMessages['product-draft'],
856
+ 'product-variant': sharedMessages['product-variant'],
857
+ 'product-variant-patch': sharedMessages['product-variant-patch'],
858
+ 'standalone-price': sharedMessages['standalone-price']
859
+ };
860
+ const message = resourceTypeMap[resourceType];
861
+ if (!message) {
862
+ console.warn(new UnexpectedResourceTypeError(resourceType));
863
+ return sharedMessages.unknownResourceType;
864
+ }
865
+ return message;
866
+ }
867
+ function resourceTypeToPluralMessage(resourceType) {
868
+ const resourceTypePluralMap = {
869
+ category: sharedMessages.categories,
870
+ product: sharedMessages.products,
871
+ 'product-type': sharedMessages['product-types'],
872
+ order: sharedMessages.orders,
873
+ customer: sharedMessages.customers,
874
+ 'discount-code': sharedMessages['discount-codes'],
875
+ inventory: sharedMessages.inventories,
876
+ // TODO: remove `inventory` after aligning the resource type names in the file upload API
877
+ 'inventory-entry': sharedMessages.inventories,
878
+ 'order-patch': sharedMessages['order-patches'],
879
+ price: sharedMessages.prices,
880
+ 'product-draft': sharedMessages['product-drafts'],
881
+ 'product-variant': sharedMessages['product-variants'],
882
+ 'product-variant-patch': sharedMessages['product-variant-patches'],
883
+ 'standalone-price': sharedMessages['standalone-prices']
884
+ };
885
+ const message = resourceTypePluralMap[resourceType];
886
+ if (!message) {
887
+ console.warn(new UnexpectedResourceTypeError(resourceType));
888
+ return sharedMessages.unknownResourceType;
889
+ }
890
+ return message;
891
+ }
892
+
893
+ function ownKeys$5(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
894
+ function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
895
+ const Instructions = () => {
896
+ const intl = useIntl();
897
+ const _useDeleteResourcesCo = useDeleteResourcesContext(),
898
+ resourceType = _useDeleteResourcesCo.resourceType;
899
+ const isFileImportJobFlowEnabled = useFeatureToggle(FILE_IMPORT_JOB_FLOW);
900
+ const documentTemplateLink = TEMPLATE_DOWNLOAD_LINKS[resourceType];
901
+ const documentationLink = DOCUMENTATION_LINKS[resourceType];
902
+ const maxFileSizeMB = isFileImportJobFlowEnabled ? IMPORT_MAX_FILE_SIZE_MB : IMPORT_LEGACY_MAX_FILE_SIZE_MB;
903
+ const maxItemCount = isFileImportJobFlowEnabled ? IMPORT_MAX_ITEM_COUNT : IMPORT_LEGACY_MAX_ROW_COUNT;
904
+ return jsxs(Spacings.Stack, {
905
+ scale: "m",
906
+ children: [jsxs(Text.Body, {
907
+ children: [intl.formatMessage(messages$3.fileUploadInstruction, {
908
+ resourceType: intl.formatMessage(resourceTypeToMessage(resourceType))
909
+ }), ' ', intl.formatMessage(messages$3.unpublishNote, {
910
+ b: msg => jsx("b", {
911
+ children: msg
912
+ }, "bold")
913
+ })]
914
+ }), jsx(Text.Body, {
915
+ intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.fileUploadInstructionForMaxFileSize), {}, {
916
+ values: {
917
+ maxFileSize: intl.formatNumber(maxFileSizeMB),
918
+ maxRowCount: intl.formatNumber(maxItemCount),
919
+ csvTemplateLink: msg => jsx(Link, {
920
+ tone: "secondary",
921
+ isExternal: true,
922
+ to: documentTemplateLink,
923
+ children: msg
924
+ }, "csvTemplateLink"),
925
+ documentationLink: msg => jsx(Link, {
926
+ tone: "secondary",
927
+ isExternal: true,
928
+ to: documentationLink,
929
+ children: msg
930
+ }, "documentationLink")
931
+ }
932
+ })
933
+ })]
934
+ });
935
+ };
936
+
937
+ const Upload = () => {
938
+ const _useDeleteResourcesCo = useDeleteResourcesContext(),
939
+ state = _useDeleteResourcesCo.state,
940
+ onClose = _useDeleteResourcesCo.onClose;
941
+ const intl = useIntl();
942
+ const _useUpload = useUpload(),
943
+ handleUploadAndValidation = _useUpload.handleUploadAndValidation;
944
+ return jsx(FormDialog, {
945
+ size: 16,
946
+ isOpen: true,
947
+ title: intl.formatMessage(sharedMessages.deleteModalTitle),
948
+ labelPrimary: intl.formatMessage(messages$5.uploadAndPreview),
949
+ onPrimaryButtonClick: handleUploadAndValidation,
950
+ isPrimaryButtonDisabled: !Boolean(state.droppedFile),
951
+ onSecondaryButtonClick: () => onClose({
952
+ shouldDeleteImportContainer: true
953
+ }),
954
+ onClose: () => onClose({
955
+ shouldDeleteImportContainer: true
956
+ }),
957
+ children: jsx(Masking.Unmask, {
958
+ children: jsxs(Spacings.Stack, {
959
+ scale: "m",
960
+ children: [jsx(Instructions, {}), jsx(FileDropArea, {})]
961
+ })
962
+ })
963
+ });
964
+ };
965
+
966
+ var messages$2 = defineMessages({
967
+ validatingResources: {
968
+ id: 'DeleteResourcesModal.Uploading.validatingResources',
969
+ defaultMessage: 'Validating {processed} / {total} {resourceType}'
970
+ }
971
+ });
972
+
973
+ const Uploading = () => {
974
+ const intl = useIntl();
975
+ const _useDeleteResourcesCo = useDeleteResourcesContext(),
976
+ resourceType = _useDeleteResourcesCo.resourceType,
977
+ state = _useDeleteResourcesCo.state,
978
+ actions = _useDeleteResourcesCo.actions,
979
+ onClose = _useDeleteResourcesCo.onClose;
980
+ if (!state.droppedFile?.name) return null;
981
+ const showValidationProgress = state.isValidating && state.totalResourceCount && (state.validationProcessed ?? 0) > 0;
982
+ const statusMessage = showValidationProgress ? intl.formatMessage(messages$2.validatingResources, {
983
+ processed: intl.formatNumber(state.validationProcessed ?? 0),
984
+ total: intl.formatNumber(state.totalResourceCount ?? 0),
985
+ resourceType: intl.formatMessage(resourceTypeToPluralMessage(resourceType))
986
+ }) : undefined;
987
+ return jsx(UploadingModal, {
988
+ isOpen: true,
989
+ title: intl.formatMessage(sharedMessages.deleteModalTitle),
990
+ fileName: state.droppedFile.name,
991
+ fileSize: state.droppedFile.size,
992
+ progress: state.progress,
993
+ statusMessage: statusMessage,
994
+ cancelLabel: intl.formatMessage(sharedMessages.cancel),
995
+ onCancel: () => {
996
+ actions.setCurrentStep('upload');
997
+ state.abortController.abort();
998
+ },
999
+ onClose: () => onClose({
1000
+ shouldDeleteImportContainer: true
1001
+ })
1002
+ });
1003
+ };
1004
+
1005
+ var messages$1 = defineMessages({
1006
+ uploadNewFile: {
1007
+ id: 'DeleteResourcesModal.uploadNewFile',
1008
+ defaultMessage: 'Upload new file'
1009
+ },
1010
+ uploadErrorDescription: {
1011
+ id: 'DeleteResourcesModal.uploadError',
1012
+ description: 'Title when errors detected while uploading file',
1013
+ defaultMessage: 'There {errorsCount, plural, one {is <b>1</b> error} other {are <b>{errorsCount}</b> errors}} detected while uploading the file "{fileName}".'
1014
+ },
1015
+ errorType: {
1016
+ id: 'DeleteResourcesModal.errorType',
1017
+ description: 'Error type" column',
1018
+ defaultMessage: 'Error type'
1019
+ },
1020
+ details: {
1021
+ id: 'DeleteResourcesModal.details',
1022
+ description: '"Details" column',
1023
+ defaultMessage: 'Details'
1024
+ }
1025
+ });
1026
+
1027
+ function ownKeys$4(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1028
+ function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$4(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$4(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
1029
+ const getColumns = () => [{
1030
+ key: 'errorType',
1031
+ label: jsx(FormattedMessage, _objectSpread$4({}, messages$1.errorType)),
1032
+ width: 'max-content'
1033
+ }, {
1034
+ key: 'details',
1035
+ label: jsx(FormattedMessage, _objectSpread$4({}, messages$1.details))
1036
+ }];
1037
+ const UploadErrorTable = props => {
1038
+ var _context;
1039
+ const pagination = usePaginationState({
1040
+ perPage: 10
1041
+ });
1042
+ const startIndex = (pagination.page.value - 1) * pagination.perPage.value;
1043
+ const endIndex = startIndex + pagination.perPage.value;
1044
+ const currentPageRows = _sliceInstanceProperty(_context = props.rows).call(_context, startIndex, endIndex);
1045
+ const shouldShowPagination = props.rows.length > pagination.perPage.value;
1046
+ return jsxs(Spacings.Stack, {
1047
+ scale: "l",
1048
+ children: [jsx(DataTable, {
1049
+ verticalCellAlignment: "center",
1050
+ isCondensed: true,
1051
+ rows: currentPageRows,
1052
+ columns: getColumns(),
1053
+ itemRenderer: itemRenderer
1054
+ }), shouldShowPagination && jsx(PageNavigator, {
1055
+ onPageChange: pagination.page.onChange,
1056
+ page: pagination.page.value,
1057
+ totalPages: Math.ceil(props.rows.length / pagination.perPage.value)
1058
+ })]
1059
+ });
1060
+ };
1061
+ function itemRenderer(item, column) {
1062
+ switch (column.key) {
1063
+ case 'errorType':
1064
+ return jsx(Stamp, {
1065
+ isCondensed: true,
1066
+ label: item.title,
1067
+ tone: "critical"
1068
+ });
1069
+ case 'details':
1070
+ return jsx(Text.Body, {
1071
+ children: item.description
1072
+ });
1073
+ default:
1074
+ return null;
1075
+ }
1076
+ }
1077
+
1078
+ function ownKeys$3(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1079
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$3(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$3(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
1080
+ const UploadErrorsModal = () => {
1081
+ const intl = useIntl();
1082
+ const _useDeleteResourcesCo = useDeleteResourcesContext(),
1083
+ state = _useDeleteResourcesCo.state,
1084
+ actions = _useDeleteResourcesCo.actions,
1085
+ onClose = _useDeleteResourcesCo.onClose;
1086
+ const errorsCount = state.fileUploadErrors?.length ?? 0;
1087
+ return jsx(InfoDialog, {
1088
+ size: 16,
1089
+ isOpen: true,
1090
+ title: intl.formatMessage(sharedMessages.deleteModalTitle),
1091
+ onClose: () => onClose(),
1092
+ children: jsx(Masking.Unmask, {
1093
+ children: jsxs(Spacings.Stack, {
1094
+ scale: "l",
1095
+ children: [jsx(Masking.Mask, {
1096
+ children: jsx(Text.Body, {
1097
+ intlMessage: _objectSpread$3(_objectSpread$3({}, messages$1.uploadErrorDescription), {}, {
1098
+ values: {
1099
+ fileName: state.droppedFile?.name,
1100
+ errorsCount: intl.formatNumber(errorsCount),
1101
+ b: getBold$2
1102
+ }
1103
+ })
1104
+ })
1105
+ }), jsx(UploadErrorTable, {
1106
+ rows: mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors ?? [])
1107
+ }), jsxs(Spacings.Inline, {
1108
+ scale: "m",
1109
+ justifyContent: "flex-end",
1110
+ children: [jsx(SecondaryButton, {
1111
+ label: intl.formatMessage(sharedMessages.cancel),
1112
+ onClick: () => onClose()
1113
+ }), jsx(PrimaryButton, {
1114
+ iconLeft: jsx(ImportIcon, {}),
1115
+ label: intl.formatMessage(messages$1.uploadNewFile),
1116
+ onClick: () => actions.uploadNewFile()
1117
+ })]
1118
+ })]
1119
+ })
1120
+ })
1121
+ });
1122
+ };
1123
+ function getBold$2(msg) {
1124
+ return jsx(Text.Body, {
1125
+ as: "span",
1126
+ isBold: true,
1127
+ children: msg
1128
+ }, crypto.randomUUID());
1129
+ }
1130
+
1131
+ var messages = defineMessages({
1132
+ continue: {
1133
+ id: 'DeleteResourcesModal.continue',
1134
+ description: 'Continue button',
1135
+ defaultMessage: 'Continue'
1136
+ },
1137
+ heresAPreview: {
1138
+ id: 'DeleteResourcesModal.heresAPreview',
1139
+ description: 'Here is a preview',
1140
+ defaultMessage: "Here's a preview:"
1141
+ },
1142
+ resourcesToBeDeleted: {
1143
+ id: 'DeleteResourcesModal.resourcesToBeDeleted',
1144
+ description: 'Resources to be deleted',
1145
+ defaultMessage: '{count, plural, one {<b>{count}</b> {resourceType} to be deleted} other {<b>{count}</b> {resourceTypePlural} to be deleted}}'
1146
+ },
1147
+ confirmationQuestion: {
1148
+ id: 'DeleteResourcesModal.confirmationQuestion',
1149
+ description: 'Confirmation question',
1150
+ defaultMessage: 'Are you sure you want to delete the {resourceTypePlural}? '
1151
+ },
1152
+ confirmationText: {
1153
+ id: 'DeleteResourcesModal.confirmationText',
1154
+ description: 'Confirmation text',
1155
+ defaultMessage: '{count, plural, one {You are about to delete <b>{count}</b> {resourceType} in the project: <b>{projectName}</b>.} other {You are about to deleted <b>{count}</b> {resourceTypePlural} in the project: <b>{projectName}</b>.}}'
1156
+ },
1157
+ cannotBeUndoneNote: {
1158
+ id: 'DeleteResourcesModal.cannotBeUndoneNote',
1159
+ description: 'Cannot be undone note in the confirmation dialog',
1160
+ defaultMessage: 'This action cannot be undone.'
1161
+ },
1162
+ importStarted: {
1163
+ id: 'DeleteResourcesModal.importStarted',
1164
+ description: 'Import started',
1165
+ defaultMessage: '<b>Your import for bulk delete has started.</b><newline></newline>Go to <logsLink>Import logs</logsLink> to view the progress.'
1166
+ },
1167
+ preparingImport: {
1168
+ id: 'DeleteResourcesModal.preparingImport',
1169
+ description: 'Preparing import',
1170
+ defaultMessage: '<b>Prepare bulk delete.</b><newline></newline>Once preparation is complete, you can track the progress <logsLink>in the Import logs</logsLink>. The data will be deleted after the import is finalized.'
1171
+ }
1172
+ });
1173
+
1174
+ function ownKeys$2(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1175
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$2(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$2(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
1176
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { 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)."; }
1177
+ const getNewLine = () => jsx("br", {}, "break");
1178
+ const getImportLogsLink = (msg, projectKey) => jsx(Link, {
1179
+ to: `/${projectKey}/operations/import/logs`,
1180
+ children: msg
1181
+ }, "link");
1182
+ var _ref2 = process.env.NODE_ENV === "production" ? {
1183
+ name: "1vs9i7r",
1184
+ styles: "width:360px"
1185
+ } : {
1186
+ name: "g36yzl-ImportRunningTextNotification",
1187
+ styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRlbGV0ZS1yZXNvdXJjZXMtY29uZmlybWF0aW9uLW1vZGFsLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFvQ1kiLCJmaWxlIjoiZGVsZXRlLXJlc291cmNlcy1jb25maXJtYXRpb24tbW9kYWwudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdXNlSW50bCB9IGZyb20gJ3JlYWN0LWludGwnXG5pbXBvcnQgeyB1c2VTaG93Tm90aWZpY2F0aW9uIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYWN0aW9ucy1nbG9iYWwnXG5pbXBvcnQgeyBJbmZvRGlhbG9nIH0gZnJvbSAnQGNvbW1lcmNldG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gICAgIHRleHQ6IDxJbXBvcnRQcmVwYXJpbmdUZXh0Tm90aWZpY2F0aW9uIHByb2plY3RLZXk9e3Byb2plY3RLZXl9IC8+LFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgZGlzbWlzc0FmdGVyOiA1MDAwLFxuICAgICAgICB9XG4gICAgICApXG5cbiAgICAgIGlmIChzdGF0ZS5qb2JJZCkge1xuICAgICAgICBhd2FpdCBwcm9jZXNzRmlsZUltcG9ydEpvYih7XG4gICAgICAgICAgcHJvamVjdEtleSxcbiAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgam9iSWQ6IHN0YXRlLmpvYklkLFxuICAgICAgICAgIHJlc291cmNlVHlwZSxcbiAgICAgICAgICBhY3Rpb246ICdkZWxldGUnLFxuICAgICAgICB9KVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYXdhaXQgcHJvY2Vzc1VwbG9hZGVkRmlsZSh7XG4gICAgICAgICAgcHJvamVjdEtleSxcbiAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgcmVzb3VyY2VUeXBlLFxuICAgICAgICAgIGFjdGlvbjogJ2RlbGV0ZScsXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICB7XG4gICAgICAgICAga2luZDogJ2luZm8nLFxuICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICB0ZXh0OiA8SW1wb3J0UnVubmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgIH1cbiAgICAgIClcbiAgICB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JjZVR5cGUpXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgIHJlc291cmNlVHlwZTogaW50bC5mb3JtYXRNZXNzYWdlKFxuICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlVHlwZVRvTWVzc2FnZShyZXNvdXJjZVR5cGUpXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgIGNvdW50OiBpbnRsLmZvcm1hdE51bWJlcihcbiAgICAgICAgICAgICAgICAgICAgICBzdGF0ZS51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCA/PyAwXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgIGI6IGdldEJvbGQsXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgIDxUZXh0LkJvZHlcbiAgICAgICAgICAgICAgICBpbnRsTWVzc2FnZT17e1xuICAgICAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uUXVlc3Rpb24sXG4gICAgICAgICAgICAgICAgICB2YWx1ZXM6IHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VUeXBlUGx1cmFsOiBpbnRsLmZvcm1hdE1lc3NhZ2UoXG4gICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VUeXBlVG9QbHVyYWxNZXNzYWdlKHJlc291cmNlVHlwZSlcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPFNwYWNpbmdzLklubGluZSBzY2FsZT1cInNcIiBhbGlnbkl0ZW1zPVwiY2VudGVyXCI+XG4gICAgICAgICAgICAgIDxXYXJuaW5nSWNvbiBzaXplPVwiNDBcIiBjb2xvcj1cIndhcm5p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2V0Qm9sZChtc2cpIHtcbiAgcmV0dXJuIChcbiAgICA8VGV4dC5Cb2R5IGFzPVwic3BhblwiIGlzQm9sZCBrZXk9e2NyeXB0by5yYW5kb21VVUlEKCl9PlxuICAgICAge21zZ31cbiAgICA8L1RleHQuQm9keT5cbiAgKVxufVxuIl19 */",
1188
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
1189
+ };
1190
+ const ImportRunningTextNotification = props => jsx("div", {
1191
+ css: _ref2,
1192
+ children: jsx(Text.Body, {
1193
+ intlMessage: _objectSpread$2(_objectSpread$2({}, messages.importStarted), {}, {
1194
+ values: {
1195
+ newline: getNewLine,
1196
+ logsLink: msg => getImportLogsLink(msg, props.projectKey),
1197
+ b: getBold$1
1198
+ }
1199
+ })
1200
+ })
1201
+ });
1202
+ var _ref = process.env.NODE_ENV === "production" ? {
1203
+ name: "1vs9i7r",
1204
+ styles: "width:360px"
1205
+ } : {
1206
+ name: "mjwslu-ImportPreparingTextNotification",
1207
+ styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRlbGV0ZS1yZXNvdXJjZXMtY29uZmlybWF0aW9uLW1vZGFsLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1RFkiLCJmaWxlIjoiZGVsZXRlLXJlc291cmNlcy1jb25maXJtYXRpb24tbW9kYWwudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdXNlSW50bCB9IGZyb20gJ3JlYWN0LWludGwnXG5pbXBvcnQgeyB1c2VTaG93Tm90aWZpY2F0aW9uIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYWN0aW9ucy1nbG9iYWwnXG5pbXBvcnQgeyBJbmZvRGlhbG9nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYXBwbGljYXRpb24tY29tcG9uZW50cydcbmltc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2F0aW9uIHByb2plY3RLZXk9e3Byb2plY3RLZXl9IC8+LFxuICAgICAgICB9LFxuICAgICAgICB7XG4gICAgICAgICAgZGlzbWlzc0FmdGVyOiA1MDAwLFxuICAgICAgICB9XG4gICAgICApXG5cbiAgICAgIGlmIChzdGF0ZS5qb2JJZCkge1xuICAgICAgICBhd2FpdCBwcm9jZXNzRmlsZUltcG9ydEpvYih7XG4gICAgICAgICAgcHJvamVjdEtleSxcbiAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgam9iSWQ6IHN0YXRlLmpvYklkLFxuICAgICAgICAgIHJlc291cmNlVHlwZSxcbiAgICAgICAgICBhY3Rpb246ICdkZWxldGUnLFxuICAgICAgICB9KVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYXdhaXQgcHJvY2Vzc1VwbG9hZGVkRmlsZSh7XG4gICAgICAgICAgcHJvamVjdEtleSxcbiAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgcmVzb3VyY2VUeXBlLFxuICAgICAgICAgIGFjdGlvbjogJ2RlbGV0ZScsXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICB7XG4gICAgICAgICAga2luZDogJ2luZm8nLFxuICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICB0ZXh0OiA8SW1wb3J0UnVubmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgIH0sXG4gICAgICAgIHtcbiAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgIH1cbiAgICAgIClcbiAgICB9IGNhdGNoIChlcnJvcikge1xuICAgICAgb25DbG9zZSh7IHNob3VsZERlbGV0ZUltcG9ydENvbnRhaW5lcjogdHJ1ZSB9KVxuICAgICAgc2hvd05vdGlmaWNhdGlvbih7XG4gICAgICAgIGtpbmQ6ICdlcnJvcicsXG4gICAgICAgIGRvbWFpbjogRE9NQUlOUy5QQUdFLFxuICAgICAgICB0ZXh0OiBTdHJpbmcoZXJyb3IpLFxuICAgICAgfSlcbiAgICB9XG4gIH1cblxuICByZXR1cm4gKFxuICAgIDxJbmZvRGlhbG9nXG4gICAgICB0aXRsZT17aW50bC5mb3JtYXRNZXNzYWdlKHNoYXJlZE1lc3NhZ2VzLmRlbGV0ZU1vZGFsVGl0bGUpfVxuICAgICAgaXNPcGVuXG4gICAgICBvbkNsb3NlPXsoKSA9PiBvbkNsb3NlKHsgc2hvdWxkRGVsZXRlSW1wb3J0Q29udGFpbmVyOiB0cnVlIH0pfVxuICAgICAgc2l6ZT17MTZ9XG4gICAgPlxuICAgICAgPEZ1bGxTdG9yeU1hc2tpbmcuVW5tYXNrPlxuICAgICAgICA8U3BhY2luZ3MuU3RhY2sgc2NhbGU9XCJ4bFwiPlxuICAgICAgICAgIDxTcGFjaW5ncy5TdGFjayBzY2FsZT1cIm1cIj5cbiAgICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICAgIDxUZXh0LkJvZHlcbiAgICAgICAgICAgICAgICBpbnRsTWVzc2FnZT17e1xuICAgICAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uVGV4dCxcbiAgICAgICAgICAgICAgICAgIHZhbHVlczoge1xuICAgICAgICAgICAgICAgICAgICBwcm9qZWN0TmFtZTogcHJvamVjdE5hbWUsXG4gICAgICAgICAgICAgICAgICAgIHJlc291cmNlVHlwZVBsdXJhbDogaW50bC5mb3JtYXRNZXNzYWdlKFxuICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlVHlwZVRvUGx1cmFsTWVzc2FnZShyZXNvdXJjZVR5cGUpXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgIHJlc291cmNlVHlwZTogaW50bC5mb3JtYXRNZXNzYWdlKFxuICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNlVHlwZVRvTWVzc2FnZShyZXNvdXJjZVR5cGUpXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgIGNvdW50OiBpbnRsLmZvcm1hdE51bWJlcihcbiAgICAgICAgICAgICAgICAgICAgICBzdGF0ZS51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCA/PyAwXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgIGI6IGdldEJvbGQsXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgIDxUZXh0LkJvZHlcbiAgICAgICAgICAgICAgICBpbnRsTWVzc2FnZT17e1xuICAgICAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uUXVlc3Rpb24sXG4gICAgICAgICAgICAgICAgICB2YWx1ZXM6IHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VUeXBlUGx1cmFsOiBpbnRsLmZvcm1hdE1lc3NhZ2UoXG4gICAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VUeXBlVG9QbHVyYWxNZXNzYWdlKHJlc291cmNlVHlwZSlcbiAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfX1cbiAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPFNwYWNpbmdzLklubGluZSBzY2FsZT1cInNcIiBhbGlnbkl0ZW1zPVwiY2VudGVyXCI+XG4gICAgICAgICAgICAgIDxXYXJuaW5nSWNvbiBzaXplPVwiNDBcIiBjb2xvcj1cIndhcm5pbmdcIiAvPlxuICAgICAgICAgICAgICA8VGV4dC5Cb2R5IGludGxNZXN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Cb2R5IGFzPVwic3BhblwiIGlzQm9sZCBrZXk9e2NyeXB0by5yYW5kb21VVUlEKCl9PlxuICAgICAge21zZ31cbiAgICA8L1RleHQuQm9keT5cbiAgKVxufVxuIl19 */",
1208
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
1209
+ };
1210
+ const ImportPreparingTextNotification = props => jsx("div", {
1211
+ css: _ref,
1212
+ children: jsx(Text.Body, {
1213
+ intlMessage: _objectSpread$2(_objectSpread$2({}, messages.preparingImport), {}, {
1214
+ values: {
1215
+ newline: getNewLine,
1216
+ logsLink: msg => getImportLogsLink(msg, props.projectKey),
1217
+ b: getBold$1
1218
+ }
1219
+ })
1220
+ })
1221
+ });
1222
+ const DeleteResourcesConfirmationModal = () => {
1223
+ const intl = useIntl();
1224
+ const _useDeleteResourcesCo = useDeleteResourcesContext(),
1225
+ resourceType = _useDeleteResourcesCo.resourceType,
1226
+ state = _useDeleteResourcesCo.state,
1227
+ onClose = _useDeleteResourcesCo.onClose;
1228
+ const _useApplicationContex = useApplicationContext(context => ({
1229
+ projectKey: context.project?.key,
1230
+ projectName: context.project?.name
1231
+ })),
1232
+ projectKey = _useApplicationContex.projectKey,
1233
+ projectName = _useApplicationContex.projectName;
1234
+ const showNotification = useShowNotification();
1235
+ const onStartImport = async () => {
1236
+ try {
1237
+ const canConfirm = projectKey && state.containerKey && state.droppedFile?.name;
1238
+ if (!canConfirm) return;
1239
+ onClose();
1240
+ showNotification({
1241
+ kind: 'info',
1242
+ domain: DOMAINS.SIDE,
1243
+ // @ts-ignore
1244
+ text: jsx(ImportPreparingTextNotification, {
1245
+ projectKey: projectKey
1246
+ })
1247
+ }, {
1248
+ dismissAfter: 5000
1249
+ });
1250
+ if (state.jobId) {
1251
+ await processFileImportJob({
1252
+ projectKey,
1253
+ importContainerKey: state.containerKey,
1254
+ jobId: state.jobId,
1255
+ resourceType,
1256
+ action: 'delete'
1257
+ });
1258
+ } else {
1259
+ await processUploadedFile({
1260
+ projectKey,
1261
+ importContainerKey: state.containerKey,
1262
+ resourceType,
1263
+ action: 'delete'
1264
+ });
1265
+ }
1266
+ showNotification({
1267
+ kind: 'info',
1268
+ domain: DOMAINS.SIDE,
1269
+ // @ts-ignore
1270
+ text: jsx(ImportRunningTextNotification, {
1271
+ projectKey: projectKey
1272
+ })
1273
+ }, {
1274
+ dismissAfter: 5000
1275
+ });
1276
+ } catch (error) {
1277
+ onClose({
1278
+ shouldDeleteImportContainer: true
1279
+ });
1280
+ showNotification({
1281
+ kind: 'error',
1282
+ domain: DOMAINS.PAGE,
1283
+ text: String(error)
1284
+ });
1285
+ }
1286
+ };
1287
+ return jsx(InfoDialog, {
1288
+ title: intl.formatMessage(sharedMessages.deleteModalTitle),
1289
+ isOpen: true,
1290
+ onClose: () => onClose({
1291
+ shouldDeleteImportContainer: true
1292
+ }),
1293
+ size: 16,
1294
+ children: jsx(Masking.Unmask, {
1295
+ children: jsxs(Spacings.Stack, {
1296
+ scale: "xl",
1297
+ children: [jsxs(Spacings.Stack, {
1298
+ scale: "m",
1299
+ children: [jsxs("div", {
1300
+ children: [jsx(Text.Body, {
1301
+ intlMessage: _objectSpread$2(_objectSpread$2({}, messages.confirmationText), {}, {
1302
+ values: {
1303
+ projectName: projectName,
1304
+ resourceTypePlural: intl.formatMessage(resourceTypeToPluralMessage(resourceType)),
1305
+ resourceType: intl.formatMessage(resourceTypeToMessage(resourceType)),
1306
+ count: intl.formatNumber(state.uploadFileResponse?.rowsCount ?? 0),
1307
+ b: getBold$1
1308
+ }
1309
+ })
1310
+ }), jsx(Text.Body, {
1311
+ intlMessage: _objectSpread$2(_objectSpread$2({}, messages.confirmationQuestion), {}, {
1312
+ values: {
1313
+ resourceTypePlural: intl.formatMessage(resourceTypeToPluralMessage(resourceType))
1314
+ }
1315
+ })
1316
+ })]
1317
+ }), jsxs(Spacings.Inline, {
1318
+ scale: "s",
1319
+ alignItems: "center",
1320
+ children: [jsx(WarningIcon, {
1321
+ size: "40",
1322
+ color: "warning"
1323
+ }), jsx(Text.Body, {
1324
+ intlMessage: messages.cannotBeUndoneNote
1325
+ })]
1326
+ })]
1327
+ }), jsxs(Spacings.Inline, {
1328
+ scale: "m",
1329
+ justifyContent: "flex-end",
1330
+ children: [jsx(SecondaryButton, {
1331
+ "data-test-id": "confirmation-dialog-cancel",
1332
+ label: intl.formatMessage(sharedMessages.cancel),
1333
+ onClick: () => onClose({
1334
+ shouldDeleteImportContainer: true
1335
+ })
1336
+ }), jsx(PrimaryButton, {
1337
+ tone: "critical",
1338
+ "data-test-id": "confirmation-dialog-confirm",
1339
+ label: intl.formatMessage(sharedMessages.startBulkDelete),
1340
+ onClick: onStartImport
1341
+ })]
1342
+ })]
1343
+ })
1344
+ })
1345
+ });
1346
+ };
1347
+ function getBold$1(msg) {
1348
+ return jsx(Text.Body, {
1349
+ as: "span",
1350
+ isBold: true,
1351
+ children: msg
1352
+ }, crypto.randomUUID());
1353
+ }
1354
+
1355
+ function ownKeys$1(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1356
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$1(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$1(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
1357
+ function UploadPreviewModal() {
1358
+ const _useDeleteResourcesCo = useDeleteResourcesContext(),
1359
+ resourceType = _useDeleteResourcesCo.resourceType,
1360
+ state = _useDeleteResourcesCo.state,
1361
+ onClose = _useDeleteResourcesCo.onClose,
1362
+ actions = _useDeleteResourcesCo.actions;
1363
+ const intl = useIntl();
1364
+ return jsx(FormDialog, {
1365
+ size: 16,
1366
+ isOpen: true,
1367
+ title: intl.formatMessage(sharedMessages.deleteModalTitle),
1368
+ labelPrimary: intl.formatMessage(messages.continue),
1369
+ onSecondaryButtonClick: () => onClose({
1370
+ shouldDeleteImportContainer: true
1371
+ }),
1372
+ onPrimaryButtonClick: () => {
1373
+ actions.setCurrentStep('delete-confirmation');
1374
+ },
1375
+ onClose: () => onClose({
1376
+ shouldDeleteImportContainer: true
1377
+ }),
1378
+ children: jsxs(Spacings.Stack, {
1379
+ scale: "m",
1380
+ children: [jsx(Text.Body, {
1381
+ intlMessage: messages.heresAPreview
1382
+ }), jsx(Card, {
1383
+ insetScale: "xl",
1384
+ children: jsxs(Spacings.Inline, {
1385
+ scale: "m",
1386
+ alignItems: "center",
1387
+ children: [jsx(BinLinearIcon, {
1388
+ size: "40",
1389
+ color: "neutral60"
1390
+ }), jsx(Text.Body, {
1391
+ intlMessage: _objectSpread$1(_objectSpread$1({}, messages.resourcesToBeDeleted), {}, {
1392
+ values: {
1393
+ resourceType: intl.formatMessage(resourceTypeToMessage(resourceType)),
1394
+ resourceTypePlural: intl.formatMessage(resourceTypeToPluralMessage(resourceType)),
1395
+ count: intl.formatNumber(state.uploadFileResponse?.rowsCount ?? 0),
1396
+ b: getBold
1397
+ }
1398
+ })
1399
+ })]
1400
+ })
1401
+ })]
1402
+ })
1403
+ });
1404
+ }
1405
+ function getBold(msg) {
1406
+ return jsx(Text.Body, {
1407
+ as: "span",
1408
+ isBold: true,
1409
+ children: msg
1410
+ }, `bold-${msg}`);
1411
+ }
1412
+
1413
+ const steps = {
1414
+ upload: jsx(Upload, {}),
1415
+ uploading: jsx(Uploading, {}),
1416
+ 'upload-preview': jsx(UploadPreviewModal, {}),
1417
+ 'upload-error': jsx(UploadErrorsModal, {}),
1418
+ 'delete-confirmation': jsx(DeleteResourcesConfirmationModal, {})
1419
+ };
1420
+ const CurrentStep = () => {
1421
+ const _useDeleteResourcesCo = useDeleteResourcesContext(),
1422
+ state = _useDeleteResourcesCo.state;
1423
+ return steps[state.currentStep] || null;
1424
+ };
1425
+
1426
+ const getChunkImport = locale => {
1427
+ const intlLocale = mapLocaleToIntlLocale(locale);
1428
+ switch (intlLocale) {
1429
+ case 'de':
1430
+ return import('./de-e0280d32.esm.js');
1431
+ case 'es':
1432
+ return import('./es-332b4647.esm.js');
1433
+ case 'fr-FR':
1434
+ return import('./fr-FR-f2953298.esm.js');
1435
+ case 'ja':
1436
+ return import('./ja-73c088a7.esm.js');
1437
+ case 'pt-BR':
1438
+ return import('./pt-BR-46eadd76.esm.js');
1439
+ default:
1440
+ return import('./en-c8721699.esm.js');
1441
+ }
1442
+ };
1443
+ const loadMessages = async locale => {
1444
+ try {
1445
+ const chunkImport = await getChunkImport(locale);
1446
+ return parseChunkImport(chunkImport);
1447
+ } catch (error) {
1448
+ // eslint-disable-next-line no-console
1449
+ console.warn(`Something went wrong while loading the delete-resources-modal messages for ${locale}`, error);
1450
+ reportErrorToSentry(new Error(`Something went wrong while loading the delete-resources-modal messages for ${locale}`), {
1451
+ extra: error
1452
+ });
1453
+ return {};
1454
+ }
1455
+ };
1456
+
1457
+ const useAsyncIntlMessages = (locale, loader) => {
1458
+ const _useState = useState({
1459
+ isLoading: true,
1460
+ messages: undefined,
1461
+ error: undefined
1462
+ }),
1463
+ _useState2 = _slicedToArray(_useState, 2),
1464
+ state = _useState2[0],
1465
+ setState = _useState2[1];
1466
+ useEffect(() => {
1467
+ let _isUnmounting = false;
1468
+ async function load() {
1469
+ try {
1470
+ if (!_isUnmounting) {
1471
+ const messages = await loader(locale);
1472
+ setState({
1473
+ isLoading: false,
1474
+ messages
1475
+ });
1476
+ }
1477
+ } catch (error) {
1478
+ setState({
1479
+ isLoading: false,
1480
+ error
1481
+ });
1482
+ }
1483
+ }
1484
+ if (locale) load();
1485
+ return () => {
1486
+ _isUnmounting = true;
1487
+ };
1488
+ }, [locale, loader]);
1489
+ return state;
1490
+ };
1491
+
1492
+ function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1493
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
1494
+ const DeleteResourcesModal = props => {
1495
+ const _useApplicationContex = useApplicationContext(context => ({
1496
+ locale: context.user && context.user.locale
1497
+ })),
1498
+ locale = _useApplicationContex.locale;
1499
+ const messages = useAsyncIntlMessages(locale, loadMessages);
1500
+ if (!props.isOpen || messages.isLoading) return null;
1501
+ return jsx(IntlProvider, {
1502
+ locale: locale,
1503
+ messages: messages.messages,
1504
+ children: jsx(DeleteResourcesProvider, _objectSpread(_objectSpread({}, props), {}, {
1505
+ children: jsx(CurrentStep, {})
1506
+ }))
1507
+ });
1508
+ };
1509
+ DeleteResourcesModal.displayName = 'DeleteResourcesModal';
1510
+
1511
+ export { DeleteResourcesModal as default };