/** * IBM Confidential OCO Source Materials IBM Business Platform: Glass Foundation * (C) Copyright IBM Corp. 2016, 2017 * * The source code for this program is not published or otherwise divested of * its trade secrets, irrespective of what has been deposited with the U.S. * Copyright Office */ function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n":":/@=[]'<>",i=[],o=0;for(n=0;n /g)||[]).length,r=this._parseSTT(e,n),i="",o=this.LRM,s=n?1:0;i=0===r.length?this.enforceTextDirection(e):this.enforceTextDirection(e.substring(0,r[0]-s));for(var a=0;a=r.left&&n.pageX<=r.right,o=n.pageY>=r.top&&n.pageY<=r.bottom;return i&&o}}}),define("baglass/core-client/js/core-client/utils/dnd/DnDManager",["jquery","underscore","../../ui/core/Class","../dom-utils"],function(d,c,e,s){"use strict";return new(e.extend({dropTargets:null,currentDropTarget:null,init:function(){this.dropTargets=[],this.currentDropTarget={},this.addDropTarget(d("body")[0],".dialogBlocker",{accepts:function(){return!0}})},on:function(e,t,n,r,i){return e.on(t,n,r,i),{remove:function(){e.off(t,n,i)}}},addDropTarget:function(e,t,n){return"string"!=typeof t&&(n=t,t=null),this.removeDropTarget(e),this.dropTargets.push({el:e,selector:t,callbacks:n}),{remove:function(){this.removeDropTarget(e)}.bind(this)}},removeDropTarget:function(t){var e=c.find(this.dropTargets,function(e){return e.el===t});e&&this.dropTargets.splice(c.indexOf(this.dropTargets,e),1)},_isScrollDropSupported:function(){return!(!this.currentDropTarget.target||!this.currentDropTarget.target.callbacks.isScrollDropSupported)},_validateDropTarget:function(e,t,n){var r=e;return t&&((n.x+1>=d(window).innerWidth()||n.y+1>=d(window).height()||n.x<=1||n.y<=1)&&(r=r?this._getClosestTargetWithScrollSupport(r.node):this.lastActiveScrollableTarget),!r&&this.currentDropTarget&&(r=this._getClosestTargetWithScrollSupport(this.currentDropTarget.node))),r||{}},_getClosestTargetWithScrollSupport:function(e){var t=d(e).parents();t.splice(0,0,e);for(var n=null,r=0;ro||i>s.area&&s.priority>=o)}return s},getDropTargetFromNode:function(e){for(var t=null,n=0;nMath.abs(this.dragObject.position.x-this.dragObject.startPosition.x),r=!e.moveYThreshold||e.moveYThreshold>Math.abs(this.dragObject.position.y-this.dragObject.startPosition.y);return t&&n&&r},_callMove:function(e,t){this.callerCallbacks.onMove&&this.callerCallbacks.onMove(t,{dragObject:this.dragObject,dropTargetNode:e.node})},_callStartDrag:function(e){this.callerCallbacks.onDragStart&&!this.isDragStartCalled&&(this.callerCallbacks.onDragStart(e,{dragObject:this.dragObject}),c.each(this.dropTargets,function(e){e.callbacks.onDragStart&&e.callbacks.onDragStart(this.dragObject)}.bind(this))),d("body").addClass("dragging"),this.isDragStartCalled=!0},upHandler:function(e){if(this.isDragStartCalled){var t=!1;d("body").removeClass("dragging");var n=this.currentDropTarget;this._dropTargetCallback(n,"onDrop")&&(t=!0),this.callerCallbacks.onDragDone&&this.callerCallbacks.onDragDone(e,{dragObject:this.dragObject,dropTargetNode:t?n.node:null,isDropped:t}),n.nonActiveDropZones&&c.each(n.nonActiveDropZones,function(e){this._dropTargetCallback(e,"onDrop")}.bind(this)),c.each(this.dropTargets,function(e){e.callbacks.onDragEnd&&e.callbacks.onDragEnd(this.dragObject)}.bind(this))}this.resetDragging()},resetDragging:function(){document.releaseCapture&&document.releaseCapture(),this.attachedMoveHandler&&this.attachedMoveHandler.remove(),this.attachedUpHandler&&this.attachedUpHandler.remove(),this.attachedScrollHandler&&this.attachedScrollHandler.remove(),d("body").removeClass("preventSelection"),this.currentDropTarget={},this.dragObject=null,this.isDragStartCalled=!1,this.targetMap=null,this.lastActiveScrollableTarget=null,d(this.avatar).remove()}}))}),define("baglass/core-client/js/core-client/utils/EventHelper",["jquery","./BidiUtil","./dnd/DnDManager","underscore","hammerjs","jquery.hammer"],function(u,d,i,e,t){var n=[];for(var r in t.gestures)t.gestures.hasOwnProperty(r)&&n.push(t.gestures[r].name);var o={prevent_mouseevents:!0,stop_browser_behavior:!1};u.each(n,function(e,t){u.event.special[t]={setup:function(){var e=u(this);e.data("hammer")||e.hammer(o)}}}),u.fn.onClick=function(t){return this.on("click",function(e){t(e)}).on("tap",function(e){t(e),e.gesture.preventDefault()}),this};var s=function(r,i,o){var s=r._$inlineEdit;r._updateWidth=function(){if(s){var e=s.val()||"";e!==s._hidden.text()&&(s._hidden.text(e),s.width(s._hidden.width()+2))}},r._inlineEditChangedFn=function(){var e=s.val().trim();0===e.length&&o.noEmptyText&&(e=r._previousInlineText),s.removeClass("inlineText").off("keypress").off("keydown").off("blur");var t=!1;r._previousInlineText!==e&&(t=!0),r._previousInlineText=null,s._hidden.remove(),s._hidden=null,s.off(),s.hide(),s.parent().remove(),s=null,r._$inlineEdit=null,r.text(e),r.removeClass("inEditMode"),r.show().focus(),t&&i(e);var n=o&&o.onEditEnd;n&&n()}.bind(r);var e,t,n,a=r.text();if(r._previousInlineText=a,s)s.val(a);else{r.addClass("inEditMode");var c=u("
",{class:"inlineEditContainer"});c.css(function(e,t){var n=e.css(["padding-top","padding-right","padding-bottom","padding-left","margin-top","margin-right","margin-bottom","margin-left","border-bottom-color","border-bottom-style","border-bottom-width","border-top-color","border-top-style","border-top-width","border-right-color","border-right-style","border-right-width","border-left-color","border-left-style","border-left-width","position","top","right","left","bottom","height","width","min-height","min-width","max-height","max-width"]);if("0px"===n.height&&delete n.height,"0px"===n.width&&delete n.width,t&&t.maxSizeNode){var r=u(t.maxSizeNode);t.maxSizeNode.style.width?(n["max-width"]="100%",delete n.width):n["max-width"]=r.width()+"px"}return n}(r,o)),r.after(c),(s=u("",{class:"inlineText"})).css("max-width","100%"),s.css((t={width:"0px","min-width":(e=r).css("fontSize")},"center"===(n=e.css("text-align"))?t.margin="0px auto":"right"===n&&(t.margin="0px 0px 0px auto"),t));var l=r.css(["fontSize","fontFamily","fontWeight","letterSpacing","color"]);s.css(l),c.append(s),(r._$inlineEdit=s).val(a),s._hidden=u('
'),s._hidden.css(l),r.hide(),r.after(s._hidden),s.on("keyup keydown input propertychange change",function(){r._updateWidth()}),o&&o.style&&s.css(o.style),r._updateWidth(),s.on("blur",r._inlineEditChangedFn).on("keypress",function(e){13===e.keyCode&&r._inlineEditChangedFn()}).on("keyup",function(e){46!==e.keyCode&&8!==e.keyCode||e.stopPropagation()}).on("keydown",function(e){37!==e.keyCode&&39!==e.keyCode||e.stopPropagation()}).on("mousedown mouseup dblclick",function(e){e.stopPropagation()}),d.initElementForBidi(s[0]),s.show()}return s.focus(),s[0].setSelectionRange(0,9999),!1};u.fn.inlineEditor=function(t,n){if("remove"===t)this._$inlineEdit&&this._inlineEditChangedFn(),this.off("dblclick",this._inlineEditFn),this.off("hold",this._inlineEditFn),delete this._inlineEditFn,delete this._previousInlineText,delete this._inlineEditChangedFn,delete this._updateWidth;else if("blur"===t)this._$inlineEdit&&this._inlineEditChangedFn();else{if("isEditing"===t)return!!this._$inlineEdit;if("edit"===t)this._inlineEditFn&&this._inlineEditFn();else{var r=n&&n.onEditStart;this._inlineEditFn=function(e){i.resetDragging(),r&&r(),s(this,t,n),e&&e.stopPropagation()}.bind(this),this.hammer({stop_browser_behavior:!1,prevent_mouseevents:!0}),this.on("dblclick",this._inlineEditFn),this.on("hold",this._inlineEditFn),this.on("keypress",function(e){var t=e.keyCode||e.charCode;13!==t&&32!==t||this._inlineEditFn(e)}.bind(this))}}}}),define("baglass/core-client/js/core-client/ui/core/View",["jquery","underscore","doT","./Events","../../utils/EventHelper"],function(i,s,t,e){"use strict";var n=null,a=/^(\S+)\s*(.*)$/,r=["el","id","className","tagName","events"];return n=e.extend({templateString:null,id:null,init:function(e){n.inherited("init",this,arguments),this.viewId=s.uniqueId("view"),this.dotTemplate=t.template(this.templateString||""),s.extend(this,s.pick(e||{},r)),this._initDomElement(),this._attachEvents()},tagName:"div",_initDomElement:function(){if(this.el)this.setElement(s.result(this,"el"));else{var e={};this.id&&(e.id=s.result(this,"id")),this.className&&(e.class=s.result(this,"className")),this.setElement(document.createElement(this.tagName)),this.$el.attr(e)}},$:function(e){return this.$el.find(e)},hide:function(){this.$el.hide()},show:function(){this.$el.show()},getTarget:function(e,t){var n=i(e);if(!n.hasClass(t)){var r=n.parents("."+t);0
\n'}),define("text!baglass/core-client/js/core-client/ui/template/LoadingWaitAnimation2.html",[],function(){return''}),define("text!baglass/core-client/js/core-client/ui/template/MediumSpinner.html",[],function(){return'\n'}),define("text!baglass/core-client/js/core-client/utils/templates/webfont.html",[],function(){return''}),define("text!baglass/core-client/js/core-client/utils/templates/image.html",[],function(){return''}),define("text!baglass/core-client/js/core-client/utils/templates/svg.html",[],function(){return'\n\t{{? it.tooltip}}\n\t\t\n\t\t\t{{!it.tooltip}}\n\t\t\n\t{{?}}\n\t\n\t\n\n'}),define("baglass/core-client/js/core-client/utils/BrowserUtils",[],function(){return{isBrowser:{ie:function(){return this.isIE()},ieEdge:function(){return this.isIEEdge()},ie11:function(){return this.isIE11()},ff:function(){return this.isFirefox()},chrome:function(){return this.isChrome()},safari:function(){return this.isSafari()},iPad:function(){return this.isIPad()}},isIE:function(){return/\b(MSIE|Trident|Edge)\b/.test(this._getUserAgent())},isIE11:function(){return/Trident\/7\./.test(this._getUserAgent())},isIEEdge:function(){return/Edge/.test(this._getUserAgent())},isFirefox:function(){return/.*Firefox.*/i.test(this._getUserAgent())},isChrome:function(){return/chrome/i.test(this._getUserAgent())&&!this.isIE()},isSafari:function(){return/^((?!chrome|android|crios|fxios).)*safari/i.test(this._getUserAgent())&&!this.isChrome()&&!this.isIE()&&!this.isIPad()},isIPad:function(){return/iPad/i.test(this._getUserAgent())},_getUserAgent:function(){return navigator.userAgent}}}),define("baglass/core-client/js/core-client/utils/LegacyUtils",["jquery","underscore","./BrowserUtils"],function(t,o,s){return{legacyLaunch:function(e,t,n){this._openLegacyWindow(this._getLaunchParms(e,t,n))},getLegacyLaunchUrl:function(e,t,n,r){return this._getUrl(this._getLaunchParms(e,t,n,r))},_getLaunchParms:function(e,t,n,r){var i=this.legacyApps[t]||t;return o.isUndefined(i)||o.isUndefined(i.launchParams)?{b_action:"xts.run",m:"portal/launch.xts","ui.gateway":e.gateway+"/v1/disp","ui.tool":t,"ui.object":n,"ui.action":r||"new","launch.launchinWindow":"true",backURL:"disp?b_action=xts.run&m=portal/close.xts"}:i.launchParams},canUseLegacyTool:function(e,t){var n=this.legacyApps[t]||t;if(!o.isUndefined(n)&&e.hasCapability(n.capability)){var r=n.browsers;if(o.isUndefined(r))return!0;for(var i=0;i",{id:this.ALERT_ID,style:"position:absolute; top:-9000px;",role:"alert","aria-live":"assertive"})).text(e),u("body").append(t),setTimeout(function(){t.remove()}.bind(this),100)}},closeDialog:function(){u(".dialogBlocker").find("#cancel").trigger("primaryaction")},_isWebFont:function(e){if(e)for(var t in c){var n=new RegExp("^"+c[t],"g");if(-1!==e.search(n))return!0}return!1},_isImageIcon:function(e){if(e)for(var t in l){var n=new RegExp(l[t],"g");if(-1!==e.search(n))return!0}return!1},legacyLaunch:function(e,t,n,r){return s.legacyLaunch(e,t,n,r)},EVENT_DIALOG:"eventDialog",setEventProperty:function(e,t,n){this._getSourceEvent(e)[t]=n},getEventProperty:function(e,t){var n=this._getSourceEvent(e);return n[t]&&!0===n[t]},_getSourceEvent:function(e){return e.gesture?e.gesture.srcEvent:e.originalEvent?e.originalEvent:e},isIpad:function(){return null!==navigator.userAgent.match(/iPad/i)&&(u("body").addClass("mobile"),!0)},isControlKey:function(e){return/Macintosh/.test(this._getBrowserUserAgent())?e.metaKey:e.ctrlKey},_getBrowserUserAgent:function(){return navigator.userAgent},isInIframe:function(e){try{return(e=e||window).self!==e.top}catch(e){return!0}},formatDuration:function(e){if(!e||isNaN(e))return a.get("unknown");var t=Math.floor(e/1e3),n=Math.floor(t/60),r=Math.floor(n/60),i=Math.floor(r/24);return t%=60,n%=60,r%=24,0'),u(document.body).append(e)),e.get(0)},removeTemporaryContainer:function(){u(document.body).find(".reactTemporaryContainer").remove()},reactRender:function(r,i){return new Promise(function(t,n){require(["react-dom"],function(e){try{e.render(r,i,t)}catch(e){n(e)}},n)})},is24HrFormat:function(){throw new Error("This function has been removed; Use core-client/utils/DateTimeUtils.is24HrFormat")},getCurrentWindow:function(){return window},createPerformanceMark:function(){throw new Error("This function has been removed; Use core-client/utils/PerfUtils.createPerformanceMark")},clearPerformanceMark:function(){throw new Error("This function has been removed; Use core-client/utils/PerfUtils.clearPerformanceMark")},traverse:function(e,t){for(var n=[e];n.length;){var r=n.shift();if(r&&t(r))return r;(d.isObject(r)||d.isArray(r))&&(n=n.concat(d.values(r)))}}}}),define("baglass/core-client/js/core-client/ui/ToastMessage",["./core/Class","underscore","jquery","toastr","../utils/Utils","../nls/StringResources","jquery-ui"],function(e,p,f,h,g,v){var t=e.extend({TIMEOUT:3e3,MAX_TOAST:5,currentOptions:{},defaultOptions:{closeButton:!0,newestOnTop:!1,tapToDismiss:!1,positionClass:"toast-top-center",showDuration:"500",hideDuration:"500",showEasing:"swing",hideEasing:"linear",showMethod:"slideDown",hideMethod:"slideUp",type:"success",iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},secondaryLabel:v.get("details")},init:function(e){this.toastrOptions={},f.extend(!0,this.toastrOptions,this.defaultOptions,e),this.toastrOptions.timeOut=this.toastrOptions.timeOut||0,this.toastrOptions.extendedTimeOut=0,t.inherited("init",this,arguments)},render:function(e){var t=f.now(),n="toast-message"+t,r="toast-icon"+t;p.isUndefined(h.options.type)&&(h.options.type="success");var i=v.get(h.options.type);if(h.options.btnLabel){var o=f("
",{"aria-label":h.options.btnLabel,title:h.options.btnLabel,class:"toast-close-label",type:"button",role:"button",tabIndex:"0"});o.text(h.options.btnLabel),h.options.closeHtml=o[0]}else{var s=v.get("close"),a=f("
",{role:"button","aria-label":s,title:s,class:"toast-close-div",tabIndex:"0"});g.setIcon(a,"common-close_icon",s),h.options.closeHtml=a[0]}h.options.type=h.options.type.toLowerCase();var c,l="common-success";switch(e=p.escape(e),this._isMessageLarge(e)&&p.each(h.options.iconClasses,function(e,t){h.options.iconClasses[t]=e.concat(" large")}),h.options.type){case"info":h.options.timeOut=0===h.options.timeOut?this.TIMEOUT:h.options.timeOut,c=h.info(e),l="common-info-moreinfo";break;case"warning":h.options.timeOut=h.options.timeOut||0,c=h.warning(e),l="common-warning";break;case"error":h.options.timeOut=h.options.timeOut||0,c=h.error(e),l="common-error";break;default:h.options.timeOut=0===h.options.timeOut?this.TIMEOUT:h.options.timeOut,c=h.success(e)}if(c){c.parent().removeAttr("role aria-live"),g.activateAriaAlert(e),c.attr("aria-labelledby",r+" "+n),c.find(".toast-message").attr("id",n);var u=f("
",{class:"toast-icon",id:r,"aria-label":i});c.append(u),g.setIcon(u,l,i),p.isFunction(h.options.callback)&&c.find(".toast-close-button").on("primaryaction",h.options.callback),f(c).unbind("mouseenter mouseleave");var d=c.find(".toast-close-button");this._addSecondaryButton(d),d.on("primaryaction",function(e){d.off("primaryaction"),d.trigger("click"),this.setNextTabFocus(c),e&&e.stopPropagation()}.bind(this)),c.on("click",function(e){e&&e.stopPropagation()}.bind(this)),this._limitToast()}return c},show:function(e){return h.options=this.toastrOptions,this.render(e)},setNextTabFocus:function(e){var t=e.next(".toast").find(".toast-close-button").first();0===t.length&&(t=e.prev(".toast").find(".toast-close-button").first()),0===t.length?f(":tabbable:first").focus():t.focus()},_limitToast:function(){var e=f(document).find("#toast-container").children();if(e.length>this.MAX_TOAST)for(var t=e.length-this.MAX_TOAST,n=0;n'+this.toastrOptions.secondaryLabel+"");n.click(function(){t.toastrOptions.secondaryCallback(),e.trigger("primaryaction")}),e.after(n)}},_isMessageLarge:function(e){var t,n=f(''+e+"");n.css("width",200),n.css("height","auto"),n.css("font-size",15),n.css("font-family","HelvNeue Roman for IBM"),n.css("word-wrap","break-word");var r=f("
");return r.css("width",200),r.css("position","absolute"),r.css("left",-500),r.append(n),f("body").append(r),t=30'),this.$exitHeader=t('
'),this.$el.append(this.$entryHeader),this.$el.append(this.$exitHeader),this.$entryHeader.on("focus",this._enterView.bind(this)),this.$exitHeader.on("focus",this._setFocusToLaunchPoint.bind(this))},getLaunchPoint:function(){return this._launchPoint},setInnerContent:function(e){e instanceof t&&e.insertAfter(this.$exitHeader)},_enterView:function(){this.$el.find(":tabbable").eq(2).focus()},setLaunchPoint:function(e){this._launchPoint=e},enableLooping:function(e){e instanceof t&&!0===this.enableTabLooping&&!1===e.next().hasClass("tabLoopFooter")&&(this.$loopFooter=t('
'),this.$loopFooter.insertAfter(e),this.$loopFooter.on("focus",this._tabToFirstElementInView.bind(e)),this.$loopHeader=t('
'),this.$loopHeader.insertBefore(e),this.$loopHeader.on("focus",this._tabToLastElementInView.bind(e)))},_setFocusToLaunchPoint:function(){void 0!==this.getLaunchPoint()&&null!==this.getLaunchPoint()&&t(this.getLaunchPoint()).focus()},_tabToFirstElementInView:function(){var e=this.find(":tabbable").first();null!=e&&e.focus()},_tabToLastElementInView:function(){var e=this.find(":tabbable").last();null!=e&&e.focus()},removeContainerOnlyFromTabOrder:function(){this.$entryHeader.removeAttr("tabIndex"),this.$exitHeader.removeAttr("tabIndex"),this.$loopFooter&&this.$loopFooter.removeAttr("tabIndex"),this.$loopHeader&&this.$loopHeader.removeAttr("tabIndex")},enterContainerOnlyInTabOrder:function(){this.$entryHeader.attr("tabindex","0"),this.$exitHeader.attr("tabindex","0"),this.$loopFooter&&this.$loopFooter.attr("tabIndex","0"),this.$loopHeader&&this.$loopHeader.attr("tabIndex","0")},remove:function(){r.inherited("remove",this,arguments)}});return r}),define("baglass/core-client/js/core-client/utils/PerfUtils",["underscore"],function(n){return{createPerformanceMark:function(e){if(!n.isUndefined(e)){var t=this._getPerformance();!n.isUndefined(t)&&n.isFunction(t.mark)&&t.mark(e.component+"-"+e.name+"-"+e.state)}},clearPerformanceMark:function(e){if(!n.isUndefined(e)){var t=this._getPerformance();!n.isUndefined(t)&&n.isFunction(t.clearMarks)&&t.clearMarks(e.component+"-"+e.name+"-"+e.state)}},_getPerformance:function(){return performance}}}),define("baglass/core-client/js/core-client/ui/Slideout",["./AccessibleView","jquery","underscore","../utils/ClassFactory","../utils/Utils","../utils/PerfUtils","../nls/StringResources","jquery-ui","touch-punch"],function(e,a,u,t,o,s,c){var d=null;function l(e,t){for(var n=!1;null!==e;)n=n||a.contains(e.$el.get(0),t),e=e.child;return n}function n(){var i=null;null===this.parent&&(this.hideHandler=function(e){var t,n,r;i="mousedown"===e.type||"touchstart"===e.type?e:(r=i,l(t=this,(n=e).target)||!a.contains(document.body,n.target)||n.isDefaultPrevented()||0!==t.$el.closest(".tabhidden").length||o.getEventProperty(n,o.EVENT_DIALOG)||null!==r&&l(t,r.target)||this.hide({hideOnly:this.hideOnly}),null)}.bind(this))}function p(){null===this.hideHandler||this.hasOpenChild()||a(document).off(this.closeEventPattern,this.hideHandler),this.$el.children(".ui-resizable-handle").hide(),this.trigger("hide")}function r(e,t){var n=this;this.addChildLocked||(this.addChildLocked=!0,this.removeChild().then(function(){return n.child=e,t.overlay?(n.$el.css("z-index","2999"),a(n.$el.parents()[0]).append(n.child.$el)):n.$el.children(".pane-child").append(n.child.$el),n.child.render(),n.child.setContent(t.content),n.child.show()}).then(function(){n.addChildLocked=!1}))}return d=e.extend({_ClassFactory:t,ANIMATION_TIMEOUT:500,DISPLAY_LIMIT:3,PAGINATION_WIDTH:36,open:!1,events:{"primaryaction .pane-pagination-control":"pageBack","primaryaction .pin-icon":"_togglePin"},closeEventPattern:"mousedown.slideout touchstart.slideout clicktap.slideout",init:function(e){this.child=null,this.open=!1,this.parent=null,d.inherited("init",this,arguments),a.extend(this,e),this.hideHandler=null,this._showing=null,this.hideOnParentClick=!1!==this.hideOnParentClick,this._root=null===this.parent?this:this.parent._root,this._index=null===this.parent?0:this.parent._index+1,this.__initPinningSettings(),this.__initDisplaySettings(),function(){u.isString(this.id)||(this.id=this.content&&u.isString(this.content.module)?this.content.module:u.uniqueId("undefinedModule"))}.call(this),n.call(this,e),this._childToAdd=[],this._paginationLaunchPoint=null,void 0!==this.label&&null!==this.label||(this.label=u.uniqueId(c.get("defaultSlideoutLabel")))},__initPinningSettings:function(){u.isUndefined(this.pinning)&&(this.pinning={isPinned:!1,float:!0,display:!1}),u.isBoolean(this.pinning.isPinned)||(this.pinning.isPinned=!1),u.isBoolean(this.pinning.float)||(this.pinning.float=!0),u.isBoolean(this.pinning.display)||(!0===this.pinning.isPinned?this.pinning.display=!0:this.pinning.display=!1)},__initDisplaySettings:function(){this._displayIndex=null!==this.parent&&!0===this.overlay?this.parent._displayIndex:this._index,null===this.parent&&(this._root.displayLimit=u.isNumber(this.displayLimit)&&0
');this.setInnerContent(e);var t=this.$el.find(".pane-pagination-control");o.setIcon(t,"common-chevron_left");var n=c.get("paginationControl");if(t.attr("aria-label",n),this.width&&this.setWidth(this.width),this.resizable&&this._setResizable(e),this.isPinDisplayed()){this.$el.find(".pane-content").append('
');var r,i=this.$el.find(".pin-icon");r=this.isPinned()?(this.$el.find(".pane-content").addClass("pane-pinned"),c.get("unpinSlideout")):(i.addClass("transform-pin"),c.get("pinSlideout")),i.attr("aria-label",r)}return u.isObject(this.content)&&this.content.module?this._createContent():Promise.resolve()},_onResizeStop:function(e){return function(){this.onResizeStop&&this.onResizeStop(e),this.fireResizeStart=!0}.bind(this)},_handleResize:function(e){e.target===e.currentTarget&&(this.fireResizeStart&&(this.onResizeStart&&this.onResizeStart(e),this.fireResizeStart=!1),this.onResize&&this.onResize(e),clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(this._onResizeStop(e),200))},addChild:function(e){var t=u.isObject(e)?e:{};t.overlay=!0===t.overlay,t.overlay&&(u.isUndefined(t.width)||t.width=this._root.collapseRootIndex?e=t:(u.isEmpty(r)||u.last(r)._displayIndex!==t._displayIndex)&&(n+=t.getWidth(),r.push(t)):t._displayIndex===e._displayIndex?e=t:i=!0),i=null===(t=t.child)||i;return{firstToCollapse:e,visible:r,width:n,firstDisplayedAfterCollapsed:null,collapsed:[]}},_findSlideoutsToCollapse:function(e){var t,n=null,r=this.getRootParent()._getAvailableWidth(),i=this.getDisplayLimit(),o=[],s=!1;if(null!==e.firstToCollapse){for(t=e.firstToCollapse;null!==t;)t=(n=t).child;t=n;for(var a=!1,c=!0,l=e.visible.length;!a;)!0===t.open&&(s?e.collapsed.unshift(t):c||e.width+t.getWidth()+d.prototype.PAGINATION_WIDTH").addClass("resize-handle ui-resizable-handle ui-resizable-"+(t?"w":"e")),i={handles:[r],minWidth:this.resizable.min||300,maxWidth:this.resizable.max||1e3,direction:t?"left":"right"};t?r.insertBefore(n):r.insertAfter(n),o.setIcon(r,"common-handle"),this.$el.resizable(i)}})}),define("baglass/common/ui/SlideoutRegistry",["../../core-client/js/core-client/ui/core/Events","jquery","underscore","../../core-client/js/core-client/ui/Slideout"],function(e,n,r,i){var o="SlidoutRegistry:openSlideout - One slideout is already open",s=function(e,t){"left"===t.position?e.prepend(t.$el):e.append(t.$el)},a=function(e){return e.toString=function(){return e.msg},e},c=function(e){if("right"!==e&&"left"!==e)throw a({msg:"SlidoutRegistry:openSlideout - Invalid Slideout position",position:e})},t=e.extend({init:function(e){t.inherited("init",this,arguments),n.extend(this,e),this._open={},this._registered={}},openSlideout:function(e){var t;if(!n.prototype.isPrototypeOf(this.$container))throw a({msg:"SlidoutRegistry:openSlideout - Undefined or invalid container",container:this.$container});if(i.prototype.isPrototypeOf(e))t=function(e){var t=e.position;if(c(t),!r.isUndefined(this._open[t]))throw a({msg:o,open:this._open[t]});return r.isUndefined(this._registered[e.getRootId()])?(e.render(),s(this.$container,e)):e.getRootParent()!==this._registered[e.getRootId()]&&(e=this._registered[e.getRootId()]),e.show(),e}.call(this,e);else{if(!r.isObject(e))throw a({msg:"SlidoutRegistry:openSlideout - Invalid Slideout parameter",parameter:e});t=function(e){var t,n=e.position;if(this._registered[e.id])t=this._registered[e.id];else{if(c(n),!r.isUndefined(this._open[n]))throw a({msg:o});(t=new i(e)).render(),s(this.$container,t)}return t.show(),t}.call(this,e)}return this._open[t.position]=t.getRootParent(),function(e){var t=function(e){e.hasOpenChild()||(delete this._open[e.position],(this._registered[e.getRootId()]=e).off("hide",t))}.bind(this,e),n=function(e){this._open[e.position]===e&&delete this._open[e.position],delete this._registered[e.getRootId()],e.off("remove",n),e.off("hide",t)}.bind(this,e);e.on("hide",t),e.on("remove",n)}.call(this,this._open[t.position]),t},getOpenSlideout:function(e){if("left"!==e&&"right"!==e)throw a({msg:"SlidoutRegistry:getOpenSlideout - Invalid Slideout position",position:e});return this._open[e]},getOpenSlideouts:function(){var e=[];return r.isUndefined(this._open.left)||e.push(this._open.left),r.isUndefined(this._open.right)||e.push(this._open.right),e},getRegisteredSlideout:function(e){var t;return r.isString(e)&&(t=this._registered[e]),t},getContainer:function(){return this.$container},changeContainer:function(t){if(!n.prototype.isPrototypeOf(t))throw a({msg:"SlidoutRegistry:changeContainer - Undefined or invalid container",container:this.$container});if(this._open.left||this._open.right)throw a({msg:"SlidoutRegistry:changeContainer - Slideout is open",open:this._open});r.each(this._registered,function(e){s(t,e)},this),this.$container=t},_removeSlideout:function(e){e&&e.remove()},cleanupSlideouts:function(){r.each(this._open,function(e){e&&e.remove()}),r.each(this._registered,function(e){e&&e.remove()})}});return t}),define("baglass/ajax/AjaxErrorFactory",["../core-client/js/core-client/errors/BaseError"],function(i){return{create:function(e,t,n){var r=i.extend({init:function(e,t){r.inherited("init",this,arguments),this.name="AjaxError",this.jqXHR=t.requestInfo.jqXHR,this.textStatus=t.requestInfo.textStatus,this.errorThrown=t.requestInfo.errorThrown}});return new r(e.statusText,{requestInfo:{jqXHR:e,textStatus:t,errorThrown:n},code:e.status})}}}),define("baglass/services/AjaxService",["jquery","../ajax/AjaxErrorFactory"],function(e,t){var n=function(){function t(e){var s=this;_classCallCheck(this,t),this._logWarning=function(e){s._logger&&s._logger.warn&&s._logger.warn("AjaxService",e)},this._handleUrlTooLong=function(e,t,n,r){var i="Request too long. ".concat(JSON.stringify(e),". Prepared URL length: ").concat(t.preparedReqLen," exceeds max configured length ").concat(t.maxQuerySize,".");s._logWarning(i);var o=r(n);return i="URL reducer invoked and returned reduced params: ".concat(JSON.stringify(o),"."),s._logWarning(i),o.skipUrlReducer=!0,s.ajax(o)},this._issueRequest=function(t,n){var r=t.params;return r.urlReducer&&!r.skipUrlReducer?s._checkUrlLength(t).then(function(e){return e.urlTooLong?s._handleUrlTooLong(t,e,n,r.urlReducer):s.executeProcessedAjax(t.params)}):s._sendRequest(t)},this._sendRequest=function(n){return new Promise(function(r,i){s._cntr++;var e="xhr"+s._cntr,t=s.ajaxFn(n.params);(s._inflightRequests[e]=t).then(function(e,t,n){r({data:e,textStatus:t,jqXHR:n})}).fail(function(e,t,n){"abort"!==n?i(s._AjaxErrorFactory.create(e,t,n)):r({textStatus:t,jqXHR:e})}).done(function(){s._inflightRequests[e]&&delete s._inflightRequests[e]})})},this._logger=e&&e.logger||console,this._configService=e&&e.configService,this._errorMessageRenderer=e&&e.errorDialog||void 0,this._requestHandlers=[],this._responseHandlers=[],this._errorHandler=null,this._cntr=0,this._inflightRequests={}}return _createClass(t,[{key:"addRequestHandler",value:function(e){if(!e||"function"!=typeof e.prepareRequest)throw new Error('Handler must implement function "prepareRequest"');this._requestHandlers.push(e)}},{key:"addResponseHandler",value:function(e){if(!e||"function"!=typeof e.handleResponse)throw new Error('Handler must implement function "handleResponse"');this._responseHandlers.push(e)}},{key:"setErrorHandler",value:function(e){if(!e||"function"!=typeof e.handleError)throw new Error('Handler must implement function "handleError"');this._errorHandler=e}},{key:"_buildRequestObject",value:function(e){return{params:e||{}}}},{key:"ajax",value:function(e){var t=this._buildRequestObject(e),n=e&&e.urlReducer?_objectSpread({},e):null;return this._prepareRequest(t).then(this._issueRequest.bind(this,t,n)).then(this._handleResponse.bind(this,t),this._handleError.bind(this,t))}},{key:"executeProcessedAjax",value:function(e){var t=this._buildRequestObject(e);return this._executeProcessedAjax(t)}},{key:"_executeProcessedAjax",value:function(e){return this._sendRequest(e).then(this._handleResponse.bind(this,e),this._handleError.bind(this,e))}},{key:"prepareRequest",value:function(e){var t=this._buildRequestObject(e);return this._prepareRequest(t,!0)}},{key:"_getUrlAndParmsLength",value:function(e){var t=e.url,n=e.data,r=e.method,i=t.length;if("GET"!==r)return i;var o="";if("string"==typeof n)o=n.split("&").reduce(function(e,t){var n=t.split("=");return"".concat(e,"&").concat(n[0],"=").concat(encodeURIComponent(n[1]))},"");else if(Array.isArray(n))o=n.reduce(function(e,t){return"".concat(e,"&").concat(encodeURIComponent(t.name),"=").concat(encodeURIComponent(t.value))},"");else if("object"===_typeof(n))for(var s in n)o="".concat(o,"&").concat(encodeURIComponent(s),"=").concat(encodeURIComponent(n[s]));return i+o.length}},{key:"_checkUrlLength",value:function(n){var r=this;return this._configService.getDatasetQuerySize().then(function(e){var t=r._getUrlAndParmsLength(n.params);return{urlTooLong:e\n\t
\n\t\t\n\t\t\n\t
\n\n'}),define("text!baglass/app/templates/CoachMarkPopover.html",[],function(){return''}),define("baglass/app/CoachMark",["../core-client/js/core-client/ui/AccessibleView","jquery","text!./templates/CoachMarkBubble.html","text!./templates/CoachMarkPopover.html","../nls/StringResources","doT","underscore","bootstrap","jquery-ui"],function(e,p,r,f,h,g,i){var v=e.extend({init:function(e){this.persistence=e.glassContext.getCoreSvc(".CoachMarkService").getPersistence();var t=h.get("coachMarkLabel",{title:i.escape(e.title)}),n=g.template(r)({label:t});this._$coachMark=p(n),e.launchPoint=this._$coachMark,e.enableTabLooping=!0,v.inherited("init",this,arguments)},render:function(e,t){p(".coachMarkPopover").remove();var n=this._$coachMark,r=e.attr("id");n.addClass("coachMark"),t||n.hide(),n.data("containerId",r),e.append(n),e.addClass("coachMarkContainer");var i=e.closest(".toolpane");(i.hasClass("toolpaneLeft")||i.hasClass("toolpaneRight"))&&n.addClass("vertical"),this.placement||(this.placement="right",i.hasClass("toolpaneRight")?this.placement="left":i.hasClass("toolpaneTop")?this.placement="bottom":i.hasClass("toolpaneBottom")&&(this.placement="top"));var o=h.get("coachMarkTurnOffHints"),s=h.get("coachMarkClose"),a=g.template(f)({turnOffText:o,closeText:s}),c={placement:this.placement,trigger:"manual",container:"body",title:this.title||{},content:this.contents||{},template:a,sanitize:!1};this.$popover=n.popover(c);var l=function(e){if(e.which===p.ui.keyCode.ESCAPE||1===p(".coachMarkPopover:visible").length){this.$popover.popover("hide"),removeEventListener("blur",u),removeEventListener("touchstart",l,!0),removeEventListener("click",l,!0),removeEventListener("resize",l,!0),p("body").off("keydown");var t=p(e.target).closest(".coachMark");0!==t.length&&r===t.data("containerId")&&e.stopPropagation()}else 0!==p(".coachMarkPopover").length&&1!==p(".coachMarkPopover:hidden").length||this.$popover.popover("show")}.bind(this),u=function(){document.activeElement&&p(document.activeElement).is("iframe")&&this.$popover.popover("hide")}.bind(this),d=function(e){e.which===p.ui.keyCode.ESCAPE&&(this.getLaunchPoint().focus(),l(e))}.bind(this);this.$popover.on("shown.bs.popover",function(){var e=p(".coachMarkPopover");p(".coachMarkTitle",e).attr("id","coachTitle"),p(".coachMarkText",e).attr("id","coachText"),p(".coachMarkClose",e).focus(),this.enableLooping(p(".coachMarkContent",e)),p(".coachMarkClose",e).on("primaryaction",function(e){this.$popover.popover("hide");var t=this.$popover.data("containerId");t?(this.persistence.marksAsRead(t),p(".coachMark").filter(function(){return p(this).data("containerId")===t}).hide()):p(e.target).closest(".coachMarkPopover").hide()}.bind(this)),p(".actionableLink a",e).on("primaryaction",function(){var e=this.glassContext.getCoreSvc(".UserProfile");e.preferences[v.PREFERENCES_KEY]=v.HIDE_ALL,p(".coachMark").hide(),this.$popover.popover("hide");var t={};t[v.PREFERENCES_KEY]=v.HIDE_ALL,e.savePreferences(t)}.bind(this)),addEventListener("click",l,!0),addEventListener("resize",l,!0),addEventListener("touchstart",l,!0),addEventListener("blur",u),p("body").on("keydown",d)}.bind(this)),this.$popover.on("hidden.bs.popover",function(){removeEventListener("blur",u),removeEventListener("touchstart",l,!0),removeEventListener("click",l,!0),removeEventListener("resize",l,!0),p("body").off("keydown")}.bind(this)),this.$popover.on("primaryaction",function(e){e.stopPropagation(),this.$popover.popover("show")}.bind(this))}});return v.PREFERENCES_KEY="showHints",v.HIDE_ALL="hideAll",v}),define("baglass/app/CoachMarkPersistence",["../core-client/js/core-client/ui/core/Class","jquery"],function(e,n){var r=e.extend({init:function(e){this.glassContext=e.glassContext},isRead:function(t){var n=this;return"hideAll"===this.glassContext.getCoreSvc(".UserProfile").preferences.showHints?Promise.resolve(!0):void 0===this._readCoachMarks?this._getHints().then(function(e){return n._readCoachMarks=e,!0===n._readCoachMarks[t]}).catch(function(e){n._readCoachMarks={};var t=e.jqXHR;if(t&&404===t.status)return!1;throw n.glassContext.getCoreSvc(".Logger").error("Internal error: Unable to read coach mark"+e.jqXHR.responseText),e}):Promise.resolve(!0===this._readCoachMarks[t])},marksAsRead:function(e){var t=this;if(this._readCoachMarks){this._readCoachMarks[e]=!0;var n=JSON.stringify(this._readCoachMarks);return this.glassContext.getCoreSvc(".Ajax").ajax({url:r.SERVICE_URL,type:"PUT",headers:{"Content-Type":"application/json"},data:n}).catch(function(e){throw t.glassContext.getCoreSvc(".Logger").error("Internal error: Update coach mark status failed: "+e.jqXHR.responseText),e})}},reset:function(){var t=this;return this._readCoachMarks=void 0,this.glassContext.getCoreSvc(".Ajax").ajax({url:r.SERVICE_URL,type:"DELETE"}).then(function(){n(".coachMark").show()}).catch(function(e){throw t.glassContext.getCoreSvc(".Logger").error("Internal error: unable to delete coach marks status: "+e.jqXHR.responseText),e})},_getHints:function(){var t=this;return this._hintsRequest||(this._hintsRequest=this.glassContext.getCoreSvc(".Ajax").ajax({url:r.SERVICE_URL,type:"GET",headers:{Accept:"application/json"}}).then(function(e){return t._hintsRequest=null,e.data})),this._hintsRequest}});return r.SERVICE_URL="v1/users/~/items/uihints",r}),define("baglass/app/services/CoachMarkService",["../../core-client/js/core-client/ui/core/Events","../CoachMark","../CoachMarkPersistence"],function(e,t,n){var r=e.extend({init:function(e){r.inherited("init",this,arguments),this.renderer=t,this.glassContext=e,this.persistence=new n({glassContext:e})},setRenderer:function(e){this.renderer=e},setPersistence:function(e){this.persistence=e},getRenderer:function(){return this.renderer},getPersistence:function(){return this.persistence},isCoachMarkEnabled:function(){return"function"==typeof this.persistence.isEnabled?this.persistence.isEnabled().then(function(e){return!0===e}).fail(function(){return!1}):Promise.resolve()},disableCoachMarks:function(){return this.trigger("disable:all",{}),"function"==typeof this.persistence.disable?this.persistence.disable().then(function(){return!0}).catch(function(){return!1}):Promise.resolve()},enableAndRestart:function(){return this.trigger("enable:restart",{}),"function"==typeof this.persistence.restart?this.persistence.restart().then(function(){return!0}).catch(function(){return!1}):Promise.resolve()},enableAndContinue:function(){return this.trigger("enable:continue",{}),"function"==typeof this.persistence.restart?this.persistence.restart().then(function(){return!0}).catch(function(){return!1}):Promise.resolve()}});return r}),define("baglass/app/RestUrls",[],function(){return{JSON_CONTENT_TYPE:"application/json; charset=utf-8",JSON_DATA_TYPE:"json",INSTALL_ENV:"v1/configuration/keys/Glass/installMode",SSO_URL:"v1/ui/sso"}}),define("baglass/app/services/ConfigService",["jquery","underscore","../RestUrls","../../nls/StringResources"],function(t,u,e,n){var r=function(){function l(e){_classCallCheck(this,l),t.extend(this,e),this.CONTENTLOCALES=l.CONTENTLOCALES,this.PRODUCTLOCALES=l.PRODUCTLOCALES,this.TIMEZONES=l.TIMEZONES,this.LEGACYLAUNCHABLE=l.LEGACYLAUNCHABLE}return _createClass(l,[{key:"initialize",value:function(e){if(!u.isObject(e))throw new Error("Invalid configuration context");if(u.extend(this,u.pick(e,l.CONTENTLOCALES,l.PRODUCTLOCALES,l.TIMEZONES,l.LEGACYLAUNCHABLE,l.DEFAULTHOME,l.DEFAULTLOGIN,l.PRODUCTVERSION,l.SSOINFO,l.PORTAL_PAGES,l.DATA_SERVICE_QUERY_SIZE,l.INSTRUMENTATION_CONFIG,l.DIGITAL_CONTEXT_ENABLED,l.CLIENT_VALID_DOMAIN_LIST,l.XSS_CHECKING,l.CONF_MAPBOX_TOKEN,l.CONF_MAPBOX_ACCOUNTNAME,l.CONF_MAPBOX_SECRETTOKEN,l.MAINTENANCE_MESSAGE,l.MAINTENANCE_LINK,l.DISABLE_WHATSNEWSERVICE,l.DISABLE_ALERTBANNER,l.DISABLE_GLOBALTOAST)),this[l.SSOINFO]&&this._processSSOInfo(this[l.SSOINFO]),this[l.CONTENTLOCALES])try{this[l.CONTENTLOCALES]=JSON.parse(this[l.CONTENTLOCALES])}catch(e){this.glassContext.getCoreSvc(".Logger").error("Error parsing supportContentLocales JSON",e),this[l.CONTENTLOCALES]=void 0}if(e.featureRules)try{var t=JSON.parse(e.featureRules);this.glassContext.getCoreSvc(".FeatureChecker").addRules(t)}catch(e){this.glassContext.getCoreSvc(".Logger").error(e)}}},{key:"setConfigValue",value:function(e,t){var n=this,r={};return r[e]=u.isObject(t)?JSON.stringify(t):t,this.glassContext.getCoreSvc(".Ajax").ajax({url:l.BASE_URL+l.GLOBAL,type:"PUT",contentType:"application/json",data:JSON.stringify(r)}).then(function(){n[e]=t}).catch(function(e){var t=new Error(l.ERR_SET_CONFIG_VALUES);throw t.msg=t.message,t.causedBy=e,t})}},{key:"getProductVersion",value:function(){return this.getConfigValue(l.PRODUCTVERSION)}},{key:"getVersion",value:function(){return this.getConfigValueSync(l.PRODUCTVERSION)}},{key:"getContentLocales",value:function(){return this._getConfigList(l.CONTENTLOCALES,!0)}},{key:"getProductLocales",value:function(){return this._getConfigList(l.PRODUCTLOCALES,!0)}},{key:"getTimeZones",value:function(){return this._getConfigList(l.TIMEZONES,!0)}},{key:"getLegacyLaunchable",value:function(){return this._getConfigList(l.LEGACYLAUNCHABLE)}},{key:"getDefaultHome",value:function(){return this._getConfigList(l.DEFAULTHOME)}},{key:"getDefaultLogin",value:function(){return this.getConfigValue(l.DEFAULTLOGIN)}},{key:"getDatasetQuerySize",value:function(){return this.getConfigValue(l.DATA_SERVICE_QUERY_SIZE)}},{key:"getXSSChecking",value:function(){return this[l.XSS_CHECKING]}},{key:"getConfigValue",value:function(e,t){return this._getHelper(e,t,!1)}},{key:"getConfigValueSync",value:function(e){return this._getHelperSync(e)}},{key:"getAllowedUrlLoginParameters",value:function(){return this._getSSOInfo().urlLoginParameters}},{key:"getSSOLoginURL",value:function(){return this[l.SSO_LOGIN]?this[l.SSO_LOGIN]:this._getSSOInfo().login}},{key:"getSSOLogoutURL",value:function(){return this[l.SSO_LOGOUT]?this[l.SSO_LOGOUT]:this._getSSOInfo().logout}},{key:"getInstrumentationConfig",value:function(){return this.getConfigValueSync(l.INSTRUMENTATION_CONFIG)}},{key:"isDigitalContextEnabled",value:function(){return this.getConfigValueSync(l.DIGITAL_CONTEXT_ENABLED)}},{key:"_getConfigList",value:function(e,t){return this._getHelper(e,t,!0)}},{key:"_getSSOInfo",value:function(){return this.getConfigValueSync(l.SSOINFO)||{}}},{key:"_getHelper",value:function(i,o,s){var a=this;if(u.isUndefined(this[i])){var e=l.BASE_URL+i,c=this.glassContext.getCoreSvc(".UserProfile");return o&&(e+=c.preferences.productLocale),this.glassContext.getCoreSvc(".Ajax").ajax({url:e,type:"GET"}).then(function(e){var t=e.data;try{var n=i;o&&(n+=c.preferences.productLocale),t=s?JSON.parse(t[n]):t[n],u.isUndefined(t)||(a[i]=t)}catch(e){var r='"'+e.message+'" encountered while parsing '+i;a.glassContext.getCoreSvc(".Logger").error(r)}return a[i]}).catchReturn()}return Promise.resolve(this[i])}},{key:"_getHelperSync",value:function(e){return this[e]}},{key:"_getFormats",value:function(){return{HTML:n.get("html"),PDF:n.get("pdf"),CSV:n.get("csv"),spreadsheetML:n.get("spreadsheetML"),xlsxData:n.get("xlsxData")}}},{key:"_getBaseTextDirections",value:function(){return{RTL:n.get("rtl"),LTR:n.get("ltr"),AUTO:n.get("contextual")}}},{key:"_getShowHints",value:function(){return{showAll:n.get("showAll"),hideAll:n.get("hideAll")}}},{key:"clearConfigs",value:function(){this._contentLocales=void 0,this._productLocales=void 0,this._timeZoneIDs=void 0,this._defaultHome=void 0}},{key:"setSSOURL",value:function(){var n=this;return this[l.SSOINFO]?Promise.try(function(){return n._processSSOInfo(n[l.SSOINFO])}):this.glassContext.getCoreSvc(".Ajax").ajax({url:e.SSO_URL,type:"GET",contentType:e.JSON_CONTENT_TYPE,dataType:e.JSON_DATA_TYPE}).then(function(e){var t=e.data;return n[l.SSOINFO]=t,n._processSSOInfo(t)}).catch(function(e){throw n.glassContext.getCoreSvc(".Logger").error("Internal error: set SSO URL failed: "+e.jqXHR.responseText),e})}},{key:"_processSSOInfo",value:function(e){e&&(e.login||e.logout)&&t.ajaxSetup({headers:{"X-CA-SSO":this.glassContext.ajaxCodes.SSO}})}}]),l}();return r.BASE_URL="v1/configuration/keys/",r.CONTENTLOCALES="supportedContentLocales_",r.PRODUCTLOCALES="supportedProductLocales_",r.TIMEZONES="timeZones_",r.LEGACYLAUNCHABLE="Configuration.LegacyLaunchable",r.SSOINFO="ssoInfo",r.DEFAULTHOME="Glass.welcomePage",r.DEFAULTLOGIN="Glass.loginPage",r.PRODUCTVERSION="InstallService.productVersion",r.DIGITAL_CONTEXT_ENABLED="Glass.digitalContextEnabled",r.PORTAL_PAGES="ContentApps/enableMyPortalPages",r.GLOBAL="global",r.ERR_SET_CONFIG_VALUES="setConfigValue failed",r.DATA_SERVICE_QUERY_SIZE="DatasetService/urlQuerySize",r.INSTRUMENTATION_CONFIG="instrumentationConfig",r.CLIENT_VALID_DOMAIN_LIST="ClientValidDomainList",r.XSS_CHECKING="CAF.caf_tpXSSCheckingUsed",r.CONF_MAPBOX_TOKEN="Mapbox.token",r.CONF_MAPBOX_SECRETTOKEN="Mapbox.secretToken",r.CONF_MAPBOX_ACCOUNTNAME="Mapbox.accountName",r.MAINTENANCE_MESSAGE="Glass.maintenanceMessage",r.MAINTENANCE_LINK="Glass.maintenanceLink",r.DISABLE_WHATSNEWSERVICE="Glass.disableWhatsNewAlerts",r.DISABLE_ALERTBANNER="Glass.disableAlertBanner",r.DISABLE_GLOBALTOAST="Glass.disableGlobalToast",r.SSO_LOGIN="Glass.sso_login",r.SSO_LOGOUT="Glass.sso_logout",r}),define("baglass/services/ContextService",[],function(){var e=function(e){this.glassContext=e.glassContext};return e.prototype.get=function(e){return this.glassContext.getCoreSvc(".UserProfile")[e]},e}),define("baglass/services/EventsService",["../core-client/js/core-client/ui/core/Events"],function(e){"use strict";return e.extend({})}),define("baglass/services/FeatureChecker",[],function(){"use strict";var e=function(e){return"object"===_typeof(e)&&!Array.isArray(e)},t=function(e){this._rules=e||{}};return t.prototype.setRules=function(e){this._rules=e},t.prototype.addRules=function(n){e(n)&&Object.keys(n).forEach(function(t){e(n[t])&&(this._rules[t]?Object.keys(n[t]).forEach(function(e){this._rules[t][e]=n[t][e]}.bind(this)):this._rules[t]=n[t])}.bind(this))},t.prototype.checkValue=function(e,t,n){var r=!1;return e&&t&&this._rules[e]&&void 0!==this._rules[e][t]&&(r=this._rules[e][t]===n),r},t.prototype.getFeatureFlag=function(e,t){var n=null;return e&&t&&this._rules[e]&&(n=this._rules[e][t]),n},t.prototype.getFeatureFlags=function(e){return e?this._rules[e]:null},t.prototype.toJSON=function(){return JSON.stringify(this._rules)},t}),define("baglass/app/FeatureRules",[],function(){return{"ba-glass":{stringOnlyQS:"enabled"}}}),define("baglass/app/services/FetchService",["jquery","../../core-client/js/core-client/ui/core/Class","../../ajax/AjaxErrorFactory"],function(r,e,n){return e.extend({init:function(e){r.extend(this,e)},sendBaseRequest:function(e,t){return t=r.extend(!0,{},t,{url:e}),this.glassContext.getCoreSvc(".Ajax").ajax(t).then(function(e){return{data:e.data,code:e.jqXHR.status}}).catch(function(e){var t=e.jqXHR;throw n.create(t,t.statusText,e)})},send:function(e,t){return this.sendBaseRequest(e,t)},post:function(e,t){var n=r.extend(!0,{},t,{type:"POST"});return this.send(e,n)},put:function(e,t){var n=r.extend(!0,{},t,{type:"PUT"});return this.send(e,n)},delete:function(e,t){var n=r.extend(!0,{},t,{type:"DELETE"});return this.send(e,n)},get:function(e,t){var n=r.extend(!0,{},t,{type:"GET"});return this.send(e,n)}})}),define("baglass/app/services/AjaxService",["jquery","../../core-client/js/core-client/ui/core/Class"],function(i,e){var t=e.extend({init:function(e){i.extend(this,e),i.each(["get","put","post","delete"],function(e,r){t.prototype[r]=function(e,t){var n=i.extend({},t);return n.type=r,n.url=e,this.ajax(n)}})},ajax:function(e){var t=i.Deferred();return this.glassContext.getCoreSvc(".Ajax").ajax(e).then(function(e){t.resolve(e.data,e.textStatus,e.jqXHR)}).catch(function(e){t.reject(t,e.jqXHR,e.textStatus,e.errorThrown)}),t.promise()}});return t}),define("baglass/services/LogService",[],function(){var e=function(){this.logLevelEnum={debug:50,info:40,warn:30,error:20},this._level=this.logLevelEnum.error,this._active=!0,this.localStorageKeys={isActive:"com.ibm.ba.config.logging.isActive",level:"com.ibm.ba.config.logging.level"};var e=this._getLocalStorage(this.localStorageKeys.isActive);null!==e&&("function"==typeof e.toLowerCase&&"true"===e.toLowerCase()?this._active=!0:this._active=!1);var t=this._getLocalStorage(this.localStorageKeys.level);null!==t&&(this._level=t)};return e.prototype.turnOnLogging=function(){this._active=!0},e.prototype.turnOffLogging=function(){this._active=!1},e.prototype.isActive=function(){return this._active},e.prototype.getLevel=function(){return parseInt(this._level)},e.prototype.setLevelError=function(){this._level=this.logLevelEnum.error},e.prototype.setLevelWarn=function(){this._level=this.logLevelEnum.warn},e.prototype.setLevelInfo=function(){this._level=this.logLevelEnum.info},e.prototype.setLevelDebug=function(){this._level=this.logLevelEnum.debug},e.prototype.error=function(){this._active&&this._level>=this.logLevelEnum.error&&console.error.apply(console,this._addStack(arguments))},e.prototype.warn=function(){this._active&&this._level>=this.logLevelEnum.warn&&console.warn.apply(console,arguments)},e.prototype.info=function(){this._active&&this._level>=this.logLevelEnum.info&&console.info.apply(console,arguments)},e.prototype.debug=function(){this._active&&this._level>=this.logLevelEnum.debug&&console.debug.apply(console,arguments)},e.prototype.log=function(){this._active&&console.log.apply(console,arguments)},e.prototype.saveConfig=function(e,t){void 0!==e&&(this._level=e),void 0!==t&&(this._active=t),this._setLocalStorage(this.localStorageKeys.isActive,this._active?"true":"false"),this._setLocalStorage(this.localStorageKeys.level,this._level)},e.prototype._setLocalStorage=function(e,t){try{window.localStorage.setItem(e,t)}catch(e){console.error(e)}},e.prototype._getLocalStorage=function(e){var t=null;try{t=window.localStorage.getItem(e)||null}catch(e){console.error(e)}return t},e.prototype._addStack=function(){var e=Array.prototype.slice.call(arguments),t=(new Error).stack||"";if(""===t)try{y.name}catch(e){t=e.stack}var n=(t=t.split("\n").map(function(e){return e.trim()})).splice("Error"===t[0]?2:1);return e.push({stack:n}),e},e}),define("baglass/utils/RequestIdleCallback",[],function(){var e={requestIdleCallback:function(e){var t=1r.getWidth()&&r.setWidth(i),this._checkNavBarButtons({scope:e,slideout:r}),r}return null},_checkNavBarButtons:function(e){if(e.slideout.content){var t=null;if(-1!==e.slideout.content.module.indexOf("bi/content_apps/MyContent")?t="com.ibm.bi.contentApps.myContentFoldersSlideout":-1!==e.slideout.content.module.indexOf("bi/content_apps/TeamFolders")&&(t="com.ibm.bi.contentApps.teamFoldersSlideout"),t&&e.slideout.glassContext){var n=e.slideout.glassContext.findPlugin(t);n.setPressed(),e.slideout.on("hide",n.setUnpressed.bind(n))}}},updateRegistryContainer:function(e){this.registry.application.changeContainer(e),this.registry.appView.getContainer()||this.registry.appView.changeContainer(e)},cleanupSlideoutRegistry:function(){this.registry.application.cleanupSlideouts(),this.registry.appView.cleanupSlideouts()},closeAllOpenedSlideouts:function(){var e=!(0"),t.errorProtect(this,["render","show","hide","changeLabel"])},getRootElement:function(){return this.$el},render:function(){return this.$el.text(c.unescape(this.itemSpec.label)),this._addClass(this.$el,this.itemSpec.class),this._setIcon(this.$el),this.registerOneTimeCallback(o.APPVIEW_LOADED),Promise.resolve(this.$el.get()[0])},remove:function(){this.$el.remove()},attachActionControllerCallbacks:function(){console.debug("attachActionControllerCallbacks not implemented")},enable:function(){this._getContainer().removeClass("disabled"),this._getContainer().children().attr("tabindex","0")},disable:function(){this._getContainer().addClass("disabled"),this._getContainer().children().attr("tabindex","-1")},show:function(){this._getContainer().show()},hide:function(){this._getContainer().hide()},getController:function(){var t=this;return this._loadingController||(this.itemSpec.actionController?c.isString(this.itemSpec.actionController)?this._loadingController=n.instantiate(this.itemSpec.actionController.trim()).then(function(e){if(t._controller=e,c.isFunction(t._controller.initialize))return t._controller.initialize({glassContext:t.glassContext,target:{plugin:t,itemId:t.itemSpec.id}})}).then(function(){return t._controller}):this._loadingController=Promise.reject(new Error("actionController is not a string")):this._loadingController=Promise.resolve(this._controller)),this._loadingController},showCoachMark:function(){var s=this;return new Promise(function(e){var t=s.glassContext.getCoreSvc(".CoachMarkService"),o=t.getRenderer(),n=t.getPersistence(),r=s.itemSpec.id+"PluginContainer";e(n.isRead(r).then(function(r){var i={};return a.extend(i,s.itemSpec.coachMark),s.getController().then(function(e){var t=!1;if(c.isFunction(e.getCoachMarkSpec)){var n={glassContext:s.glassContext,target:{coachMark:i,itemId:s.itemSpec.id}};i=e.getCoachMarkSpec(n)||i}return c.isEmpty(i)||(s.glassContext.addToOptions(i),s.coachMark=new o(i),t=!s._getContainer().hasClass("disabled")&&!r,s.coachMark.render(s._getContainer(),t)),t})}))})},_getContainer:function(){return this.$container},changeLabel:function(e){console.info("GlassPlugin.changeLabel no implemented - passed label is: "+e)},changeIcon:function(e,t,n){e?(this.$el.find("svg.svgIcon, img, span.webfont").first().remove(),r.setIcon(this.$el,e,t,n)):console.warn("Invalid plugin icon. Icon unchanged.")},registerOneTimeCallback:function(e){var r=this,i=this.glassContext.getCoreSvc(".Events").on(e,function(t,n){var e=c.isFunction(r.onEventListener)?r.onEventListener:function(){};try{e.call(r,t,n)}catch(e){r.glassContext.getCoreSvc(".Logger").error("GlassPlugin event callbak failure",t,n,e)}finally{i.remove()}},this)},onEventListener:function(t,n){var r=this,i=this.glassContext.getCoreSvc(".Logger");return this.getController().then(function(e){if(e)switch(n){case o.APPVIEW_LOADED:r.appView&&r.appView===t.appView?r._onAppViewLoaded(e,i,t,n):i.info(o.APPVIEW_LOADED+" is ignored due to mismatched appView",r.appView,t.appView);break;default:i.warn("unhandled event in plugin",r,t,n)}}).catch(function(e){i.error("error on event callback",r,e)})},_onAppViewLoaded:function(e,t){c.isFunction(e.onRender)&&e.onRender({glassContext:this.glassContext,target:{plugin:this,itemId:this.itemSpec.id}}),this.showCoachMark().catch(function(e){t.error("failed to show coachmark",e)})},_setAttr:function(e,t,n){n&&e.attr(t,n)},_addClass:function(e,t){t&&e.addClass(t)},_setIcon:function(e){var t=this.itemSpec.icon;r.setIcon(e,t)}})}),define("baglass/core-client/js/core-client/utils/Deferred",[],function(){"use strict";return function(){var e,t,n=new Promise(function(){e=arguments[0],t=arguments[1]});return{resolve:e,reject:t,promise:n}}}),define("baglass/app/plugins/MenuActionInterface",["../../core-client/js/core-client/ui/core/Class"],function(e){return e.extend({onSelectItem:function(){},onRenderItem:function(){},isItemVisible:function(){return!0},isItemSelected:function(){return!1},onRender:function(){},onOpen:function(){},getCoachMarkSpec:function(){},getLabel:function(){}})}),define("baglass/app/plugins/MenuActionControllerDispatcher",["underscore","jquery","./MenuActionInterface","../../api/Context"],function(s,r,e,a){return e.extend({init:function(e){this._oControllerMap={},this._oItemMap={},s.extend(this._oControllerMap,e)},getControllerMap:function(){return this._oControllerMap},onSelectItem:function(e){var t=e.target.itemId,n=this._findController(t);if(n&&s.isFunction(n.onSelectItem))n.onSelectItem.call(n,e);else if(n&&s.isFunction(n.execute)){var r=new a(e.glassContext),i=this._getOptions(e);n.execute.call(n,r,i)}},onRender:function(t){s.each(this._oControllerMap,function(e){e&&s.isFunction(e.onRender)&&e.onRender.call(e,r.extend(!0,{},t))},this)},onOpen:function(n){var e=s.values(this._oControllerMap).map(function(t){if(t&&s.isFunction(t.onOpen))return new Promise(function(e){e(t.onOpen(r.extend(!0,{},n)))}).catch(function(e){n.glassContext.getCoreSvc(".Logger").warn(e)})});return Promise.all(e)},onRemoveItem:function(e){var t=e.target.itemId,n=this._findController(t);if(n&&s.isFunction(n.onRemoveItem))return n.onRemoveItem.call(n,r.extend(!0,{},e))},onRenderItem:function(e){var t=e.target.itemId,n=this._findController(t);n&&s.isFunction(n.onRenderItem)&&n.onRenderItem.call(n,r.extend(!0,{},e))},_getOptions:function(e){return{options:e.options?this._combineOptions(e):e.target.plugin.itemSpec.items[e.target.specItemIndex].options}},_combineOptions:function(e){var t,n=this._checkValidityPluginOptions(e)?e.target.plugin.itemSpec.items[e.target.specItemIndex].options:{};if(t=Object.assign({},e.options),n)for(var r in n)r in t||(t[r]=n[r]);return t},_checkValidityPluginOptions:function(e){var t=e&&e.target&&e.target.plugin&&e.target.plugin.itemSpec&&e.target.plugin.itemSpec.items&&Array.isArray(e.target.plugin.itemSpec.items),n=t&&void 0!==e.target.specItemIndex&&null!==e.target.specItemIndex&&0<=e.target.specItemIndex&&e.target.specItemIndex",{role:"menu",tabIndex:"0"}).addClass("commonMenuItems"),u=h.filter(this.items,function(e){return""!==e.icon&&void 0!==e.icon});return h.each(this.items,function(e){var t=g("
  • ",{role:"group",tabIndex:"0"}).addClass("commonMenuItem");!0===e.selected&&t.addClass("selected"),e.disabled&&t.addClass("disabled"),t.addClass(e.id);var n=this._buildDomItemId();if(this._itemMap[n]=e,t.attr("id",n),e.module)t.append(this._loadModule(t,e.module)),t.removeClass("commonMenuItem"),t.addClass("moduleMenuItem");else if("divider"===e.type)t.addClass(e.type),t.attr("tabIndex","-1");else{var r=g("").addClass("commonMenuLink"),i=g(""),o=h.isString(e.label)?e.label:"";r.attr("role","menuitem"),t.attr("aria-label",o),i.text(o),i.attr("title",f.enforceTextDirection(o)),i.attr("dir",f.resolveBaseTextDir(o)),u.length&&!1!==e.indent&&i.addClass("hasIcon"),e.badge&&g("").addClass("badge").text(e.badge).appendTo(i),r.append(i),d.setIcon(r,e.icon,e.iconTooltip,null,null,e.iconColor),t.append(r)}if(e.rightIcon){var s=g("
    ").addClass("rightIcon").attr("title",e.rightIcon.title);d.setIcon(s,e.rightIcon.icon),t.append(s)}if(e.removable){var a=e.removeIconLabel||p.get("remove"),c=g("
    ",{role:"button","aria-labelledby":n,title:a,tabIndex:"0"}).addClass("removeItemIcon");c.focus(function(e){g(e.target).parent().addClass("hasFocus")}),c.blur(function(e){g(e.target).parent().removeClass("hasFocus")}),d.setIcon(c,"common-close_16"),c.on("primaryaction.bi.commons.ui.menu",this._handleRemoveItem.bind(this,t)),t.append(c)}l.append(t),e&&h.isFunction(e.onRender)&&e.onRender(t)},this),l.is(":empty")||(this.$el.append(l),this.enableLooping(l)),n._registerOpenMenu(this),setTimeout(function(){this.setFocus(),this._attachCloseCallbacks()}.bind(this),200),Promise.resolve(this.el)}catch(e){return Promise.reject(e)}},setFocus:function(){this.$el.find(".commonMenuItems").focus()},_handleRemoveItem:function(t,e){var n=this._itemMap[t.attr("id")];if(e.stopPropagation(),n&&h.isFunction(n.onRemove)){var r=n.onRemove();Promise.resolve(r).then(function(e){e&&(this._setNextTabFocus(t),t.remove())}.bind(this)),delete this._itemMap[t.attr("id")]}},_setNextTabFocus:function(e){var t=e.next(".commonMenuItem");0===t.length&&(t=e.prev(".commonMenuItem")),t.focus()},_handleEscape:function(e){return this._closeMenu(e,!1),this.getLaunchPoint().focus(),!1},_onSelectItem:function(e){var t=this._itemMap[e.currentTarget.id];e.stopPropagation(),e.gesture&&e.gesture.preventDefault(),this._closeMenu(e,!1),t&&h.isFunction(t.onSelect)&&t.onSelect()},_onSelectModuleItem:function(e){var t=this._itemMap[e.currentTarget.id];e.stopPropagation(),this._closeMenu(e,!0),t&&h.isFunction(t.onSelect)&&t.onSelect()},_buildDomItemId:function(){return this.viewId+"_"+h.uniqueId("item")},_attachCloseCallbacks:function(){g(document).on("primaryaction.bi.commons.ui.menu",this.closeMenu),g(document).on("contextmenu.bi.commons.ui.menu",this.closeMenu),g(window).on("resize.bi.commons.ui.menu",this.closeMenu)},_closeMenu:function(e,t){return t?Promise.resolve():h.isFunction(this.whenReadyToClose)?this.whenReadyToClose(e).then(this.remove.bind(this),this.remove.bind(this)):(this.remove(),Promise.resolve())},_loadModule:function(t,e){require([e],function(e){return new e({$el:t}).render()}.bind(this))},remove:function(){n._unregisterOpenMenu(this),g(document).off(".bi.commons.ui.menu",this.closeMenu),g(window).off(".bi.commons.ui.menu",this.closeMenu),n.inherited("remove",this,arguments)}});return n._openMenus=[],n._registerOpenMenu=function(e){h.contains(n._openMenus,e)||(n._openMenus.push(e),g("body").hasClass("openedMenu")||g("body").addClass("openedMenu"))},n._unregisterOpenMenu=function(t){n._openMenus=h.reject(n._openMenus,function(e){return e===t}),0===n._openMenus.length&&g("body").removeClass("openedMenu")},n.hideOpenMenus=function(){h.each(n._openMenus,function(e){e.closeMenu()})},n}),define("baglass/app/plugins/GlassContextMenu",["./GlassPlugin","jquery","underscore","../../core-client/js/core-client/utils/ClassFactory","../../core-client/js/core-client/utils/Deferred","./MenuActionControllerDispatcher","../../core-client/js/core-client/ui/Menu","../../utils/Utils"],function(e,a,c,t,o,n,l,u){var d=e.extend({_ClassFactory:t,init:function(e){a.extend(!0,this,e)},getRootElement:function(){return this.glassContext.getCoreSvc(".Logger").warn("GlassContextMenu::getRootElement() is being deprecated!"),this.$el},getMenu:function(){return this.glassContext.getCoreSvc(".Logger").warn("GlassContextMenu::getMenu() is being deprecated!"),this._menu},render:function(){var n=new o,r=[],i=[],s={};return c.each(this.itemSpec.actionControllers,function(e,t){r.push(this._createController(e,t)),i.push(t)}.bind(this)),u.waitForAllOrSomePromises(r).done(function(){try{l.hideOpenMenus(),c.each(r,function(e,t){e.isFulfilled()&&(s[i[t]]=e.responseModule)}),this._oControllerDispatcher=this._createControllerDispatcher(s);var o=[];this._oControllerDispatcher.buildItemMap(this.itemSpec.items),this._menu=this._createUIMenu(o),c.each(this.itemSpec.items,function(e,t){var n={glassContext:this.glassContext,target:{plugin:this,itemId:e.id,activeObject:this.activeObject,specItemIndex:t},options:this.options};if(this._oControllerDispatcher.isItemVisible(n)){var r={};a.extend(!0,r,e),r.name=e.id,r.onSelect=this._oControllerDispatcher.onSelectItem.bind(this._oControllerDispatcher,n),r.disabled=this._oControllerDispatcher.isItemDisabled(n);var i=this._oControllerDispatcher.getLabel(n);c.isUndefined(i)||(r.label=i),this._oControllerDispatcher.isItemSelected(n)&&(r.selected=!0),o.push(r)}},this),this._menu.render().then(function(e){this.$el=a(e);var t={glassContext:this.glassContext,target:{plugin:this,itemId:this.itemSpec.id,activeObject:this.activeObject}};this._oControllerDispatcher.onRender(t),n.resolve(e)}.bind(this),function(e){n.reject({msg:d.errors.FAILURE_RENDERING_MENU,causedBy:e})})}catch(e){n.reject({msg:d.errors.FAILURE_RENDERING_MENU,causedBy:e})}}.bind(this)).fail(function(e){n.reject({msg:d.errors.FAILURE_RENDERING_MENU,causedBy:e})}),n.promise},_createControllerDispatcher:function(e){return new n(e)},_createUIMenu:function(e){return new l({spec:{items:e}})},_createController:function(e,t){var n,r={glassContext:this.glassContext,target:{plugin:this,itemId:this.itemSpec.id},controllerConfig:this.itemSpec.controllerConfig&&this.itemSpec.controllerConfig[t]};return this._ClassFactory.instantiate(e).then(function(e){if(n=e,c.isFunction(n.initialize))return n.initialize(r)}).then(function(){if(c.isFunction(n.onOpen))return n.onOpen(r)}).then(function(){return n})}});return d.errors={FAILURE_RENDERING_MENU:"Failure when rendering the contextual menu",FAILURE_CREATING_CONTROLLER:"Failure creating one of the menu controllers"},d}),define("baglass/utils/WorkArounds",["../core-client/js/core-client/utils/Utils"],function(t){return{apply:function(){this._locationOrigin()},_locationOrigin:function(){var e=t.getCurrentWindow();e.location.origin||(e.location.origin=e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:""))}}}),function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("prop-types"),require("react"),require("underscore"),require("jquery"),require("mobx-state-tree"),require("baglass/core-client/js/core-client/utils/ClassFactory"),require("ca-ui-toolkit-core"),require("mobx-react"),require("mobx"),require("baglass/nls/StringResources"),require("baglass/utils/Utils"),require("baglass/core-client/js/core-client/errors/BaseError"),require("react-dom"),require("baglass/api/Url"),require("baglass/core-client/js/core-client/ui/KeyCodes"),require("baglass/core-client/js/core-client/ui/ToastMessage"),require("baglass/app/utils/CloseViewUtils"),require("baglass/common/ui/SlideoutRegistry"),require("baglass/api/Context"),require("baglass/services/AjaxService"),require("baglass/services/ClipboardService"),require("baglass/app/services/CoachMarkService"),require("baglass/app/services/ConfigService"),require("baglass/services/ContextService"),require("baglass/services/EventsService"),require("baglass/services/FeatureChecker"),require("baglass/app/FeatureRules"),require("baglass/app/services/FetchService"),require("baglass/app/services/AjaxService"),require("baglass/services/LogService"),require("baglass/services/PrefetchService"),require("baglass/services/ServiceRegistry"),require("baglass/app/services/UserProfileService"),require("baglass/services/WindowProxyService"),require("baglass/core-client/js/core-client/utils/PerfUtils"),require("baglass/core-client/js/core-client/ui/Slideout"),require("baglass/common/ui/SlideoutController"),require("baglass/app/plugins/GlassContextMenu"),require("baglass/core-client/js/core-client/ui/Menu"),require("baglass/utils/WorkArounds"));else if("function"==typeof define&&define.amd)define("baglass/glass.webpack.bundle",["prop-types","react","underscore","jquery","mobx-state-tree","baglass/core-client/js/core-client/utils/ClassFactory","ca-ui-toolkit-core","mobx-react","mobx","baglass/nls/StringResources","baglass/utils/Utils","baglass/core-client/js/core-client/errors/BaseError","react-dom","baglass/api/Url","baglass/core-client/js/core-client/ui/KeyCodes","baglass/core-client/js/core-client/ui/ToastMessage","baglass/app/utils/CloseViewUtils","baglass/common/ui/SlideoutRegistry","baglass/api/Context","baglass/services/AjaxService","baglass/services/ClipboardService","baglass/app/services/CoachMarkService","baglass/app/services/ConfigService","baglass/services/ContextService","baglass/services/EventsService","baglass/services/FeatureChecker","baglass/app/FeatureRules","baglass/app/services/FetchService","baglass/app/services/AjaxService","baglass/services/LogService","baglass/services/PrefetchService","baglass/services/ServiceRegistry","baglass/app/services/UserProfileService","baglass/services/WindowProxyService","baglass/core-client/js/core-client/utils/PerfUtils","baglass/core-client/js/core-client/ui/Slideout","baglass/common/ui/SlideoutController","baglass/app/plugins/GlassContextMenu","baglass/core-client/js/core-client/ui/Menu","baglass/utils/WorkArounds"],t);else{var n="object"==typeof exports?t(require("prop-types"),require("react"),require("underscore"),require("jquery"),require("mobx-state-tree"),require("baglass/core-client/js/core-client/utils/ClassFactory"),require("ca-ui-toolkit-core"),require("mobx-react"),require("mobx"),require("baglass/nls/StringResources"),require("baglass/utils/Utils"),require("baglass/core-client/js/core-client/errors/BaseError"),require("react-dom"),require("baglass/api/Url"),require("baglass/core-client/js/core-client/ui/KeyCodes"),require("baglass/core-client/js/core-client/ui/ToastMessage"),require("baglass/app/utils/CloseViewUtils"),require("baglass/common/ui/SlideoutRegistry"),require("baglass/api/Context"),require("baglass/services/AjaxService"),require("baglass/services/ClipboardService"),require("baglass/app/services/CoachMarkService"),require("baglass/app/services/ConfigService"),require("baglass/services/ContextService"),require("baglass/services/EventsService"),require("baglass/services/FeatureChecker"),require("baglass/app/FeatureRules"),require("baglass/app/services/FetchService"),require("baglass/app/services/AjaxService"),require("baglass/services/LogService"),require("baglass/services/PrefetchService"),require("baglass/services/ServiceRegistry"),require("baglass/app/services/UserProfileService"),require("baglass/services/WindowProxyService"),require("baglass/core-client/js/core-client/utils/PerfUtils"),require("baglass/core-client/js/core-client/ui/Slideout"),require("baglass/common/ui/SlideoutController"),require("baglass/app/plugins/GlassContextMenu"),require("baglass/core-client/js/core-client/ui/Menu"),require("baglass/utils/WorkArounds")):t(e["prop-types"],e.react,e.underscore,e.jquery,e["mobx-state-tree"],e["baglass/core-client/js/core-client/utils/ClassFactory"],e["ca-ui-toolkit-core"],e["mobx-react"],e.mobx,e["baglass/nls/StringResources"],e["baglass/utils/Utils"],e["baglass/core-client/js/core-client/errors/BaseError"],e["react-dom"],e["baglass/api/Url"],e["baglass/core-client/js/core-client/ui/KeyCodes"],e["baglass/core-client/js/core-client/ui/ToastMessage"],e["baglass/app/utils/CloseViewUtils"],e["baglass/common/ui/SlideoutRegistry"],e["baglass/api/Context"],e["baglass/services/AjaxService"],e["baglass/services/ClipboardService"],e["baglass/app/services/CoachMarkService"],e["baglass/app/services/ConfigService"],e["baglass/services/ContextService"],e["baglass/services/EventsService"],e["baglass/services/FeatureChecker"],e["baglass/app/FeatureRules"],e["baglass/app/services/FetchService"],e["baglass/app/services/AjaxService"],e["baglass/services/LogService"],e["baglass/services/PrefetchService"],e["baglass/services/ServiceRegistry"],e["baglass/app/services/UserProfileService"],e["baglass/services/WindowProxyService"],e["baglass/core-client/js/core-client/utils/PerfUtils"],e["baglass/core-client/js/core-client/ui/Slideout"],e["baglass/common/ui/SlideoutController"],e["baglass/app/plugins/GlassContextMenu"],e["baglass/core-client/js/core-client/ui/Menu"],e["baglass/utils/WorkArounds"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(n,r,i,o,s,a,c,l,u,d,p,f,h,g,v,y,m,b,_,w,C,S,P,O,E,x,M,T,A,D,j,I,L,k,R,N,U,F,V,B){return function(n){var r={};function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=n,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/bi/js/glass/baglass/js/baglass/app/",i(i.s=52)}([function(e,t){e.exports=n},function(e,t){e.exports=r},function(e,t,n){"use strict";function r(e,t){for(var n=0;ns[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]=this.perspectiveSwitcherRegistry.size()&&(e=this.perspectiveSwitcherRegistry.size()-1),n)return null;var r,i=this.Glass.previousAppView;return this.perspectiveSwitcherRegistry.containsPerspective(i)||(i=this.Glass.previousAppView=void 0),(r=i&&i.perspective&&i!==t&&"login"!==i.perspective?i:this.perspectiveSwitcherRegistry.getPerspectiveByIndex(e))?this.Glass.openAppView(r.perspective,r.context):this.Glass.openAppView()},e.prototype.closeOpenWidgets=function(t){return o(this,void 0,void 0,function(){return a(this,function(e){switch(e.label){case 0:return[4,this.Glass.hideSlideOut(t)];case 1:return e.sent(),l.default.remove(),[2]}})})},e.prototype.setHomeFlag=function(e,t){!0===t&&this.perspectiveSwitcherRegistry.clearAllPerspectiveHomeFlags(),e.setHomeFlag(t)},e.prototype.prefetchResources=function(){var e=this.Glass.getRequireJs(),t=e&&e.s&&e.s.contexts&&e.s.contexts._&&e.s.contexts._.config&&e.s.contexts._.config.bundles;t&&this.Glass.getCoreSvc(".Prefetch").prefetchResources(Object.keys(t))},e}(c.default);t.default=u},function(e,t){e.exports=y},function(e,t){e.exports=m},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=r(n(13)),s=i.types.model({id:i.types.identifier,perspectiveName:i.types.string}).volatile(function(){return{context:{},spec:{}}}).actions(function(t){return{setContext:function(e){t.context=e},setSpec:function(e){t.spec=e}}}).views(function(e){return{get requirejs(){return e.spec.config?e.spec.config.requirejs:void 0},get configStyles(){return e.spec.config?e.spec.config.styles:void 0},get configScripts(){return e.spec.config?e.spec.config.scripts:void 0},get cssStyles(){return e.spec.cssStyles},get svgImages(){return e.spec.svgImages},get contextMenuSettings(){return e.spec.contextMenus},get actions(){return e.spec.actions},get services(){return e.spec.services},get toolBars(){return e.spec.toolBars},get layout(){return o.default.convertToolBarsToLayoutObject(this.toolBars)},get modelId(){return e.context.content&&e.context.content.id?e.context.content.id:e.context.id?e.context.id:e.spec.id?e.spec.id:""},get cacheKey(){return this.modelId?e.perspectiveName+"|"+this.modelId:e.perspectiveName},get contentModule(){return e.spec.content?e.spec.content.module:void 0}}});t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.arePerspectivesEqual=t.isPerspectiveValid=t.loadPerspectiveModels=void 0,t.loadPerspectiveModels=function(e,i,t){try{Array.isArray(e)&&e.forEach(function(e){var t=e.name,n=e.model,r=e.context;i.addModel(t,n,r)})}catch(e){t.error("Error while loading perspective models",e)}},t.isPerspectiveValid=function(e){return e&&!e.includes("/")&&!e.includes(".")&&!e.includes("%2F")&&!e.includes("%2f")},t.arePerspectivesEqual=function(e,t){return!(!e||!t||e!==t)}},function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,s,a,c){return new(a||(a=Promise))(function(n,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function i(e){try{o(c.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(r,i)}o((c=c.apply(e,s||[])).next())})},o=this&&this.__generator||function(n,r){var i,o,s,e,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,o&&(s=2&t[0]?o.return:t[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,t[1])).done)return s;switch(o=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,o=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!((s=0<(s=a.trys).length&&s[s.length-1])||6!==t[0]&&2!==t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]'},e.prototype.urlDisplay=function(e){var t=this;return a.default.createElement("textarea",{className:"displayedURLOrCode","aria-label":d.default.get("share"===e.type?"shareDialogCodeLabel":"embedDialogCodeLabel"),tabIndex:0,readOnly:!this.isIOSdevice,style:{width:"100%",height:"96px"},ref:function(e){t.targetTextarea=e},value:this.urlGenerator(e)})},e.prototype.nodeEmbedDialog=function(e){var n=this,t=this.state,r=t.embedWidth,i=t.embedHeight;return a.default.createElement(a.default.Fragment,null,a.default.createElement(c.Dialog.Body,null,a.default.createElement("div",{className:"embedDialogText",style:{marginBottom:"24px"},"aria-label":d.default.get("embedDialogText")},d.default.get("embedDialogText")),a.default.createElement("div",{className:"embedDialogSizeAdjustor",style:{marginBottom:"16px"}},a.default.createElement("div",{style:{width:"50%",display:"inline-block"}},a.default.createElement("div",null,d.default.get("embedURLWidthLabel")),a.default.createElement(c.NumberInput,{id:"GlassMessageDialog_embedWidth",value:r,scale:1,max:1e5,onValueAccept:function(e,t){return Number(e)===Number(t)&&n.setState({embedWidth:e})}})),a.default.createElement("div",{style:{width:"50%",display:"inline-block"}},a.default.createElement("div",null,d.default.get("embedURLHeightLabel")),a.default.createElement(c.NumberInput,{id:"GlassMessageDialog_embedHeight",value:i,scale:1,max:1e5,onValueAccept:function(e,t){return Number(e)===Number(t)&&n.setState({embedHeight:e})}}))),this.urlDisplay(e)),this.buttonsEmbedShareDialog(e))},e.prototype.nodeShareDialog=function(e){return a.default.createElement(a.default.Fragment,null,a.default.createElement(c.Dialog.Body,null,a.default.createElement("div",{className:"shareDialogText",style:{marginBottom:"16px"},"aria-label":d.default.get("shareDialogText")},d.default.get("shareDialogText")),this.urlDisplay(e)),this.buttonsEmbedShareDialog(e))},e.prototype.nodeGeneralDialog=function(i){var o=this,s=this.props.Glass;return a.default.createElement(a.default.Fragment,null,i.isHTMLContent?a.default.createElement(c.Dialog.Body,{dangerouslySetInnerHTML:{__html:i.message}}):a.default.createElement(c.Dialog.Body,null,a.default.createElement("div",{className:"messageBox "+i.type},i.message)),a.default.createElement(c.Dialog.Footer,null,i.buttons.map(function(e){var t="object"==typeof e&&e.text?e.text:d.default.get(o.buttonLabelMap["string"==typeof e?e:"ok"]),n="object"==typeof e&&e.defaultId?e.defaultId:e,r="ok"===e||"object"==typeof e&&"ok"===e.defaultId;return a.default.createElement(c.Dialog.Button,{key:""+i.key+t,id:n,className:"button dialogButton "+(r?"primary":"secondary"),label:t,primary:r,onClick:function(){return s.getCoreSvc(".Dialog").removeDialog(n)},style:{margin:"0px 0px 0px 16px"}})})))},e.prototype.renderBodyFooter=function(e){var t;switch(e.type){case"info":case"error":case"warning":t=this.nodeGeneralDialog(e);break;case"share":t=this.nodeShareDialog(e);break;case"embed":t=this.nodeEmbedDialog(e);break;default:t=this.nodeGeneralDialog(e)}return t},e.prototype.render=function(){var t=this,e=this.props.store,n=this.bindOnClose((0,u.toJS)(e?e.dialogs:[]));return n&&n.map(function(e){return a.default.createElement(c.Dialog,{size:e.size,width:e.width,className:e.className,startingFocusIndex:-1,onClose:e.onClose,style:{zIndex:9999999}},a.default.createElement(c.Dialog.SubHeader,null,e.subTitle),a.default.createElement(c.Dialog.Header,null,e.title),t.renderBodyFooter(e))})},o([l.observer],e)}(a.default.Component);t.default=p},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__awaiter||function(e,s,a,c){return new(a||(a=Promise))(function(n,t){function r(e){try{o(c.next(e))}catch(e){t(e)}}function i(e){try{o(c.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(r,i)}o((c=c.apply(e,s||[])).next())})},s=this&&this.__generator||function(n,r){var i,o,s,e,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,o&&(s=2&t[0]?o.return:t[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,t[1])).done)return s;switch(o=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,o=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!((s=0<(s=a.trys).length&&s[s.length-1])||6!==t[0]&&2!==t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]s[0]&&t[1]=e.length?"canExecute"!==i||!0!==r&&!1!==r?Promise.reject(r):Promise.resolve(r):h(e,t,o,i)}function f(e,t,n,r,i){return"defaultAction"===i?function(e,t,n,r){if(c.a.isFunction(e.doAction))return Promise.resolve(e.doAction(n)).catch(function(e){return d(t,n,r,e,"defaultAction")});var i=new p.a("doAction is not defined on the controller");return d(t,n,r,i,"defaultAction")}(e,t,n,r):"canExecute"===i?Promise.resolve(!0):Promise.resolve()}function h(n,r,i,o){return(e=n,t=i,a=e[t].controller,u[a]?Promise.resolve(u[a]):(s=a,l.a.instantiate(s)).then(function(e){return u[a]=e})).then(function(e){var t;return c.a.isFunction(e.canExecute)?!0===e.canExecute(r)?f(e,n,r,i,o):("defaultAction"===o?t=new p.a("Action controller can not execute this object."):"canExecute"===o&&(t=!1),d(n,r,i,t,o)):f(e,n,r,i,o)}).catch(function(e){return d(n,r,i,e,o)});var e,t,s,a}function s(e,t,n,r){return r?(i=e,o=t,s=n,(d=r.find(function(e){return e.id===i}))?(a=d.items,c=o,l=i,u=s,a&&0s[0]&&t[1]s[0]&&t[1]").css("font-size",14),t=14!==parseInt(e.css("font-size"));return e.remove(),t},e.prototype.getIntCSSProp=function(e,t){return parseInt(e.css(t))},e.prototype.getLineCount=function(e,t){void 0===t&&(t=this.isZoomTextOnly());var n=1,r=this.getIntCSSProp(e,"line-height"),i=this.getIntCSSProp(e,"max-height");return 0
    ',html:!0};this._showPopover(n)}.bind(this))},_createMenuButton:function(e){return new n({buttonSpec:e})},_createMenu:function(e){return new r({spec:{items:e}})},_showPopover:function(e){this.$el.attr("data-selector","true"),this.$ddPopover=this.$el.popover(e),this.$ddPopover.popover("show"),this.popupId=this.$ddPopover.attr("aria-describedby"),this._updatePopupover()},_updatePopupover:function(){var e=a("#"+this.popupId).find(".commonMenuItem");t.each(e,function(e){var t=a(e).find("a"),n=t.find("svg"),r=a(e).find("span"),i=t.width(),o=r.innerWidth()-r.width(),s=i-n.outerWidth(!0)-o;r.length&&c.updateEllipsesBasedOnWidth(r[0],s,r.width())},this)},_closePopover:function(){return new Promise(function(e,t){this.$ddPopover?(this.$ddPopover.on("hidden.bs.popover",function(){this._removePopover(),e()}.bind(this)),setTimeout(function(){this._removePopover(),e()}.bind(this),250),this.$el.removeClass("currentlySelected"),this.$el.blur(),this.$ddPopover.popover("hide")):t(new Error("Failed to close popover"))}.bind(this))},_removePopover:function(){this.$ddPopover&&(this.$ddPopover.off("hidden.bs.popover"),this.$ddPopover.popover("destroy"),this.$ddPopover=null,a("#"+this.popupId).remove())},remove:function(){this._removePopover(),o.inherited("remove",this,arguments)},closeDropDownMenu:function(e){if(this.contentMenu){var t=this.contentMenu;return this.contentMenu=null,t.closeMenu(e,!1)}return this._closePopover(e)}});return o}),define("baglass/app/plugins/GlassMenu",["./GlassPlugin","jquery","underscore","../../core-client/js/core-client/utils/ClassFactory","./MenuActionControllerDispatcher","../../core-client/js/core-client/ui/DropDownMenu","../../core-client/js/core-client/ui/Button","../AppEvents"],function(e,c,l,t,n,r,i,o){var s=e.extend({_ClassFactory:t,init:function(e){c.extend(!0,this,e);var t=this.itemSpec;void 0===t.labelOnly&&(t.icon?t.label&&(t.labelOnly="false"):t.labelOnly="true"),s.inherited("init",this,[t])},changeLabel:function(e){l.isString(e)&&(this.$el.contents().last()[0].nodeValue=e)},getButtonElement:function(){return this.activeObject},getDropdownMenu:function(){return this.ddMenu},getDefaultActionButton:function(){return this.defaultButton},render:function(){return this.registerOneTimeCallback(o.APPVIEW_LOADED),this._createMenu(),this.ddMenu.render().then(function(e){return this.$el=c(e),this.activeObject=this.ddMenu.$el,this.defaultButton?(this.$el=c('
    '),this.defaultButton.render().then(function(){return this.$el.append(this.defaultButton.$el),this.$el.append(this.ddMenu.menuButton.$el),this.$el.addClass("inlineFlex"),this.$el[0]}.bind(this))):this.$el[0]}.bind(this))},attachActionControllerCallbacks:function(){this.ddMenu.menuButton.onSelect=this._handleMenuClick.bind(this),this.defaultButton&&(this.defaultButton.onSelect=this._handleDefaultAction.bind(this))},getController:function(){var n=[],r=[],i={};return this._loadingController||(this._loadingController=new Promise(function(e){l.each(this.itemSpec.actionControllers,function(e,t){n.push(this._loadController(e,t)),r.push(t)}.bind(this)),e(Promise.all(n).then(function(e){return l.each(e,function(e,t){i[r[t]]=e}),this._controller=this._createControllerDispatcher(i),this._controller}.bind(this)))}.bind(this))),this._loadingController},_loadController:function(e,n){return this._ClassFactory.instantiate(e).then(function(e){if(l.isFunction(e.initialize)){var t={glassContext:this.glassContext,target:{plugin:this,itemId:this.itemSpec.id},controllerConfig:this.itemSpec.controllerConfig&&this.itemSpec.controllerConfig[n]};return Promise.resolve(e.initialize.apply(e,[t])).then(function(){return e})}return e}.bind(this))},_createMenu:function(){var e,t=this._findDefaultActionItem();if(t){var n;e={dropDownMenuSpec:{id:this.id+".menu",title:this.title,icon:"common-dropdown",class:"button menu comboBox",ddMenuPlacement:this.ddMenuPlacement,items:[]}};var r=l.isUndefined(t.title)?t.label:t.title;n={id:this.id+".default",title:r,icon:this.icon,class:this.class+" menu defaultButton",item:t},this.defaultButton=new i({buttonSpec:n})}else this.label&&(l.isUndefined(this.class)?this.class="dropDownImage":this.class+=" dropDownImage"),e={dropDownMenuSpec:{id:this.id,label:this.label,title:this.title,icon:this.icon,class:this.class,ddMenuPlacement:this.ddMenuPlacement,items:[]}};this.ddMenu=this._createDropDownMenu(e)},_handleMenuClick:function(t){var n=this.glassContext.getCoreSvc(".Logger");return this._updateMenuItemsList().then(function(e){this.ddMenu.setMenuItems(e,!0,t)}.bind(this)).catch(function(e){n.error("failure in the onSelect callback",e)})},_createControllerDispatcher:function(e){return new n(e)},_createDropDownMenu:function(e){return new r(e)},_handleDefaultAction:function(){var r=this,t=this.glassContext.getCoreSvc(".Logger");return this.getController().then(function(e){var t=e.getControllerMap()[r.defaultButton.item.featureId],n={glassContext:r.glassContext,target:{plugin:r,itemId:r.defaultButton.item.id,specItemIndex:r.defaultButton.item.index,index:0}};t&&l.isFunction(t.onSelectItem)&&t.onSelectItem.call(t,n)}).catch(function(e){t.error("failed to call the default action",e)})},_findDefaultActionItem:function(){var e,n;return l.isString(this.defaultAction)&&(e=l.find(this.itemSpec.items,function(e,t){return n=t,e.id===this.defaultAction}.bind(this))),e&&(e.index=n),e},_updateMenuItemsList:function(){var e=this,t={glassContext:this.glassContext,target:{plugin:this,itemId:this.itemSpec.id}};return this.getController().then(function(a){return a.onOpen(t).then(function(){var o=[];a.buildItemMap(this.itemSpec.items);var s=0;return l.each(this.itemSpec.items,function(e,t){var n={glassContext:this.glassContext,target:{plugin:this,itemId:e.id,specItemIndex:t}};if(a.isItemVisible(n)){n.target.index=s++;var r={};c.extend(!0,r,e),r.name=e.id,r.onSelect=function(e){n.target.activeObject=e,a.onSelectItem.call(a,n)}.bind(this),r.onRemove=function(e){return n.target.activeObject=e,a.onRemoveItem.call(a,n)}.bind(this),r.onRender=function(e){n.target.activeObject=e,a.onRenderItem.call(a,n)}.bind(this);var i=a.getLabel(n);l.isUndefined(i)||(r.label=i),a.isItemSelected(n)&&(r.selected=!0),o.push(r)}},this),o}.bind(e))})},closeGlassMenu:function(){return new Promise(function(e,t){this.ddMenu.closeDropDownMenu({}).then(e,t)}.bind(this))}});return s.errors={FAILURE_CREATING_CONTROLLER:"Failure creating one of the menu controllers"},s}),define("baglass/app/plugins/SynchronousButton",["underscore","./Button","../../api/Context"],function(a,e,c){return e.extend({initialize:function(){return this.getController()},getControllerSync:function(){if(this._controller)return this._controller;throw new Error("Controller has not been registered")},attachActionControllerCallbacks:function(){var i=this.glassContext.addToOptions({target:{plugin:this}}),o=this.glassContext.getCoreSvc(".Logger"),s=this;this.getBaseButton().onSelect=function(){try{var e,t=s.getControllerSync();if(this.setSelected(),this.push&&(i.pushState=this.isPressed()),a.isFunction(t.onPress))e=t.onPress(i);else if(a.isFunction(t.execute)){var n=new c(i.glassContext),r={options:i.target.plugin.itemSpec.options};e=t.execute(n,r)}return Promise.resolve(e).catch(function(e){o.error(e)})}catch(e){return o.error(e),Promise.resolve()}}}})}),define("baglass/app/plugins/all",["./Button","./ButtonActionInterface","./GlassMenu","./SynchronousButton"],function(){});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n",{id:this._dialogId,class:"dialogBlocker show"}),this.blockerClass&&e.addClass(this.blockerClass),this.className&&e.addClass(this.className),e.height(a(document).height());var t=a("
    ",{id:this._dialogId+"Container",class:"dialogBlockerCell"});a("body").append(e.append(t.text(r.get("loading")))),e.on("keydown",this.onKey.bind(this))}this._container().parent().on("primaryaction",null,{allowPropagationDefaultAction:!0},function(e){i.setEventProperty(e,i.EVENT_DIALOG,!0)})},show:function(){var e=this._container();if(this._width&&e.css("max-width",this._width),e.length){e.empty();var t=a("
    ",{class:"modalDialog",role:"dialog","aria-labelledby":this.getId(),"aria-describedby":this.getContentId()});if(!0===this._showHeader){var n;n=a("
    ",{class:"dialogHeader"});var r=this.renderTitle(a("
    ",{class:"dialogTitle","aria-label":this.titleAriaLabel||this.title,role:"banner",id:this.getId()})),i=this.renderCloseX();n.append(r,i),t.append(n)}var o=this.renderContent(a("
    ",{class:"dialogContent",id:this.getContentId()})),s=this.renderFooter(a("