UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

2 lines • 465 kB
var Fabric=function(e){function t(i){if(o[i])return o[i].exports;var n=o[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(1)),i(o(52)),i(o(28)),i(o(57)),i(o(61)),i(o(70)),i(o(93)),i(o(24)),i(o(97)),i(o(105)),i(o(151)),i(o(164)),i(o(185)),i(o(44)),i(o(189)),i(o(193)),i(o(8)),i(o(126)),i(o(64)),i(o(76)),i(o(39)),i(o(131)),i(o(143)),i(o(194)),i(o(199)),i(o(204)),i(o(157)),i(o(208)),i(o(213)),i(o(172)),i(o(230)),i(o(236)),i(o(240)),i(o(244)),i(o(137)),i(o(248)),i(o(73)),i(o(253)),i(o(257)),i(o(12)),i(o(16)),i(o(13)),i(o(7)),i(o(6)),i(o(21))},function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(2))},function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(3))},function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=this&&this.__decorate||function(e,t,o,i){var n,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,o,s):n(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},r=o(4),s=o(5),a=o(8),l=o(24),c=o(27),m=o(21),d=o(19),u=o(16),p=o(15);o(51);var h="overflow",f=44,g=function(e){function t(t){e.call(this,t),this._id=d.getId("Breadcrumb"),this.state=this._getStateFromProps(t)}return i(t,e),t.prototype.componentDidMount=function(){this._updateItemMeasurements(),this._updateRenderedItems(),this._events.on(window,"resize",this._updateRenderedItems)},t.prototype.componentWillReceiveProps=function(e){this.setState(this._getStateFromProps(e)),this._breadcrumbItemWidths=null},t.prototype.componentDidUpdate=function(e,t){this._breadcrumbItemWidths||(this._updateItemMeasurements(),this._updateRenderedItems())},t.prototype.render=function(){var e=this,t=this.props.className,o=this.state,i=o.isOverflowOpen,n=o.overflowAnchor,s=o.renderedItems,d=o.renderedOverflowItems,p=this._id+"-overflow";return r.createElement("div",{className:u.css("ms-Breadcrumb",t),ref:"renderingArea"},r.createElement(a.FocusZone,{direction:a.FocusZoneDirection.horizontal},r.createElement("ul",{className:"ms-Breadcrumb-list"},d&&d.length?r.createElement("li",{className:"ms-Breadcrumb-overflow",key:h,ref:h},r.createElement("div",{className:"ms-Breadcrumb-overflowButton ms-Icon ms-Icon--More",onClick:this._onOverflowClicked,"data-is-focusable":!0,role:"button","aria-haspopup":"true","aria-owns":i?p:null}),r.createElement("i",{className:u.css("ms-Breadcrumb-chevron ms-Icon",m.getRTL()?"ms-Icon--ChevronLeft":"ms-Icon--ChevronRight")})):null,s.map(function(t,o){return r.createElement("li",{className:"ms-Breadcrumb-listItem",key:t.key||String(o),ref:t.key||String(o)},r.createElement("a",{className:"ms-Breadcrumb-itemLink",onClick:t.onClick?e._onBreadcrumbClicked.bind(e,t):null,href:t.href,role:t.onClick?"button":"link"},t.text),r.createElement("i",{className:u.css("ms-Breadcrumb-chevron ms-Icon",m.getRTL()?"ms-Icon--ChevronLeft":"ms-Icon--ChevronRight")}))}))),i?r.createElement(l.ContextualMenu,{targetElement:n,isBeakVisible:!0,items:d.map(function(t,o){return{name:t.text,key:t.key,onClick:e._onBreadcrumbClicked.bind(e,t),href:t.href}}),id:p,directionalHint:c.DirectionalHint.bottomLeftEdge,onDismiss:this._onOverflowDismissed}):null)},t.prototype._onOverflowClicked=function(e){this.setState({isOverflowOpen:!this.state.isOverflowOpen,overflowAnchor:e.currentTarget})},t.prototype._onOverflowDismissed=function(e){this.setState({isOverflowOpen:!1,overflowAnchor:null})},t.prototype._onBreadcrumbClicked=function(e,t){e.onClick&&e.onClick(t,e),this.setState({isOverflowOpen:!1})},t.prototype._updateItemMeasurements=function(){var e=this.props.items;this._breadcrumbItemWidths||(this._breadcrumbItemWidths={});for(var t=0;t<e.length;t++){var o=e[t];if(!this._breadcrumbItemWidths[o.key]){var i=this.refs[o.key];this._breadcrumbItemWidths[o.key]=i.getBoundingClientRect().width}}},t.prototype._updateRenderedItems=function(){var e=this.props,t=e.items,o=e.maxDisplayedItems,i=this.refs.renderingArea,n=[],r=[].concat(t),s=0,a=window.getComputedStyle(i),l=i.clientWidth-parseInt(a.marginLeft,10)-parseInt(a.marginRight,10);l-=f;var c,m=Math.max(0,r.length-o);for(c=r.length-1;c>=m;c--){var d=r[c],u=this._breadcrumbItemWidths[d.key];if(s+u>=l)break;s+=u}n=r.splice(c+1),this.setState({isOverflowOpen:this.state.isOverflowOpen,overflowAnchor:this.state.overflowAnchor,renderedItems:n,renderedOverflowItems:r})},t.prototype._getStateFromProps=function(e){return{isOverflowOpen:!1,overflowAnchor:null,renderedItems:e.items||[],renderedOverflowItems:null}},t.defaultProps={items:[],maxDisplayedItems:999},n([p.autobind],t.prototype,"_onOverflowClicked",null),n([p.autobind],t.prototype,"_onOverflowDismissed",null),n([p.autobind],t.prototype,"_onBreadcrumbClicked",null),t}(s.BaseComponent);t.Breadcrumb=g},function(e,t){e.exports=React},function(e,t,o){"use strict";function i(e,t,o){for(var i=0,r=o.length;i<r;i++)n(e,t,o[i])}function n(e,t,o){var i=e[o],n=t[o];(i||n)&&(e[o]=function(){var t;try{n&&(t=n.apply(this,arguments)),i&&(t=i.apply(this,arguments))}catch(t){var r="Exception in "+e.className+"."+o+"(): "+("string"==typeof t?t:t.stack);m.onError&&m.onError(r,t)}return t})}function r(e,t,o){if(console&&console.warn){var i=e.className+" property '"+t+"' was used but has been deprecated.";o&&(i+=" Use '"+o+"' instead."),console.warn(i)}}var s=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},a=o(4),l=o(6),c=o(7),m=function(e){function t(o,n){if(e.call(this,o),n)for(var s in n)s in o&&r(this,s,n[s]);i(this,t.prototype,["componentWillMount","componentDidMount","shouldComponentUpdate","componentWillUpdate","componentWillReceiveProps","render","componentDidUpdate","componentWillUnmount"])}return s(t,e),t.prototype.componentWillUnmount=function(){if(this.__disposables){for(var e=0,t=this._disposables.length;e<t;e++){var o=this.__disposables[e];o.dispose&&o.dispose()}this.__disposables=null}},Object.defineProperty(t.prototype,"className",{get:function(){var e=/function (.{1,})\(/,t=e.exec(this.constructor.toString());return t&&t.length>1?t[1]:""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_disposables",{get:function(){return this.__disposables||(this.__disposables=[]),this.__disposables},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_async",{get:function(){return this.__async||(this.__async=new l.Async(this),this._disposables.push(this.__async)),this.__async},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_events",{get:function(){return this.__events||(this.__events=new c.EventGroup(this),this._disposables.push(this.__events)),this.__events},enumerable:!0,configurable:!0}),t.prototype._resolveRef=function(e){var t=this;return this.__resolves||(this.__resolves={}),this.__resolves[e]||(this.__resolves[e]=function(o){return t[e]=o}),this.__resolves[e]},t}(a.Component);t.BaseComponent=m,m.onError=function(e){throw console.error(e),e}},function(e,t){"use strict";var o=function(){function e(e,t){this._timeoutIds=null,this._immediateIds=null,this._intervalIds=null,this._animationFrameIds=null,this._isDisposed=!1,this._parent=e||null,this._onErrorHandler=t,this._noop=function(){}}return e.prototype.dispose=function(){var e;if(this._isDisposed=!0,this._parent=null,this._timeoutIds){for(e in this._timeoutIds)this._timeoutIds.hasOwnProperty(e)&&this.clearTimeout(e);this._timeoutIds=null}if(this._immediateIds){for(e in this._immediateIds)this._immediateIds.hasOwnProperty(e)&&this.clearImmediate(e);this._immediateIds=null}if(this._intervalIds){for(e in this._intervalIds)this._intervalIds.hasOwnProperty(e)&&this.clearInterval(e);this._intervalIds=null}if(this._animationFrameIds){for(e in this._animationFrameIds)this._animationFrameIds.hasOwnProperty(e)&&this.cancelAnimationFrame(e);this._animationFrameIds=null}},e.prototype.setTimeout=function(e,t){var o=this,i=0;return this._isDisposed||(this._timeoutIds||(this._timeoutIds={}),i=setTimeout(function(){try{delete o._timeoutIds[i],e.apply(o._parent)}catch(e){o._onErrorHandler&&o._onErrorHandler(e)}},t),this._timeoutIds[i]=!0),i},e.prototype.clearTimeout=function(e){this._timeoutIds&&this._timeoutIds[e]&&(clearTimeout(e),delete this._timeoutIds[e])},e.prototype.setImmediate=function(e){var t=this,o=0;if(!this._isDisposed){this._immediateIds||(this._immediateIds={});var i=function(){try{delete t._immediateIds[o],e.apply(t._parent)}catch(e){t._logError(e)}};o=window.setImmediate?window.setImmediate(i):window.setTimeout(i,0),this._immediateIds[o]=!0}return o},e.prototype.clearImmediate=function(e){this._immediateIds&&this._immediateIds[e]&&(window.clearImmediate?window.clearImmediate(e):window.clearTimeout(e),delete this._immediateIds[e])},e.prototype.setInterval=function(e,t){var o=this,i=0;return this._isDisposed||(this._intervalIds||(this._intervalIds={}),i=setInterval(function(){try{e.apply(o._parent)}catch(e){o._logError(e)}},t),this._intervalIds[i]=!0),i},e.prototype.clearInterval=function(e){this._intervalIds&&this._intervalIds[e]&&(clearInterval(e),delete this._intervalIds[e])},e.prototype.throttle=function(e,t,o){var i=this;if(this._isDisposed)return this._noop;var n,r,s=t||0,a=!0,l=!0,c=0,m=null;o&&"boolean"==typeof o.leading&&(a=o.leading),o&&"boolean"==typeof o.trailing&&(l=o.trailing);var d=function(t){var o=(new Date).getTime(),u=o-c,p=a?s-u:s;return u>=s&&(!t||a)?(c=o,m&&(i.clearTimeout(m),m=null),n=e.apply(i._parent,r)):null===m&&l&&(m=i.setTimeout(d,p)),n},u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return r=e,d(!0)};return u},e.prototype.debounce=function(e,t,o){var i=this;if(this._isDisposed)return this._noop;var n,r,s=t||0,a=!1,l=!0,c=null,m=0,d=(new Date).getTime(),u=null;o&&"boolean"==typeof o.leading&&(a=o.leading),o&&"boolean"==typeof o.trailing&&(l=o.trailing),o&&"number"==typeof o.maxWait&&!isNaN(o.maxWait)&&(c=o.maxWait);var p=function(t){var o=(new Date).getTime(),h=!1;t&&(a&&o-m>=s&&(h=!0),m=o);var f=o-m,g=s-f,b=o-d,v=!1;return null!==c&&(b>=c&&u?v=!0:g=Math.min(g,c-b)),f>=s||v||h?(u&&(i.clearTimeout(u),u=null),d=o,n=e.apply(i._parent,r)):null!==u&&t||!l||(u=i.setTimeout(p,g)),n},h=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return r=e,p(!0)};return h},e.prototype.requestAnimationFrame=function(e){var t=this,o=0;if(!this._isDisposed){this._animationFrameIds||(this._animationFrameIds={});var i=function(){try{delete t._animationFrameIds[o],e.apply(t._parent)}catch(e){t._logError(e)}};o=window.requestAnimationFrame?window.requestAnimationFrame(i):window.setTimeout(i,0),this._animationFrameIds[o]=!0}return o},e.prototype.cancelAnimationFrame=function(e){this._animationFrameIds&&this._animationFrameIds[e]&&(window.cancelAnimationFrame?window.cancelAnimationFrame(e):window.clearTimeout(e),delete this._animationFrameIds[e])},e.prototype._logError=function(e){this._onErrorHandler&&this._onErrorHandler(e)},e}();t.Async=o},function(e,t){"use strict";var o=function(){function e(t){this._id=e._uniqueId++,this._parent=t,this._eventRecords=[]}return e.raise=function(t,o,i,n){var r;if(e._isElement(t)){if(document.createEvent){var s=document.createEvent("HTMLEvents");s.initEvent(o,n,!0),s.args=i,r=t.dispatchEvent(s)}else if(document.createEventObject){var a=document.createEventObject(i);t.fireEvent("on"+o,a)}}else for(;t&&r!==!1;){var l=t.__events__,c=l?l[o]:null;for(var m in c)if(c.hasOwnProperty(m))for(var d=c[m],u=0;r!==!1&&u<d.length;u++){var p=d[u];p.objectCallback&&(r=p.objectCallback.call(p.parent,i))}t=n?t.parent:null}return r},e.isObserved=function(e,t){var o=e&&e.__events__;return!!o&&!!o[t]},e.isDeclared=function(e,t){var o=e&&e.__declaredEvents;return!!o&&!!o[t]},e.stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},e._isElement=function(e){return!!e&&(e.addEventListener||e instanceof HTMLElement)},e.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this.off(),this._parent=null)},e.prototype.onAll=function(e,t,o){for(var i in t)t.hasOwnProperty(i)&&this.on(e,i,t[i],o)},e.prototype.on=function(t,o,i,n){var r=this;if(o.indexOf(",")>-1)for(var s=o.split(/[ ,]+/),a=0;a<s.length;a++)this.on(t,s[a],i,n);else{var l=this._parent,c={target:t,eventName:o,parent:l,callback:i,objectCallback:null,elementCallback:null,useCapture:n},s=t.__events__=t.__events__||{};if(s[o]=s[o]||{count:0},s[o][this._id]=s[o][this._id]||[],s[o][this._id].push(c),s[o].count++,e._isElement(t)){var m=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];if(!r._isDisposed){var o;try{if(o=i.apply(l,e),o===!1&&e[0]){var n=e[0];n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.cancelBubble=!0}}catch(e){}return o}};c.elementCallback=m,t.addEventListener?t.addEventListener(o,m,n):t.attachEvent&&t.attachEvent("on"+o,m)}else{var d=function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];if(!r._isDisposed)return i.apply(l,e)};c.objectCallback=d}this._eventRecords.push(c)}},e.prototype.off=function(e,t,o,i){for(var n=0;n<this._eventRecords.length;n++){var r=this._eventRecords[n];if(!(e&&e!==r.target||t&&t!==r.eventName||o&&o!==r.callback||"boolean"==typeof i&&i!==r.useCapture)){var s=r.target.__events__,a=s[r.eventName],l=a?a[this._id]:null;l&&(1!==l.length&&o?(a.count--,l.splice(l.indexOf(r),1)):(a.count-=l.length,delete s[r.eventName][this._id]),a.count||delete s[r.eventName]),r.elementCallback&&(r.target.removeEventListener?r.target.removeEventListener(r.eventName,r.elementCallback,r.useCapture):r.target.detachEvent&&r.target.detachEvent("on"+r.eventName,r.elementCallback)),this._eventRecords.splice(n--,1)}}},e.prototype.raise=function(t,o,i){return e.raise(this._parent,t,o,i)},e.prototype.declare=function(e){var t=this._parent.__declaredEvents=this._parent.__declaredEvents||{};if("string"==typeof e)t[e]=!0;else for(var o=0;o<e.length;o++)t[e[o]]=!0},e._uniqueId=0,e}();t.EventGroup=o},function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(9))},function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(10)),i(o(11))},function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},r=this&&this.__decorate||function(e,t,o,i){var n,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,o,s):n(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},s=o(4),a=o(11),l=o(12),c=o(23),m="data-is-focusable",d="data-disable-click-on-enter",u="data-focuszone-id",p="tabindex",h={},f=function(e){function t(t){e.call(this,t),this._id=l.getId("FocusZone"),h[this._id]=this,this._focusAlignment={left:0,top:0}}return i(t,e),t.prototype.componentDidMount=function(){for(var e=this.refs.root.ownerDocument.defaultView,t=l.getParent(this.refs.root);t&&t!==document.body&&1===t.nodeType;){if(c.isElementFocusZone(t)){this._isInnerZone=!0;break}t=l.getParent(t)}this._events.on(e,"keydown",this._onKeyDownCapture,!0)},t.prototype.componentWillUnmount=function(){delete h[this._id]},t.prototype.render=function(){var e=this.props,t=e.rootProps,o=e.ariaLabelledBy,i=e.className;return s.createElement("div",n({},t,{className:l.css("ms-FocusZone",i),ref:"root","data-focuszone-id":this._id,"aria-labelledby":o,onKeyDown:this._onKeyDown,onFocus:this._onFocus},{onMouseDownCapture:this._onMouseDown}),this.props.children)},t.prototype.focus=function(){if(this._activeElement&&l.elementContains(this.refs.root,this._activeElement))return this._activeElement.focus(),!0;var e=this.refs.root.firstChild;return this.focusElement(c.getNextElement(this.refs.root,e,!0))},t.prototype.focusElement=function(e){var t=this.props.onBeforeFocus;return!(t&&!t(e))&&(!(!e||(this._activeElement&&(this._activeElement.tabIndex=-1),this._activeElement=e,!e))&&(this._focusAlignment||this._setFocusAlignment(e,!0,!0),this._activeElement.tabIndex=0,e.focus(),!0))},t.prototype._onFocus=function(e){var t=this.props.onActiveElementChanged;if(this._isImmediateDescendantOfZone(e.target))this._activeElement=e.target,this._setFocusAlignment(this._activeElement);else for(var o=e.target;o&&o!==this.refs.root;){if(c.isElementTabbable(o)&&this._isImmediateDescendantOfZone(o)){this._activeElement=o;break}o=l.getParent(o)}t&&t(this._activeElement,e)},t.prototype._onKeyDownCapture=function(e){e.which===l.KeyCodes.tab&&this._updateTabIndexes()},t.prototype._onMouseDown=function(e){var t=this.props.disabled;if(!t){for(var o=e.target,i=[];o&&o!==this.refs.root;)i.push(o),o=l.getParent(o);for(;i.length&&(o=i.pop(),!c.isElementFocusZone(o));)o&&c.isElementTabbable(o)&&(o.tabIndex=0,this._setFocusAlignment(o,!0,!0))}},t.prototype._onKeyDown=function(e){var t=this.props,o=t.direction,i=t.disabled,n=t.isInnerZoneKeystroke;if(!i){if(n&&this._isImmediateDescendantOfZone(e.target)&&n(e)){var r=this._getFirstInnerZone();if(!r||!r.focus())return}else switch(e.which){case l.KeyCodes.left:if(o!==a.FocusZoneDirection.vertical&&this._moveFocusLeft())break;return;case l.KeyCodes.right:if(o!==a.FocusZoneDirection.vertical&&this._moveFocusRight())break;return;case l.KeyCodes.up:if(o!==a.FocusZoneDirection.horizontal&&this._moveFocusUp())break;return;case l.KeyCodes.down:if(o!==a.FocusZoneDirection.horizontal&&this._moveFocusDown())break;return;case l.KeyCodes.home:var s=this.refs.root.firstChild;if(this.focusElement(c.getNextElement(this.refs.root,s,!0)))break;return;case l.KeyCodes.end:var m=this.refs.root.lastChild;if(this.focusElement(c.getPreviousElement(this.refs.root,m,!0,!0,!0)))break;return;case l.KeyCodes.enter:if(this._tryInvokeClickForFocusable(e.target))break;return;default:return}e.preventDefault(),e.stopPropagation()}},t.prototype._tryInvokeClickForFocusable=function(e){do{if("BUTTON"===e.tagName||"A"===e.tagName)return!1;if(this._isImmediateDescendantOfZone(e)&&"true"===e.getAttribute(m)&&"true"!==e.getAttribute(d))return l.EventGroup.raise(e,"click",null,!0),!0;e=l.getParent(e)}while(e!==this.refs.root);return!1},t.prototype._getFirstInnerZone=function(e){e=e||this._activeElement||this.refs.root;for(var t=e.firstElementChild;t;){if(c.isElementFocusZone(t))return h[t.getAttribute(u)];var o=this._getFirstInnerZone(t);if(o)return o;t=t.nextElementSibling}return null},t.prototype._moveFocus=function(e,t,o){var i,n=this._activeElement,r=-1,s=!1,l=this.props.direction===a.FocusZoneDirection.bidirectional;if(!n)return!1;if(this._isElementInput(n)&&!this._shouldInputLoseFocus(n,e))return!1;var m=l?n.getBoundingClientRect():null;do{if(n=e?c.getNextElement(this.refs.root,n):c.getPreviousElement(this.refs.root,n),!l){i=n;break}if(n){var d=n.getBoundingClientRect(),u=t(m,d);if(u>-1&&(r===-1||u<r)&&(r=u,i=n),r>=0&&u<0)break}}while(n);if(i&&i!==this._activeElement)s=!0,this.focusElement(i);else if(this.props.isCircularNavigation)return e?this.focusElement(c.getNextElement(this.refs.root,this.refs.root.firstElementChild,!0)):this.focusElement(c.getPreviousElement(this.refs.root,this.refs.root.lastElementChild,!0,!0,!0));return s},t.prototype._moveFocusDown=function(){var e=-1,t=this._focusAlignment.left;return!!this._moveFocus(!0,function(o,i){var n=-1,r=Math.floor(i.top),s=Math.floor(o.bottom);return(e===-1&&r>=s||r===e)&&(e=r,n=t>=i.left&&t<=i.left+i.width?0:Math.abs(i.left+i.width/2-t)),n})&&(this._setFocusAlignment(this._activeElement,!1,!0),!0)},t.prototype._moveFocusUp=function(){var e=-1,t=this._focusAlignment.left;return!!this._moveFocus(!1,function(o,i){var n=-1,r=Math.floor(i.bottom),s=Math.floor(i.top),a=Math.floor(o.top);return(e===-1&&r<=a||s===e)&&(e=s,n=t>=i.left&&t<=i.left+i.width?0:Math.abs(i.left+i.width/2-t)),n})&&(this._setFocusAlignment(this._activeElement,!1,!0),!0)},t.prototype._moveFocusLeft=function(){var e=this,t=-1,o=this._focusAlignment.top;return!!this._moveFocus(l.getRTL(),function(i,n){var r=-1;return(t===-1&&n.right<=i.right&&(e.props.direction===a.FocusZoneDirection.horizontal||n.top===i.top)||n.top===t)&&(t=n.top,r=Math.abs(n.top+n.height/2-o)),r})&&(this._setFocusAlignment(this._activeElement,!0,!1),!0)},t.prototype._moveFocusRight=function(){var e=this,t=-1,o=this._focusAlignment.top;return!!this._moveFocus(!l.getRTL(),function(i,n){var r=-1;return(t===-1&&n.left>=i.left&&(e.props.direction===a.FocusZoneDirection.horizontal||n.top===i.top)||n.top===t)&&(t=n.top,r=Math.abs(n.top+n.height/2-o)),r})&&(this._setFocusAlignment(this._activeElement,!0,!1),!0)},t.prototype._setFocusAlignment=function(e,t,o){if(this.props.direction===a.FocusZoneDirection.bidirectional&&(!this._focusAlignment||t||o)){var i=e.getBoundingClientRect(),n=i.left+i.width/2,r=i.top+i.height/2;this._focusAlignment||(this._focusAlignment={left:n,top:r}),t&&(this._focusAlignment.left=n),o&&(this._focusAlignment.top=r)}},t.prototype._isImmediateDescendantOfZone=function(e){for(var t=l.getParent(e);t&&t!==this.refs.root&&t!==document.body;){if(c.isElementFocusZone(t))return!1;t=l.getParent(t)}return!0},t.prototype._updateTabIndexes=function(e){e||(e=this.refs.root,this._activeElement&&!l.elementContains(e,this._activeElement)&&(this._activeElement=null));for(var t=e.children,o=0;t&&o<t.length;o++){var i=t[o];c.isElementFocusZone(i)||(c.isElementTabbable(i)?this.props.disabled?i.setAttribute(p,"-1"):this._isInnerZone||this._activeElement&&this._activeElement!==i?"-1"!==i.getAttribute(p)&&i.setAttribute(p,"-1"):(this._activeElement=i,"0"!==i.getAttribute(p)&&i.setAttribute(p,"0")):"svg"===i.tagName&&"false"!==i.getAttribute("focusable")&&i.setAttribute("focusable","false"),this._updateTabIndexes(i))}},t.prototype._isElementInput=function(e){return!(!e||!e.tagName||"input"!==e.tagName.toLowerCase())},t.prototype._shouldInputLoseFocus=function(e,t){if(e&&e.hasAttribute("selectionStart")){var o=e.selectionStart,i=e.selectionEnd,n=o!==i,r=e.value;if(n||o>0&&!t||o!==r.length&&t)return!1}return!0},t.defaultProps={isCircularNavigation:!1,direction:a.FocusZoneDirection.bidirectional},r([l.autobind],t.prototype,"_onFocus",null),r([l.autobind],t.prototype,"_onMouseDown",null),r([l.autobind],t.prototype,"_onKeyDown",null),t}(l.BaseComponent);t.FocusZone=f},function(e,t){"use strict";!function(e){e[e.vertical=0]="vertical",e[e.horizontal=1]="horizontal",e[e.bidirectional=2]="bidirectional"}(t.FocusZoneDirection||(t.FocusZoneDirection={}));t.FocusZoneDirection},function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(5)),i(o(6)),i(o(13)),i(o(14)),i(o(15)),i(o(16)),i(o(17)),i(o(7)),i(o(18)),i(o(19)),i(o(21)),i(o(22))},function(e,t){"use strict";!function(e){e[e.a=65]="a",e[e.backspace=8]="backspace",e[e.comma=188]="comma",e[e.del=46]="del",e[e.down=40]="down",e[e.end=35]="end",e[e.enter=13]="enter",e[e.escape=27]="escape",e[e.home=36]="home",e[e.left=37]="left",e[e.pageDown=34]="pageDown",e[e.pageUp=33]="pageUp",e[e.right=39]="right",e[e.semicolon=186]="semicolon",e[e.space=32]="space",e[e.tab=9]="tab",e[e.up=38]="up"}(t.KeyCodes||(t.KeyCodes={}));t.KeyCodes},function(e,t){"use strict";function o(e,t){for(var o=-1,i=0;e&&i<e.length;i++)if(t(e[i],i)){o=i;break}return o}function i(e,t){for(var o=[],i=0;i<e;i++)o.push(t(i));return o}t.findIndex=o,t.createArray=i},function(e,t){"use strict";function o(e,t,o){var i=o.value;return{configurable:!0,get:function(){return this===i.prototype?i:i.bind(this)},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:!0,value:e})}}}t.autobind=o},function(e,t){"use strict";function o(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];for(var o=[],i=0,n=e;i<n.length;i++){var r=n[i];if(r)if("string"==typeof r)o.push(r);else for(var s in r)r[s]&&o.push(s)}return o.join(" ")}t.css=o},function(e,t){"use strict";function o(e,t){var o=e,i=t;o._virtual||(o._virtual={children:[]});var n=o._virtual.parent;if(n&&n!==t){var r=n._virtual.children.indexOf(o);r>-1&&n._virtual.children.splice(r,1)}o._virtual.parent=i||void 0,i&&(i._virtual||(i._virtual={children:[]}),i._virtual.children.push(o))}function i(e){var t;return e&&m(e)&&(t=e._virtual.parent),t}function n(e,t){return void 0===t&&(t=!0),e&&(t&&i(e)||e.parentNode&&e.parentNode)}function r(e,t,o){void 0===o&&(o=!0);var i=!1;if(e&&t)if(o)for(i=!1;t;){var r=n(t);if(r===e){i=!0;break}t=r}else e.contains&&(i=e.contains(t));return i}function s(e){d=e}function a(e){return d?void 0:e&&e.ownerDocument&&e.ownerDocument.defaultView?e.ownerDocument.defaultView:window}function l(e){return d?void 0:e&&e.ownerDocument?e.ownerDocument:document}function c(e){var t;return e&&(e===window?t={left:0,top:0,width:window.innerWidth,height:window.innerHeight,right:window.innerWidth,bottom:window.innerHeight}:e.getBoundingClientRect&&(t=e.getBoundingClientRect())),t}function m(e){return e&&!!e._virtual}t.setVirtualParent=o,t.getVirtualParent=i,t.getParent=n,t.elementContains=r;var d=!1;t.setSSR=s,t.getWindow=a,t.getDocument=l,t.getRect=c},function(e,t){"use strict";function o(e,t,o){void 0===o&&(o=n);var i=[],r=function(n){"function"!=typeof t[n]||void 0!==e[n]||o&&o.indexOf(n)!==-1||(i.push(n),e[n]=function(){t[n].apply(t,arguments)})};for(var s in t)r(s);return i}function i(e,t){t.forEach(function(t){return delete e[t]})}var n=["setState","render","componentWillMount","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","componentDidUpdate","componentWillUnmount"];t.hoistMethods=o,t.unhoistMethods=i},function(e,t,o){(function(e){"use strict";function o(e,t){for(var o in e)if(e.hasOwnProperty(o)&&(!t.hasOwnProperty(o)||t[o]!==e[o]))return!1;return!0}function i(e,t){return o(e,t)&&o(t,e)}function n(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];return r.apply(this,[null,e].concat(t))}function r(e,t){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];t=t||{};for(var n=0,r=o;n<r.length;n++){var s=r[n];if(s)for(var a in s)(s.hasOwnProperty(a)&&!e||e(a))&&(t[a]=s[a])}return t}function s(e){var t=l[a]++;return(e||"")+t}var a="__currentId__",l="undefined"!=typeof window&&window||e;void 0===l[a]&&(l[a]=0),t.shallowCompare=i,t.assign=n,t.filteredAssign=r,t.getId=s}).call(t,o(20))},function(e,t){function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function n(e){if(m===setTimeout)return setTimeout(e,0);if((m===o||!m)&&setTimeout)return m=setTimeout,setTimeout(e,0);try{return m(e,0)}catch(t){try{return m.call(null,e,0)}catch(t){return m.call(this,e,0)}}}function r(e){if(d===clearTimeout)return clearTimeout(e);if((d===i||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){f&&p&&(f=!1,p.length?h=p.concat(h):g=-1,h.length&&a())}function a(){if(!f){var e=n(s);f=!0;for(var t=h.length;t;){for(p=h,h=[];++g<t;)p&&p[g].run();g=-1,t=h.length}p=null,f=!1,r(e)}}function l(e,t){this.fun=e,this.array=t}function c(){}var m,d,u=e.exports={};!function(){try{m="function"==typeof setTimeout?setTimeout:o}catch(e){m=o}try{d="function"==typeof clearTimeout?clearTimeout:i}catch(e){d=i}}();var p,h=[],f=!1,g=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)t[o-1]=arguments[o];h.push(new l(e,t)),1!==h.length||f||n(a)},l.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=c,u.addListener=c,u.once=c,u.off=c,u.removeListener=c,u.removeAllListeners=c,u.emit=c,u.binding=function(e){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(e){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},function(e,t,o){"use strict";function i(){if(void 0===l){var e=a.getDocument();if(!e)throw new Error("getRTL was called in a server environment without setRTL being called first. Call setRTL to set the correct direction first.");l="rtl"===document.documentElement.getAttribute("dir")}return l}function n(e){var t=a.getDocument();t&&t.documentElement.setAttribute("dir",e?"rtl":"ltr"),l=e}function r(e){return i()&&(e===s.KeyCodes.left?e=s.KeyCodes.right:e===s.KeyCodes.right&&(e=s.KeyCodes.left)),e}var s=o(13),a=o(17),l=!1;t.getRTL=i,t.setRTL=n,t.getRTLSafeKeyCode=r},function(e,t,o){"use strict";function i(e,t,o){return n.filteredAssign(function(e){return(!o||o.indexOf(e)<0)&&(0===e.indexOf("data-")||0===e.indexOf("aria-")||t.indexOf(e)>=0)},{},e)}var n=o(19);t.baseElementEvents=["onCopy","onCut","onPaste","onCompositionEnd","onCompositionStart","onCompositionUpdate","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onInput","onSubmit","onLoad","onError","onKeyDown","onKeyDownCapture","onKeyPress","onKeyUp","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onClick","onClickCapture","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onMouseUpCapture","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onScroll","onWheel"],t.baseElementProperties=["defaultChecked","defaultValue","accept","acceptCharset","accessKey","action","allowFullScreen","allowTransparency","alt","async","autoComplete","autoFocus","autoPlay","capture","cellPadding","cellSpacing","charSet","challenge","checked","children","classID","className","cols","colSpan","content","contentEditable","contextMenu","controls","coords","crossOrigin","data","dateTime","default","defer","dir","download","draggable","encType","form","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","headers","height","hidden","high","hrefLang","htmlFor","httpEquiv","icon","id","inputMode","integrity","is","keyParams","keyType","kind","label","lang","list","loop","low","manifest","marginHeight","marginWidth","max","maxLength","media","mediaGroup","method","min","minLength","multiple","muted","name","noValidate","open","optimum","pattern","placeholder","poster","preload","radioGroup","readOnly","rel","required","role","rows","rowSpan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","span","spellCheck","src","srcDoc","srcLang","srcSet","start","step","style","summary","tabIndex","title","type","useMap","value","width","wmode","wrap"],t.anchorProperties=t.baseElementProperties.concat(t.baseElementEvents,["href","target"]),t.buttonProperties=t.baseElementProperties.concat(t.baseElementEvents,["disabled"]),t.divProperties=t.baseElementProperties.concat(t.baseElementEvents),t.inputProperties=t.buttonProperties,t.textAreaProperties=t.buttonProperties,t.imageProperties=t.divProperties,t.getNativeProps=i},function(e,t,o){"use strict";function i(e,t,o){ return a(e,t,!0,!1,!1,o)}function n(e,t,o){return s(e,t,!0,!1,!0,o)}function r(e){var t=a(e,e,!0,!1,!1,!0);return!!t&&(t.focus(),!0)}function s(e,t,o,i,n,r){if(!t||t===e)return null;var a=l(t);if(n&&(r||!m(t))&&a){var d=s(e,t.lastElementChild,!0,!0,!0,r);if(d)return d}if(o&&a&&c(t))return t;var u=s(e,t.previousElementSibling,!0,!0,!0,r);return u?u:i?null:s(e,t.parentElement,!0,!1,!1,r)}function a(e,t,o,i,n,r){if(!t||t===e&&n)return null;var s=l(t);if(o&&s&&c(t))return t;if(!n&&s&&(r||!m(t))){var d=a(e,t.firstElementChild,!0,!0,!1,r);if(d)return d}if(t===e)return null;var u=a(e,t.nextElementSibling,!0,!0,!1,r);return u?u:i?null:a(e,t.parentElement,!1,!1,!0,r)}function l(e){if(!e||!e.getAttribute)return!1;var t=e.getAttribute(h);return null!==t&&void 0!==t?"true"===t:0!==e.offsetHeight||null!==e.offsetParent||e.isVisible===!0}function c(e){return!!e&&("A"===e.tagName||"BUTTON"===e.tagName&&!e.disabled||"INPUT"===e.tagName&&!e.disabled||"TEXTAREA"===e.tagName&&!e.disabled||e.getAttribute&&"true"===e.getAttribute(p))}function m(e){return e&&!!e.getAttribute(f)}function d(e){var t=u.getDocument(e).activeElement;return!(!t||!u.elementContains(e,t))}var u=o(17),p="data-is-focusable",h="data-is-visible",f="data-focuszone-id";t.getFirstFocusable=i,t.getLastFocusable=n,t.focusFirstChild=r,t.getPreviousElement=s,t.getNextElement=a,t.isElementVisible=l,t.isElementTabbable=c,t.isElementFocusZone=m,t.doesElementContainFocus=d},function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(25))},function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(26)),i(o(50))},function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},r=this&&this.__decorate||function(e,t,o,i){var n,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,o,s):n(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},s=o(4),a=o(27),l=o(8),c=o(13),m=o(7),d=o(15),u=o(16),p=o(21),h=o(19),f=o(6),g=o(22),b=o(28);o(49);var v;!function(e){e[e.vertical=0]="vertical",e[e.horizontal=1]="horizontal"}(v||(v={}));var y;!function(e){e[e.auto=0]="auto",e[e.left=1]="left",e[e.center=2]="center",e[e.right=3]="right"}(y||(y={}));var w;!function(e){e[e.top=0]="top",e[e.center=1]="center",e[e.bottom=2]="bottom"}(w||(w={}));var x=function(e){function t(t){e.call(this,t),this.state={contextualMenuItems:null,subMenuId:h.getId("ContextualMenu")},this._isFocusingPreviousElement=!1,this._didSetInitialFocus=!1,this._enterTimerId=0,this._events=new m.EventGroup(this),this._async=new f.Async(this),t.targetElement&&t.targetElement.ownerDocument&&t.targetElement.ownerDocument.defaultView?this._targetWindow=t.targetElement.ownerDocument.defaultView:this._targetWindow=window}return i(t,e),t.prototype.dismiss=function(e,t){var o=this.props.onDismiss;o&&o(e,t)},t.prototype.componentWillMount=function(){this._previousActiveElement=document.activeElement},t.prototype.componentDidMount=function(){this._events.on(this._targetWindow,"resize",this.dismiss)},t.prototype.componentWillReceiveProps=function(e,t){e.targetElement!==this.props.targetElement&&(this._didSetInitialFocus=!1)},t.prototype.componentWillUnmount=function(){var e=this;this._isFocusingPreviousElement&&this._previousActiveElement&&setTimeout(function(){return e._previousActiveElement.focus()},0),this._events.dispose(),this._async.dispose()},t.prototype.render=function(){var e=this,o=this.props,i=o.className,r=o.items,a=o.isBeakVisible,c=o.labelElementId,m=o.targetElement,d=o.id,p=o.targetPoint,h=o.useTargetPoint,f=o.beakWidth,g=o.directionalHint,v=o.gapSpace,y=o.coverTarget,w=o.ariaLabel,x=o.doNotLayer,k=this.state.submenuProps,_=!(!r||!r.some(function(e){return!!e.icon})),P=!(!r||!r.some(function(e){return!!e.canCheck}));return s.createElement(b.Callout,{targetElement:m,targetPoint:p,useTargetPoint:h,isBeakVisible:a,beakWidth:f,directionalHint:g,gapSpace:v,coverTarget:y,doNotLayer:x,className:"ms-ContextualMenu-Callout",setInitialFocus:!0,onDismiss:this.props.onDismiss},s.createElement("div",{ref:function(t){return e._host=t},id:d,className:u.css("ms-ContextualMenu-container",i)},r&&r.length?s.createElement(l.FocusZone,{className:"ms-ContextualMenu is-open",direction:l.FocusZoneDirection.vertical,ariaLabelledBy:c,ref:function(t){return e._focusZone=t},rootProps:{role:"menu"}},s.createElement("ul",{className:"ms-ContextualMenu-list is-open",onKeyDown:this._onKeyDown,"aria-label":w},r.map(function(t,o){return"-"===t.name?s.createElement("li",{role:"separator",key:t.key||o,className:u.css("ms-ContextualMenu-divider",t.className)}):s.createElement("li",{role:"menuitem",title:t.title,key:t.key||o,className:u.css("ms-ContextualMenu-item",t.className)},e._renderMenuItem(t,o,P,_))}))):null,k?s.createElement(t,n({},k)):null))},t.prototype._renderMenuItem=function(e,t,o,i){return e.onRender?e.onRender(e):e.href?this._renderAnchorMenuItem(e,t,o,i):this._renderButtonItem(e,t,o,i)},t.prototype._renderAnchorMenuItem=function(e,t,o,i){return s.createElement("div",null,s.createElement("a",n({},g.getNativeProps(e,g.anchorProperties),{href:e.href,className:u.css("ms-ContextualMenu-link",e.isDisabled?"is-disabled":""),role:"menuitem",onClick:this._onAnchorClick.bind(this,e)}),i?s.createElement("span",{className:"ms-ContextualMenu-icon"+(e.icon?" ms-Icon ms-Icon--"+e.icon:" no-icon")}):null,s.createElement("span",{className:"ms-ContextualMenu-linkText ms-fontWeight-regular"}," ",e.name," ")))},t.prototype._renderButtonItem=function(e,t,o,i){var n=this,r=this.state,a=r.expandedMenuItemKey,l=r.subMenuId,c="";e.ariaLabel?c=e.ariaLabel:e.name&&(c=e.name);var m={className:u.css("ms-ContextualMenu-link",{"is-expanded":a===e.key}),onClick:this._onItemClick.bind(this,e),onKeyDown:e.items&&e.items.length?this._onItemKeyDown.bind(this,e):null,onMouseEnter:this._onItemMouseEnter.bind(this,e),onMouseLeave:this._onMouseLeave,onMouseDown:function(t){return n._onItemMouseDown(e,t)},disabled:e.isDisabled,role:"menuitem",href:e.href,title:e.title,"aria-label":c,"aria-haspopup":!(!e.items||!e.items.length)||null,"aria-owns":e.key===a?l:null};return s.createElement("button",h.assign({},g.getNativeProps(e,g.buttonProperties),m),this._renderMenuItemChildren(e,t,o,i))},t.prototype._renderMenuItemChildren=function(e,t,o,i){return s.createElement("div",{className:"ms-ContextualMenu-linkContent"},o?s.createElement("span",{className:u.css("ms-ContextualMenu-icon",{"ms-Icon ms-Icon--CheckMark":e.isChecked,"not-selected":!e.isChecked}),onClick:this._onItemClick.bind(this,e)}):null,i?s.createElement("span",{className:"ms-ContextualMenu-icon"+(e.icon?" ms-Icon ms-Icon--"+e.icon:" no-icon")}):null,s.createElement("span",{className:"ms-ContextualMenu-itemText ms-fontWeight-regular"},e.name),e.items&&e.items.length?s.createElement("i",{className:u.css("ms-ContextualMenu-submenuChevron ms-Icon",p.getRTL()?"ms-Icon--ChevronLeft":"ms-Icon--ChevronRight")}):null)},t.prototype._onKeyDown=function(e){var t=p.getRTL()?c.KeyCodes.right:c.KeyCodes.left;(e.which===c.KeyCodes.escape||e.which===c.KeyCodes.tab||e.which===t&&this.props.isSubMenu)&&(this._isFocusingPreviousElement=!0,e.preventDefault(),e.stopPropagation(),this.dismiss(e))},t.prototype._onItemMouseEnter=function(e,t){var o=this,i=t.currentTarget;e.key!==this.state.expandedMenuItemKey&&(e.items&&e.items.length?this._enterTimerId=this._async.setTimeout(function(){return o._onItemSubMenuExpand(e,i)},500):this._enterTimerId=this._async.setTimeout(function(){return o._onSubMenuDismiss(t)},500))},t.prototype._onMouseLeave=function(e){this._async.clearTimeout(this._enterTimerId)},t.prototype._onItemMouseDown=function(e,t){e.onMouseDown&&e.onMouseDown(e,t)},t.prototype._onItemClick=function(e,t){e.key!==this.state.expandedMenuItemKey&&(e.items&&e.items.length?e.key===this.state.dismissedMenuItemKey?this._onSubMenuDismiss(t):this._onItemSubMenuExpand(e,t.currentTarget):this._executeItemClick(e,t)),t.stopPropagation(),t.preventDefault()},t.prototype._onAnchorClick=function(e,t){this._executeItemClick(e,t),t.stopPropagation()},t.prototype._executeItemClick=function(e,t){e.onClick&&e.onClick(t,e),this.dismiss(t,!0)},t.prototype._onItemKeyDown=function(e,t){var o=p.getRTL()?c.KeyCodes.left:c.KeyCodes.right;t.which===o&&this._onItemSubMenuExpand(e,t.currentTarget)},t.prototype._onItemSubMenuExpand=function(e,t){this.state.expandedMenuItemKey!==e.key&&(this.state.submenuProps&&this._onSubMenuDismiss(),this.setState({expandedMenuItemKey:e.key,submenuProps:{items:e.items,targetElement:t,onDismiss:this._onSubMenuDismiss,isSubMenu:!0,id:this.state.subMenuId,shouldFocusOnMount:!0,directionalHint:p.getRTL()?a.DirectionalHint.leftTopEdge:a.DirectionalHint.rightTopEdge,className:this.props.className}}))},t.prototype._onSubMenuDismiss=function(e,t){t?this.dismiss(e,t):this.setState({dismissedMenuItemKey:this.state.expandedMenuItemKey,expandedMenuItemKey:null,submenuProps:null})},t.defaultProps={items:[],shouldFocusOnMount:!0,isBeakVisible:!1,gapSpace:0,directionalHint:a.DirectionalHint.rightBottomEdge,beakWidth:16},r([d.autobind],t.prototype,"dismiss",null),r([d.autobind],t.prototype,"_onKeyDown",null),r([d.autobind],t.prototype,"_onMouseLeave",null),r([d.autobind],t.prototype,"_onSubMenuDismiss",null),t}(s.Component);t.ContextualMenu=x},function(e,t){"use strict";!function(e){e[e.topLeftEdge=0]="topLeftEdge",e[e.topCenter=1]="topCenter",e[e.topRightEdge=2]="topRightEdge",e[e.topAutoEdge=3]="topAutoEdge",e[e.bottomLeftEdge=4]="bottomLeftEdge",e[e.bottomCenter=5]="bottomCenter",e[e.bottomRightEdge=6]="bottomRightEdge",e[e.bottomAutoEdge=7]="bottomAutoEdge",e[e.leftTopEdge=8]="leftTopEdge",e[e.leftCenter=9]="leftCenter",e[e.leftBottomEdge=10]="leftBottomEdge",e[e.rightTopEdge=11]="rightTopEdge",e[e.rightCenter=12]="rightCenter",e[e.rightBottomEdge=13]="rightBottomEdge"}(t.DirectionalHint||(t.DirectionalHint={}));t.DirectionalHint},function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(29))},function(e,t,o){"use strict";function i(e){for(var o in e)t.hasOwnProperty(o)||(t[o]=e[o])}i(o(30)),i(o(27))},function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=this&&this.__assign||Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},r=o(4),s=o(31),a=o(39),l=function(e){function t(t){e.call(this,t)}return i(t,e),t.prototype.render=function(){var e=r.createElement(s.CalloutContent,n({},this.props));return this.props.doNotLayer?e:r.createElement(a.Layer,null,e)},t}(r.Component);t.Callout=l},function(e,t,o){"use strict";var i=this&&this.__extends||function(e,t){function o(){this.constructor=e}for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},n=this&&this.__decorate||function(e,t,o,i){var n,r=arguments.length,s=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(r<3?n(s):r>3?n(t,o,s):n(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},r=o(4),s=o(27),a=o(12),l=o(32),c=o(23),m=o(12),d=o(35),u=o(5);o(37);var p={top:0,left:0},h={top:-9999,left:0},f=1,g=8,b=function(e){function t(t){e.call(this,t),this._didSetInitialFocus=!1,this.state={positions:null,slideDirectionalClassName:null,calloutElementRect:null},t.targetElement&&t.targetElement.ownerDocument&&t.targetElement.ownerDocument.defaultView?this._targetWindow=t.targetElement.ownerDocument.defaultView:this._targetWindow=window,this._positionAttempts=0}return i(t,e),t.prototype.componentDidUpdate=function(){this._setInitialFocus(),this._updatePosition()},t.prototype.componentDidMount=function(){this._onComponentDidMount()},t.prototype.render=function(){var e=this,t=this.props,o=t.className,i=t.targetElement,n=t.isBeakVisible,s=t.beakStyle,l=t.children,c=t.beakWidth,m=this.state,u=m.positions,f=m.slideDirectionalClassName,g=c;"ms-Callout-smallbeak"===s&&(g=16);var b={top:u&&u.beak?u.beak.top:p.top,left:u&&u.beak?u.beak.left:p.left,height:g,width:g},v=this._getMaxHeight(),y=n&&!!i,w=r.createElement("div",{ref:this._resolveRef("_hostElement"),className:"ms-Callout-container"},r.createElement("div",{className:a.css("ms-Callout",o,f?"ms-u-"+f:""),style:u?u.callout:h,ref:this._resolveRef("_calloutElement")},y?r.createElement("div",{className:"ms-Callout-beak",style:b}):null,y?r.createElement("div",{className:"ms-Callout-beakCurtain"}):null,r.createElement(d.Popup,{className:"ms-Callout-main",onDismiss:function(t){return e.dismiss()},shouldRestoreFocus:!0,style:{maxHeight:v}},l)));return w},t.prototype.dismiss=function(){var e=this.props.onDismiss;e&&e()},t.prototype._dismissOnLostFocus=function(e){var t=this.props.targetElement,o=e.target;e.target===this._targetWindow||!this._hostElement||a.elementContains(this._hostElement,o)||t&&a.elementContains(t,o)||this.dismiss()},t.prototype._setInitialFocus=function(){this.props.setInitialFocus&&!this._didSetInitialFocus&&this.state.positions&&(this._didSetInitialFocus=!0,c.focusFirstChild(this._calloutElement))},t.prototype._onComponentDidMount=function(){this._events.on(this._targetWindow,"scroll",this._dismissOnLostFocus,!0),this._events.on(this._targetWindow,"resize",this.dismiss,!0),this._events.on(this._targetWindow,"focus",this._dismissOnLostFocus,!0),this._events.on(this._targetWindow,"click",this._dismissOnLostFocus,!0),this.props.onLayerMounted&&this.props.onLayerMounted(),this._updatePosition()},t.prototype._updatePosition=function(){var e=this.state.positions,t=this._hostElement,o=this._calloutElement;if(t&&o){var i=void 0;i=m.assign(i,this.props),i.bounds=this._getBounds();var n=l.getRelativePositions(i,t,o);(!e&&n||e&&n&&(e.callout.top.toFixed(2)!==n.calloutPosition.top.toFixed(2)||e.callout.left.toFixed(2)!==n.calloutPosition.left.toFixed(2))&&this._positionAttempts<5)&&(this._positionAttempts++,this.setState({positions:{callout:n.calloutPosition,beak:n.beakPosition},slideDirectionalClassName:n.directionalClassName}))}else this._positionAttempts=0},t.prototype._getBounds=function(){if(!this._bounds){var e=this.props.bounds;e||(e={top:0+g,left:0+g,right:this._targetWindow.innerWidth-g,bottom:this._targetWindow.innerHeight-g,width:this._targetWindow.innerWidth-2*g,height:this._targetWindow.innerHeight-2*g}),this._bounds=e}return this._bounds},t.prototype._getMaxHeight=function(){return this._maxHeight||(this._maxHeight=this._getBounds().height-2*f),this._maxHeight},t.defaultProps={isBeakVisible:!0,beakWidth:28,gapSpace:0,directionalHint:s.DirectionalHint.bottomAutoEdge},n([a.autobind],t.prototype,"_setInitialFocus",null),n([a.autobind],t.prototype,"_onComponentDidMount",null),t}(u.BaseComponent);t.CalloutContent=b},function(e,t,o){"use strict";function i(e,t,o){var i=e.isBeakVisible?e.beakWidth:0,a=h._getBorderSize(o),m=h._calculateActualBeakWidthInPixels(i)/2+(e.gapSpace?e.gapSpace:0),d=e.bounds?h._getRectangleFromIRect(e.bounds):new r.default(0,window.innerWidth-s.getScrollbarWidth(),0,window.innerHeight),u=h._getTargetRect(d,e.targetElement,e.creationEvent,e.targetPoint,e.useTargetPoint),p=h._getPositionData(e.directionalHint,u,d,e.coverTarget),f=h._positionCalloutWithinBounds(h._getRectangleFromHTMLElement(o),u,d,p,m,e.coverTarget),g=h._positionBeak(i,f,u,a),b=h._finalizeCalloutPosition(f.calloutRectangle,t);return{calloutPosition:{top:b.top,left:b.left},beakPosition:{top:g.top,left:g.left,display:"block"},directionalClassName:c[f.targetEdge],submenuDirection:f.calloutEdge===l.right?n.DirectionalHint.leftBottomEdge:n.DirectionalHint.rightBottomEdge}}var n=o(27),r=o(33),s=o(34),a=o(19);!function(e){e[e.top=0]="top",e[e.bottom=1]="bottom",e[e.left=2]="left",e[e.right=3]="right"}(t.RectangleEdge||(t.RectangleEdge={}));var l=t.RectangleEdge,c=(f={},f[l.top]="slideUpIn20",f[l.bottom]="slideDownIn20",f[l.left]="slideLeftIn20",f[l.right]="slideRightIn20",f),m=function(){function e(e,t,o,i,n,r){this.calloutDirection=e,this.targetDirection=t,this.calloutPercent=o,this.targetPercent=i,this.beakPercent=n,this.isAuto=r}return e}();t.PositionData=m;var d=(g={},g[n.DirectionalHint.topLeftEdge]=new m(l.bottom,l.top,0,0,50,!1),g[n.DirectionalHint.topCenter]=new m(l.bottom,l.top,50,50,50,!1),g[n.DirectionalHint.topRightEdge]=new m(l.bottom,l.top,100,100,50,!1),g[n.DirectionalHint.topAutoEdge]=new m(l.bottom,l.top,0,0,50,!0),g[n.DirectionalHint.bottomLeftEdge]=new m(l.top,l.bottom,0,0,50,!1),g[n.DirectionalHint.bottomCenter]=new m(l.top,l.bottom,50,50,50,!1),g[n.DirectionalHint.bottomRightEdge]=new m(l.top,l.bottom,100,100,50,!1),g[n.DirectionalHint.bottomAutoEdge]=new m(l.top,l.bottom,0,0,50,!0),g[n.DirectionalHint.leftTopEdge]=new m(l.right,l.left,0,0,50,!1),g[n.DirectionalHint.leftCenter]=new m(l.right,l.left,50,50,50,!1),g[n.DirectionalHint.leftBottomEdge]=new m(l.right,l.left,100,100,50,!1),g[n.DirectionalHint.rightTopEdge]=new m(l.left,l.right,0,0,50,!1),g[n.DirectionalHint.rightCenter]=new m(l.left,l.right,50,50,50,!1),g[n.DirectionalHint.rightBottomEdge]=new m(l.left,l.right,100,100,50,!1),g),u=(b={},b[n.DirectionalHint.topLeftEdge]=new m(l.top,l.top,0,0,50,!1),b[n.DirectionalHint.topCenter]=new m(l.top,l.top,50,50,50,!1),b[n.DirectionalHint.topRightEdge]=new m(l.top,l.top,100,10