{"version":3,"sources":["webpack://jrs-ui/./src/components/components.dialogs.js","webpack://jrs-ui/../js-sdk/src/common/templates/dialogSystemConfirmTemplate.htm","webpack://jrs-ui/./src/util/utils.animation.js","webpack://jrs-ui/./src/i18n/bundleStore.js","webpack://jrs-ui/./src/util/touch.controller.js","webpack://jrs-ui/../js-sdk/src/common/enum/loggingLevels.js","webpack://jrs-ui/../js-sdk/src/common/logging/Level.js","webpack://jrs-ui/../js-sdk/src/common/logging/LogItem.js","webpack://jrs-ui/../js-sdk/src/common/logging/Log.js","webpack://jrs-ui/../js-sdk/src/common/logging/appender/ConsoleAppender.js","webpack://jrs-ui/../js-sdk/src/common/logging/LoggerManager.js","webpack://jrs-ui/../js-sdk/src/common/logging/logger.js","webpack://jrs-ui/../js-sdk/src/common/logging/loggerConfig.js","webpack://jrs-ui/../js-sdk/src/common/stdnav/stdnavEventHandlers.js","webpack://jrs-ui/../js-sdk/src/common/stdnav/stdnavFocusing.js","webpack://jrs-ui/../js-sdk/src/common/stdnav/stdnavDebugger.js","webpack://jrs-ui/../js-sdk/src/common/stdnav/stdnav.js","webpack://jrs-ui/../js-sdk/src/common/stdnav/stdnavModalFocusing.js","webpack://jrs-ui/../js-sdk/src/common/util/browserDetection.js","webpack://jrs-ui/./src/i18n/jasperserver_messages.properties.js","webpack://jrs-ui/./src/i18n/jsexceptions_messages.properties.js"],"names":["$elem","dialogs","systemConfirm","container","message","show","duration","isWarning","window","isEmbeddedDesigner","parent","postMessage","event_id","location","origin","this","jQuery","on","slideUp","document","getElementById","console","warn","closeText","html","toLowerCase","_","messages","slideDown","setTimeout","hide","showWarning","event","detail","errorPopup","_dom","_content","_DOM_ID","_CONTENT_ID","_PAGE_CONTENT_PATTERN","_DIALOG_WIDTH","_DIALOG_HEIGHT","clickHandler","onClose","getZIndex","zIndex","parseInt","getStyle","errorContent","isStackTraceContent","options","fromSource","Builder","style","body","insertBefore","firstChild","content","contentText","isStackTrace","remove","_clickHandler","bindAsEventListener","finalContent","update","observe","setStyle","height","width","addClass","layoutModule","popup","st","isIPad","TouchController","parentNode","noInit3d","_hide","stopObserving","element","target","matchAny","clusterErrorPopup","clusterErrorPopupMsg","bundle2","call","buttonLabel","bundle1","find","apply","arguments","OWNER_ATTR","preDialogFocusArray","elem","showDimmer","appearTo","text","xssUtil","pageDimmer","is","reParent","setOpacity","removeClass","cascade","cascadeElement","position","number","horzOffset","vertOffset","centerElement","horz","vert","_setHigherZIndex","appear","from","to","returnFocus","push","activeElement","focusTarget","_getInitialFocus","focus","closable","_keyDownHandler","zIndexHandler","stdnav","length","pop","$element","hasClass","showShared","owner","attr","hideShared","ownerId","Event","dialog","matchMeOrUp","currentDialog","parentDialog","otherDialogs","biggestZIndex","currentDialogZIndex","parentsZIndex","maxZIndexAcrossOtherDialogs","select","filter","visible","each","Math","max","keyCode","KEY_ESC","stopPropagation","popupConfirm","okButtonSelector","cancelButtonSelector","$ok","$cancel","deferred","validateFunc","off","resolve","reject","childPopup","cascadePopups","id","parentId","MERGED_BUNDLES_NAME","store","children","hbar","vbar","absolute","useParent","observer","translate3d","forceLayout","use2Fingers","fit","debug","border","pos","$","webkitTransform","left","top","scrollbars","appendTo","eq","computeBoundaries","dragging","drag_sensitivity","scale","maxX","maxY","startTouchY","startTouchX","contentOffsetX","contentOffsetY","addEventListener","prototype","handleEvent","e","type","onTouchStart","onTouchMove","onTouchEnd","clientWidth","clientHeight","hratio","vratio","minWidth","minHeight","maxWidth","maxHeight","scale_pre","touches","clientX","clientY","contentStartOffsetX","contentStartOffsetY","cy","cx","animateTo","isDragging","element_scrolled","preventDefault","cX","cY","deltaX","deltaY","offsetX","offsetY","css","dx","dy","adx","abs","ady","shouldStartMomentum","reset","forceRefresh","isBottom","addPadding","padding","$id","w","right","h","bottom","DEBUG","INFO","WARN","ERROR","Level","level","name","toUpperCase","i","isGreaterOrEqual","globalLevel","levelNumber","getLevel","toString","levels","LogItem","hasOwnProperty","k","l","Error","toArray","date","m","s","ms","logParams","time","getHours","getMinutes","getSeconds","getMilliseconds","file","line","concat","args","createLogMethod","_prepareLogItem","Log","settings","callback","_id","_callback","logItem","Array","slice","Date","stack","lineAccessingLogger","split","res","match","info","error","ConsoleAppender","f","assert","clear","count","dir","dirxml","group","groupCollapsed","groupEnd","log","markTimeline","profile","profileEnd","table","timeEnd","timeStamp","trace","write","Function","ex","appenderConstructors","LoggerManager","initialize","defaults","enabled","appenders","appenderInstances","loggers","attributes","appender","set","get","value","register","_processLogItem","disable","enable","setLevel","_appendLogItem","process","logger","_onClick","ev","_buildBehavior","runAction","_onMouseDown","_onMouseUp","_onLabeledTagOver","$target","currentTarget","data","_onKeydown","action","elSubfocus","nodeName","prop","closest","nullOrUndefined","newFocus","forceFocus","basicClick","fixedFocus","basicFixFocus","isNavigable","ancestor","closestNavigableAncestor","basicFixSuperfocus","newSuperfocus","$forms","parentFixSuperfocus","basicFixSubfocus","basicFocusIn","basicFocusOut","basicMouseDown","basicMouseUp","basicSuperfocusIn","focusSelector","barrier","maxdepth","_maxNavDepth","closestDescendant","basicSuperfocusOut","_priorFocus","basicSubfocusIn","basicSubfocusOut","basicEnter","closestNavigableDescendant","undefined","basicToggle","basicExit","basicRejoined","isLogicFocusable","$el","canFocus","isUserFocusable","el","tabindex","getFirstFocusableElement","_ensureFocusingGuidelines","_getFirstFocusableElement","getLastFocusableElement","_getLastFocusableElement","getNextFocusableElement","nextElement","nextSibling","getPreviousFocusableElement","previousElement","previousSibling","suspendFocusability","currentTabindex","nodeType","resumeFocusability","suspendedTabindex","removeAttr","ensureFocusabilityBeyond","suspendee","$suspendee","newTabIndex","parents","index","$ancestor","priorTabindex","setSuperfocus","fireCallbacks","oldSubfocus","_prepSubfocusIn","setSubfocus","rootElement","foundElement","$foundElement","radioButton","childNodes","child","focusableChild","_onFocusIn","_currentFocus","updateDebugInfo","chaff","n","chaffLength","maxChaffLength","_refocusing","eventFocus","_priorSubfocus","_unforceFocus","_currentSuperfocus","_priorSuperfocus","$superfocus","_currentSubfocus","removeData","_onFocusOut","debugElementID","$dbg","$super","$focus","$sub","txt","stdnav_gserial","serial","menuItemCallbacks","click","plugins","modalDialogRoots","isStdnavEnabledForElement","isEnabled","attrValue","Boolean","stdnavAvailabilityAroundAspect","invocation","stdnavEventHandlers","stdnavFocusing","stdnavModalFocusing","stdnavAlerting","stdnavDebugger","koan","closestAncestor","start","iterator","depth","effective_maxdepth","search_queue","items_at_current_depth","items_at_next_depth","enqueueFn","unshift","zinit","selector","navtype_nodeNames","_navigableFilter","_unnavigableFilter","_rebuildNavigationFilters","newFilter","navtype","nodeNames","registerPlugin","plugin","unregisterPlugin","unload","registerNavtype","behaviors","navtypeBehaviors","unregisterNavtype","activate","context","noop","nullBehavior","defaultBehavior","_onModalNext","handlers","handler","func","originalHandler","$body","_bindFocusEvents","_bindKeyboardEvents","_bindMouseEvents","_bindTouchEvents","$initialFocus","browserDetection","blur","stop","deactivate","_unbindTouchEvents","_unbindMouseEvents","_unbindKeyboardEvents","_unbindFocusEvents","_onDblClick","_onMouseOut","_onMouseOver","_onTouchStart","removeEventListener","_getExplicitBehavior","overlay","_buildParentBehaviorOBSOLETE","parentEl","parentImmediateBehavior","_buildImmediateBehavior","grandparentBehavior","_buildParentBehavior","behavior","iter","immediateBehavior","key","self","defaultNavtype","navigationType","supportedNodeNames","nodeBehavior","navtypeBehavior","explicitBehavior","_buildBehaviorOBSOLETE","inheritedBehavior","actionName","_runActionDesc","actionDesc","retval","String","substr","prev","next","newEl","funcName","paramstr","colon","lparen","rparen","indexOf","contextName","actionContexts","params","MODAL_TRAP_ELEMENT_TEMPLATE","DIALOG_REFERENCE_ATTRIBUTE","beginModalFocus","endModalFocus","trapElement","attrName","insertAfter","querySelectorAll","forEach","isMozilla","navigator","appName","isFirefox","userAgent","isWebKitEngine","isChrome","platform","isIOS","isAndroid","isIE","isEdge","isIE6","isIEVersion","isIE7","isIE8","isIE9","isIE10","isIE11","isIEVersion7Upwards","getIEVersion","testVersion","version","ua","RegExp","exec","parseFloat","$1","msV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AO,WACH,OAAOvkB,KAAKskB,YAAY,IAE5BE,MAAO,WACH,OAAOxkB,KAAKskB,YAAY,IAE5BG,MAAO,WACH,OAAOzkB,KAAKskB,YAAY,IAE5BI,OAAQ,WACJ,OAAO1kB,KAAKskB,YAAY,KAE5BK,OAAQ,WACJ,OAAO3kB,KAAKskB,YAAY,KAE5BF,OAAQ,WACJ,MAA0B,aAAtBV,UAAUC,SAIPD,UAAUG,UAAUjB,QAAQ,UAAY,GAEnDgC,oBAAqB,WACjB,OAAO5kB,KAAK6kB,gBAAkB,GAElCP,YAAa,SAAUQ,GACnB,OAAO9kB,KAAK6kB,iBAAmBC,GAEnCD,aAAc,WACV,IAAIE,EAAU,EACd,GAAI/kB,KAAK6kB,aAAaE,SAAW,EAC7B,OAAO/kB,KAAK6kB,aAAaE,QAG7B,GAAI/kB,KAAKmkB,OACL,GAA0B,aAAtBT,UAAUC,QAAwB,CAClC,IAAIqB,EAAKtB,UAAUG,UAEA,MADV,IAAIoB,OAAO,wCACbC,KAAKF,KACRD,EAAUI,WAAWF,OAAOG,SAE7B,CACH,IAAIC,EAAY3B,UAAU4B,WAAW1T,MAAM,QAAQ,GACnDmT,EAAUI,WAAWE,GAK7B,OADArlB,KAAK6kB,aAAaE,QAAUA,EACrBA,K,6DCrGP,IAAIQ,EAEA,0BAA4B,KAC5B,0BAAiC,2BAAkC,GACnEA,EAAS,2BAETA,EAASC,OAAOC,KAAK,KAAOC,QAAO,CAACC,EAAKvE,KAC9B,IACAuE,KACA,IAAMvE,MAEd,IAGP,W,4DCdA,IAAImE,EAEA,0BAA4B,KAC5B,0BAAiC,2BAAkC,GACnEA,EAAS,2BAETA,EAASC,OAAOC,KAAK,KAAOC,QAAO,CAACC,EAAKvE,KAC9B,IACAuE,KACA,IAAMvE,MAEd,IAGP","file":"_chunks/chunk.2687.js","sourcesContent":["/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n/**\n * @author: Yuriy Plakosh\n * @version: $Id$\n */\n/**\n * Dialogs Module.\n */\n\nimport _ from 'underscore';\nimport jQuery from 'jquery';\nimport stdnav from 'js-sdk/src/common/stdnav/stdnav';\nimport dialogTemplate from 'js-sdk/src/common/templates/dialogSystemConfirmTemplate.htm';\nimport {appear} from '../util/utils.animation';\nimport {reParent, cascadeElement, centerElement, isIPad, matchMeOrUp, matchAny, pageDimmer} from \"../util/utils.common\";\nimport bundle1 from '../i18n/jasperserver_messages.properties';\nimport bundle2 from '../i18n/jsexceptions_messages.properties';\nimport TouchController from '../util/touch.controller';\nimport layoutModule from '../core/core.layout';\nimport xssUtil from 'js-sdk/src/common/util/xssUtil';\nimport Builder from 'scriptaculous/src/builder';\n\nlet $elem;\nvar dialogs = {};\n///////////////////////////////////////////\n// System confirm object and methods\n///////////////////////////////////////////\n/**\n * System confirm is used to show system confirm about the last action.\n * It fades up rapidly after the action completes, and fades away on the next mouseDown anywhere on the page.\n */\ndialogs.systemConfirm = {\n container: null,\n message: null,\n show: function (message, duration, isWarning) {\n if (window.isEmbeddedDesigner) {\n window.parent.postMessage({\n event_id: \"adhocDesigner:notification\",\n message: message,\n duration: duration\n }, window.location.origin);\n } else {\n this.container = this.container || jQuery('#systemMessageConsole').on('mouseup touchend', function () {\n dialogs.systemConfirm.container.slideUp();\n });\n this.message = this.message || document.getElementById('systemMessage');\n if (!this.message) {\n //unable to find DOM elem to output the system message\n /*eslint-disable-next-line no-console*/\n console.warn(message);\n return;\n }\n if (!this.closeText) {\n this.closeText = jQuery(this.message).html().toLowerCase();\n }\n jQuery(this.message).html(_.template(dialogTemplate, {\n messages: message,\n isWarning: isWarning,\n closeText: this.closeText\n }));\n dialogs.systemConfirm.container.slideDown();\n setTimeout(function() {\n dialogs.systemConfirm.hide();\n }, duration ? duration : 2000);\n }\n },\n showWarning: function (message, duration) {\n this.show(message, duration, true);\n },\n hide: function () {\n if (dialogs.systemConfirm.container) {\n dialogs.systemConfirm.container.slideUp();\n }\n }\n};\n\njQuery(document).on('systemDialogWarn', function(event) {\n var message = event.detail.message,\n duration = event.detail.duration;\n\n dialogs.systemConfirm.showWarning(message, duration);\n});\n//////////////////////////////////////////////\n// Ajax Error Popup Dialog object and methods\n//////////////////////////////////////////////\n/**\n * Ajax Error dialog is used then any ajax call returns and server side error which was not\n * catched by server. It show popup dialog with stackrtace and close button.\n */\ndialogs.errorPopup = {\n _dom: null,\n _content: null,\n /**\n * The identifier of the DOM element.\n */\n _DOM_ID: 'standardAlert',\n /**\n * The identifier of the element there error content should be placed.\n */\n _CONTENT_ID: 'errorPopupContents',\n /**\n * Pattern of element in response where error is placed\n */\n _PAGE_CONTENT_PATTERN: '#errorPageContent',\n _DIALOG_WIDTH: '546px',\n _DIALOG_HEIGHT: '350px',\n clickHandler: null,\n\n onClose: null,\n\n getZIndex: function() {\n var zIndex = 0;\n\n if (this._dom) {\n zIndex = parseInt(this._dom.getStyle('zIndex'), 10);\n }\n\n return zIndex;\n },\n\n /**\n * Shows popup dialog.\n *\n * @param errorContent error content to be showed\n */\n show: function (errorContent, isStackTraceContent, options) {\n options || (options = {});\n var fromSource = Builder.node('DIV', { style: 'display:none' });\n\n jQuery(fromSource).html(errorContent);\n\n document.body.insertBefore(fromSource, document.body.firstChild);\n var content = jQuery(this._PAGE_CONTENT_PATTERN)[0];\n var contentText = content ? jQuery(content).html() : errorContent;\n var isStackTrace = content && jQuery(content).html();\n fromSource.remove();\n if (contentText) {\n if (!this._dom) {\n this._dom = jQuery('#' + this._DOM_ID)[0];\n this._content = jQuery('#' + this._CONTENT_ID)[0];\n this.clickHandler = this._clickHandler.bindAsEventListener(this);\n }\n if (this._dom) {\n var finalContent = contentText;\n //If error is a plain text - wrap it into

element\n if (!isStackTrace) {\n finalContent = Builder.node('P', { 'class': 'message' });\n finalContent.update(contentText);\n }\n this._content.update(finalContent);\n this._dom.observe('click', this.clickHandler);\n this._dom.setStyle({\n height: options.height || this._DIALOG_HEIGHT,\n width: options.width || this._DIALOG_WIDTH\n });\n isStackTraceContent && this._dom.addClass(layoutModule.STACKTRACE_CLASS);\n dialogs.popup.show(this._dom, isStackTraceContent);\n var st = document.getElementById('completeStackTrace');\n if (st) {\n isIPad() && new TouchController(st, st.parentNode, { noInit3d: true });\n }\n }\n }\n },\n /**\n * Hides popup dialog.\n */\n _hide: function () {\n if (this._dom) {\n this._dom.stopObserving('click', this.clickHandler);\n\n if (this.onClose) {\n this.onClose();\n this.onClose = null;\n }\n\n dialogs.popup.hide(this._dom);\n }\n },\n /*\n * Mouse click handler for close button\n */\n _clickHandler: function (event) {\n var element = event.target;\n if (matchAny(element, ['button'], true)) {\n this._hide();\n }\n }\n};\ndialogs.clusterErrorPopup = _.extend({}, dialogs.errorPopup, {\n show: function (errorContent) {\n var clusterErrorPopupMsg = bundle2['cluster.exception.session.attribute.missing.popup'];\n dialogs.errorPopup.show.call(this, clusterErrorPopupMsg);\n var buttonLabel = bundle1['button.home'];\n jQuery('#' + this._DOM_ID).find('button span.wrap').html(buttonLabel);\n },\n _hide: function (event) {\n dialogs.errorPopup._hide.apply(this, arguments);\n window.location = 'home.html';\n }\n});\n/**\n * generic 'popup' dialog controller\n * @param {Object} elem\n */\ndialogs.popup = {\n OWNER_ATTR: 'data-owner',\n preDialogFocusArray: [],\n show: function (elem, showDimmer, options) {\n options = options || {};\n elem = jQuery(elem)[0];\n if (!elem) {\n return;\n }\n if ('message' in options) {\n // Update the displayed message in the dialog.\n jQuery(elem).find('.body').text(xssUtil.unescape(options.message));\n } //dimmer\n\n if (showDimmer) {\n pageDimmer.show();\n jQuery(elem).is(layoutModule.DIALOG_LOADING_PATTERN) && pageDimmer.setZindex(elem.getStyle('zIndex') - 1);\n }\n //ensure body is parent\n reParent(elem, document.body);\n elem.setOpacity(0);\n jQuery(elem).removeClass(layoutModule.HIDDEN_CLASS);\n layoutModule.createSizer.call(layoutModule, elem);\n if (options.cascade) {\n //cascade\n cascadeElement(elem, {\n position: options.position,\n number: options.number,\n horzOffset: 40,\n vertOffset: 40\n });\n } else {\n //center\n centerElement(elem, {\n horz: true,\n vert: true\n });\n } // raise if necessary\n dialogs.popup._setHigherZIndex(elem);\n // Drag'&'Drop depends depends from zIndex on dialog\n layoutModule.createMover.call(layoutModule, elem, options);\n // To move dialog on foreground we need initialize DnD after we have zIndex for dialog\n isIPad() ? elem.setOpacity(1) && elem.show() : appear(elem, 0.4);\n // Keep track of the element that had focus prior to the dialog being\n // shown, so that it can be restored.\n if (options.returnFocus) {\n this.preDialogFocusArray.push(options.returnFocus);\n } else {\n this.preDialogFocusArray.push(document.activeElement);\n }\n\n const focusTarget = dialogs.popup._getInitialFocus(elem, options);\n if (focusTarget) {\n _.defer(() => {\n // need to defer focus because stdnav might broke focusing otherwise\n // for example is dialog is shown via enter key press on a link\n // stdnav forces focus on a link after this dialog is shown\n focusTarget.focus();\n });\n }\n if (options.closable) {\n elem.observe('keydown', this._keyDownHandler);\n }\n\n !showDimmer && elem.observe('click', dialogs.popup.zIndexHandler);\n // Ensure the TAB key cannot move focus outside of the dialog. While\n // the \"shader\" dialog will intercept mouse clicks and touch events, it\n // does not prevent keyboard events.\n // NOTE: This must be done AFTER moving focus into the dialog.\n stdnav.beginModalFocus(elem);\n },\n hide: function (elem) {\n // Ensure the TAB key can move focus to all the places it was able to\n // before the dialog was shown.\n // NOTE: This must be done BEFORE moving focus out of the dialog.\n stdnav.endModalFocus(elem);\n\n // Restore keyboard focus to the element that had it prior to the\n // dialog.\n if (this.preDialogFocusArray.length && jQuery(elem).is(\":visible\")){\n stdnav.forceFocus(this.preDialogFocusArray.pop());\n }\n if (!elem) {\n return;\n }\n\n var $element = jQuery(elem)[0];\n //hide dialog and dimmer\n if (jQuery($element).hasClass(layoutModule.CANCELLABLE_CLASS)) {\n jQuery($element).removeClass(layoutModule.CANCELLABLE_CLASS);\n }\n if (!jQuery($element).hasClass(layoutModule.HIDDEN_CLASS)) {\n jQuery($element).addClass(layoutModule.HIDDEN_CLASS);\n pageDimmer.hide();\n jQuery($element).is(layoutModule.DIALOG_LOADING_PATTERN) && pageDimmer.setZindex(layoutModule.DIMMER_Z_INDEX);\n }\n\n $element.stopObserving('keydown', dialogs.popup._keyDownHandler);\n _.defer(()=>{\n // JRS-20956\n // in IE click event handler for dialog executed twice for some reason.\n // So flow is the following:\n //\n // 1. User clicks on close button of the dialog\n // 2. stopObserving executed so event removed from the events registry\n // 3. unexpected click event handler executed second time and it fails since there is no even in the registry\n //\n // wrapping in _.defer changes this to click->click->stopObserving\n $element.stopObserving('click', dialogs.popup.zIndexHandler)\n });\n },\n showShared: function (elem, showDimmer, options) {\n if (!elem) {\n return;\n }\n $elem = jQuery(elem)[0];\n options = options || {};\n if (!options.owner) {\n return;\n }\n jQuery($elem).attr(this.OWNER_ATTR, options.owner);\n if (jQuery($elem).hasClass(layoutModule.HIDDEN_CLASS)) {\n this.show($elem, showDimmer, options);\n }\n },\n hideShared: function (elem, ownerId) {\n if (!elem) {\n return;\n }\n $elem = jQuery(elem)[0];\n var ownerAttr = jQuery($elem).attr(this.OWNER_ATTR);\n if (ownerAttr == ownerId) {\n jQuery($elem).attr(this.OWNER_ATTR, false);\n this.hide($elem);\n }\n },\n /**\n * Handler for dialog z-index change on click.\n */\n zIndexHandler: function (event) {\n var element = Event.element(event);\n var dialog = matchMeOrUp(element, layoutModule.DIALOG_PATTERN);\n if (!dialog) {\n return;\n }\n dialogs.popup._setHigherZIndex(dialog);\n },\n _setHigherZIndex: function (currentDialog, parentDialog) {\n var otherDialogs, biggestZIndex, currentDialogZIndex, parentsZIndex = 0, maxZIndexAcrossOtherDialogs = 0;\n if (!currentDialog) {\n return;\n }\n currentDialogZIndex = currentDialog.getStyle('zIndex');\n if (parentDialog) {\n parentsZIndex = parentDialog.getStyle('zIndex');\n }\n otherDialogs = document.body.select(layoutModule.DIALOG_PATTERN);\n // skip dialogs which are:\n // 1) not active\n // 2) loading dialog\n // 3) the current dialog\n otherDialogs = otherDialogs.filter(function (dialog) {\n if (!dialog.visible()) {\n return false;\n }\n if (jQuery(dialog).is(layoutModule.DIALOG_LOADING_PATTERN)) {\n return false;\n }\n if (dialog === currentDialog) {\n return false;\n }\n return true;\n });\n otherDialogs.each(function (dialog) {\n maxZIndexAcrossOtherDialogs = Math.max(maxZIndexAcrossOtherDialogs, dialog.getStyle('zIndex'));\n });\n biggestZIndex = Math.max(parentsZIndex, currentDialogZIndex, maxZIndexAcrossOtherDialogs, layoutModule.DIMMER_Z_INDEX);\n // set the current dialog the biggest found z-index\n currentDialog.setStyle({ zIndex: biggestZIndex });\n // now walk thr each other dialog and if it has the same z-index, decrease it by one\n otherDialogs.each(function (dialog) {\n var currentZIndex = dialog.getStyle('zIndex');\n if (currentZIndex >= biggestZIndex) {\n dialog.setStyle({ zIndex: biggestZIndex - 1 });\n }\n });\n },\n _getInitialFocus: function (elem, options = {}) {\n // WAI-ARIA best practices says that first focusable element inside a dialog should get focused\n // If you want to override that - pass focusable focus element in options, but make sure it could be\n // focused programmatically (for example set tabindex=-1 if it's not an input/button/anchor)\n if (options.focus && stdnav.isLogicFocusable(options.focus)) {\n return options.focus;\n } else {\n return stdnav.getFirstFocusableElement(elem);\n }\n },\n _keyDownHandler: function (event) {\n if (event.keyCode === Event.KEY_ESC) {\n event.stopPropagation();\n dialogs.popup.hide(this);\n }\n }\n};\ndialogs.popupConfirm = _.extend({}, dialogs.popup, {\n show: function (elem, showDimmer, options) {\n dialogs.popup.show.apply(this, arguments);\n options = _.extend({\n okButtonSelector: 'button.ok',\n cancelButtonSelector: 'button.cancel'\n }, options);\n var $element = jQuery(elem), $ok = jQuery($element).find(options.okButtonSelector), $cancel = jQuery($element).find(options.cancelButtonSelector), deferred = jQuery.Deferred();\n jQuery($ok).on('click', function () {\n if (options.validateFunc) {\n if (options.validateFunc() === false) {\n return;\n }\n }\n jQuery($ok).off('click');\n jQuery($cancel).off('click');\n dialogs.popupConfirm.hide(elem);\n deferred.resolve();\n });\n jQuery($cancel).on('click', function () {\n jQuery($ok).off('click');\n jQuery($cancel).off('click');\n dialogs.popupConfirm.hide(elem);\n deferred.reject();\n });\n return deferred;\n }\n});\ndialogs.childPopup = _.extend({}, dialogs.popup, {\n cascadePopups: {},\n show: function (elem, showDimmer, parent, options) {\n if (parent) {\n options = _.extend({ parent: parent }, options);\n this.cascadePopups[parent.id] || (this.cascadePopups[parent.id] = []);\n this.cascadePopups[parent.id].push(elem.id);\n jQuery(elem).attr('data-parentDialog', parent.id)[0];\n dialogs.popup.show.apply(this, [\n elem,\n showDimmer,\n options\n ]);\n dialogs.popup._setHigherZIndex(elem, parent);\n showDimmer && pageDimmer.setZindex(elem.getStyle('zIndex') - 1);\n parent.stopObserving('click', dialogs.popup.zIndexHandler);\n } else {\n dialogs.popup.show.apply(this, [\n elem,\n showDimmer,\n options\n ]);\n }\n },\n hide: function (elem) {\n var parentId = jQuery(elem).attr('data-parentDialog');\n if (parentId) {\n if (this.cascadePopups[parentId]) {\n this.cascadePopups[parentId] = _.without(this.cascadePopups[parentId], elem.id);\n }\n dialogs.popup.hide.apply(this, [elem]);\n var parent = jQuery('#' + parentId)[0];\n pageDimmer.show(parent);\n dialogs.popup._setHigherZIndex(parent);\n } else {\n dialogs.popup.hide.apply(this, [elem]);\n }\n }\n});\n\n//expose to global scope\nwindow.dialogs = dialogs;\n\nexport default dialogs;","export default \" \\n{{ if (isWarning) { }}\\n\\n{{ } }}\\n\\n{{ if (_.isArray(messages)) { }}\\n {{\\n var flag = false;\\n _.each(messages, function(msg) {\\n if (flag)\\n print('
');\\n print(_.escape(msg));\\n flag = true;\\n })\\n }}\\n{{ } else { }}\\n {{- messages }}\\n{{ } }}\\n\\n{{ if (closeText) { }}\\n  | {{- closeText }} \\n{{ } }}\\n\\n{{ if (isWarning) { }}\\n
\\n{{ } }}\";","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * @version: $Id$\n */\n\n/**\n * A collection of Common Animation Utilities.\n */\n\n///////////////////////////////////////////////////////////////////////////////////////////////////////\n// ** See also: common.js **\n///////////////////////////////////////////////////////////////////////////////////////////////////////\n\n///////////////////////////////////////////\n// Script.aculo.us helpers\n///////////////////////////////////////////\n\n\n///////////////////////////////////////////\n// Move\n///////////////////////////////////////////\n/**\n * Move to absolute position\n * @param {Object} element or element id\n * @param {Object} toX\n * @param {Object} toY\n * @param {Object} duration in seconds (default 1)\n */\nimport Effect from 'scriptaculous/src/effects';\nimport {$} from 'prototype';\nimport jQuery from \"jquery\";\n\nfunction moveTo(element, toX, toY, duration) {\n new Effect.Move(jQuery('#' + element)[0],{sync: false, x: toX, y: toY, mode: 'absolute', duration: (duration?duration:0.2)});\n}\n\n/**\n * Move by given x and y deltas\n * @param {Object} element or element id\n * @param {Object} toX\n * @param {Object} toY\n * @param {Object} duration in seconds (default 1)\n */\nfunction move(element, moveX, moveY, duration) {\n new Effect.Move(jQuery('#' + element)[0],{sync: false, x: moveX, y: moveY, mode: 'relative', duration: (duration?duration:0.2)});\n}\n\n/**\n * Move an array of elems in parallele by given x and y deltas\n * @param {Array} elements, array of elements to move\n * @param {Object} toX\n * @param {Object} toY\n * @param {Object} duration in seconds (default 1)\n */\nfunction moveMany(elements, moveX, moveY, duration){\n var effects = [];\n for (var i=0; i.\n */\n\n// This bundle store will be filled with the actual bundles loaded from the server\n\nexport const MERGED_BUNDLES_NAME = \"all\";\nexport const store = {};","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nimport $ from 'jquery';\nvar TouchController = function (element, parent, options) {\n this.element = element;\n this.parent = parent;\n this.children = [];\n this.hbar = null;\n this.vbar = null; /*\n\t\t * Constructor parameters: absolute translate3d, forceLayout, debug, useParent\n\t\t */\n /*\n\t\t * Constructor parameters: absolute translate3d, forceLayout, debug, useParent\n\t\t */\n options = options || {};\n options.absolute ? this.element.style.position = 'absolute' : this.element.style.position = 'relative';\n this.useParent = options.useParent ? this.observer = parent : this.observer = element;\n this.translate3d = options.translate3d !== false ? true : false;\n this.forceLayout = options.forceLayout !== true ? false : true;\n this.use2Fingers = options.use2Fingers !== true ? false : true;\n this.fit = options.fit;\n if (options.debug) {\n parent.style.border = 'solid 1px #f00';\n element.style.border = 'solid 1px #00f'; //console.info('Px: ' + parent.clientWidth + ', Ex: ' + element.clientWidth + 'Dx: ' + (parent.clientWidth - element.clientWidth));\n //console.info('Py: ' + parent.clientHeight + ', Ey: ' + element.clientHeight + 'Dy: ' + (parent.clientHeight - element.clientHeight));\n }\n if (this.translate3d && !options.noInit3d) {\n var pos = $(element).position();\n element.style.webkitTransform = 'translate3d(' + pos.left + 'px,' + pos.top + 'px,0)';\n element.style.top = '';\n element.style.left = '';\n }\n if (options.scrollbars === true) {\n var hbar = $('

').appendTo(parent);\n var vbar = $('
').appendTo(parent);\n this.hbar = hbar.children().eq(0);\n this.vbar = vbar.children().eq(0);\n }\n this.computeBoundaries();\n this.dragging = false;\n this.drag_sensitivity = 20;\n this.scale = 1;\n this.element.style.top = 0;\n this.element.style.left = 0;\n this.maxX = 0;\n this.maxY = 0;\n this.startTouchY = 0;\n this.startTouchX = 0;\n this.contentOffsetX = 0;\n this.contentOffsetY = 0;\n this.observer.addEventListener('touchstart', this, false);\n this.observer.addEventListener('touchmove', this, false);\n this.observer.addEventListener('touchend', this, false);\n};\nTouchController.prototype.handleEvent = function (e) {\n switch (e.type) {\n case 'touchstart':\n this.onTouchStart(e);\n break;\n case 'touchmove':\n this.onTouchMove(e);\n break;\n case 'touchend':\n this.onTouchEnd(e);\n break;\n }\n};\nTouchController.prototype.computeBoundaries = function () {\n this.maxX = this.parent.clientWidth - this.element.clientWidth;\n this.maxY = this.parent.clientHeight - this.element.clientHeight;\n this.maxX = this.maxX < 0 ? this.maxX : 0;\n this.maxY = this.maxY < 0 ? this.maxY : 0;\n if (this.hbar && this.maxX !== 0) {\n this.hratio = this.parent.clientWidth / this.element.clientWidth;\n this.hbar.width(this.hratio * this.parent.clientWidth);\n this.hbar.show();\n } else {\n this.hbar && this.hbar.hide();\n }\n if (this.vbar && this.maxY !== 0) {\n this.vratio = this.parent.clientHeight / this.element.clientHeight;\n this.vbar.height(this.vratio * this.parent.clientHeight);\n this.vbar.show();\n } else {\n this.vbar && this.vbar.hide();\n }\n if (this.maxX === 0 && this.maxY === 0) {\n this.element.style.minWidth = this.parent.clientWidth + 'px';\n this.element.style.minHeight = this.parent.clientHeight + 'px';\n if (this.element.id === 'reportContainer') {\n this.element.style.maxWidth = this.parent.clientWidth + 'px';\n this.element.style.maxHeight = this.parent.clientHeight + 'px';\n }\n }\n};\nTouchController.prototype.onTouchStart = function (e) {\n this.scale_pre = false;\n this.computeBoundaries();\n this.startTouchX = e.touches[0].clientX;\n this.startTouchY = e.touches[0].clientY;\n this.contentStartOffsetX = this.contentOffsetX;\n this.contentStartOffsetY = this.contentOffsetY;\n};\nTouchController.prototype.onTouchMove = function (e) {\n var cy = e.touches[0].clientY;\n var cx = e.touches[0].clientX;\n if (!this.use2Fingers || this.use2Fingers && e.touches.length == 2) {\n if (this.dragging) {\n this.animateTo(cx, cy);\n } else {\n if (this.isDragging(e)) {\n TouchController.element_scrolled = true;\n if (this.forceLayout) {\n this.element.style.top = 0;\n this.element.style.webkitTransform = 'translate3d(0,' + this.contentOffsetY + 'px,0)';\n }\n this.animateTo(cx, cy);\n }\n }\n }\n};\nTouchController.prototype.onTouchEnd = function (e) {\n if (this.dragging) {\n if (this.forceLayout) {\n this.element.style.webkitTransform = 'translate3d(0,0,0)';\n this.element.style.top = this.contentOffsetY + 'px';\n }\n this.hbar && this.hbar.hide();\n this.vbar && this.vbar.hide();\n e.preventDefault();\n }\n this.dragging = false;\n};\nTouchController.prototype.animateTo = function (cX, cY) {\n var deltaX = cX - this.startTouchX;\n var deltaY = cY - this.startTouchY;\n var offsetX = deltaX + this.contentStartOffsetX;\n var offsetY = deltaY + this.contentStartOffsetY;\n var pos = $(this.element).position();\n if (this.translate3d) {\n if (offsetX > 0)\n offsetX = 0;\n if (offsetY > 0)\n offsetY = 0;\n if (offsetX < this.maxX)\n offsetX = this.maxX;\n if (offsetY < this.maxY)\n offsetY = this.maxY;\n } else {\n if (offsetX + pos.left > 0)\n offsetX = -1 * pos.left;\n if (offsetY + pos.top > 0)\n offsetY = -1 * pos.top;\n if (pos.left + offsetX < this.maxX)\n offsetX = this.maxX - pos.left;\n if (pos.top + offsetY < this.maxY)\n offsetY = this.maxY - pos.top;\n }\n this.contentOffsetX = offsetX;\n this.contentOffsetY = offsetY;\n if (this.translate3d || this.use2Fingers) {\n this.element.style.webkitTransform = 'scale(' + this.scale + ') translate3d(' + offsetX + 'px,' + offsetY + 'px, 0)';\n } else {\n this.element.style.top = pos.top + offsetY + 'px';\n this.element.style.left = pos.left + offsetX + 'px';\n }\n this.hbar && this.hbar.css('left', -1 * offsetX * this.hratio + 'px');\n this.vbar && this.vbar.css('top', -1 * offsetY * this.vratio + 'px');\n};\nTouchController.prototype.isDragging = function (e) {\n var dx = e.touches[0].clientX - this.startTouchX;\n var dy = e.touches[0].clientY - this.startTouchY;\n var adx = Math.abs(dx);\n var ady = Math.abs(dy);\n this.dragging = adx > this.drag_sensitivity || ady > this.drag_sensitivity ? true : false;\n return this.dragging;\n};\nTouchController.prototype.shouldStartMomentum = function () {\n return false;\n};\nTouchController.prototype.reset = function () {\n var offsetX = this.contentOffsetX;\n var offsetY = this.contentOffsetY;\n this.maxX = this.parent.clientWidth - this.element.clientWidth;\n this.maxY = this.parent.clientHeight - this.element.clientHeight;\n if (this.translate3d) {\n this.element.style.webkitTransform = 'scale(' + this.scale + ') translate3d(' + offsetX + 'px,' + offsetY + 'px, 0)';\n this.element.style.webkitTransform = 'scale(' + this.scale + ') translate3d(0,0,0)';\n this.contentOffsetX = 0;\n this.contentOffsetY = 0;\n } else {\n this.element.style.top = 0;\n this.element.style.left = 0;\n }\n};\nTouchController.prototype.forceRefresh = function () {\n} //this.element.style.webkitTransform = 'scale('+this.scale+') translate3d(0,100px, 0)';\n//this.element.style.webkitTransform = 'scale('+this.scale+') translate3d(0,0,0)';\n;\nTouchController.prototype.isBottom = function () {\n if (this.maxY >= 0) {\n return false;\n } else {\n return this.contentOffsetY - this.maxY < 10;\n }\n};\nTouchController.prototype.addPadding = function (id, padding) {\n var $id = $('#' + id);\n var w = $id.width() + padding.right;\n var h = $id.height() + padding.bottom;\n this.element.style.width = w + 'px';\n this.element.style.height = h + 'px';\n}; // TODO: remove it when we move Repository Search into AMD style\n// Make it global due to RepositorySearch modules\n// TODO: remove it when we move Repository Search into AMD style\n// Make it global due to RepositorySearch modules\nwindow.TouchController = TouchController;\nexport default TouchController;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * @author: Pavel Savushchyk\n * @version: $Id$\n */\n\nexport default {\n DEBUG: 100,\n INFO: 200,\n WARN: 300,\n ERROR: 400\n};","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * @author: Pavel Savushchyk\n * @version: $Id$\n */\n\nimport levels from \"../enum/loggingLevels\";\n\nfunction Level(level, name) {\n this.level = level;\n this.name = name.toUpperCase();\n}\n\nLevel.prototype.isGreaterOrEqual = function(globalLevel) {\n var levelNumber = (globalLevel instanceof Level ? globalLevel : Level.getLevel(globalLevel) ).level;\n return this.level >= levelNumber;\n};\nLevel.prototype.toString = function() {\n return this.name;\n};\nLevel.getLevel = function(level) {\n return Level[level.toUpperCase()];\n};\n\nfor (var i in levels) {\n if (levels.hasOwnProperty(i)) {\n Level[i] = new Level(levels[i], i);\n }\n}\n\nexport default Level;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * @author: Pavel Savushchyk\n * @version: $Id$\n */\n\nfunction formatTime(date) {\n var timeString,\n h = date.getHours().toString(),\n m = date.getMinutes().toString(),\n s = date.getSeconds().toString(),\n ms = date.getMilliseconds();\n\n if (h.length === 1) {\n h = \"0\" + h;\n }\n if (m.length === 1) {\n m = \"0\" + m;\n }\n if (s.length === 1) {\n s = \"0\" + s;\n }\n\n timeString = h + \":\" + m + \":\" + s + \".\" + ms;\n\n return timeString;\n}\n\nfunction LogItem(options) {\n for (var i in options) {\n if (options.hasOwnProperty(i)) {\n if (i === \"args\") {\n for (var k = 0, l = options[i].length; k < l; k++) {\n if (options[i][k] instanceof Error) {\n options[i][k] = options[i][k].message;\n }\n }\n }\n this[i] = options[i];\n }\n }\n}\n\nLogItem.prototype.toArray = function() {\n var logParams = [];\n logParams.push(formatTime(this.time));\n logParams.push(\"[\" + this.id + \"]\");\n if (this.file !== \"unknown\"){\n logParams.push(\"[\" + this.file + \":\" + this.line + \"]\");\n }\n logParams.push(\"[\" + this.level.toString() + \"] -\");\n logParams = logParams.concat(this.args);\n\n return logParams;\n};\n\nexport default LogItem;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * @author: Pavel Savushchyk\n * @version: $Id$\n */\n\nimport Level from \"./Level\";\nimport LogItem from \"./LogItem\";\n\nfunction createLogMethod(type) {\n return function() {\n return this._prepareLogItem({\n level: Level.getLevel(type),\n args: arguments\n });\n }\n}\n\nfunction Log(settings, callback) {\n this._id = settings.id;\n this._callback = callback;\n}\n\nLog.prototype._prepareLogItem = function(logItem) {\n logItem.id = this._id;\n logItem.args = Array.prototype.slice.call(logItem.args, 0);\n logItem.time = new Date();\n\n // TODO cross browser support\n var stack = new Error().stack;\n if (stack) {\n var lineAccessingLogger = stack.split(\"\\n\")[2];\n if (lineAccessingLogger != null) {\n var res = lineAccessingLogger.match(/\\/(\\w+\\.\\w+):(\\d+)/i);\n if (res) {\n logItem.file = res[1];\n logItem.line = res[2];\n }\n }\n }\n if (!logItem.file) {\n logItem.file = \"unknown\";\n logItem.line = \"0\";\n }\n\n logItem = new LogItem(logItem);\n\n this._callback(logItem);\n return logItem;\n};\n\nLog.prototype.debug = createLogMethod(\"debug\");\nLog.prototype.info = createLogMethod(\"info\");\nLog.prototype.warn = createLogMethod(\"warn\");\nLog.prototype.error = createLogMethod(\"error\");\n\nexport default Log;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * @author: Pavel Savushchyk\n * @version: $Id$\n */\n\n/*global console */\nfunction ConsoleAppender() {}\n\nConsoleAppender.prototype.console = (function() {\n if (typeof console === \"undefined\") {\n var f = function() {};\n\n return {\n assert: f,\n clear: f,\n count: f,\n debug: f,\n dir: f,\n dirxml: f,\n error: f,\n group: f,\n groupCollapsed: f,\n groupEnd: f,\n info: f,\n log: f,\n markTimeline: f,\n profile: f,\n profileEnd: f,\n table: f,\n time: f,\n timeEnd: f,\n timeStamp: f,\n trace: f,\n warn: f\n }\n } else {\n return console;\n }\n})();\n\nConsoleAppender.prototype.write = function(logItem) {\n\n var f = this.console.log;\n\n switch (logItem.level.toString()) {\n case \"DEBUG\":\n f = this.console.debug || this.console.log;\n break;\n case \"INFO\":\n f = this.console.info || this.console.log;\n break;\n case \"WARN\":\n f = this.console.warn;\n break;\n case \"ERROR\":\n f = this.console.error;\n break;\n }\n\n try\n {\n f.apply(this.console, logItem.toArray());\n }\n catch (e)\n {\n try {\n Function.prototype.apply.call(f, this.console, logItem.toArray());\n } catch(ex) {}\n }\n};\n\nexport default ConsoleAppender;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * @author: Pavel Savushchyk\n * @version: $Id$\n */\n\n\nimport _ from \"underscore\";\nimport Log from \"./Log\";\nimport Level from \"./Level\";\nimport ConsoleAppender from \"./appender/ConsoleAppender\";\n\nvar appenderConstructors = {\n console: ConsoleAppender\n};\n\nvar LoggerManager = function(options) {\n this.initialize(options || {});\n};\n\n_.extend(LoggerManager.prototype, {\n\n defaults : function() {\n return {\n enabled: false,\n level: \"error\",\n appenders: {},\n appenderInstances: {},\n loggers: {}\n }\n },\n\n initialize: function(options) {\n this.attributes = _.defaults(options, this.defaults());\n\n // initialize appenders\n var appenders = {};\n _.each(appenderConstructors, function(appender, name){\n appenders[name] = new appender();\n });\n this.set(\"appenderInstances\", appenders);\n\n },\n\n get: function(attr) {\n return this.attributes[attr];\n },\n\n set: function(attr, value) {\n this.attributes[attr] = value;\n },\n\n register: function(options) {\n var settings = {\n id: \"root\"\n };\n\n if (typeof options === \"string\" && options !== \"\") {\n settings.id = options;\n } else if (options && options.hasOwnProperty(\"id\")) {\n settings.id = options.id;\n }\n\n if (!this.get(\"loggers\").hasOwnProperty(settings.id)) {\n var loggers = this.get(\"loggers\");\n loggers[settings.id] = new Log(settings, _.bind(this._processLogItem, this));\n this.set(\"loggers\", loggers);\n }\n\n return this.get(\"loggers\")[settings.id];\n },\n disable: function() {\n this.set(\"enabled\", false);\n },\n enable: function(level) {\n if (level) {\n this.set(\"level\", Level.getLevel(level));\n }\n this.set(\"enabled\", true);\n },\n setLevel: function(level) {\n this.set(\"level\", level);\n },\n\n _processLogItem: function(logItem) {\n if (this.get(\"enabled\") && logItem.level.isGreaterOrEqual(this.get(\"level\"))) {\n this._appendLogItem(logItem);\n }\n },\n _appendLogItem: function(logItem) {\n var appenders = this.get(\"appenders\"),\n appenderInstances = this.get(\"appenderInstances\");\n for (var i in appenders) {\n if (appenderInstances.hasOwnProperty(appenders[i])) {\n appenderInstances[appenders[i]].write(logItem);\n }\n }\n }\n});\n\nexport default LoggerManager;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\nimport LoggerManager from './LoggerManager';\nimport config from \"./loggerConfig\";\n\nlet logger = new LoggerManager(config);\nexport default logger;","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n/* global process */\n\nexport default {\n enabled : process.env.LOGGER_ENABLED !== 'false',\n level : process.env.LOGGER_LEVEL || 'error',\n appenders: (process.env.LOGGER_APPENDERS || \"console\").split(',')\n};","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n/**\n * @author: ${username}\n * @version: $Id$\n */\n\n/* Standard Navigation library (stdnav) extension\n * ------------------------------------\n * Standard events handlers\n *\n */\n\nimport $ from 'jquery';\nimport log from '../logging/logger';\n\nlet logger = log.register('stdnav');\n\nexport default {\n\n // Callback run when an element in the DOM is clicked.\n _onClick: function (ev) {\n var element = $(ev.target);\n\n // Sometimes this happens...\n if (element.length !== 1) {\n return;\n }\n\n // Get the behavior for the clicked element.\n var behavior = this._buildBehavior(element);\n if (behavior['click'] != null) {\n var bubble = this.runAction('click', ev.target);\n if (bubble === false) {\n ev.stopPropagation();\n ev.preventDefault();\n }\n }\n },\n\n // Callback run when an element in the DOM is clicked.\n _onMouseDown: function (ev) {\n var element = $(ev.target);\n\n // Sometimes this happens...\n if (element.length !== 1) {\n return;\n }\n\n // Get the behavior for the clicked element.\n var behavior = this._buildBehavior(element);\n if (behavior['mousedown'] != null) {\n var bubble = this.runAction('mousedown', ev.target);\n if (bubble === false) {\n ev.stopPropagation();\n ev.preventDefault();\n }\n }\n },\n\n // Callback run when an element in the DOM is clicked.\n _onMouseUp: function (ev) {\n var element = $(ev.target);\n\n // Sometimes this happens...\n if (element.length !== 1) {\n return;\n }\n\n // Get the behavior for the clicked element.\n var behavior = this._buildBehavior(element);\n if (behavior['mouseup'] != null) {\n var bubble = this.runAction('mouseup', ev.target);\n if (bubble === false) {\n ev.stopPropagation();\n ev.preventDefault();\n }\n }\n },\n\n // Callback run when cursor is over on element with aria-label attribute.\n _onLabeledTagOver: function(ev) {\n var $target = $(ev.currentTarget);\n\n if ($target.attr(\"aria-label\") && $target.data(\"title\")) {\n $target.attr(\"title\", $target.attr(\"aria-label\"));\n }\n },\n\n _onKeydown: function (ev) {\n // Determine precisely what had browser focus when keyboard input was received.\n // var elFocus = ev.target;\n\n // If nothing has subfocus, we cannot presume stdnav is safe\n // to use; bail out.\n if ($('.subfocus').length === 0) {\n return;\n }\n var elSubfocus = $('.subfocus')[0];\n\n // While we allow form elements to be subfocused for visual consistency,\n // we never handle keyboard input from them, with a single exception:\n // the ESCAPE key must still allow focus to be returned to the menu.\n var nodeName = $(elSubfocus).prop('nodeName');\n // NOTE: 'BUTTON' was in the array below, but we desire ENTER to work\n // on this as well.\n if ($(elSubfocus).is(':input') || ($.inArray(nodeName, ['INPUT', 'SELECT', 'OBJECT', 'TEXTAREA']) > -1)) {\n // This is special rule which allow continue execute code in the stdnavToolBarPlugin if focus element is 'input'\n if(nodeName === 'INPUT'){\n if($(elSubfocus).closest(\".j-toolbar\").length === 0){\n return;\n }\n } else if ((nodeName !== 'BUTTON') && (ev.keyCode !== 27)) {\n return;\n }\n }\n\n var action;\n switch (ev.keyCode) {\n case 13: // Enter (CR)\n action = 'enter';\n break;\n\n case 27: // Escape.\n action = 'exit';\n break;\n\n case 32: // Space.\n action = 'toggle';\n break;\n\n case 33: // Page up.\n action = 'pageup';\n break;\n\n case 34: // Page down.\n action = 'pagedown';\n break;\n\n case 35: // End.\n action = 'end';\n break;\n\n case 36: // Home.\n action = 'home';\n break;\n\n /* Arrow key behavior depends on menu orientation. */\n case 37: // Left arrow\n action = 'left';\n break;\n\n case 38: // Up arrow\n action = 'up';\n break;\n\n case 39: // Right arrow\n action = 'right';\n break;\n\n case 40: // Down arrow\n action = 'down';\n break;\n\n case 91: // '[':\n // FIXME: Ignore unless CTRL or ALT is pressed.\n action = 'structleft';\n break;\n\n case 93: // ']':\n // FIXME: Ignore unless CTRL or ALT is pressed\n action = 'structright';\n break;\n\n default:\n // Allow default behavior for other keys.\n }\n if (!this.nullOrUndefined(action)) {\n var newFocus = this.runAction(action, elSubfocus);\n if (!this.nullOrUndefined(newFocus)) {\n // Returning null indicates the event should bubble up.\n // Otherwise, it indicates a new focus target.\n ev.stopPropagation();\n ev.preventDefault();\n // If focus should change as a result of navigation, force the\n // element to be focusable, and focus it.\n // Note that redundant focus sets will be suppressed.\n this.forceFocus(newFocus);\n } else {\n return;\n }\n } else {\n return;\n }\n },\n\n // ===DEFAULT BEHAVIOR HANDLERS========================================\n\n // The default click handler tries to find an appropriate element to\n // focus based on what you clicked, but also allows the click event to\n // bubble to other handlers. This behavior may be redundant with basic\n // mousedown behavior, so consider whether you really want to use both.\n basicClick: function (element, args) {\n var fixedFocus = this.runAction('fixfocus', element);\n if (this.nullOrUndefined(fixedFocus)) {\n logger.debug(\"stdnav.basicClick: \" + element.nodeName + \"#\" + element.id + \" has no navigable ancestor, ignoring\");\n } else {\n logger.debug(\"stdnav.basicClick(\" + element.nodeName + \"#\" + element.id + \") refocusing to \" + fixedFocus.nodeName + '#' + fixedFocus.id);\n if (!this.nullOrUndefined(fixedFocus)) {\n this.forceFocus(fixedFocus);\n }\n }\n // Let the event bubble up.\n return true;\n },\n\n // The default fixfocus callback returns the element if it is navigable,\n // or if it is a form field/input. Otherwise, the closest navigable\n // ancestor is returned. If no navigable ancestor exists, the function\n // returns null, and focus should not change; this is useful in click\n // handlers.\n basicFixFocus: function (element, args) {\n if (this.isNavigable(element) || $(element).is(':input')) {\n return element;\n }\n var ancestor = this.closestNavigableAncestor(element);\n if (!this.nullOrUndefined(ancestor)) {\n return ancestor;\n }\n return null;\n },\n\n // FIXME-- UPDATE DOCS FOR LOGIC CHANGES\n // The default fixsuperfocus callback returns the closest navigable\n // ancestor for form elements, buttons, and links. For other elements,\n // it returns the element itself, if it is navigable, otherwise the\n // closest navigable ancestor. If nothing navigable can be identified,\n // superfocus is returned as BODY.\n //\n // If you place a tabindex=\"0\" on an element that contains a form, this\n // will give you the behavior you expect: you can tab between the form\n // elements, but the overall form will be indicated as the active UI\n // region, and a fixsuperfocus call on the container itself will return\n // the container.\n basicFixSuperfocus: function (element, args) {\n var newSuperfocus = null;\n if ($(element).is(':input,fieldset')) {\n // Form element, input, button, or link.\n var $forms = $(element).closest('form');\n $(element).closest('form');\n if ($forms.length > 0) {\n newSuperfocus = $forms[0];\n }\n } else {\n // Non-[input,form,link] element.\n if (this.isNavigable(element)) {\n newSuperfocus = element;\n } else {\n newSuperfocus = this.closestNavigableAncestor(element);\n }\n }\n if ((newSuperfocus === null) || (typeof (newSuperfocus) === 'undefined')) {\n newSuperfocus = element;\n }\n return newSuperfocus;\n },\n\n // This handy callback lets you set superfocus to whatever is appropriate\n // for your parent. Use it when working with navtypes that have to\n // specify \"inherit=false\" but shouldn't be superfocii.\n parentFixSuperfocus: function (element, args) {\n return this.basicFixSuperfocus(element.parentNode, args);\n },\n\n // The default fixsubfocus callback simply returns the element passed.\n // This has the effect of setting subfocus to focus, which is almost\n // always what you want.\n basicFixSubfocus: function (element, args) {\n return element;\n },\n\n // The default focusin handler returns the same element as the new\n // subfocus.\n basicFocusIn: function (element, args) {\n logger.debug(\"stdnav.basicFocusIn(\" + element.nodeName + \"#\" + element.id + \")\");\n return element;\n },\n\n // The default focusout handler disallows demotion to ghostfocus. This\n // is to prevent visual clutter with forms and other areas where there are\n // groups of tabbed elements with only one subfocusable region.\n basicFocusOut: function (element, args) {\n logger.debug(\"stdnav.basicFocusOut(\" + element.nodeName + \"#\" + element.id + \")\");\n return null;\n },\n\n // The default mousedown handler tries to find an appropriate element to\n // focus based on what you clicked, but also allows the mousedown event to\n // bubble to other handlers.\n //\n // Optional Arguments:\n //\n // TODO:\n // 'onlyfor': An optional jQuery selector whitelist. Only elements matching\n // this selector will have this behavior. The event will bubble\n // up whether the element matches the selector or not, however.\n basicMouseDown: function (element, args) {\n var fixedFocus = this.runAction('fixfocus', element);\n if (this.nullOrUndefined(fixedFocus)) {\n logger.debug(\"stdnav.basicClick: \" + element.nodeName + \"#\" + element.id + \" has no navigable ancestor, ignoring\");\n } else {\n logger.debug(\"stdnav.basicClick(\" + element.nodeName + \"#\" + element.id + \") refocusing to \" + fixedFocus.nodeName + '#' + fixedFocus.id);\n if (!this.nullOrUndefined(fixedFocus)) {\n this.forceFocus(fixedFocus);\n }\n }\n // Let the event bubble up.\n return true;\n },\n\n // The default mouseup handler takes no action, but allows the\n // mouseup event to bubble to other handlers.\n basicMouseUp: function (element, args) {\n // Let the event bubble up.\n return true;\n },\n\n // The default superfocusin handler indicates that focus should be given\n // to the same element as superfocus, unless an optional jQuery selector\n // matches one or more descendant elements within a maximum depth. If\n // matches are found, and one also has the special CSS class \"ghostfocus\",\n // then it will be returned. Otherwise, the first match will be returned.\n // Note that if the region contains any input controls, these will also\n // be focused.\n basicSuperfocusIn: function (element, args) {\n logger.debug(\"stdnav.basicSuperfocusIn(\" + element.nodeName + \"#\" + element.id + \")\");\n var newFocus = null;\n\n if ('focusSelector' in args) {\n var focusSelector = ':input,fieldset,' + args['focusSelector'] + '[js-navigable!=\"false\"]';\n var barrier = null;\n if ('barrier' in args) {\n barrier = args['barrier'];\n }\n var maxdepth = this._maxNavDepth;\n if ('maxdepth' in args) {\n maxdepth = args['maxdepth'];\n }\n if (('ghostfocus' in args) && (args['ghostfocus'] === true)) {\n newFocus = this.closestDescendant(element, focusSelector + ' .ghostfocus', barrier, maxdepth);\n // Remove ghostfocus, since it is being promoted to focus.\n $(newFocus).removeClass('ghostfocus');\n }\n if (newFocus == null) {\n // No ghost available, or ghostfocus not allowed.\n newFocus = this.closestDescendant(element, focusSelector, barrier, maxdepth);\n }\n }\n\n if (newFocus == null) {\n // If other approaches have failed, return the same element that has\n // superfocus. This is appropriate for form fields, etc.\n newFocus = element;\n }\n return newFocus;\n },\n\n // The default superfocusout handler adds ghostfocus to the prior focus,\n // if the args hash includes 'ghostfocus':true.\n basicSuperfocusOut: function (element, args) {\n logger.debug(\"stdnav.basicSuperfocusOut(\" + element.nodeName + \"#\" + element.id + \")\");\n if ('ghostfocus' in args) {\n if (args['ghostfocus'] === true) {\n if (this._priorFocus){\n $(this._priorFocus).addClass('ghostfocus');\n }\n }\n }\n return null;\n },\n\n // The default subfocusin handler takes no action.\n basicSubfocusIn: function (element, args) {\n logger.debug(\"stdnav.basicSubfocusIn(\" + element.nodeName + \"#\" + element.id + \")\");\n return null;\n },\n\n // The default subfocusout handler takes no action.\n basicSubfocusOut: function (element, args) {\n logger.debug(\"stdnav.basicSubfocusOut(\" + element.nodeName + \"#\" + element.id + \")\");\n return null;\n },\n\n // \"Enter\" is a catch-all \"activate\" function, normally triggered by\n // pressing the ENTER key. It is distinct from acquiring focus or\n // subfocus, because it implies a deliberate user action _within_ the\n // element when it already has focus.\n //\n // The default \"enter\" handler finds the closest navigable descendant,\n // if one exists, and fires its \"enter\" handler.\n //\n // EXAMPLE:\n // If the Anchor and Button plugins are loaded, their \"enter\"\n // handlers will fire when they are entered; those handlers simulate a\n // \"click\" event but do not move focus or subfocus. The net effect of\n // this is that pressing ENTER in a table cell that contains a button\n // will press the button, but pressing RIGHT ARROW immediately after\n // this will still move one cell to the right, because subfocus remains\n // on the table cell.\n basicEnter: function (element, args) {\n logger.debug(\"stdnav.basicEnter(\" + element.nodeName + \"#\" + element.id + \")\");\n var target = this.closestNavigableDescendant(element);\n if (target !== undefined) {\n this.runAction('enter', target);\n }\n return element;\n },\n\n // \"Toggle\" is kind of \"switch state\" function, normally triggered by\n // pressing the SPACE key on toggle-buttons, check-boxes, etc. If button\n // has a single state (no toggling) - then SPACE key behaves like ENTER and\n // fires the \"activate\" function.\n basicToggle: function (element, args) {\n logger.debug(\"stdnav.basicToggle(\" + element.nodeName + \"#\" + element.id + \")\");\n var target = this.closestNavigableDescendant(element);\n if (target !== undefined) {\n this.runAction('toggle', target);\n }\n return null;\n },\n\n // \"exit\" is the operation when the user presses Escape. (There is no\n // mouse equivalent for this, so do not use this as a sort of\n // \"onDefocus\" event.) The default behavior for \"exit\" is to look for\n // the closest navigable ancestor of the superfocus, and return that as\n // the new focus. If no such ancestor exists, if BODY is returned, or\n // if NULL is somehow returned, focus instead moves to the main menu.\n // In any case, the \"rejoined\" action will fire for the new focus.\n basicExit: function (element, args) {\n logger.debug(\"stdnav.basicExit(\" + element.nodeName + \"#\" + element.id + \")\");\n var target = this.closestNavigableAncestor($('.superfocus'));\n if (target !== undefined) {\n this.runAction('rejoined', target[0]);\n }\n return target && target[0];\n },\n\n // \"rejoined\" behavior is run when a child element is being exited due to\n // a user action, normally the ESCAPE key. When ESCAPE is pressed,\n // \"exit\" behavior will run in the element that has focus, and \"rejoin\"\n // behavior will run in the nearest navigable parent. This default\n // handler simply forces focus to the element, which causes superfocus to\n // be recomputed, etc.\n basicRejoined: function (element, args) {\n logger.debug(\"stdnav.basicRejoined(\" + element.nodeName + \"#\" + element.id + \")\");\n //var fixedFocus = this.runAction('fixfocus', element);\n //$(element).focus();\n }\n}","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n/**\n * @author: ${username}\n * @version: $Id$\n */\n\n/* Standard Navigation library (stdnav) extension\n * ------------------------------------\n * Focus management handlers\n *\n */\n\nimport $ from 'jquery';\nimport log from '../logging/logger';\n\nlet logger = log.register('stdnav');\n\nexport default {\n\n // Returns true if the element is PROGRAMMATICALLY focusable-- in other\n // words, whether or not JavaScript logic can move focus to this\n // element. This does NOT necessarily mean the TAB key can move to\n // this element, or that it will receive focus automatically if clicked\n // on; it simply means an element.focus() call should succeed.\n //\n // Element type is checked, then we check to see if the element is\\\n // enabled, then we check explicit overrides from tabindex.\n //\n // Note that not all navigable controls can be focused. For example, a\n // table cell is navigable if the table plugin is loaded, but is not\n // normally focusable (though the table itself will be if the table\n // element specifies a tabindex).\n isLogicFocusable: function (element) {\n if (this.nullOrUndefined(element)) {\n logger.error(\"isLogicFocusable called on a null or undefined element\");\n return false;\n }\n\n var $el = $(element),\n canFocus = false,\n nodeName = $el.prop('nodeName');\n\n // These elements are always focusable (...unless you're in Safari\n // and haven't turned on keyboard accessibility!)\n if ($el.is(':input') || ($.inArray(nodeName, ['A', 'BUTTON', 'INPUT', 'SELECT', 'OBJECT', 'TEXTAREA']) > -1)) {\n // ...unless they've been disabled.\n if ($el.is(':enabled')) {\n canFocus = true;\n }\n }\n\n /* else if (nodeName == 'A') {\n // Anchor tags are only focusable if they are clickable links.\n // NOTE: Anchor tags are sometimes given explicit tabindexes anyway.\n if (el.attr('href') != undefined) {\n canFocus = true;\n }\n }*/\n\n // If any tabindex value has been manually assigned, the control\n // can receive focus through JS logic.\n if ($el.is('[tabindex]')) {\n canFocus=true;\n }\n return canFocus;\n },\n\n // Returns true if the element is USER focusable-- the TAB key, a mouse\n // click, or a touch can focus this element. This DOES imply that the\n // element can be given focus via JavaScript logic such as\n // element.focus().\n //\n // Element type is checked, then we check to see if the element is\\\n // enabled, then we check explicit overrides from tabindex.\n //\n // Note that not all navigable controls can be focused. For example, a\n // table cell is navigable if the table plugin is loaded, but is not\n // normally focusable (though the table itself will be if the table\n // element specifies a tabindex).\n isUserFocusable: function (element) {\n if (this.nullOrUndefined(element)) {\n logger.error(\"isUserFocusable called on a null or undefined element\");\n return false;\n }\n var el = $(element),\n canFocus = false,\n nodeName = el.prop('nodeName'),\n tabindex = el.attr('tabindex');\n\n if (!el.is(':visible')) {\n return false;\n }\n\n // These elements are always focusable...\n if (el.is(':input') || ($.inArray(nodeName, ['A', 'BUTTON', 'INPUT', 'SELECT', 'OBJECT', 'TEXTAREA']) > -1)) {\n // ...unless they've been disabled.\n if (!el.is(':disabled')) {\n canFocus = true;\n }\n }\n\n /* else if (nodeName == 'A') {\n // Anchor tags are only focusable if they are clickable links.\n // NOTE: Anchor tags are sometimes given explicit tabindexes anyway.\n if (el.attr('href') != undefined) {\n canFocus = true;\n }\n }*/\n\n // Explicit overrides\n if (tabindex !== undefined) {\n if (tabindex === '-1') {\n canFocus = false;\n } else {\n // tabindex>=0\n canFocus = true;\n }\n }\n return canFocus;\n },\n\n // Recursively walk through element and it's children\n // to find first focusable element\n getFirstFocusableElement: function (element) {\n return this._ensureFocusingGuidelines(element, this._getFirstFocusableElement(element));\n },\n\n // Recursively walk through element and it's children in a reverse order\n // to find last focusable element\n getLastFocusableElement: function (element) {\n return this._ensureFocusingGuidelines(element, this._getLastFocusableElement(element));\n },\n\n // Find focusable element which is placed after passed element\n getNextFocusableElement: function (element) {\n if (!element) {\n return element;\n }\n\n const nextElement = element.nextSibling;\n if (!nextElement) {\n return this.getNextFocusableElement(element.parentNode);\n }\n\n const focus = this.getFirstFocusableElement(nextElement);\n\n if (focus) {\n return focus;\n }\n\n return this.getNextFocusableElement(nextElement)\n },\n\n // Find focusable element which is placed before passed element\n getPreviousFocusableElement: function (element) {\n if (!element) {\n return element;\n }\n\n const previousElement = element.previousSibling;\n if (!previousElement) {\n const parentNode = element.parentNode;\n if (this.isUserFocusable(parentNode)) {\n return parentNode;\n }\n\n return this.getPreviousFocusableElement(parentNode);\n }\n\n const focus = this.getLastFocusableElement(previousElement);\n\n if (focus) {\n return focus;\n }\n\n return this.getPreviousFocusableElement(previousElement)\n },\n\n // This function temporarily makes an element unfocusable. It is\n // normally used to make a container unfocusable while focused on a\n // contained element, so that SHIFT-TAB will navigate to the PRIOR\n // container, rather than merely the contained element's container\n // (which would immediately promote focus back to the contained element,\n // giving no net change).\n //\n // - Unfocusable items will not become focusable.\n // - Redundant calls are harmless.\n suspendFocusability: function (element) {\n if (this.nullOrUndefined(element)) {\n logger.debug('stdnav.suspendFocusability called on null or undefined element');\n return;\n }\n if (!this.isUserFocusable(element)) {\n logger.debug('stdnav.suspendFocusability called on element which is not userFocusable');\n return;\n }\n var $el = $(element);\n if (!this.nullOrUndefined($el.attr('js-suspended-tabindex'))) {\n // Redundant call, abort.\n logger.debug('stdnav.suspendFocusability called on already suspended element ' + element.nodeType + '#' + element.id);\n return;\n }\n var currentTabindex = $el.attr('tabindex');\n if (!this.nullOrUndefined(currentTabindex)) {\n $el.attr('js-suspended-tabindex', currentTabindex);\n } else {\n $el.attr('js-suspended-tabindex', 'none');\n }\n // Explicitly make the element unfocusable-- temporarily.\n $el.attr('tabindex', '-1');\n },\n\n resumeFocusability: function (element) {\n if (this.nullOrUndefined(element)) {\n logger.warn('stdnav.resumeFocusability called on null or undefined element');\n return;\n }\n var $el = $(element);\n var suspendedTabindex = $el.attr('js-suspended-tabindex');\n if (this.nullOrUndefined(suspendedTabindex)) {\n // Out-of-order call, abort.\n logger.debug('stdnav.resumeFocusability called on non-suspended element ' + element.nodeName + '#' + element.id);\n return;\n }\n if (suspendedTabindex === 'none') {\n // No tabindex was present, so remove the temporary one.\n $el.removeAttr('tabindex');\n } else {\n // The original tabindex must have explicitly been given a negative\n // number to suppress normal tab navigation; restore that value.\n $el.attr('tabindex', suspendedTabindex);\n }\n $el.removeAttr('js-suspended-tabindex');\n },\n\n // There are various weird ways we can lose focus beyond normal UI\n // actions and JavaScript logic-- ALT-TABbing to another app, etc.\n // For embedded uses, \"alert\" popups in third-party apps can cause\n // this. And, the debugging tools can cause this-- which is very\n // frustrating. That can result in a loss of focusability and cause\n // various other problems. Therefore, this function looks for\n // anything with a suspended-tabindex and restores it, _unless_ it\n // is an ancestor of the element passed-- this avoid breaking\n // SHIFT-TAB, since most containers will auto-promote focus to their\n // children.\n\n ensureFocusabilityBeyond: function(element){\n var $suspendees=$('[suspended-tabindex]');\n $suspendees.each(function(suspendee){\n if (!$.contains(suspendee, element)){\n var $suspendee=$(suspendee);\n var suspendedTabindex=$suspendee.attr('js-suspended-tabindex');\n $suspendee.attr('tabindex', suspendedTabindex);\n $suspendee.removeAttr('js-suspended-tabindex');\n }\n });\n },\n\n\n\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //////////////////////////////////////__F_O_C_U_S__I_N__////////////////////////////////////////////////////////\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\n // Set browser focus if and only if it will not be redundant.\n // Additionally, if the element is not normally focusable, keep track of\n // the reason why, but make it temporarily focusable anyway. Finally,\n // if an ancestor has a tabindex greater than 0, use that value.\n //\n forceFocus: function (element) {\n logger.debug(\"stdnav.forceFocus(\" + element.nodeName + \"#\" + element.id + \")\");\n var $el = $(element);\n\n // See if we should use a tabindex of zero, or something else. Keep in mind\n // that we need to check _suspended_ tabindexes as well, or the logic that\n // lets SHIFT-TAB get out of a region will break this. For (example, a list\n // suspends focus on its UL while an LI has focus, so that SHIFT-TAB doesn't\n // just refocus the list. But if the UL has tabindex=2, which will have\n // been suspended, we still want the LIs to get tabindex=2, to avoid breaking\n // the tab cycle in Internet Explorer.)\n var newTabIndex = 0;\n $.each($el.parents('[tabindex]'), function(index, ancestor){\n var $ancestor = $(ancestor);\n if ($ancestor.attr('tabindex')>newTabIndex) {\n newTabIndex=$ancestor.attr('tabindex');\n }\n if ($ancestor.attr('js-suspended-tabindex')>newTabIndex) {\n newTabIndex=$ancestor.attr('js-suspended-tabindex');\n }\n });\n\n if (!$el.is($(document.activeElement))) {\n // Avoid redundant focus sets.\n if ( (!this.isLogicFocusable(element)) || (newTabIndex>$el.attr('tabindex')) ) {\n // Temporarily make the element focusable or have a higher tabindex.\n // This SHOULD be undefined, but if it IS, leave things\n // alone.\n if (!$el.attr('priortabindex')){\n var priorTabindex = $el.attr('tabindex');\n if (priorTabindex !== undefined) {\n $el.data('prior-tabindex', priorTabindex);\n } else {\n $el.data('prior-tabindex', 'none');\n }\n // Explicitly make the element focusable-- temporarily.\n $el.attr('tabindex', newTabIndex);\n }\n }\n }\n $(element).focus();\n },\n\n // Callback run when an element in the DOM is about to relinquish subfocus.\n // Only fires if this happens through stdnav.setSubfocus!\n //_prepSubfocusOut: function(element) {},\n // OBSOLETE\n\n // Sets superfocus to the element provided, if it can take superfocus, or\n // to the closest ancestor that can. If no ancestor can take superfocus,\n // superfocus falls back to BODY. If the new superfocus is the same as\n // the current superfocus, nothing happens and the function returns\n // immediately.\n //\n // If the superfocus is indeed different, the following things occur, in\n // this order:\n // 1. The \"superfocusout\" action runs on the prior superfocus element.\n // 2. The superfocus CSS style is removed from the prior superfocus element.\n // 3. The superfocus CSS style is added to the new superfocus element.\n // 4. The \"superfocusin\" action runs on the new superfocus element.\n // 4A. This action MUST set browser focus appropriately.\n //\n setSuperfocus: function (element, fireCallbacks) {\n logger.debug(\"stdnav.setSuperfocus(\" + element.nodeName + \"#\" + element.id + \", \" + fireCallbacks + \")\");\n if (fireCallbacks === undefined) {\n fireCallbacks = true;\n }\n var oldSubfocus = $('.subfocus');\n if (oldSubfocus.length > 0) {\n if (fireCallbacks) {\n // Call the subfocusout action on the old subfocus.\n this.runAction('subfocusout', oldSubfocus[0]);\n }\n // Remove subfocus from the current (prior) element, if any (should be exactly one at all times).\n oldSubfocus.removeClass('subfocus');\n }\n\n // Take subfocus.\n $(element).addClass('subfocus');\n\n if (fireCallbacks) {\n // This default behavior, which ensures subfocus is always within\n // browser focus, runs no matter what.\n this._prepSubfocusIn(element);\n\n // Call the subfocusin action on the new subfocus.\n // This behavior can be overridden.\n this.runAction('subfocusin', element);\n }\n },\n\n // Sets subfocus to the element provided.\n // Your plugin should normally use this function instead of messing with\n // the \"subfocus\" class directly.\n // Using it ensures:\n //\n // - Exactly one element has subfocus at all times.\n //\n // - Subfocus never falls outside the inclusive subdom of the element\n // that has superfocus. Main focus will move if necessary.\n //\n // - Plugins can receive event callbacks when subfocus changes.\n //\n // fireCallbacks is optional, and defaults to true.\n setSubfocus: function (element, fireCallbacks) {\n logger.debug(\"stdnav.setSubfocus(\" + element.nodeName + \"#\" + element.id + \", \" + fireCallbacks + \")\");\n if (fireCallbacks === undefined) {\n fireCallbacks = true;\n }\n var oldSubfocus = $('.subfocus');\n if (oldSubfocus.length > 0) {\n if (fireCallbacks) {\n // Call the subfocusout action on the old subfocus.\n this.runAction('subfocusout', oldSubfocus[0]);\n }\n // Remove subfocus from the current (prior) element, if any (should be exactly one at all times).\n oldSubfocus.removeClass('subfocus');\n }\n\n // Take subfocus.\n $(element).addClass('subfocus');\n\n if (fireCallbacks) {\n // This default behavior, which ensures subfocus is always within\n // browser focus, runs no matter what.\n this._prepSubfocusIn(element);\n\n // Call the subfocusin action on the new subfocus.\n // This behavior can be overridden.\n this.runAction('subfocusin', element);\n }\n },\n\n _ensureFocusingGuidelines(rootElement, foundElement){\n var res = foundElement;\n if (foundElement) {\n var $foundElement = $(foundElement);\n\n if ($foundElement.prop('tagName').toLowerCase() === 'input' &&\n $foundElement.prop('type').toLowerCase() === 'radio' &&\n !$foundElement.prop('checked')) {\n\n res = $(rootElement).find('[name=' + $foundElement.prop('name')+ ']').toArray().find(function(radioButton){\n return $(radioButton).prop('checked');\n }) || foundElement;\n }\n }\n\n return res;\n },\n\n // Recursively walk through element and it's children\n // to find first focusable element\n _getFirstFocusableElement: function (element) {\n if (!$(element).is(':visible')) {\n return undefined;\n }\n\n if (this.isUserFocusable(element)) {\n return element;\n }\n\n for (let i = 0; i < element.childNodes.length; i++) {\n const child = element.childNodes[i];\n\n if (this.isUserFocusable(child)) {\n return child;\n }\n\n const focusableChild = this._getFirstFocusableElement(child);\n if (focusableChild) {\n return focusableChild;\n }\n }\n\n return undefined;\n },\n\n // Recursively walk through element and it's children in a reverse order\n // to find last focusable element\n _getLastFocusableElement: function (element) {\n if (!$(element).is(':visible')) {\n return undefined;\n }\n\n for (let i = element.childNodes.length - 1; i >= 0; i--) {\n let child = element.childNodes[i];\n\n const focusableChild = this._getLastFocusableElement(child);\n if (focusableChild) {\n return focusableChild;\n }\n\n if (this.isUserFocusable(child)) {\n return child;\n }\n }\n\n if (this.isUserFocusable(element)) {\n return element;\n }\n\n return undefined;\n },\n\n // Callback run when an element in the DOM has acquired focus.\n _onFocusIn: function (ev) {\n this._currentFocus = ev.target;\n var fixedFocus = null,\n $target = $(ev.target);\n\n if ($target.attr(\"aria-label\")) {\n $target.removeAttr(\"title\");\n }\n\n logger.info(\"stdnav._onFocusIn ev.target==\" + ev.target.nodeName + \"#\" + ev.target.id);\n this.updateDebugInfo();\n\n // Hack for IE11, force a potential visual change\n var chaff='';\n for (var n=0; n 0) {\n logger.debug(\"Removing .superfocus from \" + $superfocus[0].nodeName + '#' + $superfocus[0].id);\n } else {\n logger.warn(\"No current .superfocus to remove\");\n }\n $('.superfocus').removeClass('superfocus');\n if (this._priorSuperfocus){\n this.runAction('superfocusout', this._priorSuperfocus);\n this.resumeFocusability(this._priorSuperfocus);\n }\n // Refresh the automatic ARIA markup for the region.\n logger.debug(\"Running ARIA refresh for \" + this._currentSuperfocus.nodeName + '#' + this._currentSuperfocus.id);\n this.runAction('ariarefresh', this._currentSuperfocus);\n logger.debug(\"Adding .superfocus to \" + this._currentSuperfocus.nodeName + '#' + this._currentSuperfocus.id);\n $(this._currentSuperfocus).addClass('superfocus');\n // This ensures SHIFT-TAB will properly move to the prior region,\n // rather than moving from an inner focus to the container (which\n // is not useful and breaks backwards navigation). However, do\n // NOT do this if the superfocus is the same element as the focus,\n // since it is not needed.\n if (!$(this._currentSuperfocus).is(this._currentFocus)) {\n this.suspendFocusability(this._currentSuperfocus);\n }\n this.runAction('superfocusin', this._currentSuperfocus);\n }\n // Run the focusin handler on the new focus. This callback returns\n // the new subfocus. If it returns null, use the same value as the\n // focus itself.\n this._currentSubfocus = this.runAction('focusin', this._currentFocus);\n if (this._currentSubfocus === null) {\n this._currentSubfocus = this._currentFocus;\n }\n // Finally, set the subfocus CSS class on the new subfocus, and run\n // the subfocusin callback for the new subfocus.\n $(this._currentSubfocus).addClass('subfocus');\n this.runAction('subfocusin', this._currentSubfocus);\n\n // Ensure focus can be moved to other areas in the DOM.\n // This is a safety, and helps deal with ALT-TAB, alerts,\n // popups, debuggers, etc. It does NOT restore the\n // tabindex of the current focus container.\n this.ensureFocusabilityBeyond(this._currentFocus);\n\n }\n }\n this.updateDebugInfo();\n },\n\n // Callback run when an element in the DOM has just acquired subfocus.\n // Note that this is AFTER the change, which is different than the way\n // 'onfocusin' works-- this is DELIBERATE, to ensure either callback\n // can preempt the other if necessary without recursing.\n //\n // Thie callback only fires if the subfocus change happens through\n // stdnav.setSubfocus! Do not just set the CSS class!\n _prepSubfocusIn: function (element) {\n // If you move subfocus outside of a parent that has browser focus,\n // browser focus will be set to the subfocus. This means that if\n // you, for example, give tabindexes to grid cells, moving left will\n // move both focus and subfocus-- give tabindexes to the top level\n // grid element ONLY, if you want to avoid this.\n if ($(element).parents(':focus').length === 0) {\n // No parent has focus. Set browser focus to the new subfocus element.\n $(element).focus();\n }\n },\n\n\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //////////////////////////////////////__F_O_C_U_S__O_U_T__//////////////////////////////////////////////////////\n ////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n // Reset any tabindex changes that were made to force the element to be\n // temporarily focusable for navigation and screen reader purposes. Note\n // that this function does not actually change browser focus, as it is\n // intended to be called as a reaction to \"focusout\".\n _unforceFocus: function (element) {\n var $el = $(element);\n var priorTabindex = $el.data('prior-tabindex');\n if (this.nullOrUndefined(priorTabindex)) {\n // forceFocus does not seem to have been called, was not needed, or\n // had no effect; do nothing.\n } else {\n if (priorTabindex === 'none') {\n // No tabindex was originally present, so remove the temporary one.\n $el.removeAttr('tabindex');\n } else {\n // The original tabindex must have explicitly been given a negative\n // number to suppress normal tab navigation; restore that value.\n $el.attr('tabindex', priorTabindex);\n }\n $el.removeData('prior-tabindex');\n }\n },\n\n // Callback run when an element in the DOM is about to lose focus.\n _onFocusOut: function (ev) {\n this.updateDebugInfo();\n if (this._refocusing === true) {\n // Intermediate target-- do not update latches.\n } else {\n if ($('.superfocus').length > 0) {\n this._priorSuperfocus = $('.superfocus')[0];\n } else {\n logger.warn(\"no prior superfocus\");\n this._priorSuperfocus = $('body')[0];\n }\n this._priorFocus = ev.target;\n if ($('.subfocus').length > 0) {\n this._priorSubfocus = $('.subfocus')[0];\n } else {\n logger.warn(\"no prior subfocus\");\n this._priorSubfocus = ev.target;\n }\n }\n\n //TODO: get rid of dependency on JRS mark-up (move to core.layout.js)\n var MAIN_NAVIGATION_ENTRY_POINT = \"#globalSearch input#searchInput\";\n var MAIN_NAVIGATION_EXIT_POINT = \"#about a.superfocus.subfocus\";\n\n // Remove focus classes when leaving the global navigation entry-point and exit-point.\n if ($(ev.target).is(MAIN_NAVIGATION_ENTRY_POINT) || $(ev.target).is(MAIN_NAVIGATION_EXIT_POINT)) {\n $('.subfocus').removeClass('subfocus');\n $('.superfocus').removeClass('superfocus');\n }\n this.updateDebugInfo();\n }\n}\n","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n/**\n * @author: ${username}\n * @version: $Id$\n */\n\n/* Standard Navigation library (stdnav) extension\n * ------------------------------------\n * Internal debugging helper\n *\n */\n\nimport $ from 'jquery';\n\nexport default {\n // ===INTERNAL DEBUGGING FUNCTIONS=====================================\n updateDebugInfo: function(){\n if (!this.debugElementID){\n return;\n }\n // DO NOT CACHE THIS\n var $dbg=$('#'+this.debugElementID),\n $super=$('.superfocus'),\n $focus=$(document.activeElement),\n $sub=$('.subfocus'),\n txt='[sup:';\n if ($dbg.length<1){\n return;\n }\n txt+=$super.length;\n if ($super.length>0){\n txt+=':'+$super[0].nodeName+'#'+$super[0].id;\n } else {\n txt+='?';\n }\n txt+=', foc:';\n txt+=$focus.length;\n if ($focus.length>0){\n txt+=':'+$focus[0].nodeName+'#'+$focus[0].id;\n } else {\n txt+='?';\n }\n txt+=', sub:';\n txt+=$sub.length;\n if ($sub.length>0){\n txt+=':'+$sub[0].nodeName+'#'+$sub[0].id;\n } else {\n txt+='?';\n }\n\n // Priors\n // DO NOT CACHE THIS\n $super=$(this._priorSuperfocus);\n $focus=$(this._priorFocus);\n $sub=$(this._priorSubfocus);\n txt+=' :: psup:';\n if ($dbg.length<1){\n return;\n }\n txt+=$super.length;\n if ($super.length>0){\n txt+=':'+$super[0].nodeName+'#'+$super[0].id;\n } else {\n txt+='?';\n }\n txt+=', pfoc:';\n txt+=$focus.length;\n if ($focus.length>0){\n txt+=':'+$focus[0].nodeName+'#'+$focus[0].id;\n } else {\n txt+='?';\n }\n txt+=', psub:';\n txt+=$sub.length;\n if ($sub.length>0){\n txt+=':'+$sub[0].nodeName+'#'+$sub[0].id;\n } else {\n txt+='?';\n }\n\n txt+=']';\n $dbg.text(txt);\n }\n\n}","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n/**\n* @author: ${username}\n* @version: $Id$\n*/\n\n/* Standard Navigation library (stdnav)\n* ------------------------------------\n* This library provides keyboard and screen-reader support for areas of the\n* application that do not explicitly enable that support. It attempts to\n* stay out of the way of areas that already handle it properly, and can be\n* disabled in problem areas by adding 'js-stdnav=\"false\"' to any element\n* that contains the area.\n*\n* This module supports enhancements intended to improve compliance with\n* section 508 of the Rehabilitation Act of 1973, 29 USC 798, as amended\n* 1998.\n*/\n\nimport $ from 'jquery';\nimport _ from 'underscore';\nimport browserDetection from '../util/browserDetection';\nimport log from \"../logging/logger\"\n\nimport stdnavEventHandlers from \"./stdnavEventHandlers\";\nimport stdnavFocusing from \"./stdnavFocusing\";\nimport stdnavModalFocusing from \"./stdnavModalFocusing\";\nimport stdnavAlerting from \"./stdnavAlerting\";\nimport stdnavDebugger from \"./stdnavDebugger\";\n\nvar version = \"0.0.1\",\n singleton = null,\n stdnav_gserial = 0;\n\nlet logger = log.register('stdnav');\n\n// Local object definition.\n// The top-level stdnav object is a function. You can get the Effective\n// Navigation Topology for a given element be passing in a jQuery selector,\n// then use that to check what a particular key will do when that element\n// focus/subfocus, like this:\n// var onLeft = stdnav(\"#HomeButton\")[stdnav-left];\n// ...or change it, like this:\n// stdnav(\"#HomeButton\")[stdnav-left]=\"#\";\n// (This example disables the \"left arrow\" key on the HomeButton element,\n// by pointing it to \"#\", or \"self\".)\n//\n// If you call it with no parameters, you interact with the library instance\n// itself. For example, the critical:\n// stdnav.activate();\n\nvar stdnav = function () {\n //logger.debug('JSAM('+selector+\")\\n\");\n stdnav_gserial++;\n this.serial = stdnav_gserial;\n this.menuItemCallbacks = {\n click: {}\n };\n\n // This hash stores navtype plugins. Look up the plugin objects by the\n // navtype string, if you need to tweak one for some reason.\n // For example: var gridPluginObj = root.stdnav.plugins['grid'];\n this.plugins = {};\n\n // this is the object of root elements of active dialogs.\n this.modalDialogRoots = {};\n\n // If set, focus debugging data will be formatted into this element,\n // when it exists, as a simple string. The element will be updated as\n // focus changes. If left null, the system is disabled.\n this.debugElementID=null;\n //this.debugElementID='copyright';\n\n // Number of non-blocking spaces to increment the delta sink area with;\n // these are used to convince Internet Explorer its rendering cache\n // (and therefore its tab order) are out of date and force it to\n // recompute them.\n this.chaffLength=1;\n\n // Maximum length of the rendering cache countermeasure string.\n this.maxChaffLength=8;\n};\n\n$.extend(stdnav.prototype, stdnavEventHandlers, stdnavFocusing, stdnavModalFocusing, stdnavAlerting, stdnavDebugger, {\n // ===LIMITS AND SAFETY BAILOUTS=======================================\n\n // Prevents runaway recursion in case of a jQuery filter bug or other\n // DOM search failure. Keep this value significantly higher than your\n // maximum expected DOM depth.\n _maxNavDepth: 100,\n\n // ===GENERAL-PURPOSE PUBLIC UTILITY FUNCTIONS=========================\n // (NOTE: MOST OF THESE SHOULD BE MOVED TO JQUERY PLUGINS, UTILS, ETC.)\n\n nullOrUndefined: function (koan) {\n if ((koan === null) || (typeof (koan) === 'undefined')) {\n return true;\n }\n return false;\n },\n\n // Like \"$.closest\" but with an additional barrier filter and a maximum\n // number of levels. All ancestors will be searched unless they match\n // the optional jQuery selector \"barrier\", in which case the search\n // stops and returns undefined. If maxdepth is specified and exceeded,\n // the search stops and returns undefined. If maxdepth is zero, only\n // the start is searched. If a match is found, it is returned\n // immediately. If no match is found all the way to the root element,\n // the function returns undefined.\n // NOTE THAT THIS FUNCTION RETURNS A jQuery-WRAPPED ELEMENT.\n closestAncestor: function (start, target, barrier, maxdepth) {\n if ((start === undefined) || (start === null)) {\n // FAILURE, BAD START\n return undefined;\n }\n var iterator = $(start).parent();\n var depth = 1;\n while (iterator !== undefined) {\n if ((maxdepth !== null) && (maxdepth !== undefined) && (depth >= maxdepth)) {\n // FAILURE, RECURSION LIMIT EXCEEDED\n return undefined;\n }\n if (iterator.is(barrier)) {\n // FAILURE, BARRIER DETECTED\n return undefined;\n }\n if (iterator.is(target)) {\n // SUCCESS\n return iterator;\n }\n depth++;\n iterator = iterator.parent();\n }\n // FAILURE, NO ANCESTOR MATCHED CRITERIA\n return undefined;\n },\n\n // Like \"$.closest\" but working down. Returns the first instance of\n // an element matching the jQuery selector \"target\" at or beneath the\n // element passed as \"start\". All children will be recursively searched\n // unless they match the optional jQuery selector \"barrier\". If \"barrier\"\n // is omitted, null, or undefined, no filtering is performed. An optional\n // maximum depth can be specified as \"maxdepth\"; a value of 0 will search\n // nothing, because the starting point is not a solution candidate.\n // Negative values will abort immediately. If this parameter is omitted,\n // null, or undefined, a library default is used.\n // TIPS:\n // - Keep in mind that either selector can use OR or NOT specifiers as\n // usual for jQuery.\n // - \"start\" is never considered a match.\n // - If a node matches the target AND the barrier, it will still be\n // returned. The barrier prevents enumeration of children only, which\n // is why it is named \"barrier\" and not \"filter\".\n // - If no candidate is found, the function returns undefined.\n // - This uses a breadth-first search.\n // NOTE THAT THIS FUNCTION RETURNS A jQuery-WRAPPED ELEMENT.\n closestDescendant: function (start, target, barrier, maxdepth) {\n if ((start === null) || (start === undefined) || (target === null) || (target === undefined)) {\n // Parameters cannot result in a match.\n return undefined;\n }\n\n var effective_maxdepth;\n if ((maxdepth === null) || (maxdepth === undefined)) {\n effective_maxdepth = this._maxNavDepth;\n } else {\n effective_maxdepth = maxdepth;\n }\n\n var search_queue = [];\n\n // Perform a breadth-first search with the \"start\" element as the root.\n // Each iteration of this loop is a different absolute depth level,\n // relative to \"start\".\n\n // FIXME - This algorithm uses a naive queue because the depth is not\n // expected to be large. Replace with a higher-performance queue if\n // one is available, or change this to TODO if no higher-performance\n // queue is available.\n\n var depth = 0,\n items_at_current_depth = 1,\n items_at_next_depth = 0,\n iterator = start,\n enqueueFn = function (index, child) {\n // Enqueue children for search after this level is completed.\n search_queue.unshift(child);\n items_at_next_depth++;\n };\n while (iterator !== undefined) {\n // See if the iterator is the element we're looking for.\n if ($(iterator).is(target) && (depth > 0)) {\n // Success!\n return iterator;\n }\n\n // See if its children should be enqueued for search.\n if (!($(iterator).is(barrier))) {\n var children = $(iterator).children();\n children.each(enqueueFn);\n }\n\n // See if this was our last element at this depth (our next dequeue\n // will be the first one at a lower depth), and swap tracking values\n // if it is.\n if (--items_at_current_depth === 0) {\n depth++;\n items_at_current_depth = items_at_next_depth;\n items_at_next_depth = 0;\n }\n if (depth > effective_maxdepth) {\n // Maximum depth exceeded, no match.\n return undefined;\n }\n // Get the next item to be checked.\n iterator = search_queue.pop();\n }\n // Search space exhausted, no match.\n return undefined;\n },\n\n zinit: function (selector) {\n logger.debug('stdnav.init(' + selector + \")\\n\");\n return this;\n },\n\n // This is the node-to-navtype map. This is used to determine the\n // default navtype for a given element. Since all elements are\n // supported by plugins, this map is initially empty.\n navtype_nodeNames: {},\n\n //ToDo get object from stdnavDebugger.js\n\n // ===LIBRARY-SPECIFIC PUBLIC UTILITY FUNCTIONS========================\n\n // Returns true if the element is navigable.\n isNavigable: function (element) {\n if ($(element).is(this._navigableFilter) && (!$(element).is(this._unnavigableFilter))) {\n return true;\n }\n return false;\n },\n\n // Returns the closest parent or further ancestor that is navigable, or\n // undefined if the element is the shallowest navigable ancestor.\n // NOTE THAT THIS FUNCTION RETURNS A jQuery-WRAPPED ELEMENT.\n closestNavigableAncestor: function (element) {\n return this.closestAncestor(element, this._navigableFilter, this._unnavigableFilter, this._maxNavDepth);\n },\n\n // Returns the closest child or further descendant that is navigable,\n // or undefined if no such descendant exists.\n // NOTE THAT THIS FUNCTION RETURNS A jQuery-WRAPPED ELEMENT.\n closestNavigableDescendant: function (element) {\n return this.closestDescendant(element, this._navigableFilter, this._unnavigableFilter, this._maxNavDepth);\n },\n\n // ===PLUGIN MANAGEMENT FUNCTIONS======================================\n\n // Build the jQuery filters used to rapidly locate navigable elements.\n // This must be redone when plugins are registered.\n _rebuildNavigationFilters: function () {\n // Rebuild the jQuery filter used to determine if a component is\n // navigable. This is a logical OR of all known nodeNames as well as\n // anything with a js-navtype explicitly set. This whitelist is\n // applied first.\n var newFilter = '';\n $.each(this.navtype_nodeNames, function (navtype, nodeNames) {\n $.each(nodeNames, function (index, nodeName) {\n newFilter += nodeName + ',';\n });\n });\n // Note that an element with js-navtype specified is still considered\n // unnavigable if no loaded plugin provides that navtype. However, for\n // performance reasons, that check is only performed if we actually\n // have a candidate element.\n newFilter += '[js-navtype]';\n this._navigableFilter = newFilter;\n\n // Elements matching this filter are never navigable under any\n // circumstances. This blacklist is applied last.\n this._unnavigableFilter = '[js-stdnav=\"false\"],[js-navtype=\"none\"]';\n },\n\n // Registers a new plugin. Must be called by plugins in their AMD\n // loading sequence, NOT in their Activate methods.\n registerPlugin: function (name, plugin) {\n this.plugins[name] = plugin;\n },\n\n // Unregisters a plugin. Only useful if you need to free the memory.\n unregisterPlugin: function (name) {\n this.plugins[name].unload();\n delete this.plugins[name];\n },\n\n // Registers a new navtype. Intended for use by UI control modules,\n // such as JSAM (Jaspersoft Accessible Menus). May be called at any\n // time, but it's probably wise to register all navtypes before\n // calling activate().\n //\n // Parameters:\n // navtype: A string describing the new navigation type.\n // (NOTE: navtypes are NOT case-sensitive)\n // behaviors: An object mapping one or more of the nav actions to\n // new callbacks, targets, or undefined. Note that the\n // value of \"this\" for these callbacks will be the\n // stdnav object.\n // nodeNames: An optional array of HTML node names (element types)\n // that intrinsically imply the navtype. Elements of this\n // type will not require a \"js-navtype\" attribute to leverage\n // the plugin's behavior; it becomes implied by default.\n registerNavtype: function (navtype, behaviors, nodeNames) {\n this.navtypeBehaviors[navtype.toLowerCase()] = behaviors;\n this.navtype_nodeNames[navtype.toLowerCase()] = nodeNames;\n this._rebuildNavigationFilters();\n },\n\n // Unregisters the navtype. May be done at any time, for example, to\n // allow a user preference \"Apply\" to change navigation handlers.\n unregisterNavtype: function (navtype, behaviors) {\n delete this.navtypeBehaviors[navtype.toLowerCase()];\n delete this.navtype_nodeNames[navtype.toLowerCase()];\n this._rebuildNavigationFilters();\n },\n\n // ===PRIMARY ACTIVATION AND INITIALIZATION FUNCTIONS==================\n\n // Loads the library and initializes it. After calling this function,\n // you may register plugins dynamically at any time. When possible,\n // however, plugins should be loaded immediately after calling activate,\n // and before calling stdnav.start(). Calling stdnav.start() is still\n // required to initialize ARIA Live Regions by setting body[aria-busy] to\n // false.\n activate: function () {\n // This is the null behavior hash. Its purpose is only to define valid\n // keys for the hash, but it is also used in some optimized overlays.\n // Any behavior keys used anywhere else MUST exist here.\n this.nullBehavior = {\n 'ariaprep': null,\n 'ariarefresh': null,\n 'click': null,\n 'down': null,\n 'end': null,\n 'enter': null,\n 'exit': null,\n 'fixfocus': null,\n 'fixsubfocus': null,\n 'fixsuperfocus': null,\n 'focusin': null,\n 'focusout': null,\n 'home': null,\n 'hoverin': null,\n 'hoverout': null,\n 'inherit': null,\n 'inheritable': null,\n 'left': null,\n 'mousedown': null,\n 'mouseover': null,\n 'mouseout': null,\n 'mouseup': null,\n 'next': null,\n 'pagedown': null,\n 'pageup': null,\n 'prev': null,\n 'rejoined': null,\n 'right': null,\n 'subfocusin': null,\n 'subfocusout': null,\n 'superfocusin': null,\n 'superfocusout': null,\n 'toggle': null,\n 'touchend': null,\n 'touchstart': null,\n 'up': null\n };\n\n // This is the root \"default\" behaviour hash. These defaults pass\n // everything through to the browser, and are normally overridden\n // with $.extend based on specific node names and stdnav attributes.\n this.defaultBehavior = {\n // 'click': [this, this.basicClick, null],\n 'enter': [this, this.basicEnter, null],\n 'toggle': [this, this.basicToggle, null],\n 'exit': [this, this.basicExit, null],\n 'fixfocus': [this, this.basicFixFocus, null],\n 'fixsubfocus': [this, this.basicFixSubfocus, null],\n 'fixsuperfocus': [this, this.basicFixSuperfocus, null],\n 'focusin': [this, this.basicFocusIn, {\n 'maxdepth': 0\n }],\n 'focusout': [this, this.basicFocusOut, null],\n // By default, overrides in parents should be used (unless those parents\n // have inheritable===false).\n 'inherit': true,\n // By default, allow overrides to apply to any children with inherit===true.\n 'inheritable': true,\n 'rejoined': [this, this.basicRejoined, null],\n 'subfocusin': [this, this.basicSubfocusIn, null],\n 'subfocusout': [this, this.basicSubfocusOut, null],\n 'superfocusin': [this, this.basicSuperfocusIn, null],\n 'superfocusout': [this, this.basicSuperfocusOut, {\n 'ghostfocus': false\n }]\n };\n\n this.navtypeBehaviors = {\n 'block': {},\n 'global': {},\n 'inline': {},\n 'modal': {\n 'next': this._onModalNext,\n 'inherit': false,\n 'inheritable': true\n }\n };\n\n // Initialize state management\n this._refocusing = false;\n this._priorSuperfocus = null;\n this._priorFocus = null;\n this._priorSubfocus = null;\n /*\n this._currentSuperfocus = $('body')[0];\n this._currentSubfocus = $('body')[0];\n $(this._currentSuperfocus).addClass('superfocus');\n $(this._currentSubfocus).addClass('subfocus');\n */\n this._currentSuperfocus = document.activeElement;\n this._currentFocus = document.activeElement;\n this._currentSubfocus = document.activeElement;\n $(this._currentSuperfocus).addClass('superfocus');\n $(this._currentSubfocus).addClass('subfocus');\n\n // Build the jQuery filters used to rapidly locate navigable elements.\n // This must be redone when plugins are registered.\n this._rebuildNavigationFilters();\n\n wrapEventHandlersIntoStdnavAvailabilityAspect(this);\n\n this.$body = $(\"body\");\n\n this._bindFocusEvents();\n this._bindKeyboardEvents();\n this._bindMouseEvents();\n this._bindTouchEvents();\n },\n\n // Initializes ARIA Live Regions and performs final initial static\n // analysis, if any, prior to dynamic monitoring. Finally, forces focus\n // to move to the LAST element found with the CSS class\n // \"stdnavinitialfocus\" (only one should be defined, however).\n // Call this function ONLY when the main DOM has been fully rendered\n // (it's okay if large, slow resources are not yet loaded).\n start: function () {\n // WARNING-- THIS IS *NOT* REDUNDANT WITH TABINDEX VALUES!\n // Do not change this without understanding the accessibility issues\n // involved. It is here to force correct initial browser focus even\n // when screen readers are in use, due to screen reader bugs in ARIA\n // support.\n //\n // If the templates get the tab order correct (which cannot always\n // be done), the above code may not actually result in a focus\n // change. This means the focus events may not be triggered, and\n // as a result, the superfocus and subfocus reevaluation\n // code will not run. Therefore, force a focus change.\n var $initialFocus = $('.stdnavinitialfocus');\n if ($initialFocus.length<1) {\n if (document.activeElement && document.activeElement!=$('body')[0]) {\n $initialFocus=$(document.activeElement);\n } else {\n $initialFocus=$('body').children(\"[tabindex='0']:first\");\n if ($initialFocus.length<1){\n // Give up\n $initialFocus=$('body');\n }\n }\n }\n // Hack for IE11, force a potential visual change\n if (browserDetection.isIE11()) {\n this.forceFocus($('body')[0]);\n $('#IECM').html(' ');\n this._unforceFocus($('body')[0]);\n $('body').blur();\n $('#IECM').html('  ');\n }\n\n //this.forceFocus($initialFocus[$initialFocus.length-1]);\n\n this.updateDebugInfo();\n },\n\n // ===CLEANUP AND SHUTDOWN FUNCTIONS===================================\n\n // Stops dynamic DOM monitoring without unbinding keyboard or mouse\n // events. Presently no effect.\n stop: function () {},\n\n // Unbind the keyboard and mouse handlers.\n deactivate: function () {\n this._unbindTouchEvents();\n this._unbindMouseEvents();\n this._unbindKeyboardEvents();\n this._unbindFocusEvents();\n },\n\n // ===DOM EVENT HANDLERS, EVENT BINDING AND UNBINDING==================\n _bindFocusEvents: function() {\n document.addEventListener('focusin', this._onFocusIn);\n document.addEventListener('focusout', this._onFocusOut);\n },\n\n _bindKeyboardEvents: function () {\n $(document).on('keydown', this._onKeydown);\n // TODO: Evaluate whether focus and blur have better compatibility\n },\n\n _bindMouseEvents: function () {\n this.$body.on('click', this._onClick);\n this.$body.on('dblclick', this._onDblClick);\n this.$body.on('mousedown', this._onMouseDown);\n this.$body.on('mouseover', this._onMouseOut);\n this.$body.on('mouseout', this._onMouseOver);\n this.$body.on('mouseup', this._onMouseUp);\n this.$body.on('mouseover', '[aria-label]', this._onLabeledTagOver);\n },\n\n _bindTouchEvents: function () {\n this.$body.on('touchend', this._onTouchStart);\n this.$body.on('touchstart', this._onTouchStart);\n },\n\n _unbindTouchEvents: function () {\n this.$body.off('touchend', this._onTouchStart);\n this.$body.off('touchstart', this._onTouchStart);\n },\n\n _unbindMouseEvents: function () {\n this.$body.off('click', this._onClick);\n this.$body.off('dblclick', this._onDblClick);\n this.$body.off('mousedown', this._onMouseDown);\n this.$body.off('mouseover', this._onMouseOut);\n this.$body.off('mouseout', this._onMouseOver);\n this.$body.off('mouseup', this._onMouseUp);\n },\n\n _unbindKeyboardEvents: function () {\n $(document).off('keydown', this._onKeydown);\n },\n\n _unbindFocusEvents: function () {\n document.removeEventListener('focusin', this._onFocusIn);\n document.removeEventListener('focusout', this._onFocusOut);\n },\n\n // ===BEHAVIOR ASSEMBLY================================================\n\n // Takes a jQuery element and builds the a behavior overlay hash composed\n // of that element's explicit overrides only.\n // FIXME - Try to come up with a more generic mechanism so this isn't\n // brittle if we add new attributes/overrides. However, this may be\n // complicated by differences in JS and HTML naming conventions in our\n // coding standards. Also, see if we can optimize this by quickly\n // building a js-stdnav-* array/hash.\n _getExplicitBehavior: function (el) {\n var overlay = {};\n if (el.attr('js-stdanv-enter') !== undefined) {\n overlay['enter'] = el.attr('js-stdnav-enter');\n }\n if (el.attr('js-stdanv-exit') !== undefined) {\n overlay['exit'] = el.attr('js-stdnav-exit');\n }\n if (el.attr('js-stdanv-toggle') !== undefined) {\n overlay['toggle'] = el.attr('js-stdnav-toggle');\n }\n if (el.attr('js-stdanv-rejoin') !== undefined) {\n overlay['rejoin'] = el.attr('js-stdnav-rejoin');\n }\n if (el.attr('js-stdanv-up') !== undefined) {\n overlay['up'] = el.attr('js-stdnav-up');\n }\n if (el.attr('js-stdanv-down') !== undefined) {\n overlay['down'] = el.attr('js-stdnav-down');\n }\n if (el.attr('js-stdanv-left') !== undefined) {\n overlay['left'] = el.attr('js-stdnav-left');\n }\n if (el.attr('js-stdanv-right') !== undefined) {\n overlay['right'] = el.attr('js-stdnav-right');\n }\n if (el.attr('js-stdanv-next') !== undefined) {\n overlay['next'] = el.attr('js-stdnav-next');\n }\n if (el.attr('js-stdanv-prev') !== undefined) {\n overlay['prev'] = el.attr('js-stdnav-prev');\n }\n if (el.attr('js-stdanv-inherit') !== undefined) {\n overlay['inherit'] = el.attr('js-stdnav-inherit');\n }\n if (el.attr('js-stdanv-inheritable') !== undefined) {\n overlay['inheritable'] = el.attr('js-stdnav-inheritable');\n }\n return overlay;\n },\n\n // Builds the effective navigation behavior hash for the ancestry of the element,\n // NOT including the element itself.\n //\n // Right now, this includes node/element behavior, navtype behavior, and explicit\n // overrides; it may be more appropriate include only explicit overrides.\n //\n // Traversal stops when any of the following are true:\n // - The iterator has \"inherit='false'\"\n // - The parent has \"inheritable='false'\"\n // - The root is reached\n // - The parent is an IFRAME\n //\n // PERFORMANCE / MEMORY NOTE: RECURSIVE SOLUTION\n _buildParentBehaviorOBSOLETE: function (element) {\n // IMPORTANT - DO NOT \"OPTIMIZE\" THIS BY JUST RETURNING\n // this.defaultBehavior! We need to use a new object, because it gets\n // modified recursively! This code does a deep copy:\n // var compositeBehavior = $.extend(true, {}, this.defaultBehavior);\n\n\n // NOTE: the case where:\n // element.prop('js-stdnav-inherit')==false\n // is ruled out by the caller.\n\n // ABORT CASE: Somehow, element has no parent. Shouldn't happen,\n // but might occur in a testing framework, or detached DOM objects.\n var parentEl = $(element.parent()[0]);\n if (parentEl === undefined) {\n //return compositeBehavior;\n return this.defaultBehavior;\n }\n\n // ALL REMAINING CASES REQUIRE COMPUTATION OF PARENT BEHAVIOR\n // Therefore, we must now determine the parent's immediate behavior, so\n // we can figure out if we should 1) overlay it, and, 2) go further.\n var parentImmediateBehavior = this._buildImmediateBehavior(parentEl);\n\n if (parentImmediateBehavior['inheritable'] === false) {\n // BASE CASE: Parent disallows inheritance by element.\n return this.defaultBehavior;\n }\n\n // ALL REMAINING CASES ALLOW PARENT INHERITANCE\n // (the parent's behavior will be overlayed on the defaults and returned)\n // The remaining variants may or may not allow GRANDPARENT inheritance.\n if ((parentImmediateBehavior['inherit'] === false) || parentEl.is('body,iframe')) {\n // BASE CASE: Parent allows inheritance of itself but disallows inheritance of grandparent.\n // BASE CASE: Parent is BODY; no grandparent to check.\n // BASE CASE: Parent is an IFRAME; treat as document root.\n return $.extend({}, true, this.defaultBehavior, parentImmediateBehavior);\n }\n\n // RECURSIVE CASE\n // Go check the grandparent.\n var grandparentBehavior = this._buildParentBehavior(parentEl);\n // The special option 'inherit' is not, itself, inheritable; override\n // it back to true.\n return $.extend({}, true, grandparentBehavior, parentImmediateBehavior, {\n 'inherit': false\n });\n },\n\n // Builds the effective navigation behavior hash for an element.\n //\n // This is a non-recursive version of the previous approach, to improve\n // performance, reduce stack overhead (critical), improve debugging, and\n // provide a failsafe bailout.\n //\n // The new approach is:\n // - copy the NULL behavior hash to a new object\n // - for each ancestor, build the immediate behavior for that ancestor\n // - use that behavior to fill in ONLY non-NULL elements in the working hash\n // - abort when inherit==false or parent->inheritable==false\n // - also abort if maximum ancestry depth is reached (failsafe)\n // - fill in remaining behavior from defaults hash\n //\n // ...basically, an underlay instead of an overlay.\n //\n // NOTE: This function returns a deep-copy throwaway you can modify at\n // will.\n _buildBehavior: function (element) {\n // Make a copy of the default behavior, or you'll corrupt it! And make\n // sure it's a DEEP copy, or you won't get the arrays and subobjects!\n var behavior = $.extend(true, {}, this.nullBehavior);\n var iter = element;\n var height = 0;\n var immediateBehavior = this._buildImmediateBehavior(iter);\n\n while (height < this._maxNavDepth) {\n // UNDERLAY this node's behavior\n $.each(immediateBehavior, function (key, value) {\n if (key in behavior) {\n if (behavior[key] === null) {\n // This key is known, but has not been seen yet, use the\n // ancestor's value.\n behavior[key] = value;\n }\n // ...else, the key has been overridden by a descendant and this\n // ancestor value is therefore unimportant.\n } else {\n // The key does not yet exist in the behavior hash. This\n // indicates the behavior is missing from the NULL behavior hash,\n // which will cause performance issues. However, it is not fatal,\n // so recover. TEST THIS WITH A BREAKPOINT AND TAG IT DURING\n // PERFORMANCE AUDITS!\n logger.debug(\"StdNav: Key '\" + key + \"' is missing from the NULL-behavior hash\");\n behavior[key] = value;\n }\n });\n if (immediateBehavior['inherit'] === false) {\n // Node does not want to inherit parent behavior, stop search.\n break;\n }\n height++;\n iter = $(iter).parent()[0];\n immediateBehavior = this._buildImmediateBehavior(iter);\n if (immediateBehavior['inheritable'] === false) {\n // Parent is not inheritable, stop search.\n break;\n }\n }\n\n // Fill in any remaining values from the default behavior hash.\n $.each(this.defaultBehavior, function (key, value) {\n if (key in behavior) {\n if (behavior[key] === null) {\n // This key is known, but has not been seen yet, use the\n // default value.\n behavior[key] = value;\n }\n // ...else, the key has been specified in the DOM, and the default\n // value is therefore unimportant.\n } else {\n // The key does not yet exist in the behavior hash. This\n // indicates the behavior is missing from the NULL behavior hash,\n // which will cause performance issues. However, it is not fatal,\n // so recover. TEST THIS WITH A BREAKPOINT AND TAG IT DURING\n // PERFORMANCE AUDITS!\n logger.debug(\"StdNav: Key '\" + key + \"' is defined in defaults but missing from the NULL-behavior hash\");\n behavior[key] = value;\n }\n });\n\n // IMPORTANT! The underlay technique above assigns SHALLOW COPIES.\n // That would be fine if we could count on being able to return a\n // const object, but that's not widely supported yet, so instead, we\n // fix the result into a new object with a deep copy.\n return $.extend(true, {}, behavior);\n },\n\n // Takes a DOM element and builds the \"immediate behavior\"-- the behavior\n // from the node/element type, navtype, and explicit overrides, but NOT\n // the ancestors and defaults.\n _buildImmediateBehavior: function (element) {\n var self = this;\n // Do something sensible if subfocus was unset and we got bad input.\n if (this.nullOrUndefined(element)) {\n return this.defaultBehavior;\n }\n\n var el = $(element);\n\n // Figure out the default navtype for the node/element type.\n var defaultNavtype;\n var nodeName = el.prop('nodeName');\n $.each(this.navtype_nodeNames, function (navigationType, supportedNodeNames) {\n if ($.inArray(nodeName, supportedNodeNames) > -1) {\n if (self.isNavigable(element)) {\n defaultNavtype = navigationType;\n }\n }\n });\n var nodeBehavior = {};\n if (defaultNavtype !== undefined) {\n nodeBehavior = this.navtypeBehaviors[defaultNavtype];\n }\n\n // Determine the navtype explicitly requested, if any.\n // NOTE: Children inherit the resulting _behavior_ of a parent with\n // an explicit navtype; they do not inherit the navtype attribute\n // itself. This means, for example, that a particular child cell in\n // a table or grid can have a navtype that provides special behavior\n // for a few keystrokes but otherwise leaves the rest of the behavior\n // as it was for the higher-level, more complete navtype. While this\n // can also be done by using explicit behavior, using a navtype is\n // more efficient, as the callback lookup does not need to be parsed.\n var navtype = el.attr('js-navtype');\n var navtypeBehavior = {};\n if (navtype !== undefined) {\n navtypeBehavior = this.navtypeBehaviors[navtype.toLowerCase()];\n }\n\n // Get other explicitly-specified behavior for the element, if any.\n var explicitBehavior = this._getExplicitBehavior(el);\n\n // FIXME-- this may be expensive in actual use, consider just checking required tags\n // Return the overlaid \"immediate behavior\" hash.\n return $.extend(true, {\n 'inherit': true\n }, nodeBehavior, navtypeBehavior, explicitBehavior);\n },\n\n // Takes a DOM element and builds the effective navigation behavior hash.\n _buildBehaviorOBSOLETE: function (element) {\n // Do something sensible if subfocus was unset and we got bad input.\n if ((element === undefined) || (element === null)) {\n return this.defaultBehavior;\n }\n var el = $(element);\n // BUILD THE EFFECTIVE BEHAVIOR HASH FROM THE OVERLAYS\n // A. Build the inherited behavior:\n // 1. Start with default behavior (normally none).\n // 2. Overlay any inheritable behavior.\n // B. Build the immediate behavior:\n // 3. Overlay node/element type behavior.\n // 4. Overlay explicit navtype behavior, if specified.\n // 5. Finally, overlay any other explicitly-specified behavior.\n var immediateBehavior = this._buildImmediateBehavior(el);\n var inheritedBehavior = {};\n if (immediateBehavior['inherit'] === true) {\n inheritedBehavior = this._buildParentBehavior(el);\n }\n return $.extend(true, inheritedBehavior, immediateBehavior);\n },\n\n //ToDo get object from stdnavFocusing!\n //ToDo get object from stdnavEventHandlers!\n\n\n\n // ===ACTION LOGIC=====================================================\n\n // Runs the action defined in the effective behavior appropriate for a given element.\n // This function may be called by a testing framework or other automation.\n runAction: function (actionName, element) {\n if (element === null) {\n logger.debug(\"tried to run action '\" + actionName + \"' on null element\");\n return;\n }\n if (typeof (element) === 'undefined') {\n logger.debug(\"tried to run action '\" + actionName + \"' on undefined element\");\n return;\n }\n logger.debug(\"stdnav.runAction(\" + actionName + \", \" + element.nodeName + \"#\" + element.id + \")\");\n var behavior = this._buildBehavior(element);\n if (!this.nullOrUndefined(behavior[actionName])) {\n return this._runActionDesc(behavior[actionName], element);\n }\n },\n\n // Runs the action described by the object provided. Normally called\n // by runAction, which will figure out the behavior appropriate for a\n // given element.\n //\n // 1. A string that specifies the ID of an element to navigate to,\n // preceded by a '#'. The element will be given the focus and/or\n // subfocus, as appropriate. You can also use these special codes:\n // \"##parent\" Parent element.\n // \"##child\" First child element.\n // \"##prev\" Previous sibling element.\n // \"##next\" Next sibling element.\n // These actions come from behavior explicitly specified in the markup.\n // Examples: \"#otherDiv\"\n // \"##parent\"\n //\n // 2. A string that specifies a function to call, the object to call\n // it on, and any optional parameters that can be reasonably\n // specified as substrings, preceded by a '@' if the object name\n // is registered with stdnav, or '@@' if the value of\n // \"data-stdnav-context\" should be used as the object/context.\n // These actions also come from behavior explicitly specified in\n // the markup.\n // Examples: \"@myObj:myFunc('param1', 'param2', 'paramChicken')\"\n // \"@myObj:myFunc\"\n // \"@@myFunc('param1', 'parm2')\"\n // \"@@myFunc\"\n //\n // 3. An array that specifies a context object, callback function,\n // and parameter object (or null). These actions normally come\n // from behavior overalys in StdNav plugins, or default behavior\n // in StdNav itself. While they can be changed dynamically, this\n // is not usually the best approach.\n //\n // 4. If actionDesc is null, no action is taken. However, the event\n // handler that has called this function is expected to NOT stop\n // event propagation in this case. Explicitly specifying null as the\n // event handler-- as opposed to leaving the key out entirely-- tells\n // the system that something other than StdNav is going to handle the\n // event.\n _runActionDesc: function (actionDesc, element) {\n var retval = true, context;\n if ((typeof actionDesc === \"string\") || (actionDesc instanceof String)) {\n // A string can be used to indicate a simple subfocus change to a new\n // element, for example, \"#someOtherDiv\".\n if (actionDesc.substr(0, 1) == \"#\") {\n if (actionDesc == \"##parent\") {\n this.forceFocus($(element).parent());\n } else if (actionDesc == \"##child\") {\n var children = $(element).children();\n if (children.length > 0) {\n this.forceFocus($(element).children()[0]);\n }\n } else if (actionDesc == \"##prev\") {\n var prev = $(element).prev();\n if (prev.length > 0) {\n this.forceFocus($(element).prev()[0]);\n }\n } else if (actionDesc == \"##next\") {\n var next = $(element).next();\n if (next.length > 0) {\n this.forceFocus($(element).next()[0]);\n }\n } else {\n var newEl = $(actionDesc);\n if (newEl !== undefined) {\n this.forceFocus(newEl);\n }\n }\n } else if (actionDesc.substr(0, 1) == '@') {\n var funcName, func, paramstr, colon, lparen, rparen;\n // If no context is specified, use the stdnav instance.\n context = this;\n if (actionDesc.substr(1, 1) == '@') {\n context = $(element).data('stdnav-context');\n } else {\n colon = actionDesc.indexOf(':');\n if (colon > -1) {\n var contextName = actionDesc.substr(0, colon);\n context = this.actionContexts[contextName];\n }\n }\n lparen = actionDesc.indexOf('(');\n if (lparen == -1) {\n funcName = actionDesc.substr(2);\n } else {\n rparen = actionDesc.indexOf(')');\n funcName = actionDesc.substr(2, lparen - 2);\n if (rparen == -1) {\n logger.debug('Bad stdnav action: ' + actionDesc);\n } else {\n paramstr = actionDesc.substr(lparen, rparen - lparen);\n }\n }\n func = context[funcName];\n retval = func.call(context, paramstr);\n }\n } else if (actionDesc instanceof Array) {\n // The format is [context, callback, paramsObject].\n if (actionDesc[1] === undefined) {\n logger.debug(\"undefined actionDesc[1]\");\n }\n context = actionDesc[0];\n if ((context === null) || typeof (context) === 'undefined') {\n context = this;\n }\n var callback = actionDesc[1];\n var params = actionDesc[2];\n if ((params === null) || typeof (params) === 'undefined') {\n params = {};\n }\n retval = callback.call(context, element, params);\n }\n return retval;\n }\n});\n\nfunction isStdnavEnabledForElement(el) {\n var parents = [el, ...$(el).parents()],\n isEnabled;\n\n for (var n = 0; n < parents.length; n++) {\n let attrValue = $(parents[n]).attr('js-stdnav');\n\n if (attrValue === 'true') {\n isEnabled = true;\n } else if (attrValue === 'false') {\n isEnabled = false;\n }\n\n if (_.isBoolean(isEnabled)) {\n break;\n }\n }\n\n return Boolean(isEnabled);\n}\n\nfunction stdnavAvailabilityAroundAspect(invocation, callback, ev) {\n var args = Array.prototype.slice.call(arguments, 2);\n\n if (isStdnavEnabledForElement(ev.target)) {\n return invocation.apply(this, args);\n } else {\n callback && callback.apply(this, args)\n }\n\n logger.debug(\"StdNav is disabled in this subdom, aborting action\");\n}\n\nfunction focusInCallback(ev) {\n $('.subfocus').removeClass('subfocus');\n if (this._priorSubfocus){\n this.runAction('subfocusout', this._priorSubfocus);\n this._priorSubfocus = undefined;\n }\n\n if (this._priorFocus){\n this.runAction('focusout', this._priorFocus);\n // If the control was temporarily made focusable, undo that.\n this._unforceFocus(this._priorFocus);\n this._priorFocus = undefined\n }\n\n $('.superfocus').removeClass('superfocus');\n if (this._priorSuperfocus){\n this.runAction('superfocusout', this._priorSuperfocus);\n this.resumeFocusability(this._priorSuperfocus);\n this._priorSuperfocus = undefined;\n }\n}\n\nvar handlers = [\n {name: \"_onFocusIn\", func: stdnavAvailabilityAroundAspect, callback: focusInCallback},\n {name: \"_onFocusOut\", func: stdnavAvailabilityAroundAspect},\n {name: \"_onKeydown\", func: stdnavAvailabilityAroundAspect},\n {name: \"_onClick\", func: stdnavAvailabilityAroundAspect},\n {name: \"_onDblClick\", func: stdnavAvailabilityAroundAspect},\n {name: \"_onMouseDown\", func: stdnavAvailabilityAroundAspect},\n {name: \"_onMouseOut\", func: stdnavAvailabilityAroundAspect},\n {name: \"_onMouseOver\", func: stdnavAvailabilityAroundAspect},\n {name: \"_onMouseUp\", func: stdnavAvailabilityAroundAspect},\n {name: \"_onLabeledTagOver\", func: stdnavAvailabilityAroundAspect},\n {name: \"_onTouchStart\", func: stdnavAvailabilityAroundAspect}\n];\n\nfunction wrapEventHandlersIntoStdnavAvailabilityAspect(context) {\n var noop = function() {};\n\n _.each(handlers, function(handler) {\n const {name, func, callback} = handler;\n var originalHandler = context[name];\n\n if (originalHandler) {\n context[name] = _.bind(func, context, originalHandler, callback);\n } else {\n context[name] = noop;\n }\n });\n}\n\nexport default new stdnav();\n","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n/* Standard Navigation library (stdnav) extension\n * ------------------------------------\n * Modal focus management handlers\n *\n */\nimport jQuery from 'jquery';\nimport _ from 'underscore';\n\nconst MODAL_TRAP_ELEMENT_TEMPLATE =\n _.template('
');\n\nexport const DIALOG_REFERENCE_ATTRIBUTE = 'js-dialog-reference';\n\nexport default {\n\n // Add special focusable invisible elements before and after modal dialog.\n // When they will receive focus - they will force focus back to the modal dialog:\n // - element before the dialog will force last focusable element of the dialog\n // - element after the dialog will force first focusable element of the dialog (or dialog itself if it's focusable)\n beginModalFocus: function(element) {\n if (!element) {\n return;\n }\n\n const $el = jQuery(element);\n const id = _.uniqueId();\n\n // This should handle the case\n // where two different \"threads\" pop up the same dialog.\n if (this.modalDialogRoots[id]) {\n this.endModalFocus(this.modalDialogRoots[id]);\n }\n\n this.modalDialogRoots[id] = element;\n $el.attr(DIALOG_REFERENCE_ATTRIBUTE, id);\n\n const trapElement = MODAL_TRAP_ELEMENT_TEMPLATE({attrName: DIALOG_REFERENCE_ATTRIBUTE, attrValue: id});\n jQuery(trapElement).insertBefore($el);\n jQuery(trapElement).insertAfter($el);\n },\n\n // Resumes the focusability of all elements in the DOM which do not\n // have the element provided as a parent.\n endModalFocus: function(element) {\n const $el = jQuery(element);\n const id = $el.attr(DIALOG_REFERENCE_ATTRIBUTE);\n if (this.modalDialogRoots[id]) {\n document.querySelectorAll(`[js-navtype='modalTrap'][${DIALOG_REFERENCE_ATTRIBUTE}='${id}']`).forEach(e => e.remove());\n delete this.modalDialogRoots[id];\n }\n },\n}","/*\n * Copyright (C) 2005 - 2022 TIBCO Software Inc. All rights reserved.\n * http://www.jaspersoft.com.\n *\n * Unless you have purchased a commercial license agreement from Jaspersoft,\n * the following license terms apply:\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n */\n\n\n/**\n * @version: $Id$\n */\n\nimport $ from 'jquery';\n\nexport default {\n isMozilla: function () {\n return navigator.appName === \"Netscape\";\n },\n isFirefox: function () {\n return (navigator.userAgent.toLowerCase().indexOf(\"firefox\") !== -1);\n },\n isWebKitEngine: function () {\n return ($.browser && $.browser.webkit);\n },\n isChrome: function () {\n return navigator.userAgent.toLowerCase().indexOf('chrome');\n },\n isIPad: function () {\n return navigator.platform == \"iPad\";\n },\n isIOS: function() {\n return navigator.userAgent.match(/(iPad|iPhone|iPod)/g);\n },\n isAndroid: function () {\n return navigator.userAgent.toLowerCase().indexOf('android');\n },\n isIE: function () {\n return navigator.appName === \"Microsoft Internet Explorer\" || navigator.userAgent.indexOf(\"Trident/\") >= 0 || this.isEdge();\n },\n isIE6: function () {\n return this.isIEVersion(6);\n },\n isIE7: function () {\n return this.isIEVersion(7);\n },\n isIE8: function () {\n return this.isIEVersion(8);\n },\n isIE9: function () {\n return this.isIEVersion(9);\n },\n isIE10: function () {\n return this.isIEVersion(10);\n },\n isIE11: function () {\n return this.isIEVersion(11);\n },\n isEdge: function () {\n if (navigator.appName !== \"Netscape\") {\n return false;\n }\n\n return navigator.userAgent.indexOf(\"Edge/\") >= 0;\n },\n isIEVersion7Upwards: function () {\n return this.getIEVersion() >= 7;\n },\n isIEVersion: function (testVersion) {\n return this.getIEVersion() === testVersion;\n },\n getIEVersion: function () {\n var version = 0; // not IE\n if (this.getIEVersion.version >= 0) {\n return this.getIEVersion.version;\n }\n\n if (this.isIE()) {\n if (navigator.appName === \"Netscape\") {\n var ua = navigator.userAgent;\n var re = new RegExp(\"Trident/.*rv:([0-9]{1,}[\\\\.0-9]{0,})\");\n if (re.exec(ua) != null) {\n version = parseFloat(RegExp.$1);\n }\n } else {\n var msVersion = navigator.appVersion.split(\"MSIE\")[1];\n version = parseFloat(msVersion);\n }\n }\n\n this.getIEVersion.version = version;\n return version;\n }\n}\n","\n import {store, MERGED_BUNDLES_NAME} from 'bundleStore';\n \n let bundle;\n \n if ('jasperserver_messages' !== MERGED_BUNDLES_NAME) {\n store['jasperserver_messages'] = store['jasperserver_messages'] || {};\n bundle = store['jasperserver_messages'];\n } else {\n bundle = Object.keys(store).reduce((acc, key) => {\n return {\n ...acc,\n ...store[key]\n }\n }, {});\n }\n \n export default bundle;\n ","\n import {store, MERGED_BUNDLES_NAME} from 'bundleStore';\n \n let bundle;\n \n if ('jsexceptions_messages' !== MERGED_BUNDLES_NAME) {\n store['jsexceptions_messages'] = store['jsexceptions_messages'] || {};\n bundle = store['jsexceptions_messages'];\n } else {\n bundle = Object.keys(store).reduce((acc, key) => {\n return {\n ...acc,\n ...store[key]\n }\n }, {});\n }\n \n export default bundle;\n "],"sourceRoot":""}