!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={4656:e=>{e.exports=require("i18n-react/dist/i18n-react")},6689:e=>{e.exports=require("react")},1929:e=>{e.exports=require("react-select")}},t={};function a(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,a),s.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 r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{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 r={};return(()=>{a.r(r),a.d(r,{default:()=>l});var e=a(6689),t=a.n(e),n=a(1929),s=a.n(n),o=a(4656),i=a.n(o);class l extends t().Component{constructor(e){super(e),this.state={summitValue:null},this.handleChange=this.handleChange.bind(this),this.handleClick=this.handleClick.bind(this)}handleChange(e){this.setState({summitValue:e})}handleClick(e){e.preventDefault(),this.props.onClick(this.state.summitValue.value)}render(){let{summits:e,actionLabel:a,actionClass:r}=this.props,n=e.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}))),o=this.props.hasOwnProperty("big")?"big":"";return t().createElement("div",{className:"summit-dropdown btn-group "+o},t().createElement(s(),{id:"summit-select",value:this.state.summitValue,onChange:this.handleChange,options:n,placeholder:i().translate("general.select_summit"),className:"btn-group summit-select text-left",isClearable:!1}),t().createElement("button",{type:"button",className:`btn btn-default ${r}`,onClick:this.handleClick},a))}}})(),r})()));
//# sourceMappingURL=summit-dropdown.js.map