text: var e=require("react"),n=function(e,n){return e[n]},t=function(e){throw new Error(e)},r=function(e,n){return e.findIndex(function(e){return e.id===n})},u=function(n){var u=n.initialStep;void 0===u&&(u=0);var i=n.autoAdvanceDuration;void 0===i&&(i=0);var o=n.steps;"production"!==process.env.NODE_ENV&&(Array.isArray(o)||Number.isInteger(o)||t("useStep: You must specify either an array or an integer for `steps`"));var a="number"==typeof o?new Array(o).fill({}):o,s="number"==typeof u?u:r(a,u);"production"!==process.env.NODE_ENV&&"string"==typeof u&&-1===s&&t('useStep: id of "'+u+'" specified in initialStep not found in steps');var c=e.useState(s),f=c[0],p=c[1],v=e.useState(!1),d=v[0],l=v[1],g=a[f],S=g.autoAdvanceDuration;void 0===S&&(S=i);var y=function(e){void 0===e&&(e=1),p((f+a.length+e)%a.length)};return e.useEffect(function(){var e=!d&&S?setTimeout(y,S):null;return function(){return clearTimeout(e)}},[f,d]),{autoAdvanceDuration:S,isPaused:d,index:f,step:g,navigation:{next:function(){return y(1)},previous:function(){return y(-1)},go:function(e){if("number"==typeof e)"production"!==process.env.NODE_ENV&&(e<0||e>a.length)&&t("useStep: Index out of range in go("+e+")"),p(e);else{var n=r(a,e);"production"!==process.env.NODE_ENV&&-1===n&&t('useStep: go("'+e+'") not found in steps'),p(n)}},play:function(){return l(!1)},pause:function(){return l(!0)}}}};exports.useNot=function(n){var t=e.useState(!!n),r=t[1];return[t[0],function(){return r(function(e){return!e})}]},exports.useForm=function(t){var r=e.useState(t),u=r[1];return[r[0],function(e){var t=e.target,r=t.name,i=t.value,o=t.checked,a="checkbox"===t.type;u(function(e){var t=JSON.parse(JSON.stringify(e)),u=r.split("."),s=u.slice(0,-1),c=u.slice(-1)[0];return s.reduce(n,t)[c]=a?o:i,t})}]},exports.useTrafficLight=function(e,n){void 0===e&&(e=0),void 0===n&&(n=[5e3,4e3,1e3]);var t=n.map(function(e){return{autoAdvanceDuration:e}});return u({initialStep:e,steps:t}).index},exports.useStep=u;
  