!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},2015:e=>{e.exports=require("react")},8466:e=>{e.exports=require("react-select")}},t={};function a(s){var o=t[s];if(void 0!==o)return o.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,a),n.exports}(()=>{a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t}})(),(()=>{a.d=(e,t)=>{for(var s in t)a.o(t,s)&&!a.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}})(),(()=>{a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var s={};a.r(s),a.d(s,{default:()=>d});var o=a(2015),n=a.n(o),i=a(8466),r=a.n(i),l=a(6842),u=a.n(l);class d extends n().Component{constructor(e){super(e),this.state={summitValue:null},this.handleChange=this.handleChange.bind(this),this.handleClick=this.handleClick.bind(this)}handleChange(e){const t=void 0!==(null==e?void 0:e.value)?e:this.state.summitValue;this.setState({summitValue:t})}handleClick(e){var t,a;e.preventDefault(),void 0!==(null===(t=this.state)||void 0===t||null===(a=t.summitValue)||void 0===a?void 0:a.value)&&this.props.onClick(this.state.summitValue.value)}render(){var e;let{summits:t,actionLabel:a,actionClass:s}=this.props,o=[...t].sort(((e,t)=>e.start_date<t.start_date?1:e.start_date>t.start_date?-1:0)).map((e=>({label:e.name,value:e.id}))),i=this.props.hasOwnProperty("big")?"big":"";const l=void 0===(null===(e=this.state.summitValue)||void 0===e?void 0:e.value);return n().createElement("div",{className:"summit-dropdown btn-group "+i},n().createElement(r(),{id:"summit-select",value:this.state.summitValue,onChange:this.handleChange,options:o,placeholder:u().translate("general.select_summit"),className:"btn-group summit-select text-left",isClearable:!1}),n().createElement("button",{type:"button",className:`btn btn-default ${s}`,disabled:l,onClick:this.handleClick},a))}}return s})()));
//# sourceMappingURL=summit-dropdown.js.map