@amazon/vinyl-mpd-parser 1.1.0 → 1.2.0

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.
@@ -1,26 +1,34 @@
1
- "use strict";function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&_setPrototypeOf(p,r.prototype),p}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeof t}}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}(function(){var __defProp=Object.defineProperty;var __defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty;var __propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=function __defNormalProp(obj,key,value){return key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value};var __spreadValues=function __spreadValues(a,b){for(var prop in b||(b={}))if(__hasOwnProp.call(b,prop))__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols){var _iterator=_createForOfIteratorHelper(__getOwnPropSymbols(b)),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var prop=_step.value;if(__propIsEnum.call(b,prop))__defNormalProp(a,prop,b[prop])}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return a};var __spreadProps=function __spreadProps(a,b){return __defProps(a,__getOwnPropDescs(b))};// ../vinyl-util/dist/browserTestUtil/index.js
2
- var __defProp2=Object.defineProperty;var __getOwnPropSymbols2=Object.getOwnPropertySymbols;var __hasOwnProp2=Object.prototype.hasOwnProperty;var __propIsEnum2=Object.prototype.propertyIsEnumerable;var __defNormalProp2=function __defNormalProp2(obj,key,value){return key in obj?__defProp2(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value};var __spreadValues2=function __spreadValues2(a,b){for(var prop in b||(b={}))if(__hasOwnProp2.call(b,prop))__defNormalProp2(a,prop,b[prop]);if(__getOwnPropSymbols2){var _iterator2=_createForOfIteratorHelper(__getOwnPropSymbols2(b)),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var prop=_step2.value;if(__propIsEnum2.call(b,prop))__defNormalProp2(a,prop,b[prop])}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}return a};var __objRest=function __objRest(source,exclude){var target={};for(var prop in source)if(__hasOwnProp2.call(source,prop)&&exclude.indexOf(prop)<0)target[prop]=source[prop];if(source!=null&&__getOwnPropSymbols2){var _iterator3=_createForOfIteratorHelper(__getOwnPropSymbols2(source)),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var prop=_step3.value;if(exclude.indexOf(prop)<0&&__propIsEnum2.call(source,prop))target[prop]=source[prop]}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}return target};var __publicField=function __publicField(obj,key,value){return __defNormalProp2(obj,_typeof(key)!=="symbol"?key+"":key,value)};var createSpy=jasmine.createSpy;function createSpy2(key){return createSpy(String(key))}var MockAbortSignal=/*#__PURE__*/_createClass(function MockAbortSignal(){_classCallCheck(this,MockAbortSignal);__publicField(this,"aborted",false);__publicField(this,"onabort",null);__publicField(this,"reason");__publicField(this,"throwIfAborted",createSpy2("throwIfAborted"));__publicField(this,"addEventListener",createSpy2("addEventListener"));__publicField(this,"removeEventListener",createSpy2("removeEventListener"));__publicField(this,"dispatchEvent",createSpy2("dispatchEvent"))});var MockMediaSource=/*#__PURE__*/_createClass(function MockMediaSource(){_classCallCheck(this,MockMediaSource);__publicField(this,"activeSourceBuffers");__publicField(this,"duration",0);__publicField(this,"onsourceclose",null);__publicField(this,"onsourceended",null);__publicField(this,"onsourceopen",null);__publicField(this,"readyState","closed");__publicField(this,"sourceBuffers");__publicField(this,"addSourceBuffer",createSpy2("addSourceBuffer"));__publicField(this,"clearLiveSeekableRange",createSpy2("clearLiveSeekableRange"));__publicField(this,"endOfStream",createSpy2("endOfStream"));__publicField(this,"removeSourceBuffer",createSpy2("removeSourceBuffer"));__publicField(this,"setLiveSeekableRange",createSpy2("setLiveSeekableRange"));__publicField(this,"addEventListener",createSpy2("addEventListener"));__publicField(this,"removeEventListener",createSpy2("removeEventListener"));__publicField(this,"dispatchEvent",createSpy2("dispatchEvent"))});var MockMediaSourceGlobal=/*#__PURE__*/function(_MockMediaSource){function MockMediaSourceGlobal(){_classCallCheck(this,MockMediaSourceGlobal);return _callSuper(this,MockMediaSourceGlobal,arguments)}_inherits(MockMediaSourceGlobal,_MockMediaSource);return _createClass(MockMediaSourceGlobal)}(MockMediaSource);__publicField(MockMediaSourceGlobal,"canConstructInDedicatedWorker",false);__publicField(MockMediaSourceGlobal,"isTypeSupported",createSpy2("isTypeSupported"));var MockAbortSignalGlobal=/*#__PURE__*/function(_MockAbortSignal){function MockAbortSignalGlobal(){_classCallCheck(this,MockAbortSignalGlobal);return _callSuper(this,MockAbortSignalGlobal,arguments)}_inherits(MockAbortSignalGlobal,_MockAbortSignal);return _createClass(MockAbortSignalGlobal)}(MockAbortSignal);__publicField(MockAbortSignalGlobal,"abort",createSpy2("abort"));__publicField(MockAbortSignalGlobal,"any",createSpy2("any"));__publicField(MockAbortSignalGlobal,"timeout",createSpy2("timeout"));function expectNothing(){expect(true).toBeTruthy()}var nextTestTimeoutOverridden=false;function setTestTimeout(timeout){var originalTimeout=null;beforeEach(function(){originalTimeout=jasmine.DEFAULT_TIMEOUT_INTERVAL;if(!nextTestTimeoutOverridden)jasmine.DEFAULT_TIMEOUT_INTERVAL=timeout*1e3});afterEach(function(){if(originalTimeout)jasmine.DEFAULT_TIMEOUT_INTERVAL=originalTimeout;if(nextTestTimeoutOverridden)nextTestTimeoutOverridden=false})}var now;if(typeof window!=="undefined"&&typeof window.performance!=="undefined"&&typeof window.performance.now!=="undefined"){now=function now(){return window.performance.now()}}else if(typeof self!=="undefined"&&typeof self.performance!=="undefined"&&typeof self.performance.now!=="undefined"){now=function now(){return self.performance.now()}}else{now=function now(){return Date.now()}}var BenchmarkRunResults=/*#__PURE__*/function(){function BenchmarkRunResults(name){_classCallCheck(this,BenchmarkRunResults);this.name=name;__publicField(this,"cycleResults",[]);__publicField(this,"_totalSamples",0)}return _createClass(BenchmarkRunResults,[{key:"totalSamples",get:function get(){return this._totalSamples}},{key:"cycleResultsNoOutliers",get:function get(){var sD=this.standardDeviation;var avg=average(this.cycleResults);return this.cycleResults.filter(function(e){var zScore=(avg-e)/sD;return Math.abs(zScore)<3})}/**
1
+ "use strict";function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t)}:p}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value}},_get.apply(null,arguments)}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _wrapNativeSuper(t){var r="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!_isNativeFunction(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,Wrapper)}function Wrapper(){return _construct(t,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,t)},_wrapNativeSuper(t)}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&_setPrototypeOf(p,r.prototype),p}function _isNativeFunction(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(n){return"function"==typeof t}}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i["return"])&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e))}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function")}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t["return"]||t["return"]()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}(function(){var __defProp=Object.defineProperty;var __defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty;var __propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=function __defNormalProp(obj,key,value){return key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value};var __spreadValues=function __spreadValues(a,b){for(var prop in b||(b={}))if(__hasOwnProp.call(b,prop))__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols){var _iterator=_createForOfIteratorHelper(__getOwnPropSymbols(b)),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var prop=_step.value;if(__propIsEnum.call(b,prop))__defNormalProp(a,prop,b[prop])}}catch(err){_iterator.e(err)}finally{_iterator.f()}}return a};var __spreadProps=function __spreadProps(a,b){return __defProps(a,__getOwnPropDescs(b))};var __objRest=function __objRest(source,exclude){var target={};for(var prop in source)if(__hasOwnProp.call(source,prop)&&exclude.indexOf(prop)<0)target[prop]=source[prop];if(source!=null&&__getOwnPropSymbols){var _iterator2=_createForOfIteratorHelper(__getOwnPropSymbols(source)),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var prop=_step2.value;if(exclude.indexOf(prop)<0&&__propIsEnum.call(source,prop))target[prop]=source[prop]}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}return target};var __publicField=function __publicField(obj,key,value){return __defNormalProp(obj,_typeof(key)!=="symbol"?key+"":key,value)};// ../vinyl-util/test/browserTestUtil/mock/createSpyFactory.ts
2
+ var createSpy=jasmine.createSpy;function createSpy2(key){return createSpy(String(key))}// ../vinyl-util/test/browserTestUtil/mock/dom/lib.dom.ts
3
+ var MockAbortSignal=/*#__PURE__*/_createClass(function MockAbortSignal(){_classCallCheck(this,MockAbortSignal);__publicField(this,"aborted",false);__publicField(this,"onabort",null);__publicField(this,"reason");__publicField(this,"throwIfAborted",createSpy2("throwIfAborted"));__publicField(this,"addEventListener",createSpy2("addEventListener"));__publicField(this,"removeEventListener",createSpy2("removeEventListener"));__publicField(this,"dispatchEvent",createSpy2("dispatchEvent"))});var MockMediaSource=/*#__PURE__*/_createClass(function MockMediaSource(){_classCallCheck(this,MockMediaSource);__publicField(this,"activeSourceBuffers");__publicField(this,"duration",0);__publicField(this,"onsourceclose",null);__publicField(this,"onsourceended",null);__publicField(this,"onsourceopen",null);__publicField(this,"readyState","closed");__publicField(this,"sourceBuffers");__publicField(this,"addSourceBuffer",createSpy2("addSourceBuffer"));__publicField(this,"clearLiveSeekableRange",createSpy2("clearLiveSeekableRange"));__publicField(this,"endOfStream",createSpy2("endOfStream"));__publicField(this,"removeSourceBuffer",createSpy2("removeSourceBuffer"));__publicField(this,"setLiveSeekableRange",createSpy2("setLiveSeekableRange"));__publicField(this,"addEventListener",createSpy2("addEventListener"));__publicField(this,"removeEventListener",createSpy2("removeEventListener"));__publicField(this,"dispatchEvent",createSpy2("dispatchEvent"))});// ../vinyl-util/test/browserTestUtil/mock/dom/globals.ts
4
+ var MockMediaSourceGlobal=/*#__PURE__*/function(_MockMediaSource){function MockMediaSourceGlobal(){_classCallCheck(this,MockMediaSourceGlobal);return _callSuper(this,MockMediaSourceGlobal,arguments)}_inherits(MockMediaSourceGlobal,_MockMediaSource);return _createClass(MockMediaSourceGlobal)}(MockMediaSource);__publicField(MockMediaSourceGlobal,"canConstructInDedicatedWorker",false);__publicField(MockMediaSourceGlobal,"isTypeSupported",createSpy2("isTypeSupported"));var MockAbortSignalGlobal=/*#__PURE__*/function(_MockAbortSignal){function MockAbortSignalGlobal(){_classCallCheck(this,MockAbortSignalGlobal);return _callSuper(this,MockAbortSignalGlobal,arguments)}_inherits(MockAbortSignalGlobal,_MockAbortSignal);return _createClass(MockAbortSignalGlobal)}(MockAbortSignal);__publicField(MockAbortSignalGlobal,"abort",createSpy2("abort"));__publicField(MockAbortSignalGlobal,"any",createSpy2("any"));__publicField(MockAbortSignalGlobal,"timeout",createSpy2("timeout"));// ../vinyl-util/test/browserTestUtil/expect/expectNothing.ts
5
+ function expectNothing(){expect(true).toBeTruthy()}// ../vinyl-util/test/browserTestUtil/env/jasmineEnv.ts
6
+ var nextTestTimeoutOverridden=false;function setTestTimeout(timeout){var originalTimeout=null;beforeEach(function(){originalTimeout=jasmine.DEFAULT_TIMEOUT_INTERVAL;if(!nextTestTimeoutOverridden)jasmine.DEFAULT_TIMEOUT_INTERVAL=timeout*1e3});afterEach(function(){if(originalTimeout)jasmine.DEFAULT_TIMEOUT_INTERVAL=originalTimeout;if(nextTestTimeoutOverridden)nextTestTimeoutOverridden=false})}// ../vinyl-util/test/browserTestUtil/benchmark/Benchmark.ts
7
+ var now;if(typeof window!=="undefined"&&typeof window.performance!=="undefined"&&typeof window.performance.now!=="undefined"){now=function now(){return window.performance.now()}}else if(typeof self!=="undefined"&&typeof self.performance!=="undefined"&&typeof self.performance.now!=="undefined"){now=function now(){return self.performance.now()}}else{now=function now(){return Date.now()}}var BenchmarkRunResults=/*#__PURE__*/function(){function BenchmarkRunResults(name){_classCallCheck(this,BenchmarkRunResults);__publicField(this,"name",name);__publicField(this,"cycleResults",[]);__publicField(this,"_totalSamples",0)}return _createClass(BenchmarkRunResults,[{key:"totalSamples",get:function get(){return this._totalSamples}},{key:"cycleResultsNoOutliers",get:function get(){var sD=this.standardDeviation;var avg=average(this.cycleResults);return this.cycleResults.filter(function(e){var zScore=(avg-e)/sD;return Math.abs(zScore)<3})}/**
3
8
  * Returns the mean ops per second minus outliers of greater than 3 standard deviations.
4
9
  */},{key:"meanOpsPerSec",get:function get(){return average(this.cycleResultsNoOutliers)}},{key:"standardDeviation",get:function get(){return standardDeviation(this.cycleResults)}},{key:"variance",get:function get(){return this.standardDeviation/this.meanOpsPerSec}/**
5
10
  * Returns the mean ops / s ± variance % as a string.
6
- */},{key:"meanOpsStr",get:function get(){var mean=this.meanOpsPerSec.toLocaleString(void 0,{maximumSignificantDigits:4});var variance=this.variance.toLocaleString(void 0,{style:"percent"});return"".concat(mean," \xB1").concat(variance)}},{key:"add",value:function add(cycle){var opsPerSecond=cycle.ops/cycle.duration;var index=this.cycleResults.findIndex(function(value){return opsPerSecond<value});if(index<0)index=this.cycleResults.length;this.cycleResults.splice(index,0,opsPerSecond);this._totalSamples+=cycle.ops}},{key:"toString",value:function toString(){if(!this.cycleResults.length)return"No results";return"".concat(this.name,": ").concat(this.meanOpsStr," ops/sec")}}])}();var RunResultsComparison=/*#__PURE__*/function(){function RunResultsComparison(name,results){_classCallCheck(this,RunResultsComparison);this.name=name;__publicField(this,"results");this.results=results.sort(function(a,b){return a.meanOpsPerSec-b.meanOpsPerSec})}return _createClass(RunResultsComparison,[{key:"logToTable",value:function logToTable(){var _this=this;var r=this.results.map(function(run){var variance=run.variance.toLocaleString(void 0,{style:"percent"});var mean=run.meanOpsPerSec.toLocaleString(void 0,{maximumSignificantDigits:4});return{Name:run.name,Mean:"".concat(mean," \xB1").concat(variance),Samples:run.totalSamples,Compare:_this.runComparisonToString(run)}});var table=r.reduce(function(acc,_a2){var _b=_a2,Name=_b.Name,x=__objRest(_b,["Name"]);acc[Name]=x;return acc},{});console.log("\n"+this.name);console.table(table)}},{key:"runComparisonToString",value:function runComparisonToString(run){var _a2,_b;var baseline=(_b=(_a2=this.results[0])==null?void 0:_a2.meanOpsPerSec)!=null?_b:0;var fasterPercent=run.meanOpsPerSec/baseline-1;return fasterPercent<0.01?"-":fasterPercent.toLocaleString(void 0,{style:"percent"})+" faster"}}])}();function compareResults(name){for(var _len=arguments.length,results=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){results[_key-1]=arguments[_key]}return new RunResultsComparison(name,results)}var defaultBenchmarkOptions={warmupTime:0.5,maxCycleDuration:0.5,cycles:9};var _Benchmark=/*#__PURE__*/function(){/**
11
+ */},{key:"meanOpsStr",get:function get(){var mean=this.meanOpsPerSec.toLocaleString(void 0,{maximumSignificantDigits:4});var variance=this.variance.toLocaleString(void 0,{style:"percent"});return"".concat(mean," \xB1").concat(variance)}},{key:"add",value:function add(cycle){var opsPerSecond=cycle.ops/cycle.duration;var index=this.cycleResults.findIndex(function(value){return opsPerSecond<value});if(index<0)index=this.cycleResults.length;this.cycleResults.splice(index,0,opsPerSecond);this._totalSamples+=cycle.ops}},{key:"toString",value:function toString(){if(!this.cycleResults.length)return"No results";return"".concat(this.name,": ").concat(this.meanOpsStr," ops/sec")}}])}();var RunResultsComparison=/*#__PURE__*/function(){function RunResultsComparison(name,results){_classCallCheck(this,RunResultsComparison);__publicField(this,"name",name);/**
12
+ * Sorted by median ops/s from slowest to fastest.
13
+ */__publicField(this,"results");this.results=results.sort(function(a,b){return a.meanOpsPerSec-b.meanOpsPerSec})}return _createClass(RunResultsComparison,[{key:"logToTable",value:function logToTable(){var _this=this;var r=this.results.map(function(run){var variance=run.variance.toLocaleString(void 0,{style:"percent"});var mean=run.meanOpsPerSec.toLocaleString(void 0,{maximumSignificantDigits:4});return{Name:run.name,Mean:"".concat(mean," \xB1").concat(variance),Samples:run.totalSamples,Compare:_this.runComparisonToString(run)}});var table=r.reduce(function(acc,_a2){var _b=_a2,Name=_b.Name,x=__objRest(_b,["Name"]);acc[Name]=x;return acc},{});console.log("\n"+this.name);console.table(table)}},{key:"runComparisonToString",value:function runComparisonToString(run){var _a2,_b;var baseline=(_b=(_a2=this.results[0])==null?void 0:_a2.meanOpsPerSec)!=null?_b:0;var fasterPercent=run.meanOpsPerSec/baseline-1;return fasterPercent<0.01?"-":fasterPercent.toLocaleString(void 0,{style:"percent"})+" faster"}}])}();function compareResults(name){for(var _len=arguments.length,results=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){results[_key-1]=arguments[_key]}return new RunResultsComparison(name,results)}var defaultBenchmarkOptions={warmupTime:0.5,maxCycleDuration:0.5,cycles:9};var _Benchmark=/*#__PURE__*/function(){/**
7
14
  * Constructs a new Benchmark.
8
15
  *
9
16
  * @param name The name of the benchmark, to be used when logging.
10
17
  * @param executor The method to execute and measure. If this method returns a promise, the
11
18
  * promise will be awaited. The executor should either always return a promise, or never.
12
19
  * @param options Optional configuration for the benchmark.
13
- */function _Benchmark2(name,executor,options){_classCallCheck(this,_Benchmark2);this.name=name;this.executor=executor;__publicField(this,"options");this.options=__spreadValues2(__spreadValues2({},defaultBenchmarkOptions),options)}return _createClass(_Benchmark2,[{key:"run",value:function(){var _run=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(){var _this2=this;var opts,warmupTimeMs,cycleStart,isAsync,result,resultsPromise;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:opts=this.options;_context2.n=1;return _Benchmark2.semaphore;case 1:warmupTimeMs=opts.warmupTime*1e3;cycleStart=now();isAsync=false;case 2:result=this.executor();isAsync=isAsync||result&&typeof result.then==="function";if(!isAsync){_context2.n=3;break}_context2.n=3;return result;case 3:if(now()-cycleStart<warmupTimeMs){_context2.n=2;break}case 4:resultsPromise=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(){var results,i,cycleResults;return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:results=new BenchmarkRunResults(_this2.name);i=0;case 1:if(!(i<opts.cycles)){_context.n=4;break}_context.n=2;return _this2.runCycle(isAsync);case 2:cycleResults=_context.v;results.add(cycleResults);_context.n=3;return nextFrame();case 3:i++;_context.n=1;break;case 4:return _context.a(2,results)}},_callee)}))();_Benchmark2.semaphore=resultsPromise;_context2.n=5;return resultsPromise;case 5:return _context2.a(2,_context2.v)}},_callee2,this)}));function run(){return _run.apply(this,arguments)}return run}()/**
20
+ */function _Benchmark(name,executor,options){_classCallCheck(this,_Benchmark);__publicField(this,"name",name);__publicField(this,"executor",executor);__publicField(this,"options");this.options=__spreadValues(__spreadValues({},defaultBenchmarkOptions),options)}return _createClass(_Benchmark,[{key:"run",value:function(){var _run=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(){var _this2=this;var opts,warmupTimeMs,cycleStart,isAsync,result,resultsPromise;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:opts=this.options;_context2.n=1;return _Benchmark.semaphore;case 1:warmupTimeMs=opts.warmupTime*1e3;cycleStart=now();isAsync=false;case 2:result=this.executor();isAsync=isAsync||result&&typeof result.then==="function";if(!isAsync){_context2.n=3;break}_context2.n=3;return result;case 3:if(now()-cycleStart<warmupTimeMs){_context2.n=2;break}case 4:resultsPromise=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(){var results,i,cycleResults;return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:results=new BenchmarkRunResults(_this2.name);i=0;case 1:if(!(i<opts.cycles)){_context.n=4;break}_context.n=2;return _this2.runCycle(isAsync);case 2:cycleResults=_context.v;results.add(cycleResults);_context.n=3;return nextFrame();case 3:i++;_context.n=1;break;case 4:return _context.a(2,results)}},_callee)}))();_Benchmark.semaphore=resultsPromise;_context2.n=5;return resultsPromise;case 5:return _context2.a(2,_context2.v)}},_callee2,this)}));function run(){return _run.apply(this,arguments)}return run}()/**
14
21
  * Runs one cycle. A cycle will repeat the executor approximately `options.maxCycleDuration`
15
22
  * seconds.
16
23
  *
17
24
  * @param isAsync
18
25
  * @return Returns the duration (in seconds) and number of operations the cycle repeated.
19
- */},{key:"runCycle",value:(function(){var _runCycle=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(isAsync){var cycleMs,ops,cycleStart,result,duration;return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:cycleMs=this.options.maxCycleDuration*1e3;ops=0;cycleStart=now();case 1:result=this.executor();if(!isAsync){_context3.n=2;break}_context3.n=2;return result;case 2:ops++;case 3:if(now()-cycleStart<cycleMs){_context3.n=1;break}case 4:duration=(now()-cycleStart)/1e3;return _context3.a(2,{duration:duration,ops:ops})}},_callee3,this)}));function runCycle(_x){return _runCycle.apply(this,arguments)}return runCycle}())}])}();__publicField(_Benchmark,"semaphore",nextFrame());var Benchmark=_Benchmark;function benchmark(name,executor,options){var benchmark2=new Benchmark(name,executor,options);return benchmark2.run().then(function(results){console.log(results.toString());return results})}function nextFrame(){return new Promise(function(resolve){setTimeout(resolve)})}function standardDeviation(values){var avg=average(values);var squareDiffs=values.map(function(value){var diff=value-avg;return diff*diff});var avgSquareDiff=average(squareDiffs);return Math.sqrt(avgSquareDiff)}function average(values){var sum=values.reduce(function(acc,value){return acc+value},0);return sum/values.length}var createSpy3=jasmine.createSpy;// test/benchmark/setup.ts
20
- function setupBenchmark(){setTestTimeout(180);afterEach(expectNothing)}var comparisons=[];function addComparison(comparison){comparisons.push(comparison)}function addBenchmarks(name){for(var _len2=arguments.length,results=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){results[_key2-1]=arguments[_key2]}var comparison=compareResults.apply(void 0,[name].concat(results));comparison.logToTable();comparisons.push(comparison)}if(typeof document!=="undefined"){jasmine.getEnv().addReporter({jasmineDone:function jasmineDone(){var _a2;console.log("Tests complete");var jasmineContainer=document.getElementsByClassName("jasmine_html-reporter")[0];(_a2=jasmineContainer.parentElement)==null?void 0:_a2.removeChild(jasmineContainer);var container=createEl("div",document.body);container.id="benchmarkResults";var sortedComparisons=[].concat(comparisons).sort(function(a,b){return a.name>b.name?1:-1});var _iterator4=_createForOfIteratorHelper(sortedComparisons),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var comparison=_step4.value;toTableHtml(comparison,container)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}})}function toTableHtml(comparison,parent){var container=createEl("div",parent);container.className="benchmarkComparison";var title=createEl("h2",container);title.innerText=comparison.name;var table=createEl("table",container);var head=createEl("thead",table);var headRow=createEl("tr",head);var name=createEl("th",headRow);name.innerText="Name";var median=createEl("th",headRow);median.innerText="Mean ops/s";var samples=createEl("th",headRow);samples.innerText="Samples";var compare=createEl("th",headRow);compare.innerText="% Comparison";var body=createEl("tbody",table);comparison.results.forEach(function(result){var row=createEl("tr",body);createEl("th",row).innerText=result.name;createEl("td",row).innerText=result.meanOpsStr;createEl("td",row).innerText=result.totalSamples.toLocaleString();createEl("td",row).innerText=comparison.runComparisonToString(result)});return container}function createEl(tagName,parent,options){var element2=document.createElement(tagName,options);if(parent)parent.appendChild(element2);return element2}// src/xmlns/mpeg/cenc/2013.ts
26
+ */},{key:"runCycle",value:(function(){var _runCycle=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(isAsync){var cycleMs,ops,cycleStart,result,duration;return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:cycleMs=this.options.maxCycleDuration*1e3;ops=0;cycleStart=now();case 1:result=this.executor();if(!isAsync){_context3.n=2;break}_context3.n=2;return result;case 2:ops++;case 3:if(now()-cycleStart<cycleMs){_context3.n=1;break}case 4:duration=(now()-cycleStart)/1e3;return _context3.a(2,{duration:duration,ops:ops})}},_callee3,this)}));function runCycle(_x){return _runCycle.apply(this,arguments)}return runCycle}())}])}();__publicField(_Benchmark,"semaphore",nextFrame());var Benchmark=_Benchmark;function benchmark(name,executor,options){var benchmark2=new Benchmark(name,executor,options);return benchmark2.run().then(function(results){console.log(results.toString());return results})}function nextFrame(){return new Promise(function(resolve){setTimeout(resolve)})}function standardDeviation(values){var avg=average(values);var squareDiffs=values.map(function(value){var diff=value-avg;return diff*diff});var avgSquareDiff=average(squareDiffs);return Math.sqrt(avgSquareDiff)}function average(values){var sum=values.reduce(function(acc,value){return acc+value},0);return sum/values.length}// test/benchmark/setup.ts
27
+ function setupBenchmark(){setTestTimeout(180);afterEach(expectNothing)}var comparisons=[];function addComparison(comparison){comparisons.push(comparison)}function addBenchmarks(name){for(var _len2=arguments.length,results=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){results[_key2-1]=arguments[_key2]}var comparison=compareResults.apply(void 0,[name].concat(results));comparison.logToTable();comparisons.push(comparison)}if(typeof document!=="undefined"){jasmine.getEnv().addReporter({jasmineDone:function jasmineDone(){var _a2;console.log("Tests complete");var jasmineContainer=document.getElementsByClassName("jasmine_html-reporter")[0];(_a2=jasmineContainer.parentElement)==null?void 0:_a2.removeChild(jasmineContainer);var container=createEl("div",document.body);container.id="benchmarkResults";var sortedComparisons=[].concat(comparisons).sort(function(a,b){return a.name>b.name?1:-1});var _iterator3=_createForOfIteratorHelper(sortedComparisons),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var comparison=_step3.value;toTableHtml(comparison,container)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}})}function toTableHtml(comparison,parent){var container=createEl("div",parent);container.className="benchmarkComparison";var title=createEl("h2",container);title.innerText=comparison.name;var table=createEl("table",container);var head=createEl("thead",table);var headRow=createEl("tr",head);var name=createEl("th",headRow);name.innerText="Name";var median=createEl("th",headRow);median.innerText="Mean ops/s";var samples=createEl("th",headRow);samples.innerText="Samples";var compare=createEl("th",headRow);compare.innerText="% Comparison";var body=createEl("tbody",table);comparison.results.forEach(function(result){var row=createEl("tr",body);createEl("th",row).innerText=result.name;createEl("td",row).innerText=result.meanOpsStr;createEl("td",row).innerText=result.totalSamples.toLocaleString();createEl("td",row).innerText=comparison.runComparisonToString(result)});return container}function createEl(tagName,parent,options){var element2=document.createElement(tagName,options);if(parent)parent.appendChild(element2);return element2}// src/xmlns/mpeg/cenc/2013.ts
21
28
  var CENC_NAMESPACE_URI="urn:mpeg:cenc:2013";// src/xmlns/microsoft/playready.ts
