🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-responsive-select

Package Overview
Dependencies
Maintainers
1
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-responsive-select - npm Package Compare versions

Comparing version

to
5.0.1

2

dist/ReactResponsiveSelect.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define("ReactResponsiveSelect",["React"],t):"object"==typeof exports?exports.ReactResponsiveSelect=t(require("React")):e.ReactResponsiveSelect=t(e.React)}(window,function(n){return function(n){var o={};function l(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,l),t.l=!0,t.exports}return l.m=n,l.c=o,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(t,e){if(1&e&&(t=l(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)l.d(n,o,function(e){return t[e]}.bind(null,o));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="",l(l.s=11)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INITIALISE="INITIALISE",t.UPDATE_VIA_PROPS="UPDATE_VIA_PROPS",t.SET_IS_DRAGGING="SET_IS_DRAGGING",t.SET_OPTIONS_PANEL_OPEN="SET_OPTIONS_PANEL_OPEN",t.SET_OPTIONS_PANEL_CLOSED="SET_OPTIONS_PANEL_CLOSED",t.SET_SINGLESELECT_OPTIONS="SET_SINGLESELECT_OPTIONS",t.SET_MULTISELECT_OPTIONS="SET_MULTISELECT_OPTIONS",t.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION="SET_OPTIONS_PANEL_CLOSED_NO_SELECTION",t.SET_OPTIONS_PANEL_CLOSED_ONBLUR="SET_OPTIONS_PANEL_CLOSED_ONBLUR",t.SET_NEXT_SELECTED_INDEX="SET_NEXT_SELECTED_INDEX",t.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC="SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC"},function(e,t){e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t?"":" ";return e.replace(/\s\s+/g,n).trim()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function o(){var n=[];return function(e,t){if("object"==typeof t&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t}}t.isEqual=function(e,t){return JSON.stringify(e,o())===JSON.stringify(t,o())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextValidIndex=function(e,t,n){void 0===n&&(n="INCREMENT");var o=e.options,l=o.reduce(function(e,t,n){return t.optHeader||e.push(n),e},[]),i=-1===l.indexOf(t);return i&&"INCREMENT"===n?o[t+1]&&!o[t+1].optHeader?t+1:l[0]:i&&"DECREMENT"===n?o[t-1]&&!o[t-1].optHeader?t-1:l[l.length-1]:t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.handleAlphaNumerical=function(e){var t=e.event,n=e.state,o=e.ReactResponsiveSelectClassRef,l=n.options;if(!n.disabled){var i=l.map(function(e){return!e.optHeader&&!e.disabled&&(e.text||"").toLowerCase().charAt(0)}).indexOf(t.key);-1<i&&o.updateState({value:i,type:r.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(14);t.multiSelectBroadcastChange=o.multiSelectBroadcastChange;var l=n(15);t.singleSelectBroadcastChange=l.singleSelectBroadcastChange},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),d=n(16);t.handleClick=function(e){var t=e.event,n=e.state,o=e.ReactResponsiveSelectClassRef,l=n.multiselect,i=n.isOptionsPanelOpen,r=n.isDragging,a=n.disabled,s=n.options;if(!a&&!1===r){if(t.preventDefault(),t&&d.containsClassName(t.target,"rrs__options"))return;var c=parseFloat(t.target.getAttribute("data-key"));if(s[c]&&!0===s[c].disabled||s[c]&&!0===s[c].optHeader)return;if(d.containsClassName(t.target,"rrs__option"))return void o.updateState({type:l?u.SET_MULTISELECT_OPTIONS:u.SET_SINGLESELECT_OPTIONS,value:c});if(i&&(d.containsClassName(t.target,"rrs__label")||d.containsClassName(t.target,"rrs")))return void o.updateState({type:u.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION},function(){return o.focusButton()});o.updateState({type:i?u.SET_OPTIONS_PANEL_CLOSED:u.SET_OPTIONS_PANEL_OPEN},function(e){!1===e.isOptionsPanelOpen&&o.focusButton()})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=n(0);t.handleEnterPressed=function(e){var t=e.event,n=e.state,o=e.props,l=e.ReactResponsiveSelectClassRef,i=n.disabled,r=n.isOptionsPanelOpen,a=n.multiselect,s=n.nextPotentialSelectionIndex,c=n.options;if(!i){var u=parseFloat(t.target.getAttribute("data-key"));c[u]&&!0===c[u].disabled||c[u]&&!0===c[u].optHeader||(a?l.updateState({type:d.SET_MULTISELECT_OPTIONS,value:s}):l.updateState({type:d.SET_SINGLESELECT_OPTIONS,value:s}),r?t.stopPropagation():o.onSubmit&&o.onSubmit(t))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(20);t.handleKeyUpOrDownPressed=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=e.type,l=t.isOptionsPanelOpen;t.disabled||(n.updateState({type:i.SET_NEXT_SELECTED_INDEX,value:r.getNextIndex(o,t)}),!1===l&&n.updateState({type:i.SET_OPTIONS_PANEL_OPEN}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState={multiselect:!1,name:"",options:[],isDragging:!1,isOptionsPanelOpen:!1,altered:!1,singleSelectInitialIndex:0,singleSelectSelectedIndex:0,singleSelectSelectedOption:{},nextPotentialSelectionIndex:0,multiSelectInitialSelectedIndexes:[0],multiSelectSelectedOptions:{altered:!1,options:[]},multiSelectSelectedIndexes:[]}},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),l=this&&this.__assign||function(){return(l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var h=n(1),x=n(2),s=n(0),i=n(12),I=n(23),c=n(6),r=n(10),a=n(24),u=n(3),b=n(37),P=n(39),d=function(n){function e(e){var t=n.call(this,e)||this;return t.onHandleKeyEvent=function(e){i.handleKeyEvent({event:e,ReactResponsiveSelectClassRef:t,state:t.state,props:t.props})},t.onHandleTouchStart=function(){i.handleTouchStart({ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleTouchMove=function(){i.handleTouchMove({ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleClick=function(e){i.handleClick({event:e,ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleBlur=function(){i.handleBlur({ReactResponsiveSelectClassRef:t,state:t.state,props:t.props})},t.state=r.initialState,t.reducer=a.reducer,t.firstLoad=!0,t}return o(e,n),e.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.noSelectionLabel,o=e.selectedValue,l=e.selectedValues,i=e.name,r=e.multiselect,a=e.disabled;this.updateState({type:s.INITIALISE,value:{options:t,noSelectionLabel:n,selectedValue:o,selectedValues:l,name:i,multiselect:r,disabled:a}})},e.prototype.componentWillReceiveProps=function(e){u.isEqual(e,this.props)||this.updateState({type:s.UPDATE_VIA_PROPS,value:l({},this.props,e)})},e.prototype.componentDidUpdate=function(e,t){var n=this.state,o=n.singleSelectSelectedOption,l=n.multiSelectSelectedOptions,i=n.multiselect,r=n.altered,a=this.props.onChange;return this.firstLoad?this.firstLoad=!1:(i?c.multiSelectBroadcastChange(l.options,Boolean(r),a,t.multiSelectSelectedOptions.options):c.singleSelectBroadcastChange(o,Boolean(r),a,t.singleSelectSelectedOption),!0)},e.prototype.updateState=function(t,e){var n=this.props,o=n.onListen,l=n.name,i=this.reducer(this.state,t);this.setState(i,function(){e&&e(i)}),o&&o([s.SET_OPTIONS_PANEL_OPEN,s.SET_NEXT_SELECTED_INDEX,s.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC,s.SET_IS_DRAGGING].some(function(e){return t.type===e}),l,t.type)},e.prototype.focusButton=function(){var e=this.selectBox&&this.selectBox.querySelector(".rrs__button");e&&e.focus()},e.prototype.render=function(){var t=this,e=this.props,n=e.prefix,o=e.caretIcon,l=e.disabled,i=this.state,r=i.altered,a=i.hasOptHeaders,s=i.isOptionsPanelOpen,c=i.isDragging,u=i.noSelectionLabel,d=i.multiSelectSelectedIndexes,p=i.multiSelectSelectedOptions,S=i.name,f=i.nextPotentialSelectionIndex,_=i.options,O=i.singleSelectSelectedIndex,v=i.singleSelectSelectedOption,E=i.multiselect,m=I.getCustomLabelText({props:this.props,state:this.state});return h.createElement("div",{"data-testid":S,"data-name":S,className:x.default("\n rrs\n "+(!0===s?"rrs--options-visible":"")+"\n "+(r?"rrs--has-changed":"")+"\n "+(a?"rrs--has-opt-headers":"")+"\n "),ref:function(e){t.selectBox=e},tabIndex:-1,onKeyDown:this.onHandleKeyEvent,onTouchStart:this.onHandleTouchStart,onTouchMove:this.onHandleTouchMove,onTouchEnd:this.onHandleClick,onMouseDown:this.onHandleClick,onBlur:this.onHandleBlur},E?h.createElement(b.MultiSelect,{disabled:Boolean(l),isDragging:c,caretIcon:o,customLabelText:m,prefix:n||"",name:S,multiSelectSelectedOptions:p,multiSelectSelectedIndexes:d,nextPotentialSelectionIndex:f,isOptionsPanelOpen:s,options:_,selectBoxRef:this.selectBox}):h.createElement(P.SingleSelect,{noSelectionLabel:u||"",disabled:Boolean(l),caretIcon:o,prefix:n||"",name:S,customLabelText:m,singleSelectSelectedOption:v,singleSelectSelectedIndex:O,nextPotentialSelectionIndex:f,isOptionsPanelOpen:s,options:_,selectBoxRef:this.selectBox}))},e}(h.Component);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(5);t.handleAlphaNumerical=o.handleAlphaNumerical;var l=n(13);t.handleBlur=l.handleBlur;var i=n(7);t.handleClick=i.handleClick;var r=n(8);t.handleEnterPressed=r.handleEnterPressed;var a=n(17);t.handleKeyEvent=a.handleKeyEvent;var s=n(9);t.handleKeyUpOrDownPressed=s.handleKeyUpOrDownPressed;var c=n(21);t.handleTouchMove=c.handleTouchMove;var u=n(22);t.handleTouchStart=u.handleTouchStart},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var p=n(0),S=n(6);t.handleBlur=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=e.props,l=t.isOptionsPanelOpen,i=t.disabled,r=t.altered,a=t.singleSelectSelectedOption,s=t.multiSelectSelectedOptions,c=o.onBlur,u=o.multiselect;if(!i){var d=n.selectBox&&!n.selectBox.contains(document.activeElement);l&&d&&n.updateState({type:p.SET_OPTIONS_PANEL_CLOSED_ONBLUR}),d&&c&&(u?S.multiSelectBroadcastChange(s.options,Boolean(r),c):S.singleSelectBroadcastChange(a,Boolean(r),c))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(3);t.multiSelectBroadcastChange=function(e,t,n,o){n&&(o&&l.isEqual(o,e)||n({options:e.map(function(e){return{name:e.name||"",text:e.text||"",value:e.value||""}}),altered:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(3);t.singleSelectBroadcastChange=function(e,t,n,o){n&&(l.isEqual(o,e)||n({name:e.name,text:e.text,value:e.value,altered:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containsClassName=function(e,t){return-1<String(e.className).split(" ").indexOf(t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=n(18),c=n(19),u=n(5),d=n(7),p=n(8),S=n(9);t.handleKeyEvent=function(e){var t=e.event,n=e.state,o=e.props,l=e.ReactResponsiveSelectClassRef,i=n.multiselect,r=n.isOptionsPanelOpen;if(!n.disabled)switch(c.preventDefaultForKeyCodes([s.keyCodes.ENTER,s.keyCodes.SPACE,s.keyCodes.ESCAPE,s.keyCodes.UP,s.keyCodes.DOWN],t),/^[a-z0-9]+$/.test(t.key)&&u.handleAlphaNumerical({event:t,ReactResponsiveSelectClassRef:l,state:n}),t.keyCode){case s.keyCodes.TAB:r&&(t.preventDefault(),i&&l.updateState({type:a.SET_OPTIONS_PANEL_CLOSED},function(){return l.focusButton()}));break;case s.keyCodes.ENTER:p.handleEnterPressed({ReactResponsiveSelectClassRef:l,event:t,props:o,state:n});break;case s.keyCodes.SPACE:r?d.handleClick({event:t,state:n,ReactResponsiveSelectClassRef:l}):l.updateState({type:a.SET_OPTIONS_PANEL_OPEN});break;case s.keyCodes.ESCAPE:l.updateState({type:a.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION},function(){return l.focusButton()});break;case s.keyCodes.UP:S.handleKeyUpOrDownPressed({ReactResponsiveSelectClassRef:l,state:n,type:"DECREMENT"});break;case s.keyCodes.DOWN:S.handleKeyUpOrDownPressed({ReactResponsiveSelectClassRef:l,state:n,type:"INCREMENT"})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyCodes={TAB:9,ENTER:13,SPACE:32,ESCAPE:27,UP:38,DOWN:40}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultForKeyCodes=function(e,t){e.forEach(function(e){e===t.keyCode&&t.preventDefault()})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4);t.getNextIndex=function(e,t){var n=t.isOptionsPanelOpen,o=t.nextPotentialSelectionIndex,l=t.options;switch(e){case"INCREMENT":return!1===n?i.nextValidIndex(t,o,"INCREMENT"):o===l.length-1?i.nextValidIndex(t,0,"INCREMENT"):i.nextValidIndex(t,o+1,"INCREMENT");case"DECREMENT":return!1===n?i.nextValidIndex(t,o,"DECREMENT"):0===o?i.nextValidIndex(t,l.length-1,"DECREMENT"):i.nextValidIndex(t,o-1,"DECREMENT");default:return i.nextValidIndex(t,0,"DECREMENT")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(0);t.handleTouchMove=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=t.isDragging;t.disabled||o||n.updateState({type:l.SET_IS_DRAGGING,value:!0})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.handleTouchStart=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef;t.disabled||n.updateState({type:o.SET_IS_DRAGGING,value:!1})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCustomLabelText=function(e){var t=e.state,n=e.props,o=n.multiselect,l=n.customLabelRenderer,i=t.multiSelectSelectedOptions,r=t.singleSelectSelectedOption;return!!l&&l(o?i:r)}},function(e,t,n){"use strict";var d=this&&this.__assign||function(){return(d=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var p=n(0),S=n(4),f=n(25);t.reducer=function(e,t){switch(t.type){case p.UPDATE_VIA_PROPS:case p.INITIALISE:var n=f.getSelectedValueIndex(t.value),o=f.getMultiSelectSelectedValueIndexes(t.value,t.value.selectedValues,t.value.noSelectionLabel);return d({},e,{hasOptHeaders:t.value.options.some(function(e){return!0===e.optHeader}),multiselect:t.value.multiselect||!1,noSelectionLabel:t.value.noSelectionLabel,name:t.value.name,options:t.value.options,altered:t.value.altered||!1,disabled:t.value.disabled||!1,singleSelectInitialIndex:n,singleSelectSelectedIndex:n,singleSelectSelectedOption:f.getSingleSelectSelectedOption(t.value,n),nextPotentialSelectionIndex:e.nextPotentialSelectionIndex?e.nextPotentialSelectionIndex:n,multiSelectInitialSelectedIndexes:o,multiSelectSelectedIndexes:o,multiSelectSelectedOptions:{options:f.getMultiSelectInitialSelectedOptions(t.value,t.value.selectedValues)}});case p.SET_IS_DRAGGING:return d({},e,{isDragging:t.value});case p.SET_OPTIONS_PANEL_OPEN:var l=d({},e,{isOptionsPanelOpen:!0,nextPotentialSelectionIndex:function(){return e.multiselect?e.multiSelectSelectedIndexes.length?S.nextValidIndex(e,e.multiSelectSelectedIndexes[0]):S.nextValidIndex(e,0):S.nextValidIndex(e,e.nextPotentialSelectionIndex)}(),singleSelectSelectedOption:f.getSingleSelectSelectedOption(e,e.nextPotentialSelectionIndex)});return f.mergeIsAlteredState(l);case p.SET_OPTIONS_PANEL_CLOSED:l=d({},e,{isOptionsPanelOpen:!1,singleSelectSelectedIndex:e.nextPotentialSelectionIndex,singleSelectSelectedOption:f.getSingleSelectSelectedOption(e,e.nextPotentialSelectionIndex)});return f.mergeIsAlteredState(l);case p.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION:case p.SET_OPTIONS_PANEL_CLOSED_ONBLUR:return d({},e,{isOptionsPanelOpen:!1});case p.SET_NEXT_SELECTED_INDEX:return d({},e,{nextPotentialSelectionIndex:t.value});case p.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC:return d({},e,{isOptionsPanelOpen:!0,nextPotentialSelectionIndex:t.value});case p.SET_SINGLESELECT_OPTIONS:var i=d({},e,{nextPotentialSelectionIndex:t.value,singleSelectSelectedIndex:t.value,isOptionsPanelOpen:!1,singleSelectSelectedOption:f.getSingleSelectSelectedOption(e,t.value)});return f.mergeIsAlteredState(i);case p.SET_MULTISELECT_OPTIONS:if(!e.noSelectionLabel){var r=0===e.multiSelectSelectedIndexes[0]&&1===e.multiSelectSelectedIndexes.length,a=0<e.multiSelectSelectedIndexes.length&&!r&&0===t.value,s=r&&0!==t.value;if(a)return f.mergeIsAlteredState(f.getInitialMultiSelectOption(e));s&&(e=f.resetMultiSelectState(e))}e.noSelectionLabel&&e.multiSelectSelectedOptions.options[0].text===e.noSelectionLabel&&(e.multiSelectSelectedOptions.options=[]);var c=S.nextValidIndex(e,t.value),u=e.multiSelectSelectedIndexes.indexOf(c);return 0===(i=d({},e,{nextPotentialSelectionIndex:c,multiSelectSelectedIndexes:-1===u?f.addMultiSelectIndex(e,c):f.removeMultiSelectIndex(e,u),multiSelectSelectedOptions:-1===u?f.addMultiSelectOption(e,c):f.removeMultiSelectOption(e,u)})).multiSelectSelectedOptions.options.length&&(i=e.noSelectionLabel?d({},i,{nextPotentialSelectionIndex:e.hasOptHeaders?S.nextValidIndex(e,-1):-1,multiSelectSelectedOptions:{options:f.getMultiSelectInitialSelectedOptions(e)}}):f.getInitialMultiSelectOption(e)),f.mergeIsAlteredState(i);default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(26);t.addMultiSelectIndex=o.addMultiSelectIndex;var l=n(27);t.addMultiSelectOption=l.addMultiSelectOption;var i=n(28);t.getInitialMultiSelectOption=i.getInitialMultiSelectOption;var r=n(29);t.getMultiSelectInitialSelectedOptions=r.getMultiSelectInitialSelectedOptions;var a=n(30);t.getMultiSelectSelectedValueIndexes=a.getMultiSelectSelectedValueIndexes;var s=n(31);t.getSelectedValueIndex=s.getSelectedValueIndex;var c=n(32);t.getSingleSelectSelectedOption=c.getSingleSelectSelectedOption;var u=n(33);t.mergeIsAlteredState=u.mergeIsAlteredState;var d=n(34);t.removeMultiSelectIndex=d.removeMultiSelectIndex;var p=n(35);t.removeMultiSelectOption=p.removeMultiSelectOption;var S=n(36);t.resetMultiSelectState=S.resetMultiSelectState},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMultiSelectIndex=function(e,t){return e.multiSelectSelectedIndexes.concat([t])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMultiSelectOption=function(e,t){return{options:e.multiSelectSelectedOptions.options.concat([{name:e.name,text:e.options[t].text,value:e.options[t].value}])}}},function(e,t,n){"use strict";var l=this&&this.__assign||function(){return(l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getInitialMultiSelectOption=function(e){var t=function(o){return o.options.reduce(function(e,t,n){return t.optHeader||e.push({option:{value:t.value,text:t.text,name:o.name},index:n}),e},[])[0]}(e),n=t.option,o=t.index;return l({},e,{multiSelectSelectedIndexes:[o],multiSelectSelectedOptions:{options:[l({},n)]},nextPotentialSelectionIndex:o})}},function(e,t,n){"use strict";var l=this&&this.__assign||function(){return(l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getMultiSelectInitialSelectedOptions=function(t,e){var n;if(t.noSelectionLabel)return n=e&&0<e.length?t.options.filter(function(t){return e.some(function(e){return e===t.value})}).map(function(e){return l({name:t.name},e)}):[{name:t.name,text:t.noSelectionLabel,value:"null"}];if(e&&0<e.length)n=t.options.filter(function(t){return e.some(function(e){return e===t.value})}).map(function(e){return l({name:t.name},e)});else{var o=t.options[0]&&t.options[0].optHeader?function(e){if(e.multiSelectSelectedOptions&&e.multiSelectSelectedOptions.options.length)return e.multiSelectSelectedOptions.options[0];var t=e.options.reduce(function(e,t){return t.optHeader||e.push(t),e},[]);return{name:e.name,text:t[0].text,value:t[0].value}}(t):t.options[0];n=[{name:t.name,text:o.text,value:o.value}]}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);t.getMultiSelectSelectedValueIndexes=function(e,o,t){void 0===o&&(o=[]);var n=e.options,l=t?[]:[r.nextValidIndex(e,0)],i=n.reduce(function(e,t,n){return o.some(function(e){return t.value===e})&&e.push(n),e},[]);return 0<i.length?i:l}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedValueIndex=function(e){var t=e.options,n=e.selectedValue,o=e.noSelectionLabel,l=n?t.map(function(e){return e.value}).indexOf(n):-1;return-1<l||o?l:0}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSingleSelectSelectedOption=function(e,t){void 0===t&&(t=0);var n=-1!==t||e.noSelectionLabel?t:0;return e.options[n]&&e.options[n].optHeader?function(e){if(e.singleSelectSelectedOption)return e.singleSelectSelectedOption;var t=e.options.reduce(function(e,t){return t.optHeader||e.push(t),e},[]);return o({},t[0],{name:e.name})}(e):e.noSelectionLabel?-1<t?o({name:e.name},e.options[t]):{name:e.name,text:e.noSelectionLabel,value:"null"}:o({name:e.name},e.options[n])}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};function l(e){return e.multiselect?!(JSON.stringify(e.multiSelectInitialSelectedIndexes)===JSON.stringify(e.multiSelectSelectedIndexes)):e.singleSelectSelectedIndex!==e.singleSelectInitialIndex}Object.defineProperty(t,"__esModule",{value:!0}),t.isAltered=l,t.mergeIsAlteredState=function(e){return o({},e,{altered:l(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMultiSelectIndex=function(e,t){return e.multiSelectSelectedIndexes.slice(0,t).concat(e.multiSelectSelectedIndexes.slice(t+1))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMultiSelectOption=function(e,t){return{options:e.multiSelectSelectedOptions.options.slice(0,t).concat(e.multiSelectSelectedOptions.options.slice(t+1))}}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var l=n(10);t.resetMultiSelectState=function(e){return o({},e,{multiSelectSelectedIndexes:l.initialState.multiSelectSelectedIndexes.slice(),multiSelectSelectedOptions:o({},l.initialState.multiSelectSelectedOptions)})}},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var S=n(1),f=n(2),_=n(38),l=function(n){function e(e){var t=n.call(this,e)||this;return t.optionsButton=S.createRef(),t.optionsContainer=S.createRef(),t}return o(e,n),e.prototype.componentDidUpdate=function(e){var t=this.props,n=t.isOptionsPanelOpen,o=t.selectBoxRef;!n&&e.isOptionsPanelOpen&&o&&o.contains(document.activeElement)&&this.optionsButton.current&&this.optionsButton.current.focus()},e.prototype.getAriaLabel=function(){var e=this.props,t=e.multiSelectSelectedOptions,n=e.prefix,o=t.options.length;return f.default("\n Checkbox group "+(n?n+" ":"")+" has\n "+o+" item"+(1===o?"":"s")+" selected.\n Selected option"+(1===o?"":"s")+" "+(1===o?"is":"are")+"\n "+t.options.map(function(e){return e.text||""}).join(" and ")+"\n ")},e.prototype.render=function(){var n=this,e=this.props,t=e.caretIcon,o=e.customLabelText,l=e.disabled,i=e.isOptionsPanelOpen,r=e.multiSelectSelectedIndexes,a=e.multiSelectSelectedOptions,s=e.name,c=e.options,u=e.nextPotentialSelectionIndex,d=e.prefix,p="";return S.createElement("div",null,S.createElement("div",{role:"button",tabIndex:0,"aria-disabled":l,"aria-haspopup":"true","aria-expanded":i,"aria-controls":"rrs-"+s+"-menu",ref:this.optionsButton,className:f.default("\n rrs__button\n "+(!0===l?"rrs__button--disabled":"")+"\n ")},o&&S.createElement("div",{className:"rrs__label"},S.createElement("span",{"aria-label":this.getAriaLabel(),className:"rrs__label__text",id:"rrs-"+s+"-label","data-testid":"rrs-label_"+s},o),t&&t),!o&&S.createElement("div",{className:"rrs__label"},S.createElement("span",{"aria-label":this.getAriaLabel(),className:"rrs__label__text",id:"rrs-"+s+"-label","data-testid":"rrs-label_"+s},S.createElement("span",{className:"rrs__multiselect-label"},S.createElement("span",{className:"rrs__multiselect-label__text"},(d?d+" ":"")+"\n "+(0<a.options.length?a.options[0].text:"")),1<a.options.length&&S.createElement("span",{className:"rrs__multiselect-label__badge"},"+ "+(a.options.length-1)))),t&&t),s&&S.createElement("input",{type:"hidden",name:s,"data-testid":"rrs-input_"+s,value:[a.options.map(function(e){return e.value})].join(",")})),S.createElement("ul",{id:"rrs-"+s+"-menu","aria-labelledby":"rrs-"+s+"-label",role:"menu",className:"rrs__options",ref:this.optionsContainer},0<c.length&&c.map(function(e,t){return e.optHeader&&(p=e.text||e.markup&&e.markup.textContent||""),S.createElement(_.MultiSelectOption,{key:t,name:s,optHeaderLabel:p,optionsContainerRef:n.optionsContainer,index:t,option:e,isOptionsPanelOpen:i,multiSelectSelectedIndexes:r,nextPotentialSelectionIndex:u})})))},e}(S.Component);t.MultiSelect=l},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),c=n(2),l=function(n){function e(e){var t=n.call(this,e)||this;return t.optionRef=s.createRef(),t}return o(e,n),e.prototype.getScrollOffset=function(){var e=document.querySelector(".rrs__option--header");return Math.ceil(e&&e.getBoundingClientRect().height||0)},e.prototype.componentDidUpdate=function(){var e=this.props,t=e.index,n=e.isOptionsPanelOpen,o=e.nextPotentialSelectionIndex,l=e.optionsContainerRef,i=e.optHeaderLabel;if(t===o&&n&&this.optionRef.current&&l.current&&(this.optionRef.current.focus(),""!==i)){var r=Math.ceil(this.optionRef.current.getBoundingClientRect().top-l.current.getBoundingClientRect().top);this.scrollOffset=this.scrollOffset||this.getScrollOffset(),r<this.scrollOffset&&l.current.scroll(0,Math.floor(l.current.scrollTop-this.scrollOffset))}},e.prototype.isDisabled=function(e){return Boolean(e.disabled||e.optHeader)},e.prototype.render=function(){var e=this.props,t=e.index,n=e.name,o=e.multiSelectSelectedIndexes,l=e.nextPotentialSelectionIndex,i=e.option,r=e.optHeaderLabel,a=o.some(function(e){return e===t});return s.createElement("li",{role:"checkbox","data-testid":"rrs-option_"+n+"_"+t,tabIndex:-1,"aria-checked":a,"aria-label":"\n "+(i.text||i.markup&&i.markup.textContent)+" "+(""!==r?" of "+r:"")+"\n ","aria-live":"assertive","aria-disabled":this.isDisabled(i)?"true":"false","data-key":t,ref:this.optionRef,className:c.default("\n rrs__option\n "+(a?"rrs__option--selected":"")+"\n "+(l===t?"rrs__option--next-selection":"")+"\n "+(!0===i.disabled?"rrs__option--disabled":"")+"\n "+(!0===i.optHeader?"rrs__option--header":"")+"\n ")},i.markup||i.text)},e}(s.Component);t.MultiSelectOption=l},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var d=n(1),p=n(2),S=n(40),l=function(n){function e(e){var t=n.call(this,e)||this;return t.optionsButton=d.createRef(),t.optionsContainer=d.createRef(),t}return o(e,n),e.prototype.componentDidUpdate=function(e){var t=this.props,n=t.isOptionsPanelOpen,o=t.nextPotentialSelectionIndex,l=t.selectBoxRef,i=!n&&e.isOptionsPanelOpen;this.optionsButton.current&&(i&&l&&l.contains(document.activeElement)&&this.optionsButton.current.focus(),n&&-1===o&&this.optionsButton.current.focus())},e.prototype.getCustomLabel=function(){var e=this.props,t=e.prefix,n=e.name,o=e.singleSelectSelectedOption,l=e.caretIcon,i=e.customLabelText;return d.createElement("div",{className:"rrs__label"},d.createElement("span",{"aria-label":(t?t+" ":"")+o.text+" selected",className:"rrs__label__text",id:"rrs-"+n+"-label","data-testid":"rrs-label_"+n},i),l&&l)},e.prototype.getDefaultLabel=function(){var e=this.props,t=e.prefix,n=e.singleSelectSelectedOption,o=e.name,l=e.caretIcon,i=e.singleSelectSelectedIndex,r=e.noSelectionLabel;return-1===i?d.createElement("div",{className:"rrs__label"},d.createElement("span",{"aria-label":r,className:"rrs__label__text",id:"rrs-"+o+"-label","data-testid":"rrs-label_"+o},t&&d.createElement("span",null,t),r),l&&l):d.createElement("div",{className:"rrs__label"},d.createElement("span",{"aria-label":(t?t+" ":"")+n.text+" selected",className:"rrs__label__text",id:"rrs-"+o+"-label","data-testid":"rrs-label_"+o},t&&d.createElement("span",null,t),n.text?n.text:d.createElement("div",null," ")),l&&l)},e.prototype.render=function(){var n=this,e=this.props,t=e.customLabelText,o=e.disabled,l=e.isOptionsPanelOpen,i=e.name,r=e.nextPotentialSelectionIndex,a=e.options,s=e.singleSelectSelectedIndex,c=e.singleSelectSelectedOption,u="";return d.createElement("div",null,d.createElement("div",{role:"button",tabIndex:0,"aria-disabled":o,"aria-haspopup":"true","aria-expanded":l,"aria-controls":"rrs-"+i+"-menu",ref:this.optionsButton,className:p.default("\n rrs__button\n "+(!0===o?"rrs__button--disabled":"")+"\n ")},t?this.getCustomLabel():this.getDefaultLabel(),i&&d.createElement("input",{type:"hidden",name:i,"data-testid":"rrs-input_"+i,value:c.value})),d.createElement("ul",{id:"rrs-"+i+"-menu","aria-labelledby":"rrs-"+i+"-label",role:"menu",className:"rrs__options",ref:this.optionsContainer},0<a.length&&a.map(function(e,t){return e.optHeader&&(u=e.text||e.markup&&e.markup.textContent||""),d.createElement(S.SingleSelectOption,{key:t,name:i,optHeaderLabel:u,optionsContainerRef:n.optionsContainer,index:t,isOptionsPanelOpen:l,option:e,singleSelectSelectedIndex:s,nextPotentialSelectionIndex:r})})))},e}(d.Component);t.SingleSelect=l},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),s=n(2),l=function(n){function e(e){var t=n.call(this,e)||this;return t.optionRef=a.createRef(),t}return o(e,n),e.prototype.getScrollOffset=function(){var e=document.querySelector(".rrs__option--header");return Math.ceil(e&&e.getBoundingClientRect().height||0)},e.prototype.componentDidUpdate=function(){var e=this.props,t=e.index,n=e.isOptionsPanelOpen,o=e.nextPotentialSelectionIndex,l=e.optionsContainerRef,i=e.optHeaderLabel;if(t===o&&n&&this.optionRef.current&&l.current&&(this.optionRef.current.focus(),""!==i)){var r=Math.ceil(this.optionRef.current.getBoundingClientRect().top-l.current.getBoundingClientRect().top);this.scrollOffset=this.scrollOffset||this.getScrollOffset(),r<this.scrollOffset&&l.current.scroll(0,Math.floor(l.current.scrollTop-this.scrollOffset))}},e.prototype.isDisabled=function(e){return Boolean(e.disabled||e.optHeader)},e.prototype.render=function(){var e=this.props,t=e.index,n=e.name,o=e.nextPotentialSelectionIndex,l=e.option,i=e.singleSelectSelectedIndex,r=e.optHeaderLabel;return a.createElement("li",{role:"menuitem","data-testid":"rrs-option_"+n+"_"+t,tabIndex:-1,"aria-disabled":this.isDisabled(l)?"true":"false","aria-label":"\n "+(l.text||l.markup&&l.markup.textContent)+" "+(""!==r?" of "+r:"")+"\n ","data-key":t,ref:this.optionRef,className:s.default("\n rrs__option\n "+(i===t?"rrs__option--selected":"")+"\n "+(o===t?"rrs__option--next-selection":"")+"\n "+(!0===l.disabled?"rrs__option--disabled":"")+"\n "+(!0===l.optHeader?"rrs__option--header":"")+"\n ")},l.markup||l.text)},e}(a.Component);t.SingleSelectOption=l}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("ReactResponsiveSelect",[],t):"object"==typeof exports?exports.ReactResponsiveSelect=t():e.ReactResponsiveSelect=t()}(window,function(){return function(n){var o={};function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}return r.m=n,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INITIALISE="INITIALISE",t.UPDATE_VIA_PROPS="UPDATE_VIA_PROPS",t.SET_IS_DRAGGING="SET_IS_DRAGGING",t.SET_OPTIONS_PANEL_OPEN="SET_OPTIONS_PANEL_OPEN",t.SET_OPTIONS_PANEL_CLOSED="SET_OPTIONS_PANEL_CLOSED",t.SET_SINGLESELECT_OPTIONS="SET_SINGLESELECT_OPTIONS",t.SET_MULTISELECT_OPTIONS="SET_MULTISELECT_OPTIONS",t.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION="SET_OPTIONS_PANEL_CLOSED_NO_SELECTION",t.SET_OPTIONS_PANEL_CLOSED_ONBLUR="SET_OPTIONS_PANEL_CLOSED_ONBLUR",t.SET_NEXT_SELECTED_INDEX="SET_NEXT_SELECTED_INDEX",t.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC="SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC"},function(e,t,n){"use strict";e.exports=n(12)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t?"":" ";return e.replace(/\s\s+/g,n).trim()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function o(){var n=[];return function(e,t){if("object"==typeof t&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t}}t.isEqual=function(e,t){return JSON.stringify(e,o())===JSON.stringify(t,o())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextValidIndex=function(e,t,n){void 0===n&&(n="INCREMENT");var o=e.options,r=o.reduce(function(e,t,n){return t.optHeader||e.push(n),e},[]),l=-1===r.indexOf(t);return l&&"INCREMENT"===n?o[t+1]&&!o[t+1].optHeader?t+1:r[0]:l&&"DECREMENT"===n?o[t-1]&&!o[t-1].optHeader?t-1:r[r.length-1]:t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);t.handleAlphaNumerical=function(e){var t=e.event,n=e.state,o=e.ReactResponsiveSelectClassRef,r=n.options;if(!n.disabled){var l=r.map(function(e){return!e.optHeader&&!e.disabled&&(e.text||"").toLowerCase().charAt(0)}).indexOf(t.key);-1<l&&o.updateState({value:l,type:i.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(16);t.multiSelectBroadcastChange=o.multiSelectBroadcastChange;var r=n(17);t.singleSelectBroadcastChange=r.singleSelectBroadcastChange},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),p=n(18);t.handleClick=function(e){var t=e.event,n=e.state,o=e.ReactResponsiveSelectClassRef,r=n.multiselect,l=n.isOptionsPanelOpen,i=n.isDragging,a=n.disabled,s=n.options;if(!a&&!1===i){if(t.preventDefault(),t&&p.containsClassName(t.target,"rrs__options"))return;var c=parseFloat(t.target.getAttribute("data-key"));if(s[c]&&!0===s[c].disabled||s[c]&&!0===s[c].optHeader)return;if(p.containsClassName(t.target,"rrs__option"))return void o.updateState({type:r?u.SET_MULTISELECT_OPTIONS:u.SET_SINGLESELECT_OPTIONS,value:c});if(l&&(p.containsClassName(t.target,"rrs__label")||p.containsClassName(t.target,"rrs")))return void o.updateState({type:u.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION},function(){return o.focusButton()});o.updateState({type:l?u.SET_OPTIONS_PANEL_CLOSED:u.SET_OPTIONS_PANEL_OPEN},function(e){!1===e.isOptionsPanelOpen&&o.focusButton()})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var p=n(0);t.handleEnterPressed=function(e){var t=e.event,n=e.state,o=e.props,r=e.ReactResponsiveSelectClassRef,l=n.disabled,i=n.isOptionsPanelOpen,a=n.multiselect,s=n.nextPotentialSelectionIndex,c=n.options;if(!l){var u=parseFloat(t.target.getAttribute("data-key"));c[u]&&!0===c[u].disabled||c[u]&&!0===c[u].optHeader||(a?r.updateState({type:p.SET_MULTISELECT_OPTIONS,value:s}):r.updateState({type:p.SET_SINGLESELECT_OPTIONS,value:s}),i?t.stopPropagation():o.onSubmit&&o.onSubmit(t))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),i=n(22);t.handleKeyUpOrDownPressed=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=e.type,r=t.isOptionsPanelOpen;t.disabled||(n.updateState({type:l.SET_NEXT_SELECTED_INDEX,value:i.getNextIndex(o,t)}),!1===r&&n.updateState({type:l.SET_OPTIONS_PANEL_OPEN}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState={multiselect:!1,name:"",options:[],isDragging:!1,isOptionsPanelOpen:!1,altered:!1,singleSelectInitialIndex:0,singleSelectSelectedIndex:0,singleSelectSelectedOption:{},nextPotentialSelectionIndex:0,multiSelectInitialSelectedIndexes:[0],multiSelectSelectedOptions:{altered:!1,options:[]},multiSelectSelectedIndexes:[]}},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var E=n(1),y=n(2),s=n(0),l=n(14),b=n(25),c=n(6),i=n(10),a=n(26),u=n(3),x=n(39),I=n(41),p=function(n){function e(e){var t=n.call(this,e)||this;return t.onHandleKeyEvent=function(e){l.handleKeyEvent({event:e,ReactResponsiveSelectClassRef:t,state:t.state,props:t.props})},t.onHandleTouchStart=function(){l.handleTouchStart({ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleTouchMove=function(){l.handleTouchMove({ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleClick=function(e){l.handleClick({event:e,ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleBlur=function(){l.handleBlur({ReactResponsiveSelectClassRef:t,state:t.state,props:t.props})},t.state=i.initialState,t.reducer=a.reducer,t.firstLoad=!0,t}return o(e,n),e.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.noSelectionLabel,o=e.selectedValue,r=e.selectedValues,l=e.name,i=e.multiselect,a=e.disabled;this.updateState({type:s.INITIALISE,value:{options:t,noSelectionLabel:n,selectedValue:o,selectedValues:r,name:l,multiselect:i,disabled:a}})},e.prototype.componentWillReceiveProps=function(e){u.isEqual(e,this.props)||this.updateState({type:s.UPDATE_VIA_PROPS,value:r({},this.props,e)})},e.prototype.componentDidUpdate=function(e,t){var n=this.state,o=n.singleSelectSelectedOption,r=n.multiSelectSelectedOptions,l=n.multiselect,i=n.altered,a=this.props.onChange;return this.firstLoad?this.firstLoad=!1:(l?c.multiSelectBroadcastChange(r.options,Boolean(i),a,t.multiSelectSelectedOptions.options):c.singleSelectBroadcastChange(o,Boolean(i),a,t.singleSelectSelectedOption),!0)},e.prototype.updateState=function(t,e){var n=this.props,o=n.onListen,r=n.name,l=this.reducer(this.state,t);this.setState(l,function(){e&&e(l)}),o&&o([s.SET_OPTIONS_PANEL_OPEN,s.SET_NEXT_SELECTED_INDEX,s.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC,s.SET_IS_DRAGGING].some(function(e){return t.type===e}),r,t.type)},e.prototype.focusButton=function(){var e=this.selectBox&&this.selectBox.querySelector(".rrs__button");e&&e.focus()},e.prototype.render=function(){var t=this,e=this.props,n=e.prefix,o=e.caretIcon,r=e.disabled,l=this.state,i=l.altered,a=l.hasOptHeaders,s=l.isOptionsPanelOpen,c=l.isDragging,u=l.noSelectionLabel,p=l.multiSelectSelectedIndexes,d=l.multiSelectSelectedOptions,f=l.name,S=l.nextPotentialSelectionIndex,_=l.options,v=l.singleSelectSelectedIndex,O=l.singleSelectSelectedOption,m=l.multiselect,h=b.getCustomLabelText({props:this.props,state:this.state});return E.createElement("div",{"data-testid":f,"data-name":f,className:y.default("\n rrs\n "+(!0===s?"rrs--options-visible":"")+"\n "+(i?"rrs--has-changed":"")+"\n "+(a?"rrs--has-opt-headers":"")+"\n "),ref:function(e){t.selectBox=e},tabIndex:-1,onKeyDown:this.onHandleKeyEvent,onTouchStart:this.onHandleTouchStart,onTouchMove:this.onHandleTouchMove,onTouchEnd:this.onHandleClick,onMouseDown:this.onHandleClick,onBlur:this.onHandleBlur},m?E.createElement(x.MultiSelect,{disabled:Boolean(r),isDragging:c,caretIcon:o,customLabelText:h,prefix:n||"",name:f,multiSelectSelectedOptions:d,multiSelectSelectedIndexes:p,nextPotentialSelectionIndex:S,isOptionsPanelOpen:s,options:_,selectBoxRef:this.selectBox}):E.createElement(I.SingleSelect,{noSelectionLabel:u||"",disabled:Boolean(r),caretIcon:o,prefix:n||"",name:f,customLabelText:h,singleSelectSelectedOption:O,singleSelectSelectedIndex:v,nextPotentialSelectionIndex:S,isOptionsPanelOpen:s,options:_,selectBoxRef:this.selectBox}))},e}(E.Component);t.default=p},function(e,t,n){"use strict";var u=n(13),o="function"==typeof Symbol&&Symbol.for,p=o?Symbol.for("react.element"):60103,c=o?Symbol.for("react.portal"):60106,r=o?Symbol.for("react.fragment"):60107,l=o?Symbol.for("react.strict_mode"):60108,i=o?Symbol.for("react.profiler"):60114,a=o?Symbol.for("react.provider"):60109,s=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.concurrent_mode"):60111,f=o?Symbol.for("react.forward_ref"):60112,S=o?Symbol.for("react.suspense"):60113,_=o?Symbol.for("react.memo"):60115,v=o?Symbol.for("react.lazy"):60116,O="function"==typeof Symbol&&Symbol.iterator;function m(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;o<t;o++)n+="&args[]="+encodeURIComponent(arguments[o+1]);!function(e,t,n,o,r,l,i,a){if(!e){if((e=void 0)===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,o,r,l,i,a],c=0;(e=Error(t.replace(/%s/g,function(){return s[c++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E={};function y(e,t,n){this.props=e,this.context=t,this.refs=E,this.updater=n||h}function b(){}function x(e,t,n){this.props=e,this.context=t,this.refs=E,this.updater=n||h}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&m("85"),this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=y.prototype;var I=x.prototype=new b;I.constructor=x,u(I,y.prototype),I.isPureReactComponent=!0;var g={current:null},P={current:null},N=Object.prototype.hasOwnProperty,T={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,n){var o=void 0,r={},l=null,i=null;if(null!=t)for(o in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(l=""+t.key),t)N.call(t,o)&&!T.hasOwnProperty(o)&&(r[o]=t[o]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps)void 0===r[o]&&(r[o]=a[o]);return{$$typeof:p,type:e,key:l,ref:i,props:r,_owner:P.current}}function R(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var L=/\/+/g,M=[];function j(e,t,n,o){if(M.length){var r=M.pop();return r.result=e,r.keyPrefix=t,r.func=n,r.context=o,r.count=0,r}return{result:e,keyPrefix:t,func:n,context:o,count:0}}function A(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,M.length<10&&M.push(e)}function D(e,t,n){return null==e?0:function e(t,n,o,r){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var i=!1;if(null===t)i=!0;else switch(l){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case p:case c:i=!0}}if(i)return o(r,t,""===n?"."+k(t,0):n),1;if(i=0,n=""===n?".":n+":",Array.isArray(t))for(var a=0;a<t.length;a++){var s=n+k(l=t[a],a);i+=e(l,s,o,r)}else if("function"==typeof(s=null===t||"object"!=typeof t?null:"function"==typeof(s=O&&t[O]||t["@@iterator"])?s:null))for(t=s.call(t),a=0;!(l=t.next()).done;)i+=e(l=l.value,s=n+k(l,a++),o,r);else"object"===l&&m("31","[object Object]"==(o=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":o,"");return i}(e,"",t,n)}function k(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function B(e,t){e.func.call(e.context,t,e.count++)}function w(e,t,n){var o=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?H(e,o,n,function(e){return e}):null!=e&&(R(e)&&(e=function(e,t){return{$$typeof:p,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(L,"$&/")+"/")+n)),o.push(e))}function H(e,t,n,o,r){var l="";null!=n&&(l=(""+n).replace(L,"$&/")+"/"),D(e,w,t=j(t,l,o,r)),A(t)}function U(){var e=g.current;return null===e&&m("321"),e}var V={Children:{map:function(e,t,n){if(null==e)return e;var o=[];return H(e,o,null,t,n),o},forEach:function(e,t,n){if(null==e)return e;D(e,B,t=j(null,null,t,n)),A(t)},count:function(e){return D(e,function(){return null},null)},toArray:function(e){var t=[];return H(e,t,null,function(e){return e}),t},only:function(e){return R(e)||m("143"),e}},createRef:function(){return{current:null}},Component:y,PureComponent:x,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:f,render:e}},lazy:function(e){return{$$typeof:v,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:_,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return U().useCallback(e,t)},useContext:function(e,t){return U().useContext(e,t)},useEffect:function(e,t){return U().useEffect(e,t)},useImperativeHandle:function(e,t,n){return U().useImperativeHandle(e,t,n)},useDebugValue:function(){},useLayoutEffect:function(e,t){return U().useLayoutEffect(e,t)},useMemo:function(e,t){return U().useMemo(e,t)},useReducer:function(e,t,n){return U().useReducer(e,t,n)},useRef:function(e){return U().useRef(e)},useState:function(e){return U().useState(e)},Fragment:r,StrictMode:l,Suspense:S,createElement:C,cloneElement:function(e,t,n){null==e&&m("267",e);var o=void 0,r=u({},e.props),l=e.key,i=e.ref,a=e._owner;if(null!=t){void 0!==t.ref&&(i=t.ref,a=P.current),void 0!==t.key&&(l=""+t.key);var s=void 0;for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)N.call(t,o)&&!T.hasOwnProperty(o)&&(r[o]=void 0===t[o]&&void 0!==s?s[o]:t[o])}if(1===(o=arguments.length-2))r.children=n;else if(1<o){s=Array(o);for(var c=0;c<o;c++)s[c]=arguments[c+2];r.children=s}return{$$typeof:p,type:e.type,key:l,ref:i,props:r,_owner:a}},createFactory:function(e){var t=C.bind(null,e);return t.type=e,t},isValidElement:R,version:"16.8.5",unstable_ConcurrentMode:d,unstable_Profiler:i,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:g,ReactCurrentOwner:P,assign:u}},$=V;e.exports=$.default||$},function(e,t,n){"use strict";var s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,r=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var i in n=Object(arguments[l]))c.call(n,i)&&(r[i]=n[i]);if(s){o=s(n);for(var a=0;a<o.length;a++)u.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(5);t.handleAlphaNumerical=o.handleAlphaNumerical;var r=n(15);t.handleBlur=r.handleBlur;var l=n(7);t.handleClick=l.handleClick;var i=n(8);t.handleEnterPressed=i.handleEnterPressed;var a=n(19);t.handleKeyEvent=a.handleKeyEvent;var s=n(9);t.handleKeyUpOrDownPressed=s.handleKeyUpOrDownPressed;var c=n(23);t.handleTouchMove=c.handleTouchMove;var u=n(24);t.handleTouchStart=u.handleTouchStart},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=n(0),f=n(6);t.handleBlur=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=e.props,r=t.isOptionsPanelOpen,l=t.disabled,i=t.altered,a=t.singleSelectSelectedOption,s=t.multiSelectSelectedOptions,c=o.onBlur,u=o.multiselect;if(!l){var p=n.selectBox&&!n.selectBox.contains(document.activeElement);r&&p&&n.updateState({type:d.SET_OPTIONS_PANEL_CLOSED_ONBLUR}),p&&c&&(u?f.multiSelectBroadcastChange(s.options,Boolean(i),c):f.singleSelectBroadcastChange(a,Boolean(i),c))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.multiSelectBroadcastChange=function(e,t,n,o){n&&(o&&r.isEqual(o,e)||n({options:e.map(function(e){return{name:e.name||"",text:e.text||"",value:e.value||""}}),altered:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.singleSelectBroadcastChange=function(e,t,n,o){n&&(r.isEqual(o,e)||n({name:e.name,text:e.text,value:e.value,altered:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containsClassName=function(e,t){return-1<String(e.className).split(" ").indexOf(t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=n(20),c=n(21),u=n(5),p=n(7),d=n(8),f=n(9);t.handleKeyEvent=function(e){var t=e.event,n=e.state,o=e.props,r=e.ReactResponsiveSelectClassRef,l=n.multiselect,i=n.isOptionsPanelOpen;if(!n.disabled)switch(c.preventDefaultForKeyCodes([s.keyCodes.ENTER,s.keyCodes.SPACE,s.keyCodes.ESCAPE,s.keyCodes.UP,s.keyCodes.DOWN],t),/^[a-z0-9]+$/.test(t.key)&&u.handleAlphaNumerical({event:t,ReactResponsiveSelectClassRef:r,state:n}),t.keyCode){case s.keyCodes.TAB:i&&(t.preventDefault(),l&&r.updateState({type:a.SET_OPTIONS_PANEL_CLOSED},function(){return r.focusButton()}));break;case s.keyCodes.ENTER:d.handleEnterPressed({ReactResponsiveSelectClassRef:r,event:t,props:o,state:n});break;case s.keyCodes.SPACE:i?p.handleClick({event:t,state:n,ReactResponsiveSelectClassRef:r}):r.updateState({type:a.SET_OPTIONS_PANEL_OPEN});break;case s.keyCodes.ESCAPE:r.updateState({type:a.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION},function(){return r.focusButton()});break;case s.keyCodes.UP:f.handleKeyUpOrDownPressed({ReactResponsiveSelectClassRef:r,state:n,type:"DECREMENT"});break;case s.keyCodes.DOWN:f.handleKeyUpOrDownPressed({ReactResponsiveSelectClassRef:r,state:n,type:"INCREMENT"})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyCodes={TAB:9,ENTER:13,SPACE:32,ESCAPE:27,UP:38,DOWN:40}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultForKeyCodes=function(e,t){e.forEach(function(e){e===t.keyCode&&t.preventDefault()})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(4);t.getNextIndex=function(e,t){var n=t.isOptionsPanelOpen,o=t.nextPotentialSelectionIndex,r=t.options;switch(e){case"INCREMENT":return!1===n?l.nextValidIndex(t,o,"INCREMENT"):o===r.length-1?l.nextValidIndex(t,0,"INCREMENT"):l.nextValidIndex(t,o+1,"INCREMENT");case"DECREMENT":return!1===n?l.nextValidIndex(t,o,"DECREMENT"):0===o?l.nextValidIndex(t,r.length-1,"DECREMENT"):l.nextValidIndex(t,o-1,"DECREMENT");default:return l.nextValidIndex(t,0,"DECREMENT")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.handleTouchMove=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=t.isDragging;t.disabled||o||n.updateState({type:r.SET_IS_DRAGGING,value:!0})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.handleTouchStart=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef;t.disabled||n.updateState({type:o.SET_IS_DRAGGING,value:!1})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCustomLabelText=function(e){var t=e.state,n=e.props,o=n.multiselect,r=n.customLabelRenderer,l=t.multiSelectSelectedOptions,i=t.singleSelectSelectedOption;return!!r&&r(o?l:i)}},function(e,t,n){"use strict";var p=this&&this.__assign||function(){return(p=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var d=n(0),f=n(4),S=n(27);t.reducer=function(e,t){switch(t.type){case d.UPDATE_VIA_PROPS:case d.INITIALISE:var n=S.getSelectedValueIndex(t.value),o=S.getMultiSelectSelectedValueIndexes(t.value,t.value.selectedValues,t.value.noSelectionLabel);return p({},e,{hasOptHeaders:t.value.options.some(function(e){return!0===e.optHeader}),multiselect:t.value.multiselect||!1,noSelectionLabel:t.value.noSelectionLabel,name:t.value.name,options:t.value.options,altered:t.value.altered||!1,disabled:t.value.disabled||!1,singleSelectInitialIndex:n,singleSelectSelectedIndex:n,singleSelectSelectedOption:S.getSingleSelectSelectedOption(t.value,n),nextPotentialSelectionIndex:e.nextPotentialSelectionIndex?e.nextPotentialSelectionIndex:n,multiSelectInitialSelectedIndexes:o,multiSelectSelectedIndexes:o,multiSelectSelectedOptions:{options:S.getMultiSelectInitialSelectedOptions(t.value,t.value.selectedValues)}});case d.SET_IS_DRAGGING:return p({},e,{isDragging:t.value});case d.SET_OPTIONS_PANEL_OPEN:var r=p({},e,{isOptionsPanelOpen:!0,nextPotentialSelectionIndex:function(){return e.multiselect?e.multiSelectSelectedIndexes.length?f.nextValidIndex(e,e.multiSelectSelectedIndexes[0]):f.nextValidIndex(e,0):f.nextValidIndex(e,e.nextPotentialSelectionIndex)}(),singleSelectSelectedOption:S.getSingleSelectSelectedOption(e,e.nextPotentialSelectionIndex)});return S.mergeIsAlteredState(r);case d.SET_OPTIONS_PANEL_CLOSED:r=p({},e,{isOptionsPanelOpen:!1,singleSelectSelectedIndex:e.nextPotentialSelectionIndex,singleSelectSelectedOption:S.getSingleSelectSelectedOption(e,e.nextPotentialSelectionIndex)});return S.mergeIsAlteredState(r);case d.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION:case d.SET_OPTIONS_PANEL_CLOSED_ONBLUR:return p({},e,{isOptionsPanelOpen:!1});case d.SET_NEXT_SELECTED_INDEX:return p({},e,{nextPotentialSelectionIndex:t.value});case d.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC:return p({},e,{isOptionsPanelOpen:!0,nextPotentialSelectionIndex:t.value});case d.SET_SINGLESELECT_OPTIONS:var l=p({},e,{nextPotentialSelectionIndex:t.value,singleSelectSelectedIndex:t.value,isOptionsPanelOpen:!1,singleSelectSelectedOption:S.getSingleSelectSelectedOption(e,t.value)});return S.mergeIsAlteredState(l);case d.SET_MULTISELECT_OPTIONS:if(!e.noSelectionLabel){var i=0===e.multiSelectSelectedIndexes[0]&&1===e.multiSelectSelectedIndexes.length,a=0<e.multiSelectSelectedIndexes.length&&!i&&0===t.value,s=i&&0!==t.value;if(a)return S.mergeIsAlteredState(S.getInitialMultiSelectOption(e));s&&(e=S.resetMultiSelectState(e))}e.noSelectionLabel&&e.multiSelectSelectedOptions.options[0].text===e.noSelectionLabel&&(e.multiSelectSelectedOptions.options=[]);var c=f.nextValidIndex(e,t.value),u=e.multiSelectSelectedIndexes.indexOf(c);return 0===(l=p({},e,{nextPotentialSelectionIndex:c,multiSelectSelectedIndexes:-1===u?S.addMultiSelectIndex(e,c):S.removeMultiSelectIndex(e,u),multiSelectSelectedOptions:-1===u?S.addMultiSelectOption(e,c):S.removeMultiSelectOption(e,u)})).multiSelectSelectedOptions.options.length&&(l=e.noSelectionLabel?p({},l,{nextPotentialSelectionIndex:e.hasOptHeaders?f.nextValidIndex(e,-1):-1,multiSelectSelectedOptions:{options:S.getMultiSelectInitialSelectedOptions(e)}}):S.getInitialMultiSelectOption(e)),S.mergeIsAlteredState(l);default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(28);t.addMultiSelectIndex=o.addMultiSelectIndex;var r=n(29);t.addMultiSelectOption=r.addMultiSelectOption;var l=n(30);t.getInitialMultiSelectOption=l.getInitialMultiSelectOption;var i=n(31);t.getMultiSelectInitialSelectedOptions=i.getMultiSelectInitialSelectedOptions;var a=n(32);t.getMultiSelectSelectedValueIndexes=a.getMultiSelectSelectedValueIndexes;var s=n(33);t.getSelectedValueIndex=s.getSelectedValueIndex;var c=n(34);t.getSingleSelectSelectedOption=c.getSingleSelectSelectedOption;var u=n(35);t.mergeIsAlteredState=u.mergeIsAlteredState;var p=n(36);t.removeMultiSelectIndex=p.removeMultiSelectIndex;var d=n(37);t.removeMultiSelectOption=d.removeMultiSelectOption;var f=n(38);t.resetMultiSelectState=f.resetMultiSelectState},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMultiSelectIndex=function(e,t){return e.multiSelectSelectedIndexes.concat([t])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMultiSelectOption=function(e,t){return{options:e.multiSelectSelectedOptions.options.concat([{name:e.name,text:e.options[t].text,value:e.options[t].value}])}}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getInitialMultiSelectOption=function(e){var t=function(o){return o.options.reduce(function(e,t,n){return t.optHeader||e.push({option:{value:t.value,text:t.text,name:o.name},index:n}),e},[])[0]}(e),n=t.option,o=t.index;return r({},e,{multiSelectSelectedIndexes:[o],multiSelectSelectedOptions:{options:[r({},n)]},nextPotentialSelectionIndex:o})}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getMultiSelectInitialSelectedOptions=function(t,e){var n;if(t.noSelectionLabel)return n=e&&0<e.length?t.options.filter(function(t){return e.some(function(e){return e===t.value})}).map(function(e){return r({name:t.name},e)}):[{name:t.name,text:t.noSelectionLabel,value:"null"}];if(e&&0<e.length)n=t.options.filter(function(t){return e.some(function(e){return e===t.value})}).map(function(e){return r({name:t.name},e)});else{var o=t.options[0]&&t.options[0].optHeader?function(e){if(e.multiSelectSelectedOptions&&e.multiSelectSelectedOptions.options.length)return e.multiSelectSelectedOptions.options[0];var t=e.options.reduce(function(e,t){return t.optHeader||e.push(t),e},[]);return{name:e.name,text:t[0].text,value:t[0].value}}(t):t.options[0];n=[{name:t.name,text:o.text,value:o.value}]}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4);t.getMultiSelectSelectedValueIndexes=function(e,o,t){void 0===o&&(o=[]);var n=e.options,r=t?[]:[i.nextValidIndex(e,0)],l=n.reduce(function(e,t,n){return o.some(function(e){return t.value===e})&&e.push(n),e},[]);return 0<l.length?l:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedValueIndex=function(e){var t=e.options,n=e.selectedValue,o=e.noSelectionLabel,r=n?t.map(function(e){return e.value}).indexOf(n):-1;return-1<r||o?r:0}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSingleSelectSelectedOption=function(e,t){void 0===t&&(t=0);var n=-1!==t||e.noSelectionLabel?t:0;return e.options[n]&&e.options[n].optHeader?function(e){if(e.singleSelectSelectedOption)return e.singleSelectSelectedOption;var t=e.options.reduce(function(e,t){return t.optHeader||e.push(t),e},[]);return o({},t[0],{name:e.name})}(e):e.noSelectionLabel?-1<t?o({name:e.name},e.options[t]):{name:e.name,text:e.noSelectionLabel,value:"null"}:o({name:e.name},e.options[n])}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function r(e){return e.multiselect?!(JSON.stringify(e.multiSelectInitialSelectedIndexes)===JSON.stringify(e.multiSelectSelectedIndexes)):e.singleSelectSelectedIndex!==e.singleSelectInitialIndex}Object.defineProperty(t,"__esModule",{value:!0}),t.isAltered=r,t.mergeIsAlteredState=function(e){return o({},e,{altered:r(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMultiSelectIndex=function(e,t){return e.multiSelectSelectedIndexes.slice(0,t).concat(e.multiSelectSelectedIndexes.slice(t+1))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMultiSelectOption=function(e,t){return{options:e.multiSelectSelectedOptions.options.slice(0,t).concat(e.multiSelectSelectedOptions.options.slice(t+1))}}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var r=n(10);t.resetMultiSelectState=function(e){return o({},e,{multiSelectSelectedIndexes:r.initialState.multiSelectSelectedIndexes.slice(),multiSelectSelectedOptions:o({},r.initialState.multiSelectSelectedOptions)})}},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var f=n(1),S=n(2),_=n(40),r=function(n){function e(e){var t=n.call(this,e)||this;return t.optionsButton=f.createRef(),t.optionsContainer=f.createRef(),t}return o(e,n),e.prototype.componentDidUpdate=function(e){var t=this.props,n=t.isOptionsPanelOpen,o=t.selectBoxRef;!n&&e.isOptionsPanelOpen&&o&&o.contains(document.activeElement)&&this.optionsButton.current&&this.optionsButton.current.focus()},e.prototype.getAriaLabel=function(){var e=this.props,t=e.multiSelectSelectedOptions,n=e.prefix,o=t.options.length;return S.default("\n Checkbox group "+(n?n+" ":"")+" has\n "+o+" item"+(1===o?"":"s")+" selected.\n Selected option"+(1===o?"":"s")+" "+(1===o?"is":"are")+"\n "+t.options.map(function(e){return e.text||""}).join(" and ")+"\n ")},e.prototype.render=function(){var n=this,e=this.props,t=e.caretIcon,o=e.customLabelText,r=e.disabled,l=e.isOptionsPanelOpen,i=e.multiSelectSelectedIndexes,a=e.multiSelectSelectedOptions,s=e.name,c=e.options,u=e.nextPotentialSelectionIndex,p=e.prefix,d="";return f.createElement("div",null,f.createElement("div",{role:"button",tabIndex:0,"aria-disabled":r,"aria-haspopup":"true","aria-expanded":l,"aria-controls":"rrs-"+s+"-menu",ref:this.optionsButton,className:S.default("\n rrs__button\n "+(!0===r?"rrs__button--disabled":"")+"\n ")},o&&f.createElement("div",{className:"rrs__label"},f.createElement("span",{"aria-label":this.getAriaLabel(),className:"rrs__label__text",id:"rrs-"+s+"-label","data-testid":"rrs-label_"+s},o),t&&t),!o&&f.createElement("div",{className:"rrs__label"},f.createElement("span",{"aria-label":this.getAriaLabel(),className:"rrs__label__text",id:"rrs-"+s+"-label","data-testid":"rrs-label_"+s},f.createElement("span",{className:"rrs__multiselect-label"},f.createElement("span",{className:"rrs__multiselect-label__text"},(p?p+" ":"")+"\n "+(0<a.options.length?a.options[0].text:"")),1<a.options.length&&f.createElement("span",{className:"rrs__multiselect-label__badge"},"+ "+(a.options.length-1)))),t&&t),s&&f.createElement("input",{type:"hidden",name:s,"data-testid":"rrs-input_"+s,value:[a.options.map(function(e){return e.value})].join(",")})),f.createElement("ul",{id:"rrs-"+s+"-menu","aria-labelledby":"rrs-"+s+"-label",role:"menu",className:"rrs__options",ref:this.optionsContainer},0<c.length&&c.map(function(e,t){return e.optHeader&&(d=e.text||e.markup&&e.markup.textContent||""),f.createElement(_.MultiSelectOption,{key:t,name:s,optHeaderLabel:d,optionsContainerRef:n.optionsContainer,index:t,option:e,isOptionsPanelOpen:l,multiSelectSelectedIndexes:i,nextPotentialSelectionIndex:u})})))},e}(f.Component);t.MultiSelect=r},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),c=n(2),r=function(n){function e(e){var t=n.call(this,e)||this;return t.optionRef=s.createRef(),t}return o(e,n),e.prototype.getScrollOffset=function(){var e=document.querySelector(".rrs__option--header");return Math.ceil(e&&e.getBoundingClientRect().height||0)},e.prototype.componentDidUpdate=function(){var e=this.props,t=e.index,n=e.isOptionsPanelOpen,o=e.nextPotentialSelectionIndex,r=e.optionsContainerRef,l=e.optHeaderLabel;if(t===o&&n&&this.optionRef.current&&r.current&&(this.optionRef.current.focus(),""!==l)){var i=Math.ceil(this.optionRef.current.getBoundingClientRect().top-r.current.getBoundingClientRect().top);this.scrollOffset=this.scrollOffset||this.getScrollOffset(),i<this.scrollOffset&&r.current.scroll(0,Math.floor(r.current.scrollTop-this.scrollOffset))}},e.prototype.isDisabled=function(e){return Boolean(e.disabled||e.optHeader)},e.prototype.render=function(){var e=this.props,t=e.index,n=e.name,o=e.multiSelectSelectedIndexes,r=e.nextPotentialSelectionIndex,l=e.option,i=e.optHeaderLabel,a=o.some(function(e){return e===t});return s.createElement("li",{role:"checkbox","data-testid":"rrs-option_"+n+"_"+t,tabIndex:-1,"aria-checked":a,"aria-label":"\n "+(l.text||l.markup&&l.markup.textContent)+" "+(""!==i?" of "+i:"")+"\n ","aria-live":"assertive","aria-disabled":this.isDisabled(l)?"true":"false","data-key":t,ref:this.optionRef,className:c.default("\n rrs__option\n "+(a?"rrs__option--selected":"")+"\n "+(r===t?"rrs__option--next-selection":"")+"\n "+(!0===l.disabled?"rrs__option--disabled":"")+"\n "+(!0===l.optHeader?"rrs__option--header":"")+"\n ")},l.markup||l.text)},e}(s.Component);t.MultiSelectOption=r},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var p=n(1),d=n(2),f=n(42),r=function(n){function e(e){var t=n.call(this,e)||this;return t.optionsButton=p.createRef(),t.optionsContainer=p.createRef(),t}return o(e,n),e.prototype.componentDidUpdate=function(e){var t=this.props,n=t.isOptionsPanelOpen,o=t.nextPotentialSelectionIndex,r=t.selectBoxRef,l=!n&&e.isOptionsPanelOpen;this.optionsButton.current&&(l&&r&&r.contains(document.activeElement)&&this.optionsButton.current.focus(),n&&-1===o&&this.optionsButton.current.focus())},e.prototype.getCustomLabel=function(){var e=this.props,t=e.prefix,n=e.name,o=e.singleSelectSelectedOption,r=e.caretIcon,l=e.customLabelText;return p.createElement("div",{className:"rrs__label"},p.createElement("span",{"aria-label":(t?t+" ":"")+o.text+" selected",className:"rrs__label__text",id:"rrs-"+n+"-label","data-testid":"rrs-label_"+n},l),r&&r)},e.prototype.getDefaultLabel=function(){var e=this.props,t=e.prefix,n=e.singleSelectSelectedOption,o=e.name,r=e.caretIcon,l=e.singleSelectSelectedIndex,i=e.noSelectionLabel;return-1===l?p.createElement("div",{className:"rrs__label"},p.createElement("span",{"aria-label":i,className:"rrs__label__text",id:"rrs-"+o+"-label","data-testid":"rrs-label_"+o},t&&p.createElement("span",null,t),i),r&&r):p.createElement("div",{className:"rrs__label"},p.createElement("span",{"aria-label":(t?t+" ":"")+n.text+" selected",className:"rrs__label__text",id:"rrs-"+o+"-label","data-testid":"rrs-label_"+o},t&&p.createElement("span",null,t),n.text?n.text:p.createElement("div",null," ")),r&&r)},e.prototype.render=function(){var n=this,e=this.props,t=e.customLabelText,o=e.disabled,r=e.isOptionsPanelOpen,l=e.name,i=e.nextPotentialSelectionIndex,a=e.options,s=e.singleSelectSelectedIndex,c=e.singleSelectSelectedOption,u="";return p.createElement("div",null,p.createElement("div",{role:"button",tabIndex:0,"aria-disabled":o,"aria-haspopup":"true","aria-expanded":r,"aria-controls":"rrs-"+l+"-menu",ref:this.optionsButton,className:d.default("\n rrs__button\n "+(!0===o?"rrs__button--disabled":"")+"\n ")},t?this.getCustomLabel():this.getDefaultLabel(),l&&p.createElement("input",{type:"hidden",name:l,"data-testid":"rrs-input_"+l,value:c.value})),p.createElement("ul",{id:"rrs-"+l+"-menu","aria-labelledby":"rrs-"+l+"-label",role:"menu",className:"rrs__options",ref:this.optionsContainer},0<a.length&&a.map(function(e,t){return e.optHeader&&(u=e.text||e.markup&&e.markup.textContent||""),p.createElement(f.SingleSelectOption,{key:t,name:l,optHeaderLabel:u,optionsContainerRef:n.optionsContainer,index:t,isOptionsPanelOpen:r,option:e,singleSelectSelectedIndex:s,nextPotentialSelectionIndex:i})})))},e}(p.Component);t.SingleSelect=r},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),s=n(2),r=function(n){function e(e){var t=n.call(this,e)||this;return t.optionRef=a.createRef(),t}return o(e,n),e.prototype.getScrollOffset=function(){var e=document.querySelector(".rrs__option--header");return Math.ceil(e&&e.getBoundingClientRect().height||0)},e.prototype.componentDidUpdate=function(){var e=this.props,t=e.index,n=e.isOptionsPanelOpen,o=e.nextPotentialSelectionIndex,r=e.optionsContainerRef,l=e.optHeaderLabel;if(t===o&&n&&this.optionRef.current&&r.current&&(this.optionRef.current.focus(),""!==l)){var i=Math.ceil(this.optionRef.current.getBoundingClientRect().top-r.current.getBoundingClientRect().top);this.scrollOffset=this.scrollOffset||this.getScrollOffset(),i<this.scrollOffset&&r.current.scroll(0,Math.floor(r.current.scrollTop-this.scrollOffset))}},e.prototype.isDisabled=function(e){return Boolean(e.disabled||e.optHeader)},e.prototype.render=function(){var e=this.props,t=e.index,n=e.name,o=e.nextPotentialSelectionIndex,r=e.option,l=e.singleSelectSelectedIndex,i=e.optHeaderLabel;return a.createElement("li",{role:"menuitem","data-testid":"rrs-option_"+n+"_"+t,tabIndex:-1,"aria-disabled":this.isDisabled(r)?"true":"false","aria-label":"\n "+(r.text||r.markup&&r.markup.textContent)+" "+(""!==i?" of "+i:"")+"\n ","data-key":t,ref:this.optionRef,className:s.default("\n rrs__option\n "+(l===t?"rrs__option--selected":"")+"\n "+(o===t?"rrs__option--next-selection":"")+"\n "+(!0===r.disabled?"rrs__option--disabled":"")+"\n "+(!0===r.optHeader?"rrs__option--header":"")+"\n ")},r.markup||r.text)},e}(a.Component);t.SingleSelectOption=r}])});
//# sourceMappingURL=ReactResponsiveSelect.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define("ReactResponsiveSelect",["React"],t):"object"==typeof exports?exports.ReactResponsiveSelect=t(require("React")):e.ReactResponsiveSelect=t(e.React)}(window,function(n){return function(n){var o={};function l(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,l),t.l=!0,t.exports}return l.m=n,l.c=o,l.d=function(e,t,n){l.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(t,e){if(1&e&&(t=l(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(l.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)l.d(n,o,function(e){return t[e]}.bind(null,o));return n},l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,"a",t),t},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.p="",l(l.s=11)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INITIALISE="INITIALISE",t.UPDATE_VIA_PROPS="UPDATE_VIA_PROPS",t.SET_IS_DRAGGING="SET_IS_DRAGGING",t.SET_OPTIONS_PANEL_OPEN="SET_OPTIONS_PANEL_OPEN",t.SET_OPTIONS_PANEL_CLOSED="SET_OPTIONS_PANEL_CLOSED",t.SET_SINGLESELECT_OPTIONS="SET_SINGLESELECT_OPTIONS",t.SET_MULTISELECT_OPTIONS="SET_MULTISELECT_OPTIONS",t.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION="SET_OPTIONS_PANEL_CLOSED_NO_SELECTION",t.SET_OPTIONS_PANEL_CLOSED_ONBLUR="SET_OPTIONS_PANEL_CLOSED_ONBLUR",t.SET_NEXT_SELECTED_INDEX="SET_NEXT_SELECTED_INDEX",t.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC="SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC"},function(e,t){e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t?"":" ";return e.replace(/\s\s+/g,n).trim()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function o(){var n=[];return function(e,t){if("object"==typeof t&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t}}t.isEqual=function(e,t){return JSON.stringify(e,o())===JSON.stringify(t,o())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextValidIndex=function(e,t,n){void 0===n&&(n="INCREMENT");var o=e.options,l=o.reduce(function(e,t,n){return t.optHeader||e.push(n),e},[]),i=-1===l.indexOf(t);return i&&"INCREMENT"===n?o[t+1]&&!o[t+1].optHeader?t+1:l[0]:i&&"DECREMENT"===n?o[t-1]&&!o[t-1].optHeader?t-1:l[l.length-1]:t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.handleAlphaNumerical=function(e){var t=e.event,n=e.state,o=e.ReactResponsiveSelectClassRef,l=n.options;if(!n.disabled){var i=l.map(function(e){return!e.optHeader&&!e.disabled&&(e.text||"").toLowerCase().charAt(0)}).indexOf(t.key);-1<i&&o.updateState({value:i,type:r.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(14);t.multiSelectBroadcastChange=o.multiSelectBroadcastChange;var l=n(15);t.singleSelectBroadcastChange=l.singleSelectBroadcastChange},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),d=n(16);t.handleClick=function(e){var t=e.event,n=e.state,o=e.ReactResponsiveSelectClassRef,l=n.multiselect,i=n.isOptionsPanelOpen,r=n.isDragging,a=n.disabled,s=n.options;if(!a&&!1===r){if(t.preventDefault(),t&&d.containsClassName(t.target,"rrs__options"))return;var c=parseFloat(t.target.getAttribute("data-key"));if(s[c]&&!0===s[c].disabled||s[c]&&!0===s[c].optHeader)return;if(d.containsClassName(t.target,"rrs__option"))return void o.updateState({type:l?u.SET_MULTISELECT_OPTIONS:u.SET_SINGLESELECT_OPTIONS,value:c});if(i&&(d.containsClassName(t.target,"rrs__label")||d.containsClassName(t.target,"rrs")))return void o.updateState({type:u.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION},function(){return o.focusButton()});o.updateState({type:i?u.SET_OPTIONS_PANEL_CLOSED:u.SET_OPTIONS_PANEL_OPEN},function(e){!1===e.isOptionsPanelOpen&&o.focusButton()})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=n(0);t.handleEnterPressed=function(e){var t=e.event,n=e.state,o=e.props,l=e.ReactResponsiveSelectClassRef,i=n.disabled,r=n.isOptionsPanelOpen,a=n.multiselect,s=n.nextPotentialSelectionIndex,c=n.options;if(!i){var u=parseFloat(t.target.getAttribute("data-key"));c[u]&&!0===c[u].disabled||c[u]&&!0===c[u].optHeader||(a?l.updateState({type:d.SET_MULTISELECT_OPTIONS,value:s}):l.updateState({type:d.SET_SINGLESELECT_OPTIONS,value:s}),r?t.stopPropagation():o.onSubmit&&o.onSubmit(t))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),r=n(20);t.handleKeyUpOrDownPressed=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=e.type,l=t.isOptionsPanelOpen;t.disabled||(n.updateState({type:i.SET_NEXT_SELECTED_INDEX,value:r.getNextIndex(o,t)}),!1===l&&n.updateState({type:i.SET_OPTIONS_PANEL_OPEN}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState={multiselect:!1,name:"",options:[],isDragging:!1,isOptionsPanelOpen:!1,altered:!1,singleSelectInitialIndex:0,singleSelectSelectedIndex:0,singleSelectSelectedOption:{},nextPotentialSelectionIndex:0,multiSelectInitialSelectedIndexes:[0],multiSelectSelectedOptions:{altered:!1,options:[]},multiSelectSelectedIndexes:[]}},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),l=this&&this.__assign||function(){return(l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var h=n(1),x=n(2),s=n(0),i=n(12),I=n(23),c=n(6),r=n(10),a=n(24),u=n(3),b=n(37),P=n(39),d=function(n){function e(e){var t=n.call(this,e)||this;return t.onHandleKeyEvent=function(e){i.handleKeyEvent({event:e,ReactResponsiveSelectClassRef:t,state:t.state,props:t.props})},t.onHandleTouchStart=function(){i.handleTouchStart({ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleTouchMove=function(){i.handleTouchMove({ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleClick=function(e){i.handleClick({event:e,ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleBlur=function(){i.handleBlur({ReactResponsiveSelectClassRef:t,state:t.state,props:t.props})},t.state=r.initialState,t.reducer=a.reducer,t.firstLoad=!0,t}return o(e,n),e.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.noSelectionLabel,o=e.selectedValue,l=e.selectedValues,i=e.name,r=e.multiselect,a=e.disabled;this.updateState({type:s.INITIALISE,value:{options:t,noSelectionLabel:n,selectedValue:o,selectedValues:l,name:i,multiselect:r,disabled:a}})},e.prototype.componentWillReceiveProps=function(e){u.isEqual(e,this.props)||this.updateState({type:s.UPDATE_VIA_PROPS,value:l({},this.props,e)})},e.prototype.componentDidUpdate=function(e,t){var n=this.state,o=n.singleSelectSelectedOption,l=n.multiSelectSelectedOptions,i=n.multiselect,r=n.altered,a=this.props.onChange;return this.firstLoad?this.firstLoad=!1:(i?c.multiSelectBroadcastChange(l.options,Boolean(r),a,t.multiSelectSelectedOptions.options):c.singleSelectBroadcastChange(o,Boolean(r),a,t.singleSelectSelectedOption),!0)},e.prototype.updateState=function(t,e){var n=this.props,o=n.onListen,l=n.name,i=this.reducer(this.state,t);this.setState(i,function(){e&&e(i)}),o&&o([s.SET_OPTIONS_PANEL_OPEN,s.SET_NEXT_SELECTED_INDEX,s.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC,s.SET_IS_DRAGGING].some(function(e){return t.type===e}),l,t.type)},e.prototype.focusButton=function(){var e=this.selectBox&&this.selectBox.querySelector(".rrs__button");e&&e.focus()},e.prototype.render=function(){var t=this,e=this.props,n=e.prefix,o=e.caretIcon,l=e.disabled,i=this.state,r=i.altered,a=i.hasOptHeaders,s=i.isOptionsPanelOpen,c=i.isDragging,u=i.noSelectionLabel,d=i.multiSelectSelectedIndexes,p=i.multiSelectSelectedOptions,S=i.name,f=i.nextPotentialSelectionIndex,_=i.options,O=i.singleSelectSelectedIndex,v=i.singleSelectSelectedOption,E=i.multiselect,m=I.getCustomLabelText({props:this.props,state:this.state});return h.createElement("div",{"data-testid":S,"data-name":S,className:x.default("\n rrs\n "+(!0===s?"rrs--options-visible":"")+"\n "+(r?"rrs--has-changed":"")+"\n "+(a?"rrs--has-opt-headers":"")+"\n "),ref:function(e){t.selectBox=e},tabIndex:-1,onKeyDown:this.onHandleKeyEvent,onTouchStart:this.onHandleTouchStart,onTouchMove:this.onHandleTouchMove,onTouchEnd:this.onHandleClick,onMouseDown:this.onHandleClick,onBlur:this.onHandleBlur},E?h.createElement(b.MultiSelect,{disabled:Boolean(l),isDragging:c,caretIcon:o,customLabelText:m,prefix:n||"",name:S,multiSelectSelectedOptions:p,multiSelectSelectedIndexes:d,nextPotentialSelectionIndex:f,isOptionsPanelOpen:s,options:_,selectBoxRef:this.selectBox}):h.createElement(P.SingleSelect,{noSelectionLabel:u||"",disabled:Boolean(l),caretIcon:o,prefix:n||"",name:S,customLabelText:m,singleSelectSelectedOption:v,singleSelectSelectedIndex:O,nextPotentialSelectionIndex:f,isOptionsPanelOpen:s,options:_,selectBoxRef:this.selectBox}))},e}(h.Component);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(5);t.handleAlphaNumerical=o.handleAlphaNumerical;var l=n(13);t.handleBlur=l.handleBlur;var i=n(7);t.handleClick=i.handleClick;var r=n(8);t.handleEnterPressed=r.handleEnterPressed;var a=n(17);t.handleKeyEvent=a.handleKeyEvent;var s=n(9);t.handleKeyUpOrDownPressed=s.handleKeyUpOrDownPressed;var c=n(21);t.handleTouchMove=c.handleTouchMove;var u=n(22);t.handleTouchStart=u.handleTouchStart},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var p=n(0),S=n(6);t.handleBlur=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=e.props,l=t.isOptionsPanelOpen,i=t.disabled,r=t.altered,a=t.singleSelectSelectedOption,s=t.multiSelectSelectedOptions,c=o.onBlur,u=o.multiselect;if(!i){var d=n.selectBox&&!n.selectBox.contains(document.activeElement);l&&d&&n.updateState({type:p.SET_OPTIONS_PANEL_CLOSED_ONBLUR}),d&&c&&(u?S.multiSelectBroadcastChange(s.options,Boolean(r),c):S.singleSelectBroadcastChange(a,Boolean(r),c))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(3);t.multiSelectBroadcastChange=function(e,t,n,o){n&&(o&&l.isEqual(o,e)||n({options:e.map(function(e){return{name:e.name||"",text:e.text||"",value:e.value||""}}),altered:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(3);t.singleSelectBroadcastChange=function(e,t,n,o){n&&(l.isEqual(o,e)||n({name:e.name,text:e.text,value:e.value,altered:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containsClassName=function(e,t){return-1<String(e.className).split(" ").indexOf(t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=n(18),c=n(19),u=n(5),d=n(7),p=n(8),S=n(9);t.handleKeyEvent=function(e){var t=e.event,n=e.state,o=e.props,l=e.ReactResponsiveSelectClassRef,i=n.multiselect,r=n.isOptionsPanelOpen;if(!n.disabled)switch(c.preventDefaultForKeyCodes([s.keyCodes.ENTER,s.keyCodes.SPACE,s.keyCodes.ESCAPE,s.keyCodes.UP,s.keyCodes.DOWN],t),/^[a-z0-9]+$/.test(t.key)&&u.handleAlphaNumerical({event:t,ReactResponsiveSelectClassRef:l,state:n}),t.keyCode){case s.keyCodes.TAB:r&&(t.preventDefault(),i&&l.updateState({type:a.SET_OPTIONS_PANEL_CLOSED},function(){return l.focusButton()}));break;case s.keyCodes.ENTER:p.handleEnterPressed({ReactResponsiveSelectClassRef:l,event:t,props:o,state:n});break;case s.keyCodes.SPACE:r?d.handleClick({event:t,state:n,ReactResponsiveSelectClassRef:l}):l.updateState({type:a.SET_OPTIONS_PANEL_OPEN});break;case s.keyCodes.ESCAPE:l.updateState({type:a.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION},function(){return l.focusButton()});break;case s.keyCodes.UP:S.handleKeyUpOrDownPressed({ReactResponsiveSelectClassRef:l,state:n,type:"DECREMENT"});break;case s.keyCodes.DOWN:S.handleKeyUpOrDownPressed({ReactResponsiveSelectClassRef:l,state:n,type:"INCREMENT"})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyCodes={TAB:9,ENTER:13,SPACE:32,ESCAPE:27,UP:38,DOWN:40}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultForKeyCodes=function(e,t){e.forEach(function(e){e===t.keyCode&&t.preventDefault()})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4);t.getNextIndex=function(e,t){var n=t.isOptionsPanelOpen,o=t.nextPotentialSelectionIndex,l=t.options;switch(e){case"INCREMENT":return!1===n?i.nextValidIndex(t,o,"INCREMENT"):o===l.length-1?i.nextValidIndex(t,0,"INCREMENT"):i.nextValidIndex(t,o+1,"INCREMENT");case"DECREMENT":return!1===n?i.nextValidIndex(t,o,"DECREMENT"):0===o?i.nextValidIndex(t,l.length-1,"DECREMENT"):i.nextValidIndex(t,o-1,"DECREMENT");default:return i.nextValidIndex(t,0,"DECREMENT")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(0);t.handleTouchMove=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=t.isDragging;t.disabled||o||n.updateState({type:l.SET_IS_DRAGGING,value:!0})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.handleTouchStart=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef;t.disabled||n.updateState({type:o.SET_IS_DRAGGING,value:!1})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCustomLabelText=function(e){var t=e.state,n=e.props,o=n.multiselect,l=n.customLabelRenderer,i=t.multiSelectSelectedOptions,r=t.singleSelectSelectedOption;return!!l&&l(o?i:r)}},function(e,t,n){"use strict";var d=this&&this.__assign||function(){return(d=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var p=n(0),S=n(4),f=n(25);t.reducer=function(e,t){switch(t.type){case p.UPDATE_VIA_PROPS:case p.INITIALISE:var n=f.getSelectedValueIndex(t.value),o=f.getMultiSelectSelectedValueIndexes(t.value,t.value.selectedValues,t.value.noSelectionLabel);return d({},e,{hasOptHeaders:t.value.options.some(function(e){return!0===e.optHeader}),multiselect:t.value.multiselect||!1,noSelectionLabel:t.value.noSelectionLabel,name:t.value.name,options:t.value.options,altered:t.value.altered||!1,disabled:t.value.disabled||!1,singleSelectInitialIndex:n,singleSelectSelectedIndex:n,singleSelectSelectedOption:f.getSingleSelectSelectedOption(t.value,n),nextPotentialSelectionIndex:e.nextPotentialSelectionIndex?e.nextPotentialSelectionIndex:n,multiSelectInitialSelectedIndexes:o,multiSelectSelectedIndexes:o,multiSelectSelectedOptions:{options:f.getMultiSelectInitialSelectedOptions(t.value,t.value.selectedValues)}});case p.SET_IS_DRAGGING:return d({},e,{isDragging:t.value});case p.SET_OPTIONS_PANEL_OPEN:var l=d({},e,{isOptionsPanelOpen:!0,nextPotentialSelectionIndex:function(){return e.multiselect?e.multiSelectSelectedIndexes.length?S.nextValidIndex(e,e.multiSelectSelectedIndexes[0]):S.nextValidIndex(e,0):S.nextValidIndex(e,e.nextPotentialSelectionIndex)}(),singleSelectSelectedOption:f.getSingleSelectSelectedOption(e,e.nextPotentialSelectionIndex)});return f.mergeIsAlteredState(l);case p.SET_OPTIONS_PANEL_CLOSED:l=d({},e,{isOptionsPanelOpen:!1,singleSelectSelectedIndex:e.nextPotentialSelectionIndex,singleSelectSelectedOption:f.getSingleSelectSelectedOption(e,e.nextPotentialSelectionIndex)});return f.mergeIsAlteredState(l);case p.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION:case p.SET_OPTIONS_PANEL_CLOSED_ONBLUR:return d({},e,{isOptionsPanelOpen:!1});case p.SET_NEXT_SELECTED_INDEX:return d({},e,{nextPotentialSelectionIndex:t.value});case p.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC:return d({},e,{isOptionsPanelOpen:!0,nextPotentialSelectionIndex:t.value});case p.SET_SINGLESELECT_OPTIONS:var i=d({},e,{nextPotentialSelectionIndex:t.value,singleSelectSelectedIndex:t.value,isOptionsPanelOpen:!1,singleSelectSelectedOption:f.getSingleSelectSelectedOption(e,t.value)});return f.mergeIsAlteredState(i);case p.SET_MULTISELECT_OPTIONS:if(!e.noSelectionLabel){var r=0===e.multiSelectSelectedIndexes[0]&&1===e.multiSelectSelectedIndexes.length,a=0<e.multiSelectSelectedIndexes.length&&!r&&0===t.value,s=r&&0!==t.value;if(a)return f.mergeIsAlteredState(f.getInitialMultiSelectOption(e));s&&(e=f.resetMultiSelectState(e))}e.noSelectionLabel&&e.multiSelectSelectedOptions.options[0].text===e.noSelectionLabel&&(e.multiSelectSelectedOptions.options=[]);var c=S.nextValidIndex(e,t.value),u=e.multiSelectSelectedIndexes.indexOf(c);return 0===(i=d({},e,{nextPotentialSelectionIndex:c,multiSelectSelectedIndexes:-1===u?f.addMultiSelectIndex(e,c):f.removeMultiSelectIndex(e,u),multiSelectSelectedOptions:-1===u?f.addMultiSelectOption(e,c):f.removeMultiSelectOption(e,u)})).multiSelectSelectedOptions.options.length&&(i=e.noSelectionLabel?d({},i,{nextPotentialSelectionIndex:e.hasOptHeaders?S.nextValidIndex(e,-1):-1,multiSelectSelectedOptions:{options:f.getMultiSelectInitialSelectedOptions(e)}}):f.getInitialMultiSelectOption(e)),f.mergeIsAlteredState(i);default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(26);t.addMultiSelectIndex=o.addMultiSelectIndex;var l=n(27);t.addMultiSelectOption=l.addMultiSelectOption;var i=n(28);t.getInitialMultiSelectOption=i.getInitialMultiSelectOption;var r=n(29);t.getMultiSelectInitialSelectedOptions=r.getMultiSelectInitialSelectedOptions;var a=n(30);t.getMultiSelectSelectedValueIndexes=a.getMultiSelectSelectedValueIndexes;var s=n(31);t.getSelectedValueIndex=s.getSelectedValueIndex;var c=n(32);t.getSingleSelectSelectedOption=c.getSingleSelectSelectedOption;var u=n(33);t.mergeIsAlteredState=u.mergeIsAlteredState;var d=n(34);t.removeMultiSelectIndex=d.removeMultiSelectIndex;var p=n(35);t.removeMultiSelectOption=p.removeMultiSelectOption;var S=n(36);t.resetMultiSelectState=S.resetMultiSelectState},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMultiSelectIndex=function(e,t){return e.multiSelectSelectedIndexes.concat([t])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMultiSelectOption=function(e,t){return{options:e.multiSelectSelectedOptions.options.concat([{name:e.name,text:e.options[t].text,value:e.options[t].value}])}}},function(e,t,n){"use strict";var l=this&&this.__assign||function(){return(l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getInitialMultiSelectOption=function(e){var t=function(o){return o.options.reduce(function(e,t,n){return t.optHeader||e.push({option:{value:t.value,text:t.text,name:o.name},index:n}),e},[])[0]}(e),n=t.option,o=t.index;return l({},e,{multiSelectSelectedIndexes:[o],multiSelectSelectedOptions:{options:[l({},n)]},nextPotentialSelectionIndex:o})}},function(e,t,n){"use strict";var l=this&&this.__assign||function(){return(l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getMultiSelectInitialSelectedOptions=function(t,e){var n;if(t.noSelectionLabel)return n=e&&0<e.length?t.options.filter(function(t){return e.some(function(e){return e===t.value})}).map(function(e){return l({name:t.name},e)}):[{name:t.name,text:t.noSelectionLabel,value:"null"}];if(e&&0<e.length)n=t.options.filter(function(t){return e.some(function(e){return e===t.value})}).map(function(e){return l({name:t.name},e)});else{var o=t.options[0]&&t.options[0].optHeader?function(e){if(e.multiSelectSelectedOptions&&e.multiSelectSelectedOptions.options.length)return e.multiSelectSelectedOptions.options[0];var t=e.options.reduce(function(e,t){return t.optHeader||e.push(t),e},[]);return{name:e.name,text:t[0].text,value:t[0].value}}(t):t.options[0];n=[{name:t.name,text:o.text,value:o.value}]}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4);t.getMultiSelectSelectedValueIndexes=function(e,o,t){void 0===o&&(o=[]);var n=e.options,l=t?[]:[r.nextValidIndex(e,0)],i=n.reduce(function(e,t,n){return o.some(function(e){return t.value===e})&&e.push(n),e},[]);return 0<i.length?i:l}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedValueIndex=function(e){var t=e.options,n=e.selectedValue,o=e.noSelectionLabel,l=n?t.map(function(e){return e.value}).indexOf(n):-1;return-1<l||o?l:0}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSingleSelectSelectedOption=function(e,t){void 0===t&&(t=0);var n=-1!==t||e.noSelectionLabel?t:0;return e.options[n]&&e.options[n].optHeader?function(e){if(e.singleSelectSelectedOption)return e.singleSelectSelectedOption;var t=e.options.reduce(function(e,t){return t.optHeader||e.push(t),e},[]);return o({},t[0],{name:e.name})}(e):e.noSelectionLabel?-1<t?o({name:e.name},e.options[t]):{name:e.name,text:e.noSelectionLabel,value:"null"}:o({name:e.name},e.options[n])}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};function l(e){return e.multiselect?!(JSON.stringify(e.multiSelectInitialSelectedIndexes)===JSON.stringify(e.multiSelectSelectedIndexes)):e.singleSelectSelectedIndex!==e.singleSelectInitialIndex}Object.defineProperty(t,"__esModule",{value:!0}),t.isAltered=l,t.mergeIsAlteredState=function(e){return o({},e,{altered:l(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMultiSelectIndex=function(e,t){return e.multiSelectSelectedIndexes.slice(0,t).concat(e.multiSelectSelectedIndexes.slice(t+1))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMultiSelectOption=function(e,t){return{options:e.multiSelectSelectedOptions.options.slice(0,t).concat(e.multiSelectSelectedOptions.options.slice(t+1))}}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var l in t=arguments[n])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var l=n(10);t.resetMultiSelectState=function(e){return o({},e,{multiSelectSelectedIndexes:l.initialState.multiSelectSelectedIndexes.slice(),multiSelectSelectedOptions:o({},l.initialState.multiSelectSelectedOptions)})}},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var S=n(1),f=n(2),_=n(38),l=function(n){function e(e){var t=n.call(this,e)||this;return t.optionsButton=S.createRef(),t.optionsContainer=S.createRef(),t}return o(e,n),e.prototype.componentDidUpdate=function(e){var t=this.props,n=t.isOptionsPanelOpen,o=t.selectBoxRef;!n&&e.isOptionsPanelOpen&&o&&o.contains(document.activeElement)&&this.optionsButton.current&&this.optionsButton.current.focus()},e.prototype.getAriaLabel=function(){var e=this.props,t=e.multiSelectSelectedOptions,n=e.prefix,o=t.options.length;return f.default("\n Checkbox group "+(n?n+" ":"")+" has\n "+o+" item"+(1===o?"":"s")+" selected.\n Selected option"+(1===o?"":"s")+" "+(1===o?"is":"are")+"\n "+t.options.map(function(e){return e.text||""}).join(" and ")+"\n ")},e.prototype.render=function(){var n=this,e=this.props,t=e.caretIcon,o=e.customLabelText,l=e.disabled,i=e.isOptionsPanelOpen,r=e.multiSelectSelectedIndexes,a=e.multiSelectSelectedOptions,s=e.name,c=e.options,u=e.nextPotentialSelectionIndex,d=e.prefix,p="";return S.createElement("div",null,S.createElement("div",{role:"button",tabIndex:0,"aria-disabled":l,"aria-haspopup":"true","aria-expanded":i,"aria-controls":"rrs-"+s+"-menu",ref:this.optionsButton,className:f.default("\n rrs__button\n "+(!0===l?"rrs__button--disabled":"")+"\n ")},o&&S.createElement("div",{className:"rrs__label"},S.createElement("span",{"aria-label":this.getAriaLabel(),className:"rrs__label__text",id:"rrs-"+s+"-label","data-testid":"rrs-label_"+s},o),t&&t),!o&&S.createElement("div",{className:"rrs__label"},S.createElement("span",{"aria-label":this.getAriaLabel(),className:"rrs__label__text",id:"rrs-"+s+"-label","data-testid":"rrs-label_"+s},S.createElement("span",{className:"rrs__multiselect-label"},S.createElement("span",{className:"rrs__multiselect-label__text"},(d?d+" ":"")+"\n "+(0<a.options.length?a.options[0].text:"")),1<a.options.length&&S.createElement("span",{className:"rrs__multiselect-label__badge"},"+ "+(a.options.length-1)))),t&&t),s&&S.createElement("input",{type:"hidden",name:s,"data-testid":"rrs-input_"+s,value:[a.options.map(function(e){return e.value})].join(",")})),S.createElement("ul",{id:"rrs-"+s+"-menu","aria-labelledby":"rrs-"+s+"-label",role:"menu",className:"rrs__options",ref:this.optionsContainer},0<c.length&&c.map(function(e,t){return e.optHeader&&(p=e.text||e.markup&&e.markup.textContent||""),S.createElement(_.MultiSelectOption,{key:t,name:s,optHeaderLabel:p,optionsContainerRef:n.optionsContainer,index:t,option:e,isOptionsPanelOpen:i,multiSelectSelectedIndexes:r,nextPotentialSelectionIndex:u})})))},e}(S.Component);t.MultiSelect=l},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),c=n(2),l=function(n){function e(e){var t=n.call(this,e)||this;return t.optionRef=s.createRef(),t}return o(e,n),e.prototype.getScrollOffset=function(){var e=document.querySelector(".rrs__option--header");return Math.ceil(e&&e.getBoundingClientRect().height||0)},e.prototype.componentDidUpdate=function(){var e=this.props,t=e.index,n=e.isOptionsPanelOpen,o=e.nextPotentialSelectionIndex,l=e.optionsContainerRef,i=e.optHeaderLabel;if(t===o&&n&&this.optionRef.current&&l.current&&(this.optionRef.current.focus(),""!==i)){var r=Math.ceil(this.optionRef.current.getBoundingClientRect().top-l.current.getBoundingClientRect().top);this.scrollOffset=this.scrollOffset||this.getScrollOffset(),r<this.scrollOffset&&l.current.scroll(0,Math.floor(l.current.scrollTop-this.scrollOffset))}},e.prototype.isDisabled=function(e){return Boolean(e.disabled||e.optHeader)},e.prototype.render=function(){var e=this.props,t=e.index,n=e.name,o=e.multiSelectSelectedIndexes,l=e.nextPotentialSelectionIndex,i=e.option,r=e.optHeaderLabel,a=o.some(function(e){return e===t});return s.createElement("li",{role:"checkbox","data-testid":"rrs-option_"+n+"_"+t,tabIndex:-1,"aria-checked":a,"aria-label":"\n "+(i.text||i.markup&&i.markup.textContent)+" "+(""!==r?" of "+r:"")+"\n ","aria-live":"assertive","aria-disabled":this.isDisabled(i)?"true":"false","data-key":t,ref:this.optionRef,className:c.default("\n rrs__option\n "+(a?"rrs__option--selected":"")+"\n "+(l===t?"rrs__option--next-selection":"")+"\n "+(!0===i.disabled?"rrs__option--disabled":"")+"\n "+(!0===i.optHeader?"rrs__option--header":"")+"\n ")},i.markup||i.text)},e}(s.Component);t.MultiSelectOption=l},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var d=n(1),p=n(2),S=n(40),l=function(n){function e(e){var t=n.call(this,e)||this;return t.optionsButton=d.createRef(),t.optionsContainer=d.createRef(),t}return o(e,n),e.prototype.componentDidUpdate=function(e){var t=this.props,n=t.isOptionsPanelOpen,o=t.nextPotentialSelectionIndex,l=t.selectBoxRef,i=!n&&e.isOptionsPanelOpen;this.optionsButton.current&&(i&&l&&l.contains(document.activeElement)&&this.optionsButton.current.focus(),n&&-1===o&&this.optionsButton.current.focus())},e.prototype.getCustomLabel=function(){var e=this.props,t=e.prefix,n=e.name,o=e.singleSelectSelectedOption,l=e.caretIcon,i=e.customLabelText;return d.createElement("div",{className:"rrs__label"},d.createElement("span",{"aria-label":(t?t+" ":"")+o.text+" selected",className:"rrs__label__text",id:"rrs-"+n+"-label","data-testid":"rrs-label_"+n},i),l&&l)},e.prototype.getDefaultLabel=function(){var e=this.props,t=e.prefix,n=e.singleSelectSelectedOption,o=e.name,l=e.caretIcon,i=e.singleSelectSelectedIndex,r=e.noSelectionLabel;return-1===i?d.createElement("div",{className:"rrs__label"},d.createElement("span",{"aria-label":r,className:"rrs__label__text",id:"rrs-"+o+"-label","data-testid":"rrs-label_"+o},t&&d.createElement("span",null,t),r),l&&l):d.createElement("div",{className:"rrs__label"},d.createElement("span",{"aria-label":(t?t+" ":"")+n.text+" selected",className:"rrs__label__text",id:"rrs-"+o+"-label","data-testid":"rrs-label_"+o},t&&d.createElement("span",null,t),n.text?n.text:d.createElement("div",null," ")),l&&l)},e.prototype.render=function(){var n=this,e=this.props,t=e.customLabelText,o=e.disabled,l=e.isOptionsPanelOpen,i=e.name,r=e.nextPotentialSelectionIndex,a=e.options,s=e.singleSelectSelectedIndex,c=e.singleSelectSelectedOption,u="";return d.createElement("div",null,d.createElement("div",{role:"button",tabIndex:0,"aria-disabled":o,"aria-haspopup":"true","aria-expanded":l,"aria-controls":"rrs-"+i+"-menu",ref:this.optionsButton,className:p.default("\n rrs__button\n "+(!0===o?"rrs__button--disabled":"")+"\n ")},t?this.getCustomLabel():this.getDefaultLabel(),i&&d.createElement("input",{type:"hidden",name:i,"data-testid":"rrs-input_"+i,value:c.value})),d.createElement("ul",{id:"rrs-"+i+"-menu","aria-labelledby":"rrs-"+i+"-label",role:"menu",className:"rrs__options",ref:this.optionsContainer},0<a.length&&a.map(function(e,t){return e.optHeader&&(u=e.text||e.markup&&e.markup.textContent||""),d.createElement(S.SingleSelectOption,{key:t,name:i,optHeaderLabel:u,optionsContainerRef:n.optionsContainer,index:t,isOptionsPanelOpen:l,option:e,singleSelectSelectedIndex:s,nextPotentialSelectionIndex:r})})))},e}(d.Component);t.SingleSelect=l},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),s=n(2),l=function(n){function e(e){var t=n.call(this,e)||this;return t.optionRef=a.createRef(),t}return o(e,n),e.prototype.getScrollOffset=function(){var e=document.querySelector(".rrs__option--header");return Math.ceil(e&&e.getBoundingClientRect().height||0)},e.prototype.componentDidUpdate=function(){var e=this.props,t=e.index,n=e.isOptionsPanelOpen,o=e.nextPotentialSelectionIndex,l=e.optionsContainerRef,i=e.optHeaderLabel;if(t===o&&n&&this.optionRef.current&&l.current&&(this.optionRef.current.focus(),""!==i)){var r=Math.ceil(this.optionRef.current.getBoundingClientRect().top-l.current.getBoundingClientRect().top);this.scrollOffset=this.scrollOffset||this.getScrollOffset(),r<this.scrollOffset&&l.current.scroll(0,Math.floor(l.current.scrollTop-this.scrollOffset))}},e.prototype.isDisabled=function(e){return Boolean(e.disabled||e.optHeader)},e.prototype.render=function(){var e=this.props,t=e.index,n=e.name,o=e.nextPotentialSelectionIndex,l=e.option,i=e.singleSelectSelectedIndex,r=e.optHeaderLabel;return a.createElement("li",{role:"menuitem","data-testid":"rrs-option_"+n+"_"+t,tabIndex:-1,"aria-disabled":this.isDisabled(l)?"true":"false","aria-label":"\n "+(l.text||l.markup&&l.markup.textContent)+" "+(""!==r?" of "+r:"")+"\n ","data-key":t,ref:this.optionRef,className:s.default("\n rrs__option\n "+(i===t?"rrs__option--selected":"")+"\n "+(o===t?"rrs__option--next-selection":"")+"\n "+(!0===l.disabled?"rrs__option--disabled":"")+"\n "+(!0===l.optHeader?"rrs__option--header":"")+"\n ")},l.markup||l.text)},e}(a.Component);t.SingleSelectOption=l}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("ReactResponsiveSelect",[],t):"object"==typeof exports?exports.ReactResponsiveSelect=t():e.ReactResponsiveSelect=t()}(window,function(){return function(n){var o={};function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}return r.m=n,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=11)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INITIALISE="INITIALISE",t.UPDATE_VIA_PROPS="UPDATE_VIA_PROPS",t.SET_IS_DRAGGING="SET_IS_DRAGGING",t.SET_OPTIONS_PANEL_OPEN="SET_OPTIONS_PANEL_OPEN",t.SET_OPTIONS_PANEL_CLOSED="SET_OPTIONS_PANEL_CLOSED",t.SET_SINGLESELECT_OPTIONS="SET_SINGLESELECT_OPTIONS",t.SET_MULTISELECT_OPTIONS="SET_MULTISELECT_OPTIONS",t.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION="SET_OPTIONS_PANEL_CLOSED_NO_SELECTION",t.SET_OPTIONS_PANEL_CLOSED_ONBLUR="SET_OPTIONS_PANEL_CLOSED_ONBLUR",t.SET_NEXT_SELECTED_INDEX="SET_NEXT_SELECTED_INDEX",t.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC="SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC"},function(e,t,n){"use strict";e.exports=n(12)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=t?"":" ";return e.replace(/\s\s+/g,n).trim()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function o(){var n=[];return function(e,t){if("object"==typeof t&&null!==t){if(-1!==n.indexOf(t))return;n.push(t)}return t}}t.isEqual=function(e,t){return JSON.stringify(e,o())===JSON.stringify(t,o())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextValidIndex=function(e,t,n){void 0===n&&(n="INCREMENT");var o=e.options,r=o.reduce(function(e,t,n){return t.optHeader||e.push(n),e},[]),l=-1===r.indexOf(t);return l&&"INCREMENT"===n?o[t+1]&&!o[t+1].optHeader?t+1:r[0]:l&&"DECREMENT"===n?o[t-1]&&!o[t-1].optHeader?t-1:r[r.length-1]:t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);t.handleAlphaNumerical=function(e){var t=e.event,n=e.state,o=e.ReactResponsiveSelectClassRef,r=n.options;if(!n.disabled){var l=r.map(function(e){return!e.optHeader&&!e.disabled&&(e.text||"").toLowerCase().charAt(0)}).indexOf(t.key);-1<l&&o.updateState({value:l,type:i.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(16);t.multiSelectBroadcastChange=o.multiSelectBroadcastChange;var r=n(17);t.singleSelectBroadcastChange=r.singleSelectBroadcastChange},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),p=n(18);t.handleClick=function(e){var t=e.event,n=e.state,o=e.ReactResponsiveSelectClassRef,r=n.multiselect,l=n.isOptionsPanelOpen,i=n.isDragging,a=n.disabled,s=n.options;if(!a&&!1===i){if(t.preventDefault(),t&&p.containsClassName(t.target,"rrs__options"))return;var c=parseFloat(t.target.getAttribute("data-key"));if(s[c]&&!0===s[c].disabled||s[c]&&!0===s[c].optHeader)return;if(p.containsClassName(t.target,"rrs__option"))return void o.updateState({type:r?u.SET_MULTISELECT_OPTIONS:u.SET_SINGLESELECT_OPTIONS,value:c});if(l&&(p.containsClassName(t.target,"rrs__label")||p.containsClassName(t.target,"rrs")))return void o.updateState({type:u.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION},function(){return o.focusButton()});o.updateState({type:l?u.SET_OPTIONS_PANEL_CLOSED:u.SET_OPTIONS_PANEL_OPEN},function(e){!1===e.isOptionsPanelOpen&&o.focusButton()})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var p=n(0);t.handleEnterPressed=function(e){var t=e.event,n=e.state,o=e.props,r=e.ReactResponsiveSelectClassRef,l=n.disabled,i=n.isOptionsPanelOpen,a=n.multiselect,s=n.nextPotentialSelectionIndex,c=n.options;if(!l){var u=parseFloat(t.target.getAttribute("data-key"));c[u]&&!0===c[u].disabled||c[u]&&!0===c[u].optHeader||(a?r.updateState({type:p.SET_MULTISELECT_OPTIONS,value:s}):r.updateState({type:p.SET_SINGLESELECT_OPTIONS,value:s}),i?t.stopPropagation():o.onSubmit&&o.onSubmit(t))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(0),i=n(22);t.handleKeyUpOrDownPressed=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=e.type,r=t.isOptionsPanelOpen;t.disabled||(n.updateState({type:l.SET_NEXT_SELECTED_INDEX,value:i.getNextIndex(o,t)}),!1===r&&n.updateState({type:l.SET_OPTIONS_PANEL_OPEN}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialState={multiselect:!1,name:"",options:[],isDragging:!1,isOptionsPanelOpen:!1,altered:!1,singleSelectInitialIndex:0,singleSelectSelectedIndex:0,singleSelectSelectedOption:{},nextPotentialSelectionIndex:0,multiSelectInitialSelectedIndexes:[0],multiSelectSelectedOptions:{altered:!1,options:[]},multiSelectSelectedIndexes:[]}},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var E=n(1),y=n(2),s=n(0),l=n(14),b=n(25),c=n(6),i=n(10),a=n(26),u=n(3),x=n(39),I=n(41),p=function(n){function e(e){var t=n.call(this,e)||this;return t.onHandleKeyEvent=function(e){l.handleKeyEvent({event:e,ReactResponsiveSelectClassRef:t,state:t.state,props:t.props})},t.onHandleTouchStart=function(){l.handleTouchStart({ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleTouchMove=function(){l.handleTouchMove({ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleClick=function(e){l.handleClick({event:e,ReactResponsiveSelectClassRef:t,state:t.state})},t.onHandleBlur=function(){l.handleBlur({ReactResponsiveSelectClassRef:t,state:t.state,props:t.props})},t.state=i.initialState,t.reducer=a.reducer,t.firstLoad=!0,t}return o(e,n),e.prototype.componentDidMount=function(){var e=this.props,t=e.options,n=e.noSelectionLabel,o=e.selectedValue,r=e.selectedValues,l=e.name,i=e.multiselect,a=e.disabled;this.updateState({type:s.INITIALISE,value:{options:t,noSelectionLabel:n,selectedValue:o,selectedValues:r,name:l,multiselect:i,disabled:a}})},e.prototype.componentWillReceiveProps=function(e){u.isEqual(e,this.props)||this.updateState({type:s.UPDATE_VIA_PROPS,value:r({},this.props,e)})},e.prototype.componentDidUpdate=function(e,t){var n=this.state,o=n.singleSelectSelectedOption,r=n.multiSelectSelectedOptions,l=n.multiselect,i=n.altered,a=this.props.onChange;return this.firstLoad?this.firstLoad=!1:(l?c.multiSelectBroadcastChange(r.options,Boolean(i),a,t.multiSelectSelectedOptions.options):c.singleSelectBroadcastChange(o,Boolean(i),a,t.singleSelectSelectedOption),!0)},e.prototype.updateState=function(t,e){var n=this.props,o=n.onListen,r=n.name,l=this.reducer(this.state,t);this.setState(l,function(){e&&e(l)}),o&&o([s.SET_OPTIONS_PANEL_OPEN,s.SET_NEXT_SELECTED_INDEX,s.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC,s.SET_IS_DRAGGING].some(function(e){return t.type===e}),r,t.type)},e.prototype.focusButton=function(){var e=this.selectBox&&this.selectBox.querySelector(".rrs__button");e&&e.focus()},e.prototype.render=function(){var t=this,e=this.props,n=e.prefix,o=e.caretIcon,r=e.disabled,l=this.state,i=l.altered,a=l.hasOptHeaders,s=l.isOptionsPanelOpen,c=l.isDragging,u=l.noSelectionLabel,p=l.multiSelectSelectedIndexes,d=l.multiSelectSelectedOptions,f=l.name,S=l.nextPotentialSelectionIndex,_=l.options,v=l.singleSelectSelectedIndex,O=l.singleSelectSelectedOption,m=l.multiselect,h=b.getCustomLabelText({props:this.props,state:this.state});return E.createElement("div",{"data-testid":f,"data-name":f,className:y.default("\n rrs\n "+(!0===s?"rrs--options-visible":"")+"\n "+(i?"rrs--has-changed":"")+"\n "+(a?"rrs--has-opt-headers":"")+"\n "),ref:function(e){t.selectBox=e},tabIndex:-1,onKeyDown:this.onHandleKeyEvent,onTouchStart:this.onHandleTouchStart,onTouchMove:this.onHandleTouchMove,onTouchEnd:this.onHandleClick,onMouseDown:this.onHandleClick,onBlur:this.onHandleBlur},m?E.createElement(x.MultiSelect,{disabled:Boolean(r),isDragging:c,caretIcon:o,customLabelText:h,prefix:n||"",name:f,multiSelectSelectedOptions:d,multiSelectSelectedIndexes:p,nextPotentialSelectionIndex:S,isOptionsPanelOpen:s,options:_,selectBoxRef:this.selectBox}):E.createElement(I.SingleSelect,{noSelectionLabel:u||"",disabled:Boolean(r),caretIcon:o,prefix:n||"",name:f,customLabelText:h,singleSelectSelectedOption:O,singleSelectSelectedIndex:v,nextPotentialSelectionIndex:S,isOptionsPanelOpen:s,options:_,selectBoxRef:this.selectBox}))},e}(E.Component);t.default=p},function(e,t,n){"use strict";var u=n(13),o="function"==typeof Symbol&&Symbol.for,p=o?Symbol.for("react.element"):60103,c=o?Symbol.for("react.portal"):60106,r=o?Symbol.for("react.fragment"):60107,l=o?Symbol.for("react.strict_mode"):60108,i=o?Symbol.for("react.profiler"):60114,a=o?Symbol.for("react.provider"):60109,s=o?Symbol.for("react.context"):60110,d=o?Symbol.for("react.concurrent_mode"):60111,f=o?Symbol.for("react.forward_ref"):60112,S=o?Symbol.for("react.suspense"):60113,_=o?Symbol.for("react.memo"):60115,v=o?Symbol.for("react.lazy"):60116,O="function"==typeof Symbol&&Symbol.iterator;function m(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;o<t;o++)n+="&args[]="+encodeURIComponent(arguments[o+1]);!function(e,t,n,o,r,l,i,a){if(!e){if((e=void 0)===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var s=[n,o,r,l,i,a],c=0;(e=Error(t.replace(/%s/g,function(){return s[c++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E={};function y(e,t,n){this.props=e,this.context=t,this.refs=E,this.updater=n||h}function b(){}function x(e,t,n){this.props=e,this.context=t,this.refs=E,this.updater=n||h}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&m("85"),this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=y.prototype;var I=x.prototype=new b;I.constructor=x,u(I,y.prototype),I.isPureReactComponent=!0;var g={current:null},P={current:null},N=Object.prototype.hasOwnProperty,T={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,n){var o=void 0,r={},l=null,i=null;if(null!=t)for(o in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(l=""+t.key),t)N.call(t,o)&&!T.hasOwnProperty(o)&&(r[o]=t[o]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps)void 0===r[o]&&(r[o]=a[o]);return{$$typeof:p,type:e,key:l,ref:i,props:r,_owner:P.current}}function R(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var L=/\/+/g,M=[];function j(e,t,n,o){if(M.length){var r=M.pop();return r.result=e,r.keyPrefix=t,r.func=n,r.context=o,r.count=0,r}return{result:e,keyPrefix:t,func:n,context:o,count:0}}function A(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,M.length<10&&M.push(e)}function D(e,t,n){return null==e?0:function e(t,n,o,r){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var i=!1;if(null===t)i=!0;else switch(l){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case p:case c:i=!0}}if(i)return o(r,t,""===n?"."+k(t,0):n),1;if(i=0,n=""===n?".":n+":",Array.isArray(t))for(var a=0;a<t.length;a++){var s=n+k(l=t[a],a);i+=e(l,s,o,r)}else if("function"==typeof(s=null===t||"object"!=typeof t?null:"function"==typeof(s=O&&t[O]||t["@@iterator"])?s:null))for(t=s.call(t),a=0;!(l=t.next()).done;)i+=e(l=l.value,s=n+k(l,a++),o,r);else"object"===l&&m("31","[object Object]"==(o=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":o,"");return i}(e,"",t,n)}function k(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function B(e,t){e.func.call(e.context,t,e.count++)}function w(e,t,n){var o=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?H(e,o,n,function(e){return e}):null!=e&&(R(e)&&(e=function(e,t){return{$$typeof:p,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(L,"$&/")+"/")+n)),o.push(e))}function H(e,t,n,o,r){var l="";null!=n&&(l=(""+n).replace(L,"$&/")+"/"),D(e,w,t=j(t,l,o,r)),A(t)}function U(){var e=g.current;return null===e&&m("321"),e}var V={Children:{map:function(e,t,n){if(null==e)return e;var o=[];return H(e,o,null,t,n),o},forEach:function(e,t,n){if(null==e)return e;D(e,B,t=j(null,null,t,n)),A(t)},count:function(e){return D(e,function(){return null},null)},toArray:function(e){var t=[];return H(e,t,null,function(e){return e}),t},only:function(e){return R(e)||m("143"),e}},createRef:function(){return{current:null}},Component:y,PureComponent:x,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:f,render:e}},lazy:function(e){return{$$typeof:v,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:_,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return U().useCallback(e,t)},useContext:function(e,t){return U().useContext(e,t)},useEffect:function(e,t){return U().useEffect(e,t)},useImperativeHandle:function(e,t,n){return U().useImperativeHandle(e,t,n)},useDebugValue:function(){},useLayoutEffect:function(e,t){return U().useLayoutEffect(e,t)},useMemo:function(e,t){return U().useMemo(e,t)},useReducer:function(e,t,n){return U().useReducer(e,t,n)},useRef:function(e){return U().useRef(e)},useState:function(e){return U().useState(e)},Fragment:r,StrictMode:l,Suspense:S,createElement:C,cloneElement:function(e,t,n){null==e&&m("267",e);var o=void 0,r=u({},e.props),l=e.key,i=e.ref,a=e._owner;if(null!=t){void 0!==t.ref&&(i=t.ref,a=P.current),void 0!==t.key&&(l=""+t.key);var s=void 0;for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)N.call(t,o)&&!T.hasOwnProperty(o)&&(r[o]=void 0===t[o]&&void 0!==s?s[o]:t[o])}if(1===(o=arguments.length-2))r.children=n;else if(1<o){s=Array(o);for(var c=0;c<o;c++)s[c]=arguments[c+2];r.children=s}return{$$typeof:p,type:e.type,key:l,ref:i,props:r,_owner:a}},createFactory:function(e){var t=C.bind(null,e);return t.type=e,t},isValidElement:R,version:"16.8.5",unstable_ConcurrentMode:d,unstable_Profiler:i,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:g,ReactCurrentOwner:P,assign:u}},$=V;e.exports=$.default||$},function(e,t,n){"use strict";var s=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,o,r=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var i in n=Object(arguments[l]))c.call(n,i)&&(r[i]=n[i]);if(s){o=s(n);for(var a=0;a<o.length;a++)u.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(5);t.handleAlphaNumerical=o.handleAlphaNumerical;var r=n(15);t.handleBlur=r.handleBlur;var l=n(7);t.handleClick=l.handleClick;var i=n(8);t.handleEnterPressed=i.handleEnterPressed;var a=n(19);t.handleKeyEvent=a.handleKeyEvent;var s=n(9);t.handleKeyUpOrDownPressed=s.handleKeyUpOrDownPressed;var c=n(23);t.handleTouchMove=c.handleTouchMove;var u=n(24);t.handleTouchStart=u.handleTouchStart},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var d=n(0),f=n(6);t.handleBlur=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=e.props,r=t.isOptionsPanelOpen,l=t.disabled,i=t.altered,a=t.singleSelectSelectedOption,s=t.multiSelectSelectedOptions,c=o.onBlur,u=o.multiselect;if(!l){var p=n.selectBox&&!n.selectBox.contains(document.activeElement);r&&p&&n.updateState({type:d.SET_OPTIONS_PANEL_CLOSED_ONBLUR}),p&&c&&(u?f.multiSelectBroadcastChange(s.options,Boolean(i),c):f.singleSelectBroadcastChange(a,Boolean(i),c))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.multiSelectBroadcastChange=function(e,t,n,o){n&&(o&&r.isEqual(o,e)||n({options:e.map(function(e){return{name:e.name||"",text:e.text||"",value:e.value||""}}),altered:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.singleSelectBroadcastChange=function(e,t,n,o){n&&(r.isEqual(o,e)||n({name:e.name,text:e.text,value:e.value,altered:t}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.containsClassName=function(e,t){return-1<String(e.className).split(" ").indexOf(t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),s=n(20),c=n(21),u=n(5),p=n(7),d=n(8),f=n(9);t.handleKeyEvent=function(e){var t=e.event,n=e.state,o=e.props,r=e.ReactResponsiveSelectClassRef,l=n.multiselect,i=n.isOptionsPanelOpen;if(!n.disabled)switch(c.preventDefaultForKeyCodes([s.keyCodes.ENTER,s.keyCodes.SPACE,s.keyCodes.ESCAPE,s.keyCodes.UP,s.keyCodes.DOWN],t),/^[a-z0-9]+$/.test(t.key)&&u.handleAlphaNumerical({event:t,ReactResponsiveSelectClassRef:r,state:n}),t.keyCode){case s.keyCodes.TAB:i&&(t.preventDefault(),l&&r.updateState({type:a.SET_OPTIONS_PANEL_CLOSED},function(){return r.focusButton()}));break;case s.keyCodes.ENTER:d.handleEnterPressed({ReactResponsiveSelectClassRef:r,event:t,props:o,state:n});break;case s.keyCodes.SPACE:i?p.handleClick({event:t,state:n,ReactResponsiveSelectClassRef:r}):r.updateState({type:a.SET_OPTIONS_PANEL_OPEN});break;case s.keyCodes.ESCAPE:r.updateState({type:a.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION},function(){return r.focusButton()});break;case s.keyCodes.UP:f.handleKeyUpOrDownPressed({ReactResponsiveSelectClassRef:r,state:n,type:"DECREMENT"});break;case s.keyCodes.DOWN:f.handleKeyUpOrDownPressed({ReactResponsiveSelectClassRef:r,state:n,type:"INCREMENT"})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyCodes={TAB:9,ENTER:13,SPACE:32,ESCAPE:27,UP:38,DOWN:40}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.preventDefaultForKeyCodes=function(e,t){e.forEach(function(e){e===t.keyCode&&t.preventDefault()})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(4);t.getNextIndex=function(e,t){var n=t.isOptionsPanelOpen,o=t.nextPotentialSelectionIndex,r=t.options;switch(e){case"INCREMENT":return!1===n?l.nextValidIndex(t,o,"INCREMENT"):o===r.length-1?l.nextValidIndex(t,0,"INCREMENT"):l.nextValidIndex(t,o+1,"INCREMENT");case"DECREMENT":return!1===n?l.nextValidIndex(t,o,"DECREMENT"):0===o?l.nextValidIndex(t,r.length-1,"DECREMENT"):l.nextValidIndex(t,o-1,"DECREMENT");default:return l.nextValidIndex(t,0,"DECREMENT")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.handleTouchMove=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef,o=t.isDragging;t.disabled||o||n.updateState({type:r.SET_IS_DRAGGING,value:!0})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.handleTouchStart=function(e){var t=e.state,n=e.ReactResponsiveSelectClassRef;t.disabled||n.updateState({type:o.SET_IS_DRAGGING,value:!1})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCustomLabelText=function(e){var t=e.state,n=e.props,o=n.multiselect,r=n.customLabelRenderer,l=t.multiSelectSelectedOptions,i=t.singleSelectSelectedOption;return!!r&&r(o?l:i)}},function(e,t,n){"use strict";var p=this&&this.__assign||function(){return(p=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var d=n(0),f=n(4),S=n(27);t.reducer=function(e,t){switch(t.type){case d.UPDATE_VIA_PROPS:case d.INITIALISE:var n=S.getSelectedValueIndex(t.value),o=S.getMultiSelectSelectedValueIndexes(t.value,t.value.selectedValues,t.value.noSelectionLabel);return p({},e,{hasOptHeaders:t.value.options.some(function(e){return!0===e.optHeader}),multiselect:t.value.multiselect||!1,noSelectionLabel:t.value.noSelectionLabel,name:t.value.name,options:t.value.options,altered:t.value.altered||!1,disabled:t.value.disabled||!1,singleSelectInitialIndex:n,singleSelectSelectedIndex:n,singleSelectSelectedOption:S.getSingleSelectSelectedOption(t.value,n),nextPotentialSelectionIndex:e.nextPotentialSelectionIndex?e.nextPotentialSelectionIndex:n,multiSelectInitialSelectedIndexes:o,multiSelectSelectedIndexes:o,multiSelectSelectedOptions:{options:S.getMultiSelectInitialSelectedOptions(t.value,t.value.selectedValues)}});case d.SET_IS_DRAGGING:return p({},e,{isDragging:t.value});case d.SET_OPTIONS_PANEL_OPEN:var r=p({},e,{isOptionsPanelOpen:!0,nextPotentialSelectionIndex:function(){return e.multiselect?e.multiSelectSelectedIndexes.length?f.nextValidIndex(e,e.multiSelectSelectedIndexes[0]):f.nextValidIndex(e,0):f.nextValidIndex(e,e.nextPotentialSelectionIndex)}(),singleSelectSelectedOption:S.getSingleSelectSelectedOption(e,e.nextPotentialSelectionIndex)});return S.mergeIsAlteredState(r);case d.SET_OPTIONS_PANEL_CLOSED:r=p({},e,{isOptionsPanelOpen:!1,singleSelectSelectedIndex:e.nextPotentialSelectionIndex,singleSelectSelectedOption:S.getSingleSelectSelectedOption(e,e.nextPotentialSelectionIndex)});return S.mergeIsAlteredState(r);case d.SET_OPTIONS_PANEL_CLOSED_NO_SELECTION:case d.SET_OPTIONS_PANEL_CLOSED_ONBLUR:return p({},e,{isOptionsPanelOpen:!1});case d.SET_NEXT_SELECTED_INDEX:return p({},e,{nextPotentialSelectionIndex:t.value});case d.SET_NEXT_SELECTED_INDEX_ALPHA_NUMERIC:return p({},e,{isOptionsPanelOpen:!0,nextPotentialSelectionIndex:t.value});case d.SET_SINGLESELECT_OPTIONS:var l=p({},e,{nextPotentialSelectionIndex:t.value,singleSelectSelectedIndex:t.value,isOptionsPanelOpen:!1,singleSelectSelectedOption:S.getSingleSelectSelectedOption(e,t.value)});return S.mergeIsAlteredState(l);case d.SET_MULTISELECT_OPTIONS:if(!e.noSelectionLabel){var i=0===e.multiSelectSelectedIndexes[0]&&1===e.multiSelectSelectedIndexes.length,a=0<e.multiSelectSelectedIndexes.length&&!i&&0===t.value,s=i&&0!==t.value;if(a)return S.mergeIsAlteredState(S.getInitialMultiSelectOption(e));s&&(e=S.resetMultiSelectState(e))}e.noSelectionLabel&&e.multiSelectSelectedOptions.options[0].text===e.noSelectionLabel&&(e.multiSelectSelectedOptions.options=[]);var c=f.nextValidIndex(e,t.value),u=e.multiSelectSelectedIndexes.indexOf(c);return 0===(l=p({},e,{nextPotentialSelectionIndex:c,multiSelectSelectedIndexes:-1===u?S.addMultiSelectIndex(e,c):S.removeMultiSelectIndex(e,u),multiSelectSelectedOptions:-1===u?S.addMultiSelectOption(e,c):S.removeMultiSelectOption(e,u)})).multiSelectSelectedOptions.options.length&&(l=e.noSelectionLabel?p({},l,{nextPotentialSelectionIndex:e.hasOptHeaders?f.nextValidIndex(e,-1):-1,multiSelectSelectedOptions:{options:S.getMultiSelectInitialSelectedOptions(e)}}):S.getInitialMultiSelectOption(e)),S.mergeIsAlteredState(l);default:return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(28);t.addMultiSelectIndex=o.addMultiSelectIndex;var r=n(29);t.addMultiSelectOption=r.addMultiSelectOption;var l=n(30);t.getInitialMultiSelectOption=l.getInitialMultiSelectOption;var i=n(31);t.getMultiSelectInitialSelectedOptions=i.getMultiSelectInitialSelectedOptions;var a=n(32);t.getMultiSelectSelectedValueIndexes=a.getMultiSelectSelectedValueIndexes;var s=n(33);t.getSelectedValueIndex=s.getSelectedValueIndex;var c=n(34);t.getSingleSelectSelectedOption=c.getSingleSelectSelectedOption;var u=n(35);t.mergeIsAlteredState=u.mergeIsAlteredState;var p=n(36);t.removeMultiSelectIndex=p.removeMultiSelectIndex;var d=n(37);t.removeMultiSelectOption=d.removeMultiSelectOption;var f=n(38);t.resetMultiSelectState=f.resetMultiSelectState},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMultiSelectIndex=function(e,t){return e.multiSelectSelectedIndexes.concat([t])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addMultiSelectOption=function(e,t){return{options:e.multiSelectSelectedOptions.options.concat([{name:e.name,text:e.options[t].text,value:e.options[t].value}])}}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getInitialMultiSelectOption=function(e){var t=function(o){return o.options.reduce(function(e,t,n){return t.optHeader||e.push({option:{value:t.value,text:t.text,name:o.name},index:n}),e},[])[0]}(e),n=t.option,o=t.index;return r({},e,{multiSelectSelectedIndexes:[o],multiSelectSelectedOptions:{options:[r({},n)]},nextPotentialSelectionIndex:o})}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getMultiSelectInitialSelectedOptions=function(t,e){var n;if(t.noSelectionLabel)return n=e&&0<e.length?t.options.filter(function(t){return e.some(function(e){return e===t.value})}).map(function(e){return r({name:t.name},e)}):[{name:t.name,text:t.noSelectionLabel,value:"null"}];if(e&&0<e.length)n=t.options.filter(function(t){return e.some(function(e){return e===t.value})}).map(function(e){return r({name:t.name},e)});else{var o=t.options[0]&&t.options[0].optHeader?function(e){if(e.multiSelectSelectedOptions&&e.multiSelectSelectedOptions.options.length)return e.multiSelectSelectedOptions.options[0];var t=e.options.reduce(function(e,t){return t.optHeader||e.push(t),e},[]);return{name:e.name,text:t[0].text,value:t[0].value}}(t):t.options[0];n=[{name:t.name,text:o.text,value:o.value}]}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4);t.getMultiSelectSelectedValueIndexes=function(e,o,t){void 0===o&&(o=[]);var n=e.options,r=t?[]:[i.nextValidIndex(e,0)],l=n.reduce(function(e,t,n){return o.some(function(e){return t.value===e})&&e.push(n),e},[]);return 0<l.length?l:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSelectedValueIndex=function(e){var t=e.options,n=e.selectedValue,o=e.noSelectionLabel,r=n?t.map(function(e){return e.value}).indexOf(n):-1;return-1<r||o?r:0}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getSingleSelectSelectedOption=function(e,t){void 0===t&&(t=0);var n=-1!==t||e.noSelectionLabel?t:0;return e.options[n]&&e.options[n].optHeader?function(e){if(e.singleSelectSelectedOption)return e.singleSelectSelectedOption;var t=e.options.reduce(function(e,t){return t.optHeader||e.push(t),e},[]);return o({},t[0],{name:e.name})}(e):e.noSelectionLabel?-1<t?o({name:e.name},e.options[t]):{name:e.name,text:e.noSelectionLabel,value:"null"}:o({name:e.name},e.options[n])}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function r(e){return e.multiselect?!(JSON.stringify(e.multiSelectInitialSelectedIndexes)===JSON.stringify(e.multiSelectSelectedIndexes)):e.singleSelectSelectedIndex!==e.singleSelectInitialIndex}Object.defineProperty(t,"__esModule",{value:!0}),t.isAltered=r,t.mergeIsAlteredState=function(e){return o({},e,{altered:r(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMultiSelectIndex=function(e,t){return e.multiSelectSelectedIndexes.slice(0,t).concat(e.multiSelectSelectedIndexes.slice(t+1))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeMultiSelectOption=function(e,t){return{options:e.multiSelectSelectedOptions.options.slice(0,t).concat(e.multiSelectSelectedOptions.options.slice(t+1))}}},function(e,t,n){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var r=n(10);t.resetMultiSelectState=function(e){return o({},e,{multiSelectSelectedIndexes:r.initialState.multiSelectSelectedIndexes.slice(),multiSelectSelectedOptions:o({},r.initialState.multiSelectSelectedOptions)})}},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var f=n(1),S=n(2),_=n(40),r=function(n){function e(e){var t=n.call(this,e)||this;return t.optionsButton=f.createRef(),t.optionsContainer=f.createRef(),t}return o(e,n),e.prototype.componentDidUpdate=function(e){var t=this.props,n=t.isOptionsPanelOpen,o=t.selectBoxRef;!n&&e.isOptionsPanelOpen&&o&&o.contains(document.activeElement)&&this.optionsButton.current&&this.optionsButton.current.focus()},e.prototype.getAriaLabel=function(){var e=this.props,t=e.multiSelectSelectedOptions,n=e.prefix,o=t.options.length;return S.default("\n Checkbox group "+(n?n+" ":"")+" has\n "+o+" item"+(1===o?"":"s")+" selected.\n Selected option"+(1===o?"":"s")+" "+(1===o?"is":"are")+"\n "+t.options.map(function(e){return e.text||""}).join(" and ")+"\n ")},e.prototype.render=function(){var n=this,e=this.props,t=e.caretIcon,o=e.customLabelText,r=e.disabled,l=e.isOptionsPanelOpen,i=e.multiSelectSelectedIndexes,a=e.multiSelectSelectedOptions,s=e.name,c=e.options,u=e.nextPotentialSelectionIndex,p=e.prefix,d="";return f.createElement("div",null,f.createElement("div",{role:"button",tabIndex:0,"aria-disabled":r,"aria-haspopup":"true","aria-expanded":l,"aria-controls":"rrs-"+s+"-menu",ref:this.optionsButton,className:S.default("\n rrs__button\n "+(!0===r?"rrs__button--disabled":"")+"\n ")},o&&f.createElement("div",{className:"rrs__label"},f.createElement("span",{"aria-label":this.getAriaLabel(),className:"rrs__label__text",id:"rrs-"+s+"-label","data-testid":"rrs-label_"+s},o),t&&t),!o&&f.createElement("div",{className:"rrs__label"},f.createElement("span",{"aria-label":this.getAriaLabel(),className:"rrs__label__text",id:"rrs-"+s+"-label","data-testid":"rrs-label_"+s},f.createElement("span",{className:"rrs__multiselect-label"},f.createElement("span",{className:"rrs__multiselect-label__text"},(p?p+" ":"")+"\n "+(0<a.options.length?a.options[0].text:"")),1<a.options.length&&f.createElement("span",{className:"rrs__multiselect-label__badge"},"+ "+(a.options.length-1)))),t&&t),s&&f.createElement("input",{type:"hidden",name:s,"data-testid":"rrs-input_"+s,value:[a.options.map(function(e){return e.value})].join(",")})),f.createElement("ul",{id:"rrs-"+s+"-menu","aria-labelledby":"rrs-"+s+"-label",role:"menu",className:"rrs__options",ref:this.optionsContainer},0<c.length&&c.map(function(e,t){return e.optHeader&&(d=e.text||e.markup&&e.markup.textContent||""),f.createElement(_.MultiSelectOption,{key:t,name:s,optHeaderLabel:d,optionsContainerRef:n.optionsContainer,index:t,option:e,isOptionsPanelOpen:l,multiSelectSelectedIndexes:i,nextPotentialSelectionIndex:u})})))},e}(f.Component);t.MultiSelect=r},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),c=n(2),r=function(n){function e(e){var t=n.call(this,e)||this;return t.optionRef=s.createRef(),t}return o(e,n),e.prototype.getScrollOffset=function(){var e=document.querySelector(".rrs__option--header");return Math.ceil(e&&e.getBoundingClientRect().height||0)},e.prototype.componentDidUpdate=function(){var e=this.props,t=e.index,n=e.isOptionsPanelOpen,o=e.nextPotentialSelectionIndex,r=e.optionsContainerRef,l=e.optHeaderLabel;if(t===o&&n&&this.optionRef.current&&r.current&&(this.optionRef.current.focus(),""!==l)){var i=Math.ceil(this.optionRef.current.getBoundingClientRect().top-r.current.getBoundingClientRect().top);this.scrollOffset=this.scrollOffset||this.getScrollOffset(),i<this.scrollOffset&&r.current.scroll(0,Math.floor(r.current.scrollTop-this.scrollOffset))}},e.prototype.isDisabled=function(e){return Boolean(e.disabled||e.optHeader)},e.prototype.render=function(){var e=this.props,t=e.index,n=e.name,o=e.multiSelectSelectedIndexes,r=e.nextPotentialSelectionIndex,l=e.option,i=e.optHeaderLabel,a=o.some(function(e){return e===t});return s.createElement("li",{role:"checkbox","data-testid":"rrs-option_"+n+"_"+t,tabIndex:-1,"aria-checked":a,"aria-label":"\n "+(l.text||l.markup&&l.markup.textContent)+" "+(""!==i?" of "+i:"")+"\n ","aria-live":"assertive","aria-disabled":this.isDisabled(l)?"true":"false","data-key":t,ref:this.optionRef,className:c.default("\n rrs__option\n "+(a?"rrs__option--selected":"")+"\n "+(r===t?"rrs__option--next-selection":"")+"\n "+(!0===l.disabled?"rrs__option--disabled":"")+"\n "+(!0===l.optHeader?"rrs__option--header":"")+"\n ")},l.markup||l.text)},e}(s.Component);t.MultiSelectOption=r},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var p=n(1),d=n(2),f=n(42),r=function(n){function e(e){var t=n.call(this,e)||this;return t.optionsButton=p.createRef(),t.optionsContainer=p.createRef(),t}return o(e,n),e.prototype.componentDidUpdate=function(e){var t=this.props,n=t.isOptionsPanelOpen,o=t.nextPotentialSelectionIndex,r=t.selectBoxRef,l=!n&&e.isOptionsPanelOpen;this.optionsButton.current&&(l&&r&&r.contains(document.activeElement)&&this.optionsButton.current.focus(),n&&-1===o&&this.optionsButton.current.focus())},e.prototype.getCustomLabel=function(){var e=this.props,t=e.prefix,n=e.name,o=e.singleSelectSelectedOption,r=e.caretIcon,l=e.customLabelText;return p.createElement("div",{className:"rrs__label"},p.createElement("span",{"aria-label":(t?t+" ":"")+o.text+" selected",className:"rrs__label__text",id:"rrs-"+n+"-label","data-testid":"rrs-label_"+n},l),r&&r)},e.prototype.getDefaultLabel=function(){var e=this.props,t=e.prefix,n=e.singleSelectSelectedOption,o=e.name,r=e.caretIcon,l=e.singleSelectSelectedIndex,i=e.noSelectionLabel;return-1===l?p.createElement("div",{className:"rrs__label"},p.createElement("span",{"aria-label":i,className:"rrs__label__text",id:"rrs-"+o+"-label","data-testid":"rrs-label_"+o},t&&p.createElement("span",null,t),i),r&&r):p.createElement("div",{className:"rrs__label"},p.createElement("span",{"aria-label":(t?t+" ":"")+n.text+" selected",className:"rrs__label__text",id:"rrs-"+o+"-label","data-testid":"rrs-label_"+o},t&&p.createElement("span",null,t),n.text?n.text:p.createElement("div",null," ")),r&&r)},e.prototype.render=function(){var n=this,e=this.props,t=e.customLabelText,o=e.disabled,r=e.isOptionsPanelOpen,l=e.name,i=e.nextPotentialSelectionIndex,a=e.options,s=e.singleSelectSelectedIndex,c=e.singleSelectSelectedOption,u="";return p.createElement("div",null,p.createElement("div",{role:"button",tabIndex:0,"aria-disabled":o,"aria-haspopup":"true","aria-expanded":r,"aria-controls":"rrs-"+l+"-menu",ref:this.optionsButton,className:d.default("\n rrs__button\n "+(!0===o?"rrs__button--disabled":"")+"\n ")},t?this.getCustomLabel():this.getDefaultLabel(),l&&p.createElement("input",{type:"hidden",name:l,"data-testid":"rrs-input_"+l,value:c.value})),p.createElement("ul",{id:"rrs-"+l+"-menu","aria-labelledby":"rrs-"+l+"-label",role:"menu",className:"rrs__options",ref:this.optionsContainer},0<a.length&&a.map(function(e,t){return e.optHeader&&(u=e.text||e.markup&&e.markup.textContent||""),p.createElement(f.SingleSelectOption,{key:t,name:l,optHeaderLabel:u,optionsContainerRef:n.optionsContainer,index:t,isOptionsPanelOpen:r,option:e,singleSelectSelectedIndex:s,nextPotentialSelectionIndex:i})})))},e}(p.Component);t.SingleSelect=r},function(e,t,n){"use strict";var o=this&&this.__extends||function(){var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};return function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),s=n(2),r=function(n){function e(e){var t=n.call(this,e)||this;return t.optionRef=a.createRef(),t}return o(e,n),e.prototype.getScrollOffset=function(){var e=document.querySelector(".rrs__option--header");return Math.ceil(e&&e.getBoundingClientRect().height||0)},e.prototype.componentDidUpdate=function(){var e=this.props,t=e.index,n=e.isOptionsPanelOpen,o=e.nextPotentialSelectionIndex,r=e.optionsContainerRef,l=e.optHeaderLabel;if(t===o&&n&&this.optionRef.current&&r.current&&(this.optionRef.current.focus(),""!==l)){var i=Math.ceil(this.optionRef.current.getBoundingClientRect().top-r.current.getBoundingClientRect().top);this.scrollOffset=this.scrollOffset||this.getScrollOffset(),i<this.scrollOffset&&r.current.scroll(0,Math.floor(r.current.scrollTop-this.scrollOffset))}},e.prototype.isDisabled=function(e){return Boolean(e.disabled||e.optHeader)},e.prototype.render=function(){var e=this.props,t=e.index,n=e.name,o=e.nextPotentialSelectionIndex,r=e.option,l=e.singleSelectSelectedIndex,i=e.optHeaderLabel;return a.createElement("li",{role:"menuitem","data-testid":"rrs-option_"+n+"_"+t,tabIndex:-1,"aria-disabled":this.isDisabled(r)?"true":"false","aria-label":"\n "+(r.text||r.markup&&r.markup.textContent)+" "+(""!==i?" of "+i:"")+"\n ","data-key":t,ref:this.optionRef,className:s.default("\n rrs__option\n "+(l===t?"rrs__option--selected":"")+"\n "+(o===t?"rrs__option--next-selection":"")+"\n "+(!0===r.disabled?"rrs__option--disabled":"")+"\n "+(!0===r.optHeader?"rrs__option--header":"")+"\n ")},r.markup||r.text)},e}(a.Component);t.SingleSelectOption=r}])});
//# sourceMappingURL=ReactResponsiveSelect.min.js.map
{
"name": "react-responsive-select",
"version": "5.0.1-aplha.1",
"version": "5.0.1",
"description": "A React customisable, touchable, single-select / multi-select form component. Built with keyboard and screen reader accessibility in mind.",
"main": "dist/ReactResponsiveSelect.js",
"types": "dist/ReactResponsiveSelect.d.ts",
"types": "ts/ReactResponsiveSelect.d.ts",
"scripts": {

@@ -8,0 +8,0 @@ "compile": "rm -rf dist ts ts-esm && tsc && tsc -m es6 --outDir ts-esm && webpack --config webpack.output.js --json > stats.json && cp src/ReactResponsiveSelect.css dist/ReactResponsiveSelect.css",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet