text: "use strict";var _react=require("react");Object.defineProperty(exports,"__esModule",{value:!0}),exports.experimentReducer=experimentReducer,exports.initialExperimentState=exports.reducerEvents=exports.ExperimentStateContext=exports.ExperimentDispatcherContext=void 0;function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_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 _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _iterableToArray(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}var ExperimentDispatcherContext=/*#__PURE__*/(0,_react.createContext)();exports.ExperimentDispatcherContext=ExperimentDispatcherContext;var ExperimentStateContext=/*#__PURE__*/(0,_react.createContext)();exports.ExperimentStateContext=ExperimentStateContext;var reducerEvents={addVariant:"ADD_VARIANTS",setActiveVariant:"SET_ACTIVE_VARIANT",setWeight:"SET_WEIGHT"};exports.reducerEvents=reducerEvents;var initialExperimentState={activeVariant:null,weights:[50,50],variantsProvided:[]};exports.initialExperimentState=initialExperimentState;function experimentReducer(a,b){switch(b.type){case reducerEvents.addVariant:return _objectSpread(_objectSpread({},a),{},{variantsProvided:[].concat(_toConsumableArray(a.variantsProvided),[b.variants])});case reducerEvents.setActiveVariant:return _objectSpread(_objectSpread({},a),{},{activeVariant:b.variant});case reducerEvents.setWeight:return _objectSpread(_objectSpread({},a),{},{weights:b.weights});default:}}