22
- var PLAY_READY_NAMESPACE_URI="urn:microsoft:playready";// ../vinyl-util/dist/index.js
23
- var __defProp3=Object.defineProperty;var __defProps2=Object.defineProperties;var __getOwnPropDescs2=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols3=Object.getOwnPropertySymbols;var __hasOwnProp3=Object.prototype.hasOwnProperty;var __propIsEnum3=Object.prototype.propertyIsEnumerable;var __defNormalProp3=function __defNormalProp3(obj,key,value){return key in obj?__defProp3(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value};var __spreadValues3=function __spreadValues3(a,b){for(var prop in b||(b={}))if(__hasOwnProp3.call(b,prop))__defNormalProp3(a,prop,b[prop]);if(__getOwnPropSymbols3){var _iterator5=_createForOfIteratorHelper(__getOwnPropSymbols3(b)),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var prop=_step5.value;if(__propIsEnum3.call(b,prop))__defNormalProp3(a,prop,b[prop])}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}return a};var __spreadProps2=function __spreadProps2(a,b){return __defProps2(a,__getOwnPropDescs2(b))};var __publicField2=function __publicField2(obj,key,value){return __defNormalProp3(obj,_typeof(key)!=="symbol"?key+"":key,value)};function invariant(){return void 0}var ErrorOrigin={/**
29
+ var PLAY_READY_NAMESPACE_URI="urn:microsoft:playready";// ../vinyl-util/src/util/type.ts
30
+ function invariant(){return void 0}// ../vinyl-util/src/error/ErrorOrigin.ts
31
+ var ErrorOrigin={/**
24
32
  * The error originated from Vinyl and was reported from the uncaught exception or promise
25
33
  * rejection handlers.
26
34
  */UNCAUGHT:"uncaught",/**
@@ -44,14 +52,24 @@ var __defProp3=Object.defineProperty;var __defProps2=Object.defineProperties;var
44
52
  * The error originated from DRM.
45
53
  * This does not include internal or service errors, only errors from the creation of media keys or media key
46
54
  * sessions.
47
- */DRM:"drm"};var ReportableError=/*#__PURE__*/function(_Error){function _ReportableError(message){var _this3;var origin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ErrorOrigin.INTERNAL;var level=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"fatal";_classCallCheck(this,_ReportableError);_this3=_callSuper(this,_ReportableError,[message]);_this3.origin=origin;_this3.level=level;Object.setPrototypeOf(_this3,_ReportableError.prototype);return _this3}_inherits(_ReportableError,_Error);return _createClass(_ReportableError,[{key:Symbol.toStringTag,get:function get(){return"ReportableError"}},{key:"name",get:function get(){return this[Symbol.toStringTag]}/**
55
+ */DRM:"drm"};// ../vinyl-util/src/error/ReportableError.ts
56
+ var ReportableError=/*#__PURE__*/function(_Error){function _ReportableError(message){var _this3;var origin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ErrorOrigin.INTERNAL;var level=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"fatal";_classCallCheck(this,_ReportableError);_this3=_callSuper(this,_ReportableError,[message]);__publicField(_this3,"origin",origin);__publicField(_this3,"level",level);Object.setPrototypeOf(_this3,_ReportableError.prototype);return _this3}_inherits(_ReportableError,_Error);return _createClass(_ReportableError,[{key:Symbol.toStringTag,get:function get(){return"ReportableError"}},{key:"name",get:function get(){return this[Symbol.toStringTag]}/**
48
57
  * All ReportableError instances must be serializable.
49
- */},{key:"toJSON",value:function toJSON(){return{level:this.level,message:this.message,name:this.name,origin:this.origin,stack:this.stack}}}])}(/*#__PURE__*/_wrapNativeSuper(Error));var IllegalArgumentError=/*#__PURE__*/function(_ReportableError2){function _IllegalArgumentError(message){var _this4;var isInternal=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;_classCallCheck(this,_IllegalArgumentError);_this4=_callSuper(this,_IllegalArgumentError,[message,isInternal?ErrorOrigin.INTERNAL:ErrorOrigin.API]);_this4.isInternal=isInternal;Object.setPrototypeOf(_this4,_IllegalArgumentError.prototype);return _this4}_inherits(_IllegalArgumentError,_ReportableError2);return _createClass(_IllegalArgumentError,[{key:Symbol.toStringTag,get:function get(){return"IllegalArgumentError"}}])}(ReportableError);function getOrSet(map2,key,defaultValue){if(map2.has(key)){return map2.get(key)}else{var value=defaultValue(key);map2.set(key,value);return value}}var locale={variableNotDefined:"Variable '{name}' is not defined"};var DEFAULT_SUBSTITUTE_PATTERN=/\{(\w+)}/g;function substitute(str,variables){var pattern=arguments.length>2&&arguments[2]!==undefined?arguments[2]:DEFAULT_SUBSTITUTE_PATTERN;return str.replace(pattern,function(_,name){if(!(name in variables)){throw new IllegalArgumentError(locale.variableNotDefined.replace("{name}",String(name)))}return String(variables[name])})}function isWhitespaceChar(charCode){return charCode===32||// ' ' (space)
58
+ */},{key:"toJSON",value:function toJSON(){return{level:this.level,message:this.message,name:this.name,origin:this.origin,stack:this.stack}}}])}(/*#__PURE__*/_wrapNativeSuper(Error));// ../vinyl-util/src/error/IllegalArgumentError.ts
59
+ var IllegalArgumentError=/*#__PURE__*/function(_ReportableError2){function _IllegalArgumentError(message){var _this4;var isInternal=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;_classCallCheck(this,_IllegalArgumentError);_this4=_callSuper(this,_IllegalArgumentError,[message,isInternal?ErrorOrigin.INTERNAL:ErrorOrigin.API]);__publicField(_this4,"isInternal",isInternal);Object.setPrototypeOf(_this4,_IllegalArgumentError.prototype);return _this4}_inherits(_IllegalArgumentError,_ReportableError2);return _createClass(_IllegalArgumentError,[{key:Symbol.toStringTag,get:function get(){return"IllegalArgumentError"}}])}(ReportableError);// ../vinyl-util/src/util/map/map.ts
60
+ function getOrSet(map,key,defaultValue){if(map.has(key)){return map.get(key)}else{var value=defaultValue(key);map.set(key,value);return value}}function flipMap(map){var result=/* @__PURE__ */new Map;var _iterator4=_createForOfIteratorHelper(map),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _step4$value=_slicedToArray(_step4.value,2),key=_step4$value[0],value=_step4$value[1];result.set(value,key)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}return result}// ../vinyl-util/src/util/string/string.ts
61
+ var locale={variableNotDefined:"Variable '{name}' is not defined"};var DEFAULT_SUBSTITUTE_PATTERN=/\{(\w+)}/g;function substitute(str,variables){var pattern=arguments.length>2&&arguments[2]!==undefined?arguments[2]:DEFAULT_SUBSTITUTE_PATTERN;return str.replace(pattern,function(_,name){if(!(name in variables)){throw new IllegalArgumentError(locale.variableNotDefined.replace("{name}",String(name)))}return String(variables[name])})}function isWhitespaceChar(charCode){return charCode===32||// ' ' (space)
50
62
  charCode===9||// '\t' (tab)
51
63
  charCode===13||// '\r' (carriage return)
52
- charCode===10}var encodedEntitiesRegex=/&(#(\d+)|\w+);/gi;var predefinedDecodeEntities=/* @__PURE__ */new Map([["apos","'"],["amp","&"],["lt","<"],["gt",">"],["quot","\""]]);function decodeEntities(str){var namedEntities=arguments.length>1&&arguments[1]!==undefined?arguments[1]:predefinedDecodeEntities;if(encodedEntitiesRegex.test(str)){return str.replace(encodedEntitiesRegex,function(substring,entityName,codePoint){if(codePoint!==void 0)return String.fromCharCode(parseInt(codePoint));var entityValue=namedEntities.get(entityName.toLowerCase());if(!entityValue)return substring;return entityValue})}else{return str}}function eqStr(a,b){var ignoreCase=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(a==null&&b==null)return true;if(a==null||b==null)return false;if(a===b)return true;if(ignoreCase)return a.length===b.length&&a.toLowerCase()===b.toLowerCase();return false}function char(str){return str.charCodeAt(0)}function truncate(str,maxLength){var indicator=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\u2026";if(str==null)return str;if(str.length>maxLength)return str.substring(0,maxLength-indicator.length)+indicator;return str}function clamp(value,min2,max2){return Math.min(Math.max(value,min2),max2)}function roundToNearest(value,snap){var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;return Math.round((value-offset)/snap)*snap+offset}function printStringPosition(str,index,options){var _a2;var caret=(options==null?void 0:options.caret)||"^";index=clamp(index,0,str.length);var minIndex=str.lastIndexOf("\n",index-1)+1;var maxIndex=str.indexOf("\n",index);if(maxIndex===-1)maxIndex=str.length;var split=(options==null?void 0:options.split)===void 0?0.6:options.split;var cols=((_a2=options==null?void 0:options.maxColumns)!=null?_a2:60)-caret.length;var leadingChars=cols*split;var trailingChars=cols*(1-split);var maxLeadingChars=index-minIndex;var maxTrailingChars=maxIndex-index;if(leadingChars>maxLeadingChars){trailingChars+=leadingChars-maxLeadingChars;leadingChars=maxLeadingChars;if(trailingChars>maxTrailingChars)trailingChars=maxTrailingChars}else if(trailingChars>maxTrailingChars){leadingChars+=trailingChars-maxTrailingChars;trailingChars=maxTrailingChars;if(leadingChars>maxLeadingChars)leadingChars=maxLeadingChars}var out=str.substring(index-leadingChars,index+trailingChars)+"\n";out+=" ".repeat(leadingChars)+caret;return out}var StringReader=/*#__PURE__*/function(){/**
64
+ charCode===10}var encodedEntitiesRegex=/&(#(\d+)|\w+);/gi;var predefinedDecodeEntities=/* @__PURE__ */new Map([["apos","'"],["amp","&"],["lt","<"],["gt",">"],["quot","\""]]);function decodeEntities(str){var namedEntities=arguments.length>1&&arguments[1]!==undefined?arguments[1]:predefinedDecodeEntities;if(encodedEntitiesRegex.test(str)){return str.replace(encodedEntitiesRegex,function(substring,entityName,codePoint){if(codePoint!==void 0)return String.fromCharCode(parseInt(codePoint));var entityValue=namedEntities.get(entityName.toLowerCase());if(!entityValue)return substring;return entityValue})}else{return str}}var standardEntityValueToNames=flipMap(predefinedDecodeEntities);function eqStr(a,b){var ignoreCase=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(a==null&&b==null)return true;if(a==null||b==null)return false;if(a===b)return true;if(ignoreCase)return a.length===b.length&&a.toLowerCase()===b.toLowerCase();return false}function _char(str){return str.charCodeAt(0)}function truncate(str,maxLength){var indicator=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\u2026";if(str==null)return str;if(str.length>maxLength)return str.substring(0,maxLength-indicator.length)+indicator;return str}// ../vinyl-util/src/util/math/math.ts
65
+ function clamp(value,min,max){return Math.min(Math.max(value,min),max)}function roundToNearest(value,snap){var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;return Math.round((value-offset)/snap)*snap+offset}// ../vinyl-util/src/util/serialization/ParseError.ts
66
+ function printStringPosition(str,index,options){var _a2;var caret=(options==null?void 0:options.caret)||"^";index=clamp(index,0,str.length);var minIndex=str.lastIndexOf("\n",index-1)+1;var maxIndex=str.indexOf("\n",index);if(maxIndex===-1)maxIndex=str.length;var split=(options==null?void 0:options.split)===void 0?0.6:options.split;var cols=((_a2=options==null?void 0:options.maxColumns)!=null?_a2:60)-caret.length;var leadingChars=cols*split;var trailingChars=cols*(1-split);var maxLeadingChars=index-minIndex;var maxTrailingChars=maxIndex-index;if(leadingChars>maxLeadingChars){trailingChars+=leadingChars-maxLeadingChars;leadingChars=maxLeadingChars;if(trailingChars>maxTrailingChars)trailingChars=maxTrailingChars}else if(trailingChars>maxTrailingChars){leadingChars+=trailingChars-maxTrailingChars;trailingChars=maxTrailingChars;if(leadingChars>maxLeadingChars)leadingChars=maxLeadingChars}var out=str.substring(index-leadingChars,index+trailingChars)+"\n";out+=" ".repeat(leadingChars)+caret;return out}// ../vinyl-util/src/util/string/StringReader.ts
67
+ var StringReader=/*#__PURE__*/function(){/**
53
68
  * @param data The string to read.
54
- */function StringReader(data){_classCallCheck(this,StringReader);this.data=data;__publicField2(this,"position",0)}/**
69
+ */function StringReader(data){_classCallCheck(this,StringReader);__publicField(this,"data",data);/**
70
+ * The current cursor.
71
+ * This should always be between the range 0 and `data.length`
72
+ */__publicField(this,"position",0)}/**
55
73
  * Returns true if the current {@link position} is less than the source data's length.
56
74
  */return _createClass(StringReader,[{key:"hasNext",value:function hasNext(){return this.position<this.data.length}/**
57
75
  * Returns the number of characters remaining to be read.
@@ -83,7 +101,7 @@ charCode===10}var encodedEntitiesRegex=/&(#(\d+)|\w+);/gi;var predefinedDecodeEn
83
101
  *
84
102
  * @param predicate
85
103
  * @returns number Returns the start index.
86
- */},{key:"until",value:function until(predicate){return this.while(function(charCode){return!predicate(charCode)})}/**
104
+ */},{key:"until",value:function until(predicate){return this["while"](function(charCode){return!predicate(charCode)})}/**
87
105
  * Reads characters until the given character has been found or the string length has been
88
106
  * reached.
89
107
  *
@@ -97,7 +115,7 @@ charCode===10}var encodedEntitiesRegex=/&(#(\d+)|\w+);/gi;var predefinedDecodeEn
97
115
  * @return number Returns the start index.
98
116
  */},{key:"untilString",value:function untilString(string){var start=this.position;var index=this.data.indexOf(string,this.position);this.position=index===-1?this.data.length:index;return start}/**
99
117
  * The same as {@link while} except returns the read substring as a result.
100
- */},{key:"substringWhile",value:function substringWhile(predicate){return this.data.substring(this.while(predicate),this.position)}/**
118
+ */},{key:"substringWhile",value:function substringWhile(predicate){return this.data.substring(this["while"](predicate),this.position)}/**
101
119
  * The same as {@link until} except returns the read substring as a result.
102
120
  */},{key:"substringUntil",value:function substringUntil(predicate){return this.substringWhile(function(charCode){return!predicate(charCode)})}/**
103
121
  * The same as {@link untilChar} except returns the read substring as a result.
@@ -127,7 +145,7 @@ charCode===10}var encodedEntitiesRegex=/&(#(\d+)|\w+);/gi;var predefinedDecodeEn
127
145
  * @see String.charCodeAt
128
146
  */},{key:"peek",get:function get(){return this.data.charCodeAt(this.position)}/**
129
147
  * Reads through all whitespace characters, returning the starting index.
130
- */},{key:"white",value:function white(){return this.while(isWhitespaceChar)}/**
148
+ */},{key:"white",value:function white(){return this["while"](isWhitespaceChar)}/**
131
149
  * If {@link peek} equals the given character code, returns true and advances the index by
132
150
  * one.
133
151
  *
@@ -135,7 +153,13 @@ charCode===10}var encodedEntitiesRegex=/&(#(\d+)|\w+);/gi;var predefinedDecodeEn
135
153
  */},{key:"charIf",value:function charIf(charCode){if(this.peek===charCode){this.next();return true}else{return false}}/**
136
154
  * If the given string matches the substring at the current position, returns true and advances
137
155
  * the index by the string's length.
138
- */},{key:"stringIf",value:function stringIf(string){var ignoreCase=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(this.remaining<string.length)return false;var substr=this.data.substring(this.position,this.position+string.length);var match=eqStr(substr,string,ignoreCase);if(match)this.position+=string.length;return match}}])}();var locale2={messageSeparator:", at: \n"};var StringParseError=/*#__PURE__*/function(_ReportableError3){function _StringParseError(str,position,reason){var _this5;_classCallCheck(this,_StringParseError);var location2=printStringPosition(str,position);_this5=_callSuper(this,_StringParseError,["".concat(reason).concat(locale2.messageSeparator).concat(location2),ErrorOrigin.PARSING]);_this5.position=position;_this5.reason=reason;__publicField2(_this5,"location");_this5.location=location2;Object.setPrototypeOf(_this5,_StringParseError.prototype);return _this5}_inherits(_StringParseError,_ReportableError3);return _createClass(_StringParseError,[{key:Symbol.toStringTag,get:function get(){return"StringParseError"}},{key:"toJSON",value:function toJSON(){return __spreadProps2(__spreadValues3({},_superPropGet(_StringParseError,"toJSON",this,3)([])),{position:this.position,location:this.location,reason:this.reason})}}])}(ReportableError);function union(a,b){return/* @__PURE__ */new Set([].concat(_toConsumableArray(a),_toConsumableArray(b)))}function ownKeys(obj){if(!obj)return/* @__PURE__ */new Set;if(typeof Reflect!=="undefined")return new Set(Reflect.ownKeys(obj));var properties=/* @__PURE__ */new Set;Object.getOwnPropertyNames(obj).forEach(function(item){return properties.add(item)});Object.getOwnPropertySymbols(obj).forEach(function(item){return properties.add(item)});return properties}function isPlainObject(value){if(!value||_typeof(value)!=="object"||Array.isArray(value))return false;var proto=Object.getPrototypeOf(value);return!proto||!Object.getPrototypeOf(proto)}function toJson(value){return toJsonInternal(value,/* @__PURE__ */new Set)}function toJsonInternal(value,visited){switch(_typeof(value)){case"object":return objectToJsonInternal(value,visited);case"undefined":case"boolean":case"number":case"string":return value;case"function":return"[function ".concat(value.name,"]");case"symbol":return"[symbol ".concat(value.toString().slice(7,-1),"]");case"bigint":return value.toString()}}function objectToJsonInternal(value,visited){if(value==null)return value;if(visited.has(value))return"<circular reference: ".concat(String(value),">");visited.add(value);if("toJSON"in value&&typeof value.toJSON==="function")return value.toJSON();if(value instanceof Set){return Array.from(value).map(function(e){return toJsonInternal(e,visited)})}else if(Array.isArray(value)){return value.map(function(e){return toJsonInternal(e,visited)})}else{if(isPlainObject(value)){var o={};for(var key in value){o[key]=toJsonInternal(value[key],visited)}return o}else if(value instanceof Error){return{name:value.name,message:value.message,stack:value.stack}}else{return value.toString()}}}function stringifyForPrint(value,maxLength){var indicator=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\u2026";var str=JSON.stringify(toJson(value),function(_,value2){var type=_typeof(value2);if(["undefined"].includes(type)){return"{{".concat(String(value2),"}}")}if(type==="number"){if(Number.isNaN(value2)||!Number.isFinite(value2))return"{{".concat(value2.toString(),"}}")}return value2}," ");str=str.replace(/("\{\{.*}}")/g,function(_,s){return s.substring(3,s.length-3)});if(maxLength)str=truncate(str,maxLength,indicator);return str}function parseBoolean(str){return str==="true"||str==="1"}function stringify(value){if(value===null)return"null";if(value===void 0)return"undefined";return value.toString()}function parseIntSafe(str,radix){if(!str)return null;var value=parseInt(str,radix);if(!Number.isFinite(value))return null;return value}var LinkedList=/*#__PURE__*/function(){function LinkedList(){_classCallCheck(this,LinkedList);__publicField2(this,"_head",null);__publicField2(this,"_tail",null)}/**
156
+ */},{key:"stringIf",value:function stringIf(string){var ignoreCase=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(this.remaining<string.length)return false;var substr=this.data.substring(this.position,this.position+string.length);var match=eqStr(substr,string,ignoreCase);if(match)this.position+=string.length;return match}}])}();var locale2={messageSeparator:", at: \n"};var StringParseError=/*#__PURE__*/function(_ReportableError3){function _StringParseError(str,position,reason){var _this5;_classCallCheck(this,_StringParseError);var location=printStringPosition(str,position);_this5=_callSuper(this,_StringParseError,["".concat(reason).concat(locale2.messageSeparator).concat(location),ErrorOrigin.PARSING]);__publicField(_this5,"position",position);__publicField(_this5,"reason",reason);__publicField(_this5,"location");_this5.location=location;Object.setPrototypeOf(_this5,_StringParseError.prototype);return _this5}_inherits(_StringParseError,_ReportableError3);return _createClass(_StringParseError,[{key:Symbol.toStringTag,get:function get(){return"StringParseError"}},{key:"toJSON",value:function toJSON(){return __spreadProps(__spreadValues({},_superPropGet(_StringParseError,"toJSON",this,3)([])),{position:this.position,location:this.location,reason:this.reason})}}])}(ReportableError);// ../vinyl-util/src/util/set/set.ts
157
+ function union(a,b){return/* @__PURE__ */new Set([].concat(_toConsumableArray(a),_toConsumableArray(b)))}// ../vinyl-util/src/util/object/object.ts
158
+ function ownKeys(obj){if(!obj)return/* @__PURE__ */new Set;if(typeof Reflect!=="undefined")return new Set(Reflect.ownKeys(obj));var properties=/* @__PURE__ */new Set;Object.getOwnPropertyNames(obj).forEach(function(item){return properties.add(item)});Object.getOwnPropertySymbols(obj).forEach(function(item){return properties.add(item)});return properties}function isPlainObject(value){if(!value||_typeof(value)!=="object"||Array.isArray(value))return false;var proto=Object.getPrototypeOf(value);return!proto||!Object.getPrototypeOf(proto)}// ../vinyl-util/src/util/serialization/json.ts
159
+ function toJson(value){return toJsonInternal(value,/* @__PURE__ */new Set)}function toJsonInternal(value,visited){switch(_typeof(value)){case"object":return objectToJsonInternal(value,visited);case"undefined":case"boolean":case"number":case"string":return value;case"function":return"[function ".concat(value.name,"]");case"symbol":return"[symbol ".concat(value.toString().slice(7,-1),"]");case"bigint":return value.toString()}}function objectToJsonInternal(value,visited){if(value==null)return value;if(visited.has(value))return"<circular reference: ".concat(String(value),">");visited.add(value);if("toJSON"in value&&typeof value.toJSON==="function")return value.toJSON();if(value instanceof Set){return Array.from(value).map(function(e){return toJsonInternal(e,visited)})}else if(Array.isArray(value)){return value.map(function(e){return toJsonInternal(e,visited)})}else{if(isPlainObject(value)){var o={};for(var key in value){o[key]=toJsonInternal(value[key],visited)}return o}else if(value instanceof Error){return{name:value.name,message:value.message,stack:value.stack}}else{return value.toString()}}}// ../vinyl-util/src/util/serialization/stringifyForPrint.ts
160
+ function stringifyForPrint(value,maxLength){var indicator=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\u2026";var str=JSON.stringify(toJson(value),function(_,value2){var type=_typeof(value2);if(["undefined"].includes(type)){return"{{".concat(String(value2),"}}")}if(type==="number"){if(Number.isNaN(value2)||!Number.isFinite(value2))return"{{".concat(value2.toString(),"}}")}return value2}," ");str=str.replace(/("\{\{.*}}")/g,function(_,s){return s.substring(3,s.length-3)});if(maxLength)str=truncate(str,maxLength,indicator);return str}// ../vinyl-util/src/util/serialization/primitives.ts
161
+ function parseBoolean(str){return str==="true"||str==="1"}function stringify(value){if(value===null)return"null";if(value===void 0)return"undefined";return value.toString()}function parseIntSafe(str,radix){if(!str)return null;var value=parseInt(str,radix);if(!Number.isFinite(value))return null;return value}// ../vinyl-util/src/util/collection/LinkedList.ts
162
+ var LinkedList=/*#__PURE__*/function(){function LinkedList(){_classCallCheck(this,LinkedList);__publicField(this,"_head",null);__publicField(this,"_tail",null)}/**
139
163
  * Returns the current head.
140
164
  */return _createClass(LinkedList,[{key:"head",get:function get(){return this._head}/**
141
165
  * Returns the current tail.
@@ -234,13 +258,41 @@ charCode===10}var encodedEntitiesRegex=/&(#(\d+)|\w+);/gi;var predefinedDecodeEn
234
258
  * @param start The starting node. (inclusive)
235
259
  * @param end The ending node (exclusive).
236
260
  * @param next A method that is given the current node, and returns the next node.
237
- */},{key:"createIterator",value:function createIterator(start,end,_next2){var current=start;return{[Symbol.iterator]:function(){return this},next:function next(){if(current===end||!current){return{value:void 0,done:true}}var result={value:current.value,done:false};current=_next2(current);while(current==null?void 0:current.removed){current=_next2(current)}return result}}}}])}();function last(arrayLike){if(!arrayLike)return void 0;return arrayLike[arrayLike.length-1]}function cloneTypedArray(array){return new array.constructor(array)}var typedArrayTypes=[Float32Array,Float64Array,Int16Array,Int32Array,Int8Array,Uint16Array,Uint32Array,Uint8Array,Uint8ClampedArray];function isTypedArray(value){return typedArrayTypes.some(function(type){return value instanceof type})}function isCloneable(value){return value!=null&&_typeof(value)==="object"&&"clone"in value&&typeof value.clone==="function"&&value.clone.length===0}var locale3={cyclicRefError:"Cyclic reference found at: {path}",mergeReferenceError:"No merge rule found at {path} for \"{source}\" and reference copy not allowed"};function mergeDeep(sources,options){if(!sources.length)return void 0;var finalOpts=__spreadValues3(__spreadValues3({},defaultMergeOptions),options);var stack=new PropStack;var n=sources.length;if(n===1)return _mergeDeep(void 0,sources[0],stack,0,finalOpts);var out=_mergeDeep(sources[0],sources[1],stack,1,finalOpts);for(var i=2;i<n;i++){out=_mergeDeep(out,sources[i],stack,i,finalOpts)}return out}var PropStack=/*#__PURE__*/function(){function PropStack(){_classCallCheck(this,PropStack);__publicField2(this,"refsA",/* @__PURE__ */new Set);__publicField2(this,"refsB",/* @__PURE__ */new Set);__publicField2(this,"propStack",[])}/**
261
+ */},{key:"createIterator",value:function createIterator(start,end,_next2){var current=start;return _defineProperty(_defineProperty({},Symbol.iterator,function(){return this}),"next",function next(){if(current===end||!current){return{value:void 0,done:true}}var result={value:current.value,done:false};current=_next2(current);while(current==null?void 0:current.removed){current=_next2(current)}return result})}}])}();// ../vinyl-util/src/util/collection/array.ts
262
+ function last(arrayLike){if(!arrayLike)return void 0;return arrayLike[arrayLike.length-1]}// ../vinyl-util/src/util/collection/typedArray.ts
263
+ function cloneTypedArray(array){return new array.constructor(array)}var typedArrayTypes=[Float32Array,Float64Array,Int16Array,Int32Array,Int8Array,Uint16Array,Uint32Array,Uint8Array,Uint8ClampedArray];function isTypedArray(value){return typedArrayTypes.some(function(type){return value instanceof type})}// ../vinyl-util/src/core/cloneable.ts
264
+ function isCloneable(value){return value!=null&&_typeof(value)==="object"&&"clone"in value&&typeof value.clone==="function"&&value.clone.length===0}// ../vinyl-util/src/util/object/mergeDeep.ts
265
+ var locale3={cyclicRefError:"Cyclic reference found at: {path}",mergeReferenceError:"No merge rule found at {path} for \"{source}\" and reference copy not allowed"};function mergeDeep(sources,options){if(!sources.length)return void 0;var finalOpts=__spreadValues(__spreadValues({},defaultMergeOptions),options);var stack=new PropStack;var n=sources.length;if(n===1)return _mergeDeep(void 0,sources[0],stack,0,finalOpts);var out=_mergeDeep(sources[0],sources[1],stack,1,finalOpts);for(var i=2;i<n;i++){out=_mergeDeep(out,sources[i],stack,i,finalOpts)}return out}var PropStack=/*#__PURE__*/function(){function PropStack(){_classCallCheck(this,PropStack);/**
266
+ * Object references for sourceA.
267
+ */__publicField(this,"refsA",/* @__PURE__ */new Set);/**
268
+ * Object references for sourceB.
269
+ */__publicField(this,"refsB",/* @__PURE__ */new Set);__publicField(this,"propStack",[])}/**
238
270
  * The property stack, joined by .
239
- */return _createClass(PropStack,[{key:"currentPath",get:function get(){return this.propStack.map(function(e){return e[2]}).filter(function(e){return e!=null}).join(".")}},{key:"push",value:function push(sourceA,sourceB,prop){this.propStack.push([sourceA,sourceB,prop]);this.addRef(this.refsA,sourceA);this.addRef(this.refsB,sourceB)}},{key:"pop",value:function pop(){var last2=this.propStack.pop();this.refsA.delete(last2[0]);this.refsB.delete(last2[1])}},{key:"addRef",value:function addRef(refSet,source){if(_typeof(source)!=="object")return;if(refSet.has(source)){throw new IllegalArgumentError(substitute(locale3.cyclicRefError,{path:this.currentPath}))}refSet.add(source)}}])}();function _mergeDeep(sourceA,sourceB,propStack,prop,options){if(_typeof(sourceB)!=="object"||sourceB===null)return sourceB;var merge2=function merge2(sourceA2,sourceB2,prop2){return _mergeDeep(sourceA2,sourceB2,propStack,prop2,options)};var _iterator6=_createForOfIteratorHelper(options.rules),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var rule=_step6.value;if(rule.matches(sourceB)){propStack.push(sourceA,sourceB,prop);var result=rule.merge(rule.matches(sourceA)?sourceA:void 0,sourceB,merge2);propStack.pop();return result}}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}if(!options.allowReferenceCopy){propStack.push(sourceA,sourceB,prop);throw new MergeReferenceError(propStack.currentPath,sourceB)}return sourceB}var MergeReferenceError=/*#__PURE__*/function(_ReportableError4){function _MergeReferenceError(propPath,source){var _this6;_classCallCheck(this,_MergeReferenceError);_this6=_callSuper(this,_MergeReferenceError,[substitute(locale3.mergeReferenceError,{path:propPath,source:source})]);Object.setPrototypeOf(_this6,_MergeReferenceError.prototype);return _this6}_inherits(_MergeReferenceError,_ReportableError4);return _createClass(_MergeReferenceError)}(ReportableError);var cloneableMergeRule={matches:function matches(object){return isCloneable(object)},merge:function merge(_1,sourceB,_2){return sourceB.clone()}};var arrayMergeRule={matches:function matches(object){return Array.isArray(object)},merge:function merge(sourceA,sourceB,merge2){var out=[];if(sourceA){var _iterator7=_createForOfIteratorHelper(sourceA),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var element2=_step7.value;out.push(merge2(void 0,element2,out.length))}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}}var _iterator8=_createForOfIteratorHelper(sourceB),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _element=_step8.value;out.push(merge2(void 0,_element,out.length))}}catch(err){_iterator8.e(err)}finally{_iterator8.f()}return out}};var plainObjectMergeRule={matches:function matches(object){return isPlainObject(object)},merge:function merge(sourceA,sourceB,merge2){var out={};var _iterator9=_createForOfIteratorHelper(union(ownKeys(sourceA),ownKeys(sourceB))),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var key=_step9.value;if(sourceA&&key in sourceB&&key in sourceA){out[key]=merge2(sourceA[key],sourceB[key],key)}else if(sourceA&&key in sourceA){out[key]=merge2(void 0,sourceA[key],key)}else{out[key]=merge2(void 0,sourceB[key],key)}}}catch(err){_iterator9.e(err)}finally{_iterator9.f()}return out}};var regexpMergeRule={matches:function matches(object){return object instanceof RegExp},merge:function merge(_1,sourceB,_2){return new RegExp(sourceB.source,sourceB.flags)}};var dateMergeRule={matches:function matches(object){return object instanceof Date},merge:function merge(_1,sourceB,_2){return new Date(sourceB.getTime())}};var mapMergeRule={matches:function matches(object){return object instanceof Map},merge:function merge(sourceA,sourceB,merge2){var _a2;var out=/* @__PURE__ */new Map;var _iterator0=_createForOfIteratorHelper(/* @__PURE__ */new Set([].concat(_toConsumableArray((_a2=sourceA==null?void 0:sourceA.keys())!=null?_a2:[]),_toConsumableArray(sourceB.keys())))),_step0;try{for(_iterator0.s();!(_step0=_iterator0.n()).done;){var key=_step0.value;if(sourceB.has(key)&&(sourceA==null?void 0:sourceA.has(key))){out.set(key,merge2(sourceA.get(key),sourceB.get(key),key))}else if(sourceA==null?void 0:sourceA.has(key)){out.set(key,merge2(void 0,sourceA.get(key),key))}else{out.set(key,merge2(void 0,sourceB.get(key),key))}}}catch(err){_iterator0.e(err)}finally{_iterator0.f()}return out}};var setMergeRule={matches:function matches(object){return object instanceof Set},merge:function merge(sourceA,sourceB,merge2){var _a2;return new Set([].concat(_toConsumableArray((_a2=sourceA==null?void 0:sourceA.values())!=null?_a2:[]),_toConsumableArray(sourceB.values())).map(function(element2,index){return merge2(void 0,element2,index)}))}};var typedArrayMergeRule={matches:function matches(object){return isTypedArray(object)},merge:function merge(_1,sourceB,_2){return cloneTypedArray(sourceB)}};var urlMergeRule={matches:function matches(object){return object instanceof URL},merge:function merge(_1,sourceB,_2){return new URL(sourceB.toString())}};var defaultMergeOptions={allowReferenceCopy:true,rules:[cloneableMergeRule,arrayMergeRule,plainObjectMergeRule,regexpMergeRule,dateMergeRule,mapMergeRule,setMergeRule,typedArrayMergeRule,urlMergeRule]};function merge(){var _Array$prototype;for(var _len4=arguments.length,sources=new Array(_len4),_key4=0;_key4<_len4;_key4++){sources[_key4]=arguments[_key4]}if(!sources.length)return void 0;if(Array.isArray(sources[0]))return(_Array$prototype=Array.prototype).concat.apply(_Array$prototype,sources);return Object.assign.apply(Object,[{}].concat(sources))}var IllegalStateError=/*#__PURE__*/function(_ReportableError5){function _IllegalStateError(message){var _this7;_classCallCheck(this,_IllegalStateError);_this7=_callSuper(this,_IllegalStateError,[message]);Object.setPrototypeOf(_this7,_IllegalStateError.prototype);return _this7}_inherits(_IllegalStateError,_ReportableError5);return _createClass(_IllegalStateError,[{key:Symbol.toStringTag,get:function get(){return"IllegalStateError"}}])}(ReportableError);function _clone(target,options){var _a2,_b,_c;return mergeDeep([target],{allowReferenceCopy:(_a2=options==null?void 0:options.allowReferenceCopy)!=null?_a2:false,rules:(_c=(_b=options==null?void 0:options.rules)==null?void 0:_b.map(toMergeRule))!=null?_c:defaultMergeOptions.rules})}function toMergeRule(cloneRule){return{matches:cloneRule.matches,merge:function merge(_sourceA,sourceB,merge2){return cloneRule.clone(sourceB,function(source,prop){return merge2(void 0,source,prop)})}}}var ValidationError=/*#__PURE__*/function(_ReportableError6){/**
271
+ */return _createClass(PropStack,[{key:"currentPath",get:function get(){return this.propStack.map(function(e){return e[2]}).filter(function(e){return e!=null}).join(".")}},{key:"push",value:function push(sourceA,sourceB,prop){this.propStack.push([sourceA,sourceB,prop]);this.addRef(this.refsA,sourceA);this.addRef(this.refsB,sourceB)}},{key:"pop",value:function pop(){var last2=this.propStack.pop();this.refsA["delete"](last2[0]);this.refsB["delete"](last2[1])}},{key:"addRef",value:function addRef(refSet,source){if(_typeof(source)!=="object")return;if(refSet.has(source)){throw new IllegalArgumentError(substitute(locale3.cyclicRefError,{path:this.currentPath}))}refSet.add(source)}}])}();function _mergeDeep(sourceA,sourceB,propStack,prop,options){if(_typeof(sourceB)!=="object"||sourceB===null)return sourceB;var merge=function merge(sourceA2,sourceB2,prop2){return _mergeDeep(sourceA2,sourceB2,propStack,prop2,options)};var _iterator5=_createForOfIteratorHelper(options.rules),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var rule=_step5.value;if(rule.matches(sourceB)){propStack.push(sourceA,sourceB,prop);var result=rule.merge(rule.matches(sourceA)?sourceA:void 0,sourceB,merge);propStack.pop();return result}}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}if(!options.allowReferenceCopy){propStack.push(sourceA,sourceB,prop);throw new MergeReferenceError(propStack.currentPath,sourceB)}return sourceB}var MergeReferenceError=/*#__PURE__*/function(_ReportableError4){function _MergeReferenceError(propPath,source){var _this6;_classCallCheck(this,_MergeReferenceError);_this6=_callSuper(this,_MergeReferenceError,[substitute(locale3.mergeReferenceError,{path:propPath,source:source})]);Object.setPrototypeOf(_this6,_MergeReferenceError.prototype);return _this6}_inherits(_MergeReferenceError,_ReportableError4);return _createClass(_MergeReferenceError)}(ReportableError);var cloneableMergeRule={matches:function matches(object){return isCloneable(object)},merge:function merge(_1,sourceB,_2){return sourceB.clone()}};var arrayMergeRule={matches:function matches(object){return Array.isArray(object)},merge:function merge(sourceA,sourceB,_merge){var out=[];if(sourceA){var _iterator6=_createForOfIteratorHelper(sourceA),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var element2=_step6.value;out.push(_merge(void 0,element2,out.length))}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}var _iterator7=_createForOfIteratorHelper(sourceB),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _element=_step7.value;out.push(_merge(void 0,_element,out.length))}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}return out}};var plainObjectMergeRule={matches:function matches(object){return isPlainObject(object)},merge:function merge(sourceA,sourceB,_merge2){var out={};var _iterator8=_createForOfIteratorHelper(union(ownKeys(sourceA),ownKeys(sourceB))),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var key=_step8.value;if(sourceA&&key in sourceB&&key in sourceA){out[key]=_merge2(sourceA[key],sourceB[key],key)}else if(sourceA&&key in sourceA){out[key]=_merge2(void 0,sourceA[key],key)}else{out[key]=_merge2(void 0,sourceB[key],key)}}}catch(err){_iterator8.e(err)}finally{_iterator8.f()}return out}};var regexpMergeRule={matches:function matches(object){return object instanceof RegExp},merge:function merge(_1,sourceB,_2){return new RegExp(sourceB.source,sourceB.flags)}};var dateMergeRule={matches:function matches(object){return object instanceof Date},merge:function merge(_1,sourceB,_2){return new Date(sourceB.getTime())}};var mapMergeRule={matches:function matches(object){return object instanceof Map},merge:function merge(sourceA,sourceB,_merge3){var _a2;var out=/* @__PURE__ */new Map;var _iterator9=_createForOfIteratorHelper(/* @__PURE__ */new Set([].concat(_toConsumableArray((_a2=sourceA==null?void 0:sourceA.keys())!=null?_a2:[]),_toConsumableArray(sourceB.keys())))),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var key=_step9.value;if(sourceB.has(key)&&(sourceA==null?void 0:sourceA.has(key))){out.set(key,_merge3(sourceA.get(key),sourceB.get(key),key))}else if(sourceA==null?void 0:sourceA.has(key)){out.set(key,_merge3(void 0,sourceA.get(key),key))}else{out.set(key,_merge3(void 0,sourceB.get(key),key))}}}catch(err){_iterator9.e(err)}finally{_iterator9.f()}return out}};var setMergeRule={matches:function matches(object){return object instanceof Set},merge:function merge(sourceA,sourceB,_merge4){var _a2;return new Set([].concat(_toConsumableArray((_a2=sourceA==null?void 0:sourceA.values())!=null?_a2:[]),_toConsumableArray(sourceB.values())).map(function(element2,index){return _merge4(void 0,element2,index)}))}};var typedArrayMergeRule={matches:function matches(object){return isTypedArray(object)},merge:function merge(_1,sourceB,_2){return cloneTypedArray(sourceB)}};var urlMergeRule={matches:function matches(object){return object instanceof URL},merge:function merge(_1,sourceB,_2){return new URL(sourceB.toString())}};var defaultMergeOptions={allowReferenceCopy:true,rules:[cloneableMergeRule,arrayMergeRule,plainObjectMergeRule,regexpMergeRule,dateMergeRule,mapMergeRule,setMergeRule,typedArrayMergeRule,urlMergeRule]};// ../vinyl-util/src/error/IllegalStateError.ts
272
+ var IllegalStateError=/*#__PURE__*/function(_ReportableError5){function _IllegalStateError(message){var _this7;_classCallCheck(this,_IllegalStateError);_this7=_callSuper(this,_IllegalStateError,[message]);Object.setPrototypeOf(_this7,_IllegalStateError.prototype);return _this7}_inherits(_IllegalStateError,_ReportableError5);return _createClass(_IllegalStateError,[{key:Symbol.toStringTag,get:function get(){return"IllegalStateError"}}])}(ReportableError);// ../vinyl-util/src/util/object/clone.ts
273
+ function _clone(target,options){var _a2,_b,_c;return mergeDeep([target],{allowReferenceCopy:(_a2=options==null?void 0:options.allowReferenceCopy)!=null?_a2:false,rules:(_c=(_b=options==null?void 0:options.rules)==null?void 0:_b.map(toMergeRule))!=null?_c:defaultMergeOptions.rules})}function toMergeRule(cloneRule){return{matches:cloneRule.matches,merge:function merge(_sourceA,sourceB,_merge5){return cloneRule.clone(sourceB,function(source,prop){return _merge5(void 0,source,prop)})}}}// ../vinyl-util/src/error/ValidationError.ts
274
+ var ValidationError=/*#__PURE__*/function(_ReportableError6){/**
240
275
  * @param message The validation error message.
241
276
  * @param origin The error origin, typically API (default) or SERVICE_EXTERNAL
242
277
  * @param path The property path to the invalid field.
243
- */function _ValidationError(message){var _this8;var origin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ErrorOrigin.API;var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];_classCallCheck(this,_ValidationError);_this8=_callSuper(this,_ValidationError,[message,origin]);_this8.path=path;Object.setPrototypeOf(_this8,_ValidationError.prototype);return _this8}_inherits(_ValidationError,_ReportableError6);return _createClass(_ValidationError,[{key:Symbol.toStringTag,get:function get(){return"ValidationError"}},{key:"toJSON",value:function toJSON(){return __spreadProps2(__spreadValues3({},_superPropGet(_ValidationError,"toJSON",this,3)([])),{origin:this.origin,path:this.path})}}])}(ReportableError);function mapIter(iterable,transform){var it2=iterable[Symbol.iterator]();return{[Symbol.iterator]:function(){return mapIter(iterable,transform)},next:function next(){var result=it2.next();if(result.done)return result;return{value:transform(result.value),done:false}}}}var LruCache=/*#__PURE__*/function(){function LruCache(initialCapacity){_classCallCheck(this,LruCache);__publicField2(this,"cache",/* @__PURE__ */new Map);__publicField2(this,"list",/* @__PURE__ */new LinkedList);__publicField2(this,"onEvicting",null);__publicField2(this,"onEvict",null);__publicField2(this,"_capacity",0);this._capacity=initialCapacity}return _createClass(LruCache,[{key:"capacity",get:function get(){return this._capacity},set:function set(value){this._capacity=value;while(this.cache.size>this.capacity){this.evictLeastRecentlyUsed()}}/**
278
+ */function _ValidationError(message){var _this8;var origin=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ErrorOrigin.API;var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];_classCallCheck(this,_ValidationError);_this8=_callSuper(this,_ValidationError,[message,origin]);__publicField(_this8,"path",path);Object.setPrototypeOf(_this8,_ValidationError.prototype);return _this8}_inherits(_ValidationError,_ReportableError6);return _createClass(_ValidationError,[{key:Symbol.toStringTag,get:function get(){return"ValidationError"}},{key:"toJSON",value:function toJSON(){return __spreadProps(__spreadValues({},_superPropGet(_ValidationError,"toJSON",this,3)([])),{origin:this.origin,path:this.path})}}])}(ReportableError);// ../vinyl-util/src/util/iteration/iterable.ts
279
+ function mapIter(iterable,transform){var it2=iterable[Symbol.iterator]();return _defineProperty(_defineProperty({},Symbol.iterator,function(){return mapIter(iterable,transform)}),"next",function next(){var result=it2.next();if(result.done)return result;return{value:transform(result.value),done:false}})}// ../vinyl-util/src/util/collection/LruCache.ts
280
+ var LruCache=/*#__PURE__*/function(){function LruCache(initialCapacity){_classCallCheck(this,LruCache);/**
281
+ * A map of the list nodes.
282
+ *
283
+ * @private
284
+ */__publicField(this,"cache",/* @__PURE__ */new Map);/**
285
+ * Most recently used elements are at the tail, least recently used are at the head.
286
+ * @private
287
+ */__publicField(this,"list",new LinkedList);/**
288
+ * An element is about to be removed. Should return true if the element may be evicted,
289
+ * otherwise false.
290
+ * If false is returned for all elements, an IllegalStateError is thrown.
291
+ */__publicField(this,"onEvicting",null);/**
292
+ * When an element is added when at capacity, the least recently used element will be removed.
293
+ * This callback can be set to be notified with the element being evicted, which may be used
294
+ * for disposal.
295
+ */__publicField(this,"onEvict",null);__publicField(this,"_capacity",0);this._capacity=initialCapacity}return _createClass(LruCache,[{key:"capacity",get:function get(){return this._capacity},set:function set(value){this._capacity=value;while(this.cache.size>this.capacity){this.evictLeastRecentlyUsed()}}/**
244
296
  * @returns the number of elements in the Map.
245
297
  */},{key:"size",get:function get(){return this.cache.size}/**
246
298
  * @returns boolean indicating whether an element with the specified key exists or not.
@@ -254,11 +306,11 @@ charCode===10}var encodedEntitiesRegex=/&(#(\d+)|\w+);/gi;var predefinedDecodeEn
254
306
  * Adds a new element with a specified key and value to the Map. If an element with the
255
307
  * same key already exists, the element will be updated and position moved to most recently
256
308
  * used.
257
- */},{key:"set",value:function set(key,value){if(this.has(key)){var node=this.cache.get(key);node.value[1]=value;this.list.pushNode(node)}else{var _node=this.list.push([key,value]);this.cache.set(key,_node);if(this.cache.size>this.capacity){this.evictLeastRecentlyUsed()}}return this}},{key:"evictLeastRecentlyUsed",value:function evictLeastRecentlyUsed(){var _a2,_b,_c;var node=this.list.head;while(node){var _node$value=_slicedToArray(node.value,2),key2=_node$value[0],value2=_node$value[1];var allowed=(_b=(_a2=this.onEvicting)==null?void 0:_a2.call(null,value2,key2,this))!=null?_b:true;if(allowed)break;node=node.next}if(!node)throw new IllegalStateError("onEvicting returned false for all elements");var _node$value2=_slicedToArray(node.value,2),key=_node$value2[0],value=_node$value2[1];this.list.remove(node);this.cache.delete(node.value[0]);(_c=this.onEvict)==null?void 0:_c.call(null,value,key,this)}/**
309
+ */},{key:"set",value:function set(key,value){if(this.has(key)){var node=this.cache.get(key);node.value[1]=value;this.list.pushNode(node)}else{var _node=this.list.push([key,value]);this.cache.set(key,_node);if(this.cache.size>this.capacity){this.evictLeastRecentlyUsed()}}return this}},{key:"evictLeastRecentlyUsed",value:function evictLeastRecentlyUsed(){var _a2,_b,_c;var node=this.list.head;while(node){var _node$value=_slicedToArray(node.value,2),key2=_node$value[0],value2=_node$value[1];var allowed=(_b=(_a2=this.onEvicting)==null?void 0:_a2.call(null,value2,key2,this))!=null?_b:true;if(allowed)break;node=node.next}if(!node)throw new IllegalStateError("onEvicting returned false for all elements");var _node$value2=_slicedToArray(node.value,2),key=_node$value2[0],value=_node$value2[1];this.list.remove(node);this.cache["delete"](node.value[0]);(_c=this.onEvict)==null?void 0:_c.call(null,value,key,this)}/**
258
310
  * Clears all elements from the cache.
259
311
  */},{key:"clear",value:function clear(){this.list.clear();this.cache.clear()}/**
260
312
  * @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
261
- */},{key:"delete",value:function _delete(key){if(!this.has(key))return false;var node=this.cache.get(key);this.cache.delete(key);this.list.remove(node);return true}/**
313
+ */},{key:"delete",value:function _delete(key){if(!this.has(key))return false;var node=this.cache.get(key);this.cache["delete"](key);this.list.remove(node);return true}/**
262
314
  * Executes a provided function once per each key/value pair in the Map, in insertion order.
263
315
  *
264
316
  * @param callback A callback to invoke for every element in the cache.
@@ -268,21 +320,30 @@ charCode===10}var encodedEntitiesRegex=/&(#(\d+)|\w+);/gi;var predefinedDecodeEn
268
320
  */},{key:"entries",value:function entries(){return this[Symbol.iterator]()}/**
269
321
  * Returns an iterable of keys in the map. This will be ordered from least recently used to
270
322
  * most.
271
- */},{key:"keys",value:function keys(){return mapIter(this.list,function(_ref2){var _ref3=_slicedToArray(_ref2,1),key=_ref3[0];return key})}/**
323
+ */},{key:"keys",value:function keys(){return mapIter(this.list,function(_ref4){var _ref5=_slicedToArray(_ref4,1),key=_ref5[0];return key})}/**
272
324
  * Returns an iterable of values in the map. This will be ordered from least recently used to
273
325
  * most.
274
- */},{key:"values",value:function values(){return mapIter(this.list,function(_ref4){var _ref5=_slicedToArray(_ref4,2),value=_ref5[1];return value})}},{key:Symbol.iterator,value:function value(){return this.list[Symbol.iterator]()}},{key:Symbol.toStringTag,get:function get(){return"LruCache"}}])}();function memoize(inner,keyProvider){var capacity=arguments.length>2&&arguments[2]!==undefined?arguments[2]:500;if(!keyProvider){var cached=false;var value=void 0;var memoized=function memoized(){if(!cached){cached=true;value=inner()}return value};return Object.assign(memoized,{clear:function clear(){cached=false;value=void 0}})}else if(capacity===0){var _memoized=function _memoized(){return inner.apply(void 0,arguments)};return Object.assign(_memoized,{clear:function clear(){}})}else if(capacity===1){var hasValue=false;var cachedKey;var cachedValue;var _memoized2=function _memoized2(){var key=keyProvider.apply(void 0,arguments);if(!hasValue||cachedKey!==key){hasValue=true;cachedKey=key;cachedValue=inner.apply(void 0,arguments)}return cachedValue};return Object.assign(_memoized2,{clear:function clear(){hasValue=false}})}else{var cache=new LruCache(capacity);var _memoized3=function _memoized3(){for(var _len5=arguments.length,args=new Array(_len5),_key5=0;_key5<_len5;_key5++){args[_key5]=arguments[_key5]}var key=keyProvider.apply(void 0,args);return getOrSet(cache,key,function(){return inner.apply(void 0,args)})};return Object.assign(_memoized3,{clear:function clear(){cache.clear()}})}}var locale4={invalidDateError:"\"{value}\" is an invalid date"};function parseTimestamp(str){var timestamp=Date.parse(str);if(Number.isNaN(timestamp))throw new ValidationError(substitute(locale4.invalidDateError,{value:str}),ErrorOrigin.PARSING);return timestamp}function parseDate(str){return new Date(parseTimestamp(str))}function stringifyDate(value){return value.toISOString()}// src/error/parsingError.ts
326
+ */},{key:"values",value:function values(){return mapIter(this.list,function(_ref6){var _ref7=_slicedToArray(_ref6,2),value=_ref7[1];return value})}},{key:Symbol.iterator,value:function value(){return this.list[Symbol.iterator]()}},{key:Symbol.toStringTag,get:function get(){return"LruCache"}}])}();// ../vinyl-util/src/util/fun/memoize.ts
327
+ function memoize(inner,keyProvider){var capacity=arguments.length>2&&arguments[2]!==undefined?arguments[2]:500;if(!keyProvider){var cached=false;var value=void 0;var memoized=function memoized(){if(!cached){cached=true;value=inner()}return value};return Object.assign(memoized,{clear:function clear(){cached=false;value=void 0}})}else if(capacity===0){var _memoized=function _memoized(){return inner.apply(void 0,arguments)};return Object.assign(_memoized,{clear:function clear(){}})}else if(capacity===1){var hasValue=false;var cachedKey;var cachedValue;var _memoized2=function _memoized2(){var key=keyProvider.apply(void 0,arguments);if(!hasValue||cachedKey!==key){hasValue=true;cachedKey=key;cachedValue=inner.apply(void 0,arguments)}return cachedValue};return Object.assign(_memoized2,{clear:function clear(){hasValue=false}})}else{var cache=new LruCache(capacity);var _memoized3=function _memoized3(){for(var _len4=arguments.length,args=new Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4]}var key=keyProvider.apply(void 0,args);return getOrSet(cache,key,function(){return inner.apply(void 0,args)})};return Object.assign(_memoized3,{clear:function clear(){cache.clear()}})}}// ../vinyl-util/src/util/date/date.ts
328
+ var locale4={invalidDateError:"\"{value}\" is an invalid date"};function parseTimestamp(str){var timestamp=Date.parse(str);if(Number.isNaN(timestamp))throw new ValidationError(substitute(locale4.invalidDateError,{value:str}),ErrorOrigin.PARSING);return timestamp}function parseDate(str){return new Date(parseTimestamp(str))}function stringifyDate(value){return value.toISOString()}// src/error/parsingError.ts
275
329
  function throwParsingError(message){throw new ValidationError(message,ErrorOrigin.PARSING)}// src/media/ratio.ts
276
330
  var ratioRegExp=/^([0-9]*):([0-9]*)$/;function parseRatio(str){var match=str?ratioRegExp.exec(str):null;if(!match)throwParsingError("invalid ratio format: ".concat(str));return[parseInt(match[1]||"1"),parseInt(match[2]||"1")]}function stringifyRatio(value){return"".concat(value[0],":").concat(value[1])}// src/media/frameRate.ts
277
331
  var framerateRegexp=/^(\d+)(?:\/(\d+))?$/;function parseFrameRate(str){var match=str?framerateRegexp.exec(str):null;if(!match)throwParsingError("invalid frame rate: '".concat(str,"'"));return[parseInt(match[1]),parseInt(match[2]||"1")]}function stringifyFrameRate(value){return value[1]===1?value[0].toString():"".concat(value[0],"/").concat(value[1])}// src/media/byteRange.ts
278
- var byteRangeExp=/^(-?[0-9]+)-(-?[0-9]*)$/;function parseByteRange(str){var match=str?byteRangeExp.exec(str):null;if(!match)throwParsingError("invalid byte range: '".concat(str,"'"));var start=parseInt(match[1]);if(start<0)start>>>=0;var end=parseIntSafe(match[2]);if(end!=null&&end<0)end=end>>>0;return[start,end]}function stringifyByteRange(value){var end=value[1];return"".concat(value[0],"-").concat(end==null?"":end)}// ../vinyl-validation/dist/index.js
279
- var __defProp4=Object.defineProperty;var __defProps3=Object.defineProperties;var __getOwnPropDescs3=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols4=Object.getOwnPropertySymbols;var __hasOwnProp4=Object.prototype.hasOwnProperty;var __propIsEnum4=Object.prototype.propertyIsEnumerable;var __defNormalProp4=function __defNormalProp4(obj,key,value){return key in obj?__defProp4(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value};var __spreadValues4=function __spreadValues4(a,b){for(var prop in b||(b={}))if(__hasOwnProp4.call(b,prop))__defNormalProp4(a,prop,b[prop]);if(__getOwnPropSymbols4){var _iterator1=_createForOfIteratorHelper(__getOwnPropSymbols4(b)),_step1;try{for(_iterator1.s();!(_step1=_iterator1.n()).done;){var prop=_step1.value;if(__propIsEnum4.call(b,prop))__defNormalProp4(a,prop,b[prop])}}catch(err){_iterator1.e(err)}finally{_iterator1.f()}}return a};var __spreadProps3=function __spreadProps3(a,b){return __defProps3(a,__getOwnPropDescs3(b))};var __publicField3=function __publicField3(obj,key,value){return __defNormalProp4(obj,_typeof(key)!=="symbol"?key+"":key,value)};var validatorLocale={/**
332
+ var byteRangeExp=/^(-?[0-9]+)-(-?[0-9]*)$/;function parseByteRange(str){var match=str?byteRangeExp.exec(str):null;if(!match)throwParsingError("invalid byte range: '".concat(str,"'"));var start=parseInt(match[1]);if(start<0)start>>>=0;var end=parseIntSafe(match[2]);if(end!=null&&end<0)end=end>>>0;return[start,end]}function stringifyByteRange(value){var end=value[1];return"".concat(value[0],"-").concat(end==null?"":end)}// ../vinyl-xml/src/xml/xmlRules.ts
333
+ function element(rules,options){return __spreadProps(__spreadValues({type:"element"/* ELEMENT */,localPart:void 0,namespaceUri:void 0,required:false},options),{rules:rules})}function elements(rules,options){return __spreadProps(__spreadValues({type:"elements"/* ELEMENTS */,localPart:void 0,namespaceUri:void 0,minOccurs:0,maxOccurs:null,useEmptyArrays:false},options),{rules:rules})}function characters(parse,stringify2){return{type:"characters"/* CHARACTERS */,parse:parse,stringify:stringify2}}var charactersString=characters(function(i){return i},stringify);function attr(parse,stringify2,options){return __spreadProps(__spreadValues({type:"attribute"/* ATTRIBUTE */,localPart:void 0,namespaceUri:null,required:false,"default":void 0},options),{parse:parse,stringify:stringify2})}function attrString(options){return attr(function(i){return i},stringify,options)}function attrInt(options){return attr(parseInt,stringify,options)}function attrFloat(options){return attr(parseFloat,stringify,options)}function attrBoolean(options){return attr(parseBoolean,stringify,options)}function attrDateTime(options){return attr(parseDate,stringifyDate,options)}// ../vinyl-xml/src/xml/XmlSchemaError.ts
334
+ var xmlSchemaErrorLocale={atLeastElements:"Expected at least {expected} occurrences of {property} but was {actual}",atMostElements:"Expected at most {expected} occurrences of {property} but was {actual}",cyclicReferences:"Cyclic reference detected",requiredAttribute:"Attribute '{property}' is required"};var XmlSchemaError=/*#__PURE__*/function(_ReportableError7){function _XmlSchemaError(message){var _this0;_classCallCheck(this,_XmlSchemaError);_this0=_callSuper(this,_XmlSchemaError,[message,ErrorOrigin.PARSING]);Object.setPrototypeOf(_this0,_XmlSchemaError.prototype);return _this0}_inherits(_XmlSchemaError,_ReportableError7);return _createClass(_XmlSchemaError,[{key:Symbol.toStringTag,get:function get(){return"XmlSchemaError"}}])}(ReportableError);// ../vinyl-xml/src/xml/parseXml.ts
335
+ var XMLNS="http://www.w3.org/2000/xmlns/";var LT=_char("<");var GT=_char(">");var EQ=_char("=");var SLASH=_char("/");var COLON=_char(":");var QMARK=_char("?");var EXCL=_char("!");var APOS=_char("'");var QUOT=_char("\"");var QUOTES=/* @__PURE__ */new Set([APOS,QUOT]);function parseXml(str,handler){var c=new StringReader(str);var current={qName:"#document",namespaceMap:/* @__PURE__ */new Map,defaultNamespaceUri:null};var stack=[current];var namespaceLookup=function namespaceLookup(prefix){if(!prefix)return current.defaultNamespaceUri;for(var i=stack.length-1;i>=0;i--){var map=stack[i].namespaceMap;if(map.has(prefix))return stack[i].namespaceMap.get(prefix)}return null};try{handler.startDocument()}catch(e){c.err(e.message)}while(c.hasNext()){var charsStart=c.untilChar(LT);if(charsStart<c.position){var chars=str.substring(charsStart,c.position);try{handler.textNode(chars)}catch(e){c.err(e.message)}}if(!c.hasNext())break;c.next();if(c.charIf(SLASH)){c.white();var name=readQName(c);if(name.qName!==current.qName)c.err("Expected </".concat(current.qName,"> but was </").concat(name.qName,">"));stack.pop();current=last(stack);c.white();c.readChar(GT);try{handler.endElement()}catch(e){c.err(e.message)}}else if(c.charIf(QMARK)){untilTagClose(c)}else if(c.charIf(EXCL)){if(c.charIf(45/* - */)){c.readChar(45);c.untilString("-->");c.read("-->")}else if(c.stringIf("[CDATA[")){var charsStart2=c.untilString("]]>");try{handler.cDataNode(str.substring(charsStart2,c.position))}catch(e){c.err(e.message)}c.read("]]>")}else{untilTagClose(c)}}else{var _name=readQName(c);current={qName:_name.qName,namespaceMap:/* @__PURE__ */new Map,defaultNamespaceUri:current.defaultNamespaceUri};stack.push(current);var attributes=xmlAttributes(c,current);_name.namespaceUri=namespaceLookup(_name.prefix);for(var attributesKey in attributes){var value=attributes[attributesKey];var name2=value.name;if(name2.prefix&&!name2.namespaceUri){name2.namespaceUri=namespaceLookup(name2.prefix)}}try{handler.startElement(_name,attributes)}catch(e){c.err(e.message)}if(c.charIf(SLASH)){c.readChar(GT);stack.pop();current=last(stack);try{handler.endElement()}catch(e){c.err(e.message)}}else{c.readChar(GT)}}}try{return handler.endDocument()}catch(e){return c.err(e.message)}}function readAttributeValue(c){var quote=c.next();if(!QUOTES.has(quote))c.err("Expected ' or \"");var value=c.substringUntil(function(charCode){return charCode===quote});c.readChar(quote);return decodeEntities(value)}function untilTagClose(c){while(true){c.until(function(c2){return c2===APOS||c2===QUOT||c2===GT});var char2=c.next();if(QUOTES.has(char2)){c.untilChar(char2);c.next()}else{break}}}function isNameChar(charCode){if(charCode>=97){if(charCode>=183){if(charCode>=768){if(charCode>=8255){return charCode<=8256}else{return charCode<=879}}else{return charCode===183}}else{return charCode<=122}}else{if(charCode>=95){return charCode===95}else{if(charCode>=65){return charCode<=90}else{if(charCode>=45){if(charCode>=48){return charCode<=57}else{return charCode<=46}}else{return false}}}}}function readQName(reader){var prefixOrLocalName=reader.substringWhile(isNameChar);var prefix,localPart,name;if(reader.charIf(COLON)){prefix=prefixOrLocalName;localPart=reader.substringWhile(isNameChar);name="".concat(prefix,":").concat(localPart)}else{prefix=null;localPart=prefixOrLocalName;name=localPart}return{prefix:prefix,localPart:localPart,qName:name,namespaceUri:null}}function xmlAttributes(reader,stackElement){var attributes={};while(true){reader.white();if(!isNameChar(reader.peek))break;var name=readQName(reader);reader.white();var value="";if(reader.charIf(EQ)){reader.white();value=readAttributeValue(reader)}else{}if(name.prefix==="xmlns"){name.namespaceUri=XMLNS;stackElement.namespaceMap.set(name.localPart,value===""?null:value)}else if(!name.prefix&&name.localPart==="xmlns"){name.namespaceUri=XMLNS;stackElement.defaultNamespaceUri=!value?null:value}if(attributes[name.qName]!=null)reader.err("Attribute '".concat(name.qName,"' is already specified."));attributes[name.qName]={name:name,value:value}}return attributes}// ../vinyl-xml/src/xml/mergeXmlRules.ts
336
+ var locale5={illegalRuleOverrideTypeError:"Cannot override the rule {property} of type {sourceType} with a rule of type {overrideType}",illegalQNameOverrideError:"Cannot override the rule {property} with a different localPart or namespace"};function mergeXmlRules(){var finalRule=arguments.length<=0?undefined:arguments[0];for(var i=1;i<arguments.length;i++){finalRule=plainObjectMergeRule.merge(finalRule,i<0||arguments.length<=i?undefined:arguments[i],mergeXmlRule)}return finalRule}function mergeXmlRule(sourceA,sourceB,prop){var _a2,_b,_c,_d;if(sourceA==null)return sourceB;var sourceAIsLazy=typeof sourceA==="function";var sourceBIsLazy=typeof sourceB==="function";if(sourceAIsLazy||sourceBIsLazy){return function(){var a=sourceAIsLazy?sourceA():sourceA;var b=sourceBIsLazy?sourceB():sourceB;return mergeXmlRule(a,b,prop)}}if(sourceA.type!==sourceB.type){throw new ValidationError(substitute(locale5.illegalRuleOverrideTypeError,{property:prop,sourceType:sourceA.type,overrideType:sourceB.type}))}switch(sourceA.type){case"attribute"/* ATTRIBUTE */:case"element"/* ELEMENT */:case"elements"/* ELEMENTS */:{var b=sourceB;if(sourceA.namespaceUri!==b.namespaceUri||((_a2=sourceA.localPart)!=null?_a2:prop)!==((_b=b.localPart)!=null?_b:prop)){throw new ValidationError(substitute(locale5.illegalQNameOverrideError,{property:prop}))}break}}switch(sourceA.type){case"attribute"/* ATTRIBUTE */:{var _b2=sourceB;return __spreadProps(__spreadValues({},_b2),{"default":(_c=_b2["default"])!=null?_c:sourceA["default"]})}case"characters"/* CHARACTERS */:return sourceB;case"element"/* ELEMENT */:{var _b3=sourceB;return __spreadProps(__spreadValues({},_b3),{required:sourceA.required||_b3.required,rules:mergeXmlRules(sourceA.rules,_b3.rules)})}case"elements"/* ELEMENTS */:{var _b4=sourceB;var maxOccurs=sourceA.maxOccurs!=null&&_b4.maxOccurs!=null?Math.min(sourceA.maxOccurs,_b4.maxOccurs):(_d=sourceA.maxOccurs)!=null?_d:_b4.maxOccurs;return __spreadProps(__spreadValues({},_b4),{minOccurs:Math.max(sourceA.minOccurs,_b4.minOccurs),maxOccurs:maxOccurs,useEmptyArrays:sourceA.useEmptyArrays||_b4.useEmptyArrays,rules:mergeXmlRules(sourceA.rules,_b4.rules)})}}}// ../vinyl-xml/src/xml/mappedXmlRules.ts
337
+ var EmptyRules={__type:invariant(),attributes:/* @__PURE__ */new Map,elements:/* @__PURE__ */new Map,characters:void 0};function mapXmlRules(rules){var parentNamespaceUri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var _a2,_b,_c;var attributeRules=/* @__PURE__ */new Map;var elementRules=/* @__PURE__ */new Map;var charactersRule=void 0;var _loop=function _loop(){var handlerOrFunction=rules[property];var handler;if(typeof handlerOrFunction==="function"){handler=handlerOrFunction()}else{handler=handlerOrFunction}var key;switch(handler.type){case"characters"/* CHARACTERS */:if(charactersRule!==void 0)throw new IllegalArgumentError("characters handler already defined");charactersRule={property:property,parse:handler.parse,stringify:handler.stringify};break;case"element"/* ELEMENT */:case"elements"/* ELEMENTS */:{var localPart=(_a2=handler.localPart)!=null?_a2:property;var namespaceUri=handler.namespaceUri===void 0?parentNamespaceUri:handler.namespaceUri;key=xmlRuleKey(localPart,namespaceUri);if(elementRules.has(key)){throw new IllegalArgumentError("Multiple element rules for ".concat(key))}if(handler.type==="element"/* ELEMENT */){var rules2=handler.rules;elementRules.set(key,{array:false,property:property,minOccurs:handler.required?1:0,maxOccurs:1,rules:memoize(function(){return mapXmlRules(rules2,namespaceUri)}),useEmptyArrays:false,localPart:localPart,namespaceUri:namespaceUri})}else{var _rules=handler.rules;elementRules.set(key,{array:true,property:property,maxOccurs:handler.maxOccurs,minOccurs:handler.minOccurs,rules:memoize(function(){return mapXmlRules(_rules,namespaceUri)}),useEmptyArrays:handler.useEmptyArrays,localPart:localPart,namespaceUri:namespaceUri})}break}case"attribute"/* ATTRIBUTE */:{var _namespaceUri=handler.namespaceUri;var _localPart=(_b=handler.localPart)!=null?_b:property;key=xmlRuleKey(_localPart,_namespaceUri);if(attributeRules.has(key)){throw new IllegalArgumentError("Multiple attribute rules for ".concat(key))}attributeRules.set(key,{property:property,"default":handler["default"],parse:handler.parse,stringify:handler.stringify,required:handler.required,localPart:_localPart,namespaceUri:(_c=handler.namespaceUri)!=null?_c:null});break}}};for(var property in rules){_loop()}return{__type:invariant(),attributes:attributeRules,elements:elementRules,characters:charactersRule}}function xmlRuleKey(localPart){var namespaceUri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return"".concat(namespaceUri!=null?namespaceUri:"",":").concat(localPart)}// ../vinyl-xml/src/xml/ParseXmlHandlerImpl.ts
338
+ function getRule(name,rules){return rules.get(xmlRuleKey(name.localPart,name.namespaceUri))}var ParseXmlHandlerImpl=/*#__PURE__*/function(){function ParseXmlHandlerImpl(rules,options){_classCallCheck(this,ParseXmlHandlerImpl);__publicField(this,"rules",rules);__publicField(this,"stack",[]);__publicField(this,"options");__publicField(this,"busy",false);this.options=__spreadValues({validateRules:true},options)}return _createClass(ParseXmlHandlerImpl,[{key:"startDocument",value:function startDocument(){if(this.busy)throw new IllegalStateError("XML content handler is busy");this.busy=true;var rules=this.rules;this.stack.push({element:new XmlElementImpl,rules:rules,characters:""})}},{key:"startElement",value:function startElement(name,attributes){var _this1=this;var _a2;var parent=last(this.stack);var element2=null;var elementRule=getRule(name,parent.rules.elements);var rules=(_a2=elementRule==null?void 0:elementRule.rules())!=null?_a2:EmptyRules;if(elementRule){var prop=elementRule.property;element2=new XmlElementImpl(parent.element);if(elementRule.array){var arr=parent.element[prop];if(Array.isArray(arr)){arr.push(element2)}else{parent.element[prop]=[element2]}}else{if(parent.element[prop]){throw new XmlSchemaError("Expected single element with name ".concat(name.qName))}else{parent.element[prop]=element2}}var attributeRules=rules.attributes;for(var k in attributes){var attribute=attributes[k];var name2=attribute.name;var attributeRule=getRule(name2,attributeRules);if(attributeRule){element2[attributeRule.property]=attributeRule.parse(attribute.value)}}attributeRules.forEach(function(_value,key){var rule=attributeRules.get(key);if(!(rule.property in element2)){if(rule["default"]!=null){element2[rule.property]=rule["default"]}else if(_this1.options.validateRules&&rule.required){throw new XmlSchemaError(substitute(xmlSchemaErrorLocale.requiredAttribute,{property:rule.property}))}}})}this.stack.push({element:element2,rules:rules,characters:""})}},{key:"textNode",value:function textNode(str){var current=last(this.stack);if(!current.rules.characters)return;current.characters+=decodeEntities(str.trim())}},{key:"cDataNode",value:function cDataNode(str){var current=last(this.stack);if(!current.rules.characters)return;current.characters+=str}},{key:"endElement",value:function endElement(){var lastEl=this.stack.pop();var charactersRule=lastEl.rules.characters;if(charactersRule)lastEl.element[charactersRule.property]=charactersRule.parse(lastEl.characters);lastEl.rules.elements.forEach(function(rule){if(rule.array&&!(rule.property in lastEl.element)){if(rule.useEmptyArrays){lastEl.element[rule.property]=[]}}});this.validate(lastEl)}},{key:"endDocument",value:function endDocument(){this.busy=false;var last2=this.stack.pop();this.validate(last2);return last2.element}},{key:"validate",value:function validate(current){if(!this.options.validateRules)return;current.rules.elements.forEach(function(rule){var _a2,_b;var length=rule.array?(_b=(_a2=current.element[rule.property])==null?void 0:_a2.length)!=null?_b:0:current.element[rule.property]?1:0;if(length<rule.minOccurs){throw new XmlSchemaError(substitute(xmlSchemaErrorLocale.atLeastElements,{property:rule.property,expected:rule.minOccurs,actual:length}))}if(rule.maxOccurs!=null&&length>rule.maxOccurs){throw new XmlSchemaError(substitute(xmlSchemaErrorLocale.atMostElements,{property:rule.property,expected:rule.maxOccurs,actual:length}))}})}}])}();var parentSymbol=/* @__PURE__ */Symbol("parent");var _a;_a=parentSymbol;var _XmlElementImpl=/*#__PURE__*/function(){function _XmlElementImpl(){var parent=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;_classCallCheck(this,_XmlElementImpl);__publicField(this,_a);this[parentSymbol]=parent}return _createClass(_XmlElementImpl,[{key:"parent",get:function get(){return this[parentSymbol]},set:function set(value){this[parentSymbol]=value}},{key:"clone",value:function clone(){var out=new _XmlElementImpl(this.parent);for(var key in this){var child=_clone(this[key]);if(Array.isArray(child)){var _iterator0=_createForOfIteratorHelper(child),_step0;try{for(_iterator0.s();!(_step0=_iterator0.n()).done;){var e=_step0.value;if(_typeof(e)==="object"&&"parent"in e)e.parent=out}}catch(err){_iterator0.e(err)}finally{_iterator0.f()}}else if(_typeof(child)==="object"&&"parent"in child){child.parent=out}out[key]=child}return out}},{key:"toJSON",value:function toJSON(){var out={};for(var key in this){out[key]=toJson(this[key])}return out}}])}();var XmlElementImpl=_XmlElementImpl;// ../vinyl-validation/src/validation/Validator.ts
339
+ var validatorLocale={/**
280
340
  * The expectation template string with the following replacement tokens:
281
341
  *
282
342
  * `{expected}` - The expected description.
283
343
  * `{actual}` - The actual value.
284
344
  * `{path}` - The path, dot separated.
285
- */template:"Expected: {expected}, but was: {actual}. At: {path}"};function createValidationExpectationMessage(expectationMessage,input,path){var inputStringify=arguments.length>3&&arguments[3]!==undefined?arguments[3]:function(input2){return stringifyForPrint(input2,500)};return substitute(validatorLocale.template,{expected:expectationMessage,actual:inputStringify(input),path:path.join(".")})}function createValidator(expectationMessage,_isValid){var inputStringify=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(input){return stringifyForPrint(input,500)};return{description:expectationMessage,isValid:function isValid(input){return _isValid(input)},validate:function validate(input,_){var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];if(!_isValid(input)){return[{message:createValidationExpectationMessage(expectationMessage,input,path,inputStringify),path:path}]}return[]},assert:function assert(input,origin){var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];if(!_isValid(input)){throw new ValidationError(createValidationExpectationMessage(expectationMessage,input,path,inputStringify),origin,path)}}}}function createDeepValidator(description,_validate){return{description:description,isValid:function isValid(input){return _validate(input,{all:false},[]).length===0},validate:function validate(input,options){var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];return _validate(input,options!=null?options:{all:false},path)},assert:function assert(input,origin){var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var errors=_validate(input,{all:false},path);if(errors.length){var error=errors[0];throw new ValidationError(error.message,origin,error.path)}}}}var locale5={/**
345
+ */template:"Expected: {expected}, but was: {actual}. At: {path}"};function createValidationExpectationMessage(expectationMessage,input,path){var inputStringify=arguments.length>3&&arguments[3]!==undefined?arguments[3]:function(input2){return stringifyForPrint(input2,500)};return substitute(validatorLocale.template,{expected:expectationMessage,actual:inputStringify(input),path:path.join(".")})}function createValidator(expectationMessage,_isValid){var inputStringify=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(input){return stringifyForPrint(input,500)};return{description:expectationMessage,isValid:function isValid(input){return _isValid(input)},validate:function validate(input,_){var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];if(!_isValid(input)){return[{message:createValidationExpectationMessage(expectationMessage,input,path,inputStringify),path:path}]}return[]},assert:function assert(input,origin){var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];if(!_isValid(input)){throw new ValidationError(createValidationExpectationMessage(expectationMessage,input,path,inputStringify),origin,path)}}}}function createDeepValidator(description,_validate){return{description:description,isValid:function isValid(input){return _validate(input,{all:false},[]).length===0},validate:function validate(input,options){var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];return _validate(input,options!=null?options:{all:false},path)},assert:function assert(input,origin){var path=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var errors=_validate(input,{all:false},path);if(errors.length){var error=errors[0];throw new ValidationError(error.message,origin,error.path)}}}}// ../vinyl-validation/src/validation/andValidators.ts
346
+ var locale6={/**
286
347
  * {value} The child validators' descriptions, joined with `separator`.
287
348
  *
288
349
  * groupings of and validators is unimportant,
@@ -290,11 +351,13 @@ var __defProp4=Object.defineProperty;var __defProps3=Object.defineProperties;var
290
351
  * representation for either.
291
352
  */template:"{value}",/**
292
353
  * The separator with which to join child validator descriptions.
293
- */separator:" & "};function andValidators(){for(var _len6=arguments.length,validators=new Array(_len6),_key6=0;_key6<_len6;_key6++){validators[_key6]=arguments[_key6]}return createDeepValidator(substitute(locale5.template,{value:validators.map(function(v){return v.description}).join(locale5.separator)}),function(input,options,path){for(var _i2=0,_validators=validators;_i2<_validators.length;_i2++){var validator=_validators[_i2];var errors=validator.validate(input,options,path);if(errors.length)return errors}return[]})}var locale22={/**
354
+ */separator:" & "};function andValidators(){for(var _len5=arguments.length,validators=new Array(_len5),_key5=0;_key5<_len5;_key5++){validators[_key5]=arguments[_key5]}return createDeepValidator(substitute(locale6.template,{value:validators.map(function(v){return v.description}).join(locale6.separator)}),function(input,options,path){for(var _i2=0,_validators=validators;_i2<_validators.length;_i2++){var validator=_validators[_i2];var errors=validator.validate(input,options,path);if(errors.length)return errors}return[]})}// ../vinyl-validation/src/validation/orValidators.ts
355
+ var locale7={/**
294
356
  * {value} - The child validators' descriptions, joined with `separator`.
295
357
  */template:"({value})",/**
296
358
  * The separator with which to join child validator descriptions.
297
- */separator:" | "};function orValidators(){for(var _len7=arguments.length,validators=new Array(_len7),_key7=0;_key7<_len7;_key7++){validators[_key7]=arguments[_key7]}var description=substitute(locale22.template,{value:validators.map(function(v){return v.description}).join(locale22.separator)});return createDeepValidator(description,function(input,options,path){var longestErrors=[];var longestPath=0;for(var _i3=0,_validators2=validators;_i3<_validators2.length;_i3++){var validator=_validators2[_i3];var errors=validator.validate(input,options,path);if(!errors.length)return errors;var pathLength=errors.reduce(function(max,m){return Math.max(m.path.length,max)},0);if(pathLength>=longestPath){longestErrors=errors;longestPath=pathLength}}return longestPath>path.length?longestErrors:[{message:createValidationExpectationMessage(description,input,path),path:path}]})}var requiredValidationOptions={optional:false};var SchemaBase=/*#__PURE__*/function(){function SchemaBase(currentValidator,previousSchema,operation){var _this0=this;_classCallCheck(this,SchemaBase);this.currentValidator=currentValidator;this.previousSchema=previousSchema;this.operation=operation;__publicField3(this,"__type",/* @__PURE__ */invariant());__publicField3(this,"validator");__publicField3(this,"_options",requiredValidationOptions);__publicField3(this,"assert",function(input,origin,path){_this0.validator.assert(input,origin,path)});__publicField3(this,"isValid",function(input){return _this0.validator.isValid(input)});__publicField3(this,"validate",function(input,options,path){return _this0.validator.validate(input,options,path)});this.validator=operation==null?currentValidator:operation(previousSchema,currentValidator)}return _createClass(SchemaBase,[{key:"options",get:function get(){return this._options}},{key:"description",get:function get(){return this.validator.description}/**
359
+ */separator:" | "};function orValidators(){for(var _len6=arguments.length,validators=new Array(_len6),_key6=0;_key6<_len6;_key6++){validators[_key6]=arguments[_key6]}var description=substitute(locale7.template,{value:validators.map(function(v){return v.description}).join(locale7.separator)});return createDeepValidator(description,function(input,options,path){var longestErrors=[];var longestPath=0;for(var _i3=0,_validators2=validators;_i3<_validators2.length;_i3++){var validator=_validators2[_i3];var errors=validator.validate(input,options,path);if(!errors.length)return errors;var pathLength=errors.reduce(function(max,m){return Math.max(m.path.length,max)},0);if(pathLength>=longestPath){longestErrors=errors;longestPath=pathLength}}return longestPath>path.length?longestErrors:[{message:createValidationExpectationMessage(description,input,path),path:path}]})}// ../vinyl-validation/src/validation/SchemaBase.ts
360
+ var requiredValidationOptions={optional:false};var SchemaBase=/*#__PURE__*/function(){function SchemaBase(currentValidator,previousSchema,operation){var _this10=this;_classCallCheck(this,SchemaBase);__publicField(this,"currentValidator",currentValidator);__publicField(this,"previousSchema",previousSchema);__publicField(this,"operation",operation);__publicField(this,"__type",invariant());__publicField(this,"validator");__publicField(this,"_options",requiredValidationOptions);__publicField(this,"assert",function(input,origin,path){_this10.validator.assert(input,origin,path)});__publicField(this,"isValid",function(input){return _this10.validator.isValid(input)});__publicField(this,"validate",function(input,options,path){return _this10.validator.validate(input,options,path)});this.validator=operation==null?currentValidator:operation(previousSchema,currentValidator)}return _createClass(SchemaBase,[{key:"options",get:function get(){return this._options}},{key:"description",get:function get(){return this.validator.description}/**
298
361
  * Clones this schema, transforming all validators with the given mutator.
299
362
  *
300
363
  * @param transform A transformer which takes an existing validator in the chain and returns
@@ -307,17 +370,18 @@ var __defProp4=Object.defineProperty;var __defProps3=Object.defineProperties;var
307
370
  * @param nextValidator The validator to run after the current.
308
371
  * @return Returns a new Schema instance the same class with a new validator chaining the
309
372
  * current validator with the given next in an AND operation.
310
- */},{key:"chain",value:function chain(nextValidator){return this.self(nextValidator,this,andValidators)}},{key:"optional",value:function optional(){var cloned=this.clone();cloned._options=__spreadProps3(__spreadValues4({},cloned.options),{optional:true});return cloned}},{key:"required",value:function required(){var cloned=this.clone();cloned._options=__spreadProps3(__spreadValues4({},cloned.options),{optional:false});return cloned}}])}();var locale32={null:"null",nullish:"nullish",undefined:"undefined"};var valueValidators={any:function any(){return createValidator("",function(){return true})},/**
373
+ */},{key:"chain",value:function chain(nextValidator){return this.self(nextValidator,this,andValidators)}},{key:"optional",value:function optional(){var cloned=this.clone();cloned._options=__spreadProps(__spreadValues({},cloned.options),{optional:true});return cloned}},{key:"required",value:function required(){var cloned=this.clone();cloned._options=__spreadProps(__spreadValues({},cloned.options),{optional:false});return cloned}}])}();// ../vinyl-validation/src/validation/ValueSchema.ts
374
+ var locale8={"null":"null",nullish:"nullish",undefined:"undefined"};var valueValidators={any:function any(){return createValidator("",function(){return true})},/**
311
375
  * Creates a validator that asserts that the input is nullish.
312
- */nullish:function nullish(){return createValidator(locale32.nullish,function(input){return input==null})},/**
376
+ */nullish:function nullish(){return createValidator(locale8.nullish,function(input){return input==null})},/**
313
377
  * Creates a validator that asserts that the input is strictly null.
314
- */null:function _null(){return createValidator(locale32.null,function(input){return input===null})},/**
378
+ */"null":function _null(){return createValidator(locale8["null"],function(input){return input===null})},/**
315
379
  * Creates a validator that asserts that the input is strictly undefined.
316
- */undefined:function undefined(){return createValidator(locale32.undefined,function(input){return input===void 0})}};var ValueSchema=/*#__PURE__*/function(_SchemaBase){function _ValueSchema(){_classCallCheck(this,_ValueSchema);return _callSuper(this,_ValueSchema,arguments)}_inherits(_ValueSchema,_SchemaBase);return _createClass(_ValueSchema,[{key:"maybe",value:/**
380
+ */undefined:function undefined(){return createValidator(locale8.undefined,function(input){return input===void 0})}};var ValueSchema=/*#__PURE__*/function(_SchemaBase){function _ValueSchema(){_classCallCheck(this,_ValueSchema);return _callSuper(this,_ValueSchema,arguments)}_inherits(_ValueSchema,_SchemaBase);return _createClass(_ValueSchema,[{key:"maybe",value:/**
317
381
  * Prepends this validator allowing for null or undefined.
318
382
  */function maybe(){return this.or(valueValidators.nullish())}/**
319
383
  * Prepends this validator allowing for null.
320
- */},{key:"orNull",value:function orNull(){return this.or(valueValidators.null())}/**
384
+ */},{key:"orNull",value:function orNull(){return this.or(valueValidators["null"]())}/**
321
385
  * Prepends this validator allowing for undefined.
322
386
  */},{key:"orUndefined",value:function orUndefined(){return this.or(valueValidators.undefined())}/**
323
387
  * Returns a validator that asserts if this validator and the next passes.
@@ -335,105 +399,39 @@ var __defProp4=Object.defineProperty;var __defProps3=Object.defineProperties;var
335
399
  *
336
400
  * @param nextValidator The validator to run after the current.
337
401
  * @return Returns a new ValueSchema providing the union of this validator and the next.
338
- */},{key:"or",value:function or(nextValidator){return new _ValueSchema(nextValidator,this,orValidators)}}])}(SchemaBase);var locale42={array:"array",minLength:"at least {value} elements",maxLength:"at most {value} elements",exactlyLength:"exactly {value} elements",actualLength:"length {value}",withElements:"({value})[]",tuple:"[{value}]"};var arrayValidators={/**
339
- * Creates a validator that asserts that the input is an array.
340
- *
341
- * Note: arrays can only be readonly by type system, there is no native readonly
342
- * js array. This validator assumes mutability, use the ArraySchema readonly() method
343
- * to cast to a readonly array.
344
- */isArray:function isArray(){return createValidator(locale42.array,function(input){return Array.isArray(input)})},/**
345
- * Creates a validator that asserts that every element passes the given validator.
346
- *
347
- * @param elementValidator
348
- */withElements:function withElements(elementValidator){return createDeepValidator(substitute(locale42.withElements,{value:elementValidator.description}),function(input,options,path){var errors=[];for(var i=0;i<input.length;i++){var element2=input[i];errors.push.apply(errors,_toConsumableArray(elementValidator.validate(element2,options,path.concat(i.toString()))));if(!options.all&&errors.length)return errors}return errors})},/**
349
- * Creates a validator that asserts that the input array is a tuple whose elements match
350
- * the given validators.
351
- *
352
- * @param validators
353
- */tuple:function tuple(){for(var _len8=arguments.length,validators=new Array(_len8),_key8=0;_key8<_len8;_key8++){validators[_key8]=arguments[_key8]}var lengthValidator=createValidator(substitute(locale42.exactlyLength,{value:validators.length}),function(length){return length===validators.length});return createDeepValidator(substitute(locale42.tuple,{value:validators.join(", ")}),function(input,options,path){var errors=[];errors.push.apply(errors,_toConsumableArray(lengthValidator.validate(input.length,options,path)));if(!options.all&&errors.length)return errors;var n=Math.min(validators.length,input.length);for(var i=0;i<n;i++){var element2=input[i];var validator=validators[i];errors.push.apply(errors,_toConsumableArray(validator.validate(element2,options,path.concat(i.toString()))));if(!options.all&&errors.length)return errors}return errors})},/**
354
- * Creates a validator that validates the input array has the given minimum length.
355
- * @param min The minimum number of elements (inclusive)
356
- */minLength:function minLength(min){return createValidator(substitute(locale42.minLength,{value:min}),function(input){return input.length>=min},function(input){return substitute(locale42.actualLength,{value:input.length})})},/**
357
- *
358
- * Creates a validator that validates the input array has the given maximum length.
359
- * @param max The maximum number of elements (inclusive)
360
- */maxLength:function maxLength(max){return createValidator(substitute(locale42.maxLength,{value:max}),function(input){return input.length<=max},function(input){return substitute(locale42.actualLength,{value:input.length})})}};var _ArraySchema=/*#__PURE__*/function(_ValueSchema2){function _ArraySchema2(){_classCallCheck(this,_ArraySchema2);return _callSuper(this,_ArraySchema2,arguments)}_inherits(_ArraySchema2,_ValueSchema2);return _createClass(_ArraySchema2,[{key:"withElements",value:/**
361
- * Creates a validator that asserts that every element passes the given validator.
362
- *
363
- * @param elementValidator
364
- */function withElements(elementValidator){return this.chain(arrayValidators.withElements(elementValidator))}/**
365
- * Creates a validator that asserts that the input array is a tuple whose elements match
366
- * the given validators.
367
- *
368
- * @param validators
369
- */},{key:"tuple",value:function tuple(){return this.chain(arrayValidators.tuple.apply(arrayValidators,arguments))}/**
370
- * Creates a validator that validates the input array has the given minimum length.
371
- * @param min The minimum number of elements (inclusive)
372
- */},{key:"minLength",value:function minLength(min){return this.chain(arrayValidators.minLength(min))}/**
373
- *
374
- * Creates a validator that validates the input array has the given maximum length.
375
- * @param max The maximum number of elements (inclusive)
376
- */},{key:"maxLength",value:function maxLength(max){return this.chain(arrayValidators.maxLength(max))}/**
377
- * Casts to a readonly array.
378
- * This is a shallow cast, elements of the array will not be changed.
379
- */},{key:"readonly",value:function readonly(){return this}/**
380
- * Casts the type parameter.
381
- */},{key:"cast",value:function cast(){return this}}],[{key:"base",get:/**
382
- * The base ArraySchema instance validating that the input is an Array.
383
- */function get(){if(this._base==null)this._base=new _ArraySchema2(arrayValidators.isArray());return this._base}}])}(ValueSchema);__publicField3(_ArraySchema,"_base",null);var locale52={template:"type {value}"};function typeOfValidator(expected){return createValidator(substitute(locale52.template,{value:expected}),function(input){return input!=null&&_typeof(input)===expected})}var typeOfValidatorCache={};function cachedTypeOfValidator(type){if(!(type in typeOfValidatorCache)){typeOfValidatorCache[type]=typeOfValidator(type)}return typeOfValidatorCache[type]}var typeOfValidators={get boolean(){return cachedTypeOfValidator("boolean")},get func(){return cachedTypeOfValidator("function")},get number(){return cachedTypeOfValidator("number")},get object(){return cachedTypeOfValidator("object")},get string(){return cachedTypeOfValidator("string")},get symbol(){return cachedTypeOfValidator("symbol")}};var locale6={length:"at most {value} arguments",actualLength:"{value} arguments"};var functionValidators={length:function length(max){return createValidator(substitute(locale6.length,{value:max}),function(input){return input.length<=max},function(input){return substitute(locale6.actualLength,{value:input.length})})}};var _FunctionSchema=/*#__PURE__*/function(_ValueSchema3){function _FunctionSchema2(){_classCallCheck(this,_FunctionSchema2);return _callSuper(this,_FunctionSchema2,arguments)}_inherits(_FunctionSchema2,_ValueSchema3);return _createClass(_FunctionSchema2,[{key:"length",value:function length(max){return this.chain(functionValidators.length(max))}/**
384
- * Casts the function signature.
385
- * Function signatures, except for their required number of parameters, cannot be
386
- * meaningfully validated.
387
- */},{key:"cast",value:function cast(){return this}}],[{key:"base",get:/**
388
- * The base Function validator validating that the input is a function.
389
- */function get(){if(this._base==null)this._base=new _FunctionSchema2(typeOfValidators.func);return this._base}}])}(ValueSchema);__publicField3(_FunctionSchema,"_base",null);var locale7={set:"Set",withElements:"Set<{value}>"};var setValidators={/**
390
- * Creates a validator that asserts that the input is a set.
391
- */isSet:function isSet(){return createValidator(locale7.set,function(input){return input instanceof Set})},/**
392
- * Creates a validator that asserts that every element passes the given validator.
393
- *
394
- * @param elementValidator
395
- */withElements:function withElements(elementValidator){return createDeepValidator(substitute(locale7.withElements,{value:elementValidator.description}),function(input,options,path){var errors=[];var i=0;var _iterator10=_createForOfIteratorHelper(input),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var element2=_step10.value;errors.push.apply(errors,_toConsumableArray(elementValidator.validate(element2,options,path.concat(i.toString()))));if(!options.all&&errors.length)return errors;i++}}catch(err){_iterator10.e(err)}finally{_iterator10.f()}return errors})}};var _SetSchema=/*#__PURE__*/function(_ValueSchema4){function _SetSchema2(){_classCallCheck(this,_SetSchema2);return _callSuper(this,_SetSchema2,arguments)}_inherits(_SetSchema2,_ValueSchema4);return _createClass(_SetSchema2,[{key:"withElements",value:/**
396
- * Creates a validator that asserts that every element passes the given validator.
397
- *
398
- * @param elementValidator
399
- */function withElements(elementValidator){return this.chain(setValidators.withElements(elementValidator))}/**
400
- * Casts to a readonly set.
401
- * This is a shallow cast, elements of the array will not be changed.
402
- */},{key:"readonly",value:function readonly(){return this}/**
403
- * Casts the parameter type.
404
- */},{key:"cast",value:function cast(){return this}}],[{key:"base",get:/**
405
- * The base SetSchema instance validating that the input is a Set.
406
- */function get(){if(this._base==null)this._base=new _SetSchema2(setValidators.isSet());return this._base}}])}(ValueSchema);__publicField3(_SetSchema,"_base",null);var locale8={gte:"at least {value}",gt:"greater than {value}",lte:"at most {value}",lt:"less than {value}",within:"within {min} and {max}",safeInteger:"safe integer",finite:"finite"};var numberValidators={/**
402
+ */},{key:"or",value:function or(nextValidator){return new _ValueSchema(nextValidator,this,orValidators)}}])}(SchemaBase);// ../vinyl-validation/src/validation/typeOfValidators.ts
403
+ var locale9={template:"type {value}"};function typeOfValidator(expected){return createValidator(substitute(locale9.template,{value:expected}),function(input){return input!=null&&_typeof(input)===expected})}var typeOfValidatorCache={};function cachedTypeOfValidator(type){if(!(type in typeOfValidatorCache)){typeOfValidatorCache[type]=typeOfValidator(type)}return typeOfValidatorCache[type]}var typeOfValidators={get boolean(){return cachedTypeOfValidator("boolean")},get func(){return cachedTypeOfValidator("function")},get number(){return cachedTypeOfValidator("number")},get object(){return cachedTypeOfValidator("object")},get string(){return cachedTypeOfValidator("string")},get symbol(){return cachedTypeOfValidator("symbol")}};// ../vinyl-validation/src/validation/NumberSchema.ts
404
+ var locale10={gte:"at least {value}",gt:"greater than {value}",lte:"at most {value}",lt:"less than {value}",within:"within {min} and {max}",safeInteger:"safe integer",finite:"finite"};var numberValidators={/**
407
405
  * Creates a validator that asserts that the input number is at least the provided minimum
408
406
  * value.
409
407
  *
410
408
  * @param min The minimum (inclusive) the value may be.
411
- */gte:function gte(min){return createValidator(substitute(locale8.gte,{value:min}),function(input){return input>=min})},/**
409
+ */gte:function gte(min){return createValidator(substitute(locale10.gte,{value:min}),function(input){return input>=min})},/**
412
410
  * Creates a validator that asserts that the input number is greater than the provided minimum
413
411
  * value.
414
412
  *
415
413
  * @param min The minimum (exclusive) the value may be.
416
- */gt:function gt(min){return createValidator(substitute(locale8.gt,{value:min}),function(input){return input>min})},/**
414
+ */gt:function gt(min){return createValidator(substitute(locale10.gt,{value:min}),function(input){return input>min})},/**
417
415
  * Creates a validator that asserts that the input number is at most the provided maximum
418
416
  * value.
419
417
  *
420
418
  * @param max The maximum (inclusive) the value may be.
421
- */lte:function lte(max){return createValidator(substitute(locale8.lte,{value:max}),function(input){return input<=max})},/**
419
+ */lte:function lte(max){return createValidator(substitute(locale10.lte,{value:max}),function(input){return input<=max})},/**
422
420
  * Creates a validator that asserts that the input number is less than the provided maximum
423
421
  * value.
424
422
  *
425
423
  * @param max The maximum (exclusive) the value may be.
426
- */lt:function lt(max){return createValidator(substitute(locale8.lt,{value:max}),function(input){return input<max})},/**
424
+ */lt:function lt(max){return createValidator(substitute(locale10.lt,{value:max}),function(input){return input<max})},/**
427
425
  * Creates a validator that asserts that the input number is at least the provided minimum
428
426
  * and at most the provided maximum values.
429
427
  *
430
428
  * @param min The minimum (inclusive) value the input may be.
431
429
  * @param max The maximum (inclusive) value the input may be.
432
- */within:function within(min,max){return createValidator(substitute(locale8.within,{min:min,max:max}),function(input){return input>=min&&input<=max})},/**
430
+ */within:function within(min,max){return createValidator(substitute(locale10.within,{min:min,max:max}),function(input){return input>=min&&input<=max})},/**
433
431
  * Creates a validator that asserts that the input number is finite.
434
- */finite:function finite(){return createValidator(locale8.finite,function(input){return Number.isFinite(input)})},/**
432
+ */finite:function finite(){return createValidator(locale10.finite,function(input){return Number.isFinite(input)})},/**
435
433
  * Creates a validator that asserts that the input number is a safe integer.
436
- */safeInteger:function safeInteger(){return createValidator(locale8.safeInteger,function(input){return Number.isSafeInteger(input)})}};var _NumberSchema=/*#__PURE__*/function(_ValueSchema5){function _NumberSchema2(){_classCallCheck(this,_NumberSchema2);return _callSuper(this,_NumberSchema2,arguments)}_inherits(_NumberSchema2,_ValueSchema5);return _createClass(_NumberSchema2,[{key:"gte",value:/**
434
+ */safeInteger:function safeInteger(){return createValidator(locale10.safeInteger,function(input){return Number.isSafeInteger(input)})}};var _NumberSchema=/*#__PURE__*/function(_ValueSchema2){function _NumberSchema(){_classCallCheck(this,_NumberSchema);return _callSuper(this,_NumberSchema,arguments)}_inherits(_NumberSchema,_ValueSchema2);return _createClass(_NumberSchema,[{key:"gte",value:/**
437
435
  * Creates a validator that asserts that the input number is at least the provided minimum
438
436
  * value.
439
437
  *
@@ -465,99 +463,11 @@ var __defProp4=Object.defineProperty;var __defProps3=Object.defineProperties;var
465
463
  * Creates a validator that asserts that the input number is a safe integer.
466
464
  */},{key:"safeInteger",value:function safeInteger(){return this.chain(numberValidators.safeInteger())}}],[{key:"base",get:/**
467
465
  * The base Object validator validating that the input is an object.
468
- */function get(){if(this._base==null)this._base=new _NumberSchema2(typeOfValidators.number);return this._base}}])}(ValueSchema);__publicField3(_NumberSchema,"_base",null);var NumberSchema=_NumberSchema;function isValidatorWithPartial(validator){return"partial"in validator&&"partialDeep"in validator}function maybeToDeepPartial(validator){return isValidatorWithPartial(validator)?validator.partialDeep():validator}function maybeToPartial(validator){return isValidatorWithPartial(validator)?validator.partial():validator}var locale9={extend:"{\n{body}\n}",prop:"{key}: {value}",propSeparator:",\n",indent:" ",required:"property '{key}' is required"};var objectValidators={/**
469
- * Creates a validator that validates the input has properties that pass their respective
470
- * validators.
471
- *
472
- * @param propertyValidators
473
- */properties:function properties(propertyValidators){var propertiesDescriptions=[];var keys=ownKeys(propertyValidators);var _iterator11=_createForOfIteratorHelper(keys),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var key=_step11.value;var validator2=propertyValidators[key];propertiesDescriptions.push(substitute(locale9.prop,{key:String(key)+(validator2.options.optional?"?":""),value:validator2.description}))}}catch(err){_iterator11.e(err)}finally{_iterator11.f()}var description=substitute(locale9.extend,{body:propertiesDescriptions.join(locale9.propSeparator).split("\n").map(function(line){return locale9.indent+line}).join("\n")});var validator=createDeepValidator(description,function(input,options,path){var errors=[];var _iterator12=_createForOfIteratorHelper(keys),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var key=_step12.value;var validator2=propertyValidators[key];if(key in input){var value=input[key];errors.push.apply(errors,_toConsumableArray(validator2.validate(value,options,path.concat(String(key)))))}else{if(!validator2.options.optional){errors.push({message:substitute(locale9.required,{key:key}),path:path.concat(String(key))})}}if(!options.all&&errors.length)return errors}}catch(err){_iterator12.e(err)}finally{_iterator12.f()}return errors});return merge(validator,{partial:function partial(){var optionalPropertyValidators={};var _iterator13=_createForOfIteratorHelper(keys),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var key=_step13.value;optionalPropertyValidators[key]=propertyValidators[key].optional()}}catch(err){_iterator13.e(err)}finally{_iterator13.f()}return objectValidators.properties(optionalPropertyValidators)},partialDeep:function partialDeep(){var optionalPropertyValidators={};var _iterator14=_createForOfIteratorHelper(keys),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var key=_step14.value;optionalPropertyValidators[key]=maybeToDeepPartial(propertyValidators[key].optional())}}catch(err){_iterator14.e(err)}finally{_iterator14.f()}return objectValidators.properties(optionalPropertyValidators)}})}};var _ObjectSchema=/*#__PURE__*/function(_ValueSchema6){function _ObjectSchema2(){_classCallCheck(this,_ObjectSchema2);return _callSuper(this,_ObjectSchema2,arguments)}_inherits(_ObjectSchema2,_ValueSchema6);return _createClass(_ObjectSchema2,[{key:"extend",value:/**
474
- * Creates a validator that validates the input has properties that pass their respective
475
- * validators.
476
- *
477
- * @param propertyValidators
478
- */function extend(propertyValidators){return this.chain(objectValidators.properties(propertyValidators))}/**
479
- * Allows all properties to be undefined.
480
- */},{key:"partial",value:function partial(){return this.clone(maybeToPartial)}/**
481
- * Allows all recursive properties to be undefined.
482
- */},{key:"partialDeep",value:function partialDeep(){return this.clone(maybeToDeepPartial)}/**
483
- * Casts the type parameter.
484
- */},{key:"cast",value:function cast(){return this}}],[{key:"base",get:/**
485
- * The base Object validator validating that the input is an object.
486
- */function get(){if(this._base==null)this._base=new _ObjectSchema2(typeOfValidators.object);return this._base}}])}(ValueSchema);__publicField3(_ObjectSchema,"_base",null);var locale10={notEmpty:"not empty",minLength:"at least {value} characters",maxLength:"at most {value} characters",noWhitespace:"no whitespace characters",matches:"matches {value}"};var stringValidators={/**
487
- * Creates a validator that asserts that the input is not empty.
488
- */notEmpty:function notEmpty(){return createValidator(locale10.notEmpty,function(input){return input!==""})},/**
489
- * Creates a validator that asserts that the input string has at least the given minimum
490
- * length.
491
- *
492
- * @param min The string must be at least this length.
493
- */minLength:function minLength(min){return createValidator(substitute(locale10.minLength,{value:min}),function(input){return input.length>=min})},/**
494
- * Creates a validator that asserts that the input string has at most the given maximum
495
- * length.
496
- *
497
- * @param max The string must be at most this length.
498
- */maxLength:function maxLength(max){return createValidator(substitute(locale10.maxLength,{value:max}),function(input){return input.length<=max})},/**
499
- * Creates a validator that asserts that the input string has no whitespace characters.
500
- * Whitespace characters include space, new line, carriage return, and tab.
501
- */noWhitespace:function noWhitespace(){return createValidator(locale10.noWhitespace,function(input){return input.search(/\s/g)===-1})},/**
502
- * Creates a validator that asserts that the input string matches the given regex.
503
- * @param regex
504
- */matches:function matches(regex){return createValidator(substitute(locale10.matches,{value:regex.toString()}),function(input){return regex.test(input)})}};var _StringSchema=/*#__PURE__*/function(_ValueSchema7){function _StringSchema2(){_classCallCheck(this,_StringSchema2);return _callSuper(this,_StringSchema2,arguments)}_inherits(_StringSchema2,_ValueSchema7);return _createClass(_StringSchema2,[{key:"notEmpty",value:/**
505
- * Creates a validator that asserts that the input is not empty.
506
- */function notEmpty(){return this.chain(stringValidators.notEmpty())}/**
507
- * Creates a validator that asserts that the input string has at least the given minimum
508
- * length.
509
- *
510
- * @param min The string must be at least this length.
511
- */},{key:"minLength",value:function minLength(min){return this.chain(stringValidators.minLength(min))}/**
512
- * Creates a validator that asserts that the input string has at most the given maximum
513
- * length.
514
- *
515
- * @param max The string must be at most this length.
516
- */},{key:"maxLength",value:function maxLength(max){return this.chain(stringValidators.maxLength(max))}/**
517
- * Creates a validator that asserts that the input string has no whitespace characters.
518
- * Whitespace characters include space, new line, carriage return, and tab.
519
- */},{key:"noWhitespace",value:function noWhitespace(){return this.chain(stringValidators.noWhitespace())}/**
520
- * Creates a validator that asserts that the input string matches the given regex.
521
- * @param regex
522
- */},{key:"matches",value:function matches(regex){return this.chain(stringValidators.matches(regex))}}],[{key:"base",get:/**
523
- * The base SetSchema instance validating that the input is a Set.
524
- */function get(){if(this._base==null)this._base=new _StringSchema2(typeOfValidators.string);return this._base}}])}(ValueSchema);__publicField3(_StringSchema,"_base",null);var StringSchema=_StringSchema;var locale11={record:"{ [key: {key}]: {value} }"};var recordValidators={/**
525
- * Returns a validator that asserts that the object's own enumerable properties has keys and
526
- * values that match their respective validators.
527
- *
528
- * Prototype members are not included.
529
- * Numeric keys are validated as strings. For example the object `{ [0]: 1 }` will be passed
530
- * to the key validator as '0'.
531
- *
532
- * @param keyValidator Validates each key.
533
- * @param valueValidator Validates each value.
534
- */record:function record(keyValidator,valueValidator){return createDeepValidator(substitute(locale11.record,{key:keyValidator.description,value:valueValidator.description}),function(input,options,path){var errors=[];var _iterator15=_createForOfIteratorHelper(ownKeys(input)),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var key=_step15.value;var keyStr=String(key);errors.push.apply(errors,_toConsumableArray(keyValidator.validate(key,options,path.concat("[".concat(keyStr,"]")))));if(!options.all&&errors.length)return errors;var value=input[key];errors.push.apply(errors,_toConsumableArray(valueValidator.validate(value,options,path.concat(keyStr))));if(!options.all&&errors.length)return errors}}catch(err){_iterator15.e(err)}finally{_iterator15.f()}return errors})}};var _RecordSchema=/*#__PURE__*/function(_ValueSchema8){function _RecordSchema2(){_classCallCheck(this,_RecordSchema2);return _callSuper(this,_RecordSchema2,arguments)}_inherits(_RecordSchema2,_ValueSchema8);return _createClass(_RecordSchema2,[{key:"record",value:/**
535
- * Returns a validator that asserts that the object's own enumerable properties has keys and
536
- * values that match their respective validators.
537
- *
538
- * Prototype members are not included.
539
- * Numeric keys are validated as strings. For example the object `{ [0]: 1 }` will be passed
540
- * to the key validator as '0'.
541
- *
542
- * @param keyValidator Validates each key.
543
- * @param valueValidator Validates each value.
544
- */function record(keyValidator,valueValidator){return this.chain(recordValidators.record(keyValidator,valueValidator))}/**
545
- * Returns a validator that asserts that the object's own enumerable properties has
546
- * string keys and values that match the given validator.
547
- *
548
- * Prototype members are not included.
549
- *
550
- * @param valueValidator Validates each value.
551
- */},{key:"recordValues",value:function recordValues(valueValidator){return this.record(_RecordSchema2.defaultKeyValidator,valueValidator)}/**
552
- * Casts to a ReadonlyRecord
553
- */},{key:"readonly",value:function readonly(){return this}/**
554
- * Casts the type parameter.
555
- */},{key:"cast",value:function cast(){return this}}],[{key:"base",get:/**
556
- * The base Object validator validating that the input is an object.
557
- */function get(){if(this._base==null)this._base=new _RecordSchema2(typeOfValidators.object);return this._base}},{key:"defaultKeyValidator",get:function get(){return StringSchema.base}}])}(ValueSchema);__publicField3(_RecordSchema,"_base",null);var locale12={isOneOf:"one of: {value}",instanceOf:"instance of {value}",oneOfSeparator:" | "};function isOneOf(){for(var _len9=arguments.length,possibleValues=new Array(_len9),_key9=0;_key9<_len9;_key9++){possibleValues[_key9]=arguments[_key9]}return new ValueSchema(createValidator(substitute(locale12.isOneOf,{value:possibleValues.join(locale12.oneOfSeparator)}),function(input){return possibleValues.includes(input)}))}function number(){return NumberSchema.base}// ../vinyl-xml/dist/index.js
558
- var __defProp5=Object.defineProperty;var __defProps4=Object.defineProperties;var __getOwnPropDescs4=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols5=Object.getOwnPropertySymbols;var __hasOwnProp5=Object.prototype.hasOwnProperty;var __propIsEnum5=Object.prototype.propertyIsEnumerable;var __defNormalProp5=function __defNormalProp5(obj,key,value){return key in obj?__defProp5(obj,key,{enumerable:true,configurable:true,writable:true,value:value}):obj[key]=value};var __spreadValues5=function __spreadValues5(a,b){for(var prop in b||(b={}))if(__hasOwnProp5.call(b,prop))__defNormalProp5(a,prop,b[prop]);if(__getOwnPropSymbols5){var _iterator16=_createForOfIteratorHelper(__getOwnPropSymbols5(b)),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var prop=_step16.value;if(__propIsEnum5.call(b,prop))__defNormalProp5(a,prop,b[prop])}}catch(err){_iterator16.e(err)}finally{_iterator16.f()}}return a};var __spreadProps4=function __spreadProps4(a,b){return __defProps4(a,__getOwnPropDescs4(b))};var __publicField4=function __publicField4(obj,key,value){return __defNormalProp5(obj,_typeof(key)!=="symbol"?key+"":key,value)};function element(rules,options){return __spreadProps4(__spreadValues5({type:"element",localPart:void 0,namespaceUri:void 0,required:false},options),{rules:rules})}function elements(rules,options){return __spreadProps4(__spreadValues5({type:"elements",localPart:void 0,namespaceUri:void 0,minOccurs:0,maxOccurs:null,useEmptyArrays:false},options),{rules:rules})}function characters(parse,stringify2){return{type:"characters",parse:parse,stringify:stringify2}}var charactersString=/* @__PURE__ */characters(function(i){return i},stringify);function attr(parse,stringify2,options){return __spreadProps4(__spreadValues5({type:"attribute",localPart:void 0,namespaceUri:null,required:false,default:void 0},options),{parse:parse,stringify:stringify2})}function attrString(options){return attr(function(i){return i},stringify,options)}function attrInt(options){return attr(parseInt,stringify,options)}function attrFloat(options){return attr(parseFloat,stringify,options)}function attrBoolean(options){return attr(parseBoolean,stringify,options)}function attrDateTime(options){return attr(parseDate,stringifyDate,options)}var xmlSchemaErrorLocale={atLeastElements:"Expected at least {expected} occurrences of {property} but was {actual}",atMostElements:"Expected at most {expected} occurrences of {property} but was {actual}",cyclicReferences:"Cyclic reference detected",requiredAttribute:"Attribute '{property}' is required"};var XmlSchemaError=/*#__PURE__*/function(_ReportableError7){function _XmlSchemaError(message){var _this1;_classCallCheck(this,_XmlSchemaError);_this1=_callSuper(this,_XmlSchemaError,[message,ErrorOrigin.PARSING]);Object.setPrototypeOf(_this1,_XmlSchemaError.prototype);return _this1}_inherits(_XmlSchemaError,_ReportableError7);return _createClass(_XmlSchemaError,[{key:Symbol.toStringTag,get:function get(){return"XmlSchemaError"}}])}(ReportableError);var XMLNS="http://www.w3.org/2000/xmlns/";var LT=/* @__PURE__ */char("<");var GT=/* @__PURE__ */char(">");var EQ=/* @__PURE__ */char("=");var SLASH=/* @__PURE__ */char("/");var COLON=/* @__PURE__ */char(":");var QMARK=/* @__PURE__ */char("?");var EXCL=/* @__PURE__ */char("!");var APOS=/* @__PURE__ */char("'");var QUOT=/* @__PURE__ */char("\"");var QUOTES=/* @__PURE__ */new Set([APOS,QUOT]);function parseXml(str,handler){var c=new StringReader(str);var current={qName:"#document",namespaceMap:/* @__PURE__ */new Map,defaultNamespaceUri:null};var stack=[current];var namespaceLookup=function namespaceLookup(prefix){if(!prefix)return current.defaultNamespaceUri;for(var i=stack.length-1;i>=0;i--){var map=stack[i].namespaceMap;if(map.has(prefix))return stack[i].namespaceMap.get(prefix)}return null};try{handler.startDocument()}catch(e){c.err(e.message)}while(c.hasNext()){var charsStart=c.untilChar(LT);if(charsStart<c.position){var chars=str.substring(charsStart,c.position);try{handler.textNode(chars)}catch(e){c.err(e.message)}}if(!c.hasNext())break;c.next();if(c.charIf(SLASH)){c.white();var name=readQName(c);if(name.qName!==current.qName)c.err("Expected </".concat(current.qName,"> but was </").concat(name.qName,">"));stack.pop();current=last(stack);c.white();c.readChar(GT);try{handler.endElement()}catch(e){c.err(e.message)}}else if(c.charIf(QMARK)){untilTagClose(c)}else if(c.charIf(EXCL)){if(c.charIf(45/* - */)){c.readChar(45);c.untilString("-->");c.read("-->")}else if(c.stringIf("[CDATA[")){var charsStart2=c.untilString("]]>");try{handler.cDataNode(str.substring(charsStart2,c.position))}catch(e){c.err(e.message)}c.read("]]>")}else{untilTagClose(c)}}else{var _name=readQName(c);current={qName:_name.qName,namespaceMap:/* @__PURE__ */new Map,defaultNamespaceUri:current.defaultNamespaceUri};stack.push(current);var attributes=xmlAttributes(c,current);_name.namespaceUri=namespaceLookup(_name.prefix);for(var attributesKey in attributes){var value=attributes[attributesKey];var name2=value.name;if(name2.prefix&&!name2.namespaceUri){name2.namespaceUri=namespaceLookup(name2.prefix)}}try{handler.startElement(_name,attributes)}catch(e){c.err(e.message)}if(c.charIf(SLASH)){c.readChar(GT);stack.pop();current=last(stack);try{handler.endElement()}catch(e){c.err(e.message)}}else{c.readChar(GT)}}}try{return handler.endDocument()}catch(e){return c.err(e.message)}}function readAttributeValue(c){var quote=c.next();if(!QUOTES.has(quote))c.err("Expected ' or \"");var value=c.substringUntil(function(charCode){return charCode===quote});c.readChar(quote);return decodeEntities(value)}function untilTagClose(c){while(true){c.until(function(c2){return c2===APOS||c2===QUOT||c2===GT});var char2=c.next();if(QUOTES.has(char2)){c.untilChar(char2);c.next()}else{break}}}function isNameChar(charCode){if(charCode>=97){if(charCode>=183){if(charCode>=768){if(charCode>=8255){return charCode<=8256}else{return charCode<=879}}else{return charCode===183}}else{return charCode<=122}}else{if(charCode>=95){return charCode===95}else{if(charCode>=65){return charCode<=90}else{if(charCode>=45){if(charCode>=48){return charCode<=57}else{return charCode<=46}}else{return false}}}}}function readQName(reader){var prefixOrLocalName=reader.substringWhile(isNameChar);var prefix,localPart,name;if(reader.charIf(COLON)){prefix=prefixOrLocalName;localPart=reader.substringWhile(isNameChar);name="".concat(prefix,":").concat(localPart)}else{prefix=null;localPart=prefixOrLocalName;name=localPart}return{prefix:prefix,localPart:localPart,qName:name,namespaceUri:null}}function xmlAttributes(reader,stackElement){var attributes={};while(true){reader.white();if(!isNameChar(reader.peek))break;var name=readQName(reader);reader.white();var value="";if(reader.charIf(EQ)){reader.white();value=readAttributeValue(reader)}else{}if(name.prefix==="xmlns"){name.namespaceUri=XMLNS;stackElement.namespaceMap.set(name.localPart,value===""?null:value)}else if(!name.prefix&&name.localPart==="xmlns"){name.namespaceUri=XMLNS;stackElement.defaultNamespaceUri=!value?null:value}if(attributes[name.qName]!=null)reader.err("Attribute '".concat(name.qName,"' is already specified."));attributes[name.qName]={name:name,value:value}}return attributes}var locale23={illegalRuleOverrideTypeError:"Cannot override the rule {property} of type {sourceType} with a rule of type {overrideType}",illegalQNameOverrideError:"Cannot override the rule {property} with a different localPart or namespace"};function mergeXmlRules(){var finalRule=arguments.length<=0?undefined:arguments[0];for(var i=1;i<arguments.length;i++){finalRule=plainObjectMergeRule.merge(finalRule,i<0||arguments.length<=i?undefined:arguments[i],mergeXmlRule)}return finalRule}function mergeXmlRule(sourceA,sourceB,prop){var _a2,_b,_c,_d;if(sourceA==null)return sourceB;var sourceAIsLazy=typeof sourceA==="function";var sourceBIsLazy=typeof sourceB==="function";if(sourceAIsLazy||sourceBIsLazy){return function(){var a=sourceAIsLazy?sourceA():sourceA;var b=sourceBIsLazy?sourceB():sourceB;return mergeXmlRule(a,b,prop)}}if(sourceA.type!==sourceB.type){throw new ValidationError(substitute(locale23.illegalRuleOverrideTypeError,{property:prop,sourceType:sourceA.type,overrideType:sourceB.type}))}switch(sourceA.type){case"attribute":case"element":case"elements":{var b=sourceB;if(sourceA.namespaceUri!==b.namespaceUri||((_a2=sourceA.localPart)!=null?_a2:prop)!==((_b=b.localPart)!=null?_b:prop)){throw new ValidationError(substitute(locale23.illegalQNameOverrideError,{property:prop}))}break}}switch(sourceA.type){case"attribute":{var _b2=sourceB;return __spreadProps4(__spreadValues5({},_b2),{default:(_c=_b2.default)!=null?_c:sourceA.default})}case"characters":return sourceB;case"element":{var _b3=sourceB;return __spreadProps4(__spreadValues5({},_b3),{required:sourceA.required||_b3.required,rules:mergeXmlRules(sourceA.rules,_b3.rules)})}case"elements":{var _b4=sourceB;var maxOccurs=sourceA.maxOccurs!=null&&_b4.maxOccurs!=null?Math.min(sourceA.maxOccurs,_b4.maxOccurs):(_d=sourceA.maxOccurs)!=null?_d:_b4.maxOccurs;return __spreadProps4(__spreadValues5({},_b4),{minOccurs:Math.max(sourceA.minOccurs,_b4.minOccurs),maxOccurs:maxOccurs,useEmptyArrays:sourceA.useEmptyArrays||_b4.useEmptyArrays,rules:mergeXmlRules(sourceA.rules,_b4.rules)})}}}var EmptyRules={__type:/* @__PURE__ */invariant(),attributes:/* @__PURE__ */new Map,elements:/* @__PURE__ */new Map,characters:void 0};function mapXmlRules(rules){var parentNamespaceUri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var _a2,_b,_c;var attributeRules=/* @__PURE__ */new Map;var elementRules=/* @__PURE__ */new Map;var charactersRule=void 0;var _loop=function _loop(){var handlerOrFunction=rules[property];var handler;if(typeof handlerOrFunction==="function"){handler=handlerOrFunction()}else{handler=handlerOrFunction}var key;switch(handler.type){case"characters":if(charactersRule!==void 0)throw new IllegalArgumentError("characters handler already defined");charactersRule={property:property,parse:handler.parse,stringify:handler.stringify};break;case"element":case"elements":{var localPart=(_a2=handler.localPart)!=null?_a2:property;var namespaceUri=handler.namespaceUri===void 0?parentNamespaceUri:handler.namespaceUri;key=xmlRuleKey(localPart,namespaceUri);if(elementRules.has(key)){throw new IllegalArgumentError("Multiple element rules for ".concat(key))}if(handler.type==="element"){var rules2=handler.rules;elementRules.set(key,{array:false,property:property,minOccurs:handler.required?1:0,maxOccurs:1,rules:memoize(function(){return mapXmlRules(rules2,namespaceUri)}),useEmptyArrays:false,localPart:localPart,namespaceUri:namespaceUri})}else{var _rules=handler.rules;elementRules.set(key,{array:true,property:property,maxOccurs:handler.maxOccurs,minOccurs:handler.minOccurs,rules:memoize(function(){return mapXmlRules(_rules,namespaceUri)}),useEmptyArrays:handler.useEmptyArrays,localPart:localPart,namespaceUri:namespaceUri})}break}case"attribute":{var _namespaceUri=handler.namespaceUri;var _localPart=(_b=handler.localPart)!=null?_b:property;key=xmlRuleKey(_localPart,_namespaceUri);if(attributeRules.has(key)){throw new IllegalArgumentError("Multiple attribute rules for ".concat(key))}attributeRules.set(key,{property:property,default:handler.default,parse:handler.parse,stringify:handler.stringify,required:handler.required,localPart:_localPart,namespaceUri:(_c=handler.namespaceUri)!=null?_c:null});break}}};for(var property in rules){_loop()}return{__type:invariant(),attributes:attributeRules,elements:elementRules,characters:charactersRule}}function xmlRuleKey(localPart){var namespaceUri=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return"".concat(namespaceUri!=null?namespaceUri:"",":").concat(localPart)}function getRule(name,rules){return rules.get(xmlRuleKey(name.localPart,name.namespaceUri))}var ParseXmlHandlerImpl=/*#__PURE__*/function(){function ParseXmlHandlerImpl(rules,options){_classCallCheck(this,ParseXmlHandlerImpl);this.rules=rules;__publicField4(this,"stack",[]);__publicField4(this,"options");__publicField4(this,"busy",false);this.options=__spreadValues5({validateRules:true},options)}return _createClass(ParseXmlHandlerImpl,[{key:"startDocument",value:function startDocument(){if(this.busy)throw new IllegalStateError("XML content handler is busy");this.busy=true;var rules=this.rules;this.stack.push({element:new XmlElementImpl,rules:rules,characters:""})}},{key:"startElement",value:function startElement(name,attributes){var _this10=this;var _a2;var parent=last(this.stack);var element2=null;var elementRule=getRule(name,parent.rules.elements);var rules=(_a2=elementRule==null?void 0:elementRule.rules())!=null?_a2:EmptyRules;if(elementRule){var prop=elementRule.property;element2=new XmlElementImpl(parent.element);if(elementRule.array){var arr=parent.element[prop];if(Array.isArray(arr)){arr.push(element2)}else{parent.element[prop]=[element2]}}else{if(parent.element[prop]){throw new XmlSchemaError("Expected single element with name ".concat(name.qName))}else{parent.element[prop]=element2}}var attributeRules=rules.attributes;for(var k in attributes){var attribute=attributes[k];var name2=attribute.name;var attributeRule=getRule(name2,attributeRules);if(attributeRule){element2[attributeRule.property]=attributeRule.parse(attribute.value)}}attributeRules.forEach(function(_value,key){var rule=attributeRules.get(key);if(!(rule.property in element2)){if(rule.default!=null){element2[rule.property]=rule.default}else if(_this10.options.validateRules&&rule.required){throw new XmlSchemaError(substitute(xmlSchemaErrorLocale.requiredAttribute,{property:rule.property}))}}})}this.stack.push({element:element2,rules:rules,characters:""})}},{key:"textNode",value:function textNode(str){var current=last(this.stack);if(!current.rules.characters)return;current.characters+=decodeEntities(str.trim())}},{key:"cDataNode",value:function cDataNode(str){var current=last(this.stack);if(!current.rules.characters)return;current.characters+=str}},{key:"endElement",value:function endElement(){var lastEl=this.stack.pop();var charactersRule=lastEl.rules.characters;if(charactersRule)lastEl.element[charactersRule.property]=charactersRule.parse(lastEl.characters);lastEl.rules.elements.forEach(function(rule){if(rule.array&&!(rule.property in lastEl.element)){if(rule.useEmptyArrays){lastEl.element[rule.property]=[]}}});this.validate(lastEl)}},{key:"endDocument",value:function endDocument(){this.busy=false;var last3=this.stack.pop();this.validate(last3);return last3.element}},{key:"validate",value:function validate(current){if(!this.options.validateRules)return;current.rules.elements.forEach(function(rule){var _a2,_b;var length=rule.array?(_b=(_a2=current.element[rule.property])==null?void 0:_a2.length)!=null?_b:0:current.element[rule.property]?1:0;if(length<rule.minOccurs){throw new XmlSchemaError(substitute(xmlSchemaErrorLocale.atLeastElements,{property:rule.property,expected:rule.minOccurs,actual:length}))}if(rule.maxOccurs!=null&&length>rule.maxOccurs){throw new XmlSchemaError(substitute(xmlSchemaErrorLocale.atMostElements,{property:rule.property,expected:rule.maxOccurs,actual:length}))}})}}])}();var parentSymbol=/* @__PURE__ */Symbol("parent");var _a;_a=parentSymbol;var _XmlElementImpl=/*#__PURE__*/function(){function _XmlElementImpl2(){var parent=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;_classCallCheck(this,_XmlElementImpl2);__publicField4(this,_a);this[parentSymbol]=parent}return _createClass(_XmlElementImpl2,[{key:"parent",get:function get(){return this[parentSymbol]},set:function set(value){this[parentSymbol]=value}},{key:"clone",value:function clone(){var out=new _XmlElementImpl2(this.parent);for(var key in this){var child=_clone(this[key]);if(Array.isArray(child)){var _iterator17=_createForOfIteratorHelper(child),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var e=_step17.value;if(_typeof(e)==="object"&&"parent"in e)e.parent=out}}catch(err){_iterator17.e(err)}finally{_iterator17.f()}}else if(_typeof(child)==="object"&&"parent"in child){child.parent=out}out[key]=child}return out}},{key:"toJSON",value:function toJSON(){var out={};for(var key in this){out[key]=toJson(this[key])}return out}}])}();var XmlElementImpl=_XmlElementImpl;var actuateValidator=/* @__PURE__ */isOneOf("onLoad","onRequest");function assertActuateEnum(str){actuateValidator.assert(str,ErrorOrigin.PARSING);return str}// src/duration/duration.ts
466
+ */function get(){if(this._base==null)this._base=new _NumberSchema(typeOfValidators.number);return this._base}}])}(ValueSchema);__publicField(_NumberSchema,"_base",null);var NumberSchema=_NumberSchema;// ../vinyl-validation/src/validation/validators.ts
467
+ var locale11={isOneOf:"one of: {value}",instanceOf:"instance of {value}",oneOfSeparator:" | "};function isOneOf(){for(var _len7=arguments.length,possibleValues=new Array(_len7),_key7=0;_key7<_len7;_key7++){possibleValues[_key7]=arguments[_key7]}return new ValueSchema(createValidator(substitute(locale11.isOneOf,{value:possibleValues.join(locale11.oneOfSeparator)}),function(input){return possibleValues.includes(input)}))}function number(){return NumberSchema.base}// ../vinyl-xml/src/xlink/actuateValidator.ts
468
+ var actuateValidator=isOneOf("onLoad","onRequest");function assertActuateEnum(str){actuateValidator.assert(str,ErrorOrigin.PARSING);return str}// src/duration/duration.ts
559
469
  var I=60;var H=3600;var D=86400;var M=2592e3;var Y=31536e3;var iso8601Duration=/^(-?)P?(\d+(?:\.\d*)?Y)?(\d+(?:\.\d*)?M)?(\d+(?:\.\d*)?D)?T?(\d+(?:\.\d*)?H)?(\d+(?:\.\d*)?M)?(\d+(?:\.\d*)?S?)?$/i;function parseDuration(value){var match=iso8601Duration.exec(value);if(match==null)throw new ValidationError("Unexpected duration: '".concat(value,"', should be in iso 8601 format"),ErrorOrigin.PARSING);var sign=match[1]==="-"?-1:1;return sign*(parseFloat(match[2]||"0")*Y+parseFloat(match[3]||"0")*M+parseFloat(match[4]||"0")*D+parseFloat(match[5]||"0")*H+parseFloat(match[6]||"0")*I+parseFloat(match[7]||"0"))}function stringifyDuration(value){var sign=value<0?"-":"";var abs=Math.abs(value);var years=Math.floor(abs/Y);abs-=years*Y;var months=Math.floor(abs%Y/M);var days=Math.floor(abs%M/D);var hours=Math.floor(abs%D/H);var minutes=Math.floor(abs%H/I);var seconds=abs%I;var isoString="".concat(sign,"P");if(years>0)isoString+="".concat(years,"Y");if(months>0)isoString+="".concat(months,"M");if(days>0)isoString+="".concat(days,"D");isoString+="T";if(hours>0)isoString+="".concat(hours,"H");if(minutes>0)isoString+="".concat(minutes,"M");if(seconds>0||!value)isoString+="".concat(roundToNearest(seconds,1e-3),"S");return isoString}// src/manifest/dashManifestXmlRules.ts
