@vidispine/vdt-js 22.4.0-pre.9 → 23.1.0-pre.1

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.
package/dist/index.es.js CHANGED
@@ -5,30 +5,25 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
5
5
  import _typeof from '@babel/runtime/helpers/typeof';
6
6
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
7
7
  import _createClass from '@babel/runtime/helpers/createClass';
8
- import parseFileSize from 'filesize';
8
+ import { filesize } from 'filesize';
9
9
 
10
10
  var gcd = function gcd(a, b) {
11
11
  return b ? gcd(b, a % b) : a;
12
12
  };
13
-
14
13
  var parseAspectRatio = function parseAspectRatio(aspectRatio) {
15
14
  var _ref = aspectRatio || {},
16
- width = _ref.width,
17
- height = _ref.height;
18
-
15
+ width = _ref.width,
16
+ height = _ref.height;
19
17
  if (width === undefined || height === undefined) {
20
18
  return undefined;
21
19
  }
22
-
23
20
  var denominator = gcd(width, height);
24
21
  var widthRatio = width / denominator;
25
22
  var heightRatio = height / denominator;
26
-
27
23
  if (widthRatio > 21) {
28
24
  heightRatio = 1;
29
25
  widthRatio = (width / height).toFixed(2);
30
26
  }
31
-
32
27
  return [widthRatio, heightRatio].join(':');
33
28
  };
34
29
 
