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

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