webpackJsonp([8],{0:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}s(291);var a=s(3),r=n(a),o=s(1),i=n(o),l=s(12),u=n(l),d=s(10),p=s(183),c=n(p),f=s(198),h=n(f),m=s(189),y=n(m),v=s(193),g=n(v),b=s(182),P=n(b);window.PTL=window.PTL||{};var T={user:h.default,language:y.default,project:g.default};PTL.userAdmin={init:function(){(0,r.default)(document).ready(function(){var e=function(e){var t={results:r.default.map(e.items.results,function(e){var t={id:e.id,text:e.text};return t})};return t.pagination={more:e.items.more_results},t};(0,r.default)(".js-s2-new-members").on("s2-process-data",function(e,t){return PTL.s2.processData(t)}),(0,r.default)(".js-s2-new-members").on("s2-process-results",function(t,s){return e(s)}),(0,r.default)(".js-s2-new-members").on("s2-template-result",function(e,t){return PTL.s2.templateResult(t)})})}},PTL.admin={init:function(e){if(!T.hasOwnProperty(e.itemType))throw new Error("Invalid `itemType`.");u.default.render(i.default.createElement(c.default,{adminModule:T[e.itemType],appRoot:e.appRoot,formChoices:e.formChoices||{},router:new P.default}),(0,d.q)(".js-admin-app"))}}},9:function(e,t,s){var n,a;/*!
	  Copyright (c) 2016 Jed Watson.
	  Licensed under the MIT License (MIT), see
	  http://jedwatson.github.io/classnames
	*/
!function(){"use strict";function s(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n))e.push(s.apply(null,n));else if("object"===a)for(var o in n)r.call(n,o)&&n[o]&&e.push(o)}}return e.join(" ")}var r={}.hasOwnProperty;"undefined"!=typeof e&&e.exports?e.exports=s:(n=[],a=function(){return s}.apply(t,n),!(void 0!==a&&(e.exports=a)))}()},10:function(e,t){"use strict";function s(e){return document.querySelector(e)}function n(e){var t=document.querySelectorAll(e);return Array.prototype.slice.call(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.q=s,t.qAll=n},16:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},r=s(1),o=n(r),i=s(34),l=n(i),u=s(36),d=n(u),p=s(35),c=n(p),f=o.default.createClass({displayName:"FormElement",propTypes:{type:o.default.PropTypes.string,label:o.default.PropTypes.string.isRequired,multiple:o.default.PropTypes.bool,name:o.default.PropTypes.string.isRequired,handleChange:o.default.PropTypes.func.isRequired,value:o.default.PropTypes.oneOfType([o.default.PropTypes.array,o.default.PropTypes.bool,o.default.PropTypes.number,o.default.PropTypes.string,o.default.PropTypes.array]).isRequired,help:o.default.PropTypes.string,errors:o.default.PropTypes.array},getDefaultProps:function(){return{type:"text"}},render:function(){var e=this.props.errors,t="id_"+this.props.name,s=this.props.help,n={text:d.default,email:d.default,password:d.default,textarea:d.default,checkbox:l.default,radio:l.default,select:c.default}[this.props.type];return o.default.createElement("div",{className:"field-wrapper"},o.default.createElement("label",{htmlFor:t},this.props.label),o.default.createElement(n,a({id:t},this.props)),e&&o.default.createElement("ul",{className:"errorlist"},e.map(function(e,t){return o.default.createElement("li",{key:t},e)})),s&&o.default.createElement("span",{className:"helptext"},s))}});t.default=f},18:function(e,t,s){/*!
	  Copyright (c) 2015 Jed Watson.
	  Licensed under the MIT License (MIT), see
	  http://jedwatson.github.io/classnames
	*/
function n(){for(var e,t="",s=0;s<arguments.length;s++)if(e=arguments[s])if("string"==typeof e||"number"==typeof e)t+=" "+e;else if("[object Array]"===Object.prototype.toString.call(e))t+=" "+n.apply(null,e);else if("object"==typeof e)for(var a in e)e.hasOwnProperty(a)&&e[a]&&(t+=" "+a);return t.substr(1)}var a,r;"undefined"!=typeof e&&e.exports&&(e.exports=n),a=[],r=function(){return n}.apply(t,a),!(void 0!==r&&(e.exports=r))},23:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.FormMixin=void 0;var a=s(6),r=n(a),o=s(56),i=n(o),l=t.FormMixin={mixins:[i.default],getInitialState:function(){return{isDirty:!1}},handleChange:function(e,t){var s=r.default.extend({},this.state.formData);s[e]=t;var n=!r.default.isEqual(s,this.initialData);this.setState({isDirty:n,formData:s})},handleFormSuccess:function(){this.clearValidation(),this.initialData=r.default.extend({},this.state.formData),this.setState({isDirty:!1}),this.handleSuccess&&this.handleSuccess(this.getResource())},handleFormError:function(e){this.validateResponse(e),this.handleError&&this.handleError(e)}};t.default=l},27:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},r=s(32),o=n(r),i=s(1),l=n(i),u=l.default.createClass({displayName:"AutosizeTextarea",componentDidMount:function(){(0,o.default)(this.refs.textarea)},componentDidUpdate:function(){var e=this;setTimeout(function(){return o.default.update(e.refs.textarea)},0)},componentWillUnmount:function(){o.default.destroy(this.refs.textarea)},render:function(){return l.default.createElement("textarea",a({ref:"textarea"},this.props))}});t.default=u},32:function(e,t,s){var n,a,r;/*!
		Autosize 3.0.21
		license: MIT
		http://www.jacklmoore.com/autosize
	*/
!function(s,o){a=[t,e],n=o,r="function"==typeof n?n.apply(t,a):n,!(void 0!==r&&(e.exports=r))}(this,function(e,t){"use strict";function s(e){function t(){var t=window.getComputedStyle(e,null);"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),l="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(l)&&(l=0),i()}function s(t){var s=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=s,e.style.overflowY=t}function n(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function a(){var t=e.style.height,s=n(e),a=document.documentElement&&document.documentElement.scrollTop;e.style.height="auto";var r=e.scrollHeight+l;return 0===e.scrollHeight?void(e.style.height=t):(e.style.height=r+"px",u=e.clientWidth,s.forEach(function(e){e.node.scrollTop=e.scrollTop}),void(a&&(document.documentElement.scrollTop=a)))}function i(){a();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r!==t?"hidden"===n.overflowY&&(s("scroll"),a(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(s("hidden"),a(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),d!==r){d=r;var i=o("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var l=null,u=e.clientWidth,d=null,p=function(){e.clientWidth!==u&&i()},c=function(t){window.removeEventListener("resize",p,!1),e.removeEventListener("input",i,!1),e.removeEventListener("keyup",i,!1),e.removeEventListener("autosize:destroy",c,!1),e.removeEventListener("autosize:update",i,!1),Object.keys(t).forEach(function(s){e.style[s]=t[s]}),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",c,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",i,!1),window.addEventListener("resize",p,!1),e.addEventListener("input",i,!1),e.addEventListener("autosize:update",i,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:c,update:i}),t()}}function n(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var r="function"==typeof Map?new Map:function(){var e=[],t=[];return{has:function(t){return e.indexOf(t)>-1},get:function(s){return t[e.indexOf(s)]},set:function(s,n){e.indexOf(s)===-1&&(e.push(s),t.push(n))},delete:function(s){var n=e.indexOf(s);n>-1&&(e.splice(n,1),t.splice(n,1))}}}(),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var i=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(i=function(e){return e},i.destroy=function(e){return e},i.update=function(e){return e}):(i=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return s(e,t)}),e},i.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],n),e},i.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.exports=i})},34:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},r=s(1),o=n(r),i=o.default.createClass({displayName:"FormCheckedInput",propTypes:{handleChange:o.default.PropTypes.func.isRequired,value:o.default.PropTypes.bool.isRequired},handleChange:function(e){this.props.handleChange(e.target.name,e.target.checked)},render:function(){return o.default.createElement("input",a({checked:this.props.value,onChange:this.handleChange},this.props))}});t.default=i},35:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},r=s(1),o=n(r),i=s(41),l=n(i),u=o.default.createClass({displayName:"FormSelectInput",propTypes:{handleChange:o.default.PropTypes.func.isRequired,multiple:o.default.PropTypes.bool,name:o.default.PropTypes.string.isRequired,options:o.default.PropTypes.array.isRequired,value:o.default.PropTypes.oneOfType([o.default.PropTypes.array,o.default.PropTypes.number,o.default.PropTypes.string,o.default.PropTypes.array]).isRequired},handleChange:function(e){var t=this.props.multiple?e.split(","):e;this.props.handleChange(this.props.name,t)},render:function(){var e=this.props.value,t=this.props.multiple?e:e.toString();return o.default.createElement(l.default,a({clearAllText:gettext("Clear all"),clearValueText:gettext("Clear value"),noResultsText:gettext("No results found"),onChange:this.handleChange,placeholder:gettext("Select..."),searchPromptText:gettext("Type to search")},this.props,{multi:this.props.multiple,value:t}))}});t.default=u},36:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},r=s(1),o=n(r),i=s(27),l=n(i),u=o.default.createClass({displayName:"FormValueInput",propTypes:{handleChange:o.default.PropTypes.func.isRequired,autosize:o.default.PropTypes.bool,type:o.default.PropTypes.string,value:o.default.PropTypes.string},getDefaultProps:function(){return{autosize:!0}},handleChange:function(e){this.props.handleChange(e.target.name,e.target.value)},render:function(){return"textarea"===this.props.type?this.props.autosize?o.default.createElement(l.default,a({onChange:this.handleChange},this.props)):o.default.createElement("textarea",a({onChange:this.handleChange},this.props)):o.default.createElement("input",a({onChange:this.handleChange},this.props))}});t.default=u},39:function(e,t,s){"use strict";var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},a=s(1),r={position:"absolute",visibility:"hidden",height:0,width:0,overflow:"scroll",whiteSpace:"pre"},o=("undefined"!=typeof window?function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}().bind(window):void 0,a.createClass({displayName:"AutosizeInput",propTypes:{value:a.PropTypes.any,defaultValue:a.PropTypes.any,onChange:a.PropTypes.func,style:a.PropTypes.object,className:a.PropTypes.string,minWidth:a.PropTypes.oneOfType([a.PropTypes.number,a.PropTypes.string]),inputStyle:a.PropTypes.object,inputClassName:a.PropTypes.string},getDefaultProps:function(){return{minWidth:1}},getInitialState:function(){return{inputWidth:this.props.minWidth}},componentDidMount:function(){this.copyInputStyles(),this.updateInputWidth()},componentDidUpdate:function(){this.updateInputWidth()},copyInputStyles:function(){if(this.isMounted()&&window.getComputedStyle){var e=window.getComputedStyle(this.refs.input);if(e){var t=this.refs.sizer;if(t.style.fontSize=e.fontSize,t.style.fontFamily=e.fontFamily,t.style.fontWeight=e.fontWeight,t.style.fontStyle=e.fontStyle,t.style.letterSpacing=e.letterSpacing,this.props.placeholder){var s=this.refs.placeholderSizer;s.style.fontSize=e.fontSize,s.style.fontFamily=e.fontFamily,s.style.fontWeight=e.fontWeight,s.style.fontStyle=e.fontStyle,s.style.letterSpacing=e.letterSpacing}}}},updateInputWidth:function(){if(this.isMounted()&&"undefined"!=typeof this.refs.sizer.scrollWidth){var e=void 0;e=this.props.placeholder?Math.max(this.refs.sizer.scrollWidth,this.refs.placeholderSizer.scrollWidth)+2:this.refs.sizer.scrollWidth+2,e<this.props.minWidth&&(e=this.props.minWidth),e!==this.state.inputWidth&&this.setState({inputWidth:e})}},getInput:function(){return this.refs.input},focus:function(){this.refs.input.focus()},blur:function(){this.refs.input.blur()},select:function(){this.refs.input.select()},render:function(){var e=this.props.defaultValue||this.props.value||"",t=this.props.style||{};t.display||(t.display="inline-block");var s=n({},this.props.inputStyle);s.width=this.state.inputWidth+"px",s.boxSizing="content-box";var o=this.props.placeholder?a.createElement("div",{ref:"placeholderSizer",style:r},this.props.placeholder):null;return a.createElement("div",{className:this.props.className,style:t},a.createElement("input",n({},this.props,{ref:"input",className:this.props.inputClassName,style:s})),a.createElement("div",{ref:"sizer",style:r},e),o)}}));e.exports=o},40:function(e,t,s){"use strict";var n=s(1),a=s(9),r=n.createClass({displayName:"Option",propTypes:{addLabelText:n.PropTypes.string,className:n.PropTypes.string,mouseDown:n.PropTypes.func,mouseEnter:n.PropTypes.func,mouseLeave:n.PropTypes.func,option:n.PropTypes.object.isRequired,renderFunc:n.PropTypes.func},blockEvent:function(e){e.preventDefault(),"A"===e.target.tagName&&"href"in e.target&&(e.target.target?window.open(e.target.href):window.location.href=e.target.href)},handleMouseDown:function(e){this.props.mouseDown(this.props.option,e)},handleMouseEnter:function(e){this.props.mouseEnter(this.props.option,e)},handleMouseLeave:function(e){this.props.mouseLeave(this.props.option,e)},render:function(){var e=this.props.option,t=e.create?this.props.addLabelText.replace("{label}",e.label):this.props.renderFunc(e),s=a(this.props.className,e.className);return e.disabled?n.createElement("div",{className:s,onMouseDown:this.blockEvent,onClick:this.blockEvent},t):n.createElement("div",{className:s,style:e.style,onMouseDown:this.handleMouseDown,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onClick:this.handleMouseDown,title:e.title},t)}});e.exports=r},41:function(e,t,s){"use strict";function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},r=s(1),o=s(12),i=s(39),l=s(9),u=s(43),d=s(42),p=s(40),c=0,f=r.createClass({displayName:"Select",propTypes:{addLabelText:r.PropTypes.string,allowCreate:r.PropTypes.bool,asyncOptions:r.PropTypes.func,autoload:r.PropTypes.bool,backspaceRemoves:r.PropTypes.bool,cacheAsyncResults:r.PropTypes.bool,className:r.PropTypes.string,clearAllText:r.PropTypes.string,clearValueText:r.PropTypes.string,clearable:r.PropTypes.bool,delimiter:r.PropTypes.string,disabled:r.PropTypes.bool,filterOption:r.PropTypes.func,filterOptions:r.PropTypes.func,ignoreCase:r.PropTypes.bool,inputProps:r.PropTypes.object,isLoading:r.PropTypes.bool,labelKey:r.PropTypes.string,matchPos:r.PropTypes.string,matchProp:r.PropTypes.string,multi:r.PropTypes.bool,name:r.PropTypes.string,newOptionCreator:r.PropTypes.func,noResultsText:r.PropTypes.string,onBlur:r.PropTypes.func,onChange:r.PropTypes.func,onFocus:r.PropTypes.func,onInputChange:r.PropTypes.func,onOptionLabelClick:r.PropTypes.func,optionComponent:r.PropTypes.func,optionRenderer:r.PropTypes.func,options:r.PropTypes.array,placeholder:r.PropTypes.string,searchable:r.PropTypes.bool,searchingText:r.PropTypes.string,searchPromptText:r.PropTypes.string,singleValueComponent:r.PropTypes.func,value:r.PropTypes.any,valueComponent:r.PropTypes.func,valueKey:r.PropTypes.string,valueRenderer:r.PropTypes.func},getDefaultProps:function(){return{addLabelText:'Add "{label}"?',allowCreate:!1,asyncOptions:void 0,autoload:!0,backspaceRemoves:!0,cacheAsyncResults:!0,className:void 0,clearAllText:"Clear all",clearValueText:"Clear value",clearable:!0,delimiter:",",disabled:!1,ignoreCase:!0,inputProps:{},isLoading:!1,labelKey:"label",matchPos:"any",matchProp:"any",name:void 0,newOptionCreator:void 0,noResultsText:"No results found",onChange:void 0,onInputChange:void 0,onOptionLabelClick:void 0,optionComponent:p,options:void 0,placeholder:"Select...",searchable:!0,searchingText:"Searching...",searchPromptText:"Type to search",singleValueComponent:d,value:void 0,valueComponent:u,valueKey:"value"}},getInitialState:function(){return{isFocused:!1,isLoading:!1,isOpen:!1,options:this.props.options}},componentWillMount:function(){var e=this;this._optionsCache={},this._optionsFilterString="",this._closeMenuIfClickedOutside=function(t){if(e.state.isOpen){var s=o.findDOMNode(e.refs.selectMenuContainer),n=o.findDOMNode(e.refs.control),a=e.clickedOutsideElement(s,t),r=e.clickedOutsideElement(n,t);a&&r&&e.setState({isOpen:!1},e._unbindCloseMenuIfClickedOutside)}},this._bindCloseMenuIfClickedOutside=function(){!document.addEventListener&&document.attachEvent?document.attachEvent("onclick",e._closeMenuIfClickedOutside):document.addEventListener("click",e._closeMenuIfClickedOutside)},this._unbindCloseMenuIfClickedOutside=function(){!document.removeEventListener&&document.detachEvent?document.detachEvent("onclick",e._closeMenuIfClickedOutside):document.removeEventListener("click",e._closeMenuIfClickedOutside)},this.setState(this.getStateFromValue(this.props.value))},componentDidMount:function(){this.props.asyncOptions&&this.props.autoload&&this.autoloadAsyncOptions()},componentWillUnmount:function(){clearTimeout(this._blurTimeout),clearTimeout(this._focusTimeout),this.state.isOpen&&this._unbindCloseMenuIfClickedOutside()},componentWillReceiveProps:function(e){var t=this,s=!1;if(JSON.stringify(e.options)!==JSON.stringify(this.props.options)&&(s=!0,this.setState({options:e.options,filteredOptions:this.filterOptions(e.options)})),e.value!==this.state.value||e.placeholder!==this.props.placeholder||s){var n=function(s){t.setState(t.getStateFromValue(e.value,s&&s.options||e.options,e.placeholder))};this.props.asyncOptions?this.loadAsyncOptions(e.value,{},n):n()}},componentDidUpdate:function(){var e=this;if(!this.props.disabled&&this._focusAfterUpdate&&(clearTimeout(this._blurTimeout),clearTimeout(this._focusTimeout),this._focusTimeout=setTimeout(function(){e.isMounted()&&(e.getInputNode().focus(),e._focusAfterUpdate=!1)},50)),this._focusedOptionReveal){if(this.refs.focused&&this.refs.menu){var t=o.findDOMNode(this.refs.focused),s=o.findDOMNode(this.refs.menu),n=t.getBoundingClientRect(),a=s.getBoundingClientRect();(n.bottom>a.bottom||n.top<a.top)&&(s.scrollTop=t.offsetTop+t.clientHeight-s.offsetHeight)}this._focusedOptionReveal=!1}},focus:function(){this.getInputNode().focus()},clickedOutsideElement:function(e,t){for(var s=t.target?t.target:t.srcElement;null!=s;){if(s===e)return!1;s=s.offsetParent}return!0},getStateFromValue:function(e,t,s){var n=this;t||(t=this.state.options),s||(s=this.props.placeholder),this._optionsFilterString="";var a,r=this.initValuesArray(e,t),o=this.filterOptions(t,r),i=null;return!this.props.multi&&r.length?(a=r[0],i=r[0][this.props.valueKey]):(a=this.getFirstFocusableOption(o),i=r.map(function(e){return e[n.props.valueKey]}).join(this.props.delimiter)),{value:i,values:r,inputValue:"",filteredOptions:o,placeholder:!this.props.multi&&r.length?r[0][this.props.labelKey]:s,focusedOption:a}},getFirstFocusableOption:function(e){for(var t=0;t<e.length;++t)if(!e[t].disabled)return e[t]},initValuesArray:function(e,t){var s=this;return Array.isArray(e)||(e="string"==typeof e?""===e?[]:this.props.multi?e.split(this.props.delimiter):[e]:void 0!==e&&null!==e?[e]:[]),e.map(function(e){if("string"==typeof e||"number"==typeof e){var a;for(var r in t)if(t.hasOwnProperty(r)&&t[r]&&(t[r][s.props.valueKey]===e||"number"==typeof t[r][s.props.valueKey]&&t[r][s.props.valueKey].toString()===e))return t[r];return a={},n(a,s.props.valueKey,e),n(a,s.props.labelKey,e),a}return e})},setValue:function(e,t){(t||void 0===t)&&(this._focusAfterUpdate=!0);var s=this.getStateFromValue(e);s.isOpen=!1,this.fireChangeEvent(s),this.setState(s)},selectValue:function(e){this.props.multi?e&&this.addValue(e):this.setValue(e),this._unbindCloseMenuIfClickedOutside()},addValue:function(e){this.setValue(this.state.values.concat(e))},popValue:function(){this.setValue(this.state.values.slice(0,this.state.values.length-1))},removeValue:function(e){this.setValue(this.state.values.filter(function(t){return t!==e}))},clearValue:function(e){e&&"mousedown"===e.type&&0!==e.button||(e.stopPropagation(),e.preventDefault(),this.setValue(null))},resetValue:function(){this.setValue(""===this.state.value?null:this.state.value)},getInputNode:function(){var e=this.refs.input;return this.props.searchable?e:o.findDOMNode(e)},fireChangeEvent:function(e){e.value!==this.state.value&&this.props.onChange&&this.props.onChange(e.value,e.values)},handleMouseDown:function(e){if(!(this.props.disabled||"mousedown"===e.type&&0!==e.button))return e.stopPropagation(),e.preventDefault(),this.state.isOpen&&!this.props.searchable?void this.setState({isOpen:!1},this._unbindCloseMenuIfClickedOutside):void(this.state.isFocused?this.setState({isOpen:!0},this._bindCloseMenuIfClickedOutside):(this._openAfterFocus=!0,this.getInputNode().focus()))},handleMouseDownOnMenu:function(e){this.props.disabled||"mousedown"===e.type&&0!==e.button||(e.stopPropagation(),e.preventDefault())},handleMouseDownOnArrow:function(e){this.props.disabled||"mousedown"===e.type&&0!==e.button||this.state.isOpen&&(e.stopPropagation(),e.preventDefault(),this.setState({isOpen:!1},this._unbindCloseMenuIfClickedOutside))},handleInputFocus:function(e){var t=this,s=this.state.isOpen||this._openAfterFocus;this.setState({isFocused:!0,isOpen:s},function(){s?t._bindCloseMenuIfClickedOutside():t._unbindCloseMenuIfClickedOutside()}),this._openAfterFocus=!1,this.props.onFocus&&this.props.onFocus(e)},handleInputBlur:function(e){var t=this,s=o.findDOMNode(this.refs.menu);document.activeElement.isEqualNode(s)||(this._blurTimeout=setTimeout(function(){!t._focusAfterUpdate&&t.isMounted()&&t.setState({inputValue:"",isFocused:!1,isOpen:!1})},50),this.props.onBlur&&this.props.onBlur(e))},handleKeyDown:function(e){if(!this.props.disabled){switch(e.keyCode){case 8:return void(!this.state.inputValue&&this.props.backspaceRemoves&&(e.preventDefault(),this.popValue()));case 9:if(e.shiftKey||!this.state.isOpen||!this.state.focusedOption)return;this.selectFocusedOption();break;case 13:if(!this.state.isOpen)return;this.selectFocusedOption();break;case 27:this.state.isOpen?this.resetValue():this.props.clearable&&this.clearValue(e);break;case 38:this.focusPreviousOption();break;case 40:this.focusNextOption();break;case 188:if(!this.props.allowCreate||!this.props.multi)return;e.preventDefault(),e.stopPropagation(),this.selectFocusedOption();break;default:return}e.preventDefault()}},_getNewFocusedOption:function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t]===this.state.focusedOption)return e[t];return this.getFirstFocusableOption(e)},handleInputChange:function(e){if(this._optionsFilterString=e.target.value,this.props.onInputChange&&this.props.onInputChange(e.target.value),this.props.asyncOptions)this.setState({isLoading:!0,inputValue:e.target.value}),this.loadAsyncOptions(e.target.value,{isLoading:!1,isOpen:!0},this._bindCloseMenuIfClickedOutside);else{var t=this.filterOptions(this.state.options);this.setState({isOpen:!0,inputValue:e.target.value,filteredOptions:t,focusedOption:this._getNewFocusedOption(t)},this._bindCloseMenuIfClickedOutside)}},autoloadAsyncOptions:function(){var e=this;this.setState({isLoading:!0}),this.loadAsyncOptions("",{isLoading:!1},function(){e.setValue(e.props.value,!1)})},loadAsyncOptions:function(e,t,s){void 0===e&&(e="");var n=this,a=this._currentRequestId=c++;if(this.props.cacheAsyncResults)for(var r=0;r<=e.length;r++){var o=e.slice(0,r);if(this._optionsCache[o]&&(e===o||this._optionsCache[o].complete)){var i=this._optionsCache[o].options,l=this.filterOptions(i),u={options:i,filteredOptions:l,focusedOption:this._getNewFocusedOption(l)};for(var d in t)t.hasOwnProperty(d)&&(u[d]=t[d]);return this.setState(u),void(s&&s.call(this,u))}}var p=function(r,o){if(r)throw r;if(n.props.cacheAsyncResults&&(n._optionsCache[e]=o),a===n._currentRequestId){var i=n.filterOptions(o.options),l={options:o.options,filteredOptions:i,focusedOption:n._getNewFocusedOption(i)};for(var u in t)t.hasOwnProperty(u)&&(l[u]=t[u]);n.setState(l),s&&s.call(n,l)}},f=this.props.asyncOptions(e,p);f&&"function"==typeof f.then&&f.then(function(e){p(null,e)},function(e){p(e)})},filterOptions:function(e,t){var s=this,n=this._optionsFilterString,a=(t||this.state.values).map(function(e){return e[s.props.valueKey]});if(this.props.filterOptions)return this.props.filterOptions.call(this,e,n,a);var r=function(e){if(this.props.multi&&a.indexOf(e[this.props.valueKey])>-1)return!1;if(this.props.filterOption)return this.props.filterOption.call(this,e,n);var t=String(e[this.props.valueKey]),s=String(e[this.props.labelKey]);return this.props.ignoreCase&&(t=t.toLowerCase(),s=s.toLowerCase(),n=n.toLowerCase()),n&&"start"!==this.props.matchPos?"label"!==this.props.matchProp&&t.indexOf(n)>=0||"value"!==this.props.matchProp&&s.indexOf(n)>=0:"label"!==this.props.matchProp&&t.substr(0,n.length)===n||"value"!==this.props.matchProp&&s.substr(0,n.length)===n};return(e||[]).filter(r,this)},selectFocusedOption:function(){return this.props.allowCreate&&!this.state.focusedOption?this.selectValue(this.state.inputValue):this.state.focusedOption?this.selectValue(this.state.focusedOption):void 0},focusOption:function(e){this.setState({focusedOption:e})},focusNextOption:function(){this.focusAdjacentOption("next")},focusPreviousOption:function(){this.focusAdjacentOption("previous")},focusAdjacentOption:function(e){this._focusedOptionReveal=!0;var t=this.state.filteredOptions.filter(function(e){return!e.disabled});if(!this.state.isOpen)return void this.setState({isOpen:!0,inputValue:"",focusedOption:this.state.focusedOption||t["next"===e?0:t.length-1]},this._bindCloseMenuIfClickedOutside);if(t.length){for(var s=-1,n=0;n<t.length;n++)if(this.state.focusedOption===t[n]){s=n;break}var a=t[0];"next"===e&&s>-1&&s<t.length-1?a=t[s+1]:"previous"===e&&(a=s>0?t[s-1]:t[t.length-1]),this.setState({focusedOption:a})}},unfocusOption:function(e){this.state.focusedOption===e&&this.setState({focusedOption:null})},renderOptionLabel:function(e){return e[this.props.labelKey]},buildMenu:function(){var e=this.state.focusedOption?this.state.focusedOption[this.props.valueKey]:null,t=this.props.optionRenderer||this.renderOptionLabel;this.state.filteredOptions.length>0&&(e=null==e?this.state.filteredOptions[0]:e);var s=this.state.filteredOptions;if(this.props.allowCreate&&this.state.inputValue.trim()){var n=this.state.inputValue;s=s.slice();var a=this.props.newOptionCreator?this.props.newOptionCreator(n):{value:n,label:n,create:!0};s.unshift(a)}var o=Object.keys(s).map(function(n){var a=s[n],o=this.state.value===a[this.props.valueKey],i=e===a[this.props.valueKey],u=l({"Select-option":!0,"is-selected":o,"is-focused":i,"is-disabled":a.disabled}),d=i?"focused":null,p=r.createElement(this.props.optionComponent,{key:"option-"+a[this.props.valueKey],className:u,renderFunc:t,mouseDown:this.selectValue,mouseEnter:this.focusOption,mouseLeave:this.unfocusOption,addLabelText:this.props.addLabelText,option:a,ref:d});return p},this);if(o.length)return o;var i,u;return this.isLoading()?(u="Select-searching",i=this.props.searchingText):this.state.inputValue||!this.props.asyncOptions?(u="Select-noresults",i=this.props.noResultsText):(u="Select-search-prompt",i=this.props.searchPromptText),r.createElement("div",{className:u},i)},handleOptionLabelClick:function(e,t){this.props.onOptionLabelClick&&this.props.onOptionLabelClick(e,t)},isLoading:function(){return this.props.isLoading||this.state.isLoading},render:function(){var e=l("Select",this.props.className,{"Select--multi":this.props.multi,"is-searchable":this.props.searchable,"is-open":this.state.isOpen,"is-focused":this.state.isFocused,"is-loading":this.isLoading(),"is-disabled":this.props.disabled,"has-value":this.state.value}),t=[];if(this.props.multi&&this.state.values.forEach(function(e){var s=this.props.valueRenderer||this.renderOptionLabel,n=this.handleOptionLabelClick.bind(this,e),a=this.removeValue.bind(this,e),o=r.createElement(this.props.valueComponent,{key:e[this.props.valueKey],option:e,renderer:s,optionLabelClick:!!this.props.onOptionLabelClick,onOptionLabelClick:n,onRemove:a,disabled:this.props.disabled});t.push(o)},this),!(this.state.inputValue||this.props.multi&&t.length)){var s=this.state.values[0]||null;if(this.props.valueRenderer&&this.state.values.length)t.push(r.createElement(u,{key:0,option:s,renderer:this.props.valueRenderer,disabled:this.props.disabled}));else{var n=r.createElement(this.props.singleValueComponent,{key:"placeholder",value:s,placeholder:this.state.placeholder});t.push(n)}}var o,d,p=this.isLoading()?r.createElement("span",{className:"Select-loading-zone","aria-hidden":"true"},r.createElement("span",{className:"Select-loading"})):null,c=this.props.clearable&&this.state.value&&!this.props.disabled&&!this.isLoading()?r.createElement("span",{className:"Select-clear-zone",title:this.props.multi?this.props.clearAllText:this.props.clearValueText,"aria-label":this.props.multi?this.props.clearAllText:this.props.clearValueText,onMouseDown:this.clearValue,onTouchEnd:this.clearValue,onClick:this.clearValue},r.createElement("span",{className:"Select-clear",dangerouslySetInnerHTML:{__html:"&times;"}})):null,f=r.createElement("span",{className:"Select-arrow-zone",onMouseDown:this.handleMouseDownOnArrow},r.createElement("span",{className:"Select-arrow",onMouseDown:this.handleMouseDownOnArrow}));this.state.isOpen&&(d={ref:"menu",className:"Select-menu",onMouseDown:this.handleMouseDownOnMenu},o=r.createElement("div",{ref:"selectMenuContainer",className:"Select-menu-outer"},r.createElement("div",d,this.buildMenu())));var h,m={ref:"input",className:"Select-input "+(this.props.inputProps.className||""),tabIndex:this.props.tabIndex||0,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur};for(var y in this.props.inputProps)this.props.inputProps.hasOwnProperty(y)&&"className"!==y&&(m[y]=this.props.inputProps[y]);return this.props.disabled?this.props.multi&&this.state.values.length||(h=r.createElement("div",{className:"Select-input"}," ")):h=this.props.searchable?r.createElement(i,a({value:this.state.inputValue,onChange:this.handleInputChange,minWidth:"5"},m)):r.createElement("div",m," "),r.createElement("div",{ref:"wrapper",className:e},r.createElement("input",{type:"hidden",ref:"value",name:this.props.name,value:this.state.value,disabled:this.props.disabled}),r.createElement("div",{className:"Select-control",ref:"control",onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchEnd:this.handleMouseDown},t,h,p,c,f),o)}});e.exports=f},42:function(e,t,s){"use strict";var n=s(1),a=s(9),r=n.createClass({displayName:"SingleValue",propTypes:{placeholder:n.PropTypes.string,value:n.PropTypes.object},render:function(){var e=a("Select-placeholder",this.props.value&&this.props.value.className);return n.createElement("div",{className:e,style:this.props.value&&this.props.value.style,title:this.props.value&&this.props.value.title},this.props.placeholder)}});e.exports=r},43:function(e,t,s){"use strict";var n=s(1),a=s(9),r=n.createClass({displayName:"Value",propTypes:{disabled:n.PropTypes.bool,onOptionLabelClick:n.PropTypes.func,onRemove:n.PropTypes.func,option:n.PropTypes.object.isRequired,optionLabelClick:n.PropTypes.bool,renderer:n.PropTypes.func},blockEvent:function(e){e.stopPropagation()},handleOnRemove:function(e){this.props.disabled||this.props.onRemove(e)},render:function(){var e=this.props.option.label;return this.props.renderer&&(e=this.props.renderer(this.props.option)),this.props.onRemove||this.props.optionLabelClick?(this.props.optionLabelClick&&(e=n.createElement("a",{className:a("Select-item-label__a",this.props.option.className),onMouseDown:this.blockEvent,onTouchEnd:this.props.onOptionLabelClick,onClick:this.props.onOptionLabelClick,style:this.props.option.style,title:this.props.option.title},e)),n.createElement("div",{className:a("Select-item",this.props.option.className),style:this.props.option.style,title:this.props.option.title},n.createElement("span",{className:"Select-item-icon",onMouseDown:this.blockEvent,onClick:this.handleOnRemove,onTouchEnd:this.handleOnRemove},"×"),n.createElement("span",{className:"Select-item-label"},e))):n.createElement("div",{className:a("Select-value",this.props.option.className),style:this.props.option.style,title:this.props.option.title},e)}});e.exports=r},55:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(15),r=n(a),o=s(6),i=n(o),l=r.default.Model.extend({defaults:{text:"",level:"info",language:"en"}}),u=r.default.Collection.extend({model:l}),d=r.default.View.extend({className:"alert alert-block",render:function(){return this.$el.addClass(["alert",this.model.get("level")].join("-")),this.$el.attr("lang",this.model.get("language")),this.$el.html(this.model.get("text")).hide().fadeIn(300),this}}),p=r.default.View.extend({el:".js-alerts",initialize:function(){this.subViews=[],this.listenTo(this.collection,"add",this.add),this.listenTo(this.collection,"remove",this.remove)},add:function(e){var t=new d({model:e});this.subViews.push(t),this.$el.prepend(t.render().el)},remove:function(e){var t=i.default.find(this.subViews,function(t){return t.model===e});this.subViews=(0,i.default)(this.subViews).without(t),t.$el.fadeOut(3500,function(){t.remove()})}}),c=new u,f=void 0,h={show:function(e){f||(f=new p({collection:c}));var t=new l(e);c.add(t),window.setTimeout(function(){c.remove(t)},2e3)}};t.default=h},56:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.FormValidationMixin=void 0;var a=s(1),r=n(a),o=t.FormValidationMixin={getInitialState:function(){return{errors:{}}},clearValidation:function(){this.setState({errors:{}})},validateResponse:function(e){var t=JSON.parse(e.responseText);this.setState({errors:t.errors})},renderSingleError:function(e,t){return r.default.createElement("li",{key:t},e)},renderAllFormErrors:function(){var e=this.state.errors;return e.hasOwnProperty("__all__")?r.default.createElement("ul",{className:"errorlist errorlist-all"},e.__all__.map(this.renderSingleError)):null}};t.default=o},57:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ModelFormMixin=void 0;var a=s(1),r=n(a),o=s(6),i=n(o),l=s(91),u=n(l),d=s(23),p=n(d),c=t.ModelFormMixin={mixins:[u.default,p.default],propTypes:{model:r.default.PropTypes.object.isRequired},getInitialState:function(){return this.initialData=i.default.pick(this.getResource().toJSON(),this.fields),{formData:i.default.extend({},this.initialData)}},componentDidMount:function(){if(i.default.isUndefined(this.fields))throw new Error("To use ModelFormMixin, you must define a `fields` property.");if(!i.default.isArray(this.fields))throw new Error("The `fields` property must be an array.")},getResource:function(){return this.props.model},handleFormSubmit:function(e){e.preventDefault(),this.getResource().save(this.state.formData,{wait:!0}).done(this.handleFormSuccess).error(this.handleFormError)}};t.default=c},58:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(6),r=n(a),o={initialize:function(){this.count=0,
this.page=0,this.keywords="",this.on("add",this.incrCount),this.on("remove",this.decrCount)},parse:function(e){return this.count=e.count,e.models},comparator:"-id",incrCount:function(){this.count++},decrCount:function(){this.count--},fetchNextPage:function(e){var t=this,s=this.page+1,n=1===s?{}:{p:s},a=""===this.keywords?{}:{q:this.keywords},o=r.default.extend({},n,a),i={remove:!1,silent:!0,data:o};return r.default.defaults(i,e),this.fetch(i).done(function(){t.page=s})},search:function(e){var t={};return e!==this.keywords&&(this.setSearch(e),t.reset=!0),this.fetchNextPage(t)},setSearch:function(e){this.keywords=e,this.page=0}};t.default=o},81:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=r.default.createClass({displayName:"ItemDelete",propTypes:{item:r.default.PropTypes.object.isRequired,helpText:r.default.PropTypes.string,onDelete:r.default.PropTypes.func.isRequired},getInitialState:function(){return{buttonDisabled:!0}},toggleButton:function(){this.setState({buttonDisabled:!this.state.buttonDisabled})},handleClick:function(e){e.preventDefault(),this.props.item.destroy().then(this.props.onDelete)},render:function(){return r.default.createElement("div",{className:"item-delete"},r.default.createElement("input",{type:"checkbox",checked:!this.state.buttonDisabled,onChange:this.toggleButton}),r.default.createElement("button",{className:"btn btn-danger",disabled:this.state.buttonDisabled,onClick:this.handleClick},gettext("Delete")),this.props.helpText&&r.default.createElement("span",{className:"helptext"},this.props.helpText))}});t.default=o},82:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(18),r=n(a),o=s(1),i=n(o),l=s(184),u=n(l),d=s(194),p=n(d),c=i.default.createClass({displayName:"Search",propTypes:{fields:i.default.PropTypes.array.isRequired,onSearch:i.default.PropTypes.func.isRequired,onSelectItem:i.default.PropTypes.func.isRequired,items:i.default.PropTypes.object.isRequired,selectedItem:i.default.PropTypes.object,searchLabel:i.default.PropTypes.string.isRequired,searchPlaceholder:i.default.PropTypes.string.isRequired,resultsCaption:i.default.PropTypes.string.isRequired,searchQuery:i.default.PropTypes.string.isRequired},getInitialState:function(){return{isLoading:!1}},onResultsFetched:function(){this.setState({isLoading:!1})},fetchResults:function(e){this.setState({isLoading:!0}),this.props.onSearch(e).then(this.onResultsFetched)},loadMore:function(){this.fetchResults(this.props.searchQuery)},render:function(){var e=this.state.isLoading,t=this.props.items,s=void 0;t.count>0&&t.length<t.count&&(s=i.default.createElement("button",{className:"btn",onClick:this.loadMore},gettext("Load More")));var n=(0,r.default)({"search-results":!0,loading:e});return i.default.createElement("div",{className:"search"},i.default.createElement("div",{className:"hd"},i.default.createElement("h2",null,this.props.searchLabel)),i.default.createElement("div",{className:"bd"},i.default.createElement("div",{className:"search-box"},i.default.createElement(p.default,{onSearch:this.props.onSearch,placeholder:this.props.searchPlaceholder,searchQuery:this.props.searchQuery})),i.default.createElement("div",{className:n},e&&0===this.props.items.length?i.default.createElement("div",null,gettext("Loading...")):i.default.createElement("div",null,i.default.createElement(u.default,{fields:this.props.fields,items:t,resultsCaption:this.props.resultsCaption,selectedItem:this.props.selectedItem,onSelectItem:this.props.onSelectItem}),s))))}});t.default=c},91:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={componentDidMount:function(){this._boundForceUpdate=this.forceUpdate.bind(this,null),this.getResource().on("all",this._boundForceUpdate,this)},componentWillUnmount:function(){this.getResource().off("all",this._boundForceUpdate)}};t.default=s},92:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.UserSet=t.User=void 0;var a=s(15),r=n(a),o=s(6),i=n(o),u=s(58),d=n(u),p=["nobody","default","system"],c=t.User=r.default.Model.extend({defaults:{username:"",is_active:!0,password:"",full_name:"",email:"",is_superuser:!1,twitter:"",linkedin:"",website:"",bio:""},initialize:function(e,t){t&&t.urlRoot&&(this.urlRoot=t.urlRoot)},urlRoot:l("/xhr/admin/users/"),getProfileUrl:function(){return l("/user/"+this.get("username")+"/")},getSettingsUrl:function(){return l("/user/"+this.get("username")+"/settings/")},isMeta:function(){return p.indexOf(this.get("username"))!==-1}});t.UserSet=r.default.Collection.extend(i.default.extend({},d.default,{model:c,url:l("/xhr/admin/users/")}))},121:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(16),i=n(o),l=s(57),u=n(l),d=s(81),p=n(d),c=r.default.createClass({displayName:"LanguageForm",propTypes:{collection:r.default.PropTypes.object.isRequired,onDelete:r.default.PropTypes.func,onSuccess:r.default.PropTypes.func.isRequired},mixins:[u.default],fields:["code","fullname","specialchars","nplurals","pluralequation"],handleSuccess:function(e){this.props.onSuccess(e)},render:function(){var e=this.getResource(),t=this.state.errors,s=this.state.formData;return r.default.createElement("form",{method:"post",id:"item-form",onSubmit:this.handleFormSubmit},r.default.createElement("div",{className:"fields"},r.default.createElement(i.default,{autoFocus:!0,disabled:e.hasOwnProperty("id"),label:gettext("Code"),handleChange:this.handleChange,name:"code",errors:t.code,value:s.code}),r.default.createElement(i.default,{label:gettext("Full Name"),handleChange:this.handleChange,name:"fullname",errors:t.fullname,value:s.fullname}),r.default.createElement(i.default,{label:gettext("Special Characters"),handleChange:this.handleChange,name:"specialchars",errors:t.specialchars,value:s.specialchars}),r.default.createElement(i.default,{type:"select",clearable:!1,options:e.getFieldChoices("nplurals"),label:gettext("Number of Plurals"),handleChange:this.handleChange,name:"nplurals",errors:t.nplurals,value:s.nplurals}),r.default.createElement(i.default,{label:gettext("Plural Equation"),handleChange:this.handleChange,name:"pluralequation",errors:t.pluralequation,value:s.pluralequation})),r.default.createElement("div",{className:"buttons"},r.default.createElement("input",{type:"submit",className:"btn btn-primary",disabled:!this.state.isDirty,value:gettext("Save")}),e.id&&r.default.createElement("ul",{className:"action-links"},r.default.createElement("li",null,r.default.createElement("a",{href:e.getAbsoluteUrl()},gettext("Overview"))),r.default.createElement("li",null,r.default.createElement("a",{href:e.getTeamUrl()},gettext("Team"))))),this.props.onDelete&&r.default.createElement("div",null,r.default.createElement("p",{className:"divider"}),r.default.createElement("div",{className:"buttons"},r.default.createElement(p.default,{item:e,onDelete:this.props.onDelete}))))}});t.default=c},122:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(16),i=n(o),l=s(57),u=n(l),d=s(81),p=n(d),c=r.default.createClass({displayName:"ProjectForm",propTypes:{collection:r.default.PropTypes.object.isRequired,onDelete:r.default.PropTypes.func,onSuccess:r.default.PropTypes.func.isRequired},mixins:[u.default],fields:["code","fullname","checkstyle","filetypes","treestyle","source_language","ignoredfiles","report_email","screenshot_search_prefix","disabled"],handleSuccess:function(e){this.props.onSuccess(e)},render:function(){var e=this.getResource(),t=this.state.errors,s=this.state.formData;return r.default.createElement("form",{method:"post",id:"item-form",onSubmit:this.handleFormSubmit},r.default.createElement("div",{className:"fields"},r.default.createElement(i.default,{autoFocus:!0,disabled:e.hasOwnProperty("id"),label:gettext("Code"),handleChange:this.handleChange,name:"code",errors:t.code,value:s.code}),r.default.createElement(i.default,{label:gettext("Full Name"),handleChange:this.handleChange,name:"fullname",errors:t.fullname,value:s.fullname}),r.default.createElement(i.default,{type:"select",clearable:!1,options:e.getFieldChoices("checkstyle"),label:gettext("Quality Checks"),handleChange:this.handleChange,name:"checkstyle",errors:t.checkstyle,value:s.checkstyle}),r.default.createElement(i.default,{type:"select",multiple:!0,clearable:!1,options:e.getFieldChoices("filetypes"),label:gettext("File types"),handleChange:this.handleChange,name:"filetypes",errors:t.filetypes,value:s.filetypes}),r.default.createElement(i.default,{type:"select",clearable:!1,options:e.getFieldChoices("treestyle"),label:gettext("Project Tree Style"),handleChange:this.handleChange,name:"treestyle",errors:t.treestyle,value:s.treestyle}),r.default.createElement(i.default,{type:"select",clearable:!1,options:e.getFieldChoices("source_language"),label:gettext("Source Language"),handleChange:this.handleChange,name:"source_language",errors:t.source_language,value:s.source_language}),r.default.createElement(i.default,{label:gettext("Ignore Files"),handleChange:this.handleChange,name:"ignoredfiles",errors:t.ignoredfiles,value:s.ignoredfiles}),r.default.createElement(i.default,{type:"email",label:gettext("String Errors Contact"),handleChange:this.handleChange,name:"report_email",errors:t.report_email,value:s.report_email}),r.default.createElement(i.default,{label:gettext("Screenshot Search Prefix"),handleChange:this.handleChange,name:"screenshot_search_prefix",errors:t.screenshot_search_prefix,value:s.screenshot_search_prefix}),r.default.createElement(i.default,{type:"checkbox",label:gettext("Disabled"),handleChange:this.handleChange,name:"disabled",errors:t.disabled,value:!!s.disabled})),r.default.createElement("div",{className:"buttons"},r.default.createElement("input",{type:"submit",className:"btn btn-primary",disabled:!this.state.isDirty,value:gettext("Save")}),e.id&&r.default.createElement("ul",{className:"action-links"},r.default.createElement("li",null,r.default.createElement("a",{href:e.getAbsoluteUrl()},gettext("Overview"))),r.default.createElement("li",null,r.default.createElement("a",{href:e.getLanguagesUrl()},gettext("Languages"))),r.default.createElement("li",null,r.default.createElement("a",{href:e.getPermissionsUrl()},gettext("Permissions"))),"pootle_fs"===e.attributes.treestyle&&r.default.createElement("li",null,r.default.createElement("a",{href:e.getFSUrl()},gettext("Filesystems"))))),this.props.onDelete&&r.default.createElement("div",null,r.default.createElement("p",{className:"divider"}),r.default.createElement("div",{className:"buttons"},r.default.createElement(p.default,{item:e,onDelete:this.props.onDelete}))))}});t.default=c},123:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(16),i=n(o),l=s(57),u=n(l),d=s(81),p=n(d),c=r.default.createClass({displayName:"UserForm",propTypes:{collection:r.default.PropTypes.object.isRequired,onDelete:r.default.PropTypes.func,onSuccess:r.default.PropTypes.func.isRequired},mixins:[u.default],fields:["username","is_active","password","full_name","email","is_superuser","twitter","linkedin","website","bio"],handleSuccess:function(e){this.props.onSuccess(e)},render:function(){var e=this.getResource(),t=this.state.errors,s=this.state.formData,n=gettext("Note: when deleting a user their contributions to the site, e.g. comments, suggestions and translations, are attributed to the anonymous user (nobody).");return r.default.createElement("form",{method:"post",id:"item-form",autoComplete:"off",onSubmit:this.handleFormSubmit},r.default.createElement("div",{className:"fields"},r.default.createElement(i.default,{autoFocus:!e.isMeta(),readOnly:e.isMeta(),label:gettext("Username"),handleChange:this.handleChange,name:"username",errors:t.username,value:s.username}),!e.isMeta()&&r.default.createElement("div",{className:"no-meta"},r.default.createElement(i.default,{type:"checkbox",label:gettext("Active"),handleChange:this.handleChange,name:"is_active",errors:t.is_active,value:s.is_active}),r.default.createElement(i.default,{type:"password",label:gettext("Password"),placeholder:gettext("Set a new password"),handleChange:this.handleChange,name:"password",errors:t.password,value:s.password})),r.default.createElement(i.default,{autoFocus:e.isMeta(),label:gettext("Full Name"),handleChange:this.handleChange,name:"full_name",errors:t.full_name,value:s.full_name}),r.default.createElement(i.default,{label:gettext("Email"),handleChange:this.handleChange,name:"email",errors:t.email,value:s.email}),!e.isMeta()&&r.default.createElement("div",{className:"no-meta"},r.default.createElement(i.default,{type:"checkbox",label:gettext("Administrator"),handleChange:this.handleChange,name:"is_superuser",errors:t.is_superuser,value:s.is_superuser}),r.default.createElement("p",{className:"divider"}),r.default.createElement(i.default,{label:gettext("Twitter"),handleChange:this.handleChange,placeholder:gettext("Twitter username"),maxLength:"15",name:"twitter",errors:t.twitter,value:s.twitter}),r.default.createElement(i.default,{label:gettext("LinkedIn"),handleChange:this.handleChange,placeholder:gettext("LinkedIn profile URL"),name:"linkedin",errors:t.linkedin,value:s.linkedin}),r.default.createElement(i.default,{label:gettext("Website"),handleChange:this.handleChange,placeholder:gettext("Personal website URL"),name:"website",errors:t.website,value:s.website}),r.default.createElement(i.default,{type:"textarea",label:gettext("Short Bio"),handleChange:this.handleChange,placeholder:gettext("Personal description"),name:"bio",errors:t.bio,value:s.bio}))),r.default.createElement("div",{className:"buttons"},r.default.createElement("input",{type:"submit",className:"btn btn-primary",disabled:!this.state.isDirty,value:gettext("Save")}),e.id&&r.default.createElement("ul",{className:"action-links"},r.default.createElement("li",null,r.default.createElement("a",{href:e.getProfileUrl()},gettext("Public Profile"))),r.default.createElement("li",null,r.default.createElement("a",{href:e.getSettingsUrl()},gettext("Settings"))))),this.props.onDelete&&!e.isMeta()&&r.default.createElement("div",null,r.default.createElement("p",{className:"divider"}),r.default.createElement("div",{className:"buttons"},r.default.createElement(p.default,{item:e,onDelete:this.props.onDelete,helpText:n}))))}});t.default=c},182:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(15),r=n(a),o=r.default.Router.extend({routes:{"?q=:searchQuery":"main","":"main",":id(/)":"edit"}});t.default=o},183:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(15),r=n(a),o=s(3),i=n(o),l=s(1),u=n(l),d=s(6),p=n(d),c=s(55),f=n(c),h=u.default.createClass({displayName:"AdminController",propTypes:{adminModule:u.default.PropTypes.object.isRequired,appRoot:u.default.PropTypes.string.isRequired,formChoices:u.default.PropTypes.object.isRequired,router:u.default.PropTypes.object.isRequired},getInitialState:function(){return{items:new this.props.adminModule.Collection,selectedItem:null,searchQuery:"",view:"edit"}},componentWillMount:function(){this.setupRoutes(this.props.router),r.default.history.start({pushState:!0,root:this.props.appRoot})},componentWillUpdate:function(e,t){t.searchQuery===this.state.searchQuery&&t.selectedItem===this.state.selectedItem||this.handleURL(t)},setupRoutes:function(e){var t=this;e.on("route:main",function(e){var s=e;void 0!==e&&null!==e||(s=""),t.handleSearch(s)}),e.on("route:edit",function(e){t.handleSelectItem(e)})},handleSearch:function(e,t){var s=this,n=t||{};return e!==this.state.searchQuery&&(n.searchQuery=e,n.selectedItem=null),this.state.items.search(e).then(function(){n.items=s.state.items,s.setState(n)})},handleSelectItem:function(e){var t=this,s=this.state.items.get(e);if(s)this.setState({selectedItem:s,view:"edit"});else{var n=this.state.items;n.search("").then(function(){var s=i.default.Deferred(),a=n.get(e);return void 0!==a?s.resolve(a):(a=new t.props.adminModule.Model({id:e}),a.fetch({success:function(){s.resolve(a)}})),s.promise()}).then(function(e){n.unshift(e,{merge:!0}),t.setState({items:n,selectedItem:e,view:"edit"})})}},handleAdd:function(){this.setState({selectedItem:null,view:"add"})},handleCancel:function(){this.setState({selectedItem:null,view:"edit"})},handleSave:function(e){var t=this.state.items;t.unshift(e,{merge:!0}),t.move(e,0),this.setState({items:t,selectedItem:e,view:"edit"}),f.default.show({text:gettext("Saved successfully."),level:"success"})},handleDelete:function(){this.setState({selectedItem:null}),f.default.show({text:gettext("Deleted successfully."),level:"danger"})},handleURL:function(e){var t=this.props.router,s=e.searchQuery,n=void 0;n=e.selectedItem?"/"+e.selectedItem.id+"/":""===s?"/":"?q="+encodeURIComponent(s),t.navigate(n)},render:function(){var e=this.props.adminModule.Model;p.default.defaults(e.prototype,{fieldChoices:{}}),p.default.extend(e.prototype.fieldChoices,this.props.formChoices),p.default.extend(e.prototype.defaults,this.props.formChoices.defaults);var t={items:this.state.items,selectedItem:this.state.selectedItem,searchQuery:this.state.searchQuery,view:this.state.view,collection:this.props.adminModule.collection,model:e,onSearch:this.handleSearch,onSelectItem:this.handleSelectItem,onAdd:this.handleAdd,onCancel:this.handleCancel,onSuccess:this.handleSave,onDelete:this.handleDelete};return u.default.createElement("div",{className:"admin-app"},u.default.createElement(this.props.adminModule.Controller,t))}});t.default=h},184:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(185),i=n(o),l=r.default.createClass({displayName:"ItemTable",propTypes:{fields:r.default.PropTypes.array.isRequired,items:r.default.PropTypes.object.isRequired,resultsCaption:r.default.PropTypes.string.isRequired,selectedItem:r.default.PropTypes.object,onSelectItem:r.default.PropTypes.func.isRequired},render:function(){function e(e,t){return r.default.createElement(i.default,{fields:this.props.fields,key:e.id,item:e,index:t,selectedItem:this.props.selectedItem,onSelectItem:this.props.onSelectItem})}return r.default.createElement("table",null,r.default.createElement("caption",null,this.props.resultsCaption),r.default.createElement("tbody",null,this.props.items.map(e.bind(this))))}});t.default=l},185:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(18),r=n(a),o=s(1),i=n(o),l=i.default.createClass({displayName:"ItemTableRow",propTypes:{fields:i.default.PropTypes.array.isRequired,item:i.default.PropTypes.object.isRequired,index:i.default.PropTypes.number.isRequired,selectedItem:i.default.PropTypes.object,onSelectItem:i.default.PropTypes.func.isRequired},render:function(){function e(e,t){return i.default.createElement("td",{key:t},o[e])}var t=this,s=this.props.item,n=this.props.selectedItem,a=this.props.index,o=s.toJSON();o.index=a+1;var l=(0,r.default)({"is-selected":n&&s.id===n.id,"is-disabled":s.get("disabled"),"row-divider":0!==a&&a%10===0});return i.default.createElement("tr",{className:l,key:s.id,onClick:function(){return t.props.onSelectItem(s.id)}},this.props.fields.map(e))}});t.default=l},186:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(121),i=n(o),l=r.default.createClass({displayName:"LanguageAdd",propTypes:{collection:r.default.PropTypes.object.isRequired,model:r.default.PropTypes.func.isRequired,onCancel:r.default.PropTypes.func.isRequired,onSuccess:r.default.PropTypes.func.isRequired},render:function(){var e=this.props.model;return r.default.createElement("div",{className:"item-add"},r.default.createElement("div",{className:"hd"},r.default.createElement("h2",null,gettext("Add Language")),r.default.createElement("button",{onClick:this.props.onCancel,className:"btn btn-primary"},gettext("Cancel"))),r.default.createElement("div",{className:"bd"},r.default.createElement(i.default,{model:new e,collection:this.props.collection,onSuccess:this.props.onSuccess})))}});t.default=l},187:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(82),i=n(o),l=s(186),u=n(l),d=s(188),p=n(d),c=r.default.createClass({displayName:"LanguageController",propTypes:{items:r.default.PropTypes.object.isRequired,model:r.default.PropTypes.func.isRequired,onAdd:r.default.PropTypes.func.isRequired,onCancel:r.default.PropTypes.func.isRequired,onDelete:r.default.PropTypes.func.isRequired,onSearch:r.default.PropTypes.func.isRequired,onSelectItem:r.default.PropTypes.func.isRequired,onSuccess:r.default.PropTypes.func.isRequired,searchQuery:r.default.PropTypes.string.isRequired,selectedItem:r.default.PropTypes.object,view:r.default.PropTypes.string.isRequired},render:function(){var e={add:r.default.createElement(u.default,{model:this.props.model,collection:this.props.items,onSuccess:this.props.onSuccess,onCancel:this.props.onCancel}),edit:r.default.createElement(p.default,{model:this.props.selectedItem,collection:this.props.items,onAdd:this.props.onAdd,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete})},t={count:this.props.items.count},s=void 0;s=this.props.searchQuery?ngettext("%(count)s language matches your query.","%(count)s languages match your query.",t.count):ngettext("There is %(count)s language.","There are %(count)s languages. Below are the most recently added ones.",t.count);var n=interpolate(s,t,!0);return r.default.createElement("div",{className:"admin-app-languages"},r.default.createElement("div",{className:"module first"},r.default.createElement(i.default,{fields:["index","code","fullname"],onSearch:this.props.onSearch,onSelectItem:this.props.onSelectItem,items:this.props.items,selectedItem:this.props.selectedItem,searchLabel:gettext("Search Languages"),searchPlaceholder:gettext("Find language by name, code"),resultsCaption:n,searchQuery:this.props.searchQuery})),r.default.createElement("div",{className:"module admin-content"},e[this.props.view]))}});t.default=c},188:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(121),i=n(o),l=r.default.createClass({displayName:"LanguageEdit",propTypes:{collection:r.default.PropTypes.object.isRequired,model:r.default.PropTypes.object,onAdd:r.default.PropTypes.func.isRequired,onDelete:r.default.PropTypes.func.isRequired,onSuccess:r.default.PropTypes.func.isRequired},render:function(){return r.default.createElement("div",{className:"item-edit"},r.default.createElement("div",{className:"hd"},r.default.createElement("h2",null,gettext("Edit Language")),r.default.createElement("button",{onClick:this.props.onAdd,className:"btn btn-primary"},gettext("Add Language"))),r.default.createElement("div",{className:"bd"},this.props.model?r.default.createElement(i.default,{key:this.props.model.id,model:this.props.model,collection:this.props.collection,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete}):r.default.createElement("p",null,gettext("Use the search form to find the language, then click on a language to edit."))))}});t.default=l},189:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(255),r=s(187),o=n(r);t.default={Controller:o.default,Model:a.Language,Collection:a.LanguageSet}},190:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(122),i=n(o),l=r.default.createClass({displayName:"ProjectAdd",propTypes:{collection:r.default.PropTypes.object.isRequired,model:r.default.PropTypes.func.isRequired,onCancel:r.default.PropTypes.func.isRequired,onSuccess:r.default.PropTypes.func.isRequired},render:function(){var e=this.props.model;return r.default.createElement("div",{className:"item-add"},r.default.createElement("div",{className:"hd"},r.default.createElement("h2",null,gettext("Add Project")),r.default.createElement("button",{onClick:this.props.onCancel,className:"btn btn-primary"},gettext("Cancel"))),r.default.createElement("div",{className:"bd"},r.default.createElement(i.default,{model:new e,collection:this.props.collection,onSuccess:this.props.onSuccess})))}});t.default=l},191:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(82),i=n(o),l=s(190),u=n(l),d=s(192),p=n(d),c=r.default.createClass({displayName:"ProjectController",propTypes:{items:r.default.PropTypes.object.isRequired,model:r.default.PropTypes.func.isRequired,onAdd:r.default.PropTypes.func.isRequired,onCancel:r.default.PropTypes.func.isRequired,onDelete:r.default.PropTypes.func.isRequired,onSearch:r.default.PropTypes.func.isRequired,onSelectItem:r.default.PropTypes.func.isRequired,onSuccess:r.default.PropTypes.func.isRequired,searchQuery:r.default.PropTypes.string.isRequired,selectedItem:r.default.PropTypes.object,view:r.default.PropTypes.string.isRequired},render:function(){var e={add:r.default.createElement(u.default,{model:this.props.model,collection:this.props.items,onSuccess:this.props.onSuccess,onCancel:this.props.onCancel}),edit:r.default.createElement(p.default,{model:this.props.selectedItem,collection:this.props.items,onAdd:this.props.onAdd,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete})},t={count:this.props.items.count},s=void 0;s=this.props.searchQuery?ngettext("%(count)s project matches your query.","%(count)s projects match your query.",t.count):ngettext("There is %(count)s project.","There are %(count)s projects. Below are the most recently added ones.",t.count);var n=interpolate(s,t,!0);return r.default.createElement("div",{className:"admin-app-projects"},r.default.createElement("div",{className:"module first"},r.default.createElement(i.default,{fields:["index","code","fullname","disabled"],onSearch:this.props.onSearch,onSelectItem:this.props.onSelectItem,items:this.props.items,selectedItem:this.props.selectedItem,searchLabel:gettext("Search Projects"),searchPlaceholder:gettext("Find project by name, code"),resultsCaption:n,searchQuery:this.props.searchQuery})),r.default.createElement("div",{className:"module admin-content"},e[this.props.view]))}});t.default=c},192:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(122),i=n(o),l=r.default.createClass({displayName:"ProjectEdit",propTypes:{collection:r.default.PropTypes.object.isRequired,model:r.default.PropTypes.object,onAdd:r.default.PropTypes.func.isRequired,onDelete:r.default.PropTypes.func.isRequired,onSuccess:r.default.PropTypes.func.isRequired},render:function(){return r.default.createElement("div",{className:"item-edit"},r.default.createElement("div",{className:"hd"},r.default.createElement("h2",null,gettext("Edit Project")),r.default.createElement("button",{onClick:this.props.onAdd,className:"btn btn-primary"},gettext("Add Project"))),r.default.createElement("div",{className:"bd"},this.props.model?r.default.createElement(i.default,{key:this.props.model.id,model:this.props.model,collection:this.props.collection,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete}):r.default.createElement("p",null,gettext("Use the search form to find the project, then click on a project to edit."))))}});t.default=l},193:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(256),r=s(191),o=n(r);t.default={Controller:o.default,Model:a.Project,Collection:a.ProjectSet}},194:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},r=s(1),o=n(r),i=s(6),l=n(i),u=o.default.createClass({displayName:"SearchBox",propTypes:{onSearch:o.default.PropTypes.func.isRequired,placeholder:o.default.PropTypes.string,searchQuery:o.default.PropTypes.string},getInitialState:function(){return{searchQuery:this.props.searchQuery}},componentWillMount:function(){var e=this;this.handleSearchDebounced=l.default.debounce(function(){e.props.onSearch.apply(e,[e.state.searchQuery])},300)},componentDidMount:function(){this.refs.input.focus()},componentWillReceiveProps:function(e){e.searchQuery!==this.state.searchQuery&&this.setState({searchQuery:e.searchQuery})},handleKeyUp:function(e){var t=e.nativeEvent.keyCode;27===t&&this.refs.input.blur()},handleChange:function(){this.setState({searchQuery:this.refs.input.value}),this.handleSearchDebounced()},render:function(){return o.default.createElement("input",a({type:"text",ref:"input",value:this.state.searchQuery,onChange:this.handleChange,onKeyUp:this.handleKeyUp},this.props))}});t.default=u},195:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(123),i=n(o),l=r.default.createClass({displayName:"UserAdd",propTypes:{collection:r.default.PropTypes.object.isRequired,model:r.default.PropTypes.func.isRequired,onCancel:r.default.PropTypes.func.isRequired,onSuccess:r.default.PropTypes.func.isRequired},render:function(){var e=this.props.model;return r.default.createElement("div",{className:"item-add"},r.default.createElement("div",{className:"hd"},r.default.createElement("h2",null,gettext("Add User")),r.default.createElement("button",{onClick:this.props.onCancel,className:"btn btn-primary"},gettext("Cancel"))),r.default.createElement("div",{className:"bd"},r.default.createElement(i.default,{model:new e,collection:this.props.collection,onSuccess:this.props.onSuccess})))}});t.default=l},196:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(82),i=n(o),l=s(195),u=n(l),d=s(197),p=n(d),c=r.default.createClass({displayName:"UserController",propTypes:{items:r.default.PropTypes.object.isRequired,model:r.default.PropTypes.func.isRequired,onAdd:r.default.PropTypes.func.isRequired,onCancel:r.default.PropTypes.func.isRequired,onDelete:r.default.PropTypes.func.isRequired,onSearch:r.default.PropTypes.func.isRequired,onSelectItem:r.default.PropTypes.func.isRequired,onSuccess:r.default.PropTypes.func.isRequired,searchQuery:r.default.PropTypes.string.isRequired,selectedItem:r.default.PropTypes.object,view:r.default.PropTypes.string.isRequired},render:function(){var e={add:r.default.createElement(u.default,{model:this.props.model,collection:this.props.items,onSuccess:this.props.onSuccess,onCancel:this.props.onCancel}),edit:r.default.createElement(p.default,{model:this.props.selectedItem,collection:this.props.items,onAdd:this.props.onAdd,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete})},t={count:this.props.items.count},s=void 0;s=this.props.searchQuery?ngettext("%(count)s user matches your query.","%(count)s users match your query.",t.count):ngettext("There is %(count)s user.","There are %(count)s users. Below are the most recently added ones.",t.count);var n=interpolate(s,t,!0);return r.default.createElement("div",{className:"admin-app-users"},r.default.createElement("div",{className:"module first"},r.default.createElement(i.default,{
fields:["index","full_name","username","email"],onSearch:this.props.onSearch,onSelectItem:this.props.onSelectItem,items:this.props.items,selectedItem:this.props.selectedItem,searchLabel:gettext("Search Users"),searchPlaceholder:gettext("Find user by name, email, properties"),resultsCaption:n,searchQuery:this.props.searchQuery})),r.default.createElement("div",{className:"module admin-content"},e[this.props.view]))}});t.default=c},197:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),r=n(a),o=s(123),i=n(o),l=r.default.createClass({displayName:"UserEdit",propTypes:{collection:r.default.PropTypes.object.isRequired,model:r.default.PropTypes.object,onAdd:r.default.PropTypes.func.isRequired,onDelete:r.default.PropTypes.func.isRequired,onSuccess:r.default.PropTypes.func.isRequired},render:function(){return r.default.createElement("div",{className:"item-edit"},r.default.createElement("div",{className:"hd"},r.default.createElement("h2",null,gettext("Edit User")),r.default.createElement("button",{onClick:this.props.onAdd,className:"btn btn-primary"},gettext("Add User"))),r.default.createElement("div",{className:"bd"},this.props.model?r.default.createElement(i.default,{key:this.props.model.id,model:this.props.model,collection:this.props.collection,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete}):r.default.createElement("p",null,gettext("Use the search form to find the user, then click on a user to edit."))))}});t.default=l},198:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(92),r=s(196),o=n(r);t.default={Controller:o.default,Model:a.User,Collection:a.UserSet}},255:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageSet=t.Language=void 0;var a=s(15),r=n(a),o=s(6),i=n(o),u=s(58),d=n(u),p=t.Language=r.default.Model.extend({defaults:{code:"",fullname:"",specialchars:"",nplurals:"0",pluralequation:""},fieldChoices:{nplurals:[[0,"Unknown"],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6]]},urlRoot:function(){return l("/xhr/admin/languages/")},getAbsoluteUrl:function(){return l(["",this.get("code"),""].join("/"))},getTeamUrl:function(){return l(["",this.get("code"),"admin","team",""].join("/"))},getFieldChoices:function(e){return this.fieldChoices&&this.fieldChoices.hasOwnProperty(e)?this.fieldChoices[e].map(function(e){return{value:e[0].toString(),label:e[1]}}):[]}});t.LanguageSet=r.default.Collection.extend(i.default.extend({},d.default,{model:p,url:l("/xhr/admin/languages/")}))},256:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ProjectSet=t.Project=void 0;var a=s(15),r=n(a),o=s(6),i=n(o),u=s(58),d=n(u),p=t.Project=r.default.Model.extend({defaults:{code:"",fullname:"",checkstyle:"standard",treestyle:"auto",source_language:"",ignoredfiles:"",filetypes:[],screenshot_search_prefix:"",disabled:!1},urlRoot:function(){return l("/xhr/admin/projects/")},getAbsoluteUrl:function(){return l(["","projects",this.get("code"),""].join("/"))},getLanguagesUrl:function(){return l(["","projects",this.get("code"),"admin","languages",""].join("/"))},getPermissionsUrl:function(){return l(["","projects",this.get("code"),"admin","permissions",""].join("/"))},getFSUrl:function(){return l(["","admin","projects",this.get("code"),"fs",""].join("/"))},getFieldChoices:function(e){return this.fieldChoices&&this.fieldChoices.hasOwnProperty(e)?this.fieldChoices[e].map(function(e){return{value:e[0].toString(),label:e[1]}}):[]},toJSON:function(){var e=i.default.clone(this.attributes);return e.disabled=e.disabled?gettext("disabled"):"",e}});t.ProjectSet=r.default.Collection.extend(i.default.extend({},d.default,{model:p,url:l("/xhr/admin/projects/")}))},291:function(e,t,s){var n=s(15);n.Collection.prototype.move=function(e,t){var s=this.indexOf(e);if(s==-1)throw new Error("Can't move a model that's not in the collection");s!==t&&this.models.splice(t,0,this.models.splice(s,1)[0])}}});