@@ -42,13 +37,13 @@ var parseAspectRatio = function parseAspectRatio(aspectRatio) {
42
37
  var parseKeyValuePairTypes = function parseKeyValuePairTypes(keyValuePairTypes) {
43
38
  return Object.fromEntries(keyValuePairTypes.map(function (_ref) {
44
39
  var key = _ref.key,
45
- value = _ref.value;
40
+ value = _ref.value;
46
41
  return [key, value];
47
42
  }));
48
43
  };
49
44
 
50
45
  /**
51
- * Object with all name of roles in VidiCore
46
+ * Const object with VidiCore role names
52
47
  *
53
48
  * @category Auth
54
49
  */
@@ -164,114 +159,96 @@ var ROLE_NAMES = {
164
159
  VXA_READ: '_vxa_read'
165
160
  };
166
161
 
167
- var SHARED_ATTRIBUTE_KEYS = ['uuid', 'user', 'timestamp', 'change', 'conflict', 'mode'];
168
- var SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS = ['name', 'id', 'referenced', 'data', 'inheritance'];
169
162
  /**
170
- * Array with all available metadata group attributes
163
+ * Array with all available VidiCore system/default field group names
171
164
  *
172
165
  * @category Metadata
173
166
  */
167
+ var SYSTEM_FIELDGROUPS = ['stl_subtitle', 'stl_tti', 'stl_gsi', 'mrk_marker', 'pho_validation', 'pho_resource', 'pho_error', 'facedetect_rect', 'facedetect_face', 'originalTrackFilename', 'stl_gsiHeader'];
174
168
 
175
- var GROUP_ATTRIBUTE_KEYS = [].concat(SHARED_ATTRIBUTE_KEYS, SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS, ['cycle', 'field', 'group']);
176
169
  /**
177
- * Array with all available metadata group attributes
170
+ * Array with all available VidiCore system/default field names (including transient)
178
171
  *
179
172
  * @category Metadata
180
173
  */
174
+ var SYSTEM_FIELDS = ['title', 'user', 'shapeTag', 'representativeThumbnail', 'representativeThumbnailNoAuth', 'representativeItems', 'itemId', 'collectionId', 'mediaType', 'mimeType', 'created', 'startTimeCode', 'startSeconds', 'fieldValidationError', 'schemaValidationError', 'originalFilename', 'originalUri', 'originalAudioCodec', 'originalVideoCodec', 'originalHeight', 'originalWidth', 'originalFormat', 'durationSeconds', 'durationTimeCode', 'solr-index', '__user', '__collection', '__collection_size', '__ancestor_collection', '__ancestor_collection_size', '__shape', '__shape_size', '__shape_last_added', '__placeholder_shape_size', '__version', '__version_count', '__storage', '__storage_size', '__shapetag_{tag}_hash_{hash}', '__storage_{tag}', '__storage_{tag}_size', '__storagegroup', '__storagegroup_size', '__sequence', '__sequence_size', '__metadata_last_modified', '__external_id', '__deletion_lock_id', '__deletion_lock_expiry', '__child_collection', '__child_collection_size', '__parent_collection', '__parent_collection_size', '__items_size', 'stl_text', 'stl_justification', 'stl_xrelative', 'stl_yrelative', 'stl_vertical', 'stl_verticalbase', 'stl_horizontalbase', 'stl_sizerelative', 'stl_color', 'stl_outline', 'stl_outlinecolor', 'stl_outlinesize', 'stl_font', 'stl_service', 'stl_tti', 'stl_gsi', 'cct', 'tcd', 'tcf', 'oet', 'cd', 'mnc', 'cpn', 'dfc', 'tcp', 'tcs', 'tet', 'tnb', 'tnd', 'en', 'co', 'tng', 'rd', 'mnr', 'dsc', 'opt', 'lc', 'tpt', 'tn', 'slr', 'tns', 'rn', 'pub', 'dsn', 'ecd', 'mrk_zerolength', 'mrk_text', 'mrk_color', 'pho_resource_name', 'pho_error_level', 'pho_error_code', 'pho_error_description', 'facedetect_rect_width', 'facedetect_rect_height', 'facedetect_rect_y', 'facedetect_rect_x', 'facedetect_pid', 'facedetect_rect', 'trackId', 'eidr_actor', 'eidr_alternateId', 'eidr_countryOfOrigin', 'eidr_director', 'eidr_id', 'eidr_referentType', 'eidr_releaseDate', 'eidr_resourceName', 'eidr_status', 'eidr_sync', 'ttml_div', 'ttml_root', 'vxa_collection_id', 'vxaId', 'vxaLocalPath', 'tco', 'cs', 'ebn', 'tf', 'cf', 'sgn', 'tci', 'jc', 'vp', 'sn'];
175
+
176
+ var SHARED_ATTRIBUTE_KEYS = ['uuid', 'user', 'timestamp', 'change', 'conflict', 'mode'];
177
+ var SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS = ['name', 'id', 'referenced', 'data', 'inheritance'];
181
178
 
182
- var FIELD_ATTRIBUTE_KEYS = [].concat(SHARED_ATTRIBUTE_KEYS, SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS, ['value', 'reference', 'type', 'track']);
183
179
  /**
184
180
  * Array with all available metadata field value attributes
185
181
  *
186
182
  * @category Metadata
187
183
  */
188
-
189
- var FIELD_VALUE_ATTRIBUTE_KEYS = [].concat(SHARED_ATTRIBUTE_KEYS, ['value', 'lang']);
184
+ var FIELD_VALUE_ATTRIBUTE_KEYS = [].concat(_toConsumableArray(SHARED_ATTRIBUTE_KEYS), ['value', 'lang']);
190
185
 
191
186
  /**
192
- * Array with all available VidiCore system/default field group names
187
+ * Array with all available metadata field attributes
193
188
  *
194
189
  * @category Metadata
195
190
  */
196
- var SYSTEM_FIELDGROUPS = ['stl_subtitle', 'stl_tti', 'stl_gsi', 'mrk_marker', 'pho_validation', 'pho_resource', 'pho_error', 'facedetect_rect', 'facedetect_face', 'originalTrackFilename', 'stl_gsiHeader'];
191
+ var FIELD_ATTRIBUTE_KEYS = [].concat(_toConsumableArray(SHARED_ATTRIBUTE_KEYS), _toConsumableArray(SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS), ['value', 'reference', 'type', 'track']);
192
+
197
193
  /**
198
- * Array with all available VidiCore system/default field group names
194
+ * Array with all available metadata group attributes
199
195
  *
200
196
  * @category Metadata
201
197
  */
202
-
203
- var SYSTEM_FIELDS = ['title', 'user', 'shapeTag', 'representativeThumbnail', 'representativeThumbnailNoAuth', 'representativeItems', 'itemId', 'collectionId', 'mediaType', 'mimeType', 'created', 'startTimeCode', 'startSeconds', 'fieldValidationError', 'schemaValidationError', 'originalFilename', 'originalUri', 'originalAudioCodec', 'originalVideoCodec', 'originalHeight', 'originalWidth', 'originalFormat', 'durationSeconds', 'durationTimeCode', 'solr-index', '__user', '__collection', '__collection_size', '__ancestor_collection', '__ancestor_collection_size', '__shape', '__shape_size', '__shape_last_added', '__placeholder_shape_size', '__version', '__version_count', '__storage', '__storage_size', '__shapetag_{tag}_hash_{hash}', '__storage_{tag}', '__storage_{tag}_size', '__storagegroup', '__storagegroup_size', '__sequence', '__sequence_size', '__metadata_last_modified', '__external_id', '__deletion_lock_id', '__deletion_lock_expiry', '__child_collection', '__child_collection_size', '__parent_collection', '__parent_collection_size', '__items_size', 'stl_text', 'stl_justification', 'stl_xrelative', 'stl_yrelative', 'stl_vertical', 'stl_verticalbase', 'stl_horizontalbase', 'stl_sizerelative', 'stl_color', 'stl_outline', 'stl_outlinecolor', 'stl_outlinesize', 'stl_font', 'stl_service', 'stl_tti', 'stl_gsi', 'cct', 'tcd', 'tcf', 'oet', 'cd', 'mnc', 'cpn', 'dfc', 'tcp', 'tcs', 'tet', 'tnb', 'tnd', 'en', 'co', 'tng', 'rd', 'mnr', 'dsc', 'opt', 'lc', 'tpt', 'tn', 'slr', 'tns', 'rn', 'pub', 'dsn', 'ecd', 'mrk_zerolength', 'mrk_text', 'mrk_color', 'pho_resource_name', 'pho_error_level', 'pho_error_code', 'pho_error_description', 'facedetect_rect_width', 'facedetect_rect_height', 'facedetect_rect_y', 'facedetect_rect_x', 'facedetect_pid', 'facedetect_rect', 'trackId', 'eidr_actor', 'eidr_alternateId', 'eidr_countryOfOrigin', 'eidr_director', 'eidr_id', 'eidr_referentType', 'eidr_releaseDate', 'eidr_resourceName', 'eidr_status', 'eidr_sync', 'ttml_div', 'ttml_root', 'vxa_collection_id', 'vxaId', 'vxaLocalPath', 'tco', 'cs', 'ebn', 'tf', 'cf', 'sgn', 'tci', 'jc', 'vp', 'sn'];
198
+ var GROUP_ATTRIBUTE_KEYS = [].concat(_toConsumableArray(SHARED_ATTRIBUTE_KEYS), _toConsumableArray(SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS), ['cycle', 'field', 'group']);
204
199
 
205
200
  var _excluded$e = ["value"],
206
- _excluded2$2 = ["start", "end", "base"];
207
-
201
+ _excluded2$2 = ["start", "end", "base"];
208
202
  function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
209
-
210
203
  function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
211
-
212
204
  var isValueObject = function isValueObject(o) {
213
205
  return Object.prototype.toString.call(o) === '[object Object]' && o.value !== undefined;
214
206
  };
215
-
216
207
  var isFieldType = function isFieldType(v) {
217
208
  return ['string', 'boolean', 'number'].includes(_typeof(v));
218
209
  };
219
-
220
210
  var isFieldObject = function isFieldObject(o) {
221
211
  return isValueObject(o) && ((o === null || o === void 0 ? void 0 : o.value) === null || isValueObject(o.value) || isFieldType(o.value));
222
212
  };
223
-
224
213
  var isObject = function isObject(o) {
225
214
  return Object.prototype.toString.call(o) === '[object Object]';
226
215
  };
227
-
228
216
  var isDate = function isDate(o) {
229
217
  return Object.prototype.toString.call(o) === '[object Date]';
230
218
  };
231
-
232
219
  var isField = function isField(value) {
233
220
  if (value === null) {
234
221
  return true;
235
222
  }
236
-
237
223
  if (Array.isArray(value)) {
238
224
  return value.some(isField);
239
225
  }
240
-
241
226
  return isFieldType(value) || isFieldObject(value) || isDate(value);
242
227
  };
243
-
244
228
  var isGroup = function isGroup(value) {
245
229
  var isGroupObject = function isGroupObject(v) {
246
230
  return isObject(v) && v.value === undefined && !!Object.entries(value);
247
231
  };
248
-
249
232
  if (Array.isArray(value)) {
250
233
  return value.every(isGroup);
251
234
  }
252
-
253
235
  return isGroupObject(value);
254
236
  };
255
-
256
237
  var tryPluralize = function tryPluralize(str, arr) {
257
238
  return str + (arr.length > 1 ? 's' : '');
258
239
  };
259
-
260
240
  var ensureKeysAreValid = function ensureKeysAreValid(keysToCheck, keysToMatch) {
261
241
  var unsupportedKeys = keysToCheck.filter(function (k) {
262
242
  return !keysToMatch.includes(k);
263
243
  });
264
-
265
244
  if (unsupportedKeys.length) {
266
245
  throw Error("Unsupported ".concat(tryPluralize('key', unsupportedKeys), " (").concat(unsupportedKeys.join(', '), ")"));
267
246
  }
268
247
  };
269
-
270
248
  var parseValue$1 = function parseValue(value) {
271
249
  if (Array.isArray(value)) {
272
250
  throw Error('Invalid value inside value object, cannot be array');
273
251
  }
274
-
275
252
  if ([undefined, null].includes(value)) return {};
276
253
  if (isDate(value)) return {
277
254
  value: value.toISOString()
@@ -280,70 +257,55 @@ var parseValue$1 = function parseValue(value) {
280
257
  value: value.toString()
281
258
  };
282
259
  };
283
-
284
260
  var parseValueObject = function parseValueObject(valueObject) {
285
261
  ensureKeysAreValid(Object.keys(valueObject), FIELD_VALUE_ATTRIBUTE_KEYS);
286
-
287
262
  if (Object.keys(valueObject).length === 0) {
288
263
  throw Error('Invalid value object, cannot be empty object');
289
264
  }
290
-
291
265
  if (typeof (valueObject === null || valueObject === void 0 ? void 0 : valueObject.value) === 'string') {
292
266
  return valueObject;
293
267
  }
294
-
295
268
  var parsedValue = parseValue$1(valueObject === null || valueObject === void 0 ? void 0 : valueObject.value);
296
269
  return _objectSpread$i(_objectSpread$i({}, valueObject), parsedValue !== undefined ? parsedValue : {});
297
270
  };
298
-
299
271
  var parseFieldValue = function parseFieldValue(value) {
300
272
  if ([undefined, null].includes(value)) return undefined;
301
273
  if (Array.isArray(value)) return value.flatMap(parseFieldValue);
302
274
  if (isValueObject(value)) return parseValueObject(value);
303
275
  return parseValue$1(value);
304
276
  };
305
-
306
277
  var parseFieldObject = function parseFieldObject(fieldObject) {
307
278
  ensureKeysAreValid(Object.keys(fieldObject), FIELD_ATTRIBUTE_KEYS);
308
279
  var parsedFieldValue = parseFieldValue(fieldObject === null || fieldObject === void 0 ? void 0 : fieldObject.value);
309
-
310
280
  if (parsedFieldValue === undefined) {
311
281
  fieldObject.value;
312
- var fieldObjectWithoutValue = _objectWithoutProperties(fieldObject, _excluded$e);
313
-
282
+ var fieldObjectWithoutValue = _objectWithoutProperties(fieldObject, _excluded$e);
314
283
  return fieldObjectWithoutValue;
315
284
  }
316
-
317
285
  return _objectSpread$i(_objectSpread$i({}, fieldObject), {}, {
318
286
  value: _toConsumableArray(Array.isArray(parsedFieldValue) ? parsedFieldValue : [parsedFieldValue])
319
287
  });
320
288
  };
321
-
322
289
  var parseField$1 = function parseField(field) {
323
290
  if (isFieldObject(field)) {
324
291
  return parseFieldObject(field);
325
292
  }
326
-
327
293
  var parsedFieldValue = parseFieldValue(field);
328
-
329
294
  if (parsedFieldValue === undefined) {
330
295
  return undefined;
331
296
  }
332
-
333
297
  return {
334
298
  value: _toConsumableArray(Array.isArray(parsedFieldValue) ? parsedFieldValue : [parsedFieldValue])
335
299
  };
336
300
  };
337
-
338
301
  var parseGroupsAndFields = function parseGroupsAndFields(groupOrField) {
339
302
  var group = [];
340
303
  var field = [];
341
304
  var groupAttributes = {};
342
305
  Object.entries(groupOrField || {}).forEach(function (_ref) {
343
306
  var _ref2 = _slicedToArray(_ref, 2),
344
- name = _ref2[0],
345
- value = _ref2[1];
346
-
307
+ name = _ref2[0],
308
+ value = _ref2[1];
347
309
  if (GROUP_ATTRIBUTE_KEYS.includes(name)) {
348
310
  groupAttributes = _objectSpread$i(_objectSpread$i({}, groupAttributes), {}, _defineProperty({}, name, value));
349
311
  } else if (isField(value)) {
@@ -370,20 +332,17 @@ var parseGroupsAndFields = function parseGroupsAndFields(groupOrField) {
370
332
  field: field
371
333
  } : {});
372
334
  };
373
-
374
335
  var parseTimespan$1 = function parseTimespan(timespan) {
375
336
  var _timespan$start = timespan.start,
376
- start = _timespan$start === void 0 ? '-INF' : _timespan$start,
377
- _timespan$end = timespan.end,
378
- end = _timespan$end === void 0 ? '+INF' : _timespan$end,
379
- _timespan$base = timespan.base,
380
- base = _timespan$base === void 0 ? undefined : _timespan$base,
381
- groupsAndFields = _objectWithoutProperties(timespan, _excluded2$2);
382
-
337
+ start = _timespan$start === void 0 ? '-INF' : _timespan$start,
338
+ _timespan$end = timespan.end,
339
+ end = _timespan$end === void 0 ? '+INF' : _timespan$end,
340
+ _timespan$base = timespan.base,
341
+ base = _timespan$base === void 0 ? undefined : _timespan$base,
342
+ groupsAndFields = _objectWithoutProperties(timespan, _excluded2$2);
383
343
  var _parseGroupsAndFields = parseGroupsAndFields(groupsAndFields),
384
- group = _parseGroupsAndFields.group,
385
- field = _parseGroupsAndFields.field;
386
-
344
+ group = _parseGroupsAndFields.group,
345
+ field = _parseGroupsAndFields.field;
387
346
  return _objectSpread$i(_objectSpread$i(_objectSpread$i({}, group ? {
388
347
  group: group
389
348
  } : {}), field ? {
@@ -395,7 +354,6 @@ var parseTimespan$1 = function parseTimespan(timespan) {
395
354
  base: base
396
355
  } : {});
397
356
  };
398
-
399
357
  /**
400
358
  * Create a VidiCore metadata object from a more dense/simplified structure
401
359
  *
@@ -427,23 +385,18 @@ var createMetadataType = function createMetadataType(input) {
427
385
  */
428
386
  var sortTimespanList = function sortTimespanList(timespan1, timespan2) {
429
387
  var _timespan1$start, _timespan2$start;
430
-
431
388
  var _ref = (timespan1 === null || timespan1 === void 0 ? void 0 : (_timespan1$start = timespan1.start) === null || _timespan1$start === void 0 ? void 0 : _timespan1$start.split('@')) || [],
432
- _ref2 = _slicedToArray(_ref, 1),
433
- firstStart = _ref2[0];
434
-
389
+ _ref2 = _slicedToArray(_ref, 1),
390
+ firstStart = _ref2[0];
435
391
  var _ref3 = (timespan2 === null || timespan2 === void 0 ? void 0 : (_timespan2$start = timespan2.start) === null || _timespan2$start === void 0 ? void 0 : _timespan2$start.split('@')) || [],
436
- _ref4 = _slicedToArray(_ref3, 1),
437
- secondStart = _ref4[0];
438
-
392
+ _ref4 = _slicedToArray(_ref3, 1),
393
+ secondStart = _ref4[0];
439
394
  if (Number(firstStart) < Number(secondStart)) {
440
395
  return -1;
441
396
  }
442
-
443
397
  if (Number(firstStart) > Number(secondStart)) {
444
398
  return 1;
445
399
  }
446
-
447
400
  return 0;
448
401
  };
449
402
 
@@ -455,10 +408,10 @@ var sortTimespanList = function sortTimespanList(timespan1, timespan2) {
455
408
  * @param v value to return as array
456
409
  * @returns input value wrapped as array
457
410
  */
458
-
459
411
  var asArray = function asArray(v) {
460
412
  return Array.isArray(v) ? v : v && [v] || [];
461
413
  };
414
+
462
415
  /**
463
416
  * @private
464
417
  *
@@ -467,10 +420,10 @@ var asArray = function asArray(v) {
467
420
  * @param v value to return as array
468
421
  * @returns input value wrapped as array
469
422
  */
470
-
471
423
  var asSingle = function asSingle(v) {
472
424
  return Array.isArray(v) ? v.pop() : v;
473
425
  };
426
+
474
427
  /**
475
428
  * @private
476
429
  * Check if array is string array (+ type guard)
@@ -478,7 +431,6 @@ var asSingle = function asSingle(v) {
478
431
  * @param arr Array to check if string array
479
432
  * @returns true if string array
480
433
  */
481
-
482
434
  var isStringArray = function isStringArray(arr) {
483
435
  return (arr === null || arr === void 0 ? void 0 : arr.every(function (v) {
484
436
  return typeof v === 'string';
@@ -486,14 +438,12 @@ var isStringArray = function isStringArray(arr) {
486
438
  };
487
439
 
488
440
  var _excluded$d = ["value"];
489
-
490
441
  function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
491
-
492
442
  function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$h(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
493
-
494
443
  var defaultOptions$a = {
495
444
  includeValueAttributes: false
496
445
  };
446
+
497
447
  /**
498
448
  * @internal
499
449
  * Parse the value object inside a field value list
@@ -502,22 +452,17 @@ var defaultOptions$a = {
502
452
  * @param options For how to parse the value object
503
453
  * @returns The parsed value
504
454
  */
505
-
506
455
  function parseValue(value, options) {
507
456
  var _defaultOptions = _objectSpread$h(_objectSpread$h({}, defaultOptions$a), options || {}),
508
- includeValueAttributes = _defaultOptions.includeValueAttributes;
509
-
457
+ includeValueAttributes = _defaultOptions.includeValueAttributes;
510
458
  if (includeValueAttributes === false) {
511
459
  return value === null || value === void 0 ? void 0 : value.value;
512
460
  }
513
-
514
461
  var stringValue = value.value,
515
- attributes = _objectWithoutProperties(value, _excluded$d);
516
-
462
+ attributes = _objectWithoutProperties(value, _excluded$d);
517
463
  var valueAttributes = includeValueAttributes === true && attributes || Array.isArray(includeValueAttributes) && Object.fromEntries(Object.entries(attributes).filter(function (_ref) {
518
464
  var _ref2 = _slicedToArray(_ref, 1),
519
- key = _ref2[0];
520
-
465
+ key = _ref2[0];
521
466
  return includeValueAttributes.includes(key);
522
467
  })) || {};
523
468
  return _objectSpread$h(_objectSpread$h({}, valueAttributes), {}, {
@@ -526,14 +471,13 @@ function parseValue(value, options) {
526
471
  }
527
472
 
528
473
  var _excluded$c = ["joinValue", "arrayOnSingleValue"];
529
-
530
474
  function ownKeys$g(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
531
-
532
475
  function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$g(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
533
476
  var defaultOptions$9 = _objectSpread$g(_objectSpread$g({}, defaultOptions$a), {}, {
534
477
  joinValue: undefined,
535
478
  arrayOnSingleValue: true
536
479
  });
480
+
537
481
  /**
538
482
  * @internal
539
483
  *
@@ -541,13 +485,11 @@ var defaultOptions$9 = _objectSpread$g(_objectSpread$g({}, defaultOptions$a), {}
541
485
  * @param options
542
486
  * @returns
543
487
  */
544
-
545
488
  function parseValueList(valueList, options) {
546
489
  var _defaultOptions = _objectSpread$g(_objectSpread$g({}, defaultOptions$9), options || {}),
547
- joinValue = _defaultOptions.joinValue,
548
- arrayOnSingleValue = _defaultOptions.arrayOnSingleValue,
549
- parseValueOptions = _objectWithoutProperties(_defaultOptions, _excluded$c);
550
-
490
+ joinValue = _defaultOptions.joinValue,
491
+ arrayOnSingleValue = _defaultOptions.arrayOnSingleValue,
492
+ parseValueOptions = _objectWithoutProperties(_defaultOptions, _excluded$c);
551
493
  var parsedValueList = valueList === null || valueList === void 0 ? void 0 : valueList.map(function (v) {
552
494
  return parseValue(v, parseValueOptions);
553
495
  });
@@ -557,14 +499,13 @@ function parseValueList(valueList, options) {
557
499
  }
558
500
 
559
501
  var _excluded$b = ["includeFieldAttributes"],
560
- _excluded2$1 = ["value"];
561
-
502
+ _excluded2$1 = ["value"];
562
503
  function ownKeys$f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
563
-
564
504
  function _objectSpread$f(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$f(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
565
505
  var defaultOptions$8 = _objectSpread$f({
566
506
  includeFieldAttributes: false
567
507
  }, defaultOptions$9);
508
+
568
509
  /**
569
510
  * @internal
570
511
  *
@@ -572,20 +513,16 @@ var defaultOptions$8 = _objectSpread$f({
572
513
  * @param options
573
514
  * @returns
574
515
  */
575
-
576
516
  var parseField = function parseField(field, options) {
577
517
  var _defaultOptions = _objectSpread$f(_objectSpread$f({}, defaultOptions$8), options || {}),
578
- includeFieldAttributes = _defaultOptions.includeFieldAttributes,
579
- parseValueListOptions = _objectWithoutProperties(_defaultOptions, _excluded$b);
580
-
518
+ includeFieldAttributes = _defaultOptions.includeFieldAttributes,
519
+ parseValueListOptions = _objectWithoutProperties(_defaultOptions, _excluded$b);
581
520
  var value = field.value,
582
- attributes = _objectWithoutProperties(field, _excluded2$1);
583
-
521
+ attributes = _objectWithoutProperties(field, _excluded2$1);
584
522
  var parsedValueList = parseValueList(value, parseValueListOptions);
585
523
  var fieldAttributes = includeFieldAttributes === true && attributes || Array.isArray(includeFieldAttributes) && Object.fromEntries(Object.entries(attributes).filter(function (_ref) {
586
524
  var _ref2 = _slicedToArray(_ref, 1),
587
- key = _ref2[0];
588
-
525
+ key = _ref2[0];
589
526
  return includeFieldAttributes.includes(key);
590
527
  })) || {};
591
528
  return includeFieldAttributes ? _objectSpread$f(_objectSpread$f({}, fieldAttributes), {}, {
@@ -594,25 +531,22 @@ var parseField = function parseField(field, options) {
594
531
  };
595
532
 
596
533
  function ownKeys$e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
597
-
598
534
  function _objectSpread$e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$e(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
599
535
  var defaultOptions$7 = _objectSpread$e(_objectSpread$e({}, defaultOptions$8), {}, {
600
536
  fieldAsList: false,
601
537
  arrayOnSingleField: false,
602
538
  overrideField: undefined
603
539
  });
604
-
605
540
  /**
606
541
  * Parse a metadata field list according to selected options
607
542
  *
608
543
  * @remarks
609
- * Duplicate fields (same field name in the same field list) are usually not the data model we'd advise using.
610
- * Since VidiCore supports multiple values in one fields, it's typically advised to store them as such.
611
- * But, given duplicated fields when parsing it will:
612
- * - with default options, merge duplicated field values to one field value array
613
- * - with `fieldAsList` enabled, separate fields in the list/array (as usual, even if not duplicate)
614
- * - with `includeFieldAttributes` enabled, return an array of field objects
615
- * - with `overrideField` enabled - Override so it returns the latest "duplicated" field it parses
544
+ * When parsing duplicate fields (same field name in the same field list) it will:
545
+ * - with default options: combine field values to one array within the same field name key
546
+ * - with `joinValue` enabled: join values within each field (returns array with string for each field value)
547
+ * - with `fieldAsList` enabled: separate fields in the list/array (as usual, even if not duplicate)
548
+ * - with `includeFieldAttributes` enabled: return an array of field objects
549
+ * - with `overrideField` enabled: return the latest duplicated field it parses
616
550
  *
617
551
  * @param fieldList Field list to parse
618
552
  * @param [options=defaultOptions] Options for how to parse the field list
@@ -622,10 +556,9 @@ var defaultOptions$7 = _objectSpread$e(_objectSpread$e({}, defaultOptions$8), {}
622
556
  */
623
557
  var parseFieldList = function parseFieldList(fieldList, options) {
624
558
  var parseFieldListOptions = _objectSpread$e(_objectSpread$e({}, defaultOptions$7), options || {});
625
-
626
559
  var fieldAsList = parseFieldListOptions.fieldAsList,
627
- arrayOnSingleField = parseFieldListOptions.arrayOnSingleField,
628
- overrideField = parseFieldListOptions.overrideField;
560
+ arrayOnSingleField = parseFieldListOptions.arrayOnSingleField,
561
+ overrideField = parseFieldListOptions.overrideField;
629
562
  var shouldOverride = overrideField === true && fieldAsList === false;
630
563
  var output = {};
631
564
  fieldList === null || fieldList === void 0 ? void 0 : fieldList.forEach(function (field) {
@@ -639,18 +572,14 @@ var parseFieldList = function parseFieldList(fieldList, options) {
639
572
  };
640
573
 
641
574
  var _excluded$a = ["field", "group"];
642
-
643
575
  function ownKeys$d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
644
-
645
576
  function _objectSpread$d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$d(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
646
-
647
577
  var defaultParseGroupOptions = _objectSpread$d(_objectSpread$d({}, defaultOptions$7), {}, {
648
578
  includeGroupAttributes: false,
649
579
  groupAsList: false,
650
580
  arrayOnSingleGroup: false,
651
581
  overrideGroup: undefined
652
582
  });
653
-
654
583
  /**
655
584
  * @internal
656
585
  *
@@ -662,26 +591,21 @@ var defaultParseGroupOptions = _objectSpread$d(_objectSpread$d({}, defaultOption
662
591
  */
663
592
  var parseGroup = function parseGroup(group, options) {
664
593
  var parseGroupOptions = _objectSpread$d(_objectSpread$d({}, defaultParseGroupOptions), options || {});
665
-
666
594
  var includeGroupAttributes = parseGroupOptions.includeGroupAttributes;
667
595
  var parseFieldListOptions = Object.fromEntries(Object.entries(parseGroupOptions).filter(function (_ref) {
668
596
  var _ref2 = _slicedToArray(_ref, 1),
669
- key = _ref2[0];
670
-
597
+ key = _ref2[0];
671
598
  return Object.keys(defaultOptions$7).includes(key);
672
599
  }));
673
-
674
600
  var fieldList = group.field,
675
- groupList = group.group,
676
- attributes = _objectWithoutProperties(group, _excluded$a);
677
-
678
- var parsedFieldList = fieldList && parseFieldList(fieldList, parseFieldListOptions); // eslint-disable-next-line @typescript-eslint/no-use-before-define
679
-
601
+ groupList = group.group,
602
+ attributes = _objectWithoutProperties(group, _excluded$a);
603
+ var parsedFieldList = fieldList && parseFieldList(fieldList, parseFieldListOptions);
604
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
680
605
  var parsedGroupList = groupList && parseGroupList(groupList, parseGroupOptions);
681
606
  var groupAttributes = includeGroupAttributes === true && attributes || Array.isArray(includeGroupAttributes) && Object.fromEntries(Object.entries(attributes).filter(function (_ref3) {
682
607
  var _ref4 = _slicedToArray(_ref3, 1),
683
- key = _ref4[0];
684
-
608
+ key = _ref4[0];
685
609
  return includeGroupAttributes.includes(key);
686
610
  })) || {};
687
611
  return _objectSpread$d(_objectSpread$d(_objectSpread$d({}, groupAttributes), parseFieldListOptions !== null && parseFieldListOptions !== void 0 && parseFieldListOptions.fieldAsList ? parsedFieldList && {
@@ -690,16 +614,16 @@ var parseGroup = function parseGroup(group, options) {
690
614
  group: parsedGroupList
691
615
  } || {} : parsedGroupList);
692
616
  };
693
-
694
617
  var defaultOptions$6 = defaultParseGroupOptions;
618
+
695
619
  /**
696
620
  * Parse a metadata group list according to selected options
697
621
  *
698
622
  * @remarks
699
- * Parsing duplicate groups (with identical name) in the same group list will return:
700
- * - with default options, an array of group objects
701
- * - with `groupAsList` enabled, separate group objects in the list/array (as usual, even if not duplicate)
702
- * - with `overrideGroup` enabled, return the latest duplicated group it parses
623
+ * Parsing duplicate groups (same group name in the same group list) it will:
624
+ * - with default options: combine group objects to one array within the same group name key
625
+ * - with `groupAsList` enabled: return separate group objects in a list/array (as usual, even if not duplicate)
626
+ * - with `overrideGroup` enabled: return the latest duplicated group it parses
703
627
  *
704
628
  * @param groupList Group list to parse
705
629
  * @param options options for how to parse list
@@ -707,13 +631,11 @@ var defaultOptions$6 = defaultParseGroupOptions;
707
631
  *
708
632
  * @category Metadata
709
633
  */
710
-
711
634
  var parseGroupList = function parseGroupList(groupList, options) {
712
635
  var parseGroupOptions = _objectSpread$d(_objectSpread$d({}, defaultOptions$6), options || {});
713
-
714
636
  var groupAsList = parseGroupOptions.groupAsList,
715
- arrayOnSingleGroup = parseGroupOptions.arrayOnSingleGroup,
716
- overrideGroup = parseGroupOptions.overrideGroup;
637
+ arrayOnSingleGroup = parseGroupOptions.arrayOnSingleGroup,
638
+ overrideGroup = parseGroupOptions.overrideGroup;
717
639
  var shouldOverride = overrideGroup === true && groupAsList === false;
718
640
  var output = {};
719
641
  groupList === null || groupList === void 0 ? void 0 : groupList.forEach(function (group) {
@@ -723,18 +645,14 @@ var parseGroupList = function parseGroupList(groupList, options) {
723
645
  var existingParsedGroups = output[name];
724
646
  if (!existingParsedGroups) output[name] = parsedGroupOutput;else if (shouldOverride) output[name] = parsedGroup;else output[name] = [asArray(existingParsedGroups), asArray(parsedGroup)].flat();
725
647
  });
726
-
727
648
  if (groupAsList) {
728
649
  return Object.values(output).flat();
729
650
  }
730
-
731
651
  return output;
732
652
  };
733
653
 
734
654
  var _excluded$9 = ["field", "group"];
735
-
736
655
  function ownKeys$c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
737
-
738
656
  function _objectSpread$c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$c(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
739
657
  var defaultOptions$5 = _objectSpread$c(_objectSpread$c({}, defaultOptions$6), {}, {
740
658
  includeTimespanAttributes: false,
@@ -744,6 +662,7 @@ var defaultOptions$5 = _objectSpread$c(_objectSpread$c({}, defaultOptions$6), {}
744
662
  arrayOnSingleGroup: undefined,
745
663
  arrayOnSingleField: undefined
746
664
  });
665
+
747
666
  /**
748
667
  *
749
668
  * Parses timespan according to specified options
@@ -759,68 +678,55 @@ var defaultOptions$5 = _objectSpread$c(_objectSpread$c({}, defaultOptions$6), {}
759
678
  *
760
679
  * @category Metadata
761
680
  */
762
-
763
681
  var parseTimespan = function parseTimespan(timespan, options) {
764
682
  var parseTimespanOptions = _objectSpread$c(_objectSpread$c({}, defaultOptions$5), options || {});
765
-
766
683
  var includeTimespanAttributes = parseTimespanOptions.includeTimespanAttributes,
767
- arrayOnSingle = parseTimespanOptions.arrayOnSingle,
768
- flat = parseTimespanOptions.flat;
684
+ arrayOnSingle = parseTimespanOptions.arrayOnSingle,
685
+ flat = parseTimespanOptions.flat;
769
686
  var parseGroupListOptions = Object.fromEntries(Object.entries(options).map(function (_ref) {
770
687
  var _ref2 = _slicedToArray(_ref, 2),
771
- key = _ref2[0],
772
- value = _ref2[1];
773
-
688
+ key = _ref2[0],
689
+ value = _ref2[1];
774
690
  if (Object.keys(defaultOptions$6).includes(key)) {
775
691
  if (['arrayOnSingleGroup', 'arrayOnSingleField', 'arrayOnSingleValue'].includes(key) && (value !== undefined ? value : arrayOnSingle === true)) {
776
692
  return [key, true];
777
693
  }
778
-
779
694
  if (['overrideGroup', 'overrideField'].includes(key) && (value !== undefined ? value : flat === true)) {
780
695
  return [key, true];
781
696
  }
782
-
783
697
  return [key, value];
784
698
  }
785
-
786
699
  return undefined;
787
700
  }).filter(function (e) {
788
701
  return !!e;
789
702
  }));
790
703
  var parseFieldListOptions = Object.fromEntries(Object.entries(options).map(function (_ref3) {
791
704
  var _ref4 = _slicedToArray(_ref3, 2),
792
- key = _ref4[0],
793
- value = _ref4[1];
794
-
705
+ key = _ref4[0],
706
+ value = _ref4[1];
795
707
  if (Object.keys(defaultOptions$7).includes(key)) {
796
708
  if (['arrayOnSingleField', 'arrayOnSingleValue'].includes(key) && (value !== undefined ? value : arrayOnSingle === true)) {
797
709
  return [key, true];
798
710
  }
799
-
800
711
  if (['overrideField'].includes(key) && (value !== undefined ? value : flat === true)) {
801
712
  return [key, true];
802
713
  }
803
-
804
714
  return [key, value];
805
715
  }
806
-
807
716
  return undefined;
808
717
  }).filter(function (e) {
809
718
  return !!e;
810
719
  }));
811
-
812
720
  var _ref5 = timespan || {},
813
- fieldList = _ref5.field,
814
- groupList = _ref5.group,
815
- attributes = _objectWithoutProperties(_ref5, _excluded$9);
816
-
817
- var parsedFieldList = fieldList && parseFieldList(fieldList, parseFieldListOptions); // eslint-disable-next-line @typescript-eslint/no-use-before-define
818
-
721
+ fieldList = _ref5.field,
722
+ groupList = _ref5.group,
723
+ attributes = _objectWithoutProperties(_ref5, _excluded$9);
724
+ var parsedFieldList = fieldList && parseFieldList(fieldList, parseFieldListOptions);
725
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
819
726
  var parsedGroupList = groupList && parseGroupList(groupList, parseGroupListOptions);
820
727
  var timespanAttributes = includeTimespanAttributes === true && attributes || Array.isArray(includeTimespanAttributes) && Object.fromEntries(Object.entries(attributes).filter(function (_ref6) {
821
728
  var _ref7 = _slicedToArray(_ref6, 1),
822
- key = _ref7[0];
823
-
729
+ key = _ref7[0];
824
730
  return includeTimespanAttributes.includes(key);
825
731
  })) || {};
826
732
  return _objectSpread$c(_objectSpread$c(_objectSpread$c({}, timespanAttributes), parseFieldListOptions !== null && parseFieldListOptions !== void 0 && parseFieldListOptions.fieldAsList ? {
@@ -831,9 +737,7 @@ var parseTimespan = function parseTimespan(timespan, options) {
831
737
  };
832
738
 
833
739
  var _excluded$8 = ["timespanAsList", "joinTimespan", "sortTimespan", "flat", "flatTimespan"];
834
-
835
740
  function ownKeys$b(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
836
-
837
741
  function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$b(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
838
742
  var defaultOptions$4 = _objectSpread$b(_objectSpread$b({}, defaultOptions$5), {}, {
839
743
  timespanAsList: false,
@@ -854,27 +758,23 @@ var defaultOptions$4 = _objectSpread$b(_objectSpread$b({}, defaultOptions$5), {}
854
758
  *
855
759
  * @category Metadata
856
760
  */
857
-
858
761
  var parseTimespanList = function parseTimespanList(timespanList, options) {
859
762
  var parseTimespanListOptions = _objectSpread$b(_objectSpread$b({}, defaultOptions$4), options || {});
860
-
861
763
  var timespanAsList = parseTimespanListOptions.timespanAsList,
862
- joinTimespan = parseTimespanListOptions.joinTimespan,
863
- sortTimespan = parseTimespanListOptions.sortTimespan,
864
- flat = parseTimespanListOptions.flat,
865
- flatTimespan = parseTimespanListOptions.flatTimespan,
866
- otherOptions = _objectWithoutProperties(parseTimespanListOptions, _excluded$8);
867
-
764
+ joinTimespan = parseTimespanListOptions.joinTimespan,
765
+ sortTimespan = parseTimespanListOptions.sortTimespan,
766
+ flat = parseTimespanListOptions.flat,
767
+ flatTimespan = parseTimespanListOptions.flatTimespan,
768
+ otherOptions = _objectWithoutProperties(parseTimespanListOptions, _excluded$8);
868
769
  var parseTimespanOptions = _objectSpread$b({
869
770
  flat: flat
870
771
  }, otherOptions);
871
-
872
772
  if (sortTimespan) timespanList.sort(sortTimespanList);
873
773
  var shouldFlatten = (flatTimespan !== undefined ? flatTimespan === true : flat === true) && timespanAsList === false;
874
774
  var output = {};
875
775
  timespanList === null || timespanList === void 0 ? void 0 : timespanList.forEach(function (timespan) {
876
776
  var start = timespan.start,
877
- end = timespan.end;
777
+ end = timespan.end;
878
778
  var key = shouldFlatten ? 'flat' : [start, end].join(joinTimespan);
879
779
  var parsedTimespan = parseTimespan(timespan, parseTimespanOptions);
880
780
  var existingParsedTimespans = output[key];
@@ -886,27 +786,23 @@ var parseTimespanList = function parseTimespanList(timespanList, options) {
886
786
  }
887
787
  } else output[key] = [].concat(_toConsumableArray(asArray(existingParsedTimespans)), [parsedTimespan]);
888
788
  });
889
-
890
789
  if (timespanAsList === true) {
891
790
  return Object.values(output);
892
791
  }
893
-
894
792
  if (shouldFlatten) {
895
793
  return Object.values(output).pop();
896
794
  }
897
-
898
795
  return output;
899
796
  };
900
797
 
901
798
  var _excluded$7 = ["timespan"];
902
-
903
799
  function ownKeys$a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
904
-
905
800
  function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$a(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
906
801
  var defaultOptions$3 = _objectSpread$a(_objectSpread$a({}, defaultOptions$4), {}, {
907
802
  includeMetadataAttributes: false,
908
803
  flat: false
909
804
  });
805
+
910
806
  /**
911
807
  * Parses MetadataType according to specified options
912
808
  *
@@ -923,31 +819,24 @@ var defaultOptions$3 = _objectSpread$a(_objectSpread$a({}, defaultOptions$4), {}
923
819
  *
924
820
  * @category Metadata
925
821
  */
926
-
927
822
  function parseMetadataType(metadataType, options) {
928
823
  var parseMetadataTypeOptions = _objectSpread$a(_objectSpread$a({}, defaultOptions$3), options || {});
929
-
930
824
  var includeMetadataAttributes = parseMetadataTypeOptions.includeMetadataAttributes,
931
- flat = parseMetadataTypeOptions.flat;
932
-
825
+ flat = parseMetadataTypeOptions.flat;
933
826
  var _ref = metadataType || {},
934
- _ref$timespan = _ref.timespan,
935
- timespanList = _ref$timespan === void 0 ? [] : _ref$timespan,
936
- attributes = _objectWithoutProperties(_ref, _excluded$7);
937
-
827
+ _ref$timespan = _ref.timespan,
828
+ timespanList = _ref$timespan === void 0 ? [] : _ref$timespan,
829
+ attributes = _objectWithoutProperties(_ref, _excluded$7);
938
830
  var parseTimespanListOptions = Object.fromEntries(Object.entries(options).map(function (_ref2) {
939
831
  var _ref3 = _slicedToArray(_ref2, 2),
940
- key = _ref3[0],
941
- value = _ref3[1];
942
-
832
+ key = _ref3[0],
833
+ value = _ref3[1];
943
834
  if (Object.keys(defaultOptions$4).includes(key)) {
944
835
  if (['onlyGeneric', 'overrideGroup', 'overrideField'].includes(key) && (value !== undefined ? value : flat === true)) {
945
836
  return [key, true];
946
837
  }
947
-
948
838
  return [key, value];
949
839
  }
950
-
951
840
  return undefined;
952
841
  }).filter(function (e) {
953
842
  return !!e;
@@ -957,13 +846,11 @@ function parseMetadataType(metadataType, options) {
957
846
  revision: attributes.revision.split(',')
958
847
  } : {}) || Array.isArray(includeMetadataAttributes) && Object.fromEntries(Object.entries(attributes).map(function (_ref4) {
959
848
  var _ref5 = _slicedToArray(_ref4, 2),
960
- key = _ref5[0],
961
- value = _ref5[1];
962
-
849
+ key = _ref5[0],
850
+ value = _ref5[1];
963
851
  if (includeMetadataAttributes.includes(key)) {
964
852
  return [key, key === 'revision' && typeof value === 'string' ? value.split(',') : value];
965
853
  }
966
-
967
854
  return undefined;
968
855
  }).filter(function (o) {
969
856
  return !!o;
@@ -983,12 +870,10 @@ function parseMetadataType(metadataType, options) {
983
870
  *
984
871
  * @category Metadata
985
872
  */
986
-
987
873
  var parseSimpleMetadataType = function parseSimpleMetadataType(simpleMetadataType) {
988
874
  var _ref = simpleMetadataType || {},
989
- _ref$field = _ref.field,
990
- field = _ref$field === void 0 ? [] : _ref$field;
991
-
875
+ _ref$field = _ref.field,
876
+ field = _ref$field === void 0 ? [] : _ref$field;
992
877
  return parseKeyValuePairTypes(field);
993
878
  };
994
879
 
@@ -1033,6 +918,7 @@ var TIME_BASE_CONSTANTS = Object.keys(MAP_CONSTANT_TO_DEN_NUM);
1033
918
  */
1034
919
  var TimeBase = /*#__PURE__*/function () {
1035
920
  // The numerator for the TimeBase
921
+
1036
922
  // The denominator for the TimeBase
1037
923
 
1038
924
  /**
@@ -1042,79 +928,68 @@ var TimeBase = /*#__PURE__*/function () {
1042
928
  */
1043
929
  function TimeBase(timeBaseType) {
1044
930
  _classCallCheck(this, TimeBase);
1045
-
1046
931
  _defineProperty(this, "numerator", 1);
1047
-
1048
932
  _defineProperty(this, "denominator", 1);
1049
-
1050
933
  var _ref = timeBaseType || {},
1051
- _ref$numerator = _ref.numerator,
1052
- numerator = _ref$numerator === void 0 ? 1 : _ref$numerator,
1053
- _ref$denominator = _ref.denominator,
1054
- denominator = _ref$denominator === void 0 ? 1 : _ref$denominator;
1055
-
934
+ _ref$numerator = _ref.numerator,
935
+ numerator = _ref$numerator === void 0 ? 1 : _ref$numerator,
936
+ _ref$denominator = _ref.denominator,
937
+ denominator = _ref$denominator === void 0 ? 1 : _ref$denominator;
1056
938
  this.numerator = Number(numerator);
1057
939
  this.denominator = Number(denominator);
1058
940
  }
941
+
1059
942
  /**
1060
943
  * Get TimeBase in a constant representation (e.g. "PAL") if possible, otherwise undefined
1061
944
  * @returns Constant representation of the TimeBase
1062
945
  */
1063
-
1064
-
1065
946
  _createClass(TimeBase, [{
1066
947
  key: "toConstant",
1067
948
  value: function toConstant() {
1068
949
  var _this = this;
1069
-
1070
- var constant; // If multiple equal den/num, it selects first in MAP_CONSTANT_TO_DEN_NUM
1071
-
950
+ var constant;
951
+ // If multiple equal den/num, it selects first in MAP_CONSTANT_TO_DEN_NUM
1072
952
  Object.entries(MAP_CONSTANT_TO_DEN_NUM).find(function (timeBaseConstant) {
1073
953
  var _timeBaseConstant = _slicedToArray(timeBaseConstant, 2),
1074
- thisTimeBaseText = _timeBaseConstant[0],
1075
- thisTimeBaseType = _timeBaseConstant[1];
1076
-
954
+ thisTimeBaseText = _timeBaseConstant[0],
955
+ thisTimeBaseType = _timeBaseConstant[1];
1077
956
  var numerator = thisTimeBaseType.numerator,
1078
- denominator = thisTimeBaseType.denominator;
1079
-
957
+ denominator = thisTimeBaseType.denominator;
1080
958
  if (numerator === _this.numerator && denominator === _this.denominator) {
1081
959
  constant = thisTimeBaseText;
1082
960
  return true;
1083
961
  }
1084
-
1085
962
  return false;
1086
963
  });
1087
964
  return constant;
1088
965
  }
966
+
1089
967
  /**
1090
968
  * Get TimeBase as a VidiCore TimeBaseType string
1091
969
  *
1092
970
  * @remarks
1093
971
  * Default format: denominator(:numerator if > 1)
972
+ *
1094
973
  * `constant` has precedence over `fraction` if both are true (e.g. NTSC > 30000:1001)
1095
974
  *
1096
975
  * @param options For how to display it as text
1097
976
  * @returns Text representation of the TimeBase
1098
977
  */
1099
-
1100
978
  }, {
1101
979
  key: "toText",
1102
980
  value: function toText(options) {
1103
981
  if (options !== null && options !== void 0 && options.constant) {
1104
982
  var _timeBaseText = this.toConstant();
1105
-
1106
983
  if (_timeBaseText) return _timeBaseText;
1107
984
  }
1108
-
1109
985
  if (options !== null && options !== void 0 && options.fraction || this.numerator > 1) {
1110
986
  var _timeBaseText2 = [this.denominator, this.numerator].join(':');
1111
-
1112
987
  return _timeBaseText2;
1113
988
  }
1114
-
1115
989
  var timeBaseText = String(this.denominator);
1116
990
  return timeBaseText;
1117
991
  }
992
+
1118
993
  /**
1119
994
  * Output TimeBase as frame rate (by default max 16 decimal places)
1120
995
  *
@@ -1125,6 +1000,7 @@ var TimeBase = /*#__PURE__*/function () {
1125
1000
  * - `number` gives that amount of decimal places
1126
1001
  *
1127
1002
  * Default format: rate with two decimals if needed (i.e. decimals are > 0)
1003
+ *
1128
1004
  * Option precedence (when all true): `constant` > `rounded` > `fixed`
1129
1005
  *
1130
1006
  * @param options For how to display it as rate
@@ -1133,36 +1009,30 @@ var TimeBase = /*#__PURE__*/function () {
1133
1009
  *
1134
1010
  * @category Time
1135
1011
  */
1136
-
1137
1012
  }, {
1138
1013
  key: "toRate",
1139
1014
  value: function toRate(options) {
1140
1015
  var rate = this.denominator / this.numerator;
1141
-
1142
1016
  if (Number.isInteger(rate)) {
1143
1017
  return rate;
1144
1018
  }
1145
-
1146
1019
  if (options !== null && options !== void 0 && options.rounded) {
1147
1020
  return Math.round(rate);
1148
1021
  }
1149
-
1150
1022
  var _ref2 = options || {},
1151
- _ref2$fixed = _ref2.fixed,
1152
- fixed = _ref2$fixed === void 0 ? true : _ref2$fixed;
1153
-
1023
+ _ref2$fixed = _ref2.fixed,
1024
+ fixed = _ref2$fixed === void 0 ? true : _ref2$fixed;
1154
1025
  if (fixed === true || typeof fixed === 'number') {
1155
1026
  return Number(rate.toFixed(typeof fixed === 'boolean' ? 2 : fixed));
1156
1027
  }
1157
-
1158
1028
  return rate;
1159
1029
  }
1030
+
1160
1031
  /**
1161
1032
  * Get TimeBase in a object representation
1162
1033
  *
1163
1034
  * @returns TimeBase as `{denominator, numerator}` object
1164
1035
  */
1165
-
1166
1036
  }, {
1167
1037
  key: "toObject",
1168
1038
  value: function toObject() {
@@ -1171,12 +1041,12 @@ var TimeBase = /*#__PURE__*/function () {
1171
1041
  numerator: this.numerator
1172
1042
  };
1173
1043
  }
1044
+
1174
1045
  /**
1175
1046
  * @deprecated Use {@link TimeBase#toObject | toObject} instead
1176
1047
  *
1177
1048
  * @returns TimeBase as `{denominator, numerator}` object
1178
1049
  */
1179
-
1180
1050
  }, {
1181
1051
  key: "toJson",
1182
1052
  value: function toJson() {
@@ -1185,7 +1055,6 @@ var TimeBase = /*#__PURE__*/function () {
1185
1055
  return this.toObject();
1186
1056
  }
1187
1057
  }]);
1188
-
1189
1058
  return TimeBase;
1190
1059
  }();
1191
1060
 
@@ -1197,38 +1066,31 @@ var TimeBase = /*#__PURE__*/function () {
1197
1066
  *
1198
1067
  * @category Time
1199
1068
  */
1200
-
1201
1069
  var formatTimeBaseText = function formatTimeBaseText(timeBaseText) {
1202
1070
  if (timeBaseText === undefined) {
1203
1071
  return new TimeBase();
1204
1072
  }
1205
-
1206
1073
  if (typeof timeBaseText === 'number') {
1207
1074
  return new TimeBase({
1208
1075
  denominator: timeBaseText
1209
1076
  });
1210
1077
  }
1211
-
1212
1078
  if (typeof timeBaseText === 'string' && timeBaseText.includes(':')) {
1213
1079
  var _timeBaseText$split = timeBaseText.split(':'),
1214
- _timeBaseText$split2 = _slicedToArray(_timeBaseText$split, 2),
1215
- denominator = _timeBaseText$split2[0],
1216
- numerator = _timeBaseText$split2[1];
1217
-
1080
+ _timeBaseText$split2 = _slicedToArray(_timeBaseText$split, 2),
1081
+ denominator = _timeBaseText$split2[0],
1082
+ numerator = _timeBaseText$split2[1];
1218
1083
  return new TimeBase({
1219
1084
  denominator: denominator,
1220
1085
  numerator: numerator
1221
1086
  });
1222
1087
  }
1223
-
1224
1088
  if (TIME_BASE_CONSTANTS.includes(timeBaseText)) {
1225
1089
  return new TimeBase(MAP_CONSTANT_TO_DEN_NUM[timeBaseText]);
1226
1090
  }
1227
-
1228
1091
  if (!['string', 'number'].includes(_typeof(timeBaseText)) || Number.isNaN(Number(timeBaseText))) {
1229
1092
  throw new Error("timeBaseText must be a number or ".concat(TIME_BASE_CONSTANTS.join(','), " - is ").concat(JSON.stringify(timeBaseText)));
1230
1093
  }
1231
-
1232
1094
  return new TimeBase({
1233
1095
  denominator: Number(timeBaseText)
1234
1096
  });
@@ -1258,7 +1120,6 @@ var createTimeBase = function createTimeBase(timeBase) {
1258
1120
  if (typeof timeBase === 'string' || typeof timeBase === 'number') {
1259
1121
  return formatTimeBaseText(timeBase);
1260
1122
  }
1261
-
1262
1123
  return formatTimeBaseType(timeBase);
1263
1124
  };
1264
1125
 
@@ -1283,16 +1144,14 @@ var getAmountOfFrameDrops = function getAmountOfFrameDrops(timeBase) {
1283
1144
  * @param timeBase TimeBase Instance to check
1284
1145
  * @returns true if time base drops frames, false otherwise
1285
1146
  */
1286
-
1287
1147
  var isDropFrameTimeBase = function isDropFrameTimeBase(timeBase) {
1288
1148
  return getAmountOfFrameDrops(timeBase) > 0;
1289
1149
  };
1290
1150
 
1291
1151
  var _excluded$6 = ["hours"];
1292
-
1293
1152
  var getDroppedFramesFromSamples = function getDroppedFramesFromSamples(timeCode) {
1294
1153
  var samples = timeCode.samples,
1295
- timeBase = timeCode.timeBase;
1154
+ timeBase = timeCode.timeBase;
1296
1155
  var amountOfFrameDrops = getAmountOfFrameDrops(timeBase);
1297
1156
  if (!amountOfFrameDrops) return 0;
1298
1157
  var roundedFrameRate = timeBase.toRate({
@@ -1308,7 +1167,6 @@ var getDroppedFramesFromSamples = function getDroppedFramesFromSamples(timeCode)
1308
1167
  var amountOfFrameRemainderChunks = frameRemainder > 0 ? amountOfFrameDrops : 0;
1309
1168
  return amountOfTenMinuteChunks * 9 * amountOfFrameDrops + amountOfOneMinuteReminderChunks * amountOfFrameDrops + amountOfFrameRemainderChunks;
1310
1169
  };
1311
-
1312
1170
  /**
1313
1171
  * TimeCode class representing the TimeCodeType in VidiCore
1314
1172
  *
@@ -1318,8 +1176,11 @@ var getDroppedFramesFromSamples = function getDroppedFramesFromSamples(timeCode)
1318
1176
  */
1319
1177
  var TimeCode = /*#__PURE__*/function () {
1320
1178
  // Amount of samples for the time code
1179
+
1321
1180
  // The time base for the time code
1181
+
1322
1182
  // If time code is dropFrame or not (by default checks timeBase)
1183
+
1323
1184
  // Separator for frame in smpte output (default ":" for non-drop-frame and ";" for dropFrame)
1324
1185
 
1325
1186
  /**
@@ -1330,21 +1191,14 @@ var TimeCode = /*#__PURE__*/function () {
1330
1191
  */
1331
1192
  function TimeCode(timeCodeType, options) {
1332
1193
  var _options$dropFrame, _options$frameSeparat;
1333
-
1334
1194
  _classCallCheck(this, TimeCode);
1335
-
1336
1195
  _defineProperty(this, "samples", 0);
1337
-
1338
1196
  _defineProperty(this, "timeBase", new TimeBase());
1339
-
1340
1197
  _defineProperty(this, "dropFrame", void 0);
1341
-
1342
1198
  _defineProperty(this, "frameSeparator", void 0);
1343
-
1344
1199
  var _ref = timeCodeType || {},
1345
- samples = _ref.samples,
1346
- timeBase = _ref.timeBase;
1347
-
1200
+ samples = _ref.samples,
1201
+ timeBase = _ref.timeBase;
1348
1202
  if (samples !== undefined) {
1349
1203
  if (typeof samples === 'number') {
1350
1204
  this.samples = samples;
@@ -1360,7 +1214,6 @@ var TimeCode = /*#__PURE__*/function () {
1360
1214
  throw new Error("samples is not number/string/-Inf/+Inf is: ".concat(samples));
1361
1215
  }
1362
1216
  }
1363
-
1364
1217
  if (timeBase !== undefined) {
1365
1218
  if (timeBase instanceof TimeBase) {
1366
1219
  this.timeBase = timeBase;
@@ -1368,10 +1221,10 @@ var TimeCode = /*#__PURE__*/function () {
1368
1221
  this.timeBase = createTimeBase(timeBase);
1369
1222
  }
1370
1223
  }
1371
-
1372
1224
  this.dropFrame = (_options$dropFrame = options === null || options === void 0 ? void 0 : options.dropFrame) !== null && _options$dropFrame !== void 0 ? _options$dropFrame : isDropFrameTimeBase(this.timeBase);
1373
1225
  this.frameSeparator = (_options$frameSeparat = options === null || options === void 0 ? void 0 : options.frameSeparator) !== null && _options$frameSeparat !== void 0 ? _options$frameSeparat : this.dropFrame ? ';' : ':';
1374
1226
  }
1227
+
1375
1228
  /**
1376
1229
  * Return this TimeCode added with the supplied timeCodeType
1377
1230
  * If time bases differ, it will retain the time base of this TimeCode instance
@@ -1384,32 +1237,27 @@ var TimeCode = /*#__PURE__*/function () {
1384
1237
  * @param timeCode A TimeCode instance you want to add with
1385
1238
  * @returns A new TimeCode instance with the addition applied
1386
1239
  */
1387
-
1388
-
1389
1240
  _createClass(TimeCode, [{
1390
1241
  key: "add",
1391
1242
  value: function add(timeCode) {
1392
1243
  if (!(timeCode !== null && timeCode !== void 0 && timeCode.timeBase) || (timeCode === null || timeCode === void 0 ? void 0 : timeCode.samples) === undefined) {
1393
1244
  throw Error('Invalid timeCodeType, cannot be added');
1394
1245
  }
1395
-
1396
1246
  var _ref2 = (timeCode === null || timeCode === void 0 ? void 0 : timeCode.timeBase) || {},
1397
- numerator = _ref2.numerator,
1398
- denominator = _ref2.denominator;
1399
-
1247
+ numerator = _ref2.numerator,
1248
+ denominator = _ref2.denominator;
1400
1249
  var conformedTimeCode = timeCode;
1401
-
1402
1250
  if (numerator !== this.timeBase.numerator || denominator !== this.timeBase.denominator) {
1403
1251
  conformedTimeCode = timeCode.conformTimeBase(this.timeBase);
1404
1252
  }
1405
-
1406
1253
  var _conformedTimeCode = conformedTimeCode,
1407
- samples = _conformedTimeCode.samples;
1254
+ samples = _conformedTimeCode.samples;
1408
1255
  return new TimeCode({
1409
1256
  samples: this.samples + samples,
1410
1257
  timeBase: this.timeBase
1411
1258
  });
1412
1259
  }
1260
+
1413
1261
  /**
1414
1262
  * Return this TimeCode subtracted with the supplied timeCodeType
1415
1263
  * If time bases differ, it will retain the time base of the instance time code
@@ -1422,31 +1270,28 @@ var TimeCode = /*#__PURE__*/function () {
1422
1270
  * @param timeCode A TimeCode instance you want to subtract with
1423
1271
  * @returns A new TimeCode instance with the subtraction applied
1424
1272
  */
1425
-
1426
1273
  }, {
1427
1274
  key: "subtract",
1428
1275
  value: function subtract(timeCode) {
1429
1276
  if (!(timeCode !== null && timeCode !== void 0 && timeCode.timeBase) || (timeCode === null || timeCode === void 0 ? void 0 : timeCode.samples) === undefined) {
1430
1277
  throw Error('Invalid timeCodeType, cannot be subtracted');
1431
1278
  }
1432
-
1433
1279
  var _timeCode$timeBase = timeCode.timeBase;
1434
1280
  _timeCode$timeBase = _timeCode$timeBase === void 0 ? {} : _timeCode$timeBase;
1435
1281
  var numerator = _timeCode$timeBase.numerator,
1436
- denominator = _timeCode$timeBase.denominator;
1282
+ denominator = _timeCode$timeBase.denominator;
1437
1283
  var conformedTimeCode = timeCode;
1438
-
1439
1284
  if (numerator !== this.timeBase.numerator || denominator !== this.timeBase.denominator) {
1440
1285
  conformedTimeCode = timeCode.conformTimeBase(this.timeBase);
1441
1286
  }
1442
-
1443
1287
  var _conformedTimeCode2 = conformedTimeCode,
1444
- samples = _conformedTimeCode2.samples;
1288
+ samples = _conformedTimeCode2.samples;
1445
1289
  return new TimeCode({
1446
1290
  samples: this.samples - samples,
1447
1291
  timeBase: this.timeBase
1448
1292
  });
1449
1293
  }
1294
+
1450
1295
  /**
1451
1296
  * Creates a new TimeCode instance with specified timeBase and samples adjusted to that.
1452
1297
  *
@@ -1456,7 +1301,6 @@ var TimeCode = /*#__PURE__*/function () {
1456
1301
  * @param timeBase The TimeBase it should conform the TimeCode to
1457
1302
  * @returns A new TimeCode instance with the conformTo timeBase applied
1458
1303
  */
1459
-
1460
1304
  }, {
1461
1305
  key: "conformTimeBase",
1462
1306
  value: function conformTimeBase(timeBase) {
@@ -1472,11 +1316,13 @@ var TimeCode = /*#__PURE__*/function () {
1472
1316
  };
1473
1317
  return new TimeCode(timeCode);
1474
1318
  }
1319
+
1475
1320
  /**
1476
1321
  * Get TimeCode as a text representation
1477
1322
  *
1478
1323
  * @remarks
1479
1324
  * Default format: samples@denominator(:numerator if > 1)
1325
+ *
1480
1326
  * `constant` has precedence over `fraction` if both are true
1481
1327
  *
1482
1328
  * @param options Options for how to format text
@@ -1484,39 +1330,36 @@ var TimeCode = /*#__PURE__*/function () {
1484
1330
  *
1485
1331
  * @category Time
1486
1332
  */
1487
-
1488
1333
  }, {
1489
1334
  key: "toText",
1490
1335
  value: function toText(options) {
1491
1336
  var timeCodeText = "".concat(this.samples);
1492
1337
  var timeBaseText = this.timeBase.toText(options);
1493
-
1494
1338
  if (options !== null && options !== void 0 && options.includeTimeBaseForSeconds || !['1', '1:1'].includes(timeBaseText)) {
1495
1339
  timeCodeText = [this.samples, timeBaseText].join('@');
1496
1340
  }
1497
-
1498
1341
  return timeCodeText;
1499
1342
  }
1343
+
1500
1344
  /**
1501
1345
  * Get TimeCode in a units object representation
1502
1346
  *
1503
1347
  * @returns Units (time and frames) for the time code
1504
1348
  */
1505
-
1506
1349
  }, {
1507
1350
  key: "toUnits",
1508
1351
  value: function toUnits() {
1509
1352
  var totalSamples = this.samples + (this.dropFrame ? getDroppedFramesFromSamples(this) : 0);
1510
1353
  var roundedFrameRate = this.timeBase.toRate({
1511
1354
  rounded: true
1512
- }); // Calculated without drop-frame but with 2 decimal places
1355
+ });
1513
1356
 
1357
+ // Calculated without drop-frame but with 2 decimal places
1514
1358
  if (['23.976', '23.98'].includes(this.timeBase.toConstant())) {
1515
1359
  roundedFrameRate = this.timeBase.toRate({
1516
1360
  fixed: true
1517
1361
  });
1518
1362
  }
1519
-
1520
1363
  var hours = Math.floor(totalSamples / (3600 * roundedFrameRate));
1521
1364
  var minutes = Math.floor(totalSamples / (60 * roundedFrameRate)) % 60;
1522
1365
  var seconds = Math.floor(totalSamples / roundedFrameRate) % 60;
@@ -1528,23 +1371,21 @@ var TimeCode = /*#__PURE__*/function () {
1528
1371
  frames: frames
1529
1372
  };
1530
1373
  }
1374
+
1531
1375
  /**
1532
1376
  * Get TimeCode in a time object representation
1533
1377
  * "milliseconds" is rounded down, if you want another representation use "partialSeconds"
1534
1378
  *
1535
1379
  * @returns Time for the time code
1536
1380
  */
1537
-
1538
1381
  }, {
1539
1382
  key: "toTime",
1540
1383
  value: function toTime() {
1541
1384
  var totalSamples = this.samples + getDroppedFramesFromSamples(this);
1542
-
1543
1385
  var _this$toUnits = this.toUnits(),
1544
- hours = _this$toUnits.hours,
1545
- minutes = _this$toUnits.minutes,
1546
- seconds = _this$toUnits.seconds;
1547
-
1386
+ hours = _this$toUnits.hours,
1387
+ minutes = _this$toUnits.minutes,
1388
+ seconds = _this$toUnits.seconds;
1548
1389
  var roundedFrameRate = this.timeBase.toRate({
1549
1390
  rounded: true
1550
1391
  });
@@ -1559,20 +1400,21 @@ var TimeCode = /*#__PURE__*/function () {
1559
1400
  partialSeconds: partialSeconds
1560
1401
  };
1561
1402
  }
1403
+
1562
1404
  /**
1563
1405
  * Get TimeCode in a seconds representation
1564
1406
  *
1565
1407
  * @returns Total seconds for the time code
1566
1408
  */
1567
-
1568
1409
  }, {
1569
1410
  key: "toSeconds",
1570
1411
  value: function toSeconds() {
1571
1412
  var _this$timeBase = this.timeBase,
1572
- numerator = _this$timeBase.numerator,
1573
- denominator = _this$timeBase.denominator;
1413
+ numerator = _this$timeBase.numerator,
1414
+ denominator = _this$timeBase.denominator;
1574
1415
  return Math.round(1000 * +(this.samples * numerator / denominator)) / 1000;
1575
1416
  }
1417
+
1576
1418
  /**
1577
1419
  * Get TimeCode in a duration representation
1578
1420
  * The time unit char keys for the format string are:
@@ -1591,52 +1433,40 @@ var TimeCode = /*#__PURE__*/function () {
1591
1433
  * @param options Options for how to display duration
1592
1434
  * @returns Duration representation of the TimeCode
1593
1435
  */
1594
-
1595
1436
  }, {
1596
1437
  key: "toDuration",
1597
1438
  value: function toDuration(options) {
1598
1439
  var _ref3 = options || {},
1599
- format = _ref3.format;
1600
-
1440
+ format = _ref3.format;
1601
1441
  var _this$toTime = this.toTime(),
1602
- hours = _this$toTime.hours,
1603
- rest = _objectWithoutProperties(_this$toTime, _excluded$6);
1604
-
1442
+ hours = _this$toTime.hours,
1443
+ rest = _objectWithoutProperties(_this$toTime, _excluded$6);
1605
1444
  var minutes = rest.minutes,
1606
- seconds = rest.seconds,
1607
- milliseconds = rest.milliseconds;
1608
-
1445
+ seconds = rest.seconds,
1446
+ milliseconds = rest.milliseconds;
1609
1447
  if (!!format && typeof format !== 'string') {
1610
1448
  throw Error('format has to be a string');
1611
1449
  }
1612
-
1613
1450
  var isBefore = function isBefore(unit, units) {
1614
1451
  return !format.includes(unit) || !units.some(function (u) {
1615
1452
  return format.includes(u) && format.lastIndexOf(unit) > format.indexOf(u);
1616
1453
  });
1617
1454
  };
1618
-
1619
1455
  if (!!format && !(isBefore('h', ['m', 's', 'S']) && isBefore('m', ['s', 'S']) && isBefore('s', ['S']))) {
1620
1456
  throw Error('format order is unsupported (has to be h, m, s then S)');
1621
1457
  }
1622
-
1623
1458
  if (!format) {
1624
1459
  return "".concat(hours > 0 ? "".concat(hours, ":").concat("".concat(minutes).padStart(2, '0')) : minutes, ":").concat("".concat(seconds).padStart(2, '0'));
1625
1460
  }
1626
-
1627
1461
  var countConsecutiveChars = function countConsecutiveChars(i, arr) {
1628
1462
  var j = i;
1629
-
1630
1463
  while (arr[j] === arr[j + 1]) {
1631
1464
  j += 1;
1632
1465
  }
1633
-
1634
1466
  return j - i + 1;
1635
1467
  };
1636
-
1637
1468
  var timeUnitKeys = ['h', 'm', 's', 'S'];
1638
1469
  var output = [];
1639
-
1640
1470
  _toConsumableArray(format).forEach(function (c, i, arr) {
1641
1471
  switch (c) {
1642
1472
  case 'h':
@@ -1644,108 +1474,85 @@ var TimeCode = /*#__PURE__*/function () {
1644
1474
  if (arr[i - 1] === 'h') {
1645
1475
  break;
1646
1476
  }
1647
-
1648
1477
  var amount = countConsecutiveChars(i, arr);
1649
1478
  output.push("".concat(hours).padStart(amount, '0'));
1650
-
1651
1479
  if (timeUnitKeys.includes(arr[i + amount])) {
1652
1480
  output.push(':');
1653
1481
  }
1654
-
1655
1482
  break;
1656
1483
  }
1657
-
1658
1484
  case 'm':
1659
1485
  {
1660
1486
  if (arr[i - 1] === 'm') {
1661
1487
  break;
1662
1488
  }
1663
-
1664
1489
  var _amount = countConsecutiveChars(i, arr);
1665
-
1666
1490
  if (!format.includes('h')) {
1667
1491
  minutes += hours * 60;
1668
1492
  }
1669
-
1670
1493
  output.push("".concat(minutes).padStart(_amount, '0'));
1671
-
1672
1494
  if (timeUnitKeys.includes(arr[i + _amount])) {
1673
1495
  output.push(':');
1674
1496
  }
1675
-
1676
1497
  break;
1677
1498
  }
1678
-
1679
1499
  case 's':
1680
1500
  {
1681
1501
  if (arr[i - 1] === 's') {
1682
1502
  break;
1683
1503
  }
1684
-
1685
1504
  var _amount2 = countConsecutiveChars(i, arr);
1686
-
1687
1505
  if (!format.includes('m')) {
1688
1506
  seconds += minutes * 60;
1689
1507
  }
1690
-
1691
1508
  output.push("".concat(seconds).padStart(_amount2, '0'));
1692
-
1693
1509
  if (timeUnitKeys.includes(arr[i + _amount2])) {
1694
1510
  output.push('.');
1695
1511
  }
1696
-
1697
1512
  break;
1698
1513
  }
1699
-
1700
1514
  case 'S':
1701
1515
  {
1702
1516
  if (arr[i - 1] === 'S') {
1703
1517
  break;
1704
1518
  }
1705
-
1706
1519
  var _amount3 = countConsecutiveChars(i, arr);
1707
-
1708
1520
  if (!format.includes('s')) {
1709
1521
  milliseconds += seconds * 1000;
1710
1522
  }
1711
-
1712
1523
  output.push("".concat(Math.round(milliseconds / Math.pow(10, 3 - _amount3))).padStart(_amount3, '0'));
1713
1524
  break;
1714
1525
  }
1715
-
1716
1526
  default:
1717
1527
  output.push(c);
1718
1528
  }
1719
1529
  });
1720
-
1721
1530
  return output.join('');
1722
1531
  }
1532
+
1723
1533
  /**
1724
1534
  * Get TimeCode in a smpte representation
1725
1535
  *
1726
1536
  * @returns Smpte representation of the TimeCode
1727
1537
  */
1728
-
1729
1538
  }, {
1730
1539
  key: "toSmpte",
1731
1540
  value: function toSmpte() {
1732
1541
  if (this.samples === -Infinity) return '00:00:00:00';
1733
-
1734
1542
  var _this$toUnits2 = this.toUnits(),
1735
- hours = _this$toUnits2.hours,
1736
- minutes = _this$toUnits2.minutes,
1737
- seconds = _this$toUnits2.seconds,
1738
- frames = _this$toUnits2.frames;
1739
-
1543
+ hours = _this$toUnits2.hours,
1544
+ minutes = _this$toUnits2.minutes,
1545
+ seconds = _this$toUnits2.seconds,
1546
+ frames = _this$toUnits2.frames;
1740
1547
  var hhmmss = [hours.toFixed().padStart(2, '0'), minutes.toFixed().padStart(2, '0'), seconds.toFixed().padStart(2, '0')].join(':');
1741
1548
  return [hhmmss, "".concat(frames).padStart(2, '0')].join(this.frameSeparator);
1742
1549
  }
1550
+
1743
1551
  /**
1744
1552
  * Get TimeCode as a VidiCore TimeCodeType object
1745
1553
  *
1746
1554
  * @returns TimeCode as `{ samples, timeBase }`
1747
1555
  */
1748
-
1749
1556
  }, {
1750
1557
  key: "toObject",
1751
1558
  value: function toObject() {
@@ -1754,12 +1561,12 @@ var TimeCode = /*#__PURE__*/function () {
1754
1561
  timeBase: this.timeBase.toObject()
1755
1562
  };
1756
1563
  }
1564
+
1757
1565
  /**
1758
1566
  * @deprecated Use {@link TimeCode#toObject | toObject} instead
1759
1567
  *
1760
1568
  * @returns TimeCode as `{ samples, timeBase }`
1761
1569
  */
1762
-
1763
1570
  }, {
1764
1571
  key: "toJson",
1765
1572
  value: function toJson() {
@@ -1768,7 +1575,6 @@ var TimeCode = /*#__PURE__*/function () {
1768
1575
  return this.toObject();
1769
1576
  }
1770
1577
  }]);
1771
-
1772
1578
  return TimeCode;
1773
1579
  }();
1774
1580
 
@@ -1786,7 +1592,6 @@ var TimeCode = /*#__PURE__*/function () {
1786
1592
  var getGreatestCommonDivisor = function getGreatestCommonDivisor(num1, num2) {
1787
1593
  var a = Math.abs(num1);
1788
1594
  var b = Math.abs(num2);
1789
-
1790
1595
  while (a && b && a !== b) {
1791
1596
  if (a > b) {
1792
1597
  var _ref = [a - b, b];
@@ -1798,15 +1603,15 @@ var getGreatestCommonDivisor = function getGreatestCommonDivisor(num1, num2) {
1798
1603
  b = _ref2[1];
1799
1604
  }
1800
1605
  }
1801
-
1802
1606
  return a || b;
1803
1607
  };
1804
1608
 
1805
1609
  var _excluded$5 = ["timeBase", "useGCD"];
1806
-
1807
1610
  /**
1808
1611
  * Format seconds to TimeCode object
1809
- * Input time base is always 1:1 since it expects seconds as input
1612
+ *
1613
+ * @remarks
1614
+ * Input time base is always considered as 1:1 since it expects seconds as input
1810
1615
  *
1811
1616
  * Note: Max 15 digits accuracy (double precision float64), e.g.
1812
1617
  * - 10^6 seconds can have 10^9 decimals (nanosecond) precision
@@ -1821,40 +1626,32 @@ var _excluded$5 = ["timeBase", "useGCD"];
1821
1626
  */
1822
1627
  var formatTimeCodeSeconds = function formatTimeCodeSeconds(seconds, options) {
1823
1628
  var _ref = options || {},
1824
- timeBase = _ref.timeBase,
1825
- _ref$useGCD = _ref.useGCD,
1826
- useGCD = _ref$useGCD === void 0 ? false : _ref$useGCD,
1827
- timeCodeOptions = _objectWithoutProperties(_ref, _excluded$5);
1828
-
1629
+ timeBase = _ref.timeBase,
1630
+ _ref$useGCD = _ref.useGCD,
1631
+ useGCD = _ref$useGCD === void 0 ? false : _ref$useGCD,
1632
+ timeCodeOptions = _objectWithoutProperties(_ref, _excluded$5);
1829
1633
  var secondsWithDot = "".concat(seconds).replace(/,/g, '.');
1830
-
1831
1634
  if (Number.isNaN(+secondsWithDot)) {
1832
1635
  throw new Error("seconds must be digits, is ".concat(seconds));
1833
1636
  }
1834
-
1835
1637
  var denominator = 1;
1836
1638
  var samples;
1837
-
1838
1639
  if (Number.isInteger(+secondsWithDot)) {
1839
1640
  samples = +secondsWithDot * denominator;
1840
1641
  } else {
1841
1642
  var _ms$length;
1842
-
1843
1643
  var _secondsWithDot$split = secondsWithDot.split('.'),
1844
- _secondsWithDot$split2 = _slicedToArray(_secondsWithDot$split, 2),
1845
- ms = _secondsWithDot$split2[1];
1846
-
1644
+ _secondsWithDot$split2 = _slicedToArray(_secondsWithDot$split, 2),
1645
+ ms = _secondsWithDot$split2[1];
1847
1646
  var decimalPlaces = Math.min((_ms$length = ms === null || ms === void 0 ? void 0 : ms.length) !== null && _ms$length !== void 0 ? _ms$length : 0, 16);
1848
1647
  denominator *= Math.pow(10, decimalPlaces);
1849
1648
  samples = Math.round(Number(secondsWithDot) * denominator);
1850
1649
  }
1851
-
1852
1650
  if (timeBase === undefined && useGCD) {
1853
1651
  var gcd = getGreatestCommonDivisor(denominator, samples);
1854
1652
  samples /= gcd;
1855
1653
  denominator /= gcd;
1856
1654
  }
1857
-
1858
1655
  var timeCode = new TimeCode({
1859
1656
  samples: samples,
1860
1657
  timeBase: {
@@ -1862,47 +1659,40 @@ var formatTimeCodeSeconds = function formatTimeCodeSeconds(seconds, options) {
1862
1659
  numerator: 1
1863
1660
  }
1864
1661
  }, timeCodeOptions);
1865
- return timeBase !== undefined ? timeCode.conformTimeBase(createTimeBase(timeBase === true ? 1 : timeBase)) : timeCode;
1662
+ return timeBase !== undefined ? timeCode.conformTimeBase(createTimeBase(timeBase)) : timeCode;
1866
1663
  };
1867
1664
 
1868
1665
  var getDroppedFramesFromSmpte = function getDroppedFramesFromSmpte(_ref, samples, timeBase) {
1869
1666
  var _ref2 = _slicedToArray(_ref, 4),
1870
- hh = _ref2[0],
1871
- mm = _ref2[1],
1872
- ss = _ref2[2],
1873
- ff = _ref2[3];
1874
-
1667
+ hh = _ref2[0],
1668
+ mm = _ref2[1],
1669
+ ss = _ref2[2],
1670
+ ff = _ref2[3];
1875
1671
  var roundedFrameRate = timeBase.toRate({
1876
1672
  rounded: true
1877
1673
  });
1878
1674
  var dropFrames = getAmountOfFrameDrops(timeBase);
1879
-
1880
1675
  if (samples === 0 || !dropFrames) {
1881
1676
  return 0;
1882
1677
  }
1883
-
1884
1678
  var shouldDropMinute = mm % 10 !== 0;
1885
1679
  var shouldDropSecond = shouldDropMinute && ss === 0;
1886
1680
  var hourFrames = hh * (3600 * roundedFrameRate - 54 * dropFrames);
1887
1681
  var minuteFrames = mm * 60 * roundedFrameRate - (mm - Math.ceil(mm / 10)) * dropFrames;
1888
1682
  var secondFrames = ss * roundedFrameRate - (shouldDropMinute && ss > 1 ? dropFrames : 0);
1889
-
1890
1683
  if (shouldDropSecond && ff < dropFrames) {
1891
1684
  throw new Error("Frame does not exist for ".concat(timeBase.toConstant() || timeBase.toRate(), " drop-frame"));
1892
1685
  }
1893
-
1894
1686
  var frameFrames = shouldDropSecond ? ff - dropFrames : ff;
1895
1687
  var samplesWithoutDroppedFrames = hourFrames + minuteFrames + secondFrames + frameFrames;
1896
1688
  return samples - samplesWithoutDroppedFrames;
1897
1689
  };
1898
-
1899
1690
  var getSamplesFromSmpte = function getSamplesFromSmpte(smpteValues, timeBase, dropFrame) {
1900
1691
  var _smpteValues = _slicedToArray(smpteValues, 4),
1901
- hh = _smpteValues[0],
1902
- mm = _smpteValues[1],
1903
- ss = _smpteValues[2],
1904
- ff = _smpteValues[3];
1905
-
1692
+ hh = _smpteValues[0],
1693
+ mm = _smpteValues[1],
1694
+ ss = _smpteValues[2],
1695
+ ff = _smpteValues[3];
1906
1696
  var roundedFrameRate = timeBase.toRate({
1907
1697
  rounded: true
1908
1698
  });
@@ -1912,32 +1702,26 @@ var getSamplesFromSmpte = function getSamplesFromSmpte(smpteValues, timeBase, dr
1912
1702
 
1913
1703
  var splitSmpte = function splitSmpte(smpte) {
1914
1704
  var _ref = (smpte === null || smpte === void 0 ? void 0 : smpte.match(/[^0-9:\-_]/)) || [],
1915
- _ref2 = _slicedToArray(_ref, 1),
1916
- nonColonFrameSeparator = _ref2[0];
1917
-
1705
+ _ref2 = _slicedToArray(_ref, 1),
1706
+ nonColonFrameSeparator = _ref2[0];
1918
1707
  var smpteValues = [];
1919
-
1920
1708
  if (nonColonFrameSeparator) {
1921
1709
  var _smpte$split = smpte.split(nonColonFrameSeparator),
1922
- _smpte$split2 = _slicedToArray(_smpte$split, 2),
1923
- hhmmss = _smpte$split2[0],
1924
- ff = _smpte$split2[1];
1925
-
1710
+ _smpte$split2 = _slicedToArray(_smpte$split, 2),
1711
+ hhmmss = _smpte$split2[0],
1712
+ ff = _smpte$split2[1];
1926
1713
  smpteValues = [].concat(_toConsumableArray(hhmmss.split(':')), [ff]);
1927
1714
  } else {
1928
1715
  smpteValues = smpte.split(':');
1929
1716
  }
1930
-
1931
1717
  if (smpteValues.length !== 4) {
1932
1718
  throw new Error('Invalid format, must be "##:##:##:##');
1933
1719
  }
1934
-
1935
1720
  if (smpteValues.some(function (n) {
1936
1721
  return Number.isNaN(n);
1937
1722
  })) {
1938
1723
  throw new Error('Invalid format, values must be numbers');
1939
1724
  }
1940
-
1941
1725
  var smpteFrameSeparator = nonColonFrameSeparator || ':';
1942
1726
  return {
1943
1727
  smpteValues: smpteValues.map(Number),
@@ -1946,12 +1730,9 @@ var splitSmpte = function splitSmpte(smpte) {
1946
1730
  };
1947
1731
 
1948
1732
  var _excluded$4 = ["exceedingMode", "timeBase"];
1949
-
1950
1733
  function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1951
-
1952
1734
  function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$9(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1953
1735
  var EXCEEDING_OPTIONS = ['error', 'add', 'ignore'];
1954
-
1955
1736
  /**
1956
1737
  * Format smpte text to a TimeCode Instance
1957
1738
  *
@@ -1968,98 +1749,79 @@ var EXCEEDING_OPTIONS = ['error', 'add', 'ignore'];
1968
1749
  */
1969
1750
  var formatTimeCodeSmpte = function formatTimeCodeSmpte(smpte, options) {
1970
1751
  var _ref = options || {},
1971
- _ref$exceedingMode = _ref.exceedingMode,
1972
- exceedingMode = _ref$exceedingMode === void 0 ? 'error' : _ref$exceedingMode,
1973
- timeBase = _ref.timeBase,
1974
- timeCodeOptions = _objectWithoutProperties(_ref, _excluded$4);
1975
-
1752
+ _ref$exceedingMode = _ref.exceedingMode,
1753
+ exceedingMode = _ref$exceedingMode === void 0 ? 'error' : _ref$exceedingMode,
1754
+ timeBase = _ref.timeBase,
1755
+ timeCodeOptions = _objectWithoutProperties(_ref, _excluded$4);
1976
1756
  if ([null, undefined].includes(smpte)) {
1977
1757
  throw new Error("smpte cannot be undefined or null");
1978
1758
  }
1979
-
1980
1759
  if (typeof smpte !== 'string') {
1981
1760
  throw new Error("smpte must be a string, is ".concat(JSON.stringify(smpte)));
1982
1761
  }
1983
-
1984
1762
  var _splitSmpte = splitSmpte(smpte),
1985
- smpteValues = _splitSmpte.smpteValues,
1986
- smpteFrameSeparator = _splitSmpte.smpteFrameSeparator;
1987
-
1763
+ smpteValues = _splitSmpte.smpteValues,
1764
+ smpteFrameSeparator = _splitSmpte.smpteFrameSeparator;
1988
1765
  var timeBaseInstance = createTimeBase(timeBase);
1989
-
1990
1766
  var mergedOptions = _objectSpread$9(_objectSpread$9({}, timeCodeOptions), {}, {
1991
1767
  frameSeparator: (timeCodeOptions === null || timeCodeOptions === void 0 ? void 0 : timeCodeOptions.frameSeparator) || smpteFrameSeparator
1992
1768
  }, (timeCodeOptions === null || timeCodeOptions === void 0 ? void 0 : timeCodeOptions.dropFrame) === undefined ? {
1993
1769
  dropFrame: timeBase !== undefined ? isDropFrameTimeBase(timeBaseInstance) : [';', ','].includes(smpteFrameSeparator)
1994
1770
  } : {});
1995
-
1996
1771
  var roundedFrameRate = timeBaseInstance.toRate({
1997
1772
  rounded: true
1998
1773
  });
1999
1774
  var maxFrame = Math.max(0, roundedFrameRate - 1);
2000
-
2001
1775
  if (smpteValues.some(function (v) {
2002
1776
  return v < 0;
2003
1777
  })) {
2004
1778
  throw new Error('Negative values are not supported');
2005
1779
  }
2006
-
2007
1780
  var samples;
2008
-
2009
1781
  switch (exceedingMode) {
2010
1782
  case 'error':
2011
1783
  {
2012
1784
  var _smpteValues = _slicedToArray(smpteValues, 4),
2013
- hours = _smpteValues[0],
2014
- minutes = _smpteValues[1],
2015
- seconds = _smpteValues[2],
2016
- frames = _smpteValues[3];
2017
-
1785
+ hours = _smpteValues[0],
1786
+ minutes = _smpteValues[1],
1787
+ seconds = _smpteValues[2],
1788
+ frames = _smpteValues[3];
2018
1789
  if (hours >= 100) {
2019
1790
  throw Error('Minutes has to be less than 60');
2020
1791
  }
2021
-
2022
1792
  if (minutes >= 60) {
2023
1793
  throw Error('Minutes has to be less than 60');
2024
1794
  }
2025
-
2026
1795
  if (seconds >= 60) {
2027
1796
  throw Error('Seconds has to be less than 60');
2028
1797
  }
2029
-
2030
1798
  if (frames > maxFrame) {
2031
1799
  throw Error("Frames has to be less or equal to ".concat(maxFrame));
2032
1800
  }
2033
-
2034
1801
  samples = getSamplesFromSmpte(smpteValues, timeBaseInstance, mergedOptions === null || mergedOptions === void 0 ? void 0 : mergedOptions.dropFrame);
2035
1802
  break;
2036
1803
  }
2037
-
2038
1804
  case 'ignore':
2039
1805
  {
2040
1806
  var _smpteValues2 = _slicedToArray(smpteValues, 4),
2041
- _hours = _smpteValues2[0],
2042
- _minutes = _smpteValues2[1],
2043
- _seconds = _smpteValues2[2],
2044
- _frames = _smpteValues2[3];
2045
-
1807
+ _hours = _smpteValues2[0],
1808
+ _minutes = _smpteValues2[1],
1809
+ _seconds = _smpteValues2[2],
1810
+ _frames = _smpteValues2[3];
2046
1811
  var truncatedSmpteValues = [Math.min(100, _hours), Math.min(59, _minutes), Math.min(59, _seconds), Math.min(maxFrame, _frames)];
2047
1812
  samples = getSamplesFromSmpte(truncatedSmpteValues, timeBaseInstance, mergedOptions === null || mergedOptions === void 0 ? void 0 : mergedOptions.dropFrame);
2048
1813
  break;
2049
1814
  }
2050
-
2051
1815
  case 'add':
2052
1816
  {
2053
1817
  samples = getSamplesFromSmpte(smpteValues, timeBaseInstance, mergedOptions === null || mergedOptions === void 0 ? void 0 : mergedOptions.dropFrame);
2054
1818
  break;
2055
1819
  }
2056
-
2057
1820
  default:
2058
1821
  {
2059
1822
  throw new Error("Invalid exceedingMode, options are ".concat(JSON.stringify(EXCEEDING_OPTIONS)));
2060
1823
  }
2061
1824
  }
2062
-
2063
1825
  return new TimeCode({
2064
1826
  samples: samples,
2065
1827
  timeBase: timeBaseInstance
@@ -2067,7 +1829,6 @@ var formatTimeCodeSmpte = function formatTimeCodeSmpte(smpte, options) {
2067
1829
  };
2068
1830
 
2069
1831
  var _excluded$3 = ["timeBase"];
2070
-
2071
1832
  /**
2072
1833
  * Format text to a TimeCode instance
2073
1834
  *
@@ -2077,13 +1838,10 @@ var _excluded$3 = ["timeBase"];
2077
1838
  */
2078
1839
  var formatTimeCodeText = function formatTimeCodeText(timeCodeText, options) {
2079
1840
  var _timeCodeObject;
2080
-
2081
1841
  var _ref = options || {},
2082
- timeBase = _ref.timeBase,
2083
- timeCodeOptions = _objectWithoutProperties(_ref, _excluded$3);
2084
-
1842
+ timeBase = _ref.timeBase,
1843
+ timeCodeOptions = _objectWithoutProperties(_ref, _excluded$3);
2085
1844
  var timeCodeObject;
2086
-
2087
1845
  if (timeCodeText === undefined) {
2088
1846
  timeCodeObject = {
2089
1847
  samples: 0
@@ -2094,10 +1852,9 @@ var formatTimeCodeText = function formatTimeCodeText(timeCodeText, options) {
2094
1852
  };
2095
1853
  } else if (timeCodeText.includes('@')) {
2096
1854
  var _timeCodeText$split = timeCodeText.split('@'),
2097
- _timeCodeText$split2 = _slicedToArray(_timeCodeText$split, 2),
2098
- samplesString = _timeCodeText$split2[0],
2099
- timeBaseText = _timeCodeText$split2[1];
2100
-
1855
+ _timeCodeText$split2 = _slicedToArray(_timeCodeText$split, 2),
1856
+ samplesString = _timeCodeText$split2[0],
1857
+ timeBaseText = _timeCodeText$split2[1];
2101
1858
  var samples = Number(samplesString);
2102
1859
  timeCodeObject = {
2103
1860
  samples: samples,
@@ -2116,11 +1873,9 @@ var formatTimeCodeText = function formatTimeCodeText(timeCodeText, options) {
2116
1873
  samples: Number(timeCodeText)
2117
1874
  };
2118
1875
  }
2119
-
2120
1876
  if (Number.isNaN((_timeCodeObject = timeCodeObject) === null || _timeCodeObject === void 0 ? void 0 : _timeCodeObject.samples) || timeCodeObject.timeBase && !(timeCodeObject.timeBase instanceof TimeBase)) {
2121
1877
  throw new Error("timeCodeText must be a number or sample@timeBase - is ".concat(timeCodeText));
2122
1878
  }
2123
-
2124
1879
  var timeCode = new TimeCode(timeCodeObject, timeCodeOptions);
2125
1880
  return timeBase ? timeCode.conformTimeBase(createTimeBase(timeBase)) : timeCode;
2126
1881
  };
@@ -2141,11 +1896,9 @@ var formatTimeCodeType = function formatTimeCodeType(timeCode, options) {
2141
1896
  var hasSmpteFormat = function hasSmpteFormat(s) {
2142
1897
  return !!s.match(/^(\d\d+):(\d\d+):(\d\d+)(:|;|\.|,)(\d\d+)$/);
2143
1898
  };
2144
-
2145
1899
  var isNumber = function isNumber(s) {
2146
1900
  return !Number.isNaN(Number(s));
2147
1901
  };
2148
-
2149
1902
  /**
2150
1903
  * Create a TimeCode instance from smpte, seconds/samples, timeCode object or string
2151
1904
  *
@@ -2157,42 +1910,38 @@ var isNumber = function isNumber(s) {
2157
1910
  */
2158
1911
  var createTimeCode = function createTimeCode(timeCode, options) {
2159
1912
  // TimeCode
2160
- if (typeof timeCode !== 'string' && typeof timeCode !== 'number') return formatTimeCodeType(timeCode, options); // SMPTE
2161
-
1913
+ if (typeof timeCode !== 'string' && typeof timeCode !== 'number') return formatTimeCodeType(timeCode, options);
1914
+ // SMPTE
2162
1915
  if (typeof timeCode === 'string' && hasSmpteFormat(timeCode)) return formatTimeCodeSmpte(timeCode, options);
2163
1916
  if (['string', 'number'].includes(_typeof(timeCode)) && isNumber(timeCode)) return formatTimeCodeSeconds(timeCode, options);
2164
-
2165
1917
  if (typeof timeCode === 'string') {
2166
1918
  return formatTimeCodeText(timeCode, options);
2167
1919
  }
2168
-
2169
1920
  return undefined;
2170
1921
  };
2171
1922
 
2172
1923
  function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2173
-
2174
1924
  function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$8(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2175
-
2176
1925
  function timeToCueTime(_ref) {
2177
1926
  var _ref$hours = _ref.hours,
2178
- hours = _ref$hours === void 0 ? 0 : _ref$hours,
2179
- _ref$minutes = _ref.minutes,
2180
- minutes = _ref$minutes === void 0 ? 0 : _ref$minutes,
2181
- _ref$seconds = _ref.seconds,
2182
- seconds = _ref$seconds === void 0 ? 0 : _ref$seconds,
2183
- _ref$partialSeconds = _ref.partialSeconds,
2184
- partialSeconds = _ref$partialSeconds === void 0 ? 0 : _ref$partialSeconds;
1927
+ hours = _ref$hours === void 0 ? 0 : _ref$hours,
1928
+ _ref$minutes = _ref.minutes,
1929
+ minutes = _ref$minutes === void 0 ? 0 : _ref$minutes,
1930
+ _ref$seconds = _ref.seconds,
1931
+ seconds = _ref$seconds === void 0 ? 0 : _ref$seconds,
1932
+ _ref$partialSeconds = _ref.partialSeconds,
1933
+ partialSeconds = _ref$partialSeconds === void 0 ? 0 : _ref$partialSeconds;
2185
1934
  var hourStr = hours.toFixed().padStart(2, '0');
2186
1935
  var minStr = minutes.toFixed().padStart(2, '0');
2187
1936
  var secondsStr = seconds.toFixed().padStart(2, '0');
2188
1937
  var partialStr = (partialSeconds * 10).toFixed().padStart(3, '0');
2189
1938
  return "".concat(hourStr, ":").concat(minStr, ":").concat(secondsStr, ".").concat(partialStr);
2190
1939
  }
2191
-
2192
1940
  var defaultOptions$2 = {
2193
1941
  subtitleGroup: 'stl_subtitle',
2194
1942
  subtitleField: 'stl_text'
2195
1943
  };
1944
+
2196
1945
  /**
2197
1946
  * Convert metadata subtitle groups to WebVtt subtitles
2198
1947
  *
@@ -2202,16 +1951,13 @@ var defaultOptions$2 = {
2202
1951
  *
2203
1952
  * @category Metadata
2204
1953
  */
2205
-
2206
1954
  var metadataTypeToWebVtt = function metadataTypeToWebVtt(metadataType, options) {
2207
1955
  var _defaultOptions = _objectSpread$8(_objectSpread$8({}, defaultOptions$2), options || {}),
2208
- subtitleGroup = _defaultOptions.subtitleGroup,
2209
- subtitleField = _defaultOptions.subtitleField;
2210
-
1956
+ subtitleGroup = _defaultOptions.subtitleGroup,
1957
+ subtitleField = _defaultOptions.subtitleField;
2211
1958
  var _ref2 = metadataType || {},
2212
- _ref2$timespan = _ref2.timespan,
2213
- timespanList = _ref2$timespan === void 0 ? [] : _ref2$timespan;
2214
-
1959
+ _ref2$timespan = _ref2.timespan,
1960
+ timespanList = _ref2$timespan === void 0 ? [] : _ref2$timespan;
2215
1961
  if (timespanList.length === 0) return '';
2216
1962
  var parsedTimespans = parseTimespanList(timespanList, {
2217
1963
  includeTimespanAttributes: true,
@@ -2222,10 +1968,9 @@ var metadataTypeToWebVtt = function metadataTypeToWebVtt(metadataType, options)
2222
1968
  });
2223
1969
  var vttCues = parsedTimespans.map(function (timespan) {
2224
1970
  var _ref3 = (Array.isArray(timespan) ? timespan[0] : timespan) || {},
2225
- startText = _ref3.start,
2226
- endText = _ref3.end,
2227
- _ref3$subtitleGroup = _ref3[subtitleGroup];
2228
-
1971
+ startText = _ref3.start,
1972
+ endText = _ref3.end,
1973
+ _ref3$subtitleGroup = _ref3[subtitleGroup];
2229
1974
  _ref3$subtitleGroup = _ref3$subtitleGroup === void 0 ? {} : _ref3$subtitleGroup;
2230
1975
  var text = _ref3$subtitleGroup[subtitleField];
2231
1976
  if (!text) return '';
@@ -2261,9 +2006,7 @@ var createFacetType = function createFacetType() {
2261
2006
  };
2262
2007
 
2263
2008
  function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2264
-
2265
2009
  function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2266
-
2267
2010
  /** Parsed facet type */
2268
2011
 
2269
2012
  /**
@@ -2279,11 +2022,11 @@ var parseFacetType = function parseFacetType() {
2279
2022
  var output = {};
2280
2023
  facetType.forEach(function (_ref) {
2281
2024
  var name = _ref.name,
2282
- field = _ref.field,
2283
- count = _ref.count;
2025
+ field = _ref.field,
2026
+ count = _ref.count;
2284
2027
  output[name || field] = count.reduce(function (acc, _ref2) {
2285
2028
  var fieldValue = _ref2.fieldValue,
2286
- value = _ref2.value;
2029
+ value = _ref2.value;
2287
2030
  return _objectSpread$7(_objectSpread$7({}, acc), {}, _defineProperty({}, fieldValue, value));
2288
2031
  }, {});
2289
2032
  });
@@ -2291,14 +2034,13 @@ var parseFacetType = function parseFacetType() {
2291
2034
  };
2292
2035
 
2293
2036
  function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2294
-
2295
2037
  function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2296
-
2297
2038
  var defaultOptions$1 = {
2298
2039
  arrayOnSingle: true,
2299
2040
  joinValue: undefined,
2300
2041
  timespanAsList: false
2301
2042
  };
2043
+
2302
2044
  /**
2303
2045
  * Parses highlight timespan in VidiCore into key/value object.
2304
2046
  * The attributes can be targeted for each sub-type.
@@ -2307,48 +2049,40 @@ var defaultOptions$1 = {
2307
2049
  *
2308
2050
  * @category Search
2309
2051
  */
2310
-
2311
2052
  var parseHighlightTimespan = function parseHighlightTimespan(timespan, options) {
2312
2053
  var _defaultOptions = _objectSpread$6(_objectSpread$6({}, defaultOptions$1), options || {}),
2313
- _defaultOptions$array = _defaultOptions.arrayOnSingle,
2314
- arrayOnSingle = _defaultOptions$array === void 0 ? true : _defaultOptions$array,
2315
- _defaultOptions$joinV = _defaultOptions.joinValue,
2316
- joinValue = _defaultOptions$joinV === void 0 ? undefined : _defaultOptions$joinV,
2317
- _defaultOptions$times = _defaultOptions.timespanAsList,
2318
- timespanAsList = _defaultOptions$times === void 0 ? false : _defaultOptions$times;
2319
-
2054
+ _defaultOptions$array = _defaultOptions.arrayOnSingle,
2055
+ arrayOnSingle = _defaultOptions$array === void 0 ? true : _defaultOptions$array,
2056
+ _defaultOptions$joinV = _defaultOptions.joinValue,
2057
+ joinValue = _defaultOptions$joinV === void 0 ? undefined : _defaultOptions$joinV,
2058
+ _defaultOptions$times = _defaultOptions.timespanAsList,
2059
+ timespanAsList = _defaultOptions$times === void 0 ? false : _defaultOptions$times;
2320
2060
  var _ref = timespan || {},
2321
- _ref$field = _ref.field,
2322
- field = _ref$field === void 0 ? [] : _ref$field,
2323
- start = _ref.start,
2324
- end = _ref.end;
2325
-
2061
+ _ref$field = _ref.field,
2062
+ field = _ref$field === void 0 ? [] : _ref$field,
2063
+ start = _ref.start,
2064
+ end = _ref.end;
2326
2065
  var initialValue = timespanAsList ? {
2327
2066
  start: start,
2328
2067
  end: end
2329
2068
  } : {};
2330
2069
  var fieldList = field.reduce(function (acc, curr) {
2331
2070
  var name = curr.name,
2332
- _curr$value = curr.value,
2333
- valueList = _curr$value === void 0 ? [] : _curr$value;
2071
+ _curr$value = curr.value,
2072
+ valueList = _curr$value === void 0 ? [] : _curr$value;
2334
2073
  if (valueList.length === 0) return acc;
2335
2074
  var fieldValue;
2336
-
2337
2075
  if (arrayOnSingle === false && valueList.length === 1) {
2338
2076
  var _valueList = _slicedToArray(valueList, 1);
2339
-
2340
2077
  fieldValue = _valueList[0];
2341
2078
  } else if (joinValue) fieldValue = valueList.join(joinValue);else fieldValue = valueList;
2342
-
2343
2079
  return _objectSpread$6(_objectSpread$6({}, acc), {}, _defineProperty({}, name, fieldValue));
2344
2080
  }, initialValue);
2345
2081
  return fieldList;
2346
2082
  };
2347
2083
 
2348
2084
  var _excluded$2 = ["timespanAsList", "joinTimespan", "flat", "flatTimespan"];
2349
-
2350
2085
  function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2351
-
2352
2086
  function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2353
2087
  var defaultOptions = _objectSpread$5(_objectSpread$5({}, defaultOptions$1), {}, {
2354
2088
  timespanAsList: false,
@@ -2356,6 +2090,7 @@ var defaultOptions = _objectSpread$5(_objectSpread$5({}, defaultOptions$1), {},
2356
2090
  flat: false,
2357
2091
  flatTimespan: false
2358
2092
  });
2093
+
2359
2094
  /**
2360
2095
  * Parses highlight timespans from VidiCore into key/value object.
2361
2096
  * The attributes can be targeted for each sub-type.
@@ -2365,19 +2100,16 @@ var defaultOptions = _objectSpread$5(_objectSpread$5({}, defaultOptions$1), {},
2365
2100
  *
2366
2101
  * @category Search
2367
2102
  */
2368
-
2369
2103
  var parseHighlightTimespanList = function parseHighlightTimespanList() {
2370
2104
  var highlightTimespanList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
2371
2105
  var options = arguments.length > 1 ? arguments[1] : undefined;
2372
-
2373
2106
  var _defaultOptions = _objectSpread$5(_objectSpread$5({}, defaultOptions), options || {}),
2374
- timespanAsList = _defaultOptions.timespanAsList,
2375
- _defaultOptions$joinT = _defaultOptions.joinTimespan,
2376
- joinTimespan = _defaultOptions$joinT === void 0 ? '_' : _defaultOptions$joinT,
2377
- flat = _defaultOptions.flat,
2378
- flatTimespan = _defaultOptions.flatTimespan,
2379
- parseHighlightTimespanOptions = _objectWithoutProperties(_defaultOptions, _excluded$2);
2380
-
2107
+ timespanAsList = _defaultOptions.timespanAsList,
2108
+ _defaultOptions$joinT = _defaultOptions.joinTimespan,
2109
+ joinTimespan = _defaultOptions$joinT === void 0 ? '_' : _defaultOptions$joinT,
2110
+ flat = _defaultOptions.flat,
2111
+ flatTimespan = _defaultOptions.flatTimespan,
2112
+ parseHighlightTimespanOptions = _objectWithoutProperties(_defaultOptions, _excluded$2);
2381
2113
  if (timespanAsList === true) return highlightTimespanList.map(function (timespan) {
2382
2114
  return parseHighlightTimespan(timespan, _objectSpread$5(_objectSpread$5({}, parseHighlightTimespanOptions), {}, {
2383
2115
  timespanAsList: timespanAsList
@@ -2391,59 +2123,62 @@ var parseHighlightTimespanList = function parseHighlightTimespanList() {
2391
2123
  }, {});
2392
2124
  };
2393
2125
 
2126
+ /**
2127
+ * Parse Vidicore "NOW" constants to a date object
2128
+ *
2129
+ * Format: `NOW[+/-][number][HOUR/DAY/MONTH/YEAR(s)]` (e.g. "NOW-2HOURS")
2130
+ *
2131
+ * @remarks
2132
+ * Returns an approximate date since it's created client side
2133
+ *
2134
+ * @param value A "NOW" constant
2135
+ * @returns A date from the NOW constant
2136
+ *
2137
+ * @category Search
2138
+ */
2394
2139
  var parseNowDate = function parseNowDate() {
2395
2140
  var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'NOW';
2396
-
2397
2141
  if (value.startsWith('NOW')) {
2398
2142
  if (value === 'NOW') return new Date();
2399
2143
  var sign = value[3];
2400
2144
  var number = Number(value.match(/(\d+)/)[0]);
2401
2145
  var unit = value.match(/(\d.*)/)[0].replace(/\d/g, '');
2402
2146
  var nowDiff = new Date();
2403
-
2404
2147
  switch (unit) {
2405
2148
  case 'HOUR':
2406
2149
  case 'HOURS':
2407
2150
  if (sign === '+') nowDiff.setHours(nowDiff.getHours() + number);
2408
2151
  if (sign === '-') nowDiff.setHours(nowDiff.getHours() - number);
2409
2152
  break;
2410
-
2411
2153
  case 'DAY':
2412
2154
  case 'DAYS':
2413
2155
  if (sign === '+') nowDiff.setDate(nowDiff.getDate() + number);
2414
2156
  if (sign === '-') nowDiff.setDate(nowDiff.getDate() - number);
2415
2157
  break;
2416
-
2417
2158
  case 'MONTH':
2418
2159
  case 'MONTHS':
2419
2160
  if (sign === '+') nowDiff.setMonth(nowDiff.getMonth() + number);
2420
2161
  if (sign === '-') nowDiff.setMonth(nowDiff.getMonth() - number);
2421
2162
  break;
2422
-
2423
2163
  case 'YEAR':
2424
2164
  case 'YEARS':
2425
2165
  if (sign === '+') nowDiff.setFullYear(nowDiff.getFullYear() + number);
2426
2166
  if (sign === '-') nowDiff.setFullYear(nowDiff.getFullYear() - number);
2427
2167
  break;
2428
2168
  }
2429
-
2430
2169
  return nowDiff;
2431
2170
  }
2432
-
2433
2171
  return new Date(value);
2434
2172
  };
2435
2173
 
2436
2174
  var _excluded$1 = ["property"];
2437
-
2438
2175
  function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2439
-
2440
2176
  function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2441
2177
  var parseBaseMediaInfoType = function parseBaseMediaInfoType(baseMediaInfoType) {
2442
2178
  var _ref = baseMediaInfoType || {},
2443
- _ref$property = _ref.property,
2444
- keyValuePairTypes = _ref$property === void 0 ? [] : _ref$property,
2445
- props = _objectWithoutProperties(_ref, _excluded$1);
2446
-
2179
+ _ref$property = _ref.property,
2180
+ keyValuePairTypes = _ref$property === void 0 ? [] : _ref$property,
2181
+ props = _objectWithoutProperties(_ref, _excluded$1);
2447
2182
  var parsedKeyValuePairType = parseKeyValuePairTypes(keyValuePairTypes);
2448
2183
  return _objectSpread$4(_objectSpread$4({}, parsedKeyValuePairType), props);
2449
2184
  };
@@ -2459,12 +2194,11 @@ var sampleRateSymbols = {
2459
2194
  B: 'Hz',
2460
2195
  mB: 'mHz'
2461
2196
  };
2462
- var bitRateSymbols = {
2197
+ var bitRateSymbols$1 = {
2463
2198
  kB: 'kbps',
2464
2199
  B: 'bps',
2465
2200
  MB: 'mbps'
2466
2201
  };
2467
-
2468
2202
  /**
2469
2203
  * Parses the technical information of a AudioComponentType.
2470
2204
  * @param audioComponentType - A AudioComponentType from VidiCore.
@@ -2474,27 +2208,35 @@ var bitRateSymbols = {
2474
2208
  */
2475
2209
  var parseAudioComponent = function parseAudioComponent(audioComponentType) {
2476
2210
  var timeBase = audioComponentType.timeBase,
2477
- audioChannels = audioComponentType.channelCount,
2478
- audioCodec = audioComponentType.codec,
2479
- mediaInfo = audioComponentType.mediaInfo,
2480
- bitrate = audioComponentType.bitrate,
2481
- metadata = audioComponentType.metadata;
2211
+ audioChannels = audioComponentType.channelCount,
2212
+ audioCodec = audioComponentType.codec,
2213
+ mediaInfo = audioComponentType.mediaInfo,
2214
+ bitrate = audioComponentType.bitrate,
2215
+ metadata = audioComponentType.metadata;
2482
2216
  var audioMediaInfo = parseAudioMediaInfoType(mediaInfo);
2483
2217
  var audioFormat = audioMediaInfo.Format,
2484
- audioBitDepth = audioMediaInfo.Resolution,
2485
- audioBitRateMode = audioMediaInfo.Bit_rate_mode;
2218
+ audioBitDepth = audioMediaInfo.Resolution,
2219
+ audioBitRateMode = audioMediaInfo.Bit_rate_mode;
2486
2220
  var audioMetadata = parseKeyValuePairTypes(metadata || []);
2487
2221
  var audioSamplerateSamples = timeBase !== null && timeBase !== void 0 && timeBase.denominator ? ((timeBase === null || timeBase === void 0 ? void 0 : timeBase.denominator) || 1) / ((timeBase === null || timeBase === void 0 ? void 0 : timeBase.numerator) || 1) : undefined;
2488
- var audioSamplerate = audioSamplerateSamples !== undefined ? parseFileSize(audioSamplerateSamples, {
2222
+ var audioSamplerate = audioSamplerateSamples !== undefined ? filesize(audioSamplerateSamples, {
2489
2223
  base: 10,
2490
2224
  round: 1,
2491
2225
  symbols: sampleRateSymbols
2492
2226
  }) : undefined;
2493
- var audioBitrate = bitrate !== undefined ? parseFileSize(bitrate, {
2494
- base: 10,
2495
- round: 2,
2496
- symbols: bitRateSymbols
2497
- }) : undefined;
2227
+ var audioBitrate;
2228
+ var audioBitrateKbps;
2229
+ if (bitrate !== undefined) {
2230
+ var _split;
2231
+ audioBitrate = filesize(bitrate, {
2232
+ round: 2,
2233
+ symbols: bitRateSymbols$1
2234
+ });
2235
+ audioBitrateKbps = Number((_split = filesize(bitrate, {
2236
+ exponent: 1,
2237
+ symbols: bitRateSymbols$1
2238
+ }).split(' kbps')) === null || _split === void 0 ? void 0 : _split[0]);
2239
+ }
2498
2240
  return {
2499
2241
  audioFormat: audioFormat,
2500
2242
  audioCodec: audioCodec,
@@ -2502,6 +2244,7 @@ var parseAudioComponent = function parseAudioComponent(audioComponentType) {
2502
2244
  audioSamplerateSamples: audioSamplerateSamples,
2503
2245
  audioBitDepth: audioBitDepth,
2504
2246
  audioBitrate: audioBitrate,
2247
+ audioBitrateKbps: audioBitrateKbps,
2505
2248
  audioBitRateMode: audioBitRateMode,
2506
2249
  audioChannels: audioChannels,
2507
2250
  audioMediaInfo: audioMediaInfo,
@@ -2509,9 +2252,43 @@ var parseAudioComponent = function parseAudioComponent(audioComponentType) {
2509
2252
  };
2510
2253
  };
2511
2254
 
2255
+ /**
2256
+ * Const object with all file states in VidiCore
2257
+ * (see https://apidoc.vidispine.com/latest/storage/storage.html#file-states for more info)
2258
+ *
2259
+ * @category File
2260
+ */
2261
+ var FILE_STATES = {
2262
+ /** Just created, not used. */
2263
+ NONE: 'NONE',
2264
+ /** Discovered or created, not yet marked as finished. */
2265
+ OPEN: 'OPEN',
2266
+ /** File does no longer grow. */
2267
+ CLOSED: 'CLOSED',
2268
+ /** The current state is not known. */
2269
+ UNKNOWN: 'UNKNOWN',
2270
+ /** File is missing from the file system/storage. */
2271
+ MISSING: 'MISSING',
2272
+ /** File has been missing for a longer period. Candidate for restoration from archive. */
2273
+ LOST: 'LOST',
2274
+ /** File will appear on file system/storage, transfer subsystem or transcoder will create it. */
2275
+ TO_APPEAR: 'TO_APPEAR',
2276
+ /** The file is no longer in use, and will be deleted at the next clean-up sweep. */
2277
+ TO_BE_DELETED: 'TO_BE_DELETED',
2278
+ /** File is in use by transfer subsystem or transcoder. */
2279
+ BEING_READ: 'BEING_READ',
2280
+ /** File is archived. */
2281
+ ARCHIVED: 'ARCHIVED',
2282
+ /** File will be synchronized by multi-site agent. */
2283
+ AWAITING_SYNC: 'AWAITING_SYNC'
2284
+ };
2285
+
2512
2286
  /**
2513
2287
  * Parses a VidiCore file object
2514
2288
  *
2289
+ * @remarks
2290
+ * File sizes are parsed with JEDEC standard (base 2)
2291
+ *
2515
2292
  * @param fileType VidiCore file object
2516
2293
  * @returns A parsed file object
2517
2294
  *
@@ -2519,16 +2296,17 @@ var parseAudioComponent = function parseAudioComponent(audioComponentType) {
2519
2296
  */
2520
2297
  var parseFileType = function parseFileType(fileType) {
2521
2298
  var _fileType$uri = fileType.uri,
2522
- uriList = _fileType$uri === void 0 ? [] : _fileType$uri,
2523
- fileSizeBytes = fileType.size,
2524
- hash = fileType.hash,
2525
- path = fileType.path,
2526
- fileId = fileType.id;
2527
-
2299
+ uriList = _fileType$uri === void 0 ? [] : _fileType$uri,
2300
+ fileSizeBytes = fileType.size,
2301
+ hash = fileType.hash,
2302
+ path = fileType.path,
2303
+ fileId = fileType.id;
2528
2304
  var _uriList = _slicedToArray(uriList, 1),
2529
- uri = _uriList[0];
2530
-
2531
- var fileSize = fileSizeBytes !== undefined ? parseFileSize(fileSizeBytes) : '';
2305
+ uri = _uriList[0];
2306
+ var fileSize = fileSizeBytes !== undefined ? filesize(fileSizeBytes, {
2307
+ base: 2,
2308
+ standard: 'jedec'
2309
+ }) : '';
2532
2310
  var fileName = path ? path.split('/').pop() : undefined;
2533
2311
  return {
2534
2312
  uri: uri,
@@ -2542,9 +2320,7 @@ var parseFileType = function parseFileType(fileType) {
2542
2320
  };
2543
2321
 
2544
2322
  function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2545
-
2546
2323
  function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2547
-
2548
2324
  /**
2549
2325
  * Parses the technical information of a BinaryComponentType.
2550
2326
  * @param binaryComponentType - A BinaryComponentType from VidiCore.
@@ -2555,30 +2331,27 @@ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) {
2555
2331
  var parseBinaryComponent = function parseBinaryComponent() {
2556
2332
  var binaryComponentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2557
2333
  var fileList = binaryComponentType.file,
2558
- mediaInfo = binaryComponentType.mediaInfo,
2559
- _binaryComponentType$ = binaryComponentType.metadata,
2560
- metadata = _binaryComponentType$ === void 0 ? [] : _binaryComponentType$;
2334
+ mediaInfo = binaryComponentType.mediaInfo,
2335
+ _binaryComponentType$ = binaryComponentType.metadata,
2336
+ metadata = _binaryComponentType$ === void 0 ? [] : _binaryComponentType$;
2561
2337
  var binaryMetadata = parseKeyValuePairTypes(metadata);
2562
2338
  var binaryMediaInfo = parseBaseMediaInfoType(mediaInfo);
2563
2339
  var parsedBinaryComponent = {
2564
2340
  binaryMetadata: binaryMetadata,
2565
2341
  binaryMediaInfo: binaryMediaInfo
2566
2342
  };
2567
-
2568
2343
  if (fileList) {
2569
2344
  var _fileList = _slicedToArray(fileList, 1),
2570
- fileType = _fileList[0];
2571
-
2345
+ fileType = _fileList[0];
2572
2346
  var parsedFileType = parseFileType(fileType);
2573
2347
  parsedBinaryComponent = _objectSpread$3(_objectSpread$3({}, parsedBinaryComponent), parsedFileType);
2574
2348
  }
2575
-
2576
2349
  return parsedBinaryComponent;
2577
2350
  };
2578
2351
 
2579
2352
  function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2580
-
2581
2353
  function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2354
+
2582
2355
  /**
2583
2356
  * Parsed container component
2584
2357
  */
@@ -2593,32 +2366,27 @@ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) {
2593
2366
  var parseContainerComponent = function parseContainerComponent() {
2594
2367
  var containerComponentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2595
2368
  var mediaInfo = containerComponentType.mediaInfo,
2596
- metadata = containerComponentType.metadata,
2597
- fileList = containerComponentType.file,
2598
- durationTimeCode = containerComponentType.duration,
2599
- startTimestamp = containerComponentType.startTimestamp,
2600
- startTimecode = containerComponentType.startTimecode,
2601
- timeCodeTimeBase = containerComponentType.timeCodeTimeBase;
2369
+ metadata = containerComponentType.metadata,
2370
+ fileList = containerComponentType.file,
2371
+ durationTimeCode = containerComponentType.duration,
2372
+ startTimestamp = containerComponentType.startTimestamp,
2373
+ startTimecode = containerComponentType.startTimecode,
2374
+ timeCodeTimeBase = containerComponentType.timeCodeTimeBase;
2602
2375
  var containerMetadata = parseKeyValuePairTypes(metadata || []);
2603
2376
  var containerMediaInfo = parseBaseMediaInfoType(mediaInfo);
2604
2377
  var containerFormat = containerMediaInfo.Format;
2605
2378
  var videoFormat = containerMediaInfo.Video_Format_List,
2606
- audioFormat = containerMediaInfo.Audio_Format_List,
2607
- textFormat = containerMediaInfo.Text_Format_List;
2608
-
2379
+ audioFormat = containerMediaInfo.Audio_Format_List,
2380
+ textFormat = containerMediaInfo.Text_Format_List;
2609
2381
  if (containerFormat === undefined) {
2610
2382
  var format = containerComponentType.format;
2611
2383
  containerFormat = format;
2612
-
2613
2384
  if (format && format.includes(',')) {
2614
2385
  var formatList = format.split(',');
2615
-
2616
2386
  var _formatList = _slicedToArray(formatList, 1);
2617
-
2618
2387
  containerFormat = _formatList[0];
2619
2388
  }
2620
2389
  }
2621
-
2622
2390
  var parsedContainerComponentType = {
2623
2391
  containerFormat: containerFormat,
2624
2392
  videoFormat: videoFormat,
@@ -2627,39 +2395,37 @@ var parseContainerComponent = function parseContainerComponent() {
2627
2395
  containerMetadata: containerMetadata,
2628
2396
  containerMediaInfo: containerMediaInfo
2629
2397
  };
2630
-
2631
2398
  if (containerMetadata.componentOriginalFilename) {
2632
2399
  parsedContainerComponentType.originalFilename = containerMetadata.componentOriginalFilename;
2633
2400
  }
2634
-
2635
2401
  if (durationTimeCode !== undefined && durationTimeCode.samples !== 0) {
2636
2402
  var timeCode = formatTimeCodeType(durationTimeCode);
2637
2403
  parsedContainerComponentType.durationTimeCode = timeCode.toObject();
2638
2404
  parsedContainerComponentType.duration = timeCode.toDuration();
2639
2405
  }
2640
-
2641
2406
  if (startTimestamp) {
2642
2407
  parsedContainerComponentType.startTimestamp = formatTimeCodeType(startTimestamp).toObject();
2643
2408
  }
2644
-
2645
2409
  if (startTimecode !== undefined && timeCodeTimeBase) {
2646
2410
  parsedContainerComponentType.startTimecode = formatTimeCodeType({
2647
2411
  samples: startTimecode,
2648
2412
  timeBase: timeCodeTimeBase
2649
2413
  });
2650
2414
  }
2651
-
2652
2415
  if (fileList) {
2653
2416
  var _fileList = _slicedToArray(fileList, 1),
2654
- fileType = _fileList[0];
2655
-
2417
+ fileType = _fileList[0];
2656
2418
  var parsedFileType = parseFileType(fileType);
2657
2419
  parsedContainerComponentType = _objectSpread$2(_objectSpread$2({}, parsedContainerComponentType), parsedFileType);
2658
2420
  }
2659
-
2660
2421
  return parsedContainerComponentType;
2661
2422
  };
2662
2423
 
2424
+ var bitRateSymbols = {
2425
+ kB: 'kbps',
2426
+ B: 'bps',
2427
+ MB: 'mbps'
2428
+ };
2663
2429
  /**
2664
2430
  * Parses the technical information of a VideoComponentType.
2665
2431
  * @param {Object} videoComponentType - A VideoComponentType from VidiCore.
@@ -2670,23 +2436,22 @@ var parseContainerComponent = function parseContainerComponent() {
2670
2436
  var parseVideoComponent = function parseVideoComponent() {
2671
2437
  var videoComponentType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2672
2438
  var videoCodec = videoComponentType.codec,
2673
- bitrate = videoComponentType.bitrate,
2674
- fieldOrder = videoComponentType.fieldOrder,
2675
- resolution = videoComponentType.resolution,
2676
- mediaInfo = videoComponentType.mediaInfo,
2677
- _videoComponentType$m = videoComponentType.metadata,
2678
- metadata = _videoComponentType$m === void 0 ? [] : _videoComponentType$m;
2439
+ bitrate = videoComponentType.bitrate,
2440
+ fieldOrder = videoComponentType.fieldOrder,
2441
+ resolution = videoComponentType.resolution,
2442
+ mediaInfo = videoComponentType.mediaInfo,
2443
+ _videoComponentType$m = videoComponentType.metadata,
2444
+ metadata = _videoComponentType$m === void 0 ? [] : _videoComponentType$m;
2679
2445
  var videoMediaInfo = parseVideoMediaInfoType(mediaInfo);
2680
2446
  var videoMetadata = parseKeyValuePairTypes(metadata);
2681
2447
  var videoFormat = videoMediaInfo.Format,
2682
- timeBaseText = videoMediaInfo['Frame rate'],
2683
- colorSpace = videoMediaInfo['Color space'],
2684
- colorPrimaries = videoMediaInfo['Color primaries'],
2685
- chromaSubsampling = videoMediaInfo.Colorimetry;
2448
+ timeBaseText = videoMediaInfo['Frame rate'],
2449
+ colorSpace = videoMediaInfo['Color space'],
2450
+ colorPrimaries = videoMediaInfo['Color primaries'],
2451
+ chromaSubsampling = videoMediaInfo.Colorimetry;
2686
2452
  var timeBase;
2687
2453
  var averageFrameRate = videoComponentType.averageFrameRate,
2688
- realBaseFrameRate = videoComponentType.realBaseFrameRate;
2689
-
2454
+ realBaseFrameRate = videoComponentType.realBaseFrameRate;
2690
2455
  if (realBaseFrameRate !== undefined) {
2691
2456
  timeBase = formatTimeBaseType({
2692
2457
  numerator: realBaseFrameRate.denominator,
@@ -2700,18 +2465,14 @@ var parseVideoComponent = function parseVideoComponent() {
2700
2465
  denominator: averageFrameRate.numerator
2701
2466
  });
2702
2467
  }
2703
-
2704
2468
  var samples = videoMediaInfo['Frame count'];
2705
-
2706
2469
  if (samples === undefined) {
2707
2470
  var numberOfPackets = videoComponentType.numberOfPackets;
2708
2471
  if (numberOfPackets !== undefined) samples = numberOfPackets.toString();
2709
2472
  }
2710
-
2711
2473
  var timeCode;
2712
2474
  var frameRate;
2713
2475
  var smpte;
2714
-
2715
2476
  if (samples && timeBase) {
2716
2477
  timeCode = formatTimeCodeType({
2717
2478
  samples: samples,
@@ -2720,16 +2481,24 @@ var parseVideoComponent = function parseVideoComponent() {
2720
2481
  frameRate = timeCode.timeBase.toConstant() || timeCode.timeBase.toRate();
2721
2482
  smpte = timeCode.toSmpte();
2722
2483
  }
2723
-
2724
2484
  var _ref = resolution || {},
2725
- height = _ref.height,
2726
- width = _ref.width;
2727
-
2485
+ height = _ref.height,
2486
+ width = _ref.width;
2728
2487
  var aspectRatio = parseAspectRatio(resolution);
2729
2488
  var dimension = "".concat(width, "x").concat(height);
2730
- var videoBitrate = bitrate ? parseFileSize(bitrate, {
2731
- bits: true
2732
- }) : undefined;
2489
+ var videoBitrate;
2490
+ var videoBitrateMbps;
2491
+ if (bitrate !== undefined) {
2492
+ var _split;
2493
+ videoBitrate = filesize(bitrate, {
2494
+ round: 2,
2495
+ symbols: bitRateSymbols
2496
+ });
2497
+ videoBitrateMbps = Number((_split = filesize(bitrate, {
2498
+ exponent: 2,
2499
+ symbols: bitRateSymbols
2500
+ }).split(' mbps')) === null || _split === void 0 ? void 0 : _split[0]);
2501
+ }
2733
2502
  return {
2734
2503
  videoFormat: videoFormat,
2735
2504
  dimension: dimension,
@@ -2741,6 +2510,7 @@ var parseVideoComponent = function parseVideoComponent() {
2741
2510
  videoCodec: videoCodec,
2742
2511
  smpte: smpte,
2743
2512
  videoBitrate: videoBitrate,
2513
+ videoBitrateMbps: videoBitrateMbps,
2744
2514
  fieldOrder: fieldOrder,
2745
2515
  colorSpace: colorSpace,
2746
2516
  chromaSubsampling: chromaSubsampling,
@@ -2752,9 +2522,7 @@ var parseVideoComponent = function parseVideoComponent() {
2752
2522
  };
2753
2523
 
2754
2524
  function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2755
-
2756
2525
  function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2757
-
2758
2526
  /**
2759
2527
  * Parses the technical information of a ShapeType and its various components.
2760
2528
  *
@@ -2773,55 +2541,47 @@ var parseShapeType = function parseShapeType() {
2773
2541
  var shapeType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2774
2542
  var parsedShape = {};
2775
2543
  var containerComponent = shapeType.containerComponent,
2776
- videoComponentList = shapeType.videoComponent,
2777
- audioComponentList = shapeType.audioComponent,
2778
- binaryComponentList = shapeType.binaryComponent,
2779
- _shapeType$mimeType = shapeType.mimeType,
2780
- mimeTypeList = _shapeType$mimeType === void 0 ? [] : _shapeType$mimeType,
2781
- _shapeType$tag = shapeType.tag,
2782
- tagList = _shapeType$tag === void 0 ? [] : _shapeType$tag;
2783
-
2544
+ videoComponentList = shapeType.videoComponent,
2545
+ audioComponentList = shapeType.audioComponent,
2546
+ binaryComponentList = shapeType.binaryComponent,
2547
+ _shapeType$mimeType = shapeType.mimeType,
2548
+ mimeTypeList = _shapeType$mimeType === void 0 ? [] : _shapeType$mimeType,
2549
+ _shapeType$tag = shapeType.tag,
2550
+ tagList = _shapeType$tag === void 0 ? [] : _shapeType$tag;
2784
2551
  var _tagList = _slicedToArray(tagList, 1);
2785
-
2786
2552
  parsedShape.tag = _tagList[0];
2787
-
2788
2553
  var _mimeTypeList = _slicedToArray(mimeTypeList, 1);
2789
-
2790
2554
  parsedShape.mimeType = _mimeTypeList[0];
2791
-
2792
2555
  if (containerComponent) {
2793
2556
  var parsedContainerComponent = parseContainerComponent(containerComponent);
2794
2557
  parsedShape = _objectSpread$1(_objectSpread$1({}, parsedShape), parsedContainerComponent);
2795
2558
  }
2796
-
2797
2559
  if (videoComponentList) {
2798
2560
  var _videoComponentList = _slicedToArray(videoComponentList, 1),
2799
- videoComponent = _videoComponentList[0];
2800
-
2561
+ videoComponent = _videoComponentList[0];
2801
2562
  var parsedVideoComponent = parseVideoComponent(videoComponent);
2802
2563
  parsedShape = _objectSpread$1(_objectSpread$1({}, parsedShape), parsedVideoComponent);
2803
2564
  }
2804
-
2805
2565
  if (audioComponentList) {
2806
2566
  var _audioComponentList = _slicedToArray(audioComponentList, 1),
2807
- audioComponent = _audioComponentList[0];
2808
-
2567
+ audioComponent = _audioComponentList[0];
2809
2568
  var parsedAudioComponent = parseAudioComponent(audioComponent);
2810
2569
  parsedShape = _objectSpread$1(_objectSpread$1({}, parsedShape), parsedAudioComponent);
2811
2570
  }
2812
-
2813
2571
  if (binaryComponentList) {
2814
2572
  var _binaryComponentList = _slicedToArray(binaryComponentList, 1),
2815
- binaryComponent = _binaryComponentList[0];
2816
-
2573
+ binaryComponent = _binaryComponentList[0];
2817
2574
  var parsedBinaryComponent = parseBinaryComponent(binaryComponent);
2818
2575
  parsedShape = _objectSpread$1(_objectSpread$1({}, parsedShape), parsedBinaryComponent);
2819
2576
  }
2820
-
2821
2577
  return parsedShape;
2822
2578
  };
2823
2579
 
2824
- // eslint-disable-next-line import/no-cycle
2580
+ /**
2581
+ * Const object with document types
2582
+ *
2583
+ * @category Shape
2584
+ */
2825
2585
  var DOCUMENT_TYPES = {
2826
2586
  PDF: 'PDF',
2827
2587
  TEXT: 'TEXT',
@@ -2830,6 +2590,20 @@ var DOCUMENT_TYPES = {
2830
2590
  XML: 'XML'
2831
2591
  };
2832
2592
 
2593
+ /**
2594
+ * Const object with media types
2595
+ *
2596
+ * @category Shape
2597
+ */
2598
+ var SHAPE_MEDIA_TYPES = {
2599
+ IMAGE: 'IMAGE',
2600
+ AUDIO: 'AUDIO',
2601
+ VIDEO: 'VIDEO',
2602
+ DOCUMENT: 'DOCUMENT',
2603
+ BINARY: 'BINARY'
2604
+ };
2605
+
2606
+ // eslint-disable-next-line import/no-cycle
2833
2607
  /**
2834
2608
  * Return a const for the document type of a shape (looks at mimeType)
2835
2609
  *
@@ -2863,21 +2637,20 @@ var QUICKTIME_MIMETYPE = 'video/quicktime';
2863
2637
  var M4V_MIMETYPE = 'video/x-m4v';
2864
2638
  var MP4_CONTAINER = 'MPEG-4';
2865
2639
  var MOV_CONTAINER = 'mov';
2866
- var H264_CODEC = 'h264'; // Sort by tags in the order of previewShapeOrder, secondary alphabetical.
2867
- // using reverse() so the first has highest index
2640
+ var H264_CODEC = 'h264';
2868
2641
 
2642
+ // Sort by tags in the order of previewShapeOrder, secondary alphabetical.
2643
+ // using reverse() so the first has highest index
2869
2644
  var PREVIEW_SHAPE_ORDER = ['__mp4', '__mp3_160k', '__png', '__jpeg', '__gif', 'original'].reverse();
2870
-
2871
2645
  var defaultSortPriority = function defaultSortPriority(_ref, _ref2) {
2872
2646
  var firstEl = _ref.parsedShape.tag;
2873
2647
  var secondEl = _ref2.parsedShape.tag;
2874
-
2875
2648
  if (PREVIEW_SHAPE_ORDER.includes(firstEl) || PREVIEW_SHAPE_ORDER.includes(secondEl)) {
2876
2649
  return PREVIEW_SHAPE_ORDER.indexOf(secondEl) - PREVIEW_SHAPE_ORDER.indexOf(firstEl);
2877
2650
  }
2878
-
2879
2651
  return firstEl.toLowerCase().localeCompare(secondEl.toLowerCase());
2880
2652
  };
2653
+
2881
2654
  /**
2882
2655
  * Filter a shape type list to get shapes that are playable in a browser
2883
2656
  *
@@ -2887,75 +2660,57 @@ var defaultSortPriority = function defaultSortPriority(_ref, _ref2) {
2887
2660
  *
2888
2661
  * @category Shape
2889
2662
  */
2890
-
2891
-
2892
2663
  var filterShapeSource = function filterShapeSource(itemType, options) {
2893
2664
  var _ref3 = options || {},
2894
- _ref3$allowedMimeType = _ref3.allowedMimeTypes,
2895
- allowedMimeTypes = _ref3$allowedMimeType === void 0 ? DEFAULT_ALLOWED_MIME_TYPES : _ref3$allowedMimeType,
2896
- _ref3$allowedMethods = _ref3.allowedMethods,
2897
- allowedMethods = _ref3$allowedMethods === void 0 ? DEFAULT_ALLOWED_METHODS : _ref3$allowedMethods,
2898
- _ref3$sortPriority = _ref3.sortPriority,
2899
- sortPriority = _ref3$sortPriority === void 0 ? defaultSortPriority : _ref3$sortPriority,
2900
- _ref3$sourceKey = _ref3.sourceKey,
2901
- sourceKey = _ref3$sourceKey === void 0 ? 'src' : _ref3$sourceKey,
2902
- _ref3$mimeTypeKey = _ref3.mimeTypeKey,
2903
- mimeTypeKey = _ref3$mimeTypeKey === void 0 ? 'type' : _ref3$mimeTypeKey,
2904
- _ref3$shapeKey = _ref3.shapeKey,
2905
- shapeKey = _ref3$shapeKey === void 0 ? 'shape' : _ref3$shapeKey,
2906
- _ref3$parsedShapeKey = _ref3.parsedShapeKey,
2907
- parsedShapeKey = _ref3$parsedShapeKey === void 0 ? 'parsedShape' : _ref3$parsedShapeKey;
2908
-
2665
+ _ref3$allowedMimeType = _ref3.allowedMimeTypes,
2666
+ allowedMimeTypes = _ref3$allowedMimeType === void 0 ? DEFAULT_ALLOWED_MIME_TYPES : _ref3$allowedMimeType,
2667
+ _ref3$allowedMethods = _ref3.allowedMethods,
2668
+ allowedMethods = _ref3$allowedMethods === void 0 ? DEFAULT_ALLOWED_METHODS : _ref3$allowedMethods,
2669
+ _ref3$sortPriority = _ref3.sortPriority,
2670
+ sortPriority = _ref3$sortPriority === void 0 ? defaultSortPriority : _ref3$sortPriority,
2671
+ _ref3$sourceKey = _ref3.sourceKey,
2672
+ sourceKey = _ref3$sourceKey === void 0 ? 'src' : _ref3$sourceKey,
2673
+ _ref3$mimeTypeKey = _ref3.mimeTypeKey,
2674
+ mimeTypeKey = _ref3$mimeTypeKey === void 0 ? 'type' : _ref3$mimeTypeKey,
2675
+ _ref3$shapeKey = _ref3.shapeKey,
2676
+ shapeKey = _ref3$shapeKey === void 0 ? 'shape' : _ref3$shapeKey,
2677
+ _ref3$parsedShapeKey = _ref3.parsedShapeKey,
2678
+ parsedShapeKey = _ref3$parsedShapeKey === void 0 ? 'parsedShape' : _ref3$parsedShapeKey;
2909
2679
  var _ref4 = itemType || {},
2910
- _ref4$shape = _ref4.shape,
2911
- shapeList = _ref4$shape === void 0 ? [] : _ref4$shape;
2912
-
2680
+ _ref4$shape = _ref4.shape,
2681
+ shapeList = _ref4$shape === void 0 ? [] : _ref4$shape;
2913
2682
  var filteredShapeList = shapeList.reduce(function (acc, shapeType) {
2914
2683
  var type;
2915
2684
  var src;
2916
2685
  var parsedShape = parseShapeType(shapeType);
2917
2686
  var uri = parsedShape.uri,
2918
- mimeType = parsedShape.mimeType,
2919
- containerFormat = parsedShape.containerFormat,
2920
- videoCodec = parsedShape.videoCodec;
2921
-
2687
+ mimeType = parsedShape.mimeType,
2688
+ containerFormat = parsedShape.containerFormat,
2689
+ videoCodec = parsedShape.videoCodec;
2922
2690
  if (mimeType) {
2923
2691
  type = mimeType;
2924
2692
  if ((mimeType === QUICKTIME_MIMETYPE || mimeType === M4V_MIMETYPE) && (containerFormat === MP4_CONTAINER || containerFormat === MOV_CONTAINER) && videoCodec === H264_CODEC) type = MP4_MIMETYPE;
2925
2693
  }
2926
-
2927
2694
  if (uri) {
2928
2695
  if (allowedMethods) {
2929
2696
  var _uri$split = uri.split('://'),
2930
- _uri$split2 = _slicedToArray(_uri$split, 1),
2931
- thisMethod = _uri$split2[0];
2932
-
2697
+ _uri$split2 = _slicedToArray(_uri$split, 1),
2698
+ thisMethod = _uri$split2[0];
2933
2699
  if (allowedMethods.includes(thisMethod)) src = uri;
2934
2700
  } else {
2935
2701
  src = uri;
2936
2702
  }
2937
2703
  }
2938
-
2939
2704
  if (src && allowedMimeTypes.includes(type)) {
2940
2705
  var _acc$push;
2941
-
2942
2706
  acc.push((_acc$push = {}, _defineProperty(_acc$push, sourceKey, src), _defineProperty(_acc$push, mimeTypeKey, type), _defineProperty(_acc$push, shapeKey, shapeType), _defineProperty(_acc$push, parsedShapeKey, parsedShape), _acc$push));
2943
2707
  }
2944
-
2945
2708
  return acc;
2946
2709
  }, []);
2947
2710
  if (typeof sortPriority === 'function') filteredShapeList.sort(defaultSortPriority);
2948
2711
  return filteredShapeList;
2949
2712
  };
2950
2713
 
2951
- var SHAPE_MEDIA_TYPES = {
2952
- IMAGE: 'IMAGE',
2953
- AUDIO: 'AUDIO',
2954
- VIDEO: 'VIDEO',
2955
- DOCUMENT: 'DOCUMENT',
2956
- BINARY: 'BINARY'
2957
- };
2958
-
2959
2714
  /**
2960
2715
  * Returns a const for which media type a shape has
2961
2716
  *
@@ -2967,19 +2722,16 @@ var SHAPE_MEDIA_TYPES = {
2967
2722
  var getShapeMediaType = function getShapeMediaType(shape) {
2968
2723
  var parsedShape = parseShapeType(shape);
2969
2724
  var mimeType = parsedShape.mimeType,
2970
- videoCodec = parsedShape.videoCodec,
2971
- audioCodec = parsedShape.audioCodec;
2725
+ videoCodec = parsedShape.videoCodec,
2726
+ audioCodec = parsedShape.audioCodec;
2972
2727
  if (!mimeType) return undefined;
2973
-
2974
2728
  if (mimeType.startsWith('audio/')) {
2975
2729
  if (audioCodec !== undefined) return SHAPE_MEDIA_TYPES.AUDIO;
2976
2730
  }
2977
-
2978
2731
  if (mimeType.startsWith('video/')) {
2979
2732
  if (videoCodec !== undefined) return SHAPE_MEDIA_TYPES.VIDEO;
2980
2733
  if (audioCodec !== undefined) return SHAPE_MEDIA_TYPES.AUDIO;
2981
2734
  }
2982
-
2983
2735
  if (mimeType.startsWith('image/')) return SHAPE_MEDIA_TYPES.IMAGE;
2984
2736
  if (mimeType.endsWith('/pdf')) return SHAPE_MEDIA_TYPES.DOCUMENT;
2985
2737
  if (mimeType.startsWith('text/')) return SHAPE_MEDIA_TYPES.DOCUMENT;
@@ -3004,13 +2756,11 @@ var getShapeMediaType = function getShapeMediaType(shape) {
3004
2756
  */
3005
2757
  var findNearestThumbnail = function findNearestThumbnail(itemType, timeCode) {
3006
2758
  var tcSeconds = createTimeCode(timeCode).toSeconds();
3007
-
3008
2759
  var _ref = itemType || {},
3009
- _ref$thumbnails = _ref.thumbnails,
3010
- thumbnails = _ref$thumbnails === void 0 ? {} : _ref$thumbnails;
3011
-
2760
+ _ref$thumbnails = _ref.thumbnails,
2761
+ thumbnails = _ref$thumbnails === void 0 ? {} : _ref$thumbnails;
3012
2762
  var _thumbnails$uri = thumbnails.uri,
3013
- srcList = _thumbnails$uri === void 0 ? [] : _thumbnails$uri;
2763
+ srcList = _thumbnails$uri === void 0 ? [] : _thumbnails$uri;
3014
2764
  var srcTcSeconds = srcList.map(function (url) {
3015
2765
  var tc = new URL(url).pathname.split('/').pop();
3016
2766
  return formatTimeCodeText(tc).toSeconds();
@@ -3022,7 +2772,8 @@ var findNearestThumbnail = function findNearestThumbnail(itemType, timeCode) {
3022
2772
  };
3023
2773
 
3024
2774
  var _excluded = ["Codec"],
3025
- _excluded2 = ["Codec"];
2775
+ _excluded2 = ["Codec"];
2776
+
3026
2777
  /**
3027
2778
  * TODO
3028
2779
  */
@@ -3037,36 +2788,29 @@ var _excluded = ["Codec"],
3037
2788
  */
3038
2789
  var parseMediaConvertPreset = function parseMediaConvertPreset(mediaconvert) {
3039
2790
  var output = {};
3040
-
3041
2791
  var _ref = mediaconvert || {},
3042
- _ref$outputSetting = _ref.outputSetting,
3043
- outputSetting = _ref$outputSetting === void 0 ? [] : _ref$outputSetting;
3044
-
2792
+ _ref$outputSetting = _ref.outputSetting,
2793
+ outputSetting = _ref$outputSetting === void 0 ? [] : _ref$outputSetting;
3045
2794
  if (outputSetting.length === 0) return output;
3046
2795
  var mc = JSON.parse(outputSetting[0]);
3047
2796
  var _mc$Settings = mc.Settings;
3048
2797
  _mc$Settings = _mc$Settings === void 0 ? {} : _mc$Settings;
3049
2798
  var ContainerSettings = _mc$Settings.ContainerSettings,
3050
- VideoDescription = _mc$Settings.VideoDescription,
3051
- AudioDescriptions = _mc$Settings.AudioDescriptions;
3052
-
2799
+ VideoDescription = _mc$Settings.VideoDescription,
2800
+ AudioDescriptions = _mc$Settings.AudioDescriptions;
3053
2801
  if (ContainerSettings) {
3054
2802
  output.containerFormat = ContainerSettings.Container;
3055
2803
  }
3056
-
3057
2804
  if (VideoDescription) {
3058
2805
  var _VideoDescription$Cod = VideoDescription.CodecSettings,
3059
- CodecSettings = _VideoDescription$Cod === void 0 ? {} : _VideoDescription$Cod;
3060
-
2806
+ CodecSettings = _VideoDescription$Cod === void 0 ? {} : _VideoDescription$Cod;
3061
2807
  var Codec = CodecSettings.Codec,
3062
- otherSettings = _objectWithoutProperties(CodecSettings, _excluded);
3063
-
2808
+ otherSettings = _objectWithoutProperties(CodecSettings, _excluded);
3064
2809
  output.videoFormat = Codec;
3065
2810
  var height = VideoDescription.Height,
3066
- width = VideoDescription.Width;
2811
+ width = VideoDescription.Width;
3067
2812
  output.height = height;
3068
2813
  output.width = width;
3069
-
3070
2814
  if (height && width) {
3071
2815
  output.dimension = "".concat(width, "x").concat(height);
3072
2816
  output.aspectRatio = parseAspectRatio({
@@ -3074,17 +2818,14 @@ var parseMediaConvertPreset = function parseMediaConvertPreset(mediaconvert) {
3074
2818
  width: width
3075
2819
  });
3076
2820
  }
3077
-
3078
2821
  var _Object$values = Object.values(otherSettings),
3079
- _Object$values2 = _slicedToArray(_Object$values, 1),
3080
- codecSpecs = _Object$values2[0];
3081
-
2822
+ _Object$values2 = _slicedToArray(_Object$values, 1),
2823
+ codecSpecs = _Object$values2[0];
3082
2824
  if (codecSpecs) {
3083
2825
  output.fieldOrder = codecSpecs.InterlaceMode;
3084
2826
  if (output.fieldOrder && output.fieldOrder.includes('TOP')) output.fieldOrder = 'interlaced';
3085
2827
  output.videoBitrate = codecSpecs.Bitrate;
3086
2828
  var numerator = codecSpecs.FramerateDenominator; // other way round to vs ¯\_(ツ)_/¯
3087
-
3088
2829
  var denominator = codecSpecs.FramerateNumerator;
3089
2830
  var timeBase = formatTimeBaseType({
3090
2831
  denominator: denominator,
@@ -3094,78 +2835,61 @@ var parseMediaConvertPreset = function parseMediaConvertPreset(mediaconvert) {
3094
2835
  output.frameRate = timeBase.toConstant() || timeBase.toRate();
3095
2836
  }
3096
2837
  }
3097
-
3098
2838
  if (AudioDescriptions && AudioDescriptions.length > 0) {
3099
2839
  var _AudioDescriptions$0$ = AudioDescriptions[0].CodecSettings,
3100
- _CodecSettings = _AudioDescriptions$0$ === void 0 ? {} : _AudioDescriptions$0$;
3101
-
2840
+ _CodecSettings = _AudioDescriptions$0$ === void 0 ? {} : _AudioDescriptions$0$;
3102
2841
  var _Codec = _CodecSettings.Codec,
3103
- _otherSettings = _objectWithoutProperties(_CodecSettings, _excluded2);
3104
-
2842
+ _otherSettings = _objectWithoutProperties(_CodecSettings, _excluded2);
3105
2843
  output.audioFormat = _Codec;
3106
-
3107
2844
  var _Object$values3 = Object.values(_otherSettings),
3108
- _Object$values4 = _slicedToArray(_Object$values3, 1),
3109
- _codecSpecs = _Object$values4[0];
3110
-
2845
+ _Object$values4 = _slicedToArray(_Object$values3, 1),
2846
+ _codecSpecs = _Object$values4[0];
3111
2847
  if (_codecSpecs) {
3112
2848
  output.audioSamplerate = _codecSpecs.SampleRate;
3113
2849
  output.audioBitrate = _codecSpecs.Bitrate;
3114
2850
  output.audioBitRateMode = _codecSpecs.RateControlMode;
3115
2851
  }
3116
2852
  }
3117
-
3118
2853
  return output;
3119
2854
  };
3120
2855
 
3121
2856
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3122
-
3123
2857
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3124
2858
  /**
3125
- * TODO
3126
- */
3127
-
3128
- /**
3129
- * TODO
2859
+ * Parse a VidiCore transcode preset
3130
2860
  *
3131
- * @param transcodePresetType
3132
- * @returns
2861
+ * @param transcodePresetType a VidiCore transcode preset
2862
+ * @returns A parsed transcode preset
3133
2863
  *
3134
2864
  * @category Transcode
3135
2865
  */
3136
2866
  var parseTranscodePreset = function parseTranscodePreset(transcodePresetType) {
3137
2867
  var output = {};
3138
-
3139
2868
  var _ref = transcodePresetType || {},
3140
- description = _ref.description,
3141
- format = _ref.format,
3142
- audio = _ref.audio,
3143
- video = _ref.video,
3144
- mediaconvert = _ref.mediaconvert;
3145
-
2869
+ description = _ref.description,
2870
+ format = _ref.format,
2871
+ audio = _ref.audio,
2872
+ video = _ref.video,
2873
+ mediaconvert = _ref.mediaconvert;
3146
2874
  if (mediaconvert) return _objectSpread({
3147
2875
  description: description
3148
2876
  }, parseMediaConvertPreset(mediaconvert));
3149
2877
  output.description = description;
3150
2878
  output.containerFormat = format;
3151
-
3152
2879
  if (video) {
3153
2880
  output.videoFormat = video.codec;
3154
2881
  output.videoBitrate = video.bitrate;
3155
-
3156
2882
  if (video.framerate) {
3157
2883
  var timeBase = formatTimeBaseType(video.framerate);
3158
2884
  output.timeBase = timeBase;
3159
2885
  output.frameRate = timeBase.toConstant() || timeBase.toRate();
3160
2886
  }
3161
-
3162
2887
  if (video.scaling) {
3163
2888
  var _video$scaling = video.scaling,
3164
- height = _video$scaling.height,
3165
- width = _video$scaling.width;
2889
+ height = _video$scaling.height,
2890
+ width = _video$scaling.width;
3166
2891
  output.height = height;
3167
2892
  output.width = width;
3168
-
3169
2893
  if (height && width) {
3170
2894
  output.dimension = "".concat(width, "x").concat(height);
3171
2895
  output.aspectRatio = parseAspectRatio({
@@ -3175,16 +2899,14 @@ var parseTranscodePreset = function parseTranscodePreset(transcodePresetType) {
3175
2899
  }
3176
2900
  }
3177
2901
  }
3178
-
3179
2902
  if (audio) {
3180
2903
  var audioFormat = audio.codec,
3181
- channel = audio.channel;
2904
+ channel = audio.channel;
3182
2905
  output.audioFormat = audioFormat;
3183
2906
  if (channel) output.audioChannels = channel.length;
3184
2907
  }
3185
-
3186
2908
  return output;
3187
2909
  };
3188
2910
 
3189
- export { FIELD_ATTRIBUTE_KEYS, FIELD_VALUE_ATTRIBUTE_KEYS, GROUP_ATTRIBUTE_KEYS, ROLE_NAMES, SYSTEM_FIELDGROUPS, SYSTEM_FIELDS, TimeBase, TimeCode, createFacetType, createMetadataType, createTimeBase, createTimeCode, filterShapeSource, findNearestThumbnail, formatTimeBaseText, formatTimeBaseType, formatTimeCodeSeconds, formatTimeCodeSmpte, formatTimeCodeText, formatTimeCodeType, getShapeDocumentType, getShapeMediaType, metadataTypeToWebVtt, parseAudioComponent, parseBinaryComponent, parseContainerComponent, parseFacetType, parseFieldList, parseFileType, parseGroupList, parseHighlightTimespan, parseHighlightTimespanList, parseKeyValuePairTypes as parseKeyValuePairType, parseMediaConvertPreset, parseMetadataType, parseNowDate, parseShapeType, parseSimpleMetadataType, parseTimespan, parseTimespanList, parseTranscodePreset, parseVideoComponent };
2911
+ export { DOCUMENT_TYPES, FIELD_ATTRIBUTE_KEYS, FIELD_VALUE_ATTRIBUTE_KEYS, FILE_STATES, GROUP_ATTRIBUTE_KEYS, ROLE_NAMES, SHAPE_MEDIA_TYPES, SYSTEM_FIELDGROUPS, SYSTEM_FIELDS, TimeBase, TimeCode, createFacetType, createMetadataType, createTimeBase, createTimeCode, filterShapeSource, findNearestThumbnail, formatTimeBaseText, formatTimeBaseType, formatTimeCodeSeconds, formatTimeCodeSmpte, formatTimeCodeText, formatTimeCodeType, getShapeDocumentType, getShapeMediaType, metadataTypeToWebVtt, parseAudioComponent, parseBinaryComponent, parseContainerComponent, parseFacetType, parseFieldList, parseFileType, parseGroupList, parseHighlightTimespan, parseHighlightTimespanList, parseKeyValuePairTypes as parseKeyValuePairType, parseMediaConvertPreset, parseMetadataType, parseNowDate, parseShapeType, parseSimpleMetadataType, parseTimespan, parseTimespanList, parseTranscodePreset, parseVideoComponent };
3190
2912
  //# sourceMappingURL=index.es.js.map