560
- var dashNamespaceUri="urn:mpeg:dash:schema:mpd:2011";function dashManifestXmlRules(){var attrActuateType=attr(assertActuateEnum,stringify,{default:"onRequest"});var descriptorType={id:attrString,schemeIdUri:attrString({required:true}),value:attrString};var baseURLType={availabilityTimeComplete:attrBoolean,availabilityTimeOffset:attrFloat,byteRange:attrString,serviceLocation:attrString,_content:charactersString};var contentComponentType={contentType:attrString,id:attrInt,lang:attrString,par:attr(parseRatio,stringifyRatio),Accessibility:elements(descriptorType),Rating:elements(descriptorType),Role:elements(descriptorType),Viewpoint:elements(descriptorType)};var urlType={range:attr(parseByteRange,stringifyByteRange),sourceURL:attrString};var uriType={_content:charactersString};var segmentBaseType={Initialization:element(urlType),RepresentationIndex:element(urlType),availabilityTimeComplete:attrBoolean,availabilityTimeOffset:attrInt,indexRange:attr(parseByteRange,stringifyByteRange),indexRangeExact:attrBoolean({default:false}),presentationTimeOffset:attrFloat,timescale:attrInt};var segmentTimelineTypeSType={d:attrInt({required:true}),n:attrInt,r:attrInt({default:0}),t:attrInt};var segmentTimelineType={S:elements(segmentTimelineTypeSType)};var multipleSegmentBaseType=__spreadProps(__spreadValues({},segmentBaseType),{SegmentTimeline:element(segmentTimelineType),BitstreamSwitching:element(urlType),duration:attrInt,startNumber:attrInt});var segmentURLType={index:attrString,indexRange:attr(parseByteRange,stringifyByteRange),media:attrString,mediaRange:attr(parseByteRange,stringifyByteRange)};var segmentListType=__spreadProps(__spreadValues({},multipleSegmentBaseType),{actuate:attrActuateType,href:attrString,SegmentURL:elements(segmentURLType)});var segmentTemplateType=__spreadProps(__spreadValues({},multipleSegmentBaseType),{bitstreamSwitching:attrString,index:attrString,initialization:attrString,media:attrString});var subsetType={contains:attr(parseIntVector,stringifyIntVector,{required:true}),id:attrString};var eventType={duration:attrInt,id:attrInt,messageData:attrString,presentationTime:attrInt({default:0})};var eventStreamType={Event:elements(eventType),actuate:attrActuateType,href:attrString,messageData:attrString,schemeIdUri:attrString({required:true}),timescale:attrInt,value:attrString};var switchingType={interval:attrInt({required:true}),type:attr(parseSwitchingTypeType,stringify)};var representationBaseType={FramePacking:elements(descriptorType),AudioChannelConfiguration:elements(descriptorType),ContentProtection:elements(descriptorType),EssentialProperty:elements(descriptorType),SupplementalProperty:elements(descriptorType),InbandEventStream:elements(eventStreamType),Switching:elements(switchingType),audioSamplingRate:attr(parseIntVector,stringifyIntVector),codecs:attrString,codingDependency:attrBoolean,frameRate:attr(parseFrameRate,stringifyFrameRate),height:attrInt,maximumSAPPeriod:attrInt,maxPlayoutRate:attrInt,mimeType:attrString,profiles:attr(parseProfiles,stringifyProfiles),sar:attr(parseRatio,stringifyRatio),scanType:attr(parseVideoScan,stringify),segmentProfiles:attrString,startWithSAP:attr(parseSap,stringify),width:attrInt};var subRepresentationType=__spreadProps(__spreadValues({},representationBaseType),{bandwidth:attrInt,contentComponent:attr(parseStringVector,stringifyStringVector),dependencyLevel:attr(parseIntVector,stringifyIntVector),level:attrInt});var representationType=__spreadProps(__spreadValues({},representationBaseType),{bandwidth:attrInt({required:true}),bitrate:attrInt,dependencyId:attr(parseStringVector,stringifyStringVector),id:attrString({required:true}),mediaStreamStructureId:attr(parseStringVector,stringifyStringVector),qualityRanking:attrInt,BaseURL:elements(baseURLType),SegmentBase:element(segmentBaseType),SegmentList:element(segmentListType),SegmentTemplate:element(segmentTemplateType),SubRepresentation:elements(subRepresentationType)});var adaptationSetType=__spreadProps(__spreadValues({},representationBaseType),{Accessibility:elements(descriptorType),Role:elements(descriptorType),Rating:elements(descriptorType),Viewpoint:elements(descriptorType),ContentComponent:elements(contentComponentType),BaseURL:elements(baseURLType),SegmentBase:element(segmentBaseType),SegmentList:element(segmentListType),SegmentTemplate:element(segmentTemplateType),Representation:elements(representationType),actuate:attrActuateType,bitstreamSwitching:attrBoolean,contentType:attrString,group:attrInt,href:attrString,id:attrInt,lang:attrString,maxBandwidth:attrInt,maxFrameRate:attr(parseFrameRate,stringifyFrameRate),maxHeight:attrInt,maxWidth:attrInt,minBandwidth:attrInt,minFrameRate:attr(parseFrameRate,stringifyFrameRate),minHeight:attrInt,minWidth:attrInt,par:attr(parseRatio,stringifyRatio),segmentAlignment:attr(parseConditionalUint,stringify,{default:false}),selectionPriority:attrInt({default:1}),subsegmentAlignment:attr(parseConditionalUint,stringify,{default:false}),subsegmentStartsWithSAP:attr(parseSap,stringify,{default:0})});var rangeType={duration:attr(parseDuration,stringifyDuration),starttime:attr(parseDuration,stringifyDuration)};var metricsType={metrics:attrString({required:true}),Range:elements(rangeType),Reporting:elements(descriptorType,{minOccurs:1})};var periodType={BaseURL:elements(baseURLType),SegmentBase:element(segmentBaseType),SegmentList:element(segmentListType),SegmentTemplate:element(segmentTemplateType),AssetIdentifier:element(descriptorType),EventStream:elements(eventStreamType),AdaptationSet:elements(adaptationSetType),Subset:elements(subsetType),SupplementalProperty:elements(descriptorType),actuate:attrActuateType,bitstreamSwitching:attrBoolean({default:false}),duration:attr(parseDuration,stringifyDuration),href:attrString,id:attrString,start:attr(parseDuration,stringifyDuration)};var programInformationType={lang:attrString,moreInformationURL:attrString,Copyright:attrString,Source:attrString,Title:attrString};var mpdType={ProgramInformation:elements(programInformationType),BaseURL:elements(baseURLType),Location:elements(uriType),Period:elements(periodType,{minOccurs:1}),Metrics:elements(metricsType),EssentialProperty:elements(descriptorType),SupplementalProperty:elements(descriptorType),UTCTiming:elements(descriptorType),availabilityEndTime:attrDateTime,availabilityStartTime:attrDateTime,id:attrString,maxSegmentDuration:attr(parseDuration,stringifyDuration),maxSubsegmentDuration:attr(parseDuration,stringifyDuration),mediaPresentationDuration:attr(parseDuration,stringifyDuration),minBufferTime:attr(parseDuration,stringifyDuration,{required:true}),minimumUpdatePeriod:attr(parseDuration,stringifyDuration),profiles:attr(parseProfiles,stringifyProfiles,{required:true}),publishTime:attrDateTime,suggestedPresentationDelay:attr(parseDuration,stringifyDuration),timeShiftBufferDepth:attr(parseDuration,stringifyDuration),type:attr(parsePresentationTypeType,stringify,{default:"static"})};return{MPD:element(mpdType,{required:true,namespaceUri:dashNamespaceUri})}}function parseProfiles(str){return str.split(",")}function stringifyProfiles(value){return value.join(",")}var videoScanTypeValidator=isOneOf("progressive","interlaced","unknown");function parseVideoScan(str){videoScanTypeValidator.assert(str,ErrorOrigin.PARSING);return str}var switchingTypeTypeValidator=isOneOf("media","bitstream");function parseSwitchingTypeType(str){switchingTypeTypeValidator.assert(str,ErrorOrigin.PARSING);return str}var validateSap=number().within(0,6);function parseSap(str){var number2=parseInt(str);validateSap.assert(number2,ErrorOrigin.PARSING);return number2}function parseStringVector(str){return str.split(/\s+/)}function stringifyStringVector(value){return value.join(" ")}function parseIntVector(str){return str.split(/\s+/).map(function(subStr){return parseInt(subStr)})}function stringifyIntVector(value){return value.join(" ")}var presentationTypeValidator=isOneOf("static","dynamic");function parsePresentationTypeType(str){presentationTypeValidator.assert(str,ErrorOrigin.PARSING);return str}function parseConditionalUint(str){var lower=str.toLowerCase();switch(lower){case"true":return true;case"false":return false;default:return parseInt(str)}}// src/manifest/ext/drm/cencXmlRules.ts
470
+ var dashNamespaceUri="urn:mpeg:dash:schema:mpd:2011";function dashManifestXmlRules(){var attrActuateType=attr(assertActuateEnum,stringify,{"default":"onRequest"});var descriptorType={id:attrString,schemeIdUri:attrString({required:true}),value:attrString};var baseURLType={availabilityTimeComplete:attrBoolean,availabilityTimeOffset:attrFloat,byteRange:attrString,serviceLocation:attrString,_content:charactersString};var contentComponentType={contentType:attrString,id:attrInt,lang:attrString,par:attr(parseRatio,stringifyRatio),Accessibility:elements(descriptorType),Rating:elements(descriptorType),Role:elements(descriptorType),Viewpoint:elements(descriptorType)};var urlType={range:attr(parseByteRange,stringifyByteRange),sourceURL:attrString};var uriType={_content:charactersString};var segmentBaseType={Initialization:element(urlType),RepresentationIndex:element(urlType),availabilityTimeComplete:attrBoolean,availabilityTimeOffset:attrInt,indexRange:attr(parseByteRange,stringifyByteRange),indexRangeExact:attrBoolean({"default":false}),presentationTimeOffset:attrFloat,timescale:attrInt};var segmentTimelineTypeSType={d:attrInt({required:true}),n:attrInt,r:attrInt({"default":0}),t:attrInt};var segmentTimelineType={S:elements(segmentTimelineTypeSType)};var multipleSegmentBaseType=__spreadProps(__spreadValues({},segmentBaseType),{SegmentTimeline:element(segmentTimelineType),BitstreamSwitching:element(urlType),duration:attrInt,startNumber:attrInt});var segmentURLType={index:attrString,indexRange:attr(parseByteRange,stringifyByteRange),media:attrString,mediaRange:attr(parseByteRange,stringifyByteRange)};var segmentListType=__spreadProps(__spreadValues({},multipleSegmentBaseType),{actuate:attrActuateType,href:attrString,SegmentURL:elements(segmentURLType)});var segmentTemplateType=__spreadProps(__spreadValues({},multipleSegmentBaseType),{bitstreamSwitching:attrString,index:attrString,initialization:attrString,media:attrString});var subsetType={contains:attr(parseIntVector,stringifyIntVector,{required:true}),id:attrString};var eventType={duration:attrInt,id:attrInt,messageData:attrString,presentationTime:attrInt({"default":0})};var eventStreamType={Event:elements(eventType),actuate:attrActuateType,href:attrString,messageData:attrString,schemeIdUri:attrString({required:true}),timescale:attrInt,value:attrString};var switchingType={interval:attrInt({required:true}),type:attr(parseSwitchingTypeType,stringify)};var representationBaseType={FramePacking:elements(descriptorType),AudioChannelConfiguration:elements(descriptorType),ContentProtection:elements(descriptorType),EssentialProperty:elements(descriptorType),SupplementalProperty:elements(descriptorType),InbandEventStream:elements(eventStreamType),Switching:elements(switchingType),audioSamplingRate:attr(parseIntVector,stringifyIntVector),codecs:attrString,codingDependency:attrBoolean,frameRate:attr(parseFrameRate,stringifyFrameRate),height:attrInt,maximumSAPPeriod:attrInt,maxPlayoutRate:attrInt,mimeType:attrString,profiles:attr(parseProfiles,stringifyProfiles),sar:attr(parseRatio,stringifyRatio),scanType:attr(parseVideoScan,stringify),segmentProfiles:attrString,startWithSAP:attr(parseSap,stringify),width:attrInt};var subRepresentationType=__spreadProps(__spreadValues({},representationBaseType),{bandwidth:attrInt,contentComponent:attr(parseStringVector,stringifyStringVector),dependencyLevel:attr(parseIntVector,stringifyIntVector),level:attrInt});var representationType=__spreadProps(__spreadValues({},representationBaseType),{bandwidth:attrInt({required:true}),bitrate:attrInt,dependencyId:attr(parseStringVector,stringifyStringVector),id:attrString({required:true}),mediaStreamStructureId:attr(parseStringVector,stringifyStringVector),qualityRanking:attrInt,BaseURL:elements(baseURLType),SegmentBase:element(segmentBaseType),SegmentList:element(segmentListType),SegmentTemplate:element(segmentTemplateType),SubRepresentation:elements(subRepresentationType)});var adaptationSetType=__spreadProps(__spreadValues({},representationBaseType),{Accessibility:elements(descriptorType),Role:elements(descriptorType),Rating:elements(descriptorType),Viewpoint:elements(descriptorType),ContentComponent:elements(contentComponentType),BaseURL:elements(baseURLType),SegmentBase:element(segmentBaseType),SegmentList:element(segmentListType),SegmentTemplate:element(segmentTemplateType),Representation:elements(representationType),actuate:attrActuateType,bitstreamSwitching:attrBoolean,contentType:attrString,group:attrInt,href:attrString,id:attrInt,lang:attrString,maxBandwidth:attrInt,maxFrameRate:attr(parseFrameRate,stringifyFrameRate),maxHeight:attrInt,maxWidth:attrInt,minBandwidth:attrInt,minFrameRate:attr(parseFrameRate,stringifyFrameRate),minHeight:attrInt,minWidth:attrInt,par:attr(parseRatio,stringifyRatio),segmentAlignment:attr(parseConditionalUint,stringify,{"default":false}),selectionPriority:attrInt({"default":1}),subsegmentAlignment:attr(parseConditionalUint,stringify,{"default":false}),subsegmentStartsWithSAP:attr(parseSap,stringify,{"default":0})});var rangeType={duration:attr(parseDuration,stringifyDuration),starttime:attr(parseDuration,stringifyDuration)};var metricsType={metrics:attrString({required:true}),Range:elements(rangeType),Reporting:elements(descriptorType,{minOccurs:1})};var periodType={BaseURL:elements(baseURLType),SegmentBase:element(segmentBaseType),SegmentList:element(segmentListType),SegmentTemplate:element(segmentTemplateType),AssetIdentifier:element(descriptorType),EventStream:elements(eventStreamType),AdaptationSet:elements(adaptationSetType),Subset:elements(subsetType),SupplementalProperty:elements(descriptorType),actuate:attrActuateType,bitstreamSwitching:attrBoolean({"default":false}),duration:attr(parseDuration,stringifyDuration),href:attrString,id:attrString,start:attr(parseDuration,stringifyDuration)};var programInformationType={lang:attrString,moreInformationURL:attrString,Copyright:attrString,Source:attrString,Title:attrString};var mpdType={ProgramInformation:elements(programInformationType),BaseURL:elements(baseURLType),Location:elements(uriType),Period:elements(periodType,{minOccurs:1}),Metrics:elements(metricsType),EssentialProperty:elements(descriptorType),SupplementalProperty:elements(descriptorType),UTCTiming:elements(descriptorType),availabilityEndTime:attrDateTime,availabilityStartTime:attrDateTime,id:attrString,maxSegmentDuration:attr(parseDuration,stringifyDuration),maxSubsegmentDuration:attr(parseDuration,stringifyDuration),mediaPresentationDuration:attr(parseDuration,stringifyDuration),minBufferTime:attr(parseDuration,stringifyDuration,{required:true}),minimumUpdatePeriod:attr(parseDuration,stringifyDuration),profiles:attr(parseProfiles,stringifyProfiles,{required:true}),publishTime:attrDateTime,suggestedPresentationDelay:attr(parseDuration,stringifyDuration),timeShiftBufferDepth:attr(parseDuration,stringifyDuration),type:attr(parsePresentationTypeType,stringify,{"default":"static"})};return{MPD:element(mpdType,{required:true,namespaceUri:dashNamespaceUri})}}function parseProfiles(str){return str.split(",")}function stringifyProfiles(value){return value.join(",")}var videoScanTypeValidator=isOneOf("progressive","interlaced","unknown");function parseVideoScan(str){videoScanTypeValidator.assert(str,ErrorOrigin.PARSING);return str}var switchingTypeTypeValidator=isOneOf("media","bitstream");function parseSwitchingTypeType(str){switchingTypeTypeValidator.assert(str,ErrorOrigin.PARSING);return str}var validateSap=number().within(0,6);function parseSap(str){var number2=parseInt(str);validateSap.assert(number2,ErrorOrigin.PARSING);return number2}function parseStringVector(str){return str.split(/\s+/)}function stringifyStringVector(value){return value.join(" ")}function parseIntVector(str){return str.split(/\s+/).map(function(subStr){return parseInt(subStr)})}function stringifyIntVector(value){return value.join(" ")}var presentationTypeValidator=isOneOf("static","dynamic");function parsePresentationTypeType(str){presentationTypeValidator.assert(str,ErrorOrigin.PARSING);return str}function parseConditionalUint(str){var lower=str.toLowerCase();switch(lower){case"true":return true;case"false":return false;default:return parseInt(str)}}// src/manifest/ext/drm/cencXmlRules.ts
561
471
  var cencXmlRules={default_KID:attr(parseStringVector,stringifyStringVector,{namespaceUri:CENC_NAMESPACE_URI}),pssh:element({_content:charactersString},{namespaceUri:CENC_NAMESPACE_URI})};// src/manifest/ext/drm/contentProtection.ts
562
472
  function createDashProtectionXmlRules(contentProtectionRules){var withProtections={ContentProtection:elements(contentProtectionRules)};return{MPD:element({Period:elements({AdaptationSet:elements(__spreadProps(__spreadValues({},withProtections),{Representation:elements(__spreadProps(__spreadValues({},withProtections),{SubRepresentation:elements(withProtections)}))}))},{minOccurs:1})},{required:true,namespaceUri:dashNamespaceUri})}}// src/manifest/ext/drm/playreadyXmlRules.ts
563
473
  var playreadyXmlRules={pro:element({_content:charactersString},{namespaceUri:PLAY_READY_NAMESPACE_URI})};// src/manifest/dashParser.ts